JP2009260747A - Image encoding device, and control method thereof - Google Patents
Image encoding device, and control method thereof Download PDFInfo
- Publication number
- JP2009260747A JP2009260747A JP2008108294A JP2008108294A JP2009260747A JP 2009260747 A JP2009260747 A JP 2009260747A JP 2008108294 A JP2008108294 A JP 2008108294A JP 2008108294 A JP2008108294 A JP 2008108294A JP 2009260747 A JP2009260747 A JP 2009260747A
- Authority
- JP
- Japan
- Prior art keywords
- encoding
- image
- bit
- coefficient
- bit position
- 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.)
- Withdrawn
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
Description
本発明は画像データを符号化する技術に関するものである。 The present invention relates to a technique for encoding image data.
静止画の符号化技術として知られているものにJPEG符号化方式がある。JPEG符号化では、まず、入力画像データを垂直方向8画素、水平方向8画素で構成される画素ブロックに分割する。そして、この画素ブロックを単位に、DCT変換処理を行ない、8×8個の周波数成分係数(以下、DCT係数)を得る。そして、8×8個のDCT係数の左上隅の1つの係数がDC(直流)成分、残りの63係数がAC(交流)成分を表す。次いで、各DCT係数を、予め設定された量子化テーブルを参照して、量子化する。量子化された各DCT係数は、エントロピ符号化され、符号化デーとして出力される。エントロピ符号化の方式としては、ハフマン符号化と算術符号化とがあり、DC係数とAC係数とではそれぞれ異なる手順がとられ、符号化が施される。 A JPEG encoding method is known as a still image encoding technique. In JPEG encoding, first, input image data is divided into pixel blocks composed of 8 pixels in the vertical direction and 8 pixels in the horizontal direction. Then, DCT conversion processing is performed for each pixel block, and 8 × 8 frequency component coefficients (hereinafter, DCT coefficients) are obtained. One coefficient in the upper left corner of the 8 × 8 DCT coefficients represents a DC (direct current) component, and the remaining 63 coefficients represent an AC (alternating current) component. Next, each DCT coefficient is quantized with reference to a preset quantization table. Each quantized DCT coefficient is entropy encoded and output as encoded data. Entropy coding methods include Huffman coding and arithmetic coding. The DC coefficient and the AC coefficient take different procedures and are coded.
JPEG Baselineでは、係数のエントロピ符号化手法としてハフマン符号化を採用している。DC係数とAC係数とではそれぞれ異なる手順で符号化される。着目画素ブロックのDC成分は、直前の画素ブロックのDC成分(予測値)との差分値を算出された後、符号化される。一方、着目画素ブロック内の各AC成分は、ゼロの連続数(ゼロラン)と非ゼロの係数値の組み合わせによりハフマン符号化される。 JPEG Baseline employs Huffman coding as a coefficient entropy coding method. The DC coefficient and the AC coefficient are encoded by different procedures. The DC component of the pixel block of interest is encoded after the difference value with the DC component (predicted value) of the immediately preceding pixel block is calculated. On the other hand, each AC component in the pixel block of interest is Huffman-encoded with a combination of a zero consecutive number (zero run) and a non-zero coefficient value.
JPEG Baselineに見られるように、ゼロの連続数を符号化する符号化手法において、符号化が効率的に行われるためには、0となる係数がある程度存在しなければならない。換言すれば、63個のAC係数の全てが非ゼロであるような場合には、符号化効率は非常に悪くなる。 As can be seen in JPEG Baseline, in an encoding method that encodes a continuous number of zeros, a coefficient that becomes 0 must exist to some extent in order to perform encoding efficiently. In other words, when all 63 AC coefficients are non-zero, the coding efficiency is very poor.
AC係数を量子化する場合、ゼロの出現数を多くするためには、量子化ステップ値を大きな値にすることである。しかしながら、量子化ステップ値を大きくすればするほど、復号して得られた画像の画質が低くなるという問題がある。 When the AC coefficient is quantized, in order to increase the number of occurrences of zero, it is necessary to increase the quantization step value. However, the larger the quantization step value, the lower the image quality of the image obtained by decoding.
そこで、符号化を効率的に機能させるため、各係数を境界ビット位置を境にして、上位ビット部と下位ビット部に分離して、上位ビット部分に対してはランレングス符号化を適用するといった手法が考えられる。かかる分離処理を介在させると、量子化後のDCT係数が非ゼロであっても、境界ビット位置を適度な位置にすれば、上位ビット部は“0”となる確率が高くなり、効率的な符号化データを生成することができる。かかる技術を開示する文献としては、特許文献1が挙げられる。
Therefore, in order to make the coding function efficiently, each coefficient is separated into the upper bit part and the lower bit part at the boundary bit position, and run length coding is applied to the upper bit part. A method can be considered. By interposing such separation processing, even if the DCT coefficient after quantization is non-zero, if the boundary bit position is set to an appropriate position, the higher-order bit portion is more likely to be “0”, which is efficient. Encoded data can be generated.
また、符号化の際に効率良く圧縮するための最適なパラメータを探索し、適用する方法も知られている(例えば特許文献2)。この方法は、Golomb−Rice符号化するための、最適なkパラメータを探索するものであり、各kパラメータに対してGolomb−Rice符号化を行い、符号化データを生成するため、符号化効率の良いkパラメータを見つけるものである。
しかしながら、例えば特許文献1に開示された技術では、DCT係数を上位ビット部と、下位ビット部分を分割する際のビット分割位置は固定であり、DCT係数の内容によっては、必ずしも符号化効率の良い結果を得ることはできない。また、境界ビット位置を最適な位置に設定しようとする場合、全てのビット位置での符号化を行ない、その中から最も符号量を見つけ出すことが必要になる。すなわち、ソフトウェアで実現するためには符号化処理に多くの時間を必要とし、ハードウェアで実現する場合には回路規模が大きなものとなり、装置の大型化、コスト高、消費電力増大といった問題が残る。
However, in the technique disclosed in
本発明は上記従来例に鑑みてなされたものであり、複数の符号化処理部を有する装置において、並列に符号化する画素ブロックの数と、境界ビット位置の候補数を画像のサイズに応じて決定することで、符号化速度、符号化効率を適正に設定できる技術を提供しようとするものである。 The present invention has been made in view of the above-described conventional example. In an apparatus having a plurality of encoding processing units, the number of pixel blocks to be encoded in parallel and the number of boundary bit position candidates are determined according to the size of the image. By deciding, it is intended to provide a technology that can appropriately set the encoding speed and the encoding efficiency.
かかる課題を解決するため、例えば本発明の画像符号化装置は以下の構成を備える。すなわち、
多値画像データから画素ブロックを単位に、周波数変換、量子化処理を行ない、当該量子化処理で得られた多値の各係数を符号化する画像符号化装置であって、
前記画素ブロックの各係数値を、設定された境界ビット位置より上位の上位ビット部、前記設定された境界ビット位置以下の下位ビット部に分離し、前記上位ビット部についてはランレングス符号化を行ない、前記下位ビット部についてはビットプレーンを単位に符号化する、複数の符号化手段と、
着目画素ブロックの各係数について、最上位から最下位のビットに向かって最初に“1”となるビット位置から最下位ビットまでのビット数を有効ビット数として検出し、検出した有効ビット数の出現回数に基づき、前記着目画素ブロックの各係数に対する前記境界ビット位置の複数の候補を決定する境界ビット位置決定手段と、
符号化対象の画像のサイズを設定する設定手段と、
前記複数の符号化手段の個数をN0、並列して符号化する画素ブロックの数をN1、各画素ブロックの符号化する際に参照する境界ビット位置の候補数をN2としたとき、前記設定手段で設定したサイズが大きい程、大きな前記N1を決定するとともに、前記設定手段で設定したサイズが大きいほど小さな前記N2を決定する符号化パラメータ決定手段と、
該符号化パラメータ決定手段で決定されたN1個の画素ブロックの係数値を、前記境界ビット位置決定手段に供給することで、各画素ブロックについてN2個の境界ビット位置の候補を算出させ、各画素ブロックの係数値を、N2個の符号化手段のそれぞれに供給するとともに、前記N2個の境界ビット位置の候補を各N2個の符号化手段に設定することで、各画素ブロック毎にN2個の符号化データを生成させる符号化制御手段と、
1つの画素ブロックの係数値から生成されたN2個の符号化データ中の最小符号化データ量となる符号化データを選択し、出力することを、N1個の画素ブロックのそれぞれについて行なう出力手段とを備える。
In order to solve this problem, for example, an image encoding device of the present invention has the following configuration. That is,
An image encoding device that performs frequency conversion and quantization processing in units of pixel blocks from multivalued image data, and encodes each multivalued coefficient obtained by the quantization processing,
Each coefficient value of the pixel block is separated into an upper bit part higher than a set boundary bit position and a lower bit part below the set boundary bit position, and run-length encoding is performed on the upper bit part A plurality of encoding means for encoding the lower bit part in bit plane units;
For each coefficient of the pixel block of interest, the number of bits from the bit position that first becomes “1” from the most significant bit to the least significant bit to the least significant bit is detected as the effective bit number, and the detected effective bit number appears. Boundary bit position determining means for determining a plurality of candidates for the boundary bit position for each coefficient of the pixel block of interest based on the number of times;
Setting means for setting the size of the image to be encoded;
When the number of the plurality of encoding means is N0, the number of pixel blocks to be encoded in parallel is N1, and the number of boundary bit position candidates to be referred to when encoding each pixel block is N2, the setting means The larger the size set in (1), the larger the N1 is determined, and the larger the size set by the setting means is, the smaller the N2 is determined, the encoding parameter determining means;
By supplying the coefficient values of the N1 pixel blocks determined by the encoding parameter determining means to the boundary bit position determining means, N2 boundary bit position candidates are calculated for each pixel block, and each pixel The coefficient value of the block is supplied to each of the N2 encoding units, and the N2 boundary bit position candidates are set in each of the N2 encoding units, so that N2 units are provided for each pixel block. Encoding control means for generating encoded data;
An output means for selecting and outputting encoded data having a minimum encoded data amount among N2 encoded data generated from coefficient values of one pixel block for each of the N1 pixel blocks; Is provided.
本発明によれば、並列に符号化する画素ブロックの数と、境界ビット位置の候補数を画像のサイズに応じて決定することで、符号化速度、符号化効率を適正に設定できるようになる。 According to the present invention, it is possible to appropriately set the encoding speed and the encoding efficiency by determining the number of pixel blocks to be encoded in parallel and the number of boundary bit position candidates according to the image size. .
以下添付図面を参照して、本発明を好適な実施形態に従って詳細に説明する。 Hereinafter, the present invention will be described in detail according to preferred embodiments with reference to the accompanying drawings.
本実施形態で説明する画像符号化装置は、画素ブロックを単位に、周波数変換、量子化処理を行なう。そして、量子化処理して得られた多値の係数値を、境界ビット位置(その設定については後述)よりも上位の上位ビット部と境界ビット位置以下の下位ビット部に分離し、それぞれ符号化するものである。 The image encoding apparatus described in the present embodiment performs frequency conversion and quantization processing in units of pixel blocks. Then, the multi-value coefficient value obtained by the quantization process is separated into an upper bit part higher than the boundary bit position (the setting will be described later) and a lower bit part below the boundary bit position and encoded. To do.
[第1の実施形態]
図1は、本実施形態に係る画像符号化装置のブロック構成図である。尚、この画像符号化装置は、デジタルカメラ内に画像符号化処理部として組み込まれるものとして説明する。デジタルカメラには、光学部、撮像素子、表示部、操作部、書き換え可能な不揮発性記憶媒体を収納する収納部があるが、これらは、本願発明の主体である符号化処理装置とは直接には関係が無く、且つ、公知の構成と同じであるものとしてその説明は省略する。但し、実施形態におけるデジタルカメラは、ユーザは撮影に先立ち、操作部を操作して撮影画像の解像度(サイズ)を設定できるものとする。選択可能なサイズ(解像度)には、L、M、Sの3通りがある。Lサイズは水平方向4000画素、垂直方向3000画素(以下、4000×3000画素という)であり、Mサイズは2000×1500画素、Sサイズは1600画素×1200画素であるものとする。
[First Embodiment]
FIG. 1 is a block configuration diagram of an image encoding device according to the present embodiment. Note that this image encoding apparatus will be described as being incorporated as an image encoding processing unit in a digital camera. A digital camera has an optical unit, an image sensor, a display unit, an operation unit, and a storage unit that stores a rewritable nonvolatile storage medium. These are directly connected to the encoding processing apparatus that is the subject of the present invention. Is not related and the description is omitted because it is the same as a known configuration. However, in the digital camera according to the embodiment, it is assumed that the user can set the resolution (size) of the photographed image by operating the operation unit before photographing. There are three selectable sizes (resolutions): L, M, and S. The L size is 4000 pixels in the horizontal direction and 3000 pixels in the vertical direction (hereinafter referred to as 4000 × 3000 pixels), the M size is 2000 × 1500 pixels, and the S size is 1600 pixels × 1200 pixels.
図1に示すように、実施形態の画像符号化装置は、画像データ入力部101、ブロック分割部102、系列変換部103、係数量子化部103、係数バッファ103、係数データ取得部106を備える。また、本装置は、ユーザモード設定部107、エントロピ符号化制御部108、境界ビット位置決定部109、エントロピ符号化処理部110、符号量比較部111、画像データ出力部112も備える。エントロピ符号化処理部110は、複数のエントロピー符号化部で構成される。実施形態の場合、エントロピ符号化処理部110は4つのエントロピー符号化部110a、110b、110c、110dで構成されている。
As illustrated in FIG. 1, the image coding apparatus according to the embodiment includes an image
ユーザモード設定部107は、不図示の操作部に設けられ、以下の3つの項目について設定可能である。
・画質レベル(実施形態では高画質と標準画質の2種類)
・符号化モード(符号化速度優先/符号量抑制優先/オートの3種類)
・画像サイズ(L,M,Sの3種類)
ユーザモード設定部107は、例えば、デジタルカメラが有する表示部と操作キーで構成できる。図15は、表示部の設定画面の例を示している。ユーザは、操作部のキーを操作して、3つの項目について設定を行なう。図15の例では、画質レベルが「高画質」、符号化モードは「Auto」、画像サイズが「L」が設定されている例を示している。
The user
-Image quality level (in the embodiment, high image quality and standard image quality)
・ Encoding mode (encoding speed priority / encoding amount suppression priority / auto)
・ Image size (L, M, S)
The user
ユーザモード設定部107は、上記の3つの項目のうち、設定された画質レベルを示す信号を、後述の係数量子化部104に出力する。また、ユーザモード設定部107は、他の2つの項目、すなわち、{符号化速度優先モードor符号量抑制優先モードorオートモード}、{L or M or S}をエントロピー符号化制御部108に出力する。
The user
ところで、通常、デジタルカメラは、1画素につき、R、G、Bの3成分のデータを生成するが、本実施形態が適用するデジタルカメラの撮像素子は、輝度成分のみのモノクロ多値画像データ(1画素当たり8ビット=256階調)を出力するものとする。これは、便宜的なものであって、以下の説明を簡単なものとするためである。1画素がRGBの3成分の場合、各成分につき、以下に説明する処理を行なえば良いのは明らかである。また、色空間は輝度1成分の空間、RGB色空間に限らず、Luv空間、YCbCr空間、YMCK空間等でも構わず、本発明はその色空間の種類を問わない。また、本実施形態の画像符号化装置をデジタルカメラ以外に適用する場合、例えば、デジタル複写機等に適用するのであれば、画像入力源はイメージスキャナとなる。また、PCに適用するのであれば、画像入力源はイメージスキャナやビデオカメラであっても良いし、場合によっては非圧縮の画像データファイルを格納したコンピュータ可読記憶媒体であっても構わない。つまり、画像データ入力源の種類によって本発明が限定されるものではない。 Normally, a digital camera generates R, G, and B three-component data for each pixel. However, the image sensor of the digital camera to which the present embodiment applies is monochrome multi-value image data (only luminance components) ( Assume that 8 bits per pixel = 256 gradations). This is for convenience and to simplify the following description. When one pixel is RGB three components, it is clear that the processing described below may be performed for each component. In addition, the color space is not limited to the one-component luminance space and the RGB color space, but may be a Luv space, a YCbCr space, a YMCK space, or the like. When the image encoding apparatus according to the present embodiment is applied to a device other than a digital camera, for example, when applied to a digital copying machine, the image input source is an image scanner. If applied to a PC, the image input source may be an image scanner or a video camera, or may be a computer-readable storage medium storing an uncompressed image data file in some cases. That is, the present invention is not limited by the type of image data input source.
以下、図1を参照して、各処理部の処理内容を説明する。 Hereinafter, the processing content of each processing unit will be described with reference to FIG.
画像データ入力部101は、不図示の撮像素子による撮像されたモノクロ多値画像データをラスタースキャン順に入力し、ブロック分割部102に出力する。ブロック分割部102は、画像データ入力部101からの画像データを一時的に格納するための内部バッファメモリを有し、8×8画素で構成される画像(以下、画素ブロックという)を単位に係数変換部103に出力する。
The image
系列変換部1003は、ブロック分割部1002から出力される画素ブロックを周波数変換することで、8×8個の係数値を生成し、係数量子化部104に出力する。
The series conversion unit 1003 frequency-converts the pixel block output from the block division unit 1002 to generate 8 × 8 coefficient values and outputs the generated coefficient values to the
ここで述べる周波数変換は、JPEG(ISO/IEC 15444−1)で用いられるDCT(離散コサイン変換)を適用するものとする。JPEGの離散コサイン変換処理については、以下に示す国際標準勧告書に記載されているので、ここでの詳述は省略する。
『ITU-T Recommendation T.81 | ISO/IEC 10918-1:1994, Information technology - Digital compression and coding of continuous-tone still images: Requirements and guidelines.』
The frequency conversion described here applies DCT (discrete cosine transform) used in JPEG (ISO / IEC 154444-1). The JPEG discrete cosine transform processing is described in the following international standard recommendation, and therefore detailed description thereof is omitted here.
ITU-T Recommendation T.81 | ISO / IEC 10918-1: 1994, Information technology-Digital compression and coding of continuous-tone still images: Requirements and guidelines.
なお、JPEGの場合と同様に、離散コサイン変換の適用に先立ち、画素値から中間値を減算するレベルシフト処理を行うものとする。本実施形態における1画素は8ビットで表わされる輝度成分値を持つので、画素値から128を減じた上で、離間コサイン変換を行なうことになる。 As in the case of JPEG, level shift processing for subtracting an intermediate value from a pixel value is performed prior to application of discrete cosine transform. Since one pixel in this embodiment has a luminance component value represented by 8 bits, the cosine transform is performed after subtracting 128 from the pixel value.
係数量子化部104は、係数変換部103から出力されてきた、画素ブロック毎に、その画素ブロック内に含まれる各DCT係数値を、ユーザモード設定部107で設定された画質レベルに対応する量子化マトリクスを用いて、量子化する。画質レベルが高画質である場合、選択される量子化マトリクス内の各量子化ステップ値は、標準画質用のそれよりも小さな値を持つことになる。係数量子化部104は、量子化後の各係数値を係数バッファ105へと格納する。なお、以降の説明において、量子化の有無を区別する必要がない場合、係数バッファ105に格納されている「量子化された係数値」を単に「係数値」と記す。また、係数量子化部104が生成する1個の係数値は、正負の符号を示す1ビットと絶対値部分を示す8ビットの計9ビットであるものとする。但し、係数値を表現するビット数はこれに限らない。特に、精度を高くするのであれば10ビット以上でも構わない。
The
先に説明したように、ユーザモード設定部107からエントロピー符号化制御部108には、{符号化速度優先モードor符号量抑制優先モードorオートモード}、{L or M or S}を示す信号が供給される。
As described above, from the user
このエントロピー符号化制御部108は、係数データ取得部106、及び、境界ビット位置決定部109に与える符号化パラメータを決定する符号化パラメータ決定部として機能する。具体的には、符号化速度優先モードが選択された場合のエントロピー符号化制御部108の処理は、いずれの画像サイズが指定されても、{オートモード&画像Lサイズ}と等価の処理となるように各処理部を設定する。また、符号量抑制優先モードが選択された場合のエントロピー符号化制御部108の処理は、画像サイズL,M,Sのいずれが指定された場合であっても、{オートモード&画像Sサイズ}と等価の処理となるように各処理部を設定する。従って、符号化速度優先モード、符号量抑制優先モードについては、以下に説明するオートモードの記述に従って把握されたい。
The entropy
以下、オートモードが選択された場合について説明する。 Hereinafter, a case where the auto mode is selected will be described.
エントロピ符号化制御部108は、オートモードが設定されたことを示す情報を受信すると、ユーザが選択した画像サイズに応じた制御信号(符号化パラメータ)を、係数データ取得部106、境界ビット位置決定部109、及び、符号量比較部111に出力する。
When the entropy
係数データ取得部106、境界ビット位置決定部109、及び、符号量比較部111の処理は次の通りである。なお、係数データ取得部106は、ラスタースキャン順に画素ブロックの係数値を係数バッファ105から取得する。画像の左上隅の画素ブロックを0番目と定義し、その画素ブロックをMB0と定義する。そして、i番目の画素ブロックを着目画素MBiと表わすこととする。ここで、iは0≦i≦画素ブロックの総数−1の関係にある。
The processing of the coefficient
・画像サイズLの場合:
係数データ取得部106は、着目画素ブロックMBiと、それに後続する3つの画素ブロックBMi+1、BMi+2、BMi+3の計4つの画素ブロックの係数値を係数バッファ105から取得する。そして、係数データ取得部106は、着目画素ブロックMBiの64個の係数値をエントロピー符号化処理部110内のエントロピー符号化部110aに出力する。また、係数データ取得部106は、着目画素ブロックの次の画素ブロックMBi+1の64個の係数値を、エントロピー符号化部110bに出力する。また、係数データ取得部106は、着目画素ブロックMBi+2の64個の係数値を、エントロピー符号化部110cに出力する。そして、係数データ取得部106は、着目画素ブロックMBi+3の64個の係数値を、エントロピー符号化部110dに出力する。
-For image size L:
The coefficient
また、係数データ取得部106は、画素ブロックMBi、MBi+1、MBi+2、MBi+3の4つの画素ブロックの各係数値を、この順番に境界ビット位置決定部109に出力する。
Further, the coefficient
境界ビット位置決定部109は、画素ブロックMBiの係数値から、複数の境界ビット位置の候補を算出する。そして、境界ビット位置決定部109は第1位の境界ビット位置の候補を、エントロピー符号化部110aに出力する。同様に、境界ビット位置決定部109は画素ブロックMBi+1、MBi+2、MBi+3それぞれの第1位の境界ビット位置の候補を、エントロピー符号化部110b、110c、110dに出力する。
The boundary bit
この結果、エントロピー符号化部110a乃至100dは、それぞれ、画素ブロックMBi、MBi+1、MBi+2、画素ブロックMBi+3を、与えられた境界ビット位置を用いて符号化し、符号化データを符号量選択部111に出力する。
As a result, the
符号量比較部111は、エントロピー符号化部110a、110b、110c、100dからの符号化データを、この順番に符号化データ出力部112に出力する。
The code
上記のようにして、4つの画素ブロックが並列的に符号化される。従って、4つの画素ブロックの符号化処理を終えると、係数データ取得部106は画素ブロックMBi+4を着目画素ブロックと見なして、上記処理を行なうことにない、最終画素ブロックの符号化が終わるまで、この処理を繰り返す。従って、生成される符号化データ量が、最小となるとは限らないものの、エントロピー符号化処理部110の稼働率を100%となり、高速な符号化処理を実現できる。
As described above, four pixel blocks are encoded in parallel. Therefore, when the encoding process of the four pixel blocks is completed, the coefficient
・画像サイズMの場合:
係数データ取得部106は、着目画素ブロックMBiと、それに後続する画素ブロックBMi+1の計2つの画素ブロックの係数値を係数バッファ105から取得する。そして、係数データ取得部106は、着目画素ブロックMBiの64個の係数値をエントロピー符号化処理部110内のエントロピー符号化部110a、110bに出力する。また、係数データ取得部106は、着目画素ブロックの次の画素ブロックMBi+1の64個の係数値を、エントロピー符号化部110c、110dに出力する。
-For image size M:
The coefficient
境界ビット位置決定部109は、画素ブロックMBiの係数値から、上位2つの境界ビット位置の候補を、エントロピー符号化部110a、110bに出力する。同様にして、画素ブロックMBi+1から、境界ビット位置の上位2つの候補を、エントロピー符号化部110c、110dに出力する。
The boundary bit
この結果、エントロピー符号化部110a乃至100dは、それぞれ与えられた係数値を符号化し、符号化データを符号量選択部111に出力する。
As a result, the
符号量比較部111は、先ず、エントロピー符号化部110a、110bからの符号化データのデータ量を比較する。そして、データ量の少ない符号化データを着目画素ブロックの符号化データとして選択し、符号化データ出力部112に出力する。次いで、符号量比較部111は、エントロピー符号化部110c、110dからの符号化データのデータ量を比較する。そして、データ量の少ない符号化データを着目画素ブロックの次の画素ブロックの符号化データとして選択し、符号化データ出力部112に出力する。
The code
上記のようにして、2つの画素ブロックについて、4つのエントロピー符号化部が符号化処理を行なうことになる。つまり、エントロピー符号化処理部110の稼働率を100%にできる。また、画像サイズがMの場合、1つの画素ブロックについて2つの符号化処理を行ない、符号化データ量の少ない方が選択されるので、符号化効率を更に高くすることができる。
As described above, four entropy encoding units perform encoding processing for two pixel blocks. That is, the operating rate of the entropy
・画像サイズSの場合:
係数データ取得部106は、着目画素ブロックMBiの係数値を係数バッファ105から取得する。そして、係数データ取得部106は、着目画素ブロックMBiの64個の係数値をエントロピー符号化処理部110内のエントロピー符号化部110a、110b、110c、110dに出力する。
-For image size S:
The coefficient
境界ビット位置決定部109は、画素ブロックMBiの係数値から、境界ビット位置の上位4つ候補をエントロピー符号化部110a乃至110dに出力する。
The boundary bit
符号量比較部111は、エントロピー符号化部110a乃至110dからの4つの符号化データのデータ量を比較する。そして、データ量が最小の符号化データを着目画素ブロックの符号化データとして選択し、符号化データ出力部112に出力する。
The code
上記の結果、1つの画素ブロックについて、4つの境界位置での符号化を行なうことになるので、エントロピー符号化処理部110の稼働率を100%にできる。また、1つの画素ブロックについて4つの符号化処理を行ない、符号化データ量の少ない方が選択されるので、符号化効率を更に高くすることができる。また、画像サイズがSの場合の画素ブロックの総数は、画像サイズM、Lのそれと比較して、少ないので、符号化に要する時間は問題にならない。
As a result, since one pixel block is encoded at four boundary positions, the operation rate of the entropy
以上、オートモードが選択された場合の各画像サイズ(解像度)に応じた処理を説明した。 The process according to each image size (resolution) when the auto mode is selected has been described above.
なお、符号化速度優先モードが選択された場合、画像サイズとは無関係に連続する4つの画素ブロックについて、4つのエントロピー符号化部110a乃至110dが符号化処理を行なうことになる。また、符号量抑制優先モードが選択された場合、画像サイズとは無関係に、1つの画素ブロックについて、異なる4つの境界ビット位置に従い4つエントロピー符号化部110a乃至110dそれぞれが符号化処理を行ない、最小の符号化データを選択し、出力することになる。
When the encoding speed priority mode is selected, the four
次に、境界ビット位置決定部109、及び、エントロピー符号化処理部110について更に詳しく説明する。
Next, the boundary bit
先ず、境界ビット位置決定部109について説明する。図3は、境界ビット位置決定部109のブロック構成図である。境界ビット位置決定部109は、有効ビット判定部301、頻度テーブル生成部302、頻度テーブルバッファ303、境界ビット選択部304を有する。
First, the boundary bit
説明を簡単にするため、1つの画素ブロック(着目画素ブロック)の境界ビット位置を決定する処理について説明する。また、着目画素ブロック内の64個の各係数値をCnと表わす。 In order to simplify the description, a process for determining the boundary bit position of one pixel block (target pixel block) will be described. Each of the 64 coefficient values in the pixel block of interest is represented as Cn.
有効ビット判定部301は入力される各係数値Cnの有効ビット数B(Cn)を求める。有効ビット数とは係数値Cnの絶対値を自然2進数表記した場合に、上位から下位ビットに探索した際に最初に“1”が出現するビット位置を示す。例えば、着目する係数値Cnが“−5”である場合、その絶対値“5”について自然2進表記すると、“0…0101”となる。最上位の“1”は最下位から3桁目であるので、B(−5)=3となる。言い換えれば、絶対値が“5”の係数値の有効なビット数は、最下位ビットから3ビットであると言うことができる。なお、Cn=0である場合、“1”のビットは存在しないので、有効ビット数B(Cn)は0となる。要するに、有効ビット数B(Cn)は、係数Cnの絶対値|Cn|に対して|Cn|<2Pの条件を満たす最小の正の整数値Pであると言える。
The effective
頻度テーブル生成部302は有効ビット数判定部301から出力されるB(Cn)について、頻度テーブルバッファ303に保持する発生頻度テーブルを更新する。実施形態における係数Cnは、その正負の符号ビットを除くと、8ビットで表わされる。従って、頻度テーブルバッファ303は、有効ビット数0乃至8それぞれの出現頻度N(0)乃至N(8)を格納する容量を有する。頻度テーブルバッファ308は、1つの画素ブロックの頻度を求める際に、“0”で初期化されるものとする。そして、有効ビット判定部301が着目係数値Cnの有効ビット数B(Cn)を決定した場合、頻度テーブル生成部302は頻度テーブルバッファ303内のN(B(Cn))を“1”だけ増加させる。つまり、頻度テーブル生成部302は、有効ビット判定部301によって1つの係数値の有効ビットを判定する度に、頻度テーブルバッファ303を更新する。
The frequency
図4は、上記のようにして求めた、着目画素ブロック内の全係数値の有効ビットの出現頻度をグラフにして示した例を示している。図4では、有効ビット数が0乃至7が存在し、有効ビット数8の出現回数は0回であった例を示している。 FIG. 4 shows an example in which the appearance frequency of the effective bits of all coefficient values in the pixel block of interest obtained as described above is shown as a graph. FIG. 4 shows an example in which there are 0 to 7 effective bits and the number of occurrences of 8 effective bits is 0.
さて、着目する矩形ブロックのすべての係数値について、有効ビット数の判定、頻度テーブルの更新処理が行われると、境界ビット選択部304は、着目矩形ブロックにおける境界ビットの候補を算出を行なう。具体的には、次の通りである。
When the effective bit number determination and the frequency table update processing are performed for all the coefficient values of the target rectangular block, the boundary
境界ビット選択304は、まず、頻度テーブルバッファ303に格納される各有効ビット数bの出現回数N(b)(bは任意の整数値)を、有効ビット数の最大値から最小値に向けて累積加算することで、図5のような累積頻度のテーブルS(b)へと変換を行う。着目画素ブロックにおいて、出現回数が1以上の有効ビット数の最大値をbmax(図4の場合にはbmax=7)とするとき、境界ビット選択部304は、変数b=bmax,bmax−1,bmax−2…と更新して、次式で示される累積頻度テーブルS(b)を求める。
S(b)=N(b) b=bmaxの場合
S(b)=N(b)+S(b+1) b≠bmaxの場合
In the
S (b) = N (b) When b = bmax S (b) = N (b) + S (b + 1) When b ≠ bmax
上記は、逆に変数b=0、1、2、…、bmaxと更新する場合、合算関数Σを用いて次のように表わすこともできる。
S(bmax−b)=ΣN(bmax−i) (i=0,1,…,b)
Conversely, when the variable b = 0, 1, 2,..., Bmax is updated, it can be expressed as follows using the summation function Σ.
S (bmax−b) = ΣN (bmax−i) (i = 0, 1,..., B)
累積頻度テーブルS(b)は、要するに、b≠0の場合、絶対値が2^b以上となる係数値の個数を表すことを示している。また、S(0)は着目矩形ブロック内の全係数値の個数に等しい。 In short, the cumulative frequency table S (b) indicates that when b ≠ 0, the cumulative frequency table S (b) represents the number of coefficient values whose absolute value is 2 ^ b or more. S (0) is equal to the number of all coefficient values in the target rectangular block.
累積頻度テーブルS(b)を得た後、境界ビット選択部304は、有効ビット数の最大値から最小値に向けて、すなわち、降順にS(b)の値を調べ、予め設定された閾値Thを超える最大整数bを探索する。そして、境界ビット選択部304は、得られたbを境界ビット位置の第1候補B1として決定する。
After obtaining the cumulative frequency table S (b), the boundary
ここで閾値Thは係数値の総数(実施形態の場合、画素ブロックは8×8画素のサイズなので、係数値の総数は64個)に対して、所定の比率となるように設定する。この閾値Thはユーザが適宜設定もしくは選択可能にすることができるものとするが、統計的に見ると、この閾値Thは矩形ブロック内の全係数の個数の1/4乃至1/3が適当である。例えば、比率1/3を採用するなら、閾値Thは“21”(≒64/3)である。
Here, the threshold Th is set to be a predetermined ratio with respect to the total number of coefficient values (in the case of the embodiment, since the pixel block has a size of 8 × 8 pixels, the total number of coefficient values is 64). This threshold value Th can be set or selectable by the user as appropriate, but from a statistical viewpoint, this threshold value Th is suitably ¼ to 3 of the total number of coefficients in the rectangular block. is there. For example, if the
また、境界ビット選択部304は、第1候補B1からのビットの距離順に第2候補以降を決定する。例えば、「B1+1」を第2候補B2、「B1−1」を第3候補B3、「B1+2」を第4候補B4として決定する。言い換えれば、境界ビット選択部304は、第1候補B1が決定した場合、それを中心にして距離が長くなる順に第2候補以降を決定する。
Further, the boundary
詳細は後述するが、エントロピー符号化処理部110内の各エントロピー符号化部110a乃至110dは、係数値Cnを境界ビットBで上位と下位に分離し、上位ビット部に対してゼロの連続数の符号化、即ち、ランレングス符号化を適用する。従って、ここでの閾値Thの役割は、係数値の上位ビット部が非ゼロの係数とゼロの係数値の比を調整するためのものであり、ランレングス符号化を有効に機能させることを狙いとして設定されるものであると言える。図5に示した例では、“5”が閾値Thを超える最大のbとなる場合、第1候補の境界ビット位置B1は“5”となる。また、第2候補B2は、“6”、第3候補B3は“4”、そして、第4候補B4は“7”となる。なお、候補を選定する際に、その候補の値が、係数Cnの取り得る範囲を超える場合には、その値を無視して、有効な範囲内で決定するものとする。例えば、境界ビット位置Bが仮に“8”となった場合、7、6、5が第2乃至第4候補の値として決定される。
Although details will be described later, each of the
ここで、先に説明したオートモードが選択された場合の境界ビット位置決定部109の処理をまとめると次の通りである。なお、以下の説明で、着目画素ブロックMBiに対する境界ビット位置の第1候補をB1i、第2候補をB2i、第3候補をB3i、第4候補をB4iと表わすこととする。
・画像サイズがLの場合:
境界ビット位置決定部109は、着目画素ブロックを含む計4つの画素ブロックMBi、MBi+1,MBi+2、MBi+3それぞれから第1候補の境界ビット位置B1i,B1i+1,B1i+2,B1i+3を算出する。言い換えれば、境界ビット位置決定部109は、各画素ブロックの第2候補以降の境界ビット位置を出力しない。そして、境界ビット位置決定部109は、境界ビット位置B1iをエントロピー符号化部110aに出力する。同様に、境界ビット位置決定部109は、境界ビット位置B1i+1、B1i+2,B1i+3それぞれを、エントロピー符号化部110b、110c、110dに出力する。
・画像サイズがMの場合:
境界ビット位置決定部109は、着目画素ブロックとその次の画素ブロックの計2画素ブロックのMBi、MBi+1それぞれから第1候補、第2候補の境界ビット位置B1i,B2i,B1i+1,B2i+1を算出する。そして、境界ビット位置決定部109は、境界ビット位置B1iをエントロピー符号化部110aに出力し、境界ビット位置B2iをエントロピー符号化部110bに出力する。同様に、境界ビット位置決定部109は、境界ビット位置B1i+1、B2i+1を、エントロピー符号化部110c、110dに出力する。
・画像サイズがSの場合:
境界ビット位置決定部109は、着目画素ブロックMBiから第1乃至第4候補の境界ビット位置B1i,B2i,B3i,B4iを算出する。そして、境界ビット位置決定部109は、境界ビット位置B1i,B2i,B3i,B4iそれぞれを、エントロピー符号化部110a乃至110dに出力する。
Here, the processing of the boundary bit
-When the image size is L:
The boundary bit
・ When the image size is M:
The boundary bit
・ When the image size is S:
The boundary bit
次に、エントロピー符号化処理部110について説明する。図1に示すように、実施形態におけるエントロピー符号化処理部110は、4つのエントロピー符号化部110a乃至110dを有する。各エントロピー符号化部は、係数データ取得部106から入力した1画素ブロック内の各係数Cn(64個)を、境界ビット位置決定部109から入力した境界ビット位置に従って符号化するものであり、その構成は互いに同じである。それ故、以下では、エントロピー符号化部110aについてのみ説明することとする。
Next, the entropy
図2は、エントロピー符号化部110aのブロック構成図である。図示の如く、エントロピー符号化部110aは、上位/下位ビット分離部200、上位ビット符号化部201、下位ビット符号化部202、符号バッファ203、符号列形成部204を有する。
FIG. 2 is a block configuration diagram of the
以下、境界ビット位置決定部109からエントロピー符号化部110aに設定される境界ビット位置を“B”として説明する。
Hereinafter, the boundary bit position set by the boundary bit
上位/下位ビット分離部200は、係数データ取得部106から出力された着目画素ブロックの係数値Cnについて、その符号絶対値表現における下位Bビットを取り除いて得られる上位ビット部と、境界ビット位置以下の下位Bビット部とに分離する。但し、正負の符号ビットは処理対象外とする。より具体的には、上位/下位ビット分離部200は、着目係数値Cnの、上位ビット部Un(=Cn>>B)と、下位ビット部Ln(=|Cn|&((1<<B)−1))を求める。ここでY>>Xは、値YをXビットだけ下位方向にシフトすることを示し、Y<<Xは値YをXビットだけ上位方向にシフトすることを示している。また、|Y|は値Yの絶対値を、X&Yは値Xと値Yとのビット単位の論理積(AND)を示す。
The upper / lower
上位/下位ビット分離部200は、着目係数値Cnの上記ビット部Unを上位ビット符号化201に出力し、下位ビット部Lnを下位ビット符号化部202へと出力する。
The upper / lower
なお、上位ビット部Unの正負符号ビットを除く値が“0”である係数Cnについては、係数Cnの正負を表す符号も下位ビット符号化部202へと引き渡されるものとする。
It should be noted that for the coefficient Cn whose value excluding the sign bit of the upper bit part Un is “0”, the sign indicating the sign of the coefficient Cn is also passed to the lower
図6に、係数値Cnの一例として“−41、−7、28、−1、…”が入力され、境界ビット位置B=4で上位ビット部Unと下位ビット部Lnに分離した例を示す。 FIG. 6 shows an example in which “−41, −7, 28, −1,...” Is input as an example of the coefficient value Cn, and the upper bit part Un and the lower bit part Ln are separated at the boundary bit position B = 4. .
図示の場合、上位/下位ビット分離部200は、正負符号の1ビットを含む64個の上位ビット部Unを上位ビット符号化部201に出力する。
In the case illustrated, the upper / lower
上位ビット符号化部201は、入力される上位ビット部Unの正負符号ビットを除外した4ビットで表わされる値が“0”の場合、ここではその正負符号ビットの符号化は行なわない。上位ビット部Unにおいて、正負符号ビットを除外した4ビットで表わされる値が“0”となるのは、図6の場合、係数値Cn=“−7”、“−1”である。また、上位ビット部Unの正負符号ビットを除く、4ビットで表わされる値が非“0”の場合、その正負符号ビットを含む上位ビット部Unがそのままランレングス符号化対象となる。
When the value represented by 4 bits excluding the sign bit of the input upper bit part Un is “0”, the upper
従って、図6の場合、上位ビット符号化部201は、10進数表記の多値データ“−2”、“0”、“1”、“0”…の順に、ランレングス符号化を行なうことになる。この結果、上位ビット部が“0”となる確率が高くなり、符号化効率が高めることができる。
Accordingly, in the case of FIG. 6, the upper
なお、1つの画素ブロックからは、1個のDC係数と、63個のAC係数が得られる。そして、実施形態における上位ビット符号化部201の符号化はJPEGのBaselineでのDC,AC係数の符号化と同じ方法を用いる。すなわち、着目画素ブロックのDC係数の上位ビット部Unを符号化する場合には、直前の画素ブロック(既に符号化済みのブロックでもある)のDC係数の上位ビット部Unを予測値として用いる。そして、着目画素ブロックの上位ビット部Unと予測値との差分を算出し、その差分に基づきハフマン符号化を行う。そして、AC係数の上位ビット部Unについては、ゼロの連続数と非ゼロの係数を組み合わせてハフマン符号化を行う。ブロックの最後がゼロの連続で終わる場合にはEOB(End Of Block)を表す特殊符号を用いる点についてもJPEG Baselineと同様である。
Note that one DC coefficient and 63 AC coefficients are obtained from one pixel block. The upper
一方、上位/下位ビット分離部200は、着目矩形ブロックの64個の下位ビット部Lnを下位ビット符号化部202に出力する。ただし、先に説明したように、上位/下位ビット分離部200は、上位ビット部Unの正負符号ビットを除く4ビットの値が“0”である係数Cnについては、その正負符号ビットを下位ビット部Lnに付加して下位ビット符号化部202に出力する。
On the other hand, the upper / lower
正負符号ビットを除く上位ビット部Unの値が“0”となるのは、図6の例では、係数値“−7”と、“−1”である。そこで、正負符号ビットの付加位置は、下位ビット部Lnの上位から下位に向かって最初に“1”が出現する位置とする。図6の場合には、斜線で示される位置が正負ビットを挿入する位置になる。 In the example of FIG. 6, the coefficient values “−7” and “−1” indicate that the value of the upper bit part Un excluding the sign bit is “0”. Therefore, the addition position of the plus / minus sign bit is set to a position where “1” first appears from the high order to the low order of the low order bit part Ln. In the case of FIG. 6, the position indicated by the diagonal lines is the position where the positive and negative bits are inserted.
下位ビット符号化部202は上位/下位ビット分離部200から出力された下位ビット部Lnの符号化を行う。上位ビット部Unに対し、下位ビット部Lnは一般に圧縮しにくいデータであるので、本実施形態の下位ビット符号化部202は、下位ビット部Lnを非圧縮で出力する(但し、圧縮性能を追求する場合には算術符号などを適用しても良い)。非圧縮であるので、基本的には入力データがそのまま符号化データとなるが、画質への影響度に応じてビットデータが配置されるように、言い換えれば、復号装置がプログレッシブ再生できるようにするため、ビットプレーン順に並び替えて出力する。
The lower
図6の場合、下位ビット符号化部202は、入力した下位ビット部Lnを不図示の内部バッファに格納し、各下位ビット部Lnの最上位のビット桁(B番目の桁)で構成されるビットプレーンを出力する。この処理を最下位のビット桁(1番目の桁)まで繰り返す。
In the case of FIG. 6, the lower
図6に示した係数値列“−41、−7、28、−1、…”の場合(境界ビット位置B=4)における、下位ビット符号化部202が出力するデータの例を、図7に示す。
An example of data output by the lower
下位ビット部Lnの最初に出力されるプレーン(同一ビット位置のビット情報)はB桁のビットプレーン“1010…”となる。この中の“1”に対応するのは、係数値“−41”、“28”である。係数値“−41”、“28”の正負符号ビットを除く上位ビット部Unが表わす値は非0であるので、正負符号ビットは挿入されない。 The plane (bit information at the same bit position) output at the beginning of the lower bit part Ln is a B-digit bit plane “1010...”. The coefficient values “−41” and “28” correspond to “1”. Since the value represented by the upper bit part Un excluding the sign bits of the coefficient values “−41” and “28” is non-zero, the sign bit is not inserted.
次のB−1桁のビットプレーンに着目すると、係数値“−7”を表わす最初の“1”のビットが出現する(図6参照)。また、係数値“−7”の正負符号ビットを除く上位ビット部Unの値は“0”となる。それ故、図示の如く、係数値“−7”を表わす最初の“1”に後続する位置に、正負の符号ビットを挿入する。以下、B−2桁のビットプレーン、B−3桁のビットプレーンを出力していく。B−3桁のビットプレーンでは、係数値“−1”を表わす最初の“1”が出現するので、それに後続して正負符号ビットが挿入される。 Focusing on the next bit plane of B-1 digits, the first “1” bit representing the coefficient value “−7” appears (see FIG. 6). Further, the value of the upper bit part Un excluding the sign bit of the coefficient value “−7” is “0”. Therefore, as shown in the figure, positive and negative sign bits are inserted at positions following the first “1” representing the coefficient value “−7”. Hereinafter, the B-2 digit bit plane and the B-3 digit bit plane are output. In the B-3 digit bit plane, since the first “1” representing the coefficient value “−1” appears, the sign bit is inserted subsequently.
符号化バッファ203には、上位ビット符号化部201、下位ビット符号化部202から出力される画素ブロックを単位とする符号化データが格納される。また、符号化バッファ203には、境界ビット位置決定部109から設定された境界ビット位置の情報も格納されるものとする。
The
符号列形成部204は、符号バッファ203に格納された1画素ブロックの符号化データから、図8に示すような構造の画素ブロックの符号化データを形成し、符号量比較部111に出力する。図8において、ブロックヘッダには着目画素ブロックの境界ビット位置Bの情報が格納される。また、それに後続して、上位ビット部Unの符号化データ、下位ビット部Lnの符号化データが格納されることになる。
The code
以上、エントロピー符号化部110aの処理内容について説明した。他のエントロピー符号化部110b、110c、110dは、与えられる係数値、又は、境界ビット位置が、エントロピー符号化部110aのそれと異なるだけである。
The processing content of the
符号量比較部111については、既に説明した通りであるが、これまでの説明に基づいてまとめると次の通りである。以下もユーザがユーザモード設定部107を操作してオートモードが選択された場合の説明である。
The code
なお、符号量比較部111内には、適当な容量の内部バッファを備えているものとする。
・画像サイズがLの場合:
エントロピー符号化部110a乃至110dは、画素ブロックMBi,MBi+1,MBi+2,MBi+3の符号化データを出力する。従って、符号量比較部111は各符号化データが画素ブロックMBi,MBi+1,MBi+2,MBi+3の符号化データであるものとし、そのまま符号化データ出力部112に出力する。
・画像サイズがMの場合:
エントロピー符号化部110a、110bは、画素ブロックMBiの境界ビット位置の第1候補B1i、第2候補B2iをパラメータとする符号化データを出力する。そこで、符号量比較部111は、この2つの符号化データのデータ量を比較し、符号量の小さい方を画素ブロックMBiの符号化データとして選択し、符号化データ出力部112に出力する。また、符号量比較部111は、非選択の符号化データを破棄する。
It is assumed that the code
-When the image size is L:
The
・ When the image size is M:
また、エントロピー符号化部110c、110dは、画素ブロックMBi+1の境界ビット位置の第1候補B1i+1、第2候補B2i+1の符号化データを出力する。そこで、符号量比較部111は、この2つの符号化データのデータ量を比較し、符号量の小さい方を画素ブロックMBi+1の符号化データとして選択し、符号化データ出力部112に出力する。また、符号量比較部111は、非選択の符号化データを破棄する。
・画像サイズがSの場合:
エントロピー符号化部110a乃至110dは、画素ブロックMBiの境界ビット位置の第1候補B1i、第2候補B2i、第3候補B3i、第4候補B4iの符号化データを出力する。そこで、符号量比較部111は、これら4つの符号化データのデータ量を比較し、最小符号量となる符号化データを、画素ブロックMBiの符号化データとして選択し、符号化データ出力部112に出力する。また、符号量比較部111は、非選択の3つの符号化データを破棄する。
Further, the
・ When the image size is S:
The
次に、符号化データ出力部112について説明する。
Next, the encoded
符号化データ出力部112は、符号量比較部111からの符号化データを入力するに先立ってファイルヘッダを生成し、出力する。このファイルヘッダには、画像の水平方向画素数、垂直方向画素数や、色成分の数(実施形態でモノクロ画像の例であるので色成分の数は1つ)、各画素のビット数など、復号に必要な各種情報がヘッダとして付与される。
The encoded
この後、符号化データ出力部112は、符号量比較部111からの各画素ブロックの符号化データを、先に生成したファイルヘッダに後続するように出力する。図9は、実施形態における符号化画像データのファイル構造を示している。
Thereafter, the encoded
なお、最終的に生成される符号化画像データのファイル構造は図9に限らない。例えば、図10に示すファイル構造であっても良い。 Note that the file structure of the finally generated encoded image data is not limited to FIG. For example, the file structure shown in FIG. 10 may be used.
例えば、図10のように、ファイルヘッダには、画像の水平方向画素数、垂直方向画素数や、色成分の数、各画素のビット数など、復号に必要な各種情報がヘッダとして付与する。このヘッダには全てのブロックについての境界ビット位置情報も含まれる。即ち、復号側ではこのヘッダを解析すれば、各ブロックの境界ビット位置を得ることができるということである。ヘッダの後に、画像の全ブロックについて上位ビット符号化データが配置され、その後に、下位ビット符号化データが並ぶ。図中、Nはブロックの総数を表し、Lは全ブロックについて探索した境界ビット位置Bの最大値を表す。上位ビット符号化データは、ラスタースキャンの順番で各ブロックの上位ビット部符号化データを連結して構成される。下位ビット符号化データは各ブロックの下位ビット部符号化データをビットプレーン順に配置して構成される。ビットプレーンiはラスタースキャンの順番で各ブロックのビットプレーンiのデータを集めて構成されるが、境界ビットB<iとなるブロックからのデータは含まれないため、必ずしもすべてのブロックからデータが集められるわけではない。 For example, as shown in FIG. 10, various information necessary for decoding, such as the number of pixels in the horizontal direction and the number of pixels in the vertical direction, the number of color components, and the number of bits of each pixel, are added to the file header. This header also includes boundary bit position information for all blocks. That is, if this header is analyzed on the decoding side, the boundary bit position of each block can be obtained. After the header, the upper bit encoded data is arranged for all the blocks of the image, and then the lower bit encoded data is arranged. In the figure, N represents the total number of blocks, and L represents the maximum value of the boundary bit position B searched for all blocks. The upper bit encoded data is configured by concatenating the upper bit portion encoded data of each block in the order of raster scanning. The low-order bit encoded data is configured by arranging low-order bit part encoded data of each block in the order of bit planes. The bit plane i is configured by collecting the data of the bit plane i of each block in the raster scan order, but does not include the data from the block where the boundary bit B <i, and therefore the data is not necessarily collected from all the blocks. It is not done.
以上実施形態の画像符号化装置の構成とその処理について説明した。上記実施形態を分かりやすくまとめると次の通りである。 The configuration and processing of the image encoding device according to the embodiment have been described above. The above embodiment is summarized as follows in an easy-to-understand manner.
先ず、エントロピー符号化処理部110が有するエントロピー符号化部の数をN0個(実施形態ではN0=4の場合であった)とする。また、連続する位置の符号化対象の画素ブロックの個数をN1、1つの画素ブロックを符号化する際の用いる境界ビット位置の候補の数をN2と定義する。ここでN0,N1,N2の関係は、N0=N1×N2である。
First, it is assumed that the number of entropy encoding units included in the entropy
かかる定義の下で、本実施形態の符号化処理を説明すると、画像のサイズが大きいほど、符号化パラメータであるN1を大きくし、N2を小さくして符号化処理を行なう。逆に、画像のサイズが小さいほど、N1を小さくし、N2を大きくして符号化処理を行なう。そして、決定されたN1個の画素ブロックの各係数値を、前記境界ビット位置決定部109に供給することで、各画素ブロックについてN2個の境界ビット位置の候補を算出させる。そして、各画素ブロックの係数値を、N2個のエントロピー符号化部のそれぞれに供給するとともに、N2個の境界ビット位置の候補を各N2個のエントロピー符号化部に設定することで、各画素ブロック毎にN2個の符号化データを生成させる。この結果、1つの画素ブロックの係数値からは、N2個の符号化データが生成される。そして、符号量比較部111は、N2個の符号化データ中の最小符号化データ量となる符号化データを選択し、出力する。符号量比較部111はこの処理をN1個の画素ブロックのそれぞれについて行なう。
Under this definition, the encoding process of the present embodiment will be described. As the image size increases, the encoding parameter N1 is increased and N2 is decreased to perform the encoding process. Conversely, the smaller the image size, the smaller N1 and the larger N2, and the encoding process is performed. Then, the coefficient values of the determined N1 pixel blocks are supplied to the boundary bit
この結果、画像のサイズが大きいほど、単位時間当たりの符号化対象の画素ブロック数が増える。一方、画像サイズが小さいほど、単位時間当たりの符号化対象の画素ブロックの数は減るが、符号化効率を高めることができる。 As a result, the larger the image size, the greater the number of pixel blocks to be encoded per unit time. On the other hand, the smaller the image size, the smaller the number of pixel blocks to be encoded per unit time, but the encoding efficiency can be increased.
なお、実施形態では、N0=N1×N2を満たすものとして説明したが、必ずしもこの要件を満たす必要はない。 In the embodiment, it has been described that N0 = N1 × N2, but this requirement is not necessarily satisfied.
例えば、N0=4の場合、ブロックMBiについては、2つの境界ビット位置の候補を用い、ブロックBMi+1、MBi+2については、それぞれ1つの境界ビット位置候補を用いて符号化しても構わない。この場合、ブロックMBiについては、符号化データ量の少ない方が選択されるが、いずれを選んだとしても画質には影響はない。エントロピー符号化そのものは可逆であり、画質は係数量子化部104による量子化ステップ値で決まるからである。要するに、高速符号化が望まれるほど境界ビット位置の候補数を減らす、換言すれば、符号化効率を高めるほど境界ビット位置を多くするようにすればよい。この結果、3種類を超える解像度で撮影可能なデジタルカメラに対しても対処できる。
For example, when N0 = 4, the block MB i is encoded using two boundary bit position candidates, and the blocks BM i + 1 and MB i + 2 are encoded using one boundary bit position candidate. It doesn't matter. In this case, for the block MBi, the one with the smaller amount of encoded data is selected, but whichever is selected does not affect the image quality. This is because the entropy coding itself is reversible and the image quality is determined by the quantization step value by the
なお、上記実施形態では、画素ブロックのサイズを8×8画素とし、この画素ブロックを単位に境界ビット位置を決定するものとして説明した。しかしながら、本発明はこれに限定されるものではない。例えば、1画素ブロックがn×m画素(n,nは2以上の整数)のサイズとし、系列変換、係数量子化はこの画素ブロックを単位に実行する。そして、境界ビット位置決定部109は、複数の画素ブロック(p×n)×(q×m)で構成されるマクロブロックを単位に境界位置を決定し、各エントロピー符号化部もマクロブロックを単位に、上位ビット部と下位ビット部に分離して、マクロブロックを単位に符号化しても構わない。この場合、1つのマクロブロック内の先頭の画素ブロックのDC成分を符号化する際に用いる予測値を“0”とすることが望ましい。また、2番目以降の画素ブロックのDC成分を符号化する場合には、その直前の画素ブロックのDC成分値を予測値として用いる。このようにすると、マクロブロックを単位に単独で復号することも可能になる。
In the above embodiment, the pixel block size is 8 × 8 pixels, and the boundary bit position is determined in units of the pixel block. However, the present invention is not limited to this. For example, one pixel block has a size of n × m pixels (n and n are integers of 2 or more), and series conversion and coefficient quantization are executed in units of this pixel block. Then, the boundary bit
また、実施形態では、画像のサイズとして3種類、符号化部(実施形態におけるエントロピー符号化部)の数が4つの例を説明したが、この数によって本発明が限定されるものではない。 In the embodiment, an example in which there are three types of image sizes and four encoding units (entropy encoding units in the embodiment) has been described. However, the present invention is not limited to this number.
以上説明したように本実施形態によれば、オートモードが選択された場合、符号化しようとする画像のサイズ(解像度)に応じて、複数の符号化部の稼働率を100%にすることができる。また、サイズの大きい画像を符号化する場合には、多少とも符号化効率が下がる可能性があるものの、高速に符号化することが可能になる。一方、サイズの小さい画像の場合には、符号化処理する単位であるブロック数が少ないので、その分だけ符号化効率を高める処理を行なうことが可能になる。 As described above, according to the present embodiment, when the auto mode is selected, the operation rate of the plurality of encoding units can be set to 100% according to the size (resolution) of the image to be encoded. it can. In addition, when encoding a large image, although there is a possibility that the encoding efficiency may slightly decrease, it is possible to encode at a high speed. On the other hand, in the case of an image with a small size, since the number of blocks as a unit for encoding processing is small, it is possible to perform processing for improving the encoding efficiency by that amount.
なお、実施形態では、デジタルカメラに適用する例を説明したが、画像データの入力源はイメージスキャナを搭載する、もしくは接続可能な装置(例えばデジタル複写機)に適用しても構わない。この場合、「画像のサイズ」は、「原稿サイズ」と置き換えれば理解しやすいであろう。また、イメージスキャナの読み取り解像度が可変の場合には、上記実施形態がそのまま利用できる。 In the embodiment, the example applied to the digital camera has been described. However, the image data input source may be applied to an apparatus (for example, a digital copying machine) on which an image scanner is mounted or connectable. In this case, “image size” can be easily understood by replacing “original size”. Further, when the reading resolution of the image scanner is variable, the above embodiment can be used as it is.
[第1の実施形態の変形例]
上記第1の実施形態と同等の処理を、コンピュータプログラムによって実現する例を第1の実施形態の変形例として以下に説明する。
[Modification of First Embodiment]
An example in which processing equivalent to that in the first embodiment is realized by a computer program will be described below as a modification of the first embodiment.
図14は、本変形例における情報処理装置(例えばパーソナルコンピュータ)のブロック構成図である。 FIG. 14 is a block configuration diagram of an information processing apparatus (for example, a personal computer) in the present modification.
図中、1401はCPUで、RAM1402やROM1403に記憶されているプログラムやデータを用いて本装置全体の制御を行うと共に、後述する画像符号化処理、復号処理を実行する。1402はRAMで、外部記憶装置1407や記憶媒体ドライブ1408、若しくはI/F1409を介して外部装置からダウンロードされたプログラムやデータを記憶する為のエリアを備える。また、RAM1402は、CPU1401が各種の処理を実行する際に使用するワークエリアも備える。1403はROMで、ブートプログラムや本装置の設定プログラムやデータを格納する。1404、1405は夫々キーボード、マウスで、CPU1401に対して各種の指示を入力することができる。
In the figure,
1406は表示装置で、CRTや液晶画面などにより構成されており、画像や文字などの情報を表示することができる。1407はハードディスクドライブ装置等の大容量の外部記憶装置である。この外部記憶装置1407には、OS(オペレーティングシステム)や後述する画像符号化、復号処理の為のプログラム、符号化対象の画像データ、復号対象画像の符号化データなどがファイルとして保存されている。また、CPU1401は、これらのプログラムやデータをRAM1402上の所定のエリアにロードし、実行することになる。
A
1408は記憶媒体ドライブで、CD−ROMやDVD−ROMなどの記憶媒体に記録されたプログラムやデータを読み出してRAM1402や外部記憶装置1407に出力するものである。なお、この記憶媒体に後述する画像符号化、復号処理の為のプログラム、符号化対象の画像データ、復号対象の画像の符号化データなどを記録しておいても良い。この場合、記憶媒体ドライブ1408は、CPU1401による制御によって、これらのプログラムやデータをRAM1402上の所定のエリアにロードする。
A
1409はI/Fで、このI/F1409によって外部装置を本装置に接続し、本装置と外部装置との間でデータ通信を可能にするものである。例えは符号化対象の画像データや、復号対象の画像の符号化データなどを本装置のRAM1402や外部記憶装置1407、あるいは記憶媒体ドライブ1408に入力することもできる。1410は上述の各部を繋ぐバスである。
上記構成において、本装置の電源がONになると、CPU1401はROM1403のブートプログラムに従って、外部記憶装置1407からOSをRAM1402にロードする。この結果、キーボード1404、マウス1405の入力が可能となり、表示装置1406にGUIを表示することが可能になる。ユーザが、キーボード1404やマウス1405を操作し、外部記憶装置1407に格納された画像符号化処理用アプリケーションプログラムの起動の指示を行なうと、CPU1401はそのプログラムをRAM1402にロードし、実行する。これにより、本装置が画像符号化装置として機能することになる。
In the above configuration, when the power of this apparatus is turned on, the
以下、CPU1401が実行する画像符号化処理用のアプリケーションプログラムの処理手順を図11のフローチャートに従って説明する。基本的に、このプログラムは、図1に示す各構成要素に相当する関数を備えることになる。ただし、図1における係数バッファ105、図2の符号バッファ203、図3の頻度テーブルバッファ303の各領域はRAM1402内に予め確保することになる。なお、本変形例では、符号化対象の画像データは外部記憶装置1407にファイルとして格納されており、符号化処理した結果も外部記憶装置1407にファイルとして保存する例を説明する。但し、画像データの入力源は、インタフェース1409に接続されたイメージスキャナであっても良いし、符号化画像データの出力先もネットワークであっても構わない。
Hereinafter, the processing procedure of the application program for image encoding processing executed by the
ユーザが符号化対象となる画像ファイルを指定すると、CPU1401は、そのファイルヘッダを解析することで、画像のサイズ(画素数)が判定できる。ステップS1では、CPU1401は、この判定した画像のサイズと、予め設定された閾値と比較し、L,M,Sのいずれに該当するかを判定する。
When the user designates an image file to be encoded, the
ステップS1にて、符号化対象の画像がサイズSであると判定した場合、ステップS2に進んで、並列的に符号化する画素ブロックの数を定義する変数Pnに“1”に設定する。また、参照する境界ビット位置の候補数を定義する変数Qnに“4”を設定する。 If it is determined in step S1 that the image to be encoded is size S, the process proceeds to step S2, and a variable Pn that defines the number of pixel blocks to be encoded in parallel is set to “1”. Also, “4” is set to the variable Qn that defines the number of boundary bit position candidates to be referred to.
また、ステップS1にて、符号化対象の画像がサイズMであると判定した場合、ステップS3に進んで、並列的に符号化する画素ブロックの数を定義する変数Pnに“2”に設定する。また、参照する境界ビット位置の候補数を定義する変数Qnに“2”を設定する。 If it is determined in step S1 that the image to be encoded is size M, the process proceeds to step S3, and the variable Pn that defines the number of pixel blocks to be encoded in parallel is set to “2”. . Further, “2” is set to the variable Qn that defines the number of candidates for the boundary bit position to be referred to.
また、ステップS1にて、符号化対象の画像がサイズLであると判定した場合、ステップS4に進んで、並列的に符号化する画素ブロックの数を定義する変数Pnに“4”に設定する。また、参照する境界ビット位置の候補数を定義する変数Qnに“1”を設定する。 If it is determined in step S1 that the image to be encoded is size L, the process proceeds to step S4, and the variable Pn that defines the number of pixel blocks to be encoded in parallel is set to “4”. . Further, “1” is set to the variable Qn that defines the number of candidates for the boundary bit position to be referred to.
上記ステップS2乃至S4の処理は、図1のエントロピー符号化制御部108に対応するものである。
The processes in steps S2 to S4 correspond to the entropy
次いで、ステップS5に処理を進め、Pn個の画素ブロックを入力する。これは、係数データ取得部106に相当する処理である。
Next, the process proceeds to step S5, and Pn pixel blocks are input. This is a process corresponding to the coefficient
そして、ステップS6に進んで、Pn個の画素ブロックそれぞれに対し、Qn個の境界ビット位置の候補を算出する。これは境界ビット位置決定部109に相当する処理である。
In step S6, Qn boundary bit position candidates are calculated for each of the Pn pixel blocks. This is a process corresponding to the boundary bit
ステップS7では、Pn個の画素ブロックそれぞれに、Qn個の境界ビット閾値を用いてPn×Qn個の符号化データを生成させる(エントロピー符号化処理部110に相当)。 In step S7, Pn × Qn encoded data is generated in each of the Pn pixel blocks using Qn boundary bit threshold values (corresponding to the entropy encoding processing unit 110).
そして、ステップS8にて、符号量比較&出力処理を行なう。この処理の内容は、先に説明した符号量比較部111と同じである。
In step S8, code amount comparison & output processing is performed. The contents of this process are the same as those of the code
ステップS9では、全画素ブロックの符号化処理を終えたか否かを判定し、否の場合には次のPn個の画素ブロックの符号化を行なうため、ステップS5以降の処理を行なう。 In step S9, it is determined whether or not the encoding process for all pixel blocks has been completed. If not, the process from step S5 is performed to encode the next Pn pixel blocks.
また、ステップS9にて、全画素ブロックの符号化処理を終えたと判断した場合には、本処理を終了する。 If it is determined in step S9 that the encoding process has been completed for all pixel blocks, this process ends.
以上説明したように本変形例によると、先に説明した第1の実施形態と同等の処理を、コンピュータプログラムとしてコンピュータにより実現できる。 As described above, according to the present modification, processing equivalent to that of the first embodiment described above can be realized by a computer as a computer program.
[第2の実施形態]
第2の実施形態を説明する。本第2の実施形態の装置構成は、図1と同じであるが、ユーザモード設定部107は、更に、動画像撮影モードと静止画撮影モードのいずれかを設定できる点が異なる。従って、装置構成は図1を参照して説明する。なお、説明を簡単なものとするため、静止画撮影モードでは、第1の実施形態のオートモードが設定されるものとして説明する。また、動画像撮影モードでは、入力される1枚の画像は動画像における1フレームに対応するものとし、動画像撮影の停止指示が入力されるまで、動画像の撮影が継続するものとして説明する。
[Second Embodiment]
A second embodiment will be described. The apparatus configuration of the second embodiment is the same as that of FIG. 1 except that the user
図12は、エントロピー符号化制御部108の処理内容を示すフローチャートである。以下、同図に従ってエントロピー符号化制御部108の処理手順を説明する。
FIG. 12 is a flowchart showing the processing contents of the entropy
先ず、ステップS21において、エントロピー符号化制御部108は、ユーザモード設定部107より、撮影モードを取得する。そして、ステップS22にて、設定された撮影モードが動画像撮影モードであるか、静止画撮影モードであるかを判定する。動画像撮影モードであると判定した場合、処理はステップS23に進み、並列的に符号化する画素ブロックの数を定義する変数Pnに“4”に設定する。また、参照する境界ビット位置の候補数を定義する変数Qnに“1”を設定する。動画像の場合、フレームレートが30フレーム/秒とするなら、1フレーム当たりの符号化は1/30秒以内に行なわなければならい。そこで、実施形態では、変数Pnに“4”に、変数Qnに“1”を決定する。
First, in step S <b> 21, the entropy
一方、ステップS22にて、静止画撮影モードが設定されていると判断した場合、処理はステップS24に進む。静止画撮影モードの場合、1枚の画像の符号化に要する時間は、動画像ほどの高速性は要求されない。そこで、このステップS24では、第1の実施形態のオートモードに従って変数Pn、変数Qnを決定する。すなわち、画像サイズがLの場合には、Pnを“4”、変数Qnを“1”に決定する。また、画像サイズがMの場合には、Pnを“2”、Qnを“2”に決定する。そして、画像サイズがSの場合には、Pnを“1”、Qnを“4”に決定する。 On the other hand, if it is determined in step S22 that the still image shooting mode is set, the process proceeds to step S24. In the still image shooting mode, the time required for encoding one image is not required to be as fast as a moving image. Therefore, in step S24, the variable Pn and the variable Qn are determined according to the auto mode of the first embodiment. That is, when the image size is L, Pn is determined to be “4” and the variable Qn is determined to be “1”. When the image size is M, Pn is determined to be “2” and Qn is determined to be “2”. When the image size is S, Pn is determined to be “1” and Qn is determined to be “4”.
この後、ステップS25に進み、エントロピー符号化制御部108は、決定したPn,Qnを係数データ取得部106、境界ビット位置決定部109にそれぞれ出力する。
Thereafter, the process proceeds to step S25, and the entropy
係数データ取得部106の処理は第1の実施形態と同じである。境界ビット位置決定部109の処理は、第1の実施形態と同じであっても良いし、より高速に処理する必要がある場合には、全ての画素ブロックに対して境界ビット位置にある固定のビット位置を設定しても構わない。例えば8ビットで係数のビット数列が形成されている場合に、境界ビット位置を下位から3ビット目であるとったように決めてしまっても良い。
The processing of the coefficient
以上本第2の実施形態を説明した。本第2の実施形態によれば、動画像撮影モードでは、リアルタイムに各フレームを符号化する必要があることに鑑み、境界ビット位置の候補数を“1”とし、4つのエントロピー符号化部110a乃至110dに4つの連続する画素ブロックを符号化を行なう。この結果、符号化速度を上げ、フレームの欠落をなくして符号化を行なうことが可能になる。
The second embodiment has been described above. According to the second embodiment, in the moving image shooting mode, in consideration of the necessity of encoding each frame in real time, the number of boundary bit position candidates is set to “1”, and the four
なお、第2の実施形態では、図1の構成を採用したので、エントロピー符号化部の個数が4つの例であったが、この数によって本願発明が限定されるものではない。その理由は先の第1の実施形態で説明した通りである。 In the second embodiment, since the configuration of FIG. 1 is adopted, the number of entropy encoding units is four. However, the present invention is not limited to this number. The reason is as described in the first embodiment.
[第3の実施形態]
第3の実施形態では、圧縮符号化した画像データを格納する記憶媒体(CFメモリカード等)の空き容量に応じて、静止画の符号化の変数Pn、変数Qnを設定する例を説明する。なお、説明を簡単なものとするため、
装置構成は第1の実施形態と同じとし、その説明は省略する。但し、符号化データ出力部112の出力先の記憶媒体の空き容量を検出する構成が増える点であるが、通常のデジタルカメラでも記憶媒体のファイルシステムにアクセスし、その空き容量を検出することを行なっているので、その構成については省略する。
[Third Embodiment]
In the third embodiment, an example will be described in which the variable Pn and the variable Qn for encoding a still image are set according to the free space of a storage medium (such as a CF memory card) that stores compressed and encoded image data. In order to simplify the explanation,
The apparatus configuration is the same as in the first embodiment, and a description thereof is omitted. However, although the configuration for detecting the free capacity of the output destination storage medium of the encoded
図13は、本第3の実施形態におけるエントロピー符号化制御部108の処理手順を示すフローチャートである。以下、同図に従って説明する。
FIG. 13 is a flowchart showing a processing procedure of the entropy
先ず、ステップS31において、エントロピー符号化制御部108は、記憶媒体の空き容量Mcを取得する。そして、ステップS32にて、取得した空き容量Mcが予め設定された閾値Thm以下であるか否かを判定する。Mc≦Thmであると判定した場合、すなわち、空き容量が閾値Thmで示される容量以下であると判定した場合、処理はステップS33に進み、並列的に符号化する画素ブロックの数を定義する変数Pnに“1”に設定する。また、参照する境界ビット位置の候補数を定義する変数Qnに“4”を設定する。この結果、高い圧縮率の符号化データが生成されることになる。
First, in step S31, the entropy
一方、ステップS32にて、Mc>Thm、すなわち、記憶媒体に十分な空き容量があると判定した場合、処理はステップS34に進む。このステップS34では、第1の実施形態のオートモードに従って変数Pn、変数Qnを決定する。すなわち、画像サイズがLの場合には、Pnを“4”、変数Qnを“1”に決定する。また、画像サイズがMの場合には、Pnを“2”、Qnを“2”に決定する。そして、画像サイズがSの場合には、Pnを“1”、Qnを“4”に決定する。 On the other hand, if it is determined in step S32 that Mc> Thm, that is, the storage medium has sufficient free space, the process proceeds to step S34. In step S34, the variable Pn and the variable Qn are determined according to the auto mode of the first embodiment. That is, when the image size is L, Pn is determined to be “4” and the variable Qn is determined to be “1”. When the image size is M, Pn is determined to be “2” and Qn is determined to be “2”. When the image size is S, Pn is determined to be “1” and Qn is determined to be “4”.
この後、ステップS35に進み、エントロピー符号化制御部108は、決定したPn,Qnを係数データ取得部106、境界ビット位置決定部109にそれぞれ出力する。
Thereafter, the process proceeds to step S35, and the entropy
係数データ取得部106、境界ビット位置決定部109の処理は、第1の実施形態と同じである。
The processing of the coefficient
以上説明したように本第3の実施形態によれば、記憶媒体の空き容量が少なくなった場合、圧縮率を上げるためのパラメータに切り換わるので、保存可能な写真枚数を多くすることが可能になる。 As described above, according to the third embodiment, when the free capacity of the storage medium is reduced, the parameter is switched to a parameter for increasing the compression rate, so that the number of photos that can be stored can be increased. Become.
[その他の実施形態]
第4の実施形態を説明する。本第4の実施形態における装置構成も、第1の実施形態と同じであるものとする。但し、バッテリー駆動モードとして省電力モードと通常モード(非省電力モード)のいずれかを設定できるようにする点で異なる。この設定は、不図示の操作パネルから行なうものとする。
[Other Embodiments]
A fourth embodiment will be described. The apparatus configuration in the fourth embodiment is also the same as that in the first embodiment. However, the battery driving mode is different in that either a power saving mode or a normal mode (non-power saving mode) can be set. This setting is performed from an operation panel (not shown).
さて、省電力モード、通常モードのいずれでもエントロピー符号化処理部110の稼働率が100%であるとする。この場合、電力消費量を少なくする為には符号化に要する時間を短くすることである。
Now, let us say that the operating rate of the entropy
そこで、省電力モードが設定されている場合には、Pn=4、Qn=1とし、通常モードの場合には第1の実施形態と同様の処理を行なえば良いであろう。 Therefore, when the power saving mode is set, Pn = 4 and Qn = 1 are set, and in the normal mode, the same processing as in the first embodiment may be performed.
以上、本発明にかかる各実施形態を説明したが、先に説明した第1の実施形態の変形例と同様、第2乃至第4の実施形態にかかる処理を、コンピュータプログラムでもって実現できることは明らかである。また、通常、コンピュータプログラムは、CD−ROM等のコンピュータ可読記憶媒体に格納されており、それをコンピュータが有する読取り装置(CD−ROMドライブ等)にセットし、システムにコピーもしはインストールすることで実行可能になる。従って、かかるコンピュータ可読記憶媒体も本発明の範疇にあることは明らかである。 As described above, each embodiment according to the present invention has been described, but it is obvious that the processing according to the second to fourth embodiments can be realized by a computer program, as in the modification of the first embodiment described above. It is. In general, the computer program is stored in a computer-readable storage medium such as a CD-ROM, and is set in a reading device (CD-ROM drive or the like) included in the computer and copied or installed in the system. Become executable. Therefore, it is obvious that such a computer readable storage medium is also within the scope of the present invention.
Claims (9)
前記画素ブロックの各係数値を、設定された境界ビット位置より上位の上位ビット部、前記設定された境界ビット位置以下の下位ビット部に分離し、前記上位ビット部についてはランレングス符号化を行ない、前記下位ビット部についてはビットプレーンを単位に符号化する、複数の符号化手段と、
着目画素ブロックの各係数について、最上位から最下位のビットに向かって最初に“1”となるビット位置から最下位ビットまでのビット数を有効ビット数として検出し、検出した有効ビット数の出現回数に基づき、前記着目画素ブロックの各係数に対する前記境界ビット位置の複数の候補を決定する境界ビット位置決定手段と、
符号化対象の画像のサイズを設定する設定手段と、
前記複数の符号化手段の個数をN0、並列して符号化する画素ブロックの数をN1、各画素ブロックの符号化する際に参照する境界ビット位置の候補数をN2としたとき、前記設定手段で設定したサイズが大きい程、大きな前記N1を決定するとともに、前記設定手段で設定したサイズが大きいほど小さな前記N2を決定する符号化パラメータ決定手段と、
該符号化パラメータ決定手段で決定されたN1個の画素ブロックの係数値を、前記境界ビット位置決定手段に供給することで、各画素ブロックについてN2個の境界ビット位置の候補を算出させ、各画素ブロックの係数値を、N2個の符号化手段のそれぞれに供給するとともに、前記N2個の境界ビット位置の候補を各N2個の符号化手段に設定することで、各画素ブロック毎にN2個の符号化データを生成させる符号化制御手段と、
1つの画素ブロックの係数値から生成されたN2個の符号化データ中の最小符号化データ量となる符号化データを選択し、出力することを、N1個の画素ブロックのそれぞれについて行なう出力手段と
を備えることを特徴とする画像符号化装置。 An image encoding device that performs frequency conversion and quantization processing in units of pixel blocks from multivalued image data, and encodes each multivalued coefficient obtained by the quantization processing,
Each coefficient value of the pixel block is separated into an upper bit part higher than a set boundary bit position and a lower bit part below the set boundary bit position, and run-length encoding is performed on the upper bit part A plurality of encoding means for encoding the lower bit part in bit plane units;
For each coefficient of the pixel block of interest, the number of bits from the bit position that first becomes “1” from the most significant bit to the least significant bit to the least significant bit is detected as the effective bit number, and the detected effective bit number appears. Boundary bit position determining means for determining a plurality of candidates for the boundary bit position for each coefficient of the pixel block of interest based on the number of times;
Setting means for setting the size of the image to be encoded;
When the number of the plurality of encoding means is N0, the number of pixel blocks to be encoded in parallel is N1, and the number of boundary bit position candidates to be referred to when encoding each pixel block is N2, the setting means The larger the size set in (1), the larger the N1 is determined, and the larger the size set by the setting means is, the smaller the N2 is determined, the encoding parameter determining means;
By supplying the coefficient values of the N1 pixel blocks determined by the encoding parameter determining means to the boundary bit position determining means, N2 boundary bit position candidates are calculated for each pixel block, and each pixel The coefficient value of the block is supplied to each of the N2 encoding units, and the N2 boundary bit position candidates are set in each of the N2 encoding units, so that N2 units are provided for each pixel block. Encoding control means for generating encoded data;
An output means for selecting and outputting encoded data having a minimum encoded data amount among N2 encoded data generated from coefficient values of one pixel block for each of the N1 pixel blocks; An image encoding device comprising:
前記有効ビット数bの出現回数をN(b)と定義し、出現回数が1以上の最大の有効ビット数をbmaxと定義し、変数b=0、1、2…に対する次式の合算関数:
S(bmax−b)=ΣN(bmax−i) (i=0,1,…、b)
において、予め設定された閾値Thに対し、
S(bmax−b)>Th
を満たす最大整数bを求め、当該最大整数bを前記境界ビット位置の第1候補、当該第1候補からのビットの距離順に第2候補以降を決定することを特徴とする請求項1に記載の画像符号化装置。 The boundary bit position determining means includes
The number of occurrences of the effective number of bits b is defined as N (b), the maximum number of effective bits with the number of occurrences of 1 or more is defined as bmax, and the summation function of the following equation for the variable b = 0, 1, 2,.
S (bmax−b) = ΣN (bmax−i) (i = 0, 1,..., B)
In relation to a preset threshold value Th,
S (bmax−b)> Th
The maximum integer b that satisfies the following condition is obtained, and the second integer and the subsequent candidates are determined in order of the first integer at the boundary bit position and the bit distance from the first candidate. Image encoding device.
前記設定手段は前記撮像手段による撮像する画像のサイズを設定することを特徴とする請求項1又は2に記載の画像符号化装置。 Furthermore, an imaging means is provided,
The image encoding apparatus according to claim 1, wherein the setting unit sets a size of an image captured by the imaging unit.
該選択手段で動画像撮影モードが選択された場合に限って、前記符号化パラメータ決定手段は前記N1をN0に設定し、前記N2を“1”に設定することを特徴とする請求項1又は2に記載の画像符号化装置。 Furthermore, an image pickup means, a selection means for selecting either a moving image shooting mode or a still image shooting mode using the image pickup means,
The encoding parameter determining means sets the N1 to N0 and the N2 to "1" only when the moving image shooting mode is selected by the selecting means. 2. The image encoding device according to 2.
該検出手段で検出した空き容量が予め設定された容量以下である場合に限って、前記符号化パラメータ決定手段は前記N1をN0に設定し、前記N2を“1”に設定することを特徴とする請求項1又は2に記載の画像符号化装置。 Furthermore, a detection means for detecting the free capacity of the storage medium for storing the encoded image data is provided,
The encoding parameter determining means sets the N1 to N0 and the N2 to “1” only when the free space detected by the detecting means is equal to or less than a preset capacity. The image encoding device according to claim 1 or 2.
該選択手段で省電力モードが選択された場合に限って、前記符号化パラメータ決定手段は前記N1をN0に設定し、前記N2を“1”に設定することを特徴とする請求項1又は2に記載の画像符号化装置。 Furthermore, a selection means for selecting either the power saving mode or the non-power saving mode is provided,
3. The encoding parameter determining means sets the N1 to N0 and sets the N2 to “1” only when the power saving mode is selected by the selecting means. The image encoding device described in 1.
前記画素ブロックの各係数値を、設定された境界ビット位置より上位の上位ビット部、前記設定された境界ビット位置以下の下位ビット部に分離し、前記上位ビット部についてはランレングス符号化を行ない、前記下位ビット部についてはビットプレーンを単位に符号化する、複数の符号化工程と、
着目画素ブロックの各係数について、最上位から最下位のビットに向かって最初に“1”となるビット位置から最下位ビットまでのビット数を有効ビット数として検出し、検出した有効ビット数の出現回数に基づき、前記着目画素ブロックの各係数に対する前記境界ビット位置の複数の候補を決定する境界ビット位置決定工程と、
符号化対象の画像のサイズを設定する設定工程と、
前記複数の符号化工程の個数をN0、並列して符号化する画素ブロックの数をN1、各画素ブロックの符号化する際に参照する境界ビット位置の候補数をN2としたとき、前記設定工程で設定したサイズが大きい程、大きな前記N1を決定するとともに、前記設定工程で設定したサイズが大きいほど小さな前記N2を決定する符号化パラメータ決定工程と、
該符号化パラメータ決定工程で決定されたN1個の画素ブロックの係数値を、前記境界ビット位置決定工程に供給することで、各画素ブロックについてN2個の境界ビット位置の候補を算出させ、各画素ブロックの係数値を、N2個の符号化工程のそれぞれに供給するとともに、前記N2個の境界ビット位置の候補を各N2個の符号化工程に設定することで、各画素ブロック毎にN2個の符号化データを生成させる符号化制御工程と、
1つの画素ブロックの係数値から生成されたN2個の符号化データ中の最小符号化データ量となる符号化データを選択し、出力することを、N1個の画素ブロックのそれぞれについて行なう出力工程と
を備えることを特徴とする画像符号化装置の制御方法。 A control method for an image encoding device that performs frequency conversion and quantization processing in units of pixel blocks from multi-value image data, and encodes each multi-value coefficient obtained by the quantization processing,
Each coefficient value of the pixel block is separated into an upper bit part higher than a set boundary bit position and a lower bit part below the set boundary bit position, and run-length encoding is performed on the upper bit part A plurality of encoding steps for encoding the lower bit part in bit plane units;
For each coefficient of the pixel block of interest, the number of bits from the bit position that first becomes “1” from the most significant bit to the least significant bit to the least significant bit is detected as the effective bit number, and the detected effective bit number appears. A boundary bit position determining step for determining a plurality of candidates for the boundary bit position for each coefficient of the pixel block of interest based on the number of times;
A setting step for setting the size of the image to be encoded;
When the number of the plurality of encoding steps is N0, the number of pixel blocks to be encoded in parallel is N1, and the number of boundary bit position candidates to be referred to when encoding each pixel block is N2, the setting step An encoding parameter determining step of determining the larger N1 as the size set in (2) is larger and determining the smaller N2 as the size set in the setting step is larger;
By supplying the coefficient values of N1 pixel blocks determined in the encoding parameter determination step to the boundary bit position determination step, N2 boundary bit position candidates are calculated for each pixel block, and each pixel The coefficient value of the block is supplied to each of the N2 encoding processes, and the N2 boundary bit position candidates are set in each of the N2 encoding processes, so that N2 number of pixels for each pixel block are set. An encoding control step for generating encoded data;
An output step of selecting and outputting encoded data having a minimum encoded data amount among N2 encoded data generated from coefficient values of one pixel block for each of the N1 pixel blocks; A method for controlling an image encoding device comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008108294A JP2009260747A (en) | 2008-04-17 | 2008-04-17 | Image encoding device, and control method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008108294A JP2009260747A (en) | 2008-04-17 | 2008-04-17 | Image encoding device, and control method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009260747A true JP2009260747A (en) | 2009-11-05 |
Family
ID=41387583
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008108294A Withdrawn JP2009260747A (en) | 2008-04-17 | 2008-04-17 | Image encoding device, and control method thereof |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009260747A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9979415B2 (en) | 2015-02-16 | 2018-05-22 | Mitsubishi Electric Corporation | Data compression apparatus, data decompression apparatus, data compression method, data compression method, and computer readable medium |
JP2018160827A (en) * | 2017-03-23 | 2018-10-11 | 富士ゼロックス株式会社 | Coding apparatus, decoding apparatus, and program |
-
2008
- 2008-04-17 JP JP2008108294A patent/JP2009260747A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9979415B2 (en) | 2015-02-16 | 2018-05-22 | Mitsubishi Electric Corporation | Data compression apparatus, data decompression apparatus, data compression method, data compression method, and computer readable medium |
JP2018160827A (en) * | 2017-03-23 | 2018-10-11 | 富士ゼロックス株式会社 | Coding apparatus, decoding apparatus, and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4979655B2 (en) | Image coding apparatus and control method thereof | |
US9521433B2 (en) | Video encoding device, video decoding device, video encoding method, video decoding method, video encoding or decoding program | |
US7903888B2 (en) | Image encoding apparatus and image decoding apparatus | |
JP4365957B2 (en) | Image processing method and apparatus and storage medium | |
US20060262982A1 (en) | Image encoding apparatus and method, computer program, and computer-readable storage medium | |
US20090141048A1 (en) | Method, apparatus, and computer program product for processing image | |
US8452112B2 (en) | Image encoding apparatus and method of controlling the same | |
US6912318B2 (en) | Method and system for compressing motion image information | |
JP4956304B2 (en) | Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium | |
JP2008178108A (en) | Method and device for effectively compressing and restoring binary image | |
US8457428B2 (en) | Image coding apparatus, control method thereof, and storage medium | |
US8041135B2 (en) | Image encoding apparatus and control method thereof | |
JP2006180456A (en) | Image compressor, image decoder, image converter and image processing method | |
JP6502739B2 (en) | Image coding apparatus, image processing apparatus, image coding method | |
JP5101962B2 (en) | Image coding apparatus, control method therefor, and computer program | |
JP4833309B2 (en) | Video compression encoding device | |
US8233729B2 (en) | Method and apparatus for generating coded block pattern for highpass coefficients | |
JP2009260747A (en) | Image encoding device, and control method thereof | |
US7197078B2 (en) | Video coding/decoding buffering apparatus and buffering method thereof | |
JP5086777B2 (en) | Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium | |
JP4139657B2 (en) | Video signal encoding apparatus and decoding apparatus | |
JP4743884B2 (en) | Image coding apparatus and control method thereof | |
JP2002051221A (en) | Device, system and method for encoding and decoding image and storage medium | |
JP2009038740A (en) | Image encoding device | |
JP4944833B2 (en) | Image coding apparatus and control method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20110705 |