JP2011109573A - Image compression device, and electronic camera - Google Patents

Image compression device, and electronic camera Download PDF

Info

Publication number
JP2011109573A
JP2011109573A JP2009264770A JP2009264770A JP2011109573A JP 2011109573 A JP2011109573 A JP 2011109573A JP 2009264770 A JP2009264770 A JP 2009264770A JP 2009264770 A JP2009264770 A JP 2009264770A JP 2011109573 A JP2011109573 A JP 2011109573A
Authority
JP
Japan
Prior art keywords
quantization
target
change amount
file size
compression
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.)
Granted
Application number
JP2009264770A
Other languages
Japanese (ja)
Other versions
JP5493761B2 (en
Inventor
Hideyasu Kuniba
英康 国場
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.)
Nikon Corp
Original Assignee
Nikon 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 Nikon Corp filed Critical Nikon Corp
Priority to JP2009264770A priority Critical patent/JP5493761B2/en
Publication of JP2011109573A publication Critical patent/JP2011109573A/en
Application granted granted Critical
Publication of JP5493761B2 publication Critical patent/JP5493761B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To solve a conventional problem where a quantization parameter cannot be accurately obtained. <P>SOLUTION: The image compression device includes: an image data input means to input compression object image data; a first calculation means, having a quantization-like variation in advance where image data generally linearly varies in the relation with a file size, for obtaining a file size corresponding to the compression object image data for two predetermined quantization-like variations; a file size designation means to designate a target file size; a second calculation means to obtain a target quantization-like variation corresponding to the target file size in relation to the compression object image data based on the relation between the file size obtained by the first calculation means and the quantization-like variation; a storage means to store in advance a relation between a quantization-like variation and a quantization step; and an image compression means to obtain a quantization step corresponding to the target file size based on the target quantization-like variation obtained by the second calculation means from the relation between the quantization-like variation and the quantization step stored in the storage means, and compress the compression object image data using the obtained quantization step. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、画像圧縮装置および電子カメラに関する。   The present invention relates to an image compression apparatus and an electronic camera.

一般的な電子カメラでは、撮影画像を圧縮して記録メディアに保存する。画像圧縮処理は、例えば直交変換した係数を所定の量子化パラメータで量子化後、冗長成分を少なくする符号化を行う。ところが、被写体によって空間周波数成分の分布が異なるため、同じ量子化パラメータを用いた場合でも圧縮後の画像ファイル容量が大きく異なってしまう。このため、記録メディアの残容量で撮影可能な画像枚数の予測が難しく、電子カメラとしての使い勝手が良くないという問題が生じる。そこで、被写体の種類に依らず圧縮後の画像ファイル容量を概ね一定にする固定長圧縮技術が検討されている(例えば特許文献1参照)。   In a general electronic camera, a captured image is compressed and stored in a recording medium. In the image compression processing, for example, after orthogonally transformed coefficients are quantized with a predetermined quantization parameter, encoding for reducing redundant components is performed. However, since the distribution of spatial frequency components differs depending on the subject, the compressed image file capacity varies greatly even when the same quantization parameter is used. For this reason, it is difficult to predict the number of images that can be taken with the remaining capacity of the recording medium, and there is a problem that the usability as an electronic camera is not good. In view of this, a fixed-length compression technique that makes the compressed image file capacity substantially constant regardless of the type of subject has been studied (see, for example, Patent Document 1).

米国特許第5594554号明細書US Pat. No. 5,594,554

ところが、従来技術では、圧縮率と量子化パラメータとが必ずしも直線関係にならないため、テスト圧縮結果から目標圧縮率に対する量子化パラメータを精度良く求めることができないという問題があった。   However, since the compression rate and the quantization parameter do not necessarily have a linear relationship, the conventional technology has a problem that the quantization parameter for the target compression rate cannot be obtained with high accuracy from the test compression result.

本発明の目的は、圧縮後の画像ファイル容量を概ね一定にするための量子化パラメータを精度良く求めることができる画像圧縮装置および電子カメラを提供することである。   An object of the present invention is to provide an image compression apparatus and an electronic camera capable of accurately obtaining a quantization parameter for making a compressed image file capacity substantially constant.

本発明に係る画像圧縮装置は、圧縮対象画像データを入力する画像データ入力手段と、ファイルサイズとの関係において画像データがほぼ直線的に変化する量子化的変化量を予め有し、所定の2つの量子化的変化量に対して前記圧縮対象画像データに対応するファイルサイズを求める第1演算手段と、目標ファイルサイズを指定するファイルサイズ指定手段と、前記第1演算手段で求めたファイルサイズと量子化的変化量との関係に基づき、前記圧縮対象画像データに関して前記目標ファイルサイズに対応する目標量子化的変化量を求める第2演算手段と、前記量子化的変化量と量子化ステップとの関係を予め記憶する記憶手段と、前記記憶手段に記憶した量子化的変化量と量子化ステップとの関係から、前記第2演算手段で求めた前記目標量子化的変化量に基づいて前記目標ファイルサイズに対応する量子化ステップを求め、この求めた量子化ステップを用いて前記圧縮対象画像データを圧縮する画像圧縮手段と、を有することを特徴とする。   An image compression apparatus according to the present invention has in advance a quantized change amount in which image data changes almost linearly in relation to a file size and an image data input means for inputting image data to be compressed. First calculation means for obtaining a file size corresponding to the compression target image data for one quantized change amount, file size designation means for designating a target file size, and file size obtained by the first calculation means; A second computing means for obtaining a target quantizing change amount corresponding to the target file size with respect to the compression target image data based on a relationship with the quantizing change amount; and the quantizing change amount and the quantization step; The target calculated by the second calculation means from the relationship between the storage means for storing the relationship in advance and the quantization change amount stored in the storage means and the quantization step An image compression unit that obtains a quantization step corresponding to the target file size based on a child change amount, and compresses the image data to be compressed using the obtained quantization step; .

特に、前記所定の2つの量子化的変化量は、前記目標ファイルサイズに応じて設定されることを特徴とする。   In particular, the predetermined two quantization change amounts are set according to the target file size.

また、前記第1演算手段は、前記目標ファイルサイズに応じて設定された1つの量子化的変化量に対するファイルサイズを求め、この求めたファイルサイズに応じて決定した他の1つの量子化的変化量に対するファイルサイズを求めることを特徴とする。   Further, the first calculation means obtains a file size for one quantized change amount set according to the target file size, and another one quantized change determined according to the obtained file size. The file size with respect to the quantity is obtained.

本発明に係る画像圧縮装置は、圧縮対象画像データを入力する画像データ入力手段と、量子化インデックスと量子化的変化量との対応関係を記憶する記憶手段と、指定された前記量子化インデックスで前記画像データを圧縮する圧縮手段と、目標ファイルサイズを指定するファイルサイズ指定手段と、前記圧縮手段により、前記画像データを、第1の量子化インデックスと第2の量子化インデックスとを用いて、それぞれ圧縮したときの第1のファイルサイズと第2のファイルサイズとを求めるテスト圧縮手段と、前記量子化インデックスと量子化的変化量との対応関係を用いて、前記第1の量子化インデックスに対応する第1の量子化的変化量と、前記第2の量子化インデックスに対応する第2の量子化的変化量とを求める量子化的変化量算出手段と、前記画像データの前記量子化的変化量と前記ファイルサイズとの関係を、前記第1の量子化的変化量と前記第1のファイルサイズ、および前記第2の量子化的変化量と前記第2のファイルサイズから求め、求めた関係によって、前記目標ファイルサイズでの目標量子化的変化量を求める目標量子化的変化量算出手段と、前記量子化インデックスと量子化的変化量との対応関係を用いて、前記目標量子化的変化量から目標量子化インデックスを求める目標量子化インデックス算出手段と、前記目標量子化インデックスで、前記圧縮手段により前記画像データを圧縮した圧縮画像データを出力する画像データ出力手段とを有することを特徴とする。   An image compression apparatus according to the present invention includes an image data input unit that inputs image data to be compressed, a storage unit that stores a correspondence relationship between a quantization index and a quantization change amount, and a specified quantization index. A compression unit that compresses the image data, a file size designation unit that designates a target file size, and the compression unit that uses the first quantization index and the second quantization index, Using the test compression means for obtaining the first file size and the second file size when compressed, respectively, and the correspondence relationship between the quantization index and the quantization change amount, the first quantization index is obtained. Quantization change amount for obtaining a corresponding first quantization change amount and a second quantization change amount corresponding to the second quantization index Output means, and the relationship between the quantization change amount of the image data and the file size, the first quantization change amount, the first file size, and the second quantization change amount. And a target quantization change amount calculating means for obtaining a target quantization change amount at the target file size according to the obtained relationship, and the quantization index and the quantization change amount. A target quantization index calculating means for obtaining a target quantization index from the target quantization change amount, and compressed image data obtained by compressing the image data by the compression means with the target quantization index. Image data output means for outputting.

特に、前記第1の量子化インデックスと前記第2の量子化インデックスとは、前記目標ファイルサイズに応じて設定されることを特徴とする。   In particular, the first quantization index and the second quantization index are set according to the target file size.

また、前記テスト圧縮手段は、前記目標ファイルサイズに応じた第1の量子化インデックスを用いて、前記圧縮手段で1回目の圧縮を行って第1のファイルサイズを求め、前記第1のファイルサイズに応じて決定した第2の量子化インデックスを用いて、前記圧縮手段で2回目の圧縮を行って第2のファイルサイズを求めることを特徴とする。   In addition, the test compression unit obtains a first file size by performing a first compression by the compression unit using a first quantization index corresponding to the target file size, and the first file size Using the second quantization index determined according to the above, the second compression is performed by the compression unit to obtain the second file size.

さらに、前記第1の量子化的変化量と前記第1のファイルサイズ、および前記第2の量子化的変化量と前記第2のファイルサイズの対数値の関係は略直線であることを特徴とする。
また、前記量子化的変化量算出手段は、前記第1の量子化インデックスと前記第2の量子化インデックスとからそれぞれの第1の量子化的変化量の対数値と第2の量子化的変化量の対数値とを求め、前記目標量子化的変化量算出手段は、前記第1の量子化的変化量の対数値および前記第2の量子化的変化量の対数値と前記第1のファイルサイズおよび前記第2のファイルサイズとの関係から前記目標ファイルサイズでの目標量子化的変化量の対数値を求め、前記目標量子化インデックス算出手段は、前記目標量子化的変化量の対数値から目標量子化インデックスを求めることを特徴とする。
Furthermore, the relationship between the first quantized change amount and the first file size and the logarithmic value of the second quantized change amount and the second file size are substantially straight lines. To do.
In addition, the quantization change amount calculation unit may calculate a logarithmic value of each first quantization change amount and a second quantization change from the first quantization index and the second quantization index. A logarithmic value of the quantity, and the target quantized change calculating means calculates the logarithmic value of the first quantizing change quantity and the logarithmic value of the second quantizing change quantity and the first file. A logarithmic value of the target quantization change amount at the target file size is obtained from the relationship between the size and the second file size, and the target quantization index calculation means calculates the logarithmic value of the target quantization change amount. A target quantization index is obtained.

本発明に係る画像圧縮装置は、圧縮対象画像データを入力する画像データ入力手段と、量子化インデックスと量子化的変化量との対応関係を記憶する記憶手段と、指定された前記量子化インデックスで前記画像データを圧縮する圧縮手段と、前記圧縮手段の目標ファイルサイズを設定する目標ファイルサイズ設定手段と、前記圧縮手段により、前記画像データを、第1の量子化インデックスで圧縮したときの第1のファイルサイズを求めるテスト圧縮手段と、前記量子化インデックスと量子化的変化量との対応関係を用いて、前記第1の量子化インデックスに対応する第1の量子化的変化量を求める量子化的変化量算出手段と、前記画像データの前記量子化的変化量と前記ファイルサイズとの関係を、前記第1の量子化的変化量と前記第1のファイルサイズ、および予め設定された初期量子化的変化量と、前記初期量子化的変化量に対応する初期ファイルサイズから求め、求めた関係によって、前記目標ファイルサイズでの目標量子化的変化量を求める目標量子化的変化量算出手段と、前記量子化インデックスと量子化的変化量との対応関係を用いて、前記目標量子化的変化量から目標量子化インデックスを求める目標量子化インデックス算出手段と、前記目標量子化インデックスで、前記圧縮手段により前記画像データを圧縮した圧縮画像データを出力する画像データ出力手段とを有することを特徴とする。   An image compression apparatus according to the present invention includes an image data input unit that inputs image data to be compressed, a storage unit that stores a correspondence relationship between a quantization index and a quantization change amount, and a specified quantization index. A compression unit that compresses the image data; a target file size setting unit that sets a target file size of the compression unit; and a first unit when the image data is compressed with a first quantization index by the compression unit. Quantizing to obtain a first quantized change amount corresponding to the first quantized index using a test compression means for obtaining a file size of the image and a correspondence relationship between the quantized index and the quantized change amount A change amount calculating unit; and a relationship between the quantized change amount of the image data and the file size, the first quantized change amount and the first The target quantized change amount in the target file size is obtained from the file size and the initial quantized change amount set in advance and the initial file size corresponding to the initial quantized change amount, and according to the obtained relationship. Target quantization change amount calculation means to be obtained; target quantization index calculation means for obtaining a target quantization index from the target quantization change amount using a correspondence relationship between the quantization index and the quantization change amount; And image data output means for outputting compressed image data obtained by compressing the image data by the compression means at the target quantization index.

特に、前記第1の量子化インデックスは前記目標ファイルサイズに応じて設定されることを特徴とする。   In particular, the first quantization index is set according to the target file size.

また、前記第1の量子化的変化量と前記第1のファイルサイズ、および前記初期量子化的変化量の対数値と前記初期ファイルサイズの対数値の関係は略直線であることを特徴とする。   The first quantizing change amount and the first file size, and the relationship between the logarithmic value of the initial quantizing change amount and the logarithmic value of the initial file size are substantially straight lines. .

さらに、前記量子化的変化量算出手段は、前記第1の量子化インデックスから第1の量子化的変化量の対数値を求め、前記目標量子化的変化量算出手段は、前記第1の量子化的変化量の対数値および予め設定された初期量子化的変化量の対数値と前記第1のファイルサイズおよび前記初期量子化的変化量の対数値に対応する初期ファイルサイズとの関係から目標ファイルサイズでの目標量子化的変化量の対数値を求め、前記目標量子化インデックス算出手段は、前記目標量子化的変化量の対数値から目標量子化インデックスを求めることを特徴とする。   Further, the quantization change amount calculation means obtains a logarithmic value of the first quantization change amount from the first quantization index, and the target quantization change amount calculation means calculates the first quantum change amount. The target from the relationship between the logarithmic value of the categorical change amount and the logarithm value of the preset initial quantizing change amount and the initial file size corresponding to the first file size and the logarithmic value of the initial quantizing change amount A logarithmic value of a target quantization change amount in a file size is obtained, and the target quantization index calculation means obtains a target quantization index from the logarithmic value of the target quantization change amount.

本発明に係る電子カメラは、前記画像圧縮装置を有することを特徴とする。   An electronic camera according to the present invention includes the image compression device.

本発明では、圧縮後の画像ファイル容量を概ね一定にする量子化パラメータを精度良く求めることができる。   In the present invention, a quantization parameter that makes the compressed image file capacity substantially constant can be obtained with high accuracy.

本実施形態に係る電子カメラ101の構成を示すブロック図である。It is a block diagram which shows the structure of the electronic camera 101 which concerns on this embodiment. 本実施形態における量子化インデックスと量子化ステップと疑似量子化ステップおよびその対数値の対応を示す説明図である。It is explanatory drawing which shows a response | compatibility with the quantization index in this embodiment, a quantization step, a pseudo quantization step, and its logarithmic value. 画像処理部107の構成を示すブロック図である。2 is a block diagram illustrating a configuration of an image processing unit 107. FIG. 量子化インデックスと量子化ステップおよび量子化ステップと圧縮率の関係を示す説明図である。It is explanatory drawing which shows the relationship between a quantization index, a quantization step, a quantization step, and a compression rate. 本実施形態における量子化インデックスと量子化ステップおよび量子化インデックスと疑似量子化ステップの関係を示す説明図である。It is explanatory drawing which shows the relationship between the quantization index in this embodiment, a quantization step, and a quantization index and a pseudo quantization step. 第1の実施形態に係る画像圧縮処理を示すフローチャートである。It is a flowchart which shows the image compression process which concerns on 1st Embodiment. 本実施形態における量子化インデックスと疑似量子化ステップの求め方を示す説明図である。It is explanatory drawing which shows how to obtain | require the quantization index and pseudo | simulation quantization step in this embodiment. テスト圧縮処理の高速化方法を示す説明図である。It is explanatory drawing which shows the speed-up method of a test compression process. 第2の実施形態の変形例の画像圧縮処理を示すフローチャートである。It is a flowchart which shows the image compression process of the modification of 2nd Embodiment. 第3の実施形態に係る画像圧縮処理を原理を示す説明図である。It is explanatory drawing which shows the principle of the image compression process which concerns on 3rd Embodiment. 第3の実施形態に係る画像圧縮処理を示すフローチャートである。It is a flowchart which shows the image compression process which concerns on 3rd Embodiment.

以下、本発明に係る画像圧縮装置および電子カメラに関する実施形態について説明する。尚、本実施形態で説明する電子カメラ101は、本発明に係る画像圧縮装置を搭載する電子カメラの例である。   Embodiments relating to an image compression apparatus and an electronic camera according to the present invention will be described below. The electronic camera 101 described in the present embodiment is an example of an electronic camera equipped with the image compression apparatus according to the present invention.

[電子カメラ101の構成および基本動作]
先ず、電子カメラ101の全体構成および基本動作について説明する。図1は電子カメラ101の構成を示すブロック図で、電子カメラ101は、光学系102と、メカニカルシャッタ103と、撮像素子104と、A/D変換部105と、画像バッファ106と、画像処理部107と、カメラ制御部108と、メモリ109と、表示部110と、メモリカードIF(インターフェース)112と、操作部材111とで構成される。ここで、画像処理部107は、本発明に係る画像圧縮装置を含むブロックである。
[Configuration and Basic Operation of Electronic Camera 101]
First, the overall configuration and basic operation of the electronic camera 101 will be described. FIG. 1 is a block diagram illustrating a configuration of an electronic camera 101. The electronic camera 101 includes an optical system 102, a mechanical shutter 103, an image sensor 104, an A / D conversion unit 105, an image buffer 106, and an image processing unit. 107, a camera control unit 108, a memory 109, a display unit 110, a memory card IF (interface) 112, and an operation member 111. Here, the image processing unit 107 is a block including the image compression apparatus according to the present invention.

図1において、光学系102に入射された被写体光は、メカニカルシャッタ103を介して撮像素子104の受光面に入射される。ここで、光学系102は、ズームレンズやフォーカスレンズなどの複数枚のレンズで構成され、カメラ制御部108から制御されるレンズ駆動部や絞りなどを有している。   In FIG. 1, the subject light incident on the optical system 102 is incident on the light receiving surface of the image sensor 104 via the mechanical shutter 103. Here, the optical system 102 includes a plurality of lenses such as a zoom lens and a focus lens, and includes a lens driving unit and a diaphragm controlled by the camera control unit 108.

撮像素子104は、受光面に光電変換を行うための画素が二次元状に配置され、光電変換したアナログの画像信号を画素単位で出力する。   In the imaging element 104, pixels for performing photoelectric conversion on the light receiving surface are two-dimensionally arranged, and an analog image signal subjected to photoelectric conversion is output in units of pixels.

A/D変換部105は、撮像素子104が出力するアナログの画像信号をデジタル値に変換し、撮影画像1枚分の画像データを画像バッファ106に取り込む。例えば、撮像素子104の解像度が1000画素×1000画素である場合、100万画素分の画像データが画像バッファ106に取り込まれる。この時、画像バッファ106に取り込まれた画像データはRAWデータと呼ばれ、各画素にRGBいずれかの色成分を有している。   The A / D conversion unit 105 converts an analog image signal output from the image sensor 104 into a digital value, and captures image data for one captured image into the image buffer 106. For example, when the resolution of the image sensor 104 is 1000 pixels × 1000 pixels, image data for 1 million pixels is taken into the image buffer 106. At this time, the image data taken into the image buffer 106 is called RAW data, and each pixel has one of RGB color components.

画像バッファ106は、揮発性の高速メモリで構成され、A/D変換部105が出力する撮影画像を一時的に記憶するだけでなく、画像処理部107が画像処理を行う時のバッファとしても使用される。或いは撮影画像やメモリカードIF112に接続されたメモリカード112aに保存されている撮影済の画像を表示部110に表示する際の表示用バッファとしても使用される。   The image buffer 106 is composed of a volatile high-speed memory, and not only temporarily stores the captured image output from the A / D conversion unit 105 but also used as a buffer when the image processing unit 107 performs image processing. Is done. Alternatively, it is also used as a display buffer when displaying a photographed image or a photographed image stored in the memory card 112 a connected to the memory card IF 112 on the display unit 110.

画像処理部107は、画像バッファ106に取り込まれたRAWデータに対して、補間処理,ホワイトバランス処理,階調処理,色変換処理,エッジ強調処理などを行う。さらに、カメラ制御部108から与えられるパラメータ(量子化インデックス)に応じて、例えばJPEGXR規格などに準拠した画像圧縮処理を施す。尚、画像処理部107の構成および量子化インデックスなどについては後で詳しく説明する。   The image processing unit 107 performs interpolation processing, white balance processing, gradation processing, color conversion processing, edge enhancement processing, and the like on the RAW data fetched into the image buffer 106. Furthermore, according to the parameter (quantization index) given from the camera control unit 108, for example, image compression processing conforming to the JPEGXR standard or the like is performed. The configuration of the image processing unit 107 and the quantization index will be described in detail later.

カメラ制御部108は、内部に記憶されたプログラムに従って動作するCPUで構成され、電子カメラ101全体の動作を制御する。例えば、カメラ制御部108は、操作部材111の撮影モード選択ダイヤル(不図示)やレリーズボタン111bの押下などに応じて、電子カメラ101の撮影モードを設定したり、光学系102のレンズ制御や絞り制御あるいはメカニカルシャッタ103を制御して撮像素子104で被写体画像を撮像する。そして、カメラ制御部108は、撮像素子104から所定解像度の画像信号を読み出し、A/D変換部105でデジタル値に変換して1画面分の画像データを画像バッファ106に取り込む。さらに、カメラ制御部108は、画像バッファ106に取り込まれた画像データに対して所定の画像処理を施すよう画像処理部107に指令する。特に本実施形態に係る電子カメラ101では、カメラ制御部108は、圧縮処理を行うためのパラメータ(量子化インデックス)を画像処理部107に与える。この時、カメラ制御部108は、固定長圧縮を行うために目標圧縮率(目標ファイルサイズ)に対応する目標量子化インデックスを求める処理を行い、目標量子化インデックスを画像処理部107に与えて本圧縮処理を行う。そして、画像処理部107が画像圧縮後の画像データ、例えばJPEGXRデータに所定のファイル名やヘッダ情報を付加してメモリカードI/F112を介してメモリカード112aに保存したり、表示部110に撮影画像を表示する。   The camera control unit 108 includes a CPU that operates according to a program stored therein, and controls the operation of the entire electronic camera 101. For example, the camera control unit 108 sets the shooting mode of the electronic camera 101 in response to a shooting mode selection dial (not shown) of the operation member 111 or a release button 111b, and controls the lens of the optical system 102 or the aperture. A subject image is picked up by the image pickup device 104 by controlling the control or the mechanical shutter 103. Then, the camera control unit 108 reads an image signal with a predetermined resolution from the image sensor 104, converts the image signal into a digital value by the A / D conversion unit 105, and captures image data for one screen into the image buffer 106. Furthermore, the camera control unit 108 instructs the image processing unit 107 to perform predetermined image processing on the image data captured in the image buffer 106. In particular, in the electronic camera 101 according to the present embodiment, the camera control unit 108 gives a parameter (quantization index) for performing compression processing to the image processing unit 107. At this time, the camera control unit 108 performs processing for obtaining a target quantization index corresponding to the target compression rate (target file size) in order to perform fixed length compression, and supplies the target quantization index to the image processing unit 107 to perform the main quantization index. Perform compression processing. Then, the image processing unit 107 adds a predetermined file name and header information to the image data after image compression, for example, JPEGXR data, and saves it in the memory card 112a via the memory card I / F 112, or shoots on the display unit 110. Display an image.

メモリ109は、フラッシュメモリなどの不揮発性の半導体メモリで構成され、電子カメラ101の撮影モードや露出情報,フォーカス情報などのパラメータを記憶し、カメラ制御部108は、これらのパラメータをユーザー操作に応じて適宜更新する。特に、本実施形態では、固定長圧縮処理を行うために、図2に示すような量子化インデックスと量子化ステップと疑似量子化ステップ(量子化的変化量)などの対応を示すテーブルが例えば製造時などに予めメモリ109に記憶されている。尚、量子化インデックス,量子化ステップおよび疑似量子化ステップについては後で詳しく説明する。   The memory 109 is configured by a non-volatile semiconductor memory such as a flash memory, and stores parameters such as a shooting mode, exposure information, and focus information of the electronic camera 101, and the camera control unit 108 sets these parameters according to a user operation. Update as appropriate. In particular, in the present embodiment, in order to perform fixed-length compression processing, for example, a table indicating the correspondence between a quantization index, a quantization step, a pseudo-quantization step (quantization change amount) and the like as illustrated in FIG. 2 is manufactured. Pre-stored in the memory 109 at times. The quantization index, the quantization step, and the pseudo quantization step will be described in detail later.

表示部110は、液晶モニタなどで構成され、カメラ制御部108によって画像バッファ106に取り込まれた撮影画像や電子カメラ101の操作に必要なメニュー画面などを表示する。   The display unit 110 is configured by a liquid crystal monitor or the like, and displays a captured image taken into the image buffer 106 by the camera control unit 108, a menu screen necessary for operating the electronic camera 101, and the like.

操作部材111は、レリーズボタン111bの他に、電源ボタン(不図示)、撮影モード選択ダイヤル(不図示)、ホワイトバランス選択ボタン(不図示)、カーソルボタン(不図示)などで構成される。ユーザーは、これらの操作ボタンを用いて電子カメラ101を操作し、これらの操作ボタンによる操作情報はカメラ制御部108に出力される。そして、カメラ制御部108は、操作部材111から入力する操作情報に応じて、電子カメラ101全体の動作を制御する。特に、本実施形態では、操作部材111に目標圧縮率を設定する目標圧縮率設定ダイヤル111aが設けられている。撮影者は、この目標圧縮率設定ダイヤル111aを用いて、FINE(1/4の圧縮率),NORMAL(1/8の圧縮率),BASIC(1/16の圧縮率)の3種類のいずれかを選択する。なお、目標圧縮率を設定することは、圧縮後の画像データのデータ容量(ファイルサイズ)の目標値を設定することに対応している。   In addition to the release button 111b, the operation member 111 includes a power button (not shown), a shooting mode selection dial (not shown), a white balance selection button (not shown), a cursor button (not shown), and the like. The user operates the electronic camera 101 using these operation buttons, and operation information by these operation buttons is output to the camera control unit 108. The camera control unit 108 controls the operation of the entire electronic camera 101 in accordance with operation information input from the operation member 111. In particular, in the present embodiment, the operation member 111 is provided with a target compression rate setting dial 111a for setting a target compression rate. The photographer uses the target compression ratio setting dial 111a to select one of the three types of FINE (1/4 compression ratio), NORMAL (1/8 compression ratio), and BASIC (1/16 compression ratio). Select. Note that setting the target compression rate corresponds to setting the target value of the data capacity (file size) of the compressed image data.

メモリカードIF112は、電子カメラ101にメモリカード112aを接続するためのインターフェースで、カメラ制御部108はメモリカードIF112を介してメモリカード112aに画像データを書き込んだり、メモリカード112aに保存されている画像データを読み出す。   The memory card IF 112 is an interface for connecting the memory card 112a to the electronic camera 101, and the camera control unit 108 writes image data to the memory card 112a via the memory card IF 112 or an image stored in the memory card 112a. Read data.

以上が各実施形態に共通の電子カメラ101の構成および基本動作である。   The above is the configuration and basic operation of the electronic camera 101 common to the embodiments.

[画像処理部107の構成および動作]
次に、画像処理部107の構成および動作について詳しく説明する。図3は画像処理部107と画像圧縮処理に関係するカメラ制御部108の構成を示すブロック図である。図3において、画像処理部107は、ホワイトバランス処理部201と、色補間処理部202と、エッジ強調処理部203と、圧縮処理部204とで構成される。
[Configuration and Operation of Image Processing Unit 107]
Next, the configuration and operation of the image processing unit 107 will be described in detail. FIG. 3 is a block diagram showing the configuration of the image processing unit 107 and the camera control unit 108 related to the image compression processing. In FIG. 3, the image processing unit 107 includes a white balance processing unit 201, a color interpolation processing unit 202, an edge enhancement processing unit 203, and a compression processing unit 204.

ホワイトバランス処理部201は、撮影された被写体の無彩色部分が無彩色の画像として撮影されるように、各画素のRGB各成分のデータにホワイトバランス係数を乗算する処理を行う。   The white balance processing unit 201 performs processing of multiplying the RGB component data of each pixel by a white balance coefficient so that the achromatic portion of the photographed subject is photographed as an achromatic image.

色補間処理部202は、各画素がRGBいずれか1色の値しか持たないRAWデータを補間して、各画素がRGB各色の値を持つRGBデータに変換する処理を行う。   The color interpolation processing unit 202 performs a process of interpolating RAW data in which each pixel has only one of RGB values and converting each pixel into RGB data having each RGB value.

エッジ強調処理部203は、例えばRGBデータを輝度色差データ(Y,Cb,Cr)に変換して、輝度データYに対してエッジ強調処理を行う。   The edge enhancement processing unit 203 converts, for example, RGB data into luminance color difference data (Y, Cb, Cr), and performs edge enhancement processing on the luminance data Y.

圧縮処理部204は、エッジ強調処理部203が出力する輝度色差データ(Y,Cb,Cr)に対して、JPEGやJPEGXR等の規格に従った圧縮方式で画像圧縮処理を行う。特に、本実施形態ではJPEGXRに準拠した圧縮方式で画像圧縮処理を行うものとし、指定された量子化インデックスに応じた量子化ステップで量子化後、エントロピー符号化を行う。つまり、本実施形態では圧縮処理部204は、指定された量子化インデックス(QPIndex)で入力する画像データを圧縮処理し、画像圧縮データ(符号化データ)を出力するブラックボックスと見なすことができる。   The compression processing unit 204 performs image compression processing on the luminance color difference data (Y, Cb, Cr) output from the edge enhancement processing unit 203 by a compression method according to a standard such as JPEG or JPEGXR. In particular, in this embodiment, it is assumed that image compression processing is performed by a compression method compliant with JPEGXR, and entropy coding is performed after quantization in a quantization step according to a specified quantization index. That is, in the present embodiment, the compression processing unit 204 can be regarded as a black box that compresses image data input with a designated quantization index (QPIndex) and outputs compressed image data (encoded data).

ここで、圧縮処理部204の構成について説明する。圧縮処理部204は、直交変換部251と、量子化部252と、エントロピー符号化部253とで構成される。   Here, the configuration of the compression processing unit 204 will be described. The compression processing unit 204 includes an orthogonal transform unit 251, a quantization unit 252, and an entropy coding unit 253.

直交変換部251は、入力される1枚の撮影画像を複数のサブブロックに分割して、サブブロック毎に例えばDCT(離散コサイン変換)やウェーブレット変換などの直交変換処理を行って空間周波数成分に変換し、周波数成分毎の係数を出力する。尚、直交変換処理は、例えば輝度(Y)と、色差(Cb,Cr)のそれぞれについて行う。また、以降の圧縮処理の説明では、サブブロックや輝度・色差の次元で記載していないが、基本的には複数のサブブロックおよび輝度データ・色差データについて同様の処理を行って1枚の撮影画像全体の圧縮を行うものとする。   The orthogonal transform unit 251 divides one input captured image into a plurality of sub-blocks, and performs orthogonal transform processing such as DCT (Discrete Cosine Transform) or wavelet transform for each sub-block to generate spatial frequency components. Convert and output coefficients for each frequency component. The orthogonal transformation process is performed for each of luminance (Y) and color difference (Cb, Cr), for example. In the following description of the compression processing, although it is not described in terms of sub-blocks and luminance / color difference dimensions, basically, a plurality of sub-blocks and luminance data / color difference data are subjected to the same processing to obtain one image. It is assumed that the entire image is compressed.

量子化部252は、カメラ制御部108から指定された量子化インデックスに応じた量子化ステップで直交変換部251が出力する係数を量子化する。尚、通常の電子カメラでは、図2に示した量子化インデックス(QPIndex)と量子化ステップ(QP)の対応に基づいて、カメラ制御部108から指定された量子化インデックスに対応する量子化ステップを求め、直交変換部251が出力する係数を量子化する。ここで、量子化処理において、指定される量子化インデックスに応じて圧縮率は変化し、例えば量子化インデックスを大きくすると量子化ステップも大きくなるので圧縮率は高くなり、逆に量子化インデックスを小さくすると量子化ステップも小さくなるので圧縮率は低くなる。   The quantization unit 252 quantizes the coefficient output from the orthogonal transform unit 251 in a quantization step corresponding to the quantization index specified by the camera control unit 108. Note that in a normal electronic camera, the quantization step corresponding to the quantization index designated by the camera control unit 108 based on the correspondence between the quantization index (QPIndex) and the quantization step (QP) shown in FIG. The coefficient output from the orthogonal transform unit 251 is quantized. Here, in the quantization process, the compression rate changes according to the specified quantization index.For example, if the quantization index is increased, the quantization step also increases, so the compression rate increases, and conversely the quantization index decreases. As a result, the quantization step becomes smaller, and the compression rate becomes lower.

エントロピー符号化部253は、量子化部252が出力する量子化データの差分処理や符号の配列処理などを行った後、発生頻度の高いデータ列に短い符号を割り当てるエントロピー符号化を行う。尚、符号化処理も圧縮率に影響する処理である。   The entropy encoding unit 253 performs entropy encoding that assigns a short code to a frequently occurring data sequence after performing difference processing of the quantized data output from the quantization unit 252 and code arrangement processing. The encoding process is also a process that affects the compression rate.

このように、圧縮処理部204は、直交変換部251と、量子化部252と、エントロピー符号化部253とで構成され、カメラ制御部108から指定された量子化インデックス(QPIndex)に応じて画像圧縮処理を実行する。   As described above, the compression processing unit 204 includes the orthogonal transform unit 251, the quantization unit 252, and the entropy coding unit 253, and displays an image according to the quantization index (QPIndex) designated by the camera control unit 108. Perform compression processing.

画像圧縮処理後の画像データ(例えばJPEG画像データ)は、カメラ制御部108を介してメモリカードIF112に接続されているメモリカード112aに撮影画像として保存される。   The image data after the image compression process (for example, JPEG image data) is stored as a captured image in the memory card 112a connected to the memory card IF 112 via the camera control unit 108.

ここで、ホワイトバランス処理部201,色補間処理部202,エッジ強調処理部203および圧縮処理部204までの処理は、一般的な電子カメラで行われている周知の画像処理である。本実施形態に係る電子カメラ101の特徴は、固定長圧縮処理を行うための固定長圧縮処理部205がカメラ制御部108に設けられていることである。   Here, the processing up to the white balance processing unit 201, the color interpolation processing unit 202, the edge enhancement processing unit 203, and the compression processing unit 204 is well-known image processing performed by a general electronic camera. A feature of the electronic camera 101 according to the present embodiment is that the camera control unit 108 is provided with a fixed length compression processing unit 205 for performing fixed length compression processing.

[固定長圧縮処理部205の構成および動作]
次に、固定長圧縮処理部205の構成および動作について説明するが、先ず、量子化インデックスと量子化ステップについて説明する。例えば量子化インデックス(QPIndex)と量子化ステップ(QP)の関係は、図4(a)の両対数グラフに示すように、量子化インデックスの増加に応じて量子化ステップも増加し、量子化インデックスのある部分から急激に量子化ステップが増大する。
[Configuration and Operation of Fixed Length Compression Processing Unit 205]
Next, the configuration and operation of the fixed-length compression processing unit 205 will be described. First, the quantization index and the quantization step will be described. For example, the relationship between the quantization index (QPIndex) and the quantization step (QP) is as shown in the logarithmic graph of FIG. 4A, and the quantization step increases as the quantization index increases. The quantization step suddenly increases from a certain portion.

ここで、量子化インデックスとは、JPEGXR規格に従った画像圧縮処理を行う際のパラメータで、例えば図4(a)のような関係が予め規格で決められており、圧縮処理部204の量子化部252は、この規格に従ってカメラ制御部108から指定された量子化インデックスに対応する量子化ステップで直交変換された係数値の量子化を行う。   Here, the quantization index is a parameter for performing image compression processing in accordance with the JPEGXR standard. For example, the relationship shown in FIG. 4A is determined in advance by the standard, and the quantization of the compression processing unit 204 is performed. The unit 252 quantizes the coefficient value orthogonally transformed in the quantization step corresponding to the quantization index designated by the camera control unit 108 in accordance with this standard.

また、量子化ステップとは、係数値を量子化する際の幅(量子化幅)を意味し、量子化ステップが大きいほど係数値が粗く分解されるので圧縮率は高くなるが画質は悪くなる。逆に、量子化ステップが小さいほど係数値が細かく分解されるので圧縮率は低くなるが画質は良くなる。尚、圧縮率と量子化ステップの関係は画像の種類によって異なる。この関係を図4(b)に示す。図4(b)は様々な種類の画像を同じ量子化ステップ(QP)で圧縮処理した時の圧縮率(CR)の関係を示す両対数グラフで、画像の種類によって同じ量子化ステップでも圧縮率は異なり、ある幅を持った分布になっている。但し、全体の傾向は、図4(b)に示すように、量子化ステップが大きくなるほど圧縮率は低くなっていく。特に、量子化ステップが小さい領域(例えば1から20程度)では、量子化ステップと圧縮率との関係が両対数グラフ上で直線に近くなるが、量子化ステップが大きい領域(例えば50以上)では、量子化ステップと圧縮率との関係が両対数グラフ上で直線にはならず、傾きが大きくなって圧縮率が急激に低下する。   The quantization step means the width (quantization width) when the coefficient value is quantized, and the larger the quantization step, the coarser the coefficient value is decomposed, so the compression ratio increases but the image quality deteriorates. . Conversely, the smaller the quantization step, the finer the coefficient values are decomposed, so the compression ratio is lower but the image quality is improved. Note that the relationship between the compression rate and the quantization step differs depending on the type of image. This relationship is shown in FIG. FIG. 4B is a log-log graph showing the relationship of the compression rate (CR) when various types of images are compressed in the same quantization step (QP). The compression rate is the same even if the quantization step is the same depending on the type of image. Is different and has a distribution with a certain width. However, as shown in FIG. 4B, the overall tendency is that the compression rate decreases as the quantization step increases. In particular, in a region where the quantization step is small (for example, about 1 to 20), the relationship between the quantization step and the compression ratio is close to a straight line on the log-log graph, but in a region where the quantization step is large (for example, 50 or more). The relationship between the quantization step and the compression rate does not become a straight line on the log-log graph, and the inclination increases and the compression rate rapidly decreases.

このため、例えば、任意の2つの量子化インデックス(2つの量子化ステップにそれぞれ対応)を指定してテスト圧縮を行った結果から、直線補間方法を用いて目標圧縮率に対応する量子化ステップ(および対応する量子化インデックス)を推定することが難しくなる。そこで、本実施形態に係る電子カメラ101では、固定長圧縮処理部205において、圧縮率と量子化ステップとが両対数グラフで比例関係になるような特殊な量子化ステップ(疑似量子化ステップ)を用いることにより、目標圧縮率に対応する量子化ステップ(および対応する量子化インデックス)を精度良く推定できる。   For this reason, for example, from the result of performing test compression by designating any two quantization indexes (corresponding to two quantization steps, respectively), the quantization step (corresponding to the target compression ratio using the linear interpolation method) ( And the corresponding quantization index) are difficult to estimate. Therefore, in the electronic camera 101 according to the present embodiment, the fixed length compression processing unit 205 performs a special quantization step (pseudo quantization step) in which the compression rate and the quantization step are proportional to each other in a log-log graph. By using, the quantization step (and corresponding quantization index) corresponding to the target compression rate can be estimated with high accuracy.

次に、固定長圧縮処理部205の構成および動作について説明する。固定長圧縮処理部205は、目標圧縮率設定部261と、圧縮率調査部(容量調査部)262と、疑似量子化幅算出部263と、目標疑似量子化幅算出部264と、目標量子化インデックス算出部265とで構成される。以下、各部について順番に説明する。
[目標圧縮率設定部261]
目標圧縮率設定部261は、ユーザーが操作部材111の目標圧縮率設定ダイヤル111aを用いて選択した圧縮率を固定長圧縮処理の目標圧縮率として設定する。尚、目標圧縮率を数値指定できるようにしても構わないが、本実施形態に係る電子カメラ101では、例えばFINE,NORMAL,BASICの3種類から目標圧縮率設定ダイヤル111aで選択する。また、目標圧縮率設定ダイヤル111aでFINEが選択された場合は圧縮率を1/4、NORMALが選択された場合は圧縮率を1/8、BASICが選択された場合は圧縮率を1/16のように予め対応させておくものとする。
[圧縮率調査部262]
圧縮率調査部262は、例えば容量調査部と称しても構わず、テスト圧縮用の量子化インデックスを暫定的に選択し、これを圧縮処理部204の量子化部252に与えてテスト圧縮を行い、テスト圧縮後の画像データの容量を調べて当該量子化インデックスにおける圧縮率を求める。ここで、圧縮率は、図3の圧縮処理部204の直交変換部251が入力する圧縮処理前の画像データの容量と、エントロピー符号化部253が出力する圧縮処理後の符号化データ(画像圧縮データ)の容量との比として求められる。例えば、圧縮前のデータ容量(ファイルサイズ)をA(MB(メガバイト))、圧縮後のデータ容量(ファイルサイズ)をB(MB)とすると、圧縮率(CR)はCR=B/Aのように求めることができる。
Next, the configuration and operation of the fixed length compression processing unit 205 will be described. The fixed-length compression processing unit 205 includes a target compression rate setting unit 261, a compression rate checking unit (capacity checking unit) 262, a pseudo quantization width calculation unit 263, a target pseudo quantization width calculation unit 264, and a target quantization. It is comprised with the index calculation part 265. Hereinafter, each part will be described in order.
[Target compression rate setting unit 261]
The target compression rate setting unit 261 sets the compression rate selected by the user using the target compression rate setting dial 111a of the operation member 111 as the target compression rate of the fixed length compression process. Although the target compression rate may be designated numerically, in the electronic camera 101 according to the present embodiment, for example, the target compression rate setting dial 111a is selected from three types of FINE, NORMAL, and BASIC. When the target compression ratio setting dial 111a is selected as FINE, the compression ratio is 1/4, when NORMAL is selected, the compression ratio is 1/8, and when BASIC is selected, the compression ratio is 1/16. As shown in FIG.
[Compression rate survey unit 262]
The compression rate checking unit 262 may be referred to as, for example, a capacity checking unit, and temporarily selects a quantization index for test compression, and gives this to the quantization unit 252 of the compression processing unit 204 to perform test compression. Then, the capacity of the image data after the test compression is checked to obtain the compression rate in the quantization index. Here, the compression rate includes the capacity of image data before compression processing input by the orthogonal transform unit 251 of the compression processing unit 204 in FIG. 3 and encoded data after compression processing (image compression) output by the entropy encoding unit 253. Data) capacity. For example, if the data capacity (file size) before compression is A (MB (megabytes)) and the data capacity (file size) after compression is B (MB), the compression rate (CR) is CR = B / A. Can be requested.

次に、テスト圧縮用の量子化インデックスの決め方について説明する。先ず目標圧縮率設定部261で設定された目標圧縮率(CR_T)に対応するテスト圧縮用の量子化ステップ(QP)を求める。これは例えば図4(b)の量子化ステップ(QP)と圧縮率(CR)の関係を示すグラフから読み取ることができる。尚、実際の処理では、例えば量子化ステップ(QP)と圧縮率(CR)の関係をテーブル化してメモリ109に記憶しておけばよい。但し、先に説明したように、同じ圧縮率(CR)でも画像の種類によって量子化ステップ(QP)はある幅を持って分布するので、分布範囲内から統計的に確率が高い値を選択する。例えば、図4(b)において圧縮率がFINE(圧縮率1/4)の場合、圧縮率1/4(0.25)に対応する量子化ステップ(QP)の分布範囲は6から60ぐらいなので、この範囲内から量子化ステップ(QP)を選択する。例えば1つの量子化ステップを選択する場合は分布の中央付近の30付近を選択し、2つの量子化ステップを選択する場合は分布の中央付近を跨ぐ2点の20付近と40付近を選択する。同様に図4(b)において、NORMAL(圧縮率1/8)に対応する量子化ステップの範囲は20から100ぐらいで、BASIC(圧縮率1/16)に対応する量子化ステップの範囲は50から200ぐらいなので、各分布範囲内から統計的に確率が高い量子化ステップ(QP)を選択する。尚、実際の処理では、先に説明したように、目標圧縮率設定ダイヤル111aで選択可能な目標圧縮率毎に量子化ステップ(QP)の分布範囲を示すテーブルや統計的に高い確率の値を製造時などに求めてメモリ109に記憶しておき、このテーブルを参照するようにしてもよい。   Next, how to determine the quantization index for test compression will be described. First, a quantization step (QP) for test compression corresponding to the target compression rate (CR_T) set by the target compression rate setting unit 261 is obtained. This can be read from the graph showing the relationship between the quantization step (QP) and the compression ratio (CR) in FIG. In actual processing, for example, the relationship between the quantization step (QP) and the compression rate (CR) may be tabulated and stored in the memory 109. However, as described above, the quantization step (QP) is distributed with a certain width depending on the image type even with the same compression rate (CR), and therefore, a value having a statistically high probability is selected from the distribution range. . For example, in FIG. 4B, when the compression ratio is FINE (compression ratio ¼), the quantization step (QP) distribution range corresponding to the compression ratio ¼ (0.25) is about 6 to 60. The quantization step (QP) is selected from within this range. For example, when one quantization step is selected, the vicinity of 30 near the center of the distribution is selected, and when two quantization steps are selected, two points near 20 and 40 near the center of the distribution are selected. Similarly, in FIG. 4B, the range of quantization steps corresponding to NORMAL (compression ratio 1/8) is about 20 to 100, and the range of quantization steps corresponding to BASIC (compression ratio 1/16) is 50. Therefore, a quantization step (QP) having a statistically high probability is selected from within each distribution range. In the actual processing, as described above, a table indicating the distribution range of the quantization step (QP) for each target compression rate selectable by the target compression rate setting dial 111a or a statistically high probability value is used. It may be obtained at the time of manufacture or the like and stored in the memory 109, and this table may be referred to.

次に、選択されたテスト圧縮用の量子化ステップ(QP)に対応するテスト圧縮用の量子化インデックス(QPIndex)を求める。これは例えばメモリ109に予め記憶されている図5(b)に示した量子化ステップ(QP)と量子化インデックス(QPIndex)の関係から求めることができる。尚、量子化ステップ(QP)と量子化インデックス(QPIndex)は一対一に対応する。例えば圧縮率がFINE(圧縮率1/4)において、先の処理で22と42の2つの量子化ステップが選択された場合は、図5(a)において量子化ステップ(QP)が22の時の量子化インデックス(QPIndex)は16と32との間にあり、Delta=1なので22となる。同様に、量子化ステップ(QP)が42の時の量子化インデックス(QPIndex)は32と48の間にあり、Delta=2なので37となる。尚、量子化インデックス(QPIndex)が整数にならない時は、例えば小数点以下を四捨五入する。   Next, a test compression quantization index (QPIndex) corresponding to the selected test compression quantization step (QP) is obtained. This can be obtained from the relationship between the quantization step (QP) and the quantization index (QPIndex) shown in FIG. The quantization step (QP) and the quantization index (QPIndex) correspond one-to-one. For example, if the compression rate is FINE (compression rate ¼) and two quantization steps 22 and 42 are selected in the previous process, the quantization step (QP) is 22 in FIG. The quantization index (QPIndex) is between 16 and 32, and is 22 because Delta = 1. Similarly, when the quantization step (QP) is 42, the quantization index (QPIndex) is between 32 and 48, and since Delta = 2, it is 37. When the quantization index (QPIndex) does not become an integer, for example, the decimal part is rounded off.

このようにして、圧縮率調査部262は、指定された目標圧縮率(CR_T)に対応するテスト圧縮用の量子化インデックス(QPIndex)を決めることができ、このテスト圧縮用の量子化インデックスを用いてテスト圧縮を行って当該量子化インデックスにおける圧縮率を求める。
[疑似量子化幅算出部263]
疑似量子化幅算出部263は、テスト圧縮用の量子化インデックス(QPIndex)に対応する疑似量子化ステップ(QP2)を求める。ここでは、図4(b)に示した量子化ステップ(QP)と圧縮率(CR)の関係が両対数グラフ上で直線に近づくように量子化ステップ(QP)の代わりとなる疑似量子化ステップ(QP2)を算出する。疑似量子化ステップ(QP2)は、例えば図4(c)に示すように、圧縮率(CR)との関係が両対数グラフ上で直線に近くなるようにした量子化幅である。図4(c)の疑似量子化ステップ(QP2)は、図4(b)の量子化ステップ(QP)よりも量子化幅が約30以上の領域で指数関数的に大きくなるように求めてある。尚、図4(c)についても図4(b)と同様に、疑似量子化ステップ(QP2)と圧縮率(CR)の関係を実測した結果の一例を示す両対数グラフで、画像の種類によって同じ疑似量子化ステップでも圧縮率は異なり、ある幅を持った分布になっている。
In this way, the compression rate examining unit 262 can determine the test compression quantization index (QPIndex) corresponding to the designated target compression rate (CR_T), and uses this test compression quantization index. Then, test compression is performed to obtain a compression rate in the quantization index.
[Pseudo Quantization Width Calculation Unit 263]
The pseudo quantization width calculation unit 263 obtains a pseudo quantization step (QP2) corresponding to the test compression quantization index (QPIndex). Here, a pseudo-quantization step that replaces the quantization step (QP) so that the relationship between the quantization step (QP) and the compression ratio (CR) shown in FIG. 4B approaches a straight line on the log-log graph. (QP2) is calculated. The pseudo quantization step (QP2) is a quantization width in which the relationship with the compression rate (CR) is close to a straight line on the log-log graph, for example, as shown in FIG. The pseudo-quantization step (QP2) in FIG. 4 (c) is obtained so as to be exponentially larger in the region where the quantization width is about 30 or more than the quantization step (QP) in FIG. 4 (b). . 4C is a log-log graph showing an example of the result of actual measurement of the relationship between the pseudo-quantization step (QP2) and the compression rate (CR), similar to FIG. 4B. Even in the same pseudo-quantization step, the compression rate is different and the distribution has a certain width.

ここで、量子化ステップ(QP)と疑似量子化ステップ(QP2)との関係について説明する。圧縮処理部204の量子化部252は、図5(a)に示すような量子化インデックス(QPIndex)と量子化ステップ(QP)の関係を用いてカメラ制御部108から指定された量子化インデックス(QPIndex)に対応する量子化ステップ(QP)で量子化を行う。ここで、図5(a)は図4(a)に対応する。図5(a)において、量子化インデックス(QPIndex)は16ずつ増加する複数の区間に分けられ、それぞれの区間で対応する量子化ステップ(QP)との関係が示され、各区間毎に直線で近似した折れ線グラフになっている。   Here, the relationship between the quantization step (QP) and the pseudo quantization step (QP2) will be described. The quantization unit 252 of the compression processing unit 204 uses the relationship between the quantization index (QPIndex) and the quantization step (QP) as shown in FIG. Quantization is performed in a quantization step (QP) corresponding to QPIndex). Here, FIG. 5A corresponds to FIG. In FIG. 5A, the quantization index (QPIndex) is divided into a plurality of sections increasing by 16, and the relationship with the corresponding quantization step (QP) is shown in each section. It is an approximate line graph.

具体的には図5(a)において、量子化インデックス(QPIndex)に対する量子化ステップ(QP)の変化は、QPIndex≦16の区間ではQP=QPIndexとなり、16<QPIndex≦32ではQPIndexが1増える毎にQPも増分(Delta)=1で変化する。つまり、QPIndex≦32の区間において、QPとQPIndexは直線関係になっている。また、32<QPIndex≦48の区間では増分(Delta)=2で変化し、QPIndexが1増える毎にQPは2増えるので、QPIndexが48の時のQPは64となる。同様に、48<QPIndex≦64の区間では増分(Delta)=4で変化し、QPIndexが1増える毎にQPは4増えるので、QPIndexが64の時のQPは128となる。このように、増分(Delta)は傾きに相当し、以降、QPIndexが16増える毎にQPの増分は2のべき乗で増加する。   Specifically, in FIG. 5A, the change of the quantization step (QP) with respect to the quantization index (QPIndex) becomes QP = QPIndex in the interval of QPIndex ≦ 16, and every time QPIndex increases by 1 when 16 <QPIndex ≦ 32. QP also changes with increment (Delta) = 1. In other words, QP and QPIndex have a linear relationship in a section where QPIndex ≦ 32. Further, in the section of 32 <QPIndex ≦ 48, the value changes with increment (Delta) = 2, and whenever QPIndex increases by 1, QP increases by 2, so that QP when QPIndex is 48 becomes 64. Similarly, in the interval of 48 <QPIndex ≦ 64, the value changes with an increment (Delta) = 4. Since QP increases by 4 every time QPIndex increases by 1, QP becomes 128 when QPIndex is 64. Thus, the increment (Delta) corresponds to the slope, and thereafter, every time QPIndex increases by 16, the increment of QP increases by a power of 2.

ここで、図5(a)において、変数i(iは整数)でQPIndexの区間を示した場合、例えば変数iとQPIndexの区間および増分(Delta)の関係は以下のようになる。
i=0:QPIndexが1以上16以下の区間で実質的にDelta=1
i=1:QPIndexが16より大きく32以下の区間でDelta=1
i=2:QPIndexが32より大きく48以下の区間でDelta=2
i=3:QPIndexが48より大きく64以下の区間でDelta=4
i=4:QPIndexが64より大きく80以下の区間でDelta=8
以下、同様に定義される。尚、増分(Delta)を変数iで表わすと、Delta=2(i−1)で表すことができる(i≧1の場合)。
Here, in FIG. 5A, when a variable i (i is an integer) indicates a QPIndex interval, for example, the relationship between the variable i and the QPIndex interval and the increment (Delta) is as follows.
i = 0: Delta = 1 substantially in a section where QPIndex is 1 or more and 16 or less
i = 1: Delta = 1 in the interval where QPIndex is greater than 16 and less than or equal to 32
i = 2: Delta = 2 in the interval where QPIndex is greater than 32 and less than or equal to 48
i = 3: In a section where QPIndex is greater than 48 and less than or equal to 64, Delta = 4
i = 4: Delta = 8 in a section where QPIndex is greater than 64 and less than or equal to 80
Hereinafter, it is similarly defined. If increment (Delta) is represented by variable i, it can be represented by Delta = 2 (i−1) (when i ≧ 1).

このように、圧縮処理部204の量子化部252は、図5(a)の量子化インデックス(QPIndex)と量子化ステップ(QP)の関係を用いて、カメラ制御部108から指定された量子化インデックスに対応する量子化ステップを求めて量子化処理を行う。尚、図5(a)の特性は図2の表のQPに対応し、メモリ109にパラメータとして予め記憶されている。   As described above, the quantization unit 252 of the compression processing unit 204 uses the relationship between the quantization index (QPIndex) and the quantization step (QP) in FIG. A quantization step corresponding to the index is obtained and quantization processing is performed. 5A corresponds to the QP in the table of FIG. 2 and is stored in advance in the memory 109 as a parameter.

一方、本実施形態の特徴である固定長圧縮処理部205が目標圧縮率(CR_T)に対する目標量子化インデックス(QPIndex_T)を求めるために用いる疑似量子化ステップ(QP2)は、図5(b)に示すように、図5(a)の量子化インデックス(QPIndex)と量子化ステップ(QP)の関係よりも量子化幅が大きくなっている。図5(b)において、量子化インデックス(QPIndex)は図5(a)と同様に16ずつ増加する複数の区間に分けられ、それぞれの区間で対応する疑似量子化ステップ(QP2)との関係が示され、各区間毎に直線で近似した折れ線グラフになっている。但し、図5(b)において量子化幅の増分は図5(a)より大きくなっているので、圧縮率(CR)と疑似量子化ステップ(QP2)との関係は図4(c)のようにほぼ直線になる。   On the other hand, the pseudo quantization step (QP2) used by the fixed length compression processing unit 205, which is a feature of the present embodiment, to obtain the target quantization index (QPIndex_T) for the target compression ratio (CR_T) is shown in FIG. As shown, the quantization width is larger than the relationship between the quantization index (QPIndex) and the quantization step (QP) in FIG. In FIG. 5B, the quantization index (QPIndex) is divided into a plurality of sections that increase by 16 as in FIG. 5A, and the relationship with the corresponding pseudo quantization step (QP2) in each section is as follows. This is a line graph approximated by a straight line for each section. However, in FIG. 5B, since the increment of the quantization width is larger than that in FIG. 5A, the relationship between the compression ratio (CR) and the pseudo quantization step (QP2) is as shown in FIG. 4C. Almost straight.

具体的には図5(b)において、量子化インデックス(QPIndex)に対する疑似量子化ステップ(QP2)の変化は、QPIndex≦16の区間ではQP2=QPIndexとなり、16<QPIndex≦32ではQPIndexが1増える毎にQP2も増分(Delta)=1で変化する。つまり、QPIndex≦32の区間においては、図5(a)と同様にQP2とQPIndexは直線関係になっている。そして図5(a)と異なるのはQPIndexが32より大きい区間で、例えば32<QPIndex≦48の区間では増分(Delta)=5で変化し、QPIndexが1増える毎にQP2は5増えるので、QPIndexが48の時のQP2は112となる。同様に、48<QPIndex≦64の区間では増分(Delta)=25で変化し、QPIndexが1増える毎にQP2は25増えるので、QPIndexが64の時のQP2は512となる。このように、図5(a)と同様に増分(Delta)は傾きに相当し、以降、QPIndexが16増える毎にQP2の増分は5のべき乗で増加する。   Specifically, in FIG. 5B, the change of the pseudo quantization step (QP2) with respect to the quantization index (QPIndex) is QP2 = QPIndex in the interval of QPIndex ≦ 16, and QPIndex is increased by 1 when 16 <QPIndex ≦ 32. Every time QP2 also changes with increment (Delta) = 1. That is, in the section of QPIndex ≦ 32, QP2 and QPIndex have a linear relationship as in FIG. 5A differs from FIG. 5A in a section where QPIndex is larger than 32. For example, in a section where 32 <QPIndex ≦ 48, it changes with increment (Delta) = 5, and as QPIndex increases by 1, QP2 increases by 5. QP2 when is 48 is 112. Similarly, in the section of 48 <QPIndex ≦ 64, the value changes with increment (Delta) = 25, and every time QPIndex increases by 1, QP2 increases by 25, so QP2 when 512 is QP2 becomes 512. Thus, as in FIG. 5A, the increment (Delta) corresponds to the slope, and thereafter, every time QPIndex increases by 16, the increment of QP2 increases by a power of 5.

ここで、図5(b)において、変数i(iは整数)でQPIndexの区間を示した場合、例えば変数iとQPIndexの区間および増分(Delta)の関係は以下のようになる。
i=0:QPIndexが1以上16以下の区間で実質的にDelta=1
i=1:QPIndexが16より大きく32以下の区間でDelta=1
i=2:QPIndexが32より大きく48以下の区間でDelta=5
i=3:QPIndexが48より大きく64以下の区間でDelta=25
i=4:QPIndexが64より大きく80以下の区間でDelta=125
以下、同様に定義される。尚、図5(a)と同様に増分(Delta)を変数iで表わすと、Delta=5(i−1)で表すことができる(i≧1の場合)。
Here, in FIG. 5B, when a variable i (i is an integer) indicates a QPIndex interval, for example, the relationship between the variable i and the QPIndex interval and the increment (Delta) is as follows.
i = 0: Delta = 1 substantially in a section where QPIndex is 1 or more and 16 or less
i = 1: Delta = 1 in the interval where QPIndex is greater than 16 and less than or equal to 32
i = 2: Delta = 5 in the interval where QPIndex is greater than 32 and less than or equal to 48
i = 3: In a section where QPIndex is greater than 48 and less than or equal to 64, Delta = 25
i = 4: Delta = 125 in a section where QPIndex is greater than 64 and less than or equal to 80
Hereinafter, it is similarly defined. Similarly to FIG. 5A, when increment (Delta) is represented by a variable i, it can be represented by Delta = 5 (i−1) (when i ≧ 1).

本実施形態では、圧縮率(CR)と疑似量子化ステップ(QP2)との関係が図4(c)のように直線に近くなるような量子化インデックス(QPIndex)と疑似量子化ステップ(QP2)の関係を定義する点に特徴があり、これにより目標圧縮率(CR_T)に対する目標量子化インデックス(QPIndex_T)を精度良く求めることができる。尚、図5(b)の特性は図2の表のQP2に対応し、メモリ109にパラメータとして予め記憶されているものとする。また、上記の説明では、増分(Delta)を5のべき乗としたが、様々な種類の被写体を撮影した画像で試験的に圧縮処理を行って経験的に求めた値であり、増分(Delta)が5のべき乗である必要はなく、圧縮率(CR)と疑似量子化ステップ(QP2)との関係が図4(c)のように直線に近くなるような量子化インデックス(QPIndex)と疑似量子化ステップ(QP2)の関係が得られる値であればよい。また、カメラの機種や撮影する画像の解像度などによっても圧縮率(CR)と疑似量子化ステップ(QP2)との関係が直線に近くなるような増分(Delta)は異なる場合があるので、カメラ或いは解像度毎に適切な増分(Delta)を予めメモリ109に記憶しておいて、撮影モードに応じて自動的に(或いはマニュアルで)選択できるようにしても構わない。   In the present embodiment, the quantization index (QPIndex) and the pseudo quantization step (QP2) such that the relationship between the compression ratio (CR) and the pseudo quantization step (QP2) is close to a straight line as shown in FIG. 4C. The target quantization index (QPIndex_T) with respect to the target compression rate (CR_T) can be obtained with high accuracy. 5B corresponds to QP2 in the table of FIG. 2, and is stored in advance in the memory 109 as a parameter. In the above description, the increment (Delta) is a power of 5. However, it is a value obtained experimentally by performing compression processing on images obtained by photographing various types of subjects, and the increment (Delta). Does not need to be a power of 5, and the quantization index (QPIndex) and the pseudo quantum such that the relationship between the compression ratio (CR) and the pseudo quantization step (QP2) is close to a straight line as shown in FIG. Any value can be used as long as the relationship of the quantization step (QP2) is obtained. Also, the increment (Delta) in which the relationship between the compression rate (CR) and the pseudo quantization step (QP2) is close to a straight line may differ depending on the model of the camera and the resolution of the image to be captured. An appropriate increment (Delta) for each resolution may be stored in the memory 109 in advance so that it can be automatically (or manually) selected according to the shooting mode.

このようにして、疑似量子化幅算出部263は、テスト圧縮用の量子化インデックス(QPIndex)に対応する疑似量子化ステップ(QP2)を求める処理を行う。
[目標疑似量子化幅算出部264]
目標疑似量子化幅算出部264は、テスト圧縮用の量子化インデックス(QPIndex)に対応する疑似量子化ステップ(QP2)と、テスト圧縮用の量子化インデックス(QPIndex)でテスト圧縮して求めた圧縮率(CR)とを用いて目標圧縮率(CR_T)にするための目標疑似量子化ステップ(QP2_T)を算出する。ここで、圧縮率(CR)と疑似量子化ステップ(QP2)との関係は、図4(c)で説明したように両対数グラフでほぼ直線と見なすことができるので、直線補間方法を適用して目標圧縮率(CR_T)に対する目標疑似量子化ステップ(QP2_T)を精度良く求めることができる。具体的な処理の流れについては後で詳しく説明する。
[目標量子化インデックス算出部265]
目標量子化インデックス算出部265は、目標疑似量子化幅算出部264が求めた目標疑似量子化ステップ(QP2_T)から目標圧縮率(CR_T)に対応する目標量子化インデックス(QPIndex_T)を算出する。ここで、目標量子化インデックス(QPIndex_T)は、量子化インデックス(QPIndex)と疑似量子化ステップ(QP2)との関係を示す図5(b)のグラフまたは同等のテーブルを用いて求める。尚、具体的な処理の流れについては後で詳しく説明する。
In this way, the pseudo quantization width calculation unit 263 performs a process of obtaining a pseudo quantization step (QP2) corresponding to the test compression quantization index (QPIndex).
[Target pseudo-quantization width calculation unit 264]
The target pseudo quantization width calculation unit 264 includes a pseudo quantization step (QP2) corresponding to a test compression quantization index (QPIndex) and a compression obtained by test compression using the test compression quantization index (QPIndex). The target pseudo-quantization step (QP2_T) for obtaining the target compression rate (CR_T) is calculated using the rate (CR). Here, since the relationship between the compression ratio (CR) and the pseudo quantization step (QP2) can be regarded as a substantially straight line in the log-log graph as described in FIG. 4C, the linear interpolation method is applied. Thus, the target pseudo quantization step (QP2_T) for the target compression rate (CR_T) can be obtained with high accuracy. A specific processing flow will be described in detail later.
[Target quantization index calculation unit 265]
The target quantization index calculation unit 265 calculates a target quantization index (QPIndex_T) corresponding to the target compression rate (CR_T) from the target pseudo quantization step (QP2_T) obtained by the target pseudo quantization width calculation unit 264. Here, the target quantization index (QPIndex_T) is obtained using the graph of FIG. 5B showing the relationship between the quantization index (QPIndex) and the pseudo quantization step (QP2) or an equivalent table. A specific processing flow will be described in detail later.

以上説明してきたように、固定長圧縮処理部205を構成する目標圧縮率設定部261、圧縮率調査部(容量調査部)262、疑似量子化幅算出部263、目標疑似量子化幅算出部264および目標量子化インデックス算出部265は動作する。
(第1の実施形態)
次に、本発明に係る画像圧縮装置および電子カメラ101の第1の実施形態について説明するが、電子カメラ101の構成は図1で説明した構成と同じである。本実施形態では、先に説明した固定長圧縮処理部205の具体的な処理の流れについて説明する。
As described above, the target compression rate setting unit 261, the compression rate investigation unit (capacity investigation unit) 262, the pseudo quantization width calculation unit 263, and the target pseudo quantization width calculation unit 264 constituting the fixed length compression processing unit 205. And the target quantization index calculation unit 265 operates.
(First embodiment)
Next, a first embodiment of the image compression apparatus and the electronic camera 101 according to the present invention will be described. The configuration of the electronic camera 101 is the same as the configuration described in FIG. In the present embodiment, a specific processing flow of the fixed-length compression processing unit 205 described above will be described.

図6は、設定された目標圧縮率に対応する量子化インデックスを求めるための処理を中心とする画像圧縮処理のフローチャートで、目標圧縮率に対応する量子化インデックスを求めて本圧縮処理を行い、メモリカード112aに保存する。   FIG. 6 is a flowchart of an image compression process centering on a process for obtaining a quantization index corresponding to the set target compression ratio, and performing a main compression process by obtaining a quantization index corresponding to the target compression ratio. Save to the memory card 112a.

以下、図6のフローチャートに従って順番に説明する。
(ステップS101)固定長圧縮処理部205の目標圧縮率設定部261は、先に説明したように、操作部材111の目標圧縮率設定ダイヤル111aで選択された圧縮率を目標圧縮率として予め設定する。尚、本ステップは、必ずしも撮影毎に行う必要はなく、例えば電源立ち上げ時や撮影前の設定時に行っておけばよい。
(ステップS102)電子カメラ101の操作部材111でレリーズボタン111bが押下されると、撮像素子104で撮影された画像データが画像バッファ106に取り込まれ、画像処理部107のホワイトバランス処理部201,色補間処理部202およびエッジ強調処理部203で画像処理が行われた後、再び画像バッファ106に記憶される。この時点で、圧縮処理部204へ入力される画像データが画像バッファ106に記憶されている。
(ステップS103)圧縮率調査部262は、目標圧縮率(CR_T)に対応する2つのテスト圧縮用の量子化インデックス(QPIndex_1およびQPIndex_2)をメモリ109に記憶されているテーブルを参照して選択する。
Hereinafter, it demonstrates in order according to the flowchart of FIG.
(Step S101) As described above, the target compression rate setting unit 261 of the fixed length compression processing unit 205 presets the compression rate selected by the target compression rate setting dial 111a of the operation member 111 as the target compression rate. . Note that this step does not necessarily have to be performed for each shooting, and may be performed, for example, when the power is turned on or setting before shooting.
(Step S <b> 102) When the release button 111 b is pressed with the operation member 111 of the electronic camera 101, the image data photographed by the image sensor 104 is taken into the image buffer 106, the white balance processing unit 201 of the image processing unit 107, color After the image processing is performed by the interpolation processing unit 202 and the edge enhancement processing unit 203, the image data is stored in the image buffer 106 again. At this time, the image data input to the compression processing unit 204 is stored in the image buffer 106.
(Step S103) The compression rate examining unit 262 selects two test compression quantization indexes (QPIndex_1 and QPIndex_2) corresponding to the target compression rate (CR_T) with reference to a table stored in the memory 109.

そして、圧縮率調査部262は、テスト圧縮用の量子化インデックス(QPIndex_1およびQPIndex_2)を圧縮処理部204の量子化部252に与え、圧縮処理部204へ入力される画像データに対してテスト圧縮を行う。テスト圧縮は、直交変換部251で直交変換された係数を2つの量子化インデックス(QPIndex_1およびQPIndex_2)でそれぞれ量子化し、エントロピー符号化部253でそれぞれの量子化データを符号化する。そして、圧縮率調査部262は、エントロピー符号化部253が出力するそれぞれの符号化データ取得して圧縮画像データの容量を調べる。   Then, the compression rate examining unit 262 gives the quantization index (QPIndex_1 and QPIndex_2) for test compression to the quantization unit 252 of the compression processing unit 204, and performs test compression on the image data input to the compression processing unit 204. Do. In the test compression, the coefficients orthogonally transformed by the orthogonal transformation unit 251 are quantized by two quantization indexes (QPIndex_1 and QPIndex_2), respectively, and the entropy coding unit 253 encodes each quantized data. Then, the compression rate checking unit 262 acquires the respective encoded data output from the entropy encoding unit 253 and checks the capacity of the compressed image data.

ここで、例えば2つの量子化インデックス(QPIndex_1およびQPIndex_2)に対応する圧縮画像データの容量をそれぞれVM1およびVM2とし、圧縮処理部204へ入力された画像データの容量をVM0とすると、2つの量子化インデックス(QPIndex_1およびQPIndex_2)に対応するそれぞれの圧縮率(CR_1およびCR_2)は(式1)および(式2)のように求められる。
CR_1=VM1/VM0 … (式1)
CR_2=VM2/VM0 … (式2)
(ステップS104)疑似量子化幅算出部263は、テスト圧縮用の2つの量子化インデックス(QPIndex_1およびQPIndex_2)に対応する疑似量子化ステップ(QP2_1およびQP2_2)を求める。この求め方は、図5(b)で説明した量子化インデックス(QPIndex)と疑似量子化ステップ(QP2)との関係を示すグラフまたはテーブルを用いて求める。この様子を図7(a)に示す。尚、図7(a)は図5(b)と同じグラフである。ここで、図7(a)の関数は(式3)のように表すことができる。
QP2=g(QPIndex) … (式3)
図7(a)の例では、量子化インデックスQPIndex_1=36、量子化インデックスQPIndex_2=58の場合を示している。QPIndex_1=36に対する疑似量子化ステップQP2_1は、図5(b)で説明したようにDelta=5の区間に位置するので、QP2_1=32+(36−32)・5=52となる。同様に、QPIndex_1=58に対する疑似量子化ステップQP2_2は、Delta=25の区間に位置するので、QP2_1=112+(58−48)・25=362となる。
Here, for example, assuming that the volumes of compressed image data corresponding to two quantization indexes (QPIndex_1 and QPIndex_2) are VM1 and VM2, respectively, and the volume of image data input to the compression processing unit 204 is VM0, two quantizations Respective compression ratios (CR_1 and CR_2) corresponding to the indexes (QPIndex_1 and QPIndex_2) are obtained as (Expression 1) and (Expression 2).
CR_1 = VM1 / VM0 (Formula 1)
CR_2 = VM2 / VM0 (Formula 2)
(Step S104) The pseudo quantization width calculation unit 263 obtains pseudo quantization steps (QP2_1 and QP2_2) corresponding to the two quantization indexes (QPIndex_1 and QPIndex_2) for test compression. This method is obtained using a graph or table showing the relationship between the quantization index (QPIndex) and the pseudo quantization step (QP2) described in FIG. This is shown in FIG. FIG. 7 (a) is the same graph as FIG. 5 (b). Here, the function of FIG. 7A can be expressed as (Equation 3).
QP2 = g (QPIndex) (Formula 3)
In the example of FIG. 7A, the case where the quantization index QPIndex_1 = 36 and the quantization index QPIndex_2 = 58 is shown. Since the pseudo quantization step QP2_1 for QPIndex_1 = 36 is located in the section of Delta = 5 as described in FIG. 5B, QP2_1 = 32 + (36−32) · 5 = 52. Similarly, since the pseudo quantization step QP2_2 for QPIndex_1 = 58 is located in the section of Delta = 25, QP2_1 = 112 + (58−48) · 25 = 362.

ここで、上記の処理において、2つの量子化インデックス(QPIndex_1およびQPIndex_2)がどの区間に属するかを調べるためのC言語によるプログラム処理の例を以下に示す。
[プログラム(1)]
for(i=0;i<16;i++){
if(QPIndex_x>=QPIndex[i]&&QPIndex_x<=QPIndex[i+1]){
QP2_x=(QP2[i+1]-QP2[i])/(QPIndex[i+1]-QPIndex[i])*
(QPIndex_x-QPIndex[i])+QP2[i];
break;
}
}
ここで、上記のプログラム(1)において、変数iは図5(b)で説明した変数iと同じものでQPIndexの区間を示し、QPIndex_xは区間を調べたいQPIndex_1やQPIndex_2に対応する。尚、本実施形態では、QPIndexの範囲は0から255とし、QPIndexは16ずつに区切られているので区間を示す変数iは1から16となる。
Here, an example of program processing in C language for examining which section the two quantization indexes (QPIndex_1 and QPIndex_2) belong to in the above processing is shown below.
[Program (1)]
for (i = 0; i <16; i ++) {
if (QPIndex_x> = QPIndex [i] && QPIndex_x <= QPIndex [i + 1]) {
QP2_x = (QP2 [i + 1] -QP2 [i]) / (QPIndex [i + 1] -QPIndex [i]) *
(QPIndex_x-QPIndex [i]) + QP2 [i];
break;
}
}
Here, in the above program (1), the variable i is the same as the variable i described with reference to FIG. 5B and indicates a QPIndex section, and QPIndex_x corresponds to QPIndex_1 and QPIndex_2 to be checked. In this embodiment, the range of QPIndex is 0 to 255, and QPIndex is divided into 16 units, so the variable i indicating the interval is 1 to 16.

このようにして、疑似量子化幅算出部263は、テスト圧縮用の2つの量子化インデックス(QPIndex_1およびQPIndex_2)に対応する疑似量子化インデックス(QP2_1およびQP2_2)を求める。
(ステップS105)目標疑似量子化幅算出部264は、テスト圧縮で求めた疑似量子化ステップ(QP2_1およびQP2_2)とそれぞれに対応する圧縮率(CR_1およびCR_2)とを用いて目標圧縮率(CR_T)での目標疑似量子化ステップ(QP2_T)を算出する。ここで、圧縮率(CR)と疑似量子化ステップ(QP2)との関係は、図4で説明したように両対数グラフでほぼ直線と見なすことができるので、直線補間方法を適用して目標圧縮率(CR_T)に対する目標疑似量子化ステップ(QP2_T)を求めることができる(式4)。尚、直線関係は両対数グラフ上で成立するので、先ず対数値の目標疑似量子化ステップ(log(QP2_T))を求め、そしてQP2_Tを算出する。
In this manner, the pseudo quantization width calculation unit 263 obtains pseudo quantization indexes (QP2_1 and QP2_2) corresponding to the two quantization indexes for test compression (QPIndex_1 and QPIndex_2).
(Step S105) The target pseudo-quantization width calculation unit 264 uses the pseudo-quantization steps (QP2_1 and QP2_2) obtained by the test compression and the compression ratios (CR_1 and CR_2) respectively corresponding to the target compression ratios (CR_T). The target pseudo-quantization step (QP2_T) is calculated. Here, since the relationship between the compression ratio (CR) and the pseudo quantization step (QP2) can be regarded as a straight line in the log-log graph as described in FIG. 4, the target compression is applied by applying the linear interpolation method. The target pseudo-quantization step (QP2_T) for the rate (CR_T) can be determined (Equation 4). Since the linear relationship is established on the log-log graph, first, a target pseudo-quantization step (log (QP2_T)) of logarithmic value is obtained, and QP2_T is calculated.

Figure 2011109573
Figure 2011109573

例えば、(式4)において、目標圧縮率(CR_T)がCR_T=0.25、疑似量子化ステップ(QP2_1およびQP2_2)がそれぞれQP2_1=52およびQP2_2=362、圧縮率(CR_1およびCR_2)がそれぞれCR_1=0.10およびCR_2=0.58とした場合、目標疑似量子化ステップ(QP2_T)はQP2_T≒132となる。   For example, in (Expression 4), the target compression rate (CR_T) is CR_T = 0.25, the pseudo quantization steps (QP2_1 and QP2_2) are QP2_1 = 52 and QP2_2 = 362, and the compression rates (CR_1 and CR_2) are CR_1, respectively. = 0.10 and CR_2 = 0.58, the target pseudo-quantization step (QP2_T) is QP2_T≈132.

このようにして、疑似量子化幅算出部263は、テスト圧縮で求めた疑似量子化ステップ(QP2_1およびQP2_2)とそれぞれに対応する圧縮率(CR_1およびCR_2)とを用いて目標圧縮率(CR_T)に対する目標疑似量子化ステップ(QP2_T)を算出する。
(ステップS106)目標量子化インデックス算出部265は、ステップS105で求めた目標疑似量子化ステップ(QP2_T)に対応する目標量子化インデックス(QPIndex_T)を求める。
In this way, the pseudo quantization width calculation unit 263 uses the pseudo quantization steps (QP2_1 and QP2_2) obtained by the test compression and the compression rates (CR_1 and CR_2) corresponding to the respective steps to the target compression rate (CR_T). The target pseudo-quantization step (QP2_T) for is calculated.
(Step S106) The target quantization index calculation unit 265 calculates a target quantization index (QPIndex_T) corresponding to the target pseudo quantization step (QP2_T) obtained in step S105.

ここで、目標量子化インデックス(QPIndex_T)は、量子化インデックス(QPIndex)と疑似量子化ステップ(QP2)との関係を示す図5(b)のグラフまたは同等のテーブルを用いて求める。この様子を図7(b)に示す。尚、図7(b)は図5(b)と同じグラフである。また、図7(b)の関数は先に説明した(式3)の逆関数として(式5)のように表すことができる。
QPIndex_T=g−1(QP2_T) … (式5)
図7(b)の例では、ステップS105で求めた目標疑似量子化ステップ(QP2_T)がQP2_T≒132の場合を示している。QP2_T=132に対する目標量子化インデックスQPIndex_Tは、QPIndex_T=(132−112)/5+48=52となる。
Here, the target quantization index (QPIndex_T) is obtained using the graph of FIG. 5B showing the relationship between the quantization index (QPIndex) and the pseudo quantization step (QP2) or an equivalent table. This state is shown in FIG. FIG. 7 (b) is the same graph as FIG. 5 (b). Moreover, the function of FIG.7 (b) can be represented like (Formula 5) as an inverse function of (Formula 3) demonstrated previously.
QPIndex_T = g −1 (QP2_T) (Formula 5)
The example of FIG. 7B shows a case where the target pseudo quantization step (QP2_T) obtained in step S105 is QP2_T≈132. The target quantization index QPIndex_T for QP2_T = 132 is QPIndex_T = (132−112) / 5 + 48 = 52.

ここで、上記の処理において、目標量子化インデックス(QPIndex_T)がどの区間に属するかを調べるためのC言語によるプログラム処理の例を以下に示す。
[プログラム(2)]
for(i=0;i<16;i++){
if(QP2_T >= QP2[i] && QP2_T <= QP2[i+1]){
QPIndex_T=(QPIndex[i+1]-QPIndex[i])/(QP2[i+1]-QP2[i])*
(QP2_T-QP2[i])+QPIndex[i];
break;
}
}
ここで、上記のプログラム(2)において、変数iは図5(b)で説明した変数iと同じものでQPIndexの区間を示し、QPIndex[i]は区間iの開始位置のQPIndex値=(16*i)に対応する。例えばQP2_T=132の場合はi=3(区間3)に対応するので、QP2[3]=112とQP2[4]=512との間にあり、この区間の開始位置のQPIndex値=16*3=48であることがわかる。つまり、目標量子化インデックス(QPIndex_T)は、i=3(区間3)にあり、QPIndex=48とQPIndex=64との間の値となる。目標量子化インデックス(QPIndex_T)が位置する区間がわかれば、その区間の増分Deltaがわかるので目標量子化インデックス(QPIndex_T)を比例配分で内挿して求めることができる。
Here, an example of program processing in C language for examining which section the target quantization index (QPIndex_T) belongs to in the above processing is shown below.
[Program (2)]
for (i = 0; i <16; i ++) {
if (QP2_T> = QP2 [i] && QP2_T <= QP2 [i + 1]) {
QPIndex_T = (QPIndex [i + 1] -QPIndex [i]) / (QP2 [i + 1] -QP2 [i]) *
(QP2_T-QP2 [i]) + QPIndex [i];
break;
}
}
Here, in the program (2), the variable i is the same as the variable i described with reference to FIG. 5B and indicates the QPIndex section, and QPIndex [i] is the QPIndex value of the start position of the section i = (16 * Corresponds to i). For example, since QP2_T = 132 corresponds to i = 3 (section 3), it is between QP2 [3] = 112 and QP2 [4] = 512, and the QPIndex value at the start position of this section = 16 * 3 It can be seen that = 48. That is, the target quantization index (QPIndex_T) is at i = 3 (section 3), and is a value between QPIndex = 48 and QPIndex = 64. If the interval in which the target quantization index (QPIndex_T) is located is known, the increment Delta in that interval can be known, so that the target quantization index (QPIndex_T) can be interpolated by proportional distribution.

このようにして、目標量子化インデックス算出部265は、ステップS105で求めた目標疑似量子化ステップ(QP2_T)に対応する目標量子化インデックス(QPIndex_T)を求める。
(ステップS107)圧縮処理部204は、ステップS106で求めた目標量子化インデックス(QPIndex_T)を量子化部252に与え、圧縮処理部204へ入力される画像データに対して本圧縮を行う。尚、本圧縮は、直交変換部251で直交変換された係数を目標量子化インデックス(QPIndex_T)で量子化し、エントロピー符号化部253で量子化データを符号化し、圧縮画像データとして出力する。
(ステップS108)カメラ制御部108は、画像処理部107の圧縮処理部204が出力する圧縮画像データを撮影画像データとしてメモリカードI/F112を介してメモリカード112aに保存する。
In this way, the target quantization index calculation unit 265 calculates the target quantization index (QPIndex_T) corresponding to the target pseudo quantization step (QP2_T) obtained in step S105.
(Step S107) The compression processing unit 204 gives the target quantization index (QPIndex_T) obtained in step S106 to the quantization unit 252, and performs main compression on the image data input to the compression processing unit 204. In the main compression, the coefficient orthogonally transformed by the orthogonal transform unit 251 is quantized with the target quantization index (QPIndex_T), the quantized data is encoded by the entropy encoding unit 253, and is output as compressed image data.
(Step S108) The camera control unit 108 stores the compressed image data output from the compression processing unit 204 of the image processing unit 107 in the memory card 112a via the memory card I / F 112 as photographed image data.

尚、実際には、画像圧縮処理は図8(a)に示すように1枚の撮影画像を複数のサブブロックに分割してそれぞれのブロック毎に上記の圧縮処理を施す。   Actually, in the image compression processing, as shown in FIG. 8A, one photographed image is divided into a plurality of sub-blocks, and the above-described compression processing is performed for each block.

このようにして、第1の実施形態に係る電子カメラ101は、設定された目標圧縮率になるようにテスト圧縮結果から精度良く量子化インデックスを求めることができる。これにより、圧縮後の画像データの容量を概ね一定にすることができるので、メモリカード112aの残容量に応じて選択された目標圧縮率で撮影可能な画像の枚数を把握することができ、電子カメラ101の使い勝手が向上する。   In this way, the electronic camera 101 according to the first embodiment can accurately obtain the quantization index from the test compression result so that the set target compression rate is obtained. As a result, the volume of the compressed image data can be made substantially constant, so that the number of images that can be captured with the target compression rate selected according to the remaining capacity of the memory card 112a can be grasped. Usability of the camera 101 is improved.

尚、第1の実施形態において、2つの量子化インデックス(QPIndex_1およびQPIndex_2)を用いてそれぞれテスト圧縮を行うので、テスト圧縮を2回行う必要があるが、図8(a)に示すように1枚の撮影画像を複数のサブブロックに分割してそれぞれのブロック毎に圧縮処理を施す場合に、図8(b)に示すように、量子化インデックス(QPIndex_1)を適用するブロックと、量子化インデックス(QPIndex_2)を適用するブロックとに分けて量子化を行うことにより、1回のテスト圧縮で済ませることができる。図8(b)の例では、千鳥状に量子化インデックス(QPIndex_1)を適用するブロックAと、量子化インデックス(QPIndex_2)を適用するブロックBとに分けているので、圧縮率調査部262は、圧縮画像データの容量を求める際もブロックAとブロックBとに分けて算出し、それぞれのブロックでの圧縮率を算出する。このように処理することで処理量および処理時間を低減することができる。   In the first embodiment, since test compression is performed using two quantization indexes (QPIndex_1 and QPIndex_2), it is necessary to perform test compression twice. However, as shown in FIG. When dividing a captured image into a plurality of sub-blocks and performing compression processing for each block, as shown in FIG. 8B, a block to which a quantization index (QPIndex_1) is applied, and a quantization index By performing the quantization separately for the blocks to which (QPIndex_2) is applied, it is possible to perform one test compression. In the example of FIG. 8B, since the block A that applies the quantization index (QPIndex_1) and the block B that applies the quantization index (QPIndex_2) are divided in a zigzag manner, the compression ratio examining unit 262 When obtaining the capacity of the compressed image data, it is calculated separately for the block A and the block B, and the compression rate in each block is calculated. By processing in this way, the processing amount and processing time can be reduced.

(第2の実施形態)
次に、本発明に係る画像圧縮装置および電子カメラ101の第2の実施形態について説明する。尚、電子カメラ101の構成は図1で説明した構成と同じである。本実施形態では、先に説明した固定長圧縮処理部205の処理が第1の実施形態と少し異なる。
(Second Embodiment)
Next, a second embodiment of the image compression apparatus and the electronic camera 101 according to the present invention will be described. The configuration of the electronic camera 101 is the same as that described with reference to FIG. In the present embodiment, the processing of the fixed-length compression processing unit 205 described above is slightly different from that in the first embodiment.

図9は、第2の実施形態において、設定された目標圧縮率に対応する量子化インデックスを求めるための処理を中心とする画像圧縮処理のフローチャートで、図6のステップS103の処理が異なり、ステップS102で画像データを入力した後、ステップS103の処理を実行する代わりに次の処理を実行する。
(ステップS103a)圧縮率調査部262は、先ず目標圧縮率(CR_T)に対応する1つのテスト圧縮用の量子化インデックス(QPIndex_1)をメモリ109に記憶されているテーブルを参照して選択する。尚、選択方法は、先に説明したように、最も確率の高い量子化インデックス値を選択する。
FIG. 9 is a flowchart of the image compression process centering on the process for obtaining the quantization index corresponding to the set target compression rate in the second embodiment. The process of step S103 in FIG. After inputting the image data in S102, the following processing is executed instead of executing the processing of Step S103.
(Step S103a) The compression rate examining unit 262 first selects one test compression quantization index (QPIndex_1) corresponding to the target compression rate (CR_T) with reference to the table stored in the memory 109. As described above, the selection method selects the quantization index value having the highest probability.

そして、圧縮率調査部262は、テスト圧縮用の量子化インデックス(QPIndex_1)を圧縮処理部204の量子化部252に与え、圧縮処理部204へ入力される画像データに対してテスト圧縮を行う。テスト圧縮は、直交変換部251で直交変換された係数を量子化インデックス(QPIndex_1)でそれぞれ量子化し、エントロピー符号化部253でそれぞれの量子化データを符号化する。そして、圧縮率調査部262は、エントロピー符号化部253が出力する符号化データ取得して圧縮画像データの容量を調べる。例えば量子化インデックス(QPIndex_1)に対応する圧縮画像データの容量をVM1、圧縮処理部204へ入力された画像データの容量をVM0とすると、第1の実施形態で説明した(式1)で表され、量子化インデックス(QPIndex_1)に対応する圧縮率(CR_1)を求めることができる。
(ステップS103b)圧縮率調査部262は、圧縮率(CR_1)に応じて2つめのテスト圧縮用の量子化インデックス(QPIndex_2)を選択する。尚、選択方法は、例えば、ステップS103aで求めた1つめのテスト圧縮用の量子化インデックス(QPIndex_1)における圧縮率(CR_1)が目標圧縮率(CR_T)より小さい場合は、2つめのテスト圧縮用の量子化インデックス(QPIndex_2)としてQPIndex_1よりも大きい値を選択する。逆に、1つめのテスト圧縮用の量子化インデックス(QPIndex_1)における圧縮率(CR_1)が目標圧縮率(CR_T)より大きい場合は、2つめのテスト圧縮用の量子化インデックス(QPIndex_2)としてQPIndex_1よりも小さい値を選択する。これにより、目標圧縮率(CR_T)にできるだけ近いテスト圧縮用の量子化インデックス(QPIndex_2)を選択できるが、必ずしもこのように処理する必要はなく、1回目のテスト圧縮で求めた圧縮率(CR_1)を利用する別の手法で2つめのテスト圧縮用の量子化インデックス(QPIndex_2)を選択しても構わない。
Then, the compression rate examining unit 262 gives the quantization index (QPIndex_1) for test compression to the quantization unit 252 of the compression processing unit 204, and performs test compression on the image data input to the compression processing unit 204. In the test compression, the coefficients orthogonally transformed by the orthogonal transform unit 251 are quantized with a quantization index (QPIndex_1), and the entropy coding unit 253 codes each quantized data. The compression rate checking unit 262 acquires the encoded data output from the entropy encoding unit 253 and checks the capacity of the compressed image data. For example, when the capacity of the compressed image data corresponding to the quantization index (QPIndex_1) is VM1, and the capacity of the image data input to the compression processing unit 204 is VM0, it is expressed by (Expression 1) described in the first embodiment. The compression rate (CR_1) corresponding to the quantization index (QPIndex_1) can be obtained.
(Step S103b) The compression rate examining unit 262 selects the second quantization index (QPIndex_2) for test compression according to the compression rate (CR_1). For example, when the compression rate (CR_1) in the first quantization index for test compression (QPIndex_1) obtained in step S103a is smaller than the target compression rate (CR_T), the selection method is for the second test compression. As the quantization index (QPIndex_2), a value larger than QPIndex_1 is selected. Conversely, when the compression rate (CR_1) in the first test compression quantization index (QPIndex_1) is larger than the target compression rate (CR_T), the second test compression quantization index (QPIndex_2) is obtained from QPIndex_1. Choose a smaller value. As a result, a quantization index (QPIndex_2) for test compression that is as close as possible to the target compression ratio (CR_T) can be selected, but it is not always necessary to perform this processing, and the compression ratio (CR_1) obtained in the first test compression The second quantization index for test compression (QPIndex_2) may be selected by another method using the above.

そして、圧縮率調査部262は、2つめのテスト圧縮用の量子化インデックス(QPIndex_2)を圧縮処理部204の量子化部252に与え、圧縮処理部204へ入力される画像データに対してテスト圧縮を行い、ステップS103aと同様にして、第1の実施形態で説明した(式2)を用いて量子化インデックス(QPIndex_2)に対応する圧縮率(CR_2)を求める。   Then, the compression ratio examining unit 262 gives the second quantization index (QPIndex_2) for test compression to the quantization unit 252 of the compression processing unit 204, and performs test compression on the image data input to the compression processing unit 204. As in step S103a, the compression ratio (CR_2) corresponding to the quantization index (QPIndex_2) is obtained using (Expression 2) described in the first embodiment.

図9において、ステップS104以降の処理は、第1の実施形態で説明した図6と同様に処理される。   In FIG. 9, the processing after step S104 is performed in the same manner as in FIG. 6 described in the first embodiment.

このように、第2の実施形態に係る電子カメラ101は、テスト圧縮を2回に分けて実行することにより、テスト圧縮用に選択すべき2つの量子化インデックス(QPIndex_1およびQPIndex_2)を第1の実施形態よりも適切な値を選択できるので、設定された目標圧縮率に近くなるように本圧縮処理する際の目標量子化インデックス(QPIndex_T)をより精度良く求めることができる。これにより、圧縮後の画像データの容量を概ね一定にすることができるので、メモリカード112aの残容量に応じて選択された目標圧縮率で撮影可能な画像の枚数を把握することができ、電子カメラ101の使い勝手が向上する。   As described above, the electronic camera 101 according to the second embodiment performs the test compression in two steps, thereby obtaining the two quantization indexes (QPIndex_1 and QPIndex_2) to be selected for the test compression as the first. Since a more appropriate value can be selected than in the embodiment, the target quantization index (QPIndex_T) for performing the main compression processing so as to be close to the set target compression rate can be obtained with higher accuracy. As a result, the volume of the compressed image data can be made substantially constant, so that the number of images that can be captured with the target compression rate selected according to the remaining capacity of the memory card 112a can be grasped. Usability of the camera 101 is improved.

(第3の実施形態)
次に、本発明に係る画像圧縮装置および電子カメラ101の第3の実施形態について説明する。尚、電子カメラ101の構成は図1で説明した構成と同じである。本実施形態では、先に説明した固定長圧縮処理部205の処理が第1の実施形態および第2の実施形態と異なる。
(Third embodiment)
Next, a third embodiment of the image compression apparatus and the electronic camera 101 according to the present invention will be described. The configuration of the electronic camera 101 is the same as that described with reference to FIG. In the present embodiment, the processing of the fixed-length compression processing unit 205 described above is different from the first embodiment and the second embodiment.

図10は、本実施形態の原理を説明するためのグラフで、疑似量子化ステップ(QP2)と圧縮率(CR)との関係を図4(c)よりもマクロ的に描いたものである。つまり、図4(c)の横軸の疑似量子化ステップ(QP2)の下限値は1で、縦軸の圧縮率(CR)の上限値は1であるのに対して、図10では、横軸の疑似量子化ステップ(QP2)の下限値の1以下、縦軸の圧縮率(CR)の上限値の1以上をマクロ的に予測して描いてある。   FIG. 10 is a graph for explaining the principle of the present embodiment, in which the relationship between the pseudo-quantization step (QP2) and the compression ratio (CR) is drawn in a macro manner as compared with FIG. 4 (c). That is, the lower limit value of the pseudo quantization step (QP2) on the horizontal axis in FIG. 4C is 1, and the upper limit value of the compression ratio (CR) on the vertical axis is 1, whereas in FIG. 1 or less of the lower limit value of the quasi-quantization step (QP2) of the axis and 1 or more of the upper limit value of the compression ratio (CR) of the ordinate are drawn macroscopically.

本実施形態の原理は、図10に示したように、様々な種類の画像を圧縮する場合、疑似量子化ステップ(QP2)と圧縮率(CR)との関係は、疑似量子化ステップ(QP2)が1以下で、圧縮率(CR)が1以上の領域で1点に集束するという予測が前提になっている。尚、この原理は、発明者による実験結果などにより経験的に得られた考え方である。例えば実際に測定した図4(c)のグラフを見ると、左上方から右下方に向かって放射状に広がる特性になっていることからも左上方で1点に集束するであろうことは容易に予測できる。   The principle of the present embodiment is that, as shown in FIG. 10, when various types of images are compressed, the relationship between the pseudo quantization step (QP2) and the compression rate (CR) is the pseudo quantization step (QP2). Is assumed to be converged to one point in a region where the compression ratio (CR) is 1 or more. This principle is a concept obtained empirically based on experimental results by the inventors. For example, looking at the actually measured graph of FIG. 4 (c), it is easy to focus on one point in the upper left because it has a characteristic of spreading radially from the upper left to the lower right. Predictable.

先に説明した第1の実施形態や第2の実施形態では、2つのテスト圧縮用の量子化インデックスを選択する必要があったが、本実施形態ではテスト圧縮用の量子化インデックスを1つだけ選択してテスト圧縮を1回だけで済ませることができるという利点がある。   In the first embodiment and the second embodiment described above, it is necessary to select two quantization indexes for test compression, but in this embodiment, only one quantization index for test compression is selected. The advantage is that it can be selected and the test compression can be done only once.

以下、第3の実施形態における固定長圧縮処理部205の具体的な処理の流れについて図11のフローチャートに従って順番に説明する。尚、図11のフローチャートにおいて、第1の実施形態の図6のフローチャートと同じステップ番号の処理は同じ処理なので重複する説明は省略し、図6のフローチャートと異なる部分についてのみ説明する。   Hereinafter, a specific processing flow of the fixed-length compression processing unit 205 in the third embodiment will be described in order according to the flowchart of FIG. In the flowchart of FIG. 11, the processes with the same step numbers as those in the flowchart of FIG. 6 of the first embodiment are the same processes, and thus redundant description is omitted, and only the parts different from the flowchart of FIG.

図11において、ステップS101およびステップS102の処理は、図6のフローチャートと同じである。
(ステップS203)圧縮率調査部262は、先ず目標圧縮率(CR_T)に対応する1つのテスト圧縮用の量子化インデックス(QPIndex_1)をメモリ109に記憶されているテーブルを参照して選択する。尚、選択方法は、先に説明したように、最も確率の高い量子化インデックス値を選択する。
(ステップS204)圧縮率調査部262は、テスト圧縮用の量子化インデックス(QPIndex_1)を圧縮処理部204の量子化部252に与え、圧縮処理部204へ入力される画像データに対してテスト圧縮を行う。そして、第1の実施形態と同様に、(式1)を用いて量子化インデックス(QPIndex_1)に対応する圧縮率(CR_1)を求める。
(ステップS205)疑似量子化幅算出部263は、テスト圧縮用の1つの量子化インデックス(QPIndex_1)に対応する疑似量子化ステップ(QP2_1)を求める。一方、図10で説明したように、1点に集中した部分の初期疑似量子化ステップ(QP2_0)と初期圧縮率(CR_0)とを求めておく。
(ステップS206)疑似量子化幅算出部263は、テスト圧縮で求めた疑似量子化ステップ(QP2_1)と圧縮率(CR_1)と初期疑似量子化ステップ(QP2_0)と初期圧縮率(CR_0)とを用いて目標圧縮率(CR_T)における目標疑似量子化ステップ(QP2_T)を算出する。算出方法は、図10のようにマクロ的に見た場合でも、圧縮率(CR)と疑似量子化ステップ(QP2)との関係は、図4で説明したように両対数グラフでほぼ直線と見なすことができるので、直線補間方法を適用して目標圧縮率(CR_T)に対する目標疑似量子化ステップ(QP2_T)を求めることができる(式6)。
In FIG. 11, the processing of step S101 and step S102 is the same as the flowchart of FIG.
(Step S203) The compression rate examining unit 262 first selects one test compression quantization index (QPIndex_1) corresponding to the target compression rate (CR_T) with reference to the table stored in the memory 109. As described above, the selection method selects the quantization index value having the highest probability.
(Step S204) The compression rate examining unit 262 gives the quantization index (QPIndex_1) for test compression to the quantization unit 252 of the compression processing unit 204, and performs test compression on the image data input to the compression processing unit 204. Do. Then, as in the first embodiment, the compression ratio (CR_1) corresponding to the quantization index (QPIndex_1) is obtained using (Equation 1).
(Step S205) The pseudo quantization width calculation unit 263 obtains a pseudo quantization step (QP2_1) corresponding to one quantization index (QPIndex_1) for test compression. On the other hand, as described with reference to FIG. 10, the initial pseudo-quantization step (QP2_0) and the initial compression rate (CR_0) of the portion concentrated on one point are obtained.
(Step S206) The pseudo quantization width calculation unit 263 uses the pseudo quantization step (QP2_1), compression rate (CR_1), initial pseudo quantization step (QP2_0), and initial compression rate (CR_0) obtained by the test compression. The target pseudo quantization step (QP2_T) at the target compression rate (CR_T) is calculated. Even if the calculation method is macroscopically as shown in FIG. 10, the relationship between the compression rate (CR) and the pseudo quantization step (QP2) is regarded as a straight line in the log-log graph as described in FIG. Therefore, the target pseudo quantization step (QP2_T) with respect to the target compression rate (CR_T) can be obtained by applying a linear interpolation method (Formula 6).

Figure 2011109573
Figure 2011109573

尚、(式6)は第1の実施形態で説明した(式4)に対応する式で、(式4)の疑似量子化ステップ(QP2_2)と圧縮率(CR_2)とがそれぞれ初期疑似量子化ステップ(QP2_0)と初期圧縮率(CR_0)とに置き換わっているだけである。ステップS106以降の処理は第1の実施形態と同じなので重複する説明は省略する。   (Equation 6) is an equation corresponding to (Equation 4) described in the first embodiment, and the pseudo-quantization step (QP2_2) and the compression rate (CR_2) of (Equation 4) are respectively the initial pseudo-quantization. Only the step (QP2_0) and the initial compression rate (CR_0) are replaced. Since the processing after step S106 is the same as that of the first embodiment, a duplicate description is omitted.

このようにして、第3の実施形態に係る電子カメラ101は、設定された目標圧縮率になるように1回だけのテスト圧縮結果から量子化インデックスを求めることができる。これにより、圧縮後の画像データの容量を概ね一定にすることができるので、メモリカード112aの残容量に応じて選択された目標圧縮率で撮影可能な画像の枚数を把握することができ、電子カメラ101の使い勝手が向上する。   In this way, the electronic camera 101 according to the third embodiment can obtain the quantization index from the test compression result only once so that the set target compression rate is obtained. As a result, the volume of the compressed image data can be made substantially constant, so that the number of images that can be captured with the target compression rate selected according to the remaining capacity of the memory card 112a can be grasped. Usability of the camera 101 is improved.

(第4の実施形態)
次に、本発明に係る画像圧縮装置および電子カメラ101の第4の実施形態について説明する。尚、電子カメラ101の構成は図1で説明した構成と同じである。本実施形態では、固定長圧縮処理部205の処理で扱うデータ形式が他の実施形態とは異なり、対数値(log(QP2))のまま処理を行う点に特徴がある。この理由は、図2に示したように、疑似量子化ステップ(QP2)は量子化インデックス(QPIndex)が大きくなるに従って非常に大きな値を取ることと、疑似量子化ステップ(QP2)を求める際にはその対数値しか使わないのでQP2値を算出しておく必要がないことである。本実施形態ではこの点に着目して、対数値のまま処理することにより、対数変換や関連する処理量およびメモリ容量の増大を軽減することができる。
(Fourth embodiment)
Next, a fourth embodiment of the image compression apparatus and the electronic camera 101 according to the present invention will be described. The configuration of the electronic camera 101 is the same as that described with reference to FIG. Unlike the other embodiments, the present embodiment is characterized in that processing is performed with logarithmic values (log (QP2)) unlike the other embodiments. The reason for this is that, as shown in FIG. 2, the pseudo quantization step (QP2) takes a very large value as the quantization index (QPIndex) increases, and the pseudo quantization step (QP2) is obtained. Since only the logarithmic value is used, it is not necessary to calculate the QP2 value. In this embodiment, paying attention to this point, processing with logarithmic values can reduce the increase in logarithmic conversion and related processing amount and memory capacity.

以下、本実施形態における固定長圧縮処理部205の処理について説明するが、基本的な処理の流れは第1の実施形態で説明した図6のフローチャートと同じなので、図6を用いて説明する。   Hereinafter, the processing of the fixed-length compression processing unit 205 in the present embodiment will be described, but the basic processing flow is the same as the flowchart of FIG. 6 described in the first embodiment, and will be described with reference to FIG.

図6のフローチャートにおいて、ステップS101からステップS103までの処理は全く同じで、ステップS104の処理が第1の実施形態とは少し異なり、下記のステップS104bのように処理する。
(ステップS104b)疑似量子化幅算出部263は、テスト圧縮用の2つの量子化インデックス(QPIndex_1およびQPIndex_2)に対応する対数値の疑似量子化ステップ(log(QP2_1)およびlog(QP2_2))を求める。第1の実施形態では、図7(a)の量子化インデックス(QPIndex)と疑似量子化ステップ(QP2)との関係を示すグラフまたはテーブルを用いてQP2を求めたが、本実施形態ではQP2の対数値log(QP2)をそのまま用いる。このように、QP2ではなくQP2の対数値log(QP2)を用いることで、例えば図2に示したようにiが10以上の区間でQP2の値は巨大な値になっているがlog(QP2)は扱い易い大きさの値になっている。
In the flowchart of FIG. 6, the processing from step S101 to step S103 is exactly the same, the processing of step S104 is slightly different from the first embodiment, and processing is performed as in step S104b below.
(Step S104b) The pseudo quantization width calculation unit 263 obtains logarithmic pseudo quantization steps (log (QP2_1) and log (QP2_2)) corresponding to the two quantization indexes for test compression (QPIndex_1 and QPIndex_2). . In the first embodiment, QP2 is obtained using a graph or table showing the relationship between the quantization index (QPIndex) and the pseudo quantization step (QP2) in FIG. 7A. The logarithmic value log (QP2) is used as it is. Thus, by using the logarithmic value log (QP2) of QP2 instead of QP2, for example, as shown in FIG. 2, the value of QP2 is a huge value in a section where i is 10 or more, but log (QP2 ) Is a size that is easy to handle.

ここで、本実施形態では第1の実施形態で説明したプログラム(1)は以下に示したプログラム(3)のように処理される。
[プログラム(3)]
for(i=0;i<16;i++){
if(QPIndex_x >= QPIndex[i] && QPIndex_x <= QPIndex[i+1]){
logQP2_x=(logQP2[i+1]-logQP2[i])/(QPIndex[i+1]-QPIndex[i])*
(QPIndex_x-QPIndex[i])+logQP2[i];
break;
}
}
このようにして、疑似量子化幅算出部263は、テスト圧縮用の2つの量子化インデックス(QPIndex_1およびQPIndex_2)に対応する対数値の疑似量子化インデックス(log(QP2_1)およびlog(QP2_2))を求める。
(ステップS105b)疑似量子化幅算出部263は、第1の実施形態のステップS105と同様に(式4)を用いて目標圧縮率(CR_T)に対する対数値の目標疑似量子化ステップ(log(QP2_T))を求めるが、本実施形態ではステップS104bで対数値の疑似量子化インデックス(log(QP2_1)およびlog(QP2_2))を求めてあるので、そのまま(式4)のlog(QP2_1)およびlog(QP2_2)に代入するだけでよく、対数計算する必要がない。
(ステップS106b)目標量子化インデックス算出部265は、ステップS105bで求めた対数値の目標疑似量子化ステップ(log(QP2_T))に対応する目標量子化インデックス(QPIndex_T)を求める。
Here, in the present embodiment, the program (1) described in the first embodiment is processed as a program (3) shown below.
[Program (3)]
for (i = 0; i <16; i ++) {
if (QPIndex_x> = QPIndex [i] && QPIndex_x <= QPIndex [i + 1]) {
logQP2_x = (logQP2 [i + 1] -logQP2 [i]) / (QPIndex [i + 1] -QPIndex [i]) *
(QPIndex_x-QPIndex [i]) + logQP2 [i];
break;
}
}
In this way, the pseudo quantization width calculation unit 263 obtains logarithmic pseudo quantization indexes (log (QP2_1) and log (QP2_2)) corresponding to the two quantization indexes for test compression (QPIndex_1 and QPIndex_2). Ask.
(Step S105b) The pseudo-quantization width calculation unit 263 uses the (Equation 4) in the same manner as in Step S105 of the first embodiment, and uses a logarithmic target pseudo-quantization step (log (QP2_T) In this embodiment, since the logarithmic pseudo-quantization index (log (QP2_1) and log (QP2_2)) is obtained in step S104b, log (QP2_1) and log (QP2_1) It is only necessary to substitute for QP2_2), and logarithmic calculation is not necessary.
(Step S106b) The target quantization index calculation unit 265 calculates a target quantization index (QPIndex_T) corresponding to the logarithmic target pseudo quantization step (log (QP2_T)) calculated in step S105b.

ここで、第1の実施形態では、図7(b)の量子化インデックス(QPIndex)と疑似量子化ステップ(QP2)との関係を示すグラフまたはテーブルを用いて、目標量子化インデックス(QPIndex_T)を求めたが、本実施形態ではQP2の対数値log(QP2)をそのまま用いて求める。QP2ではなくQP2の対数値log(QP2)を用いることで、ステップS104bと同様に巨大な値となるQP2ではなく扱い易い対数値log(QP2)のまま計算することができる。   Here, in the first embodiment, the target quantization index (QPIndex_T) is set using a graph or table showing the relationship between the quantization index (QPIndex) and the pseudo quantization step (QP2) in FIG. In this embodiment, the logarithm value log (QP2) of QP2 is used as it is. By using the logarithmic value log (QP2) of QP2 instead of QP2, it is possible to calculate the logarithm value log (QP2) that is easy to handle instead of QP2 that is a huge value as in step S104b.

ここで、本実施形態では第1の実施形態で説明したプログラム(2)は以下に示したプログラム(4)のように処理される。
[プログラム(4)]
for(i=0;i<16;i++){
if(logQP2_T >= logQP2[i] && logQP2_T <= logQP2[i+1]){
QPIndex_T=(QPIndex[i+1]-QPIndex[i])/(logQP2[i+1]-logQP2[i])*
(logQP2_T-logQP2[i])+QPIndex[i];
break;
}
}
このようにして、目標量子化インデックス算出部265は、ステップS105で求めた対数値の目標疑似量子化ステップ(log(QP2_T))に対応する目標量子化インデックス(QPIndex_T)を求める。
Here, in this embodiment, the program (2) described in the first embodiment is processed as the following program (4).
[Program (4)]
for (i = 0; i <16; i ++) {
if (logQP2_T> = logQP2 [i] && logQP2_T <= logQP2 [i + 1]) {
QPIndex_T = (QPIndex [i + 1] -QPIndex [i]) / (logQP2 [i + 1] -logQP2 [i]) *
(logQP2_T-logQP2 [i]) + QPIndex [i];
break;
}
}
In this way, the target quantization index calculation unit 265 calculates the target quantization index (QPIndex_T) corresponding to the logarithmic target pseudo quantization step (log (QP2_T)) calculated in step S105.

以降のステップS107およびステップS108の処理は第1の実施形態と同じなので重複する説明は省略する。   Subsequent processes in step S107 and step S108 are the same as those in the first embodiment, and thus redundant description is omitted.

以上説明したように、第4の実施形態に係る電子カメラ101は、設定された目標圧縮率になるようにテスト圧縮結果から精度良く量子化インデックスを求めることができる。これにより、圧縮後の画像データの容量を概ね一定にすることができるので、メモリカード112aの残容量に応じて選択された目標圧縮率で撮影可能な画像の枚数を把握することができ、電子カメラ101の使い勝手が向上する。特に本実施形態では疑似量子化ステップを対数のまま処理することにより、対数変換や関連する処理量およびメモリ容量の増大を軽減することができる。   As described above, the electronic camera 101 according to the fourth embodiment can accurately obtain the quantization index from the test compression result so that the set target compression rate is obtained. As a result, the volume of the compressed image data can be made substantially constant, so that the number of images that can be captured with the target compression rate selected according to the remaining capacity of the memory card 112a can be grasped. Usability of the camera 101 is improved. In particular, in the present embodiment, the pseudo-quantization step is processed logarithmically, thereby reducing logarithmic conversion and related processing amount and memory capacity.

尚、上記の説明では、第1の実施形態を基にして説明したが、疑似量子化ステップを対数値のまま用いる点が本実施形態の特徴なので、第2の実施形態および第3の実施形態においても同様に適用することができる。   In the above description, the description has been made based on the first embodiment. However, since the feature of the present embodiment is that the pseudo-quantization step is used as a logarithmic value, the second embodiment and the third embodiment. The same applies to the above.

以上、本発明に係る画像圧縮装置および電子カメラの各実施形態について説明してきたが、圧縮率と量子化ステップとの関係が両対数グラフで直線に近くなるような疑似量子化ステップを設けることにより、目標圧縮率に対する目標量子化インデックスを精度よく求めることができる。この結果、本発明に係る画像圧縮装置および電子カメラは、どのような被写体を撮影しても圧縮後の画像ファイル容量を概ね一定にすることができ、記録メディアの残容量で撮影できる画像枚数の予測を行うことができ、電子カメラの使い勝手が向上する。   As described above, the embodiments of the image compression apparatus and the electronic camera according to the present invention have been described. By providing a pseudo quantization step in which the relationship between the compression rate and the quantization step is close to a straight line in the log-log graph. The target quantization index for the target compression rate can be obtained with high accuracy. As a result, the image compression apparatus and the electronic camera according to the present invention can make the image file capacity after compression almost constant regardless of what kind of subject is photographed, and the number of images that can be photographed with the remaining capacity of the recording medium. Prediction can be performed and the usability of the electronic camera is improved.

尚、各実施形態では、目標圧縮率に近くなるように目標量子化インデックスを求めるようにしたが、目標量子化インデックスの下限値(QPIndex_L)を設定しておき、予測された目標量子化インデックス(QPIndex_T)が次の関係になった場合は、予測された目標量子化インデックス(QPIndex_T)に関係なく目標量子化インデックスの下限値(QPIndex_L)を用いるようにしても構わない。これにより、撮影画像が高周波成分の少ない画像で圧縮率が高くなる場合でも、本圧縮に使用する量子化インデックスが極端に小さな値になってしまうという問題を防止できる。   In each embodiment, the target quantization index is obtained so as to be close to the target compression rate. However, a lower limit value (QPIndex_L) of the target quantization index is set and the predicted target quantization index ( When QPIndex_T) has the following relationship, the lower limit value (QPIndex_L) of the target quantization index may be used regardless of the predicted target quantization index (QPIndex_T). This prevents the problem that the quantization index used for the main compression becomes an extremely small value even when the captured image is an image with a small number of high-frequency components and the compression rate is high.

以上、本発明に係る画像圧縮装置および電子カメラについて、各実施形態で例を挙げて説明してきたが、その精神またはその主要な特徴から逸脱することなく他の多様な形で実施することができる。そのため、上述した実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈してはならない。本発明は、特許請求の範囲によって示されるものであって、本発明は明細書本文にはなんら拘束されない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内である。   As described above, the image compression apparatus and the electronic camera according to the present invention have been described by way of examples in the respective embodiments, but can be implemented in various other forms without departing from the spirit or main features thereof. . Therefore, the above-described embodiment is merely an example in all respects and should not be interpreted in a limited manner. The present invention is defined by the claims, and the present invention is not limited to the text of the specification. Further, all modifications and changes belonging to the equivalent scope of the claims are within the scope of the present invention.

101・・・電子カメラ 102・・・光学系
103・・・メカニカルシャッタ 104・・・撮像素子
105・・・A/D変換部 106・・・画像バッファ
107・・・画像処理部 108・・・カメラ制御部
109・・・メモリ 110・・・表示部
111・・・操作部材
112・・・メモリカードIF(インターフェース)
112a・・・メモリカード 201・・・ホワイトバランス処理部
202・・・色補間処理部 203・・・エッジ強調処理部
204・・・圧縮処理部 205・・・固定長圧縮処理部
251・・・直交変換部 252・・・量子化部
253・・・エントロピー符号化部 261・・・目標圧縮率設定部
262・・・圧縮率調査部(容量調査部)
263・・・疑似量子化幅算出部 264・・・目標疑似量子化幅算出部
265・・・目標量子化インデックス算出部
DESCRIPTION OF SYMBOLS 101 ... Electronic camera 102 ... Optical system 103 ... Mechanical shutter 104 ... Image sensor 105 ... A / D conversion part 106 ... Image buffer 107 ... Image processing part 108 ... Camera control unit 109 ... Memory 110 ... Display unit 111 ... Operation member 112 ... Memory card IF (interface)
112a ... Memory card 201 ... White balance processing unit 202 ... Color interpolation processing unit 203 ... Edge enhancement processing unit 204 ... Compression processing unit 205 ... Fixed length compression processing unit 251 ... Orthogonal transformation unit 252 ... quantization unit 253 ... entropy coding unit 261 ... target compression rate setting unit 262 ... compression rate investigation unit (capacity investigation unit)
263 ... pseudo quantization width calculation unit 264 ... target pseudo quantization width calculation unit 265 ... target quantization index calculation unit

Claims (13)

圧縮対象画像データを入力する画像データ入力手段と、
ファイルサイズとの関係において画像データがほぼ直線的に変化する量子化的変化量を予め有し、所定の2つの量子化的変化量に対して前記圧縮対象画像データに対応するファイルサイズを求める第1演算手段と、
目標ファイルサイズを指定するファイルサイズ指定手段と、
前記第1演算手段で求めたファイルサイズと量子化的変化量との関係に基づき、前記圧縮対象画像データに関して前記目標ファイルサイズに対応する目標量子化的変化量を求める第2演算手段と、
前記量子化的変化量と量子化ステップとの関係を予め記憶する記憶手段と、
前記記憶手段に記憶した量子化的変化量と量子化ステップとの関係から、前記第2演算手段で求めた前記目標量子化的変化量に基づいて前記目標ファイルサイズに対応する量子化ステップを求め、この求めた量子化ステップを用いて前記圧縮対象画像データを圧縮する画像圧縮手段と、
を有することを特徴とする画像圧縮装置。
Image data input means for inputting image data to be compressed;
First, the image data has a quantized change amount that changes almost linearly in relation to the file size, and a file size corresponding to the compression target image data is obtained for two predetermined quantized change amounts. One computing means;
A file size specification means for specifying a target file size;
Second computing means for obtaining a target quantization change amount corresponding to the target file size for the compression target image data based on the relationship between the file size obtained by the first computation means and the quantization change amount;
Storage means for storing in advance the relationship between the quantization change amount and the quantization step;
From the relationship between the quantization change amount stored in the storage means and the quantization step, a quantization step corresponding to the target file size is obtained based on the target quantization change amount obtained by the second calculation means. Image compression means for compressing the image data to be compressed using the obtained quantization step;
An image compression apparatus comprising:
請求項1に記載の画像圧縮装置において、
前記所定の2つの量子化的変化量は、前記目標ファイルサイズに応じて設定されることを特徴とする画像圧縮装置。
The image compression apparatus according to claim 1.
2. The image compression apparatus according to claim 1, wherein the two predetermined quantization change amounts are set according to the target file size.
請求項1に記載の画像圧縮装置において、
前記第1演算手段は、前記目標ファイルサイズに応じて設定された1つの量子化的変化量に対するファイルサイズを求め、この求めたファイルサイズに応じて決定した、他の1つの量子化的変化量に対するファイルサイズを求めることを特徴とする画像圧縮装置。
The image compression apparatus according to claim 1.
The first computing means obtains a file size for one quantized change amount set according to the target file size, and another quantized change amount determined according to the obtained file size. An image compression apparatus for obtaining a file size for.
圧縮対象画像データを入力する画像データ入力手段と、
量子化インデックスと量子化的変化量との対応関係を記憶する記憶手段と、
指定された前記量子化インデックスで前記画像データを圧縮する圧縮手段と、
目標ファイルサイズを指定するファイルサイズ指定手段と、
前記圧縮手段により、前記画像データを、第1の量子化インデックスと第2の量子化インデックスとを用いて、それぞれ圧縮したときの第1のファイルサイズと第2のファイルサイズとを求めるテスト圧縮手段と、
前記量子化インデックスと量子化的変化量との対応関係を用いて、前記第1の量子化インデックスに対応する第1の量子化的変化量と、前記第2の量子化インデックスに対応する第2の量子化的変化量とを求める量子化的変化量算出手段と、
前記画像データの前記量子化的変化量と前記ファイルサイズとの関係を、前記第1の量子化的変化量と前記第1のファイルサイズ、および前記第2の量子化的変化量と前記第2のファイルサイズから求め、求めた関係によって、前記目標ファイルサイズでの目標量子化的変化量を求める目標量子化的変化量算出手段と、
前記量子化インデックスと量子化的変化量との対応関係を用いて、前記目標量子化的変化量から目標量子化インデックスを求める目標量子化インデックス算出手段と、
前記目標量子化インデックスで、前記圧縮手段により前記画像データを圧縮した圧縮画像データを出力する画像データ出力手段と
を有することを特徴とする画像圧縮装置。
Image data input means for inputting image data to be compressed;
Storage means for storing a correspondence relationship between the quantization index and the quantization change amount;
Compression means for compressing the image data with the specified quantization index;
A file size specification means for specifying a target file size;
Test compression means for obtaining a first file size and a second file size when the image data is compressed by using the first quantization index and the second quantization index, respectively, by the compression means. When,
Using the correspondence relationship between the quantization index and the quantization change amount, the first quantization change amount corresponding to the first quantization index and the second quantization index corresponding to the second quantization index. A quantization variation calculation means for obtaining a quantization variation of
The relationship between the quantized change amount of the image data and the file size is represented by the first quantized change amount, the first file size, the second quantized change amount, and the second size. A target quantization change amount calculating means for obtaining a target quantization change amount at the target file size according to the obtained relationship.
A target quantization index calculating means for obtaining a target quantization index from the target quantization change amount using a correspondence relationship between the quantization index and the quantization change amount;
An image data output device comprising: image data output means for outputting compressed image data obtained by compressing the image data by the compression means at the target quantization index.
請求項4に記載の画像圧縮装置において、
前記第1の量子化インデックスと前記第2の量子化インデックスとは、前記目標ファイルサイズに応じて設定されることを特徴とする画像圧縮装置。
The image compression apparatus according to claim 4.
The image compression apparatus according to claim 1, wherein the first quantization index and the second quantization index are set according to the target file size.
請求項4に記載の画像圧縮装置において、
前記テスト圧縮手段は、前記目標ファイルサイズに応じた第1の量子化インデックスを用いて、前記圧縮手段で1回目の圧縮を行って第1のファイルサイズを求め、前記第1のファイルサイズに応じて決定した第2の量子化インデックスを用いて、前記圧縮手段で2回目の圧縮を行って第2のファイルサイズを求める
ことを特徴とする画像圧縮装置。
The image compression apparatus according to claim 4.
The test compression unit obtains a first file size by performing a first compression by the compression unit using a first quantization index corresponding to the target file size, and according to the first file size An image compression apparatus characterized in that the second file size is obtained by performing a second compression by the compression means using the second quantization index determined in the above.
請求項4から6のいずれか一項に記載の画像圧縮装置において、
前記第1の量子化的変化量と前記第1のファイルサイズ、および前記第2の量子化的変化量と前記第2のファイルサイズの対数値の関係は略直線であることを特徴とする画像圧縮装置。
The image compression apparatus according to any one of claims 4 to 6,
The image is characterized in that the first quantized change amount and the first file size and the logarithmic value of the second quantized change amount and the second file size are substantially straight lines. Compression device.
請求項4から7のいずれか一項に記載の画像圧縮装置において、
前記量子化的変化量算出手段は、前記第1の量子化インデックスと前記第2の量子化インデックスとからそれぞれの第1の量子化的変化量の対数値と第2の量子化的変化量の対数値とを求め、
前記目標量子化的変化量算出手段は、前記第1の量子化的変化量の対数値および前記第2の量子化的変化量の対数値と前記第1のファイルサイズおよび前記第2のファイルサイズとの関係から前記目標ファイルサイズでの目標量子化的変化量の対数値を求め、
前記目標量子化インデックス算出手段は、前記目標量子化的変化量の対数値から目標量子化インデックスを求めることを特徴とする画像圧縮装置。
The image compression apparatus according to any one of claims 4 to 7,
The quantization change amount calculation means calculates a logarithmic value of each first quantization change amount and a second quantization change amount from the first quantization index and the second quantization index. Logarithm value and
The target quantization change amount calculating means includes a logarithmic value of the first quantization change amount, a logarithmic value of the second quantization change amount, the first file size, and the second file size. The logarithmic value of the target quantization change amount at the target file size is obtained from the relationship with
The target quantization index calculating unit obtains a target quantization index from a logarithmic value of the target quantization change amount.
圧縮対象画像データを入力する画像データ入力手段と、
量子化インデックスと量子化的変化量との対応関係を記憶する記憶手段と、
指定された前記量子化インデックスで前記画像データを圧縮する圧縮手段と、
前記圧縮手段の目標ファイルサイズを設定する目標ファイルサイズ設定手段と、
前記圧縮手段により、前記画像データを、第1の量子化インデックスで圧縮したときの第1のファイルサイズを求めるテスト圧縮手段と、
前記量子化インデックスと量子化的変化量との対応関係を用いて、前記第1の量子化インデックスに対応する第1の量子化的変化量を求める量子化的変化量算出手段と、
前記画像データの前記量子化的変化量と前記ファイルサイズとの関係を、前記第1の量子化的変化量と前記第1のファイルサイズ、および予め設定された初期量子化的変化量と、前記初期量子化的変化量に対応する初期ファイルサイズから求め、求めた関係によって、前記目標ファイルサイズでの目標量子化的変化量を求める目標量子化的変化量算出手段と、
前記量子化インデックスと量子化的変化量との対応関係を用いて、前記目標量子化的変化量から目標量子化インデックスを求める目標量子化インデックス算出手段と、
前記目標量子化インデックスで、前記圧縮手段により前記画像データを圧縮した圧縮画像データを出力する画像データ出力手段と
を有することを特徴とする画像圧縮装置。
Image data input means for inputting image data to be compressed;
Storage means for storing a correspondence relationship between the quantization index and the quantization change amount;
Compression means for compressing the image data with the specified quantization index;
Target file size setting means for setting a target file size of the compression means;
A test compression means for obtaining a first file size when the image data is compressed with a first quantization index by the compression means;
Using a correspondence relationship between the quantization index and the quantization change amount, a quantization change amount calculating unit for obtaining a first quantization change amount corresponding to the first quantization index;
The relationship between the quantized change amount of the image data and the file size, the first quantized change amount and the first file size, and a preset initial quantized change amount, A target quantized change amount calculating means for determining a target quantized change amount at the target file size according to a relationship obtained from an initial file size corresponding to the initial quantized change amount;
A target quantization index calculating means for obtaining a target quantization index from the target quantization change amount using a correspondence relationship between the quantization index and the quantization change amount;
An image data output device comprising: image data output means for outputting compressed image data obtained by compressing the image data by the compression means at the target quantization index.
請求項9に記載の画像圧縮装置において、
前記第1の量子化インデックスは前記目標ファイルサイズに応じて設定されることを特徴とする画像圧縮装置。
The image compression apparatus according to claim 9.
The image compression apparatus according to claim 1, wherein the first quantization index is set according to the target file size.
請求項9または10に記載の画像圧縮装置において、
前記第1の量子化的変化量と前記第1のファイルサイズ、および前記初期量子化的変化量の対数値と前記初期ファイルサイズの対数値の関係は略直線である
ことを特徴とする画像圧縮装置。
The image compression apparatus according to claim 9 or 10,
The first compression change amount and the first file size, and the logarithmic value of the initial quantization change amount and the logarithmic value of the initial file size are substantially straight lines. apparatus.
請求項9から11のいずれか一項に記載の画像圧縮装置において、
前記量子化的変化量算出手段は、前記第1の量子化インデックスから第1の量子化的変化量の対数値を求め、
前記目標量子化的変化量算出手段は、前記第1の量子化的変化量の対数値および予め設定された初期量子化的変化量の対数値と前記第1のファイルサイズおよび前記初期量子化的変化量の対数値に対応する初期ファイルサイズとの関係から目標ファイルサイズでの目標量子化的変化量の対数値を求め、
前記目標量子化インデックス算出手段は、前記目標量子化的変化量の対数値から目標量子化インデックスを求める
ことを特徴とする画像圧縮装置。
The image compression apparatus according to any one of claims 9 to 11,
The quantization change amount calculating means obtains a logarithmic value of the first quantization change amount from the first quantization index,
The target quantization change amount calculation means includes a logarithmic value of the first quantization change amount, a logarithm value of a preset initial quantization change amount, the first file size, and the initial quantization value. Obtain the logarithmic value of the target quantized change amount at the target file size from the relationship with the initial file size corresponding to the logarithmic value of the change amount,
The target compression index calculating unit obtains a target quantization index from a logarithmic value of the target quantization change amount.
請求項1から12のいずれか一項に記載の画像圧縮装置を有することを特徴とする電子カメラ。   An electronic camera comprising the image compression apparatus according to claim 1.
JP2009264770A 2009-11-20 2009-11-20 Image compression apparatus and electronic camera Active JP5493761B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009264770A JP5493761B2 (en) 2009-11-20 2009-11-20 Image compression apparatus and electronic camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009264770A JP5493761B2 (en) 2009-11-20 2009-11-20 Image compression apparatus and electronic camera

Publications (2)

Publication Number Publication Date
JP2011109573A true JP2011109573A (en) 2011-06-02
JP5493761B2 JP5493761B2 (en) 2014-05-14

Family

ID=44232543

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009264770A Active JP5493761B2 (en) 2009-11-20 2009-11-20 Image compression apparatus and electronic camera

Country Status (1)

Country Link
JP (1) JP5493761B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0898175A (en) * 1994-09-21 1996-04-12 Nec Corp Picture encoding device
JPH1023413A (en) * 1996-07-03 1998-01-23 Fuji Xerox Co Ltd Encoding device
JPH1028266A (en) * 1997-04-07 1998-01-27 Nec Corp Image encoding device
JPH11127354A (en) * 1997-10-20 1999-05-11 Casio Comput Co Ltd Image encoding method and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0898175A (en) * 1994-09-21 1996-04-12 Nec Corp Picture encoding device
JPH1023413A (en) * 1996-07-03 1998-01-23 Fuji Xerox Co Ltd Encoding device
JPH1028266A (en) * 1997-04-07 1998-01-27 Nec Corp Image encoding device
JPH11127354A (en) * 1997-10-20 1999-05-11 Casio Comput Co Ltd Image encoding method and storage medium

Also Published As

Publication number Publication date
JP5493761B2 (en) 2014-05-14

Similar Documents

Publication Publication Date Title
EP1925150B1 (en) Image encoding apparatus and image encoding method
JP4979655B2 (en) Image coding apparatus and control method thereof
US20080285866A1 (en) Apparatus and method for image data compression
JP5507515B2 (en) Non-reversible compression apparatus, operation control method thereof, and operation control program thereof
TWI407794B (en) Data compression method and data compression system
US20170359471A1 (en) Imaging apparatus
JP6792351B2 (en) Encoding device, imaging device, coding method, and program
TWI421798B (en) Method and apparatus for image compression bit rate control
JP6685198B2 (en) Imaging device, control method thereof, and program
US10930018B2 (en) Quantizer determination, computer-readable medium and apparatus that implements at least two quantizers
JPH09247675A (en) Image compression method and image compression system
JP4183432B2 (en) Image data encoding method
JP5493761B2 (en) Image compression apparatus and electronic camera
US20060008167A1 (en) Digital camera having picture quality setting
US7116832B2 (en) Method of compressing digital images
TWI390959B (en) Video signal processing device, video signal processing method and video signal processing program
JP2010074263A (en) Image compression apparatus
JP3919426B2 (en) Image encoding apparatus and method, and storage medium
JP4631629B2 (en) Electronic camera and image processing program
Richter Evaluation of floating point image compression
JP6486120B2 (en) Encoding apparatus, encoding apparatus control method, and program
JP3752931B2 (en) Digital camera and image data processing method
JPH1066004A (en) Picture file size controller
JPH09219807A (en) Digital still camera
JP4262144B2 (en) Image coding apparatus and method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121029

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140129

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140217

R150 Certificate of patent or registration of utility model

Ref document number: 5493761

Country of ref document: JP

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

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250