JP4971807B2 - Image storage device, control method thereof, program, and digital camera - Google Patents

Image storage device, control method thereof, program, and digital camera Download PDF

Info

Publication number
JP4971807B2
JP4971807B2 JP2007008218A JP2007008218A JP4971807B2 JP 4971807 B2 JP4971807 B2 JP 4971807B2 JP 2007008218 A JP2007008218 A JP 2007008218A JP 2007008218 A JP2007008218 A JP 2007008218A JP 4971807 B2 JP4971807 B2 JP 4971807B2
Authority
JP
Japan
Prior art keywords
image data
buffer
compressed image
compressed
writing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2007008218A
Other languages
Japanese (ja)
Other versions
JP2008176481A (en
Inventor
純 鈴木
秀行 蓮覚寺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2007008218A priority Critical patent/JP4971807B2/en
Publication of JP2008176481A publication Critical patent/JP2008176481A/en
Application granted granted Critical
Publication of JP4971807B2 publication Critical patent/JP4971807B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Television Signal Processing For Recording (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image storage device writing compressed image data into one storage means which serves as both a first buffer and a second buffer without overwriting the compressed image data onto image data while maintaining the use efficiency of the storage means. <P>SOLUTION: When JPEG data is written in at least part of a RAW buffer 302 and a JPEG buffer 301 of a RAM 206 and when the size of the JPEG data is equal to or smaller than a preset size and the JPEG data is overwritten onto the RAW data, a compression processing part 209 compresses again the RAW data (YUV data) read from the RAW buffer 302 at a set compression rate and the JPEG data is generated. The generated JPEG data is written in the RAW buffer 302 and the JPEG buffer 301. <P>COPYRIGHT: (C)2008,JPO&amp;INPIT

Description

本発明は、画像記憶装置、その制御方法、プログラムおよび該画像記憶装置を搭載するデジタルカメラに関する。   The present invention relates to an image storage device, a control method thereof, a program, and a digital camera equipped with the image storage device.

デジタルカメラなどの画像を撮像し、記録する機器においては、撮像素子の高性能化、例えば高画素数化が進められている。これに伴い撮像した画像データのサイズが大きくなる、すなわち当該画像データを記録するファイルのサイズが大きくなる。このファイルのサイズが大きくなることにより、当該ファイルを記録するメモリとして、大きな容量のメモリが必要になる。   In devices that capture and record images, such as digital cameras, the performance of image sensors, for example, the number of pixels has been increased. As a result, the size of the captured image data increases, that is, the size of the file that records the image data increases. As the file size increases, a large-capacity memory is required as a memory for recording the file.

メモリの大容量化を避けるために、1つのメモリを、撮像データであるRAWデータを記録するバッファと、圧縮データであるJPEGデータを記録するバッファを兼用するように使用する手法が提案されている(例えば特許文献1参照)。   In order to avoid an increase in memory capacity, a method has been proposed in which one memory is used so as to serve both as a buffer for recording RAW data that is imaging data and a buffer for recording JPEG data that is compressed data. (For example, refer to Patent Document 1).

また、JPEGデータを記録するバッファを有し、撮像データを圧縮してJPEGバッファに記録する際にその圧縮率を求め、当該圧縮率で撮像データを圧縮する方法がある(例えば特許文献2参照)。
特登録第03342388号公報 特開2003−199052号公報
Also, there is a method of having a buffer for recording JPEG data, obtaining the compression rate when compressing the image data and recording it in the JPEG buffer, and compressing the image data at the compression rate (see, for example, Patent Document 2). .
Japanese Patent Registration No. 0342388 Japanese Patent Laid-Open No. 2003-199052

しかしながら、1つのメモリを、RAWデータを記憶するバッファとJPEGデータを記憶するバッファとして兼用する場合、圧縮前のRAWデータがJPEGデータにより上書きされ、再度、圧縮を行うことができないことがある。   However, when one memory is used as both a buffer for storing RAW data and a buffer for storing JPEG data, the RAW data before compression may be overwritten by JPEG data, and compression may not be performed again.

元となるRAWデータがJPEGデータにより上書きされる問題は、圧縮により得られるJPEGデータが大きくなる、すなわちJPEGデータを記憶するバッファのサイズ以上となる場合に発生する。例えば高周波の画像を撮影した場合について説明する。   The problem that the original RAW data is overwritten with JPEG data occurs when the JPEG data obtained by compression becomes large, that is, when the JPEG data exceeds the size of the buffer for storing the JPEG data. For example, a case where a high-frequency image is taken will be described.

RAWデータが1pixelあたり10bit、信号処理により得られるYUVデータが16bitとする。標準チャートを撮影した場合には、YUVデータを圧縮したJPEGデータは、1pixelあたり4bit程度である。しかし、高周波の画像を撮影した場合には、YUVデータを圧縮したJPEGデータは1pixelあたり12bitとなり、標準的な画像を撮影した場合に比べ高周波の画像を撮影した場合のJPEGデータのサイズは大きくなる。バッファ兼用のメモリにおいては、アドレス上JPEGバッファとRAWバッファを連続させ、JPEGバッファを通常の画像の圧縮サイズに合わせて確保している。したがって、JPEGデータのサイズが大きいと、JPEGデータの書き込みアドレスがRAWデータの読み出しアドレスに追いついてしまい、元となるRAWデータがJPEGデータにより上書きされる。これを回避するためには、例外的な高周波の画像に対応してJPEGバッファ領域をメモリに大きく確保することもできる。しかし、その場合、通常の画像においてはメモリの使用効率が低下し、兼用バッファの効果も薄くなる。   RAW data is 10 bits per pixel, and YUV data obtained by signal processing is 16 bits. When a standard chart is photographed, JPEG data obtained by compressing YUV data is about 4 bits per pixel. However, when a high-frequency image is taken, the JPEG data obtained by compressing YUV data is 12 bits per pixel, and the JPEG data size when a high-frequency image is taken is larger than when a standard image is taken. . In the memory also serving as a buffer, a JPEG buffer and a RAW buffer are continuous on the address, and the JPEG buffer is secured in accordance with the compression size of a normal image. Therefore, if the JPEG data size is large, the JPEG data write address catches up with the RAW data read address, and the original RAW data is overwritten by the JPEG data. In order to avoid this, a large JPEG buffer area can be secured in the memory corresponding to an exceptional high-frequency image. However, in that case, the memory use efficiency is reduced in a normal image, and the effect of the dual buffer is also reduced.

本発明の目的は、第1のバッファと第2のバッファとを兼ねる1つの記憶手段の使用効率を保持したまま、その記憶手段に対して、画像データにその圧縮画像データを上書きすることなく、圧縮画像データを書き込むことを可能にすることにある。   The object of the present invention is to maintain the use efficiency of one storage means that serves as both the first buffer and the second buffer, without overwriting the compressed image data on the image data to the storage means, It is to make it possible to write compressed image data.

また、本発明の目的は、上記書き込みを可能とした画像記憶装置、その制御方法およびプログラム、並びに上記画像記憶装置を搭載するデジタルカメラを提供することにある。   Another object of the present invention is to provide an image storage device that enables the writing, a control method and program thereof, and a digital camera equipped with the image storage device.

本発明は、上記目的を達成するため、第1のバッファと第2のバッファとを兼ねる記憶手段と、入力された画像データを前記第1のバッファへの書き込む画像書き込み手段と、前記第1のバッファから前記画像データを読み出す画像読み出し手段と、前記第1のバッファから読み出された画像データを設定されている圧縮率で圧縮して、圧縮画像データを生成する画像圧縮手段と、前記画像圧縮手段により生成された圧縮画像データを前記第2のバッファから前記第1のバッファに亘って書き込むことが可能な圧縮画像書き込み手段と、前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれる場合において、前記圧縮画像書込み手段による前記圧縮画像データの前記記憶手段への書き込みを停止させる停止手段と、前記停止手段により書き込みを停止させた後、前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくか否かを判定する判定手段と、前記判定手段により前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつかないと判断された場合、前記圧縮画像書き込み手段が、再度、停止前の圧縮率で圧縮された圧縮画像データを前記記憶手段へ書き込むよう制御する制御手段と、を備えることを特徴とする画像記憶装置を提供する。   In order to achieve the above object, the present invention achieves the above-described object, storage means serving as both a first buffer and a second buffer, image writing means for writing input image data into the first buffer, and the first buffer Image reading means for reading the image data from the buffer, image compression means for compressing the image data read from the first buffer at a set compression rate, and generating compressed image data; and the image compression Compressed image writing means capable of writing the compressed image data generated by the means from the second buffer to the first buffer, and the compressed image data from the second buffer to the first buffer. The compressed image data is written into the storage means by the compressed image writing means. A stop unit for stopping the writing, a determination unit for determining whether a write address of the compressed image data catches up with a read address of the image data after the writing is stopped by the stop unit, and the compression unit by the determination unit When it is determined that the image data write address cannot catch up with the image data read address, the compressed image writing means controls to write again the compressed image data compressed at the compression rate before the stop to the storage means. And an image storage device.

本発明は、上記目的を達成するため、第1のバッファと第2のバッファとを兼ねる記憶手段と、入力された画像データを前記第1のバッファへの書き込む画像書き込み手段と、前記第1のバッファから前記画像データを読み出す画像読み出し手段と、前記第1のバッファから読み出された画像データを設定されている圧縮率で圧縮して、圧縮画像データを生成する画像圧縮手段と、前記画像圧縮手段により生成された圧縮画像データを前記第2のバッファから前記第1のバッファに亘って書き込むことが可能な圧縮画像書き込み手段とを備える画像記憶装置の制御方法であって、前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれる場合において、前記圧縮画像書込み手段による前記圧縮画像データの前記記憶手段への書き込みを停止させる停止ステップと、前記書き込みを停止させた後、前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくか否かを判定する判定ステップと、前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつかないと判断された場合、前記圧縮画像書き込み手段が、再度、停止前の圧縮率で圧縮された圧縮画像データを前記記憶手段へ書き込むよう制御する制御ステップと、を備えることを特徴とする画像記憶装置の制御方法を提供する。   In order to achieve the above object, the present invention achieves the above-described object, storage means serving as both a first buffer and a second buffer, image writing means for writing input image data into the first buffer, and the first buffer Image reading means for reading the image data from the buffer, image compression means for compressing the image data read from the first buffer at a set compression rate, and generating compressed image data; and the image compression And a compressed image writing unit capable of writing the compressed image data generated by the first buffer from the second buffer to the first buffer, wherein the compressed image data is In the case where writing is performed from the second buffer over at least a partial area of the first buffer, the compressed image writing means performs the A stop step of stopping writing of the compressed image data to the storage means, and a determination step of determining whether or not a write address of the compressed image data catches up with a read address of the image data after the writing is stopped. When it is determined that the write address of the compressed image data cannot catch up with the read address of the image data, the compressed image writing means again stores the compressed image data compressed at the compression rate before the stop to the storage means. And a control step for controlling writing. An image storage device control method is provided.

本発明は、上記目的を達成するため、第1のバッファと第2のバッファとを兼ねる記憶手段と、入力された画像データを前記第1のバッファへの書き込む画像書き込み手段と、前記第1のバッファから前記画像データを読み出す画像読み出し手段と、前記第1のバッファから読み出された画像データを設定されている圧縮率で圧縮して、圧縮画像データを生成する画像圧縮手段と、前記画像圧縮手段により生成された圧縮画像データを前記第2のバッファから前記第1のバッファに亘って書き込むことが可能な圧縮画像書き込み手段とを備える画像記憶装置を制御するためのプログラムであって、前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれる場合において、前記圧縮画像書込み手段による前記圧縮画像データの前記記憶手段への書き込みを停止させる停止ステップと、前記書き込みを停止させた後、前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくか否かを判定する判定ステップと、前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつかないと判断された場合、前記圧縮画像書き込み手段が、再度、停止前の圧縮率で圧縮された圧縮画像データを前記記憶手段へ書き込むよう制御する制御ステップと、を有することを特徴とするプログラムを提供する。   In order to achieve the above object, the present invention achieves the above-described object, storage means serving as both a first buffer and a second buffer, image writing means for writing input image data into the first buffer, and the first buffer Image reading means for reading the image data from the buffer, image compression means for compressing the image data read from the first buffer at a set compression rate, and generating compressed image data; and the image compression And a compressed image writing unit capable of writing compressed image data generated by the first buffer from the second buffer to the first buffer, the program for controlling the image storage device, In the case where image data is written from the second buffer to at least a partial area of the first buffer, the compressed image writing Stopping the writing of the compressed image data to the storage means by the means, and determining whether the write address of the compressed image data catches up with the read address of the image data after the writing is stopped And when it is determined that the write address of the compressed image data cannot catch up with the read address of the image data, the compressed image writing means again reads the compressed image data compressed at the compression rate before the stop. And a control step for controlling to write to the storage means.

本発明は、上記目的を達成するため、上記画像記憶装置を搭載することを特徴とするデジタルカメラを提供する。   In order to achieve the above object, the present invention provides a digital camera equipped with the above image storage device.

本発明によれば、第1のバッファと第2のバッファとを兼ねる1つの記憶手段の使用効率を保持したまま、その記憶手段に対して、画像データにその圧縮画像データを上書きすることなく、圧縮画像データを書き込むことができる。   According to the present invention, while maintaining the use efficiency of one storage means serving as both the first buffer and the second buffer, without overwriting the compressed image data on the image data to the storage means, Compressed image data can be written.

以下、本発明の実施の形態について図面を参照しながら説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は本発明の一実施の形態に係る画像記憶装置を搭載するデジタルカメラの構成を示すブロック図である。図2は図1のRAM206のメモリマップを示す図である。   FIG. 1 is a block diagram showing the configuration of a digital camera equipped with an image storage device according to an embodiment of the present invention. FIG. 2 is a diagram showing a memory map of the RAM 206 in FIG.

デジタルカメラは、図1に示すように、レンズ201と、レンズ201を介して捕らえられた被写体像を光電変換によりアナログ信号に変換する撮像素子202とを備える。撮像素子202から出力されたアナログ信号は、A/D変換部203により、デジタル信号(RAWデータ)に変換される。このデジタル信号は、メモリコントローラ204に、またはメモリコントローラ204を介して信号処理部207に入力される。   As shown in FIG. 1, the digital camera includes a lens 201 and an image sensor 202 that converts an object image captured via the lens 201 into an analog signal by photoelectric conversion. The analog signal output from the image sensor 202 is converted into a digital signal (RAW data) by the A / D converter 203. This digital signal is input to the memory controller 204 or to the signal processing unit 207 via the memory controller 204.

メモリコントローラ204は、入力された書き込みアドレスまたは読み出しアドレスに基づいて、RAM206またはメモリカード216に対して、RAWデータまたは圧縮された画像データ(JPEGデータ)の書き込みまたは読み出しを行う。ここで、メモリカード216に対するデータの書き込みは、I/F(インタフェース)215を介して行われる。   The memory controller 204 writes or reads RAW data or compressed image data (JPEG data) to the RAM 206 or the memory card 216 based on the input write address or read address. Here, writing of data to the memory card 216 is performed via an I / F (interface) 215.

ここで、上記RAWデータに対する書き込みアドレスと読み出しアドレスは、それぞれ、RAWデータ書き込みアドレス発生部205とRAWデータ読み出しアドレス発生部212により発生される。また、上記JPEGデータに対する書き込みアドレスは、JPEGデータ書き込みアドレス発生部211により発生される。   Here, a write address and a read address for the RAW data are generated by a RAW data write address generation unit 205 and a RAW data read address generation unit 212, respectively. A write address for the JPEG data is generated by the JPEG data write address generation unit 211.

RAM206には、図2に示すように、RAWバッファ302とJPEGバッファ301が設けられている。RAWバッファ302は、A/D変換部203から出力されたRAWデータが書き込まれるバッファであり、JPEGバッファ301は、RAWデータを圧縮処理することによって得られたJPEGデータが書き込まれるバッファである。例えば、JPEGバッファ301のサイズは、標準チャートを撮影した場合のJPEGファイルサイズに設定されている。ここで、RAM206においては、アドレスが図2中の矢印が示す方向に向けて大きくなるものとする。圧縮処理により得られたJPEGデータは、通常、JPEGバッファ301に書き込まれる。ここで、書き込まれるJPEGデータのサイズがJPEGバッファ301の容量より大きい場合は、JPEGデータの一部がRAWバッファ302に書き込まれる。   As shown in FIG. 2, the RAM 206 is provided with a RAW buffer 302 and a JPEG buffer 301. The RAW buffer 302 is a buffer to which RAW data output from the A / D conversion unit 203 is written, and the JPEG buffer 301 is a buffer to which JPEG data obtained by compressing the RAW data is written. For example, the size of the JPEG buffer 301 is set to the JPEG file size when a standard chart is captured. Here, in the RAM 206, it is assumed that the address increases in the direction indicated by the arrow in FIG. JPEG data obtained by the compression process is normally written in the JPEG buffer 301. Here, when the size of the JPEG data to be written is larger than the capacity of the JPEG buffer 301, a part of the JPEG data is written to the RAW buffer 302.

信号処理部207は、入力されたRAWデータに対して所定の信号処理を施し、当該RAWデータを、輝度色差信号であるYUVデータに変換する。このYUVデータは、スイッチ208を介して、圧縮処理部209に入力される。また、YUVデータは、メモリコントローラ204を介して、YUVデータ書き込みアドレス発生部217により発生されたYUVデータ書き込みアドレスに基づいてRAM206へ書き込まれる。   The signal processing unit 207 performs predetermined signal processing on the input RAW data, and converts the RAW data into YUV data that is a luminance color difference signal. This YUV data is input to the compression processing unit 209 via the switch 208. The YUV data is written to the RAM 206 via the memory controller 204 based on the YUV data write address generated by the YUV data write address generation unit 217.

ここで、スイッチ208は、圧縮処理部209に入力されるデータとして、信号処理部207から出力されたYUVデータとRAM206から読み出されたYUVデータのいずれかを選択するためのスイッチである。このスイッチ208の選択動作は、後述するシステムコントローラ210により制御される。   Here, the switch 208 is a switch for selecting either YUV data output from the signal processing unit 207 or YUV data read from the RAM 206 as data input to the compression processing unit 209. The selection operation of the switch 208 is controlled by a system controller 210 described later.

例えばシステムコントローラ210がスイッチ208に対して「0」を設定すると、スイッチ208は、信号処理部207から出力されたYUVデータを選択して圧縮処理部209に入力するように動作する。これに対し、スイッチ208に対して「1」が設定された場合、スイッチ208は、RAM206から読み出されたYUVデータを選択して圧縮処理部209に入力するように動作する。このRAM206から読み出されたYUVデータは、YUVデータ読み出しアドレス発生部218が発生するYUVデータ読み出しアドレスに基づいて読み出されたデータである。   For example, when the system controller 210 sets “0” for the switch 208, the switch 208 operates to select the YUV data output from the signal processing unit 207 and input it to the compression processing unit 209. On the other hand, when “1” is set for the switch 208, the switch 208 operates to select the YUV data read from the RAM 206 and input it to the compression processing unit 209. The YUV data read from the RAM 206 is data read based on the YUV data read address generated by the YUV data read address generation unit 218.

圧縮処理部209は、JPEG方式に従って入力されたYUVデータを圧縮することによって、JPEGデータを生成する。この生成されたJPEGデータは、メモリコントローラ204およびI/F215を介して、メモリカード216に記録される。   The compression processing unit 209 generates JPEG data by compressing YUV data input according to the JPEG method. The generated JPEG data is recorded on the memory card 216 via the memory controller 204 and the I / F 215.

上記JPEGデータ書き込みアドレス発生部211により発生されたJPEGデータ書き込みアドレスは、上記メモリコントローラ204に入力されるとともに、RAWバッファ侵入検出部213および追い付き検出部214に入力される。また、上記RAWデータ読み出しアドレス発生部212により発生されたRAWデータ読み出しアドレスは、上記メモリコントローラ204に入力されるとともに、追い付き検出部214に入力される。   The JPEG data write address generated by the JPEG data write address generator 211 is input to the memory controller 204 and also input to the RAW buffer intrusion detector 213 and the catch-up detector 214. The RAW data read address generated by the RAW data read address generator 212 is input to the memory controller 204 and also to the catch-up detector 214.

RAWバッファ侵入検出部213は、上記JPEGデータ書き込みアドレスとシステムコントローラ210から入力されたRAWバッファ開始アドレスを比較する。このRAWバッファ開始アドレスとは、RAM206に対してRAWデータの書き込みを開始するアドレスとして予め設定されているアドレスである。そして、RAWバッファ侵入検出部213は、上記比較結果に基づいてJPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達しているか否かを検出する。この検出結果は、JPEGデータがJPEGバッファ301からRAWバッファ302の少なくとも一部領域に亘って書き込まれるか否かを表すものである。この検出結果を示す信号は、システムコントローラ210に出力され、システムコントローラ210は、この信号に応じて、内部に保持するRAWバッファ侵入フラグの値を変化させる。   The RAW buffer intrusion detection unit 213 compares the JPEG data write address with the RAW buffer start address input from the system controller 210. The RAW buffer start address is an address set in advance as an address at which writing of RAW data to the RAM 206 is started. Then, the RAW buffer intrusion detection unit 213 detects whether the JPEG data write address has reached the address in the RAW buffer 302 based on the comparison result. This detection result indicates whether JPEG data is written over at least a partial area of the RAW buffer 302 from the JPEG buffer 301. A signal indicating the detection result is output to the system controller 210, and the system controller 210 changes the value of the RAW buffer intrusion flag held therein in accordance with this signal.

追い付き検出部214は、上記RAWデータ読み出しアドレスの値と上記JPEGデータ書き込みアドレスの値を比較し、この比較結果に基づいてJPEGデータ書き込みアドレスがRAWデータ読み出しアドレスに追い付いたか否かを検出する。具体的には、JPEGデータ書き込みアドレスがRAWデータ読み出しアドレスより大きい場合、JPEGデータ書き込みアドレスがRAWデータ読み出しアドレスに追い付いたと検出される。追い付き検出部214の検出結果は、RAWバッファ302のRAWデータ上にJPEGデータが上書きされるか否かを表すものである。この検出結果を示す信号は、システムコントローラ210に出力され、システムコントローラ210は、この信号に応じて、内部に保持する追い付き検出フラグの値を変化させる。   The catch-up detection unit 214 compares the value of the RAW data read address with the value of the JPEG data write address, and detects whether the JPEG data write address has caught up with the RAW data read address based on the comparison result. Specifically, when the JPEG data write address is larger than the RAW data read address, it is detected that the JPEG data write address has caught up with the RAW data read address. The detection result of the catch-up detection unit 214 indicates whether or not JPEG data is overwritten on the RAW data in the RAW buffer 302. A signal indicating the detection result is output to the system controller 210, and the system controller 210 changes the value of the catch-up detection flag held therein according to the signal.

システムコントローラ210は、CPU(図示せず)、各種制御および処理のためのプログラムが格納されているROM(図示せず)、およびCPUの作業領域を提供するためのRAM(図示せず)などから構成される。上記CPUがROMに格納されているプログラムを実行することによって、本デジタルカメラの全体制御が行われるとともに、各種処理が行われる。   The system controller 210 includes a CPU (not shown), a ROM (not shown) in which programs for various controls and processes are stored, and a RAM (not shown) for providing a work area for the CPU. Composed. When the CPU executes a program stored in the ROM, overall control of the digital camera is performed and various processes are performed.

次に、JPEGデータの書き込み動作について図3〜図5を参照しながら説明する。図3〜図5は図1のデジタルカメラにおけるJPEGデータの書き込み動作の手順を示すフローチャートである。ここで、図3〜図5のフローチャートに示す手順は、システムコントローラ210の制御下で実行される手順である。   Next, the JPEG data writing operation will be described with reference to FIGS. 3 to 5 are flowcharts showing the procedure of JPEG data writing operation in the digital camera of FIG. Here, the procedure shown in the flowcharts of FIGS. 3 to 5 is a procedure executed under the control of the system controller 210.

システムコントローラ210は、図3に示すように、RAWデータの書き込みを行うように制御する(ステップS101)。これにより、メモリコントローラ204には、RAWデータ書き込みアドレス発生部205により発生されたRAWデータ書き込みアドレスが入力される。そして、メモリコントローラ204は、撮像素子202から出力された電気信号をA/D変換することによって得られたRAWデータを、RAM206のRAWバッファ302の上記発生されたRAWデータ書き込みアドレスに書き込む。この際、RAWデータは、RAWバッファ開始アドレスを先頭として順に書き込まれる。   As shown in FIG. 3, the system controller 210 controls to write RAW data (step S101). As a result, the RAW data write address generated by the RAW data write address generator 205 is input to the memory controller 204. Then, the memory controller 204 writes the RAW data obtained by A / D converting the electrical signal output from the image sensor 202 to the generated RAW data write address of the RAW buffer 302 of the RAM 206. At this time, the RAW data is written in order starting from the RAW buffer start address.

次いで、システムコントローラ210は、内部に保持するRAWバッファ侵入フラグに「0」をセットする(ステップS102)。このRAWバッファ侵入フラグは、JPEGデータ書き込みアドレスの値がRAWバッファ開始アドレスの値より大きいことを示すためのフラグである。すなわち、RAWバッファ侵入フラグは、JPEGデータ書き込みアドレスがRAWバッファ302内のアドレス到達したことを示すためのフラグである。RAWバッファ侵入フラグに「0」がセットされた場合、RAWバッファ侵入フラグは、JPEGデータ書き込みアドレスがRAWバッファ302内のアドレス到達していないことを示す。これに対し、RAWバッファ侵入フラグに「1」がセットされた場合、RAWバッファ侵入フラグは、JPEGデータ書き込みアドレスがRAWバッファ302内のアドレス到達していることを示す。   Next, the system controller 210 sets “0” in the RAW buffer intrusion flag held therein (step S102). This RAW buffer entry flag is a flag for indicating that the value of the JPEG data write address is larger than the value of the RAW buffer start address. That is, the RAW buffer entry flag is a flag for indicating that the JPEG data write address has reached the address in the RAW buffer 302. When “0” is set in the RAW buffer intrusion flag, the RAW buffer intrusion flag indicates that the JPEG data write address has not reached the address in the RAW buffer 302. On the other hand, when “1” is set in the RAW buffer intrusion flag, the RAW buffer intrusion flag indicates that the JPEG data write address has reached the address in the RAW buffer 302.

次いで、システムコントローラ210は、内部に保持する追い付き検出フラグに「0」をセットする(ステップS103)。この追い付き検出フラグは、JPEGデータ書き込みアドレス106がRAWデータ読出アドレスより大きいことを示すためのフラグである。すなわち、追い付き検出フラグは、JPEGデータ書き込みアドレスがRAWデータ読み出しアドレスに追い付いたことを示すためのフラグである。   Next, the system controller 210 sets “0” in the catch-up detection flag held inside (step S103). This catch-up detection flag is a flag for indicating that the JPEG data write address 106 is larger than the RAW data read address. That is, the catch-up detection flag is a flag for indicating that the JPEG data write address has caught up with the RAW data read address.

次いで、システムコントローラ210は、RAWデータ読み出しアドレス発生部212に対して、RAWデータ読み出しアドレスの初期値としてRAWバッファ開始アドレスをセットする(ステップS104)。そして、システムコントローラ210は、JPEGデータ書き込みアドレス発生部211に対して、JPEGデータ書き込みアドレスの初期値としてJPEGバッファ開始アドレスをセットする(ステップS105)。   Next, the system controller 210 sets a RAW buffer start address as an initial value of the RAW data read address to the RAW data read address generation unit 212 (step S104). Then, the system controller 210 sets the JPEG buffer start address as the initial value of the JPEG data write address in the JPEG data write address generation unit 211 (step S105).

次いで、システムコントローラ210は、RAM206のRAWバッファ302からRAWデータを読み出し、当該読み出されたRAWデータをJPEGデータへ変換する圧縮処理を開始するように制御する(ステップS106)。そして、システムコントローラ210は、画像全体の圧縮が終了したか否かの判定を行う(ステップS107)。この圧縮終了の判定は、圧縮処理部209において圧縮する画素数をカウントし、そのカウントした画素数が所定値に達したか否かに応じて行われる。   Next, the system controller 210 reads RAW data from the RAW buffer 302 of the RAM 206, and controls to start compression processing for converting the read RAW data into JPEG data (step S106). Then, the system controller 210 determines whether or not the entire image has been compressed (step S107). The determination of the end of compression is performed according to whether or not the number of pixels to be compressed is counted in the compression processing unit 209 and the counted number of pixels has reached a predetermined value.

ここで、RAWデータからJPEGデータへの変換について説明する。RAWデータは、上記ステップS101においてRAM206のRAWバッファ302に記憶されている。メモリコントローラ204は、RAWデータ読み出しアドレス発生部212が発生するRAWデータ読み出しアドレスに対応するRAWデータをRAWバッファ302から読み出す。この読み出されたRAWデータは、信号処理部207においてYUVデータに変換された後に、スイッチ208を介して圧縮処理部209に入力される。圧縮処理部209は、入力されたYUVデータを予め設定されている圧縮率で圧縮し、JPEGデータを生成する。このJPEGデータは、メモリコントローラ204により、JPEGデータ書き込みアドレス発生部211が発生するJPEGデータ書き込みアドレスに書き込まれる。   Here, conversion from RAW data to JPEG data will be described. The RAW data is stored in the RAW buffer 302 of the RAM 206 in step S101. The memory controller 204 reads RAW data corresponding to the RAW data read address generated by the RAW data read address generation unit 212 from the RAW buffer 302. The read RAW data is converted into YUV data by the signal processing unit 207 and then input to the compression processing unit 209 via the switch 208. The compression processing unit 209 compresses the input YUV data at a preset compression rate, and generates JPEG data. This JPEG data is written to the JPEG data write address generated by the JPEG data write address generation unit 211 by the memory controller 204.

上記ステップS107において画像全体の圧縮が終了していないと判定された場合、図4に示すように、システムコントローラ210は、RAWバッファ開始アドレス<JPEGデータ書き込みアドレスの関係が成立するか否かを判定する(ステップS108)。この判定は、RAWバッファ侵入検出部213の検出結果に基づいて行われる。ここで、RAWバッファ開始アドレス<JPEGデータ書き込みアドレスの関係が成立しない場合、システムコントローラ210は、JPEGデータ書き込みアドレスを更新し(ステップS112)、RAWデータ読み出しアドレスを更新する(ステップS113)。そして、システムコントローラ210は、再度、画像全体の圧縮が終了したか否かを判定する(ステップS107)。   If it is determined in step S107 that the compression of the entire image has not ended, the system controller 210 determines whether or not the relationship of RAW buffer start address <JPEG data write address is satisfied, as shown in FIG. (Step S108). This determination is made based on the detection result of the RAW buffer intrusion detection unit 213. If the relationship of RAW buffer start address <JPEG data write address is not established, the system controller 210 updates the JPEG data write address (step S112) and updates the RAW data read address (step S113). Then, the system controller 210 determines again whether or not the entire image has been compressed (step S107).

上記ステップS108においてRAWバッファ開始アドレス<JPEGデータ書き込みアドレスの関係が成立している場合、システムコントローラ210は、RAWバッファ侵入フラグに「1」をセットする(ステップS109)。この場合、JPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達しているので、JPEGデータのRAM206への書き込みを中止するようにメモリコントローラ204が制御される。   If the relationship of RAW buffer start address <JPEG data write address is established in step S108, the system controller 210 sets “1” in the RAW buffer entry flag (step S109). In this case, since the JPEG data write address has reached the address in the RAW buffer 302, the memory controller 204 is controlled to stop writing the JPEG data to the RAM 206.

次いで、システムコントローラ210は、追い付き検出部214の検出結果に基づいてRAWデータ読み出しアドレス<JPEGデータ書き込みアドレスの関係が成立するか否かを判定する(ステップS110)。ここで、RAWデータ読み出しアドレス<JPEGデータ書き込みアドレスの関係が成立しない場合、システムコントローラ210は、JPEGデータ書き込みアドレスおよびRAWデータ読み出しアドレスを更新する(ステップS112およびS113)。そして、システムコントローラ210は、再度、画像全体の圧縮が終了したか否かを判定する(ステップS107)。   Next, the system controller 210 determines whether or not the relationship of RAW data read address <JPEG data write address is established based on the detection result of the catch-up detection unit 214 (step S110). Here, if the relationship of RAW data read address <JPEG data write address is not established, the system controller 210 updates the JPEG data write address and the RAW data read address (steps S112 and S113). Then, the system controller 210 determines again whether or not the entire image has been compressed (step S107).

上記ステップS110においてRAWデータ読み出しアドレス<JPEGデータ書き込みアドレスの関係が成立すると判定された場合、システムコントローラ210は、追い付き検出フラグに「1」をセットする(ステップS111)。これにより、JPEGデータ書き込みアドレスがRAWデータ読み出しアドレスに到達していることが示される。   If it is determined in step S110 that the relationship RAW data read address <JPEG data write address is established, the system controller 210 sets “1” in the catch-up detection flag (step S111). This indicates that the JPEG data write address has reached the RAW data read address.

次いで、システムコントローラ210は、JPEGデータ書き込みアドレスおよびRAWデータ読み出しアドレスを更新する(ステップS112およびS113)。そして、システムコントローラ210は、再度、画像全体の圧縮が終了したか否かを判定する(ステップS107)。   Next, the system controller 210 updates the JPEG data write address and the RAW data read address (steps S112 and S113). Then, the system controller 210 determines again whether or not the entire image has been compressed (step S107).

上記ステップS107において画像全体の圧縮が終了していると判定された場合、図5に示すように、システムコントローラ210は、RAWバッファ侵入フラグが「1」であるか否かを判定する(ステップS114)。ここで、RAWバッファ侵入フラグが1である場合、システムコントローラ210は、JPEGデータのサイズが予め設定されているサイズAより大きいか否かを判定する(ステップS115)。JPEGデータのサイズがサイズAより大きい場合、システムコントローラ210は、圧縮処理部209の圧縮率をJPEGデータのサイズがサイズA内に収まる圧縮率に変更する(ステップS116)。   If it is determined in step S107 that the compression of the entire image has been completed, the system controller 210 determines whether or not the RAW buffer entry flag is “1” as shown in FIG. 5 (step S114). ). Here, when the RAW buffer entry flag is 1, the system controller 210 determines whether or not the size of the JPEG data is larger than a preset size A (step S115). When the size of the JPEG data is larger than the size A, the system controller 210 changes the compression rate of the compression processing unit 209 to a compression rate that allows the size of the JPEG data to be within the size A (step S116).

次いで、システムコントローラ210は、RAWバッファ侵入フラグおよび追い付き検出フラグと、RAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスのそれぞれに対する初期化を行う(ステップS102〜S105)。そして、システムコントローラ210は、上記変更された圧縮率を圧縮処理部209に設定し、この圧縮率を用いた圧縮処理を開始するように制御する(ステップS106)。   Next, the system controller 210 initializes the RAW buffer intrusion flag and the catch-up detection flag, and the RAW data read address and JPEG data write address (steps S102 to S105). Then, the system controller 210 sets the changed compression rate in the compression processing unit 209 and controls to start the compression processing using this compression rate (step S106).

上記ステップS115においてJPEGデータのサイズがサイズA以下であると判定された場合、システムコントローラ210は、追い付き検出フラグが「1」であるか否かを判定する(ステップS117)。ここで、追い付き検出フラグが「1」である場合、システムコントローラ210は、圧縮処理部209の圧縮率を、JPEGデータ書き込みアドレスがRAWデータ読み出しアドレスに追い付かない圧縮率に変更する(ステップS118)。そして、システムコントローラ210は、上記ステップS102に戻り、上記変更された圧縮率を圧縮処理部209に設定し、この圧縮率を用いた圧縮処理を開始するように制御する(ステップS106)。   If it is determined in step S115 that the size of the JPEG data is equal to or smaller than size A, the system controller 210 determines whether or not the catch-up detection flag is “1” (step S117). If the catch-up detection flag is “1”, the system controller 210 changes the compression rate of the compression processing unit 209 to a compression rate at which the JPEG data write address does not catch up with the RAW data read address (step S118). Then, the system controller 210 returns to step S102, sets the changed compression rate in the compression processing unit 209, and controls to start compression processing using this compression rate (step S106).

ここで圧縮率を上げた後に、JPEGデータ書き込みアドレスが再度RAWバッファに侵入する場合の動作について説明する。ステップS118で上げた圧縮率により、ステップS107〜ステップS113を画像全体の圧縮が終了するまで繰り返し行う。このとき、ステップS109においてRAWバッファ侵入フラグに「1」がセットされた場合、JPEGデータのRAM206への書き込みを中止するようにメモリコントローラ204が制御される。そして、ステップS114においてRAWバッファ侵入フラグに「1」がセットされているので、ステップS115、ステップS117へと移行する。   Here, an operation when the JPEG data write address enters the RAW buffer again after increasing the compression rate will be described. Steps S107 to S113 are repeated until the compression of the entire image is completed according to the compression rate increased in step S118. At this time, if “1” is set to the RAW buffer intrusion flag in step S109, the memory controller 204 is controlled to stop writing the JPEG data to the RAM 206. Since “1” is set in the RAW buffer intrusion flag in step S114, the process proceeds to step S115 and step S117.

上記ステップS117において追い付き検出フラグが「1」でないと判定されるので、システムコントローラ210は、圧縮処理部209により、画像先頭から本圧縮を行うように制御する(ステップS119)。   Since it is determined in step S117 that the catch-up detection flag is not “1”, the system controller 210 controls the compression processing unit 209 to perform main compression from the top of the image (step S119).

本実施形態の圧縮処理として本圧縮と仮圧縮があるが、後述の図6の説明の際に、その具体的な処理について述べる。   The compression processing according to the present embodiment includes main compression and temporary compression. Specific processing will be described in the description of FIG.

この本圧縮により得られたJPEGデータは、RAM206のJPEGバッファ301にまたはJPEGバッファ301からRAWバッファ302に亘って書き込まれる。次いで、システムコントローラ210は、メモリコントローラ204により、RAM206に書き込まれたJPEGデータを、メモリカード216に記録するように制御する(ステップS120)。そして、システムコントローラ210は、本処理を終了する。   The JPEG data obtained by the main compression is written to the JPEG buffer 301 of the RAM 206 or from the JPEG buffer 301 to the RAW buffer 302. Next, the system controller 210 controls the memory controller 204 to record the JPEG data written in the RAM 206 on the memory card 216 (step S120). Then, the system controller 210 ends this process.

また別の場合として、圧縮率を上げた後に、JPEGデータ書き込みアドレスがRAWバッファに侵入しない場合の動作について説明する。この場合も圧縮率を上げた後、ステップS107〜ステップS113を画像全体の圧縮が終了するまで繰り返し行うが、RAWバッファへの侵入は検出されない。したがって、ステップS114では、RAWバッファ侵入フラグが「1」でないと判定され、ステップS120に移行する。ステップS120では、システムコントローラ210は、メモリコントローラ204により、上記JPEGデータをメモリカード216に記録するように制御する。そして、システムコントローラ210は、本処理を終了する。   As another case, the operation when the JPEG data write address does not enter the RAW buffer after increasing the compression rate will be described. Also in this case, after increasing the compression rate, steps S107 to S113 are repeated until the compression of the entire image is completed, but no entry into the RAW buffer is detected. Therefore, in step S114, it is determined that the RAW buffer entry flag is not “1”, and the process proceeds to step S120. In step S <b> 120, the system controller 210 controls the memory controller 204 to record the JPEG data on the memory card 216. Then, the system controller 210 ends this process.

上記ステップS114においてRAWバッファ侵入フラグが「1」でないと判定された場合、システムコントローラ210は、メモリコントローラ204により、上記JPEGデータをメモリカード216に記録するように制御する(ステップS120)。そして、システムコントローラ210は、本処理を終了する。   If it is determined in step S114 that the RAW buffer entry flag is not “1”, the system controller 210 controls the memory controller 204 to record the JPEG data in the memory card 216 (step S120). Then, the system controller 210 ends this process.

次に、JPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達する場合のJPEGデータの書き込み動作について図6を参照しながら説明する。図6はJPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達する場合のメモリマップとRAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスの関係とを示す図である。ここでは、スイッチ208に対して「0」が設定され、信号処理部207から出力されたYUVデータが圧縮処理部209に入力されるものとする。   Next, the JPEG data write operation when the JPEG data write address reaches the address in the RAW buffer 302 will be described with reference to FIG. FIG. 6 is a diagram showing the memory map and the relationship between the RAW data read address and the JPEG data write address when the JPEG data write address reaches the address in the RAW buffer 302. Here, “0” is set to the switch 208, and the YUV data output from the signal processing unit 207 is input to the compression processing unit 209.

図6に示すように、RAWデータ読み出しアドレス105がRAWバッファ開始アドレス103を初期値として順次発生され、発生されたRAWデータ読み出しアドレス105に対応するRAWデータがRAWバッファ302から読み出される。そして、RAWデータ読み出しアドレス105が圧縮終了に対応するRAWデータ読み出し終了アドレス111に達するまで、RAWデータ(YUVデータ)に対する圧縮処理が圧縮処理部209により行われる。ここで、図6の縦軸はアドレスを表し、アドレスの値は下方向に向けて大きくなるものとする。また、横軸は圧縮の進度を表し、左端が圧縮の開始、右端が圧縮の終了を示す。   As shown in FIG. 6, the RAW data read address 105 is sequentially generated with the RAW buffer start address 103 as an initial value, and RAW data corresponding to the generated RAW data read address 105 is read from the RAW buffer 302. The compression processing unit 209 performs compression processing on the RAW data (YUV data) until the RAW data read address 105 reaches the RAW data read end address 111 corresponding to the end of compression. Here, the vertical axis in FIG. 6 represents an address, and the value of the address is assumed to increase downward. The horizontal axis represents the degree of compression, the left end indicates the start of compression, and the right end indicates the end of compression.

また、RAWデータ読み出しアドレスの発生に伴い、JPEGデータ書き込みアドレス106がJPEGバッファ開始アドレス104を初期値として順次発生される。ここで、JPEGデータのRAM206への書き込み終了時に、JPEGデータ書き込みアドレス106はJPEGデータ書き込み終了アドレス108へ達するものとする。図6に示す例の場合、このJPEGデータ書き込み終了アドレス108は、RAWバッファ302内のアドレスであるとする。ここで、JPEG方式による圧縮は可変長圧縮であるために、JPEGデータ書き込みアドレス106は、実際には直線では表されないが便宜的に直線で表すものとする。   As the RAW data read address is generated, the JPEG data write address 106 is sequentially generated with the JPEG buffer start address 104 as an initial value. Here, it is assumed that the JPEG data write address 106 reaches the JPEG data write end address 108 when the JPEG data has been written to the RAM 206. In the case of the example shown in FIG. 6, it is assumed that this JPEG data write end address 108 is an address in the RAW buffer 302. Here, since the compression by the JPEG method is variable length compression, the JPEG data write address 106 is not actually represented by a straight line but is represented by a straight line for convenience.

このような場合、JPEGデータ書き込みアドレス106がRAWバッファ開始アドレス103(図中の交点107)を経てRAWバッファ302内のアドレスに到達することになる。すなわち、JPEGデータの一部がRAWバッファ302に書き込まれることになる。   In such a case, the JPEG data write address 106 reaches the address in the RAW buffer 302 via the RAW buffer start address 103 (intersection 107 in the figure). That is, a part of the JPEG data is written into the RAW buffer 302.

本実施の形態においては、JPEGデータ書き込みアドレス106がRAWバッファ302内のアドレスに到達した場合、JPEGデータのサイズを算出するための圧縮が実施され、この圧縮を本実施形態では仮圧縮と定義している。このJPEGデータのサイズは、JPEGバッファ開始アドレス104からJPEGデータ書き込み終了アドレスに基づいて算出される。この仮圧縮時には、JPEGデータ書き込みアドレス106の発生は継続されるが、JPEGデータの一部は、RAM206に書き込まれない。すなわち、JPEGデータ書き込みアドレス106がRAWバッファ302のRAWバッファ開始アドレスに到達して時点(交点107)からJPEGデータ書き込み終了アドレス108間のデータが、RAM206に書き込まれない。そして、画像全体の圧縮が終了するまで、上記仮圧縮が行われる。   In the present embodiment, when the JPEG data write address 106 reaches the address in the RAW buffer 302, compression for calculating the size of JPEG data is performed, and this compression is defined as temporary compression in the present embodiment. ing. The JPEG data size is calculated from the JPEG buffer start address 104 based on the JPEG data write end address. During this temporary compression, generation of the JPEG data write address 106 is continued, but part of the JPEG data is not written to the RAM 206. That is, data between the JPEG data write end address 108 from the time (intersection 107) when the JPEG data write address 106 reaches the RAW buffer start address of the RAW buffer 302 is not written to the RAM 206. Then, the temporary compression is performed until the entire image is compressed.

画像全体の圧縮が終了すると、JPEGデータを再度RAM206に書き込むために、改めて画像(RAWデータ)をその先頭から圧縮するための圧縮が行われる。この圧縮を本実施形態では本圧縮と定義している。   When the compression of the entire image is completed, in order to write JPEG data into the RAM 206 again, compression for compressing the image (RAW data) from the head is performed again. This compression is defined as main compression in this embodiment.

この場合の書き込み動作を具体的に説明すると、撮像素子202から出力された電気信号をA/D変換することによって得られたRAWデータが、RAM206のRAWバッファ302の上記発生されたRAWデータ書き込みアドレスに書き込まれる。この際、RAWデータは、RAWバッファ開始アドレス103を先頭として順に書き込まれる(ステップS101)。   The write operation in this case will be specifically described. The RAW data obtained by A / D converting the electric signal output from the image sensor 202 is the generated RAW data write address of the RAW buffer 302 of the RAM 206. Is written to. At this time, the RAW data is sequentially written starting from the RAW buffer start address 103 (step S101).

次いで、システムコントローラ210の内部に保持されるRAWバッファ侵入フラグに「0」がセットされ(ステップS102)、追い付き検出フラグに「0」がセットされる(ステップS103)。   Next, “0” is set to the RAW buffer intrusion flag held in the system controller 210 (step S102), and “0” is set to the catch-up detection flag (step S103).

次いで、RAWデータ読み出しアドレス発生部212に対して、RAWデータ読み出しアドレス105の初期値としてRAWバッファ開始アドレス103がセットされる(ステップS104)。そして、JPEGデータ書き込みアドレス発生部211に対して、JPEGデータ書き込みアドレス106の初期値としてJPEGバッファ開始アドレス104がセットされる(ステップS105)。   Next, the RAW buffer start address 103 is set as an initial value of the RAW data read address 105 to the RAW data read address generation unit 212 (step S104). Then, the JPEG buffer start address 104 is set as the initial value of the JPEG data write address 106 to the JPEG data write address generator 211 (step S105).

次いで、RAM206のRAWバッファ302からRAWデータが読み出され、当該読み出されたRAWデータをJPEGデータへ変換する圧縮処理が開始される(ステップS106)。   Next, RAW data is read from the RAW buffer 302 of the RAM 206, and a compression process for converting the read RAW data into JPEG data is started (step S106).

本例の場合、上記画像全体の圧縮中において、JPEGデータ書き込みアドレス106がRAWバッファ開始アドレス103(図中の交点107)に到達することになる。すなわち、RAWバッファ開始アドレス103<JPEGデータ書き込みアドレス106の関係が成立することになる(図4のステップS108)。   In the case of this example, the JPEG data write address 106 reaches the RAW buffer start address 103 (intersection 107 in the figure) during the compression of the entire image. That is, the relationship RAW buffer start address 103 <JPEG data write address 106 is established (step S108 in FIG. 4).

RAWバッファ開始アドレス103<JPEGデータ書き込みアドレス106の関係が成立すると、RAWバッファ侵入フラグが「1」にセットされる(ステップS109)。RAWバッファ侵入フラグに「1」がセットされると、JPEGデータ書き込み終了アドレス108とJPEGバッファ開始アドレス104に基づいて当該アドレス間のJPEGデータのサイズを算出するための仮圧縮が行われる。この仮圧縮時には、JPEGデータのRAM206への書き込みは中止される。本例の場合、RAWデータ読み出しアドレス105<JPEGデータ書き込みアドレス106の関係は成立しないので、追い付き検出フラグに「1」がセットされない。そして、JPEGデータ書き込みアドレス106およびRAWデータ読み出しアドレス105の更新が、継続される(ステップS112およびS113)。   When the relationship of RAW buffer start address 103 <JPEG data write address 106 is established, the RAW buffer entry flag is set to “1” (step S109). When “1” is set to the RAW buffer intrusion flag, temporary compression for calculating the size of JPEG data between the addresses is performed based on the JPEG data write end address 108 and the JPEG buffer start address 104. During this temporary compression, writing of JPEG data to the RAM 206 is stopped. In the case of this example, the relationship of the RAW data read address 105 <JPEG data write address 106 does not hold, so that the catch-up detection flag is not set to “1”. Then, the update of the JPEG data write address 106 and the RAW data read address 105 is continued (steps S112 and S113).

このようにして、ステップS107からステップS113までが、画像全体の圧縮が終了するまで繰り返し行われる。この画像全体の圧縮が終了した状態には(ステップS107)、RAWバッファ侵入フラグに「1」がセットされている状態にある(ステップS114)。   In this way, steps S107 to S113 are repeated until the compression of the entire image is completed. When the entire image has been compressed (step S107), the RAW buffer entry flag is set to “1” (step S114).

次いで、上記算出されたJPEGデータのサイズが予め設定されているサイズAを超えているか否かの判定が行われる(ステップS115)。ここで、上記算出されたJPEGデータのサイズがサイズAを超えている場合、圧縮処理部209の圧縮率が、上記算出されたJPEGデータのサイズが上記サイズA内に収まる圧縮率に変更される(ステップS116)。   Next, it is determined whether or not the calculated JPEG data size exceeds a preset size A (step S115). When the calculated JPEG data size exceeds the size A, the compression rate of the compression processing unit 209 is changed to a compression rate that allows the calculated JPEG data size to be within the size A. (Step S116).

圧縮率が変更されると、RAWバッファ侵入フラグおよび追い付き検出フラグの初期化と、RAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスの初期化とが行われる(ステップS102〜S105)。そして、上記変更された圧縮率を用いてRAWデータを圧縮する圧縮処理が開始される(ステップS106)。   When the compression rate is changed, initialization of the RAW buffer entry flag and catch-up detection flag, and initialization of the RAW data read address and JPEG data write address are performed (steps S102 to S105). Then, a compression process for compressing RAW data using the changed compression rate is started (step S106).

圧縮率が変更された場合においても、RAWバッファ侵入フラグに「1」がセットされる場合があるが、JPEGデータはサイズA以下のサイズに収まる。よって、追い付き検出フラグが「1」であるか否かの判定が行われる(ステップS117)。本例の場合、追い付きフラグに「1」がセットされていないので、圧縮処理部209により、改めてRAWデータをその先頭から圧縮し、当該圧縮により得られたJPEGデータをRAM206に書き込む本圧縮が行われる(ステップS119)。この本圧縮においては、JPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達したとしても、JPEGデータの書き込みを中止することなく、RAWバッファ302にJPEGデータの書き込みが行われる。そして、本圧縮によりJPEGバッファ301からRAWバッファ302に亘って書き込まれたJPEGデータは、メモリカード216に記録される(ステップS120)。   Even when the compression rate is changed, “1” may be set in the RAW buffer intrusion flag, but the JPEG data fits in the size A or smaller. Therefore, it is determined whether or not the catch-up detection flag is “1” (step S117). In this example, since “1” is not set in the catch-up flag, the compression processing unit 209 compresses the RAW data from the head again, and performs the main compression to write the JPEG data obtained by the compression to the RAM 206. (Step S119). In this main compression, even if the JPEG data write address reaches the address in the RAW buffer 302, the JPEG data is written to the RAW buffer 302 without stopping the JPEG data write. The JPEG data written from the JPEG buffer 301 to the RAW buffer 302 by the main compression is recorded on the memory card 216 (step S120).

次に、JPEGデータ書き込みアドレスがRAWバッファ302内に到達し、かつRAWデータ読み出しアドレスに追い付く場合について図7を参照しながら説明する。図7はJPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達し、かつRAWデータ読み出しアドレスに追い付く場合のメモリマップとRAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスの関係とを示す図である。   Next, a case where the JPEG data write address reaches the RAW buffer 302 and catches up with the RAW data read address will be described with reference to FIG. FIG. 7 is a diagram showing the memory map and the relationship between the RAW data read address and the JPEG data write address when the JPEG data write address reaches the address in the RAW buffer 302 and catches up with the RAW data read address.

図7に示すように、JPEGデータ書き込みアドレス506が、RAWバッファ302のRAWバッファ開始アドレス103を経てRAWデータ読出しアドレス106と一致し(交点509)、追い付く場合がある。   As shown in FIG. 7, the JPEG data write address 506 may coincide with the RAW data read address 106 via the RAW buffer start address 103 of the RAW buffer 302 (intersection 509) and catch up.

JPEGデータ書き込みアドレス506がRAWバッファ302のRAWバッファ開始アドレス103を超えると、RAWバッファ開始アドレス103<JPEGデータ書き込みアドレス506の関係が成立する(図4のステップS108)。これにより、RAWバッファ侵入フラグに「1」がセットされる(ステップS109)。RAWバッファ侵入フラグに「1」がセットされると、以降のJPEGデータ書き込みアドレス506に書き込むべきJPEGデータの書き込みが中止される。そして、仮圧縮が行われ、JPEGデータ書き込み終了アドレスとJPEGバッファ開始アドレス104に基づいてJPEGデータのサイズが算出される。この仮圧縮時には、JPEGデータのRAM206への書き込みは中止されるが、JPEGデータ書き込みアドレス506およびRAWデータ読み出しアドレス105の発生は継続される。すなわち、画像全体の圧縮が終了するまで、仮圧縮が行われる。   When the JPEG data write address 506 exceeds the RAW buffer start address 103 of the RAW buffer 302, the relationship of RAW buffer start address 103 <JPEG data write address 506 is established (step S108 in FIG. 4). As a result, “1” is set to the RAW buffer entry flag (step S109). When “1” is set to the RAW buffer intrusion flag, writing of JPEG data to be written to the subsequent JPEG data writing address 506 is stopped. Then, temporary compression is performed, and the JPEG data size is calculated based on the JPEG data write end address and the JPEG buffer start address 104. During this temporary compression, writing of JPEG data to the RAM 206 is stopped, but generation of the JPEG data write address 506 and the RAW data read address 105 is continued. That is, temporary compression is performed until the entire image is compressed.

本例の場合、画像全体の圧縮が終了するまでの期間中に、RAWデータ読み出しアドレス105<JPEGデータ書き込みアドレス506の関係が成立し(ステップS110)、追い付き検出フラグに「1」がセットされる(ステップS111)。そして、画像全体の圧縮が終了するまで、ステップS107からステップS113までの処理が繰り返し行われる。この画像全体の圧縮が終了した状態においては(ステップS107)、RAWバッファ侵入フラグに「1」がセットされ、追い付き検出フラグに「1」がセットされた状態にある。   In the case of this example, the relationship of RAW data read address 105 <JPEG data write address 506 is established during the period until the entire image is compressed (step S110), and the catch-up detection flag is set to “1”. (Step S111). Then, the processing from step S107 to step S113 is repeated until the compression of the entire image is completed. In a state where the compression of the entire image has been completed (step S107), “1” is set to the RAW buffer entry flag and “1” is set to the catch-up detection flag.

次いで、RAWバッファ侵入フラグに「1」がセットされているので、上記算出されたJPEGデータのサイズが予め設定されているサイズAを超えているか否かの判定が行われる(ステップS115)。ここで、上記算出されたJPEGデータのサイズがサイズAを超えている場合、圧縮処理部209の圧縮率が、上記算出されたJPEGデータのサイズが上記サイズA内に収まるような圧縮率に変更される(ステップS116)。   Next, since “1” is set in the RAW buffer intrusion flag, it is determined whether or not the calculated size of the JPEG data exceeds a preset size A (step S115). When the calculated JPEG data size exceeds the size A, the compression rate of the compression processing unit 209 is changed to a compression rate that allows the calculated JPEG data size to be within the size A. (Step S116).

圧縮率が変更されると、RAWバッファ侵入フラグおよび追い付き検出フラグの初期化と、RAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスの初期化とが行われる(ステップS102〜S105)。そして、上記変更された圧縮率を用いてRAWデータを圧縮する圧縮処理が開始される(ステップS106)。   When the compression rate is changed, initialization of the RAW buffer entry flag and catch-up detection flag, and initialization of the RAW data read address and JPEG data write address are performed (steps S102 to S105). Then, a compression process for compressing RAW data using the changed compression rate is started (step S106).

ここで変更する圧縮率により再圧縮時のJPEGデータ書き込みアドレスとRAWバッファ302内のアドレスとの間の関係は、次の3つのいずれかである。   The relationship between the JPEG data write address and the address in the RAW buffer 302 at the time of recompression according to the compression rate changed here is one of the following three.

(1)変更する圧縮率により再圧縮時のJPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに達するが、RAWデータ読み出しアドレスに追い付かない場合。
(2)RAWバッファ302内のアドレスに到達し、かつRAWデータ読み出しアドレスに追い付く場合。
(3)RAWバッファ302内のアドレスに到達し無い場合。
(1) The JPEG data write address at the time of recompression reaches the address in the RAW buffer 302 depending on the compression rate to be changed, but cannot catch up with the RAW data read address.
(2) A case where the address in the RAW buffer 302 is reached and the RAW data read address is caught up.
(3) When the address in the RAW buffer 302 is not reached.

以下、3つの場合のそれぞれについて説明する。   Hereinafter, each of the three cases will be described.

まず、上記(1)の場合すなわち上記圧縮率の変更後の再圧縮においてJPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに達するが、RAWデータ読み出しアドレスに追い付かない場合について説明する。   First, the case of (1), that is, the case where the JPEG data write address reaches the address in the RAW buffer 302 in the recompression after changing the compression rate, but does not catch up with the RAW data read address will be described.

この場合、JPEGデータ書き込みアドレスが、JPEGデータ書き込みアドレス510になるものとする。このJPEGデータ書き込みアドレス510は、RAWバッファ開始アドレスとの交点507を経てRAWバッファ302内のアドレスに達するものとなるが、RAWデータ読み出しアドレスに追い付くことはない。   In this case, it is assumed that the JPEG data write address becomes the JPEG data write address 510. The JPEG data write address 510 reaches the address in the RAW buffer 302 via the intersection 507 with the RAW buffer start address, but does not catch up with the RAW data read address.

よって、上記JPEGデータのサイズがサイズAを超えておらず、かつ追い付き検出フラグが「1」でない状態になるので、改めて、圧縮処理部209により、変更された圧縮率で画像全体の圧縮を行う本圧縮が行われる。この本圧縮においては、JPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達したとしても、JPEGデータの書き込みを中止することなく、RAWバッファ302にJPEGデータの書き込みが行われる。そして、本圧縮によりJPEGバッファ301からRAWバッファ302に亘って書き込まれたJPEGデータは、メモリカード216に記録される(ステップS120)。   Therefore, since the JPEG data size does not exceed the size A and the catch-up detection flag is not “1”, the compression processing unit 209 again compresses the entire image at the changed compression rate. Full compression is performed. In this main compression, even if the JPEG data write address reaches the address in the RAW buffer 302, the JPEG data is written to the RAW buffer 302 without stopping the JPEG data write. The JPEG data written from the JPEG buffer 301 to the RAW buffer 302 by the main compression is recorded on the memory card 216 (step S120).

次に、上記(2)の場合すなわち上記圧縮率の変更後の再圧縮においてJPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達し、かつRAWデータ読み出しアドレスに追い付く場合について説明する。   Next, the case of (2), that is, the case where the JPEG data write address reaches the address in the RAW buffer 302 and catches up with the RAW data read address in the recompression after changing the compression rate will be described.

この場合、追い付きフラグに「1」がセットされているので、圧縮処理部209の圧縮率が、JPEGデータ書き込みアドレスがRAWデータ読み出しアドレスに追い付かない圧縮率に変更される(ステップS118)。そして、再度変更された圧縮率を用いた圧縮処理が行われる。   In this case, since the catch-up flag is set to “1”, the compression rate of the compression processing unit 209 is changed to a compression rate at which the JPEG data write address cannot catch up with the RAW data read address (step S118). Then, the compression process using the changed compression rate is performed again.

最後に、上記(3)の場合すなわち上記圧縮率の変更後の再圧縮においてJPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達し無い場合について説明する。   Finally, the case of (3), that is, the case where the JPEG data write address does not reach the address in the RAW buffer 302 in the recompression after changing the compression rate will be described.

この場合、再圧縮処理終了後RAWバッファに到達していないことが判定される(ステップ114)。そして、圧縮により書き込まれたJPEGデータはメモリカード216へ記録される(ステップ120)。   In this case, it is determined that the RAW buffer has not been reached after completion of the recompression process (step 114). The JPEG data written by compression is recorded on the memory card 216 (step 120).

次に、JPEG書き込みデータアドレスがRAWバッファ302内のアドレスに到達しない場合について図8を参照しながら説明する。図8はJPEG書き込みデータアドレスがRAWバッファ302内のアドレスに到達しない場合のメモリマップとRAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスの関係を示す図である。   Next, a case where the JPEG write data address does not reach the address in the RAW buffer 302 will be described with reference to FIG. FIG. 8 is a diagram showing the relationship between the memory map, the RAW data read address, and the JPEG data write address when the JPEG write data address does not reach the address in the RAW buffer 302.

JPEG書き込みデータアドレスがRAWバッファ302内のアドレスに到達しない場合とは、圧縮処理部209により、JPEGデータがJPEGバッファ301内に収まるような圧縮率で、画像が圧縮された場合である。   The case where the JPEG write data address does not reach the address in the RAW buffer 302 is a case where the image is compressed by the compression processing unit 209 at a compression rate that allows the JPEG data to be stored in the JPEG buffer 301.

このような場合、画像全体の圧縮が終了するまで、RAWバッファ開始アドレス103<JPEGデータ書き込みアドレス106の関係が成立しない(ステップS108)。また、RAWデータ読み出しアドレス105<JPEGデータ書き込みアドレス506の関係が成立しない(ステップS110)。すなわち、RAWバッファ侵入フラグおよび追い付き検出フラグには、「1」がセットされることはない(ステップS109およびS111)。   In such a case, the relationship of RAW buffer start address 103 <JPEG data write address 106 does not hold until the entire image is compressed (step S108). Further, the relationship RAW data read address 105 <JPEG data write address 506 is not established (step S110). That is, “1” is not set in the RAW buffer intrusion flag and the catch-up detection flag (steps S109 and S111).

そして、画像全体の圧縮が終了すると(ステップS107)、JPEGバッファ301に書き込まれたJPEGデータがメモリカード216に記録される(ステップS120)。   When the entire image is compressed (step S107), the JPEG data written in the JPEG buffer 301 is recorded in the memory card 216 (step S120).

このように、本実施の形態によれば、JPEGバッファ301とRAWバッファ302とを兼ねるRAM206に対して、RAWデータにJPEGデータを上書きすることなく、JPEGデータを書き込むことができる。   As described above, according to the present embodiment, JPEG data can be written to the RAM 206 serving as the JPEG buffer 301 and the RAW buffer 302 without overwriting the RAW data with the JPEG data.

本実施の形態においては、JPEGバッファ301のサイズが、標準チャートを撮影した場合のJPEGファイルサイズに設定されている。これにより、高周波画像に代表される特殊な画像を撮影した場合のみに、JPEGデータの一部がRAWバッファ302に書き込まれることとなる。すなわち、JPEGデータ書き込みアドレスがRAWバッファ内のアドレスに到達する場合が少なくなり、仮圧縮の後に本圧縮を行うなどという、圧縮を行う頻度を低下させることができ、処理速度の低下を未然に防止することができる。   In the present embodiment, the size of the JPEG buffer 301 is set to the JPEG file size when a standard chart is captured. As a result, only when a special image typified by a high-frequency image is taken, a part of the JPEG data is written in the RAW buffer 302. In other words, the JPEG data write address is less likely to reach the address in the RAW buffer, and the frequency of compression such as performing the main compression after the temporary compression can be reduced, thereby preventing a reduction in processing speed. can do.

また、本実施の形態においては、RAWデータ上にJPEGデータを上書きする場合を説明したが、RAM206に保持されているYUVデータ上にJPEGデータを上書きするようにしてもよい。   In the present embodiment, the case where the JPEG data is overwritten on the RAW data has been described. However, the JPEG data may be overwritten on the YUV data held in the RAM 206.

また、本実施の形態においては、RAWデータをRAM206から読み出して圧縮する場合を説明したが、例えばYUVデータをRAM206から読み出し圧縮する場合にも、同様にYUVバッファをJPEGバッファとして兼ねるようにすることも可能である。この場合、RAM206には、YUVデータが書き込まれるYUVバッファが設けられる。   In the present embodiment, the case where the raw data is read from the RAM 206 and compressed is described. However, for example, when the YUV data is read from the RAM 206 and compressed, the YUV buffer is also used as the JPEG buffer. Is also possible. In this case, the RAM 206 is provided with a YUV buffer into which YUV data is written.

また、本実施の形態においては、圧縮処理部209の圧縮方式としてJPEG方式を用いているが、これに代えて他の圧縮方式を用いることも可能である。   In the present embodiment, the JPEG method is used as the compression method of the compression processing unit 209, but other compression methods can be used instead.

また、本発明の目的は、以下の処理を実行することによって達成される。即ち、上述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)が記憶媒体に格納されたプログラムコードを読み出す処理である。   The object of the present invention is achieved by executing the following processing. That is, a storage medium that records a program code of software that realizes the functions of the above-described embodiments is supplied to a system or apparatus, and a computer (or CPU, MPU, etc.) of the system or apparatus is stored in the storage medium. This is the process of reading the code.

この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施の形態の機能を実現することになり、そのプログラムコード及び該プログラムコードを記憶した記憶媒体は本発明を構成することになる。   In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the program code and the storage medium storing the program code constitute the present invention.

また、プログラムコードを供給するための記憶媒体としては、次のものを用いることができる。例えば、フロッピー(登録商標)ディスク、ハードディスク、光磁気ディスク、CD−ROM、CD−R、CD−RW、DVD−ROM、DVD−RAM、DVD−RW、DVD+RW、磁気テープ、不揮発性のメモリカード、ROM等である。または、プログラムコードをネットワークを介してダウンロードしてもよい。   Moreover, the following can be used as a storage medium for supplying the program code. For example, floppy (registered trademark) disk, hard disk, magneto-optical disk, CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW, magnetic tape, nonvolatile memory card, ROM or the like. Alternatively, the program code may be downloaded via a network.

また、コンピュータが読み出したプログラムコードを実行することにより、上記実施の形態の機能が実現される場合も本発明に含まれる。加えて、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(オペレーティングシステム)等が実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれる。   Further, the present invention includes a case where the function of the above-described embodiment is realized by executing the program code read by the computer. In addition, an OS (operating system) running on the computer performs part or all of the actual processing based on an instruction of the program code, and the functions of the above-described embodiments are realized by the processing. Is also included.

更に、前述した実施形態の機能が以下の処理によって実現される場合も本発明に含まれる。即ち、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれる。その後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部または全部を行う場合である。   Furthermore, a case where the functions of the above-described embodiment are realized by the following processing is also included in the present invention. That is, the program code read from the storage medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. Thereafter, based on the instruction of the program code, the CPU or the like provided in the function expansion board or function expansion unit performs part or all of the actual processing.

本発明の一実施の形態に係る画像記憶装置を搭載するデジタルカメラの構成を示すブロック図である。It is a block diagram which shows the structure of the digital camera carrying the image storage device which concerns on one embodiment of this invention. 図1のRAM206のメモリマップを示す図である。It is a figure which shows the memory map of RAM206 of FIG. 図1のデジタルカメラにおけるJPEGデータの書き込み動作の手順を示すフローチャートである。3 is a flowchart showing a procedure of JPEG data writing operation in the digital camera of FIG. 1. 図1のデジタルカメラにおけるJPEGデータの書き込み動作の手順を示すフローチャートである。3 is a flowchart showing a procedure of JPEG data writing operation in the digital camera of FIG. 1. 図1のデジタルカメラにおけるJPEGデータの書き込み動作の手順を示すフローチャートである。3 is a flowchart showing a procedure of JPEG data writing operation in the digital camera of FIG. 1. JPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達する場合のメモリマップとRAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスの関係とを示す図である。It is a figure which shows the memory map in case a JPEG data write address reaches the address in the RAW buffer 302, and the relationship between a RAW data read address and a JPEG data write address. JPEGデータ書き込みアドレスがRAWバッファ302内のアドレスに到達し、かつRAWデータ読み出しアドレスに追い付く場合のメモリマップとRAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスの関係とを示す図である。It is a figure which shows the memory map when the JPEG data write address reaches the address in the RAW buffer 302 and catches up with the RAW data read address, and the relationship between the RAW data read address and the JPEG data write address. JPEG書き込みデータアドレスがRAWバッファ302内のアドレスに到達しない場合のメモリマップとRAWデータ読み出しアドレスおよびJPEGデータ書き込みアドレスの関係を示す図である。It is a figure which shows the relationship between a memory map in case a JPEG write data address does not reach the address in the RAW buffer 302, a RAW data read address, and a JPEG data write address.

符号の説明Explanation of symbols

204 メモリコントローラ
205 RAWデータ書き込みアドレス発生部
206 RAM
209 圧縮処理部
210 システムコントローラ
211 JPEGデータ書き込みアドレス発生部
212 RAWデータ読み出しアドレス発生部
213 RAWバッファ侵入検出部
214 追い付き検出部
204 Memory controller 205 RAW data write address generator 206 RAM
209 Compression processing unit 210 System controller 211 JPEG data write address generation unit 212 RAW data read address generation unit 213 RAW buffer intrusion detection unit 214 Catch-up detection unit

Claims (12)

第1のバッファと第2のバッファとを兼ねる記憶手段と、
入力された画像データを前記第1のバッファへの書き込む画像書き込み手段と、
前記第1のバッファから前記画像データを読み出す画像読み出し手段と、
前記第1のバッファから読み出された画像データを設定されている圧縮率で圧縮して、圧縮画像データを生成する画像圧縮手段と、
前記画像圧縮手段により生成された圧縮画像データを前記第2のバッファから前記第1のバッファに亘って書き込むことが可能な圧縮画像書き込み手段と、
前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれる場合において、前記圧縮画像書込み手段による前記圧縮画像データの前記記憶手段への書き込みを停止させる停止手段と、
前記停止手段により書き込みを停止させた後、前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくか否かを判定する判定手段と、
前記判定手段により前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつかないと判断された場合、前記圧縮画像書き込み手段が、再度、停止前の圧縮率で圧縮された圧縮画像データを前記記憶手段へ書き込むよう制御する制御手段と、を備えることを特徴とする画像記憶装置。
Storage means serving both as a first buffer and a second buffer;
Image writing means for writing input image data into the first buffer;
Image reading means for reading the image data from the first buffer;
Image compression means for compressing the image data read from the first buffer at a set compression rate to generate compressed image data;
Compressed image writing means capable of writing the compressed image data generated by the image compression means from the second buffer to the first buffer;
When the compressed image data is written from the second buffer over at least a partial area of the first buffer, the stop for stopping the writing of the compressed image data to the storage unit by the compressed image writing unit Means,
Determination means for determining whether or not the write address of the compressed image data catches up with the read address of the image data after the writing is stopped by the stop means;
When the determination unit determines that the write address of the compressed image data cannot catch up with the read address of the image data, the compressed image writing unit again stores the compressed image data compressed at the compression rate before the stop. An image storage device comprising: control means for controlling writing to the storage means.
前記判定手段により前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくと判定された場合、前記制御手段は、前記画像圧縮手段の圧縮率を前記停止前の圧縮率よりも高い圧縮率に変更することを特徴とする請求項1に記載の画像記憶装置。   When the determination unit determines that the write address of the compressed image data catches up with the read address of the image data, the control unit sets the compression rate of the image compression unit higher than the compression rate before the stop. The image storage device according to claim 1, wherein the image storage device is changed to: 前記高い圧縮率で圧縮された圧縮画像データが前記第2のバッファから前記第1のバッファの領域に亘って書き込まれない場合、前記制御手段は、前記圧縮画像書き込み手段が前記高い圧縮率で圧縮された圧縮画像データを前記記憶手段へ書き込むよう制御することを特徴とする請求項2に記載の画像記憶装置。   When the compressed image data compressed at the high compression rate is not written from the second buffer to the area of the first buffer, the control unit compresses the compressed image writing unit at the high compression rate. 3. The image storage device according to claim 2, wherein the compressed image data is controlled to be written in the storage means. 前記制御手段は、前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれる場合において、前記圧縮画像データのサイズが予め設定されているサイズより大きい場合、前記画像圧縮手段の圧縮率を、前記圧縮画像データのサイズが予め設定されているサイズ以下になる圧縮率に変更し、再度、前記画像圧縮手段により、前記第1のバッファから読み出された画像データを前記変更された圧縮率で圧縮して圧縮画像データを生成し、前記圧縮画像書き込み手段により、前記生成された圧縮画像データを前記第2のバッファから書き込むように制御することを特徴とする請求項1〜3のいずれか1つに記載の画像記憶装置。   In the case where the compressed image data is written from the second buffer to at least a partial area of the first buffer, the control means is configured such that the size of the compressed image data is larger than a preset size. The compression rate of the image compression unit is changed to a compression rate at which the size of the compressed image data is equal to or smaller than a preset size, and the image compression unit reads the compression rate from the first buffer again. The image data is compressed at the changed compression rate to generate compressed image data, and the compressed image writing means controls to write the generated compressed image data from the second buffer. The image storage device according to claim 1. 前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれることを検出する第1の検出手段と、
前記圧縮画像データのサイズを検出する第2の検出手段と、
前記画像データ上に前記圧縮画像データが上書きされることを検出する第3の検出手段とを備え、
前記停止手段は、前記第1の検出手段の検出結果に基づいて前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれるか否かを判定して前記書き込みを停止し、前記制御手段は、前記第2の検出手段の結果に基づいて前記圧縮画像データのサイズが予め設定されているサイズ以下であるか否かの判定し、前記判定手段は前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくか否かの判定を行うことを特徴とする請求項1ないし4のいずれか1つに記載の画像記憶装置。
First detection means for detecting that the compressed image data is written from the second buffer over at least a partial region of the first buffer;
Second detection means for detecting the size of the compressed image data;
Third detection means for detecting that the compressed image data is overwritten on the image data,
The stop means determines whether or not the compressed image data is written from the second buffer to at least a partial area of the first buffer based on a detection result of the first detection means. The writing is stopped, and the control means determines whether or not the size of the compressed image data is equal to or smaller than a preset size based on the result of the second detection means, and the determination means 5. The image storage device according to claim 1, wherein a determination is made as to whether a write address of compressed image data catches up with a read address of the image data. 6.
第1のバッファと第2のバッファとを兼ねる記憶手段と、入力された画像データを前記第1のバッファへの書き込む画像書き込み手段と、前記第1のバッファから前記画像データを読み出す画像読み出し手段と、前記第1のバッファから読み出された画像データを設定されている圧縮率で圧縮して、圧縮画像データを生成する画像圧縮手段と、前記画像圧縮手段により生成された圧縮画像データを前記第2のバッファから前記第1のバッファに亘って書き込むことが可能な圧縮画像書き込み手段とを備える画像記憶装置の制御方法であって、
前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれる場合において、
前記圧縮画像書込み手段による前記圧縮画像データの前記記憶手段への書き込みを停止させる停止ステップと、
前記書き込みを停止させた後、前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくか否かを判定する判定ステップと、
前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつかないと判断された場合、前記圧縮画像書き込み手段が、再度、停止前の圧縮率で圧縮された圧縮画像データを前記記憶手段へ書き込むよう制御する制御ステップと、を備えることを特徴とする画像記憶装置の制御方法。
Storage means serving both as a first buffer and a second buffer; image writing means for writing input image data into the first buffer; and image reading means for reading out the image data from the first buffer; The image data read from the first buffer is compressed at a set compression ratio to generate compressed image data, and the compressed image data generated by the image compression means is A compressed image writing unit capable of writing from two buffers to the first buffer,
In the case where the compressed image data is written from the second buffer over at least a partial area of the first buffer,
A stop step of stopping writing of the compressed image data into the storage unit by the compressed image writing unit;
A determination step of determining whether or not a write address of the compressed image data catches up with a read address of the image data after stopping the writing;
When it is determined that the write address of the compressed image data cannot catch up with the read address of the image data, the compressed image writing means again writes the compressed image data compressed at the compression rate before the stop to the storage means. And a control step for controlling the image storage device.
前記判定ステップにより前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくと判定された場合、前記制御ステップは、前記画像圧縮手段の圧縮率を前記停止前の圧縮率よりも高い圧縮率に変更することを特徴とする請求項6に記載の画像記憶装置の制御方法。   When the determination step determines that the write address of the compressed image data catches up with the read address of the image data, the control step sets the compression rate of the image compression unit to a compression rate higher than the compression rate before the stop. The method of controlling an image storage device according to claim 6, wherein: 前記高い圧縮率で圧縮された圧縮画像データが前記第2のバッファから前記第1のバッファの領域に亘って書き込まれない場合、前記制御ステップは、前記圧縮画像書き込み手段が前記高い圧縮率で圧縮された圧縮画像データを前記記憶手段へ書き込むよう制御することを特徴とする請求項7に記載の画像記憶装置の制御方法。   When the compressed image data compressed at the high compression rate is not written from the second buffer to the area of the first buffer, the control step compresses the compressed image writing means at the high compression rate. 8. The method of controlling an image storage device according to claim 7, wherein the compressed image data is controlled to be written into the storage means. 前記制御ステップは、前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれる場合において、前記圧縮画像データのサイズが予め設定されているサイズより大きい場合、前記画像圧縮手段の圧縮率を、前記圧縮画像データのサイズが予め設定されているサイズ以下になる圧縮率に変更し、
再度、前記画像圧縮手段により、前記第1のバッファから読み出された画像データを前記変更された圧縮率で圧縮して圧縮画像データを生成するように制御し、
前記圧縮画像書き込み手段により、前記生成された圧縮画像データを前記第2のバッファから書き込むように制御することを特徴とする請求項5〜8のいずれか1つに記載の画像記憶装置の制御方法。
In the control step, when the compressed image data is written from the second buffer to at least a partial area of the first buffer, the size of the compressed image data is larger than a preset size. The compression rate of the image compression means is changed to a compression rate at which the size of the compressed image data is equal to or smaller than a preset size,
Again, the image compression means controls the image data read from the first buffer to be compressed at the changed compression rate to generate compressed image data,
9. The method of controlling an image storage device according to claim 5, wherein the compressed image writing unit controls the generated compressed image data to be written from the second buffer. .
前記画像記憶装置は、前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれることを検出する第1の検出手段と、前記圧縮画像データのサイズを検出する第2の検出手段と、前記画像データ上に前記圧縮画像データが上書きされることを検出する第3の検出手段とを備え、
前記停止ステップは、前記第1の検出手段の検出結果に基づいて、前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれるか否かを判定して前記書き込みを停止し、前記制御ステップは、前記第2の検出手段の結果に基づいて、前記圧縮画像データのサイズが予め設定されているサイズ以下であるか否かの判定、前記判定ステップは前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくか否かの判定を行うことを特徴とする請求項6ないし8のいずれか1つに記載の画像記憶装置。
The image storage device includes: a first detection unit configured to detect that the compressed image data is written from the second buffer over at least a partial region of the first buffer; and a size of the compressed image data. Second detection means for detecting, and third detection means for detecting that the compressed image data is overwritten on the image data,
The stopping step determines whether or not the compressed image data is written from the second buffer to at least a partial region of the first buffer based on a detection result of the first detection unit. And the control step determines whether or not the size of the compressed image data is equal to or smaller than a preset size based on the result of the second detection unit, 9. The image storage device according to claim 6, wherein a determination is made as to whether or not a write address of the compressed image data catches up with a read address of the image data.
第1のバッファと第2のバッファとを兼ねる記憶手段と、入力された画像データを前記第1のバッファへの書き込む画像書き込み手段と、前記第1のバッファから前記画像データを読み出す画像読み出し手段と、前記第1のバッファから読み出された画像データを設定されている圧縮率で圧縮して、圧縮画像データを生成する画像圧縮手段と、前記画像圧縮手段により生成された圧縮画像データを前記第2のバッファから前記第1のバッファに亘って書き込むことが可能な圧縮画像書き込み手段とを備える画像記憶装置を制御するためのプログラムであって、
前記圧縮画像データが前記第2のバッファから前記第1のバッファの少なくとも一部領域に亘って書き込まれる場合において、前記圧縮画像書込み手段による前記圧縮画像データの前記記憶手段への書き込みを停止させる停止ステップと、
前記書き込みを停止させた後、前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつくか否かを判定する判定ステップと、
前記圧縮画像データの書き込みアドレスが前記画像データの読み出しアドレスに追いつかないと判断された場合、前記圧縮画像書き込み手段が、再度、停止前の圧縮率で圧縮された圧縮画像データを前記記憶手段へ書き込むよう制御する制御ステップと、
を有することを特徴とするプログラム。
Storage means serving both as a first buffer and a second buffer; image writing means for writing input image data into the first buffer; and image reading means for reading out the image data from the first buffer; The image data read from the first buffer is compressed at a set compression ratio to generate compressed image data, and the compressed image data generated by the image compression means is A program for controlling an image storage device comprising compressed image writing means capable of writing from two buffers to the first buffer,
When the compressed image data is written from the second buffer over at least a partial area of the first buffer, the stop for stopping the writing of the compressed image data to the storage unit by the compressed image writing unit Steps,
A determination step of determining whether or not a write address of the compressed image data catches up with a read address of the image data after stopping the writing;
When it is determined that the write address of the compressed image data cannot catch up with the read address of the image data, the compressed image writing means again writes the compressed image data compressed at the compression rate before the stop to the storage means. A control step for controlling
The program characterized by having.
請求項1に記載の画像記憶装置を搭載することを特徴とするデジタルカメラ。   A digital camera comprising the image storage device according to claim 1.
JP2007008218A 2007-01-17 2007-01-17 Image storage device, control method thereof, program, and digital camera Expired - Fee Related JP4971807B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007008218A JP4971807B2 (en) 2007-01-17 2007-01-17 Image storage device, control method thereof, program, and digital camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007008218A JP4971807B2 (en) 2007-01-17 2007-01-17 Image storage device, control method thereof, program, and digital camera

Publications (2)

Publication Number Publication Date
JP2008176481A JP2008176481A (en) 2008-07-31
JP4971807B2 true JP4971807B2 (en) 2012-07-11

Family

ID=39703466

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007008218A Expired - Fee Related JP4971807B2 (en) 2007-01-17 2007-01-17 Image storage device, control method thereof, program, and digital camera

Country Status (1)

Country Link
JP (1) JP4971807B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534694A (en) * 2016-11-28 2017-03-22 上海传英信息技术有限公司 Method and device for processing shooting pictures in night shooting mode

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3006158B2 (en) * 1991-05-09 2000-02-07 ソニー株式会社 Disk recording device and disk reproducing device
JP3164428B2 (en) * 1992-06-19 2001-05-08 オリンパス光学工業株式会社 Image recording device
JP4459322B2 (en) * 1999-03-12 2010-04-28 パナソニック株式会社 Imaging device
JP3975811B2 (en) * 2002-04-12 2007-09-12 松下電器産業株式会社 Digital still camera
JP4608186B2 (en) * 2003-01-08 2011-01-05 パナソニック株式会社 Imaging device
JP3827162B2 (en) * 2004-06-25 2006-09-27 ソニー株式会社 Data recording device

Also Published As

Publication number Publication date
JP2008176481A (en) 2008-07-31

Similar Documents

Publication Publication Date Title
JP4626493B2 (en) Image processing apparatus, image processing method, program for image processing method, and recording medium recording program for image processing method
US11727960B2 (en) Recording and reproducing apparatus and method thereof
JP2010130097A (en) Imaging apparatus, control method therefor and program
JP2006203376A (en) Electronic camera, noise reducing device and noise reducing method
US7684679B2 (en) Image recording apparatus
JP4971807B2 (en) Image storage device, control method thereof, program, and digital camera
JP2009290318A (en) Image capturing apparatus and zooming adjustment method
JP2010109567A (en) Information processor and information processing method
JP2005094298A (en) Digital camera and image data recording method
JP2006020096A (en) Imaging recorder, imaging and recording method, and imaging and recording control program
JP2007019742A (en) Electronic camera, and control method and control program for the electronic camera
CN113347490B (en) Video processing method, terminal and storage medium
JP2007124178A (en) Video signal recording/regenerating device
JP2018195892A (en) Imaging apparatus
KR100708476B1 (en) Method for image definition decision considering performance of memory card and photographing apparatus thereof
JP4305473B2 (en) Electronic still camera, image information erasing method, and image information state setting method
JP3403106B2 (en) Video recording device
JP2006259890A (en) Data file management device, data file management method and program
JP4235052B2 (en) Moving image recording apparatus, image information processing apparatus and method
JP5132513B2 (en) Imaging apparatus and imaging method
JP2001218153A (en) Image recorder
JP2008146733A (en) Recording and reproducing device
JP2004173005A (en) Successive image compressor, successive image compressing method, program therefor, and information recording medium having the program recorded therein
JPH1132291A (en) Digital still camera
JP2004236290A (en) Image recording device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20091211

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120323

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120406

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

Free format text: PAYMENT UNTIL: 20150413

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4971807

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20150413

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees