JP6581469B2 - Image encoding apparatus, control method therefor, program, and storage medium - Google Patents

Image encoding apparatus, control method therefor, program, and storage medium Download PDF

Info

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
Application number
JP2015214805A
Other languages
Japanese (ja)
Other versions
JP2017085499A (en
Inventor
正輝 北郷
正輝 北郷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2015214805A priority Critical patent/JP6581469B2/en
Publication of JP2017085499A publication Critical patent/JP2017085499A/en
Application granted granted Critical
Publication of JP6581469B2 publication Critical patent/JP6581469B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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).

特許第4895567号公報Japanese Patent No. 4895567

画像データを予測符号化によりニアロスレス符号化する場合を考察する。この場合のニアロスレス符号化による符号化データから得られた画像データには、設定した許容誤差で規定される特定の値を持つ画素が多く発生する傾向があり、それが擬似輪郭となって現れることがある。   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.

画像符号化装置の構成を示す図。The figure which shows the structure of an image coding apparatus. 符号化部の構成を示す図。The figure which shows the structure of an encoding part. 情報処理部のハードウェア構成を示す図。The figure which shows the hardware constitutions of an information processing part. カメラの撮像部の構成の一例を示す図。The figure which shows an example of a structure of the imaging part of a camera. 符号化部で行われる処理のフローチャート。The flowchart of the process performed in an encoding part. 逆量子化部で行われる処理のフローチャート。The flowchart of the process performed in an inverse quantization part. 着目画素と周辺画素の位置関係を示す図。The figure which shows the positional relationship of a focused pixel and a surrounding pixel. ゴロム・ライス符号化を説明する図。The figure explaining Golomb-Rice encoding. 逆量子化を説明する図。The figure explaining inverse quantization. 画像復号装置の構成の一例を示す図。The figure which shows an example of a structure of an image decoding apparatus. 復号部の構成の一例を示す図。The figure which shows an example of a structure of a decoding part. 復号部で行われる処理のフローチャート。The flowchart of the process performed in a decoding part. 逆量子化を説明する図。The figure explaining inverse quantization.

以下、添付図面に従って本発明に係る実施形態を詳細に説明する。なお、以下に説明する実施形態は、本発明を具体的に実施した場合の一例を示すもので、特許請求の範囲に記載した構成の具体的な実施形態の一つである。   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 camera 100. The camera 100 includes an operation unit 101, an imaging unit 102, an information processing unit 109, a storage unit 107, and an I / O interface 108. The information processing unit 109 includes an acquisition unit 103, an image processing unit 104, an encoding unit 105, and an output unit 106.

図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 camera 100. As illustrated in FIG. 4A, the camera 100 includes an imaging unit 102. FIG. 4B is a diagram illustrating an internal configuration of the imaging unit 102. The imaging unit 102 includes a zoom lens 401, focus lenses 402 and 403, an aperture stop 404, and a shutter 405. The optical low-pass filter 406, iR cut filter 407, color filter 408, image sensor 409, and A / D conversion unit 410 are included. The user can adjust the amount of incident light entering the imaging unit 102 by adjusting the diaphragm 404. The image sensor 409 is a light receiving element such as a CMOS or a CCD. When the light amount of the subject is detected by the image sensor 409, the detected light amount is converted into a digital value by the A / D conversion unit 410 and output to the information processing unit 109 as digital data.

図3は情報処理部109の内部構成を示す図である。情報処理部109は、CPU301、RAM302、ROM303を有し、各構成部はシステムバス304により相互に接続されている。   FIG. 3 is a diagram illustrating an internal configuration of the information processing unit 109. The information processing unit 109 includes a CPU 301, a RAM 302, and a ROM 303, and each component is connected to each other via a system bus 304.

ROM303には、CPU301が実行するプログラムや各種データが記憶されている。RAM302は、CPU301がプログラムを実行した際のワークエリア、各種バッファとして利用される。CPU301は、ROM303に格納されたプログラムを実行し、RAM302をワークエリアやバッファとして利用する。この結果、CPU301は、先に示した図1の取得部103、画像処理部104、符号化部105、出力部106として機能すると共に、装置全体の制御を司ることになる。なお、ここでは、各構成要素を、CPU301が実行することで実現するものとしたが、同等の処理を果たす専用の回路等で実現しても構わない。   The ROM 303 stores programs executed by the CPU 301 and various data. The RAM 302 is used as a work area and various buffers when the CPU 301 executes a program. The CPU 301 executes a program stored in the ROM 303 and uses the RAM 302 as a work area or a buffer. As a result, the CPU 301 functions as the acquisition unit 103, the image processing unit 104, the encoding unit 105, and the output unit 106 shown in FIG. 1 and controls the entire apparatus. Here, each component is realized by being executed by the CPU 301, but may be realized by a dedicated circuit or the like that performs equivalent processing.

操作部101は、カメラ本体に備えられたボタンやダイヤル、タッチパネルなどの入力装置であり、ユーザが操作して、撮影の開始、停止および撮影条件の設定などの命令を行える。後述するパラメータNEARも、ユーザの指示に従ってこの操作部101から設定されるものである。ここでパラメータNEARは、ニアロスレス符号化を行う際の許容誤差を表す指標値であり、ユーザが許容誤差の大小の指示したとき、その指示に応じて1、2、4、8…と、2の累乗数の値の1つがNEARとして設定されるものとする。   The operation unit 101 is an input device such as a button, dial, or touch panel provided in the camera body, and can be operated by the user to give instructions such as start / stop of shooting and setting of shooting conditions. A parameter NEAR, which will be described later, is also set from the operation unit 101 in accordance with a user instruction. Here, the parameter NEAR is an index value representing an allowable error when performing near-lossless encoding. When the user indicates the size of the allowable error, 1, 2, 4, 8,. One of the power numbers is assumed to be set as NEAR.

記憶部107は、撮像部102により取得されたRAW画像データ、および、画像データを保存することができる、メモリカードなどの不揮発性の記憶媒体である。I/Oインターフェース108はユニバーサルシリアルバス(USB)によって実装されたシリアルバス接続を利用でき、対応するUSBコネクタを有する。もちろん、I/Oインターフェース108を、光ファイバによるLAN接続や、無線接続などに利用しても構わない。表示部305は、撮影画像や文字の表示を行う。表示部305には一般的に液晶ディスプレイが用いられる。またタッチパネル機能を有していても良く、その場合はタッチパネルを用いたユーザ指示を操作部101の入力として扱うことも可能である。   The storage unit 107 is a non-volatile storage medium such as a memory card that can store the RAW image data acquired by the imaging unit 102 and the image data. The I / O interface 108 can use a serial bus connection implemented by a universal serial bus (USB), and has a corresponding USB connector. Of course, the I / O interface 108 may be used for LAN connection by optical fiber or wireless connection. A display unit 305 displays captured images and characters. A liquid crystal display is generally used for the display unit 305. Further, a touch panel function may be provided, and in that case, a user instruction using the touch panel can be handled as an input of the operation unit 101.

以下、本実施形態に示す情報処理部109の処理について説明する。ユーザの操作部101に対する撮像指示に基づき、取得部103は、撮像部102から出力されたベイヤ配列のRAW画像データを取得し、画像処理部104にそのRAW画像データを供給する。画像処理部104は、RAW画像データを、デモザイク処理して、通常の1画素がRGBの3成分で構成される画像データを生成し、符号化部105にその画像データを供給する。符号化部105は、供給された画像データを、設定された許容誤差範囲内で符号化処理を行うことになる。   Hereinafter, processing of the information processing unit 109 illustrated in the present embodiment will be described. Based on the imaging instruction to the user operation unit 101, the acquisition unit 103 acquires the RAW image data of the Bayer array output from the imaging unit 102 and supplies the RAW image data to the image processing unit 104. The image processing unit 104 performs demosaic processing on the RAW image data, generates image data in which one normal pixel is composed of three components of RGB, and supplies the image data to the encoding unit 105. The encoding unit 105 performs an encoding process on the supplied image data within a set allowable error range.

なお、本実施形態における符号化対象の画像データの画素は、上記のように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 encoding unit 105 in the embodiment will be described by taking an example of encoding as a monochrome image in units of color components. That is, the R component monochrome multi-valued image, the G component monochrome multi-valued image, and the B component monochrome multi-valued image are encoded independently.

よって、本実施形態における符号化対象の画像データは、単一成分のみのモノクロ画像の符号化であっても良いのは明らかである。また、符号化対象の画像データは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 imaging unit 102 have a Bayer array (an array of 2 × 2 imaging elements corresponding to the colors R, G0, G1, and B). When the signal from each image sensor is expressed by 14 bits, a monochrome multivalued image composed of R components, a monochrome multivalued image composed of G0 components, a monochrome multivalued image composed of G1 components, B Each monochrome multi-valued image composed of components is encoded. Therefore, the present application is not limited by the type of color space of the image, the type of color components constituting the image, and the number of bits. It should be understood that the encoding target image has three components of R, G, and B, each having 8 bits (256 gradations), for the sake of easy understanding.

本実施形態における符号化部105の処理について説明する。図2は符号化部105の内部構成であり、図5は符号化部105で行われる1つの色成分(実施形態では、R、G、Bのいずれか)のモノクロ多値画像データに対する符号化処理を示すフローチャートである。つまり、実際には図5の処理を3回実行する。そして、3回行った結果得られた符号データをまとめて、1つのファイルが構成されることになる。   Processing of the encoding unit 105 in the present embodiment will be described. FIG. 2 shows an internal configuration of the encoding unit 105. FIG. 5 shows encoding of monochrome multilevel image data of one color component (in the embodiment, any one of R, G, and B) performed by the encoding unit 105. It is a flowchart which shows a process. That is, the process of FIG. 5 is actually executed three times. Then, the code data obtained as a result of the three times is collected to form one file.

まずステップS501で、色成分入力部201は、画像処理部104から供給された画像データにおける1つの成分の画像データをモノクロ多値画像として入力する。   First, in step S <b> 501, the color component input unit 201 inputs image data of one component in the image data supplied from the image processing unit 104 as a monochrome multilevel image.

ステップS502で、符号化部105は、モノクロ多値画像内の画素が全て符号化されたかを判定する。全て符号化された場合は符号化処理を終了し、符号化されていない画素がある場合は、ステップS503に移る。   In step S502, the encoding unit 105 determines whether all the pixels in the monochrome multilevel image have been encoded. If all the pixels are encoded, the encoding process is terminated, and if there is a pixel that is not encoded, the process proceeds to step S503.

ステップS503で、符号化部105は、モノクロ多値画像の画素値をライン単位に入力する。そしてステップS504で、符号化部105は、入力したラインにおける左端に位置する画素を符号化対象の着目画素として設定する。   In step S503, the encoding unit 105 inputs the pixel value of the monochrome multivalued image in units of lines. In step S504, the encoding unit 105 sets a pixel located at the left end of the input line as a target pixel to be encoded.

ラインデータ保持部202は、符号化処理に必要となるデータをRAM302内に予め確保されたバッファ領域に保持する。このバッファ領域には、符号化対象の着目画素が位置するラインと、その直前のラインの2ライン分のデータを保持するものとする。図7は着目画素とその周辺画素の位置関係を示している。図示のxが符号化対象の着目画素である。図示のごとく、参照範囲は、着目画素xが位置するラインとその直前のラインの2ラインにおける、着目画素の周囲画素(左画素a、上画素b、左上画素c)である。また、実施形態では、ラスタスキャン順に画素を順次符号化していくため、着目画素xの左画素a、上画素b、左上画素cは、符号化済みの画素である。ニアロスレス符号化では、符号化以前の画素値と復号後の画素値の差を、設定した許容範囲内にすることができる。このため、バッファ領域内の符号化済みの画素位置には、復号後の画素値が記憶保持されることになる(ローカル復号)。   The line data holding unit 202 holds data necessary for the encoding process in a buffer area secured in advance in the RAM 302. It is assumed that the buffer area holds data for two lines, the line where the pixel of interest to be encoded is located and the immediately preceding line. FIG. 7 shows the positional relationship between the pixel of interest and its surrounding pixels. The x shown in the figure is the target pixel to be encoded. As shown in the figure, the reference range is the surrounding pixels (left pixel a, upper pixel b, upper left pixel c) of the target pixel in two lines, the line where the target pixel x is located and the line immediately preceding it. Further, in the embodiment, since the pixels are sequentially encoded in the raster scan order, the left pixel a, the upper pixel b, and the upper left pixel c of the target pixel x are already encoded pixels. In near lossless encoding, the difference between the pixel value before encoding and the pixel value after decoding can be set within a set allowable range. For this reason, the decoded pixel value in the buffer area is stored and held (local decoding).

なお、着目画素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 encoding unit 105 determines whether all the pixels in the target line have been encoded. In other words, it is determined whether or not the encoding of the pixel at the line end (right end) of the line of interest has been completed. If it is determined that all pixels in the line have been encoded, the process proceeds to the next line in step S506. If encoding of all the pixels of the line of interest is incomplete, the encoding unit 105 proceeds with the process to step S507.

ステップS507で、予測変換部203は、着目画素に対する予測値pを算出し、着目画素xと予測値pとの差である予測誤差e(=x−p)を導出する。実施形態において、予測値pは、MED(Median Edge Detection)予測を用いて算出するものとする。図7の周辺画素a、b、cの画素値を用いた予測値pの算出式は以下の通りである。

Figure 0006581469
In step S507, the prediction conversion unit 203 calculates a prediction value p for the target pixel, and derives a prediction error e (= x−p) that is a difference between the target pixel x and the prediction value p. In the embodiment, the predicted value p is calculated by using MED (Media Edge Detection) prediction. The calculation formula of the predicted value p using the pixel values of the peripheral pixels a, b, and c in FIG. 7 is as follows.
Figure 0006581469

予測変換部203は、上記のようにして求めた予測値pと着目画素xの差分から、予測誤差を導出する。   The prediction conversion unit 203 derives a prediction error from the difference between the predicted value p obtained as described above and the target pixel x.

ステップS508で、量子化部204は、予測誤差eを量子化して量子化値qを算出する。量子化部204は、ニアロスレス符号化におけるパラメータ“NEAR”に基づき量子化を行う。パラメータNEARは、符号化/復号に伴う画素値の変化の大きさの最大値を指定するものであり、ここでは許容誤差と呼ぶ。予測誤差e(=着目画素値x−予測値p)、パラメータNEARを用いた量子化値qの算出式は以下の通りである。

Figure 0006581469
In step S508, the quantization unit 204 quantizes the prediction error e to calculate a quantization value q. The quantization unit 204 performs quantization based on the parameter “NEAR” in near lossless coding. The parameter NEAR specifies the maximum value of the change in the pixel value accompanying encoding / decoding, and is referred to as an allowable error here. The calculation formula of the quantization value q using the prediction error e (= target pixel value x−prediction value p) and the parameter NEAR is as follows.
Figure 0006581469

パラメータ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の正負の符号が判別できることになる。

Figure 0006581469
In step S509, the Golomb encoding unit 206 performs Golomb-Rice encoding on the quantized value q. The Golomb encoding unit 207 first converts the quantized value q into a non-negative integer value MV. The conversion formula is as follows. As is apparent from this equation, the sign of the quantized value q can be determined depending on whether the integer value MV is even or odd.
Figure 0006581469

次に、ゴロム符号化部206は、パラメータkを用いて整数値MVをゴロム・ライス符号化でエントロピー符号化する。ゴロム・ライス符号化の手順は以下の通りである。
(1)整数値MVを2進数表現して、整数値MVをkビット右シフトした値で示される個数の0を並べ、その後に1を付加する。
(2)工程(1)の後ろに、MVの下位kビットを取りだして付け加える。
Next, the Golomb encoding unit 206 performs entropy encoding on the integer value MV by Golomb-Rice encoding using the parameter k. The procedure for Golomb-Rice coding is as follows.
(1) The integer value MV is expressed in binary, and the number 0 indicated by a value obtained by shifting the integer value MV to the right by k bits is arranged, and then 1 is added.
(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 Golomb encoding unit 206 finishes outputting the code word for the pixel of interest x, the process proceeds to step S510.

ステップS510にて、逆量子化部205は、量子化値qに対する逆量子化処理を含むローカル復号処理を行う。逆量子化部205で行われる処理のフローチャートを図6に示す。   In step S510, the inverse quantization unit 205 performs local decoding processing including inverse quantization processing for the quantized value q. A flowchart of the processing performed in the inverse quantization unit 205 is shown in FIG.

まずステップS601で、判定部208は、量子化値qを取得する。ステップS602で、判定部208は、量子化値の正負の符号に基づき、逆量子化方法を切り替える。即ち、量子化値qが0以上のとき、ステップS603に移り、第1逆量子化部209の処理を行う。また量子化値qが0より小さいとき、ステップS604に移り、第2逆量子化部210の処理を行う。   First, in step S601, the determination unit 208 acquires a quantized value q. In step S602, the determination unit 208 switches the inverse quantization method based on the sign of the quantization value. That is, when the quantized value q is 0 or more, the process proceeds to step S603 and the first inverse quantization unit 209 performs processing. When the quantized value q is smaller than 0, the process proceeds to step S604, where the second inverse quantization unit 210 performs the process.

ステップ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 inverse quantization unit 209 performs inverse quantization using the quantization value q and the parameter NEAR, and calculates an inverse quantization value iq. The calculation formula is as follows.
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 inverse quantization unit 210 performs inverse quantization using the quantization value q and the parameter NEAR, and calculates an inverse quantization value iq. The calculation formula is as follows.
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 inverse quantization unit 205 calculates a decoded pixel value x ′ of the pixel of interest x using the inverse quantization value iq and the predicted value p. The calculation formula of the pixel value x ′ is as follows.
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 encoding unit 105 updates the pixel value x of the pixel of interest. Specifically, the value of the pixel of interest x before encoding in the buffer area of the line data holding unit 202 is replaced with the pixel value x ′ after decoding. In step S512, the encoding unit 105 sets the pixel on the right side of the target pixel x as a new target pixel, and returns to step S505.

図2に戻って、符号出力部207は、ゴロム符号化部206で生成された符号化データを出力部106に供給する。出力部106は、復号に必要な情報を含むヘッダを生成し、生成したヘッダに後続して、符号出力部207から供給された符号化データを記憶部107に出力し、保存する。保存された符号化データは、I/Oインターフェース108を介して、カメラ外のデバイスに出力される。   Returning to FIG. 2, the code output unit 207 supplies the encoded data generated by the Golomb encoding unit 206 to the output unit 106. The output unit 106 generates a header including information necessary for decoding, and outputs the encoded data supplied from the code output unit 207 to the storage unit 107 following the generated header and stores it. The stored encoded data is output to a device outside the camera via the I / O interface 108.

次に、実施形態における第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 inverse quantization unit 209 and the second inverse quantization unit 210 in the embodiment will be described. As described above, when the parameter NEAR is limited to 1, 2, 4, and 8, the multiplication process can be realized with a simple bit shift, and the calculation cost can be reduced. Further, the improvement of the image quality of the decoded image will be described with reference to FIG. Details of the decoding process will be described in the second embodiment. Here, a case where the parameter NEAR is 2 is taken as an example. FIG. 9A shows a case where the level shift of step 605 is not performed in the inverse quantization process. It can be seen that the inverse quantization value is a multiple of 4.

復号画素値x’は、次式のように算出される。
復号画素値x’=逆量子化値iq+予測値p
逆量子化値が4の倍数であるため、予測値pが4の倍数であれば、復号画素値x’は4の倍数となる。予測値pは、周辺画素からMED予測で算出される。MED予測を再度示せば次の通りである。

Figure 0006581469
The decoded pixel value x ′ is calculated as follows:
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.
Figure 0006581469

周囲画素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 camera 100 of the first embodiment will be described. FIG. 10 is a diagram illustrating an example of a configuration of a device 1000 that performs image decoding according to the first embodiment. The device 1000 includes an I / O interface 1001, a storage unit 1002, an operation unit 1003, an information processing unit 1008, and a display unit 1007.

デバイス1000の種類は特に問わないが、典型的にはコンピュータ、または、カメラである。本第1の実施形態におけるデバイス1000をコンピュータとして説明する。I/Oインターフェース1001は、I/Oインターフェース108と同様にUSBコネクタを有する。デバイス1000は、I/Oインターフェース1001を介して、カメラ100のI/Oインターフェース108から出力される圧縮画像データを取得する。   The type of device 1000 is not particularly limited, but is typically a computer or a camera. The device 1000 in the first embodiment will be described as a computer. Similar to the I / O interface 108, the I / O interface 1001 has a USB connector. The device 1000 acquires compressed image data output from the I / O interface 108 of the camera 100 via the I / O interface 1001.

記録部1002は、I/Oインターフェース1001から取得された圧縮画像データを保存することができるメモリカードなどの不揮発性の記憶媒体である。操作部1003は、コンピュータに備えられたキーボード、マウスなどの入力装置であり、ユーザが操作して復号処理などの命令を行える。表示部1007は、復号画像の表示等が行え、一般的に液晶ディスプレイが用いられる。情報処理部1008の内部構成は、図3に示す情報処理部109と同様である。   The recording unit 1002 is a nonvolatile storage medium such as a memory card that can store compressed image data acquired from the I / O interface 1001. The operation unit 1003 is an input device such as a keyboard and a mouse provided in the computer, and can be operated by a user to issue an instruction such as a decoding process. The display unit 1007 can display a decoded image, and a liquid crystal display is generally used. The internal configuration of the information processing unit 1008 is the same as that of the information processing unit 109 shown in FIG.

以下、本第1の実施形態における情報処理部1008の処理について説明する。ユーザの操作部1003に対する復号指示に基づき、取得部1004は、記憶部1002から圧縮画像データ(第1の実施形態の装置で符号化したデータファイル)を取得し、復号部1005に圧縮画像データを供給する。   Hereinafter, processing of the information processing unit 1008 in the first embodiment will be described. Based on the decoding instruction to the user operation unit 1003, the acquisition unit 1004 acquires compressed image data (data file encoded by the apparatus of the first embodiment) from the storage unit 1002, and stores the compressed image data in the decoding unit 1005. Supply.

復号部1005は、圧縮画像データの復号処理を行う。本第1の実施形態では1画素がRGB各8ビットで表現されるものとし、色成分を単位にモノクロ画像として復号する場合を例に説明する。つまり、R成分のモノクロ多値画像、G成分のモノクロ多値画像、B成分のモノクロ多値画像をそれぞれ独立して復号する。   The decoding unit 1005 performs a decoding process on the compressed image data. In the first embodiment, an example will be described in which one pixel is represented by 8 bits for each of RGB and is decoded as a monochrome image in units of color components. That is, the R component monochrome multivalued image, the G component monochrome multivalued image, and the B component monochrome multivalued image are decoded independently.

本第1の実施形態に示す復号部1005の処理について説明する。図11は復号部1005の内部構成であり、図12は復号部1005で行われる1つの色成分(実施形態では、R、G、Bのいずれか)の符号データに対する復号処理を示すフローチャートである。つまり、実際には図12の処理を3回実行する。そして、3回行った結果得られたR成分、G成分、B成分のモノクロ多値画像をまとめることで、カラー画像データが生成される。なお、ラインデータ保持部1104は2ライン分の容量を有し、復号に先立ち0クリアされるものとする。   Processing of the decoding unit 1005 shown in the first embodiment will be described. FIG. 11 is an internal configuration of the decoding unit 1005, and FIG. 12 is a flowchart showing a decoding process for code data of one color component (in the embodiment, any one of R, G, and B) performed by the decoding unit 1005. . That is, the process of FIG. 12 is actually executed three times. Then, color image data is generated by combining the monochrome multi-valued images of the R component, G component, and B component obtained as a result of performing three times. The line data holding unit 1104 has a capacity for two lines and is cleared to 0 prior to decoding.

まずステップS1201で、符号入力部1101は、取得部1004から出力された圧縮画像データにおける1つの成分の符号データを入力する。ステップS1202で、復号部1005は、モノクロ多値画像内の画素が全て復号されたかを判定する。全て復号された場合は復号処理を終了し、復号されていない画素がある場合は、ステップS1203に移る。ステップS1203にて、復号部1005は、復号するラインにおける左端に位置する画素を復号対象の着目画素として設定する。   First, in step S <b> 1201, the code input unit 1101 inputs code data of one component in the compressed image data output from the acquisition unit 1004. In step S1202, the decoding unit 1005 determines whether all the pixels in the monochrome multi-valued image have been decoded. If all the pixels are decoded, the decoding process is terminated. If there is a pixel that has not been decoded, the process proceeds to step S1203. In step S1203, the decoding unit 1005 sets a pixel located at the left end of the line to be decoded as a target pixel to be decoded.

ラインデータ保持部1104は、復号処理に必要となるデータを保持する。ここでは、復号対象の着目画素が位置するラインと、その直前のラインの2ライン分のバッファメモリを用意し、復号済みの画素値を保持する。図7は着目画素とその周辺画素の位置関係を示している。xが復号対象の着目画素である。図示のごとく、参照範囲は、着目画素xが位置するラインとその直前のラインの2ラインにおける、着目画素の周囲画素(左画素a、上画素b、左上画素c)である。ラスタスキャン順に画素を順次復号していくため、左画素a、上画素b、左上画素cは、復号済みの画素である。なお、着目画素xが最初のラインの左端に位置するとき、a、b、cは実在しない。また、着目画素xが2ライン目以降でラインの左端に位置するとき、aは実在しない。このような実在しない画素については、所定の値(たとえば0)を持つものと見なす。符号化に先立って、ラインデータ保持部1104をゼロクリアするのは、かかる理由である。   The line data holding unit 1104 holds data necessary for the decoding process. Here, a buffer memory is prepared for two lines of the line where the target pixel to be decoded is located and the line immediately before the line, and the decoded pixel value is held. FIG. 7 shows the positional relationship between the pixel of interest and its surrounding pixels. x is a target pixel to be decoded. As shown in the figure, the reference range is the surrounding pixels (left pixel a, upper pixel b, upper left pixel c) of the target pixel in two lines, the line where the target pixel x is located and the line immediately preceding it. Since the pixels are sequentially decoded in the raster scan order, the left pixel a, the upper pixel b, and the upper left pixel c are decoded pixels. Note that when the pixel of interest x is located at the left end of the first line, a, b, and c do not exist. In addition, when the pixel of interest x is located at the left end of the line after the second line, a does not exist. Such a nonexistent pixel is considered to have a predetermined value (for example, 0). This is why the line data holding unit 1104 is cleared to zero prior to encoding.

ステップS1204で、復号部1005は、着目ライン内の全画素の復号を終えたか否かを判定する。言い換えれば、着目ラインのライン終端(右端)の画素の復号を終えたか否かを判定する。着目ライン中の全画素の復号を終えたと判定した場合には、ステップS1205で次のラインの処理に移る。着目ラインの全画素の復号が未完である場合、復号部1005は処理をステップS1206に進める。   In step S1204, the decoding unit 1005 determines whether or not decoding of all the pixels in the line of interest has been completed. In other words, it is determined whether or not the decoding of the pixel at the line end (right end) of the line of interest has been completed. If it is determined that all the pixels in the line of interest have been decoded, the process proceeds to the next line in step S1205. When decoding of all the pixels of the line of interest is incomplete, the decoding unit 1005 advances the process to step S1206.

ステップS1206で、予測変換部1102は、予測変換にMED(Median Edge Detection)予測を用いた予測値pを算出する。図7の周辺画素a、b、cの復号済みの画素値を用いた予測値pの算出式は既に示したが、再度示せば次の通りである。

Figure 0006581469
In step S1206, the prediction conversion unit 1102 calculates a prediction value p using MED (Media Edge Detection) prediction for prediction conversion. The formula for calculating the predicted value p using the decoded pixel values of the peripheral pixels a, b, and c in FIG. 7 has already been shown.
Figure 0006581469

ステップS1207にて、ゴロム復号部1103は、量子化値qをゴロム・ライス復号に基づくエントロピー復号を行う。パラメータkを用いたゴロム・ライス復号の手順は以下の通りである。
(1)符号データから1ビットずつ取りだし、取り出したビットが"0"である限り、カウントアップしていく。そして、取り出したビットが"1"の場合は次工程(2)に移る。ここでは、ビットが"0"の数をZEROcntと呼ぶ。
(2)ZEROcntをkビット左シフトする。さらに符号データからkビット取りだした値を、シフト後のZEROcntに加算し、シンボルMVを求める。
In step S1207, Golomb decoding section 1103 performs entropy decoding on quantized value q based on Golomb-Rice decoding. The procedure for Golomb-Rice decoding using the parameter k is as follows.
(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を算出する。変換式は次の通りである。

Figure 0006581469
Next, Golomb decoding section 1102 calculates quantized value q from symbol MV. The conversion formula is as follows.
Figure 0006581469

ステップ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 inverse quantization unit 205 performs inverse quantization on the quantized value q. A process performed by the inverse quantization unit 205 is shown in a flowchart in FIG. Since the processing of the inverse quantization unit 205 is the same as the processing in the encoding unit, description thereof is omitted here. By the process of the inverse quantization unit 205, a quantized value iq is calculated, and a pixel value x ′ after decoding of the pixel of interest x is calculated using the predicted value p.
x ′ = iq + p
In step S1209, the decoding unit 1005 sets a decoded pixel value x ′ of the pixel of interest x. That is, the decoding unit 1005 stores the decoded pixel value x ′ at the position of the pixel of interest x in the buffer memory for two lines held by the line data holding unit 1104. In step S1210, the decoding unit 1005 sets the pixel immediately adjacent to the target pixel x as a new target pixel, and returns to step S1204.

図11に戻って、色成分出力部1105は、復号後の画像データを出力部1006に出力する。図10に戻って、出力部1006は、R,G,Bの各成分の画像データを予め設定されたフォーマットにし、記憶部1002に出力し、保存する。または、表示部1007に出力し、表示する。   Returning to FIG. 11, the color component output unit 1105 outputs the decoded image data to the output unit 1006. Returning to FIG. 10, the output unit 1006 converts the image data of R, G, and B components into a preset format, and outputs the data to the storage unit 1002 for storage. Or it outputs to the display part 1007 and displays.

以上説明したように、復号装置では、画像データをニアロスレス復号する際、量子化値の正負の符号に基づき、複数の逆量子化方法を切り替えることで、予測符号化における演算量削減、及び、復号画像の画質向上が期待できる。   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 encoding unit 105 is also the same as that of FIG. 2, description thereof will be omitted. Therefore, the quantization unit 204 and the inverse quantization unit 205 different from the first embodiment will be described together with the processing of the encoding unit 105.

図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 encoding unit 105.

ステップS501からステップS507までは第1の実施形態と共通するので、ここでの説明は省略する。ステップS508において、量子化部204は、予測誤差eを量子化して量子化値qを算出する。この量子化処理は、ニアロスレス符号化におけるパラメータNEARに基づき量子化を行う。本第2の実施形態における予測誤差e(=着目画素xの画素値−予測値p)、パラメータNEARを用いた量子化値qの算出式は次式の通りである。

Figure 0006581469
Steps S501 to S507 are the same as those in the first embodiment, and a description thereof will be omitted here. In step S508, the quantization unit 204 quantizes the prediction error e to calculate a quantization value q. This quantization processing is performed based on the parameter NEAR in the near lossless encoding. The calculation formula of the quantization value q using the prediction error e (= the pixel value of the target pixel x−the prediction value p) and the parameter NEAR in the second embodiment is as follows.
Figure 0006581469

ステップ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 inverse quantization unit 205 performs inverse quantization on the quantized value q. The processing performed in the inverse quantization unit 205 is as shown in the flowchart of FIG.

まずステップS601で、判定部208は、量子化値qを取得する。ステップS602で、判定部208は、量子化値の正負の符号に基づき、逆量子化方法を切り替える。即ち、量子化値qが0以上のとき、ステップS603に移り、第1逆量子化部209の処理を行う。また量子化値qが0より小さいとき、ステップS604に移り、第2逆量子化部210の処理を行う。   First, in step S601, the determination unit 208 acquires a quantized value q. In step S602, the determination unit 208 switches the inverse quantization method based on the sign of the quantization value. That is, when the quantized value q is 0 or more, the process proceeds to step S603 and the first inverse quantization unit 209 performs processing. When the quantized value q is smaller than 0, the process proceeds to step S604, where the second inverse quantization unit 210 performs the process.

ステップ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 inverse quantization unit 209 performs inverse quantization using the quantization value q and the parameter NEAR, and calculates an inverse quantization value iq.
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 inverse quantization unit 210 performs inverse quantization using the quantization value q and the parameter NEAR, and calculates an inverse quantization value iq. The calculation formula is as follows.
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 quantization value 0 is set so as to allow an error of +2 and -2, and the coding efficiency near the quantization value 0 is improved. be able to.

また、第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 sub rear portion 1005 is also the same as that of FIG. Therefore, hereinafter, the process of the decoding unit 1005 in the decoding apparatus will be described with reference to FIG. 12 and a modification of the quantization and inverse quantization methods in the decoding process.

ステップ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 inverse quantization unit 205 performs inverse quantization on the quantized value q. A flowchart of the processing performed in the inverse quantization unit 205 is shown in FIG.

まずステップS601で、判定部208は、量子化値qを取得する。ステップS602で、判定部208は、量子化値の正負の符号に基づき、逆量子化方法を切り替える。即ち、量子化値qが0以上のとき、ステップS603に移り、第1逆量子化部209の処理を行う。また量子化値qが0より小さいとき、ステップS604に移り、第2逆量子化部210の処理を行う。   First, in step S601, the determination unit 208 acquires a quantized value q. In step S602, the determination unit 208 switches the inverse quantization method based on the sign of the quantization value. That is, when the quantized value q is 0 or more, the process proceeds to step S603 and the first inverse quantization unit 209 performs processing. When the quantized value q is smaller than 0, the process proceeds to step S604, where the second inverse quantization unit 210 performs the process.

ステップ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 inverse quantization unit 209 performs inverse quantization using the quantization value q and the parameter NEAR, and calculates an inverse quantization value iq. The calculation formula is as follows.
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 inverse quantization unit 210 performs inverse quantization using the quantization value q and the parameter NEAR, and calculates an inverse quantization value iq. The calculation formula is as follows.
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 quantization value 0 is set so as to allow an error of +2 and -2, and the coding efficiency near the quantization value 0 is set. Can be improved.

また、第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 SYMBOLS 100 ... Camera 101 ... Operation part 102 ... Imaging part 103 ... Acquisition part 104 ... Image processing part 105 ... Encoding part 106 ... Output part 107 ... Storage part 108 ... I / O, 109 ... Information Processing unit 201 ... Color component input unit 202 202 Line data holding unit 203 ... Prediction conversion unit 204 ... Quantization unit 205 ... Inverse quantization unit 206 ... Golomb encoding unit 207 ... Code output unit 208 ... determination unit, 209 ... first inverse quantization unit, 210 ... second inverse quantization unit

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.
符号化対象の着目画素をx、予測値をp、前記指標値をNEARとしたとき、
前記量子化手段は、量子化値qを次式に従って算出する
Figure 0006581469
ことを特徴とする請求項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:
Figure 0006581469
The image coding apparatus according to claim 1.
前記ローカル復号手段は、次式に従って前記逆量子化値iqを算出する
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:
符号化対象の着目画素をx、予測値をp、前記指標値をNEARとしたとき、
前記量子化手段は、量子化値qを次式に従って算出する
Figure 0006581469
ことを特徴とする請求項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:
Figure 0006581469
The image coding apparatus according to claim 1.
前記ローカル復号手段は、次式に従って前記逆量子化値iqを算出する
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:
ユーザの操作に応じて、2の累乗数を前記指標値として生成する生成手段を更に有することを特徴とする請求項1乃至5のいずれか1項に記載の画像符号化装置。   The image coding apparatus according to claim 1, further comprising a generation unit configured to generate a power of 2 as the index value in response to a user operation. コンピュータが読み込み実行することで、前記コンピュータを、請求項1乃至6のいずれか1項に記載の画像符号化装置が有する各手段として機能させるためのプログラム。   A program for causing a computer to function as each unit included in the image encoding device according to any one of claims 1 to 6 when the computer reads and executes the computer. 請求項7に記載のプログラムを格納した、コンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 7. 符号化対象の画像データにおける着目画素を予測符号化する際の予測値の算出に利用する周囲画素を記憶するための記憶手段を有し、前記画像データの各画素を、設定した許容誤差範囲内でニアロスレス符号化する画像符号化装置の制御方法であって、
算出手段が、前記着目画素と、前記記憶手段を参照して求めた前記着目画素の予測値とから、前記着目画素の予測誤差を算出する算出工程と、
量子化手段が、該算出工程で得られた予測誤差を、予め設定された許容誤差を表す指標値を用いて量子化することで量子化値を得る量子化工程と、
符号化手段が、該量子化工程で得られた量子化値を符号化し、前記着目画素の符号化データとして出力する符号化工程と、
ローカル復号手段が、前記量子化工程で得られた量子化値を前記指標値を用いて逆量子化し、当該逆量子化したて得られた逆量子化値と前記予測値とから前記着目画素の位置の復号画素値を求め、当該復号画素値を、前記着目画素に後続して符号化する際の前記周囲画素の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.
JP2015214805A 2015-10-30 2015-10-30 Image encoding apparatus, control method therefor, program, and storage medium Active JP6581469B2 (en)

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)

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