JP2004295564A - File storage device, file storage method, and file storage program - Google Patents
File storage device, file storage method, and file storage program Download PDFInfo
- Publication number
- JP2004295564A JP2004295564A JP2003087981A JP2003087981A JP2004295564A JP 2004295564 A JP2004295564 A JP 2004295564A JP 2003087981 A JP2003087981 A JP 2003087981A JP 2003087981 A JP2003087981 A JP 2003087981A JP 2004295564 A JP2004295564 A JP 2004295564A
- Authority
- JP
- Japan
- Prior art keywords
- file
- compression
- size
- compression parameter
- compressed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、所定の最小記録単位を有する記録媒体にファイルを圧縮して保存するファイル保存装置、ファイル保存方法およびファイル保存プログラムに関する。
【0002】
【従来の技術】
従来より、デジタルカメラや撮影機能を有する携帯電話などでは、画像ファイルは、通常、圧縮された後、メモリなどの記録媒体に保存されていた。例えば、デジタルカメラなどでは、撮影した画像を保存する際の画質を、いくつかの画質の中からユーザが選択すると、設定を変えるまでは、選択された画質(圧縮率)で撮影した画像を圧縮してメモリなどの記録媒体に保存している。また、撮影機能を有する携帯電話などでは、予め設定された固定圧縮率で圧縮を行なった後、メモリなどの記録媒体に保存している(例えば、特許文献1参照)。
【0003】
【特許文献1】
特開2000−270294号公報
【0004】
【発明が解決しようとする課題】
ところで、ファイルを保存するメモリは、ファイルシステムにより管理されている。一般に、ファイルシステムでは、クラスタというサイズを単位としてメモリを管理している。クラスタのサイズは、システム毎に独自の値をとっている。例えば、FAT16系のファイルシステムの場合、クラスタサイズは、16Kバイトとなっている。1つのファイルは、最低でもこのクラスタ容量を消費する。例えば、1クラスタが16Kバイトであるならば、1バイトのデータを保存しても16Kバイトを消費する。すなわち、1バイト以外の領域は使用されることはない。例えば、携帯電話の場合、4〜7Kバイトのデータが多いので、無駄なクラスタ内領域が存在することになり、メモリの使用効率が悪い。
【0005】
このように、従来技術では、ファイル保存に必要な容量(占有する領域量=実際に使用されるクラスタサイズ)を考慮せずに圧縮を行なっていたので、保存領域の終端に未使用領域が発生していた。この未使用領域は、保存した画像ファイルに占有されているため、他のデータ保存には使用できず、無駄な領域となり、メモリの使用効率が悪くなるという問題があった。
【0006】
そこで本発明は、メモリの使用効率を上げ、保存可能ファイル数を減少させることなく、高品質のデータを保存することができるファイル保存装置、ファイル保存方法およびファイル保存プログラムを提供することを目的とする。
【0007】
【課題を解決するための手段】
上記目的達成のため、請求項1記載の発明によるファイル保存装置は、所定の最小記録単位を有する記録媒体にファイルを圧縮して保存するファイル保存装置において、所定の圧縮パラメータでファイルを圧縮する圧縮手段と、前記圧縮手段により圧縮されたファイルのサイズを検出するサイズ検出手段と、前記圧縮手段により圧縮されたファイルを前記記録媒体に保存した場合における占有サイズを検出する占有サイズ検出手段と、前記サイズ検出手段により検出された圧縮ファイルのサイズと前記占有サイズ検出手段により検出された圧縮ファイルの占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定する圧縮パラメータ決定手段と、前記圧縮パラメータ決定手段により決定された補正圧縮パラメータに基づいて、前記圧縮手段により前記ファイルを再圧縮して記録媒体に保存する保存制御手段とを具備することを特徴とする。
【0008】
また、好ましい態様として、例えば請求項2記載のように、請求項1記載のファイル保存装置において、前記圧縮パラメータを圧縮率としてもよい。
【0009】
また、好ましい態様として、例えば請求項3記載のように、請求項1記載のファイル保存装置において、前記圧縮パラメータを符号化方式としてもよい。
【0010】
また、好ましい態様として、例えば請求項4記載のように、請求項1記載のファイル保存装置において、前記圧縮パラメータをサンプリングレートとしてもよい。
【0011】
また、好ましい態様として、例えば請求項5記載のように、請求項1記載のファイル保存装置において、前記圧縮パラメータおよび前記補正圧縮パラメータは、前記ファイルのサイズであって、前記ファイルをリサイズするファイルリサイズ手段を具備し、前記保存制御手段は、前記圧縮手段によるファイルの圧縮に先立って、前記ファイルリサイズ手段により前記ファイルを前記補正圧縮パラメータに基づいてリサイズした後、前記圧縮手段によりリサイズしたファイルを再圧縮して記録媒体に保存するようにしてもよい。
【0012】
また、好ましい態様として、例えば請求項6記載のように、請求項1記載のファイル保存装置において、前記圧縮パラメータおよび前記補正圧縮パラメータは、前記ファイルのファイル形式であって、前記ファイルのファイル形式を変換するファイル形式変換手段を具備し、前記保存制御手段は、前記圧縮手段によるファイルの圧縮に先立って、前記ファイル形式変換手段により前記ファイルのファイル形式を前記補正圧縮パラメータに基づいて変換した後、前記圧縮手段によりファイル形式を変換したファイルを再圧縮して記録媒体に保存するようにしてもよい。
【0013】
また、好ましい態様として、例えば請求項7記載のように、請求項1記載のファイル保存装置において、前記圧縮パラメータおよび前記補正圧縮パラメータは、前記ファイルに付加する付加情報であって、前記保存制御手段は、前記補正圧縮パラメータに基づく付加情報を付加した状態で前記圧縮手段により再圧縮して記録媒体に保存するようにしてもよい。
【0014】
また、上記目的達成のため、請求項8記載の発明によるファイル保存方法は、所定の最小記録単位を有する記録媒体にファイルを圧縮して保存するファイル保存方法において、所定の圧縮パラメータでファイルを圧縮し、該圧縮ファイルのサイズと前記圧縮ファイルを前記記録媒体に保存した場合における占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定し、該補正圧縮パラメータに基づいて、前記ファイルを再圧縮して記録媒体に保存することを特徴とする。
【0015】
また、好ましい態様として、例えば請求項9記載のように、請求項7記載のファイル保存装置において、前記圧縮パラメータを圧縮率としてもよい。
【0016】
また、好ましい態様として、例えば請求項10記載のように、請求項7記載のファイル保存装置において、前記圧縮パラメータを符号化方式としてもよい。
【0017】
また、好ましい態様として、例えば請求項11記載のように、請求項7記載のファイル保存装置において、前記圧縮パラメータをサンプリングレートとしてもよい。
【0018】
また、好ましい態様として、例えば請求項12記載のように、請求項7記載のファイル保存方法において、前記圧縮パラメータおよび前記補正圧縮パラメータは、前記ファイルのサイズであって、前記ファイルの圧縮に先立って、前記ファイルを前記補正圧縮パラメータに基づいてリサイズした後、リサイズしたファイルを再圧縮して記録媒体に保存するようにしてもよい。
【0019】
また、好ましい態様として、例えば請求項13記載のように、請求項7記載のファイル保存方法において、前記圧縮パラメータおよび前記補正圧縮パラメータは、前記ファイルのファイル形式であって、前記ファイルの圧縮に先立って、前記ファイルのファイル形式を前記補正圧縮パラメータに基づいて変換した後、ファイル形式を変換したファイルを再圧縮して記録媒体に保存するようにしてもよい。
【0020】
また、好ましい態様として、例えば請求項14記載のように、請求項7記載のファイル保存方法において、前記圧縮パラメータおよび前記補正圧縮パラメータは、前記ファイルに付加する付加情報であって、前記補正圧縮パラメータに基づく付加情報を付加した状態で再圧縮して記録媒体に保存するようにしてもよい。
【0021】
また、上記目的達成のため、請求項15記載の発明によるファイル保存プログラムは、所定の最小記録単位を有する記録媒体にファイルを圧縮して保存するファイル保存プログラムにおいて、所定の圧縮パラメータでファイルを圧縮するステップと、前記圧縮されたファイルのサイズと、前記圧縮されたファイルを前記記録媒体に保存した場合における占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定するステップと、前記補正圧縮パラメータに基づいて、前記ファイルを再圧縮して記録媒体に保存するステップとをコンピュータに実行させることを特徴とする。
【0022】
【発明の実施の形態】
以下、本発明の実施の形態を、デジタルカメラに適用した一実施例として、図面を参照して説明する。
【0023】
A.第1実施形態
A−1.第1実施形態の構成
図1は、本発明の第1実施形態によるデジタルカメラの構成を示すブロック図である。図において、レンズ1は、いわゆる写真レンズであり、被写体を光学的に撮影し、CCD2上に結像する。CCD2は、電荷をアレイ状に転送するMOS(metal−oxide semiconductor)構造のデバイスで、タイミング発生器(TG)3、垂直ドライバ4によって駆動され、一定周期毎に光電変換出力を1画面分出力する。タイミング発生器3および垂直ドライバ4は、CCD2の読み出しに必要なタイミング信号を生成する。サンプルホールド回路(S/H)5は、CCD2から読み出された時系列的なアナログ信号を、CCD2の解像度に適合した周波数でサンプリングする。A/D変換器6は、サンプリングされた信号をデジタル信号(ベイヤーデータ)に変換する。
【0024】
カラープロセス回路7は、A/D変換器6の出力から輝度・色差マルチプレクス信号(以下、YUV信号と言う)を生成するためのカラープロセス処理を行なう。カラープロセス処理では、上記ベイヤーデータがR,G,Bデータに変換され、さらに、デジタルの輝度、色差マルチプレクス信号(Y,Cb,Crデータ)に変換される。
【0025】
DMAコントローラ8は、カラープロセス回路7とDRAM10(正確にはDRAMインターフェース9)との間のデータ転送を、CPU11の介在なしに行なうものであり、いわゆるダイレクト・メモリ転送(DMA:direct memory access)を行なうものである。DMAコントローラ8は、カラープロセス回路7のY,Cb,Crデータ出力を、同じくカラープロセス回路7の同期信号、メモリ書き込みイネーブル、クロック出力を用いて、一度、DMAコントローラ8内部のバッファに書き込み、DRAMインターフェース(DRAMI/F)9を介してDRAM10にDMA転送を行なう。DRAMインターフェース9は、DRAM10とDMAコントローラ8との間の信号インターフェース、およびDRAM10とバスとの間の信号インターフェースをとるものである。DRAM10は、DRAMインターフェース9を介してDMAコントローラ8からDMA転送される画像データ(Y,Cb,Crデータ)を蓄積する。
【0026】
CPU11は、プログラムROM20に記録された、所定のプログラムを実行してカメラの動作を集中制御するものであり、メインスイッチ、記録/再生モード切り換えスイッチ、機能選択キー、シャッターキーなどの実施ボタンを含む操作部16が接続されている。記録モードでは、そのモード用のプログラムが、また、再生モードでは、そのモード用のプログラムがプログラムROM20からCPU11の内部のRAMにロードされて実行される。CPU11は、上記画像データ(Y,Cb,Crデータ)のDRAM10へのDMA転送終了後に、該画像データ(Y,Cb,Crデータ)を、DRAMインターフェース9を介してDRAM10から読み出し、VRAMコントローラ12を介してVRAM13に書き込む。
【0027】
CPU11は、上記シャッターキーが押下された記録保存の状態では、DRAM10に書き込まれている1フレーム分のY,Cb,Crデータを、DRAMインターフェース9を介して、Y,Cb,Crの各コンポーネント毎にMCU単位で、1フレームを80×60ブロック(「0」〜「4799」)に分割した、16×16ピクセルからなるMCUブロック毎に読み出して、さらに付加する画像のMCUブロックを挿入してJPEG処理部17に送る。該JPEG処理部17に送られた画像データは、DCT変換、量子化、符号化といった処理を経て圧縮される。CPU11は、圧縮後の画像データに、ヘッダ情報を付加して、不揮発性メモリであるフラッシュメモリ18に書き込む。上記ヘッダ情報には、画像に関する情報などが含まれる。
【0028】
上記DCT変換では、上記MCUブロックのデータ(以下、単にMCUデータという)は、所定ピクセルからなるブロックの輝度成分データと、所定ピクセルからなるブロックの色差成分データとを1組として、個々のブロック毎に、周波数成分の大きさを示すDCT係数へ変換される。そして、CPU11は、上記1フレーム分のY,Cb,Crデータの圧縮処理およびフラッシュメモリ18への全圧縮データの書き込みが終了すると、再度、CCD2からDRAM10への経路を起動する。
【0029】
VRAMコントローラ12は、VRAM13とバスとの間、およびVRAM13とデジタルビデオエンコーダ14との間のデータ転送を制御するものであり、表示用画像(プレビュー画像)のVRAM13への書き込みと、同画像のVRAM13からの読み出しを制御する。
【0030】
VRAM13は、いわゆるビデオRAMであり、プレビュー画像が書き込まれると、そのプレビュー画像がデジタルビデオエンコーダ14を介して表示装置15に送られ、表示されるようになっている。なお、ビデオRAMには、書き込み用と読み出し用の2つのポートを備え、画像の書き込みと読み出しを同時並行的に行なうことができるようになっている。
【0031】
デジタルビデオエンコーダ(以下、単にビデオエンコーダという)14は、上記画像データ(Y,Cb,Crデータ)を、VRAMコントローラ12を介してVRAM13から周期的に読み出して、該画像データを元にビデオ信号を発生して表示装置15に出力する。これにより、記録モードの状態における表示装置15には、現在、CCD2から取り込まれている画像情報に基づくスルー画像が表示される。表示装置15は、例えば279×220の画素数からなる、カメラ本体の裏側に取り付けられた数インチ程度の小型の液晶パネルである。
【0032】
JPEG処理部17は、JPEGの圧縮と伸長を行なう部分である。JPEGの圧縮パラメータは圧縮処理の都度、CPU11から与えられる。なお、JPEG処理部17は、処理速度の点で専用のハードウェアにより実現することが好ましいが、CPU11でソフト的に行なうことも可能である。
【0033】
フラッシュメモリ18は、書き換え可能な読み出し専用メモリ(PROM:programmable read only memory)のうち、電気的に全ビット(又はブロック単位)の内容を消して内容を書き直せるものを指す。フラッシュメモリ18は、カメラ本体から取り外せない固定型であってもよいし、カード型やパッケージ型のように取り外し可能なものであってもよい。なお、フラッシュメモリ18は、内蔵型であれ取り外し可能型であれ、所定の形式で、所定のクラスタサイズに初期化(フォーマット)されている必要がある。なお、クラスタサイズの詳細については後述する。初期化済みのフラッシュメモリ18には、その記憶容量に応じた枚数の画像を記録できる。
【0034】
ネットワーク接続インターフェース(ネットワーク接続I/F)19は、必要に応じて携帯電話104のパケット通信プロトコルにより、指定されたURLに従って、インターネット101上のサーバ100に接続し、該サーバ100からHTMLファイルを取得するものである。なお、本第1実施形態では、図1に示すように、ネットワーク接続インターフェース19に携帯電話機104を接続し、該携帯電話機104を介してインターネット101に接続するようにしたが、これに限らず、着脱可能な通信モジュールを用いたり、デジタルスチルカメラ自体に携帯電話機104の通信機能を組み込んだりしてもよい。
【0035】
また、プログラムROM20には、図2に示すように、予め圧縮率と圧縮ファイルサイズの変化率とを対応付けた対応テーブルを記憶している。JPEG処理部17は、原画像データを基本圧縮率で圧縮する。CPU11は、圧縮された画像データのサイズと、圧縮された画像データの保存時にメモリを占有する実際のサイズとから圧縮ファイルサイズの変化率を求め、該圧縮ファイルサイズの変化率に従って、上記対応テーブルを参照し、補正した圧縮率を求める。そして、JPEG処理部17は、上記補正圧縮率により原画像データを再圧縮し、圧縮された画像データをフラッシュメモリ18に保存するようになっている。
【0036】
上記デジタルカメラでは、撮影した画像を保存する場合、画像データに圧縮処理を行なった後、フラッシュメモリ18に保存している。例えば、JPEGという画像フォーマットは、圧縮率で画質とファイル容量を排他的に制御できる。画質を良くしようとすべく圧縮率を下げると、ファイルサイズが大きくなるので、記憶可能ファイル数が減少し、記憶可能ファイル数を増やそうとすべく圧縮率を上げると、画質が低下することになる。通常、ユーザは、画質や撮影枚数を考慮して所望する画質、すなわち圧縮率を設定することになる。
【0037】
本第1実施形態では、画像データを圧縮する際には、予め設定された圧縮率で画像データを圧縮してフラッシュメモリ18に保存した場合、未使用領域が発生しないように、クラスタ容量一杯まで使用すべく、圧縮率を下げるようにしている。この結果、フラッシュメモリ18の使用効率が上がり、撮影可能枚数は同じであるにも拘わらず、画質も向上することになる。なお、以下の説明では、原画像のデータ形式は、YUV形式とする。また、圧縮方式は、JPEGベースラインとする。
【0038】
通常、クラスタサイズは自明と考えられるが、不明の場合には、以下の手順で確認可能である。
【0039】
1)利用可能残容量確認
2)ダミーデータ(1バイト)の書き込み
3)利用可能残容量確認
4)上記1)と上記3)の差分をクラスタサイズとする。
5)ダミーデータを消去する。
【0040】
A−2.第1実施形態の動作
次に、上述した第1実施形態によるデジタルカメラの動作について説明する。ここで、図3は、本第1実施形態によるデジタルカメラの画像データ保存動作を説明するためのフローチャートである。また、図4は、本第1実施形態によるデジタルカメラの画像圧縮動作を説明するための概念図である。
【0041】
まず、原画像データを基本圧縮率で圧縮する(ステップS10)。次いで、圧縮された画像データのサイズ(以下、ファイルサイズ)を取得する(ステップS12)。因みに、画像データの圧縮では、画像データの内容に応じて、同一圧縮率でも、最終的に得られるファイルサイズは異なってくる。次に、圧縮された画像データの保存時にフラッシュメモリ18を占有する実際のサイズ(以下、占有サイズ)を、クラスタサイズとファイルサイズとから算出する(ステップS14)。このファイルサイズには、圧縮された画像データのほか、画像データに必要な情報(テーブル)などのファイル生成に必要な情報を含む。
【0042】
占有クラスタ数=((ファイルサイズ)÷(クラスタサイズ))+1
占有サイズ=占有クラスタ数×クラスタサイズ
但し、(ファイルサイズ)=(クラスタサイズ×n)の場合には、+1はなし。
【0043】
次に、予め圧縮率と圧縮ファイルサイズの変化率とを対応付けた対応テーブル(図2)を参照し、(占有サイズ)÷(ファイルサイズ)=圧縮ファイルサイズの変化率の値から、補正した圧縮率(以下、補正圧縮率)を求めて設定する(ステップS16)。
【0044】
次に、補正圧縮率が、上記基本圧縮率と同じであるか否かを判断し(ステップS18)、双方の圧縮率が異なる場合には、原画像データを補正圧縮率で再度圧縮する(ステップS20)。一方、双方の圧縮率が同じであれば、再度圧縮することなく、ステップS22へ進む。
【0045】
次に、圧縮された画像データのファイルサイズが占有サイズより大きいか否かを判断し(ステップS22)、占有サイズより小さい場合には、圧縮された画像データをフラッシュメモリ18に保存する(ステップS24)。一方、ファイルサイズが占有サイズより大きくなってしまった場合には、ステップS16へ戻り、圧縮率を再調整し、上述した処理を繰り返す。
【0046】
上述した第1実施形態によれば、図4に示すように、従来技術に比べ、圧縮率が低くなる傾向をとるため、再圧縮した画像データは、圧縮率の調整をしない場合の画像より画質が向上するという利点がある。また、占有サイズを変えていないので、保存可能画像数を同じに維持できる。また、クラスタ内の未使用領域がなくなるので、フラッシュメモリ18の使用効率を向上させることができる。
【0047】
なお、上述した第1実施形態では、画像フォーマットをJPEGとして説明したが、他のフォーマット、PNG、GIF、TIFFなどでもよい。また、第1実施形態では、画像ファイルの圧縮として説明したが、画像を含む全ての圧縮ファイル(MP3,MPEGなど)であってもよい。また、画像全体を圧縮してファイルサイズを見極めていたが、画像の一部を圧縮してファイルサイズを見極めてもよい。さらに、圧縮フォーマットをJPEGベースラインとしていたが、他のフォーマット(JPEGプログレッシブ、JPEG2000)でもよい。
【0048】
B.第2実施形態
次に、本発明の第2実施形態について説明する。なお、デジタルカメラの構成は、図1と同様であるので説明を省略する。本第2実施形態では、原画像データを基本圧縮率で圧縮された画像データの占有サイズに合わせた符号化方式を選択するようになっている。符号化方式としては、JPEG2000方式(基準符号化方式)、JPEGペースライン方式およびJPEGプログレッシブ方式を用意する。そこで、プログラムROM20には、図5に示すように、符号化方式と圧縮ファイルサイズの変化率とを対応付けた対応テーブルを予め記憶している。
【0049】
次に、本第2実施形態の動作について説明する。ここで、図6は、本第2実施形態の動作を説明するためのフローチャートである。まず、原画像データを基本符号化方式、すなわちJPEG2000で圧縮する(ステップS30)。次いで、圧縮された画像データのサイズ(以下、ファイルサイズ)を取得する(ステップS32)。次に、圧縮された画像データの保存時にフラッシュメモリ18を占有する実際のサイズ(以下、占有サイズ)を、クラスタサイズとファイルサイズとから算出する(ステップS34)。
【0050】
次に、予め符号化方式と圧縮ファイルサイズの変化率とを対応付けた対応テーブル(図5)を参照し、(占有サイズ)÷(ファイルサイズ)=圧縮ファイルサイズの変化率の値から、適当な符号化方式を選択する(ステップS36)。次に、原画像データを新たに選択した符号化方式で再度圧縮する(ステップS38)。次に、圧縮された画像データのファイルサイズが占有サイズより大きいか否かを判断し(ステップS40)、占有サイズより小さい場合には、圧縮された画像データをフラッシュメモリ18に保存する(ステップS42)。一方、ファイルサイズが占有サイズより大きくなってしまった場合には、ステップS36へ戻り、符号化方式を再選択し、上述した処理を繰り返す。
【0051】
上述した第2実施形態では、符号化方式をJPEG2000方式からJPEGペースライン方式またはJPEGプログレッシブ方式に変えるようにしたので、圧縮、伸張処理時間の短縮、描画の高速化という効果がある。また、占有サイズを変えていないので、保存可能画像数を同じに維持することができる。また、クラスタ内の未使用領域がなくなるので、フラッシュメモリ18の使用効率を向上させることができる。
【0052】
なお、上述した第2実施形態では、基本符号化方式をJPEG2000として説明したが、他の符号化方式(JPEGベースライン、JPEGプログレッシブ)でもよい。また、画像フォーマットをJPEG2000としたが、他のフォーマット(PNG,GIF、TIFF)でもよい。また、画像ファイルの圧縮として説明したが、画像を含む全ての圧縮ファイルとしてよい。また、画像全体を圧縮してファイルサイズを見極めていたが、画像の一部を圧縮してファイルサイズを見極めてもよい。
【0053】
C.第3実施形態
次に、本発明の第3実施形態について説明する。なお、デジタルカメラの構成は、図1と同様であるので説明を省略する。本第3実施形態では、原画像データを基本サブサンプリングレートで圧縮された画像データの占有サイズに合わせたサンプリングレートを選択するようになっている。サブサンプリングレートとしては、4:2:0(基準サブサンプリングレート)、4:2:2および4:4:4を用意する。そこで、プログラムROM20には、図7に示すように、予めサブサンプリングレートと圧縮ファイルサイズの変化率とを対応付けた対応テーブルを記憶している。
【0054】
次に、本第3実施形態の動作について説明する。ここで、図8は、本第3実施形態の動作を説明するためのフローチャートである。まず、原画像データを4:2:0(基準サブサンプリングレート)で圧縮する(ステップS50)。次いで、圧縮された画像データのサイズ(以下、ファイルサイズ)を取得する(ステップS52)。次に、圧縮された画像データの保存時にフラッシュメモリ18を占有する実際のサイズ(以下、占有サイズ)を、クラスタサイズとファイルサイズとから算出する(ステップS54)。
【0055】
次に、予めサブサンプリングレートと圧縮ファイルサイズの変化率とを対応付けた対応テーブル(図7)を参照し、(占有サイズ)÷(ファイルサイズ)=圧縮ファイルサイズの変化率の値から、適当なサブサンプリングレートを選択する(ステップS56)。次に、原画像データを新たに選択したサブサンプリングレートで再度圧縮する(ステップS58)。次に、圧縮された画像データのファイルサイズが占有サイズより大きいか否かを判断し(ステップS60)、占有サイズより小さい場合には、圧縮された画像データをフラッシュメモリ18に保存する(ステップS62)。一方、ファイルサイズが占有サイズより大きくなってしまった場合には、ステップS46へ戻り、サブサンプリングレートを再選択し、上述した処理を繰り返す。
【0056】
上述した第3実施形態では、サブサンプリングレートを4:2:0(基準サブサンプリングレート)から4:2:2または4:4:4に変えるようにしたので、画像情報が増加している。これにより、画質が向上するという効果がある。また、占有サイズを変えていないので、保存可能画像数を同じに維持することができる。また、クラスタ内の未使用領域がなくなるので、フラッシュメモリ18の使用効率を向上させることができる。
【0057】
なお、上述した第3実施形態では、原画像データをYUVデータとして説明したが、他の色空間(RGB、YCMK、YcbCrなど)でもよい。また、画像フォーマットをJPEGとして説明したが、他のフォーマット(PNG,GIF、TIFF)でもよい。また、圧縮フォーマットをJPEGベースラインとしたが、他のフォーマット(JPEGプログレッシブ、JPEG2000など)でもよい。さらに、画像のサブサンプリングをパラメータとして調整していたが、音声(MP3など)のサンプリングレートであってもよい。また、サブサンプリングレートを3種類(4:4:4、4:2:2、4:2:0)に限定して説明したが、他の比率(4:1:1、6:1:1など)でもよい。
【0058】
D.第4実施形態
次に、本発明の第4実施形態について説明する。なお、デジタルカメラの構成は、図1と同様であるので説明を省略する。本第4実施形態では、原画像データを基本画像サイズで圧縮された画像データの占有サイズに合わせた画像サイズを選択するようになっている。画像サイズとしては、VGA(640×480:基本画像サイズ)、SVGA(800×600)およびXGA(1024×768)を用意する。そこで、プログラムROM20には、図9に示すように、予め画像サイズと圧縮ファイルサイズの変化率とを対応付けた対応テーブルを記憶している。
【0059】
次に、本第4実施形態の動作について説明する。ここで、図10は、本第4実施形態の動作を説明するためのフローチャートである。まず、原画像データをVGA(基本画像サイズ:640×480)に変換してJPEGベースラインで圧縮する(ステップS70)。次いで、圧縮された画像データのサイズ(以下、ファイルサイズ)を取得する(ステップS72)。次に、圧縮された画像データの保存時にフラッシュメモリ18を占有する実際のサイズ(以下、占有サイズ)を、クラスタサイズとファイルサイズとから算出する(ステップS74)。
【0060】
次に、予め画像サイズと圧縮ファイルサイズの変化率とを対応付けた対応テーブル(図9)を参照し、(占有サイズ)÷(ファイルサイズ)=圧縮ファイルサイズの変化率の値から、適当な画像サイズを選択する(ステップS76)。次に、原画像データを新たに選択した画像サイズに変換し、再度圧縮する(ステップS78)。次に、圧縮された画像データのファイルサイズが占有サイズより大きいか否かを判断し(ステップS80)、占有サイズより小さい場合には、圧縮された画像データをフラッシュメモリ18に保存する(ステップS82)。一方、ファイルサイズが占有サイズより大きくなってしまった場合には、ステップS76へ戻り、画像サイズを再選択し、上述した処理を繰り返す。
【0061】
上述した第4実施形態では、圧縮前に画像サイズを変更するようにしたので、圧縮後のサイズ変更に比べ、画質がよくなるという効果がある。また、占有サイズを変えていないので、保存可能画像数を同じに維持できるとともに、フラッシュメモリ18の使用効率を上げることができる。
【0062】
なお、上述した第4実施形態では、原画像データをYUVデータとして説明したが、他の色空間(RGB、YCMK、YcbCrなど)でもよい。また、画像フォーマットをJPEGとして説明したが、他のフォーマット(PNG,GIF、TIFF)でもよい。また、圧縮フォーマットをJPEGベースラインとしたが、他のフォーマット(JPEGプログレッシブ、JPEG2000など)でもよい。さらに、画像全体を圧縮してファイルサイズを見極めていたが、画像の一部を圧縮してファイルサイズを見極めるようにしてもよい。
【0063】
E.第5実施形態
次に、本発明の第5実施形態について説明する。なお、デジタルカメラの構成は、図1と同様であるので説明を省略する。本第5実施形態では、原画像データを基本ファイル形式(JPEG)で圧縮された画像データの占有サイズに基づいて、メモリのクラスタ内未使用領域がなくなるように、適切なファイル形式を選択し、該選択したファイル形式で原画像データを圧縮して保存するようになっている。ファイル形式としては、JPEG(基本ファイル形式)、TIFFおよびBMPを用意する。そこで、プログラムROM20には、図11に示すように、予めファイル形式と圧縮ファイルサイズの変化率とを対応付けた対応テーブルを記憶している。
【0064】
次に、本第5実施形態の動作について説明する。ここで、図12は、本第5実施形態の動作を説明するためのフローチャートである。まず、原画像データをJPEG(基本ファイル形式)で圧縮する(ステップS90)。次いで、圧縮された画像データのサイズ(以下、ファイルサイズ)を取得する(ステップS92)。次に、圧縮された画像データの保存時にフラッシュメモリ18を占有する実際のサイズ(以下、占有サイズ)を、クラスタサイズとファイルサイズとから算出する(ステップS94)。
【0065】
次に、予めファイル形式と圧縮ファイルサイズの変化率とを対応付けた対応テーブル(図11)を参照し、(占有サイズ)÷(ファイルサイズ)=圧縮ファイルサイズの変化率の値から、適当なファイル形式を選択する(ステップS96)。次に、原画像データを新たに選択したファイル形式に変換する(ステップS98)。このとき、圧縮が必要であるファイル形式の場合には圧縮を行なう。次に、圧縮された画像データのファイルサイズが占有サイズより大きいか否かを判断し(ステップS100)、占有サイズより小さい場合には、圧縮された画像データをフラッシュメモリ18に保存する(ステップS102)。一方、ファイルサイズが占有サイズより大きくなってしまった場合には、ステップS96へ戻り、ファイル形式を再選択し、上述した処理を繰り返す。
【0066】
上述した第5実施形態では、ファイル形式を圧縮のある形式から非圧縮の形式に変えるようにしたので、画像の劣化がなくなり、画質の向上という効果がある。また、圧縮処理がなくなったので、画像処理、描画処理の高速化という効果がある。また、占有サイズを変えていないので、保存可能画像数を同じに維持できる。また、クラスタ内の未使用領域がなくなるので、フラッシュメモリ18の使用効率を向上させることができる。
【0067】
なお、上述した第5実施形態では、原画像データをYUVデータとして説明したが、他の色空間(RGB、YCMK、YcbCrなど)でもよい。また、画像フォーマットをJPEGとして説明したが、他のフォーマット(PNG、GIFなど)でもよい。また、変換画像フォーマットをJPEGとしたが、他のフォーマットでもよい。さらに、画像ファイルの変換として説明したが、画像を含む全てのファイル形式(MPEG、MP3等)としてもよい。
【0068】
F.第6実施形態
次に、本発明の第6実施形態について説明する。なお、デジタルカメラの構成は、図1と同様であるので説明を省略する。本第6実施形態では、原画像データを所定の圧縮フォーマット(JPEGベースライン)で圧縮した画像データの占有サイズに基づいて、メモリのクラスタ内未使用領域が極力少なくなるように、適切な付加情報を選択し、該選択した付加情報を原画像データに付加した状態で圧縮して保存するようになっている。付加情報としては、付加なし(基本方式)、位置情報およびサムネイル画像を用意する。そこで、プログラムROM20には、図13に示すように、予め付加情報と圧縮ファイルサイズの変化率とを対応付けた対応テーブルを記憶している。
【0069】
次に、本第6実施形態の動作について説明する。ここで、図14は、本第6実施形態の動作を説明するためのフローチャートである。まず、原画像データをJPEGで圧縮する(ステップS110)。次いで、圧縮された画像データのサイズ(以下、ファイルサイズ)を取得する(ステップS112)。次に、圧縮された画像データの保存時にフラッシュメモリ18を占有する実際のサイズ(以下、占有サイズ)を、クラスタサイズとファイルサイズとから算出する(ステップS114)。
【0070】
次に、予め付加情報と圧縮ファイルサイズの変化率とを対応付けた対応テーブル(図13)を参照し、(占有サイズ)÷(ファイルサイズ)=圧縮ファイルサイズの変化率の値から、適当な付加情報を選択する(ステップS116)。次に、原画像データに選択した付加情報を付加した状態で圧縮する(ステップS118)。次に、圧縮された画像データのファイルサイズが占有サイズより大きいか否かを判断し(ステップS120)、占有サイズより小さい場合には、圧縮された画像データをフラッシュメモリ18に保存する(ステップS122)。一方、ファイルサイズが占有サイズより大きくなってしまった場合には、ステップS116へ戻り、付加情報を再選択し、上述した処理を繰り返す。
【0071】
上述した第6実施形態では、1つのファイル内に画像情報と付加情報とが存在するので、画像と付加情報との関連を容易に判断でき、簡単に画像と付加情報とを用いた新たなサービスを提供することができる。また、占有サイズを変えていないので、保存可能画像数を同じに維持できる。また、クラスタ内の未使用領域がなくなるので、フラッシュメモリ18の使用効率を向上させることができる。
【0072】
なお、上述した第6実施形態では、原画像データをYUVデータとして説明したが、他の色空間(RGB、YCMK、YcbCrなど)でもよい。また、画像フォーマットをJPEGとして説明したが、他のフォーマット(PNG,GIF,TIFFなど)でもよい。また、圧縮フォーマットをJPEGベースラインとしたが、他のフォーマット(JPEGプログレッシブ、JPEG2000など)でもよい。また、画像ファイルの圧縮として説明したが、非圧縮の画像ファイルを含む全てのファイルとしてもよい。また、付加情報を1つとして説明したが、複数であってもよい。また、付加情報の追加がポイントであるが、他の実施形態と組み合わせてもよい(例えば、第1実施形態の後に本第6実施形態を行なうなど)。さらに、付加情報として位置情報とサムネイル画像としていたが、その他の情報であってもよい。
【0073】
G.第7実施形態
次に、本発明の第7実施形態について説明する。前述した第1ないし第6実施形態では、実際の画像データを圧縮して占有サイズを算出しているが、ファイルシステムの空きクラスタが物理的に連続しているサイズを上限として設定してもよい。また、前述した第1ないし第6実施形態において、占有サイズ分の物理的に連続しているクラスタを探して保存してもよい。
【0074】
上述した第7実施形態では、ファイルを保存するクラスタが物理的に連続しているので、ファイルの書き込み、読み出しが高速に行なえる。
【0075】
なお、上述した第7実施形態では、物理的な連続したクラスタを検索するとしたが、事前に物理的に連続したクラスタを用意しておいてもよい。
【0076】
また、上述した第1ないし第7実施形態では、デジタルカメラについてのみ説明したが、撮影機能を備える携帯電話や、各種圧縮データを取り扱うパーソナルコンピュータなどにも適用可能であることは言うまでもない。
【0077】
【発明の効果】
請求項1記載の発明によれば、圧縮手段により、所定の圧縮パラメータでファイルを圧縮し、サイズ検出手段により、圧縮されたファイルのサイズを検出し、占有サイズ検出手段により、圧縮されたファイルを前記記録媒体に保存した場合における占有サイズを検出し、圧縮パラメータ決定手段により、前記圧縮ファイルのサイズと前記圧縮ファイルの占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定し、保存制御手段により、決定された補正圧縮パラメータに基づいて、前記圧縮手段により前記ファイルを再圧縮して記録媒体に保存するようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0078】
また、請求項2記載の発明によれば、前記圧縮パラメータを圧縮率としたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0079】
また、請求項3記載の発明によれば、前記圧縮パラメータを符号化方式としたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0080】
また、請求項4記載の発明によれば、前記圧縮パラメータをサンプリングレートとしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0081】
また、請求項5記載の発明によれば、前記圧縮パラメータおよび前記補正圧縮パラメータを前記ファイルのサイズとし、前記保存制御手段によって、前記圧縮手段によるファイルの圧縮に先立って、前記ファイルリサイズ手段により前記ファイルを前記補正圧縮パラメータに基づいてリサイズした後、前記圧縮手段によりリサイズしたファイルを再圧縮して記録媒体に保存するようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0082】
また、請求項6記載の発明によれば、前記圧縮パラメータおよび前記補正圧縮パラメータを前記ファイルのファイル形式とし、前記保存制御手段によって、前記圧縮手段によるファイルの圧縮に先立って、前記ファイル形式変換手段により前記ファイルのファイル形式を前記補正圧縮パラメータに基づいて変換した後、前記圧縮手段によりファイル形式を変換したファイルを再圧縮して記録媒体に保存するようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0083】
また、請求項7記載の発明によれば、前記圧縮パラメータおよび前記補正圧縮パラメータを前記ファイルに付加する付加情報とし、前記保存制御手段によって、前記補正圧縮パラメータに基づく付加情報を付加した状態で前記圧縮手段により再圧縮して記録媒体に保存するようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0084】
また、請求項8記載の発明によれば、所定の圧縮パラメータでファイルを圧縮し、該圧縮ファイルのサイズと前記圧縮ファイルを前記記録媒体に保存した場合における占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定し、該補正圧縮パラメータに基づいて、前記ファイルを再圧縮して記録媒体に保存するようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0085】
また、請求項9記載の発明によれば、前記圧縮パラメータを圧縮率としたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0086】
また、請求項10記載の発明によれば、前記圧縮パラメータを符号化方式としたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0087】
また、請求項11記載の発明によれば、前記圧縮パラメータをサンプリングレートとしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0088】
また、請求項12記載の発明によれば、前記圧縮パラメータおよび前記補正圧縮パラメータを前記ファイルのサイズとし、前記ファイルの圧縮に先立って、前記ファイルを前記補正圧縮パラメータに基づいてリサイズした後、リサイズしたファイルを再圧縮して記録媒体に保存するようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0089】
また、請求項13記載の発明によれば、前記圧縮パラメータおよび前記補正圧縮パラメータを前記ファイルのファイル形式とし、前記ファイルの圧縮に先立って、前記ファイルのファイル形式を前記補正圧縮パラメータに基づいて変換した後、ファイル形式を変換したファイルを再圧縮して記録媒体に保存するようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0090】
また、請求項14記載の発明によれば、前記圧縮パラメータおよび前記補正圧縮パラメータを前記ファイルに付加する付加情報とし、前記補正圧縮パラメータに基づく付加情報を付加した状態で再圧縮して記録媒体に保存するようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【0091】
また、請求項15記載の発明によれば、所定の圧縮パラメータでファイルを圧縮するステップと、前記圧縮されたファイルのサイズと、前記圧縮されたファイルを前記記録媒体に保存した場合における占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定するステップと、前記補正圧縮パラメータに基づいて、前記ファイルを再圧縮して記録媒体に保存するステップとをコンピュータに実行させるようにしたので、記憶媒体の最小記録単位内の未使用領域を減少させることでき、かつ保存可能ファイル数を減少させることなく、高品質のデータを保存することができるという利点が得られる。
【図面の簡単な説明】
【図1】本発明の第1実施形態によるデジタルカメラの構成を示すブロック図である。
【図2】本第1実施形態の対応テーブルのデータ構成を示す概念図である。
【図3】本第1実施形態によるデジタルカメラの画像データ保存動作を説明するためのフローチャートである。
【図4】本第1実施形態によるデジタルカメラの画像圧縮動作を説明するための概念図である。
【図5】本発明の第2実施形態において、符号化方式と圧縮ファイルサイズの変化率とを対応付けた対応テーブルのデータ構成を示す概念図である。
【図6】本第2実施形態の動作を説明するためのフローチャートである。
【図7】本発明の第3実施形態において、サブサンプリングレートと圧縮ファイルサイズの変化率とを対応付けた対応テーブルのデータ構成を示す概念図である。
【図8】本第3実施形態の動作を説明するためのフローチャートである。
【図9】本発明の第4実施形態において、画像サイズと圧縮ファイルサイズの変化率とを対応付けた対応テーブルのデータ構成を示す概念図である。
【図10】本第4実施形態の動作を説明するためのフローチャートである。
【図11】本発明の第5実施形態において、ファイル形式と圧縮ファイルサイズの変化率とを対応付けた対応テーブルのデータ構成を示す概念図である。
【図12】本第5実施形態の動作を説明するためのフローチャートである。
【図13】本発明の第6実施形態において、付加情報と圧縮ファイルサイズの変化率とを対応付けた対応テーブルのデータ構成を示す概念図である。
【図14】本第6実施形態の動作を説明するためのフローチャートである。
【符号の説明】
1 レンズ
2 CCD
3 タイミング発生器
4 垂直ドライバ
5 サンプルホールド回路
6 A/D変換器
7 カラープロセス回路
8 DMAコントローラ
9 DRAMインターフェース
10 DRAM
11 CPU(サイズ検出手段、占有サイズ検出手段、圧縮パラメータ決定手段、保存制御手段、ファイルリサイズ手段、ファイル形式変換手段)
12 VRAMコントローラ
13 VRAM
14 デジタルビデオエンコーダ
15 表示装置
16 操作部
17 JPEG処理部(圧縮手段、)
18 フラッシュメモリ(記録媒体)
19 ネットワーク接続I/F
20 プログラムROM[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a file storage device, a file storage method, and a file storage program for compressing and storing a file on a recording medium having a predetermined minimum recording unit.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, in a digital camera or a mobile phone having a photographing function, an image file is usually compressed and then stored in a recording medium such as a memory. For example, in a digital camera or the like, if the user selects an image quality for saving a captured image from among several image quality, the image captured at the selected image quality (compression ratio) is compressed until the setting is changed. And stored in a recording medium such as a memory. In a mobile phone or the like having a photographing function, compression is performed at a preset fixed compression ratio, and then stored in a recording medium such as a memory (for example, see Patent Document 1).
[0003]
[Patent Document 1]
JP 2000-270294 A
[0004]
[Problems to be solved by the invention]
By the way, a memory for storing a file is managed by a file system. Generally, in a file system, memory is managed in units of clusters. The cluster size has a unique value for each system. For example, in the case of a FAT16 file system, the cluster size is 16 Kbytes. One file consumes at least this cluster capacity. For example, if one cluster is 16 Kbytes, storing 1 byte of data consumes 16 Kbytes. That is, the area other than 1 byte is not used. For example, in the case of a mobile phone, since there is a large amount of data of 4 to 7 Kbytes, there is a useless area in the cluster, and the memory use efficiency is poor.
[0005]
As described above, in the related art, the compression is performed without considering the capacity necessary for storing the file (the amount of the occupied area = the cluster size actually used), so that an unused area is generated at the end of the storage area. Was. Since this unused area is occupied by the saved image file, it cannot be used for storing other data, and becomes a useless area, thus deteriorating the memory use efficiency.
[0006]
Therefore, an object of the present invention is to provide a file storage device, a file storage method, and a file storage program that can store high-quality data without increasing the use efficiency of a memory and reducing the number of storable files. I do.
[0007]
[Means for Solving the Problems]
To achieve the above object, a file storage device according to the first aspect of the present invention is a file storage device for compressing and storing a file on a recording medium having a predetermined minimum recording unit. Means, size detection means for detecting the size of the file compressed by the compression means, occupancy size detection means for detecting the occupation size when the file compressed by the compression means is stored in the recording medium, Correction compression in which the unused area in the minimum recording unit on the recording medium is minimized based on the size of the compressed file detected by the size detection means and the occupation size of the compressed file detected by the occupation size detection means. Compression parameter determining means for determining a parameter; Based on the determined correction compression parameters, characterized by comprising a storage control unit for storing the re-compressed to a recording medium the file by the compression means.
[0008]
In a preferred embodiment, in the file storage device according to the first aspect, the compression parameter may be a compression ratio.
[0009]
In a preferred embodiment, for example, in the file storage device according to the first aspect, the compression parameter may be an encoding method.
[0010]
In a preferred embodiment, in the file storage device according to the first aspect, the compression parameter may be a sampling rate.
[0011]
Further, as a preferred mode, for example, in the file storage device according to
[0012]
Further, as a preferable mode, for example, in the file storage device according to
[0013]
In a preferred embodiment, the compression parameter and the correction compression parameter are additional information to be added to the file, and the storage control means May be recompressed by the compression means in a state where additional information based on the corrected compression parameter is added, and stored in a recording medium.
[0014]
According to another aspect of the present invention, there is provided a file storage method for compressing and storing a file on a recording medium having a predetermined minimum recording unit. Then, based on the size of the compressed file and the occupied size when the compressed file is stored on the recording medium, a correction compression parameter that minimizes an unused area in a minimum recording unit on the recording medium is determined. The file is recompressed based on the corrected compression parameter and stored in a recording medium.
[0015]
Further, as a preferable mode, for example, in the file storage device according to claim 7, the compression parameter may be a compression ratio.
[0016]
Further, as a preferable mode, for example, in the file storage device according to claim 7, the compression parameter may be an encoding method.
[0017]
Further, as a preferred mode, for example, in the file storage device according to claim 7, the compression parameter may be a sampling rate.
[0018]
As a preferred mode, for example, in the file storage method according to the twelfth aspect, the compression parameter and the correction compression parameter are the size of the file, and are set prior to the compression of the file. After resizing the file based on the corrected compression parameter, the resized file may be recompressed and stored on a recording medium.
[0019]
As a preferred mode, in the file storage method according to claim 7, for example, the compression parameter and the correction compression parameter are in a file format of the file, and the compression parameter and the correction compression parameter are set prior to the compression of the file. Then, after converting the file format of the file based on the corrected compression parameter, the file in which the file format has been converted may be recompressed and stored in a recording medium.
[0020]
As a preferred mode, in the file storage method according to claim 7, for example, the compression parameter and the correction compression parameter are additional information added to the file, and the correction compression parameter May be recompressed in a state where the additional information based on the information is added and stored in a recording medium.
[0021]
In order to achieve the above object, a file storage program according to a fifteenth aspect of the present invention is a file storage program for compressing and storing a file on a recording medium having a predetermined minimum recording unit. Based on the size of the compressed file and the occupied size when the compressed file is stored on the recording medium, the unused area in the minimum recording unit on the recording medium is minimized. Determining a corrected compression parameter, and recompressing the file based on the corrected compression parameter and storing the compressed file in a recording medium.
[0022]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an embodiment of the present invention will be described as an example in which the present invention is applied to a digital camera with reference to the drawings.
[0023]
A. First embodiment
A-1. Configuration of the first embodiment
FIG. 1 is a block diagram showing the configuration of the digital camera according to the first embodiment of the present invention. In the figure, a
[0024]
The color process circuit 7 performs a color process for generating a luminance / color difference multiplex signal (hereinafter, referred to as a YUV signal) from the output of the A / D converter 6. In the color process, the Bayer data is converted into R, G, B data, and further converted into digital luminance and color difference multiplex signals (Y, Cb, Cr data).
[0025]
The
[0026]
The CPU 11 executes a predetermined program recorded in the
[0027]
When the shutter key is depressed, the CPU 11 transfers the Y, Cb, and Cr data for one frame written in the
[0028]
In the DCT transform, the data of the MCU block (hereinafter simply referred to as MCU data) is defined as a set of luminance component data of a block composed of predetermined pixels and color difference component data of a block composed of predetermined pixels. Is converted to a DCT coefficient indicating the magnitude of the frequency component. When the compression processing of the Y, Cb, and Cr data for one frame and writing of all the compressed data to the
[0029]
The
[0030]
The
[0031]
A digital video encoder (hereinafter, simply referred to as a video encoder) 14 periodically reads the image data (Y, Cb, Cr data) from the
[0032]
The
[0033]
The
[0034]
A network connection interface (network connection I / F) 19 connects to a server 100 on the Internet 101 according to a specified URL according to a packet communication protocol of the mobile phone 104 as necessary, and acquires an HTML file from the server 100. Is what you do. In the first embodiment, as shown in FIG. 1, the mobile phone 104 is connected to the
[0035]
Further, as shown in FIG. 2, the
[0036]
In the digital camera, when storing a captured image, the image data is compressed and then stored in the
[0037]
In the first embodiment, when the image data is compressed, when the image data is compressed at a preset compression ratio and stored in the
[0038]
Usually, the cluster size is considered to be obvious, but if unknown, it can be confirmed by the following procedure.
[0039]
1) Check available remaining capacity
2) Writing dummy data (1 byte)
3) Check available remaining capacity
4) The difference between the above 1) and 3) is defined as the cluster size.
5) Erase dummy data.
[0040]
A-2. Operation of the first embodiment
Next, the operation of the digital camera according to the first embodiment will be described. Here, FIG. 3 is a flowchart for explaining the image data saving operation of the digital camera according to the first embodiment. FIG. 4 is a conceptual diagram illustrating an image compression operation of the digital camera according to the first embodiment.
[0041]
First, the original image data is compressed at the basic compression ratio (step S10). Next, the size of the compressed image data (hereinafter, file size) is obtained (step S12). Incidentally, in the compression of image data, the finally obtained file size differs depending on the content of the image data even with the same compression ratio. Next, the actual size (hereinafter, occupied size) occupying the
[0042]
Number of occupied clusters = ((file size) ÷ (cluster size)) + 1
Occupancy size = number of occupied clusters x cluster size
However, when (file size) = (cluster size × n), there is no +1.
[0043]
Next, with reference to a correspondence table (FIG. 2) in which the compression rate and the change rate of the compressed file size are associated in advance, the correction is made from the value of (occupancy size) / (file size) = change rate of the compressed file size. A compression ratio (hereinafter, a corrected compression ratio) is obtained and set (step S16).
[0044]
Next, it is determined whether or not the corrected compression rate is the same as the basic compression rate (step S18). If the two compression rates are different, the original image data is compressed again at the corrected compression rate (step S18). S20). On the other hand, if the two compression ratios are the same, the process proceeds to step S22 without performing compression again.
[0045]
Next, it is determined whether or not the file size of the compressed image data is larger than the occupation size (step S22). If the file size is smaller than the occupation size, the compressed image data is stored in the flash memory 18 (step S24). ). On the other hand, if the file size has become larger than the occupied size, the process returns to step S16, the compression ratio is readjusted, and the above-described processing is repeated.
[0046]
According to the above-described first embodiment, as shown in FIG. 4, since the compression ratio tends to be lower than that of the related art, the recompressed image data has a higher image quality than an image without adjusting the compression ratio. There is an advantage that is improved. Also, since the occupation size is not changed, the number of storable images can be maintained the same. Further, since there is no unused area in the cluster, the use efficiency of the
[0047]
In the first embodiment described above, the image format is described as JPEG, but other formats, such as PNG, GIF, and TIFF, may be used. Further, in the first embodiment, the description has been made on the assumption that image files are compressed. However, all compressed files (MP3, MPEG, etc.) including images may be used. Further, although the entire image is compressed to determine the file size, a part of the image may be compressed to determine the file size. Further, although the compression format is the JPEG baseline, other formats (JPEG progressive, JPEG2000) may be used.
[0048]
B. Second embodiment
Next, a second embodiment of the present invention will be described. The configuration of the digital camera is the same as that of FIG. In the second embodiment, an encoding method that matches the occupied size of image data obtained by compressing original image data at a basic compression ratio is selected. As the encoding method, a JPEG2000 method (reference encoding method), a JPEG paceline method, and a JPEG progressive method are prepared. Therefore, as shown in FIG. 5, a correspondence table in which the encoding method and the change rate of the compressed file size are associated with each other is stored in the
[0049]
Next, the operation of the second embodiment will be described. Here, FIG. 6 is a flowchart for explaining the operation of the second embodiment. First, the original image data is compressed by the basic encoding method, that is, JPEG2000 (step S30). Next, the size of the compressed image data (hereinafter, file size) is obtained (step S32). Next, an actual size occupying the
[0050]
Next, with reference to a correspondence table (FIG. 5) in which the encoding method and the change rate of the compressed file size are associated in advance, an appropriate value is obtained from the value of (occupancy size) / (file size) = change rate of the compressed file size. An appropriate encoding method is selected (step S36). Next, the original image data is compressed again by the newly selected encoding method (step S38). Next, it is determined whether or not the file size of the compressed image data is larger than the occupied size (step S40). If the file size is smaller than the occupied size, the compressed image data is stored in the flash memory 18 (step S42). ). On the other hand, if the file size has become larger than the occupied size, the process returns to step S36, re-selects the encoding method, and repeats the above processing.
[0051]
In the above-described second embodiment, since the encoding method is changed from the JPEG2000 method to the JPEG paceline method or the JPEG progressive method, there are effects of shortening the compression and decompression processing time and increasing the drawing speed. Further, since the occupation size is not changed, the number of storable images can be kept the same. Further, since there is no unused area in the cluster, the use efficiency of the
[0052]
In the second embodiment described above, the basic encoding method is described as JPEG2000, but another encoding method (JPEG baseline, JPEG progressive) may be used. Although the image format is JPEG2000, other formats (PNG, GIF, TIFF) may be used. In addition, although the description has been given as the compression of the image file, all the compressed files including the image may be used. Further, although the entire image is compressed to determine the file size, a part of the image may be compressed to determine the file size.
[0053]
C. Third embodiment
Next, a third embodiment of the present invention will be described. The configuration of the digital camera is the same as that of FIG. In the third embodiment, the sampling rate is selected according to the occupied size of the image data obtained by compressing the original image data at the basic sub-sampling rate. As the subsampling rates, 4: 2: 0 (reference subsampling rate), 4: 2: 2, and 4: 4: 4 are prepared. Therefore, as shown in FIG. 7, a correspondence table in which the sub-sampling rate and the change rate of the compressed file size are associated in advance is stored in the
[0054]
Next, the operation of the third embodiment will be described. Here, FIG. 8 is a flowchart for explaining the operation of the third embodiment. First, the original image data is compressed at 4: 2: 0 (reference subsampling rate) (step S50). Next, the size of the compressed image data (hereinafter, file size) is obtained (step S52). Next, an actual size occupying the
[0055]
Next, referring to a correspondence table (FIG. 7) in which the sub-sampling rate and the change rate of the compressed file size are associated in advance, an appropriate value is obtained from the value of (occupancy size) / (file size) = change rate of the compressed file size. An appropriate sub-sampling rate is selected (step S56). Next, the original image data is compressed again at the newly selected sub-sampling rate (step S58). Next, it is determined whether or not the file size of the compressed image data is larger than the occupied size (step S60). If the file size is smaller than the occupied size, the compressed image data is stored in the flash memory 18 (step S62). ). On the other hand, if the file size has become larger than the occupied size, the process returns to step S46, reselects the sub-sampling rate, and repeats the above-described processing.
[0056]
In the third embodiment described above, since the subsampling rate is changed from 4: 2: 0 (reference subsampling rate) to 4: 2: 2 or 4: 4: 4, image information is increased. This has the effect of improving image quality. Further, since the occupation size is not changed, the number of storable images can be kept the same. Further, since there is no unused area in the cluster, the use efficiency of the
[0057]
In the above-described third embodiment, the original image data is described as YUV data. However, another color space (RGB, YCMK, YcbCr, or the like) may be used. Although the image format has been described as JPEG, another format (PNG, GIF, TIFF) may be used. Although the compression format is the JPEG baseline, other formats (JPEG progressive, JPEG2000, etc.) may be used. Further, the subsampling of the image is adjusted as a parameter, but the sampling rate of audio (such as MP3) may be used. Also, the subsampling rate has been described as being limited to three types (4: 4: 4, 4: 2: 2, 4: 2: 0), but other ratios (4: 1: 1, 6: 1: 1). Etc.).
[0058]
D. Fourth embodiment
Next, a fourth embodiment of the present invention will be described. The configuration of the digital camera is the same as that of FIG. In the fourth embodiment, an image size that matches the occupied size of image data obtained by compressing original image data with the basic image size is selected. As the image size, VGA (640 × 480: basic image size), SVGA (800 × 600) and XGA (1024 × 768) are prepared. Therefore, as shown in FIG. 9, a correspondence table in which the image size and the change rate of the compressed file size are associated in advance is stored in the
[0059]
Next, the operation of the fourth embodiment will be described. Here, FIG. 10 is a flowchart for explaining the operation of the fourth embodiment. First, the original image data is converted into VGA (basic image size: 640 × 480) and compressed with a JPEG baseline (step S70). Next, the size of the compressed image data (hereinafter, file size) is obtained (step S72). Next, an actual size occupying the
[0060]
Next, referring to a correspondence table (FIG. 9) in which the image size and the change rate of the compressed file size are associated in advance, an appropriate value is obtained from the value of (occupancy size) / (file size) = change rate of the compressed file size. An image size is selected (step S76). Next, the original image data is converted to a newly selected image size and compressed again (step S78). Next, it is determined whether or not the file size of the compressed image data is larger than the occupation size (step S80). If the file size is smaller than the occupation size, the compressed image data is stored in the flash memory 18 (step S82). ). On the other hand, if the file size has become larger than the occupied size, the process returns to step S76, reselects the image size, and repeats the above processing.
[0061]
In the above-described fourth embodiment, since the image size is changed before compression, the image quality is improved as compared with the size change after compression. Further, since the occupied size is not changed, the number of storable images can be maintained the same, and the use efficiency of the
[0062]
In the above-described fourth embodiment, the original image data is described as YUV data. However, another color space (RGB, YCMK, YcbCr, or the like) may be used. Although the image format has been described as JPEG, another format (PNG, GIF, TIFF) may be used. Although the compression format is the JPEG baseline, other formats (JPEG progressive, JPEG2000, etc.) may be used. Further, although the entire image is compressed to determine the file size, a part of the image may be compressed to determine the file size.
[0063]
E. FIG. Fifth embodiment
Next, a fifth embodiment of the present invention will be described. The configuration of the digital camera is the same as that of FIG. In the fifth embodiment, an appropriate file format is selected based on the occupied size of the image data obtained by compressing the original image data in the basic file format (JPEG) so that there is no unused area in the cluster of the memory. The original image data is compressed and stored in the selected file format. JPEG (basic file format), TIFF and BMP are prepared as file formats. Therefore, as shown in FIG. 11, a correspondence table in which the file format and the change rate of the compressed file size are associated in advance is stored in the
[0064]
Next, the operation of the fifth embodiment will be described. Here, FIG. 12 is a flowchart for explaining the operation of the fifth embodiment. First, the original image data is compressed in JPEG (basic file format) (step S90). Next, the size of the compressed image data (hereinafter, file size) is obtained (step S92). Next, an actual size (hereinafter, occupied size) occupying the
[0065]
Next, referring to a correspondence table (FIG. 11) in which the file format and the change rate of the compressed file size are associated in advance, an appropriate value is obtained from the value of (occupancy size) / (file size) = change rate of the compressed file size. A file format is selected (step S96). Next, the original image data is converted into a newly selected file format (step S98). At this time, if the file format requires compression, compression is performed. Next, it is determined whether or not the file size of the compressed image data is larger than the occupied size (step S100). If the file size is smaller than the occupied size, the compressed image data is stored in the flash memory 18 (step S102). ). On the other hand, if the file size has become larger than the occupation size, the process returns to step S96, reselects the file format, and repeats the above processing.
[0066]
In the fifth embodiment described above, the file format is changed from a format with compression to a non-compression format, so that the image is not degraded and the image quality is improved. In addition, since the compression processing is eliminated, there is an effect that image processing and drawing processing are speeded up. Also, since the occupation size is not changed, the number of storable images can be maintained the same. Further, since there is no unused area in the cluster, the use efficiency of the
[0067]
In the above-described fifth embodiment, the original image data is described as YUV data. However, another color space (RGB, YCMK, YcbCr, etc.) may be used. Also, the image format has been described as JPEG, but other formats (PNG, GIF, etc.) may be used. Further, the converted image format is JPEG, but another format may be used. Further, although the description has been made as conversion of an image file, all file formats including an image (MPEG, MP3, etc.) may be used.
[0068]
F. Sixth embodiment
Next, a sixth embodiment of the present invention will be described. The configuration of the digital camera is the same as that of FIG. In the sixth embodiment, appropriate additional information is set based on the occupied size of image data obtained by compressing original image data in a predetermined compression format (JPEG baseline) so that unused areas in a cluster of the memory are reduced as much as possible. Is selected, and the selected additional information is compressed and stored in a state of being added to the original image data. As additional information, no addition (basic method), position information and thumbnail images are prepared. Therefore, as shown in FIG. 13, a correspondence table in which the additional information and the change rate of the compressed file size are associated in advance is stored in the
[0069]
Next, the operation of the sixth embodiment will be described. Here, FIG. 14 is a flowchart for explaining the operation of the sixth embodiment. First, the original image data is compressed by JPEG (step S110). Next, the size of the compressed image data (hereinafter, file size) is obtained (step S112). Next, an actual size occupying the
[0070]
Next, by referring to a correspondence table (FIG. 13) in which the additional information is previously associated with the change rate of the compressed file size, an appropriate value is obtained from the value of (occupied size) / (file size) = change rate of the compressed file size. The additional information is selected (step S116). Next, compression is performed with the selected additional information added to the original image data (step S118). Next, it is determined whether or not the file size of the compressed image data is larger than the occupation size (step S120). If the file size is smaller than the occupation size, the compressed image data is stored in the flash memory 18 (step S122). ). On the other hand, if the file size has become larger than the occupied size, the process returns to step S116, reselects additional information, and repeats the above-described processing.
[0071]
In the sixth embodiment described above, since the image information and the additional information exist in one file, the relation between the image and the additional information can be easily determined, and a new service using the image and the additional information can be easily obtained. Can be provided. Also, since the occupation size is not changed, the number of storable images can be maintained the same. Further, since there is no unused area in the cluster, the use efficiency of the
[0072]
In the above-described sixth embodiment, the original image data is described as YUV data. However, another color space (RGB, YCMK, YcbCr, or the like) may be used. Although the image format has been described as JPEG, other formats (PNG, GIF, TIFF, etc.) may be used. Although the compression format is the JPEG baseline, other formats (JPEG progressive, JPEG2000, etc.) may be used. Further, although the description has been made on the assumption that image files are compressed, all files including uncompressed image files may be used. Further, although the description has been made assuming that the additional information is one, a plurality of additional information may be used. The addition of additional information is a point, but may be combined with another embodiment (for example, the sixth embodiment is performed after the first embodiment). Further, the position information and the thumbnail image are used as the additional information, but other information may be used.
[0073]
G. FIG. Seventh embodiment
Next, a seventh embodiment of the present invention will be described. In the above-described first to sixth embodiments, the occupation size is calculated by compressing the actual image data. However, the size may be set as an upper limit to the size in which the free clusters of the file system are physically continuous. . In the above-described first to sixth embodiments, a physically continuous cluster of the occupied size may be searched for and stored.
[0074]
In the above-described seventh embodiment, clusters for storing files are physically continuous, so that writing and reading of files can be performed at high speed.
[0075]
In the above-described seventh embodiment, physically continuous clusters are searched, but physically continuous clusters may be prepared in advance.
[0076]
In the first to seventh embodiments, only the digital camera has been described. However, it is needless to say that the present invention can be applied to a mobile phone having a photographing function, a personal computer handling various types of compressed data, and the like.
[0077]
【The invention's effect】
According to the first aspect of the present invention, the file is compressed by the compression means with a predetermined compression parameter, the size of the compressed file is detected by the size detection means, and the compressed file is detected by the occupation size detection means. An occupied size when the data is stored in the recording medium is detected, and an unused area in a minimum recording unit in the recording medium is determined by a compression parameter determining unit based on the size of the compressed file and the occupied size of the compressed file. Is determined and the storage control means recompresses the file by the compression means based on the determined correction compression parameter and saves the file on the recording medium. It is possible to reduce the unused area in the minimum recording unit and without reducing the number of storable files, Advantage that it is possible to store the data of quality.
[0078]
According to the second aspect of the present invention, since the compression parameter is a compression ratio, an unused area in a minimum recording unit of a storage medium can be reduced, and the number of storable files can be reduced. The advantage is that high quality data can be stored.
[0079]
According to the third aspect of the present invention, since the compression parameter is an encoding method, an unused area in a minimum recording unit of a storage medium can be reduced, and the number of storable files can be reduced. The advantage is that high quality data can be stored.
[0080]
According to the fourth aspect of the present invention, since the compression parameter is a sampling rate, an unused area in a minimum recording unit of a storage medium can be reduced, and the number of storable files can be reduced. The advantage is that high quality data can be stored.
[0081]
According to the fifth aspect of the present invention, the compression parameter and the correction compression parameter are set to the size of the file, and the file is resized by the file resizing unit by the storage control unit before the file is compressed by the compression unit. After the file is resized based on the corrected compression parameter, the file resized by the compression unit is recompressed and stored in the recording medium, so that the unused area in the minimum recording unit of the storage medium is reduced. The advantage is that high-quality data can be stored without reducing the number of files that can be stored.
[0082]
According to the invention of claim 6, the compression parameter and the corrected compression parameter are set to the file format of the file, and the storage control unit performs the file format conversion before the file is compressed by the compression unit. After the file format of the file is converted based on the corrected compression parameter, the file whose file format has been converted by the compression unit is recompressed and stored in the recording medium. This is advantageous in that high-quality data can be stored without reducing the unused area of the data and without reducing the number of files that can be stored.
[0083]
According to the invention described in claim 7, the compression parameter and the corrected compression parameter are set as additional information to be added to the file, and the storage control unit adds the additional information based on the corrected compression parameter to the file. Since the data is recompressed by the compression means and stored on the recording medium, the unused area in the minimum recording unit of the storage medium can be reduced, and high-quality data can be stored without reducing the number of storable files. The advantage is that it can be stored.
[0084]
According to the invention described in
[0085]
According to the ninth aspect of the present invention, since the compression parameter is a compression ratio, an unused area in a minimum recording unit of a storage medium can be reduced, and the number of storable files can be reduced. The advantage is that high quality data can be stored.
[0086]
According to the tenth aspect of the present invention, since the compression parameter is an encoding method, an unused area in a minimum recording unit of a storage medium can be reduced, and the number of storable files can be reduced. The advantage is that high quality data can be stored.
[0087]
According to the eleventh aspect of the present invention, since the compression parameter is a sampling rate, an unused area in a minimum recording unit of a storage medium can be reduced, and the number of storable files can be reduced. The advantage is that high quality data can be stored.
[0088]
According to the twelfth aspect of the present invention, the compression parameter and the correction compression parameter are set to the size of the file, and the file is resized based on the correction compression parameter before the file is compressed. The compressed file is recompressed and stored on the recording medium, so the unused area in the minimum recording unit of the storage medium can be reduced, and high-quality data can be stored without reducing the number of storable files. The advantage is that it can be stored.
[0089]
According to the thirteenth aspect of the present invention, the compression parameter and the correction compression parameter are set to the file format of the file, and the file format of the file is converted based on the correction compression parameter prior to the compression of the file. After that, the file whose format has been converted is recompressed and saved on the recording medium, so that the unused area in the minimum recording unit of the storage medium can be reduced and the number of storable files can be reduced. And high quality data can be stored.
[0090]
According to the fourteenth aspect of the present invention, the compression parameter and the corrected compression parameter are set as additional information to be added to the file, and are re-compressed in a state where the additional information based on the corrected compression parameter is added to the recording medium. Since the data is stored, the unused area in the minimum recording unit of the storage medium can be reduced, and the high-quality data can be stored without reducing the number of files that can be stored. .
[0091]
According to the invention of
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of a digital camera according to a first embodiment of the present invention.
FIG. 2 is a conceptual diagram illustrating a data configuration of a correspondence table according to the first embodiment.
FIG. 3 is a flowchart for explaining an image data saving operation of the digital camera according to the first embodiment.
FIG. 4 is a conceptual diagram illustrating an image compression operation of the digital camera according to the first embodiment.
FIG. 5 is a conceptual diagram showing a data configuration of a correspondence table in which an encoding method and a change rate of a compressed file size are associated with each other in the second embodiment of the present invention.
FIG. 6 is a flowchart for explaining the operation of the second embodiment.
FIG. 7 is a conceptual diagram showing a data configuration of a correspondence table in which a sub-sampling rate and a change rate of a compressed file size are associated with each other in a third embodiment of the present invention.
FIG. 8 is a flowchart for explaining the operation of the third embodiment.
FIG. 9 is a conceptual diagram showing a data configuration of a correspondence table in which an image size and a change rate of a compressed file size are associated with each other in a fourth embodiment of the present invention.
FIG. 10 is a flowchart for explaining the operation of the fourth embodiment.
FIG. 11 is a conceptual diagram showing a data configuration of a correspondence table in which a file format is associated with a change rate of a compressed file size in a fifth embodiment of the present invention.
FIG. 12 is a flowchart for explaining the operation of the fifth embodiment.
FIG. 13 is a conceptual diagram showing a data configuration of a correspondence table in which additional information and a change rate of a compressed file size are associated with each other in the sixth embodiment of the present invention.
FIG. 14 is a flowchart illustrating the operation of the sixth embodiment.
[Explanation of symbols]
1 lens
2 CCD
3 Timing generator
4 Vertical driver
5 Sample hold circuit
6 A / D converter
7 Color process circuit
8 DMA controller
9 DRAM interface
10 DRAM
11 CPU (size detection means, occupation size detection means, compression parameter determination means, storage control means, file resizing means, file format conversion means)
12 VRAM controller
13 VRAM
14 Digital Video Encoder
15 Display device
16 Operation unit
17 JPEG processing unit (compression means)
18 Flash memory (recording medium)
19 Network connection I / F
20 Program ROM
Claims (15)
所定の圧縮パラメータでファイルを圧縮する圧縮手段と、
前記圧縮手段により圧縮されたファイルのサイズを検出するサイズ検出手段と、
前記圧縮手段により圧縮されたファイルを前記記録媒体に保存した場合における占有サイズを検出する占有サイズ検出手段と、
前記サイズ検出手段により検出された圧縮ファイルのサイズと前記占有サイズ検出手段により検出された圧縮ファイルの占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定する圧縮パラメータ決定手段と、
前記圧縮パラメータ決定手段により決定された補正圧縮パラメータに基づいて、前記圧縮手段により前記ファイルを再圧縮して記録媒体に保存する保存制御手段と
を具備することを特徴とするファイル保存装置。In a file storage device for compressing and storing a file on a recording medium having a predetermined minimum recording unit,
Compression means for compressing the file with predetermined compression parameters;
Size detection means for detecting the size of the file compressed by the compression means,
Occupation size detection means for detecting an occupation size when the file compressed by the compression means is stored in the recording medium,
A correction that minimizes an unused area in a minimum recording unit on the recording medium based on the size of the compressed file detected by the size detecting unit and the occupied size of the compressed file detected by the occupied size detecting unit. Compression parameter determining means for determining a compression parameter;
A file storage device, comprising: a storage control unit that recompresses the file by the compression unit based on the corrected compression parameter determined by the compression parameter determination unit and stores the file in a recording medium.
前記ファイルをリサイズするファイルリサイズ手段を具備し、
前記保存制御手段は、前記圧縮手段によるファイルの圧縮に先立って、前記ファイルリサイズ手段により前記ファイルを前記補正圧縮パラメータに基づいてリサイズした後、前記圧縮手段によりリサイズしたファイルを再圧縮して記録媒体に保存することを特徴とする請求項1記載のファイル保存装置。The compression parameter and the correction compression parameter are the size of the file,
A file resizing means for resizing the file,
The storage control unit resizes the file based on the corrected compression parameter by the file resizing unit prior to compression of the file by the compression unit, and then recompresses the file resized by the compression unit to record on the recording medium. The file storage device according to claim 1, wherein the file is stored in a file.
前記ファイルのファイル形式を変換するファイル形式変換手段を具備し、
前記保存制御手段は、前記圧縮手段によるファイルの圧縮に先立って、前記ファイル形式変換手段により前記ファイルのファイル形式を前記補正圧縮パラメータに基づいて変換した後、前記圧縮手段によりファイル形式を変換したファイルを再圧縮して記録媒体に保存することを特徴とする請求項1記載のファイル保存装置。The compression parameter and the correction compression parameter are a file format of the file,
Comprising a file format conversion means for converting the file format of the file,
Prior to the compression of the file by the compression unit, the storage control unit converts the file format of the file based on the corrected compression parameter by the file format conversion unit, and then converts the file format by the compression unit. 2. The file storage device according to claim 1, wherein the file is recompressed and stored in a recording medium.
前記保存制御手段は、前記補正圧縮パラメータに基づく付加情報を付加した状態で前記圧縮手段により再圧縮して記録媒体に保存することを特徴とする請求項1記載のファイル保存装置。The compression parameter and the correction compression parameter are additional information to be added to the file,
2. The file storage device according to claim 1, wherein the storage control unit re-compresses the data with the additional information based on the corrected compression parameter and stores the re-compressed data on a recording medium.
所定の圧縮パラメータでファイルを圧縮し、該圧縮ファイルのサイズと前記圧縮ファイルを前記記録媒体に保存した場合における占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定し、該補正圧縮パラメータに基づいて、前記ファイルを再圧縮して記録媒体に保存することを特徴とするファイル保存方法。A file saving method for compressing and saving a file on a recording medium having a predetermined minimum recording unit,
Based on the size of the compressed file and the occupied size when the compressed file is stored on the recording medium, the unused area in the minimum recording unit on the recording medium is minimized based on the compression of the file with predetermined compression parameters. A file storage method, comprising: determining a corrected compression parameter to be obtained; re-compressing the file based on the corrected compression parameter;
前記ファイルの圧縮に先立って、前記ファイルを前記補正圧縮パラメータに基づいてリサイズした後、リサイズしたファイルを再圧縮して記録媒体に保存することを特徴とする請求項7記載のファイル保存方法。The compression parameter and the correction compression parameter are the size of the file,
8. The file storage method according to claim 7, wherein the file is resized based on the corrected compression parameter before the file is compressed, and then the resized file is recompressed and stored on a recording medium.
前記ファイルの圧縮に先立って、前記ファイルのファイル形式を前記補正圧縮パラメータに基づいて変換した後、ファイル形式を変換したファイルを再圧縮して記録媒体に保存することを特徴とする請求項7記載のファイル保存方法。The compression parameter and the correction compression parameter are a file format of the file,
8. The method according to claim 7, wherein, prior to the compression of the file, the file format of the file is converted based on the corrected compression parameter, and then the converted file is recompressed and stored on a recording medium. How to save files.
前記補正圧縮パラメータに基づく付加情報を付加した状態で再圧縮して記録媒体に保存することを特徴とする請求項7記載のファイル保存方法。The compression parameter and the correction compression parameter are additional information to be added to the file,
8. The file storage method according to claim 7, wherein the file is recompressed and stored in a recording medium with the additional information based on the corrected compression parameter added.
所定の圧縮パラメータでファイルを圧縮するステップと、
前記圧縮されたファイルのサイズと、前記圧縮されたファイルを前記記録媒体に保存した場合における占有サイズとに基づいて、前記記録媒体における最小記録単位内での未使用領域が最小となる補正圧縮パラメータを決定するステップと、
前記補正圧縮パラメータに基づいて、前記ファイルを再圧縮して記録媒体に保存するステップと
をコンピュータに実行させることを特徴とするファイル保存プログラム。In a file storage program for compressing and storing a file on a recording medium having a predetermined minimum recording unit,
Compressing the file with predetermined compression parameters;
Based on the size of the compressed file and the occupied size when the compressed file is stored on the recording medium, a correction compression parameter that minimizes an unused area in a minimum recording unit on the recording medium Determining
Recompressing the file based on the corrected compression parameter and saving the file on a recording medium.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003087981A JP2004295564A (en) | 2003-03-27 | 2003-03-27 | File storage device, file storage method, and file storage program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003087981A JP2004295564A (en) | 2003-03-27 | 2003-03-27 | File storage device, file storage method, and file storage program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004295564A true JP2004295564A (en) | 2004-10-21 |
Family
ID=33402231
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003087981A Pending JP2004295564A (en) | 2003-03-27 | 2003-03-27 | File storage device, file storage method, and file storage program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004295564A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113038139A (en) * | 2021-03-25 | 2021-06-25 | 贵州电网有限责任公司 | Image compression method applied to machine patrol picture uploading |
US20220269807A1 (en) * | 2021-02-22 | 2022-08-25 | EMC IP Holding Company LLC | Detecting unauthorized encryptions in data storage systems |
-
2003
- 2003-03-27 JP JP2003087981A patent/JP2004295564A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220269807A1 (en) * | 2021-02-22 | 2022-08-25 | EMC IP Holding Company LLC | Detecting unauthorized encryptions in data storage systems |
CN113038139A (en) * | 2021-03-25 | 2021-06-25 | 贵州电网有限责任公司 | Image compression method applied to machine patrol picture uploading |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7027086B1 (en) | Photographing apparatus and signal processing method that allow data of still pictures to be converted into a moving picture file | |
JP3781449B2 (en) | Digital image storage device for electronic camera | |
US7230643B2 (en) | Digital camera with electronic zooming function | |
US7164442B2 (en) | Image control device with information-based image correcting capability, image control method and digital camera | |
US6661452B1 (en) | Digital camera capable of decreasing a required memory capacity | |
US7391932B2 (en) | Apparatus and method for selecting image to be displayed | |
JP3876973B2 (en) | Image recording / reproducing method, image reproducing apparatus, and file management method and apparatus | |
JP2004295564A (en) | File storage device, file storage method, and file storage program | |
JP3695140B2 (en) | Electronic still camera and control method thereof | |
US7492491B2 (en) | Image processing apparatus | |
JPH10108133A (en) | Image pickup device and its control method | |
JP2001197346A (en) | Electronic camera | |
JP2006109374A (en) | Electronic camera | |
JPH07131748A (en) | Electronic still video camera | |
JP2003141059A (en) | Information processor and method, storage medium and program | |
JP2003111012A (en) | Electronic camera | |
JP2002112086A (en) | Camera system, image encoding device and image decoding device | |
JP4439746B2 (en) | Information processing device | |
TW488154B (en) | Digital moving and static picture capturing adapter of moving picture camera | |
JP2001238173A (en) | Recording apparatus for digital image data | |
JP2004236178A (en) | Image expansion device and electronic camera | |
JPH08251536A (en) | Image processing system | |
JP2004040204A (en) | Image reproducing apparatus | |
JP4348486B2 (en) | Image recording / reproducing method and image recording / reproducing apparatus | |
JP2001218065A (en) | Device and method for processing digital image signal, device and method for recording digital image and data recording medium |