JP2014033333A - Image pickup device and image compression method - Google Patents

Image pickup device and image compression method Download PDF

Info

Publication number
JP2014033333A
JP2014033333A JP2012172531A JP2012172531A JP2014033333A JP 2014033333 A JP2014033333 A JP 2014033333A JP 2012172531 A JP2012172531 A JP 2012172531A JP 2012172531 A JP2012172531 A JP 2012172531A JP 2014033333 A JP2014033333 A JP 2014033333A
Authority
JP
Japan
Prior art keywords
image
data
image data
sub
still image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012172531A
Other languages
Japanese (ja)
Inventor
Norio Kurashige
規夫 倉重
Nobuyuki Matsukawa
信行 松川
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.)
JVCKenwood Corp
Original Assignee
JVCKenwood Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JVCKenwood Corp filed Critical JVCKenwood Corp
Priority to JP2012172531A priority Critical patent/JP2014033333A/en
Publication of JP2014033333A publication Critical patent/JP2014033333A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To generate an image compression package in a short time (suitably in real time) while also restraining an increase in circuit scale.SOLUTION: A JPEG encoder 23a compresses main image data while processing an effective area in a still picture frame and compresses sub-image data while processing a blanking area in a still picture frame. A CPU 15 writes the main image compressed data derived by compressing the main image data into the work area in a DDR main memory 16 after compression. The CPU 15 writes the sub-image compressed data derived by compressing the sub-image data and prescribed header data while processing a blanking area in the still picture frame to generate a compressed package and then stores the generated package in the DDR main memory 16.

Description

本発明は、撮像装置、画像圧縮方法に関し、特に、リアルタイムにエンコードした静止画データを取得するのに好適な撮像装置、画像圧縮方法に関する。   The present invention relates to an imaging apparatus and an image compression method, and more particularly, to an imaging apparatus and an image compression method suitable for acquiring still image data encoded in real time.

デジタルカメラ又はデジタルビデオカメラ等において、静止画を撮影しファイル化する際に、画像データを非圧縮のファイルで保存したり、JPEG(Joint Photographic Experts Group)形式等の圧縮データにして保存するのが一般的である。それらファイル化の際、通常、撮像素子同等の解像度を有するメインの画像のほかにサムネイルと呼ばれるインデックス用の副画像(水平160画素×垂直120画素)を同時にファイルにパッケージする。これにより、副画像を静止画再生時に画像サイズの小さいインデックス用の画像として表示し、ユーザが静止画を確認して効率よく選択することができる。これはデジタルカメラ用の画像ファイル規格であるEXIF(Exchangeable Image File Format)等に規定されている。 When a still image is taken and filed in a digital camera or digital video camera, the image data is saved as an uncompressed file or saved as compressed data in JPEG (Joint Photographic Experts Group) format, etc. It is common. When making these files, normally, in addition to the main image having a resolution equivalent to that of the image sensor, an index sub-image called a thumbnail (horizontal 160 pixels × vertical 120 pixels) is simultaneously packaged in a file. Accordingly, the sub-image can be displayed as an index image having a small image size when the still image is reproduced, and the user can check the still image and efficiently select it. This is defined in EXIF (Exchangeable Image File Format) which is an image file standard for digital cameras.

通常、静止画撮影をする際には、撮像素子等を介して取得された画像データを一度メインメモリに格納し、画質補正等を行った後にJPEG等の形式で圧縮して主画像ストリームを生成する。更に、必要に応じてメインメモリの画像をサムネイル用のサイズに変換してJPEG等の形式で圧縮してサムネイル用のストリームを生成する。そして、これらをEXIFとしてパッケージすることで一般的なJPEGファイルが生成される。この一連の処理(以下、静止画エンコード処理という。)においては、
(1)メインメモリへの画像データの書き込み処理
(2)メインメモリから画像データを読み出しながら、読み出された画像データをJPEG形式へエンコード処理
(3)エンコード処理されたデータのメインメモリへのストリームの書き込み処理
等の処理によりメインメモリに対するアクセスが多数発生するため、メモリバス帯域を圧迫する。このため、メモリ処理クロック周波数を高くしたりバス幅を広げたりする必要が生じ、その結果として、コストが高くなったり、消費電力が増加する等の問題点があった。
Normally, when taking a still image, the image data acquired via the image sensor is stored in the main memory, and after correcting the image quality, it is compressed in a format such as JPEG to generate the main image stream. To do. Further, if necessary, the main memory image is converted into a thumbnail size and compressed in a format such as JPEG to generate a thumbnail stream. Then, by packaging these as EXIF, a general JPEG file is generated. In this series of processing (hereinafter referred to as still image encoding processing),
(1) Processing for writing image data to main memory (2) While reading image data from main memory, encoding processing of read image data to JPEG format (3) Stream of encoded data to main memory Since a large number of accesses to the main memory are generated by the process such as the write process, the memory bus band is compressed. For this reason, it is necessary to increase the memory processing clock frequency or widen the bus width. As a result, there are problems such as an increase in cost and an increase in power consumption.

そこで本願発明者は、動画撮影と並行して、静止画データをリアルタイムにエンコードしてメインメモリに格納することが可能な撮像装置を発明した(特許文献1)。当該撮像装置では、静止画データをメインメモリではなくラインメモリに一時保管し、当該ラインメモリから読み出した静止画データを圧縮処理している。また特許文献1には、主画像用のJPEGエンコーダと副画像用のJPEGエンコーダを備え、主画像とサムネイルを並列して圧縮する構成も記載されている。当該構成により、リアルタイムでのEXIFファイルの生成を実現している。   Accordingly, the inventor of the present application has invented an imaging device capable of encoding still image data in real time and storing it in a main memory in parallel with moving image shooting (Patent Document 1). In the imaging apparatus, still image data is temporarily stored in the line memory instead of the main memory, and the still image data read from the line memory is compressed. Japanese Patent Application Laid-Open No. 2004-228561 also describes a configuration in which a JPEG encoder for a main image and a JPEG encoder for a sub image are provided and a main image and a thumbnail are compressed in parallel. With this configuration, real-time EXIF file generation is realized.

特願2011−033978号Japanese Patent Application No. 2011-033978

上述のように本願発明者は、主画像用のJPEGエンコーダと副画像用のJPEGエンコーダを備え、主画像とサムネイルを並列して圧縮して画像圧縮パッケージ(たとえばEXIFパッケージ)を生成する撮像装置を発明した。一般的にJPEGエンコーダは、ハードウェア(いわゆる回路)により構成する。そのため、上述の撮像装置には、2つのエンコーダを用いることにより回路規模が増大してしまうという問題があった。   As described above, the inventor of the present application includes an imaging device that includes a JPEG encoder for a main image and a JPEG encoder for a sub image, and generates an image compression package (for example, an EXIF package) by compressing the main image and the thumbnail in parallel. Invented. In general, a JPEG encoder is configured by hardware (a so-called circuit). For this reason, the above-described imaging apparatus has a problem that the circuit scale is increased by using two encoders.

すなわち、従来の技術では回路規模の増大を抑止し、かつ、短い時間(好適にはリアルタイム)で画像圧縮パッケージを生成することが出来ないという問題があった。   That is, the conventional technique has a problem that an increase in circuit scale is suppressed and an image compression package cannot be generated in a short time (preferably in real time).

そこで、本発明は、撮像素子(12)と、前記撮像素子(12)により取得された動画像データから任意のタイミングで静止画フレームを取得する静止画フレーム取得部と、前記静止画フレーム取得部により取得された静止画フレームのサイズをリアルタイムに変換して主画像データを生成する主画像サイズ変換部(21a)と、前記静止画フレーム取得部により取得された静止画フレームのサイズをリアルタイムに変換して副画像データを生成する副画像サイズ変換部(21b)と、前記主画像データを格納する第1ラインメモリ(22a)と、前記副画像データを格納する第2ラインメモリ(22b)と、前記第1または第2ラインメモリ(22a、22b)に格納されたデータを圧縮処理する静止画圧縮部(23a)と、前記静止画圧縮部(23a)が圧縮した圧縮データを用いて圧縮パッケージを生成するCPU(15)と、前記圧縮パッケージの生成のワークエリアとして機能するとともに、各種データを格納するメインメモリ(16)と、を有し、前記静止画圧縮部(23a)は、前記静止画フレーム内の有効エリア処理中に前記主画像データを圧縮し、前記静止画フレーム内のブランキングエリア処理中に前記副画像データを圧縮し、前記CPU(15)は、前記静止画フレーム内の有効エリア処理中に、前記ワークエリアに前記主画像データを圧縮した主画像圧縮データを書き込んでいき、前記静止画フレーム内のブランキングエリア処理中に、前記副画像データを圧縮した副画像圧縮データと、所定のヘッダデータと、を書き込むことにより前記圧縮パッケージを生成して前記メインメモリ(16)に格納する撮像装置(1)を提供する。
上記撮像装置(1)において、前記CPU(15)は、前記静止画圧縮部(23a)による前副画像データの圧縮処理と並行して、前記ヘッダデータ、及び前記主画像データを圧縮した主画像圧縮データを、前記圧縮パッケージの生成に用いる前記ワークエリアに書き込んでもよい。
上記撮像装置(1)において、前記静止画圧縮部(23a)は、前記主画像データと前記主画像圧縮データから算出する圧縮率、前記主画像の圧縮に用いた量子化テーブル、前記ワークエリア内の副画像用の領域サイズ、及び前記副画像データのデータサイズを基に前記副画像データの圧縮に用いる量子化テーブルを調整してもよい。
上記撮像装置(1)において、前記CPU(15)は、前記ワークエリアの内の副画像用の領域に前記副画像圧縮データを書き込み、空き領域が生じた場合には当該空き領域に無効データを書き込んでもよい。
上記撮像装置(1)において、前記メインメモリ(16)に格納された動画像データを圧縮処理する動画圧縮部(20)を更に備え、前記動画圧縮部(20)は、前記主画像データと前記主画像圧縮データから算出する圧縮率、及び前記主画像の圧縮に用いた量子化テーブルに基づいて動画圧縮率を推定してもよい。
上記撮像装置(1)において、前記動画圧縮部(20)は、前記主画像データと前記主画像圧縮データから算出する圧縮率、及び前記主画像の圧縮に用いた量子化テーブルに基づいて、動画圧縮に用いる量子化テーブルを調整してもよい。
上記撮像装置(1)において、前記ワークエリアの内の副画像用の領域は、固定サイズであってもよい。
本願発明にかかる画像圧縮方法の一態様は、撮像素子により取得された動画像データから任意のタイミングで静止画フレームを取得する静止画フレーム取得ステップと、前記静止画フレーム取得ステップにて取得された静止画フレームのサイズをリアルタイムに変換して主画像データを生成する主画像サイズ変換ステップと、前記静止画フレーム取得ステップにて取得された静止画フレームのサイズをリアルタイムに変換して副画像データを生成する副画像サイズ変換ステップと、第1または第2ラインメモリに格納された前記主画像データまたは前記副画像データを圧縮処理する静止画圧縮ステップと、前記静止画圧縮ステップにおいて圧縮した圧縮データを用いて圧縮パッケージを生成するパッケージステップと、を有し、前記静止画圧縮ステップでは、前記静止画フレーム内の有効エリア処理中に前記主画像データを圧縮し、前記静止画フレーム内のブランキングエリア処理中に前記副画像データを圧縮し、前記パッケージステップでは、前記静止画フレーム内の有効エリア処理中にメインメモリ内のワークエリアに前記主画像データを圧縮した主画像圧縮データを書き込んでいき、前記静止画フレーム内のブランキングエリア処理中に、前記副画像データを圧縮した副画像圧縮データと、所定のヘッダデータと、を書き込むことにより前記圧縮パッケージを生成する、ことを特徴とする。
Therefore, the present invention provides an image sensor (12), a still image frame acquisition unit that acquires a still image frame from the moving image data acquired by the image sensor (12) at an arbitrary timing, and the still image frame acquisition unit. A main image size conversion unit (21a) that converts the size of the still image frame acquired by the above in real time to generate main image data, and converts the size of the still image frame acquired by the still image frame acquisition unit in real time. A sub-image size converter (21b) for generating sub-image data, a first line memory (22a) for storing the main image data, a second line memory (22b) for storing the sub-image data, A still image compression unit (23a) for compressing data stored in the first or second line memory (22a, 22b), and the still image pressure A CPU (15) that generates a compressed package using the compressed data compressed by the unit (23a), and a main memory (16) that functions as a work area for generating the compressed package and stores various data. The still image compression unit (23a) compresses the main image data during effective area processing in the still image frame, and compresses the sub-image data during blanking area processing in the still image frame. The CPU (15) writes compressed main image data obtained by compressing the main image data into the work area during the effective area processing in the still image frame, and performs blanking area processing in the still image frame. In the compressed package, the sub-image compressed data obtained by compressing the sub-image data and predetermined header data are written. It generates and provides an imaging apparatus (1) for storing the main memory (16).
In the imaging apparatus (1), the CPU (15) compresses the header data and the main image data in parallel with the compression process of the previous sub-image data by the still image compression unit (23a). The compressed data may be written in the work area used for generating the compressed package.
In the imaging apparatus (1), the still image compression unit (23a) includes the main image data and a compression ratio calculated from the main image compression data, a quantization table used for compression of the main image, and the work area. The quantization table used for compression of the sub-image data may be adjusted based on the sub-image area size and the data size of the sub-image data.
In the imaging apparatus (1), the CPU (15) writes the compressed sub-image data in a sub-image area in the work area, and when an empty area is generated, invalid data is written in the empty area. You may write.
The imaging apparatus (1) further includes a moving image compression unit (20) that compresses moving image data stored in the main memory (16), and the moving image compression unit (20) includes the main image data and the The moving image compression rate may be estimated based on the compression rate calculated from the main image compression data and the quantization table used for compression of the main image.
In the imaging apparatus (1), the moving image compression unit (20) moves the moving image based on the main image data, a compression ratio calculated from the main image compressed data, and a quantization table used for compression of the main image. You may adjust the quantization table used for compression.
In the imaging apparatus (1), the sub-image area in the work area may be a fixed size.
One aspect of the image compression method according to the present invention is acquired by a still image frame acquisition step of acquiring a still image frame from moving image data acquired by an image sensor at an arbitrary timing, and the still image frame acquisition step. A main image size converting step for generating main image data by converting the size of the still image frame in real time, and sub image data by converting the size of the still image frame acquired in the still image frame acquiring step in real time. A sub image size conversion step to be generated; a still image compression step for compressing the main image data or the sub image data stored in the first or second line memory; and the compressed data compressed in the still image compression step. Using a package step to generate a compressed package, wherein the still image pressure In the step, the main image data is compressed during the effective area processing in the still image frame, and the sub-image data is compressed in the blanking area processing in the still image frame. In the packaging step, the still image The main image compressed data obtained by compressing the main image data is written into the work area in the main memory during the effective area processing in the frame, and the sub image data is compressed during the blanking area processing in the still image frame. The compressed package is generated by writing the compressed sub-image data and predetermined header data.

本発明では、回路規模の増大を抑止し、かつ、短い時間(好適にはリアルタイム)で画像圧縮パッケージを生成する撮像装置及び撮像方法を提供することができる。   According to the present invention, it is possible to provide an imaging device and an imaging method that suppress an increase in circuit scale and generate an image compression package in a short time (preferably in real time).

実施の形態1にかかる撮像装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of an imaging apparatus according to a first embodiment. 実施の形態1にかかる静止画フレームのリアルタイム記録処理を実現する基本構成を示す図である。FIG. 3 is a diagram illustrating a basic configuration for realizing real-time recording processing of a still image frame according to the first embodiment; 実施の形態1にかかる静止画リアルタイム処理部の構成を示すブロック図である。2 is a block diagram illustrating a configuration of a still image real-time processing unit according to the first embodiment; FIG. 実施の形態1にかかる静止画リアルタイム処理部の構成を示すブロック図である。2 is a block diagram illustrating a configuration of a still image real-time processing unit according to the first embodiment; FIG. 実施の形態1にかかる静止画リアルタイム処理部の構成を示すブロック図である。2 is a block diagram illustrating a configuration of a still image real-time processing unit according to the first embodiment; FIG. 実施の形態1にかかる量子化テーブルの一例を示す図である。It is a figure which shows an example of the quantization table concerning Embodiment 1. FIG. 実施の形態1にかかるサイズ変換部の構成を示すブロック図である。FIG. 3 is a block diagram showing a configuration of a size conversion unit according to the first exemplary embodiment. 実施の形態1にかかる撮像装置の各期間(有効期間、ブランキング期間)における各処理部の動作を示すタイミングチャートである。4 is a timing chart illustrating the operation of each processing unit in each period (effective period, blanking period) of the imaging apparatus according to the first embodiment. 実施の形態1にかかるDDRメインメモリのワークエリアの構成を示す概念図である。FIG. 3 is a conceptual diagram illustrating a configuration of a work area of a DDR main memory according to the first embodiment. 実施の形態1にかかる撮像装置のブランキング期間における各処理部の動作を示すタイミングチャートである。3 is a timing chart illustrating the operation of each processing unit during a blanking period of the imaging apparatus according to the first embodiment; 実施の形態1にかかる撮像装置のブランキング期間における各処理部の動作を示すタイミングチャートである。3 is a timing chart illustrating the operation of each processing unit during a blanking period of the imaging apparatus according to the first embodiment; 実施の形態1にかかる量子化テーブルの一例を示す図である。It is a figure which shows an example of the quantization table concerning Embodiment 1. FIG. 実施の形態1にかかる量子化テーブルの一例を示す図である。It is a figure which shows an example of the quantization table concerning Embodiment 1. FIG. 実施の形態1にかかる量子化テーブルの一例を示す図である。It is a figure which shows an example of the quantization table concerning Embodiment 1. FIG. 実施の形態1にかかるDDRメインメモリのワークエリアの状態を示す概念図である。FIG. 3 is a conceptual diagram showing a state of a work area of a DDR main memory according to the first embodiment. 実施の形態1にかかるDDRメインメモリのワークエリアの状態を示す概念図である。FIG. 3 is a conceptual diagram showing a state of a work area of a DDR main memory according to the first embodiment. 実施の形態1にかかるDDRメインメモリのワークエリアの状態を示す概念図である。FIG. 3 is a conceptual diagram showing a state of a work area of a DDR main memory according to the first embodiment.

<実施の形態1>
以下、図面を参照して本発明の実施の形態について説明する。図1は、本実施の形態にかかる撮像装置を示すブロック図である。本実施の形態にかかる撮像装置1は、撮像素子を介して動画像データを取得しつつ、ユーザの指示に基づく任意のタイミングで動画像データから静止画フレームを取得し、その静止画フレームをリアルタイムでエンコード(圧縮)処理を行うものである。ここで、リアルタイムでのエンコード処理とは、動画像データ(カメラ画像)の入力フレームレートと同じフレームレートで静止画フレームのエンコード処理、例えばJPEGエンコード処理を行うこという。また、以下の説明では、静止画フレームは、ユーザの指示に基づく任意のタイミングで取得されるものとして説明するが、例えば、「静止画フレーム自動取得モード」等を用意し、被写体の笑顔等、特定の対象を自動で検知し、当該検知結果に応じて自動で静止画フレームを取得するようにしてもよい。
<Embodiment 1>
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing an imaging apparatus according to the present embodiment. The image capturing apparatus 1 according to the present embodiment acquires still image frames from moving image data at an arbitrary timing based on a user instruction while acquiring moving image data via an image sensor, and converts the still image frames into real time. The encoding (compression) processing is performed by Here, real-time encoding processing refers to performing still image frame encoding processing, for example, JPEG encoding processing, at the same frame rate as the input frame rate of moving image data (camera image). Further, in the following description, the still image frame is described as being acquired at an arbitrary timing based on the user's instruction, but for example, a “still image frame automatic acquisition mode” is prepared, A specific target may be automatically detected, and a still image frame may be automatically acquired according to the detection result.

上記動作を実現するため、撮像装置1は、レンズ11及びレンズを通じて入射した入射光を光電変換し画像データを生成する撮像素子12等からなる撮像部を有する。さらに、撮像装置1は、DDR(Double-Data-Rate)メインメモリ16、動画コーデック20、ラインメモリ22、及びJPEGコーデック23を有している。これらDDRメインメモリ16、動画コーデック20、ラインメモリ22、及びJPEGコーデック23は、それぞれバス10を介して接続される。   In order to realize the above-described operation, the imaging device 1 includes an imaging unit including a lens 11 and an imaging element 12 that photoelectrically converts incident light incident through the lens and generates image data. Furthermore, the imaging apparatus 1 includes a DDR (Double-Data-Rate) main memory 16, a moving image codec 20, a line memory 22, and a JPEG codec 23. The DDR main memory 16, the moving image codec 20, the line memory 22, and the JPEG codec 23 are connected via the bus 10.

DDRメインメモリ16には、撮像素子12により取得された動画像データが書き込まれる。動画コーデック20は、DDRメインメモリ16に書き込まれた動画像データを圧縮処理する動画圧縮部として機能する。動画コーデック20は、さらに、圧縮された画像データを伸張する動画像伸張部としても機能する、撮像素子12から取得された動画像データは一旦DDRメインメモリ16に書き込みされ、その後に動画コーデック20によりエンコード処理される。   In the DDR main memory 16, moving image data acquired by the image sensor 12 is written. The moving image codec 20 functions as a moving image compression unit that compresses moving image data written in the DDR main memory 16. The moving image codec 20 also functions as a moving image expansion unit that expands the compressed image data. The moving image data acquired from the image sensor 12 is temporarily written in the DDR main memory 16 and then the moving image codec 20 Encoded.

一方、静止画の方は、静止画フレーム取得部(図示せず)により、撮像素子12で取得された動画像データから任意のタイミングで静止画フレームを取得し、ラインメモリ22にその静止画フレームの一部である静止画データを格納する。なお、例えば1秒間に60フレームからなる動画像データの60フレーム全部を静止画データとして取得する場合は、カメラ信号処理部13からの動画像データを順次ラインメモリ22に格納すればよく、静止画フレーム取得部は不要である。また、ユーザの指示により任意のタイミングで静止画フレームを取得する場合は、例えばユーザが撮像装置1の図示しないシャッタボタンを押下したタイミングに基づき、動画像データから所定枚数の静止画フレームから得られる静止画データをラインメモリ22に入力できるようにスイッチ動作するスイッチ等により構成することができる。   On the other hand, for still images, a still image frame acquisition unit (not shown) acquires a still image frame from the moving image data acquired by the image sensor 12 at an arbitrary timing, and the still image frame is stored in the line memory 22. The still image data that is a part of is stored. For example, when all 60 frames of moving image data consisting of 60 frames per second are acquired as still image data, the moving image data from the camera signal processing unit 13 may be stored in the line memory 22 sequentially. A frame acquisition unit is unnecessary. Further, when a still image frame is acquired at an arbitrary timing in accordance with a user instruction, for example, it is obtained from a predetermined number of still image frames from moving image data based on the timing at which the user presses a shutter button (not shown) of the imaging apparatus 1. It can be configured by a switch or the like that performs a switch operation so that still image data can be input to the line memory 22.

また、JPEGコーデック23は、ラインメモリ22に格納された静止画データを圧縮処理する静止画圧縮部として機能する。JPEGコーデック23は、圧縮された静止画データを伸張する伸張部としても機能する。このJPEGコーデック23は、撮影中の動画像データのDDRメインメモリ16への書き込みと並行してリアルタイムで静止画データをエンコード処理する。このとき、DDRメインメモリ16は、動画像データが書き込まれると共に、JPEGコーデック23によりリアルタイムでエンコード処理されたエンコードデータが書き込まれる。   The JPEG codec 23 functions as a still image compression unit that compresses still image data stored in the line memory 22. The JPEG codec 23 also functions as a decompression unit that decompresses compressed still image data. The JPEG codec 23 encodes still image data in real time in parallel with the writing of moving image data being shot to the DDR main memory 16. At this time, the DDR main memory 16 is written with the moving image data and the encoded data encoded in real time by the JPEG codec 23.

このように構成された撮像装置1においては、動画像データから取得した静止画フレームをDDRメインメモリ16に書き込みせずに、直接リアルタイムにエンコードしてからDDRメインメモリ16に書き込みする。DDRメインメモリ16に撮像画像から取得された静止画フレーム(以下、非圧縮の画像データを生データともいう。)を書き込みせず、エンコードしてから書き込みするようにすることで、DDRメインメモリ16のバス10のバス帯域に対する負荷を低減する。このことにより、多画素の画像サイズの静止画データを1秒間に60フレーム等の速度で高速撮影処理することが可能となる。   In the imaging device 1 configured as described above, the still image frame acquired from the moving image data is directly written in real time without being written in the DDR main memory 16 and then written in the DDR main memory 16. The DDR main memory 16 is configured such that a still image frame (hereinafter referred to as uncompressed image data is also referred to as raw data) acquired from the captured image is encoded and then written to the DDR main memory 16 without being written. The load on the bus bandwidth of the bus 10 is reduced. This makes it possible to perform high-speed shooting processing of still image data having a multi-pixel image size at a speed of 60 frames per second.

以下、本実施の形態にかかる撮像装置1について更に詳細に説明する。撮像装置1は、さらに、カメラ信号処理部13と、カメラ信号処理部13の制御のもと、レンズ11のズーム倍率や焦点距離を制御するズーム・フォーカス制御部14を有する。また、各ブロックを制御するCPU(Central Processing Unit)15、SDカード(SD Memory Card)17、及びUSB(Universal Serial Bus)18を有する。さらに、サイズ変換部19、サイズ変換部21、ビデオ信号処理部24、HDMI(High-Definition Multimedia Interface)25及びLCD(Liquid Crystal Display:液晶ディスプレイ)26等を有する。各処理部は、バス10を介して接続されている。   Hereinafter, the imaging apparatus 1 according to the present embodiment will be described in more detail. The imaging apparatus 1 further includes a camera signal processing unit 13 and a zoom / focus control unit 14 that controls the zoom magnification and focal length of the lens 11 under the control of the camera signal processing unit 13. In addition, a CPU (Central Processing Unit) 15, an SD card (SD Memory Card) 17, and a USB (Universal Serial Bus) 18 that control each block are included. Furthermore, it has a size conversion unit 19, a size conversion unit 21, a video signal processing unit 24, an HDMI (High-Definition Multimedia Interface) 25, an LCD (Liquid Crystal Display) 26, and the like. Each processing unit is connected via a bus 10.

カメラ信号処理部13は、図示しない同期信号発生部やY/C処理部等を有している。同期信号発生部は、生成される画像データの水平サイズ及び垂直サイズに対応し、かつ内部クロックに同期した水平同期信号及び垂直同期信号を生成する。撮像部からの画像データは、この水平同期信号及び垂直同期信号に同期した画像データをカメラ信号処理部13に入力する。Y/C処理部では、撮像部により生成された複数の画像データを順次Y/C処理する。Y/C処理とは画像データを輝度データ(Y)と色データ(C)に分離、変換する処理である。すなわち、カメラ信号処理部13は、撮像データから色分離、白バランス調整、及びY/C処理等の一連のカメラ信号処理した(動)画像データを出力する。   The camera signal processing unit 13 includes a synchronization signal generation unit, a Y / C processing unit, and the like (not shown). The synchronization signal generation unit generates a horizontal synchronization signal and a vertical synchronization signal corresponding to the horizontal size and vertical size of the generated image data and synchronized with the internal clock. As image data from the imaging unit, image data synchronized with the horizontal synchronization signal and the vertical synchronization signal is input to the camera signal processing unit 13. The Y / C processing unit sequentially Y / C-processes a plurality of image data generated by the imaging unit. Y / C processing is processing for separating and converting image data into luminance data (Y) and color data (C). That is, the camera signal processing unit 13 outputs (moving) image data obtained by performing a series of camera signal processing such as color separation, white balance adjustment, and Y / C processing from the captured data.

サイズ変換部19は、カメラ信号処理部13から出力される動画像データのサイズを変換する。この動画像データは、一旦DDRメインメモリ16に書き込みされる。   The size conversion unit 19 converts the size of the moving image data output from the camera signal processing unit 13. This moving image data is once written in the DDR main memory 16.

動画コーデック20は、記録時には、上述したように、一旦DDRメインメモリ16に書き込みされた動画像データを、例えばH.264/AVC規格やMPEG2規格に準じた形式でエンコード処理を実施する。このエンコードの際に、動画コーデック20は、内部に管理する量子化テーブルを参照してエンコード処理を行う。エンコード後のエンコードデータはDDRメインメモリ16に書き込みされ、必要に応じてSDカード17等の外部メモリに転送される。また、再生時には、例えばSDカード17等の外部メモリから読み出され、DDRメインメモリ16に書き込みされたエンコード済み動画像データに対してデコード処理を実施する。   As described above, the moving image codec 20 encodes the moving image data once written in the DDR main memory 16 in a format conforming to, for example, the H.264 / AVC standard or the MPEG2 standard. At the time of encoding, the moving image codec 20 performs an encoding process with reference to an internally managed quantization table. The encoded data after encoding is written in the DDR main memory 16 and transferred to an external memory such as the SD card 17 as necessary. Further, at the time of reproduction, a decoding process is performed on encoded moving image data read from an external memory such as the SD card 17 and written in the DDR main memory 16, for example.

SDカード17は、大容量の外部記憶媒体であり、このSDカード17に動画像データや静止画データが書き込まれ、LCD26により表示する等することができる。SDカード17に格納されている画像データは、一旦DDRメインメモリ16に書き込みされ、動画コーデック20によりデコードされ、ビデオ信号処理部24を介してLCD26に出力されたり、HDMI25を介して出力されることができる。また、撮像装置1は、USB18を介して様々な周辺機器に接続される。   The SD card 17 is a large-capacity external storage medium, and moving image data and still image data are written to the SD card 17 and can be displayed on the LCD 26. The image data stored in the SD card 17 is once written in the DDR main memory 16, decoded by the moving image codec 20, output to the LCD 26 via the video signal processing unit 24, or output via the HDMI 25. Can do. In addition, the imaging device 1 is connected to various peripheral devices via the USB 18.

ビデオ信号処理部24は、デコードした画像データをHDMI25やLCD26に応じた形式の出力データに変換する一連のビデオ信号処理を実施し、LCD26を介して画像を表示したり、HDMI25を介してテレビモニタ等の外部モニタ装置等に画像データを出力する。   The video signal processing unit 24 performs a series of video signal processing for converting the decoded image data into output data in a format corresponding to the HDMI 25 or the LCD 26, and displays an image via the LCD 26 or a television monitor via the HDMI 25. The image data is output to an external monitor device or the like.

<通常撮影ルートと高速撮影ルート>
ところで、本実施の形態にかかる撮像装置1は、DDRメインメモリ16に書き込みされた生データ又はデコード済みの動画像データから静止画フレームを取得し、サイズ変換部21によりサイズ変換し、ラインメモリ22を介してJPEGコーデック23によりエンコードしてDDRメインメモリ16に書き込みするというルートも有している。
<Normal shooting route and high-speed shooting route>
By the way, the imaging apparatus 1 according to the present embodiment acquires a still image frame from raw data or decoded moving image data written in the DDR main memory 16, converts the size by the size conversion unit 21, and performs line memory 22. Via the JPEG codec 23 and writing to the DDR main memory 16.

つまり、DDRメインメモリ16は、撮像素子12により取得された動画像データ(第1動画像データ)又はSDカード17等の外部メモリから読み込まれたエンコード済み動画像データがデコードされた動画像データ(第2動画像データ)を書き込みする。この場合、第1動画像データ、第2動画像データについても、ユーザの指示等による任意のタイミングで静止画フレームが取得され、サイズ変換部21に出力される。そして、静止画フレームはサイズ変換部21によりその画像サイズが変換され、ラインメモリ22にその一部の静止画データが順次書き込みされ、JPEGコーデック23にて、ラインメモリ22に書き込みされた静止画データのエンコードを行ってDDRメインメモリ16にエンコードされたエンコードデータが出力される。なお、DDRメインメモリ16に書き込みされた生データ又はデコード済みの動画データ(第1及び第2動画像データ)から静止画フレームを取得する場合、ユーザが指定したタイミングのフレーム1枚のみならず、その近傍の複数枚のフレームを加重平均するなどして合成し1枚の静止画フレームを取得するようにしてもよい。   That is, the DDR main memory 16 decodes moving image data (first moving image data) acquired by the image sensor 12 or encoded moving image data read from an external memory such as the SD card 17 ( 2nd moving image data) is written. In this case, a still image frame is also acquired for the first moving image data and the second moving image data at an arbitrary timing according to a user instruction or the like, and is output to the size conversion unit 21. Then, the image size of the still image frame is converted by the size conversion unit 21, a part of the still image data is sequentially written in the line memory 22, and the still image data written in the line memory 22 by the JPEG codec 23. The encoded data encoded in the DDR main memory 16 is output. In addition, when acquiring a still image frame from raw data or decoded video data (first and second moving image data) written in the DDR main memory 16, not only one frame at a timing specified by the user, A plurality of neighboring frames may be combined by weighted averaging or the like to obtain one still image frame.

ここで、本実施の形態1にかかる撮像装置1のDDRメインメモリ16は、カメラ信号処理部13からDDRメインメモリ16を経由せずにJPEGエンコードする場合(以下、高速撮影ルートともいう。)にはラインメモリ22を3面で使用することが好ましく、DDRメインメモリ16を経由してJPEGエンコードする場合(以下、「通常ルート」ともいう。)は、ラインメモリ22の3面のうちの2面を使用するようにしてもよい。以下、本実施の形態1におけるラインメモリ22を3面構成とする理由について説明する。   Here, the DDR main memory 16 of the imaging apparatus 1 according to the first embodiment is used when JPEG encoding is performed from the camera signal processing unit 13 without passing through the DDR main memory 16 (hereinafter also referred to as a high-speed shooting route). It is preferable to use the line memory 22 on three sides. When JPEG encoding is performed via the DDR main memory 16 (hereinafter also referred to as “normal route”), two of the three sides of the line memory 22 are used. May be used. The reason why the line memory 22 in the first embodiment has a three-surface configuration will be described below.

通常ルートの場合、DDRメインメモリ16から生データを転送することになる。通常ルートの場合には、内部の処理部(例えば図示しないメモリコントローラ)がエンコード処理のタイミングを考慮して処理を行えば、2面構成でも問題は生じない。また、処理を決まった同期信号内で完結したい場合、バス帯域の優先度を上げてバス帯域を確保する、またはシステムの動作周波数を上げる、等の対応を取ればよい。   In the case of the normal route, raw data is transferred from the DDR main memory 16. In the case of the normal route, if the internal processing unit (for example, a memory controller (not shown)) performs the processing in consideration of the timing of the encoding processing, there is no problem even with the two-plane configuration. Further, when it is desired to complete the processing within a predetermined synchronization signal, measures such as increasing the priority of the bus band to secure the bus band or increasing the operating frequency of the system may be taken.

本実施の形態1にかかる撮像装置1の高速撮影ルート時のボトルネックの1つはJPEGコーデック23のエンコードの処理能力に依存する。JPEGコーデック23は、通常、
入力データ量>エンコードデータ量
の大小関係が成立するが、画像の複雑度によってはハフマン符号の割り当て等によりエンコードデータ量が多くなり上の式が逆転することがある。その場合、瞬間的に画像データのリード処理が滞りラインメモリ22の2面を使用するだけでは処理が破綻する可能性があり、ラインメモリ22を3面構成とする必要がある。言い換えればJPEGコーデック23において、
入力の転送レート<出力のデータ転送レート
の状態が常になりたてば2面構成のみでの処理が可能となる。しかし、瞬間的に
入力の転送レート>出力のデータ転送レート
の状態が発生する場合があり、このとき、ラインメモリ22を3面構成としておけば、画像データのリード処理が滞ってもそれを吸収することができる。
One of the bottlenecks at the time of the high-speed shooting route of the imaging apparatus 1 according to the first embodiment depends on the encoding processing capability of the JPEG codec 23. JPEG codec 23 is usually
The magnitude relationship of input data amount> encode data amount is established, but depending on the complexity of the image, the amount of encoded data increases due to the allocation of Huffman codes and the above equation may be reversed. In that case, the read processing of the image data is instantaneously delayed, and the processing may fail if only two surfaces of the line memory 22 are used, and the line memory 22 needs to have a three-surface configuration. In other words, in the JPEG codec 23,
If the state of the input transfer rate <the output data transfer rate is always maintained, the processing with only the two-surface configuration is possible. However, there is a case where the state of input transfer rate> output data transfer rate occurs instantaneously. In this case, if the line memory 22 has a three-surface configuration, even if the read processing of image data is delayed, it is absorbed. can do.

本実施の形態においては、動画撮影時に静止画を同時に取得する場合は、高速撮影ルートを通り、カメラ信号処理部13からの静止画データが直接エンコードされ、DDRメインメモリ16に書き込まれるため、従来のように生データが書き込まれる場合に比して、データ量を削減することができる。これにより、DDRメインメモリ16のバス10のバス帯域を確保することができ、毎秒60枚取得される静止画フレーム等のエンコード済みの静止画データのDDRメインメモリ16への書き込みが可能となる。   In the present embodiment, when still images are simultaneously acquired during moving image shooting, the still image data from the camera signal processing unit 13 is directly encoded and written to the DDR main memory 16 through the high-speed shooting route. Thus, the amount of data can be reduced as compared to the case where raw data is written. As a result, the bus bandwidth of the bus 10 of the DDR main memory 16 can be secured, and encoded still image data such as still image frames acquired 60 frames per second can be written to the DDR main memory 16.

ラインメモリを3面設けることにより、一部のラインメモリを、リアルタイムなエンコード処理時の処理レートの変動を吸収するバッファとして機能させると共に、エンコード処理後のエンコードデータがDDRメインメモリ16へ書き込みされる際のタイミングを調整するバッファとして機能させることができる。   By providing three line memories, some of the line memories function as a buffer that absorbs fluctuations in the processing rate during real-time encoding processing, and encoded data after encoding processing is written to the DDR main memory 16. It can function as a buffer for adjusting the timing.

<静止画フレームのリアルタイム記録処理>
本実施の形態にかかる撮像装置1は、上述したように、動画像の記録と並列して高速に静止画フレームをリアルタイムでエンコードして記録する処理(以下、高速撮影ルートで静止画フレームをエンコードする処理をリアルタイム記録処理ともいう。また、静止画フレームのエンコード処理をリアルタイムに実行する各処理部を総称して、静止画リアルタイム処理部という。)が可能な装置である。この静止画フレームのリアルタイム記録処理の詳細について説明する。
<Real-time recording processing of still image frames>
As described above, the imaging apparatus 1 according to the present embodiment encodes and records a still image frame in real time at a high speed in parallel with the recording of a moving image (hereinafter, the still image frame is encoded by a high-speed shooting route). This processing is also referred to as real-time recording processing, and each processing unit that executes still image frame encoding processing in real time is collectively referred to as a still image real-time processing unit. Details of the still image frame real-time recording process will be described.

図2は、静止画フレームのリアルタイム記録処理を実現する基本構成を示す図である。なお、図2及び後述する図3乃至図5において、図1に示す撮像装置1と同一の構成要素には同一の符号を付し、その詳細な説明を省略する。また、図2乃至図5においては、静止画フレームのリアルタイム記録処理を説明するために撮像装置の一部を抜き出して示している。また、サイズ変換部21等については、主画像用とサムネイル用のように複数配置される場合がある。更に詳細な構成は、図3等を参照して後述する。   FIG. 2 is a diagram showing a basic configuration for realizing real-time recording processing of a still image frame. 2 and FIGS. 3 to 5 described later, the same components as those of the imaging device 1 shown in FIG. 1 are denoted by the same reference numerals, and detailed description thereof is omitted. In FIGS. 2 to 5, a part of the imaging apparatus is extracted and illustrated in order to explain the real-time recording process of the still image frame. In addition, there may be a plurality of size conversion units 21 and the like arranged for main images and thumbnails. A more detailed configuration will be described later with reference to FIG.

図2に示すように、動画像と共に入力される静止画フレームD1についてのリアルタイム記録処理を実施するパス(高速撮影ルートR1)と、DDRメインメモリ16に書き込みされた生データ又はデコード済みの動画像データから取得した静止画フレームD2について、エンコードするパス(通常ルート)とを切り替えるセレクタ27を有している。なお図中の高速撮影ルートR1は、厳密には静止画フレームD1の有効エリアを処理している場合のデータの流れを示している(詳細は図3及び図4を参照して説明する)。   As shown in FIG. 2, a path (high-speed shooting route R1) for performing a real-time recording process for a still image frame D1 input together with a moving image, and raw data or a decoded moving image written in the DDR main memory 16 A selector 27 is provided for switching a path (normal route) for encoding the still image frame D2 acquired from the data. Strictly speaking, the high-speed shooting route R1 in the drawing shows the flow of data when the effective area of the still image frame D1 is processed (details will be described with reference to FIGS. 3 and 4).

高速撮影ルートR1において、撮像素子12より取得された動画像データから取得された静止画フレームをリアルタイムでエンコードする場合は、セレクタ27を介してこの静止画フレームD1が選択され、これがラインメモリ22に順次入力される。ラインメモリ22は、1フレーム分の静止画データ未満のデータを書き込みする。ラインメモリ22の詳細については後述する。ラインメモリ22の後段に配置されたJPEGエンコーダ23aは、ラインメモリ22から出力される静止画データをJPEG形式にエンコードして出力する。このエンコードデータはDDRメインメモリ16に書き込みされる。   When the still image frame acquired from the moving image data acquired from the image sensor 12 is encoded in real time in the high-speed shooting route R1, the still image frame D1 is selected via the selector 27, and this is stored in the line memory 22. Input sequentially. The line memory 22 writes data less than one frame of still image data. Details of the line memory 22 will be described later. The JPEG encoder 23a arranged at the subsequent stage of the line memory 22 encodes the still image data output from the line memory 22 into the JPEG format and outputs the encoded image. This encoded data is written into the DDR main memory 16.

一方、通常ルートの場合は、DDRメインメモリ16に書き込みされている生データの動画像データが使用される。この動画像データは、例えばレンズ11及び撮像素子12を介して取得された動画像データがDDRメインメモリ16に書き込みされたものである。または、SDカード17等の外部メモリから入力されたエンコード済み動画像データが一旦DDRメインメモリ16に書き込みされ、これが図1に示す動画コーデック20にてデコードされて再びDDRメインメモリ16に書き込みされたものである。いずれの場合も生データ又はデコード済みである非圧縮の動画像データである。   On the other hand, in the case of the normal route, the moving image data of raw data written in the DDR main memory 16 is used. The moving image data is obtained by writing moving image data acquired through, for example, the lens 11 and the image sensor 12 to the DDR main memory 16. Alternatively, encoded moving image data input from an external memory such as the SD card 17 is once written in the DDR main memory 16, decoded by the moving image codec 20 shown in FIG. 1, and written again in the DDR main memory 16. Is. In either case, it is raw data or uncompressed moving image data that has been decoded.

これらの動画像データに対しても、ユーザの指示に基づく任意のタイミングで静止画フレームが取得されてサイズ変換部21へ出力される。このDDRメインメモリ16からサイズ変換部21、ラインメモリ22を介してJPEGエンコーダ23aによりエンコード処理されるルートが通常ルートである。JPEGエンコーダ23aにてエンコードされたエンコード静止画データはDDRメインメモリ16に書き込みされる。   Also for these moving image data, a still image frame is acquired at an arbitrary timing based on a user instruction and output to the size conversion unit 21. A route that is encoded by the JPEG encoder 23a from the DDR main memory 16 via the size converter 21 and the line memory 22 is a normal route. The encoded still image data encoded by the JPEG encoder 23a is written into the DDR main memory 16.

<静止画リアルタイム処理部の構成>
続いて、静止画リアルタイム処理部の構成(図2の詳細構成)について図3及び図4を参照して説明する。図3は、静止画フレームの有効エリアを処理している際のデータの流れを示すブロック図である。有効エリア等の詳細については、後述する。静止画リアルタイム処理部は、カメラ信号処理部13を介して入力される動画像データから取得された静止画フレームのサイズをリアルタイムに変換して主画像データ及び副画像データを生成するそれぞれ主画像サイズ変換部21a及び副画像サイズ変換部21bを有する。
<Configuration of still image real-time processing unit>
Next, the configuration of the still image real-time processing unit (detailed configuration in FIG. 2) will be described with reference to FIGS. FIG. 3 is a block diagram showing a data flow when processing the effective area of the still image frame. Details of the effective area will be described later. The still image real-time processing unit converts the size of the still image frame acquired from the moving image data input via the camera signal processing unit 13 in real time to generate main image data and sub-image data, respectively. A conversion unit 21a and a sub-image size conversion unit 21b are included.

また、主画像サイズ変換部21a及び副画像サイズ変換部21bに対応して、それぞれラインメモリ22a、22bが設けられている。ラインメモリ22a、22bの動作はラインメモリ22と同様である。   Line memories 22a and 22b are provided corresponding to the main image size conversion unit 21a and the sub image size conversion unit 21b, respectively. The operations of the line memories 22a and 22b are the same as those of the line memory 22.

静止画リアルタイム処理部は、内部に1つのJPEGエンコーダ23aのみを有し、複数のJPEGエンコーダは備えない。前述のようにJPEGエンコーダ23aは、上述のJPEGコーデック23に対応し、一般的にハードウェア(回路)により構成される。   The still image real-time processing unit has only one JPEG encoder 23a inside, and does not include a plurality of JPEG encoders. As described above, the JPEG encoder 23a corresponds to the above-described JPEG codec 23 and is generally configured by hardware (circuit).

静止画リアルタイム処理部は、更に主画像制御部28a及び副画像制御部28bを備える。主画像制御部28aは、主画像サイズ変換部21a、ラインメモリ22a、及びJPEGエンコーダ23aの制御及びこれらの処理部とのデータやり取りを行う。同様に副画像制御部28bは、副画像サイズ変換部21b、ラインメモリ22b及びJPEGエンコーダ23aの制御の制御及びこれらの処理部とのデータやり取りを行う。例えば主画像制御部28a及び副画像制御部28bは、JPEGエンコーダ23aが静止画フレームの有効エリア(後述)の処理中であるか否かを示すフラグを管理する。なお、主画像制御部28a及び副画像制御部28bを一つの処理部として構成することも可能である。   The still image real-time processing unit further includes a main image control unit 28a and a sub image control unit 28b. The main image control unit 28a controls the main image size conversion unit 21a, the line memory 22a, and the JPEG encoder 23a and exchanges data with these processing units. Similarly, the sub image control unit 28b controls the sub image size conversion unit 21b, the line memory 22b, and the JPEG encoder 23a, and exchanges data with these processing units. For example, the main image control unit 28a and the sub image control unit 28b manage a flag indicating whether or not the JPEG encoder 23a is processing a valid area (described later) of a still image frame. The main image control unit 28a and the sub image control unit 28b can be configured as one processing unit.

セレクタ27は、カメラ信号処理部13からの動画像データから取得された静止画フレームD1が主画像サイズ変換部21aにより主画像サイズにサイズ変換されたもの、同じく静止画フレームD1が副画像サイズ変換部21bにより副画像サイズにサイズ変換されたもの、DDRメインメモリ16に書き込みされている生データ又はデコード済みの動画像データから取得された静止画フレームD2、又は同じくDDRメインメモリ16の生データ又はデコード済みの動画像データから取得された静止画フレームD3がサイズ変換部21a若しくはサイズ変換部21bによりサイズ変換された静止画データのいずれかを選択し、ラインメモリ22a又はラインメモリ22bに出力する。   The selector 27 converts the still image frame D1 acquired from the moving image data from the camera signal processing unit 13 into the main image size by the main image size conversion unit 21a, and the still image frame D1 also converts the sub image size. The sub image size converted by the unit 21b, the raw data written in the DDR main memory 16 or the still image frame D2 obtained from the decoded moving image data, or the raw data of the DDR main memory 16 or Either still image data obtained by converting the size of the still image frame D3 acquired from the decoded moving image data by the size conversion unit 21a or the size conversion unit 21b is selected and output to the line memory 22a or the line memory 22b.

本構成では、サイズ変換部21a、ラインメモリ22a及びJPEGコーデック23aにより、主画像サイズの静止画データのリアルタイムエンコード処理が実行される。静止画フレームには、有効エリアとブランキングエリアが含まれる。たとえば静止画フレームの画像サイズが1920(画素)×1080(ライン)である場合、垂直同期信号が1125ラインでハイレベルとなるように設定されている。この差分の45ライン分の時間をブランキングエリアと呼称する。上述の有効エリアの処理中の期間を有効期間と呼称し、ブランキングエリアの処理中の期間をブランキング期間と呼称する。   In this configuration, real-time encoding processing of still image data of the main image size is executed by the size conversion unit 21a, the line memory 22a, and the JPEG codec 23a. The still image frame includes an effective area and a blanking area. For example, when the image size of a still image frame is 1920 (pixels) × 1080 (lines), the vertical synchronization signal is set to be high level at 1125 lines. The time for 45 lines of this difference is called a blanking area. The above-described period during processing of the effective area is referred to as an effective period, and the period during processing of the blanking area is referred to as a blanking period.

一般的にJPEGコーデック23aは、フレーム内の有効エリアをブロックに分割し、各ブロックに対して量子化テーブルを用いた量子化処理を行うことにより静止画データをエンコードする。そのエンコードデータは、DDRメインメモリ16に書き込まれる。JPEGコーデック23aは、有効エリアの処理がすべて終了した場合、CPU15が有効エリアの処理の終了を認識できるようにする。詳細には、JPEGコーデック23aは、主画像制御部28a内及び副画像制御部28b内のフラグを設定することにより有効エリアの処理が終了したこと、すなわちブランキングエリア期間が開始されたことを設定する。CPU15は、このフラグの設定の有無を適宜参照する。   In general, the JPEG codec 23a encodes still image data by dividing an effective area in a frame into blocks and performing a quantization process using a quantization table on each block. The encoded data is written into the DDR main memory 16. The JPEG codec 23a allows the CPU 15 to recognize the end of the processing of the effective area when the processing of the effective area is completed. Specifically, the JPEG codec 23a sets that the processing of the effective area has ended by setting a flag in the main image control unit 28a and the sub image control unit 28b, that is, that the blanking area period has started. To do. The CPU 15 refers to the presence / absence of this flag setting as appropriate.

主画像サイズの静止画データのリアルタイムエンコード処理と並行して、副画像サイズの静止画データの処理が実行される。すなわち、サイズ変換部21b、ラインメモリ22bにより、副画像サイズへの静止画データのサイズ変換処理が実行される。このサイズ変換処理は、有効期間の間に行われる。副画像サイズに変換された静止画データ(すなわち圧縮されていないYUV形式のデータ)は、DDRメインメモリ16に格納される。   In parallel with the real-time encoding process of the still image data of the main image size, the processing of the still image data of the sub image size is executed. That is, the size conversion process of the still image data to the sub image size is executed by the size conversion unit 21b and the line memory 22b. This size conversion process is performed during the effective period. Still image data converted to the sub-image size (that is, uncompressed YUV format data) is stored in the DDR main memory 16.

図4は、静止画リアルタイム処理部の構成(構成自体は図3と同様)を示すものであり、静止画データのブランキング期間を処理中のデータの流れを示すブロック図である。JPEGエンコーダ23aは、直前にエンコードしていた主画像サイズの静止画データと対応する副画像サイズの静止画データをDDRメインメモリ16から読み出す。JPEGエンコーダ23aは、セレクタ27及びラインメモリ22aを介して取得した副画像サイズの静止画データをエンコードし、エンコードデータをバス10を介してDDRメインメモリ16に書き込む。なお、JPEGエンコーダ23aは、ラインメモリ22aではなくラインメモリ22bを介して副画像サイズの静止画データを取得してもよい。   FIG. 4 shows the configuration of the still image real-time processing unit (the configuration itself is the same as in FIG. 3), and is a block diagram showing the flow of data during the blanking period of still image data. The JPEG encoder 23a reads from the DDR main memory 16 still image data of the sub image size corresponding to the still image data of the main image size encoded immediately before. The JPEG encoder 23a encodes still image data of the sub-image size acquired via the selector 27 and the line memory 22a, and writes the encoded data to the DDR main memory 16 via the bus 10. Note that the JPEG encoder 23a may acquire still image data of the sub-image size via the line memory 22b instead of the line memory 22a.

またCPU15は、ブランキング期間にEXIFパッケージの生成処理を行う。詳細にはCPU15は、JPEGエンコーダ23aによる副画像サイズの静止画データのエンコードと平行してEXIFパッケージのヘッダの書き込みを行う。ブランキング期間における処理詳細は、図10を参照して説明する。   Further, the CPU 15 performs an EXIF package generation process during the blanking period. Specifically, the CPU 15 writes the header of the EXIF package in parallel with the encoding of the still image data of the sub image size by the JPEG encoder 23a. Details of the processing in the blanking period will be described with reference to FIG.

<静止画リアルタイム処理部の詳細構成>
図5は、図3及び図4に示す静止画リアルタイム処理部を更に詳細に示したブロック図である。本例においては、撮像装置1は、カメラ信号処理部13から出力される動画像データから取得された静止画フレームを処理する2つのパスを有している。1つは主画像となる静止画データに関するパス(以下、パス1という。)であり、もう1つは副画像(サムネイル)となる静止画データに関するパス(以下、パス2という。)である。
<Detailed configuration of still image real-time processing unit>
FIG. 5 is a block diagram showing the still image real-time processing unit shown in FIGS. 3 and 4 in more detail. In this example, the imaging device 1 has two paths for processing still image frames acquired from moving image data output from the camera signal processing unit 13. One is a path related to still image data serving as a main image (hereinafter referred to as path 1), and the other is a path related to still image data serving as a sub image (thumbnail) (hereinafter referred to as path 2).

パス1の方は、第1の入力画像選択部27a、主画像サイズ変換部21a、及びラインメモリ22aからなり、ラインメモリ22aからの静止画データがJPEGエンコーダ23aに入力され、リアルタイムエンコードされる。パス2の方は、第2の入力画像選択部27b、副画像サイズ変換部21b、及びラインメモリ22bからなる。   The path 1 includes a first input image selection unit 27a, a main image size conversion unit 21a, and a line memory 22a. Still image data from the line memory 22a is input to the JPEG encoder 23a and is encoded in real time. The path 2 includes a second input image selection unit 27b, a sub image size conversion unit 21b, and a line memory 22b.

主画像サイズ変換部21aは、サイズ変換部211a、スケーラ用バッファ212aを有し、副画像サイズ変換部21bは、サイズ変換部211b、スケーラ用バッファ212bを有する。スケーラ用バッファ212a、212bは、ラインメモリである。主画像サイズ変換部21a、サイズ変換部21bは、基本的にはカメラ信号処理部13から入力される静止画データをそれぞれ主画像用、サムネイル用のサイズに変換する。この主画像サイズ変換部21a、副画像サイズ変換部21bについての詳細は後述する。   The main image size conversion unit 21a includes a size conversion unit 211a and a scaler buffer 212a, and the sub-image size conversion unit 21b includes a size conversion unit 211b and a scaler buffer 212b. The scaler buffers 212a and 212b are line memories. The main image size conversion unit 21a and the size conversion unit 21b basically convert still image data input from the camera signal processing unit 13 into sizes for main images and thumbnails, respectively. Details of the main image size conversion unit 21a and the sub image size conversion unit 21b will be described later.

ラインメモリ22aは、メモリコントローラ221a、SRAM等からなるバッファ222aを有し、ラインメモリ22bは、メモリコントローラ221b、バッファ222bを有する。バッファ222a、222bは、それぞれ3面及び2面のバッファである。また、JPEGエンコーダ23aにも、例えば2面構成のバッファ231が接続されている。   The line memory 22a includes a memory controller 221a and a buffer 222a including an SRAM. The line memory 22b includes a memory controller 221b and a buffer 222b. The buffers 222a and 222b are three-surface and two-surface buffers, respectively. Further, for example, a buffer 231 having a two-side structure is also connected to the JPEG encoder 23a.

バッファ222a、222bは、例えばSRAMからなり、その機能については後述する。メモリコントローラ221a、221bは、例えばSRAMをラインメモリとして機能させるために、バッファ222a、222bへのデータアクセスを制御する。また、主画像サイズ変換部21a、21bと、JPEGコア23aとでクロック周波数が異なる場合は、当該クロック周波数を変換する処理等も行うことができる。   The buffers 222a and 222b are, for example, SRAMs, and their functions will be described later. The memory controllers 221a and 221b control data access to the buffers 222a and 222b in order to make the SRAM function as a line memory, for example. In addition, when the main image size converters 21a and 21b and the JPEG core 23a have different clock frequencies, processing for converting the clock frequency can be performed.

主画像サイズ変換部21a、サイズ変換部21bでは、カメラ信号処理部13からの動画像データ又はDDRメインメモリ16からの動画像データから取得された静止画フレームがそれぞれ主画像用、サムネイル用のサイズに変換される。   In the main image size conversion unit 21a and the size conversion unit 21b, still image frames acquired from the moving image data from the camera signal processing unit 13 or the moving image data from the DDR main memory 16 are the sizes for the main image and the thumbnail, respectively. Is converted to

水平方向、及び垂直方向のサイズ変換を施された静止画フレームは、メモリコントローラ221a、221bに制御されるそれぞれバッファ222a、222bに格納される。このラインメモリ22a、22bを構成するバッファ222a、222bは、8×8DCTに必要な画素を記憶するための8ライン分のバッファであり、
Y8ライン×3面+C8ライン×3面(フォーマット4:2:2の場合)
Y16ライン×3面+C8ライン×3面(画像フォーマット4:2:0の場合)
の構成となっている。面数はシングルポート時とする。3面としたのは、後述するように、後段に控えるJPEGエンコード処理のリアルタイム処理で一時的に処理負担が増して処理レートが下がった場合の処理低下を吸収すると共に、その後段のDDRメインメモリ16aへの書き込み処理が停滞した場合の遅延を吸収するためである。なお、システム構成によっては2面構成とすることも可能である。
The still image frames subjected to the size conversion in the horizontal direction and the vertical direction are respectively stored in the buffers 222a and 222b controlled by the memory controllers 221a and 221b. The buffers 222a and 222b constituting the line memories 22a and 22b are buffers for 8 lines for storing pixels necessary for 8 × 8 DCT,
Y8 line x 3 surfaces + C8 line x 3 surfaces (in the case of format 4: 2: 2)
Y16 line x 3 planes + C8 line x 3 planes (when image format is 4: 2: 0)
It becomes the composition of. The number of faces is for single port. Three planes are used, as will be described later, in the real-time processing of JPEG encoding processing to be described later, to absorb the processing degradation when the processing load temporarily decreases and the processing rate decreases, and to the subsequent DDR main memory This is to absorb the delay when the writing process to 16a is stagnant. Depending on the system configuration, a two-sided configuration is also possible.

JPEGエンコーダ23aは、主画像データまたは副画像データをエンコードするとともに、エンコードにより生成したストリームをDDRメインメモリ16に転送する。ここでJPEGエンコーダ23aは、内部に主画像用の量子化テーブル及び副画像用の量子化テーブルを有し、JPEG圧縮方式に従い、当該量子化テーブルを参照してエンコード処理を行う。図6は、量子化テーブルの一例を示す概念図である。   The JPEG encoder 23 a encodes the main image data or the sub image data, and transfers the stream generated by the encoding to the DDR main memory 16. Here, the JPEG encoder 23a has a quantization table for a main image and a quantization table for a sub image, and performs encoding processing with reference to the quantization table according to the JPEG compression method. FIG. 6 is a conceptual diagram illustrating an example of a quantization table.

量子化テーブルは、JPEGにおける離散コサイン変換(DCT:Discrete Cosine Transform)後の画像データの、比較的高い周波数成分を省略するために、その画像データを除算する係数をそれぞれ異ならせて配した表を言い、例えば、画像ブロックが8画素×8画素で表される場合、図6に示すような8×8の係数が配された表となる。圧縮効果を下げたい場合には、量子化テーブルの各係数を比較的小さい(除数が小さい)値にし、圧縮効果を上げたい場合には、量子化テーブルの各係数を比較的大きい(除数が大きい)値にする。詳細は後述するが、JPEGエンコーダ23aは、主画像データの圧縮率に応じて副画像用の量子化テーブルの各係数の値を調整する。   The quantization table is a table in which different coefficients are used to divide the image data in order to omit relatively high frequency components of the image data after discrete cosine transform (DCT) in JPEG. That is, for example, when an image block is represented by 8 pixels × 8 pixels, a table in which 8 × 8 coefficients as shown in FIG. 6 are arranged. If you want to reduce the compression effect, set each coefficient in the quantization table to a relatively small value (small divisor). If you want to increase the compression effect, set each coefficient in the quantization table to be relatively large (large divisor). ) Value. Although details will be described later, the JPEG encoder 23a adjusts the value of each coefficient of the sub-image quantization table in accordance with the compression ratio of the main image data.

JPEGエンコーダ23aは、有効期間において主画像データの圧縮を行い、ブランキング期間において副画像データの圧縮を行う。詳細は、図8等を参照して説明する。   The JPEG encoder 23a compresses the main image data during the effective period, and compresses the sub image data during the blanking period. Details will be described with reference to FIG.

バッファ231は、SRAM2面構成等とすることができる。なお、容量はシステム構成により様々であり、DDRメインメモリ16aに転送データを書き込みするための書き込み処理が停滞した場合の遅延を吸収することができればよい。   The buffer 231 can have a SRAM two-plane configuration or the like. The capacity varies depending on the system configuration, and it is only necessary to absorb the delay when the writing process for writing the transfer data to the DDR main memory 16a is stagnant.

第1の入力画像選択部27a及び第2の入力画像選択部27bは、複数ルートからの入力画像データを選択するセレクタ27の機能を有する。   The first input image selection unit 27a and the second input image selection unit 27b have a function of a selector 27 that selects input image data from a plurality of routes.

<サイズ変換部の処理>
次に、サイズ変換部21について詳細に説明する。図7は、サイズ変換部21の詳細を示すブロック図である。取得される静止画データに応じて、2チャンネル構成となっている。これにより、2ライン(プログレッシブならODD(奇数番目)、EVEN(偶数番目))同時に入力された場合にもデータを処理することができる。2チャンネル同時とすることにより、カメラ処理の処理クロックレートを下げることができる。
<Processing of size converter>
Next, the size converter 21 will be described in detail. FIG. 7 is a block diagram showing details of the size converter 21. It has a two-channel configuration according to the acquired still image data. Thus, data can be processed even when two lines (progressive ODD (odd number), EVEN (even number)) are input simultaneously. By using two channels simultaneously, the processing clock rate of camera processing can be lowered.

入力画像は、水平フィルタ(ch1)41、水平フィルタ(ch2)42で、必要な周波数特性に制限される。例えば、サンプリング周波数をfsの水平1024画素×垂直768ラインを512画素×384ラインに間引くとした場合、フィルタのカットオフ周波数をfs/4になるように設定してフィルタリングする。そして、水平間引き回路43で512画素に間引きし、スケーラ用バッファ212aに書き込みする。水平フィルタ回路41、42による周波数特性の制限を行わないで間引きを実行すると、いわゆるモワレ(折り返し歪)が発生する。   The input image is limited to a necessary frequency characteristic by a horizontal filter (ch1) 41 and a horizontal filter (ch2). For example, when the sampling frequency is thinned out from horizontal 1024 pixels × vertical 768 lines of fs to 512 pixels × 384 lines, filtering is performed by setting the cutoff frequency of the filter to be fs / 4. Then, the pixel is thinned to 512 pixels by the horizontal thinning circuit 43 and written to the scaler buffer 212a. When thinning is performed without limiting the frequency characteristics by the horizontal filter circuits 41 and 42, so-called moire (folding distortion) occurs.

スケーラ処理ラインメモリコントローラ44では、水平間引き回路43により間引きした画像データのスケール調整をする。具体的には、間引き後のデータについて、サンプル点がサンプリング点の間にある場合フィルタリング処理された画像信号2サンプル分から補間後サンプルの距離に応じて演算して値を求めて、画素間の直線補間等を実施する。   The scaler processing line memory controller 44 adjusts the scale of the image data thinned out by the horizontal thinning circuit 43. Specifically, with respect to the data after thinning, when the sample point is between the sampling points, a value is obtained by calculating according to the distance of the sample after interpolation from two samples of the filtered image signal, and a straight line between the pixels Perform interpolation etc.

水平補間後の静止画フレームは、垂直フィルタ回路45、46に出力される。水平方向と同様に折り返し歪の発生を抑制するため、垂直フィルタ回路45、46により、ラインメモリ(スケーラ用バッファ212a)から読み出された静止画データに対して垂直方向にフィルタリング処理する。フィルタリング後に、垂直間引き回路47により垂直間引きを行い、必要な画像データのみ、その後段のメモリコントローラ221a、221bを介してラインメモリ222a、222bに書き込みする。   The still image frame after horizontal interpolation is output to the vertical filter circuits 45 and 46. In order to suppress the occurrence of aliasing distortion as in the horizontal direction, the vertical filter circuits 45 and 46 filter the still image data read from the line memory (scaler buffer 212a) in the vertical direction. After filtering, vertical thinning is performed by the vertical thinning circuit 47, and only necessary image data is written into the line memories 222a and 222b via the memory controllers 221a and 221b at the subsequent stages.

ここで、サイズ変換は、主画像とサムネイル画像とで、独立して並列処理することができる。また、スケーラ用バッファ212aを共有してバッファサイズを削減することも可能である。例えば、主画像用静止画データを、水平フィルタ回路41、42における周波数特性削減処理でfs/4にする場合について考える。その後段に直列で接続されたサムネイル用水平フィルタ回路48、49でのフィルタ処理では水平160画素×垂直120ラインとする。したがって、
サイズ変換部211aのみ(それぞれ独立使用):fs/12.8処理必要
サイズ変換部211a+211b
スケーラ1+スケーラ2(後段に直列で接続する):fs/6.4処理(前段でfs/2→fs/4のため)
で構成され、後段に直列で接続する方が、周波数特性の制限幅が少なくてすむ。制限幅が少ない場合、同じ次数ならば帯域の制限効率がよく画質メリットを生じる。一方、同程度の画質でよいのであれば、次数を減らすことが可能となる。その結果、スケーラ用バッファ212bの必要ラインメモリが少なくなり、余ったラインメモリを他のリソースに振り分けることができる。
Here, the size conversion can be independently performed in parallel on the main image and the thumbnail image. It is also possible to reduce the buffer size by sharing the scaler buffer 212a. For example, consider a case where the main image still image data is set to fs / 4 by frequency characteristic reduction processing in the horizontal filter circuits 41 and 42. In the filter processing in the thumbnail horizontal filter circuits 48 and 49 connected in series in the subsequent stage, the horizontal 160 pixels × vertical 120 lines are used. Therefore,
Size converter 211a only (each independently used): fs / 12.8 processing required Size converter 211a + 211b
Scaler 1 + Scaler 2 (connected in series in the subsequent stage): fs / 6.4 treatment (because fs / 2 → fs / 4 in the previous stage)
The frequency characteristic limit width can be reduced by connecting to the subsequent stage in series. When the limit width is small, the band order efficiency is good and the image quality is merited if the order is the same. On the other hand, if the image quality is comparable, the order can be reduced. As a result, the necessary line memory of the scaler buffer 212b is reduced, and the surplus line memory can be allocated to other resources.

サムネイル用のサイズ変換部は、垂直フィルタ回路45、46と垂直間引き回路47との間の信号が使用される。すなわち、主画像用のサイズ変換部でサイズ変換された後の静止画データのサイズ変換を行う。サムネイル用のサイズ変換部も、水平フィルタ回路48、49、水平間引き回路、スケーラ処理ラインメモリコントローラ、垂直フィルタ回路、垂直間引き回路を同様に有し、同様の処理によりサイズ変換した静止画画像を出力する。   The thumbnail size converter uses signals between the vertical filter circuits 45 and 46 and the vertical thinning circuit 47. That is, the size conversion of the still image data after the size conversion by the size conversion unit for the main image is performed. The thumbnail size converter also has horizontal filter circuits 48 and 49, a horizontal thinning circuit, a scaler processing line memory controller, a vertical filter circuit, and a vertical thinning circuit, and outputs a still image image whose size has been converted by the same processing. To do.

バッファ222a、222bに書き込みされた静止画データは、例えば8ラインデータとして書き込みされる毎にDDRメインメモリ16へ転送される。DDRメインメモリ16側の処理は、システムに応じて様々であるが、静止画ルートや動画ルート、その他カメラ制御信号のための演算結果などをDDRメインメモリ16に書き込みするのが通常である。したがって、静止画フレームのリアルタイム記録処理のデータレート以上のレートを処理できる帯域を確保するよう構成されている。ただし、静止画フレームのリアルタイム記録処理以外のデータでバス10のバス帯域を占有する瞬間も有り得る。よっって、撮像装置は、DDRメインメモリ16の処理遅延を吸収するために、スケーラ用バッファ212a、212b、バッファ222a、222b、及びストリーム用バッファ231などを有している。   The still image data written in the buffers 222a and 222b is transferred to the DDR main memory 16 every time it is written as, for example, 8-line data. The processing on the DDR main memory 16 side varies depending on the system, but it is normal to write a still image route, a moving image route, calculation results for other camera control signals, and the like into the DDR main memory 16. Therefore, a band capable of processing a rate higher than the data rate of the real-time recording process of the still image frame is secured. However, there may be a moment when the bus bandwidth of the bus 10 is occupied by data other than the real-time recording process of the still image frame. Therefore, the imaging apparatus includes the scaler buffers 212a and 212b, the buffers 222a and 222b, the stream buffer 231 and the like in order to absorb the processing delay of the DDR main memory 16.

<各期間(有効期間、ブランキング期間)における各処理部の動作>
続いて各期間(有効期間、ブランキング期間)における動作詳細について説明する。図8は、各期間(有効期間、ブランキング期間)における各処理部の動作を示すタイミングチャートである。カメラ信号処理部13内の同期信号発生部は、各処理部に対して垂直同期信号を供給する。撮像素子12は、垂直同期信号が立ち下がるタイミング(t11)で静止画フレームの有効エリアの処理を開始する(S1)。
<Operation of each processing unit in each period (effective period, blanking period)>
Next, operation details in each period (effective period, blanking period) will be described. FIG. 8 is a timing chart showing the operation of each processing unit in each period (effective period, blanking period). A synchronization signal generation unit in the camera signal processing unit 13 supplies a vertical synchronization signal to each processing unit. The image sensor 12 starts processing the effective area of the still image frame at the timing (t11) when the vertical synchronization signal falls (S1).

有効エリアの所定ライン(上述の例では8ライン)がラインメモリ22に格納された後のタイミングであるt11'からJPEGエンコーダ23aにより主画像サイズの静止画データのリアルタイムエンコード処理が実行される(S2)。エンコードはブロック単位で実行され、エンコードされた圧縮データは随時DDRメインメモリ16に書き込まれる。JPEGエンコーダ23a等による処理は、ラインメモリ22に最小処理単位ラインのデータが格納された後に行われるため、垂直同期信号の立下りや撮像素子出力開始タイミング(t11)と、各処理の開始タイミング(t11')と、は図示するように若干のずれがある。タイミングt12とt12'のずれ、タイミングt13とt13'のずれについても同様の理由により生じる。なお、図8に示すように厳密なブランキング期間(t12〜t13)と、JPEGエンコーダ23aやCPU15が処理を行う期間(t12'〜t13')にはずれがあるが、一般的な処理では無視できる程度の時間であるため、本明細書では、このずれも含む時間の概念として有効期間、ブランキング期間との文言を用いる。   Real-time encoding processing of still image data of the main image size is executed by the JPEG encoder 23a from t11 ′, which is the timing after a predetermined line (eight lines in the above example) of the effective area is stored in the line memory 22 (S2). ). Encoding is performed in units of blocks, and the encoded compressed data is written to the DDR main memory 16 as needed. Since the processing by the JPEG encoder 23a and the like is performed after the minimum processing unit line data is stored in the line memory 22, the falling edge of the vertical synchronization signal, the image sensor output start timing (t11), and the start timing of each processing ( There is a slight deviation from t11 ′) as shown in the figure. The difference between the timings t12 and t12 ′ and the difference between the timings t13 and t13 ′ occur for the same reason. As shown in FIG. 8, there is a difference between the strict blanking period (t12 to t13) and the period (t12 ′ to t13 ′) in which the JPEG encoder 23a and the CPU 15 perform processing, but it can be ignored in general processing. In this specification, the terms “effective period” and “blanking period” are used as a concept of time including this deviation.

またタイミングt11'から副画像サイズ変換部21b、ラインメモリ22bにより副画像サイズへの静止画データのサイズ変換が行われる(S3)。サイズ変換後の副画像サイズへの静止画データ(YUV形式)は、DDRメインメモリ16に格納される(S3)。   Further, the size conversion of the still image data to the sub image size is performed by the sub image size conversion unit 21b and the line memory 22b from timing t11 ′ (S3). Still image data (YUV format) to the sub-image size after size conversion is stored in the DDR main memory 16 (S3).

CPU15は、タイミングt11'からEXIFの所定ヘッダの生成を開始する(S4)。さらにCPU15は、JPEGエンコーダ23aがエンコードした主画像ストリームをDDRメインメモリ16内のワークエリア(後述)に適宜書き込む(S4)。さらにCPU15は、タイミングt11'より前に生成したEXIFパッケージを任意の記憶メディア(例えば撮像装置1に着脱可能なUSBメモリやSDカード17)に転送しても良い(S5)。   The CPU 15 starts generating a predetermined header of EXIF from timing t11 ′ (S4). Further, the CPU 15 appropriately writes the main image stream encoded by the JPEG encoder 23a in a work area (described later) in the DDR main memory 16 (S4). Further, the CPU 15 may transfer the EXIF package generated before the timing t11 ′ to an arbitrary storage medium (for example, a USB memory or SD card 17 that can be attached to and detached from the imaging device 1) (S5).

JPEGエンコーダ23aは、静止画データの有効エリアのエンコード処理が終了した場合(タイミングt12')に、主画像制御部28a及び副画像制御部28b内のフラグを設定する。撮像素子12は、タイミングt12からブランキングエリアのデータを取り込んで出力する(S6)。副画像制御部28bは、タイミングt12'からサイズ変換済みの副画像サイズの静止画データをDDRメインメモリ16から読み出してJPEGエンコーダ23aに供給するようにセレクタ27を制御する。セレクタ27により取得された副画像サイズの静止画データは、JPEGエンコーダ23aに供給される。JPEGエンコーダ23aは、副画像サイズの静止画データをエンコードしてDDRメインメモリ16に書き込む(S7)。   The JPEG encoder 23a sets a flag in the main image control unit 28a and the sub image control unit 28b when the encoding process of the effective area of the still image data is completed (timing t12 ′). The image sensor 12 captures and outputs blanking area data from timing t12 (S6). The sub-image control unit 28b controls the selector 27 so that the still image data of the sub-image size that has been subjected to size conversion from the timing t12 ′ is read from the DDR main memory 16 and supplied to the JPEG encoder 23a. The sub-image size still image data acquired by the selector 27 is supplied to the JPEG encoder 23a. The JPEG encoder 23a encodes the still image data of the sub image size and writes it in the DDR main memory 16 (S7).

CPU15は、ブランキング期間(タイミングt12'〜)においてEXIFヘッダの書き込みや副画像ストリームの書き込みを行い、EXIFパッケージを生成する(S8)。この処理の詳細は、図9及び図10を参照して説明する。ブランキング期間の終了後(タイミングt13')に各処理部は、別の静止画データについて再びS1〜S5に記載の処理を行う。   The CPU 15 writes the EXIF header and / or the sub-image stream during the blanking period (timing t12 ′) to generate an EXIF package (S8). Details of this processing will be described with reference to FIGS. After the blanking period ends (timing t13 ′), each processing unit performs the processes described in S1 to S5 again for other still image data.

<ワークエリアの構成>
ブランキング期間の処理(図8のタイミングt12'〜t13'の処理)の説明に先立ち、CPU15がEXIFパッケージの作成に用いるワークエリアについて説明する。図9は、ワーキングエリアの概略構成を示す概念図である。ワークエリアは、DDRメインメモリ16内の一領域である。
<Work area configuration>
Prior to the description of the blanking period processing (processing at timings t12 ′ to t13 ′ in FIG. 8), a work area used by the CPU 15 to create an EXIF package will be described. FIG. 9 is a conceptual diagram showing a schematic configuration of the working area. The work area is an area in the DDR main memory 16.

ワークエリアは、ヘッダ領域、サムネイル領域、及び主画像領域を有する。ヘッダ領域は規定のアドレス(以下の説明ではアドレスAとする。)から固定長のサイズを持つ領域である。サムネイル領域は、ヘッダ領域の終端アドレス(以下の説明ではアドレスBとする。)から固定長のサイズを持つ領域である。主画像領域は、サムネイル領域の終端アドレス(以下の説明ではアドレスCとする。)を先頭アドレスとする可変長の領域である。CPU15は、当該ワークエリアに各データを書込み、全ての領域に書き込みが終了した後にパッケージ化を行うことによりEXIFパッケージを生成する。CPU15は、生成したEXIFパッケージをDDRメインメモリ16に格納する。   The work area has a header area, a thumbnail area, and a main image area. The header area is an area having a fixed length from a specified address (hereinafter referred to as address A). The thumbnail area is an area having a fixed size from the end address of the header area (hereinafter referred to as address B). The main image area is a variable-length area having the head address as the end address of the thumbnail area (hereinafter referred to as address C). The CPU 15 writes each data in the work area, and generates an EXIF package by packaging after all the areas have been written. The CPU 15 stores the generated EXIF package in the DDR main memory 16.

<ブランキング期間の処理>
続いて図10を参照してブランキング期間におけるJPEGエンコーダ23a及びCPU15の処理について説明する。図10は、ブランキング期間におけるJPEGエンコーダ23a及びCPU15の処理を示すタイミングチャートであり、図8のタイミングt12'〜t13'の処理に対応する。
<Blanking period processing>
Next, processing of the JPEG encoder 23a and the CPU 15 during the blanking period will be described with reference to FIG. FIG. 10 is a timing chart showing the processes of the JPEG encoder 23a and the CPU 15 during the blanking period, and corresponds to the processes at timings t12 ′ to t13 ′ of FIG.

図10Aは、ブランキング期間の処理の第1の方式を示すタイミングチャートである。ブランキング期間の開始時(タイミングt12')にJPEGエンコーダ23aは、副画像サイズの静止画データのエンコードを開始する(S7)。CPU15は、有効期間中にワークエリアの主画像領域の先頭アドレス(アドレスC)からエンコード済みのストリームを随時書き込む。そしてCPU15は、ブランキング期間の開始時(タイミングt12)にヘッダ領域の先頭アドレス(アドレスA)からEXIFパッケージのヘッダを書き込む(S81)。さらにCPU15は、エンコードが終了しDDRメインメモリ16に格納された副画像データのストリームをワークエリアのアドレスBから順次書き込んでいく(S81)。   FIG. 10A is a timing chart showing a first method of blanking period processing. At the start of the blanking period (timing t12 ′), the JPEG encoder 23a starts encoding still image data of the sub image size (S7). The CPU 15 writes an encoded stream as needed from the start address (address C) of the main image area of the work area during the effective period. Then, the CPU 15 writes the header of the EXIF package from the head address (address A) of the header area at the start of the blanking period (timing t12) (S81). Further, the CPU 15 sequentially writes the stream of sub-image data stored in the DDR main memory 16 after the encoding is completed from the address B of the work area (S81).

JPEGエンコーダ23aは、タイミングt121において副画像サイズの静止画データのエンコードを終了する。エンコードの終了から若干遅れたタイミングt122においてCPU15は、ヘッダ及び副画像データのストリームのワークエリアへの書き込みを終了する。これによりタイミングt122において、ワークエリア内の各領域にはデータが書き込まれた状態となる。CPU15は、タイミングt122からワークエリアのデータをパッケージ化してファイル化する処理を開始する(S82)。CPU15は、生成したEXIFパッケージをDDRメインメモリ16に格納する。   The JPEG encoder 23a finishes encoding the still image data of the sub image size at timing t121. At timing t122 slightly delayed from the end of encoding, the CPU 15 finishes writing the header and sub-image data stream to the work area. Thus, at timing t122, data is written in each area in the work area. The CPU 15 starts a process of packaging work area data into a file from timing t122 (S82). The CPU 15 stores the generated EXIF package in the DDR main memory 16.

図10Bは、ブランキング期間の処理の第2の方式を示すタイミングチャートである。図10Bに示す処理の方式について、図10Aに示す処理の方式との違いを説明する。図10Bの処理方式の場合、CPU15はエンコードが終了するまで処理を行わない。そしてCPU15は、エンコードが終了したタイミングt124からヘッダ及び副画像データのストリームのワークエリアへの書き込みを開始する(S81)。CPU15は、ワークエリアへの書き込みが終了したタイミングt125からパッケージング処理(S82)を開始する。   FIG. 10B is a timing chart illustrating a second method of blanking period processing. A difference between the processing method illustrated in FIG. 10B and the processing method illustrated in FIG. 10A will be described. In the case of the processing method of FIG. 10B, the CPU 15 does not perform processing until encoding is completed. Then, the CPU 15 starts writing the header and sub-image data stream to the work area from the timing t124 when the encoding is completed (S81). The CPU 15 starts the packaging process (S82) from the timing t125 when the writing to the work area is completed.

図10Aに示す処理の方式と図10Bに示す処理の方式を比較する。図10Aに示す処理の方式では、エンコード処理とワークエリアへの書込み処理が並列して行われる。これにより、図10Bに示す処理の方式と比べて、パッケージング処理の開始及び終了のタイミングを速くできる。これにより、ブランキング期間の終了までにより確実に処理を終了することができる。   The processing method shown in FIG. 10A is compared with the processing method shown in FIG. 10B. In the processing method shown in FIG. 10A, the encoding process and the writing process to the work area are performed in parallel. As a result, the start and end timing of the packaging process can be accelerated compared to the processing method shown in FIG. 10B. As a result, the process can be completed more reliably until the end of the blanking period.

<JPEGエンコーダ23aにおける量子化テーブルの調整>
前述のように、JPEGエンコーダ23aは、有効期間において主画像サイズの静止画データの圧縮を行い、ブランキング期間において副画像サイズの静止画データの圧縮を行う。すなわち、JPEGエンコーダ23aは、ある静止画データにつついて主画像、副画像の順序で圧縮を行う。ここで副画像サイズの静止画データは、主画像サイズの静止画データのサイズのみが変更されたデータである。そのため両データには、相関関係がある。
<Adjustment of quantization table in JPEG encoder 23a>
As described above, the JPEG encoder 23a compresses still image data of the main image size during the effective period, and compresses still image data of the sub image size during the blanking period. That is, the JPEG encoder 23a performs compression in the order of the main image and the sub-image in accordance with certain still image data. Here, the sub image size still image data is data in which only the size of the main image size still image data is changed. Therefore, there is a correlation between both data.

ここで、ワークエリア内のサムネイル領域は、図9に示すように固定長である。仮に副画像サイズの静止画データのエンコード後の圧縮データがサムネイル領域のサイズを超えてしまう場合、再度のエンコード処理が必要となり、ブランキング期間内にパッケージング処理が終了しない可能性が生じる。そこでJPEGエンコーダ23aは、上述の相関関係に着目し、圧縮後のデータサイズがサムネイル領域を超えないように副画像サイズの静止画データの圧縮に用いる量子化テーブルを調整する。以下、図11を参照して詳細を説明する。なお、以下の例では説明の便宜のため、主画像用の量子化テーブルと副画像用の量子化テーブルは同一とする。   Here, the thumbnail area in the work area has a fixed length as shown in FIG. If the compressed data after encoding the still image data of the sub-image size exceeds the size of the thumbnail area, the encoding process needs to be performed again, and the packaging process may not be completed within the blanking period. Therefore, the JPEG encoder 23a pays attention to the above-described correlation, and adjusts the quantization table used for compressing the still image data of the sub-image size so that the compressed data size does not exceed the thumbnail area. Details will be described below with reference to FIG. In the following example, the quantization table for the main image and the quantization table for the sub-image are the same for convenience of explanation.

図11Aは、有効期間において使用した量子化テーブルの一例である。前述のように画像ブロックのサイズに応じて各係数が設定されている。JPEGエンコーダ23aは、主画像圧縮前のデータサイズと圧縮後のデータサイズから主画像の圧縮率を算出する。JPEGエンコーダ23aは、圧縮前の副画像サイズの静止画データのデータサイズに上述の主画像圧縮率を乗算し、圧縮後のデータサイズを推定する。JPEGエンコーダ23aは、この推定データサイズとサムネイル領域のサイズを比較する。推定データサイズがサムネイル領域のサイズよりも小さい場合、JPEGエンコーダ23aは量子化テーブルの各係数を小さな値に変更する。推定データサイズがサムネイル領域のサイズよりも大きい場合、JPEGエンコーダ23aは量子化テーブルの各係数を大きな値に変更する。   FIG. 11A is an example of the quantization table used in the effective period. As described above, each coefficient is set according to the size of the image block. The JPEG encoder 23a calculates the compression ratio of the main image from the data size before compression of the main image and the data size after compression. The JPEG encoder 23a multiplies the data size of still image data of the sub-image size before compression by the main image compression rate described above, and estimates the data size after compression. The JPEG encoder 23a compares the estimated data size with the size of the thumbnail area. When the estimated data size is smaller than the size of the thumbnail area, the JPEG encoder 23a changes each coefficient of the quantization table to a small value. When the estimated data size is larger than the size of the thumbnail area, the JPEG encoder 23a changes each coefficient of the quantization table to a large value.

図11Bは、圧縮効果を下げるために図11Aの量子化テーブルの各係数を1/2倍した量子化テーブルである。図11Cは、圧縮効果を上げるために図11Aの量子化テーブルの各係数を2倍した量子化テーブルである。   FIG. 11B is a quantization table obtained by multiplying each coefficient of the quantization table of FIG. 11A by 1/2 to reduce the compression effect. FIG. 11C is a quantization table obtained by doubling each coefficient of the quantization table of FIG. 11A in order to increase the compression effect.

なお、JPEGエンコーダ23aは、量子化テーブルの調整の際に、副画像サイズの静止画データのエンコード後のデータサイズがサムネイル領域のサイズよりも若干小さくなるように調整を行ってもよい。これは、副画像サイズの静止画データのエンコード後のデータサイズがサムネイル領域のサイズよりも確実に小さくしてエンコードを1回で終了するためである。このように調整することによりブランキング期間内でのパッケージ処理をより確実に行うことができる。   Note that the JPEG encoder 23a may adjust the quantization table so that the encoded data size of the still image data of the sub-image size is slightly smaller than the size of the thumbnail area. This is because the encoded data size of the still image data of the sub-image size is surely made smaller than the size of the thumbnail area and the encoding is completed once. By adjusting in this way, the package processing within the blanking period can be performed more reliably.

なお、上述の説明では主画像用の量子化テーブルと副画像用の量子化テーブルが同一であるものとして説明した。しかし、両者が別テーブルである場合であっても、主画像サイズの静止画データの圧縮率、及び主画像用の量子化テーブルの各係数の大きさを基に、現在の副画像用の量子化テーブルを用いた場合の圧縮後のデータサイズを推定し、この推定サイズとサムネイル領域のサイズの比較に応じて副画像用の量子化テーブルを調整すればよい。   In the above description, it is assumed that the quantization table for the main image and the quantization table for the sub-image are the same. However, even if both are separate tables, the current sub-image quantum is based on the compression ratio of still image data of the main image size and the size of each coefficient of the quantization table for the main image. It is only necessary to estimate the data size after compression when using the quantization table and adjust the quantization table for the sub-image according to the comparison between the estimated size and the size of the thumbnail area.

また、動画フレームのエンコード処理は、一般的にフレームをDDRメインメモリ16に蓄積し、その後エンコードを行う。そのため、動画フレームは、静止画フレームの処理よりも数フレームの時間だけ遅れて処理される。静止画フレームは、動画フレームから切り出されたフレームであるため両者には相関関係がある。そこで上述の動画コーデック20は、上述の主画像用の量子化テーブルを用いた場合の圧縮率を参照するようにしてもよい。これにより、動画コーデック20は、動画圧縮率を例えば2パスエンコード等において行う動画圧縮前の解析の参照データとして用いることができる。参照データとして用いることにより、通常の構成よりも少ない回路構成でより正確な符号量制御が可能となる。なお、2パスエンコードとは、動画データを圧縮する際にデータ解析と圧縮を別々に行う処理方式である。まず1回目の処理において動画解析を行って特徴等を算出し、その算出値に基づいて2回目の処理である圧縮を行う。2パスエンコードは、解析と圧縮を1回の処理で行う1パスエンコードに比べて倍近い時間がかかるが、高い画質や圧縮率を得ることができる点が特徴である。   In addition, in the encoding process of a moving image frame, the frame is generally stored in the DDR main memory 16 and then encoded. Therefore, the moving image frame is processed with a delay of several frames from the processing of the still image frame. Since the still image frame is a frame cut out from the moving image frame, there is a correlation between them. Therefore, the moving picture codec 20 may refer to the compression rate when the above-described main image quantization table is used. Thereby, the moving image codec 20 can use the moving image compression rate as reference data for analysis before moving image compression performed in, for example, two-pass encoding. By using it as reference data, it is possible to perform more accurate code amount control with a smaller circuit configuration than the normal configuration. Note that the 2-pass encoding is a processing method in which data analysis and compression are performed separately when compressing moving image data. First, moving image analysis is performed in the first process to calculate features and the like, and compression, which is the second process, is performed based on the calculated value. Two-pass encoding takes nearly twice as much time as one-pass encoding in which analysis and compression are performed in a single process, but is characterized in that a high image quality and compression rate can be obtained.

さらに動画コーデック20は、主画像用の量子化テーブルとそのテーブルを用いた際の圧縮率を参照して動画圧縮に用いる量子化テーブルを調整してもよい。ここで量子化テーブルの調整とは、前述のように圧縮率を変化させるためにテーブル内の各係数の値を変更することを意味する。これにより、動画圧縮後のデータサイズを所望のサイズにすることができる。   Furthermore, the moving image codec 20 may adjust the quantization table used for moving image compression with reference to the quantization table for the main image and the compression rate when the table is used. Here, the adjustment of the quantization table means that the value of each coefficient in the table is changed in order to change the compression rate as described above. Thereby, the data size after moving image compression can be made into a desired size.

なお、圧縮率の調整は、量子化テーブルの調整に加えて上述の水平フィルタ回路41のカットオフ周波数を調整することよっても実現することができる。そのため、水平フィルタ41は、JPEGエンコーダ23aが算出した上述の圧縮率とサムネイル領域の関係からカットオフ周波数を調整してもよい。しかしながら、この方式ではカットオフ周波数の調整が反映されるタイミングが次のフレームの処理タイミングとなる。そのため、シーンチェンジが比較的少ない動画等を処理対象としている場合には有効であるが、シーンチェンジが比較的多い動画等を処理対象としている場合には上述の量子化テーブルの調整を行ったほうがよい。また、水平フィルタ回路41でのカットオフ周波数の調整と、量子化テーブルの調整の双方を行うことも可能である。   The adjustment of the compression rate can also be realized by adjusting the cutoff frequency of the horizontal filter circuit 41 described above in addition to the adjustment of the quantization table. Therefore, the horizontal filter 41 may adjust the cut-off frequency from the relationship between the compression ratio calculated by the JPEG encoder 23a and the thumbnail area. However, in this method, the timing at which the adjustment of the cutoff frequency is reflected is the processing timing of the next frame. For this reason, it is effective when processing videos with relatively few scene changes, but it is better to adjust the quantization table as described above when processing videos with relatively many scene changes. Good. It is also possible to perform both the adjustment of the cutoff frequency in the horizontal filter circuit 41 and the adjustment of the quantization table.

<各フレームにおける生成パッケージ>
続いて、CPU15によるパッケージ処理の具体例について説明する。図12は、パッケージ処理を開始する直前のワークエリアの状態を示す概念図である。図12A〜12Cは、それぞれ異なるフレームのパッケージ前のDDRメインメモリ16内のワークエリアの状態を示す。
<Generated package in each frame>
Next, a specific example of package processing by the CPU 15 will be described. FIG. 12 is a conceptual diagram showing the state of the work area immediately before starting the package processing. 12A to 12C show the state of the work area in the DDR main memory 16 before the package of each different frame.

図12Aでは、サムネイル領域に若干の空き領域が生じた例を示している。CPU15は、空き領域に無視できるデータ(以降の説明では無効データと呼称する。)である"FF"を書き込む。CPU15は、前述のように量子化テーブルを調整することにより副画像サイズの静止画データのエンコード後のサイズをサムネイル領域に合わせている。しかしながらこのように空き領域が生じた場合、CPU15は、再度のエンコードを行うことなく無効データを書き込む。これにより、エンコード回数が1回に限定され、素早くパッケージ処理の開始を行うことができる。さらに無効データを書き込むことにより、EXIFパッケージ処理後の画像の画質に影響を与えることが無い。   FIG. 12A shows an example in which a slight empty area is generated in the thumbnail area. The CPU 15 writes “FF”, which is ignorable data (referred to as invalid data in the following description) in the empty area. The CPU 15 adjusts the quantization table as described above to adjust the size of the still image data of the sub image size after encoding to the thumbnail area. However, when such a free area occurs, the CPU 15 writes invalid data without performing re-encoding. As a result, the number of encodings is limited to one, and the package process can be started quickly. Furthermore, writing invalid data does not affect the image quality after the EXIF package processing.

図12Bは、サムネイル領域に空きが生じなかった場合の例を示している。この場合、CPU15は無効データを書き込むことなく、パッケージ処理を実行する。図12Cは、サムネイル領域に多めの空き領域が生じた例を示している。この場合にはCPU15は、図示するように空き領域全てに無効データを書き込み、再度のエンコードを行うことなくパッケージ処理を行う。   FIG. 12B shows an example in which there is no empty space in the thumbnail area. In this case, the CPU 15 executes the package process without writing invalid data. FIG. 12C shows an example in which a large empty area is generated in the thumbnail area. In this case, the CPU 15 writes invalid data in all the empty areas as shown in the figure, and performs package processing without performing re-encoding.

最後に上記の撮像装置の効果について改めて説明する。上述のように、JPEGエンコーダ23aは、有効期間に主画像サイズの静止画データを圧縮し、ブランキング期間に副画像サイズの静止画データを圧縮する。すなわち、JPEGエンコーダ23aは、主画像用の処理と副画像用の処理において共用される。また、CPU15は、ブランキング期間に副画像サイズのエンコード処理とパッケージ処理を行うため、EXIFパッケージ(画像圧縮パッケージ)をリアルタイムに生成することができる。すなわち単一のJPEGエンコーダ23a構成でリアルタイムにEXIFパッケージ(画像圧縮パッケージ)を生成することができる。   Finally, the effect of the imaging apparatus will be described again. As described above, the JPEG encoder 23a compresses still image data of the main image size during the effective period and compresses still image data of the sub image size during the blanking period. That is, the JPEG encoder 23a is shared by the main image processing and the sub image processing. Further, since the CPU 15 performs the sub-image size encoding process and the package process during the blanking period, the CPU 15 can generate an EXIF package (image compression package) in real time. That is, an EXIF package (image compression package) can be generated in real time with a single JPEG encoder 23a configuration.

また、撮像装置1内のCPU15は、ブランキング期間において副画像サイズの静止画データのエンコードとワークエリアへの書き込みを並列して実行することができる(図10A)。これによりパッケージ処理を終了するタイミングを早めることができ、ひいてはブランキング期間内に確実にパッケージ処理を終了することができる。   Further, the CPU 15 in the imaging apparatus 1 can execute the encoding of the still image data of the sub-image size and the writing to the work area in parallel during the blanking period (FIG. 10A). As a result, the timing for ending the package processing can be advanced, and as a result, the package processing can be reliably ended within the blanking period.

さらに撮像装置1内のJPEGエンコーダ23aは、主画像の圧縮率を基に副画像用の量子化テーブルを調整している。これによりサムネイル領域(ワークエリアの固定領域)に合致した圧縮率を実現することができる。   Further, the JPEG encoder 23a in the imaging apparatus 1 adjusts the quantization table for the sub image based on the compression ratio of the main image. As a result, it is possible to realize a compression rate that matches the thumbnail area (fixed area of the work area).

さらにCPU15は、サムネイル領域よりも副画像サイズの静止画データの圧縮後のデータサイズが小さい場合には無効値を空き領域に書き込む。1回のエンコード処理のみを行い、空き領域には画質に影響のない無効値を書き込んでいるため、素早く高品質な画像圧縮パッケージを生成することができる。   Further, the CPU 15 writes an invalid value in the empty area when the compressed data size of the still image data of the sub-image size is smaller than the thumbnail area. Since only one encoding process is performed and an invalid value that does not affect the image quality is written in the empty area, a high-quality image compression package can be quickly generated.

以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は既に述べた実施の形態に限定されるものではなく、その要旨を逸脱しない範囲において種々の変更が可能であることはいうまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiments. However, the present invention is not limited to the embodiments already described, and various modifications can be made without departing from the scope of the invention. It goes without saying that it is possible.

1 撮像装置
11 レンズ
12 撮像素子
13 カメラ信号処理部
14 ズーム・フォーカス制御部
15 CPU
16 DDRメインメモリ
17 SDカード
18 USB
19 サイズ変換部
20 動画コーデック
20a 動画エンコーダ
20b 動画デコーダ
21 サイズ変換部
21a 主画像サイズ変換部
21b 副画像サイズ変換部
22 ラインメモリ
22a ラインメモリ
22b ラインメモリ
23 JPEGコーデック
23a JPEGエンコーダ
24 ビデオ信号処理部
25 HDMI
26 LCD
27 セレクタ
27a 第1の入力画像選択部
27b 第2の入力画像選択部
28a 主画像制御部
28b 副画像制御部
41 水平フィルタ回路
42 水平フィルタ回路
43 水平間引き回路
44 スケーラ処理ラインメモリコントローラ
45 垂直フィルタ回路
46 垂直フィルタ回路
47 垂直間引き回路
48 水平フィルタ回路
49 水平フィルタ回路
DESCRIPTION OF SYMBOLS 1 Image pick-up device 11 Lens 12 Image pick-up element 13 Camera signal processing part 14 Zoom / focus control part 15 CPU
16 DDR main memory 17 SD card 18 USB
19 Size converter 20 Video codec 20a Video encoder 20b Video decoder 21 Size converter 21a Main image size converter 21b Sub-image size converter 22 Line memory 22a Line memory 22b Line memory 23 JPEG codec 23a JPEG encoder 24 Video signal processor 25 HDMI
26 LCD
27 selector 27a first input image selection unit 27b second input image selection unit 28a main image control unit 28b sub image control unit 41 horizontal filter circuit 42 horizontal filter circuit 43 horizontal thinning circuit 44 scaler processing line memory controller 45 vertical filter circuit 46 vertical filter circuit 47 vertical thinning circuit 48 horizontal filter circuit 49 horizontal filter circuit

Claims (8)

撮像素子と、
前記撮像素子により取得された動画像データから任意のタイミングで静止画フレームを取得する静止画フレーム取得部と、
前記静止画フレーム取得部により取得された静止画フレームのサイズをリアルタイムに変換して主画像データを生成する主画像サイズ変換部と、
前記静止画フレーム取得部により取得された静止画フレームのサイズをリアルタイムに変換して副画像データを生成する副画像サイズ変換部と、
前記主画像データを格納する第1ラインメモリと、
前記副画像データを格納する第2ラインメモリと、
前記第1または第2ラインメモリに格納されたデータを圧縮処理する静止画圧縮部と、
前記静止画圧縮部が圧縮した圧縮データを用いて圧縮パッケージを生成するCPUと、
前記圧縮パッケージの生成のワークエリアとして機能するとともに、各種データを格納するメインメモリと、を有し、
前記静止画圧縮部は、前記静止画フレーム内の有効エリア処理中に前記主画像データを圧縮し、前記静止画フレーム内のブランキングエリア処理中に前記副画像データを圧縮し、
前記CPUは、前記静止画フレーム内の有効エリア処理中に、前記ワークエリアに前記主画像データを圧縮した主画像圧縮データを書き込んでいき、前記静止画フレーム内のブランキングエリア処理中に、前記副画像データを圧縮した副画像圧縮データと、所定のヘッダデータと、を書き込むことにより前記圧縮パッケージを生成することを特徴とする撮像装置。
An image sensor;
A still image frame acquisition unit that acquires a still image frame from the moving image data acquired by the imaging device at an arbitrary timing;
A main image size conversion unit that converts the size of the still image frame acquired by the still image frame acquisition unit in real time to generate main image data;
A sub-image size conversion unit that converts the size of the still image frame acquired by the still image frame acquisition unit in real time to generate sub-image data;
A first line memory for storing the main image data;
A second line memory for storing the sub-image data;
A still image compression unit for compressing data stored in the first or second line memory;
A CPU that generates a compressed package using the compressed data compressed by the still image compression unit;
A main memory that functions as a work area for generating the compressed package and stores various data;
The still image compression unit compresses the main image data during effective area processing in the still image frame, compresses the sub-image data during blanking area processing in the still image frame,
The CPU writes main image compressed data obtained by compressing the main image data in the work area during the effective area processing in the still image frame, and during the blanking area processing in the still image frame, An imaging apparatus, wherein the compressed package is generated by writing sub-image compressed data obtained by compressing sub-image data and predetermined header data.
前記CPUは、前記静止画圧縮部による前副画像データの圧縮処理と並行して、前記ヘッダデータ、及び圧縮の終了した前記副画像データである副画像圧縮データを、前記圧縮パッケージの生成に用いる前記ワークエリアに書き込むことを特徴とする請求項1に記載の撮像装置。   The CPU uses the header data and the sub-image compressed data that is the sub-image data that has been compressed for generation of the compression package in parallel with the compression process of the previous sub-image data by the still image compression unit. The imaging apparatus according to claim 1, wherein writing is performed in the work area. 前記静止画圧縮部は、前記主画像データと前記主画像圧縮データから算出する圧縮率、前記主画像の圧縮に用いた量子化テーブル、前記ワークエリア内の副画像用の領域サイズ、及び前記副画像データのデータサイズを基に前記副画像データの圧縮に用いる量子化テーブルを調整することを特徴とする請求項1または請求項2に記載の撮像装置。   The still image compression unit includes the main image data and a compression ratio calculated from the main image compression data, a quantization table used for compressing the main image, a region size for a sub image in the work area, and the sub image The imaging apparatus according to claim 1, wherein a quantization table used for compression of the sub-image data is adjusted based on a data size of the image data. 前記CPUは、前記ワークエリアの内の副画像用の領域に前記副画像圧縮データを書き込み、空き領域が生じた場合には当該空き領域に無効データを書き込むことを特徴とする請求項1〜3のいずれか1項に記載の撮像装置。   4. The CPU according to claim 1, wherein the CPU writes the compressed sub-image data in a sub-image area of the work area, and writes invalid data in the empty area when an empty area occurs. The imaging device according to any one of the above. 前記メインメモリに格納された動画像データを圧縮処理する動画圧縮部を更に備え、
前記動画圧縮部は、前記主画像データと前記主画像圧縮データから算出する圧縮率、及び前記主画像の圧縮に用いた量子化テーブルに基づいて動画圧縮率を推定することを特徴とする請求項1〜4のいずれか1項に記載の撮像装置。
A moving image compression unit for compressing moving image data stored in the main memory;
The moving image compression unit estimates the moving image compression rate based on the main image data, a compression rate calculated from the main image compression data, and a quantization table used for compression of the main image. The imaging device according to any one of 1 to 4.
前記動画圧縮部は、前記主画像データと前記主画像圧縮データから算出する圧縮率、及び前記主画像の圧縮に用いた量子化テーブルに基づいて、動画圧縮に用いる量子化テーブルを調整することを特徴とする請求項5に記載の撮像装置。   The moving image compression unit adjusts a quantization table used for moving image compression based on the compression ratio calculated from the main image data and the main image compression data and the quantization table used for compression of the main image. The imaging apparatus according to claim 5, characterized in that: 前記ワークエリアの内の副画像用の領域は、固定サイズであることを特徴とする請求項3に記載の撮像装置。   The imaging apparatus according to claim 3, wherein a sub-image area in the work area has a fixed size. 撮像素子により取得された動画像データから任意のタイミングで静止画フレームを取得する静止画フレーム取得ステップと、
前記静止画フレーム取得ステップにて取得された静止画フレームのサイズをリアルタイムに変換して主画像データを生成する主画像サイズ変換ステップと、
前記静止画フレーム取得ステップにて取得された静止画フレームのサイズをリアルタイムに変換して副画像データを生成する副画像サイズ変換ステップと、
第1または第2ラインメモリに格納された前記主画像データまたは前記副画像データを圧縮処理する静止画圧縮ステップと、
前記静止画圧縮ステップにおいて圧縮した圧縮データを用いて圧縮パッケージを生成するパッケージステップと、を有し、
前記静止画圧縮ステップでは、前記静止画フレーム内の有効エリア処理中に前記主画像データを圧縮し、前記静止画フレーム内のブランキングエリア処理中に前記副画像データを圧縮し、
前記パッケージステップでは、前記静止画フレーム内の有効エリア処理中にメインメモリ内のワークエリアに前記主画像データを圧縮した主画像圧縮データを書き込んでいき、前記静止画フレーム内のブランキングエリア処理中に、前記副画像データを圧縮した副画像圧縮データと、所定のヘッダデータと、を書き込むことにより前記圧縮パッケージを生成する、ことを特徴とする画像圧縮方法。
A still image frame acquisition step of acquiring a still image frame from the moving image data acquired by the image sensor at an arbitrary timing;
A main image size conversion step of generating main image data by converting the size of the still image frame acquired in the still image frame acquisition step in real time;
A sub-image size conversion step of generating sub-image data by converting the size of the still image frame acquired in the still image frame acquisition step in real time;
A still image compression step for compressing the main image data or the sub image data stored in the first or second line memory;
A package step of generating a compressed package using the compressed data compressed in the still image compression step,
In the still image compression step, the main image data is compressed during effective area processing in the still image frame, and the sub-image data is compressed during blanking area processing in the still image frame,
In the packaging step, the main image compressed data obtained by compressing the main image data is written to the work area in the main memory during the effective area processing in the still image frame, and the blanking area processing in the still image frame is being performed. In addition, the compressed package is generated by writing sub-image compressed data obtained by compressing the sub-image data and predetermined header data.
JP2012172531A 2012-08-03 2012-08-03 Image pickup device and image compression method Pending JP2014033333A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012172531A JP2014033333A (en) 2012-08-03 2012-08-03 Image pickup device and image compression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012172531A JP2014033333A (en) 2012-08-03 2012-08-03 Image pickup device and image compression method

Publications (1)

Publication Number Publication Date
JP2014033333A true JP2014033333A (en) 2014-02-20

Family

ID=50282842

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012172531A Pending JP2014033333A (en) 2012-08-03 2012-08-03 Image pickup device and image compression method

Country Status (1)

Country Link
JP (1) JP2014033333A (en)

Similar Documents

Publication Publication Date Title
JP5056370B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, IMAGING DEVICE CONTROL PROGRAM, DATA PROCESSING DEVICE, DATA PROCESSING METHOD, AND DATA PROCESSING PROGRAM
US10082723B2 (en) Image capturing apparatus for generating a high dynamic range video frame from multiple image frames with different characteristics
KR101264389B1 (en) Imaging device and method
US9918062B2 (en) Image capturing apparatus, control method of image capturing apparatus, and image processing method
US10003767B2 (en) Image processing apparatus and image processing method
US9894270B2 (en) Image processing apparatus and image processing method for handling a raw image, of a moving image or a still image
US20110157426A1 (en) Video processing apparatus and video processing method thereof
US20160037014A1 (en) Imaging apparatus and imaging apparatus control method
JP4636755B2 (en) Imaging apparatus, image processing method, recording medium, and program
JP2007088806A (en) Image signal processor and image signal processing method
US9179065B2 (en) Image processing apparatus, image processing method, and program product
KR20160135826A (en) Image processing apparatus, method for controlling image processing apparatus, image pickup apparatus, method for controlling image pickup apparatus, and recording medium
US10360660B2 (en) Image processing apparatus and image processing method for handling raw images
US20100135644A1 (en) Photographing apparatus and method of controlling the same
US10397587B2 (en) Image processing apparatus and control method thereof
JP2017103753A (en) Imaging apparatus and recording method
JP2014033333A (en) Image pickup device and image compression method
JP4700992B2 (en) Image processing device
TWI424371B (en) Video processing device and processing method thereof
JP2020031336A (en) Imaging apparatus
JP2009130563A (en) Unit, method, and program for processing data, imaging apparatus, and method and program for controlling the same
JP2009130561A (en) Imaging apparatus, control method of imaging apparatus and control program of imaging apparatus
JP2010147531A (en) Imaging apparatus and imaging method
JP2023008624A (en) Imaging apparatus and control method thereof and program
JP2016063252A (en) Image processing device and image processing method