JP2008312193A - Image data compressing device, image data compressing method, and program - Google Patents

Image data compressing device, image data compressing method, and program Download PDF

Info

Publication number
JP2008312193A
JP2008312193A JP2008049599A JP2008049599A JP2008312193A JP 2008312193 A JP2008312193 A JP 2008312193A JP 2008049599 A JP2008049599 A JP 2008049599A JP 2008049599 A JP2008049599 A JP 2008049599A JP 2008312193 A JP2008312193 A JP 2008312193A
Authority
JP
Japan
Prior art keywords
image data
compression
jpeg
data
quantization
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.)
Pending
Application number
JP2008049599A
Other languages
Japanese (ja)
Inventor
Takashi Ishikawa
隆志 石川
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.)
Olympus Imaging Corp
Original Assignee
Olympus Imaging 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 Olympus Imaging Corp filed Critical Olympus Imaging Corp
Priority to JP2008049599A priority Critical patent/JP2008312193A/en
Priority to US12/113,548 priority patent/US20080285866A1/en
Priority to CN2008100965466A priority patent/CN101309414B/en
Publication of JP2008312193A publication Critical patent/JP2008312193A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image data compressing device, an image data compressing method, and program, for quickly recording JPEG data. <P>SOLUTION: The image data compressing device comprises a RAW compression processing part 57 for detecting high frequency component of image data, a JPEG parameter setting part 56 for calculating characteristic data (entropy) representing appearance frequency distribution of high frequency components, a JPEG parameter setting part 56 which calculates, based on the characteristic data, the coding amount predicted when an image data is compressed based on a first quantifying table, a JPEG parameter setting part 56 which calculates a second quantifying table for acquiring a target coding amount to be finally obtained at the RAW compression processing part 57, based on the target coding amount and predicted coding amount, and a JPEG processing part 53 for JPEG compression process based on the second quantifying table. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像データ圧縮装置、画像データ圧縮方法およびプログラムに関する。   The present invention relates to an image data compression apparatus, an image data compression method, and a program.

一眼レフデジタルカメラ等の撮像装置の一部において、可逆圧縮されたRAW画像データと非可逆圧縮されたJPEGデータを同時に記録できる撮像モードが設けられている。この撮影モードにおける画像データの記録には、RAWデータの圧縮処理と共に、JPEG符号化処理も行なう必要がある。JPEG符号化処理に時間がかかるシステムにおいては、このJPEG処理時間が記録時間のネックとなる可能性が高い。また、画質を落とさずに、JPEG符号量を一定量以下にするためには、符号化処理を複数回行なう必要もあり、これらの事情により、記録までの処理時間がかかってしまうという問題があった。   Some imaging devices such as single-lens reflex digital cameras are provided with an imaging mode capable of simultaneously recording reversibly compressed RAW image data and irreversibly compressed JPEG data. In order to record image data in this shooting mode, it is necessary to perform JPEG encoding processing as well as RAW data compression processing. In a system where JPEG encoding processing takes time, there is a high possibility that this JPEG processing time will become a bottleneck in recording time. In addition, in order to keep the JPEG code amount below a certain amount without degrading the image quality, it is necessary to perform the encoding process a plurality of times. Due to these circumstances, there is a problem that it takes a processing time until recording. It was.

そこで、RAW画像データとJPEGデータを同時記録する場合に、処理時間がかかるのを解決するために、特許文献1には、JPEGファイルとRAWデータに格納するJPEG画像を共通にすることにより、JPEG処理回数を減らすようにした撮像装置が開示されている。
特開2006−229474号公報
Therefore, in order to solve the problem that processing time is required when RAW image data and JPEG data are recorded at the same time, Patent Document 1 discloses that JPEG files and JPEG images stored in RAW data are used in common. An imaging apparatus is disclosed in which the number of processing times is reduced.
JP 2006-229474 A

特許文献1によれば、一回の撮影動作で記録用のJPEG画像と表示用JPEGデータをそれぞれ生成する必要をなくすことができる。しかしながら、JPEG符号化処理にあたって、所定のデータサイズに圧縮するには、複数回繰り返す必要があり、JPEGデータの記録を高速化することができない。   According to Patent Document 1, it is possible to eliminate the need to generate a JPEG image for recording and JPEG data for display in a single shooting operation. However, in JPEG encoding processing, in order to compress the data to a predetermined data size, it is necessary to repeat a plurality of times, and JPEG data recording cannot be accelerated.

本発明は、このような事情を鑑みてなされたものであり、JPEGデータの記録を高速化するようにした画像データ圧縮装置、画像データ圧縮方法およびプログラムを提供することを目的とする。   The present invention has been made in view of such circumstances, and an object of the present invention is to provide an image data compression apparatus, an image data compression method, and a program capable of speeding up the recording of JPEG data.

上記目的を達成するため第1の発明に係わる画像データ圧縮装置は、画像データの高周波成分を検出する画像処理部と、上記高周波成分の出現頻度分布を表す特徴データを算出する演算部と、上記画像データを第1の量子化テーブルに基づいて圧縮したと仮定したときの予測符号量を、上記特徴データをもとに演算する符号量予測部と、
上記圧縮処理部で最終的に得たい目標符号量を得るための第2の量子化テーブルを、上記目標符号量と上記予測符号量に基づいて算出する量子化テーブル生成部と、上記第2の量子化テーブルに基づいてJPEG圧縮処理を行なうJPEG圧縮部を備える。
In order to achieve the above object, an image data compression apparatus according to a first invention includes an image processing unit that detects a high frequency component of image data, a calculation unit that calculates feature data representing an appearance frequency distribution of the high frequency component, A code amount prediction unit that calculates a prediction code amount when it is assumed that the image data is compressed based on the first quantization table, based on the feature data;
A quantization table generating unit that calculates a second quantization table for obtaining a target code amount to be finally obtained by the compression processing unit based on the target code amount and the predicted code amount; and A JPEG compression unit that performs JPEG compression processing based on the quantization table is provided.

第2の発明に係わる画像データ圧縮装置は、上記第1の発明において、上記画像処理部における上記高周波成分は、近隣画素間の画像データの差分値である。
また、第3の発明に係わる画像データ圧縮装置は、上記第1の発明において、上記演算部で演算する上記特徴データは、高周波成分の大きさを表すパラメータをi、該パラメータiに対応する出現頻度をPiとするとき
−ΣPi・LogPi
で表される。
In the image data compression apparatus according to the second invention, in the first invention, the high-frequency component in the image processing unit is a difference value of image data between neighboring pixels.
In the image data compression apparatus according to a third aspect of the present invention, in the first aspect, the feature data calculated by the calculation unit is a parameter i representing the magnitude of a high frequency component, and an appearance corresponding to the parameter i. When frequency is Pi
-ΣPi ・ LogPi
It is represented by

また、第4の発明に係わる画像データ圧縮装置は、上記第1の発明において、上記特徴データをErawとし、第1の量子化テーブルをもとに上記JPEG圧縮処理を行ったときの予測符号量をDjpegとし、A、B、C、D,Eをそれぞれ定数としたとき、
Djpeg = A × Eraw + B
または、
Djpeg = C × Eraw2 + D×Eraw + E
の相関関係がある。
According to a fourth aspect of the present invention, there is provided an image data compression apparatus according to the first aspect, wherein the feature data is Eraw, and the predicted code amount when the JPEG compression processing is performed based on the first quantization table. Is Djpeg, and A, B, C, D, and E are constants.
Djpeg = A x Eraw + B
Or
Djpeg = C x Eraw2 + D x Eraw + E
There is a correlation.

また、第5の発明に係わる画像データ圧縮装置は、上記第1の発明において、上記第1の量子化テーブルをもとに上記JPEG圧縮処理を行ったときの予測符号量をDjpegとし、量子化パラメータをNとし、F、Gを定数とし、上記量子化パラメータNをもとに上記JPEG圧縮処理を行ったときの目標符号量をDtargetとしたとき、
Dtarget=Djpeg ×(F×2−N+ G)
で表され、且つ、上記第1の量子化テーブルをQ1、上記第2の量子化テーブルの値をQ2、Nを量子化パラメータとするとき、
Q2=Q1×2−N
で表される。
An image data compression apparatus according to a fifth aspect of the present invention is the image data compression apparatus according to the first aspect, wherein the predicted code amount when the JPEG compression process is performed based on the first quantization table is Djpeg, and the quantization is performed. When the parameter is N, F and G are constants, and the target code amount when the JPEG compression processing is performed based on the quantization parameter N is Dtarget,
Dtarget = Djpeg × (F × 2- N + G)
And the first quantization table is Q1, the value of the second quantization table is Q2, and N is a quantization parameter,
Q2 = Q1 × 2- N
It is represented by

また、第6の発明に係わる画像データ圧縮装置は、上記第1の発明において、上記画像データ圧縮装置は、さらに、RAWデータの符号化を行ない可変長符号化データを生成する可変長符号化部を有することを特徴とする。   The image data compression apparatus according to a sixth aspect of the present invention is the image data compression apparatus according to the first aspect, wherein the image data compression apparatus further encodes RAW data to generate variable length encoded data. It is characterized by having.

上記目的を達成するための第7の発明に係わる画像データ圧縮方法は、画像データの高周波成分を検出するステップと、上記高周波成分の出現頻度分布を表す特徴データを算出するステップと、上記画像データを第1の量子化テーブルに基づいて圧縮したと仮定したときの予測符号量を、上記特徴データをもとに演算するステップと、上記圧縮処理部で最終的に得たい目標符号量を得るための第2の量子化テーブルを、上記目標符号量と上記予測符号量に基づいて算出するステップと、上記第2の量子化テーブルに基づいてJPEG圧縮処理を行なうステップとからなる。   An image data compression method according to a seventh aspect of the invention for achieving the above object comprises a step of detecting a high frequency component of the image data, a step of calculating feature data representing an appearance frequency distribution of the high frequency component, and the image data To calculate a prediction code amount based on the feature data, and to obtain a target code amount to be finally obtained by the compression processing unit. The second quantization table is calculated based on the target code amount and the predicted code amount, and JPEG compression processing is performed based on the second quantization table.

上記目的を達成するための第8の発明に係わるコンピュータに実行させる画像データ圧縮プログラムは、画像データの高周波成分を検出するステップと、上記高周波成分の出現頻度分布を表す特徴データを算出するステップと、上記画像データを第1の量子化テーブルに基づいて圧縮したと仮定したときの予測符号量を、上記特徴データをもとに演算するステップと、上記圧縮処理部で最終的に得たい目標符号量を得るための第2の量子化テーブルを、上記目標符号量と上記予測符号量に基づいて算出するステップと、上記第2の量子化テーブルに基づいてJPEG圧縮処理を行なうステップとからなる。   An image data compression program to be executed by a computer according to an eighth invention for achieving the above object comprises a step of detecting a high frequency component of the image data, and a step of calculating feature data representing an appearance frequency distribution of the high frequency component. , A step of calculating a prediction code amount when it is assumed that the image data is compressed based on the first quantization table based on the feature data, and a target code to be finally obtained by the compression processing unit The method includes a step of calculating a second quantization table for obtaining the amount based on the target code amount and the predicted code amount, and a step of performing JPEG compression processing based on the second quantization table.

上記目的を達成するため第9の発明に係わる画像データ圧縮装置は、隣接画素の画像データ間の差分値に基づいて可変長符号化により、画像データの圧縮を行なうと共に、画像圧縮に関する圧縮情報を求めるRAW圧縮処理部と、上記圧縮情報に基づいて目標とするデータサイズにするために量子化を行うための量子化パラメータと、この量子化パラメータにより量子化したデータをハフマン符号化するためのハフマンテーブルを設定するJPEGパラメータ設定部と、画像データを上記量子化パラメータと上記ハフマンテーブルに基づいてJPEG圧縮処理を行なうJPEG処理部を具備する。   To achieve the above object, an image data compression apparatus according to a ninth aspect of the present invention compresses image data by variable length coding based on a difference value between image data of adjacent pixels, and stores compression information related to image compression. A RAW compression processing unit to be obtained; a quantization parameter for performing quantization to obtain a target data size based on the compression information; and a Huffman for encoding data quantized by the quantization parameter. A JPEG parameter setting unit for setting a table; and a JPEG processing unit for performing JPEG compression processing on image data based on the quantization parameter and the Huffman table.

第10の発明に係わる画像データ圧縮装置は、上記第9の発明において、上記圧縮情報は、上記差分値の出現頻度値を基に算出したエントロピーである。   In the image data compression apparatus according to a tenth aspect, in the ninth aspect, the compression information is entropy calculated based on the appearance frequency value of the difference value.

上記目的を達成するため第11の発明に係わる画像データ圧縮装置は、画像データを可逆的に圧縮すると共に、画像圧縮に関する圧縮情報を求めるRAW圧縮処理部と、画像データを非可逆的に圧縮する非可逆圧縮処理部と、上記圧縮情報に基づいて目標とするデータサイズとなるパラメータを求めるパラメータ算出部を具備する。   To achieve the above object, an image data compression apparatus according to an eleventh aspect of the present invention reversibly compresses image data, and RAW compression processing unit for obtaining compression information related to image compression, and irreversibly compresses image data. And an irreversible compression processing unit and a parameter calculation unit for obtaining a parameter having a target data size based on the compression information.

第12の発明に係わる画像データ圧縮装置は、上記第11の発明において、上記圧縮情報に基づいてエントロピーを算出し、このエントロピーと上記非可逆圧縮処理によるデータサイズの相関関係から目標とするデータサイズとなる上記パラメータを求める。
第13の発明に係わる画像データ圧縮装置は、上記第11の発明において、上記エントロピーは、上記画像データの高周波成分の出現頻度値を基に算出したデータであることを特徴とする。
An image data compression apparatus according to a twelfth aspect of the present invention is the image data compression apparatus according to the eleventh aspect of the invention, wherein entropy is calculated based on the compression information, and a target data size is obtained from the correlation between the entropy and the data size obtained by the irreversible compression processing. The above parameters are obtained.
An image data compression apparatus according to a thirteenth invention is characterized in that, in the eleventh invention, the entropy is data calculated based on an appearance frequency value of a high frequency component of the image data.

上記目的を達成するため第14の発明に係わる画像データ圧縮方法は、隣接画素の画像データ間の差分値に基づいて可変長符号化により、画像データの圧縮を行なうと共に、画像圧縮に関する圧縮情報を求めるステップと、上記圧縮情報に基づいて目標とするデータサイズにするために量子化を行うための量子化パラメータと、この量子化パラメータにより量子化したデータをハフマン符号化するためのハフマンテーブルを設定するステップと、画像データを上記量子化パラメータと上記ハフマンテーブルに基づいてJPEG圧縮処理を行なうステップとからなる。   In order to achieve the above object, an image data compression method according to a fourteenth aspect of the present invention compresses image data by variable length coding based on a difference value between image data of adjacent pixels, and stores compression information related to image compression. A step for obtaining, a quantization parameter for performing quantization to obtain a target data size based on the compression information, and a Huffman table for performing Huffman coding on the data quantized by the quantization parameter are set. And a step of performing JPEG compression processing on the image data based on the quantization parameter and the Huffman table.

上記目的を達成するための第15の発明に係わるコンピュータに実行させる画像データ圧縮プログラムは、隣接画素の画像データ間の差分値に基づいて可変長符号化により、画像データの圧縮を行なうと共に、画像圧縮に関する圧縮情報を求めるステップと、上記圧縮情報に基づいて目標とするデータサイズにするために量子化を行うための量子化パラメータと、この量子化パラメータにより量子化したデータをハフマン符号化するためのハフマンテーブルを設定するステップと、画像データを上記量子化パラメータと上記ハフマンテーブルに基づいてJPEG圧縮処理を行なうステップとからなる。   An image data compression program to be executed by a computer according to the fifteenth invention for achieving the above object compresses image data by variable length encoding based on a difference value between image data of adjacent pixels, and A step of obtaining compression information relating to compression, a quantization parameter for performing quantization to obtain a target data size based on the compression information, and Huffman coding of data quantized by the quantization parameter The Huffman table is set, and the image data is subjected to JPEG compression processing based on the quantization parameter and the Huffman table.

本発明によれば、JPEGデータの記録を高速化するようにした画像データ圧縮装置、画像データ圧縮方法およびプログラムを提供することができる。   According to the present invention, it is possible to provide an image data compression apparatus, an image data compression method, and a program that can speed up the recording of JPEG data.

以下、図面に従って本発明を適用したデジタル一眼レフカメラを用いて好ましい一実施形態について説明する。本実施形態に係わるデジタル一眼レフカメラは、被写体の構図を決め、被写体像を撮像すると、画像データについて種々の画像処理を行なってから画像記録媒体に記録を行う。また、画像記録のモードとして、JPEGによる非可逆圧縮処理と、RAWによる可逆圧縮処理を行い、非可逆圧縮および可逆圧縮の両方の圧縮処理による画像データを記録する撮影モードが選択可能となっている。   Hereinafter, a preferred embodiment using a digital single lens reflex camera to which the present invention is applied will be described with reference to the drawings. The digital single-lens reflex camera according to the present embodiment determines the composition of the subject and captures the subject image, and then performs various image processing on the image data before recording it on the image recording medium. In addition, as an image recording mode, it is possible to select a shooting mode in which irreversible compression processing by JPEG and reversible compression processing by RAW are performed and image data is recorded by both irreversible compression and lossless compression processing. .

本実施形態におけるデジタル一眼レフカメラの電気的構成を、図1を用いて説明する。被写体像を結像させるためのズームレンズ系1がカメラ本体に取り付けられている。このズームレンズ系1の焦点距離は可変であり、モータ等を備えるレンズ駆動部9によって焦点距離と焦点位置の調節ための駆動がなされる。   The electrical configuration of the digital single-lens reflex camera in this embodiment will be described with reference to FIG. A zoom lens system 1 for forming a subject image is attached to the camera body. The focal length of the zoom lens system 1 is variable, and driving for adjusting the focal length and the focal position is performed by a lens driving unit 9 having a motor or the like.

ズームレンズ系1の光軸上であって、被写体像の結像位置付近に、撮像素子3が配置されている。この撮像素子3は被写体像を光電変換し、画像信号を出力する。撮像素子3の出力は、画像信号の読み出しや、増幅処理等の信号処理を行う撮像回路5に接続されており、この撮像回路5の出力は、画像信号のAD変換を行なうアナログデジタル(A/D)変換器7に接続されている。   An image sensor 3 is arranged on the optical axis of the zoom lens system 1 and in the vicinity of the imaging position of the subject image. The image sensor 3 photoelectrically converts the subject image and outputs an image signal. The output of the imaging device 3 is connected to an imaging circuit 5 that performs signal processing such as readout of image signals and amplification processing, and the output of the imaging circuit 5 is analog / digital (A / A) that performs AD conversion of the image signals. D) Connected to the converter 7.

A/D変換器7はデータバス10に接続されており、このデータバス10には、RAM(Random Access Memory)11、ROM(Read Only Memory)13、ASIC(Application Specific Integrated Circuit:特定用途向け集積回路)15、システムコントローラー20、ドライブコントローラー31、外部I/F(インターフェース)37、ビデオエンコーダー41、LCD(Liquid Crystal Display:液晶ディスプレイ)ドライバ45が、それぞれ接続されている。RAM11は電気的に書き換え可能なメモリであり、一時的にデータの記憶を行なう。ROM13は電気的に書き換え可能な不揮発性メモリであり、デジタル一眼レフカメラの制御を行うためのプログラムや各種調整値等が記憶されている。   The A / D converter 7 is connected to a data bus 10, which includes a RAM (Random Access Memory) 11, a ROM (Read Only Memory) 13, an ASIC (Application Specific Integrated Circuit). Circuit) 15, system controller 20, drive controller 31, external I / F (interface) 37, video encoder 41, and LCD (Liquid Crystal Display) driver 45 are connected to each other. The RAM 11 is an electrically rewritable memory, and temporarily stores data. The ROM 13 is an electrically rewritable nonvolatile memory, and stores a program for controlling the digital single lens reflex camera, various adjustment values, and the like.

ASIC15は、画像処理、JPEG圧縮伸張処理やRAW圧縮処理等の各種処理を行なうためのハードウエアであり、システムコントローラー20に接続されている。ASIC15における画像圧縮の処理について、図2を用いて後述する。システムコントローラー20は、CPU(Central Processing Unit)等によって構成され、ROM13に記憶されているプログラムに従って、このデジタル一眼レフカメラの全体制御を行う。   The ASIC 15 is hardware for performing various processing such as image processing, JPEG compression / decompression processing, and RAW compression processing, and is connected to the system controller 20. The image compression processing in the ASIC 15 will be described later with reference to FIG. The system controller 20 is configured by a CPU (Central Processing Unit) or the like, and performs overall control of the digital single-lens reflex camera according to a program stored in the ROM 13.

システムコントローラー20は、レンズ駆動制御回路21、ストロボ発光部23、操作部25および電源部27に接続されており、これらの回路等の制御を行う。レンズ駆動制御回路21は、前述したレンズ駆動部9の駆動制御を行い、ズームレンズ系1の焦点距離やピント合わせ動作を行う。ストロボ発光部23は、システムコントローラー20からの制御信号に従って被写体に向けて照明光を投射する。   The system controller 20 is connected to the lens drive control circuit 21, the strobe light emission unit 23, the operation unit 25, and the power supply unit 27, and controls these circuits and the like. The lens drive control circuit 21 performs drive control of the lens drive unit 9 described above, and performs a focal length and a focusing operation of the zoom lens system 1. The strobe light emitting unit 23 projects illumination light toward the subject according to a control signal from the system controller 20.

操作部25は、電源スイッチや、レリーズ釦に連動する1stレリーズスイッチや2ndレリーズスイッチ、撮影モードスイッチ、メニュースイッチ、カーソル等を移動させる十字キー等の各種操作部材に連動するスイッチを含んでおり、撮影者による各種設定やレリーズ動作等を検出する。電源部27は、デジタル一眼レフカメラの動作に必要な電源を供給し、電源電池や電圧制御回路等を含む。また、電源部27には、商用電源やバッテリパック等の外部電源の供給を受けるための外部電源入力端子29が設けられている。   The operation unit 25 includes a power switch, a 1st release switch linked to the release button, a 2nd release switch, a shooting mode switch, a menu switch, a switch linked to various operation members such as a cross key for moving a cursor, and the like. Detects various settings and release operations by the photographer. The power supply unit 27 supplies power necessary for the operation of the digital single lens reflex camera, and includes a power supply battery, a voltage control circuit, and the like. The power supply unit 27 is provided with an external power supply input terminal 29 for receiving supply of external power such as a commercial power supply or a battery pack.

前述のデータバス10には、ドライブコントローラー31が接続されており、このドライブコントローラー31には、ディスクドライブ33が接続されている。ディスクドライブ33には、記録媒体35が装填可能である。この記録媒体35は、ASIC15等で画像処理された画像データを記録するための媒体であり、ドライブコントローラー31によってディスクドライブ33の記録制御を行う。   A drive controller 31 is connected to the data bus 10 described above, and a disk drive 33 is connected to the drive controller 31. A recording medium 35 can be loaded in the disk drive 33. The recording medium 35 is a medium for recording image data that has been subjected to image processing by the ASIC 15 or the like, and performs recording control of the disk drive 33 by the drive controller 31.

データバス10には外部I/F37が接続されており、この外部I/F37は外部入出力端子39に接続されている。外部I/F37は、パーソナルコンピュータ(PC)等の外部機器と画像データやその他のデータのやり取りを行なうためのインターフェースである。   An external I / F 37 is connected to the data bus 10, and this external I / F 37 is connected to an external input / output terminal 39. The external I / F 37 is an interface for exchanging image data and other data with an external device such as a personal computer (PC).

また、データバス10には、ビデオエンコーダー41が接続されており、このビデオエンコーダー41には、ビデオアウト43とLCDドライバ45が接続されている。このビデオエンコーダー41は、RAM11や記録媒体35に記憶されている画像データに基づいて表示用等の画像データに変換するための変換器であり、ここで変換された画像データはビデオアウト43を介して外部に出力されると共に、LCDドライバ45によってLCD47に表示を行なう。LCD47はデジタル一眼レフカメラの背面等に配置され、RAM11や記録媒体35に記憶されている被写体像を表示する他、操作部25によって設定された各種撮影モードや制御値等の表示も行う。   In addition, a video encoder 41 is connected to the data bus 10, and a video out 43 and an LCD driver 45 are connected to the video encoder 41. The video encoder 41 is a converter for converting into image data for display based on the image data stored in the RAM 11 or the recording medium 35, and the converted image data is transmitted via the video out 43. Are output to the outside and displayed on the LCD 47 by the LCD driver 45. The LCD 47 is arranged on the back surface of the digital single-lens reflex camera, and displays the subject images stored in the RAM 11 and the recording medium 35 and also displays various shooting modes and control values set by the operation unit 25.

次に、ASIC15内におけるRAW圧縮とJPEG圧縮について、図2を用いて説明する。撮像素子3から出力される画像信号はA/D変換器7によってデジタル形式のRAWデータ(画像データ)に変換され、データバス10を介してASIC15に入力される。図2に示す圧縮のためのブロックは、RAW圧縮処理を行なうパス1と、JPEG処理を行なうためのパス2とからなる。   Next, RAW compression and JPEG compression in the ASIC 15 will be described with reference to FIG. The image signal output from the image sensor 3 is converted into digital RAW data (image data) by the A / D converter 7 and input to the ASIC 15 via the data bus 10. The block for compression shown in FIG. 2 includes path 1 for performing RAW compression processing and path 2 for performing JPEG processing.

RAWデータ入力部は、パス2を構成する画像処理部51に接続され、この画像処理部51の出力はJPEG処理部53に接続されている。また、RAWデータ入力部はパス1を構成するRAW圧縮処理部57にも接続され、RAW圧縮処理部57の出力は、JPEGパラメータ設定部56に接続されている。前述のJPEG処理部53には、JPEGパラメータ設定部56の出力が接続されている。これらの画像処理部51、JPEG処理部53、JPEGパラメータ設定部56およびRAW圧縮処理部57は、ハードウエア回路で構成されている。   The RAW data input unit is connected to the image processing unit 51 constituting the path 2, and the output of the image processing unit 51 is connected to the JPEG processing unit 53. The RAW data input unit is also connected to the RAW compression processing unit 57 constituting the path 1, and the output of the RAW compression processing unit 57 is connected to the JPEG parameter setting unit 56. The JPEG processing unit 53 is connected to the output of the JPEG parameter setting unit 56. The image processing unit 51, JPEG processing unit 53, JPEG parameter setting unit 56, and RAW compression processing unit 57 are configured by hardware circuits.

パス1のRAW圧縮処理部57は、入力したRAW画像データを可逆圧縮処理し、圧縮処理の際に、隣接画素との差分値を求め、これより差分値の出現頻度分布を表す特徴データを算出する。このRAW圧縮処理部57の詳細については、図4および図5を用いて後述する。RAW圧縮処理部57の出力端からRAW圧縮データが出力され、また前述した特徴データがJPEGパラメータ設定部56に出力される。このJPEGパラメータ設定部56は、特徴データを用いて、JPEGパラメータを設定し、これをJPEG処理部53に出力する。このJPEGパラメータ設定部56の詳細については、図6ないし図8を用いて後述する。   The RAW compression processing unit 57 in pass 1 performs reversible compression processing on the input RAW image data, obtains a difference value with an adjacent pixel at the time of compression processing, and calculates feature data representing an appearance frequency distribution of the difference value from this. To do. Details of the RAW compression processing unit 57 will be described later with reference to FIGS. 4 and 5. RAW compressed data is output from the output end of the RAW compression processing unit 57, and the above-described feature data is output to the JPEG parameter setting unit 56. The JPEG parameter setting unit 56 sets JPEG parameters using the feature data, and outputs them to the JPEG processing unit 53. Details of the JPEG parameter setting unit 56 will be described later with reference to FIGS.

パス2の画像処理部51は、入力したRAW画像データについて、ホワイトバランス等の補正や、YC変換等の画像処理を行う。画像処理部51の詳細については、図9を用いて後述する。JPEG処理部53は、JPEG方式によって画像データを非可逆圧縮処理するための回路であり、JPEG圧縮を行なう際に、JPEGパラメータ設定部56から出力される圧縮パラメータを用いて圧縮を行なう。このJPEG処理部53の詳細については、図10を用いて後述する。   The image processing unit 51 in pass 2 performs correction such as white balance and image processing such as YC conversion on the input RAW image data. Details of the image processing unit 51 will be described later with reference to FIG. The JPEG processing unit 53 is a circuit for irreversibly compressing image data by the JPEG method, and performs compression using the compression parameter output from the JPEG parameter setting unit 56 when performing JPEG compression. Details of the JPEG processing unit 53 will be described later with reference to FIG.

上述のパス1のRAW圧縮処理部57からRAW圧縮データが出力され、またパス2のJPEG処理部53からJPEG圧縮データが出力される。すなわち、図2に示す回路により、撮像素子3の出力に基づくRAWデータは、非可逆圧縮されJPEG圧縮データとして出力され、また可逆圧縮されRAW圧縮データとして出力される。   RAW compressed data is output from the above-described RAW compression processing unit 57 in pass 1, and JPEG compressed data is output from the JPEG processing unit 53 in pass 2. In other words, the RAW data based on the output of the image sensor 3 is irreversibly compressed and output as JPEG compressed data, and is reversibly compressed and output as RAW compressed data by the circuit shown in FIG.

次に、図2に示すASIC15内の圧縮処理を行なうための回路の動作について、図3乃至図10を用いて、説明する。図3は圧縮処理の全体動作を示しており、このフローは、システムコントローラー20によって制御され、個々の処理はASIC15内の個々の回路ブロックによって実行される。   Next, the operation of the circuit for performing the compression processing in the ASIC 15 shown in FIG. 2 will be described with reference to FIGS. FIG. 3 shows the overall operation of the compression process. This flow is controlled by the system controller 20, and each process is executed by each circuit block in the ASIC 15.

図3に示す画像圧縮の処理がスタートすると、RAW撮影があるか否かの判定を行なう(S1)。本実施形態に係わるデジタル一眼レフカメラは、撮影した画像の画像データは、記録媒体35にJPEG圧縮して記録されるが、撮影者がメニューモード等を操作することにより、RAW圧縮データも一緒に記録することが可能となっている。ステップS1においては、このRAW圧縮データ記録を同時に行う撮影モードの設定がなされているか否かについて検出を行う。   When the image compression process shown in FIG. 3 is started, it is determined whether or not there is RAW shooting (S1). In the digital single-lens reflex camera according to the present embodiment, the image data of the captured image is recorded on the recording medium 35 with JPEG compression. However, when the photographer operates the menu mode or the like, the RAW compressed data is also recorded. It is possible to record. In step S1, it is detected whether or not a shooting mode for simultaneously recording this RAW compressed data is set.

ステップS1での検出の結果、RAW撮影モードである場合には、続いて、RAW圧縮処理部57においてRAW圧縮処理を行なう(S3)。このステップにおけるRAW圧縮処理の際に、隣接画像間の画像データの差分値を求め、これから圧縮情報(差分値の出現頻度)を出力する。このRAW圧縮処理については、図4および図5を用いて後述する。   If the result of detection in step S1 is RAW shooting mode, RAW compression processing unit 57 performs RAW compression processing (S3). At the time of RAW compression processing in this step, a difference value of image data between adjacent images is obtained, and compression information (frequency of appearance of difference values) is output therefrom. This RAW compression processing will be described later with reference to FIGS.

RAW圧縮処理が終わると、次にJPEGパラメータの設定を行なう(S5)。このJPEGパラメータ設定において、RAW圧縮処理で求めた圧縮情報に基づいて、量子化パラメータを算出し、ハフマンテーブルを作成し圧縮パラメータを出力する。このJPEGパラメータ設定については、図6ないし図8を用いて後述する。   When the RAW compression processing is completed, JPEG parameters are set (S5). In this JPEG parameter setting, a quantization parameter is calculated based on the compression information obtained by the RAW compression process, a Huffman table is created, and the compression parameter is output. This JPEG parameter setting will be described later with reference to FIGS.

ステップS5のJPEGパラメータ設定が終わると、またはステップS1においてRAW撮影を行わないと判定された場合には、次に、画像処理を行う(S7)。このステップにおいては、ホワイトバランス等の補正処理や、画素配列がベイヤ配列となっていることから、RGBの各画素出力をそれぞれの画素位置で補間演算処理や、YC変換等の処理を行なう。この画像処理については、図9を用いて後述する。   When the JPEG parameter setting in step S5 is completed, or if it is determined in step S1 that RAW shooting is not performed, image processing is performed next (S7). In this step, since correction processing such as white balance and the pixel array are Bayer arrays, RGB pixel outputs are subjected to interpolation calculation processing and YC conversion processing at the respective pixel positions. This image processing will be described later with reference to FIG.

ステップS7の画像処理が終わると、次に、JPEG処理を行なう(S9)。JPEG処理は、ステップS5で設定した圧縮パラメータを用いて、JPEG符号化を行なう。このJPEG処理については、図10を用いて後述する。   When the image processing in step S7 is completed, JPEG processing is next performed (S9). In JPEG processing, JPEG encoding is performed using the compression parameters set in step S5. This JPEG processing will be described later with reference to FIG.

次に、ステップS3のRAW圧縮処理について、図4に示すフローを用いて説明する。図4に示すフローに入ると、RAW圧縮処理を行なう(S11)。このRAW圧縮処理は図5に示すステップを実行する。まず、RAWデータを用いて、全画素について隣接画素との差分を求める(S21)。この差分値は、画像の高周波成分に相当する。続いて、求めた差分値の出現頻度を算出する(S23)。   Next, the RAW compression process of step S3 is demonstrated using the flow shown in FIG. When the flow shown in FIG. 4 is entered, RAW compression processing is performed (S11). This RAW compression process executes the steps shown in FIG. First, using RAW data, a difference from adjacent pixels is obtained for all pixels (S21). This difference value corresponds to the high frequency component of the image. Subsequently, the appearance frequency of the obtained difference value is calculated (S23).

次に、ステップS21で求めた差分値に基づいて可変長符号化を行なう(S25)。すなわち、エントロピー符号化を行うが、本実施形態においては、ハフマン符号をもとにした可変長符号化を行なっている。   Next, variable length coding is performed based on the difference value obtained in step S21 (S25). That is, although entropy coding is performed, in this embodiment, variable length coding based on Huffman code is performed.

ステップS25の可変長符号化でRAW圧縮データが生成される。図4に戻り、続いて、圧縮情報を生成し、これをJPEGパラメータ設定部56に出力する(S13、図4)。本実施形態においては、ステップS23において算出した差分値の出現頻度を、圧縮情報として出力する。   RAW compressed data is generated by variable length encoding in step S25. Returning to FIG. 4, subsequently, compression information is generated and output to the JPEG parameter setting unit 56 (S13, FIG. 4). In the present embodiment, the appearance frequency of the difference value calculated in step S23 is output as compressed information.

次に、図3に戻り、ステップS5のJPEGパラメータの設定について、図6を用いて説明する。このJPEGパラメータ設定は、JPEGパラメータ設定部56において実行される。まず、圧縮情報を入力する(S31)。これはRAW圧縮の際に、ステップS13において出力された情報であり、具体的には、前述したように差分値の出現頻度である。   Next, returning to FIG. 3, the setting of the JPEG parameter in step S5 will be described with reference to FIG. This JPEG parameter setting is executed by the JPEG parameter setting unit 56. First, compression information is input (S31). This is the information output in step S13 during RAW compression, and specifically the frequency of appearance of the difference value as described above.

圧縮情報を入力すると、この圧縮情報を基にして、量子化パラメータの算出を行なう(S33)。図7にこの量子化パラメータ算出のフローを示す。図7のフローに示すように、まず、高周波成分の大きさ、すなわち隣接画素間の画像データの差分値とその出現頻度からエントロピー(特徴データ)を算出する(S41)。ここでエントロピーは、具体的には高周波成分の大きさを表すパラメータをi、このパラメータiに対応する出現頻度をPiとするとき
−ΣPi・LogPi (式1)
により算出する。
When the compression information is input, the quantization parameter is calculated based on the compression information (S33). FIG. 7 shows the flow of the quantization parameter calculation. As shown in the flow of FIG. 7, first, entropy (feature data) is calculated from the magnitude of the high-frequency component, that is, the difference value of the image data between adjacent pixels and its appearance frequency (S41). Here, the entropy is, specifically, when a parameter representing the magnitude of the high-frequency component is i and the appearance frequency corresponding to the parameter i is Pi, -ΣPi · LogPi (Expression 1)
Calculated by

次に、JPEG符号化サイズ近似式から所定のエントロピーに対する予測符号量の算出を行なう(S43)。すなわち、エントロピーとJPEG符号化サイズの関係は、図11および図12に示すように、一定の相関関係がある。なお、図11および図12のグラフは、画像データを基に作成した実験データである。   Next, the prediction code amount for a predetermined entropy is calculated from the JPEG encoding size approximation formula (S43). That is, the relationship between entropy and JPEG encoding size has a certain correlation as shown in FIGS. The graphs of FIGS. 11 and 12 are experimental data created based on image data.

この相関を図11に示すように、一次式で近似すると、
Djpeg=A × Eraw + B (式2)
となる。ここで、
Eraw:RAWデータのエントロピー
Djpeg:量子化テーブル1(図13のQテーブル1参照)での予測符号量
A、B:定数
である。
When this correlation is approximated by a linear equation as shown in FIG.
Djpeg = A x Eraw + B (Formula 2)
It becomes. here,
Eraw: entropy of RAW data Djpeg: prediction code amount in quantization table 1 (see Q table 1 in FIG. 13) A, B: constants.

また、エントロピーとJPEG符号化サイズの関係を図12に示すように、二次式で近似すると、
Djpeg=C × Eraw +D ×Eraw +E (式3)
となる。ただし、C、D、Eは定数である。
Further, when the relationship between entropy and JPEG encoding size is approximated by a quadratic expression as shown in FIG.
Djpeg = C × Eraw 2 + D × Eraw + E (Formula 3)
It becomes. However, C, D, and E are constants.

ステップS43において、式2や式3のような近似式により、画像データのエントロピーに対応する予測符号を算出すると、次に、目標符号化サイズに対応する量子化パラメータの算出を行なう(S45)。JPEG方式における圧縮は、画像をブロックに分割し、ブロック単位で離散コサイン変換によって空間領域から周波数領域に変換し、この変換データを量子化によって情報量を落としてから、ハフマン符号によるエントロピー符号化を行なっている。そこで、本実施形態においては、量子化の際の量子化パラメータを選択することによって、目標とするデータサイズになるようにしている。   In step S43, when the prediction code corresponding to the entropy of the image data is calculated by the approximate expression such as Expression 2 or Expression 3, next, the quantization parameter corresponding to the target coding size is calculated (S45). In JPEG compression, an image is divided into blocks, converted from a spatial domain to a frequency domain by discrete cosine transform in units of blocks, and the amount of information is reduced by quantizing the transformed data, and then entropy coding using Huffman codes is performed. Is doing. Therefore, in the present embodiment, the target data size is obtained by selecting a quantization parameter at the time of quantization.

量子化テーブル(Qテーブル)は、周知のようにブロック単位で離散コサイン変換によって得られた各DCT(Discrete Cosine Transform)係数を所定の値で割算して量子化するための除数をテーブル化したものである。図13のQテーブル1の値をQ1(ただしQ1は複数の値の集合である)とするとき、Nの値を任意に設定してQテーブルの値を、
Q1×2−N (式4)
として任意の量子化テーブルを生成して量子化を行うとき、この整数Nが量子化パラメータである。
As is well known, the quantization table (Q table) is a table of divisors for dividing and quantizing each DCT (Discrete Cosine Transform) coefficient obtained by discrete cosine transform in units of blocks by a predetermined value. Is. When the value of the Q table 1 in FIG. 13 is Q1 (where Q1 is a set of a plurality of values), the value of the Q table is set by arbitrarily setting the value of N
Q1 × 2- N (Formula 4)
When an arbitrary quantization table is generated and quantization is performed, the integer N is a quantization parameter.

JPEG符号化サイズと量子化テーブルとの間には、図13に示すように一定の相関関係がある。なお、図13のQテーブル1〜4はそれぞれ量子化パラメータN1,N2,N3,N4に対応する。この相関関係を近似式で表すと、
Dtarget=Djpeg × (F × 2−N + G ) (式5)
となる。ここで、
Dtarget:目標符号量
Djpeg:量子化テーブル1(Qテーブル1)での予測JPEG符号量
N:量子化パラメータ
F、G:定数
There is a certain correlation between the JPEG encoding size and the quantization table as shown in FIG. Note that the Q tables 1 to 4 in FIG. 13 correspond to the quantization parameters N1, N2, N3, and N4, respectively. When this correlation is expressed by an approximate expression,
Dtarget = Djpeg × (F × 2- N + G) (Formula 5)
It becomes. here,
Dtarget: target code amount Djpeg: predicted JPEG code amount in quantization table 1 (Q table 1) N: quantization parameter F, G: constant

上述の近似式を用いて、目標とするJPEG符号化サイズ(予測符号量)となる量子化パラメータを算出する。なお、図13に示すグラフは、画像データを基に作成した実験データであり、4本のラインは、4種類の画像について、それぞれ量子化テーブル(または量子化パラメータ)を代えて求めたJPEG符号化サイズである。画像によって値は異なるものの、一定の相関関係があることが分かる。   Using the above approximate expression, a quantization parameter that is a target JPEG encoding size (predicted code amount) is calculated. The graph shown in FIG. 13 is experimental data created based on image data, and four lines are JPEG codes obtained by changing the quantization table (or quantization parameter) for each of the four types of images. Size. Although the values differ depending on the images, it can be seen that there is a certain correlation.

ステップS45において量子化パラメータを算出すると、次に、図6に戻り、ハフマンテーブルの作成を行なう(図6のS35)。このハフマンテーブルの作成のフローを図8に示す。まず、出現頻度からエントロピーの算出を行なう(S51)。このエントロピーの算出は、ステップS41と同様、式1に基づいて行なうが、ステップS41で求めた結果をそのまま用いる。   Once the quantization parameter is calculated in step S45, the process returns to FIG. 6 to create a Huffman table (S35 in FIG. 6). FIG. 8 shows a flow for creating the Huffman table. First, entropy is calculated from the appearance frequency (S51). The entropy is calculated based on Equation 1 as in step S41, but the result obtained in step S41 is used as it is.

続いて、このエントロピーを用いてハフマンテーブルを選択する(S53)。すなわち、ハフマンテーブルは、図14に示すように、ハフマンテーブル1とハフマンテーブル2と2つのカテゴリがあり、式1で算出したエントロピーに基づいて、いずれかのハフマンテーブルを選択する。ここで、ハフマンテーブル1は、自然画像のように隣接する画素出力に相関関係が強い場合に使用される。一方、ハフマンテーブル2は、テレビ画面で、所謂砂あらしといわれるような、人工的な画像や、また目の細かいレースを黒バックで撮像した画像のように、急峻に画素出力が変化する場合に使用されるテーブルである。   Subsequently, a Huffman table is selected using this entropy (S53). That is, as shown in FIG. 14, there are two categories of Huffman tables, Huffman table 1 and Huffman table 2, and one of the Huffman tables is selected based on the entropy calculated by Equation 1. Here, the Huffman table 1 is used when the correlation between adjacent pixel outputs is strong like a natural image. On the other hand, the Huffman table 2 is used when the pixel output changes abruptly such as an artificial image such as a so-called sandstorm on a TV screen or an image obtained by capturing a fine lace with a black background. The table used.

ハフマンテーブルの選択が終わると、次に、図6に戻り、圧縮パラメータをJPEG処理部53に出力する(S37)。ここで、圧縮パラメータはステップS33で求めた量子化パラメータと、ステップS35で選択したハフマンテーブルである。   When the selection of the Huffman table is completed, the process returns to FIG. 6 and the compression parameter is output to the JPEG processing unit 53 (S37). Here, the compression parameters are the quantization parameter obtained in step S33 and the Huffman table selected in step S35.

圧縮パラメータの出力(S37)が終わると、図3に戻り、次に、ステップS7(図3参照)の画像処理に移る。この画像処理のフローについて、図9を用いて説明する。画像処理部51では、まず、画像データの補正処理を行なう(S61)。補正処理としては、ホワイトバランスやオプティカルブラック等の処理を行なう。続いて、同時化処理を行う(S63)。撮像素子3は、RGBの原色フィルタが、ベイヤ配列で配置されていることから、各画素におけるRGBの値を補間により求める。   When the compression parameter output (S37) ends, the process returns to FIG. 3, and then the process proceeds to image processing in step S7 (see FIG. 3). The flow of this image processing will be described with reference to FIG. In the image processing section 51, first, image data correction processing is performed (S61). As correction processing, processing such as white balance and optical black is performed. Subsequently, a synchronization process is performed (S63). Since the RGB primary color filters are arranged in a Bayer array, the image sensor 3 obtains RGB values for each pixel by interpolation.

同時化処理が終わると、次に、画像補正を行なう(S65)。画像補正としては、画像データの色の再現性や階調表現等の補正を行なう。画像補正が終わると、続いて、輝度と色情報からなるYC信号となるようにYC変換を行なう(S67)。ここまでのステップでの処理は、ベイヤ配列に基づくRGB画素出力の処理を行なっていたが、ここでJPEG圧縮やLCD47での表示が容易なYCデータへのYC変換を行なう。   When the synchronization processing is completed, image correction is performed next (S65). As image correction, corrections such as color reproducibility and gradation expression of image data are performed. When the image correction is completed, YC conversion is subsequently performed so as to obtain a YC signal composed of luminance and color information (S67). The processing in the steps so far has been processing of RGB pixel output based on the Bayer array, but here, JPEG compression or YC conversion to YC data that can be easily displayed on the LCD 47 is performed.

ステップS67におけるYC変換が終わると、次に、図3に戻り、ステップS9のJPEG処理に移る。このJPEG処理のフローについて、図10を用いて説明する。JPEG処理部53では、まず、圧縮パラメータを入力する(S71)。前述したように量子化パラメータと選択されたハフマンテーブルからなる圧縮パラメータは、図6のフローに示すステップS37で出力されている。   When the YC conversion in step S67 ends, the process returns to FIG. 3 and proceeds to the JPEG process in step S9. The flow of this JPEG process will be described with reference to FIG. The JPEG processing unit 53 first inputs a compression parameter (S71). As described above, the compression parameter including the quantization parameter and the selected Huffman table is output in step S37 shown in the flow of FIG.

続いて、入力した圧縮パラメータを用いて、JPEGの符号化を行なう(S73)。ここでは式(4)に基づいて量子化パラメータNから新たな量子化テーブルを生成し、この新たに生成した量子化テーブルを用いてDCT係数の量子化を行う。つぎにこの量子化したDCT係数を、選択されたハフマンテーブルに基づいてハフマン符号化することにより、目標とする符号量の圧縮データを出力する。以上のRAW圧縮処理と、JPEG圧縮処理は、図2に示したブロックによってハードウエア的に処理されるが、システムコントローラー20等のCPUによって、ソフトウエア的に処理しても良い。   Subsequently, JPEG encoding is performed using the input compression parameters (S73). Here, a new quantization table is generated from the quantization parameter N based on Expression (4), and the DCT coefficient is quantized using the newly generated quantization table. Next, the quantized DCT coefficient is Huffman-encoded based on the selected Huffman table to output compressed data having a target code amount. The above RAW compression processing and JPEG compression processing are processed in hardware by the blocks shown in FIG. 2, but may be processed in software by a CPU such as the system controller 20.

以上説明したように、本実施形態にかかわる画像データ圧縮装置においては、画像データの高周波成分を検出する画像処理部(S21、RAW圧縮処理部57)と、上記高周波成分の出現頻度分布を表す特徴データ(エントロピー)を算出する演算部(S41、JPEGパラメータ設定部56)と、上記画像データを第1の量子化テーブルに基づいて圧縮したと仮定したときの予測符号量を、上記特徴データをもとに演算する符号量予測部(S43、JPEGパラメータ設定部56)と、上記圧縮処理部で最終的に得たい目標符号量を得るための第2の量子化テーブルを、上記目標符号量と上記予測符号量に基づいて算出する量子化テーブル生成部(S45、JPEGパラメータ設定部56)と、上記第2の量子化テーブルに基づいてJPEG圧縮処理を行なうJPEG圧縮部(S9、JPEG処理部53)を備えている。   As described above, in the image data compression apparatus according to the present embodiment, the image processing unit (S21, RAW compression processing unit 57) that detects the high-frequency component of the image data, and the feature that represents the appearance frequency distribution of the high-frequency component. A calculation unit (S41, JPEG parameter setting unit 56) for calculating data (entropy), and a prediction code amount when it is assumed that the image data is compressed based on the first quantization table, the characteristic data are also included. And a second quantization table for obtaining a target code amount to be finally obtained by the compression processing unit, the code amount prediction unit (S43, JPEG parameter setting unit 56), and the target code amount and the above A quantization table generating unit (S45, JPEG parameter setting unit 56) that calculates based on the predicted code amount, and a JPE based on the second quantization table. JPEG compression unit performs compression processing and a (S9, JPEG processing section 53).

このため、本実施形態においては、同時に記録されるJPEG符号化データのサイズを予測することができ、JPEGデータの記録を高速化することができる。すなわち、JPEG符号化サイズを圧縮前に予測することができることから、規定のサイズとなる量子化パラメータを設定すればよい。従来のように、規定のサイズとなるまで、JPEG圧縮処理を繰り返すことがなくなるので、JPEGデータの記録を高速化することができる。   Therefore, in the present embodiment, the size of JPEG encoded data that is recorded at the same time can be predicted, and the recording speed of JPEG data can be increased. That is, since the JPEG encoded size can be predicted before compression, a quantization parameter having a specified size may be set. Since the JPEG compression process is not repeated until a predetermined size is achieved as in the prior art, JPEG data recording can be speeded up.

なお、本実施形態においては、画像データの非可逆圧縮処理としてJPEG方式を説明したが、他の非可逆圧縮方式でもよい。また、圧縮処理にあたってハフマン符号化を利用していたが、これに限らず、他のエントロピー符号を用いても良い。   In the present embodiment, the JPEG method has been described as the irreversible compression processing of image data, but other irreversible compression methods may be used. Further, although Huffman coding is used for the compression processing, the present invention is not limited to this, and other entropy codes may be used.

さらに、本実施形態においては、JPEGデータのサイズの予測にあたって、図11および図12に示すような、1次式や2次式で近似していたが、近似式はこれに限らず種々の式を使用することができる。また、近似式に限らず、テーブルを作成し、これから補間演算する等により求めても良い。さらに、本実施形態においては、高周波成分の出現頻度分布を表す特徴データとして、情報エントロピーを用いていたが、これに限らず、例えば分散を示す値を用いても良い。   Furthermore, in the present embodiment, the size of JPEG data is approximated by a linear expression or a quadratic expression as shown in FIGS. 11 and 12, but the approximate expression is not limited to this, and various expressions can be used. Can be used. In addition to the approximate expression, a table may be created and may be calculated by performing an interpolation calculation. Furthermore, in the present embodiment, information entropy is used as feature data representing the appearance frequency distribution of high-frequency components. However, the present invention is not limited to this, and a value indicating variance, for example, may be used.

さらに、本実施形態においては、圧縮データとして、差分値の出願頻度を利用していたが、これに限らず、例えば、RAW圧縮処理部での可変長符号化データ(図5のS25)のサイズを用いてもよく、この場合には、図11および図12に示した、エントロピーとデータサイズの相関関係に代えて、可変長符号化データのサイズとJPEG符号化サイズの相関関係に基づいて、JPEG符号化サイズを予測するようにしても良い。   Furthermore, in the present embodiment, the application frequency of the difference value is used as the compressed data. However, the present invention is not limited to this. For example, the size of the variable length encoded data (S25 in FIG. 5) in the RAW compression processing unit. In this case, instead of the correlation between the entropy and the data size shown in FIGS. 11 and 12, based on the correlation between the size of the variable-length encoded data and the JPEG encoded size, The JPEG encoding size may be predicted.

本発明はデジタル一眼レフカメラに限らず、例えば、コンパクトタイプ等のデジタルカメラにも適用でき、さらには、顕微鏡用写真撮影装置のように、専用機器に取り付け可能なカメラにも適用できることは勿論である。いずれにしても、画像データ圧縮を行なうカメラ、電子撮像装置、画像処理装置等に適用できる。   The present invention is not limited to a digital single-lens reflex camera, but can be applied to a digital camera of a compact type, for example. Furthermore, it can be applied to a camera that can be attached to a dedicated device such as a microscope photography apparatus. . In any case, the present invention can be applied to a camera that performs image data compression, an electronic imaging device, an image processing device, and the like.

本発明の一実施形態に係わるデジタル一眼レフカメラの電気的構成を示すブロック図である。1 is a block diagram showing an electrical configuration of a digital single-lens reflex camera according to an embodiment of the present invention. 本発明の一実施形態に係わるASIC内の圧縮処理に関するブロック図である。It is a block diagram regarding the compression process in ASIC concerning one Embodiment of this invention. 本発明の一実施形態に係わる画像圧縮の処理を示すフローを示す図である。It is a figure which shows the flow which shows the process of the image compression concerning one Embodiment of this invention. 本発明の一実施形態に係わるRAW圧縮のフローを示す図である。It is a figure which shows the flow of RAW compression concerning one Embodiment of this invention. 本発明の一実施形態に係わるRAW圧縮処理のフローを示す図である。It is a figure which shows the flow of the RAW compression process concerning one Embodiment of this invention. 本発明の一実施形態に係わるJPEGパラメータ設定のフローを示す図である。It is a figure which shows the flow of the JPEG parameter setting concerning one Embodiment of this invention. 本発明の一実施形態に係わる量子化パラメータ算出のフローを示す図である。It is a figure which shows the flow of the quantization parameter calculation concerning one Embodiment of this invention. 本発明の一実施形態に係わるハフマンテーブルのフローを示す図である。It is a figure which shows the flow of the Huffman table concerning one Embodiment of this invention. 本発明の一実施形態に係わる画像処理のフローを示す図である。It is a figure which shows the flow of the image processing concerning one Embodiment of this invention. 本発明の一実施形態に係わるJPEG処理のフローを示す図である。It is a figure which shows the flow of the JPEG process concerning one Embodiment of this invention. 本発明の一実施形態に係わるエントロピーとJPEG符号化サイズの相関関係を示す図である。It is a figure which shows the correlation of the entropy and JPEG encoding size concerning one Embodiment of this invention. 本発明の一実施形態に係わるエントロピーとJPEG符号化サイズの相関関係を示す図である。It is a figure which shows the correlation of the entropy and JPEG encoding size concerning one Embodiment of this invention. 本発明の一実施形態に係わるJPEG量子化テーブルとJPEG符号化サイズの相関関係を示す図である。It is a figure which shows the correlation of the JPEG quantization table concerning one Embodiment of this invention, and a JPEG encoding size. 本発明の一実施形態に係わるハフマンテーブルを示す図である。It is a figure which shows the Huffman table concerning one Embodiment of this invention.

符号の説明Explanation of symbols

1・・・ズームレンズ系、3・・・撮像素子、5・・・撮像回路、7・・・アナログデジタル(A/D)変換器、9・・・レンズ駆動部、10・・・データバス、11・・・RAM、13・・・ROM、15・・・ASIC、20・・・システムコントローラー、21・・・レンズ駆動制御回路、23・・・ストロボ発光部、25・・・操作部、27・・・電源部、29・・・外部電源入力端子、31・・・ドライブコントローラー、33・・・ディスクドライブ、35・・・記録媒体、37・・・外部I/F、39・・・外部入出力端子、41・・・ビデオエンコーダー、43・・・ビデオアウト、45・・・LCDドライバ、47・・・液晶モニタ(LCD)、51・・・画像処理部、53・・・JPEG処理部、56・・・JPEGパラメータ設定部、57・・・RAW圧縮処理部 DESCRIPTION OF SYMBOLS 1 ... Zoom lens system, 3 ... Imaging element, 5 ... Imaging circuit, 7 ... Analog-digital (A / D) converter, 9 ... Lens drive part, 10 ... Data bus 11 ... RAM, 13 ... ROM, 15 ... ASIC, 20 ... system controller, 21 ... lens drive control circuit, 23 ... strobe light emission unit, 25 ... operation unit, 27 ... Power supply unit, 29 ... External power input terminal, 31 ... Drive controller, 33 ... Disk drive, 35 ... Recording medium, 37 ... External I / F, 39 ... External input / output terminal, 41 ... Video encoder, 43 ... Video out, 45 ... LCD driver, 47 ... Liquid crystal monitor (LCD), 51 ... Image processing unit, 53 ... JPEG processing 56, JPEG Meter setting unit, 57 ··· RAW compression processing unit

Claims (15)

画像データの高周波成分を検出する画像処理部と、
上記高周波成分の出現頻度分布を表す特徴データを算出する演算部と、
上記画像データを量子化テーブルとハフマン符号化テーブルに基づいて圧縮処理を行う圧縮処理部と、
上記画像データを第1の量子化テーブルに基づいて上記圧縮処理部で圧縮したと仮定したときの予測符号量を、上記特徴データをもとに演算する符号量予測部と、
上記圧縮処理部で最終的に得たい目標符号量を得るための第2の量子化テーブルを、上記目標符号量と上記予測符号量に基づいて算出する量子化テーブル生成部と、
上記第2の量子化テーブルに基づいてJPEG圧縮処理を行なうJPEG圧縮部と、
を備えたことを特徴とする画像データ圧縮装置。
An image processing unit for detecting high-frequency components of the image data;
A calculation unit for calculating feature data representing the appearance frequency distribution of the high-frequency component;
A compression processing unit that compresses the image data based on a quantization table and a Huffman coding table;
A code amount prediction unit that calculates a prediction code amount when it is assumed that the image data is compressed by the compression processing unit based on a first quantization table;
A quantization table generating unit that calculates a second quantization table for obtaining a target code amount to be finally obtained by the compression processing unit based on the target code amount and the predicted code amount;
A JPEG compression unit that performs JPEG compression processing based on the second quantization table;
An image data compression apparatus comprising:
上記画像処理部における、上記高周波成分は近隣画素間の画像データの差分値であることを特徴とする請求項1に記載の画像データ圧縮装置。   The image data compression apparatus according to claim 1, wherein the high-frequency component in the image processing unit is a difference value of image data between neighboring pixels. 上記演算部で演算する上記特徴データは、高周波成分の大きさを表すパラメータをi、該パラメータiに対応する出現頻度をPiとするとき、
−ΣPi・LogPi
で表されることを特徴とする請求項1に記載の画像データ圧縮装置。
When the characteristic data calculated by the calculation unit is i indicating a parameter representing the magnitude of the high frequency component and Pi representing the appearance frequency corresponding to the parameter i,
-ΣPi ・ LogPi
The image data compression apparatus according to claim 1, wherein
上記特徴データをErawとし、第1の量子化テーブルをもとに上記JPEG圧縮処理を行ったときの予測符号量をDjpegとし、A、B、C、D,Eをそれぞれ定数としたとき、
Djpeg=A × Eraw + B
または、
Djpeg=C × Eraw2+D×Eraw + E
の相関関係があることを特徴とする請求項1に記載の画像データ圧縮装置。
When the feature data is Eraw, the prediction code amount when the JPEG compression processing is performed based on the first quantization table is Djpeg, and A, B, C, D, and E are constants,
Djpeg = A x Eraw + B
Or
Djpeg = C × Eraw2 + D × Eraw + E
The image data compression apparatus according to claim 1, wherein:
上記第1の量子化テーブルをもとに上記JPEG圧縮処理を行ったときの予測符号量をDjpegとし、量子化パラメータをNとし、F、Gを定数とし、上記量子化パラメータNをもとに上記JPEG圧縮処理を行ったときの目標符号量をDtargetとしたとき、
Dtarget=Djpeg ×(F×2−N+G)
で表され、且つ、
上記第1の量子化テーブルをQ1、上記第2の量子化テーブルの値をQ2、Nを量子化パラメータとするとき、
Q2=Q1×2−N
で表されることを特徴とする請求項1に記載の画像データ圧縮装置。
The prediction code amount when the JPEG compression processing is performed based on the first quantization table is Djpeg, the quantization parameter is N, F and G are constants, and the quantization parameter N is based on the quantization parameter N. When the target code amount when performing the JPEG compression process is Dtarget,
Dtarget = Djpeg × (F × 2- N + G)
And
When the first quantization table is Q1, the value of the second quantization table is Q2, and N is a quantization parameter,
Q2 = Q1 × 2- N
The image data compression apparatus according to claim 1, wherein
上記画像データ圧縮装置は、さらに、RAWデータの符号化を行ない可変長符号化データを生成する可変長符号化部を有することを特徴とする請求項1に記載の画像データ圧縮装置。   2. The image data compression apparatus according to claim 1, further comprising a variable length encoding unit that encodes RAW data and generates variable length encoded data. 画像データの高周波成分を検出するステップと、
上記高周波成分の出現頻度分布を表す特徴データを算出するステップと、
上記画像データを第1の量子化テーブルに基づいて圧縮処理部で圧縮したと仮定したときの予測符号量を、上記特徴データをもとに演算するステップと、
上記圧縮処理部で最終的に得たい目標符号量を得るための第2の量子化テーブルを、上記目標符号量と上記予測符号量に基づいて算出するステップと、
上記第2の量子化テーブルに基づいてJPEG圧縮処理を行なうステップと、
を備えたことを特徴とする画像データ圧縮方法。
Detecting a high frequency component of the image data;
Calculating feature data representing the appearance frequency distribution of the high-frequency component;
A step of calculating a predictive code amount based on the feature data when it is assumed that the image data is compressed by a compression processing unit based on a first quantization table;
Calculating a second quantization table for obtaining a target code amount to be finally obtained by the compression processing unit based on the target code amount and the predicted code amount;
Performing JPEG compression processing based on the second quantization table;
An image data compression method comprising:
画像データの高周波成分を検出するステップと、
上記高周波成分の出現頻度分布を表す特徴データを算出するステップと、
上記画像データを第1の量子化テーブルに基づいて圧縮処理部で圧縮したと仮定したときの予測符号量を、上記特徴データをもとに演算するステップと、
上記圧縮処理部で最終的に得たい目標符号量を得るための第2の量子化テーブルを、上記目標符号量と上記予測符号量に基づいて算出するステップと、
上記第2の量子化テーブルに基づいてJPEG圧縮処理を行なうステップと、
をコンピュータに実行させる画像データ圧縮プログラム。
Detecting a high frequency component of the image data;
Calculating feature data representing the appearance frequency distribution of the high-frequency component;
A step of calculating a predictive code amount based on the feature data when it is assumed that the image data is compressed by a compression processing unit based on a first quantization table;
Calculating a second quantization table for obtaining a target code amount to be finally obtained by the compression processing unit based on the target code amount and the predicted code amount;
Performing JPEG compression processing based on the second quantization table;
Is an image data compression program that causes a computer to execute.
隣接画素の画像データ間の差分値に基づいて可変長符号化により、画像データの圧縮を行なうと共に、画像圧縮に関する圧縮情報を求めるRAW圧縮処理部と、
上記圧縮情報に基づいて目標とするデータサイズにするために量子化を行うための量子化パラメータと、この量子化パラメータにより量子化したデータをハフマン符号化するためのハフマンテーブルを設定するJPEGパラメータ設定部と、
画像データを上記量子化パラメータと上記ハフマンテーブルに基づいてJPEG圧縮処理を行なうJPEG処理部と、
を具備することを特徴とする画像データ圧縮装置。
A RAW compression processing unit that compresses image data by variable length coding based on a difference value between image data of adjacent pixels and obtains compression information related to image compression;
JPEG parameter setting for setting a quantization parameter for performing quantization to obtain a target data size based on the compression information and a Huffman table for performing Huffman coding on data quantized by the quantization parameter And
A JPEG processing unit that performs JPEG compression processing on the image data based on the quantization parameter and the Huffman table;
An image data compression apparatus comprising:
上記圧縮情報は、上記差分値の出現頻度値を基に算出したエントロピーであることを特徴とする請求項9に記載の画像データ圧縮装置。   The image data compression apparatus according to claim 9, wherein the compression information is entropy calculated based on an appearance frequency value of the difference value. 画像データを可逆的に圧縮すると共に、画像圧縮に関する圧縮情報を求めるRAW圧縮処理部と、
画像データを非可逆的に圧縮する非可逆圧縮処理部と、
上記圧縮情報に基づいて目標とするデータサイズとなるパラメータを求めるパラメータ算出部と、
を具備し、上記非可逆圧縮処理部は、上記パラメータに基づいて、非可逆圧縮処理を行うことを特徴とする画像データ圧縮装置。
A RAW compression processing unit that reversibly compresses image data and obtains compression information related to image compression;
An irreversible compression processing unit for irreversibly compressing image data;
A parameter calculation unit for obtaining a parameter that is a target data size based on the compression information;
And the irreversible compression processing unit performs irreversible compression processing based on the parameters.
上記圧縮情報に基づいてエントロピーを算出し、このエントロピーと上記非可逆圧縮処理によるデータサイズの相関関係から目標とするデータサイズとなる上記パラメータを求めることを特徴とする請求項11に記載の画像データ圧縮装置。   12. The image data according to claim 11, wherein entropy is calculated based on the compression information, and the parameter having a target data size is obtained from a correlation between the entropy and the data size obtained by the lossy compression processing. Compression device. 上記エントロピーは、上記画像データの高周波成分の出現頻度値を基に算出したデータであることを特徴とする請求項11に記載の画像データ圧縮装置。   12. The image data compression apparatus according to claim 11, wherein the entropy is data calculated based on an appearance frequency value of a high frequency component of the image data. 隣接画素の画像データ間の差分値に基づいて可変長符号化により、画像データの圧縮を行なうと共に、画像圧縮に関する圧縮情報を求めるステップと、
上記圧縮情報に基づいて目標とするデータサイズにするために量子化を行うための量子化パラメータと、この量子化パラメータにより量子化したデータをハフマン符号化するためのハフマンテーブルを設定するステップと、
画像データを上記量子化パラメータと上記ハフマンテーブルに基づいてJPEG圧縮処理を行なうステップと、
を具備することを特徴とする画像データ圧縮方法。
Compressing the image data by variable length coding based on the difference value between the image data of adjacent pixels, and obtaining compression information related to the image compression;
Setting a quantization parameter for performing quantization to obtain a target data size based on the compression information, and a Huffman table for performing Huffman coding on data quantized by the quantization parameter;
Performing JPEG compression on the image data based on the quantization parameter and the Huffman table;
An image data compression method comprising:
隣接画素の画像データ間の差分値に基づいて可変長符号化により、画像データの圧縮を行なうと共に、画像圧縮に関する圧縮情報を求めるステップと、
上記圧縮情報に基づいて目標とするデータサイズにするために量子化を行うための量子化パラメータと、この量子化パラメータにより量子化したデータをハフマン符号化するためのハフマンテーブルを設定するステップと、
画像データを上記量子化パラメータと上記ハフマンテーブルに基づいてJPEG圧縮処理を行なうステップと、
をコンピュータに実行させるためのプログラム。
Compressing the image data by variable length coding based on the difference value between the image data of adjacent pixels, and obtaining compression information related to the image compression;
Setting a quantization parameter for performing quantization to obtain a target data size based on the compression information, and a Huffman table for performing Huffman coding on data quantized by the quantization parameter;
Performing JPEG compression on the image data based on the quantization parameter and the Huffman table;
A program that causes a computer to execute.
JP2008049599A 2007-05-16 2008-02-29 Image data compressing device, image data compressing method, and program Pending JP2008312193A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2008049599A JP2008312193A (en) 2007-05-16 2008-02-29 Image data compressing device, image data compressing method, and program
US12/113,548 US20080285866A1 (en) 2007-05-16 2008-05-01 Apparatus and method for image data compression
CN2008100965466A CN101309414B (en) 2007-05-16 2008-05-16 Apparatus and method for image data compression

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2007130262 2007-05-16
JP2008049599A JP2008312193A (en) 2007-05-16 2008-02-29 Image data compressing device, image data compressing method, and program

Publications (1)

Publication Number Publication Date
JP2008312193A true JP2008312193A (en) 2008-12-25

Family

ID=40125592

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008049599A Pending JP2008312193A (en) 2007-05-16 2008-02-29 Image data compressing device, image data compressing method, and program

Country Status (2)

Country Link
JP (1) JP2008312193A (en)
CN (1) CN101309414B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5251774B2 (en) * 2009-07-27 2013-07-31 ソニー株式会社 Image coding apparatus and image coding method
WO2014031240A2 (en) * 2012-08-21 2014-02-27 Emc Corporation Lossless compression of fragmented image data
CN105324949B (en) * 2013-05-29 2018-05-29 凯迪迪爱通信技术有限公司 Base station system and communicator
CN107333124B (en) * 2017-06-30 2019-03-26 武汉精测电子集团股份有限公司 Picture compression method and defects of display panel detection system in AOI detection system
CN109672451B (en) * 2018-12-24 2023-06-23 哈尔滨工业大学(深圳) demura data compression method, and mura compensation method and device
CN110505484A (en) * 2019-08-12 2019-11-26 深圳市华星光电技术有限公司 Data compression device and compression method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06165151A (en) * 1992-11-25 1994-06-10 Matsushita Electric Ind Co Ltd Device for controlling video coding quantity
JP3432392B2 (en) * 1997-04-07 2003-08-04 三菱電機株式会社 Image encoding device, image encoding method, and image storage / transmission device
US6643402B1 (en) * 1999-03-23 2003-11-04 Sanyo Electric Co., Ltd Image compression device allowing rapid and highly precise encoding while suppressing code amount of image data after compression
CN100525386C (en) * 2002-09-24 2009-08-05 佳能株式会社 Image shooting device

Also Published As

Publication number Publication date
CN101309414B (en) 2010-09-29
CN101309414A (en) 2008-11-19

Similar Documents

Publication Publication Date Title
JP4869149B2 (en) Image data compression apparatus, image data compression method and program
US6650361B1 (en) Imaging apparatus control method, and a computer program product having computer program code therefor
US8615140B2 (en) Compression of image data in accordance with depth information of pixels
JP2006115446A (en) Photographing device, and method of evaluating image
US9609328B2 (en) Electronic device and method
US8823832B2 (en) Imaging apparatus
JP2008312193A (en) Image data compressing device, image data compressing method, and program
US20080285866A1 (en) Apparatus and method for image data compression
US20170359471A1 (en) Imaging apparatus
EP2086217B1 (en) Image processing method
JP2002016870A (en) Imaging apparatus
US20140147090A1 (en) Image capturing apparatus, image processing apparatus, and control method therefor
JP4118766B2 (en) Imaging apparatus and imaging method
JP2004056680A (en) Image processing apparatus and image processing method
JP3795516B2 (en) Imaging apparatus and imaging method
JP2006295573A (en) Device and method for embedding electronic openwork, and image forming apparatus
JP2008034918A (en) Image recording apparatus
JP2008219738A (en) Imaging apparatus
JP5493761B2 (en) Image compression apparatus and electronic camera
JP4701065B2 (en) Image processing apparatus and image processing method
JP3752931B2 (en) Digital camera and image data processing method
JP4401882B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP4241725B2 (en) Imaging device
JP4233562B2 (en) Imaging device
JPH1066004A (en) Picture file size controller