JP4100836B2 - Image processing device - Google Patents
Image processing device Download PDFInfo
- Publication number
- JP4100836B2 JP4100836B2 JP23454499A JP23454499A JP4100836B2 JP 4100836 B2 JP4100836 B2 JP 4100836B2 JP 23454499 A JP23454499 A JP 23454499A JP 23454499 A JP23454499 A JP 23454499A JP 4100836 B2 JP4100836 B2 JP 4100836B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- encoding
- image
- image data
- image processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
【0001】
【発明の属する技術分野】
本発明は、撮像素子によって得られる画像データを処理する画像処理装置に関する。
【0002】
【従来の技術】
画像あるいは任意の入力データを圧縮記録する場合、入力データに対して離散コサイン変換(DCT)などの直交変換あるいはDPCM(Differential Pulse Ciode Modulation)変換などを施して入力データ系列のエントロピを減少させた後、ハフマン符号あるいは算術符号などに代表されるエントロピ符号化を行って入力データの圧縮が実現される。
【0003】
ハフマン符号化は、入力データ系列のヒストグラムから出現頻度の高いデータに短い符号語を、出現頻度の低いデータに長い符号語を割り当て、平均的にデータサイズを小さくすることで、データ圧縮を達成する。
【0004】
DCTおよびハフマン符号化を利用するJPEGベースライン方式においては、設定されたハフマンテーブルに従い符号化処理を行う。ハフマンテーブルには符号化に必要なすべての情報が記述されていて、その記述内容は符号化すべきデータ系列のヒストグラムから生成される。
【0005】
【発明が解決しようとする課題】
ハフマン符号化において最も効果的な符号化を実現するには、符号化すべきデータ系列のヒストグラムを計算し、データ系列それぞれに対応する固有のハフマンテーブルを生成する必要がある。
【0006】
しかしながら、ディジタルカメラ(電子カメラ)などの画像圧縮・伸長においては、処理速度などの問題から、標準的に提供される単一のハフマンテーブルを使用する。そのため、必ずしも効果的な符号化(圧縮)が実現されるとは限らない。
【0007】
本発明は、画像データ(例えば、 CCD-RAW データ)の効果的な符号化を実現する画像処理装置を提供することを目的とする。
【0008】
本発明にかかる画像処理装置は、撮像素子の出力信号をディジタル化して第1の画像データに変換する変換手段と、前記第1の画像データのビット数が第1のビット数である場合においては、前記第1の画像データを第1の符号化方式に従って符号化し、前記第1の画像データのビット数が前記第1のビット数よりも大きい第 2 のビット数である場合においては、前記第1の画像データを前記第1のビット数分の第1の部分データと、前記第1の部分データ以外の部分を有する第2の部分データとに分割し、前記第1の部分データを前記第1の符号化方式に従って符号化する符号化手段と、前記第1の画像データを記録媒体に格納する場合であり、かつ、前記第1の画像データのビット数が前記第1のビット数である場合においては、前記符号化手段により符号化された前記第1の画像データを前記記録媒体に格納し、前記第1の画像データを前記記録媒体に格納する場合であり、かつ、前記第1の画像データのビット数が前記第 2 のビット数である場合においては、前記符号化手段により符号化された前記第1の部分データと、前記第2の部分データとを前記記録媒体に格納する記録手段とを有することを特徴とする。
【0013】
【発明の実施の形態】
以下、本発明にかかる一実施形態の画像処理装置を図面を参照して詳細に説明する。
【0014】
[構成]
図1は本発明にかかる一実施形態の画像処理装置1000の構成例を示すブロック図である。
【0015】
撮影対象物の像は、撮影レンズ10によって光学的に、撮影像を電気信号に変換するCCDなどの撮像素子12上に結像される。撮像素子12のアナログ出力信号は、A/D変換器14によってディジタル信号に変換される。なお、以下では、信号処理された画像データと区別するために、A/D変換器14から出力される画像データをCCD-RAWデータと呼ぶ。
【0016】
メモリ制御回路40は、A/D変換器14、並びに、後述するD/A変換器20、画像処理回路50、メモリ60、記録媒体70、JPEG回路80、データ変換回路100におけるデータフローを制御する。メモリ制御回路40は、メモリ60へのデータ書込専用の複数のメモリ制御回路と、メモリ60からのデータ読込専用の複数のメモリ制御回路で構成される。
【0017】
画像処理回路50は、メモリ御回路40から入力される、図3に示すような素子配列(例えばベイヤ配列)をもつCCD-RAWデータに画素補間処理や色変換処理を施して、例えばRGB画像データを形成する。
【0018】
メモリ60は、撮影された静止画像や動画像を格納するためのメモリで、所定枚数の静止画像や所定時間の動画像を格納するのに充分な記憶容量を備えている。A/D変換器14から出力されるCCD-RAWデータは、メモリ制御回路40および画像処理回路50を介して、あるいは、メモリ制御回路40から直接メモリ60に書き込まれる。また、画像処理回路50がCCD-RAWデータから形成してメモリ60に書き込まれた表示用の画像データは、メモリ制御回路40およびD/A変換器20を介して、TFT LCDなどの画像表示部22に表示される。
【0019】
記録媒体70は、半導体メモリのカード、磁気記録媒体のフロッピディスクやハードディスク、あるいは光磁気ディスクなどで、主にリムーバブルな媒体が好んで利用される。
【0020】
JPEG回路80は、DCT・量子化回路82、データセレクタ84、ハフマン符号・復号回路86で構成され、ベースラインJPEG方式により画像データを圧縮/伸長する。データセレクタ84は、画像データをJPEG符号化・復号する場合と、CCD-RAWデータを可逆圧縮・伸長する場合とで、つまり後述する記録モードに従い、データの流れを切り替える。
【0021】
データ変換回路100は、JPEG回路80のハフマン符号・復号回路86を使用して、CCD-RAWデータを可逆圧縮・伸長するためのデータ変換を行う回路で、インタフェイス回路102、分割・合成回路106およびDPCM変換回路108を含むデータ変換コア104で構成される。なお、データ変換コア回路104は、本実施形態におけるデータ変換処理を実際に行う部分である。
【0022】
インタフェイス回路102は、データ変換回路100が他の回路ブロック(たとえばメモリ制御回路40やJPEG回路80)との間でデータのハンドシェイクを行うための回路で、この回路の作用により、データ変換コア104の設計が容易になると同時に、システム全体のデータ転送制御を行うソフトウェアの開発が容易になる。詳細な構成および動作については後述する。
【0023】
ハフマン符号・復号回路86は、ベースラインJPEG用に設計された回路で、データセレクタ84とハフマン符号・復号回路86の間のデータバスは11ビットである。従って、DPCM変換されるCCD-RAWデータは10ビット以下である必要がある。
【0024】
分割・合成回路106は、圧縮時においてCCD-RAWデータが12ビットの場合、それを上位10ビットと下位2ビットに分割し、下位2ビットを8データごとにPACK(パック)処理する。また、伸長時においてCCD-RAWデータが12ビットの場合、PACKされた下位2ビットのデータをUNPACK(アンパック)処理して、DPCM変換回路108において逆DPCM変換された10ビットデータと合成する。分割およびPACK処理、並びに、UNPACKおよび合成処理におけるデータフォーマットを図2に示す。
【0025】
DPCM変換回路108は、情報のエントロピを小さくしてハフマン符号化における符号化効率を高めるために、CCD-RAWデータのDPCM変換(予測符号化)を行う。DPCM変換回路108は、10ビットのデータに対してDPCM変換(予測符号化)を行い、11ビットのDPCMデータに対して逆DPCM変換を行う。DPCM変換は、符号化すべき注目画素の画像惰報と周辺画素の画像情報とは相関関係が強いことを利用して情報のエントロピを減少させるものである。具体的には、注目画素の画像データを、隣接画素(左隣りの画素)の画像データとの差分値に変換することで、ハフマン符号化における符号化効率を高める。
【0026】
本実施形態は、図3に示すような素子配列のカラーフィルタ配列をもつ撮像素子12に対応し、常に、二画素左隣りのCCD-RAWデータとの差分値を算出する必要がある。つまり、DPCM変換回路108は、入力されるCCD-RAWデータと、二画素分前に入力されたCCD-RAWデータとの差分を求める構成である。なお、DPCM変換における予測は画像の低周波成分ほど容易であるため、CCD-RAWデータが12ビットの場合は上位10ビットのみDPCM変換して予測の難しい高周波成分を非圧縮で記録する。さらに詳細な構成および動作については後述する。
【0027】
データセレクタ90は、JPEG符号化・復号を行う場合と、CCD-RAWデータの可逆圧縮・伸長を行う場合とで、つまり後述する記録モードに従い、データの流れを切り替える。
【0028】
また、システム制御回路30は、CPU、RAMおよびROMなどで構成され、ROMに格納されたプログラム、モードダイヤル32および記録モードスイッチ34の設定、並びに、読出専用メモリ(ROM)36の記録内容に従って、画像処理装置1000全体および各回路ブロックの動作を制御する。
【0029】
モードダイアル32は、電源オンオフ、撮影モードおよび再生モードなど、画像処理装置1000の機能モードをユーザが切り替えるためのものである。記録モードスイッチ34は、CCD-RAWデータの可逆圧縮・伸長モードと、JPEG記録モードとの何れかをユーザが選択するためのものである。なお、ユーザは、JPEG記録モードを選択する場合、その圧縮率なども記録モードスイッチ34によって設定することができる。読出専用メモリ36には、システム制御回路30が実行するプログラム、並びに、JPEG回路80に設定する量子化テーブルおよびハフマンテーブルなどが記録されている。
【0030】
[データ変換コア]
図4はデータ変換コア104の詳細な構成例を示すブロック図である。なお、図4において、DPCM変換回路108以外の部分は分割・合成回路106に相当する。
【0031】
データ変換コア104に入出力するすべてのデータ系列には、一対のVALID信号およびSTOP信号が存在する。VALID信号が‘1’のときはその入出力データが有効であることを意味し、STOP信号が‘1’のときはそのデータ入出力が無効であることを意味する。データ変換コア104は、入出力データに付随するVALID信号が‘1’かつSTOP信号が‘0’のとき、有効なデータの入出力が行われるとして処理を行う。データ変換コア104に入出力するデータ系列は以下の六種類である。
CCD_IN_DATA: 圧縮対象のCCD-RAWデータ(メモリ制御回路40から)
DPCM_OUT_DATA: DPCM変換されたデータ(JPEG回路80へ)
PACK_DATA: PACKされた下位2ビットのデータ(メモリ制御回路40へ)
CCD_OUT_DATA: 伸長されたCCD-RAWデータ(メモリ制御回路40へ)
DPCM_IN_DATA: 逆DPCM変換すべきデータ(JPEG回路80から)
UNPACK_DATA: UNPACKすべきデータ
【0032】
各入力データ系列に対してVALID信号(入力)およびSTOP信号(出力)が付属し、各出力データ系列に対してVALID信号(出力)およびSTOP信号(入力)が付属する。
【0033】
データ変換コア104の出力データに付随して、データ変換コア104に入力されるSTOP信号はDPCM_OUT_STOP、PACK_STOPおよびCCD_OUT_STOPの三種類である。
【0034】
これらのSTOP信号を‘1’にしているブロックは、データ変換コア104から出力されるデータを受け取れないことを意味し、データ変換コア104の出力データは無効になる。従って、これらのSTOP信号の何れかが‘1’かつ対応するVALID信号が‘1’のとき、データ変換コア104内部のすべてのフリップフロップ(バッファ)は保持状態になり、すべてのSTOP信号が‘0’になるまでデータの更新は一切行われない。
【0035】
一方、データ変換コア104の入力データに付随して、データ変換コア104から出力されるSTOP信号はCCD_IN_STOP、DPCM_IN_STOPおよびUNPACK_STOPの三種類である。
【0036】
これらのSTOP信号が‘1’のとき、データ変換コア104は入力データを受け取れないことを意味し、STOP信号が接続されるブロックからの入力データはSTOP信号が‘0’になるまで更新されない。従って、データ変換コア104の制御信号発生器180または182は、データ変換コア104内部の動作状態に応じて次のデータ入力を遅らせる場合、あるいは、複数のブロックからデータを受け取ってそれらデータの待ち合わせ処理を行う場合に、該当ブロックに送るSTOP信号を‘1’にすることで、データ変換コア104へ入力されるデータの更新を一時的に中断させることができる。
【0037】
●CCD-RAWデータの可逆圧縮
CCD-RAWデータを可逆圧縮する場合のデータ変換コア104の動作は以下のとおりである。
【0038】
圧縮対象のCCD-RAWデータ(CCD_IN_DATA)は、VALID信号(CCD_IN_VALID)が‘1’のときにバッファ184に読み込まれ、VALID信号(CCD_IN_VALID)が‘0’のときはバッファ184に読み込まれたCCD-RAWデータが保持される。バッファ184に保持されるCCD-RAWデータのデータフォーマットの一例を図5に示す。CCD-RAWデータのデータ幅にかかわらず、バッファ184に保持されたデータの第11ビットから第2ビットまでの10ビットのデータがDPCM変換回路108に転送され、DPCM変換が行われる。DPCM変換されたデータは、一旦バッファ190に保持された後、データ変換コア104から出力される。制御信号発生器180は、入力されるVALID信号(CCD_IN_VALID)から、DPCM変換されたデータに対応するVALID信号(DPCM_OUT_VALID)を作成して、DPCM変換されたデータに合わせて出力する。
【0039】
CCD-RAWデータのデータ幅が12ビットの場合、図2に示したフォーマットに従い、下位2ビットの分離およびPACK処理が行われる。バッファ184に保持されたデータの下位2ビットは、バッファ200から214までの八個のバッファの何れかに保持される。制御信号発生器180は、入力されるVALID信号(CCD_IN_VALID)をカウントすることで、バッファ184に保持されたデータが何番目に入力されたデータであるかを判断し、その判断結果に基づき、バッファ200から214の何れかを選択する8ビットの制御信号を発生する。8ビットの制御信号の対応するビットが‘1’のバッファは、バッファ184から2ビットのデータを読み込むことでデータの更新する。一方、8ビットの制御信号の対応するビットが‘0’のバッファはデータを保持する。
【0040】
バッファ200から214の出力はバッファ192に接続される。バッファ192のデータは、制御信号発生器180の制御信号によって入力8データごとに更新され、更新されたデータはPACKされたデータとして出力される。このとき、制御信号発生器180はPACKデータに対応する‘1’のVALID信号(PACK_VALID)を出力する。
【0041】
●CCD-RAWデータの伸長
CCD-RAWデータを伸長する場合のデータ変換コア104の動作は以下のとおりである。
【0042】
逆DPCM変換されるべきDPCMデータ(DPCM_IN_DATA)は、VALID信号(DPCM_IN_VALID)が‘1’のときバッファ188に読み込まれ、VALID信号(DPCM_IN_VALID)が‘0’のときはバッファ188に読み込まれたDPCMデータが保持される。バッファ188に保持されたDPCMデータは、DPCM変換回路108によって逆DPCM変換され、逆変換された10ビットデータはバッファ194の第11ビットから第2ビットに入力される。圧縮記録されたCCD-RAWデータの元のデータ幅が10ビットの場合は、マルチプレクサ198を介して、バッファ194の下位2ビットに対応する‘00’がダミーデータとしてバッファ194に入力される。バッファ194の出力は、伸長されたCCD-RAWデータ(CCD_OUT_DATA)として出力される。制御信号発生器182は、入力されるVALID信号(DPCM_IN_VALID)から伸長されたデータに対するVALID信号(CCD_OUT_VALID)を作成して、CCD-RAWデータに合わせて出力する。
【0043】
圧縮記録されたCCD-RAWデータの元のデータ幅が12ビットの場合、図2に示したフォーマットに従い、下位2ビットのUNPACKおよび合成処理が行われる。UNPACKすべきデータ(UNPACK_DATA)は、VALID信号(UNPACK_VALID)が‘1’のときバッファ186に読み込まれ、VALID信号(UNPACK_VALID)が‘0’のときはバッファ186に読み込まれたデータが保持される。バッファ186に保持されたデータは、マルチプレクサ196によって2ビットずつ読み出され、マルチプレクサ198を介してバッファ194の下位2ビットに接続される。
【0044】
マルチプレクサ196がどの2ビットを選択するかは、制御信号発生器182の4ビットの制御信号により決定される。制御信号発生器182は、入力されるVALID信号(DPCM_IN_VALID)をカウントすることにより、バッファ194に入力されている10ビットデータが何番目であるのか判断し4ビットの制御信号を発生する。また、マルチプレクサ198に、マルチプレクサ196の出力を選択させるか、ダミーデータ‘00’を選択させるかの制御も、この4ビットの制御信号によって行われる。
【0045】
バッファ194において合成された12ビットのデータは、伸長されたCCD-RAWデータ(CCD_OUT_DATA)として出力される。制御信号発生器182は、入力されるVALID信号(DPCM_IN_VALID)から伸長されたデータに対応するVALID信号(CCD_OUT_VALID)を作成して、CCD-RAWデータに合わせて出力する。
【0046】
また、バッファ186のデータは逆DPCM変換されるデータ八個に付き一回しか更新されない。従って、制御信号発生器182は、入力されるVALID信号(DPCM_IN_VALID)をカウントしながら、STOP信号(UNPACK_STOP)を作成し出力することで、上位10ビットのデータと下位2ビットとのデータの待ち合わせ処理を容易に行う。
【0047】
●待ち合わせ処理
図6は待ち合わせ処理の具体例を示すタイミングチャートである。
【0048】
以下では、説明を簡単にするために、DPCM変換回路108からバッファ254へ送られるデータを10bit_DATA、10bit_DATAに伴うVALID信号およびSTOP信号をそれぞれ10bit_VALIDおよび10bit_STOPとして説明する。実際には、制御信号発生器182がDPCM変換回路108のデータ遅延を考慮して制御を行う。
【0049】
タイミングt1において、UNPACK_VALID信号が‘1’、UNPACK_STOP信号が‘0’であるから、UNPACK_DATAであるP1はバッファ186に読み込まれる。UNPACK_DATAは八個の10bit_DATAに対して二回しか更新されないので、次のタイミングt2においてUNPACK_DATAのP2に更新されないように、制御信号発生器182はUNPACK_STOP信号を‘1’にする。
【0050】
タイミングt2において、10bit_VALID信号が‘1’であるので、選択されたデータD1およびP1はバッファ194で合成されてCCD_OUT_DATAとして出力される。制御信号発生器182はCCD_OUT_VALID信号を‘1’にする。
【0051】
タイミングt8において、選択されたデータD7およびP1は、バッファ194で合成されてCCD_OUT_DATAとして出力される。タイミングt8の処理により七つのデータの合成処理が終了するので、次のタイミングt9において八つ目のデータの合成処理が処理終了した後にバッファ186のデータを更新する必要がある。そのために、タイミングt8で、制御信号発生器182はUNPACK_STOP信号を‘1’から‘0’にする。
【0052】
タイミングt9において、選択されたデータD8およびP1は、バッファ194で合成されてCCD_OUT_DATAとして出力される。一方、UNPACK_DATAのP2は、バッファ186に読み込まれる。そして、タイミングt1と同様に、制御信号発生器182はUNPACK_STOP信号を‘1’にする。
【0053】
タイミングt10において、選択されたデータD9およびP2は、バッファ194で合成されてCCD_OUT_DATAとして出力される。また、UNPACK_VALID信号は‘0’であるからSTOP信号を出す必要がないので、制御信号発生器182はUNPACK_STOP信号を‘0’にする。
【0054】
タイミングt17において、選択されたデータD16およびP2は、バッファ194で合成されてCCD_OUT_DATAとして出力される。タイミングt17の処理によりD9からD16の八つのデータの合成処理が終了するので、バッファ186のデータを更新する必要がある。しかし、UNPACK_VALID信号が‘0’で、UNPACK_DATAは不定である。そのため、次のタイミングt18では合成処理ができないので、制御信号発生器182は10bit_DATAが更新されないように10bit_STOP信号を‘1’にする。
【0055】
タイミングt18において、10bit_STOP信号が‘1’であるから10bit_DATAはD17のまま更新されない。また、UNPACK_VALID信号が‘1’であるので、UNPACK_DATAのP3がバッファ186に読み込まれる。タイミングt1と同様に、制御信号発生器182はUNPACK_STOP信号を‘1’にする。
【0056】
タイミングt19において、選択されたデータD17およびP3は、バッファ194で合成されてCCD_OUT_DATAとして出力される。
【0057】
このように、データ変換コア104は、STOP信号を必要に応じて出力することで、容易に待ち合わせ処理を実現する。また、データ変換コア104によってハードウェア的に待ち合わせ処理が実現されることにより、各回路ブロック間のデータ転送制御を、システム制御回路30はほとんど行う必要がない。
【0058】
[インタフェイス回路]
上記のように、データ変換コア104は、VALID信号およびSTOP信号により、二つのブロックからデータを受け取る場合の待ち合わせ処理を容易に実現する。しかし、他のブロックとの間でデータのハンドシェイクを実際に行うためには、データ変換コア104の周辺にVALID信号およびSTOP信号を制御するインタフェイス回路102が必要になる。
【0059】
図7はインタフェイス回路102の最も基本的な構成例を示すブロック図である。
【0060】
データ変換回路100に対応する演算ユニット302は、演算ユニット300および304とデータのハンドシェイクを行うインタフェイス回路102と、入力されデータに処理を施すデータ変換コア104に対応する演算回路308によって構成される。システムを構成する複数の演算ユニットは、演算ユニット302の構成を基本とし、すべてのブロックは同様の構成で設計されている。
【0061】
ユニット間を伝播するすべてのデータ系列は、各データ系列に対して一対のVALID信号およびSTOP信号を伴う。装置内における各演算ユニット間のデータ転送はすべて、これらの信号によって制御される。
【0062】
VALID信号は、各演算ユニット間を転送されるデータ系列が、あるタイミングにおいて有効なデータであることを示し、データ系列の伝播方向と同じ方向に伝播される。本実施形態において、VALID信号が‘1’であるサイクルは、そのデータ系列は有効であることを意味し、有効なデータ系列は1サイクルのみ出力される。
【0063】
STOP信号は、データを受け取るべき演算ユニットがデータ処理中などのために、次のタイミングに入力されるデータを処理することができない場合に、入力されるデータ系列のデータ更新を停止するように指示する信号で、データ系列の伝播方向と逆の方向に伝播される。本実施形態において、STOP信号が‘1’であるサイクルは、その演算ユニットがデータ処理ができないことを意味する。
【0064】
インタフェイス回路102の目的は、既に述べたように、データ処理を行う演算回路308の設計を容易にすることと、システム全体の制御を容易にすることである。
【0065】
演算回路308は、あるタイミングにおいて、入力されるVALID_IN信号が‘1’の場合にのみデータを受け取り必要なデータ処理を行う。また、後段に接続された演算ユニット304へ有効なデータ転送を行う際は、VALID_OUT信号を‘1’にセットする。ただし、VALID_OUT信号が‘1’であるサイクルであっても、後段に接続された演算ユニット304からのSTOP信号であるOUT_STOP信号が‘1’である場合は、演算回路308へのSTOP信号であるSTOP_OUT信号が‘1’になる。つまり、演算ユニット302がデータ更新を行うことができないので、演算回路308におけるすべての内部状態が保持される。また、演算ユニット302の前段に接続された演算ユニット300からのデータ転送を停止したい場合は、STOP_IN信号を‘1’にセットする。つまり、VALID_IN信号が‘1’、並びに、STOP_IN信号およびSTOP_OUT信号が‘0’のときにのみ演算回路308は有効なデータの取り込みを行う。
【0066】
実際のデータ処理においては、演算回路308に入力されるVALID信号をカウントするだけで大抵の制御を行うことができる。
【0067】
インタフェイス回路102は、実際データ処理を行う演算回路308の周辺に位置し、隣接する演算ユニットとデータのハンドシェイクを行う。インタフェイス回路102の基本構成は、入力データであるIN_DATAのバス幅(nビット)に相当するn個のDフリップフロップなどから構成されるバッファ110と、一個のDフリップフロップ、n+1ビット出力のデータセレクタ114および複数の論理ゲートで構成される。
【0068】
[インタフェイス回路の機能]
図8Aおよび8Bはデータ、VALID信号およびSTOP信号の関係を詳細に示すタイミングチャートで、インタフェイス回路102の機能を説明するものである。なお、本実施形態における演算回路308、演算ユニット300および演算ユニット304の動作は、説明のための動作を仮定しているに過ぎない。なお、図8Aおよび図8Bは一連のタイミングチャートである。
【0069】
タイミングt0において、D-FF112の出力はリセット信号RESETにより‘0’にリセットされる。その結果、演算ユニット302から出力されるIN_STOP信号は‘0’になる。セレクタ114はデータ入力側(非バッファ110側)にセットされるので、IN_DATAおよびIN_VALID信号が演算回路308のDATA_INおよびVALID_IN信号に直結される。
【0070】
タイミングt1においては、入力データであるDATA_INが不定、演算回路308へ入力されるVALID_IN信号が‘0’であるから、演算ユニット302は一切の処理を行わない。t1直後に、前段に接続された演算ユニット300からの入力データであるIN_DATAが確定し、IN_VALID信号が‘1’に変化するので、演算回路308へ入力されるVALID_IN信号は‘1’に変化する。
【0071】
タイミングt2およびt3においては、演算回路308へ入力されるVALID_IN信号が‘1’、STOP_IN信号およびSTOP_OUT信号が‘0’であるから、IN_DATAのD1およびD2は、セレクタ114を介して有効なデータとして演算回路308に読み込まれ処理される。
【0072】
タイミングt4においては、演算回路308へ入力されるVALID_IN信号は‘1’であるが、演算回路308から出力されるSTOP_IN信号が‘1’を示している。つまり、演算回路308が現在データ処理中のため、次のデータを受け取ることができないことを意味する。この場合、VALID_IN信号およびSTOP_IN信号の論理積である論理ゲート118の出力はD-FF112を‘1’にセットして、演算ユニット300へ‘1’のIN_STOP信号を出力すると同時に、セレクタ114をバッファ110側にセットする。IN_STOP信号は、前記した論理ゲート124と同様の作用により、IN_VALID信号を‘1’から‘0’に変化させる。また、論理ゲート118およびD-FF112の出力は、論理ゲート116を介してバッファ110のLOAD信号(LD)になる。従って、タイミングt4において、IN_DATAのD3はバッファ110に読み込まれ、読み込まれたデータD3*が演算回路308へのDATA_INとして出力される。
【0073】
タイミングt5においては、演算ユニット302から出力されるIN_STOP信号が‘1’であるから、演算ユニット300から出力されるIN_DATAは更新されない。また、演算回路308へ入力されるVALID_IN信号および演算回路308から出力されるSTOP_IN信号は‘1’のままであるので、D-FF112は引き続き‘1’にセットされる。また、バッファ110の更新も行われない。
【0074】
タイミングt6においては、演算ユニット302から出力されるIN_STOP信号が‘1’であるから、演算ユニット300から出力されるIN_DATAは更新されない。しかし、演算回路308へ入力されるVALID_IN信号が‘1’のままで、演算回路308から出力されるSTOP_IN信号が‘0’になるから、DATA_INに接続されているバッファ110のデータD3*は演算回路308に読み込まれ処理される。また、STOP_IN信号は、論理ゲート118を介してD-FF112を‘0’にリセットし、演算ユニット302から出力されるIN_STOP信号を‘0’にする。そして、セレクタ114はデータ入力側を選択するので、演算回路308のDATA_INは再び演算ユニット302のIN_DATAと直結される。さらに、IN_STOP信号は、前記したゲート回路124と同様の作用により、IN_VALID信号を‘0’から‘1’に変化させる。
【0075】
タイミングt7においては、演算回路308へ入力されるVALID_IN信号が‘1’であり、演算回路308から出力されるSTOP_IN信号および演算回路308へ入力されるSTOP_OUT信号が‘0’であるから、IN_DATAのD4はセレクタ114を介して有効なデータとして演算回路308に読み込まれ処理される。また、演算ユニット302から出力されるIN_STOP信号が‘0’であるから、演算ユニット300から出力されるデータは更新される。
【0076】
タイミングt8においては、タイミングt7と同様に、IN_DATAのD5は演算回路308において処理され、IN_DATAは更新される。
【0077】
タイミングt9においては、演算ユニット304へ入力されるIN_VALID信号が‘0’であるから、IN_DATAが無効(不定)を意味する。IN_DATAは演算回路308のDATA_INへ接続されているが、無効なデータであるため演算回路308は処理を行わない。なお、本実施形態においてはIN_DATAが不定であるとしたが、演算ユニット300からのIN_DATAがD5のまま更新されない場合、IN_VALID信号は‘0’になるよう設計されていることは前記したとおりである。
【0078】
タイミングt10において、演算ユニット302へ入力されるIN_DATAはタイミングt9と同様にして無視される。一方、演算回路308から出力されるVALID_OUT信号は‘1’であり、演算ユニット304へ入力さるOUT_STOP信号は‘0’であるから、OUT_VALID信号に‘1’が出力される。DATA_OUTのd1はOUT_DATAを介して演算ユニット304へ転送され、演算ユニット304において有効なデータとして処理される。
【0079】
タイミングt11およびt12においては、タイミングt7と同様に、演算ユニット300から入力されるIN_DATAのD6およびD7が演算回路308によって処理され、データは更新される。タイミングt10と同様に、演算回路308から出力されるOUT_DATAのd2およびd3は演算ユニット304で処理され、データは更新される。また、演算ユニット304は、OUT_DATAのd3を受け取った直後のタイミングt13において新しいデータを受け取ることができないため、演算ユニット302へ出力するOUT_STOP信号を‘1’にする。これは、タイミングt4において、演算ユニット302が演算ユニット300へ出力するIN_STOP信号を‘0’から‘1’に変化させた処理と同様である。演算ユニット304から出力されるOUT_STOP信号は、論理ゲート124を介してOUT_VALID信号を‘1’から‘0’に変化させる。さらに、演算回路308のVALID_OUT信号が‘1’であるので、次のタイミングt13において、DATA_OUTのd4を更新しないように、論理ゲート122を介してSTOP_OUT信号を‘0’から‘1’に変化させる。
【0080】
タイミングt13においては、演算ユニット304から出力されるOUT_STOP信号が‘1’、演算回路308から出力されるVALID_OUT信号が‘1’、および、演算ユニット300から入力されるIN_VALID信号も‘1’である。これは、後段の演算ユニット304がデータを受け取ることができないタイミングにおいて、前段の演算ユニット300および演算ユニット302が有効なデータを転送しようとしている状況である。
【0081】
演算回路308から出力される有効なDATA_OUTのd4は、タイミングt12において述べたように、STOP_OUT信号が‘1’にセットされているのでタイミングt13において更新されない。また、タイミングt4と同様にして、演算回路104へ入力されるVALID_IN信号およびSTOP_OUT信号は、論理ゲート118を介してD-FF112を‘1’にセットし、演算ユニット300へ出力されるIN_STOP信号を‘1’にセットするとともに、セレクタ114にバッファ110側を選択させる。IN_STOP信号は、前記した論理ゲート124と同様の作用により、IN_VALID信号を‘1’から‘0’に変化させる。また、IN_DATAのD8は、バッファ110に読み込まれ、読み込まれたデータD8*が演算回路308のDATA_INへ接続される。
【0082】
タイミングt14においては、演算ユニット300へ入力されるIN_STOP信号が‘1’であるので、IN_DATAは更新されない。演算ユニット304へ入力されるOUT_STOP信号は‘1’のままであるので、演算回路308から出力されるDATA_OUT信号も更新されない。タイミングt6における演算ユニット300へ出力されるIN_STOP信号の処理と同様に、タイミングt14における演算ユニット304の処理の結果、OUT_STOP信号は‘1’から‘0’に変化する。論理ゲート124を介して、演算ユニット100から出力されるOUT_VALID信号を‘1’に、論理ゲート122を介して、演算回路308へ入力されるSTOP_OUT信号を‘0’に変化させる。
【0083】
タイミングt15においては、演算ユニット304へ入力されるOUT_VALID信号が‘1’、演算ユニット304から出力されるOUT_STOP信号が‘0’であるから、演算回路308から出力されるDATA_OUTのd4は有効なデータとして演算ユニット304において処理され、DATA_OUTは更新される。また、演算ユニット300へ入力されるIN_STOP信号は‘1’であるから、演算ユニット300から出力されるIN_DATAは更新されない。しかし、演算回路308へ入力されるVALID_IN信号が‘1’、演算回路308から出力されるSTOP_IN信号および演算回路308へ入力されるSTOP_OUT信号が‘0’であるから、DATA_INに接続されているバッファ110のデータD8*は、演算回路308に入力され処理される。また、論理ゲート122の出力は、論理ゲート118を介してD-FF112を‘0’にリセットし、演算ユニット300へ出力されるIN_STOP信号を‘0’にセットする。これとほぼ同時に、セレクタ114にデータ入力側を選択させる。さらに、IN_STOP信号はIN_VALID信号を‘0’から‘1’に変化させる。
【0084】
タイミングt16においては、タイミングt7と同様に、演算ユニット300から出力されるIN_DATAのD9は、演算回路308で処理され、IN_DATAは更新される。
【0085】
タイミングt17においては、演算ユニット304から出力されるOUT_STOP信号が‘1’であるが、演算ユニット300および演算ユニット302は何れも有効なデータを転送しようとしていないので、問題はない。
【0086】
このように、インタフェイス回路102の機能は、データ変換回路100に対応する演算ユニット302がデータを受け取れない場合、あるいは、後段の演算ユニット304がデータを受け取れずに演算ユニット302の動作が停止するような場合に、前段の演算ユニット300から転送されてくるデータを一時的にバッファに記憶し、前段の演算ユニット300のデータ更新を停止させる機能を果たす。また、インタフェイス回路102は、以下に示すように、その一部構成を変更するだけで、すべての演算ユニット(回路ブロック)に対してもテンプレート的に使用することができる。
【0087】
図9および図10はインタフェイス回路102の圧縮および伸長時の動作をそれぞれ示すブロック図で、基本的な構成は図7と同じである。
【0088】
圧縮時には、データ変換コア104から出力されるデータが二種類あり、後段のブロックはJPEG回路80およびメモリ制御回路40bの二つになる。そのため、ORゲート120を三入力に変更して二種類の出力データに対応する。
【0089】
伸長時には、データ変換コア104へ入力されるデータが二種類あり、前段のブロックはJPEG回路80およびメモリ制御回路40dの二つになる。そのため、後段のブロックに相当するメモリ制御回路40cから出力されるSTOP信号をORゲート120aおよび120bに供給して二種類の入力データに対応する。
【0090】
[画像の記録処理]
画像処理装置1000は、モードダイアル32に撮影モードが設定されている場合、撮影レンズ10、撮像素子12およびA/D変換器14によって得られる撮影画像のCCD-RAWデータを、画像処理した後または直接、記録媒体70へ格納する。図11は撮影画像の記録処理に関する画像処理装置1000の動作例を示すフローチャートで、システム制御回路30によって実行されるものである。
【0091】
図11において、読出専用メモリ36に格納されているハフマンテーブルの一つがJPEG回路80に設定される(S100)。使用されるハフマンテーブルは、記録モードがJPEGモードの場合と、CCD-RAW可逆圧縮モードの場合とで異なり、DCTされたデータ系列に適したハフマンテーブル、または、DPCM変換されたデータ系列に適したハフマンテーブルが使用される。
【0092】
読出専用メモリ36には、前記二種類のデータ系列それぞれに対して複数のハフマンテーブルが格納されている。それらのハフマンテーブルは、それぞれ類似性の高い特徴をもつ複数の画像データから得られる平均的なヒストグラムから生成されたものである。従って、基の画像データに類似する画像データに対して効率的な符号化を提供する。
【0093】
次に、記録モードスイッチ34の設定を判定する(S101)。記録モードがJPEGモードであれば、メモリ60に保持されたCCD-RAWデータを、メモリ制御回路40を介して、画像処理回路50へ送る(S102)。画像処理回路50はCCD-RAWデータに画像処理を施す(S103)。画像処理されたデータは、メモリ制御回路40を介して、JPEG回路80に送られ、DCTおよび量子化される(S104)。
【0094】
一方、記録モードスイッチ34の設定がCCD-RAWモードであれば、メモリ60に保持されたCCD-RAWデータを、メモリ制御回路40およびインタフェイス回路102を介して、データ変換コア104に送る(S110)。そして、CCD-RAWデータのデータ幅を判定し(S111)、12ビットの場合は分割・合成回路106に分割・PACK処理を行わせ(S113)、PACKされたデータをメモリ制御回路40を介してメモリ60に送らせる(S114)。10ビット幅のCCD-RAWデータ、または、12ビット幅のCCD-RAWデータから分離された上位10ビットのデータは、DPCM変換回路108によりDPCM変換される(S112)。
【0095】
DCTおよび量子化、または、DPCM変換されたデータは、JPEG回路80のハフマン符号・復号回路86に設定されているハフマンテーブルに従いハフマン符号化される(S105)。ハフマン符号化されたデータは、メモリ制御回路40を介して、メモリ60に送られる(S106)。
【0096】
例えば一画像分の符号がメモリ60に格納されると、メモリ60に新たに格納されたハフマン符号と、前回の符号化によりメモリ60に格納されたハフマン符号とのデータサイズが比較され(S107)、データサイズの小さいハフマン符号がメモリ60に保持される。続いて、すべてのハフマンテーブルによる符号化が終了したか否かが判定され(S108)、未了であればステップ100へ戻り、新たなハフマンテーブルがJPEG回路80に設定され、符号化が繰り返される。この符号化の繰り返しによって、異なるハフマンテーブルによって得られる複数のハフマン符号の中でデータサイズが最小のものが選択されることになる。
【0097】
その後、メモリ60に格納された符号は、メモリ制御回路40を介して、記録媒体70にデータファイルとして格納される(S109)。その際、ハフマン符号化されたデータおよびPACKされたデータは、記録(撮影)条件などを含むヘッダデータとともにCCD-RAW可逆圧縮データとして格納される。なお、ヘッダデータに関しては、図13を参照して後述する。
【0098】
このように、本実施形態においては、複数のハフマンテーブルを予め用意して、一つのデータに対して複数回符号化を実行することにより、標準的に提供される単一のハフマンテーブルを用いる圧縮に比べて、圧縮率の点で効果的な圧縮を行うことができる。
【0099】
●再生モード
画像処理装置1000は、モードダイアル32に再生モードが設定されている場合、記録媒体70に格納された画像データファイルに記録された画像を画像表示部22に表示する。図12は画像の再生処理に関する画像処理装置1000の動作例を示すフローチャートで、システム制御回路30によって実行されるものである。
【0100】
記録媒体70に格納された画像データファイルは、メモリ制御回路40を介して、メモリ60に読み込まれ(S201)、システム制御回路30によってヘッダデータが解析される(S202)。ヘッダデータを解析した結果を判定し(S203)、記録モードがJPEGモードであるならば、メモリ60に保持されたJPEGデータをメモリ制御回路40を介してJPEG回路80に送り、JPEGデータを復号させる(S204)。つまり、JPEGデータは、ハフマン符号復号回路86によってハフマン復号され、DCT・量子化回路82によって逆量子化および逆DCTされる。その後、復号された画像データはメモリ制御回路40を介してメモリ60に格納される(S205)。メモリ60に保持された画像データは、メモリ制御回路40およびD/A変換器20を介して画像表示部22に送られ、画像が表示される(S206)。
【0101】
ヘッダデータを解析した結果がCCD-RAWモードであれば、メモリ60に保持されたハフマン符号化されたデータを、メモリ制御回路40を介してJPEG回路80に送り、ハフマン符号・復号回路86にハフマン復号させ(S207)、ハフマン復号されたデータをDPCM変換回路108で逆DPCM変換する(S208)。
【0102】
そして、ヘッダデータの解析結果を判定して(S209)、CCD-RAWデータが10ビットの場合は、逆DPCM変換により得られた10ビットのCCD-RAWデータが、インタフェイス回路102およびメモリ制御回路40を介して、メモリ60に格納される(S211)。また、CCD-RAWデータが12ビットの場合は、メモリ60に保持されたPACKデータを、メモリ制御回路40およびインタフェイス回路102を介して、データ変換コア104に送り、分割・合成回路106にUNPACK処理、並びに、UNPACK処理により得られる下位2ビットのデータと、逆DPCM変換により得られる上位10ビットのデータとの合成処理を行わせる(S210)。復元された12ビットのCCD-RAWデータは、インタフェイス回路102およびメモリ制御回路40を介して、メモリ60に格納される(S211)。
【0103】
メモリ60に格納されたCCD-RAWデータは、メモリ制御回路40を介して画像処理回路50に送られて画像処理が施される(S212)。画像処理によって得られたRGB画像データは、画像処理回路40を介してメモリ60に格納される(S205)。メモリ60に保持された画像データは、メモリ制御回路40およびD/A変換器20を介して画像表示部22に送られ、画像が表示される(S206)。
【0104】
●データフォーマット
図13は記録媒体70に記録されるCCD-RAW可逆圧縮データの基本フォーマット例を示す図である。
【0105】
図13に示す基本フォーマットの先頭にはヘッダデータが記録される。ヘッダデータの最初の1ビットは記録モードMODEを示し、‘0’の場合は10ビットのCCD-RAWデータ、‘1’の場合は12ビットのCCD-RAWデータを示す。続く、15ビットには撮像素子12の水平方向の画素数を表す12ビットの数値SIZE_Hが下詰めで記録される。続く16ビットには撮像素子12の垂直方向の画素数を示す12ビットの数値SIZE_Vが下詰めで記録される。続いて、下式から計算されるデータサイズのPACKデータが記録され、PACKデータに続き、ハフマン符号が記録される。
データサイズ = MODE × SIZE_H × SIZE_V /(8×8) [bytes]
【0106】
また、CCD-RAW可逆圧縮データのデータファイルか、JPEGファイルかは、データファイルの先頭4ビットで判断できる。JPEGファイルの場合には“FFD8”のコードでファイルが始まるので先頭4ビットは‘1111’になる。一方、CCD-RAW可逆圧縮データの場合は‘0000’または‘1000’になる。
【0107】
以上説明したように、本実施形態によれば、既存のベースラインJPEG符号化・復号回路を用いて、10または12ビットのCCD-RAWデータ用のCCD-RAW可逆圧縮・伸長回路を実現することができる。つまり、画像データの利用目的などに応じて、JPEG記録モードまたはCCD-RAW可逆圧縮記録モードを選択することができる。従って、JPEG符号化を行う場合の量子化によるデータの損失(画質劣化)を防ぎたい場合は、CCD-RAWデータを可逆圧縮して記録媒体に保存することができる。その上、圧縮されたCCD-RAWデータ(とくに12ビットのCCD-RAWデータ)は、CCD-RAW形式のままデータを保存する場合に比べて充分に小さなデータサイズにすることができる。
【0108】
また、言い換えれば、既存のベースラインJPEG符号化・復号回路の一部を、CCD-RAW可逆圧縮・伸長処理に流用することができるので、そのような回路を必要とする機器の開発にかかる負荷を軽減し、より小さな回路規模でそのような機器を実現することができる。
【0109】
さらに、本実施形態においては、複数のハフマンテーブルを予め用意して、一つのデータに対して複数回符号化を実行することにより、標準的に提供される単一のハフマンテーブルによる圧縮よりも、圧縮率の点で効果的な圧縮を行うことができる。
【0110】
このハフマンテーブルの選択供給は、システム制御部30によって選択的に行われるので、画像圧縮・伸長部に変更を加えることなく容易に実現される。さらに、圧縮すべきデータそれぞれに対してハフマンテーブルを生成する必要がないので、ハフマンテーブルを生成するためのソフトウェア開発などの負荷も軽減することができる。
【0111】
なお、上述した実施形態においては、例えば電子カメラ(ディジタルカメラ)のような撮像素子を備える画像処理装置を説明したが、コンピュータや画像出力装置などで同様の処理を行わせることもできる。
【0112】
【他の実施形態】
なお、本発明は、複数の機器(例えばホストコンピュータ、インタフェイス機器、リーダ、プリンタなど)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機、ファクシミリ装置など)に適用してもよい。
【0113】
また、本発明の目的は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体(または記録媒体)を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行することによっても、達成されることは言うまでもない。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。また、コンピュータが読み出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0114】
さらに、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張カードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0115】
本発明を上記記憶媒体に適用する場合、その記憶媒体には、先に説明した(図11および/または図12に示す)フローチャートに対応するプログラムコードが格納されることになる。
【0116】
また、本発明の適用は、ディジタルカメラのような画像処理装置およびその記録媒体に限定されない。例えば、ディジタルカメラのような画像処理装置によって撮影された画像の画像データをCD-ROMやDVD-ROMのようなメディアを使用して配布する場合に、表示、印刷、検索などの通常の用途に利用される画像データはJPEG符号化してCD-ROMなどに記録し、印刷用の色分版作成、CG作成など任意の画像処理を必要とする画像データはCCD-RAW形式でCD-ROMなどに記録する場合に、本発明の画像データの圧縮・伸長方法が利用できる。また、そのような形態で画像データが記録(格納)されたメディアも本発明に含まれる。
【0117】
【発明の効果】
以上説明したように、本発明によれば、画像データ(例えば、 CCD-RAW データ)の効果的な符号化を実現する画像処理装置を提供することができる。
【図面の簡単な説明】
【図1】本発明にかかる一実施形態の画像処理装置の構成例を示すブロック図、
【図2】分割およびPACK処理、並びに、UNPACKおよび合成処理におけるデータフォーマットを示す図、
【図3】カラーフィルタ配列の一例を示す図、
【図4】図1に示すデータ変換コアの詳細な構成例を示すブロック図、
【図5】 CCD-RAWデータのデータフォーマットの一例を示す図、
【図6】待ち合わせ処理の具体例を示すタイミングチャート、
【図7】図1に示すインタフェイス回路の最も基本的な構成例を示すブロック図、
【図8A】データ、VALID信号およびSTOP信号の関係を詳細に示すタイミングチャート、
【図8B】データ、VALID信号およびSTOP信号の関係を詳細に示すタイミングチャート、
【図9】インタフェイス回路の圧縮動作を示すブロック図、
【図10】インタフェイス回路の伸長動作を示すブロック図、
【図11】撮影画像の記録処理に関する画像処理装置の動作例を示すフローチャート、
【図12】画像の再生処理に関する画像処理装置の動作例を示すフローチャート、
【図13】記録媒体に記録されるCCD-RAW可逆圧縮データの基本フォーマット例を示す図である。[0001]
BACKGROUND OF THE INVENTION
The present invention,Image processing apparatus for processing image data obtained by an image sensorIn placeaboutThe
[0002]
[Prior art]
When compressing and recording images or arbitrary input data, the input data series is subjected to orthogonal transform such as discrete cosine transform (DCT) or DPCM (Differential Pulse Modulation Modulation) to reduce the entropy of the input data series. The input data is compressed by entropy coding represented by Huffman code or arithmetic code.
[0003]
Huffman coding achieves data compression by assigning short codewords to data with high appearance frequency and long codewords to data with low appearance frequency from the histogram of the input data series, and reducing the data size on average. .
[0004]
In the JPEG baseline method using DCT and Huffman coding, coding processing is performed according to a set Huffman table. All information necessary for encoding is described in the Huffman table, and the description content is generated from the histogram of the data series to be encoded.
[0005]
[Problems to be solved by the invention]
In order to realize the most effective encoding in Huffman encoding, it is necessary to calculate a histogram of a data sequence to be encoded and generate a unique Huffman table corresponding to each data sequence.
[0006]
However, in the image compression / decompression of a digital camera (electronic camera) or the like, a single Huffman table provided as a standard is used because of problems such as processing speed. Therefore, effective encoding (compression) is not always realized.
[0007]
The present inventionImage data (for example, CCD-RAW Data)Image processing device that realizes effective codingPlaceThe purpose is to provide.
[0008]
In the image processing apparatus according to the present invention, in the case where the output signal of the image sensor is digitized and converted into first image data, and the number of bits of the first image data is the first number of bits The first image data is encoded according to a first encoding method, and the number of bits of the first image data is larger than the first number of bits.First 2 Is the number of bitsIn this case, the first image data is divided into first partial data for the first number of bits and second partial data having a portion other than the first partial data, and the first Encoding means for encoding the partial data according to the first encoding method, and storing the first image data on a recording medium, and the number of bits of the first image data is the first When the number of bits is 1, the first image data encoded by the encoding means is stored in the recording medium, the first image data is stored in the recording medium, And the number of bits of the first image data isFirst 2 Is the number of bitsIn some cases, the recording apparatus may include recording means for storing the first partial data encoded by the encoding means and the second partial data in the recording medium.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an image processing apparatus according to an embodiment of the present invention will be described in detail with reference to the drawings.
[0014]
[Constitution]
FIG. 1 is a block diagram showing a configuration example of an
[0015]
An image of the object to be photographed is optically formed on an
[0016]
The
[0017]
The
[0018]
The
[0019]
The
[0020]
[0021]
The data conversion circuit 100 is a circuit that performs data conversion for lossless compression / decompression of CCD-RAW data using the Huffman encoding /
[0022]
The
[0023]
The Huffman encoding /
[0024]
When the CCD-RAW data is 12 bits at the time of compression, the dividing / combining
[0025]
The
[0026]
This embodiment corresponds to the
[0027]
The data selector 90 switches the data flow according to JPEG encoding / decoding and when performing lossless compression / decompression of CCD-RAW data, that is, according to a recording mode described later.
[0028]
The
[0029]
The
[0030]
[Data conversion core]
FIG. 4 is a block diagram illustrating a detailed configuration example of the
[0031]
A pair of VALID signals and STOP signals exist in all data series input to and output from the
CCD_IN_DATA: CCD-RAW data to be compressed (from memory control circuit 40)
DPCM_OUT_DATA: DPCM converted data (to JPEG circuit 80)
PACK_DATA: Packed lower 2 bits data (to memory control circuit 40)
CCD_OUT_DATA: Expanded CCD-RAW data (to memory control circuit 40)
DPCM_IN_DATA: Data to be subjected to inverse DPCM conversion (from JPEG circuit 80)
UNPACK_DATA: Data to be unpacked
[0032]
A VALID signal (input) and a STOP signal (output) are attached to each input data series, and a VALID signal (output) and a STOP signal (input) are attached to each output data series.
[0033]
There are three types of STOP signals, DPCM_OUT_STOP, PACK_STOP, and CCD_OUT_STOP, which are input to the
[0034]
These blocks having the STOP signal set to “1” mean that the data output from the
[0035]
On the other hand, accompanying the input data of the
[0036]
When these STOP signals are “1”, it means that the
[0037]
● Lossless compression of CCD-RAW data
The operation of the
[0038]
The CCD-RAW data (CCD_IN_DATA) to be compressed is read into the
[0039]
When the data width of the CCD-RAW data is 12 bits, the lower 2 bits are separated and the PACK process is performed according to the format shown in FIG. The lower 2 bits of the data held in the
[0040]
The outputs of the
[0041]
● Decompression of CCD-RAW data
The operation of the
[0042]
DPCM data (DPCM_IN_DATA) to be subjected to inverse DPCM conversion is read into the
[0043]
When the original data width of the compressed and recorded CCD-RAW data is 12 bits, UNPACK and synthesis processing of lower 2 bits are performed according to the format shown in FIG. Data to be unpacked (UNPACK_DATA) is read into the
[0044]
Which 2 bits are selected by the
[0045]
The 12-bit data synthesized in the buffer 194 is output as decompressed CCD-RAW data (CCD_OUT_DATA). The
[0046]
Further, the data in the
[0047]
● Waiting process
FIG. 6 is a timing chart showing a specific example of the waiting process.
[0048]
Hereinafter, in order to simplify the description, the data sent from the
[0049]
At timing t1, since the UNPACK_VALID signal is “1” and the UNPACK_STOP signal is “0”, P1 which is UNPACK_DATA is read into the
[0050]
At timing t2, since the 10bit_VALID signal is “1”, the selected data D1 and P1 are combined by the buffer 194 and output as CCD_OUT_DATA. The
[0051]
At timing t8, the selected data D7 and P1 are combined by the buffer 194 and output as CCD_OUT_DATA. Since the process of synthesizing the seven data is completed by the process at timing t8, it is necessary to update the data in the
[0052]
At timing t9, the selected data D8 and P1 are combined by the buffer 194 and output as CCD_OUT_DATA. On the other hand, P2 of UNPACK_DATA is read into the
[0053]
At timing t10, the selected data D9 and P2 are combined by the buffer 194 and output as CCD_OUT_DATA. Further, since the UNPACK_VALID signal is “0”, there is no need to issue a STOP signal, so the
[0054]
At timing t17, the selected data D16 and P2 are combined by the buffer 194 and output as CCD_OUT_DATA. Since the process of synthesizing the eight data D9 to D16 is completed by the process at timing t17, the data in the
[0055]
At timing t18, since the 10bit_STOP signal is “1”, 10bit_DATA is not updated as D17. Since the UNPACK_VALID signal is “1”, P3 of UNPACK_DATA is read into the
[0056]
At timing t19, the selected data D17 and P3 are combined by the buffer 194 and output as CCD_OUT_DATA.
[0057]
In this way, the
[0058]
[Interface circuit]
As described above, the
[0059]
FIG. 7 is a block diagram showing a most basic configuration example of the
[0060]
An
[0061]
Every data series that propagates between units is accompanied by a pair of VALID and STOP signals for each data series. All data transfer between each arithmetic unit in the apparatus is controlled by these signals.
[0062]
The VALID signal indicates that the data series transferred between the arithmetic units is valid data at a certain timing, and is propagated in the same direction as the propagation direction of the data series. In the present embodiment, a cycle in which the VALID signal is “1” means that the data series is valid, and only one valid data series is output.
[0063]
The STOP signal instructs to stop updating the data of the input data series when the data input at the next timing cannot be processed because the arithmetic unit that should receive the data is processing the data. Is transmitted in the direction opposite to the propagation direction of the data series. In the present embodiment, a cycle in which the STOP signal is “1” means that the arithmetic unit cannot process data.
[0064]
As described above, the purpose of the
[0065]
The
[0066]
In actual data processing, most control can be performed simply by counting the VALID signal input to the
[0067]
The
[0068]
[Function of interface circuit]
8A and 8B are timing charts showing in detail the relationship among data, the VALID signal, and the STOP signal, and explain the function of the
[0069]
At timing t0, the output of the D-
[0070]
At timing t1, DATA_IN as input data is indefinite, and the VALID_IN signal input to the
[0071]
At timings t2 and t3, the VALID_IN signal input to the
[0072]
At timing t4, the VALID_IN signal input to the
[0073]
At timing t5, since the IN_STOP signal output from the
[0074]
At timing t6, since the IN_STOP signal output from the
[0075]
At timing t7, the VALID_IN signal input to the
[0076]
At timing t8, as in timing t7, D5 of IN_DATA is processed by the
[0077]
At the timing t9, since the IN_VALID signal input to the
[0078]
At timing t10, IN_DATA input to the
[0079]
At timings t11 and t12, similarly to timing t7, D6 and D7 of IN_DATA input from the
[0080]
At timing t13, the OUT_STOP signal output from the
[0081]
The effective DATA_OUT d4 output from the
[0082]
At timing t14, since the IN_STOP signal input to the
[0083]
At timing t15, since the OUT_VALID signal input to the
[0084]
At timing t16, similarly to timing t7, D9 of IN_DATA output from the
[0085]
At timing t17, the OUT_STOP signal output from the
[0086]
As described above, the function of the
[0087]
FIG. 9 and FIG. 10 are block diagrams respectively showing operations at the time of compression and expansion of the
[0088]
At the time of compression, there are two types of data output from the
[0089]
At the time of decompression, there are two types of data to be input to the
[0090]
[Image recording process]
When the shooting mode is set in the
[0091]
In FIG. 11, one of the Huffman tables stored in the read-
[0092]
The read-
[0093]
Next, the setting of the
[0094]
On the other hand, if the setting of the
[0095]
The DCT and quantized or DPCM-converted data is Huffman encoded according to the Huffman table set in the Huffman encoding /
[0096]
For example, when the code for one image is stored in the
[0097]
Thereafter, the code stored in the
[0098]
As described above, in the present embodiment, a plurality of Huffman tables are prepared in advance, and encoding using a single Huffman table provided as a standard is performed by performing encoding on a single data multiple times. Compared to the above, it is possible to perform compression more effective in terms of compression rate.
[0099]
● Playback mode
When the playback mode is set in the
[0100]
The image data file stored in the
[0101]
If the result of analyzing the header data is the CCD-RAW mode, the Huffman-encoded data held in the
[0102]
Then, the analysis result of the header data is determined (S209). When the CCD-RAW data is 10 bits, the 10-bit CCD-RAW data obtained by the inverse DPCM conversion is converted to the
[0103]
The CCD-RAW data stored in the
[0104]
● Data format
FIG. 13 is a diagram showing a basic format example of CCD-RAW lossless compression data recorded on the
[0105]
Header data is recorded at the head of the basic format shown in FIG. The first 1 bit of the header data indicates the recording mode MODE. When it is “0”, it indicates 10-bit CCD-RAW data, and when it is “1”, it indicates 12-bit CCD-RAW data. In the subsequent 15 bits, a 12-bit numerical value SIZE_H representing the number of pixels in the horizontal direction of the
Data size = MODE x SIZE_H x SIZE_V / (8 x 8) [bytes]
[0106]
Also, whether the data file is a CCD-RAW lossless compression data file or a JPEG file can be determined by the first 4 bits of the data file. In the case of a JPEG file, since the file starts with the code “FFD8”, the first 4 bits are “1111”. On the other hand, in the case of CCD-RAW lossless compression data, it becomes '0000' or '1000'.
[0107]
As described above, according to the present embodiment, a CCD-RAW lossless compression / decompression circuit for 10- or 12-bit CCD-RAW data is realized using an existing baseline JPEG encoding / decoding circuit. Can do. That is, the JPEG recording mode or the CCD-RAW lossless compression recording mode can be selected according to the purpose of use of the image data. Accordingly, when it is desired to prevent data loss (image quality degradation) due to quantization when JPEG encoding is performed, CCD-RAW data can be reversibly compressed and stored in a recording medium. In addition, the compressed CCD-RAW data (especially 12-bit CCD-RAW data) can have a data size that is sufficiently smaller than when data is stored in the CCD-RAW format.
[0108]
In other words, a part of the existing baseline JPEG encoding / decoding circuit can be used for CCD-RAW lossless compression / decompression processing, so the load on development of equipment that requires such a circuit. Such a device can be realized with a smaller circuit scale.
[0109]
Furthermore, in the present embodiment, by preparing a plurality of Huffman tables in advance and performing encoding a plurality of times on one data, rather than compression by a single standard Huffman table provided, Effective compression can be performed in terms of compression rate.
[0110]
Since the selection and supply of the Huffman table is selectively performed by the
[0111]
In the above-described embodiment, an image processing apparatus including an image sensor such as an electronic camera (digital camera) has been described. However, similar processing can be performed by a computer, an image output apparatus, or the like.
[0112]
[Other Embodiments]
Note that the present invention can be applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, and a printer), and a device (for example, a copying machine and a facsimile device) including a single device. You may apply to.
[0113]
Also, an object of the present invention is to supply a storage medium (or recording medium) on which a program code of software that realizes the functions of the above-described embodiments is recorded to a system or apparatus, and the computer (or CPU or CPU) of the system or apparatus Needless to say, this can also be achieved by the MPU) reading and executing the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the program code constitutes the present invention. Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an operating system (OS) running on the computer based on the instruction of the program code. It goes without saying that a case where the function of the above-described embodiment is realized by performing part or all of the actual processing and the processing is included.
[0114]
Furthermore, after the program code read from the storage medium is written into a memory provided in a function expansion card inserted into the computer or a function expansion unit connected to the computer, the function is based on the instruction of the program code. It goes without saying that the CPU or the like provided in the expansion card or the function expansion unit performs part or all of the actual processing and the functions of the above-described embodiments are realized by the processing.
[0115]
When the present invention is applied to the storage medium, the storage medium stores program codes corresponding to the flowcharts described above (shown in FIG. 11 and / or FIG. 12).
[0116]
The application of the present invention is not limited to an image processing apparatus such as a digital camera and its recording medium. For example, when distributing image data of an image taken by an image processing device such as a digital camera using a medium such as a CD-ROM or DVD-ROM, for normal use such as display, printing, and search. The image data to be used is JPEG encoded and recorded on a CD-ROM, etc. The image data that requires any image processing such as color separation for printing, CG creation, etc. is in the CCD-RAW format on a CD-ROM etc. When recording, the image data compression / decompression method of the present invention can be used. Further, the present invention includes media in which image data is recorded (stored) in such a form.
[0117]
【The invention's effect】
As explained above, according to the present invention,Image data (for example, CCD-RAW Data)An image processing apparatus that realizes effective encoding can be provided.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration example of an image processing apparatus according to an embodiment of the present invention;
FIG. 2 is a diagram showing a data format in division and PACK processing, and UNPACK and synthesis processing;
FIG. 3 is a diagram showing an example of a color filter array;
FIG. 4 is a block diagram showing a detailed configuration example of the data conversion core shown in FIG.
FIG. 5 is a diagram showing an example of the data format of CCD-RAW data;
FIG. 6 is a timing chart showing a specific example of waiting processing;
7 is a block diagram showing a most basic configuration example of the interface circuit shown in FIG.
FIG. 8A is a timing chart showing in detail the relationship between data, a VALID signal, and a STOP signal;
FIG. 8B is a timing chart showing in detail the relationship between data, a VALID signal, and a STOP signal;
FIG. 9 is a block diagram showing the compression operation of the interface circuit;
FIG. 10 is a block diagram showing an expansion operation of the interface circuit;
FIG. 11 is a flowchart illustrating an operation example of the image processing apparatus related to a recording process of a captured image;
FIG. 12 is a flowchart showing an operation example of the image processing apparatus related to image reproduction processing;
FIG. 13 is a diagram illustrating a basic format example of CCD-RAW lossless compression data recorded on a recording medium.
Claims (13)
前記第1の画像データのビット数が第1のビット数である場合においては、前記第1の画像データを第1の符号化方式に従って符号化し、前記第1の画像データのビット数が前記第1のビット数よりも大きい第 2 のビット数である場合においては、前記第1の画像データを前記第1のビット数分の第1の部分データと、前記第1の部分データ以外の部分を有する第2の部分データとに分割し、前記第1の部分データを前記第1の符号化方式に従って符号化する符号化手段と、
前記第1の画像データを記録媒体に格納する場合であり、かつ、前記第1の画像データのビット数が前記第1のビット数である場合においては、前記符号化手段により符号化された前記第1の画像データを前記記録媒体に格納し、前記第1の画像データを前記記録媒体に格納する場合であり、かつ、前記第1の画像データのビット数が前記第 2 のビット数である場合においては、前記符号化手段により符号化された前記第1の部分データと、前記第2の部分データとを前記記録媒体に格納する記録手段とを有することを特徴とする画像処理装置。Conversion means for digitizing the output signal of the image sensor and converting it to first image data;
When the number of bits of the first image data is the first number of bits, the first image data is encoded according to a first encoding method, and the number of bits of the first image data is the first number of bits. In the case where the second bit number is larger than the bit number of 1, the first image data is divided into the first partial data for the first bit number and a part other than the first partial data. Encoding means for dividing the first partial data according to the first encoding scheme, and dividing the first partial data into second partial data having
In the case where the first image data is stored in a recording medium, and the number of bits of the first image data is the first number of bits, the encoding unit encodes the first image data. The first image data is stored in the recording medium, the first image data is stored in the recording medium, and the number of bits of the first image data is the second number of bits. In some cases, the image processing apparatus includes recording means for storing the first partial data encoded by the encoding means and the second partial data in the recording medium.
前記符号化手段は、前記第2の画像データを前記第1の符号化方式とは異なる第2の符号化方式に従って符号化する符号化手段であり、
前記記録手段は、前記第2の画像データを前記記録媒体に格納する場合は、前記第2の符号化手段により符号化された前記第2の画像データを前記記録媒体に格納することを特徴とする請求項1から3のいずれか1 項に記載の画像処理装置。Image processing means for performing image processing on the first image data and generating second image data;
The encoding means is an encoding means for encoding the second image data according to a second encoding scheme different from the first encoding scheme;
The recording unit stores the second image data encoded by the second encoding unit in the recording medium when storing the second image data in the recording medium. the image processing apparatus according to any one of claims 1 to 3,.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP23454499A JP4100836B2 (en) | 1999-08-20 | 1999-08-20 | Image processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP23454499A JP4100836B2 (en) | 1999-08-20 | 1999-08-20 | Image processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2001061067A JP2001061067A (en) | 2001-03-06 |
JP4100836B2 true JP4100836B2 (en) | 2008-06-11 |
Family
ID=16972695
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP23454499A Expired - Fee Related JP4100836B2 (en) | 1999-08-20 | 1999-08-20 | Image processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4100836B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10147016B2 (en) | 2014-07-23 | 2018-12-04 | Canon Kabushiki Kaisha | Image processing apparatus to encode image data by image processing parameters |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4451181B2 (en) | 2004-03-26 | 2010-04-14 | オリンパス株式会社 | Image compression method and image compression apparatus |
JP4515832B2 (en) * | 2004-06-14 | 2010-08-04 | オリンパス株式会社 | Image compression apparatus and image restoration apparatus |
JP4466378B2 (en) | 2005-01-11 | 2010-05-26 | 株式会社ニコン | History adding device, electronic camera, and image processing program |
JP4840967B2 (en) * | 2005-12-01 | 2011-12-21 | キヤノン株式会社 | Imaging apparatus, image processing method, program, and storage medium |
JP2008028534A (en) | 2006-07-19 | 2008-02-07 | Pentax Corp | Digital camera |
BR102012018582A2 (en) * | 2012-07-26 | 2014-05-06 | Finxi Solucoes Em T I Ltda | SYSTEM AND METHOD FOR CODING AND COMPRESSING DIGITAL CONTENTS IN COLOR CODES; CODED AND COMPACTED FILES; STORAGE AND / OR TRANSMISSION SYSTEM OF ENCODED FILES; SYSTEM AND METHOD FOR DECODING AND DECOMPRESSION OF COLOR CODE FILES |
-
1999
- 1999-08-20 JP JP23454499A patent/JP4100836B2/en not_active Expired - Fee Related
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10147016B2 (en) | 2014-07-23 | 2018-12-04 | Canon Kabushiki Kaisha | Image processing apparatus to encode image data by image processing parameters |
Also Published As
Publication number | Publication date |
---|---|
JP2001061067A (en) | 2001-03-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3069455B2 (en) | Quantization and dequantization circuits in image data compression and decompression equipment | |
JP3096618B2 (en) | Imaging device | |
US6798833B2 (en) | Video frame compression/decompression hardware system | |
US6560369B1 (en) | Conversion of wavelet coded formats depending on input and output buffer capacities | |
JP2000138934A (en) | Jpeg coder with limited file size, its method and recording medium | |
JP2000069292A (en) | Image processing unit, its method and storage medium | |
US11445160B2 (en) | Image processing device and method for operating image processing device | |
JP4100836B2 (en) | Image processing device | |
JP4181701B2 (en) | Image processing device | |
US11190810B2 (en) | Device and method for compressing image data using quantization parameter and entropy tables | |
JP2003189109A (en) | Image processor and image processing method, and computer program | |
JP2004501531A (en) | Method and apparatus for run-length encoding video data | |
JP2001145106A (en) | Device and method for compressing image | |
JP2000261324A (en) | Huffman decoding circuit | |
JP2001231046A (en) | Digital camera system and image transfer method used in it | |
EP1233375B1 (en) | Image data encoding apparatus and method | |
JPH10285502A (en) | Information processing system, information processor, information processing method and storage medium | |
JP3110255B2 (en) | Character data compression processing apparatus and character data compression method | |
JP2002051221A (en) | Device, system and method for encoding and decoding image and storage medium | |
JP2001144934A (en) | Method and device for image synthesis | |
JP3271539B2 (en) | Image data processing device | |
JP2735728B2 (en) | Variable length code decoding circuit | |
JPH11144052A (en) | Processor and system for image processing | |
JP2001224026A (en) | Image data processing unit and its control method | |
JP2839055B2 (en) | Image editing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060809 |
|
RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20060809 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070920 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070925 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20071126 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20071221 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080219 |
|
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: 20080310 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20080318 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110328 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120328 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130328 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140328 Year of fee payment: 6 |
|
LAPS | Cancellation because of no payment of annual fees |