JP7390788B2 - Image encoding device and its control method and program - Google Patents
Image encoding device and its control method and program Download PDFInfo
- Publication number
- JP7390788B2 JP7390788B2 JP2018238646A JP2018238646A JP7390788B2 JP 7390788 B2 JP7390788 B2 JP 7390788B2 JP 2018238646 A JP2018238646 A JP 2018238646A JP 2018238646 A JP2018238646 A JP 2018238646A JP 7390788 B2 JP7390788 B2 JP 7390788B2
- Authority
- JP
- Japan
- Prior art keywords
- interest
- encoding
- quantization
- line
- coefficients
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 87
- 238000013139 quantization Methods 0.000 claims description 93
- 230000008569 process Effects 0.000 claims description 42
- 230000009466 transformation Effects 0.000 claims description 42
- 238000012937 correction Methods 0.000 claims description 16
- 238000006243 chemical reaction Methods 0.000 claims description 14
- 230000004048 modification Effects 0.000 claims description 6
- 238000012986 modification Methods 0.000 claims description 6
- 230000002441 reversible effect Effects 0.000 claims description 5
- 230000001131 transforming effect Effects 0.000 claims description 2
- 238000004590 computer program Methods 0.000 claims 1
- 238000012545 processing Methods 0.000 description 19
- 230000006835 compression Effects 0.000 description 8
- 238000007906 compression Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 239000000872 buffer Substances 0.000 description 5
- 230000006866 deterioration Effects 0.000 description 4
- 239000012536 storage buffer Substances 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000002427 irreversible effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 230000002194 synthesizing effect Effects 0.000 description 1
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Description
本発明は画像データの圧縮符号化技術に関するものである。 The present invention relates to a compression encoding technique for image data.
従来から、顔認識などで抽出された領域や、像域分離により分離された文字・線画領域を注目領域:ROI(Region of Interest)として特定し、ROI以外の領域の符号量を削減し、圧縮する技術が様々知られている。ROIの圧縮技術として、より簡易なものは、画像をタイルなどの矩形領域に分割し、ROI領域が含まれる矩形領域とそれ以外の矩形領域で画質を変える方法が知られている。国際標準符号化方式であるJPEG2000を用いて、このようなROI符号化を実現する方法は特許文献1に記載されている。
Conventionally, regions extracted by face recognition, etc., and character/line drawing regions separated by image region separation are identified as regions of interest (ROI), and the amount of code in regions other than the ROI is reduced and compressed. Various techniques are known to do this. As a simpler ROI compression technique, a method is known in which an image is divided into rectangular regions such as tiles, and the image quality is changed between the rectangular regions that include the ROI region and the other rectangular regions. A method for realizing such ROI encoding using JPEG2000, which is an international standard encoding method, is described in
さらに、JPEG2000では、離散ウェーブレット変換(DWT:Discrete wavelet transform)を用い、ROIに含まれるDWT変換係数をビットシフトするマックスシフト法と呼ばれる方式により画素単位でROI領域を特定し符号化する方法が知られている。この仕組みを使ったROI符号化を実現する方法は特許文献2に記載されている。
Furthermore, in JPEG2000, there is a method known for identifying and encoding the ROI region pixel by pixel using a method called the max shift method, which bit-shifts the DWT transform coefficients included in the ROI using discrete wavelet transform (DWT). It is being A method for realizing ROI encoding using this mechanism is described in
ROI符号化といっても、ROI領域もある程度の画質劣化を許容できる場合と、ROI領域はロスレス圧縮する方が望ましい場合とがある。 Although it is referred to as ROI encoding, there are cases in which a certain degree of image quality deterioration can be tolerated in the ROI region, and cases in which it is desirable to perform lossless compression on the ROI region.
たとえば、文字・線画領域は劣化により認識できなくなる恐れがあり、ロスレス圧縮することが望ましい。あるいは、複数のカメラで撮影された人物の多視点映像から自由視点画像を合成する場合には、被写体の詳細について対応点を取る必要があり、各カメラの撮影画像における自由視点画像合成の対象物の領域はロスレス圧縮とすることが望ましい。 For example, text/line drawing areas may become unrecognizable due to deterioration, so it is desirable to perform lossless compression. Alternatively, when synthesizing a free-viewpoint image from multi-viewpoint videos of a person shot by multiple cameras, it is necessary to take corresponding points for details of the subject, and the target of free-viewpoint image synthesis in the images shot by each camera It is desirable to use lossless compression for the area.
しかしながら、ROI領域のロスレス圧縮を想定すると、あらかじめ決められた矩形領域を単位としてROI符号化を行うような従来技術では、符号データの削減が困難である。なぜなら、矩形領域サイズに対して重要領域が小さい場合には、ロスレス圧縮と判定される矩形領域が大きくなり、ROI領域外のデータもロスレス圧縮されてしまうため、符号量を小さくすることが難しい。逆に、ROI領域として設定可能な最小領域サイズに合わせて矩形領域サイズを決定すると、各矩形領域に付随するヘッダデータが符号量全体に占める割合が大きくなりすぎるため、やはり符号量を小さくすることが難しくなる。矩形領域サイズをある程度の大きさに限定し、ライン単位で量子化ステップを制御することも可能である。しかし、その場合は、高さ方向のみの制御になり、矩形領域の高さと重要領域の高さが同じになると、その矩形領域をロスレス圧縮することになり、符号量を小さくすることができない。 However, assuming lossless compression of the ROI region, it is difficult to reduce encoded data using conventional techniques that perform ROI encoding in units of predetermined rectangular regions. This is because if the important region is small relative to the rectangular region size, the rectangular region determined to be losslessly compressed becomes large, and data outside the ROI region is also losslessly compressed, making it difficult to reduce the amount of code. Conversely, if the rectangular area size is determined according to the minimum area size that can be set as the ROI area, the header data accompanying each rectangular area will occupy too much of the total code amount, so it is still necessary to reduce the code amount. becomes difficult. It is also possible to limit the rectangular area size to a certain size and control the quantization step on a line-by-line basis. However, in that case, control is performed only in the height direction, and if the height of the rectangular area and the height of the important area become the same, the rectangular area will be losslessly compressed, making it impossible to reduce the amount of code.
一方、JPEG2000のマックスシフト法により、画素単位でROI領域を決定すると、符号データの無駄は生じない。しかし、係数全体をビットシフトして、ROI領域以外の下位ビットを削除することは、2のn乗の量子化に相当し、ロッシー領域の画質を細かく制御できないという課題がある。さらに、ROIが設定されたタイルはデコード時に、シフトした分だけ戻す処理が必要になるため、ROIが設定されているタイルとそうではないタイルでデコード処理が異なってしまうという課題もある。 On the other hand, if the ROI region is determined pixel by pixel using the JPEG2000 max shift method, no code data is wasted. However, bit-shifting the entire coefficient and deleting lower bits outside the ROI region corresponds to quantization of 2 to the nth power, and there is a problem in that the image quality of the lossy region cannot be precisely controlled. Furthermore, when decoding a tile to which an ROI has been set, it is necessary to perform processing to return the shifted amount, so there is a problem in that the decoding process is different between tiles with an ROI and tiles without such a setting.
本発明は、かかる課題に鑑み成されたものであり、注目領域を含む画像データを、その注目領域については高画質を維持しつつ、且つ、注目領域外の符号量制御を可能にするだけでなく、注目領域、注目領域外を同じアルゴリズムで効率よく復号可能な符号化データを生成させる技術を提供しようとするものである。 The present invention has been made in view of the above problems, and it is possible to maintain high image quality of image data including a region of interest while controlling the amount of code outside the region of interest. Rather, the aim is to provide a technique for generating coded data that can be efficiently decoded using the same algorithm for both the region of interest and the outside of the region of interest.
この課題を解決するため、例えば本発明の画像符号化装置は以下の構成を備える。すなわち、
画像符号化装置であって、
符号化対象画像データにおける注目領域を設定する設定手段と、
前記符号化対象画像データに対し可逆なフィルタを用いてウェーブレット変換を行うことで、複数のサブバンドを得る変換手段と、
前記変換手段で得た各サブバンドに含まれる係数を、ライン単位に量子化パラメータに従って量子化する量子化手段と、
量子化して得た各サブバンドの量子化後の係数を、ライン単位にエントロピー符号化し、前記量子化パラメータを特定する情報が付加された符号化データを生成する符号化手段と、
前記量子化手段及び符号化手段を制御する制御手段とを有し、
前記制御手段は、サブバンド毎に、
係数で構成される着目ラインが、前記注目領域内の画素を参照して生成された係数を含むか否かを判定する判定手段と、
前記量子化手段で得た量子化後の係数を修正する修正手段とを含み、
前記制御手段は、
前記判定手段が、前記着目ラインが前記注目領域内の画素を参照して生成された係数を含まないと判定した場合、前記量子化手段に対して前記着目ラインの各係数を前記量子化パラメータで量子化するよう制御すると共に、前記符号化手段に対して前記量子化パラメータを特定する情報を含む符号化データを生成させ、
前記判定手段が、前記着目ラインが前記注目領域内の画素を参照して生成された係数を含むと判定した場合、前記量子化手段に対し、前記着目ラインの係数のうち前記注目領域内の画素を参照して生成された係数に対してはその値を維持し、前記注目領域内の画素を参照しないで生成された係数に対しては前記量子化パラメータで量子化するよう制御し、且つ、前記修正手段に対して、前記量子化手段で得た量子化後の係数を前記量子化パラメータで逆量子化させることで修正させ、前記符号化手段に対して前記着目ラインに対して量子化ステップ幅が"1"であることを表す情報を含む符号化データを生成させることを特徴とする。
In order to solve this problem, for example, the image encoding device of the present invention has the following configuration. That is,
An image encoding device,
a setting means for setting a region of interest in image data to be encoded;
Transforming means for obtaining a plurality of subbands by performing wavelet transformation on the encoding target image data using a reversible filter;
quantization means for quantizing the coefficients included in each subband obtained by the conversion means on a line-by-line basis according to a quantization parameter;
encoding means for entropy encoding the quantized coefficients of each subband obtained by quantization on a line-by-line basis to generate encoded data to which information specifying the quantization parameter is added;
and a control means for controlling the quantization means and the encoding means,
The control means, for each subband,
determining means for determining whether a line of interest made up of coefficients includes a coefficient generated with reference to pixels in the region of interest;
correction means for correcting the quantized coefficients obtained by the quantization means,
The control means includes:
If the determining means determines that the line of interest does not include a coefficient generated by referring to pixels within the region of interest, the determining means causes the quantizing means to calculate each coefficient of the line of interest using the quantization parameter. controlling the quantization and causing the encoding means to generate encoded data including information specifying the quantization parameter;
If the determining means determines that the line of interest includes a coefficient generated by referring to the pixel within the region of interest, the determining means instructs the quantizing means to determine which of the coefficients of the line of interest includes the coefficient generated by referring to the pixel within the region of interest. The coefficients generated by referring to the pixel in the region of interest are controlled to maintain their values, and the coefficients generated without referring to the pixels in the region of interest are quantized using the quantization parameter, and , the correction means corrects the quantized coefficients obtained by the quantization means by inversely quantizing them using the quantization parameter, and the encoding means quantizes the line of interest. The method is characterized in that encoded data including information indicating that the step width is "1" is generated.
本発明によれば、注目領域を含む画像データを、その注目領域については高画質を維持しつつ、且つ、注目領域外の符号量の制御を可能にするだけでなく、注目領域、注目領域外を同じアルゴリズムで効率よく復号可能な符号化データを生成することができる。 According to the present invention, image data including a region of interest can be processed while maintaining high image quality for the region of interest, as well as controlling the amount of code outside the region of interest. It is possible to generate encoded data that can be efficiently decoded using the same algorithm.
以下、添付図面に従って本発明に係る実施形態を詳細に説明する。なお、以下の実施形態は本発明を限定するものではなく、また、本実施形態で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。なお、同一の構成については、同じ符号を付して説明する。 DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. Note that the following embodiments do not limit the present invention, and not all combinations of features described in the present embodiments are essential to the solution of the present invention. Note that the same configurations will be described using the same reference numerals.
[第1の実施形態]
図1(a)は本実施形態における注目領域(ROI: Region Of Interest)を含む画像の符号化を行う画像符号化装置のブロック構成図である。この画像符号化装置は、CPU101、入力部102、ROI設定部103、符号データ生成部104、表示部105、メモリ106、及び、蓄積部107を有する。
[First embodiment]
FIG. 1A is a block configuration diagram of an image encoding apparatus that encodes an image including a region of interest (ROI) in this embodiment. This image encoding device includes a
CPU101は、各構成の処理にかかわり、装置全体の制御を司る。入力部102は、ユーザからの指示や、符号化対象の画像データなどを入力する。このため、入力部102は、キーボードやマウスなどのポインティングデバイスを含み、画像データを入力するためのインターフェースをふくむ。ROI設定部103は、符号化対象の画像データ中の注目領域ROIを設定する。符号データ生成部104は、符号化対象の画像データが有する画素値に対し、離散ウェーブレット変換(DWT:Discrete Wavelet Transform)を実行し、得られたDWT変換係数を、ランレングス符号化と予測符号化のいずれかを適宜切り替えて符号化する(詳細後述)。表示部105は、通常は液晶ディスプレイなどが用いられる。メモリ106は、ROM、RAMで構成され、CPU101が実行するプログラムや各種パラメータの格納、並びに、CPU101のワークエリアとして使用される。蓄積部107は、画像データ、プログラムなどを蓄積する部分で、通常はハードディスクなどが用いられる。また、後述するフローチャートの処理に必要な制御プログラムは、蓄積部107に格納されているか、メモリ106のROMに格納されているものとする。蓄積部107に格納されている場合は、CPU101は、一旦メモリ106内のRAMにそのプログラムを読み出して実行される。なお、システム構成については、上記以外にも様々な構成要素が存在するが、本発明の主眼ではないので、その説明は省略する。
The
実施形態の符号データ生成部104は、符号化対象の画像データをDWTし、得られたDWT変換係数を量子化し、符号化する。そして、符号化対象の画像データにおけるROI内の画素をロスレス(可逆)符号化し、ROI外の画素はロッシー(非可逆)符号化する。このため、ウェーブレット変換では可逆な5-3タップのDWTフィルタを用いるものとするが、フィルタの種類やサイズはこれに限定されるものでない。ROI内の画素をロスレス符号化するためには、ROI内の画素を参照して生成されたDWT変換係数をロスレス符号化すればよい。言い換えれば、フィルタが持つ5入力の少なくとも1つが、ROIの画素データを入力した場合、そのフィルタで算出されるDWT変換係数をロスレス符号化する。そして、ROI内の画素を参照しないで生成されたDWT変換係数についてはロッシー符号化を許容する。
The encoded
図1(b)は、符号データ生成部104のブロック構成図である。符号データ生成部104は、DWT部110、量子化部111、符号化方式選択部112、ランレングス符号化部113、予測符号化部114、符号列生成部116、及び、スイッチ109、110を含む。
FIG. 1(b) is a block diagram of the code
DWT部110は、符号化対象の画像データを1ライン単位に入力し、その入力したライン(以下、注目ラインという)に含まれる各画素に対してDWTフィルタを用いてDWTを行い、複数のサブバンドを生成する。
The
量子化部111は、ROI領域設定部103から供給されるROI領域情報を参照して、注目サブバンド内の注目ラインがROI内の画素を参照して生成されたDWT変換係数を含むか否かを判定する。なお、以降、DWT変換係数を単に変換係数と呼ぶ。そして、ROI内(注目領域内)の画素を参照して生成されたDWT変換係数をROI参照変換係数と記し、ROI内の画素を参照しない、すなわち、DWTフィルタに入力される全画素がROI外の画素であった場合に生成されたDWT変換係数をROI非参照変換係数と呼ぶ。
The
注目ラインがROI参照変換係数を含まない場合、量子化部111は、予め設定された量子化パラメータに従って注目ラインより得た全サブバンドの変換係数を量子化し、量子化後の変換係数を、スイッチ109を介して符号化方式選択部112に供給する。
If the line of interest does not include ROI reference transform coefficients, the
一方、注目ラインがROI参照変換係数を含む場合、量子化部111は設定された量子化パラメータに従って注目ラインより得た全サブバンドの変換係数のうち、ROI参照変換係数については量子化ステップ“1”で量子化(量子化しないのと等価)し、ROI非参照変換係数については予め設定された量子化パラメータに従って量子化する。そして、量子化部111は、得られた量子化後の変換係数を、スイッチ109を介して、係数修正部120に供給する。
On the other hand, when the line of interest includes ROI reference transform coefficients, the
係数修正部120は、ROI情報に基づき、量子化部111から供給された、注目ラインの変換係数のうち、ROI非参照変換係数を修正する。具体的に説明すると、係数修正部120は、量子化部111から供給された、ROI参照変換係数はその値を維持し、ROI非参照変換係数については逆量子化する。この結果、注目ラインから得た各サブバンドの変換係数のうち、ROI参照変換係数はDWTの直後の値のままとなり、可逆性が維持される。また、ROI非参照変換係数は量子化ステップ値に依存した誤差を含むので非可逆となるものの、DWTで得た係数のレベルまで復元した値となり、符号化効率に寄与したデータとすることができる。
The
なお、注目ラインの変換係数の符号化データを生成するとき、ライン単位に量子化パラメータを示す情報がそのラインの符号化データもヘッダに格納される。このため、係数修正部120を経た変換係数の符号化データのヘッダには、量子化ステップ幅が“1”であることを示す情報が格納される。また、係数修正部120を経ない、変換係数の符号化データのヘッダには、設定された量子化パラメータを示す情報が格納されることになる。
Note that when generating encoded data of transform coefficients of a line of interest, information indicating a quantization parameter for each line is also stored in the header of the encoded data of that line. Therefore, information indicating that the quantization step width is "1" is stored in the header of the encoded data of the transform coefficients that has passed through the
符号化方式選択部112は、変換係数ごとに、ランレングス符号化部113または、予測符号化部114のいずれかに出力する。ランレングス符号化部113、予測符号化部114は、それぞれに応じた符号化処理を行い、生成した符号データを、符号データ出力部115内のバッファ115aに格納する。すべてのサブバンドの変換係数の符号データがバッファ115aに格納されると、符号列生成部116は、その符号化データを所定の順に並べて、符号化列(符号ストリーム)として成形し、出力する。
Coding
本実施形態では、説明を単純化するため、符号化対象の画像データは単一成分(例えば輝度)で表され、1画素当たり8ビットで表されるモノクロ多値画像データとして説明する。ただし、1画素のビット数が10ビット、12ビット、14ビットなど8ビット以外のビット数で輝度値を表現している画像データにも適用できる。また、1画素が、RGBやCMYKなどの複数の色成分で構成される場合には、成分毎に分離した画像データを符号化対象とすればよいので、符号化対象がモノクロ多値画像データに限定されるものではない。1画素8ビットで、モノクロ多値画像データとするのは、あくまで例示であると理解されたい。 In this embodiment, in order to simplify the explanation, the image data to be encoded will be explained as monochrome multivalued image data expressed by a single component (for example, luminance) and expressed by 8 bits per pixel. However, it can also be applied to image data in which the brightness value is expressed using a bit number other than 8 bits, such as 10 bits, 12 bits, 14 bits, etc., for each pixel. Furthermore, when one pixel is composed of multiple color components such as RGB and CMYK, the image data separated for each component can be encoded, so the encoding target is monochrome multi-valued image data. It is not limited. It should be understood that the monochrome multivalued image data with 8 bits per pixel is merely an example.
次に、実施形態における符号データ生成部104における画像の符号化処理を図2のフローチャートを参照して説明する。
Next, image encoding processing in the encoded
S201にて、符号データ生成部104は、入力部102より入力された符号化対象画像の水平方向の画素数Wと垂直方向の画素数Hを取得する。符号化対象の画像データが撮像素子から得られた画像データの場合には、その撮像素子の解像度(水平、垂直方向画素数)を示す情報をCPU101が、符号データ生成部104に設定すればよい。また、符号化対象画像データが、ファイル形式で保存されていれば、CPU101は、そのファイルヘッダから、W,Hの情報を取得し、符号データ生成部104に設定すればよい。
In S201, the code
S202にて、符号データ生成部104は、ROI設定部103からROI領域情報(ROIの形状、位置を示す情報)を取得する。ROI領域の特定法は、本願の主眼ではなく、如何なる手法を採用しても良い。例えば、入力部102から入力された画像から文字・線画領域や顔、特定の物体などの自動検出結果をROI領域として自動的に取得してもよい。あるいは、マウスなどを使ってユーザが指定した任意の閉領域をROI領域として取得してもよい。本実施形態においてはあらかじめ学習した特定の物体の自動検出結果をROI領域として取得するものとし、図3(a)の領域301がROI領域として取得されたものとする。
In S202, the code
S203にて、符号データ生成部104は、DWTの実行回数と、DWTによって得られる各サブバンドを量子化する際の量子化ステップ値を特定する量子化パラメータを取得する。これらの値は、ユーザが予め入力部102により設定するものとする。サブバンド数は、『DWTの実行回数×3+1』で求めることができる。本実施形態ではDWTの実行回数は“2”としている。したがって、生成されるサブバンドの数は、図3(b)に示すように、2LL,2HL,2LH,2HH,1HL,1LH,1HHの計7つとなる。また、それらのサブバンドそれぞれに対して図4(a)に示す量子化ステップ値が決められており、符号データ生成部104は、これらの値を取得する。また、符号データ生成部104は、DWTの実行回数とDWTフィルタサイズに基づき、変換係数がROI参照変換係数、ROI非参照変換係数のいずれであるかを判定する。
In S203, the code
S204にて、符号データ生成部104は、符号化対象の画像データの垂直方向の位置を示すカウンタyに“0”を代入し、初期化する。実施形態では、符号化対象の画像の垂直方向の画素数をHとしているので、カウンタyの値は0~H-1の範囲を取り得ることになる。
In S204, the encoded
S205にて、符号データ生成部104は、y行目の1ライン分の画像データをDWT部110内のラインバッファ(不図示)に取得する。
In S205, the code
そして、S206にて、符号データ生成部104はDWT部110を制御し、ラインバッファに格納された画像データに対してJPEG2000で採用されている整数型フィルタである、5-3タップフィルタを用いて、DWTを2回実行する。一般に、2次元DWTは1次元DWTを変換対象の画像の水平・垂直方向にそれぞれ適用することで実現できる。なお、水平方向のDWTは1ライン分の画像データに対して実行できるが、垂直方向のDWTを行う場合には、フィルタのサイズとDWTの実行回数に依存したライン数の画像データが必要なる。つまり、実際には、DWT部110には、その容量のバッファメモリを有し、入力したラインに対して或る程度遅延してDWTを実行し、その結果を出力することになる。ここでは、単純化するため、1ライン分の画像データが入力されるたびに、そのラインから7つのサブバンドの変換係数が得られものとして説明を継続する。
Then, in S206, the code
S207にて、符号データ生成部104は、y行、すなわち、注目ラインの画像データから得た変換係数内に、ROI参照変換係数があるか否かを判定する。注目ラインの変換係数内にROI参照変換係数が存在すると判定した場合、符号データ生成部104は処理をS215に進め、ROI用の符号化処理を実行する。このS215に処理が進むのが、図1(b)における、量子化部111による量子化で得た変換係数がスイッチ109を介して係数修正部120に供給される場合に相当することになる。
In S207, the code
一方、注目ラインから得た変換係数内にROI参照変換係数が無いと判定した場合、すなわち、全変換係数がROI非参照変換係数である場合、符号データ生成部104は、処理をS209へ進める。本実施形態の場合、図3(a)からもわかるように、最初の数ラインはROI領域外であるので、初期段階の数ラインの符号化では、S207からS209に分岐する。このS209に処理が進むのが、図1(b)における、量子化部111による量子化で得た変換係数が、ダイレクトに(係数修正部120の介在無し)、符号化方式選択部112に供給される場合に相当する。
On the other hand, if it is determined that there is no ROI-referenced transformation coefficient among the transformation coefficients obtained from the line of interest, that is, if all the transformation coefficients are ROI-non-referenced transformation coefficients, the code
S209にて、符号データ生成部104は、サブバンドのカウンタsに“0”を代入して初期化する。本実施形態では、2LL乃至1HHの7つのサブバンドに対して、それぞれカウンタsの値“0”~“6”が割り当てられているものとする。また、カウンタsが示すサブバンドを単にサブバンドsと表記する。
In S209, the code
S210にて、符号データ生成部104は、量子化部111を制御し、サブバンドsの変換係数を、S203で取得した、対応する量子化ステップを使って量子化する。
In S210, code
S211にて、符号データ生成部104は、サブバンドsの量子化ステップ幅を示す情報を、サブバンドsの符号データのヘッダに付加するため、符号データ出力部115内に予め確保されたサブバンドs用の一時保存バッファにその情報を格納する。
In S211, the code
S212にて、符号データ生成部104は、S210で生成されたサブバンドsの量子化後の変換係数について、ランレングス符号化部113、予測符号化部114のいずれを用いるかの判定を行い、その判定結果に基づいて選択された符号化部を用いて符号化を行わせる。選択された符号化部は、生成した符号化データを、符号データ出力部115内のサブバンドsのヘッダに後続するように格納する。
In S212, the code
ここで、符号データ出力部115内に確保される各サブバンドの符号データ一時保存バッファは、図4(b)に示すように、ラインの量子化ステップ幅を示す情報に続けて、そのラインの変換係数の符号データが保存される。そして、先頭ラインから最終ラインまで、量子化ステップ幅と符号データの組み合わせが順に保存されていく。このS212の符号化処理の詳細は、図7を参照して後述する。
Here, as shown in FIG. 4(b), the code data temporary storage buffer for each subband secured in the code
S213にて、符号データ生成部104は、サブバンドカウンタsに“1”を加算し、更新する。S214にて、符号データ生成部104は、カウンタsとサブバンドの総数『1+(DWT回数×3)』を比較する。sがサブバンド総数と同じであれば、注目ラインに対する全サブバンドの符号化が終了したことになるので、処理をS216に進める。また、符号データ生成部104は、sとサブバンド総数が異なる場合、残りのサブバンドの符号化を行うため、処理をS210に戻す。
In S213, the code
S216にて、符号データ生成部104は、ラインカウンタyに“1”を加算し更新する。そして、S217にて、符号データ生成部104は、ラインカウンタyと画像の高さHを比較する。yとHが一致していれば、全ラインについての符号化処理を終えたことになるので、処理をS218へ進める。yとHが不一致の場合、符号データ生成部104は処理をS205へ戻し、次のラインを処理する。
In S216, the code
S218にて、符号データ生成部104は、符号列生成部116を制御し、各サブバンドの符号データを、あらかじめ決められた順に並べ、符号化データ列(ストリーム)を成形及び出力を行い、このフローを終了する。本実施形態では、図4(b)に示すように、低周波サブバンドから順に並べた符号化データ列が生成、出力される。
In S218, the code
次に、S215の処理を図5のフローチャートを参照して説明する。 Next, the process of S215 will be explained with reference to the flowchart of FIG.
S501にて、符号データ生成部104は、ROI内の画素を参照して生成された変換係数を識別するための、ロスレス係数位置情報P(s, x)を生成する。このロスレス係数位置情報P(s,x)における、sがサブバンドを、xが水平方向の位置を表す。符号データ生成部104は、サブバンドs、水平方向xに位置する変換係数が、ROI参照変換係数であれば“1”を、そうでなく、ROI非参照変換係数であれば“0”の値を持つP(s, x)を生成する。
In S501, the code
S502にて、符号データ生成部104は、予め決められた量子化対象とするサブバンド番号の最小値Nを取得する。このNは、CPU101によって符号データ生成部104に設定されるものであり、本実施形態ではN=4であるとする。つまり、分解レベル1(最大解像度)の高周波サブバンド1HL(サブバンド番号4), 1LH(サブバンド番号5), 1HH(サブバンド番号6)のDWT変換係数が量子化対象となる。
In S502, the code
S503にて、符号データ生成部104は、カウンタsにゼロを代入し、初期化する。なお、カウンタsが示すサブバンドを単にサブバンドsとも表記する。S504にて、符号データ生成部104は、カウンタsとNとを比較することで、サブバンドsの変換係数が量子化対象かどうかを判定する。符号データ生成部104は、カウンタsがS502で取得したN以上であれば量子化対象と判定し、処理をS505へ進む。そうでなければ、符号データ生成部104は、処理をS506に進める。
In S503, the code
S505にて、符号データ生成部104は、係数修正部120を制御し、注目ラインから得たサブバンドsの変換係数のうちROI非参照変換係数の修正を行う。このROI非参照変換係数の修正方法については、図6のフローを用いて、後に詳しく説明する。
In S505, the code
S506にて、符号データ生成部104は、サブバンドsの注目ラインの変換係数を量子化する際に用いる量子化ステップ幅“1”をそのヘッダに格納するため、符号データ出力部115内のサブバンドsの符号データ一時保存バッファに出力する。次のS507にて、符号データ生成部104は、サブバンドsの変換係数を符号化する。この処理の詳細は図7を用いて後述する。S508にて、符号データ生成部104は、サブバンドのカウンタsに“1”を加算し更新する。そして、S509にて、符号データ生成部104は、サブバンド番号sとサブバンド総数『1+(DWTの実行回数×3)』を比較する。両者が一致すれば、すべてのサブバンドについて符号化が終了したことになるので、符号データ生成部104は、このフローを終了する。一方、不一致である場合、符号データ生成部104は、処理をS504に戻し、他のサブバンドの符号化を行う。
In S506, the code
次に、図6のフローを参照して、図5のS505の非ロスレス符号化するROI非係数の修正処理について説明する。 Next, with reference to the flowchart in FIG. 6, the correction processing of ROI non-coefficients to be non-losslessly encoded in S505 in FIG. 5 will be described.
S601にて、符号データ生成部104は、注目サブバンドの1ラインのDWT変換係数の個数sWを取得する。DWT変換係数の数は、サブバンド番号毎に異なっており、DWTにより分割する画素、またはDWT変換係数の数Xの1/2になる。ただし、DWTをかける画素またはDWT変換係数の数Xが奇数の時には、サブバンドLH、LLは、(X+1)/2となり、サブバンドHL、HHは(X-1)/2となる。
In S601, the code
S602にて、符号データ生成部104は、カウンタsXに“0”を代入することで初期化する。S603にて、S501で生成したロスレス係数位置情報P(s、sX)を参照し、その値が“1”であるかどうかを判定する。“1”であれば、sX番目の変換係数[sX]はROI参照変換係数であり、修正は行わない。それ故、符号データ生成部104は、処理をS605に進める。
In S602, the code
一方、P(s、sX)が“0”であった場合、sX番目の変換係数[sX]はROI非参照変換係数であることになる。それ故、符号データ生成部104は処理をS604に進める。このS604にて、符号データ生成部104は、sX番目の変換係数[sX]を、S204で取得した量子化ステップ幅に従った丸め処理を行う。具体的には、符号データ生成部104は、変換係数[sX]を量子化ステップ幅で量子化して得た値を、同量子化ステップ幅で逆量子化する。そして、符号データ生成部104は、その逆量子化で得た変換係数を、sX番目の新たな変換係数[sX]として出力する。なお、このS604を経て得られる変換係数は、用いる量子化ステップは幅が大きいほど、丸め誤差が大きくなるものの、取り得る値の限られたものとなり、符号化効率を上げることができる。特に、注目サブバンドが高周波サブバンドである場合は、S604の処理による修正後の変換係数の多くが“0”となり、符号化効率を上げることができることになる。
On the other hand, when P(s, sX) is “0”, the sX-th transformation coefficient [sX] is an ROI non-reference transformation coefficient. Therefore, the code
S605にて、符号データ生成部104は、カウンタsXに“1”を加算し、更新する。そして、S606にて、符号データ生成部104は、カウンタsXとS601で取得した、1ラインの変換係数の数sWとを比較する。sX=sWである場合、符号データ生成部104は、注目サブバンドの注目ラインにおけるROI非参照変換係数の修正が終了したものと判定し、このフローを終了する。sX<sWの場合、未修正のROI非参照変換係数が存在する可能性があることを意味する。それ故、符号データ生成部104は、処理をS603へ処理を戻す。
In S605, the code
次に、サブバンドの変換係数の符号化処理を、図7のフローチャートを参照して説明する。この処理は、図2のS212、及び、図5のS507の処理でもある。 Next, the encoding process of subband transform coefficients will be explained with reference to the flowchart of FIG. 7. This process is also the process of S212 in FIG. 2 and S507 in FIG.
S701にて、符号データ生成部104は、注目サブバンドの1ライン分の変換係数の個数sWを取得する。そして、S702にて、符号データ生成部104は、1個の変換係数の特定するためのカウンタsXに“0”を代入し、初期化する。カウンタsXの値は、変換係数の左端から位置を示すものである。
In S701, the code
続く、S703乃至705の処理は、符号データ生成部104における符号化方式選択部112の処理である。
The subsequent processes of S703 to S705 are the processes of the encoding
符号化方式の判定処理は、図8に示すように、注目変換係数の位置をxとしたとき、その周辺の変換係数a,b,cの値を参照して行われる。そして、これら3つの周辺変換係数a、b、cを参照し、符号化方式選択部112は注目変換係数xの符号化方式を判定し、注目変換係数xをランレングス符号化部113、予測符号化部114のいずれかに供給する。実施形態における符号化方式の選択基準は、低周波成分であるサブバンドLLと、それ以外の高周波成分のサブバンドで異なっている。それ故、S703にて、符号化方式選択部112は、カウンタsに基づき、サブバンドLLの変換係数を符号化しようとしているのか否かを判定する。
As shown in FIG. 8, the encoding method determination process is performed by referring to the values of the surrounding transform coefficients a, b, and c, where x is the position of the transform coefficient of interest. Then, referring to these three peripheral transform coefficients a, b, and c, the encoding
サブバンドLLの変換係数を符号化しようとしていると判定した場合、符号化方式選択部112は処理をS705に進める。一方、サブバンドLL以外であると判定した場合、符号化方式選択部112は処理をS704に進める。
If it is determined that the transform coefficients of subband LL are to be encoded, the encoding
S704にて、符号化方式選択部112は、注目変換係数xの左隣の変換係数aが“0”であるか否かを判定する。変換係数aが“0”である場合、符号化方式選択部112は処理をS705に進める。一方、変換係数aが“0”以外である場合、符号化方式選択部112は処理をS708に進める。
In S704, the encoding
S705にて、符号化方式選択部112は、周辺の変換係数a,b,cの全てが同じ値であるか否かを判定する。変換係数a,b,cの全てが同じ値であった場合、符号化方式選択部112は処理をS706に進め、変換係数a,b,cの中に一つでも他と異なる値があった場合、符号化方式選択部112は処理をS708に進める。
In S705, the encoding
なお、S704の判定結果がYes,かつ、S705の判定結果がYesとなった場合の周辺の変換係数a,b,cの関係は、a=b=c=0である。また、符号化対象の変換係数xがサブバンドの左端にあるときは、変換係数aは存在しない。また、変換係数xがサブバンドの最初のライン内にあるときは、変換係数b、cは存在しない。このように存在しない変換係数は予め設定された値(例えば“0”)であると見なして処理を行うものとする(復号側と共通の認識となっていれば、その値は特に問わない)。 Note that when the determination result in S704 is Yes and the determination result in S705 is Yes, the relationship among the surrounding transformation coefficients a, b, and c is a=b=c=0. Further, when the transform coefficient x to be encoded is at the left end of the subband, the transform coefficient a does not exist. Furthermore, when transform coefficient x is within the first line of the subband, transform coefficients b and c do not exist. A conversion coefficient that does not exist in this way is assumed to be a preset value (for example, "0") and processed (as long as it is shared with the decoding side, the value does not matter). .
上記のS703乃至705の判定処理を分かり易く説明するのであれば、次の通りである。 The determination processing in S703 to S705 above will be explained in an easy-to-understand manner as follows.
一般に、同じ値が連続する状況下では、予測符号化よりもランレングス符号化の方が符号化効率で優れている。サブバンドLLに含まれる全変換係数は、オリジナルの画像の水平、垂直とも1/4のサイズの縮小画像と見ることができる。それ故、サブバンドLLの場合、同じ値が連続する可能性が高いか否かは、注目変換係数の周囲にある複数の変換係数が同じ値となっているか否かで推定できる。それ故、周囲の変換係数a,b,cが同じ値の場合には、注目変換係数をランの始点とするランレングス符号化を開始する。一方、連続性が期待できない場合には、注目変換係数を符号化済みの周囲の変換係数に基づく予測符号化を行う。 In general, run-length encoding is superior to predictive encoding in terms of encoding efficiency under conditions where the same value continues. All the transform coefficients included in the subband LL can be viewed as a reduced image that is 1/4 the size of the original image both horizontally and vertically. Therefore, in the case of subband LL, whether or not there is a high possibility that the same value will continue can be estimated based on whether or not a plurality of transformation coefficients around the transformation coefficient of interest have the same value. Therefore, if the surrounding transform coefficients a, b, and c have the same value, run-length encoding is started with the transform coefficient of interest as the starting point of the run. On the other hand, if continuity cannot be expected, predictive encoding is performed on the transformation coefficient of interest based on encoded surrounding transformation coefficients.
一方、サブバンドLL以外の高周波成分の変換係数は、その性質上、“0”が連続ことはあっても、“0”以外の、同じ値が連続するこことは稀である。そこで、高周波成分については、注目変換係数の周囲の変換係数a,b,cが全て“0”である場合に限って、注目変換係数をランの始点とするランレングス符号化を開始する。周囲の変換係数a,b,cのうち、1つでも“0”で無い場合、連続性が期待できないので、注目変換係数を符号化済みの周囲の変換係数に基づく予測符号化を行う。 On the other hand, due to the nature of the transform coefficients of high frequency components other than subband LL, although "0" may be continuous, it is rare that the same value other than "0" is continuous. Therefore, for high-frequency components, run-length encoding is started with the target transform coefficient as the start point of the run only when the transform coefficients a, b, and c around the target transform coefficient are all "0". If even one of the surrounding transform coefficients a, b, and c is not "0", continuity cannot be expected, so predictive encoding is performed on the target transform coefficient based on the encoded surrounding transform coefficients.
上記の通りなので、S706に処理が進んだ場合、符号データ生成部104は、ランレングス符号化部113を制御し、注目変換係数[sX]を始点とするラン長を計数させる。ランレングス符号化部113は、ランが途切れた場合に、計数したランを示す符号を出力する。そして、S707にて、S706で計数されたラン長をカウンタsXに加算し、次に、符号化方式選択部へ入力する注目係数の位置を更新する。その後、符号データ生成部104、ラン終端の係数を予測符号化するため、処理をS708へ進める。
As described above, when the process proceeds to S706, the code
S708にて、符号データ生成部104は予測符号化部114を制御し、注目変換係数xに対する予測符号化を実行させる。予測符号化部114は、周辺の符号化済み変換係数a、b、cから予測値p(単純にはp=aである)を求め、注目変換係数xと予測値pとの差分d(=x-a)をエントロピー符号化する。
In S708, the code
この後、S709にて、符号データ生成部104は、次の変換係数の符号化を行うためにカウンタsXに“1”を加算する。そして、S710にて、符号データ生成部104は、カウンタsXと1ラインの変換係数の数sWとを比較する。sX=sWの場合、注目ラインの全変換係数の符号化を終えたことになるので、符号データ生成部104は、このフローを終了する。それ以外の場合、符号データ生成部104は、次の変換係数の符号化を行うために処理をS703に戻す。
After that, in S709, the code
以上が、実施形態における符号データ生成部104の処理内容である。上記の処理を行うと、高周波サブバンドはゼロの係数が多いほどランレングス符号化されやすい。そのため、ROIに含まれないDWT変換係数は量子化されることで、“0”となる可能性が高くなり、結果、ランレングス符号化に移行しやすくなり、高い圧縮率が期待できる。つまり、ROI以外の領域の符号量を小さくできる。
The above is the processing content of the code
本実施形態の手法を用いると、図3(c)の領域302、303のラインの符号化データのヘッダには、各サブバンドに対応した量子化ステップ幅が記載される。そして、領域304、305およびROIが含まれるラインの符号化データのヘッダには、量子化ステップ幅“1”が格納されることになる。また、領域304、305の多くは、ROI領域内の画素を参照しないで得られたDWT変換係数であるので、量子化→逆量子化の処理を経た符号化データとなる。そのため、量子化ステップ幅が“1”と記載されていても、復号時にROI領域と、それ以外の非ROI領域のDWT変換係数を区別することなく復号することもでき、処理が簡略化され、高速な復号も期待できる。
When the method of this embodiment is used, the quantization step width corresponding to each subband is written in the header of the encoded data in the lines of
さらに、本実施形態では、ROI領域を含むDWT変換係数のライン(量子化ステップ幅として“1”の係数ライン)のうち、サブバンド1HL、1LH,1HHについては、ROI領域外のDWT変換係数を修正対象として量子化したが、このサブバンドの数を動的に変更してもよい。たとえば、ロスレス圧縮とするROIの画像全体に占める割合が小さい場合には、全体の符号量もあまり大きくならない。そのため、本実施形態のサブバンド1HL,1LH,1HHのみを量子化対象とし、なるべくROI領域外の画質劣化を防止する。逆に、ロスレス圧縮とする注目領域の画像全体に占める割合が大きい場合には、全体の符号量が大きくなりがちであるため、LLサブバンド以外の高周波サブバンドすべてを量子化対象として、符号量を小さくしても良い。そのため、ROIが大きいか否かを判定するための閾値を設け、それに従って量子化対象を決定しても良い。 Furthermore, in this embodiment, among the lines of DWT transform coefficients that include the ROI region (coefficient lines with a quantization step width of "1"), for subbands 1HL, 1LH, and 1HH, the DWT transform coefficients outside the ROI region are Although quantization is used as a correction target, the number of subbands may be dynamically changed. For example, if the ROI to be subjected to lossless compression occupies a small proportion of the entire image, the total amount of code will not become very large. Therefore, only subbands 1HL, 1LH, and 1HH in this embodiment are targeted for quantization, and image quality deterioration outside the ROI region is prevented as much as possible. On the other hand, if the area of interest to be losslessly compressed occupies a large proportion of the entire image, the overall code amount tends to increase, so all high-frequency subbands other than the LL subband are quantized and the code amount is You can make it smaller. Therefore, a threshold value may be provided to determine whether the ROI is large, and the quantization target may be determined according to the threshold value.
さらに、ROIを含まないDWT変換係数の量子化ステップ幅を2のべき乗よりも細かく制御することができ、画像全体の符号量を制御しやすいだけでなく、ROI領域外の画質を細かく制御することができる。 Furthermore, the quantization step width of DWT transform coefficients that do not include the ROI can be controlled more finely than a power of 2, which not only makes it easier to control the code amount of the entire image, but also allows finer control of the image quality outside the ROI region. Can be done.
また、DWT変換係数を1ライン毎に処理可能なため、符号化時の使用メモリ量を小さくすることができる。 Furthermore, since DWT transform coefficients can be processed line by line, the amount of memory used during encoding can be reduced.
なお、上記実施形態では、符号化データ生成部104は図2の構成を持つものとして説明したが、CPU101が、上記の説明で参照した各フローチャートに対応するコンピュータプログラムを実行させて実現させても構わない。
In the above embodiment, the encoded
[第2の実施形態]
上記第1の実施形態では、ROI参照変換係数を含むライン内の、ROI非参照変換係数の修正処理(図5のS505)の詳細を図6のフローチャートに参照して説明した。その際、ROI非参照変換係数については、量子化→逆量子化を行うことも説明した。
[Second embodiment]
In the first embodiment described above, details of the correction process (S505 in FIG. 5) of ROI non-reference conversion coefficients in a line including ROI reference conversion coefficients have been described with reference to the flowchart in FIG. 6. At that time, it has also been explained that quantization→inverse quantization is performed for ROI non-reference transform coefficients.
本実施形態では、ROI非参照係数のうち、予め設定された範囲の値を持つ変換係数をゼロにする例について説明する。 In this embodiment, an example will be described in which, among ROI non-reference coefficients, conversion coefficients having values within a preset range are set to zero.
本第2の実施形態における、図5のS505の処理の詳細を、図9のフローチャートを参照して以下に説明する。同図のうち、第1の実施形態と同じ処理については、図6と同じ参照符号を付し、その詳しい説明は割愛する。 Details of the process of S505 in FIG. 5 in the second embodiment will be described below with reference to the flowchart in FIG. 9. In the figure, the same processes as in the first embodiment are given the same reference numerals as in FIG. 6, and detailed explanation thereof will be omitted.
S601,S602は第1の実施形態の説明と同じである。S901にて、符号データ生成部104は,ゼロに置き換えるための係数範囲を規定する正の閾値Bを取得する。閾値Bが正とするのは、ゼロに置き換えるDWT変換係数の取り得る範囲を絶対値で判定できるようにするためである。なお、この閾値Bは、ユーザの指示入力に従ってCPU101がその値を決定し、符号データ生成部104に設定するものとする。また、閾値Bは、そのサブバンドに用いる量子化ステップ幅よりは大きな値とする。
S601 and S602 are the same as those described in the first embodiment. In S901, the code
S603にて、符号データ生成部104は、ロスレス係数位置情報P(s、sX)を参照し、その値が“1”か否かを判定する。ロスレス係数位置情報P(s、sX)が“1”である場合、注目変換係数[sX]がROI参照変換係数であり、ロスレス符号化しなければならない。それ故、符号データ生成部104は、注目変換係数については修正せずし、処理をS605に進める。
In S603, the code
ロスレス係数位置情報P(s、sX)が“1”ではなく、“0”である場合、注目変換係数[sX]はROI非参照変換係数であり、修正対象となる。したがって、符号データ生成部104は、S603からS902に処理を分岐する。S902にて、符号データ生成部104は、注目変換係数[sX]の絶対値と値Bとを比較する。注目変換係数[sX]の絶対値が値B以下である場合、符号データ生成部104は、処理をS903に進める。このS903にて、符号データ生成部104は、注目変換係数[sX]をゼロに置き換える。
When the lossless coefficient position information P (s, sX) is not "1" but "0", the transformation coefficient of interest [sX] is an ROI non-reference transformation coefficient and is subject to correction. Therefore, the code
S604,S605,S606の処理は、第1の実施形態と同様である。 The processing in S604, S605, and S606 is the same as in the first embodiment.
なお、S902では、注目変換係数[sX]の絶対値と閾値Bとを比較するものとして説明したが、以下の条件を満たすか否かの判定を行うことと等価である。
条件:-B≦注目変換係数[sX]≦B
Although S902 has been described as comparing the absolute value of the conversion coefficient of interest [sX] with the threshold B, this is equivalent to determining whether the following conditions are satisfied.
Condition: -B≦Attention conversion coefficient [sX]≦B
上記の結果、符号化対象の画像データの注目ラインから得たDWT変換係数に、ROI内の画素を参照して算出されたROI参照変換係数が含まれ、且つ、そのROI参照変換係数の絶対値が閾値以下であると判定された場合には、“0”に置き換える。この結果、第1の実施形態と比較して、“0”の発生する確率が高くなり、より符号化効率を上げることができる。 As a result of the above, the DWT transform coefficients obtained from the line of interest of the image data to be encoded include the ROI reference transform coefficients calculated with reference to pixels in the ROI, and the absolute value of the ROI reference transform coefficients If it is determined that is less than the threshold value, it is replaced with "0". As a result, the probability of "0" occurring is higher than in the first embodiment, and encoding efficiency can be further improved.
[その他の実施形態]
上記第2の実施形態では、サブバンドによって一律にある一定範囲のDWT変換係数をゼロに修正するものとしたが、第1、第2の実施形態を組み合わせてもよい。すなわち、サブバンド2HL、2LH、2HHについては第1の実施形態の方法で係数を修正し、より高周波なサブバンド1HL,1LH,1HHについては第2の実施形態の方法で修正してもよい。
[Other embodiments]
In the second embodiment, the DWT transform coefficients in a certain range are uniformly corrected to zero depending on the subband, but the first and second embodiments may be combined. That is, the coefficients may be modified for subbands 2HL, 2LH, and 2HH using the method of the first embodiment, and the coefficients for higher frequency subbands 1HL, 1LH, and 1HH may be modified using the method of the second embodiment.
また、第2の実施形態では、ゼロに置き換えるDWT変換係数の範囲を規定する値Bを動的に変更してもよい。たとえば、サブバンドの種類によって、この値Bを変更しても良い。すなわち、例えばサブバンド1HHは、より大きい値Bを設定し、広範囲なDWT変換係数をゼロにし、低周波に近いサブバンドに対しては値Bを小さくし、画質の過度な低下を防止してもよい。あるいは、符号化対象の画像データに対するROIが示す面積の比率から値Bを設定してもよい。画像全体に占めるROIの面積の比率が大きいときには、Bの値を大きくし、符号量を抑制する。一方、その比率が小さい場合には、値Bを小さくし、ROI領域とそれ以外の画素の画質の差を小さくしてもよい。 Furthermore, in the second embodiment, the value B that defines the range of DWT transform coefficients to be replaced with zero may be dynamically changed. For example, this value B may be changed depending on the type of subband. That is, for example, for subband 1HH, a larger value B is set, a wide range of DWT transform coefficients are set to zero, and the value B is decreased for subbands close to low frequencies to prevent excessive deterioration of image quality. Good too. Alternatively, the value B may be set based on the ratio of the area indicated by the ROI to the image data to be encoded. When the ratio of the area of the ROI to the entire image is large, the value of B is increased to suppress the amount of code. On the other hand, if the ratio is small, the value B may be reduced to reduce the difference in image quality between the ROI region and other pixels.
なお、本実施形態では、説明を簡単にするために、DWTの実行回数を“2”として説明したが、DWTの実行回数に制限はない。 In this embodiment, in order to simplify the explanation, the number of times the DWT is executed is "2", but there is no limit to the number of times the DWT is executed.
また、実施形態では、符号化対象の画像データをタイル分割せずに符号化する方法について説明したが、複数のタイルに分割するようにしても良い。その場合、各タイルの符号化を図2のフローを用いて符号化すればよい。また、実施形態によれば、ROIを含むタイルとそうではないタイルで、まったく同じ方法でデコードすることができる点も特徴ということができる。 Further, in the embodiment, a method has been described in which image data to be encoded is encoded without being divided into tiles, but the image data may be divided into a plurality of tiles. In that case, each tile may be encoded using the flow shown in FIG. 2. Another feature of the embodiment is that tiles that include an ROI and tiles that do not include an ROI can be decoded using exactly the same method.
本実施形態では、各ラインのDWT変換係数の符号データ先頭に量子化ステップ幅を記載したが、それらをサブバンド毎やタイル毎、画像毎に1か所にまとめて記載してもよい。また、タイル分割した際に、ROI外のタイルのサブバンドは量子化ステップ幅が1つに決まる。その場合には、各タイルの各サブバンドに1回だけ量子化ステップ幅を記載してもよい。また、量子化ステップ幅を圧縮して符号データに格納してもよい。 In this embodiment, the quantization step width is written at the beginning of the code data of the DWT transform coefficient of each line, but they may be written in one place for each subband, each tile, or each image. Furthermore, when dividing tiles, the quantization step width is determined to be one for subbands of tiles outside the ROI. In that case, the quantization step width may be written only once for each subband of each tile. Alternatively, the quantization step width may be compressed and stored in code data.
また、上記実施形態では、画像データを1ライン単位に入力し、符号化する例を説明したが、予め設定された所定サイズのブロック単位に入力し、ブロック単位に符号化しても良い。 Further, in the above embodiment, an example has been described in which image data is input in units of one line and encoded, but it may also be input in units of blocks of a predetermined size set in advance and encoded in units of blocks.
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 The present invention provides a system or device with a program that implements one or more of the functions of the embodiments described above via a network or a storage medium, and one or more processors in the computer of the system or device reads and executes the program. This can also be achieved by processing. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
101…CPU、102…入力部、103…ROI設定部、104…符号データ生成部、105…表示部、106…メモリ、107…蓄積部、110…DWT部、111…量子化部、112…符号化方式選択部、113…ランレングス符号化部、114…予測符号化部、115…符号データ出力部、116…符号列生成部 101... CPU, 102... Input unit, 103... ROI setting unit, 104... Code data generation unit, 105... Display unit, 106... Memory, 107... Storage unit, 110... DWT unit, 111... Quantization unit, 112... Code encoding scheme selection unit, 113... run length encoding unit, 114... predictive encoding unit, 115... code data output unit, 116... code string generation unit
Claims (6)
符号化対象画像データにおける注目領域を設定する設定手段と、
前記符号化対象画像データに対し可逆なフィルタを用いてウェーブレット変換を行うことで、複数のサブバンドを得る変換手段と、
前記変換手段で得た各サブバンドに含まれる係数を、ライン単位に量子化パラメータに従って量子化する量子化手段と、
量子化して得た各サブバンドの量子化後の係数を、ライン単位にエントロピー符号化し、前記量子化パラメータを特定する情報が付加された符号化データを生成する符号化手段と、
前記量子化手段及び符号化手段を制御する制御手段とを有し、
前記制御手段は、サブバンド毎に、
係数で構成される着目ラインが、前記注目領域内の画素を参照して生成された係数を含むか否かを判定する判定手段と、
前記量子化手段で得た量子化後の係数を修正する修正手段とを含み、
前記制御手段は、
前記判定手段が、前記着目ラインが前記注目領域内の画素を参照して生成された係数を含まないと判定した場合、前記量子化手段に対して前記着目ラインの各係数を前記量子化パラメータで量子化するよう制御すると共に、前記符号化手段に対して前記量子化パラメータを特定する情報を含む符号化データを生成させ、
前記判定手段が、前記着目ラインが前記注目領域内の画素を参照して生成された係数を含むと判定した場合、前記量子化手段に対し、前記着目ラインの係数のうち前記注目領域内の画素を参照して生成された係数に対してはその値を維持し、前記注目領域内の画素を参照しないで生成された係数に対しては前記量子化パラメータで量子化するよう制御し、且つ、前記修正手段に対して、前記量子化手段で得た量子化後の係数を前記量子化パラメータで逆量子化させることで修正させ、前記符号化手段に対して前記着目ラインに対して量子化ステップ幅が"1"であることを表す情報を含む符号化データを生成させる
ことを特徴とする画像符号化装置。 An image encoding device,
a setting means for setting a region of interest in image data to be encoded;
Transforming means for obtaining a plurality of subbands by performing wavelet transformation on the encoding target image data using a reversible filter;
quantization means for quantizing the coefficients included in each subband obtained by the conversion means on a line-by-line basis according to a quantization parameter;
encoding means for entropy encoding the quantized coefficients of each subband obtained by quantization on a line-by-line basis to generate encoded data to which information specifying the quantization parameter is added;
and a control means for controlling the quantization means and the encoding means,
The control means, for each subband,
determining means for determining whether a line of interest made up of coefficients includes a coefficient generated with reference to pixels in the region of interest;
correction means for correcting the quantized coefficients obtained by the quantization means,
The control means includes:
If the determining means determines that the line of interest does not include a coefficient generated by referring to pixels within the region of interest, the determining means causes the quantizing means to calculate each coefficient of the line of interest using the quantization parameter. controlling the quantization, and causing the encoding means to generate encoded data including information specifying the quantization parameter;
If the determining means determines that the line of interest includes coefficients generated by referring to pixels within the region of interest, the determining means instructs the quantization means to determine whether the line of interest includes coefficients generated by referring to pixels within the region of interest, among the coefficients of the line of interest. The coefficients generated by referring to the pixel in the region of interest are controlled to maintain their values, and the coefficients generated without referring to the pixels in the region of interest are quantized using the quantization parameter, and , the correction means corrects the quantized coefficients obtained by the quantization means by inversely quantizing them using the quantization parameter, and the encoding means quantizes the line of interest. An image encoding device that generates encoded data that includes information indicating that a step width is "1".
前記量子化手段で得た係数が示す値の絶対値が予め設定された閾値以下となる条件を満たす場合、当該係数をゼロに変更することを特徴とする請求項1に記載の画像符号化装置。 The correction means includes:
The image encoding device according to claim 1, characterized in that when a condition that the absolute value of the value indicated by the coefficient obtained by the quantization means is equal to or less than a preset threshold is satisfied, the coefficient is changed to zero. .
変換係数のランを符号化するランレングス符号化手段と、
変換係数を予測符号化する予測符号化手段と、
前記エントロピー符号化しようとしている注目変換係数がいずれのサブバンドに属するか、及び、前記注目変換係数の周囲の符号化済みの複数の変換係数の関係に基づいて、前記注目変換係数をランの始点として前記ランレングス符号化手段により符号化するか、前記注目変換係数を前記予測符号化手段を用いて符号化するかを選択する選択手段と
を含むことを特徴とする請求項1乃至3のいずれか1項に記載の画像符号化装置。 The encoding means includes:
run-length encoding means for encoding a run of transform coefficients;
Predictive encoding means for predictively encoding the transform coefficients;
The target transform coefficient is set as the starting point of the run based on which subband the target transform coefficient to be entropy-encoded belongs to and the relationship among the plurality of encoded transform coefficients surrounding the target transform coefficient. and selecting means for selecting whether to encode the target transform coefficient using the run-length encoding means or to encode the target transform coefficient using the predictive encoding means. The image encoding device according to item 1.
符号化対象画像データにおける注目領域を設定する設定工程と、
前記符号化対象画像データに対し可逆なフィルタを用いてウェーブレット変換を行うことで、複数のサブバンドを得る変換工程と、
前記変換工程で得た各サブバンドに含まれる係数を、ライン単位に量子化パラメータに従って量子化する量子化工程と、
量子化して得た各サブバンドの量子化後の係数をライン単位にエントロピー符号化し、前記量子化パラメータを特定する情報が付加された符号化データを生成する符号化工程と、
前記量子化工程及び符号化工程を制御する制御工程とを有し、
前記制御工程は、サブバンド毎に、
係数で構成される着目ラインが、前記注目領域内の画素を参照して生成された係数を含むか否かを判定する判定工程と、
前記量子化工程で得た量子化後の係数を修正する修正工程とを含み、
前記制御工程は、
前記判定工程が、前記着目ラインが前記注目領域内の画素を参照して生成された係数を含まないと判定した場合、前記量子化工程に対して前記着目ラインの各係数を前記量子化パラメータで量子化するよう制御すると共に、前記符号化工程に対して前記量子化パラメータを特定する情報を含む符号化データを生成させ、
前記判定工程が、前記着目ラインが前記注目領域内の画素を参照して生成された係数を含むと判定した場合、前記量子化工程に対し、前記着目ラインの係数のうち前記注目領域内の画素を参照して生成された係数に対してはその値を維持し、前記注目領域内の画素を参照しないで生成された係数に対しては前記量子化パラメータで量子化するよう制御し、且つ、前記修正工程に対して、前記量子化工程で得た量子化後の係数を前記量子化パラメータで逆量子化させることで修正させ、前記符号化工程に対して前記着目ラインに対して量子化ステップ幅が"1"であることを表す情報を含む符号化データを生成させる
ことを特徴とする画像符号化装置の制御方法。 A method for controlling an image encoding device, the method comprising:
a setting step of setting a region of interest in the image data to be encoded;
a transformation step of obtaining a plurality of subbands by performing wavelet transformation on the encoding target image data using a reversible filter;
a quantization step of quantizing the coefficients included in each subband obtained in the conversion step in accordance with a quantization parameter on a line-by-line basis;
an encoding step of entropy encoding the quantized coefficients of each subband obtained by quantization line by line to generate encoded data to which information specifying the quantization parameter is added;
a control step for controlling the quantization step and the encoding step,
The control process includes, for each subband,
a determination step of determining whether a line of interest made up of coefficients includes a coefficient generated with reference to pixels in the region of interest;
a correction step of correcting the quantized coefficients obtained in the quantization step,
The control step includes:
If the determination step determines that the line of interest does not include a coefficient generated by referring to pixels within the region of interest, the quantization step is performed to calculate each coefficient of the line of interest using the quantization parameter. controlling the quantization, and causing the encoding step to generate encoded data including information specifying the quantization parameter;
If the determination step determines that the line of interest includes a coefficient generated by referring to the pixel in the region of interest, the quantization step includes the coefficients of the line of interest that are generated by referring to the pixels in the region of interest. control to maintain the value of the coefficient generated with reference to the pixel in the region of interest, and quantize the coefficient generated without reference to the pixel in the region of interest using the quantization parameter; For the modification step, the quantized coefficients obtained in the quantization step are modified by inverse quantization using the quantization parameter, and for the encoding step, a quantization step is performed for the line of interest. A method for controlling an image encoding device, the method comprising: generating encoded data including information indicating that the width is "1".
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018238646A JP7390788B2 (en) | 2018-12-20 | 2018-12-20 | Image encoding device and its control method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018238646A JP7390788B2 (en) | 2018-12-20 | 2018-12-20 | Image encoding device and its control method and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2020102704A JP2020102704A (en) | 2020-07-02 |
JP7390788B2 true JP7390788B2 (en) | 2023-12-04 |
Family
ID=71139974
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018238646A Active JP7390788B2 (en) | 2018-12-20 | 2018-12-20 | Image encoding device and its control method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7390788B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112153317A (en) * | 2020-09-25 | 2020-12-29 | 杭州涂鸦信息技术有限公司 | Image quality control method, system and equipment thereof |
CN112422992A (en) * | 2020-10-28 | 2021-02-26 | 西安万像电子科技有限公司 | Image coding method and device |
CN112766265B (en) * | 2021-01-27 | 2023-11-14 | 厦门树冠科技有限公司 | Method, system, medium and equipment for intercepting ROI with arbitrary shape |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005223852A (en) | 2004-02-09 | 2005-08-18 | Sanyo Electric Co Ltd | Image-encoding device and method, and image-decoding device and method |
JP2006101472A (en) | 2004-04-23 | 2006-04-13 | Sumitomo Electric Ind Ltd | Moving picture data encoding method, decoding method, terminal device for executing them, and bi-directional interactive system |
JP2017152905A (en) | 2016-02-24 | 2017-08-31 | 沖電気工業株式会社 | Encoding device and program, decoding device and program, and distribution system |
JP2017192077A (en) | 2016-04-14 | 2017-10-19 | キヤノン株式会社 | Image encoder and image decoder and control method therefor |
-
2018
- 2018-12-20 JP JP2018238646A patent/JP7390788B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005223852A (en) | 2004-02-09 | 2005-08-18 | Sanyo Electric Co Ltd | Image-encoding device and method, and image-decoding device and method |
JP2006101472A (en) | 2004-04-23 | 2006-04-13 | Sumitomo Electric Ind Ltd | Moving picture data encoding method, decoding method, terminal device for executing them, and bi-directional interactive system |
JP2017152905A (en) | 2016-02-24 | 2017-08-31 | 沖電気工業株式会社 | Encoding device and program, decoding device and program, and distribution system |
JP2017192077A (en) | 2016-04-14 | 2017-10-19 | キヤノン株式会社 | Image encoder and image decoder and control method therefor |
Also Published As
Publication number | Publication date |
---|---|
JP2020102704A (en) | 2020-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Mentzer et al. | Conditional probability models for deep image compression | |
JP4273996B2 (en) | Image encoding apparatus and method, and image decoding apparatus and method | |
CA2295689C (en) | Apparatus and method for object based rate control in a coding system | |
KR102134705B1 (en) | Signal processing and inheritance in a tiered signal quality hierarchy | |
US20040081238A1 (en) | Asymmetric block shape modes for motion estimation | |
JP4656190B2 (en) | Information processing apparatus and method | |
US8000539B2 (en) | Geometrical image representation and compression | |
JP7390788B2 (en) | Image encoding device and its control method and program | |
US20100034478A1 (en) | Image encoding apparatus and method of controlling the same | |
US10944972B2 (en) | Apparatus and method for encoding or decoding using a subband dependent prediction adaptation for GCLI entropy coding | |
US9210435B2 (en) | Video encoding method and apparatus for estimating a code amount based on bit string length and symbol occurrence frequency | |
RU2567988C2 (en) | Encoder, method of encoding data, decoder, method of decoding data, system for transmitting data, method of transmitting data and programme product | |
WO1997035427A1 (en) | Data compression using adaptive bit allocation and hybrid lossless entropy encoding | |
JP2000115782A (en) | Coder, coding method and storage medium | |
JP6902553B2 (en) | Data compression | |
US9872032B2 (en) | Autogressive pixel prediction in the neighborhood of image borders | |
JP6727011B2 (en) | Image coding apparatus and control method thereof | |
US10812832B2 (en) | Efficient still image coding with video compression techniques | |
JP6502739B2 (en) | Image coding apparatus, image processing apparatus, image coding method | |
JP2007325262A (en) | Method of video compression | |
JP2018164299A (en) | Moving picture decoding method | |
JP2006246351A (en) | Image coding unit and image decoding unit | |
Shim et al. | Lossless Image Compression Based on Image Decomposition and Progressive Prediction Using Convolutional Neural Networks | |
JP6727010B2 (en) | IMAGE ENCODING DEVICE, IMAGE DECODING DEVICE, AND CONTROL METHOD THEREOF | |
JP7340658B2 (en) | Image encoding device, image decoding device, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20210103 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210113 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20211215 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20230124 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230130 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230302 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230619 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230807 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20231023 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20231121 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 7390788 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |