JP4717101B2 - Video recording device - Google Patents

Video recording device Download PDF

Info

Publication number
JP4717101B2
JP4717101B2 JP2008170055A JP2008170055A JP4717101B2 JP 4717101 B2 JP4717101 B2 JP 4717101B2 JP 2008170055 A JP2008170055 A JP 2008170055A JP 2008170055 A JP2008170055 A JP 2008170055A JP 4717101 B2 JP4717101 B2 JP 4717101B2
Authority
JP
Japan
Prior art keywords
jpeg
data
file
size
sdram
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
JP2008170055A
Other languages
Japanese (ja)
Other versions
JP2008263647A (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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP2008170055A priority Critical patent/JP4717101B2/en
Publication of JP2008263647A publication Critical patent/JP2008263647A/en
Application granted granted Critical
Publication of JP4717101B2 publication Critical patent/JP4717101B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Studio Devices (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Description

この発明は、動画像記録装置に関し、特にたとえばビデオカメラに適用され、動画像信号を圧縮状態で記録媒体に記録する、動画像記録装置に関する。   The present invention relates to a moving image recording apparatus, and more particularly to a moving image recording apparatus that is applied to, for example, a video camera and records a moving image signal on a recording medium in a compressed state.

従来のこの種のビデオカメラの一例が特許文献1に開示されている。この従来技術によれば、動画像を形成する現フレームの静止画像信号の圧縮率,圧縮サイズおよび目標サイズに基づいて次フレームの静止画像信号の圧縮率を算出し、これによって各フレームの圧縮処理に要する時間の短縮化を図っている。
特開2000−184330号公報(第4頁)
An example of a conventional video camera of this type is disclosed in Patent Document 1. According to this conventional technique, the compression rate of the still image signal of the next frame is calculated based on the compression rate, the compression size, and the target size of the still image signal of the current frame forming the moving image. To shorten the time required for
JP 2000-184330 A (page 4)

しかし、従来技術では、目標サイズは固定であったため、記録速度の遅い記録媒体では、各フレームの圧縮静止画像信号の記録に時間がかかっていた。つまり、従来技術では、動画像の連続記録可能時間が記録媒体の記録特性によって左右されるという問題があった。   However, in the conventional technique, since the target size is fixed, it takes time to record the compressed still image signal of each frame on a recording medium with a low recording speed. In other words, the conventional technique has a problem that the continuous recordable time of moving images depends on the recording characteristics of the recording medium.

それゆえに、この発明の主たる目的は、動画像の連続記録可能時間を制御することができる、動画像記録装置を提供することである。   Therefore, a main object of the present invention is to provide a moving image recording apparatus capable of controlling the continuous recordable time of moving images.

第1の発明は、マルチタスクOSを搭載したプロセサを備え、動画像信号を圧縮状態で記録媒体に記録する動画像記録装置において、プロセサによって実行される複数のタスクは、動画像信号の圧縮処理に関与する第1タスク、および圧縮動画像信号の記録処理に関与する第2タスクを含み、第1タスクは、圧縮動画像信号の記録処理速度を周期的に判別する判別処理、および判別処理の判別結果に基づいて動画像信号の圧縮率を変更する変更処理を含むことを特徴とする、動画像記録装置である。   A first invention includes a processor equipped with a multitask OS and records a moving image signal on a recording medium in a compressed state. In the moving image recording apparatus, a plurality of tasks executed by the processor is a moving image signal compression process. A first task involved in the recording process and a second task involved in the recording process of the compressed moving image signal. The first task is a discriminating process for periodically discriminating the recording processing speed of the compressed moving image signal; The moving image recording apparatus includes a changing process of changing a compression rate of the moving image signal based on the determination result.

第2の発明は、動画像信号を取り込む取り込み手段、動画像信号を所定画面数毎に圧縮して圧縮動画像信号を生成する圧縮手段、圧縮動画像信号を記録媒体に記録する記録手段、記録手段の処理速度を周期的に判別する判別手段、および判別手段による判別結果に基づいて圧縮手段の圧縮率を変更する変更手段を備える、動画像記録装置である。   The second invention is a capturing means for capturing a moving image signal, a compressing means for compressing the moving image signal every predetermined number of screens to generate a compressed moving image signal, a recording means for recording the compressed moving image signal on a recording medium, A moving image recording apparatus comprising: a determining unit that periodically determines a processing speed of the unit; and a changing unit that changes a compression rate of the compressing unit based on a determination result by the determining unit.

第1の発明では、動画像信号は、マルチタスクOSを搭載したプロセサの制御の下、圧縮状態で記録媒体に記録される。ここで、プロセサによって実行される複数のタスクは、動画像信号の圧縮処理に関与する第1タスク、および圧縮動画像信号の記録処理に関与する第2タスクを含む。さらに、第1タスクは、圧縮動画像信号の記録処理速度を周期的に判別する判別処理、および判別処理の判別結果に基づいて動画像信号の圧縮率を変更する変更処理を含む。   In the first invention, the moving image signal is recorded on the recording medium in a compressed state under the control of a processor equipped with a multitask OS. Here, the plurality of tasks executed by the processor include a first task related to the compression processing of the moving image signal and a second task related to the recording processing of the compressed moving image signal. Further, the first task includes a determination process for periodically determining the recording processing speed of the compressed moving image signal, and a change process for changing the compression rate of the moving image signal based on the determination result of the determination process.

マルチタスクOSでは、複数のタスクの各々は時分割でしか実行されない。すると、各々のタスクの負荷変動によって、圧縮動画像信号の記録処理速度が変動する。そこで、記録処理速度を周期的に判別し、判別結果に応じて動画像信号の圧縮率を変更する。これによって、動画像の連続記録可能時間の制御が可能となる。   In a multitasking OS, each of a plurality of tasks is executed only in a time division manner. Then, the recording processing speed of the compressed moving image signal varies depending on the load variation of each task. Therefore, the recording processing speed is periodically determined, and the compression rate of the moving image signal is changed according to the determination result. Thereby, it is possible to control the continuous recordable time of moving images.

好ましくは、第2タスクは、圧縮動画像信号を規定量ずつ記録媒体に転送する転送処理を含む。他のタスクが実行されるとき、第2タスクは規定量の転送が完了する毎に中断される。   Preferably, the second task includes a transfer process for transferring the compressed moving image signal to the recording medium by a predetermined amount. When other tasks are executed, the second task is interrupted each time a specified amount of transfer is completed.

動画像信号を取り込み条件に従って取り込む場合、複数のタスクは取り込み条件の調整に関与する第3タスクをさらに含む。第3タスクによって取り込み条件が調整される場合、この調整処理が記録処理速度の変動要因となる。   When capturing a moving image signal according to capture conditions, the plurality of tasks further include a third task related to adjustment of capture conditions. When the capturing condition is adjusted by the third task, this adjustment process becomes a fluctuation factor of the recording processing speed.

好ましくは、取り込み手段は被写体を撮影する撮影手段を含み、取り込み条件は撮影手段の撮影条件を含む。この場合、撮影条件の調整が必要かどうかは、被写体の明るさや色あいなどの外的要因に依存する。第3タスクは任意のタイミングで起動し、これによって記録処理速度が変動する。   Preferably, the capturing unit includes a capturing unit that captures a subject, and the capturing condition includes a capturing condition of the capturing unit. In this case, whether or not the shooting conditions need to be adjusted depends on external factors such as the brightness and hue of the subject. The third task is activated at an arbitrary timing, and the recording processing speed varies accordingly.

圧縮動画像信号をメモリに一時的に格納する場合、判別処理では、好ましくは、メモリに格納された未記録の圧縮動画像信号のサイズに基づいて記録処理速度が判別される。   In the case where the compressed moving image signal is temporarily stored in the memory, in the determination process, the recording processing speed is preferably determined based on the size of the unrecorded compressed moving image signal stored in the memory.

第2の発明では、取り込み手段によって取り込まれた動画像信号は、圧縮手段によって所定画面数毎に圧縮される。これによって生成された圧縮動画像信号は、記録手段によって記録媒体に記録される。記録手段の処理速度は判別手段によって周期的に判別され、変更手段は、判別手段の判別結果に基づいて圧縮手段の圧縮率を変更する。   In the second invention, the moving image signal captured by the capturing means is compressed for each predetermined number of screens by the compressing means. The compressed moving image signal generated thereby is recorded on the recording medium by the recording means. The processing speed of the recording means is periodically determined by the determining means, and the changing means changes the compression rate of the compressing means based on the determination result of the determining means.

好ましくは、メモリと接続されたバスが、動画像信号および圧縮動画像信号の転送に使用される。ズーム手段は、選択手段によって選択された態様で動画像信号に電子ズーム処理を施す。選択手段によって拡大ズームが選択されたとき、ズーム手段は、メモリを用いて動画像信号の一部を抽出し、抽出された動画像信号に拡大ズームを施す。したがって、拡大ズームが選択されたときは、動画像信号の転送にバスが使用され、圧縮動画像信号の転送のためのバスの占有率すなわち記録手段の処理速度が低下する。   Preferably, a bus connected to the memory is used for transferring moving image signals and compressed moving image signals. The zoom unit performs an electronic zoom process on the moving image signal in a manner selected by the selection unit. When the enlargement zoom is selected by the selection unit, the zoom unit extracts a part of the moving image signal using the memory, and performs the enlargement zoom on the extracted moving image signal. Accordingly, when enlargement zoom is selected, the bus is used for transferring the moving image signal, and the occupation rate of the bus for transferring the compressed moving image signal, that is, the processing speed of the recording means is reduced.

圧縮動画像信号をメモリに一時的に格納する場合、判別処理では、好ましくは、メモリに格納された未記録の圧縮動画像信号のサイズに基づいて記録処理速度が判別される。   In the case where the compressed moving image signal is temporarily stored in the memory, in the determination process, the recording processing speed is preferably determined based on the size of the unrecorded compressed moving image signal stored in the memory.

これらの発明によれば、記録処理速度を周期的に判別し、判別結果に応じて動画像信号の圧縮率を変更するようにしたため、動画像の連続記録可能時間を制御することができる。   According to these inventions, since the recording processing speed is periodically determined and the compression rate of the moving image signal is changed according to the determination result, the continuous recordable time of the moving image can be controlled.

この発明の上述の目的,その他の目的,特徴および利点は、図面を参照して行う以下の実施例の詳細な説明から一層明らかとなろう。   The above object, other objects, features and advantages of the present invention will become more apparent from the following detailed description of embodiments with reference to the drawings.

図1を参照して、この実施例のディジタルビデオカメラ10は、イメージセンサ12を含む。イメージセンサ12の前方には図示しない絞りユニットおよび光学レンズが配置されており、被写体の光学像は、これらの部材を経て、イメージセンサ12に照射される。   Referring to FIG. 1, a digital video camera 10 of this embodiment includes an image sensor 12. An aperture unit (not shown) and an optical lens (not shown) are disposed in front of the image sensor 12, and an optical image of the subject is irradiated onto the image sensor 12 through these members.

モード切換スイッチ62によって撮影モードが選択されると、対応する状態信号がシステムコントローラ56からCPU52に与えられる。CPU52はμITRONのようなマルチタスクOSを搭載したマルチタスクCPUであり、撮影モードでは、撮影処理タスク、撮影条件制御タスク、BG(Back Ground)処理タスクなどの複数のタスクが並列して実行される。具体的には、各々のタスクは、予め設定された優先順位に従って、かつ後述する垂直同期信号に応答して、時分割で実行される。   When the shooting mode is selected by the mode switch 62, a corresponding status signal is given from the system controller 56 to the CPU 52. The CPU 52 is a multitasking CPU equipped with a multitasking OS such as μITRON. In the shooting mode, a plurality of tasks such as a shooting processing task, a shooting condition control task, and a BG (Back Ground) processing task are executed in parallel. . Specifically, each task is executed in a time-sharing manner in accordance with a preset priority order and in response to a vertical synchronization signal described later.

撮影処理タスクでは、オペレータはメニューキー60の操作によって複数の撮影モードから所望の撮影モードを選択できる。撮影画像の解像度およびフレームレートならびに取込音声の音響方式,ビットレートおよびサンプリングレートのいずれかが、各撮影モードにおいて異なる。所望の撮影モードが選択されると、対応する情報信号がシステムコントローラ56からCPU52に与えられる。CPU52は、選択された撮影モードを示す撮影モード情報(解像度,フレームレート,音響方式,ビットレート,サンプリングレート)と、これから作成するムービファイルのファイル名とをレジスタrgstに格納する。   In the shooting processing task, the operator can select a desired shooting mode from a plurality of shooting modes by operating the menu key 60. Any one of the resolution and frame rate of the captured image, the sound system of the captured sound, the bit rate, and the sampling rate differs in each imaging mode. When a desired shooting mode is selected, a corresponding information signal is provided from the system controller 56 to the CPU 52. The CPU 52 stores shooting mode information (resolution, frame rate, sound method, bit rate, sampling rate) indicating the selected shooting mode and the file name of the movie file to be created in the register rgst.

CPU52はまた、撮影モード情報が示す解像度およびフレームレートでの撮影をタイミングジェネレータ(TG)14に命令する。TG14は、シグナルジェネレータ(SG)16から出力される垂直同期信号および水平同期信号に基づいて所望の撮影モード(解像度,フレームレート)に従うタイミング信号を生成し、イメージセンサ12をラスタスキャン方式で駆動する。イメージセンサ12からは、所望の解像度を持つ生画像信号(電荷)が所望のフレームレートで出力され、出力された生画像信号は、CDS/AGC回路18およびA/D変換器20を経て、ディジタル信号である生画像データとして信号処理回路22に入力される。   The CPU 52 also instructs the timing generator (TG) 14 to shoot at the resolution and frame rate indicated by the shooting mode information. The TG 14 generates a timing signal according to a desired shooting mode (resolution, frame rate) based on the vertical synchronization signal and the horizontal synchronization signal output from the signal generator (SG) 16, and drives the image sensor 12 by a raster scan method. . A raw image signal (charge) having a desired resolution is output from the image sensor 12 at a desired frame rate. The output raw image signal passes through the CDS / AGC circuit 18 and the A / D converter 20 and is digitally transmitted. The signal is input to the signal processing circuit 22 as raw image data as a signal.

設定されたズーム倍率が“1.0”のとき、信号処理回路22は、A/D変換器20から入力された生画像データに白バランス調整,色分離,YUV変換などの一連の信号処理を施して1.0倍のYUVデータを生成する。設定されたズーム倍率が“1.0”未満のとき、A/D変換器20から入力された生画像データは、まずズーム回路22aによって縮小ズームを施され、縮小ズームの後に上述の一連の信号処理が実行される。かかる処理によって生成されたYUVデータは、バスB1およびメモリ制御回路26を介してSDRAM26に格納される。   When the set zoom magnification is “1.0”, the signal processing circuit 22 performs a series of signal processing such as white balance adjustment, color separation, and YUV conversion on the raw image data input from the A / D converter 20. To generate 1.0 times YUV data. When the set zoom magnification is less than “1.0”, the raw image data input from the A / D converter 20 is first subjected to reduction zoom by the zoom circuit 22a, and the series of signals described above after reduction zoom. Processing is executed. The YUV data generated by such processing is stored in the SDRAM 26 via the bus B1 and the memory control circuit 26.

一方、設定されたズーム倍率が“1.0”よりも大きいとき、つまり拡大ズーム処理が必要なとき、ズーム回路22aは、まずA/D変換機器20から入力された生画像データをバスB1およびメモリ制御回路24を通してSDRAM26に一旦書き込む。ズーム回路22aは続いて、拡大ズーム処理に必要な一部のエリアの生画像データをバスB1およびメモリ制御回路24を通して読み出し、読み出された一部のエリアの生画像データに拡大ズームを施す。拡大された生画像データは、上述の一連の信号処理によってYUVデータに変換される。これによって、“1.0”よりも大きい倍率のYUVデータが生成される。生成されたYUVデータは、バスB1およびメモリ制御回路26を介してSDRAM26に格納される。   On the other hand, when the set zoom magnification is larger than “1.0”, that is, when zoom processing is required, the zoom circuit 22a first converts the raw image data input from the A / D conversion device 20 into the bus B1 and The data is temporarily written in the SDRAM 26 through the memory control circuit 24. Subsequently, the zoom circuit 22a reads the raw image data of a part of area necessary for the enlargement zoom process through the bus B1 and the memory control circuit 24, and performs the enlargement zoom on the read raw image data of the part of the area. The enlarged raw image data is converted into YUV data by the series of signal processing described above. As a result, YUV data having a magnification larger than “1.0” is generated. The generated YUV data is stored in the SDRAM 26 via the bus B1 and the memory control circuit 26.

ビデオエンコーダ28は、バスB1およびメモリ制御回路24を通してSDRAM26からYUVデータを読み出し、読み出したYUVデータをコンポジット画像信号にエンコードする。エンコードされたコンポジット画像信号はモニタ30に与えられ、この結果、被写体のリアルタイム動画像(スルー画像)がモニタ30に表示される。   The video encoder 28 reads YUV data from the SDRAM 26 through the bus B1 and the memory control circuit 24, and encodes the read YUV data into a composite image signal. The encoded composite image signal is supplied to the monitor 30. As a result, a real-time moving image (through image) of the subject is displayed on the monitor 30.

撮影条件制御タスクでは、CPU52は、絞り量,露光時間,白バランス調整ゲイン,電子ズーム倍率などの撮影条件を制御する。具体的には、被写体の明るさに応じて絞り量または露光時間を調整し、被写体の色に応じて白バランス調整ゲインを補正し、そしてズームキー64の操作状態を示す状態信号の変動に応じて電子ズーム倍率を調整する。この結果、スルー画像の明るさおよび色あいの変動が防止され、ズームキー64の操作に応答してスルー画像のズーム倍率が変化する。   In the shooting condition control task, the CPU 52 controls shooting conditions such as aperture amount, exposure time, white balance adjustment gain, and electronic zoom magnification. Specifically, the aperture amount or the exposure time is adjusted according to the brightness of the subject, the white balance adjustment gain is corrected according to the color of the subject, and the state signal indicating the operation state of the zoom key 64 is changed. Adjust the electronic zoom magnification. As a result, fluctuations in the brightness and hue of the through image are prevented, and the zoom magnification of the through image changes in response to the operation of the zoom key 64.

なお、ズームキー64によって“1.0”よりも大きなズーム倍率が選択されたとき、上述のような生画像データをSDRAM26に一旦格納する処理が実行される。   When a zoom magnification larger than “1.0” is selected by the zoom key 64, processing for temporarily storing the raw image data as described above in the SDRAM 26 is executed.

オペレータによってシャッタボタン58が押され、対応する状態信号がシステムコントローラ56から与えられると、CPU52は、撮影された動画像を格納したムービファイルを記録媒体50に作成する。ここで、記録媒体50は着脱自在の記録媒体であり、スロット48に装着されたときにI/F46によってアクセス可能となる。記録媒体50にはCPU50a,バッファメモリ50bおよびハードディスク50cが設けられ、ハードディスク50cには図6に示すようにFAT領域501c,ルートディレクトリ領域502cおよびデータ領域503cが形成される。データ領域503cへのデータ書き込みは、バッファメモリ50bを介して所定量ずつ行われる。   When the shutter button 58 is pressed by the operator and a corresponding status signal is given from the system controller 56, the CPU 52 creates a movie file storing the photographed moving image on the recording medium 50. Here, the recording medium 50 is a detachable recording medium, and can be accessed by the I / F 46 when the recording medium 50 is mounted in the slot 48. The recording medium 50 is provided with a CPU 50a, a buffer memory 50b, and a hard disk 50c. A FAT area 501c, a root directory area 502c, and a data area 503c are formed on the hard disk 50c as shown in FIG. Data is written to the data area 503c by a predetermined amount via the buffer memory 50b.

動画像の記録時、CPU52は、BG処理タスクを起動する。このとき、撮影処理タスクとBG処理タスクとの間で処理が円滑に行なれるように、図4に示すような指示リスト52aが作成される。   When recording a moving image, the CPU 52 activates a BG processing task. At this time, an instruction list 52a as shown in FIG. 4 is created so that processing can be smoothly performed between the photographing processing task and the BG processing task.

指示リスト52aには、まず“BG処理開始”,“ファイル作成”,“テーブル作成”および“ファイルオープン”の各々に対応するコマンドおよびパラメータが設定される。“BG処理開始”によってBG処理タスクが開始され、“ファイル作成”によってムービファイルのファイル名と“0”を示すサイズ情報とが図6に示すルートディレクトリ領域502cに書き込まれる。“テーブル作成”では、図7に示すような空き領域テーブル52cが作成される。図7によれば、データ領域503cに形成された各々の空き領域の先頭アドレスおよび空きサイズが、サイズが大きい順に設定される。“ファイルオープン”では、データを書き込むムービファイルを特定するためのハンドル番号が作成される。   In the instruction list 52a, first, commands and parameters corresponding to “BG process start”, “file creation”, “table creation”, and “file open” are set. The BG processing task is started by “BG processing start”, and the file name of the movie file and the size information indicating “0” are written in the root directory area 502c shown in FIG. 6 by “file creation”. In “table creation”, an empty area table 52c as shown in FIG. 7 is created. According to FIG. 7, the start address and the empty size of each empty area formed in the data area 503c are set in order of increasing size. In “file open”, a handle number for specifying a movie file to which data is written is created.

こうしてデータ書き込みの準備が完了すると、CPU52は、ムービファイルヘッダを作成すべく、次の1フレーム期間においてサムネイル画像の取り込み処理およびヘッダ情報の作成処理を行う。まず、信号処理回路22に間引き処理を命令し、JPEGコーデック32に圧縮処理を命令する。信号処理回路22は、上述のYUV変換に加えて間引き処理を行い、これによって生成されたサムネイルYUVデータをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。JPEGコーデック32は、バスB1およびメモリ制御回路24を通してSDRAM26からサムネイルYUVデータを読み出し、読み出されたサムネイルYUVデータにJPEG圧縮を施す。JPEGコーデック32はその後、JPEG圧縮によって生成されたサムネイル画像のJPEG生データRthをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。   When the preparation for data writing is completed in this way, the CPU 52 performs a thumbnail image capturing process and header information creating process in the next one frame period in order to create a movie file header. First, the signal processing circuit 22 is instructed to perform thinning processing, and the JPEG codec 32 is instructed to perform compression processing. The signal processing circuit 22 performs a thinning process in addition to the above-described YUV conversion, and writes the thumbnail YUV data generated thereby into the SDRAM 26 through the bus B1 and the memory control circuit 24. The JPEG codec 32 reads thumbnail YUV data from the SDRAM 26 through the bus B1 and the memory control circuit 24, and performs JPEG compression on the read thumbnail YUV data. The JPEG codec 32 then writes the JPEG raw data Rth of the thumbnail image generated by JPEG compression into the SDRAM 26 through the bus B1 and the memory control circuit 24.

CPU46はまた、サムネイル画像のJPEGヘッダHthを自ら作成し、作成したJPEGヘッダHthをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。CPU46はさらに、上述の撮影モード情報を含むヘッダ情報Hinfを自ら作成し、作成したヘッダ情報HinfをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。これによって、JPEG生データRth,JPEGヘッダHthおよびヘッダ情報Hinfが、図2に示すようにSDRAM26にマッピングされる。   The CPU 46 also creates the JPEG header Hth of the thumbnail image by itself and writes the created JPEG header Hth into the SDRAM 26 through the bus B1 and the memory control circuit 24. The CPU 46 further creates header information Hinf including the above-described shooting mode information, and writes the created header information Hinf into the SDRAM 26 through the bus B1 and the memory control circuit 24. As a result, the JPEG raw data Rth, the JPEG header Hth, and the header information Hinf are mapped to the SDRAM 26 as shown in FIG.

指示リスト52aには、“ファイル書き込み”が設定される。この“ファイル書き込み”がBG処理によって実行されることで、JPEG生データRth,JPEGヘッダHthおよびヘッダ情報HinfがSDRAM26から読み出され、バスB1およびI/F回路46を介して記録媒体50に与えられる。これによって、図7に示すムービファイルヘッダが図6に示すデータ領域503cに作成される。なお、JPEGヘッダHthおよびJPEG生データRthによって、図7に示すJPEGデータTHが形成される。   “File write” is set in the instruction list 52a. By executing this “file writing” by BG processing, JPEG raw data Rth, JPEG header Hth and header information Hinf are read from the SDRAM 26 and given to the recording medium 50 via the bus B1 and the I / F circuit 46. It is done. As a result, the movie file header shown in FIG. 7 is created in the data area 503c shown in FIG. The JPEG data TH shown in FIG. 7 is formed by the JPEG header Hth and the JPEG raw data Rth.

ムービファイルヘッダの作成が完了すると、CPU52は、垂直同期信号が発生する毎に画像取り込み処理および音声取り込み処理を行う。   When the creation of the movie file header is completed, the CPU 52 performs an image capturing process and an audio capturing process each time a vertical synchronization signal is generated.

画像取り込み処理では、自ら作成したJPEGヘッダをバスB1およびメモリ制御回路24を通してSDRAM26に書き込むとともに、JPEGコーデック32に圧縮命令を与える。JPEGコーデック32は、圧縮命令が与えられたとき、現フレームのYUVデータをバスB1およびメモリ制御回路24を通してSDRAM26から読み出し、読み出されたYUVデータを目標サイズまで圧縮する。圧縮処理によって現フレームのJPEG生データが生成されると、JPEGコーデック32は、このJPEG生データをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。   In the image capturing process, the JPEG header created by itself is written into the SDRAM 26 through the bus B1 and the memory control circuit 24, and a compression instruction is given to the JPEG codec 32. When a compression command is given, the JPEG codec 32 reads YUV data of the current frame from the SDRAM 26 through the bus B1 and the memory control circuit 24, and compresses the read YUV data to a target size. When JPEG raw data of the current frame is generated by the compression process, the JPEG codec 32 writes the JPEG raw data to the SDRAM 26 through the bus B1 and the memory control circuit 24.

ここで、JPEG圧縮時の目標サイズは記録媒体50への記録状況に応じて変更される。つまり、記録処理速度が遅いと、ボトルネックによって処理が破綻する可能性があるため、記録媒体50の記録状況が周期的に検出され、検出結果に応じてJPEG圧縮時の目標サイズが変更される。この目標サイズ変更処理については、後段で詳しく説明する。   Here, the target size at the time of JPEG compression is changed according to the recording status on the recording medium 50. In other words, if the recording processing speed is low, the processing may fail due to a bottleneck, so the recording status of the recording medium 50 is periodically detected, and the target size at the time of JPEG compression is changed according to the detection result. . This target size changing process will be described in detail later.

音声取り込み処理では、信号処理回路38に処理命令を与える。信号処理回路38は、処理命令が与えられたとき、SRAM38aに蓄積された1フレーム相当の音声データをバスB1およびメモリ制御回路38aを通してSDRAM26に書き込む。このような画像取り込み処理および音声取り込み処理が1フレーム期間毎に行なわれた結果、各フレームのJPEGヘッダ,JPEG生データおよび音声データは、図2に示すようにSDRAM26にマッピングされる。   In the voice capturing process, a processing command is given to the signal processing circuit 38. When a processing command is given, the signal processing circuit 38 writes audio data corresponding to one frame stored in the SRAM 38a into the SDRAM 26 through the bus B1 and the memory control circuit 38a. As a result of such image capture processing and audio capture processing being performed for each frame period, the JPEG header, JPEG raw data, and audio data of each frame are mapped to the SDRAM 26 as shown in FIG.

なお、図2においてJPEGヘッダおよびJPEG生データには1フレーム毎に連続番号0,1,2,…が付されるが、音声データには3フレーム毎に連続番号0,1,2,…が付される。また、同じ番号が付されたJPEGヘッダおよびJPEG生データによって1フレーム分のJPEGデータが形成され、各フレームのJPEGデータの先頭および末尾には、図8に示すようにマーカSOI(Start Of Image)およびEOI(End Of Image)が割り当てられる。   In FIG. 2, serial numbers 0, 1, 2,... Are attached to the JPEG header and JPEG raw data for each frame, but continuous numbers 0, 1, 2,. Attached. Also, JPEG data for one frame is formed by the JPEG header and JPEG raw data to which the same numbers are attached, and a marker SOI (Start Of Image) as shown in FIG. And EOI (End Of Image).

CPU52はまた、1フレーム期間が経過する毎にJPEG生データのアクセス情報,JPEGヘッダのアクセス情報およびJPEGデータのインデックス情報を作成し、3フレーム期間が経過する毎に音声データのアクセス情報および音声データのインデックス情報を作成する。   The CPU 52 also creates JPEG raw data access information, JPEG header access information, and JPEG data index information every time one frame period elapses, and audio data access information and audio data every time three frame periods elapse. Create index information for.

JPEG生データのアクセス情報は、各フレームのデータサイズとSDRAM26における先頭アドレスとからなり、JPEGヘッダのアクセス情報もまた、各フレームのデータサイズとSDRAM26における先頭アドレスとからなる。JPEGデータのインデックス情報は、各フレームのデータサイズと記録媒体50に書き込まれたときのムービファイルの先頭からの距離とからなる。   The access information of JPEG raw data consists of the data size of each frame and the start address in the SDRAM 26, and the access information of the JPEG header also consists of the data size of each frame and the start address in the SDRAM 26. The index information of JPEG data consists of the data size of each frame and the distance from the beginning of the movie file when it is written on the recording medium 50.

また、音声データのアクセス情報は、3フレーム相当のデータサイズとSDRAM26における先頭アドレスとからなり、音声データのインデックス情報は、3フレーム相当のデータサイズと記録媒体50に書き込まれたときのムービファイルの先頭からの距離とからなる。   The audio data access information is composed of a data size corresponding to 3 frames and the start address in the SDRAM 26, and the index information of the audio data is the data size corresponding to 3 frames and the movie file when written to the recording medium 50. It consists of the distance from the head.

アクセス情報は図5に示すアクセス情報テーブル52bに作成され、インデックス情報は図3に示す要領でSDRAM26に作成される。図5によれば、3フレーム分のJPEG生データのSDRAMアドレスおよびデータサイズと、3フレーム分のJPEGヘッダのSDRAMアドレスおよびデータサイズと、3フレーム相当の音声データのSDRAMアドレスおよびデータサイズとが、互いに関連付けられる。また、図3によれば、3フレーム相当の音声データの位置情報およびサイズ情報と3フレーム分のJPEGデータの位置情報およびサイズ情報とが、SDRAM26に交互にマッピングされる。   The access information is created in the access information table 52b shown in FIG. 5, and the index information is created in the SDRAM 26 in the manner shown in FIG. According to FIG. 5, the SDRAM address and data size of JPEG raw data for 3 frames, the SDRAM address and data size of JPEG header for 3 frames, and the SDRAM address and data size of audio data equivalent to 3 frames are Associated with each other. Further, according to FIG. 3, the position information and size information of audio data corresponding to three frames and the position information and size information of JPEG data for three frames are alternately mapped to the SDRAM 26.

なお、音声信号のサンプリング周波数には、ハードウェアによる実際の処理とソフトウェアの計算との間でずれが生じる場合がある。この実施例では、このずれを補償するべく、JPEGデータのインデックス情報およびアクセス情報に間引き/補間が施される。この間引き/補間処理については、後段で詳しく説明する。   Note that there may be a difference in the sampling frequency of the audio signal between actual processing by hardware and calculation by software. In this embodiment, decimation / interpolation is applied to the index information and access information of JPEG data to compensate for this deviation. This thinning / interpolation process will be described in detail later.

CPU52は、3フレーム相当の音声データと3フレームのJPEGデータとを記録媒体50に書き込むべく、上述のアクセス情報に基づいて“ファイル書き込み”を指示リスト52aに設定する。BG処理によってこの“ファイル書き込み”が実行されることで、3フレーム相当の音声データと3フレームのJPEGデータとがSDRAM26から読み出され、バスB1およびI/F回路46を介して記録媒体50に与えられる。記録媒体50のデータ領域503cには、3フレーム相当の音声データからなる音声チャンクと3フレームのJPEGデータからなる画像チャンクとが記録される。図8に示すように、音声チャンクおよび画像チャンクは、ムービファイル上に交互にマッピングされる。   The CPU 52 sets “file write” in the instruction list 52 a based on the above-described access information in order to write the audio data corresponding to 3 frames and the JPEG data of 3 frames to the recording medium 50. When this “file writing” is executed by the BG process, the audio data corresponding to 3 frames and the JPEG data of 3 frames are read from the SDRAM 26 and transferred to the recording medium 50 via the bus B1 and the I / F circuit 46. Given. In the data area 503c of the recording medium 50, an audio chunk consisting of audio data corresponding to 3 frames and an image chunk consisting of 3 frames of JPEG data are recorded. As shown in FIG. 8, audio chunks and image chunks are mapped alternately on the movie file.

シャッタボタン58が再度押されると、CPU52は、画像取り込みおよび音声取り込みを中止し、図3に示す要領でSDRAM26に作成されたインデックス情報を記録媒体50に記録するべく“ファイル書き込み”を指示リスト52aに設定する。BG処理タスクによってこの“ファイル書き込み”が実行されることで、インデックス情報がSDRAM26から読み出され、バスB1およびI/F回路46を介して記録媒体50に与えられる。この結果、図8に示すインデックスチャンクがムービファイルの末尾に形成される。インデックスチャンクでは、音声データのファイル上の位置およびサイズは3フレームに相当する時間毎に管理され、JPEGデータのファイル上の位置およびサイズは1フレーム毎に管理される。   When the shutter button 58 is pressed again, the CPU 52 stops the image capture and the sound capture and designates “write file” in the instruction list 52a in order to record the index information created in the SDRAM 26 in the manner shown in FIG. Set to. When this “file writing” is executed by the BG processing task, the index information is read from the SDRAM 26 and given to the recording medium 50 via the bus B 1 and the I / F circuit 46. As a result, the index chunk shown in FIG. 8 is formed at the end of the movie file. In the index chunk, the position and size of the audio data file on the file are managed every time corresponding to three frames, and the position and size of the JPEG data file are managed on a frame-by-frame basis.

インデックスチャンクの作成が完了すると、CPU52は、今回作成されたムービファイルのトータルサイズ値を算出し、算出したトータルサイズ値をムービファイルヘッダに書き込むべく“ファイル書き込み”を指示リスト52aに設定する。このファイル書き込みがBG処理タスクによって実行されることでトータルサイズ値がムービファイルヘッダのヘッダ情報Hinfに追加され、これによってQuickTime規格を満足するムービファイルの作成が完了する。   When the creation of the index chunk is completed, the CPU 52 calculates the total size value of the movie file created this time, and sets “write file” to the instruction list 52a in order to write the calculated total size value in the movie file header. By executing this file writing by the BG processing task, the total size value is added to the header information Hinf of the movie file header, thereby completing the creation of the movie file that satisfies the QuickTime standard.

CPU52は続いて、“ファイルクローズ”および“BG処理終了”を指示リスト52aに設定する。“ファイルクローズ”がBG処理によって実行されると、ルートディレクトリ領域502cに書き込まれたサイズ情報とFAT領域501cに書き込まれたFAT情報とが更新される。具体的には、今回作成されたムービファイルのファイル名がディレクトリエントリから検出され、検出されたファイル名に割り当てられたサイズ情報が“0”からトータルサイズ値に更新される。また、今回作成されたムービファイルの書き込み領域(クラスタ)にリンクが形成されるようにFAT情報が更新される。BG処理は、“BG処理終了”によって終了される。   Subsequently, the CPU 52 sets “file close” and “BG processing end” in the instruction list 52a. When “file close” is executed by the BG process, the size information written in the root directory area 502c and the FAT information written in the FAT area 501c are updated. Specifically, the file name of the movie file created this time is detected from the directory entry, and the size information assigned to the detected file name is updated from “0” to the total size value. In addition, the FAT information is updated so that a link is formed in the writing area (cluster) of the movie file created this time. The BG process is ended by “BG process end”.

モード切換スイッチ62によって再生モードが選択され、かつメニューキー60によって所望のムービファイルが選択されると、対応する状態信号がシステムコントローラ56に与えられる。CPU52は、選択されたムービファイルを記録媒体50から検出し、検出したムービファイル内の音声データおよびJPEGデータを再生する。このとき、再生順序は、ムービファイル内のインデックス情報に従う。   When a playback mode is selected by the mode switch 62 and a desired movie file is selected by the menu key 60, a corresponding status signal is given to the system controller 56. The CPU 52 detects the selected movie file from the recording medium 50, and reproduces the audio data and JPEG data in the detected movie file. At this time, the playback order follows the index information in the movie file.

図3に示す要領で作成されたインデックス情報がムービファイルに存在する場合、音声データおよびJPEGデータは、音声データ0,JPEGデータ0〜2,音声データ1,JPEGデータ3〜5,…の順で記録媒体50から読み出される。読み出された音声データおよびJPEGデータは、まずメモリ制御回路24によってSDRAM26に格納される。CPU52は、JPEGデータのインデックス情報に従う順序でJPEGコーデック32に伸長命令を与え、音声データのインデックス情報に従う順序で信号処理回路40に処理命令を与える。   If the index information created in the manner shown in FIG. 3 is present in the movie file, the audio data and JPEG data are in the order of audio data 0, JPEG data 0-2, audio data 1, JPEG data 3-5,. It is read from the recording medium 50. The read audio data and JPEG data are first stored in the SDRAM 26 by the memory control circuit 24. The CPU 52 gives decompression instructions to the JPEG codec 32 in the order according to the index information of JPEG data, and gives processing instructions to the signal processing circuit 40 in the order according to the index information of the audio data.

JPEGコーデック32は、所望フレームのJPEGデータを形成するJPEG生データをバスB1およびメモリ制御回路24を通してSDRAM26から読み出し、読み出されたJPEG生データにJPEG伸長を施す。JPEG伸長によって生成されたYUVデータは、バスB1およびメモリ制御回路24を通してSDRAM26に格納され、その後バスB1およびメモリ制御回路24を通してビデオエンコーダ28に与えられる。この結果、対応する再生画像がモニタ30に表示される。   The JPEG codec 32 reads JPEG raw data forming JPEG data of a desired frame from the SDRAM 26 through the bus B1 and the memory control circuit 24, and performs JPEG decompression on the read JPEG raw data. The YUV data generated by the JPEG decompression is stored in the SDRAM 26 through the bus B1 and the memory control circuit 24, and then supplied to the video encoder 28 through the bus B1 and the memory control circuit 24. As a result, a corresponding reproduced image is displayed on the monitor 30.

信号処理回路40は、所望の3フレームに相当する音声データをバスB1およびメモリ制御回路24を通してSDRAM26から読み出し、読み出された音声データをSRAM40aに蓄積する。SRAM40aに蓄積された音声データはその後D/A変換機42によってアナログ音声信号に変換され、変換された音声信号がスピーカ44から出力される。   The signal processing circuit 40 reads audio data corresponding to the desired three frames from the SDRAM 26 through the bus B1 and the memory control circuit 24, and accumulates the read audio data in the SRAM 40a. The audio data stored in the SRAM 40 a is then converted into an analog audio signal by the D / A converter 42, and the converted audio signal is output from the speaker 44.

このような処理が繰り返されることで、再生動画像がモニタ30に表示され、この再生動画像に同期する音声信号がスピーカ44から出力される。   By repeating such processing, the playback moving image is displayed on the monitor 30, and an audio signal synchronized with the playback moving image is output from the speaker 44.

撮影モードが選択されたとき、CPU52は、ROM54に記憶された制御プログラムに従って、図13〜図19に示す撮影処理タスクと図20〜図21に示すBG処理タスクとを実行する。   When the shooting mode is selected, the CPU 52 executes the shooting process task shown in FIGS. 13 to 19 and the BG process task shown in FIGS. 20 to 21 in accordance with the control program stored in the ROM 54.

まず図13を参照して、ステップS1では撮影モード決定処理を行う。具体的には、複数の撮影モードを示すメニューをモニタ30に表示し、メニューキー52の操作に応答して所望の撮影モードを決定する。撮影モードが決定されるとステップS3に進み、決定された撮影モードを示す撮影モード情報を作成する。設定情報は、たとえば“解像度:VGA”,“フレームレート:30fps”,“音響方式:モノラル”,“ビットレート:8ビット”,“サンプリングレート:8040Hz”とされる。ステップS5では、今回の撮影処理によって作成するムービファイルのファイル名を決定する。ファイル名は、たとえば“VCLP0003.MOV”とされる。作成/決定された撮影モード情報およびファイル名は、レジスタrgstに登録される。   First, referring to FIG. 13, in step S1, a shooting mode determination process is performed. Specifically, a menu showing a plurality of shooting modes is displayed on the monitor 30 and a desired shooting mode is determined in response to an operation of the menu key 52. When the shooting mode is determined, the process proceeds to step S3, and shooting mode information indicating the determined shooting mode is created. The setting information is, for example, “resolution: VGA”, “frame rate: 30 fps”, “acoustic method: monaural”, “bit rate: 8 bits”, “sampling rate: 8040 Hz”. In step S5, the file name of the movie file created by the current photographing process is determined. The file name is, for example, “VCLP0003.MOV”. The created / determined shooting mode information and file name are registered in the register rgst.

ステップS7では、各種変数を初期化する。具体的には、変数i,frmcnt,flsz,BG_RemData,pre_flsz,t_szおよびaud_szの各々を“0”に設定し、変数trgt_szを最大値MAXに設定し、そして変数audsz_fpsを理論値LGに設定する。   In step S7, various variables are initialized. Specifically, each of the variables i, frmcnt, flsz, BG_RemData, pre_flsz, t_sz and aud_sz is set to “0”, the variable trgt_sz is set to the maximum value MAX, and the variable audsz_fps is set to the theoretical value LG.

ここで、変数iおよびfrmcntは、いずれもフレーム番号を示す変数である。変数iは垂直同期信号に応答してインクリメントされ続け、変数frmcntは垂直同期信号に応答して“0”〜“3”の間で循環的に更新される。変数frmcntがとる数値“0”〜“3”のうち、実際に意味を持つのは“0”〜“2”である。上述のように、3フレームのJPEGデータによって1つの画像チャンクが形成される。変数frmcntは、注目するJPEGデータが画像チャンクの何番目のデータであるかを特定するために使用される。   Here, the variables i and frmcnt are both variables indicating the frame number. The variable i continues to be incremented in response to the vertical synchronization signal, and the variable frmcnt is cyclically updated between “0” and “3” in response to the vertical synchronization signal. Of the numerical values “0” to “3” taken by the variable frmcnt, “0” to “2” are actually meaningful. As described above, one image chunk is formed by three frames of JPEG data. The variable frmcnt is used to specify what number data of the image chunk the JPEG data of interest is.

変数flszは、JPEG圧縮によって生成されたJPEG生データのトータルサイズ値を示す変数である。変数BG_RemDataは、“ファイル書き込み”の指示が図4に示す指示リスト52aに設定されたが未だ記録媒体50に記録されていないJPEG生データのサイズを示す変数である。変数pre_flszは、記録媒体50に既に記録されたJPEG生データのトータルサイズ値を示す変数である。   The variable flsz is a variable indicating the total size value of JPEG raw data generated by JPEG compression. The variable BG_RemData is a variable that indicates the size of JPEG raw data for which the “file write” instruction is set in the instruction list 52 a shown in FIG. 4 but is not yet recorded on the recording medium 50. The variable pre_flsz is a variable indicating the total size value of the JPEG raw data already recorded on the recording medium 50.

変数trgt_szは、各フレームのYUVデータを圧縮するときの目標サイズ値を示す変数であり、変数t_szは、この目標サイズ値の算出に使用される変数である。   The variable trgt_sz is a variable indicating a target size value when compressing the YUV data of each frame, and the variable t_sz is a variable used for calculating the target size value.

変数aud_szは取り込まれた音声データのトータルサイズ値(バイト)を示す変数であり、変数audsz_fpsは1フレーム相当の音声データのサイズ値を示す変数である。ただし、変数audsz_fpsとして設定される理論値LGは、ソフトウェア計算上のサンプリングレートに基づいて決定された1フレーム相当の音声データのサイズ値である。たとえば、決定された撮影モードの実際のサンプリングレートが8043Hzであれば、ソフトウェア計算上のサンプリングレートは8040Hzとされ、理論値LGは268(=8040/30)バイトとされる。なお、8040Hzという数値は、ハードウェア上でのデータ転送が1ワード(=4バイト)単位で実行されること、および理論値LGを整数で表現できることを根拠とするものである。   The variable aud_sz is a variable indicating the total size value (bytes) of the captured audio data, and the variable audsz_fps is a variable indicating the size value of the audio data corresponding to one frame. However, the theoretical value LG set as the variable audsz_fps is a size value of audio data corresponding to one frame determined based on a sampling rate in software calculation. For example, if the actual sampling rate of the determined shooting mode is 8043 Hz, the sampling rate in software calculation is 8040 Hz, and the theoretical value LG is 268 (= 8040/30) bytes. The numerical value of 8040 Hz is based on the fact that data transfer on hardware is executed in units of 1 word (= 4 bytes) and that the theoretical value LG can be expressed by an integer.

ステップS9では、スルー画像表示を行うべく、TG14,信号処理回路22およびビデオエンコーダ28の各々に処理命令を与える。モニタ30には、被写体のスルー画像が表示される。スルー画像が表示されている状態でオペレータによってシャッタボタン58が押されると、ステップS11〜S19の各々で“BG処理開始”,“ファイル作成”,“テーブル作成”および“ファイルオープン”を図4に示す指示リスト52aのリスト番号“0”〜“3”に設定する。   In step S9, a processing command is given to each of the TG 14, the signal processing circuit 22, and the video encoder 28 in order to display a through image. On the monitor 30, a through image of the subject is displayed. When the operator presses the shutter button 58 while the through image is displayed, “BG processing start”, “file creation”, “table creation”, and “file open” are respectively shown in FIG. 4 in steps S11 to S19. Set to the list number “0” to “3” of the instruction list 52a shown.

Figure 0004717101
Figure 0004717101

表1を参照して、“BG処理開始”ではコマンドとしてFILE_STRTが設定され、“ファイル作成”ではコマンド,パラメータ1および2としてFILE_CREATE,ドライブ番号(記録媒体44を駆動するドライブの番号)およびファイルパスが設定される。また、“テーブル作成”ではコマンドおよびパラメータ1としてFILE_SET_ALLOCおよびドライブ番号が設定され、“ファイルオープン”ではコマンド,パラメータ1および2としてFILE_OPEN,ドライブ番号およびファイルパスが設定される。“ファイル作成”で設定されるファイルパスにはサイズ情報とステップS25で決定されたファイル名とが含まれ、このサイズ情報およびファイル名がディレクトリエントリに書き込まれる。ただし、ムービファイルは未完成であるため、サイズ情報は“0”を示す。
ステップS19の処理が完了した後、SG16から垂直同期信号が出力されると、ステップS21でYESと判断し、ステップS23で変数iの値を判別する。ここで変数iが“1”以上の値であればそのままステップS31に進むが、変数iが“0”であればステップS25〜S29の処理を経てステップS31に進む。
Referring to Table 1, “FILE_STRT” is set as a command in “BG processing start”, FILE_CREATE is set as a command in “file creation”, drive number (the number of the drive that drives the recording medium 44), and file path Is set. In “table creation”, FILE_SET_ALLOC and drive number are set as a command and parameter 1, and in “file open”, FILE_OPEN, drive number and file path are set as parameters and parameters 1. The file path set in “file creation” includes the size information and the file name determined in step S25, and the size information and the file name are written in the directory entry. However, since the movie file is incomplete, the size information indicates “0”.
When the vertical synchronization signal is output from SG16 after the processing of step S19 is completed, YES is determined in step S21, and the value of variable i is determined in step S23. If the variable i is a value equal to or greater than “1”, the process proceeds directly to step S31. If the variable i is “0”, the process proceeds to steps S31 through steps S25 to S29.

ステップS25では、サムネイル画像の取り込み処理を行う。具体的には、自ら作成したJPEGヘッダHthをSDRAM26に書き込むとともに、信号処理回路22およびJPEGコーデック32の各々に間引き処理および圧縮処理を命令する。   In step S25, a thumbnail image capturing process is performed. Specifically, the JPEG header Hth created by itself is written in the SDRAM 26, and the signal processing circuit 22 and the JPEG codec 32 are instructed to perform thinning processing and compression processing.

信号処理回路22は、YUVデータの間引き処理を1フレーム期間にわたって行い、これによって生成されたサムネイルYUVデータをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。JPEGコーデック32は、このサムネイルYUVデータをバスB1およびメモリ制御回路24を通してSDRAM26から読み出し、読み出されたサムネイルYUVデータにJPEG圧縮処理を施してJPEG生データRthを生成し、そしてJPEG生データRthをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。JPEGヘッダHthおよびJPEG生データRthは、図2に示すようにSDRAM26にマッピングされる。
続くステップS27では、上述の撮影モード情報(解像度,フレームレート,音響方式,ビットレート,サンプリングレート)を含むヘッダ情報Hinfを作成し、このヘッダ情報HinfをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。ヘッダ情報Hinfは、図2に示すようにJPEGヘッダHthの上にマッピングされる。
The signal processing circuit 22 performs thinning processing of YUV data over one frame period, and writes the thumbnail YUV data generated thereby into the SDRAM 26 through the bus B1 and the memory control circuit 24. The JPEG codec 32 reads the thumbnail YUV data from the SDRAM 26 through the bus B1 and the memory control circuit 24, performs JPEG compression processing on the read thumbnail YUV data to generate JPEG raw data Rth, and generates the JPEG raw data Rth. Data is written to the SDRAM 26 through the bus B1 and the memory control circuit 24. The JPEG header Hth and JPEG raw data Rth are mapped to the SDRAM 26 as shown in FIG.
In the following step S27, header information Hinf including the above-described shooting mode information (resolution, frame rate, sound system, bit rate, sampling rate) is created, and this header information Hinf is written to the SDRAM 26 through the bus B1 and the memory control circuit 24. . The header information Hinf is mapped on the JPEG header Hth as shown in FIG.

こうしてムービファイルヘッダを形成するヘッダ情報Hinf,JPEGヘッダHthおよびJPEG生データRthがSDRAM26に格納されると、ステップS29で“ファイル書き込み”を図4に示す指示リスト52aのリスト番号“4”および“5”の欄に設定する。表1から分かるように、“ファイル書き込み”ではコマンド,パラメータ1,2,3および4としてFILE_WRITE,ハンドル番号(ファイルオープン処理によって獲得),SDRAMアドレス,データサイズおよびデータ種別が設定される。“ファイル書き込み”が2つ設定されるのは、SDRAM26上においてヘッダ情報HinfおよびJPEGヘッダHthは連続しているものの、JPEG生データRthは離れた位置に格納されているからである。   When the header information Hinf, the JPEG header Hth, and the JPEG raw data Rth forming the movie file header are stored in the SDRAM 26 in this way, “file write” is changed to list numbers “4” and “4” in the instruction list 52a shown in FIG. Set in the column of 5 ". As can be seen from Table 1, in “file write”, FILE_WRITE, handle number (obtained by the file open process), SDRAM address, data size, and data type are set as a command, parameters 1, 2, 3, and 4. Two “file writing” are set because the header information Hinf and the JPEG header Hth are continuous on the SDRAM 26, but the JPEG raw data Rth is stored at a distant position.

リスト番号“4”の欄では、SDRAMアドレスとしてヘッダ情報Hinfの開始アドレスが設定され、データサイズとしてヘッダ情報HinfおよびJPEGヘッダHthの合計サイズが設定され、そしてデータ種別として“ムービファイルヘッダ”が設定される。また、リスト番号“5”の欄では、SDRAMアドレスとしてJPEG生データRthの開始アドレスが設定され、データサイズとしてJPEG生データRthのサイズが設定され、そしてデータ種別として“ムービファイルヘッダ”が設定される。この結果、図8に示すムービファイルヘッダ上では、ヘッダ情報Hinf,JPEGヘッダHthおよびJPEG生データRthがこの順で連続することとなる。なお、上述のようにJPEGヘッダHthおよびJPEG生データRthによって、JPEGデータTHが形成される。   In the column of the list number “4”, the start address of the header information Hinf is set as the SDRAM address, the total size of the header information Hinf and the JPEG header Hth is set as the data size, and “movie file header” is set as the data type Is done. In the column of the list number “5”, the start address of JPEG raw data Rth is set as the SDRAM address, the size of JPEG raw data Rth is set as the data size, and “movie file header” is set as the data type. The As a result, on the movie file header shown in FIG. 8, header information Hinf, JPEG header Hth, and JPEG raw data Rth continue in this order. As described above, the JPEG data TH is formed by the JPEG header Hth and the JPEG raw data Rth.

ステップS31では、JPEGコーデック32に圧縮処理命令を与える。この圧縮処理命令には、変数trgt_szに従う目標サイズ値が含まれる。JPEGコーデック32は、1フレーム分のYUVデータをバスB1およびメモリ制御回路24を通してSDRAM26から読み出し、読み出されたYUVデータに圧縮処理を施して目標サイズに近いサイズのJPEG生データを作成し、そして生成されたJPEG生データをバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。JPEG生データは、図2に示す要領でSDRAM26にマッピングされる。上述のように、同じフレームで得られたJPEGヘッダおよびJPEG生データによって当該フレームのJPEGデータが形成され、このJPEGデータの先頭および末尾にはマーカSOIおよびEOIが書き込まれる。   In step S31, a compression processing instruction is given to the JPEG codec 32. This compression processing instruction includes a target size value according to the variable trgt_sz. The JPEG codec 32 reads one frame of YUV data from the SDRAM 26 through the bus B1 and the memory control circuit 24, compresses the read YUV data to create JPEG raw data having a size close to the target size, and The generated JPEG raw data is written into the SDRAM 26 through the bus B1 and the memory control circuit 24. The JPEG raw data is mapped to the SDRAM 26 in the manner shown in FIG. As described above, the JPEG data of the frame is formed by the JPEG header and JPEG raw data obtained in the same frame, and the markers SOI and EOI are written at the beginning and the end of the JPEG data.

ステップS33では、1フレームに相当する音声データの取り込み処理を行うべく、信号処理回路38に処理命令を与える。信号処理回路38は、A/D変換器36から与えられかつSRAM38aに保持された1フレーム相当の音声データを、バスB1およびメモリ制御回路24を通してSDRAM26に書き込む。音声データは、図2に示す要領でSDRAM26にマッピングされる。信号処理回路38はまた、SDRAM26に書き込んだ音声データのサイズ値つまり取り込みサイズ値をCPU52に返送する。このため、ステップS35では数1に従う演算を実行し、返送された取り込みサイズ値を変数aud_szに積算する。
[数1]
aud_sz=aud_sz+取り込みサイズ値
数1の演算が完了すると、ステップS37でJPEG圧縮の完了の有無を判別する。JPEGコーデック32は、ステップS31の圧縮命令に基づくJPEG圧縮が完了すると、生成されたJPEG生データのサイズ値つまり圧縮サイズ値と圧縮完了信号とをCPU46に返送する。このため、ステップS37では、圧縮完了信号が返送されたときにYESと判断される。
In step S33, a processing command is given to the signal processing circuit 38 in order to perform audio data capturing processing corresponding to one frame. The signal processing circuit 38 writes audio data corresponding to one frame supplied from the A / D converter 36 and held in the SRAM 38 a to the SDRAM 26 through the bus B 1 and the memory control circuit 24. The audio data is mapped to the SDRAM 26 in the manner shown in FIG. The signal processing circuit 38 also returns to the CPU 52 the size value of the audio data written into the SDRAM 26, that is, the capture size value. For this reason, in step S35, the calculation according to Equation 1 is executed, and the returned fetch size value is added to the variable aud_sz.
[Equation 1]
aud_sz = aud_sz + take-in size value When the calculation of Equation 1 is completed, it is determined in step S37 whether JPEG compression has been completed. When the JPEG compression based on the compression command in step S31 is completed, the JPEG codec 32 returns the size value of the generated JPEG raw data, that is, the compression size value and the compression completion signal, to the CPU 46. For this reason, in step S37, it is determined YES when the compression completion signal is returned.

ステップS39では、返送された圧縮サイズ値を変数flszに加算するべく、数2の演算を実行する。
[数2]
flsz=flsz+圧縮サイズ値
ステップS41では、自ら作成したJPEGヘッダをバスB1およびメモリ制御回路24を通してSDRAM26に書き込み、続くステップS43では、現フレームのJPEGデータのインデックス情報をバスB1およびメモリ制御回路24を通してSDRAM26に書き込む。JPEGヘッダは図2に示す要領でSDRAM26にマッピングされ、インデックス情報は図3に示す要領でSDRAM26にマッピングされる。
In step S39, the calculation of Equation 2 is executed to add the returned compressed size value to the variable flsz.
[Equation 2]
flsz = flsz + compressed size value In step S41, the JPEG header created by itself is written into the SDRAM 26 through the bus B1 and the memory control circuit 24, and in step S43, the index information of the JPEG data of the current frame is transmitted through the bus B1 and the memory control circuit 24. Write to SDRAM 26. The JPEG header is mapped to the SDRAM 26 as shown in FIG. 2, and the index information is mapped to the SDRAM 26 as shown in FIG.

上述のように、ムービファイルのインデックスチャンクでは、JPEGデータのファイル上の位置およびサイズは1フレーム毎に管理される。このため、ステップS43では、1フレームのJPEGデータの位置情報およびサイズ情報をインデックス情報として作成する。また、ムービファイル上では3フレーム分のJPEGデータによって1つの画像チャンクが形成される。このため、ステップS43では、現フレームが連続する3フレームの何番目であるかを変数frmcntから特定し、これによってインデックス情報をSDRAM26のどの位置に作成するかを決定する。   As described above, in the movie file index chunk, the position and size of the JPEG data on the file are managed for each frame. For this reason, in step S43, position information and size information of one frame of JPEG data are created as index information. On the movie file, one image chunk is formed by three frames of JPEG data. For this reason, in step S43, the position of the three consecutive frames in the current frame is specified from the variable frmcnt, thereby determining at which position in the SDRAM 26 the index information is to be created.

ステップS45では、現フレームのJPEG生データおよびJPEGヘッダのアクセス情報を図5に示すアクセス情報テーブル52b内に作成する。つまり、SDRAM26に存在する現フレームのJPEG生データの先頭アドレス情報およびサイズ情報を現フレームのJPEG生データのアクセス情報として作成し、SDRAM26に存在する現フレームのJPEGヘッダの先頭アドレス情報およびサイズ情報を現フレームのJPEGヘッダのアクセス情報として作成する。そして作成した各々のアクセス情報をアクセス情報テーブル52bに設定された変数iに割り当てる。   In step S45, JPEG raw data of the current frame and access information of the JPEG header are created in the access information table 52b shown in FIG. That is, the head address information and size information of the JPEG raw data of the current frame existing in the SDRAM 26 are created as the access information of the JPEG raw data of the current frame, and the head address information and size information of the JPEG header of the current frame existing in the SDRAM 26 are obtained. Created as access information of the JPEG header of the current frame. Each created access information is assigned to a variable i set in the access information table 52b.

ステップS45の処理が完了すると、ステップS47で変数iを現撮影モードのフレームレート値FPSと比較する。現撮影モードのフレームレートが30fpsであれば、フレームレート値FPSは“30”となり、変数iは“30”と比較される。そして、i<FPSであればそのままステップS83に進むが、i≧FPSであればステップS49〜81の処理を経てステップS81に進む。   When the process of step S45 is completed, the variable i is compared with the frame rate value FPS of the current shooting mode in step S47. If the frame rate in the current shooting mode is 30 fps, the frame rate value FPS is “30”, and the variable i is compared with “30”. If i <FPS, the process directly proceeds to step S83, but if i ≧ FPS, the process proceeds to step S81 through steps S49 to 81.

ステップS49では変数frmcntが“2”未満かどうか判断し、YESであれば、数3の条件が満たされるかどうかをステップS51で判断する。一方、変数frmcntが“2”以上であれば、数4の条件が満たされるかどうかをステップS59で判断する。
[数3]
aud_sz−(audsz_fps*(i+1))>audsz_fps
[数4]
(audsz_fps*(i+1))−aud_sz>audsz_fps
aud_szは、実際に取り込まれた音声データのトータルサイズ値であり、audsz_fps*(i+1)は、取り込み開始からのフレーム数と理論値LGとの掛け算値である。数3および数4のいずれにおいても、両数値の差分値が理論値LGと比較される。そして、差分値が理論値LG以下である限りはそのままステップS63に進むが、差分値が理論値LGを上回ると、ステップS53〜S57を経て、あるいはステップS61を経て、ステップS63に進む。
In step S49, it is determined whether the variable frmcnt is less than “2”. If YES, it is determined in step S51 whether the condition of Equation 3 is satisfied. On the other hand, if the variable frmcnt is “2” or more, it is determined in step S59 whether or not the condition of Equation 4 is satisfied.
[Equation 3]
aud_sz- (audsz_fps * (i + 1))> audsz_fps
[Equation 4]
(Audsz_fps * (i + 1))-aud_sz> audsz_fps
aud_sz is the total size value of the audio data actually captured, and audsz_fps * (i + 1) is a product of the number of frames from the start of capture and the theoretical value LG. In both Equation 3 and Equation 4, the difference value between the two values is compared with the theoretical value LG. As long as the difference value is equal to or less than the theoretical value LG, the process proceeds to step S63 as it is. However, if the difference value exceeds the theoretical value LG, the process proceeds to step S63 via steps S53 to S57 or step S61.

たとえば、実際のサンプリングレートが8043Hzであり、ソフトウェア計算上のサンプリングレートが8040Hzであれば、両者の誤差は3Hzである。すると、1秒に相当する音声データのサイズ値に3バイトのずれが発生する。理論値LGは268バイトであるため、約90秒に1回の割合で数3の条件が満たされ、ステップS53〜S57が処理される。また、実際のサンプリングレートが8034Hzでソフトウェア計算上のサンプリングレートが8040Hzであれば、両者の誤差は6Hzとなる。このときは、約45秒に1回の割合で数4の条件が満たされ、ステップS61の処理が実行される。   For example, if the actual sampling rate is 8043 Hz and the sampling rate in software calculation is 8040 Hz, the error between them is 3 Hz. Then, a shift of 3 bytes occurs in the size value of the audio data corresponding to 1 second. Since the theoretical value LG is 268 bytes, the condition of Equation 3 is satisfied at a rate of about once every 90 seconds, and steps S53 to S57 are processed. If the actual sampling rate is 8034 Hz and the sampling rate in software calculation is 8040 Hz, the error between them is 6 Hz. At this time, the condition of Formula 4 is satisfied at a rate of about once every 45 seconds, and the process of step S61 is executed.

ステップS53では、変数iおよびfrmcntの各々をインクリメントする。ステップS55では前回と同じ画像インデックス情報つまり直前のステップS43で作成したインデックス情報と同じインデックス情報をSDRAM26内に作成し、ステップS57では前回と同じアクセス情報つまり直前のステップS45で作成したアクセス情報と同じアクセス情報をアクセス情報テーブル52b内に作成する。ステップS57の処理が完了すると、ステップS63に進む。一方、ステップS61では変数iおよびfrmcntの各々をディクリメントし、その後ステップS63に進む。   In step S53, each of variables i and frmcnt is incremented. In step S55, the same image index information as the previous time, that is, the same index information as that created in the previous step S43 is created in the SDRAM 26, and in step S57, the same access information as the previous time, that is, the same as the access information created in the previous step S45. Access information is created in the access information table 52b. When the process of step S57 is completed, the process proceeds to step S63. On the other hand, in step S61, each of the variables i and frmcnt is decremented, and then the process proceeds to step S63.

したがって、インデックス情報が図9(A)に示す要領でSDRAM26に設定されかつアクセス情報が図10(A)に示す要領でアクセス情報テーブル52bに設定された後に数3に示す条件が満たされた場合、ステップS53〜S57の処理によって、同じJPEGデータのインデックス情報が図9(B)に示すようにSDRAM26に設定され、同じJPEGデータを形成するJPEG生データおよびJPEGヘッダのアクセス情報が図10(B)に示すようにアクセス情報テーブル52bに設定される。   Therefore, when the index information is set in the SDRAM 26 as shown in FIG. 9A and the access information is set in the access information table 52b as shown in FIG. 10A, the condition shown in Equation 3 is satisfied. By the processing of steps S53 to S57, the index information of the same JPEG data is set in the SDRAM 26 as shown in FIG. 9B, and the access information of the JPEG raw data and JPEG header forming the same JPEG data is shown in FIG. ) As shown in the access information table 52b.

図9(A)によれば、JPEGデータPのインデックス情報がSDRAM26に設定されている。この状態で、変数frmcntがインクリメントされ、かつ直前のステップS43で作成したインデックス情報が再度有効化されるため、図9(B)に示すようにJPEGデータPのインデックス情報が補間される。JPEGデータPのインデックス情報が補間された後は、図9(C)に示すようにJPEGデータP+1のインデックス情報が設定される。   According to FIG. 9A, the index information of the JPEG data P is set in the SDRAM 26. In this state, the variable frmcnt is incremented and the index information created in the immediately preceding step S43 is revalidated, so that the index information of the JPEG data P is interpolated as shown in FIG. 9B. After the index information of JPEG data P is interpolated, the index information of JPEG data P + 1 is set as shown in FIG. 9C.

図10(A)によれば、JPEG生データPおよびJPEGヘッダPのアクセス情報が変数i(=P)に割り当てられている。この状態で変数iがインクリメントされ、かつ直前のステップS45で作成したアクセス情報が再度有効化されるため、図10(B)に示すようにJPEG生データPおよびJPEGヘッダPのアクセス情報が変数i(=P+1)に割り当てられることになる。JPEG生データPおよびJPEGヘッダPのアクセス情報が補間された後は、図10(C)に示すようにJPEG生データP+1およびJPEGヘッダP+1のアクセス情報が変数i(=P+2)に割り当てられる。   According to FIG. 10A, access information of JPEG raw data P and JPEG header P is assigned to variable i (= P). In this state, the variable i is incremented, and the access information created in the immediately preceding step S45 is validated again, so that the access information of the JPEG raw data P and the JPEG header P is changed to the variable i as shown in FIG. (= P + 1). After the access information of JPEG raw data P and JPEG header P is interpolated, as shown in FIG. 10C, the access information of JPEG raw data P + 1 and JPEG header P + 1 is assigned to variable i (= P + 2). .

一方、インデックス情報が図11(A)に示す要領でSDRAM26に設定されかつアクセス情報が図12(A)に示す要領でアクセス情報テーブル52bに設定された後に数4に示す条件が満たされた場合、ステップS61の処理によって、図11(B)に示すように、インデックス情報の一部が後続のインデックス情報によって上書きされ、図12(B)に示すようにアクセス情報の一部が後続のアクセス情報によって上書きされる。   On the other hand, when the index information is set in the SDRAM 26 as shown in FIG. 11A and the access information is set in the access information table 52b as shown in FIG. In step S61, a part of the index information is overwritten by the subsequent index information as shown in FIG. 11 (B), and a part of the access information becomes the subsequent access information as shown in FIG. 12 (B). Overwritten by

図11(A)によれば、JPEGデータPのインデックス情報とJPEGデータP+1のインデックス情報とが、SDRAM26に設定されている。この状態で変数frmcntがディクリメントされるため、次回のステップS43の処理によって、図11(B)に示すように、JPEGデータP+1のインデックス情報がJPEGデータP+2のインデックス情報によって上書きされる。これによって、JPEGデータP+1のインデックス情報が間引かれる。JPEGデータP+2のインデックス情報の次は、図11(C)に示すようにJPEGデータP+3のインデックス情報が設定される。   According to FIG. 11A, the index information of JPEG data P and the index information of JPEG data P + 1 are set in the SDRAM 26. Since the variable frmcnt is decremented in this state, the index information of the JPEG data P + 1 is overwritten with the index information of the JPEG data P + 2 as shown in FIG. As a result, the index information of the JPEG data P + 1 is thinned out. Next to the index information of JPEG data P + 2, the index information of JPEG data P + 3 is set as shown in FIG.

図12(A)によれば、JPEG生データPおよびJPEGヘッダPのアクセス情報とJPEG生データP+1およびJPEGヘッダP+1のアクセス情報とが、アクセス情報テーブル52bに設定されている。この状態で変数iがディクリメントされるため、次回のステップS45の処理によって、図12(B)に示すように、JPEG生データP+1およびJPEGヘッダP+1のアクセス情報がJPEG生データP+2およびJPEGヘッダP+2のアクセス情報によって上書きされる。これによって、JPEGデータP+1のアクセス情報が間引かれる。JPEG生データP+2およびJPEGヘッダP+2のアクセス情報の次は、図12(C)に示すようにJPEG生データP+3およびJPEGヘッダP+3のアクセス情報が設定される。   According to FIG. 12A, access information for JPEG raw data P and JPEG header P and access information for JPEG raw data P + 1 and JPEG header P + 1 are set in access information table 52b. Since the variable i is decremented in this state, the access processing information of the JPEG raw data P + 1 and the JPEG header P + 1 becomes the JPEG raw data P + 2 and the JPEG header P + 2 as shown in FIG. It is overwritten by the access information. As a result, the access information of the JPEG data P + 1 is thinned out. Next to the access information of the JPEG raw data P + 2 and the JPEG header P + 2, the access information of the JPEG raw data P + 3 and the JPEG header P + 3 is set as shown in FIG.

なお、ステップS53で変数iがインクリメントされることで、次回以降のステップS51ではNOとの判断が継続する。また、ステップS61で変数iがディクリメントされることで、次回以降NOステップS59ではNOとの判断が継続する。   Note that, by incrementing the variable i in step S53, the determination of NO is continued in the next step S51. Further, by decrementing the variable i in step S61, the determination of NO is continued in NO step S59 from the next time onward.

ステップS63では、変数iをフレームレート値FPSで割り算したときの余り(=i%FPS)を判別する。ここで余りが“0”でなければ、そのままステップS83に進むが、余りが“0”であればステップS65〜S81の処理を経てステップS83に進む。余りが“0”となるのは30フレームの1回であるため、ステップS65〜S81の処理は30フレームに1回の割合で実行される。   In step S63, a remainder when the variable i is divided by the frame rate value FPS (= i% FPS) is determined. If the remainder is not “0”, the process proceeds to step S83 as it is. If the remainder is “0”, the process proceeds to steps S83 through steps S65 to S81. Since the remainder is “0” once every 30 frames, the processes of steps S65 to S81 are executed once every 30 frames.

ステップS65では変数flszおよびpre_flszに数5に従う演算を施し、ステップS67では数5によって求められた差分値Δflszと変数BG_RemDataとフレームレート値FPSとに数6に従う演算を施す。
[数5]
Δflsz=flsz−pre_flsz
[数6]
t_sz=(Δflsz−BG_RemData)/FPS
数5において、変数flszはJPEG圧縮によって得られたJPEG生データのトータルサイズ値であり、変数pre_flszは記録媒体50に既に記録されたJPEG生データのトータルサイズ値である。後述するように変数pre_flszは30フレームに1回に割合でしか更新されず、数5に従う演算もまた30フレームに1回の割合でしか更新されないため、差分値Δflszは最新の30フレームで生成されたJPEG生データのトータルサイズを示す。
In step S65, an operation according to the equation 5 is performed on the variables flsz and pre_flsz, and an operation according to the equation 6 is performed on the difference value Δflsz obtained by the equation 5, the variable BG_RemData, and the frame rate value FPS.
[Equation 5]
Δflsz = flsz-pre_flsz
[Equation 6]
t_sz = (Δflsz−BG_RemData) / FPS
In Equation 5, the variable flsz is the total size value of JPEG raw data obtained by JPEG compression, and the variable pre_flsz is the total size value of JPEG raw data already recorded on the recording medium 50. As will be described later, the variable pre_flsz is updated only once every 30 frames, and the calculation according to Equation 5 is also updated only once every 30 frames, so the difference value Δflsz is generated in the latest 30 frames. The total size of JPEG raw data.

数6において、変数BG_RemDataは、“ファイル書き込み”の指示が指示リスト52aに設定されたが未だ記録媒体50に記録されていないJPEG生データのトータルサイズ値である。この変数BG_RemDataは、“ファイル書き込み”の処理に要する時間が短いほど小さくなり、逆に“ファイル書き込み”の処理に要する時間が長いほど大きくなる。差分値Δflszからこのような変数BG_RemDataを引き算した引き算値は、現時点の“ファイル書き込み”の処理速度を反映し、この引き算値をフレームレート値FPSで割り算した割り算値は、現時点の処理速度の下での変数BG_RemDataの変動量が規定の範囲内に収まる圧縮サイズ値となる。かかる圧縮サイズ値が、変数t_szとして算出される。   In Equation 6, the variable BG_RemData is a total size value of JPEG raw data in which an instruction of “file writing” is set in the instruction list 52a but is not yet recorded on the recording medium 50. This variable BG_RemData decreases as the time required for the “file writing” process decreases, and conversely increases as the time required for the “file writing” process increases. The subtracted value obtained by subtracting the variable BG_RemData from the difference value Δflsz reflects the current “file write” processing speed, and the divided value obtained by dividing the subtracted value by the frame rate value FPS is lower than the current processing speed. The amount of change in the variable BG_RemData at is a compressed size value that falls within a specified range. Such a compressed size value is calculated as a variable t_sz.

ここで、“ファイル書き込み”の処理速度の変動要因としては、CPU50aの処理速度やバッファメモリ50bの容量のような記録媒体50の特性のほかに、バスB1の占有率やBG処理タスク以外のタスクの処理状況などが考えられる。   Here, as a factor of fluctuation in the processing speed of “file writing”, in addition to the characteristics of the recording medium 50 such as the processing speed of the CPU 50a and the capacity of the buffer memory 50b, tasks other than the occupation ratio of the bus B1 and the BG processing task The processing status of this can be considered.

上述のように、ズームキー64の操作によって“1.0”よりも大きいズーム倍率が選択されると、生画像データは、SDRAM26に一旦格納されてから信号処理回路22に入力される。このとき、生画像データは、バスB1を介してSDRAM26に与えられ、バスB1を介して信号処理回路22に戻される。バスB1の占有率は生画像データの転送処理によって上昇し、これによって“ファイル書き込み”の処理速度が低下してしまう。   As described above, when a zoom magnification larger than “1.0” is selected by operating the zoom key 64, the raw image data is temporarily stored in the SDRAM 26 and then input to the signal processing circuit 22. At this time, the raw image data is given to the SDRAM 26 via the bus B1 and returned to the signal processing circuit 22 via the bus B1. The occupation ratio of the bus B1 is increased by the transfer process of the raw image data, and the processing speed of “file writing” is thereby lowered.

また、カメラのパンニングやチルティングによって被写体の明るさや色あいが大きく変化すると、撮影条件制御タスクが起動して、絞り量,露光時間,白バランス調整ゲインなどが調整される。各々のタスクを同時に実行することはできないため、撮影条件制御タスクが起動すると、BG処理タスクは中断され、これによって“ファイル書き込み”の処理速度が低下してしまう。   Also, when the brightness or color tone of the subject changes greatly due to camera panning or tilting, a shooting condition control task is activated to adjust the aperture amount, exposure time, white balance adjustment gain, and the like. Since each task cannot be executed at the same time, when the shooting condition control task is activated, the BG processing task is interrupted, thereby reducing the processing speed of “file writing”.

この実施例では、かかる“ファイル書き込み”の処理速度の変動を考慮して、変数t_szを周期的に更新するようにしている。変数t_szの更新の結果、後述するように目標サイズ値ひいてはJPEG圧縮率が更新される。   In this embodiment, the variable t_sz is periodically updated in consideration of the fluctuation in the processing speed of such “file writing”. As a result of updating the variable t_sz, the target size value and thus the JPEG compression rate are updated as will be described later.

ステップS69では算出された変数t_szを変数trgt_szと比較し、t_sz<trgt_szであれば、ステップS71で変数t_szを最小値MINと比較する。そして、t_sz≧MINであればそのままステップS79に進むが、t_sz<MINであればステップS73で変数t_szを最小値MINに更新してからステップS79に進む。一方、ステップS69でt_sz≧trgt_szと判断されると、ステップS75で変数t_szを最大値MAXと比較する。そして、t_sz≦MAXであればそのままステップS79に進むが、t_sz>MAXであればステップS77で変数t_szを最大値MAXに更新してからステップS79に進む。ステップS79では、変数t_szを変数trgt_szとして設定する。   In step S69, the calculated variable t_sz is compared with the variable trgt_sz. If t_sz <trgt_sz, the variable t_sz is compared with the minimum value MIN in step S71. If t_sz ≧ MIN, the process proceeds directly to step S79. If t_sz <MIN, the variable t_sz is updated to the minimum value MIN in step S73, and then the process proceeds to step S79. On the other hand, if it is determined in step S69 that t_sz ≧ trgt_sz, the variable t_sz is compared with the maximum value MAX in step S75. If t_sz ≦ MAX, the process proceeds directly to step S79. If t_sz> MAX, the variable t_sz is updated to the maximum value MAX in step S77, and then the process proceeds to step S79. In step S79, the variable t_sz is set as the variable trgt_sz.

数6によれば、変数BG_RemDataが大きいと変数t_szが小さくなり、逆に変数BG_RemDataが小さいと変数t_szが大きくなる。したがって、“t_sz<trgt_sz”は、未記録のJPEGデータ量が多いこと、即ち“ファイル書き込み”の処理速度が遅いことを意味する。また、“t_sz≧trgt_sz”は、未記録のJPEGデータ量が少ないこと、即ち記録媒体50の記録特性が優れていることを意味する。   According to Equation 6, when the variable BG_RemData is large, the variable t_sz is small. Conversely, when the variable BG_RemData is small, the variable t_sz is large. Therefore, “t_sz <trgt_sz” means that the amount of unrecorded JPEG data is large, that is, the processing speed of “file writing” is slow. “T_sz ≧ trgt_sz” means that the amount of unrecorded JPEG data is small, that is, the recording characteristics of the recording medium 50 are excellent.

そこで、変数t_szが変数trgt_szを下回るときは、より小さい目標サイズ値(より高いJPEG圧縮率)を次の1秒間で有効化するべく、変数t_szが変数trgt_szとして設定する。これによって、次回の1秒間で生成されるJPEGデータのサイズは今回の1秒間で生成されたJPEGデータよりも小さくなり、“ファイル書き込み”の処理速度の低下に起因する処理の破綻が回避される。   Therefore, when the variable t_sz is lower than the variable trgt_sz, the variable t_sz is set as the variable trgt_sz in order to validate a smaller target size value (higher JPEG compression rate) in the next one second. As a result, the size of the JPEG data generated in the next one second becomes smaller than the JPEG data generated in the current one second, and the failure of the processing due to the decrease in the processing speed of “file writing” is avoided. .

一方、変数t_szが変数trgt_sz以上であるときは、より大きな目標サイズ値(より低いJPEG圧縮率)を次の1秒間で有効化するべく、変数t_szを変数trgt_szに設定する。これによって、次回の1秒間で生成されるJPEGデータのサイズは今回の1秒間で生成されたJPEGデータよりも大きくなり、圧縮処理に起因する画質の劣化が低減される。   On the other hand, when the variable t_sz is greater than or equal to the variable trgt_sz, the variable t_sz is set to the variable trgt_sz in order to validate a larger target size value (lower JPEG compression rate) in the next one second. As a result, the size of the JPEG data generated in the next 1 second becomes larger than the JPEG data generated in the current 1 second, and image quality deterioration due to the compression process is reduced.

ステップS81では、変数flszおよびBG_RemDataに数7の演算を施して、変数pre_flszを更新する。
[数7]
pre_flsz=flsz−BG_RemData
数7によれば、これまでに生成されたJPEG生データのトータルサイズ値から、未記録のJPEG生データのトータルサイズ値が引き算される。この演算もまた30フレーム毎に実行されるため、変数pre_flszは30フレームに1回の割合で更新される。次回つまり30フレーム後の数5の演算では、こうして更新された変数pre_flszが最新の変数flszから引き算される。
In step S81, the calculation of Expression 7 is performed on the variables flsz and BG_RemData to update the variable pre_flsz.
[Equation 7]
pre_flsz = flsz−BG_RemData
According to Equation 7, the total size value of unrecorded JPEG raw data is subtracted from the total size value of JPEG raw data generated so far. Since this calculation is also executed every 30 frames, the variable pre_flsz is updated at a rate of once every 30 frames. In the next calculation, that is, the calculation of Equation 5 after 30 frames, the updated variable pre_flsz is subtracted from the latest variable flsz.

ステップS83では変数frmcntをインクリメントし、続くステップS85ではインクリメントされた変数frmcntの値を判別する。そして、変数frmcntが“1”または“2”であればそのままステップS95に進むが、変数frmcntが“3”であれば、ステップS87〜S93の処理を経てステップS95に進む。   In step S83, the variable frmcnt is incremented, and in the subsequent step S85, the value of the incremented variable frmcnt is determined. If the variable frmcnt is “1” or “2”, the process directly proceeds to step S95. If the variable frmcnt is “3”, the process proceeds to steps S95 through steps S87 to S93.

ステップS87では音声データのインデックス情報をSDRAM26に書き込む。図7に示すムービファイル上では、3フレームに相当する時間の音声データによって1つの音声チャンクが形成される。また、インデックスチャンクでは、音声データのファイル上の位置およびサイズは3フレームに相当する時間毎に管理される。このため、ステップS85では、最新の3フレームに相当する音声データの位置情報およびサイズ情報を作成し、作成したインデックス情報を図3に示すようにSDRAM26に書き込む。   In step S87, the index information of the audio data is written into the SDRAM 26. On the movie file shown in FIG. 7, one audio chunk is formed by audio data for a time corresponding to three frames. In the index chunk, the position and size of the audio data file are managed every time corresponding to 3 frames. For this reason, in step S85, position information and size information of audio data corresponding to the latest three frames are created, and the created index information is written in the SDRAM 26 as shown in FIG.

続くステップS89では音声データのアクセス情報をアクセス情報テーブル52bに書き込む。つまり、SDRAM26に存在する3フレーム相当の音声データの先頭アドレス情報とサイズ情報とをアクセス情報として作成し、作成したアクセス情報をアクセス情報テーブル52bに書き込む。このとき、アクセス情報は、注目する3フレームのJPEGデータのアクセス情報に関連付けられる。   In subsequent step S89, the access information of the audio data is written in the access information table 52b. That is, the start address information and size information of audio data corresponding to three frames existing in the SDRAM 26 are created as access information, and the created access information is written into the access information table 52b. At this time, the access information is associated with the access information of the JPEG data of three frames of interest.

ステップS91では、アクセス情報テーブル52bに設定された3フレーム分のJPEG生データと、3フレーム分のJPEGヘッダのアクセス情報と、3フレーム相当の音声データのアクセス情報とを参照して、“ファイル書き込み”を図4に示す指示リスト52aに設定する。図2に示すように、3フレーム相当の音声データはSDRAM26上で連続するが、3フレームのJPEG生データおよびJPEGヘッダはSDRAM26上で離散的に分布する。このため、ステップS91では、合計7つ分の“ファイル書き込み”を指示リスト52aに設定する。   In step S91, referring to the JPEG raw data for three frames set in the access information table 52b, the access information for the JPEG header for three frames, and the access information for audio data corresponding to three frames, "Is set in the instruction list 52a shown in FIG. As shown in FIG. 2, audio data corresponding to three frames is continuous on the SDRAM 26, but three frames of JPEG raw data and JPEG header are distributed discretely on the SDRAM 26. Therefore, in step S91, a total of seven “file write” is set in the instruction list 52a.

この7つの“ファイル書き込み”のうち1番目に設定される“ファイル書き込み”では、SDRAMアドレスは注目する3フレーム相当の音声データの開始アドレスを示し、データサイズは注目する3フレーム相当の音声データのサイズを示し、そしてデータ種別は音声チャンクを示す。ここで、開始アドレスおよびデータサイズは、ステップS87で作成されたアクセス情報を形成するSDRAMアドレスおよびデータサイズに等しい。   In the first “file write” among the seven “file write”, the SDRAM address indicates the start address of the audio data corresponding to the three frames of interest, and the data size is the audio data of the three frames of interest. Indicates the size, and the data type indicates an audio chunk. Here, the start address and data size are equal to the SDRAM address and data size forming the access information created in step S87.

2番目,4番目および6番目に設定される“ファイル書き込み”では、SDRAMアドレスは注目する3フレームのJPEGヘッダの開始アドレスを示し、データサイズは注目する3フレームのJPEGヘッダのサイズを示し、そしてデータ種別はJPEGヘッダを示す。ここで、開始アドレスおよびデータサイズは、ステップS45またはS57で作成された最新3フレームのJPEGヘッダのアクセス情報を形成するSDRAMアドレスおよびデータサイズに等しい。   In the “file write” set to the second, fourth and sixth, the SDRAM address indicates the start address of the JPEG header of the three frames of interest, the data size indicates the size of the JPEG header of the three frames of interest, and The data type indicates a JPEG header. Here, the start address and data size are equal to the SDRAM address and data size forming the access information of the JPEG header of the latest three frames created in step S45 or S57.

3番目,5番目および7番目に設定される“ファイル書き込み”では、SDRAMアドレスは注目する3フレームのJPEG生データの開始アドレスを示し、データサイズは注目する3フレームのJPEG生データのサイズを示し、そしてデータ種別はJPEG生データを示す。ここで、開始アドレスおよびデータサイズは、ステップS45またはS57で作成された最新3フレームのJPEG生データのアクセス情報を形成するSDRAMアドレスおよびデータサイズに等しい。   In the “file write” set in the third, fifth and seventh, the SDRAM address indicates the start address of the JPEG raw data of the three frames of interest, and the data size indicates the size of the JPEG raw data of the three frames of interest. The data type indicates JPEG raw data. Here, the start address and data size are equal to the SDRAM address and data size forming the access information of the latest three frames of JPEG raw data created in step S45 or S57.

このような指示リスト52aの指示がBG処理タスクで実行されることで、3フレーム相当の音声データと3フレームのJPEGデータとがメモリ制御回路24によってSDRAM26から読み出され、バスB1およびI/F回路46を通して記録媒体50に与えられる。この結果、音声チャンクおよび画像チャンクが図8に示すムービファイル上で交互に分布することになる。   By executing the instructions in the instruction list 52a in the BG processing task, the audio data corresponding to 3 frames and the 3 frames of JPEG data are read from the SDRAM 26 by the memory control circuit 24, and the buses B1 and I / F The signal is supplied to the recording medium 50 through the circuit 46. As a result, audio chunks and image chunks are alternately distributed on the movie file shown in FIG.

ステップS93では、ステップS91で指示リスト52aに設定した3フレームのJPEG生データのサイズ値を変数BG_RemDataに加算するべく、数8の演算を実行する。
[数8]
BG_RemData=BG_RemData+JPEG生データサイズ値
ステップS95ではフレーム番号iをインクリメントし、続くステップS97ではシャッタボタン58の操作の有無を判別する。シャッタボタン58が押されない限りステップS21〜S95の処理を繰り返し、各フレームで生成されたJPEGヘッダ,JPEG生データおよび音声データは、SDRAM26に図2に示す要領でマッピングされる。
In step S93, the calculation of Equation 8 is executed to add the size value of the 3 frames of JPEG raw data set in the instruction list 52a in step S91 to the variable BG_RemData.
[Equation 8]
BG_RemData = BG_RemData + JPEG raw data size value In step S95, the frame number i is incremented, and in the subsequent step S97, it is determined whether or not the shutter button 58 has been operated. As long as the shutter button 58 is not pressed, the processes in steps S21 to S95 are repeated, and the JPEG header, JPEG raw data, and audio data generated in each frame are mapped to the SDRAM 26 as shown in FIG.

シャッタボタン58が押されるとステップS99に進み、変数frmcntの値を判別する。ここで変数frmcntが“3”であればそのままステップS103に進むが、変数frmcntが“1”または“2”であればステップS101で“ファイル書き込み”を指示リスト52aに設定してからステップS103に進む。   When the shutter button 58 is pressed, the process proceeds to step S99 to determine the value of the variable frmcnt. If the variable frmcnt is “3”, the process directly proceeds to step S103. If the variable frmcnt is “1” or “2”, “file write” is set in the instruction list 52a in step S101, and the process proceeds to step S103. move on.

変数frmcntが“1”の場合、最後の音声チャンクおよび画像チャンクは1フレーム分の音声データおよびJPEGデータによって形成され、指示リスト52aには合計3つの“ファイル書き込み”が設定される。変数frmcntが“2”の場合、最後の音声チャンクおよび画像チャンクは2フレーム分の音声データおよびJPEGデータによって形成され、指示リスト52aには合計5つの“ファイル書き込み”が設定される。これによって、1フレーム分または2フレーム分の音声データからなる音声チャンクと、1フレームまたは2フレームのJPEGデータからなる画像チャンクとが、ムービファイルに形成される。   When the variable frmcnt is “1”, the last audio chunk and image chunk are formed by one frame of audio data and JPEG data, and a total of three “file write” is set in the instruction list 52a. When the variable frmcnt is “2”, the last audio chunk and image chunk are formed by audio data and JPEG data for two frames, and a total of five “file write” is set in the instruction list 52a. As a result, an audio chunk consisting of audio data for one frame or two frames and an image chunk consisting of one frame or two frames of JPEG data are formed in the movie file.

ステップS103では、図3に示すインデックス情報をムービファイルに書き込むべく、“ファイル書き込み”を指示リスト52aに設定する。ここで設定されるSDRAMアドレスおよびデータサイズは、図3に示すインデックス情報の開始アドレスおよび合計サイズを示し、データ種別はムービファイルヘッダを示す。BG処理によってこの“ファイル書き込み”が実行されることで、図3に示す全てのインデックス情報を含むインデックスチャンクがムービファイルの末尾に形成される。   In step S103, “file write” is set in the instruction list 52a in order to write the index information shown in FIG. 3 to the movie file. The SDRAM address and data size set here indicate the start address and total size of the index information shown in FIG. 3, and the data type indicates a movie file header. By executing this “file writing” by the BG process, an index chunk including all index information shown in FIG. 3 is formed at the end of the movie file.

ステップS105では、インデックス情報に含まれるサイズ情報に基づいてムービファイルのトータルサイズを算出し、算出されたトータルサイズデータをSDRAM26に書き込む。続くステップS107〜S111では、“ファイル書き込み”,“ファイルクローズ”および“BG処理終了”を指示リスト52aに設定する。“ファイル書き込み”で設定されるSDRAMアドレスおよびデータサイズはトータルサイズデータの先頭アドレスおよびデータサイズを示し、データ種別はムービファイルヘッダを示す。また、“ファイルクローズ”ではFILE_CLOSEがコマンドとして設定され、“BG処理終了”ではFILE_ENDがコマンドとして設定される。   In step S105, the total size of the movie file is calculated based on the size information included in the index information, and the calculated total size data is written in the SDRAM 26. In subsequent steps S107 to S111, “file write”, “file close”, and “BG processing end” are set in the instruction list 52a. The SDRAM address and data size set by “file writing” indicate the head address and data size of the total size data, and the data type indicates the movie file header. Also, “FILE_CLOSE” is set as a command in “file close”, and FILE_END is set as a command in “BG processing end”.

“ファイル書き込み”がBG処理によって実行されることで、トータルサイズ値がムービファイルヘッダのサイズ情報に追加される。また、“ファイルクローズ”がBG処理によって実行されることで、ディレクトリエントリのサイズ情報(ステップS15の処理に基づいて書き込まれたサイズ情報)が“0”からトータルサイズ値に更新され、かつ今回作成されたムービファイルの書き込み領域にリンクが形成されるようにFAT領域501cのFAT情報が更新される。BG処理は、“BG処理終了”によって終了する。   By executing “file writing” by the BG process, the total size value is added to the size information of the movie file header. In addition, the “file close” is executed by the BG process, so that the size information of the directory entry (size information written based on the process of step S15) is updated from “0” to the total size value, and is created this time. The FAT information in the FAT area 501c is updated so that a link is formed in the written area of the movie file. The BG process is terminated by “BG process end”.

なお、トータルサイズ値をムービファイルヘッダに書き込むためには、書き込み先アドレスを更新する必要があり、実際には、ステップS105の“ファイル書き込み”の設定に先立って“シーク処理”が指示リスト52aに設定される。   In order to write the total size value in the movie file header, it is necessary to update the write destination address. In practice, “seek processing” is set in the instruction list 52a prior to the setting of “file write” in step S105. Is set.

BG処理タスクは、図20〜図21に示すフロー図に従う。まずステップS121で読み出し先のリスト番号Lを“0”に設定し、続くステップS123ではリスト番号Lから読み出されたコマンドがFILE_STRTであるかどうか判断する。ここでYESであれば、ステップS125でリスト番号Lをインクリメントし、インクリメント後のリスト番号Lから読み出されたコマンドの内容をステップS127,S131,S135,S139,S147の各々で判別する。   The BG processing task follows the flowcharts shown in FIGS. First, in step S121, the list number L of the reading destination is set to “0”, and in the subsequent step S123, it is determined whether or not the command read from the list number L is FILE_STRT. If “YES” here, the list number L is incremented in a step S125, and the contents of the command read from the incremented list number L are discriminated in each of the steps S127, S131, S135, S139, and S147.

読み出されたコマンドがFILE_CREATEであればステップS127でYESと判断し、ステップS129でファイル作成処理を行う。具体的には、パラメータ1に設定されたドライブ番号によって記録媒体50を特定し、パラメータ2に設定されたファイルパスに基づいて記録媒体50のディレクトリエントリにファイル名とサイズ0を示すサイズ情報とを書き込む。処理を終えると、ステップS125に戻る。   If the read command is FILE_CREATE, “YES” is determined in the step S127, and a file creating process is performed in a step S129. Specifically, the recording medium 50 is specified by the drive number set in the parameter 1, and based on the file path set in the parameter 2, the file name and the size information indicating the size 0 are displayed in the directory entry of the recording medium 50. Write. When the process is finished, the process returns to step S125.

読み出されたコマンドがFILE_SET_ALLOCであればステップS131でYESと判断し、ステップS133でテーブル作成処理を行う。つまり、パラメータ1に設定されたドライブ番号によって記録媒体50を特定し、FAT情報を参照して図7に示す空き領域テーブル52cを作成する。処理を終えると、ステップS125に戻る。   If the read command is FILE_SET_ALLOC, YES is determined in step S131, and table creation processing is performed in step S133. That is, the recording medium 50 is specified by the drive number set in the parameter 1, and the free space table 52c shown in FIG. 7 is created with reference to the FAT information. When the process is finished, the process returns to step S125.

読み出されたコマンドがFILE_OPENであればステップS135からステップS137に進み、ファイルオープン処理を行う。つまり、パラメータ1に設定されたドライブ番号によって記録媒体50を特定し、パラメータ2に設定されたファイルパスに基づいてファイルを特定し、そしてこのファイルに割り当てるハンドル番号を作成する。作成したハンドル番号は撮影処理に用いられる。処理を終えると、ステップS125に戻る。   If the read command is FILE_OPEN, the process proceeds from step S135 to step S137, and file open processing is performed. That is, the recording medium 50 is specified by the drive number set in the parameter 1, the file is specified based on the file path set in the parameter 2, and the handle number assigned to this file is created. The created handle number is used for photographing processing. When the process is finished, the process returns to step S125.

読み出されたコマンドがFILE_WRITEであればステップS139からステップS141に進み、ファイル書き込み処理を行う。具体的には、パラメータ1に設定されたハンドル番号によって書き込み先のムービファイルを特定し、パラメータ2および3に設定されたSDRAMアドレスおよびデータサイズに従って読み出し開始アドレスおよび読み出しサイズを特定する。そして、読み出し開始アドレスおよび読み出しサイズに基づいてSDRAM26からワード単位でデータを読み出し、読み出したデータを書き込み先のムービファイル情報とともに記録媒体50のCPU50aに与える。   If the read command is FILE_WRITE, the process proceeds from step S139 to step S141, and file write processing is performed. Specifically, the movie file to be written is specified by the handle number set in parameter 1, and the read start address and read size are specified in accordance with the SDRAM address and data size set in parameters 2 and 3. Then, based on the read start address and the read size, data is read from the SDRAM 26 in units of words, and the read data is given to the CPU 50a of the recording medium 50 together with the write destination movie file information.

パラメータ3に設定された読み出しサイズが記録媒体50に設けられたバッファメモリ50bよりも大きければ、バッファメモリ50bが満杯となった時点でCPU50aからCPU52にBUSY信号が返送される。ステップS141の処理は、BUSY信号に応答して中断される。バッファメモリ50bからハードディスク50cへのデータ転送によってバッファメモリ50bに十分な空き容量が確保されると、CPU50aからCPU52にREADY信号が返送される。ステップS141の処理は、このREADY信号に応答して再開される。   If the read size set in parameter 3 is larger than the buffer memory 50b provided in the recording medium 50, a BUSY signal is returned from the CPU 50a to the CPU 52 when the buffer memory 50b is full. The process of step S141 is interrupted in response to the BUSY signal. When a sufficient free space is secured in the buffer memory 50b by data transfer from the buffer memory 50b to the hard disk 50c, a READY signal is returned from the CPU 50a to the CPU 52. The processing in step S141 is resumed in response to this READY signal.

パラメータ3に設定された読み出しサイズに相当するデータの記録媒体50への転送が完了すると、この読み出しサイズを積算するとともに、1クラスタ分の書き込みが完了する毎に書込クラスタのリンク状態を示すFAT情報を作成する。データサイズの積算値およびFAT情報は、SDRAM26に保持される。   When the transfer of the data corresponding to the read size set in parameter 3 to the recording medium 50 is completed, the read size is accumulated and the FAT indicating the link state of the write cluster every time one cluster is written. Create information. The integrated value of the data size and the FAT information are held in the SDRAM 26.

ステップS143では、パラメータ4に設定されたデータ種別を判別する。ここでデータ種別が“JPEG生データ”でなければそのままステップS125に戻るが、データ種別が“JPEG生データ”であれば、ステップS145で数9に従う演算を実行してからステップS125に戻る。
[数9]
BG_RemData=BG_RemData−JPEG生データサイズ値
数9によれば、パラメータ3に設定されたデータサイズが、変数BG_RemDataから引き算される。これによって、変数BG_RemDataが、指示リスト52aに設定されたが未だ記録媒体50に記録されていないJPEG生データのサイズを示すこととなる。
In step S143, the data type set in parameter 4 is determined. If the data type is not “JPEG raw data”, the process directly returns to step S125. If the data type is “JPEG raw data”, the calculation according to Equation 9 is executed in step S145, and then the process returns to step S125.
[Equation 9]
BG_RemData = BG_RemData-JPEG raw data size value According to Equation 9, the data size set in the parameter 3 is subtracted from the variable BG_RemData. As a result, the variable BG_RemData indicates the size of JPEG raw data set in the instruction list 52a but not yet recorded on the recording medium 50.

読み出されたコマンドがFILE_CLOSEであればステップS147からステップS149に進み、ファイルクローズ処理を行う。具体的には、オープンしているムービファイルのファイル名に割り当てられたサイズ情報をSDRAM26に保持されたトータルサイズ値によって更新し、SDRAM26によって保持されたFAT情報によってFAT領域501cのFAT情報を更新する。処理が完了すると、ステップS125に戻る。   If the read command is FILE_CLOSE, the process advances from step S147 to step S149 to perform file close processing. Specifically, the size information assigned to the file name of the open movie file is updated with the total size value held in the SDRAM 26, and the FAT information in the FAT area 501c is updated with the FAT information held in the SDRAM 26. . When the process is completed, the process returns to step S125.

読み出されたコマンドがFILE_ENDであれば、ステップS147でNOと判断し、ステップS121に戻る。BG処理は待機状態に移行する。   If the read command is FILE_END, NO is determined in step S147, and the process returns to step S121. The BG process shifts to a standby state.

以上の説明から分かるように、動画像を形成する複数フレームのYUVデータは、マルチタスクOSを搭載したCPU52の制御の下、圧縮状態で記録媒体50に記録される。ここで、CPU52によって実行される複数のタスクは、複数フレームのYUVデータの圧縮処理に関与する撮影処理タスク、および複数フレームのJPEGデータの記録処理に関与するBG処理タスクを含む。さらに、撮影処理タスクは、JPEGデータの記録処理速度を周期的に判別する判別処理(S63)、およびその判別結果に基づいてYUVデータの圧縮率を変更する変更処理(S79)を含む。   As can be seen from the above description, a plurality of frames of YUV data forming a moving image are recorded on the recording medium 50 in a compressed state under the control of the CPU 52 equipped with a multitask OS. Here, the plurality of tasks executed by the CPU 52 include an imaging processing task related to compression processing of a plurality of frames of YUV data, and a BG processing task related to recording processing of a plurality of frames of JPEG data. Further, the photographing process task includes a determination process (S63) for periodically determining the recording processing speed of JPEG data, and a change process (S79) for changing the compression rate of the YUV data based on the determination result.

マルチタスクOSでは、複数のタスクの各々は時分割でしか実行されない。すると、各々のタスクの負荷変動によって、JPEGデータの記録処理速度が変動する。また、ズーム回路22aは、ズームキー64によって拡大ズームが選択されたとき、生画像データをバスB1およびメモリ制御回路24を通してSDRAM26に一旦書き込み、一部の生画像データをバスB1およびメモリ制御回路24を通して読み出し、そして読み出された生画像データに拡大ズームを施す。このため、拡大ズームが選択されたときも、バスB1の占有率の低下に起因して記録処理速度が低下する。そこで、この実施例では、記録処理速度を周期的に判別し、判別結果に応じてYUVデータの圧縮率を変更する。これによって、動画像の連続記録可能時間の制御が可能となる。   In a multitasking OS, each of a plurality of tasks is executed only in a time division manner. Then, the recording processing speed of JPEG data varies depending on the load variation of each task. The zoom circuit 22a once writes the raw image data to the SDRAM 26 through the bus B1 and the memory control circuit 24 when the enlargement zoom is selected by the zoom key 64, and part of the raw image data through the bus B1 and the memory control circuit 24. Read-out and enlargement zoom are performed on the read raw image data. For this reason, even when the enlargement zoom is selected, the recording processing speed is reduced due to the decrease in the occupation ratio of the bus B1. Therefore, in this embodiment, the recording processing speed is periodically determined, and the compression rate of the YUV data is changed according to the determination result. Thereby, it is possible to control the continuous recordable time of moving images.

なお、この実施例では、JPEG方式で画像圧縮を行うようにしているが、JPEG方式に代えてMPEG方式を採用し、目標サイズ値をGOP単位で更新するようにしてもよい。   In this embodiment, image compression is performed using the JPEG method, but the MPEG method may be adopted instead of the JPEG method, and the target size value may be updated in units of GOPs.

また、この実施例では、目標サイズ値を30フレーム毎に更新するようにしているが、ソフトウェア計算を容易にするために、32フレーム,64フレーム,128フレームのような2のべき乗に相当するフレーム数毎に目標サイズを更新するようにしてもよい。   In this embodiment, the target size value is updated every 30 frames. However, in order to facilitate software calculation, a frame corresponding to a power of 2 such as 32 frames, 64 frames, and 128 frames. The target size may be updated every number.

さらに、この実施例では、フレーム数を調整するかどうかの判断に用いる閾値を1フレーム相当の音声データ量(=268バイト)に設定するようにしているが、この閾値は、268バイトの整数倍としてもよい。   Further, in this embodiment, the threshold used for determining whether or not to adjust the number of frames is set to the amount of audio data equivalent to one frame (= 268 bytes), but this threshold is an integral multiple of 268 bytes. It is good.

また、この実施例では、記録処理を行うときにJPEGデータのフレーム数を調整するようにしているが、フレーム数の調整は再生処理の際に行うようにしてもよい。   In this embodiment, the number of frames of JPEG data is adjusted when performing the recording process. However, the number of frames may be adjusted during the reproduction process.

さらに、この実施例では、アクセス情報およびインデックス情報の両方に間引き/補間を施すようにしているが、インデックス情報のみに基づいてJPEGデータの再生順序を制御する場合は、インデックス情報のみに間引き/補間を施すようにしてもよい。これによって、アクセス情報の間引き処理に起因するJPEGデータの欠落を防止することができる。   Further, in this embodiment, thinning / interpolation is performed on both access information and index information. However, when controlling the reproduction order of JPEG data based only on index information, thinning / interpolation is performed only on index information. May be applied. As a result, it is possible to prevent the loss of JPEG data due to the access information thinning process.

さらにまた、この実施例では、動画像信号の記録方式としてFAT方式を採用しているが、これに代えてUDF(Universal Disk Format)方式を採用してもよい。   Furthermore, in this embodiment, the FAT system is employed as the moving image signal recording system, but a UDF (Universal Disk Format) system may be employed instead.

さらにまた、この実施例ではディジタルビデオカメラを用いて説明しているが、この発明は、たとえばTV番組を録画する据え置き型のハードディスクレコーダにも適用できることは言うまでもない。   Furthermore, although this embodiment has been described using a digital video camera, it goes without saying that the present invention can also be applied to, for example, a stationary hard disk recorder for recording TV programs.

この発明の一実施例を示すブロック図である。It is a block diagram which shows one Example of this invention. SDRAMのマッピング状態の一例を示す図解図である。It is an illustration figure which shows an example of the mapping state of SDRAM. SDRAMのマッピング状態の他の一例を示す図解図である。It is an illustration figure which shows another example of the mapping state of SDRAM. 指示リストの構成の一例を示す図解図である。It is an illustration figure which shows an example of a structure of an instruction | indication list. アクセス情報テーブルの構成の一例を示す図解図である。It is an illustration figure which shows an example of a structure of an access information table. 記録媒体の構成の一例を示す図解図である。It is an illustration figure which shows an example of a structure of a recording medium. 空き領域テーブルの構成の一例を示す図解図である。It is an illustration figure which shows an example of a structure of an empty area table. 完成状態のムービファイルの構造を示す図解図である。It is an illustration figure which shows the structure of the movie file of a completion state. インデックス情報の作成処理の一部を示す図解図である。It is an illustration figure which shows a part of creation processing of index information. アクセス情報テーブルの作成処理の一部を示す図解図である。It is an illustration figure which shows a part of creation processing of an access information table. インデックス情報の作成処理の他の一部を示す図解図である。It is an illustration figure which shows another part of creation processing of index information. アクセス情報テーブルの作成処理の他の一部を示す図解図である。It is an illustration figure which shows another part of creation processing of an access information table. 撮影処理タスクを行うときのCPUの動作の一部を示すフロー図である。It is a flowchart which shows a part of operation | movement of CPU when performing an imaging | photography process task. 撮影処理タスクを行うときのCPUの動作の他の一部を示すフロー図である。It is a flowchart which shows a part of other operation | movement of CPU when performing an imaging | photography process task. 撮影処理タスクを行うときのCPUの動作のその他の一部を示すフロー図である。It is a flowchart which shows a part of other operation | movement of CPU when performing an imaging | photography process task. 撮影処理タスクを行うときのCPUの動作のさらにその他の一部を示すフロー図である。It is a flowchart which shows a part of further another operation | movement of CPU when performing a photographing process task. 撮影処理タスクを行うときのCPUの動作の他の一部を示すフロー図である。It is a flowchart which shows a part of other operation | movement of CPU when performing an imaging | photography process task. 撮影処理タスクを行うときのCPUの動作のその他の一部を示すフロー図である。It is a flowchart which shows a part of other operation | movement of CPU when performing an imaging | photography process task. 撮影処理タスクを行うときのCPUの動作のさらにその他の一部を示すフロー図である。It is a flowchart which shows a part of further another operation | movement of CPU when performing a photographing process task. BG処理タスクを行うときのCPUの動作の一部を示すフロー図である。It is a flowchart which shows a part of operation | movement of CPU when performing a BG processing task. BG処理タスクを行うときのCPUの動作の他の一部を示すフロー図である。It is a flowchart which shows another part of operation | movement of CPU when performing a BG processing task.

符号の説明Explanation of symbols

10…ディジタルビデオカメラ
12…イメージセンサ
22,38,40…信号処理回路
26…SDRAM
32…JPEGコーデック
34…マイク
44…記録媒体
52…CPU
DESCRIPTION OF SYMBOLS 10 ... Digital video camera 12 ... Image sensor 22, 38, 40 ... Signal processing circuit 26 ... SDRAM
32 ... JPEG codec 34 ... Microphone 44 ... Recording medium 52 ... CPU

Claims (5)

マルチタスクOSを搭載したプロセサを備え、動画像を形成する複数画面の画像データを圧縮状態で記録媒体に記録する動画像記録装置において、
前記プロセサによって実行される複数のタスクは、画像データの圧縮処理に関与する第1タスク、および圧縮画像データの記録処理に関与する第2タスクを含み、
前記第1タスクは第1数の画面に相当する画像データが圧縮される毎に当該第1数の画面に相当する圧縮画像データのサイズに相当する値を所定パラメータ値に加算する加算処理を含み、
前記第2タスクは第2数の画面に相当する圧縮画像データが記録される毎に、当該第2の画面に相当する圧縮画像データのサイズに相当する値を前記所定パラメータ値から減算する減算処理を含み、そして
前記第1タスクは画像データの圧縮率を前記所定パラメータ値が大きくなるほど高くなるように変更する変更処理をさらに含むことを特徴とする、動画像記録装置。
In a moving image recording apparatus that includes a processor equipped with a multitask OS and records image data of a plurality of screens forming a moving image on a recording medium in a compressed state.
The plurality of tasks executed by the processor includes a first task related to the compression processing of image data and a second task related to the recording processing of compressed image data,
The first task includes an addition process for adding a value corresponding to the size of the compressed image data corresponding to the first number of screens to a predetermined parameter value each time image data corresponding to the first number of screens is compressed. ,
The second task subtracts a value corresponding to the size of compressed image data corresponding to the second screen from the predetermined parameter value every time compressed image data corresponding to the second number of screens is recorded. And the first task further includes a change process for changing the compression rate of the image data so as to increase as the predetermined parameter value increases.
前記第2タスクは圧縮画像データを規定量ずつ前記記録媒体に転送する転送処理を含む、請求項1記載の動画像記録装置。   The moving image recording apparatus according to claim 1, wherein the second task includes a transfer process for transferring the compressed image data to the recording medium by a specified amount. 前記複数画面の画像データを取り込み条件に従って取り込む取り込み手段をさらに備え、
前記複数のタスクは前記取り込み条件の調整に関与する第3タスクをさらに含む、請求項1または2記載の動画像記録装置。
Further comprising a capturing means for capturing the image data of the plurality of screens according to a capturing condition;
The moving image recording apparatus according to claim 1, wherein the plurality of tasks further includes a third task related to adjustment of the capturing condition.
前記取り込み手段は被写体を撮影する撮影手段を含み、
前記取り込み条件は前記撮影手段の撮影条件を含む、請求項3記載の動画像記録装置。
The capturing means includes photographing means for photographing a subject,
The moving image recording apparatus according to claim 3, wherein the capturing condition includes a photographing condition of the photographing unit.
前記所定パラメータ値は圧縮されたが未だ記録されていない画像データのサイズを示す、請求項1ないし4のいずれかに記載の動画像記録装置。   5. The moving image recording apparatus according to claim 1, wherein the predetermined parameter value indicates a size of image data that has been compressed but not yet recorded.
JP2008170055A 2008-06-30 2008-06-30 Video recording device Expired - Fee Related JP4717101B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008170055A JP4717101B2 (en) 2008-06-30 2008-06-30 Video recording device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008170055A JP4717101B2 (en) 2008-06-30 2008-06-30 Video recording device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2002263769A Division JP4179831B2 (en) 2002-09-10 2002-09-10 Video recording device

Publications (2)

Publication Number Publication Date
JP2008263647A JP2008263647A (en) 2008-10-30
JP4717101B2 true JP4717101B2 (en) 2011-07-06

Family

ID=39985737

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008170055A Expired - Fee Related JP4717101B2 (en) 2008-06-30 2008-06-30 Video recording device

Country Status (1)

Country Link
JP (1) JP4717101B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000253360A (en) * 1999-03-04 2000-09-14 Matsushita Electric Ind Co Ltd Signal recorder
JP2002237984A (en) * 2002-01-23 2002-08-23 Sanyo Electric Co Ltd Digital camera

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000253360A (en) * 1999-03-04 2000-09-14 Matsushita Electric Ind Co Ltd Signal recorder
JP2002237984A (en) * 2002-01-23 2002-08-23 Sanyo Electric Co Ltd Digital camera

Also Published As

Publication number Publication date
JP2008263647A (en) 2008-10-30

Similar Documents

Publication Publication Date Title
US9270968B2 (en) Imaging apparatus and reproducing apparatus which changes frame rate based on zoom operation
JP4179831B2 (en) Video recording device
JP2005260970A (en) Combination camera and dsc lens control method using the same
WO2006129868A1 (en) Imaging device, imaging result processing method, image processing device, program for imaging result processing method, recording medium having program for imaging result processing method recorded therein, and imaging result processing system
JP2007208849A (en) Moving picture reproducing device and its program
JP4556195B2 (en) Imaging device, moving image playback device, and program
JP4162454B2 (en) Data processing device
JP4992639B2 (en) Content shooting device
JP2010074323A (en) Recording apparatus and method, and recording and playback apparatus and method
KR100564186B1 (en) Electronic camera
JP2006211324A (en) Digital camera apparatus, method and program for reproducing image, and data structure
WO2004114656A1 (en) Method for managing recording apparatus and recording medium
US20060013561A1 (en) Content editing device
JP4717101B2 (en) Video recording device
JP2010021819A (en) Image display apparatus, image display method, and program
JP2018074523A (en) Imaging device, control method thereof, program, and recording medium
JP6463967B2 (en) Imaging apparatus and control method thereof
JP2008113111A (en) Recording device
JP6332963B2 (en) Image processing apparatus and image processing apparatus control method
JP2003134515A (en) Image processing apparatus
JP4222901B2 (en) Data processing device
JP2005303807A (en) Photography-taking apparatus and method and program
JP5269639B2 (en) Imaging apparatus and communication system
JP4270221B2 (en) Electronic camera
JP2003111025A (en) Moving picture recording and reproducing device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100914

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101124

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110301

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110329

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

Free format text: PAYMENT UNTIL: 20140408

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140408

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

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

Free format text: PAYMENT UNTIL: 20140408

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees