JP6581469B2 - Image encoding apparatus, control method therefor, program, and storage medium - Google Patents
Image encoding apparatus, control method therefor, program, and storage medium Download PDFInfo
- Publication number
- JP6581469B2 JP6581469B2 JP2015214805A JP2015214805A JP6581469B2 JP 6581469 B2 JP6581469 B2 JP 6581469B2 JP 2015214805 A JP2015214805 A JP 2015214805A JP 2015214805 A JP2015214805 A JP 2015214805A JP 6581469 B2 JP6581469 B2 JP 6581469B2
- Authority
- JP
- Japan
- Prior art keywords
- value
- pixel
- quantization
- encoding
- unit
- 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
Images
Description
本発明は、画像データの符号化技術に関するものである。 The present invention relates to an image data encoding technique.
画像データの符号化方式の一つにJPEG−LSがある。このJPEG−LSは、ロスレス符号化とニアロスレス符号化を選択できる。ニアロスレス符号化は、符号化する以前の画素値と復号して得られた画素値の差が所定の範囲内とする方式である。JPEG−LSのニアロスレス符号化は、符号化対象画素の周囲画素の状態に基づいて予測符号化とランレングス符号化を切り替える。予測符号化は、符号化対象画素の画素値を周囲画素から予測し、予測誤差を量子化して符号化する。ランレングス符号化は、所定範囲内の画素値のラン長(連続数)を符号化する。量子化に関する他の方法として、特定の画素値の場合には、特定の量子化値を割り当てる量子化方法が開示されている(例えば、特許文献1)。 One of the image data encoding methods is JPEG-LS. This JPEG-LS can select lossless encoding or near lossless encoding. Near-lossless encoding is a method in which a difference between a pixel value before encoding and a pixel value obtained by decoding is within a predetermined range. JPEG-LS near-lossless coding switches between predictive coding and run-length coding based on the state of surrounding pixels of the pixel to be coded. In predictive coding, the pixel value of a pixel to be coded is predicted from surrounding pixels, and the prediction error is quantized and coded. Run-length encoding encodes the run length (number of consecutive values) of pixel values within a predetermined range. As another method related to quantization, in the case of a specific pixel value, a quantization method for assigning a specific quantization value is disclosed (for example, Patent Document 1).
画像データを予測符号化によりニアロスレス符号化する場合を考察する。この場合のニアロスレス符号化による符号化データから得られた画像データには、設定した許容誤差で規定される特定の値を持つ画素が多く発生する傾向があり、それが擬似輪郭となって現れることがある。 Consider a case where image data is near lossless coded by predictive coding. In this case, the image data obtained from the encoded data by the near lossless encoding tends to generate many pixels having a specific value defined by the set allowable error, and this appears as a pseudo contour. There is.
本発明はかかる点に鑑みなされたものであり、ニアロスレス符号化を行いながらも擬似輪郭の発生を、これまでよりも抑制可能とする技術を提供しようとするものである。 The present invention has been made in view of such a point, and an object of the present invention is to provide a technique capable of suppressing generation of a pseudo contour more than ever while performing near-lossless coding.
この課題を解決するため、例えば本発明の画像符号化装置は以下の構成を備える。すなわち、
画像データの各画素を、設定した許容誤差範囲内でニアロスレス符号化する画像符号化装置であって、
符号化対象の画像データにおける着目画素を予測符号化する際の予測値の算出に利用する周囲画素を記憶する記憶手段と、
前記着目画素と、前記記憶手段を参照して求めた前記着目画素の予測値とから、前記着目の予測誤差を算出する算出手段と、
該算出手段で得られた予測誤差を、予め設定された許容誤差を表す指標値を用いて量子化することで量子化値を得る量子化手段と、
該量子化手段で得られた量子化値を符号化し、前記着目画素の符号化データとして出力する符号化手段と、
前記量子化手段で得られた量子化値を前記指標値を用いて逆量子化し、当該逆量子化したて得られた逆量子化値と前記予測値とから前記着目画素の位置の復号画素値を求め、当該復号画素値を、前記着目画素に後続して符号化する際の前記周囲画素の1つとするために前記記憶手段に格納するローカル復号手段とを有し、
前記ローカル復号手段は、
前記量子化値の符号が正と負の場合とで、値に1の差を持つ逆量子化値を生成することを特徴とする。
In order to solve this problem, for example, an image encoding device of the present invention has the following configuration. That is,
An image encoding device that performs near-lossless encoding of each pixel of image data within a set allowable error range,
Storage means for storing surrounding pixels used for calculation of a prediction value when predictively encoding a pixel of interest in image data to be encoded;
Calculation means for calculating the prediction error of the focus from the pixel of interest and the predicted value of the pixel of interest obtained with reference to the storage means;
Quantizing means for obtaining a quantized value by quantizing the prediction error obtained by the calculating means using an index value representing a preset allowable error;
Encoding means for encoding the quantization value obtained by the quantization means and outputting the encoded value as the encoded data of the pixel of interest;
The quantization value obtained by the quantization means is inversely quantized using the index value, and the decoded pixel value at the position of the pixel of interest is obtained from the inverse quantization value obtained by the inverse quantization and the predicted value. And a local decoding means for storing the decoded pixel value in the storage means so that the decoded pixel value is one of the surrounding pixels when encoding subsequent to the pixel of interest.
The local decoding means includes
A dequantized value having a difference of 1 in value is generated depending on whether the sign of the quantized value is positive or negative.
本発明によれば、ニアロスレス符号化による予測符号化を行いながらも擬似輪郭の発生を、これまでよりも抑制可能となる。 According to the present invention, it is possible to suppress the generation of a pseudo contour more than before while performing predictive coding by near lossless coding.
以下、添付図面に従って本発明に係る実施形態を詳細に説明する。なお、以下に説明する実施形態は、本発明を具体的に実施した場合の一例を示すもので、特許請求の範囲に記載した構成の具体的な実施形態の一つである。 Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings. In addition, embodiment described below shows an example at the time of implementing this invention concretely, and is one of the concrete embodiments of the structure described in the claim.
[第1の実施形態]
第1の実施形態は、画像データを予測符号化でニアロスレス符号化する画像符号化装置に適用される。以下、本実施形態に示す画像符号化装置について説明する。また、第1の実施形態では、画像符号化装置をカメラに適用した場合を説明する。
[First Embodiment]
The first embodiment is applied to an image coding apparatus that performs near-lossless coding of image data by predictive coding. Hereinafter, the image coding apparatus shown in the present embodiment will be described. In the first embodiment, a case where the image encoding device is applied to a camera will be described.
図1は、そのカメラ100のブロック構成図である。カメラ100は、操作部101と、撮像部102と、情報処理部109と、記憶部107と、I/Oインターフェース108とを有している。情報処理部109は、取得部103、画像処理部104、符号化部105、出力部106を有する。
FIG. 1 is a block diagram of the
図4(a)はカメラ100の正面図である。図4(a)に示すように、カメラ100は撮像部102を備えている。図4(b)は撮像部102の内部構成を示す図である。撮像部102は、ズームレンズ401、フォーカスレンズ402、403、開口絞り404、シャッター405を有している。また光学ローパスフィルタ406、iRカットフィルタ407、カラーフィルタ408、撮像素子409およびA/D変換部410を有している。ユーザは絞り404を調整することにより、撮像部102に入射される入射光量を調節できる。撮像素子409は、CMOSやCCDなどの受光素子である。撮像素子409で被写体の光量を検知すると、検知された光量がA/D変換部410によってデジタル値に変換され、デジタルデータとして情報処理部109へと出力される。
FIG. 4A is a front view of the
図3は情報処理部109の内部構成を示す図である。情報処理部109は、CPU301、RAM302、ROM303を有し、各構成部はシステムバス304により相互に接続されている。
FIG. 3 is a diagram illustrating an internal configuration of the
ROM303には、CPU301が実行するプログラムや各種データが記憶されている。RAM302は、CPU301がプログラムを実行した際のワークエリア、各種バッファとして利用される。CPU301は、ROM303に格納されたプログラムを実行し、RAM302をワークエリアやバッファとして利用する。この結果、CPU301は、先に示した図1の取得部103、画像処理部104、符号化部105、出力部106として機能すると共に、装置全体の制御を司ることになる。なお、ここでは、各構成要素を、CPU301が実行することで実現するものとしたが、同等の処理を果たす専用の回路等で実現しても構わない。
The
操作部101は、カメラ本体に備えられたボタンやダイヤル、タッチパネルなどの入力装置であり、ユーザが操作して、撮影の開始、停止および撮影条件の設定などの命令を行える。後述するパラメータNEARも、ユーザの指示に従ってこの操作部101から設定されるものである。ここでパラメータNEARは、ニアロスレス符号化を行う際の許容誤差を表す指標値であり、ユーザが許容誤差の大小の指示したとき、その指示に応じて1、2、4、8…と、2の累乗数の値の1つがNEARとして設定されるものとする。
The
記憶部107は、撮像部102により取得されたRAW画像データ、および、画像データを保存することができる、メモリカードなどの不揮発性の記憶媒体である。I/Oインターフェース108はユニバーサルシリアルバス(USB)によって実装されたシリアルバス接続を利用でき、対応するUSBコネクタを有する。もちろん、I/Oインターフェース108を、光ファイバによるLAN接続や、無線接続などに利用しても構わない。表示部305は、撮影画像や文字の表示を行う。表示部305には一般的に液晶ディスプレイが用いられる。またタッチパネル機能を有していても良く、その場合はタッチパネルを用いたユーザ指示を操作部101の入力として扱うことも可能である。
The
以下、本実施形態に示す情報処理部109の処理について説明する。ユーザの操作部101に対する撮像指示に基づき、取得部103は、撮像部102から出力されたベイヤ配列のRAW画像データを取得し、画像処理部104にそのRAW画像データを供給する。画像処理部104は、RAW画像データを、デモザイク処理して、通常の1画素がRGBの3成分で構成される画像データを生成し、符号化部105にその画像データを供給する。符号化部105は、供給された画像データを、設定された許容誤差範囲内で符号化処理を行うことになる。
Hereinafter, processing of the
なお、本実施形態における符号化対象の画像データの画素は、上記のようにRGBの3成分で構成され、かつ、各成分とも各8ビットで表現されるものとする。そして、実施形態における符号化部105は、色成分を単位にモノクロ画像として符号化する場合を例に説明する。つまり、R成分のモノクロ多値画像、G成分のモノクロ多値画像、B成分のモノクロ多値画像をそれぞれ独立して符号化する。
Note that the pixel of the image data to be encoded in the present embodiment is composed of three RGB components as described above, and each component is represented by 8 bits each. The
よって、本実施形態における符号化対象の画像データは、単一成分のみのモノクロ画像の符号化であっても良いのは明らかである。また、符号化対象の画像データはRGB形式に限らず、他の色空間やRAW画像データであっても構わない。例えば、1画素がY、Cb、Crでそれぞれが8ビットで構成される場合には、各成分を単位にモノクロ画像として符号化すれば良い。また、RAW画像データに適用する場合、撮像部102の撮像素子がベイヤ配列(R、G0、G1、Bの色に対応する2×2個の撮像素子の組の配列)となっている。各撮像素子からの信号を14ビットで表現している場合、R成分で構成されるモノクロ多値画像、G0成分で構成されるモノクロ多値画像、G1成分で構成されるモノクロ多値画像、B成分で構成されるモノクロ多値画像をそれぞれ符号化する。従って、本願は、画像の色空間の種類、画像を構成する色成分の種類、ビット数によって限定されるものではない。符号化対象の画像がR、G、Bの3成分で各8ビット(256階調)とするのは、あくまで理解を容易にするためであると理解されたい。
Therefore, it is obvious that the image data to be encoded in the present embodiment may be a monochrome image encoding of only a single component. The image data to be encoded is not limited to the RGB format, and may be another color space or RAW image data. For example, when one pixel is composed of Y, Cb, and Cr and each is composed of 8 bits, each component may be encoded as a monochrome image. In addition, when applied to RAW image data, the imaging elements of the
本実施形態における符号化部105の処理について説明する。図2は符号化部105の内部構成であり、図5は符号化部105で行われる1つの色成分(実施形態では、R、G、Bのいずれか)のモノクロ多値画像データに対する符号化処理を示すフローチャートである。つまり、実際には図5の処理を3回実行する。そして、3回行った結果得られた符号データをまとめて、1つのファイルが構成されることになる。
Processing of the
まずステップS501で、色成分入力部201は、画像処理部104から供給された画像データにおける1つの成分の画像データをモノクロ多値画像として入力する。
First, in step S <b> 501, the color
ステップS502で、符号化部105は、モノクロ多値画像内の画素が全て符号化されたかを判定する。全て符号化された場合は符号化処理を終了し、符号化されていない画素がある場合は、ステップS503に移る。
In step S502, the
ステップS503で、符号化部105は、モノクロ多値画像の画素値をライン単位に入力する。そしてステップS504で、符号化部105は、入力したラインにおける左端に位置する画素を符号化対象の着目画素として設定する。
In step S503, the
ラインデータ保持部202は、符号化処理に必要となるデータをRAM302内に予め確保されたバッファ領域に保持する。このバッファ領域には、符号化対象の着目画素が位置するラインと、その直前のラインの2ライン分のデータを保持するものとする。図7は着目画素とその周辺画素の位置関係を示している。図示のxが符号化対象の着目画素である。図示のごとく、参照範囲は、着目画素xが位置するラインとその直前のラインの2ラインにおける、着目画素の周囲画素(左画素a、上画素b、左上画素c)である。また、実施形態では、ラスタスキャン順に画素を順次符号化していくため、着目画素xの左画素a、上画素b、左上画素cは、符号化済みの画素である。ニアロスレス符号化では、符号化以前の画素値と復号後の画素値の差を、設定した許容範囲内にすることができる。このため、バッファ領域内の符号化済みの画素位置には、復号後の画素値が記憶保持されることになる(ローカル復号)。
The line
なお、着目画素xが最初のラインの左端に位置するとき、周囲画素a、b、cは実在しない。また、着目画素xが2ライン目以降でラインの左端に位置するときには、周囲画素b、cは実在する画素であるものの、周囲画素aは実在しない。このような実在しない画素については、所定の値(たとえば0)を持つものと見なす。なお、この所定値は、符号化装置と復号装置との間で共通であればよく、“0”に限定されない。 When the target pixel x is located at the left end of the first line, the surrounding pixels a, b, and c do not exist. When the pixel of interest x is located at the left end of the second and subsequent lines, the surrounding pixels b and c are actual pixels, but the surrounding pixel a does not exist. Such a nonexistent pixel is considered to have a predetermined value (for example, 0). The predetermined value may be common between the encoding device and the decoding device, and is not limited to “0”.
ステップS505で、符号化部105は、着目ライン内の全画素を符号化したか否かを判定する。言い換えれば、着目ラインのライン終端(右端)の画素の符号化を終えたか否かを判定する。ライン中の全ての画素の符号化を終えたと判定した場合には、ステップS506で次のラインの処理に移る。着目ラインの全画素の符号化が未完である場合、符号化部105は、処理をステップS507に進める。
In step S505, the
ステップS507で、予測変換部203は、着目画素に対する予測値pを算出し、着目画素xと予測値pとの差である予測誤差e(=x−p)を導出する。実施形態において、予測値pは、MED(Median Edge Detection)予測を用いて算出するものとする。図7の周辺画素a、b、cの画素値を用いた予測値pの算出式は以下の通りである。
予測変換部203は、上記のようにして求めた予測値pと着目画素xの差分から、予測誤差を導出する。
The
ステップS508で、量子化部204は、予測誤差eを量子化して量子化値qを算出する。量子化部204は、ニアロスレス符号化におけるパラメータ“NEAR”に基づき量子化を行う。パラメータNEARは、符号化/復号に伴う画素値の変化の大きさの最大値を指定するものであり、ここでは許容誤差と呼ぶ。予測誤差e(=着目画素値x−予測値p)、パラメータNEARを用いた量子化値qの算出式は以下の通りである。
パラメータNEARを1、2、4、8…に限定するとき、除算する値(2×NEAR)は、2、4、8、16と2の累乗数となる。即ち、単純なビットシフトによる演算が可能となり、演算コストを削減することができる。もちろんパラメータNEARが他の数値であっても、除算する値(2×NEAR)が2の累乗数であればビットシフトによる演算が可能である。 When the parameter NEAR is limited to 1, 2, 4, 8,..., The value to be divided (2 × NEAR) is a power of 2, 4, 8, 16, and 2. That is, a simple bit shift operation is possible, and the operation cost can be reduced. Of course, even if the parameter NEAR is another numerical value, if the value to be divided (2 × NEAR) is a power of 2, an operation by bit shift is possible.
ステップS509で、ゴロム符号化部206は、量子化値qをゴロム・ライス符号化する。ゴロム符号化部207は、まず量子化値qを非負の整数値MVに変換する。変換式は以下の通りである。この式から明らかなように、整数値MVが偶数か奇数かで量子化値qの正負の符号が判別できることになる。
次に、ゴロム符号化部206は、パラメータkを用いて整数値MVをゴロム・ライス符号化でエントロピー符号化する。ゴロム・ライス符号化の手順は以下の通りである。
(1)整数値MVを2進数表現して、整数値MVをkビット右シフトした値で示される個数の0を並べ、その後に1を付加する。
(2)工程(1)の後ろに、MVの下位kビットを取りだして付け加える。
Next, the
(1) The integer value MV is expressed in binary, and the
(2) After the step (1), the lower k bits of MV are taken out and added.
図8にゴロム・ライス符号化のパラメータkと非負の整数値MVと符号語の関係を示す。ゴロム・ライス符号化の構成はこれに限定されるものではなく、例えば、0と1を反対にして符号を構成しても構わないし、上記手順で述べた(1)と(2)の順番を入れ替えて符号を構成しても良い。なお、ここでは符号化パラメータkの決定方法については特に特定しないが、符号化側と復号側で同じパラメータを利用できれば良い。例えば、予め色成分毎に適切と思われるパラメータkを選定する方法でも良いし、符号化の過程で動的に変化するようにしても構わない。 FIG. 8 shows the relationship between the Golomb-Rice coding parameter k, the non-negative integer value MV, and the code word. The configuration of Golomb-Rice coding is not limited to this. For example, codes may be configured by reversing 0 and 1, and the order of (1) and (2) described in the above procedure may be changed. The codes may be configured by replacing them. Here, the method for determining the encoding parameter k is not particularly specified, but it is sufficient that the same parameter can be used on the encoding side and the decoding side. For example, a method of selecting a parameter k that seems to be appropriate for each color component in advance may be used, or it may be dynamically changed during the encoding process.
図8において、例えばパラメータk=0の場合を考える。量子化値qが−2のとき、非負の整数値MVは3となる。量子化値qが+2のとき、非負の整数値MVは4となる。非負の整数値MVが3のとき、符号語は“0001”となって符号長は4ビットとなる。また、非負の整数値MVが4のとき、符号語は“00001”となる、符号長は5ビットとなる。上記のようにして、ゴロム符号化部206による着目画素xに対する符号語の出力を終えると、処理はステップS510に移る。
In FIG. 8, for example, consider the case where the parameter k = 0. When the quantized value q is −2, the non-negative integer value MV is 3. When the quantized value q is +2, the non-negative integer value MV is 4. When the non-negative integer value MV is 3, the code word is “0001” and the code length is 4 bits. When the non-negative integer value MV is 4, the code word is “00001” and the code length is 5 bits. As described above, when the
ステップS510にて、逆量子化部205は、量子化値qに対する逆量子化処理を含むローカル復号処理を行う。逆量子化部205で行われる処理のフローチャートを図6に示す。
In step S510, the
まずステップS601で、判定部208は、量子化値qを取得する。ステップS602で、判定部208は、量子化値の正負の符号に基づき、逆量子化方法を切り替える。即ち、量子化値qが0以上のとき、ステップS603に移り、第1逆量子化部209の処理を行う。また量子化値qが0より小さいとき、ステップS604に移り、第2逆量子化部210の処理を行う。
First, in step S601, the
ステップS603で、第1逆量子化部209は、量子化値q、パラメータNEARを用いて逆量子化を行い、逆量子化値iqを算出する。算出式は以下の通りである。
iq=q×2×NEAR
ここで、パラメータNEARを1、2、4、8に限定するとき、乗算する値(2×NEAR)は、2、4、8、16と2の累乗数となる。即ち、単純なビットシフトによる演算でiqを求めることが可能となり、演算コストを削減することができる。もちろんパラメータNEARが他の数値であっても、乗算する値(2×NEAR)が2の累乗数であればビットシフトによる演算が可能である。
In step S603, the first
iq = q × 2 × NEAR
Here, when the parameter NEAR is limited to 1, 2, 4, and 8, the value to be multiplied (2 × NEAR) is a power of 2, 4, 8, 16, and 2. That is, iq can be obtained by a simple bit shift calculation, and the calculation cost can be reduced. Of course, even if the parameter NEAR is another numerical value, if the value to be multiplied (2 × NEAR) is a power of 2, an operation by bit shift is possible.
ステップS604、及び、ステップS605で、第2逆量子化部210は、量子化値q、パラメータNEARを用いて逆量子化を行い、逆量子化値iqを算出する。算出式は以下の通りである。
iq=q×2×NEAR+1
まずステップS604では、ステップS603と同様に、量子化値qを(2×NEAR)で乗算する。次にステップS605では、逆量子化値iqが、許容誤差に収まるようにレベルシフトを行う。ここでは“+1”を加算する。ステップS508の量子化方法、及び、許容誤差に基づき、レベルシフト値が決定されることになる。
In step S604 and step S605, the second
iq = q × 2 × NEAR + 1
First, in step S604, as in step S603, the quantized value q is multiplied by (2 × NEAR). In step S605, a level shift is performed so that the inverse quantized value iq falls within the allowable error. Here, “+1” is added. The level shift value is determined based on the quantization method in step S508 and the allowable error.
図9を用いて逆量子化処理を説明する。図9(a)は、逆量子化処理でステップ605のレベルシフトを行わない場合の例である。そして、図9(b)は、逆量子化処理でレベルシフトを行う場合の例である。ここではパラメータNEARが2の場合について説明する。図示の各フィールドは、予測誤差を量子化し、逆量子化したときの予測誤差、量子化値、逆量子化値を示している。予測誤差と逆量子化値との差は、図9(a)、(b)共に、全てパラメータNEAR(=2)の範囲内の差に収まっていることが分かる。 The inverse quantization process will be described with reference to FIG. FIG. 9A shows an example in which the level shift in step 605 is not performed in the inverse quantization process. FIG. 9B shows an example in which level shift is performed by inverse quantization processing. Here, a case where the parameter NEAR is 2 will be described. Each field shown in the figure indicates a prediction error, a quantization value, and an inverse quantization value when the prediction error is quantized and inversely quantized. It can be seen that the difference between the prediction error and the dequantized value is all within the range of the parameter NEAR (= 2) in both FIGS. 9A and 9B.
2の累乗数で除算/乗算して量子化/逆量子化の処理を行うことで、逆量子化の際、複数の逆量子化値を選択できることが分かる。例えば、予測誤差が−2から−5までの値を、量子化値−1に量子化したとき、逆量子化後の逆量子化値は−3、−4共に、パラメータNEAR(=2)の範囲内に収まる。本願では、このような性質を利用して、量子化値の正負の符号に基づいて、複数の逆量子化方法を切り替える。本処理による効果は後述する。 It can be seen that by performing quantization / inverse quantization processing by dividing / multiplying by a power of 2, a plurality of inverse quantization values can be selected in the inverse quantization. For example, when a prediction error is quantized from −2 to −5 to a quantized value−1, the dequantized values after dequantization are both −3 and −4 in the parameter NEAR (= 2). Within the range. In the present application, a plurality of inverse quantization methods are switched based on the sign of the quantized value using such a property. The effect of this process will be described later.
ステップS606で、逆量子化部205は、逆量子化値iq、予測値pを用いて着目画素xの復号後の画素値x’を算出する。画素値x’の算出式は以下に示す通りである。
x’=iq+p
ニアロスレス符号化では、符号化前の画素値xと復号後の画素値x’の差の絶対値が、パラメータNEAR以下(許容値以下)となる。
|x−x’|≦NEAR
図5に戻って、ステップS511で、符号化部105は、着目画素の画素値xを更新する。具体的には、ラインデータ保持部202のバッファ領域内の符号化前の着目画素xの値を、復号後の画素値x’で置き換える。ステップS512で、符号化部105は、着目画素xの右隣の画素を新たな着目画素とし、ステップS505に戻る。
In step S606, the
x ′ = iq + p
In near-lossless encoding, the absolute value of the difference between the pixel value x before encoding and the pixel value x ′ after decoding is equal to or less than the parameter NEAR (less than the allowable value).
| X−x ′ | ≦ NEAR
Returning to FIG. 5, in step S511, the
図2に戻って、符号出力部207は、ゴロム符号化部206で生成された符号化データを出力部106に供給する。出力部106は、復号に必要な情報を含むヘッダを生成し、生成したヘッダに後続して、符号出力部207から供給された符号化データを記憶部107に出力し、保存する。保存された符号化データは、I/Oインターフェース108を介して、カメラ外のデバイスに出力される。
Returning to FIG. 2, the
次に、実施形態における第1逆量子化部209、第2逆量子化部210の処理による効果について説明する。前述のとおり、パラメータNEARを1、2、4、8に限定するとき、乗算処理が単純なビットシフトで実現でき、演算コストを削減することができる。さらに復号画像の画質向上について、図9を用いて説明する。復号処理の詳細については第2の実施形態で説明する。ここではパラメータNEARが2の場合を例とする。図9(a)は、逆量子化処理でステップ605のレベルシフトを行わない場合である。逆量子化値が4の倍数になっていることが分かる。
Next, the effect by the processing of the first
復号画素値x’は、次式のように算出される。
復号画素値x’=逆量子化値iq+予測値p
逆量子化値が4の倍数であるため、予測値pが4の倍数であれば、復号画素値x’は4の倍数となる。予測値pは、周辺画素からMED予測で算出される。MED予測を再度示せば次の通りである。
Decoded pixel value x ′ = inverse quantized value iq + predicted value p
Since the inverse quantized value is a multiple of 4, if the predicted value p is a multiple of 4, the decoded pixel value x ′ is a multiple of 4. The predicted value p is calculated from the surrounding pixels by MED prediction. If MED prediction is shown again, it is as follows.
周囲画素a、b、cが4の倍数であれば、予測値pは4の倍数となり、復号画素値x’は4の倍数となる。さらに復号画素値x’を周囲画素として用いるため、復号画素値に4の倍数が多く発生し、復号画像に疑似輪郭が発生してしまう。ここではパラメータNEARが2の場合を例としたが、パラメータNEARが1、4、8の場合も同様である。 If the surrounding pixels a, b, and c are multiples of 4, the predicted value p is a multiple of 4, and the decoded pixel value x ′ is a multiple of 4. Furthermore, since the decoded pixel value x ′ is used as a surrounding pixel, a large multiple of 4 is generated in the decoded pixel value, and a pseudo contour is generated in the decoded image. Although the case where the parameter NEAR is 2 is taken as an example here, the same applies to the case where the parameter NEAR is 1, 4, and 8.
復号画像の疑似輪郭を低減するため、図9(b)に示すごとく、逆量子化処理でレベルシフトを行う。量子化値が0以上のときは、逆量子化値は4の倍数になるが、量子化値が0より小さいときは、逆量子化値は4の倍数にならないことが分かる。このような逆量子化処理を行うことで、復号画像の疑似輪郭を低減し、画質を向上させることができる。 In order to reduce the pseudo contour of the decoded image, as shown in FIG. 9B, level shift is performed by inverse quantization processing. When the quantized value is 0 or more, the inverse quantized value is a multiple of 4. However, when the quantized value is smaller than 0, the inverse quantized value is not a multiple of 4. By performing such inverse quantization processing, the pseudo contour of the decoded image can be reduced and the image quality can be improved.
ここでは予測値pをMED予測で算出する例を示したが、周辺画素から加算、減算のみで算出する予測であれば、他の予測方法を用いても構わない。例えば、左隣画素aを予測値として用いる場合、あるいは、上隣画素bを予測値として用いる場合などが挙げられる。 Here, an example in which the prediction value p is calculated by MED prediction is shown, but other prediction methods may be used as long as the prediction is calculated only by addition and subtraction from surrounding pixels. For example, the case where the left adjacent pixel a is used as a predicted value or the case where the upper adjacent pixel b is used as a predicted value can be used.
以上説明したように、本実施形態によれば、画像データをニアロスレス符号化する際、量子化値の正負の符号に基づき、複数の逆量子化方法を切り替えることで、予測符号化における演算量削減、及び、復号画像の画質向上が図れる。 As described above, according to the present embodiment, when image data is subjected to near-lossless encoding, the amount of computation in predictive encoding is reduced by switching between a plurality of inverse quantization methods based on positive and negative codes of quantization values. And the image quality of the decoded image can be improved.
次に、上記第1の実施形態のカメラ100で生成された符号化データを復号する復号装置について説明する。図10は、第1の実施形態の画像復号を行うデバイス1000の構成の一例を示す図である。デバイス1000は、I/Oインターフェース1001と、記憶部1002と、操作部1003と、情報処理部1008と、表示部1007を有している。
Next, a decoding apparatus that decodes encoded data generated by the
デバイス1000の種類は特に問わないが、典型的にはコンピュータ、または、カメラである。本第1の実施形態におけるデバイス1000をコンピュータとして説明する。I/Oインターフェース1001は、I/Oインターフェース108と同様にUSBコネクタを有する。デバイス1000は、I/Oインターフェース1001を介して、カメラ100のI/Oインターフェース108から出力される圧縮画像データを取得する。
The type of
記録部1002は、I/Oインターフェース1001から取得された圧縮画像データを保存することができるメモリカードなどの不揮発性の記憶媒体である。操作部1003は、コンピュータに備えられたキーボード、マウスなどの入力装置であり、ユーザが操作して復号処理などの命令を行える。表示部1007は、復号画像の表示等が行え、一般的に液晶ディスプレイが用いられる。情報処理部1008の内部構成は、図3に示す情報処理部109と同様である。
The
以下、本第1の実施形態における情報処理部1008の処理について説明する。ユーザの操作部1003に対する復号指示に基づき、取得部1004は、記憶部1002から圧縮画像データ(第1の実施形態の装置で符号化したデータファイル)を取得し、復号部1005に圧縮画像データを供給する。
Hereinafter, processing of the
復号部1005は、圧縮画像データの復号処理を行う。本第1の実施形態では1画素がRGB各8ビットで表現されるものとし、色成分を単位にモノクロ画像として復号する場合を例に説明する。つまり、R成分のモノクロ多値画像、G成分のモノクロ多値画像、B成分のモノクロ多値画像をそれぞれ独立して復号する。
The
本第1の実施形態に示す復号部1005の処理について説明する。図11は復号部1005の内部構成であり、図12は復号部1005で行われる1つの色成分(実施形態では、R、G、Bのいずれか)の符号データに対する復号処理を示すフローチャートである。つまり、実際には図12の処理を3回実行する。そして、3回行った結果得られたR成分、G成分、B成分のモノクロ多値画像をまとめることで、カラー画像データが生成される。なお、ラインデータ保持部1104は2ライン分の容量を有し、復号に先立ち0クリアされるものとする。
Processing of the
まずステップS1201で、符号入力部1101は、取得部1004から出力された圧縮画像データにおける1つの成分の符号データを入力する。ステップS1202で、復号部1005は、モノクロ多値画像内の画素が全て復号されたかを判定する。全て復号された場合は復号処理を終了し、復号されていない画素がある場合は、ステップS1203に移る。ステップS1203にて、復号部1005は、復号するラインにおける左端に位置する画素を復号対象の着目画素として設定する。
First, in step S <b> 1201, the
ラインデータ保持部1104は、復号処理に必要となるデータを保持する。ここでは、復号対象の着目画素が位置するラインと、その直前のラインの2ライン分のバッファメモリを用意し、復号済みの画素値を保持する。図7は着目画素とその周辺画素の位置関係を示している。xが復号対象の着目画素である。図示のごとく、参照範囲は、着目画素xが位置するラインとその直前のラインの2ラインにおける、着目画素の周囲画素(左画素a、上画素b、左上画素c)である。ラスタスキャン順に画素を順次復号していくため、左画素a、上画素b、左上画素cは、復号済みの画素である。なお、着目画素xが最初のラインの左端に位置するとき、a、b、cは実在しない。また、着目画素xが2ライン目以降でラインの左端に位置するとき、aは実在しない。このような実在しない画素については、所定の値(たとえば0)を持つものと見なす。符号化に先立って、ラインデータ保持部1104をゼロクリアするのは、かかる理由である。
The line
ステップS1204で、復号部1005は、着目ライン内の全画素の復号を終えたか否かを判定する。言い換えれば、着目ラインのライン終端(右端)の画素の復号を終えたか否かを判定する。着目ライン中の全画素の復号を終えたと判定した場合には、ステップS1205で次のラインの処理に移る。着目ラインの全画素の復号が未完である場合、復号部1005は処理をステップS1206に進める。
In step S1204, the
ステップS1206で、予測変換部1102は、予測変換にMED(Median Edge Detection)予測を用いた予測値pを算出する。図7の周辺画素a、b、cの復号済みの画素値を用いた予測値pの算出式は既に示したが、再度示せば次の通りである。
ステップS1207にて、ゴロム復号部1103は、量子化値qをゴロム・ライス復号に基づくエントロピー復号を行う。パラメータkを用いたゴロム・ライス復号の手順は以下の通りである。
(1)符号データから1ビットずつ取りだし、取り出したビットが"0"である限り、カウントアップしていく。そして、取り出したビットが"1"の場合は次工程(2)に移る。ここでは、ビットが"0"の数をZEROcntと呼ぶ。
(2)ZEROcntをkビット左シフトする。さらに符号データからkビット取りだした値を、シフト後のZEROcntに加算し、シンボルMVを求める。
In step S1207,
(1) One bit is extracted from the code data, and the count is incremented as long as the extracted bit is “0”. When the extracted bit is “1”, the process proceeds to the next step (2). Here, the number whose bits are “0” is referred to as “ZEROcnt”.
(2) Shift Zerocnt to the left by k bits. Further, a value obtained by extracting k bits from the code data is added to the shifted ZEROcnt to obtain a symbol MV.
次に、ゴロム復号部1102は、シンボルMVから量子化値qを算出する。変換式は次の通りである。
ステップS1208で、逆量子化部205は、量子化値qに対して逆量子化を行う。逆量子化部205で行われる処理はフローチャートを図6に示す。逆量子化部205の処理は、つまり、符号化部における処理と同じであるので、ここでの説明は省略する。逆量子化部205の処理により、量子化値iqを算出し、予測値pを用いて着目画素xの復号後の画素値x’を算出する。
x’=iq+p
ステップS1209で、復号部1005は、着目画素xの復号後の画素値x’を設定する。つまり、復号部1005はラインデータ保持部1104で保持している2ライン分のバッファメモリ内の着目画素xの位置に、復号画素値x’を格納する。そして、ステップS1210で、復号部1005は、着目画素xの右隣の画素を新たな着目画素とし、ステップS1204に戻る。
In step S1208, the
x ′ = iq + p
In step S1209, the
図11に戻って、色成分出力部1105は、復号後の画像データを出力部1006に出力する。図10に戻って、出力部1006は、R,G,Bの各成分の画像データを予め設定されたフォーマットにし、記憶部1002に出力し、保存する。または、表示部1007に出力し、表示する。
Returning to FIG. 11, the color
以上説明したように、復号装置では、画像データをニアロスレス復号する際、量子化値の正負の符号に基づき、複数の逆量子化方法を切り替えることで、予測符号化における演算量削減、及び、復号画像の画質向上が期待できる。 As described above, in the decoding apparatus, when performing near-lossless decoding of image data, a plurality of inverse quantization methods are switched based on the sign of the quantization value, thereby reducing the amount of computation in predictive encoding and decoding. Expected to improve image quality.
[第2の実施形態]
第1の実施形態は、画像データを予測符号化でニアロスレス符号化/復号する例を説明した。本第2の実施形態は、画像符号化装置の量子化、逆量子化方法の変形例について説明する。
[Second Embodiment]
The first embodiment has described an example in which image data is near-lossless encoded / decoded by predictive encoding. In the second embodiment, a modification of the quantization and inverse quantization methods of the image encoding device will be described.
本第2の実施形態における画像符号化装置の構成は第1の実施形態の図1と同じであり、符号化部105の構成も図2と同じであるので、それらについての説明は省略する。そこで第1の実施形態と異なる量子化部204、及び、逆量子化部205について、符号化部105の処理と共に説明する。
Since the configuration of the image encoding apparatus in the second embodiment is the same as that of FIG. 1 of the first embodiment and the configuration of the
図5は符号化部105で行われる1つの色成分(実施形態では、R、G、Bのいずれか)の画像データに対する符号化処理を示すフローチャートである。
FIG. 5 is a flowchart showing an encoding process for image data of one color component (in the embodiment, any one of R, G, and B) performed by the
ステップS501からステップS507までは第1の実施形態と共通するので、ここでの説明は省略する。ステップS508において、量子化部204は、予測誤差eを量子化して量子化値qを算出する。この量子化処理は、ニアロスレス符号化におけるパラメータNEARに基づき量子化を行う。本第2の実施形態における予測誤差e(=着目画素xの画素値−予測値p)、パラメータNEARを用いた量子化値qの算出式は次式の通りである。
ステップS509は、第1の実施形態と共通するので、ここでの説明は省略する。ステップS510において、逆量子化部205は、量子化値qに対して逆量子化を行う。逆量子化部205で行われる処理は図6のフローチャートの通りである。
Since step S509 is common to the first embodiment, description thereof is omitted here. In step S510, the
まずステップS601で、判定部208は、量子化値qを取得する。ステップS602で、判定部208は、量子化値の正負の符号に基づき、逆量子化方法を切り替える。即ち、量子化値qが0以上のとき、ステップS603に移り、第1逆量子化部209の処理を行う。また量子化値qが0より小さいとき、ステップS604に移り、第2逆量子化部210の処理を行う。
First, in step S601, the
ステップS603で、第1逆量子化部209は、量子化値q、パラメータNEARを用いて逆量子化を行い、逆量子化値iqを算出する。
iq=q×2×NEAR
ここで、パラメータNEARを1、2、4、8に限定するとき、乗算する値(2×NEAR)は、2、4、8、16と2の累乗数となる。即ち、単純なビットシフトによる演算で逆量子化値iqを算出可能となり、演算コストを削減することができる。もちろんパラメータNEARが他の数値であっても、乗算する値(2×NEAR)が2の累乗数であればビットシフトによる演算が可能である。また、パラメータNEARが3、5など、乗算する値が2の累乗数にならない場合でも、ビットシフトによる演算はできないが、量子化、逆量子化の処理は可能である。
In step S603, the first
iq = q × 2 × NEAR
Here, when the parameter NEAR is limited to 1, 2, 4, and 8, the value to be multiplied (2 × NEAR) is a power of 2, 4, 8, 16, and 2. That is, the inverse quantization value iq can be calculated by a simple bit shift calculation, and the calculation cost can be reduced. Of course, even if the parameter NEAR is another numerical value, if the value to be multiplied (2 × NEAR) is a power of 2, an operation by bit shift is possible. Even if the parameter NEAR is 3, 5 or the like, and the value to be multiplied is not a power of 2, an operation by bit shift is not possible, but quantization and inverse quantization can be performed.
ステップS604、及び、ステップS605で、第2逆量子化部210は、量子化値q、パラメータNEARを用いて逆量子化を行い、逆量子化値iqを算出する。算出式は以下の通りである。
iq=q×2×NEAR−1
まずステップS604では、ステップS603と同様に、量子化値qを(2×NEAR)で乗算する。次にステップS605では、逆量子化値iqが、許容誤差に収まるようにレベルシフトを行う。ここでは1を減算する(−1を加算する)。ステップS508の量子化方法、及び、許容誤差に基づき、レベルシフト値が決定されることになる。
In step S604 and step S605, the second
iq = q × 2 × NEAR-1
First, in step S604, as in step S603, the quantized value q is multiplied by (2 × NEAR). In step S605, a level shift is performed so that the inverse quantized value iq falls within the allowable error. Here, 1 is subtracted (-1 is added). The level shift value is determined based on the quantization method in step S508 and the allowable error.
図13を用いて逆量子化処理を説明する。図13は、上記の量子化、逆量子化の処理を行う例である。ここではパラメータNEARが2の場合について、予測誤差を量子化し、逆量子化したときの予測誤差、量子化値、逆量子化値を示している。予測誤差と逆量子化値を比較したとき、図13は、全てパラメータNEAR(=2)の範囲内の差に収まっていることが分かる。 The inverse quantization process will be described with reference to FIG. FIG. 13 shows an example in which the above quantization and inverse quantization processes are performed. Here, when the parameter NEAR is 2, the prediction error, quantization value, and inverse quantization value when the prediction error is quantized and inversely quantized are shown. When comparing the prediction error and the inverse quantized value, it can be seen that all of FIG. 13 falls within the difference within the range of the parameter NEAR (= 2).
本第2の実施形態の量子化、逆量子化処理では、量子化値0について、+2、−2の誤差を許容できるように設定されており、量子化値0付近の符号化効率を改善させることができる。
In the quantization and inverse quantization processing of the second embodiment, the
また、第1の実施形態と同様に、量子化値が0以上のときは、逆量子化値は4の倍数になるが、量子化値が0より小さいときは、逆量子化値は4の倍数にならないことが分かる。このような逆量子化処理を行うことで、復号画像の疑似輪郭を低減し、画質を向上させることができる。 Similarly to the first embodiment, when the quantized value is 0 or more, the inverse quantized value is a multiple of 4, but when the quantized value is smaller than 0, the inverse quantized value is 4 It turns out that it does not become a multiple. By performing such inverse quantization processing, the pseudo contour of the decoded image can be reduced and the image quality can be improved.
なお、ステップS511、ステップS512は、第1の実施形態と共通するので、ここでの説明は省略する。 Note that step S511 and step S512 are the same as those in the first embodiment, and a description thereof will be omitted here.
次に、復号装置における復号処理を説明する。復号装置の構成は第1の実施形態の図10と同じであり、副後部1005の構成も図11と同じである。よって以下では、復号装置における復号部1005の処理を図12を参照し、復号処理における量子化、逆量子化方法の変形例について説明する。
Next, a decoding process in the decoding device will be described. The configuration of the decoding device is the same as that of FIG. 10 of the first embodiment, and the configuration of the
ステップS1201からステップS1207までは第1の実施形態と共通するので、ここでの説明は省略する。ステップS1208において、逆量子化部205は、量子化値qに対して逆量子化を行う。逆量子化部205で行われる処理のフローチャートを図6に示す。
Steps S1201 to S1207 are the same as those in the first embodiment, and a description thereof will be omitted here. In step S1208, the
まずステップS601で、判定部208は、量子化値qを取得する。ステップS602で、判定部208は、量子化値の正負の符号に基づき、逆量子化方法を切り替える。即ち、量子化値qが0以上のとき、ステップS603に移り、第1逆量子化部209の処理を行う。また量子化値qが0より小さいとき、ステップS604に移り、第2逆量子化部210の処理を行う。
First, in step S601, the
ステップS603で、第1逆量子化部209は、量子化値q、パラメータNEARを用いて逆量子化を行い、逆量子化値iqを算出する。算出式は以下の通りである。
iq=q×2×NEAR
ここで、パラメータNEARを1、2、4、8に限定するとき、乗算する値(2×NEAR)は、2、4、8、16と2の累乗数となる。即ち、単純なビットシフトによる演算で逆量子化値iqが算出可能となり、演算コストを削減することができる。もちろんパラメータNEARが他の数値であっても、乗算する値(2×NEAR)が2の累乗数であればビットシフトによる演算が可能である。また、パラメータNEARが3、5など、乗算する値が2の累乗数にならず、偶数である場合でも、ビットシフトによる演算はできないが、量子化、逆量子化の処理は可能である。
In step S603, the first
iq = q × 2 × NEAR
Here, when the parameter NEAR is limited to 1, 2, 4, and 8, the value to be multiplied (2 × NEAR) is a power of 2, 4, 8, 16, and 2. That is, the inverse quantization value iq can be calculated by a simple bit shift calculation, and the calculation cost can be reduced. Of course, even if the parameter NEAR is another numerical value, if the value to be multiplied (2 × NEAR) is a power of 2, an operation by bit shift is possible. Also, even when the value to be multiplied is not a power of 2, such as a parameter NEAR of 3 or 5, and is an even number, calculation by bit shift cannot be performed, but quantization and inverse quantization can be performed.
ステップS604、及び、ステップS605で、第2逆量子化部210は、量子化値q、パラメータNEARを用いて逆量子化を行い、逆量子化値iqを算出する。算出式は以下の通りである。
iq=q×2×NEAR−1
まずステップS604では、ステップS603と同様に、量子化値qを(2×NEAR)で乗算する。次にステップS605では、逆量子化値iqが、許容誤差に収まるようにレベルシフトを行う。ここでは1を減算する(−1を加算する)。
In step S604 and step S605, the second
iq = q × 2 × NEAR-1
First, in step S604, as in step S603, the quantized value q is multiplied by (2 × NEAR). In step S605, a level shift is performed so that the inverse quantized value iq falls within the allowable error. Here, 1 is subtracted (-1 is added).
図13を用いて逆量子化処理を説明する。図13は、上記の量子化、逆量子化の処理を行う例である。ここではパラメータNEARが2の場合について、予測誤差を量子化し、逆量子化したときの予測誤差、量子化値、逆量子化値を示している。予測誤差と逆量子化値を比較したとき、図13は、全てパラメータNEAR(=2)の範囲内の差に収まっていることが分かる。 The inverse quantization process will be described with reference to FIG. FIG. 13 shows an example in which the above quantization and inverse quantization processes are performed. Here, when the parameter NEAR is 2, the prediction error, quantization value, and inverse quantization value when the prediction error is quantized and inversely quantized are shown. When comparing the prediction error and the inverse quantized value, it can be seen that all of FIG. 13 falls within the difference within the range of the parameter NEAR (= 2).
本第2の実施形態の復号装置における量子化、逆量子化処理では、量子化値0について、+2、−2の誤差を許容できるように設定されており、量子化値0付近の符号化効率を改善させることができる。
In the quantization and inverse quantization processing in the decoding apparatus of the second embodiment, the
また、第1の実施形態と同様に、量子化値が0以上のときは、逆量子化値は4の倍数になるが、量子化値が0より小さいときは、逆量子化値は4の倍数にならないことが分かる。このような逆量子化処理を行うことで、復号画像の疑似輪郭を低減し、画質を向上させることができる。 Similarly to the first embodiment, when the quantized value is 0 or more, the inverse quantized value is a multiple of 4, but when the quantized value is smaller than 0, the inverse quantized value is 4 It turns out that it does not become a multiple. By performing such inverse quantization processing, the pseudo contour of the decoded image can be reduced and the image quality can be improved.
ステップS1209、ステップS1210は、第2の実施形態と共通するので、ここでの説明は省略する。 Steps S1209 and S1210 are common to those in the second embodiment, and a description thereof will be omitted here.
(その他の実施例)
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
(Other examples)
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.
100…カメラ、101…操作部、102…撮像部、103…取得部、104…画像処理部、105…符号化部、106…出力部、107…記憶部、108…I/O、109…情報処理部、201…色成分入力部、202…ラインデータ保持部、203…予測変換部、204…量子化部、205…逆量子化部、206…ゴロム符号化部、207…符号出力部、208…判定部、209…第1逆量子化部、210…第2逆量子化部
DESCRIPTION OF
Claims (9)
符号化対象の画像データにおける着目画素を予測符号化する際の予測値の算出に利用する周囲画素を記憶する記憶手段と、
前記着目画素と、前記記憶手段を参照して求めた前記着目画素の予測値とから、前記着目画素の予測誤差を算出する算出手段と、
該算出手段で得られた予測誤差を、予め設定された許容誤差を表す指標値を用いて量子化することで量子化値を得る量子化手段と、
該量子化手段で得られた量子化値を符号化し、前記着目画素の符号化データとして出力する符号化手段と、
前記量子化手段で得られた量子化値を前記指標値を用いて逆量子化し、当該逆量子化したて得られた逆量子化値と前記予測値とから前記着目画素の位置の復号画素値を求め、当該復号画素値を、前記着目画素に後続して符号化する際の前記周囲画素の1つとするために前記記憶手段に格納するローカル復号手段とを有し、
前記ローカル復号手段は、
前記量子化値の符号が正と負の場合とで、値に1の差を持つ逆量子化値を生成する
ことを特徴とする画像符号化装置。 An image encoding device that performs near-lossless encoding of each pixel of image data within a set allowable error range,
Storage means for storing surrounding pixels used for calculation of a prediction value when predictively encoding a pixel of interest in image data to be encoded;
Calculating means for calculating a prediction error of the target pixel from the target pixel and the predicted value of the target pixel obtained by referring to the storage unit;
Quantizing means for obtaining a quantized value by quantizing the prediction error obtained by the calculating means using an index value representing a preset allowable error;
Encoding means for encoding the quantization value obtained by the quantization means and outputting the encoded value as the encoded data of the pixel of interest;
The quantization value obtained by the quantization means is inversely quantized using the index value, and the decoded pixel value at the position of the pixel of interest is obtained from the inverse quantization value obtained by the inverse quantization and the predicted value. And a local decoding means for storing the decoded pixel value in the storage means so that the decoded pixel value is one of the surrounding pixels when encoding subsequent to the pixel of interest.
The local decoding means includes
An image coding apparatus, wherein a dequantized value having a difference of 1 is generated between a positive value and a negative value of the sign of the quantized value.
前記量子化手段は、量子化値qを次式に従って算出する
ことを特徴とする請求項1に記載の画像符号化装置。 When the pixel of interest to be encoded is x, the predicted value is p, and the index value is NEAR,
The quantization means calculates a quantized value q according to the following equation:
The image coding apparatus according to claim 1.
iq=q×2×NEAR (q≧0の場合)
iq=q×2×NEAR+1 (q<0の場合)
ことを特徴とする請求項2に記載の画像符号化装置。 The local decoding means calculates the inverse quantization value iq according to the following equation: iq = q × 2 × NEAR (when q ≧ 0)
iq = q × 2 × NEAR + 1 (when q <0)
The image coding apparatus according to claim 2, wherein:
前記量子化手段は、量子化値qを次式に従って算出する
ことを特徴とする請求項1に記載の画像符号化装置。 When the pixel of interest to be encoded is x, the predicted value is p, and the index value is NEAR,
The quantization means calculates a quantized value q according to the following equation:
The image coding apparatus according to claim 1.
iq=q×2×NEAR (q≧0の場合)
iq=q×2×NEAR−1 (q<0の場合)
ことを特徴とする請求項4に記載の画像符号化装置。 The local decoding means calculates the inverse quantization value iq according to the following equation: iq = q × 2 × NEAR (when q ≧ 0)
iq = q × 2 × NEAR-1 (when q <0)
The image coding apparatus according to claim 4, wherein:
算出手段が、前記着目画素と、前記記憶手段を参照して求めた前記着目画素の予測値とから、前記着目画素の予測誤差を算出する算出工程と、
量子化手段が、該算出工程で得られた予測誤差を、予め設定された許容誤差を表す指標値を用いて量子化することで量子化値を得る量子化工程と、
符号化手段が、該量子化工程で得られた量子化値を符号化し、前記着目画素の符号化データとして出力する符号化工程と、
ローカル復号手段が、前記量子化工程で得られた量子化値を前記指標値を用いて逆量子化し、当該逆量子化したて得られた逆量子化値と前記予測値とから前記着目画素の位置の復号画素値を求め、当該復号画素値を、前記着目画素に後続して符号化する際の前記周囲画素の1つとするために前記記憶手段に格納するローカル復号工程とを有し、
前記ローカル復号工程は、
前記量子化値の符号が正と負の場合とで、値に1の差を持つ逆量子化値を生成する
ことを特徴とする画像符号化装置の制御方法。 Storage means for storing surrounding pixels used for calculation of a prediction value when predictive encoding of a pixel of interest in image data to be encoded is performed, and each pixel of the image data is within a set allowable error range A control method for an image encoding device that performs near-lossless encoding in
A calculating step of calculating a prediction error of the target pixel from the target pixel and a predicted value of the target pixel obtained by referring to the storage unit;
A quantization step in which the quantization means obtains a quantized value by quantizing the prediction error obtained in the calculation step using an index value representing a preset allowable error;
An encoding step, wherein the encoding means encodes the quantized value obtained in the quantization step and outputs the encoded value as encoded data of the pixel of interest;
A local decoding unit inversely quantizes the quantization value obtained in the quantization step using the index value, and calculates the pixel of interest from the inverse quantization value obtained by the inverse quantization and the predicted value. A local decoding step of obtaining a decoded pixel value of a position, and storing the decoded pixel value in the storage means so as to be one of the surrounding pixels when encoding subsequent to the pixel of interest;
The local decoding step includes
A method for controlling an image coding apparatus, comprising: generating an inverse quantized value having a difference of 1 in a case where the sign of the quantized value is positive and negative.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015214805A JP6581469B2 (en) | 2015-10-30 | 2015-10-30 | Image encoding apparatus, control method therefor, program, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015214805A JP6581469B2 (en) | 2015-10-30 | 2015-10-30 | Image encoding apparatus, control method therefor, program, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017085499A JP2017085499A (en) | 2017-05-18 |
JP6581469B2 true JP6581469B2 (en) | 2019-09-25 |
Family
ID=58711355
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015214805A Active JP6581469B2 (en) | 2015-10-30 | 2015-10-30 | Image encoding apparatus, control method therefor, program, and storage medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6581469B2 (en) |
-
2015
- 2015-10-30 JP JP2015214805A patent/JP6581469B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2017085499A (en) | 2017-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6512928B2 (en) | Image coding apparatus, image processing apparatus, image coding method | |
JP5529685B2 (en) | Image encoding method, image decoding method, image encoding device, and image decoding device | |
JP6727011B2 (en) | Image coding apparatus and control method thereof | |
US10051276B2 (en) | Image encoding apparatus, method and imaging apparatus | |
JP6491628B2 (en) | Video encoding method, video encoding apparatus, and video encoding program | |
WO2009087783A1 (en) | Data generator for coding, method of generating data for coding, decoder and decoding method | |
JP2005323326A (en) | Image encoding apparatus, image decoding apparatus, control method thereof, computer program and computer-readable storage medium | |
JP6502739B2 (en) | Image coding apparatus, image processing apparatus, image coding method | |
JP6512916B2 (en) | Image pickup apparatus, control method thereof and program | |
JP2022140573A (en) | Moving-image decoding device, moving-image decoding method and program | |
JP6077811B2 (en) | Image coding apparatus, image coding method, and program | |
JP6906324B2 (en) | Coding device, coding method, and program | |
WO2012081193A1 (en) | Dynamic image encoding device, dynamic image encoding method, dynamic image encoding program, dynamic image decoding device, dynamic image decoding method, and dynamic image decoding program | |
JP6792351B2 (en) | Encoding device, imaging device, coding method, and program | |
JP2016092589A (en) | Encoder and control method therefor | |
JP6581469B2 (en) | Image encoding apparatus, control method therefor, program, and storage medium | |
JP6946671B2 (en) | Image processing device and image processing method | |
KR20160011359A (en) | Method and apparatus of lens shading compensation coefficient compression and decompression | |
JP6632752B2 (en) | Image encoding apparatus and method, program and storage medium | |
JP6512927B2 (en) | Image coding apparatus and control method thereof | |
JP6465570B2 (en) | IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD | |
JP2012129945A (en) | Moving image decoding apparatus, moving image decoding method and moving image decoding program | |
JP6497981B2 (en) | Image coding apparatus and control method thereof | |
JP2021078008A (en) | Image processing apparatus, image processing method and imaging apparatus | |
JP2020092327A (en) | Image encoding device, image encoding method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20181022 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190723 |
|
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: 20190802 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190830 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6581469 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |