Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5036626B2 - Image encoding apparatus and image decoding apparatus - Google Patents
[go: Go Back, main page]

JP5036626B2 - Image encoding apparatus and image decoding apparatus - Google Patents

Image encoding apparatus and image decoding apparatus Download PDF

Info

Publication number
JP5036626B2
JP5036626B2 JP2008134571A JP2008134571A JP5036626B2 JP 5036626 B2 JP5036626 B2 JP 5036626B2 JP 2008134571 A JP2008134571 A JP 2008134571A JP 2008134571 A JP2008134571 A JP 2008134571A JP 5036626 B2 JP5036626 B2 JP 5036626B2
Authority
JP
Japan
Prior art keywords
quantization
data
pixel
block
gradation level
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.)
Expired - Fee Related
Application number
JP2008134571A
Other languages
Japanese (ja)
Other versions
JP2009284244A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2008134571A priority Critical patent/JP5036626B2/en
Publication of JP2009284244A publication Critical patent/JP2009284244A/en
Application granted granted Critical
Publication of JP5036626B2 publication Critical patent/JP5036626B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Description

この発明は、撮像素子から出力される画像データが示す各画素の階調レベルを量子化して符号化データを作成する画像符号化装置と、画像符号化装置から出力された符号化データを復号化して画像データを作成する画像復号化装置とに関するものである。   The present invention relates to an image encoding device that generates encoded data by quantizing the gradation level of each pixel indicated by image data output from an image sensor, and to decode encoded data output from the image encoding device. The present invention relates to an image decoding apparatus that generates image data.

FBTC符号化方式の画像符号化装置では、画像をM×N(M、Nは自然数)のブロックに分割し、それぞれのブロックに関して、ブロック内の画素値が平均された画素基準レベルLAと、画素値の最大値と最小値の差違を示す画素値変動幅LDを求めるようにしている。
そして、画素基準レベルLAと画素値変動幅LDから各画素の画素値を量子化する際の量子化閾値を算出し、各画素の画素値を量子化閾値と比較して、各画素の画素値を量子化値に変換することで画像の圧縮を行うようにしている。
In the image encoding apparatus of the FBTC encoding method, an image is divided into M × N blocks (M and N are natural numbers), and for each block, a pixel reference level LA in which pixel values in the block are averaged, and pixels A pixel value fluctuation range LD indicating a difference between the maximum value and the minimum value is obtained.
Then, a quantization threshold for quantizing the pixel value of each pixel is calculated from the pixel reference level LA and the pixel value fluctuation width LD, and the pixel value of each pixel is compared with the quantization threshold. Is converted into a quantized value to compress the image.

例えば、以下の特許文献1には、ブロック毎に量子化閾値を求める際の内分比率を可変化し、外部から内分比率を指定できるようにしている構成が開示されている。
また、ブロック毎に内分比率を選択し、その内分比率を示す情報を付加情報として符号化する場合の構成についても開示されている。
さらに、ブロック毎に、画像データの分布にしたがって内分比率を選択する構成についても開示されている。
For example, Patent Document 1 below discloses a configuration in which an internal division ratio for obtaining a quantization threshold value for each block is made variable so that the internal division ratio can be designated from the outside.
In addition, a configuration in which an internal ratio is selected for each block and information indicating the internal ratio is encoded as additional information is also disclosed.
Furthermore, a configuration is also disclosed in which an internal ratio is selected for each block according to the distribution of image data.

ただし、以下の特許文献1に開示されている画像符号化装置では、各ブロックの符号化サイズが固定されている。
これはFBTC符号化方式の特徴の一つであるが、一般的な画像の特性では、画素値の変動が少ない情報量が小さい領域と、画素値の変動が大きい情報量が多い領域とが混在している。
このため、画像全体が同一の符号化サイズで固定されていると、情報量が多い領域と少ない領域で画質の差違が大きくなることがある。
However, in the image encoding device disclosed in Patent Document 1 below, the encoding size of each block is fixed.
This is one of the characteristics of the FBTC coding system. However, in general image characteristics, a region with a small amount of information with a small variation in pixel value and a region with a large amount of information with a large variation in pixel value are mixed. is doing.
For this reason, if the entire image is fixed at the same encoding size, the difference in image quality may be large between a region with a large amount of information and a region with a small amount of information.

また、伸張後の画像において、カメラ画像等の自然画領域と、地図や図面等の領域とが混在している場合にも、自然画領域は、含まれる情報量が大きいため画質の劣化が大きくなる一方、図面領域は、画質の劣化が小さくなる。
このため、表示画像全体として、画質の一貫性が保てなくなることがある。
In addition, even when a natural image region such as a camera image and a region such as a map or a drawing are mixed in the expanded image, the natural image region contains a large amount of information, so the image quality is greatly deteriorated. On the other hand, the image quality in the drawing area is reduced.
For this reason, the consistency of image quality may not be maintained for the entire display image.

特開平6−292027号公報(段落番号[0015]から[0016]、図1)Japanese Patent Laid-Open No. 6-292027 (paragraph numbers [0015] to [0016], FIG. 1)

従来の画像符号化装置は以上のように構成されているので、画像全体が同一の符号化サイズで固定されており、画素値の変動が少ない情報量が小さい領域と、画素値の変動が大きい情報量が多い領域とが混在している画像の場合、情報量が多い領域と少ない領域で画質の差違が大きくなることがある課題があった。   Since the conventional image coding apparatus is configured as described above, the entire image is fixed at the same coding size, the pixel value variation is small, the information amount is small, and the pixel value variation is large. In the case of an image in which a region with a large amount of information is mixed, there is a problem that a difference in image quality may increase between a region with a large amount of information and a region with a small amount of information.

この発明は上記のような課題を解決するためになされたもので、符号化効率の向上と画像全体の画質の向上を図ることができる画像符号化装置を得ることを目的とする。
また、この発明は、画像全体で画質の差違が少ない均質な画像を生成することができる画像復号化装置を得ることを目的とする。
The present invention has been made to solve the above-described problems, and an object of the present invention is to obtain an image encoding apparatus capable of improving the encoding efficiency and the image quality of the entire image.
It is another object of the present invention to provide an image decoding apparatus that can generate a homogeneous image with little difference in image quality over the entire image.

この発明に係る画像符号化装置は、予め用意されている複数のデータ量子化方法に対応するものとして、信号レベル範囲検出手段により検出された最大値及び最小値から各ブロックにおける階調レベルの基準レベル及び変動幅を算出する複数の符号化準備手段と、符号化準備手段により算出された基準レベル及び変動幅から各ブロックにおける階調レベルの量子化閾値を算出するとともに、その基準レベル及び変動幅から、量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベルを算出する複数の量子化閾値算出手段と、各ブロックにおける各画素の階調レベルと量子化閾値算出手段により算出された量子化閾値を比較して、各画素の階調レベルに対応する固有の符号を特定し、その固有の符号を量子化データとして各画素に割り当てる複数の量子化手段と、量子化閾値算出手段により算出された固有の符号が復号化された場合の各画素の階調レベルと量子化手段により量子化データが割り当てられる前の各画素の階調レベルとの誤差の絶対値をブロック毎に積算する複数の量子化誤差積算手段とを備えているとともに、ブロック毎に、複数の量子化手段により割り当てられた量子化データのうち、量子化誤差積算手段により積算された誤差の絶対値が許容閾値を超えない条件の下で、データ量が最も少ない量子化データを選択し、その量子化データ、その量子化データに係る量子化方法を示す方法識別情報、及び符号化準備手段により算出された基準レベル及び変動幅からなる符号化データを作成する符号化データ作成手段を備え、符号化データ作成手段は、画像1フレーム当りの目標符号量と、処理済のブロックの積算符号量と、未処理のブロックの数とから、未処理のブロックの1ブロック当りの目標符号量を算出し、未処理のブロックの1ブロック当りの目標符号量から許容閾値を決定することを特徴とするものである。 The image encoding apparatus according to the present invention is based on a reference of the gradation level in each block from the maximum value and the minimum value detected by the signal level range detection means, corresponding to a plurality of data quantization methods prepared in advance. A plurality of encoding preparation means for calculating a level and a fluctuation range, and calculating a quantization threshold of a gradation level in each block from the reference level and fluctuation width calculated by the encoding preparation means, and the reference level and fluctuation width A plurality of quantization threshold calculation means for calculating the gradation level of each pixel when a unique code assigned as quantized data is decoded, and the gradation level and quantization threshold calculation of each pixel in each block The quantization threshold calculated by the means is compared to identify a unique code corresponding to the gradation level of each pixel, and the unique code is converted into the quantization data. A plurality of quantization means to be assigned to each pixel, and the gradation level of each pixel when the unique code calculated by the quantization threshold value calculation means is decoded and before the quantization data is assigned by the quantization means A plurality of quantization error integration means for integrating the absolute value of the error with the gradation level of each pixel for each block, and among the quantized data assigned by the plurality of quantization means for each block , Selecting the quantized data with the smallest data amount under the condition that the absolute value of the error accumulated by the quantization error accumulating means does not exceed the allowable threshold, and quantizing the quantized data and the quantized data It includes a method identification information, and encoded data generating means for generating a coded data consisting of the calculated reference level and fluctuation width by the encoding preparation means indicating how the encoded data The generating means calculates the target code amount per block of the unprocessed block from the target code amount per image frame, the accumulated code amount of the processed blocks, and the number of unprocessed blocks. The allowable threshold value is determined from the target code amount per block of the processing block .

この発明によれば、予め用意されている複数のデータ量子化方法に対応するものとして、信号レベル範囲検出手段により検出された最大値及び最小値から各ブロックにおける階調レベルの基準レベル及び変動幅を算出する複数の符号化準備手段と、符号化準備手段により算出された基準レベル及び変動幅から各ブロックにおける階調レベルの量子化閾値を算出するとともに、その基準レベル及び変動幅から、量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベルを算出する複数の量子化閾値算出手段と、各ブロックにおける各画素の階調レベルと量子化閾値算出手段により算出された量子化閾値を比較して、各画素の階調レベルに対応する固有の符号を特定し、その固有の符号を量子化データとして各画素に割り当てる複数の量子化手段と、量子化閾値算出手段により算出された固有の符号が復号化された場合の各画素の階調レベルと量子化手段により量子化データが割り当てられる前の各画素の階調レベルとの誤差の絶対値をブロック毎に積算する複数の量子化誤差積算手段とを備えているとともに、ブロック毎に、複数の量子化手段により割り当てられた量子化データのうち、量子化誤差積算手段により積算された誤差の絶対値が許容閾値を超えない条件の下で、データ量が最も少ない量子化データを選択し、量子化データ、量子化データに係る量子化方法を示す方法識別情報、及び符号化準備手段により算出された基準レベル及び変動幅からなる符号化データを作成する符号化データ作成手段を備え、符号化データ作成手段は、画像1フレーム当りの目標符号量と、処理済のブロックの積算符号量と、未処理のブロックの数とから、未処理のブロックの1ブロック当りの目標符号量を算出し、未処理のブロックの1ブロック当りの目標符号量から許容閾値を決定することを特徴とするように構成したので、符号化効率の向上と画像全体の画質の向上を図ることができる効果がある。
According to the present invention, as corresponding to a plurality of data quantization methods prepared in advance, the reference level and fluctuation range of the gradation level in each block from the maximum value and the minimum value detected by the signal level range detection means A plurality of encoding preparation means for calculating the threshold value, and the quantization threshold of the gradation level in each block from the reference level and the fluctuation range calculated by the encoding preparation means, and the quantization level from the reference level and fluctuation width Calculated by a plurality of quantization threshold calculation means for calculating the gradation level of each pixel when a unique code assigned as data is decoded, and the gradation level of each pixel in each block and the quantization threshold calculation means The unique quantization code corresponding to the gradation level of each pixel is identified, and the unique code is used as quantized data for each pixel. A plurality of quantization means to be assigned, a gradation level of each pixel when the unique code calculated by the quantization threshold calculation means is decoded, and a level of each pixel before the quantization data is assigned by the quantization means A plurality of quantization error integration means for integrating the absolute value of the error with the key level for each block, and among the quantized data allocated by the plurality of quantization means for each block, the quantization error Method identification information indicating the quantized data and the quantizing method related to the quantized data by selecting the quantized data with the smallest data amount under the condition that the absolute value of the error accumulated by the accumulating means does not exceed the allowable threshold , and includes a coded data generating means for generating a coded data consisting of the calculated reference level and fluctuation width by the encoding preparing means, the encoded data generating means, image 1 frame The target code amount per unprocessed block is calculated from the target code amount per block, the accumulated code amount of processed blocks, and the number of unprocessed blocks, and one block of unprocessed blocks Since the permissible threshold is determined from the target code amount per hit, there is an effect that it is possible to improve the encoding efficiency and the image quality of the entire image.

実施の形態1.
図1はこの発明の実施の形態1による画像符号化装置を示す構成図であり、図において、画像データ分割部1は撮像素子から出力される画像データをM×N(M、Nは自然数)のブロックに分割する処理を実施する。なお、画像データ分割部1は画像データ分割手段を構成している。
信号レベル範囲検出部2は画像データ分割部1により分割された画像データが示す各画素の階調レベルXij(例えば、1≦i≦4,1≦j≦4)を参照して、各ブロックにおける階調レベルの最大値Lmax及び最小値Lminを検出する処理を実施する。なお、信号レベル範囲検出部2は信号レベル範囲検出手段を構成している。
Embodiment 1 FIG.
FIG. 1 is a block diagram showing an image encoding apparatus according to Embodiment 1 of the present invention. In the figure, an image data dividing unit 1 outputs image data output from an image sensor M × N (M and N are natural numbers). The process of dividing into blocks is performed. The image data dividing unit 1 constitutes image data dividing means.
The signal level range detection unit 2 refers to the gradation level Xij (for example, 1 ≦ i ≦ 4, 1 ≦ j ≦ 4) of each pixel indicated by the image data divided by the image data division unit 1, in each block. A process of detecting the maximum value Lmax and the minimum value Lmin of the gradation level is performed. The signal level range detector 2 constitutes a signal level range detection means.

符号化部3は信号レベル範囲検出部2により検出された各ブロックにおける階調レベルの最大値Lmax及び最小値Lminを用いて、各ブロックにおける各画素の階調レベルを量子化して符号化データを作成する処理を実施する。なお、符号化部3は符号化手段を構成している。
量子化部4aは予め用意されているデータ量子化方法aで、各ブロックにおける各画素の階調レベルを量子化する処理を実施する。
量子化部4bは予め用意されているデータ量子化方法bで、各ブロックにおける各画素の階調レベルを量子化する処理を実施する。
量子化部4cは予め用意されているデータ量子化方法cで、各ブロックにおける各画素の階調レベルを量子化する処理を実施する。
この実施の形態1では、3つの量子化部4a〜4cが実装されているものを示しているが、これは一例に過ぎず、4つ以上の量子化部が実装されていてもよい。
The encoding unit 3 quantizes the gradation level of each pixel in each block using the maximum value Lmax and the minimum value Lmin of the gradation level in each block detected by the signal level range detection unit 2, and encodes the encoded data. Implement the process to create. Note that the encoding unit 3 constitutes an encoding unit.
The quantization unit 4a performs a process of quantizing the gradation level of each pixel in each block by a data quantization method a prepared in advance.
The quantization unit 4b performs a process of quantizing the gradation level of each pixel in each block by a data quantization method b prepared in advance.
The quantization unit 4c performs a process of quantizing the gradation level of each pixel in each block by a data quantization method c prepared in advance.
In the first embodiment, three quantizers 4a to 4c are mounted, but this is only an example, and four or more quantizers may be mounted.

量子化部4aの符号化準備部5aは信号レベル範囲検出部2により検出された最大値Lmax及び最小値Lminから各ブロックにおける階調レベルの画素基準レベルLAa及び画素値変動幅LDaを算出する処理を実施する。
量子化閾値算出部6aは符号化準備部5aにより算出された画素基準レベルLAa及び画素値変動幅LDaから各ブロックにおける階調レベルの量子化閾値La1を算出するとともに、画素基準レベルLAa及び画素値変動幅LDaから、量子化処理部7aにより量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベルQa1〜Qa2を算出する処理を実施する。
量子化処理部7aは各ブロックにおける各画素の階調レベルXijと量子化閾値算出部6aにより算出された量子化閾値La1を比較して、各画素の階調レベルXijに対応する固有の符号を特定し、その固有の符号を量子化データφaij(例えば、1≦i≦4,1≦j≦4)として各画素に割り当てる処理を実施する。
量子化誤差積算部8aは量子化閾値算出部6aにより算出された固有の符号が復号化された場合の各画素の階調レベルQa1〜Qa2と量子化処理部7aにより量子化データが割り当てられる前の各画素の階調レベルXijとの誤差δaij(例えば、1≦i≦4,1≦j≦4)の絶対値をブロック毎に積算する処理を実施する。
The encoding preparation unit 5a of the quantization unit 4a calculates the pixel reference level LAa and the pixel value variation width LDa of the gradation level in each block from the maximum value Lmax and the minimum value Lmin detected by the signal level range detection unit 2. To implement.
The quantization threshold value calculation unit 6a calculates a gradation level quantization threshold value La1 in each block from the pixel reference level LAa and the pixel value variation width LDa calculated by the encoding preparation unit 5a, and also calculates the pixel reference level LAa and the pixel value. A process of calculating the gradation levels Qa1 to Qa2 of each pixel when a unique code assigned as quantized data by the quantization processor 7a is decoded from the variation width LDa is performed.
The quantization processing unit 7a compares the gradation level Xij of each pixel in each block with the quantization threshold value La1 calculated by the quantization threshold value calculation unit 6a, and assigns a unique code corresponding to the gradation level Xij of each pixel. A process of identifying and assigning the unique code to each pixel as quantized data φaij (for example, 1 ≦ i ≦ 4, 1 ≦ j ≦ 4) is performed.
The quantization error accumulating unit 8a has the gradation levels Qa1 to Qa2 of each pixel when the unique code calculated by the quantization threshold calculating unit 6a is decoded and before the quantized data is allocated by the quantization processing unit 7a. The process of integrating the absolute value of the error δaij (for example, 1 ≦ i ≦ 4, 1 ≦ j ≦ 4) with the gradation level Xij of each pixel for each block is performed.

量子化部4bの符号化準備部5bは信号レベル範囲検出部2により検出された最大値Lmax及び最小値Lminから各ブロックにおける階調レベルの画素基準レベルLAb及び画素値変動幅LDbを算出する処理を実施する。
量子化閾値算出部6bは符号化準備部5bにより算出された画素基準レベルLAb及び画素値変動幅LDbから各ブロックにおける階調レベルの量子化閾値Lb1〜Lb3を算出するとともに、画素基準レベルLAb及び画素値変動幅LDbから、量子化処理部7bにより量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベルQb1〜Qb4を算出する処理を実施する。
量子化処理部7bは各ブロックにおける各画素の階調レベルXijと量子化閾値算出部6bにより算出された量子化閾値Lb1〜Lb3を比較して、各画素の階調レベルXijに対応する固有の符号を特定し、その固有の符号を量子化データφbij(例えば、1≦i≦4,1≦j≦4)として各画素に割り当てる処理を実施する。
量子化誤差積算部8bは量子化閾値算出部6bにより算出された固有の符号が復号化された場合の各画素の階調レベルQb1〜Qb4と量子化処理部7bにより量子化データが割り当てられる前の各画素の階調レベルXijとの誤差δbij(例えば、1≦i≦4,1≦j≦4)の絶対値をブロック毎に積算する処理を実施する。
The encoding preparation unit 5b of the quantization unit 4b calculates the pixel reference level LAb and the pixel value variation width LDb of the gradation level in each block from the maximum value Lmax and the minimum value Lmin detected by the signal level range detection unit 2. To implement.
The quantization threshold calculation unit 6b calculates the gradation threshold quantization thresholds Lb1 to Lb3 in each block from the pixel reference level LAb and the pixel value variation width LDb calculated by the encoding preparation unit 5b, and the pixel reference level LAb and A process of calculating gradation levels Qb1 to Qb4 of each pixel when a unique code assigned as quantized data by the quantization processing unit 7b is decoded from the pixel value variation width LDb is performed.
The quantization processing unit 7b compares the gradation level Xij of each pixel in each block with the quantization thresholds Lb1 to Lb3 calculated by the quantization threshold calculation unit 6b, and determines the uniqueness corresponding to the gradation level Xij of each pixel. A process is performed in which a code is specified and the unique code is assigned to each pixel as quantized data φbij (for example, 1 ≦ i ≦ 4, 1 ≦ j ≦ 4).
The quantization error accumulating unit 8b has the gradation levels Qb1 to Qb4 of each pixel when the unique code calculated by the quantization threshold calculating unit 6b is decoded and before the quantized data is allocated by the quantization processing unit 7b. A process of integrating the absolute value of an error δbij (for example, 1 ≦ i ≦ 4, 1 ≦ j ≦ 4) from the gradation level Xij of each pixel for each block is performed.

量子化部4cの符号化準備部5cは信号レベル範囲検出部2により検出された最大値Lmax及び最小値Lminから各ブロックにおける階調レベルの画素基準レベルLAc及び画素値変動幅LDcを算出する処理を実施する。
量子化閾値算出部6cは符号化準備部5cにより算出された画素基準レベルLAc及び画素値変動幅LDcから各ブロックにおける階調レベルの量子化閾値Lc1〜Lc7を算出するとともに、画素基準レベルLAc及び画素値変動幅LDcから、量子化処理部7cにより量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベルQc1〜Qc8を算出する処理を実施する。
量子化処理部7cは各ブロックにおける各画素の階調レベルXijと量子化閾値算出部6cにより算出された量子化閾値LC1〜Lc7を比較して、各画素の階調レベルXijに対応する固有の符号を特定し、その固有の符号を量子化データφcij(例えば、1≦i≦4,1≦j≦4)として各画素に割り当てる処理を実施する。
量子化誤差積算部8cは量子化閾値算出部6cにより算出された固有の符号が復号化された場合の各画素の階調レベルQc1〜Qc8と量子化処理部7cにより量子化データが割り当てられる前の各画素の階調レベルXijとの誤差δcij(例えば、1≦i≦4,1≦j≦4)の絶対値をブロック毎に積算する処理を実施する。
The encoding preparation unit 5c of the quantization unit 4c calculates the pixel reference level LAc and the pixel value variation width LDc of the gradation level in each block from the maximum value Lmax and the minimum value Lmin detected by the signal level range detection unit 2. To implement.
The quantization threshold calculation unit 6c calculates the gradation threshold quantization thresholds Lc1 to Lc7 in each block from the pixel reference level LAc and the pixel value variation width LDc calculated by the encoding preparation unit 5c, and the pixel reference level LAc and A process of calculating gradation levels Qc1 to Qc8 of each pixel when a unique code assigned as quantized data is decoded by the quantization processing unit 7c from the pixel value variation width LDc is performed.
The quantization processing unit 7c compares the gradation level Xij of each pixel in each block with the quantization threshold values LC1 to Lc7 calculated by the quantization threshold value calculation unit 6c, and determines the uniqueness corresponding to the gradation level Xij of each pixel. A process is performed in which a code is specified and the unique code is assigned to each pixel as quantized data φcij (for example, 1 ≦ i ≦ 4, 1 ≦ j ≦ 4).
The quantization error accumulating unit 8c has gradation levels Qc1 to Qc8 of each pixel when the unique code calculated by the quantization threshold calculating unit 6c is decoded and before the quantized data is allocated by the quantization processing unit 7c. The process of integrating the absolute value of the error δcij (for example, 1 ≦ i ≦ 4, 1 ≦ j ≦ 4) from the gradation level Xij of each pixel for each block is performed.

なお、符号化準備部5a,5b,5cは符号化準備手段を構成し、量子化閾値算出部6a,6b,6cは量子化閾値算出手段を構成している。
また、量子化処理部7a,7b,7cは量子化手段を構成し、量子化誤差積算部8a,8b,8cは量子化誤差積算手段を構成している。
The encoding preparation units 5a, 5b, and 5c constitute an encoding preparation unit, and the quantization threshold calculation units 6a, 6b, and 6c constitute a quantization threshold calculation unit.
The quantization processing units 7a, 7b, and 7c constitute quantization means, and the quantization error integration units 8a, 8b, and 8c constitute quantization error integration means.

符号化データ作成部9はブロック毎に、量子化処理部7a,7b,7cにより割り当てられた量子化データφaij,φbij,φcijのうち、量子化誤差積算部8a,8b,8cにより積算された誤差δaij,δbij,δcijの絶対値が許容閾値ΔTを超えない条件の下で、データ量が最も少ない量子化データφnij(n=“a”or“b”or“c”)を選択し、その量子化データφnij、その量子化データφnijに係るデータ量子化方法nを示すフラグ(方法識別情報)、及び符号化準備部5nにより算出された画素基準レベルLAn及び画素値変動幅LDnからなる符号化データを作成する処理を実施する。なお、符号化データ作成部9は符号化データ作成手段を構成している。
図2はこの発明の実施の形態1による画像符号化装置の処理内容を示すフローチャートである。
The encoded data creating unit 9 is an error accumulated by the quantization error accumulating units 8a, 8b, and 8c among the quantized data φaij, φbij, and φcij assigned by the quantization processing units 7a, 7b, and 7c for each block. Under the condition that the absolute values of δaij, δbij, and δcij do not exceed the allowable threshold value ΔT, the quantized data φnij (n = “a” or “b” or “c”) having the smallest data amount is selected and the quantum Encoded data consisting of the encoded data φnij, a flag (method identification information) indicating the data quantization method n related to the quantized data φnij, the pixel reference level LAn and the pixel value variation width LDn calculated by the encoding preparation unit 5n Implement the process to create. The encoded data creation unit 9 constitutes encoded data creation means.
FIG. 2 is a flowchart showing the processing contents of the image coding apparatus according to Embodiment 1 of the present invention.

次に動作について説明する。
画像データ分割部1は、撮像素子から画像データを受けると、その画像データをM×N(M、Nは自然数)のブロックに分割する(ステップST1)。
この実施の形態1では、説明の便宜上、各ブロックが水平4画素、垂直4画素の16画素からなるものとして説明する。
Next, the operation will be described.
When receiving image data from the image sensor, the image data dividing unit 1 divides the image data into M × N blocks (M and N are natural numbers) (step ST1).
In the first embodiment, for convenience of explanation, each block is assumed to be composed of 16 pixels of 4 horizontal pixels and 4 vertical pixels.

信号レベル範囲検出部2は、画像データ分割部1が画像データをM×Nのブロックに分割すると、M×Nのブロックの中から、未だ符号化処理を実施していない未処理のブロックを一つ選択する(ステップST2)。
信号レベル範囲検出部2は、未処理のブロックを選択すると、そのブロックにおける各画素の階調レベルを参照して、そのブロックにおける階調レベルの最大値Lmax及び最小値Lminを検出する(ステップST3)。
When the image data dividing unit 1 divides the image data into M × N blocks, the signal level range detecting unit 2 selects one unprocessed block that has not yet been encoded from the M × N blocks. Are selected (step ST2).
When the unprocessed block is selected, the signal level range detection unit 2 refers to the gradation level of each pixel in the block and detects the maximum value Lmax and the minimum value Lmin of the gradation level in the block (step ST3). ).

量子化部4aの符号化準備部5aは、信号レベル範囲検出部2が階調レベルの最大値Lmax及び最小値Lminを検出すると、データ量子化方法aが係る算出方法で、その階調レベルの最大値Lmax及び最小値Lminから当該ブロックにおける階調レベルの画素基準レベルLAa及び画素値変動幅LDaを算出する(ステップST4a)。
また、量子化部4bの符号化準備部5bは、信号レベル範囲検出部2が階調レベルの最大値Lmax及び最小値Lminを検出すると、データ量子化方法bが係る算出方法で、その階調レベルの最大値Lmax及び最小値Lminから当該ブロックにおける階調レベルの画素基準レベルLAb及び画素値変動幅LDbを算出する(ステップST4b)。
また、量子化部4cの符号化準備部5cは、信号レベル範囲検出部2が階調レベルの最大値Lmax及び最小値Lminを検出すると、データ量子化方法cが係る算出方法で、その階調レベルの最大値Lmax及び最小値Lminから当該ブロックにおける階調レベルの画素基準レベルLAc及び画素値変動幅LDcを算出する(ステップST4c)。
以下、符号化準備部5n(n=“a”or“b”or“c”)における画素基準レベルLAn及び画素値変動幅LDnの算出方法を具体的に説明する。
When the signal level range detection unit 2 detects the maximum value Lmax and the minimum value Lmin of the gradation level, the encoding preparation unit 5a of the quantization unit 4a uses the calculation method related to the data quantization method a to calculate the gradation level. From the maximum value Lmax and the minimum value Lmin, the pixel reference level LAa and the pixel value variation width LDa of the gradation level in the block are calculated (step ST4a).
Also, the encoding preparation unit 5b of the quantization unit 4b uses the calculation method related to the data quantization method b when the signal level range detection unit 2 detects the maximum value Lmax and the minimum value Lmin of the gradation level. From the maximum value Lmax and the minimum value Lmin of the level, the pixel reference level LAb and the pixel value variation width LDb of the gradation level in the block are calculated (step ST4b).
Also, the encoding preparation unit 5c of the quantization unit 4c uses the calculation method related to the data quantization method c when the signal level range detection unit 2 detects the maximum value Lmax and the minimum value Lmin of the gradation level. From the maximum value Lmax and the minimum value Lmin of the level, the pixel reference level LAc and the pixel value variation width LDc of the gradation level in the block are calculated (step ST4c).
Hereinafter, a calculation method of the pixel reference level LAn and the pixel value variation width LDn in the encoding preparation unit 5n (n = “a” or “b” or “c”) will be specifically described.

まず、符号化準備部5nは、下記の式(1)(2)に示すように、画素基準レベルLAn及び画素値変動幅LDnを算出する際の参照画素を決めるための閾値P1n,P2nを算出する。
P1n=(K1n×Lmax+K2n×Lmin)/(K1n+K2n) (1)
P2n=(K2n×Lmax+K1n×Lmin)/(K1n+K2n) (2)
ここでは、閾値P1n,P2nを、階調レベルの最大値Lmax及び最小値Lminを加重平均した値として算出しているが、この際、加重平均に適用する係数K1n,K2nは、画像の階調レベル分布状態や、各画素の階調レベル変換の際に割り当てられるビット数や、本技術を適用するシステムの画像の特性に応じて、量子化誤差がなるべく小さくなる値を選択することが可能である。
First, as shown in the following formulas (1) and (2), the encoding preparation unit 5n calculates thresholds P1n and P2n for determining a reference pixel when calculating the pixel reference level LAn and the pixel value variation width LDn. To do.
P1n = (K1n × Lmax + K2n × Lmin) / (K1n + K2n) (1)
P2n = (K2n × Lmax + K1n × Lmin) / (K1n + K2n) (2)
Here, the threshold values P1n and P2n are calculated as values obtained by weighted averaging of the maximum value Lmax and the minimum value Lmin of the gradation level. At this time, the coefficients K1n and K2n applied to the weighted average are the gradation values of the image. A value that minimizes the quantization error can be selected according to the level distribution state, the number of bits assigned when converting the gradation level of each pixel, and the characteristics of the image of the system to which the present technology is applied. is there.

この実施の形態1では、例えば、データ量子化方法aは符号に割り当てる階調数を1bit2階調、データ量子化方法bは符号に割り当てる階調数を2bit4階調、データ量子化方法cは符号に割り当てる階調数を3bit8階調として、係数K1n,K2nの値を図3の通りとする。
また、当該ブロックの各画素の階調レベルXij(1≦i≦4,1≦j≦4)について、Xij≦P1nを満たす画素の階調レベル平均値をQmin_nとする。
また、Xij>P2nを満たす画素の階調レベル平均値をQmax_nとする。
In the first embodiment, for example, the data quantization method a has a 1-bit 2 gradation number assigned to a code, the data quantization method b has a 2-bit 4 gradation number assigned to a code, and the data quantization method c has a code. The number of gradations to be assigned to is 3 bits and 8 gradations, and the values of the coefficients K1n and K2n are as shown in FIG.
In addition, regarding the gradation level Xij (1 ≦ i ≦ 4, 1 ≦ j ≦ 4) of each pixel of the block, the average value of gradation levels of pixels satisfying Xij ≦ P1n is defined as Qmin_n.
Further, an average gradation level value of pixels satisfying Xij> P2n is set to Qmax_n.

符号化準備部5nは、階調レベル平均値Qmin_n,Qmax_nを下記の式(3)(4)に代入して、画素基準レベルLAn及び画素値変動幅LDnを算出する。
LAn=(Qmin_n+Qmax_n)/2 (3)
LDn=(Qmax_n−Qmin_n) (4)
The encoding preparation unit 5n calculates the pixel reference level LAn and the pixel value variation width LDn by substituting the gradation level average values Qmin_n and Qmax_n into the following equations (3) and (4).
LAn = (Qmin_n + Qmax_n) / 2 (3)
LDn = (Qmax_n−Qmin_n) (4)

量子化部4aの量子化閾値算出部6aは、符号化準備部5aが画素基準レベルLAa及び画素値変動幅LDaを算出すると、その画素基準レベルLAa及び画素値変動幅LDaから当該ブロックにおける階調レベルの量子化閾値La1を算出するとともに、その画素基準レベルLAa及び画素値変動幅LDaから、量子化処理部7aにより量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベル(復号レベル)Qa1〜Qa2を算出する(ステップST5a)。
また、量子化部4bの量子化閾値算出部6bは、符号化準備部5bが画素基準レベルLAb及び画素値変動幅LDbを算出すると、その画素基準レベルLAb及び画素値変動幅LDbから当該ブロックにおける階調レベルの量子化閾値Lb1〜Lb3を算出するとともに、その画素基準レベルLAb及び画素値変動幅LDbから、量子化処理部7bにより量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベル(復号レベル)Qb1〜Qb4を算出する(ステップST5b)。
また、量子化部4cの量子化閾値算出部6cは、符号化準備部5cが画素基準レベルLAc及び画素値変動幅LDcを算出すると、その画素基準レベルLAc及び画素値変動幅LDcから当該ブロックにおける階調レベルの量子化閾値Lc1〜Lc7を算出するとともに、画素基準レベルLAc及び画素値変動幅LDcから、量子化処理部7cにより量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベル(復号レベル)Qc1〜Qc8を算出する(ステップST5c)。
When the encoding preparation unit 5a calculates the pixel reference level LAa and the pixel value variation width LDa, the quantization threshold calculation unit 6a of the quantization unit 4a determines the gradation in the block from the pixel reference level LAa and the pixel value variation width LDa. The quantization threshold value La1 of the level is calculated, and from the pixel reference level LAa and the pixel value variation width LDa, each pixel level when a unique code assigned as quantized data by the quantization processing unit 7a is decoded. Key levels (decoding levels) Qa1 to Qa2 are calculated (step ST5a).
In addition, when the encoding preparation unit 5b calculates the pixel reference level LAb and the pixel value variation width LDb, the quantization threshold calculation unit 6b of the quantization unit 4b uses the pixel reference level LAb and the pixel value variation width LDb in the block. When the quantization thresholds Lb1 to Lb3 of the gradation level are calculated, and a unique code assigned as quantized data by the quantization processing unit 7b is decoded from the pixel reference level LAb and the pixel value fluctuation width LDb. The gradation levels (decoding levels) Qb1 to Qb4 of each pixel are calculated (step ST5b).
Further, the quantization threshold calculation unit 6c of the quantization unit 4c calculates the pixel reference level LAc and the pixel value variation width LDc from the pixel reference level LAc and the pixel value variation width LDc when the encoding preparation unit 5c calculates the pixel reference level LAc and the pixel value variation width LDc. While calculating the quantization thresholds Lc1 to Lc7 of the gradation level, each of the unique codes assigned as quantized data by the quantization processing unit 7c from the pixel reference level LAc and the pixel value fluctuation width LDc is decoded. Pixel gradation levels (decoding levels) Qc1 to Qc8 are calculated (step ST5c).

量子化閾値算出部6a,6b,6cにより算出される量子化閾値の数は、階調レベルを変換する符号に割り当てられるビット数に対応させる必要がある。
データ量子化方法aは符号に割り当てる階調数を1bit2階調、データ量子化方法bは符号に割り当てる階調数を2bit4階調、データ量子化方法cは符号に割り当てる階調数を3bit8階調としているので、データ量子化方法aに対応する量子化閾値算出部6aでは量子化閾値を1個、データ量子化方法bに対応する量子化閾値算出部6bでは量子化閾値を3個、データ量子化方法cに対応する量子化閾値算出部6cでは量子化閾値を7個算出するようにしている。
The number of quantization thresholds calculated by the quantization threshold calculation units 6a, 6b, and 6c needs to correspond to the number of bits assigned to the code for converting the gradation level.
The data quantization method a is 1 bit 2 gradations for the number of gradations assigned to the code, the data quantization method b is 2 bits 4 gradations for the number of gradations assigned to the code, and the data quantization method c is the 3 bits 8 gradations assigned to the code. Therefore, the quantization threshold value calculation unit 6a corresponding to the data quantization method a has one quantization threshold value, the quantization threshold value calculation unit 6b corresponding to the data quantization method b has three quantization threshold values, The quantization threshold calculation unit 6c corresponding to the quantization method c calculates seven quantization thresholds.

量子化閾値算出部6a,6b,6cによる量子化閾値の算出式は、下記の式(5)〜(15)の通りである。
ただし、式(5)〜(15)による量子化閾値の算出方法は一例であり、画像の階調レベル分布状態や本技術を適用するシステムの画像の特性に応じて、量子化誤差がなるべく小さくなる算出方法とすればよく、必ずしも、ここで挙げた式(5)〜(15)に限定されるものではない。
The calculation formulas of the quantization threshold values by the quantization threshold value calculation units 6a, 6b, and 6c are as the following formulas (5) to (15).
However, the calculation method of the quantization threshold value by the formulas (5) to (15) is an example, and the quantization error is as small as possible according to the gradation level distribution state of the image and the image characteristics of the system to which the present technology is applied. And the calculation method is not necessarily limited to the equations (5) to (15) listed here.

[データ量子化方法aの場合]
La1=LAa (5)
[データ量子化方法bの場合]
Lb1=LAb−LDb/4 (6)
Lb2=LAb (7)
Lb3=LAb+LDb/4 (8)
[データ量子化方法cの場合]
Lc1=LAc−LDc×3/8 (9)
Lc2=LAc−LDc×1/4 (10)
Lc3=LAc−LDc×1/8 (11)
Lc4=LAc (12)
Lc5=LAc+LDc×1/8 (13)
Lc6=LAc+LDc×1/4 (14)
Lc7=LAc+LDc×3/8 (15)
[In the case of data quantization method a]
La1 = LAa (5)
[In the case of data quantization method b]
Lb1 = LAb−LDb / 4 (6)
Lb2 = LAb (7)
Lb3 = LAb + LDb / 4 (8)
[In the case of data quantization method c]
Lc1 = LAc−LDc × 3/8 (9)
Lc2 = LAc−LDc × 1/4 (10)
Lc3 = LAc−LDc × 1/8 (11)
Lc4 = LAc (12)
Lc5 = LAc + LDc × 1/8 (13)
Lc6 = LAc + LDc × 1/4 (14)
Lc7 = LAc + LDc × 3/8 (15)

また、固有の符号が復号化された場合の各画素の階調レベルとして、データ量子化方法aでは2個、データ量子化方法bでは4個、データ量子化方法cでは8個求める必要がある。
量子化閾値算出部6a,6b,6cによる各画素の階調レベルの算出式は、下記の式(16)〜(29)の通りである。
ただし、式(16)〜(29)による階調レベルの算出式は一例である。量子化閾値の算出式である式(5)〜(15)が変更された場合には、その変更に対応するように、式(16)〜(29)も変更される。
Further, as the gradation level of each pixel when a unique code is decoded, it is necessary to obtain 2 for the data quantization method a, 4 for the data quantization method b, and 8 for the data quantization method c. .
Expressions for calculating the gradation levels of the respective pixels by the quantization threshold calculation units 6a, 6b, and 6c are as shown in the following expressions (16) to (29).
However, the formulas for calculating the gradation levels according to the equations (16) to (29) are only examples. When the formulas (5) to (15), which are quantization threshold calculation formulas, are changed, the formulas (16) to (29) are also changed to correspond to the change.

[データ量子化方法aの場合]
Qa1=LAa−LDa/2 (16)
Qa2=LAa+LDa/2 (17)
[データ量子化方法bの場合]
Qb1=LAb−LDb/2 (18)
Qb2=LAb−LDb/8 (19)
Qb3=LAb+LDb/8 (20)
Qb4=LAb+LDb/2 (21)
[データ量子化方法cの場合]
Qc1=LAc−LDc/2 (22)
Qc2=LAc−LDc×5/16 (23)
Qc3=LAc−LDc×3/16 (24)
Qc4=LAc−LDc/16 (25)
Qc5=LAc+LDc/16 (26)
Qc6=LAc+LDc×3/16 (27)
Qc7=LAc+LDc×5/16 (28)
Qc8=LAc+LDc/2 (29)
[In the case of data quantization method a]
Qa1 = LAa−LDa / 2 (16)
Qa2 = LAa + LDa / 2 (17)
[In the case of data quantization method b]
Qb1 = LAb−LDb / 2 (18)
Qb2 = LAb−LDb / 8 (19)
Qb3 = LAb + LDb / 8 (20)
Qb4 = LAb + LDb / 2 (21)
[In the case of data quantization method c]
Qc1 = LAc−LDc / 2 (22)
Qc2 = LAc−LDc × 5/16 (23)
Qc3 = LAc−LDc × 3/16 (24)
Qc4 = LAc-LDc / 16 (25)
Qc5 = LAc + LDc / 16 (26)
Qc6 = LAc + LDc × 3/16 (27)
Qc7 = LAc + LDc × 5/16 (28)
Qc8 = LAc + LDc / 2 (29)

量子化部4a,4b,4cの量子化処理部7a,7b,7cは、量子化閾値算出部6a,6b,6cが当該ブロックにおける階調レベルの量子化閾値La1,Lb1〜Lb3,Lc1〜Lc7を算出すると、当該ブロック内の未処理の画素を選択する(ステップST6)。
量子化部4aの量子化処理部7aは、未処理の画素を選択すると、その画素の階調レベルXijと量子化閾値算出部6aにより算出された量子化閾値La1を比較して、その画素の階調レベルXijに対応する固有の符号を特定し、その固有の符号を量子化データφaijとして当該画素に割り当てる処理を行う(ステップST7a)。
即ち、量子化処理部7aは、量子化閾値La1により分けられる2つの領域のうち、その画素の階調レベルXijがどちらの領域に属するかを判定し、属する領域に対応する固有の符号を量子化データφaijとして当該画素に割り当てる処理を行う。
The quantization processing units 7a, 7b, and 7c of the quantization units 4a, 4b, and 4c are the quantization threshold value calculation units 6a, 6b, and 6c, and the quantization level quantization threshold values La1, Lb1 to Lb3, and Lc1 to Lc7 in the block. Is calculated, an unprocessed pixel in the block is selected (step ST6).
When the quantization processing unit 7a of the quantization unit 4a selects an unprocessed pixel, it compares the gradation level Xij of that pixel with the quantization threshold value La1 calculated by the quantization threshold value calculation unit 6a, A unique code corresponding to the gradation level Xij is specified, and the unique code is assigned to the pixel as quantized data φaij (step ST7a).
That is, the quantization processing unit 7a determines which region the gradation level Xij of the pixel belongs to among the two regions divided by the quantization threshold value La1, and quantizes the unique code corresponding to the region to which the quantization processing unit 7a belongs. A process of assigning the pixel as the converted data φaij is performed.

量子化部4bの量子化処理部7bは、未処理の画素を選択すると、その画素の階調レベルXijと量子化閾値算出部6bにより算出された量子化閾値Lb1〜Lb3を比較して、その画素の階調レベルXijに対応する固有の符号を特定し、その固有の符号を量子化データφbijとして当該画素に割り当てる処理を行う(ステップST7b)。
即ち、量子化処理部7bは、量子化閾値Lb1〜Lb3により分けられる4つの領域のうち、その画素の階調レベルXijがどの領域に属するかを判定し、属する領域に対応する固有の符号を量子化データφbijとして当該画素に割り当てる処理を行う。
When the quantization processing unit 7b of the quantization unit 4b selects an unprocessed pixel, the gradation level Xij of the pixel is compared with the quantization threshold values Lb1 to Lb3 calculated by the quantization threshold value calculation unit 6b. A unique code corresponding to the gradation level Xij of the pixel is specified, and the unique code is assigned to the pixel as the quantized data φbij (step ST7b).
That is, the quantization processing unit 7b determines which region the gradation level Xij of the pixel belongs to among the four regions divided by the quantization thresholds Lb1 to Lb3, and assigns a unique code corresponding to the region to which it belongs. A process of assigning to the pixel as quantized data φbij is performed.

量子化部4cの量子化処理部7cは、未処理の画素を選択すると、その画素の階調レベルXijと量子化閾値算出部6cにより算出された量子化閾値Lc1〜Lc7を比較して、その画素の階調レベルXijに対応する固有の符号を特定し、その固有の符号を量子化データφcijとして当該画素に割り当てる処理を行う(ステップST7c)。
即ち、量子化処理部7cは、量子化閾値Lc1〜Lc7により分けられる8つの領域のうち、その画素の階調レベルXijがどの領域に属するかを判定し、属する領域に対応する固有の符号を量子化データφcijとして当該画素に割り当てる処理を行う。
When selecting an unprocessed pixel, the quantization processing unit 7c of the quantization unit 4c compares the gradation level Xij of the pixel with the quantization thresholds Lc1 to Lc7 calculated by the quantization threshold calculation unit 6c, A unique code corresponding to the gradation level Xij of the pixel is specified, and the unique code is assigned to the pixel as quantized data φcij (step ST7c).
That is, the quantization processing unit 7c determines which region the gradation level Xij of the pixel belongs to among the eight regions divided by the quantization thresholds Lc1 to Lc7, and assigns a unique code corresponding to the region to which it belongs. A process of assigning to the pixel as quantized data φcij is performed.

量子化処理部7a,7b,7cによる固有の符号の割当方法を下記の式(30)〜(43)で例示する。
[データ量子化方法aの場合]
Xij≦La1 → φaij=0(2進数) (30)
La1<Xij → φaij=1(2進数) (31)
[データ量子化方法bの場合]
Xij≦Lb1 → φbij=00(2進数) (32)
Lb1<Xij≦Lb2 → φbij=01(2進数) (33)
Lb2<Xij≦Lb3 → φbij=10(2進数) (34)
Lb3<Xij → φbij=11(2進数) (35)
[データ量子化方法cの場合]
Xij≦Lc1 → φcij=000(2進数) (36)
Lc1<Xij≦Lc2 → φcij=001(2進数) (37)
Lc2<Xij≦Lc3 → φcij=010(2進数) (38)
Lc3<Xij≦Lc4 → φcij=011(2進数) (39)
Lc4<Xij≦Lc5 → φcij=100(2進数) (40)
Lc5<Xij≦Lc6 → φcij=101(2進数) (41)
Lc6<Xij≦Lc7 → φcij=110(2進数) (42)
Lc7<Xij → φcij=111(2進数) (43)
Specific code assignment methods by the quantization processing units 7a, 7b, and 7c are exemplified by the following equations (30) to (43).
[In the case of data quantization method a]
Xij ≦ La1 → φaij = 0 (binary number) (30)
La1 <Xij → φaij = 1 (binary number) (31)
[In the case of data quantization method b]
Xij ≦ Lb1 → φbij = 00 (binary number) (32)
Lb1 <Xij ≦ Lb2 → φbij = 01 (binary number) (33)
Lb2 <Xij ≦ Lb3 → φbij = 10 (binary number) (34)
Lb3 <Xij → φbij = 11 (binary number) (35)
[In the case of data quantization method c]
Xij ≦ Lc1 → φcij = 000 (binary number) (36)
Lc1 <Xij ≦ Lc2 → φcij = 001 (binary number) (37)
Lc2 <Xij ≦ Lc3 → φcij = 010 (binary number) (38)
Lc3 <Xij ≦ Lc4 → φcij = 011 (binary number) (39)
Lc4 <Xij ≦ Lc5 → φcij = 100 (binary number) (40)
Lc5 <Xij ≦ Lc6 → φcij = 101 (binary number) (41)
Lc6 <Xij ≦ Lc7 → φcij = 110 (binary number) (42)
Lc7 <Xij → φcij = 111 (binary number) (43)

量子化部4aの量子化誤差積算部8aは、量子化閾値算出部6aにより算出された固有の符号が復号化された場合の各画素の階調レベルQa1〜Qa2と、量子化処理部7aにより量子化データφaijが割り当てられる前の各画素の階調レベルXijとの誤差δaijを算出し、当該ブロックにおいて、その誤差δaijの絶対値を積算する(ステップST8a)。
また、量子化部4bの量子化誤差積算部8bは、量子化閾値算出部6bにより算出された固有の符号が復号化された場合の各画素の階調レベルQb1〜Qb4と、量子化処理部7bにより量子化データφbijが割り当てられる前の各画素の階調レベルXijとの誤差δbijを算出し、当該ブロックにおいて、その誤差δbijの絶対値を積算する(ステップST8b)。
また、量子化部4cの量子化誤差積算部8cは、量子化閾値算出部6cにより算出された固有の符号が復号化された場合の各画素の階調レベルQc1〜Qc8と、量子化処理部7cにより量子化データφcijが割り当てられる前の各画素の階調レベルXijとの誤差δcijを算出し、当該ブロックにおいて、その誤差δcijの絶対値を積算する(ステップST8c)。
The quantization error accumulation unit 8a of the quantization unit 4a uses the gradation levels Qa1 to Qa2 of each pixel when the unique code calculated by the quantization threshold calculation unit 6a is decoded, and the quantization processing unit 7a. An error δaij with respect to the gradation level Xij of each pixel before the quantized data φaij is assigned is calculated, and the absolute value of the error δaij is integrated in the block (step ST8a).
Further, the quantization error integrating unit 8b of the quantization unit 4b includes the gradation levels Qb1 to Qb4 of each pixel when the unique code calculated by the quantization threshold calculation unit 6b is decoded, and a quantization processing unit. The error δbij with respect to the gradation level Xij of each pixel before the quantization data φbij is assigned is calculated by 7b, and the absolute value of the error δbij is integrated in the block (step ST8b).
In addition, the quantization error accumulation unit 8c of the quantization unit 4c includes gradation levels Qc1 to Qc8 of each pixel when the unique code calculated by the quantization threshold calculation unit 6c is decoded, and a quantization processing unit. The error δcij with the gradation level Xij of each pixel before the quantization data φcij is assigned is calculated by 7c, and the absolute value of the error δcij is integrated in the block (step ST8c).

量子化誤差積算部8a,8b,8cによる誤差δnijの算出式と積算値Δn(n=“a”or“b”or“c”)の算出式は、下記の式(44)〜(60)の通りである。
ただし、積算値Δnの値は、新たなブロックの処理の開始時に初期化され、ブロック処理中は、個々の画素の誤差δnijを累積する。
The calculation formula of the error δnij by the quantization error integration sections 8a, 8b, and 8c and the calculation formula of the integration value Δn (n = “a” or “b” or “c”) are the following formulas (44) to (60). It is as follows.
However, the value of the integrated value Δn is initialized at the start of processing of a new block, and the error δnij of each pixel is accumulated during the block processing.

[データ量子化方法aの場合]
φaij=0(2進数) → δaij=|Xij−Qa1| (44)
φaij=1(2進数) → δaij=|Xij−Qa2| (45)
Δa=Σδaij(1≦i≦4,1≦j≦4) (46)
[データ量子化方法bの場合]
φbij=00(2進数) → δbij=|Xij−Qb1| (47)
φbij=01(2進数) → δbij=|Xij−Qb2| (48)
φbij=10(2進数) → δbij=|Xij−Qb3| (49)
φbij=11(2進数) → δbij=|Xij−Qb4| (50)
Δb=Σδbij(1≦i≦4,1≦j≦4) (51)
[データ量子化方法cの場合]
φcij=000(2進数) → δcij=|Xij−Qc1| (52)
φcij=001(2進数) → δcij=|Xij−Qc2| (53)
φcij=010(2進数) → δcij=|Xij−Qc3| (54)
φcij=011(2進数) → δcij=|Xij−Qc4| (55)
φcij=100(2進数) → δcij=|Xij−Qc5| (56)
φcij=101(2進数) → δcij=|Xij−Qc6| (57)
φcij=110(2進数) → δcij=|Xij−Qc7| (58)
φcij=111(2進数) → δcij=|Xij−Qc8| (59)
Δc=Σδcij(1≦i≦4,1≦j≦4) (60)
[In the case of data quantization method a]
φaij = 0 (binary number) → δaij = | Xij−Qa1 | (44)
φaij = 1 (binary number) → δaij = | Xij−Qa2 | (45)
Δa = Σδaij (1 ≦ i ≦ 4, 1 ≦ j ≦ 4) (46)
[In the case of data quantization method b]
φbij = 00 (binary number) → δbij = | Xij−Qb1 | (47)
φbij = 01 (binary number) → δbij = | Xij−Qb2 | (48)
φbij = 10 (binary number) → δbij = | Xij−Qb3 | (49)
φbij = 11 (binary number) → δbij = | Xij−Qb4 | (50)
Δb = Σδbij (1 ≦ i ≦ 4, 1 ≦ j ≦ 4) (51)
[In the case of data quantization method c]
φcij = 000 (binary number) → δcij = | Xij−Qc1 | (52)
φcij = 001 (binary number) → δcij = | Xij−Qc2 | (53)
φcij = 010 (binary number) → δcij = | Xij−Qc3 | (54)
φcij = 011 (binary number) → δcij = | Xij−Qc4 | (55)
φcij = 100 (binary number) → δcij = | Xij−Qc5 | (56)
φcij = 101 (binary number) → δcij = | Xij−Qc6 | (57)
φcij = 110 (binary number) → δcij = | Xij−Qc7 | (58)
φcij = 111 (binary number) → δcij = | Xij−Qc8 | (59)
Δc = Σδcij (1 ≦ i ≦ 4, 1 ≦ j ≦ 4) (60)

量子化部4a,4b,4cは、当該ブロック内の全ての画素について処理が終了しているかを確認し(ステップST9)、処理が終了していなければ、ステップST6の処理に戻り、処理が終了していれば、ステップST10の処理に移行する。   The quantization units 4a, 4b, and 4c confirm whether or not the processing has been completed for all the pixels in the block (step ST9). If the processing has not been completed, the processing returns to step ST6 and the processing is completed. If so, the process proceeds to step ST10.

符号化データ作成部9は、量子化処理部7a,7b,7cが当該ブロック内の全ての画素に量子化データφaij,φbij,φcijを割り当てると、その量子化データφaij,φbij,φcijのうち、誤差δaij,δbij,δcijの絶対値の積算値Δa,Δb,Δcが許容閾値ΔTを超えない条件の下で、データ量が最も少ない量子化データを選択する(ステップST10)。   When the quantizing units 7a, 7b, and 7c assign the quantized data φaij, φbij, and φcij to all the pixels in the block, the encoded data creating unit 9 includes the quantized data φaij, φbij, and φcij, The quantized data with the smallest data amount is selected under the condition that the integrated values Δa, Δb, Δc of the absolute values of the errors δaij, δbij, δcij do not exceed the allowable threshold value ΔT (step ST10).

量子化データの具体的な選択例は下記の通りである。
Δa≦ΔT → 量子化データφaij
Δa>ΔT、Δb≦ΔT → 量子化データφbij
Δa>ΔT、Δb>ΔT → 量子化データφcij
上記の通り、誤差の絶対値の積算値Δnが許容閾値ΔT以下になる量子化データφnijの中で、データ量が最も少ない量子化データが選択されるが、いずれの積算値Δnも許容閾値ΔTを超過する場合には、極力画質の保存を図るため、データ量が最も多い量子化データφnijを選択する。
A specific example of selecting the quantized data is as follows.
Δa ≦ ΔT → quantized data φaij
Δa> ΔT, Δb ≦ ΔT → quantized data φbij
Δa> ΔT, Δb> ΔT → quantized data φcij
As described above, the quantized data having the smallest data amount is selected from among the quantized data φnij in which the integrated value Δn of the absolute value of the error is equal to or less than the allowable threshold value ΔT. Is exceeded, the quantized data φnij having the largest data amount is selected in order to preserve the image quality as much as possible.

量子化部4a,4b,4cは、全てのブロックについて処理が終了しているかを確認し(ステップST11)、処理が終了していなければ、ステップST2の処理に戻り、処理が終了していれば、ステップST12の処理に移行する。   The quantization units 4a, 4b, and 4c check whether the processing has been completed for all the blocks (step ST11). If the processing has not been completed, the process returns to step ST2, and if the processing has been completed. The process proceeds to step ST12.

符号化データ作成部9は、ブロック毎に、選択した量子化データφnijと、その量子化データφnijに係るデータ量子化方法nを示すフラグと、符号化準備部5nにより算出された画素基準レベルLAn及び画素値変動幅LDnとを組み合わせて、符号化データを作成する(ステップST12)。
例えば、量子化部4aにより算出された量子化データφaijが選択された場合には、その量子化データφaijと、量子化部4aが使用するデータ量子化方法aを示すフラグと、符号化準備部5aにより算出された画素基準レベルLAa及び画素値変動幅LDaとを組み合わせて、符号化データを作成する。
For each block, the encoded data creating unit 9 selects the selected quantized data φnij, a flag indicating the data quantization method n related to the quantized data φnij, and the pixel reference level LAn calculated by the encoding preparation unit 5n. And the encoded data is created by combining the pixel value variation width LDn (step ST12).
For example, when the quantized data φaij calculated by the quantizing unit 4a is selected, the quantized data φaij, a flag indicating the data quantization method a used by the quantizing unit 4a, and an encoding preparation unit The encoded data is created by combining the pixel reference level LAa and the pixel value fluctuation range LDa calculated by 5a.

ここで、図4は符号化データ作成部9により作成されるブロック毎の符号化データの構成例を示す説明図である。
符号化データの先頭には、使用されたデータ量子化方法を示す2bitのフラグが付加される。
例えば、データ量子化方法aの場合には“00”、データ量子化方法bの場合には“01”、データ量子化方法cの場合には“10”が付加される。
次に、符号化準備部5nにより算出された8bitの画素基準レベルLAnと、8bitの画素値変動幅LDnが付加される。
Here, FIG. 4 is an explanatory diagram showing a configuration example of encoded data for each block generated by the encoded data generating unit 9.
A 2-bit flag indicating the used data quantization method is added to the head of the encoded data.
For example, “00” is added for the data quantization method a, “01” is added for the data quantization method b, and “10” is added for the data quantization method c.
Next, the 8-bit pixel reference level LAn calculated by the encoding preparation unit 5n and the 8-bit pixel value variation width LDn are added.

次に、量子化部4aにより割り当てられた量子化データφaijが選択された場合には、1bit×16の量子化データφaijが付加されて、符号化データが作成される。
量子化部4bにより割り当てられた量子化データφbijが選択された場合には、2bit×16の量子化データφbijが付加されて、符号化データが作成される。
量子化部4cにより割り当てられた量子化データφcijが選択された場合には、3bit×16の量子化データφcijが付加されて、符号化データが作成される。
Next, when the quantized data φaij assigned by the quantizing unit 4a is selected, 1-bit × 16 quantized data φaij is added to generate encoded data.
When the quantized data φbij assigned by the quantizing unit 4b is selected, 2 bits × 16 quantized data φbij is added to generate encoded data.
When the quantized data φcij allocated by the quantizing unit 4c is selected, 3 bits × 16 quantized data φcij is added to generate encoded data.

図4では、データ量子化方法を示すフラグが2bitの情報である例を示したが、予め用意されているデータ量子化方法の数に応じてbit数を決定するようにしてもよい。
例えば、予め用意されているデータ量子化方法の数が2つであれば1bit、8つであれば、3bitのように決定する。
また、画素基準レベルLAnと画素値変動幅LDnについては、符号量を削減する目的で、下位bitを削除することにより、精度を落として、7bit又は6bit以下にしてもよい。
Although FIG. 4 shows an example in which the flag indicating the data quantization method is 2-bit information, the number of bits may be determined according to the number of data quantization methods prepared in advance.
For example, if the number of data quantization methods prepared in advance is two, it is determined as 1 bit, and if it is eight, it is determined as 3 bits.
The pixel reference level LAn and the pixel value variation width LDn may be reduced to 7 bits or 6 bits or less by deleting lower bits for the purpose of reducing the code amount.

また、この実施の形態1では、各画素の画素値レベルの階調数を2、4、8階調(2のべき乗の値)としているものについて示したが、これはデータ圧縮時に、データ毎にビットが割り当てられ、処理が簡易化できるようにするためである。
したがって、処理の簡易化を考慮せず、符号化効率の向上を目的とする場合には、各画素に割り当てる階調数を3階調や5階調としてもよい。この場合は、例えば、3階調のデータであれば、3の16乗を表現することができるビット幅を画素値データ用に準備し、一旦、3進数16桁の形でデータを表現した後、値を2進数に変換して記録することになる。
In the first embodiment, the case where the number of gradations of the pixel value level of each pixel is 2, 4, and 8 gradations (values of powers of 2) is shown. This is because a bit is assigned to each of them so that the processing can be simplified.
Therefore, when the purpose is to improve the coding efficiency without considering simplification of processing, the number of gradations assigned to each pixel may be 3 gradations or 5 gradations. In this case, for example, in the case of 3 gradation data, a bit width capable of expressing 3 to the 16th power is prepared for the pixel value data, and once the data is expressed in the form of ternary 16 digits The value is converted into a binary number and recorded.

以上で明らかなように、この実施の形態1によれば、予め用意されている複数のデータ量子化方法nに対応するものとして、信号レベル範囲検出部2により検出された最大値Lmax及び最小値Lminから各ブロックにおける階調レベルの画素基準レベルLAn及び画素値変動幅LDnを算出する符号化準備部5a,5b,5cと、符号化準備部5a,5b,5cにより算出された画素基準レベルLAn及び画素値変動幅LDnから各ブロックにおける階調レベルの量子化閾値La1,Lb1〜Lb3,Lc1〜Lc7を算出するとともに、その画素基準レベルLAn及び画素値変動幅LDnから固有の符号が復号化された場合の各画素の階調レベルQa1〜Qa2,Qb1〜Qb4,Qc1〜Qc8を算出する量子化閾値算出部6a,6b,6cと、各ブロックにおける各画素の階調レベルXijと量子化閾値算出部6a,6b,6cにより算出された量子化閾値La1,Lb1〜Lb3,Lc1〜Lc7を比較して、各画素の階調レベルに対応する固有の符号を特定し、その固有の符号を量子化データφaij,φbij,φcijとして各画素に割り当てる量子化処理部7a,7b,7cと、量子化閾値算出部6a,6b,6cにより算出された固有の符号が復号化された場合の各画素の階調レベルQa1〜Qa2,Qb1〜Qb4,Qc1〜Qc8と量子化処理部7a,7b,7cにより量子化データが割り当てられる前の各画素の階調レベルXijとの誤差δaij,δbij,δcijの絶対値をブロック毎に積算する量子化誤差積算部8a,8b,8cとを備え、符号化データ作成部9が、ブロック毎に、量子化処理部7a,7b,7cにより割り当てられた量子化データφaij,φbij,φcijのうち、量子化誤差積算部8a,8b,8cにより積算された誤差の絶対値が許容閾値ΔTを超えない条件の下で、データ量が最も少ない量子化データφnijを選択し、その量子化データφnij、その量子化データφnijに係る量子化方法nを示すフラグ、画素基準レベルLAn及び画素値変動幅LDnからなる符号化データを作成するように構成したので、符号化効率の向上と画像全体の画質の向上を図ることができる効果を奏する。
即ち、画像の特性に応じた効率的な符号化処理を行うことができるとともに、符号量の誤差がブロック間で均一化されて、画像全体で画質の差違が少ない均質な画像を得ることができる。
As is apparent from the above, according to the first embodiment, the maximum value Lmax and the minimum value detected by the signal level range detection unit 2 as corresponding to a plurality of data quantization methods n prepared in advance. The pixel reference level LAn calculated by the encoding preparation units 5a, 5b, and 5c and the encoding preparation units 5a, 5b, and 5c for calculating the pixel reference level LAn and the pixel value variation width LDn of the gradation level in each block from Lmin. And the gradation threshold quantization thresholds La1, Lb1 to Lb3, Lc1 to Lc7 in each block are calculated from the pixel value variation width LDn, and a unique code is decoded from the pixel reference level LAn and the pixel value variation width LDn. Quantization threshold value calculation units 6a, 6 for calculating the gradation levels Qa1-Qa2, Qb1-Qb4, Qc1-Qc8 of each pixel , 6c and the gradation level Xij of each pixel in each block and the quantization threshold values La1, Lb1 to Lb3, Lc1 to Lc7 calculated by the quantization threshold value calculation units 6a, 6b, and 6c are compared. Quantization processing units 7a, 7b, and 7c that identify a unique code corresponding to the key level and assign the unique code to each pixel as quantized data φaij, φbij, and φcij, and quantization threshold calculation units 6a, 6b, Before the quantization data is assigned by the gradation levels Qa1 to Qa2, Qb1 to Qb4, Qc1 to Qc8 and the quantization processing units 7a, 7b, and 7c when the unique code calculated by 6c is decoded Quantization error integrating units 8a, 8b, and 8c that integrate the absolute values of errors δaij, δbij, and δcij with respect to the gradation level Xij of each pixel for each block. Of the quantized data φaij, φbij, φcij assigned by the quantization processing units 7a, 7b, 7c for each block, the data creating unit 9 calculates the error accumulated by the quantization error accumulating units 8a, 8b, 8c. Under the condition that the absolute value does not exceed the allowable threshold ΔT, the quantized data φnij having the smallest data amount is selected, the quantized data φnij, the flag indicating the quantization method n related to the quantized data φnij, and the pixel reference Since the encoded data composed of the level LAn and the pixel value variation width LDn is created, there is an effect that the encoding efficiency can be improved and the image quality of the entire image can be improved.
That is, it is possible to perform an efficient encoding process according to the characteristics of the image, and the error of the code amount is made uniform between the blocks, so that a homogeneous image with little difference in image quality can be obtained over the entire image. .

実施の形態2.
上記実施の形態1では、符号化データ作成部9が固定の許容閾値ΔTを使用しているものについて示したが、符号化データ作成部9が画像1フレーム当りの目標符号量と、処理済のブロックの積算符号量と、未処理のブロックの数とから、未処理のブロックの1ブロック当りの目標符号量を算出し、未処理のブロックの1ブロック当りの目標符号量から許容閾値ΔTを決定するようにしてもよい。
この実施の形態2では、許容閾値ΔTを動的に変更することにより、ブロック毎のデータ量を画像の特性に応じて切り替えながら、画像1フレーム当りの符号化データ量を一定に保つものについて説明する。
Embodiment 2. FIG.
In the first embodiment, the encoded data creating unit 9 uses the fixed allowable threshold ΔT. However, the encoded data creating unit 9 uses the target code amount per image frame and the processed code amount. The target code amount per block of the unprocessed block is calculated from the integrated code amount of the block and the number of unprocessed blocks, and the allowable threshold ΔT is determined from the target code amount per block of the unprocessed block. You may make it do.
In the second embodiment, a description will be given of a method for keeping the encoded data amount per frame constant while changing the data amount for each block according to the characteristics of the image by dynamically changing the allowable threshold ΔT. To do.

まず、符号化データ作成部9は、画像1フレーム当りの目標符号量をS、処理済のブロックの積算符号量をD、未処理のブロックの数をBとすると、下記の式(61)に示すように、未処理のブロックの1ブロック当りの目標符号量Gを算出する。
G=(S−D)/B (61)
First, the encoded data creation unit 9 sets the target code amount per image frame as S, the integrated code amount of processed blocks as D, and the number of unprocessed blocks as B, according to the following equation (61). As shown, a target code amount G per block for an unprocessed block is calculated.
G = (SD) / B (61)

符号化データ作成部9は、未処理のブロックの1ブロック当りの目標符号量Gを算出すると、例えば、その目標符号量Gと許容閾値ΔTの対応関係が記録されているルックアップテーブルT(n)を参照することにより、その目標符号量Gから許容閾値ΔTを決定する。
ΔT=T(G) (62)
When the encoded data creation unit 9 calculates the target code amount G per unprocessed block, for example, a lookup table T (n) in which the correspondence between the target code amount G and the allowable threshold ΔT is recorded. ), The allowable threshold value ΔT is determined from the target code amount G.
ΔT = T (G) (62)

ただし、ルックアップテーブルT(n)の値を定める際には、下記の条件を満たすようにする。
(1)nの値の増加に対して、T(n)の値を単調現象させる。
即ち、1ブロック当りの目標符号量Gが大きければ、ブロックに割り当てられる符号量を大きくすることが可能であるため、許容閾値ΔTの値を低くし、画質を向上させて1ブロック当りのデータ量を増やす制御を行う。
逆に、1ブロック当りの目標符号量Gが小さければ、許容閾値ΔTの値を大きくすることによって画質を低下させる代わりに、1ブロック当りのデータ量を抑える制御を行う。
(2)nの値が選択可能なデータ量子化方法の中で、1ブロック当りの符号化データ量が最低値以下の範囲では、許容閾値ΔTの無効を示す値(例えば、“−1”)を設定する。
これにより、画像1フレームの符号量が目標符号量Sをオーバーすることを防止して、常に符号量を一定化することができる。
However, when determining the value of the lookup table T (n), the following condition is satisfied.
(1) The value of T (n) is made monotonic as the value of n increases.
That is, if the target code amount G per block is large, it is possible to increase the code amount allocated to the block. Therefore, the value of the permissible threshold ΔT is lowered, the image quality is improved, and the data amount per block is increased. Increase the control.
Conversely, if the target code amount G per block is small, control is performed to suppress the data amount per block instead of decreasing the image quality by increasing the value of the allowable threshold value ΔT.
(2) Among data quantization methods in which the value of n can be selected, a value indicating invalidity of the allowable threshold ΔT (for example, “−1”) when the amount of encoded data per block is not more than the minimum value Set.
Thereby, it is possible to prevent the code amount of one frame of the image from exceeding the target code amount S, and to always make the code amount constant.

図5は処理済のブロック毎の積算符号量と符号化誤差許容閾値の関係を示す説明図である。
符号化データ作成部9は、図2のステップST12において、最終的な符号化データを作成する際に、もし、積算符号量が画像1フレーム当りの目標符号量Sを下回っている場合には、ダミーデータを付加して、画像1フレームの符号量を一定にする処理を行う。
FIG. 5 is an explanatory diagram showing the relationship between the accumulated code amount for each processed block and the encoding error allowable threshold.
In step ST12 of FIG. 2, the encoded data creation unit 9 creates final encoded data. If the accumulated code amount is less than the target code amount S per image frame, A process of adding dummy data to make the code amount of one frame of the image constant is performed.

この実施の形態2では、画像1フレーム当りの符号量を一定化する処理を導入しているため、ブロック毎のデータサイズを可変化することによる画像符号化効率の向上と、元来FBTC圧縮方式のメリットである符号化データ量が固定であるといる性質を両立させることが可能である。   In the second embodiment, since the process of making the code amount per frame of the image constant is introduced, the image coding efficiency is improved by changing the data size for each block, and the original FBTC compression method. It is possible to achieve both of the advantages that the amount of encoded data is fixed.

実施の形態3.
上記実施の形態1,2では、符号化データ作成部9がブロック毎に、量子化処理部7a,7b,7cにより割り当てられた量子化データφaij,φbij,φcijのうち、量子化誤差積算部8a,8b,8cにより積算された誤差の絶対値が許容閾値ΔTを超えない条件の下で、データ量が最も少ない量子化データφnijを選択するものについて示したが、外部から指定された特定のブロックについては、量子化誤差積算部8a,8b,8cにより積算された誤差の絶対値に関わらず、所定のデータ量子化方法に対応する量子化処理部7nにより割り当てられた量子化データφnijを選択するようにしてもよい。
Embodiment 3 FIG.
In the first and second embodiments, the coded data creating unit 9 out of the quantized data φaij, φbij, and φcij assigned by the quantization processing units 7a, 7b, and 7c for each block is the quantization error integrating unit 8a. , 8b, and 8c are shown for selecting the quantized data φnij having the smallest data amount under the condition that the absolute value of the error accumulated by 8b and 8c does not exceed the allowable threshold value ΔT. , The quantization data φnij assigned by the quantization processing unit 7n corresponding to a predetermined data quantization method is selected regardless of the absolute value of the error accumulated by the quantization error accumulation units 8a, 8b, and 8c. You may do it.

具体的には、符号化データ作成部9は、予め、データ量子化方法を固定する特定のブロックの座標番号と、そのデータ量子化方法との対応関係を記録している参照テーブルを作成する。
符号化データ作成部9は、該当する座標番号のブロックについて量子化データφnijを取得する場合、上記実施の形態1のように、許容閾値ΔTに基づく量子化データφnijの選択処理を実施せずに、参照テーブルに記録されているデータ量子化方法を確認し、そのデータ量子化方法を使用している量子化処理部7nにより割り当てられた量子化データφnijを選択するようにする。
Specifically, the encoded data creation unit 9 creates in advance a reference table that records the correspondence between the coordinate number of a specific block for fixing the data quantization method and the data quantization method.
When acquiring the quantized data φnij for the block of the corresponding coordinate number, the encoded data creating unit 9 does not perform the process of selecting the quantized data φnij based on the allowable threshold ΔT as in the first embodiment. The data quantization method recorded in the reference table is confirmed, and the quantized data φnij assigned by the quantization processing unit 7n using the data quantization method is selected.

なお、上記実施の形態2のように、画像1フレーム当りの符号量を一定化する場合には、未処理のブロックの1ブロック当りの目標符号量Gを算出する際、未処理のブロックの数Bから、未処理のブロックの中に含まれているデータ量子化方法を固定するブロックの数を減算するとともに、処理済のブロックの積算符号量Dに対して、未処理のブロックの中に含まれているデータ量子化方法を固定するブロックの符号化データ量を加算するようにする。
これにより、データ量子化方法が固定されたブロックの影響を取り除いて、許容閾値ΔTの値を動的に変更することが可能となる。
When the code amount per image frame is made constant as in the second embodiment, the number of unprocessed blocks is calculated when calculating the target code amount G per block of unprocessed blocks. The number of blocks for fixing the data quantization method included in the unprocessed block is subtracted from B, and the total code amount D of the processed block is included in the unprocessed block. The amount of encoded data of a block that fixes the data quantization method is added.
As a result, it is possible to remove the influence of the block whose data quantization method is fixed and dynamically change the value of the allowable threshold value ΔT.

この実施の形態3では、外部から指定された特定のブロックについては、固定されたデータ量子化方法で割り当てられた量子化データφnijが得られる。このため、予め画像の性質が分かっている領域を指定することにより、データ量子化方法を固定し、周囲のブロックの画像の特性や1フレーム当りの符号量に左右されない安定した処理を実現することが可能である。   In the third embodiment, quantized data φnij assigned by a fixed data quantization method is obtained for a specific block designated from the outside. For this reason, the data quantization method is fixed by designating an area in which the image properties are known in advance, and stable processing independent of the image characteristics of surrounding blocks and the code amount per frame is realized. Is possible.

実施の形態4.
図6はこの発明の実施の形態4による画像復号化装置を示す構成図であり、図において、符号化データ分割部21は図1の画像符号化装置から出力された符号化データ(データ量子化方法nを示すフラグ、画素基準レベルLAn、画素値変動幅LDn、量子化データφnij)をM×N(M、Nは自然数)のブロックに分割する処理を実施する。なお、符号化データ分割部21は符号化データ分割手段を構成している。
復号化部22は符号化データ分割部21により分割された符号化データを復号化して画像データを作成する処理を実施する。なお、復号化部22は復号化手段を構成している。
Embodiment 4 FIG.
FIG. 6 is a block diagram showing an image decoding apparatus according to Embodiment 4 of the present invention. In FIG. 6, the encoded data dividing unit 21 outputs encoded data (data quantization) output from the image encoding apparatus of FIG. A process of dividing the flag indicating the method n, the pixel reference level LAn, the pixel value variation width LDn, and the quantized data φnij) into M × N (M and N are natural numbers) blocks is performed. The encoded data dividing unit 21 constitutes encoded data dividing means.
The decoding unit 22 performs a process of generating image data by decoding the encoded data divided by the encoded data dividing unit 21. The decoding unit 22 constitutes a decoding unit.

逆量子化部23aは予め用意されているデータ復号化方法a(データ量子化方法aに対応する復号化方法)で、量子化データφaijに対応する階調レベルXijを各画素に割り当てる処理を実施する。
逆量子化部23bは予め用意されているデータ復号化方法b(データ量子化方法bに対応する復号化方法)で、量子化データφbijに対応する階調レベルXijを各画素に割り当てる処理を実施する。
逆量子化部23cは予め用意されているデータ復号化方法c(データ量子化方法cに対応する復号化方法)で、量子化データφcijに対応する階調レベルXijを各画素に割り当てる処理を実施する。
The inverse quantization unit 23a performs a process of assigning a gradation level Xij corresponding to the quantized data φaij to each pixel by a data decoding method a (decoding method corresponding to the data quantization method a) prepared in advance. To do.
The inverse quantization unit 23b performs a process of assigning a gradation level Xij corresponding to the quantized data φbij to each pixel by a data decoding method b (decoding method corresponding to the data quantization method b) prepared in advance. To do.
The inverse quantization unit 23c performs a process of assigning a gradation level Xij corresponding to the quantized data φcij to each pixel by a data decoding method c (decoding method corresponding to the data quantization method c) prepared in advance. To do.

逆量子化部23aの階調レベル算出部24aは符号化データ分割部21により分割された符号化データに含まれているフラグがデータ復号化方法aに対応するデータ量子化方法aを示している場合、その符号化データに含まれている画素基準レベルLAaと画素値変動幅LDaから、その符号化データに含まれている量子化データφaij(固有の符号)に対応する階調レベルQa1〜Qa2を算出する処理を実施する。
階調レベル割当部25aは階調レベル算出部24aにより算出された階調レベルQa1〜Qa2のうち、符号化データに含まれている量子化データφaijの値に対応する階調レベルをXijとして各画素に割り当てる処理を実施する。
The gradation level calculation unit 24a of the inverse quantization unit 23a indicates the data quantization method a in which the flag included in the encoded data divided by the encoded data dividing unit 21 corresponds to the data decoding method a. In this case, from the pixel reference level LAa and the pixel value fluctuation width LDa included in the encoded data, the gradation levels Qa1 to Qa2 corresponding to the quantized data φaij (unique code) included in the encoded data The process of calculating is performed.
The gradation level assigning unit 25a uses the gradation level corresponding to the value of the quantized data φaij included in the encoded data among the gradation levels Qa1 to Qa2 calculated by the gradation level calculating unit 24a as Xij. A process of assigning to pixels is performed.

逆量子化部23bの階調レベル算出部24bは符号化データ分割部21により分割された符号化データに含まれているフラグがデータ復号化方法bに対応するデータ量子化方法bを示している場合、その符号化データに含まれている画素基準レベルLAbと画素値変動幅LDbから、その符号化データに含まれている量子化データφbij(固有の符号)に対応する階調レベルQb1〜Qb4を算出する処理を実施する。
階調レベル割当部25bは階調レベル算出部24bにより算出された階調レベルQb1〜Qb4のうち、符号化データに含まれている量子化データφbijの値に対応する階調レベルをXijとして各画素に割り当てる処理を実施する。
The gradation level calculation unit 24b of the inverse quantization unit 23b indicates the data quantization method b in which the flag included in the encoded data divided by the encoded data dividing unit 21 corresponds to the data decoding method b. In this case, the gradation levels Qb1 to Qb4 corresponding to the quantized data φbij (unique code) included in the encoded data from the pixel reference level LAb and the pixel value fluctuation width LDb included in the encoded data. The process of calculating is performed.
The gradation level assigning unit 25b uses the gradation level corresponding to the value of the quantized data φbij included in the encoded data among the gradation levels Qb1 to Qb4 calculated by the gradation level calculation unit 24b as Xij. A process of assigning to pixels is performed.

逆量子化部23cの階調レベル算出部24cは符号化データ分割部21により分割された符号化データに含まれているフラグがデータ復号化方法cに対応するデータ量子化方法cを示している場合、その符号化データに含まれている画素基準レベルLAcと画素値変動幅LDcから、その符号化データに含まれている量子化データφcij(固有の符号)に対応する階調レベルQc1〜Qc8を算出する処理を実施する。
階調レベル割当部25cは階調レベル算出部24cにより算出された階調レベルQc1〜Qc8のうち、符号化データに含まれている量子化データφcijの値に対応する階調レベルをXijとして各画素に割り当てる処理を実施する。
なお、階調レベル算出部24a,24b,24cは階調レベル算出手段を構成し、階調レベル割当部25a,25b,25cは階調レベル割当手段を構成している。
The gradation level calculation unit 24c of the inverse quantization unit 23c indicates the data quantization method c in which the flag included in the encoded data divided by the encoded data dividing unit 21 corresponds to the data decoding method c. In this case, the gradation levels Qc1 to Qc8 corresponding to the quantized data φcij (unique code) included in the encoded data from the pixel reference level LAc and the pixel value fluctuation width LDc included in the encoded data. The process of calculating is performed.
The gradation level assigning unit 25c uses the gradation level corresponding to the value of the quantized data φcij included in the encoded data among the gradation levels Qc1 to Qc8 calculated by the gradation level calculation unit 24c as Xij. A process of assigning to pixels is performed.
Note that the gradation level calculation units 24a, 24b, and 24c constitute gradation level calculation means, and the gradation level assignment units 25a, 25b, and 25c constitute gradation level assignment means.

画像データ作成部26は逆量子化部23a,23b,23cのうち、符号化データ分割部21により分割された符号化データに含まれているフラグに対応する逆量子化部23nを選択し、その逆量子化部23nの階調レベル割当部25nにより割り当てられた各画素の階調レベルXijから画像データを作成する処理を実施する。なお、画像データ作成部26は画像データ作成手段を構成している。
図7はこの発明の実施の形態4による画像復号化装置の処理内容を示すフローチャートである。
The image data creation unit 26 selects an inverse quantization unit 23n corresponding to the flag included in the encoded data divided by the encoded data division unit 21 among the inverse quantization units 23a, 23b, and 23c, and A process of creating image data from the gradation level Xij of each pixel assigned by the gradation level assignment unit 25n of the inverse quantization unit 23n is performed. The image data creation unit 26 constitutes image data creation means.
FIG. 7 is a flowchart showing the processing contents of the image decoding apparatus according to Embodiment 4 of the present invention.

次に動作について説明する。
符号化データ分割部21は、図1の画像符号化装置から符号化データ(データ量子化方法nを示すフラグ、画素基準レベルLAn、画素値変動幅LDn、量子化データφnij)を受けると、その符号化データをM×N(M、Nは自然数)のブロックに分割する(ステップST21)。
即ち、符号化データ分割部21は、図1の画像符号化装置により符号化される前の画像データが分割された各ブロックの対応部分に分割する。
Next, the operation will be described.
When the encoded data dividing unit 21 receives the encoded data (the flag indicating the data quantization method n, the pixel reference level LAn, the pixel value variation width LDn, the quantized data φnij) from the image encoding device of FIG. The encoded data is divided into M × N blocks (M and N are natural numbers) (step ST21).
In other words, the encoded data dividing unit 21 divides the image data before being encoded by the image encoding device of FIG. 1 into corresponding portions of the divided blocks.

この際、従来のFBTC符号化方式と異なり、画像データにおける各ブロックの符号化サイズは、ブロック毎に選択されたデータ量子化方法によって異なり、固定長ではない。
ただし、選択されたデータ量子化方法が分かれば、そのデータ量子化方法に対応するブロックの符号化データサイズは一意に定められる。そのため、符号化データ分割部21では、ブロック毎のデータ量子化方法を示すフラグを読み出し、対応するデータサイズの符号化データを読み出して1ブロック分の符号化データとして分割し、その次のデータを次のブロックの符号化データの先頭とみなして、ブロック毎のデータ量子化方法を示すフラグを読み出す動作を繰り返し実施することにより、符号化データの分割処理を行う。
At this time, unlike the conventional FBTC encoding method, the encoding size of each block in the image data differs depending on the data quantization method selected for each block and is not a fixed length.
However, if the selected data quantization method is known, the encoded data size of the block corresponding to the data quantization method is uniquely determined. Therefore, the encoded data dividing unit 21 reads a flag indicating the data quantization method for each block, reads the encoded data of the corresponding data size, divides it into encoded data for one block, and then sets the next data Considering the beginning of the encoded data of the next block, the process of dividing the encoded data is performed by repeatedly performing an operation of reading a flag indicating a data quantization method for each block.

復号化部22の逆量子化部23a,23b,23cは、符号化データ分割部21が符号化データをM×Nのブロックに分割すると、未だ復号化処理を実施していない未処理のブロックを一つ選択する(ステップST22)。
逆量子化部23aの階調レベル算出部24aは、その選択したブロックの符号化データに含まれているフラグがデータ復号化方法aに対応するデータ量子化方法aを示していれば(ステップST23)、その符号化データを入力する。
即ち、その符号化データの先頭の2bitを参照し、2bitの値が“00”であれば、その符号化データを入力する。
When the encoded data dividing unit 21 divides the encoded data into M × N blocks, the inverse quantizing units 23a, 23b, and 23c of the decoding unit 22 select unprocessed blocks that have not yet been decoded. One is selected (step ST22).
If the flag included in the encoded data of the selected block indicates the data quantization method a corresponding to the data decoding method a (step ST23), the gradation level calculation unit 24a of the inverse quantization unit 23a ), And input the encoded data.
That is, referring to the first 2 bits of the encoded data, if the 2-bit value is “00”, the encoded data is input.

逆量子化部23bの階調レベル算出部24bは、その選択したブロックの符号化データに含まれているフラグがデータ復号化方法bに対応するデータ量子化方法bを示していれば(ステップST23)、その符号化データを入力する。
即ち、その符号化データの先頭の2bitを参照し、2bitの値が“01”であれば、その符号化データを入力する。
逆量子化部23cの階調レベル算出部24cは、その選択したブロックの符号化データに含まれているフラグがデータ復号化方法cに対応するデータ量子化方法cを示していれば(ステップST23)、その符号化データを入力する。
即ち、その符号化データの先頭の2bitを参照し、2bitの値が“10”であれば、その符号化データを入力する。
この実施の形態4では、選択可能なデータ復号化方法が3種類であるため、もし、2bitの値が“11”であれば、復号エラーとする。
If the flag included in the encoded data of the selected block indicates the data quantization method b corresponding to the data decoding method b, the gradation level calculation unit 24b of the inverse quantization unit 23b (step ST23). ), And input the encoded data.
That is, referring to the first 2 bits of the encoded data, if the 2-bit value is “01”, the encoded data is input.
If the flag included in the encoded data of the selected block indicates the data quantization method c corresponding to the data decoding method c, the gradation level calculation unit 24c of the inverse quantization unit 23c (step ST23). ), And input the encoded data.
That is, referring to the first 2 bits of the encoded data, if the 2-bit value is “10”, the encoded data is input.
In the fourth embodiment, since there are three types of data decoding methods that can be selected, if the 2-bit value is “11”, a decoding error is assumed.

逆量子化部23aの階調レベル算出部24aは、当該ブロックの符号化データを入力すると、その符号化データに含まれている画素基準レベルLAaと画素値変動幅LDaから、その符号化データに含まれている量子化データφaij(固有の符号)に対応する階調レベルQa1〜Qa2を算出する(ステップST24a)。
逆量子化部23bの階調レベル算出部24bは、当該ブロックの符号化データを入力すると、その符号化データに含まれている画素基準レベルLAbと画素値変動幅LDbから、その符号化データに含まれている量子化データφbij(固有の符号)に対応する階調レベルQb1〜Qb4を算出する(ステップST24b)。
逆量子化部23cの階調レベル算出部24cは、当該ブロックの符号化データを入力すると、その符号化データに含まれている画素基準レベルLAcと画素値変動幅LDcから、その符号化データに含まれている量子化データφcij(固有の符号)に対応する階調レベルQc1〜Qc8を算出する(ステップST24c)。
When the gradation level calculation unit 24a of the inverse quantization unit 23a receives the encoded data of the block, the gradation level calculation unit 24a converts the pixel reference level LAa and the pixel value variation width LDa included in the encoded data into the encoded data. The gradation levels Qa1 to Qa2 corresponding to the included quantized data φaij (unique code) are calculated (step ST24a).
When the gradation level calculation unit 24b of the inverse quantization unit 23b receives the encoded data of the block, the gradation level calculation unit 24b converts the pixel reference level LAb and the pixel value variation width LDb included in the encoded data into the encoded data. The gradation levels Qb1 to Qb4 corresponding to the included quantized data φbij (unique code) are calculated (step ST24b).
When the gradation level calculation unit 24c of the inverse quantization unit 23c receives the encoded data of the block, the gradation level calculation unit 24c converts the pixel reference level LAc and the pixel value variation width LDc included in the encoded data into the encoded data. The gradation levels Qc1 to Qc8 corresponding to the included quantized data φcij (unique code) are calculated (step ST24c).

階調レベル算出部24a,24b,24cによる階調レベルの算出式は、例えば、下記の式(63)〜(76)である。
[データ復号化方法aの場合]
Qa1=LAa−LDa/2 (63)
Qa2=LAa+LDa/2 (64)
[データ復号化方法bの場合]
Qb1=LAb−LDb/2 (65)
Qb2=LAb−LDb/8 (66)
Qb3=LAb+LDb/8 (67)
Qb4=LAb+LDb/2 (68)
[データ復号化方法cの場合]
Qc1=LAc−LDc/2 (69)
Qc2=LAc−LDc×5/16 (70)
Qc3=LAc−LDc×3/16 (71)
Qc4=LAc−LDc/16 (72)
Qc5=LAc+LDc/16 (73)
Qc6=LAc+LDc×3/16 (74)
Qc7=LAc+LDc×5/16 (75)
Qc8=LAc+LDc/2 (76)
Expressions for calculating the gradation levels by the gradation level calculation units 24a, 24b, and 24c are, for example, the following expressions (63) to (76).
[In case of data decoding method a]
Qa1 = LAa−LDa / 2 (63)
Qa2 = LAa + LDa / 2 (64)
[In the case of data decoding method b]
Qb1 = LAb−LDb / 2 (65)
Qb2 = LAb−LDb / 8 (66)
Qb3 = LAb + LDb / 8 (67)
Qb4 = LAb + LDb / 2 (68)
[In case of data decoding method c]
Qc1 = LAc−LDc / 2 (69)
Qc2 = LAc−LDc × 5/16 (70)
Qc3 = LAc−LDc × 3/16 (71)
Qc4 = LAc-LDc / 16 (72)
Qc5 = LAc + LDc / 16 (73)
Qc6 = LAc + LDc × 3/16 (74)
Qc7 = LAc + LDc × 5/16 (75)
Qc8 = LAc + LDc / 2 (76)

式(63)〜(76)は、上記実施の形態1において、量子化閾値が式(5)〜(15)で算出された場合に対応している。
したがって、量子化閾値が式(5)〜(15)以外の算出式で算出された場合には、その算出式に対応するように、階調レベルの算出式も変更する必要がある。
Expressions (63) to (76) correspond to the case where the quantization threshold is calculated by Expressions (5) to (15) in the first embodiment.
Therefore, when the quantization threshold is calculated by a calculation formula other than the formulas (5) to (15), it is necessary to change the gradation level calculation formula to correspond to the calculation formula.

逆量子化部23aの階調レベル割当部25aは、階調レベル算出部24aが階調レベルQa1〜Qa2を算出すると、当該ブロック内で未処理の画素を一つ選択する(ステップST25)。
そして、階調レベル割当部25aは、階調レベル算出部24aにより算出された階調レベルQa1〜Qa2のうち、符号化データに含まれている量子化データφaijの値に対応する階調レベルをXijとして、当該画素に割り当てる処理を行う(ステップST26)。
When the gradation level calculation unit 24a calculates the gradation levels Qa1 to Qa2, the gradation level assignment unit 25a of the inverse quantization unit 23a selects one unprocessed pixel in the block (step ST25).
Then, the gradation level assignment unit 25a selects a gradation level corresponding to the value of the quantized data φaij included in the encoded data among the gradation levels Qa1 to Qa2 calculated by the gradation level calculation unit 24a. A process of assigning to the pixel is performed as Xij (step ST26).

逆量子化部23bの階調レベル割当部25bは、階調レベル算出部24bが階調レベルQb1〜Qb4を算出すると、当該ブロック内で未処理の画素を一つ選択する(ステップST25)。
そして、階調レベル割当部25bは、階調レベル算出部24bにより算出された階調レベルQb1〜Qb4のうち、符号化データに含まれている量子化データφbijの値に対応する階調レベルをXijとして、当該画素に割り当てる処理を行う(ステップST26)。
The gradation level assignment unit 25b of the inverse quantization unit 23b selects one unprocessed pixel in the block when the gradation level calculation unit 24b calculates the gradation levels Qb1 to Qb4 (step ST25).
Then, the gradation level assignment unit 25b selects a gradation level corresponding to the value of the quantization data φbij included in the encoded data among the gradation levels Qb1 to Qb4 calculated by the gradation level calculation unit 24b. A process of assigning to the pixel is performed as Xij (step ST26).

逆量子化部23cの階調レベル割当部25cは、階調レベル算出部24cが階調レベルQc1〜Qc8を算出すると、当該ブロック内で未処理の画素を一つ選択する(ステップST25)。
そして、階調レベル割当部25cは、階調レベル算出部24cにより算出された階調レベルQc1〜Qc8のうち、符号化データに含まれている量子化データφcijの値に対応する階調レベルをXijとして、当該画素に割り当てる処理を行う(ステップST26)。
When the gradation level calculation unit 24c calculates the gradation levels Qc1 to Qc8, the gradation level assignment unit 25c of the inverse quantization unit 23c selects one unprocessed pixel in the block (step ST25).
The gradation level assigning unit 25c then selects a gradation level corresponding to the value of the quantized data φcij included in the encoded data among the gradation levels Qc1 to Qc8 calculated by the gradation level calculating unit 24c. A process of assigning to the pixel is performed as Xij (step ST26).

階調レベル割当部25a,25b,25cによる具体的な階調レベルの割当方法の一例は下記の通りである。
[データ復号化方法aの場合]
φaij=0(2進数) → Xij=Qa1 (77)
φaij=1(2進数) → Xij=Qa2 (78)
[データ復号化方法bの場合]
φbij=00(2進数) → Xij=Qb1 (79)
φbij=01(2進数) → Xij=Qb2 (80)
φbij=10(2進数) → Xij=Qb3 (81)
φbij=11(2進数) → Xij=Qb4 (82)
[データ復号化方法cの場合]
φcij=000(2進数) → Xij=Qc1 (83)
φcij=001(2進数) → Xij=Qc2 (84)
φcij=010(2進数) → Xij=Qc3 (85)
φcij=011(2進数) → Xij=Qc4 (86)
φcij=100(2進数) → Xij=Qc5 (87)
φcij=101(2進数) → Xij=Qc6 (88)
φcij=110(2進数) → Xij=Qc7 (89)
φcij=111(2進数) → Xij=Qc8 (90)
An example of a specific gradation level assignment method by the gradation level assignment units 25a, 25b, and 25c is as follows.
[In case of data decoding method a]
φaij = 0 (binary number) → Xij = Qa1 (77)
φaij = 1 (binary number) → Xij = Qa2 (78)
[In the case of data decoding method b]
φbij = 00 (binary number) → Xij = Qb1 (79)
φbij = 01 (binary number) → Xij = Qb2 (80)
φbij = 10 (binary number) → Xij = Qb3 (81)
φbij = 11 (binary number) → Xij = Qb4 (82)
[In case of data decoding method c]
φcij = 000 (binary number) → Xij = Qc1 (83)
φcij = 001 (binary number) → Xij = Qc2 (84)
φcij = 010 (binary number) → Xij = Qc3 (85)
φcij = 011 (binary number) → Xij = Qc4 (86)
φcij = 100 (binary number) → Xij = Qc5 (87)
φcij = 101 (binary number) → Xij = Qc6 (88)
φcij = 110 (binary number) → Xij = Qc7 (89)
φcij = 111 (binary number) → Xij = Qc8 (90)

逆量子化部23a,23b,23cは、当該ブロック内の全ての画素について処理が終了しているかを確認し(ステップST27)、処理が終了していなければ、ステップST25の処理に戻り、処理が終了していれば、ステップST28の処理に移行する。
逆量子化部23a,23b,23cは、全てのブロックについて処理が終了しているかを確認し(ステップST28)、処理が終了していなければ、ステップST22の処理に戻り、処理が終了していれば、ステップST29の処理に移行する。
The inverse quantization units 23a, 23b, and 23c confirm whether or not the processing has been completed for all the pixels in the block (step ST27). If the processing has not been completed, the processing returns to the processing of step ST25 and the processing is completed. If completed, the process proceeds to step ST28.
The inverse quantization units 23a, 23b, and 23c confirm whether or not the processing has been completed for all the blocks (step ST28). If the processing has not been completed, the processing returns to step ST22 and the processing has been completed. If so, the process proceeds to step ST29.

画像データ作成部26は、符号化データ分割部21により分割された符号化データに含まれているフラグがデータ復号化方法aに対応するデータ量子化方法aを示していれば、逆量子化部23aの階調レベル割当部25aにより割り当てられた各画素の階調レベルXijをまとめて画像データを作成する(ステップST29)。
画像データ作成部26は、符号化データ分割部21により分割された符号化データに含まれているフラグがデータ復号化方法bに対応するデータ量子化方法bを示していれば、逆量子化部23bの階調レベル割当部25bにより割り当てられた各画素の階調レベルXijをまとめて画像データを作成する(ステップST29)。
画像データ作成部26は、符号化データ分割部21により分割された符号化データに含まれているフラグがデータ復号化方法cに対応するデータ量子化方法cを示していれば、逆量子化部23cの階調レベル割当部25cにより割り当てられた各画素の階調レベルXijをまとめて画像データを作成する(ステップST29)。
If the flag included in the encoded data divided by the encoded data dividing unit 21 indicates the data quantization method a corresponding to the data decoding method a, the image data creating unit 26 performs an inverse quantization unit. Image data is created by grouping the tone levels Xij of the pixels assigned by the tone level assigning unit 25a of 23a (step ST29).
When the flag included in the encoded data divided by the encoded data dividing unit 21 indicates the data quantization method b corresponding to the data decoding method b, the image data creating unit 26 Image data is created by grouping the tone levels Xij of the pixels assigned by the tone level assigning unit 25b of 23b (step ST29).
If the flag included in the encoded data divided by the encoded data dividing unit 21 indicates the data quantization method c corresponding to the data decoding method c, the image data creating unit 26 performs an inverse quantization unit. The gradation level Xij of each pixel assigned by the gradation level assignment unit 25c of 23c is collected to create image data (step ST29).

以上で明らかなように、この実施の形態4によれば、符号化データ分割部21により分割された符号化データに含まれているフラグを参照して、階調レベル割当部25a,25b,25cのいずれかに割り当てられた各画素の階調レベルXijをまとめて画像データを作成するように構成したので、ブロック毎にデータ量子化方法が異なる符号化データが作成されている場合でも、正しく復号化処理を行うことができるようになり、画像全体で画質の差違が少ない均質な画像を生成することができる効果を奏する。   As apparent from the above, according to the fourth embodiment, the gradation level assigning units 25a, 25b, and 25c are referred to by referring to the flags included in the encoded data divided by the encoded data dividing unit 21. Since the image data is created by combining the gradation levels Xij of each pixel assigned to any of the above, even if encoded data having a different data quantization method is created for each block, decoding is correctly performed. This makes it possible to generate a uniform image with little difference in image quality over the entire image.

実施の形態5.
図8はこの発明の実施の形態5による画像復号化装置を示す構成図であり、図において、図6と同一符号は同一または相当部分を示すので説明を省略する。
逆量子化部31は予め用意されているデータ復号化方法a,b,cのいずれかで、量子化データφnijに対応する階調レベルXijを各画素に割り当てる処理を実施する。
Embodiment 5 FIG.
FIG. 8 is a block diagram showing an image decoding apparatus according to Embodiment 5 of the present invention. In the figure, the same reference numerals as those in FIG.
The inverse quantization unit 31 performs a process of assigning the gradation level Xij corresponding to the quantized data φnij to each pixel by any of the data decoding methods a, b, and c prepared in advance.

階調レベル算出部32は符号化データ分割部21により分割された符号化データに含まれているフラグに対応する階調レベル算出方法で、その符号化データに含まれている画素基準レベルLAnと画素値変動幅LDnから、その符号化データに含まれている量子化データφnij(固有の符号)に対応する階調レベルQa1〜Qa2(または、Qb1〜Qb4,Qc1〜Qc8)を算出する処理を実施する。なお、階調レベル算出部32は階調レベル算出手段を構成している。
階調レベル割当部33は符号化データ分割部21により分割された符号化データに含まれているフラグに対応する階調レベル割当方法で、階調レベル算出部31により算出された階調レベルQa1〜Qa2(または、Qb1〜Qb4,Qc1〜Qc8)のうち、符号化データに含まれている量子化データφnijの値に対応する階調レベルをXijとして各画素に割り当てる処理を実施する。なお、階調レベル割当部33は階調レベル割当手段を構成している。
The gradation level calculation unit 32 is a gradation level calculation method corresponding to the flag included in the encoded data divided by the encoded data dividing unit 21, and the pixel reference level LAn included in the encoded data Processing for calculating gradation levels Qa1 to Qa2 (or Qb1 to Qb4, Qc1 to Qc8) corresponding to the quantized data φnij (unique code) included in the encoded data from the pixel value variation width LDn. carry out. The gradation level calculation unit 32 constitutes a gradation level calculation unit.
The gradation level assigning unit 33 is a gradation level assigning method corresponding to the flag included in the encoded data divided by the encoded data dividing unit 21, and the gradation level Qa1 calculated by the gradation level calculating unit 31 is used. A process of assigning to each pixel the gradation level corresponding to the value of the quantized data φnij included in the encoded data among ˜Qa2 (or Qb1 to Qb4, Qc1 to Qc8) as Xij is performed. The gradation level assigning unit 33 constitutes a gradation level assigning unit.

上記実施の形態4では、データ復号化方法aを使用する逆量子化部23aと、データ復号化方法bを使用する逆量子化部23bと、データ復号化方法cを使用する逆量子化部23cとを設けているものについて示したが、図8に示すように、データ復号化方法a,b,cのいずれも使用可能な逆量子化部31を設け、逆量子化部31が、符号化データ分割部21により分割された符号化データに含まれているフラグを参照して、使用するデータ復号化方法を選択するようにしてもよい。   In the fourth embodiment, the inverse quantization unit 23a using the data decoding method a, the inverse quantization unit 23b using the data decoding method b, and the inverse quantization unit 23c using the data decoding method c. As shown in FIG. 8, an inverse quantization unit 31 that can use any of the data decoding methods a, b, and c is provided, and the inverse quantization unit 31 performs encoding. The data decoding method to be used may be selected with reference to the flag included in the encoded data divided by the data dividing unit 21.

この発明の実施の形態1による画像符号化装置を示す構成図である。It is a block diagram which shows the image coding apparatus by Embodiment 1 of this invention. この発明の実施の形態1による画像符号化装置の処理内容を示すフローチャートである。It is a flowchart which shows the processing content of the image coding apparatus by Embodiment 1 of this invention. 係数K1n,K2nの値の一例を示す説明図である。It is explanatory drawing which shows an example of the value of the coefficient K1n and K2n. 符号化データ作成部9により作成されるブロック毎の符号化データの構成例を示す説明図である。It is explanatory drawing which shows the structural example of the coding data for every block produced by the coding data preparation part. 処理済のブロック毎の積算符号量と符号化誤差許容閾値の関係を示す説明図である。It is explanatory drawing which shows the relationship between the accumulated code amount for every processed block, and an encoding error allowable threshold value. この発明の実施の形態4による画像復号化装置を示す構成図である。It is a block diagram which shows the image decoding apparatus by Embodiment 4 of this invention. この発明の実施の形態4による画像復号化装置の処理内容を示すフローチャートである。It is a flowchart which shows the processing content of the image decoding apparatus by Embodiment 4 of this invention. この発明の実施の形態5による画像復号化装置を示す構成図である。It is a block diagram which shows the image decoding apparatus by Embodiment 5 of this invention.

符号の説明Explanation of symbols

1 画像データ分割部(画像データ分割手段)、2 信号レベル範囲検出部(信号レベル範囲検出手段)、3 符号化部(符号化手段)、4a,4b,4c 量子化部、5a,5b,5c 符号化準備部(符号化準備手段)、6a,6b,6c 量子化閾値算出部(量子化閾値算出手段)、7a,7b,7c 量子化処理部(量子化手段)、8a,8b,8c 量子化誤差積算部(量子化誤差積算手段)、9 符号化データ作成部(符号化データ作成手段)、21 符号化データ分割部(符号化データ分割手段)、22 復号化部(復号化手段)、23a,23b,23c 逆量子化部、24a,24b,24c 階調レベル算出部(階調レベル算出手段)、25a,25b,25c 階調レベル割当部(階調レベル割当手段)、26 画像データ作成部(画像データ作成手段)、31 逆量子化部、32 階調レベル算出部(階調レベル算出手段)、33 階調レベル割当部(階調レベル割当手段)。   DESCRIPTION OF SYMBOLS 1 Image data division part (image data division means), 2 Signal level range detection part (Signal level range detection means), 3 Encoding part (encoding means), 4a, 4b, 4c Quantization part, 5a, 5b, 5c Encoding preparation unit (encoding preparation unit), 6a, 6b, 6c Quantization threshold calculation unit (quantization threshold calculation unit), 7a, 7b, 7c Quantization processing unit (quantization unit), 8a, 8b, 8c Quantum Encoding error integrating unit (quantized error integrating unit), 9 Encoded data generating unit (encoded data generating unit), 21 Encoded data dividing unit (encoded data dividing unit), 22 Decoding unit (decoding unit), 23a, 23b, 23c Inverse quantization unit, 24a, 24b, 24c Gradation level calculation unit (gradation level calculation unit), 25a, 25b, 25c Gradation level allocation unit (gradation level allocation unit), 26 Image data creation (Image data generating means), 31 inverse quantization unit 32 gradation-level calculation section (gradation level calculating means), 33 gray level assignment unit (gradation level assignment means).

Claims (2)

撮像素子から出力される画像データをブロック単位に分割する画像データ分割手段と、上記画像データ分割手段により分割された画像データが示す各画素の階調レベルを参照して、各ブロックにおける階調レベルの最大値及び最小値を検出する信号レベル範囲検出手段と、上記信号レベル範囲検出手段により検出された最大値及び最小値を用いて、各ブロックにおける各画素の階調レベルを量子化して符号化データを作成する符号化手段とを備えた画像符号化装置において、上記符号化手段は、予め用意されている複数のデータ量子化方法に対応するものとして、上記信号レベル範囲検出手段により検出された最大値及び最小値から各ブロックにおける階調レベルの基準レベル及び変動幅を算出する複数の符号化準備手段と、上記符号化準備手段により算出された基準レベル及び変動幅から各ブロックにおける階調レベルの量子化閾値を算出するとともに、その基準レベル及び変動幅から、量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベルを算出する複数の量子化閾値算出手段と、各ブロックにおける各画素の階調レベルと上記量子化閾値算出手段により算出された量子化閾値を比較して、各画素の階調レベルに対応する固有の符号を特定し、その固有の符号を量子化データとして各画素に割り当てる複数の量子化手段と、上記量子化閾値算出手段により算出された固有の符号が復号化された場合の各画素の階調レベルと上記量子化手段により量子化データが割り当てられる前の各画素の階調レベルとの誤差の絶対値をブロック毎に積算する複数の量子化誤差積算手段とを備えているとともに、ブロック毎に、上記複数の量子化手段により割り当てられた量子化データのうち、上記量子化誤差積算手段により積算された誤差の絶対値が許容閾値を超えない条件の下で、データ量が最も少ない量子化データを選択し、上記量子化データ、上記量子化データに係る量子化方法を示す方法識別情報、及び上記符号化準備手段により算出された基準レベル及び変動幅からなる符号化データを作成する符号化データ作成手段を備え、上記符号化データ作成手段は、画像1フレーム当りの目標符号量と、処理済のブロックの積算符号量と、未処理のブロックの数とから、上記未処理のブロックの1ブロック当りの目標符号量を算出し、上記未処理のブロックの1ブロック当りの目標符号量から許容閾値を決定することを特徴とする画像符号化装置。 The gradation level in each block with reference to the gradation level of each pixel indicated by the image data dividing means for dividing the image data output from the image sensor into blocks and the image data divided by the image data dividing means Using the signal level range detection means for detecting the maximum value and the minimum value of the signal, and the maximum value and the minimum value detected by the signal level range detection means, the gradation level of each pixel in each block is quantized and encoded. In the image coding apparatus comprising coding means for creating data, the coding means is detected by the signal level range detection means as corresponding to a plurality of data quantization methods prepared in advance. A plurality of encoding preparation means for calculating the reference level and fluctuation range of the gradation level in each block from the maximum value and the minimum value, and the above encoding preparation The gradation level quantization threshold in each block is calculated from the reference level and fluctuation range calculated by the stage, and the unique code assigned as quantized data is decoded from the reference level and fluctuation width. A plurality of quantization threshold calculation means for calculating the gradation level of each pixel, and comparing the gradation level of each pixel in each block with the quantization threshold calculated by the quantization threshold calculation means, A unique code corresponding to the key level is identified, and the unique code calculated by the quantization threshold value calculating means is decoded by a plurality of quantization means for assigning the unique code to each pixel as quantized data. The absolute value of the error between the gradation level of each pixel and the gradation level of each pixel before the quantization data is assigned by the quantization means is integrated for each block. And an absolute value of the error accumulated by the quantization error accumulation unit among the quantized data allocated by the plurality of quantization units for each block. Calculated by the quantized data, the method identification information indicating the quantization method related to the quantized data, and the encoding preparation means, by selecting the quantized data having the smallest data amount under the condition not exceeding the threshold. Encoded data generating means for generating encoded data having a reference level and a fluctuation range, wherein the encoded data generating means includes a target code amount per image frame, an integrated code amount of processed blocks, The target code amount per block of the unprocessed block is calculated from the number of unprocessed blocks, and allowed from the target code amount per block of the unprocessed block. An image encoding apparatus characterized by determining a threshold value. 撮像素子から出力される画像データをブロック単位に分割する画像データ分割手段と、上記画像データ分割手段により分割された画像データが示す各画素の階調レベルを参照して、各ブロックにおける階調レベルの最大値及び最小値を検出する信号レベル範囲検出手段と、上記信号レベル範囲検出手段により検出された最大値及び最小値を用いて、各ブロックにおける各画素の階調レベルを量子化して符号化データを作成する符号化手段とを備えた画像符号化装置において、上記符号化手段は、予め用意されている複数のデータ量子化方法に対応するものとして、上記信号レベル範囲検出手段により検出された最大値及び最小値から各ブロックにおける階調レベルの基準レベル及び変動幅を算出する複数の符号化準備手段と、上記符号化準備手段により算出された基準レベル及び変動幅から各ブロックにおける階調レベルの量子化閾値を算出するとともに、その基準レベル及び変動幅から、量子化データとして割り当てられる固有の符号が復号化された場合の各画素の階調レベルを算出する複数の量子化閾値算出手段と、各ブロックにおける各画素の階調レベルと上記量子化閾値算出手段により算出された量子化閾値を比較して、各画素の階調レベルに対応する固有の符号を特定し、その固有の符号を量子化データとして各画素に割り当てる複数の量子化手段と、上記量子化閾値算出手段により算出された固有の符号が復号化された場合の各画素の階調レベルと上記量子化手段により量子化データが割り当てられる前の各画素の階調レベルとの誤差の絶対値をブロック毎に積算する複数の量子化誤差積算手段とを備えているとともに、ブロック毎に、上記複数の量子化手段により割り当てられた量子化データのうち、上記量子化誤差積算手段により積算された誤差の絶対値が許容閾値を超えない条件の下で、データ量が最も少ない量子化データを選択し、上記量子化データ、上記量子化データに係る量子化方法を示す方法識別情報、及び上記符号化準備手段により算出された基準レベル及び変動幅からなる符号化データを作成する符号化データ作成手段を備え、上記符号化データ作成手段は、外部から指定された特定のブロックについては、上記量子化誤差積算手段により積算された誤差の絶対値に関わらず、所定のデータ量子化方法に対応する上記量子化手段により割り当てられた量子化データを選択することを特徴とする画像符号化装置。 The gradation level in each block with reference to the gradation level of each pixel indicated by the image data dividing means for dividing the image data output from the image sensor into blocks and the image data divided by the image data dividing means Using the signal level range detection means for detecting the maximum value and the minimum value of the signal, and the maximum value and the minimum value detected by the signal level range detection means, the gradation level of each pixel in each block is quantized and encoded. In the image coding apparatus comprising coding means for creating data, the coding means is detected by the signal level range detection means as corresponding to a plurality of data quantization methods prepared in advance. A plurality of encoding preparation means for calculating the reference level and fluctuation range of the gradation level in each block from the maximum value and the minimum value, and the above encoding preparation The gradation level quantization threshold in each block is calculated from the reference level and fluctuation range calculated by the stage, and the unique code assigned as quantized data is decoded from the reference level and fluctuation width. A plurality of quantization threshold calculation means for calculating the gradation level of each pixel, and comparing the gradation level of each pixel in each block with the quantization threshold calculated by the quantization threshold calculation means, A unique code corresponding to the key level is identified, and the unique code calculated by the quantization threshold value calculating means is decoded by a plurality of quantization means for assigning the unique code to each pixel as quantized data. The absolute value of the error between the gradation level of each pixel and the gradation level of each pixel before the quantization data is assigned by the quantization means is integrated for each block. And an absolute value of the error accumulated by the quantization error accumulation unit among the quantized data allocated by the plurality of quantization units for each block. Calculated by the quantized data, the method identification information indicating the quantization method related to the quantized data, and the encoding preparation means, by selecting the quantized data having the smallest data amount under the condition not exceeding the threshold. reference level and includes a coded data generating means for generating encoded data comprising a variation width, the coded data generating means, for certain block designated from the outside, is integrated by the quantization error integrating means and regardless of the absolute value of the error, to and selects the quantized data allocated by the quantizing means corresponds to the predetermined data quantization method That picture coding apparatus.
JP2008134571A 2008-05-22 2008-05-22 Image encoding apparatus and image decoding apparatus Expired - Fee Related JP5036626B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008134571A JP5036626B2 (en) 2008-05-22 2008-05-22 Image encoding apparatus and image decoding apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008134571A JP5036626B2 (en) 2008-05-22 2008-05-22 Image encoding apparatus and image decoding apparatus

Publications (2)

Publication Number Publication Date
JP2009284244A JP2009284244A (en) 2009-12-03
JP5036626B2 true JP5036626B2 (en) 2012-09-26

Family

ID=41454230

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008134571A Expired - Fee Related JP5036626B2 (en) 2008-05-22 2008-05-22 Image encoding apparatus and image decoding apparatus

Country Status (1)

Country Link
JP (1) JP5036626B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7145793B2 (en) * 2019-03-11 2022-10-03 Kddi株式会社 Image decoding device, image decoding method and program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63306769A (en) * 1987-06-08 1988-12-14 Nippon Telegr & Teleph Corp <Ntt> Encoding method
JP3117091B2 (en) * 1990-08-23 2000-12-11 富士ゼロックス株式会社 Image coding device
JPH10210472A (en) * 1997-01-20 1998-08-07 Canon Inc Image processing apparatus and method
JP3871840B2 (en) * 1999-12-24 2007-01-24 日本電気株式会社 Compressed video re-encoding device
JP4078060B2 (en) * 2001-11-20 2008-04-23 シャープ株式会社 Image coding apparatus, method thereof, computer program thereof and recording medium recording the program, and image decoding device, method thereof, computer program thereof and recording medium recording the program

Also Published As

Publication number Publication date
JP2009284244A (en) 2009-12-03

Similar Documents

Publication Publication Date Title
JP2005348390A (en) Image encoding apparatus, image decoding apparatus, control method thereof, computer program, and computer-readable storage medium
CN102210151A (en) Image encoding device and image decoding device
CN1329439A (en) Method for producing qunantization matrix
US9014268B2 (en) Video encoder and its decoder
RU2014122981A (en) INTER-LEVEL PREDICTION BETWEEN LEVELS WITH DIFFERENT DYNAMIC RANGE OF REPORT VALUES
CN105049849B (en) Picture decoding apparatus
KR100668324B1 (en) Bit rate control method and apparatus for encoding image data
JP4806172B2 (en) Apparatus and method for compressing digital source images
JP5036626B2 (en) Image encoding apparatus and image decoding apparatus
JP4798077B2 (en) Image processing method, image processing apparatus, image data compression apparatus, and computer program
JP2017500814A (en) Method and device for encoding high dynamic range images
CN112712458B (en) Encode the data array
CN113630599A (en) ROI-based video code rate control method and system
JPH099265A (en) Image coding apparatus and method
KR101461365B1 (en) A method and apparatus for encoding and decoding image for controlling quantization parameter considering contents type
JP4255071B2 (en) Pixel value selection type encoding device and decoding device of interest
JP2002232721A (en) Image encoding apparatus and method, and storage medium
JP4145292B2 (en) Image transmission apparatus and method
JP3085017B2 (en) Encoding device and decoding device
JP2020092327A (en) Image encoding device, image encoding method, and program
JP2802629B2 (en) Image data compression device and image processing device
JP4418736B2 (en) Image encoding apparatus and method, computer program, and computer-readable storage medium
JP4755239B2 (en) Video code amount control method, video encoding device, video code amount control program, and recording medium therefor
Schonberg et al. Perceptual encoding optimization for JPEG XR image coding using spatially adaptive quantization step size control
CN108076344A (en) A kind of VR video code rate control bit distribution methods based on weight graph model

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110512

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120315

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120327

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120518

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: 20120605

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120703

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150713

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees