[go: up one dir, main page]

JP2018011120A - Imaging apparatus, control method for imaging apparatus, and program - Google Patents

Imaging apparatus, control method for imaging apparatus, and program Download PDF

Info

Publication number
JP2018011120A
JP2018011120A JP2016136861A JP2016136861A JP2018011120A JP 2018011120 A JP2018011120 A JP 2018011120A JP 2016136861 A JP2016136861 A JP 2016136861A JP 2016136861 A JP2016136861 A JP 2016136861A JP 2018011120 A JP2018011120 A JP 2018011120A
Authority
JP
Japan
Prior art keywords
data
memory
encoded
encoding
unit
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
JP2016136861A
Other languages
Japanese (ja)
Inventor
雅司 川上
Masashi Kawakami
雅司 川上
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2016136861A priority Critical patent/JP2018011120A/en
Publication of JP2018011120A publication Critical patent/JP2018011120A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Studio Devices (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

【課題】撮像された画像を符号化した符号化データを記憶するメモリが圧迫されるのを回避しつつ、高い画質を維持可能にすることを課題とする。【解決手段】周波数変換部(103)はプレーンデータを周波数変換した変換係数データを生成する。量子化部(104)は、変換係数データを量子化して量子化データを生成する。エントロピー符号化部(105)は、プレーンデータと変換係数データと量子化データの何れかを符号化する。制御部(110)は、符号化データを記憶するメモリ(107)の使用容量が閾値未満の場合、プレーンデータを符号化し、メモリ使用容量が閾値以上になった場合、1フレーム分の変換係数データを符号化した後、量子化データを符号化するように制御する。【選択図】図1An object of the present invention is to maintain high image quality while avoiding pressure on a memory that stores encoded data obtained by encoding a captured image. A frequency converter (103) generates conversion coefficient data obtained by frequency-converting plane data. The quantization unit (104) quantizes the transform coefficient data to generate quantized data. The entropy encoding unit (105) encodes any of plane data, transform coefficient data, and quantized data. The control unit (110) encodes plane data when the used capacity of the memory (107) for storing the encoded data is less than the threshold value, and transform coefficient data for one frame when the memory used capacity exceeds the threshold value. After encoding, control is performed so that the quantized data is encoded. [Selection] Figure 1

Description

本発明は、撮像された画像データを符号化する撮像装置、撮像装置の制御方法、及びプログラムに関する。   The present invention relates to an imaging apparatus that encodes captured image data, a control method for the imaging apparatus, and a program.

近年、デジタルカメラやデジタルカムコーダーの普及により、デジタル方式により静止画像や動画像を撮影することが広く普及してきている。これらのカメラは、JPEGやH.264に代表される符号化技術を用いて、静止画像や動画像の画像データを圧縮して記録することが一般的であるが、特許文献1には、撮像されたRAW(生)画像データを圧縮して記録できる撮像装置も開示されている。   In recent years, with the spread of digital cameras and digital camcorders, it has become widespread to shoot still images and moving images by digital methods. Generally, these cameras compress and record still image or moving image data using an encoding technique typified by JPEG or H.264. An imaging apparatus capable of compressing and recording the raw RAW image data is also disclosed.

JPEGやH.264に代表される符号化技術では、記録されるデータ量を抑制するために、比較的重要度が低い情報に対して量子化を行うロッシー符号化によりデータ量を削減するのが一般的であるが、量子化を行わないロスレス符号化を行うこともある。また、特許文献2には、ロスレス符号化とロッシー符号化を切り替える構成を有する画像圧縮装置が開示されている。   In encoding techniques typified by JPEG and H.264, in order to reduce the amount of data to be recorded, the amount of data can be reduced by lossy encoding that quantizes relatively less important information. In general, lossless encoding without quantization may be performed. Patent Document 2 discloses an image compression apparatus having a configuration for switching between lossless encoding and lossy encoding.

特開2014−179853号公報JP 2014-179853 A 国際公開第2012/160626号International Publication No. 2012/160626

ここで、ロスレス符号化とロッシー符号化の切り替えが行われる場合の想定例としては、連写撮影された静止画像や動画像等の画像データを一時記憶するメモリの圧迫回避などが挙げられる。例えば、メモリの空き容量が十分残っている場合には画質劣化が無いロスレス符号化を行うようにし、メモリの空き容量が少なくなったときに、ロッシー符号化に切り替えて発生符号量を減らすことで、メモリの圧迫を回避する。特に、ロスレス符号化では、画像によって、発生符号量が非常に大きくなることがあり、その発生符号量がメモリの空き容量を超えてしまう場合にはメモリが破綻してしまう。このため、メモリの空き容量が少なくなった場合に、ロスレス符号化からロッシー符号化に切り替えて発生符号量を減らすことにより、メモリの圧迫による破綻を回避する。   Here, as an assumption example when switching between lossless encoding and lossy encoding is performed, there is a pressure avoidance of a memory that temporarily stores image data such as still images and moving images taken continuously. For example, if there is sufficient free memory space, lossless coding is performed without image quality degradation, and when the free memory space decreases, switching to lossy coding reduces the amount of generated code. , Avoid memory pressure. In particular, in lossless encoding, the amount of generated code may be very large depending on the image, and if the generated code amount exceeds the free space of the memory, the memory will fail. For this reason, when the free space of the memory is reduced, the loss due to the compression of the memory is avoided by switching from lossless encoding to lossy encoding to reduce the generated code amount.

しかしながら、ロスレス符号化からロッシー符号化に切り替えられた直後は、ロッシー符号化であっても、符号化により発生する符号量が、ロスレス符号化の場合とさほど変わらないことがあり、この場合、メモリの圧迫回避が不十分になる虞がある。一方、ロッシー符号化による発生符号量を抑えるために、比較的重要度が低い情報を大幅に削減するような量子化を行うと、画質が大きく劣化することになり、符号化の切り替えがなされた箇所での画質変動が目立つようになってしまう。   However, immediately after switching from lossless encoding to lossy encoding, even in lossy encoding, the amount of code generated by encoding may not be much different from that in lossless encoding. There is a risk that the avoidance of pressure will be insufficient. On the other hand, in order to suppress the amount of generated code due to lossy encoding, if quantization is performed to significantly reduce information of relatively low importance, the image quality will be greatly degraded, and encoding switching has been performed. Variations in image quality at locations will become noticeable.

そこで、本発明は、撮像された画像を符号化した符号化データを記憶するメモリの圧迫を回避しつつ、符号化の切り替えの際の画質の変動を少なくすることを目的とする。   Accordingly, an object of the present invention is to reduce fluctuations in image quality when switching encoding while avoiding compression of a memory that stores encoded data obtained by encoding a captured image.

本発明は、フレーム画像に対して周波数変換を行って第1の係数データを生成する周波数変換手段と、第1の係数データを量子化パラメータに基づいて量子化して第2の係数データを生成する量子化手段と、入力されたデータを符号化して符号化データを生成する符号化手段と、符号化を制御する制御手段と、を有し、制御手段は、複数のフレーム画像から生成された複数の符号化データをメモリに記憶させる際に、メモリ内で符号化データの占める容量が所定の閾値未満である場合にはフレーム画像のデータを符号化し、メモリ内で符号化データの占める容量が所定の閾値以上となった場合には少なくとも1フレーム分の第1の係数データを符号化した後、第2の係数データを符号化するように制御することを特徴とする。   According to the present invention, frequency conversion means for performing frequency conversion on a frame image to generate first coefficient data, and second coefficient data are generated by quantizing the first coefficient data based on a quantization parameter. A quantization unit; an encoding unit that encodes input data to generate encoded data; and a control unit that controls encoding. The control unit includes a plurality of frames generated from a plurality of frame images. When the encoded data is stored in the memory, if the capacity occupied by the encoded data in the memory is less than a predetermined threshold, the frame image data is encoded, and the capacity occupied by the encoded data in the memory is predetermined. When the threshold value is equal to or greater than the threshold, the first coefficient data for at least one frame is encoded, and then the second coefficient data is controlled to be encoded.

本発明によれば、撮像された画像を符号化した符号化データを記憶するメモリが圧迫されるのを回避しつつ、符号化の切り替えの際の画質の変動を少なくすることが可能となる。   According to the present invention, it is possible to reduce fluctuations in image quality when switching between encodings while avoiding pressure on a memory that stores encoded data obtained by encoding a captured image.

第1の実施形態の撮像装置の概略構成例を示す図である。It is a figure which shows the example of schematic structure of the imaging device of 1st Embodiment. プレーン変換の説明に用いる図である。It is a figure used for description of plane conversion. プレーンデータをDWT処理した際のサブバンドの説明に用いる図である。It is a figure used for description of a subband at the time of carrying out DWT processing of plane data. 量子化ステップ値を決定する際の参照先の説明に用いる図である。It is a figure used for description of the reference place at the time of determining a quantization step value. 想定例におけるメモリ使用容量遷移と符号化部への入力を示す図である。It is a figure which shows the memory use capacity transition in an assumption example, and the input to an encoding part. 制御部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of a control part. 第1の実施形態のメモリ使用容量遷移と符号化部への入力を示す図である。It is a figure which shows the memory use capacity transition of 1st Embodiment, and the input to an encoding part. 第2の実施形態の撮像装置の概略構成例を示す図である。It is a figure which shows the schematic structural example of the imaging device of 2nd Embodiment. 第2の実施形態のメモリ使用容量遷移と符号化部への入力を示す図である。It is a figure which shows the memory use capacity transition of 2nd Embodiment, and the input to an encoding part.

以下、添付図面を参照して、本発明の一実施形態について説明する。
<第1の実施形態>
図1は、第1の実施形態の撮像装置100の概略構成を示す図である。
本実施形態の撮像装置100は、撮像部101、プレーン変換部102、周波数変換部103、量子化部104、エントロピー符号化部105、メモリI/F部106、メモリ107、記録処理部108、記録媒体109、制御部110、MUX111を有する。
Hereinafter, an embodiment of the present invention will be described with reference to the accompanying drawings.
<First Embodiment>
FIG. 1 is a diagram illustrating a schematic configuration of an imaging apparatus 100 according to the first embodiment.
The imaging apparatus 100 according to the present embodiment includes an imaging unit 101, a plane conversion unit 102, a frequency conversion unit 103, a quantization unit 104, an entropy encoding unit 105, a memory I / F unit 106, a memory 107, a recording processing unit 108, a recording A medium 109, a control unit 110, and a MUX 111 are included.

制御部110は、少なくとも、プレーン変換部102と、周波数変換部103と、量子化部104と、エントロピー符号化部105と、MUX111とを制御する。   The control unit 110 controls at least the plane conversion unit 102, the frequency conversion unit 103, the quantization unit 104, the entropy encoding unit 105, and the MUX 111.

撮像部101は、レンズ光学系、絞り、レンズ光学系と絞りの制御及び駆動を行う駆動部、撮像素子等を有する。レンズ光学系は、焦点調整を可能にするフォーカス光学系と光学ズームを可能にするズーム光学系等を含む。駆動部は、フォーカス光学系に対するフォーカス制御及びレンズ駆動部と、絞りに対する絞り制御及び絞り駆動部を有しており、さらにズーム光学系に対するズーム制御及びレンズ駆動部を有していてもよい。撮像素子は、CCDイメージセンサー又はCMOSセンサーからなり、レンズ光学系により撮像面上に結像された光学像を電気信号に変換する。そして、撮像部101は、撮像素子により得られた電気信号をデジタル信号へ変換したRAW(生)データを、撮像によるフレーム画像(以下、フレームと表記する。)のデータとしてプレーン変換部102へ送る。   The imaging unit 101 includes a lens optical system, a diaphragm, a driving unit that controls and drives the lens optical system and the diaphragm, an imaging element, and the like. The lens optical system includes a focus optical system that enables focus adjustment, a zoom optical system that enables optical zoom, and the like. The drive unit includes a focus control and lens drive unit for the focus optical system, an aperture control and aperture drive unit for the aperture, and may further include a zoom control and lens drive unit for the zoom optical system. The imaging element is composed of a CCD image sensor or a CMOS sensor, and converts an optical image formed on the imaging surface by a lens optical system into an electrical signal. Then, the imaging unit 101 sends RAW (raw) data obtained by converting an electrical signal obtained by the imaging element into a digital signal to the plane conversion unit 102 as data of a frame image (hereinafter referred to as a frame) by imaging. .

プレーン変換部102は、撮像部101から供給されたRAWデータを、色成分毎のデータに変換する。以下、RAWデータを色成分毎のデータに変換することをプレーン変換と呼ぶ。図2は、プレーン変換の説明図である。図2において、RAWデータ200は、いわゆるベイヤー配列に対応したデータであり、図中のRは赤色、G(G1,G2)は緑色、Bは青色の各画素を表している。プレーン変換部102は、RAWデータ200を、R成分のプレーン201Rと、G1成分のプレーン201G1と、G2成分のプレーン201G2と、B成分のプレーン201Bとの、四つのプレーンの画像データに変換する。本実施形態では、RAWデータをプレーン変換した各色成分のプレーンの画像データが、後述する周波数変換部103と後述するMUX111とに送られる。以下、プレーン変換により得られた各色成分の各プレーンの画像データをプレーンデータと呼ぶ。   The plane conversion unit 102 converts the RAW data supplied from the imaging unit 101 into data for each color component. Hereinafter, converting RAW data into data for each color component is referred to as plane conversion. FIG. 2 is an explanatory diagram of plane conversion. In FIG. 2, RAW data 200 is data corresponding to a so-called Bayer array, and R in the figure represents red, G (G1, G2) represents green, and B represents blue. The plane conversion unit 102 converts the RAW data 200 into image data of four planes, that is, an R component plane 201R, a G1 component plane 201G1, a G2 component plane 201G2, and a B component plane 201B. In this embodiment, plane image data of each color component obtained by plane conversion of RAW data is sent to a frequency conversion unit 103 described later and a MUX 111 described later. Hereinafter, the image data of each plane of each color component obtained by plane conversion is referred to as plane data.

周波数変換部103は、プレーン変換部102から供給された色成分毎のプレーンデータに対して、それぞれ周波数変換処理を行う。周波数変換処理の一例として、いわゆる離散ウェーブレット変換(Discrete Wavelet Transform:以下、DWTと表記する。)処理が行われる場合について、図3を用いて説明する。図3において、プレーンデータ300は、前述した四つのプレーンデータのうちの何れか一つであるとする。周波数変換部103は、プレーンデータ300をDWT処理により複数の周波数帯に分解する周波数分解処理を3回行うことにより、周波数帯毎の変換係数データからなるサブバンドデータ301を生成する。本実施形態では、このサブバンドデータ301における周波数帯毎の変換係数データが本発明に係る第1の係数データに相当する。以下、プレーンデータ300がDWT処理された各周波数帯をサブバンドと表記する。図3のサブバンドデータ301のうち、サブバンド"0"はDC(直流)成分の変換係数データを表しており、サブバンド"1"〜"9"はAC(交流)成分の変換係数データを表している。周波数変換部103により生成されたサブバンドデータは、後述する量子化部104と後述するMUX111とに送られる。   The frequency conversion unit 103 performs frequency conversion processing on the plane data for each color component supplied from the plane conversion unit 102. As an example of the frequency conversion process, a case where a so-called discrete wavelet transform (hereinafter referred to as DWT) process is performed will be described with reference to FIG. In FIG. 3, it is assumed that the plane data 300 is any one of the four plane data described above. The frequency conversion unit 103 generates subband data 301 including conversion coefficient data for each frequency band by performing frequency decomposition processing for decomposing the plane data 300 into a plurality of frequency bands by DWT processing three times. In the present embodiment, the conversion coefficient data for each frequency band in the subband data 301 corresponds to the first coefficient data according to the present invention. Hereinafter, each frequency band in which the plane data 300 has been subjected to DWT processing is referred to as a subband. In subband data 301 of FIG. 3, subband “0” represents DC (direct current) component conversion coefficient data, and subbands “1” to “9” represent AC (alternating current) component conversion coefficient data. Represents. The subband data generated by the frequency conversion unit 103 is sent to a quantization unit 104 described later and a MUX 111 described later.

量子化部104は、サブバンドデータ内の各サブバンドの各変換係数データを、量子化パラメータの一つである量子化ステップ値で除算して量子化データを生成する。すなわち、各サブバンドの各変換係数データは、量子化ステップ値で除算されることにより圧縮されることになる。本実施形態では、この量子化データが本発明に係る第2の係数データに相当する。量子化部104による量子化処理で得られた量子化データは、後述するMUX111に送られる。   The quantization unit 104 divides the transform coefficient data of each subband in the subband data by a quantization step value that is one of the quantization parameters to generate quantized data. That is, each transform coefficient data of each subband is compressed by being divided by the quantization step value. In the present embodiment, this quantized data corresponds to the second coefficient data according to the present invention. The quantized data obtained by the quantization processing by the quantization unit 104 is sent to the MUX 111 described later.

MUX111は、制御部110からの制御信号に基づいて、複数の入力データから1つのデータを選択して出力するマルチプレクサである。MUX111から出力されたデータは、エントロピー符号化部105へ送られる。本実施形態の場合、MUX111には、前述したプレーン変換部102から出力されたプレーンデータと、周波数変換部103から出力されたサブバンドデータと、量子化部104から出力された量子化データとの、三つのデータが入力される。本実施形態では、撮像装置100の動作モードが、第1の動作モードである場合、制御部110は、プレーン変換部102からのプレーンデータを、エントロピー符号化部105へ出力するようにMUX111を制御する。また、撮像装置100の動作モードが、第2の動作モードである場合、制御部110は、周波数変換部103からのサブバンドデータを、エントロピー符号化部105へ出力するようにMUX111を制御する。また、撮像装置100の動作モードが、第3の動作モードである場合、制御部110は、量子化部104からの量子化データをエントロピー符号化部105へ出力するようにMUX111を制御する。   The MUX 111 is a multiplexer that selects and outputs one data from a plurality of input data based on a control signal from the control unit 110. Data output from the MUX 111 is sent to the entropy encoding unit 105. In the case of the present embodiment, the MUX 111 includes the plane data output from the plane conversion unit 102, the subband data output from the frequency conversion unit 103, and the quantized data output from the quantization unit 104. , Three data are input. In the present embodiment, when the operation mode of the imaging apparatus 100 is the first operation mode, the control unit 110 controls the MUX 111 so that the plane data from the plane conversion unit 102 is output to the entropy encoding unit 105. To do. Further, when the operation mode of the imaging apparatus 100 is the second operation mode, the control unit 110 controls the MUX 111 so as to output the subband data from the frequency conversion unit 103 to the entropy encoding unit 105. When the operation mode of the imaging apparatus 100 is the third operation mode, the control unit 110 controls the MUX 111 so that the quantized data from the quantization unit 104 is output to the entropy encoding unit 105.

エントロピー符号化部105は、MUX111から供給されたデータに対してエントロピー符号化を行う。具体的には、撮像装置100が例えば第1の動作モードである場合、エントロピー符号化部105は、MUX111を介して供給されたプレーンデータに対してエントロピー符号化を行う。また、撮像装置100が第2の動作モードである場合、エントロピー符号化部105は、MUX111を介して供給されたサブバンドデータに対してエントロピー符号化を行う。また、撮像装置100が第3の動作モードである場合、エントロピー符号化部105は、MUX111を介して供給された量子化データに対してエントロピー符号化を行う。なお、エントロピー符号化の方式としては、ゴロム符号化や、ランレングス符号化、ハフマン符号化、算術符号化等の可逆符号化が考えられるが、ここではその方式については限定せず、どのような方式が用いられてもよい。エントロピー符号化部105での符号化により生成された符号化データは、メモリI/F部106に送られる。   The entropy encoding unit 105 performs entropy encoding on the data supplied from the MUX 111. Specifically, when the imaging apparatus 100 is in the first operation mode, for example, the entropy encoding unit 105 performs entropy encoding on the plane data supplied via the MUX 111. When the imaging apparatus 100 is in the second operation mode, the entropy encoding unit 105 performs entropy encoding on the subband data supplied via the MUX 111. Further, when the imaging apparatus 100 is in the third operation mode, the entropy encoding unit 105 performs entropy encoding on the quantized data supplied via the MUX 111. In addition, as a method of entropy coding, lossless coding such as Golomb coding, run-length coding, Huffman coding, arithmetic coding, etc. can be considered, but the method is not limited here and any A scheme may be used. The encoded data generated by the encoding in the entropy encoding unit 105 is sent to the memory I / F unit 106.

また、エントロピー符号化部105による符号化で発生した符号量を示す情報は、量子化部104にフィードバックされる。本実施形態の場合、例えば第2の動作モードでサブバンドデータの符号化が行われた場合、1フレーム分の発生符号量の情報とともに、サブバンド毎の変換係数データの符号化によるサブバンド毎の発生符号量の情報が、量子化部104に送られる。また、第3の動作モードでサブバンド毎の量子化データの符号化が行われた場合にも、1フレーム分の発生符号量の情報とともに、サブバンド毎の量子化データの符号化によるサブバンド毎の発生符号量の情報が、量子化部104に送られる。このように、エントロピー符号化部105は、第2及び第3の動作モードにおけるサブバンド毎の発生符号量の情報を、1フレーム分の発生符号量の情報とともに量子化部104にフィードバックする。   Information indicating the code amount generated by the encoding by the entropy encoding unit 105 is fed back to the quantization unit 104. In the case of this embodiment, for example, when subband data is encoded in the second operation mode, for each subband by encoding transform coefficient data for each subband together with information on the generated code amount for one frame. The generated code amount information is sent to the quantization unit 104. In addition, when the quantized data is encoded for each subband in the third operation mode, the subband is generated by encoding the quantized data for each subband together with information on the generated code amount for one frame. Information on the amount of generated code for each is sent to the quantization unit 104. As described above, the entropy encoding unit 105 feeds back the generated code amount information for each subband in the second and third operation modes to the quantization unit 104 together with the generated code amount information for one frame.

量子化部104は、エントロピー符号化部105からフィードバックされた発生符号量の情報を参照して、量子化パラメータの一つである量子化ステップ値を決定する。本実施形態の場合、量子化部104には、1フレーム分の発生符号量とサブバンド毎の発生符号量の情報が、フィードバックされる。したがって、量子化部104は、1フレーム分の発生符号量だけでなく、サブバンド毎の発生符号量をも参照して、サブバンド毎の細かな量子化ステップ値を決定する。   The quantization unit 104 refers to the generated code amount information fed back from the entropy encoding unit 105 and determines a quantization step value that is one of the quantization parameters. In the case of the present embodiment, the quantization unit 104 is fed back information on the generated code amount for one frame and the generated code amount for each subband. Therefore, the quantization unit 104 determines a fine quantization step value for each subband by referring not only to the generated code amount for one frame but also to the generated code amount for each subband.

以下、図4を用い、量子化部104が、サブバンド毎の発生符号量を参照して、サブバンド毎の細かな量子化ステップ値を決定する処理の動作について説明する。量子化ステップ値の決定の際には、1フレーム分の発生符号量も参照されるが、以下の説明では、1フレーム分の発生符号量の参照動作については省略する。   Hereinafter, the operation of the process in which the quantization unit 104 determines a fine quantization step value for each subband with reference to the generated code amount for each subband will be described with reference to FIG. In determining the quantization step value, the generated code amount for one frame is also referred to, but in the following description, the reference operation for the generated code amount for one frame is omitted.

図4の横軸は時間を示し、時点Taは例えば静止画像を連続撮像する連写により取得された時系列の各フレームのうち、1枚目のフレームの撮影タイミングを示し、時点Tbは2枚目のフレームの撮影タイミングを示しているとする。なお、時点TaとTbは動画撮影による連続した時系列の各フレームのうち1枚目と2枚目のフレームの撮影タイミングであってもよい。以下、静止画像の連写撮影がなされる場合のみを例に挙げて説明する。図4のサブバンドデータ401は、時点Taで撮影されたフレームの一つのプレーンデータから周波数変換処理により生成された各サブバンドの変換係数データを表しているとする。また、サブバンドデータ402は、時点Tbで撮影されたフレームの同プレーンデータから周波数変換処理により生成された各サブバンドの変換係数データを表しているとする。   The horizontal axis in FIG. 4 indicates time, and the time point Ta indicates, for example, the shooting timing of the first frame among the time-series frames acquired by continuous shooting for continuously capturing still images, and the time point Tb indicates two frames. Assume that the shooting timing of the eye frame is shown. Note that the points in time Ta and Tb may be the shooting timings of the first frame and the second frame in each successive time-series frame by moving image shooting. Hereinafter, only a case where continuous shooting of still images is performed will be described as an example. The subband data 401 in FIG. 4 represents conversion coefficient data of each subband generated by frequency conversion processing from one plane data of a frame shot at the time Ta. Further, it is assumed that the subband data 402 represents conversion coefficient data of each subband generated by frequency conversion processing from the same plane data of the frame shot at the time Tb.

ここで、例えば静止画像の連写撮影が行われている場合、時系列順の各フレームの画像は、時間方向において相関が高くなっていると考えられる。なお、動画撮影が行われている場合も、その動画撮影による時系列順の各フレームの画像は、時間方向で相関が高いと考えられる。このため、量子化部104は、時点Tbで得られたサブバンドデータ402の量子化を行う際には、1フレーム前の時点Taで得られたサブバンドデータ401のサブバンド毎の発生符号量を参照して、サブバンド毎に量子化ステップ値を決定する。例えば、サブバンドデータ402内のサブバンド"5"の変換係数データを量子化する際には、サブバンドデータ401内の同サブバンド"5"での発生符号量を参照して、そのサブバンド"5"に対応した量子化ステップ値が決められる。このように、量子化部104は、各サブバンドの量子化ステップ値を決定する際には、時間方向で相関が高いと考えられる1フレーム前の同サブバンドにおける発生符号量を参照値として利用する。このため量子化部104は、エントロピー符号化部105からフィードバックされる1フレーム前の各発生符号量の情報を記憶する記憶素子を有している。   Here, for example, when continuous shooting of still images is performed, it is considered that the images of the frames in the time series order have a high correlation in the time direction. Even when moving image shooting is performed, it is considered that the images of the frames in time-series order by the moving image shooting have a high correlation in the time direction. Therefore, when the quantization unit 104 quantizes the subband data 402 obtained at the time point Tb, the generated code amount for each subband of the subband data 401 obtained at the time point Ta one frame before is obtained. The quantization step value is determined for each subband. For example, when the transform coefficient data of the subband “5” in the subband data 402 is quantized, the generated code amount in the subband “5” in the subband data 401 is referred to and the subband data 402 is referred to. A quantization step value corresponding to “5” is determined. Thus, when determining the quantization step value of each subband, the quantization unit 104 uses the generated code amount in the same subband one frame before, which is considered to have a high correlation in the time direction, as a reference value. To do. Therefore, the quantization unit 104 includes a storage element that stores information on each generated code amount one frame before fed back from the entropy encoding unit 105.

図1に説明を戻す。メモリI/F部106は、撮像装置100の各部からのメモリ・アクセス要求を調停し、メモリ107に対する読み出し・書き込みの制御を行う。前述したエントロピー符号化部105によるエントロピー符号化後の符号化データは、メモリI/F部106を介して、メモリ107に一時的に記憶される。   Returning to FIG. The memory I / F unit 106 arbitrates memory access requests from each unit of the imaging apparatus 100 and controls reading / writing with respect to the memory 107. The encoded data after the entropy encoding by the entropy encoding unit 105 described above is temporarily stored in the memory 107 via the memory I / F unit 106.

メモリ107は、エントロピー符号化後の符号化データや、撮像装置100の各部から出力される各種データを一時的に記憶するための例えば揮発性メモリからなる記憶領域である。メモリ107に一時的に記憶された符号化データは、メモリI/F部106を介して記録処理部108に送られる。   The memory 107 is a storage area composed of, for example, a volatile memory for temporarily storing encoded data after entropy encoding and various data output from each unit of the imaging apparatus 100. The encoded data temporarily stored in the memory 107 is sent to the recording processing unit 108 via the memory I / F unit 106.

記録処理部108は、メモリ107から読み出された符号化データから、記録媒体109への記録に適した記録データを生成し、その記録データを記録媒体109に記録する。記録媒体109は、例えば不揮発性メモリで構成される記録メディアである。なお、本実施形態の撮像装置100は、記録媒体109から記録データを再生することも可能となされているが、その再生のための構成等の説明及び図示は省略する。   The recording processing unit 108 generates recording data suitable for recording on the recording medium 109 from the encoded data read from the memory 107 and records the recording data on the recording medium 109. The recording medium 109 is a recording medium composed of, for example, a nonvolatile memory. Note that the imaging apparatus 100 according to the present embodiment can reproduce recorded data from the recording medium 109, but the description and illustration of the configuration and the like for the reproduction are omitted.

<ロスレス符号化とロッシー符号化の切り替え想定例>
ここで、連写撮影等による各フレームの符号化データをバッファメモリに一時記憶させた後に記録媒体に記録する際に、バッファメモリ内で符号化データが占める容量に応じてロスレス符号化とロッシー符号化を切り替える例について想定してみる。なお、この想定例は、ロスレス符号化とロッシー符号化の切り替えにより生ずる可能性がある問題点について説明するための例であって、図1に示した本実施形態による後述する符号化の切り替え制御との差異を説明するための例である。
<Example of switching between lossless coding and lossy coding>
Here, when the encoded data of each frame by continuous shooting or the like is temporarily stored in the buffer memory and then recorded on the recording medium, lossless encoding and lossy encoding are performed according to the capacity occupied by the encoded data in the buffer memory. Let's assume an example of switching the conversion. This assumption example is an example for explaining a problem that may occur due to switching between lossless coding and lossy coding, and coding switching control described later according to the present embodiment shown in FIG. It is an example for demonstrating the difference.

本想定例において、ロスレス符号化では、撮像されたRAWデータをプレーン変換したプレーンデータに対して、エントロピー符号化が行われるとする。一方、ロッシー符号化では、プレーンデータを周波数変換処理した各サブバンドデータに量子化処理を行った後の量子化データに対して、エントロピー符号化が行われるとする。また本想定例において、ロスレス符号化からロッシー符号化への切り替えは、バッファメモリ内で符号化データが占める容量(以下、使用容量と表記する。)が、所定の閾値以上になったときに行われるとする。   In this assumption example, it is assumed that in lossless encoding, entropy encoding is performed on plane data obtained by plane-converting captured RAW data. On the other hand, in lossy coding, it is assumed that entropy coding is performed on the quantized data after the quantization processing is performed on each subband data obtained by subjecting the plane data to frequency conversion processing. In this assumption example, switching from lossless encoding to lossy encoding is performed when the capacity occupied by the encoded data in the buffer memory (hereinafter referred to as “used capacity”) exceeds a predetermined threshold. Let's say.

図5は、本想定例において、連写撮影された静止画像の各フレームの符号化データをバッファメモリに一時的に記憶した後、記録媒体へ転送して記録する場合のバッファメモリの使用容量の遷移例を示す図である。図5の例では、エントロピー符号化されてバッファメモリに記憶される符号化データの単位時間当たりの符号量が、バッファメモリから読み出されて記録媒体へ転送される単位時間当たりの転送データ量を超えている場合を示している。   FIG. 5 illustrates the capacity of the buffer memory used in the case where the encoded data of each frame of still images taken continuously is temporarily stored in the buffer memory and then transferred to the recording medium and recorded in this example. It is a figure which shows the example of a transition. In the example of FIG. 5, the code amount per unit time of the encoded data that is entropy encoded and stored in the buffer memory is the transfer data amount per unit time that is read from the buffer memory and transferred to the recording medium. Indicates the case where the number is exceeded.

図5のグラフ500の横軸は時間を示しており、縦軸はバッファメモリの容量を示しており、折れ線502がバッファメモリの使用容量の遷移を表している。また、図5のグラフ500の横軸の各目盛は、連写撮影による1枚分のフレームの符号化データがバッファメモリに記憶される時間を示している。また、図5の時点T1は、連写撮影された例えば1枚目のフレームの符号化データがバッファメモリに記憶されたタイミングを示している。以下同様であり、時点T2〜T13・・・は2枚目〜13枚目・・・の各フレームの符号化データがバッファメモリに記憶されたタイミングを示している。また、時点T0は撮影開始のタイミングを表し、時点T0からT2までの間では、折れ線502で示されるメモリ使用量は徐々に増加するが、時点T2ではメモリ使用容量が低下する。これはバッファメモリから記録媒体へのデータ転送処理が終了したことでバッファメモリ内に1枚目の符号化データ分だけ容量の空きができたことを表している。なお、バッファメモリから記録媒体へのデータ転送は、実際には1枚目のフレームがバッファメモリに記憶された時点T1から始まっている。図5の例では、説明を分かりやすくするために、時点T2のデータ転送完了のタイミングで、メモリ使用量が1枚目の符号化データ分だけ空くような(データ量が差し引かれるような)イメージで折れ線502が描かれている。   The horizontal axis of the graph 500 in FIG. 5 indicates time, the vertical axis indicates the capacity of the buffer memory, and the broken line 502 indicates the transition of the used capacity of the buffer memory. Each scale on the horizontal axis of the graph 500 in FIG. 5 indicates the time for which encoded data of one frame by continuous shooting is stored in the buffer memory. Further, a time point T1 in FIG. 5 indicates a timing at which encoded data of, for example, the first frame obtained by continuous shooting is stored in the buffer memory. The same applies to the following, and time points T2 to T13... Indicate the timing at which the encoded data of the second to thirteenth frames are stored in the buffer memory. The time point T0 represents the timing of the start of photographing. From the time point T0 to T2, the memory usage indicated by the broken line 502 gradually increases, but the memory usage capacity decreases at the time point T2. This means that the capacity for the first encoded data has been made available in the buffer memory by completing the data transfer process from the buffer memory to the recording medium. Note that the data transfer from the buffer memory to the recording medium actually starts at time T1 when the first frame is stored in the buffer memory. In the example of FIG. 5, for the sake of easy understanding, an image in which the memory usage is freed by the first encoded data (data amount is subtracted) at the timing of completion of the data transfer at time T <b> 2. A broken line 502 is drawn.

また、図5のタイムチャート501は、エントロピー符号化処理へ入力されるデータの入力タイミングを表している。本想定例の場合、連写撮影の開始直後はバッファメモリの使用容量に余裕があるため、連写撮影による各フレームのプレーンデータがエントロピー符号化処理への入力データとなされて、ロスレス符号化が行われる。このため、図5の入力データIN0やIN1は、プレーンデータ、つまり周波数変換処理及び量子化処理が行われていないデータである。   A time chart 501 in FIG. 5 represents the input timing of data input to the entropy encoding process. In the case of this assumption example, since the buffer memory has a sufficient capacity immediately after the start of continuous shooting, the plane data of each frame by continuous shooting is used as input data to the entropy encoding process, and lossless encoding is performed. Done. Therefore, the input data IN0 and IN1 in FIG. 5 are plane data, that is, data that has not been subjected to frequency conversion processing and quantization processing.

一方、図5のグラフ500の時点Txは、折れ線502で示されるバッファメモリの使用容量が、所定の閾値以上(Th以上)となったタイミングを表している。このようにバッファメモリの使用容量が所定の閾値Th以上になった場合、バッファメモリへ記憶されるデータ量を抑えるために、これ以降は符号化方式がロッシー符号化に切り替えられる。ロスレス符号化は、画像によって発生符号量が大きくなる可能性があり、発生符号量がバッファメモリの空き容量を超えてしまうと、符号化データの記憶が出来なくなり破綻してしまうため、これ以降は符号化方式がロッシー符号化に切り替えられる。本想定例の場合は、周波数変換部処理及び量子化処理がなされた後の量子化データをエントロピー符号化するようなロッシー符号化を行って発生符号量を抑える。図5の場合、バッファメモリの使用容量が閾値Th以上になった時点Txの次の時点T12以降は、周波数変換処理及び量子化処理がなされた後の量子化データIN12,IN13・・・を、エントロピー符号化処理への入力データとする。   On the other hand, a time point Tx in the graph 500 of FIG. 5 represents a timing at which the used capacity of the buffer memory indicated by the broken line 502 becomes equal to or greater than a predetermined threshold (Th or greater). As described above, when the used capacity of the buffer memory becomes equal to or greater than the predetermined threshold Th, the encoding method is switched to lossy encoding thereafter in order to reduce the amount of data stored in the buffer memory. In lossless encoding, the amount of generated code may increase depending on the image, and if the generated code amount exceeds the free space of the buffer memory, the encoded data cannot be stored, and the failure occurs. The encoding method is switched to lossy encoding. In the case of this assumption example, the amount of generated code is suppressed by performing lossy encoding such that entropy encoding is performed on the quantized data after the frequency conversion process and the quantization process. In the case of FIG. 5, after the time T12 after the time Tx when the used capacity of the buffer memory becomes equal to or greater than the threshold Th, the quantized data IN12, IN13,... After the frequency conversion process and the quantization process are performed. This is input data to the entropy encoding process.

ここで、量子化処理では、量子化ステップ値を決め、周波数変換処理によるサブバンド毎の変換係数データを、その量子化ステップ値で除算することにより、データの圧縮が行われる。量子化ステップ値は、例えば連写撮影された各フレームの画像が時間方向において有している相関を利用することにより決めている。具体的には、1フレーム前に符号化された画像の発生符号量を参照し、その発生符号量に基づいて量子化ステップ値が決められる。また、発生符号量を参照する際には、前述の図4で説明したように、1フレーム分の発生符号量だけでなく、サブバンド毎の量子化データの符号化により発生したサブバンド毎の発生符号量が参照される。このように、サブバンド毎の発生符号量に応じてサブバンド毎に量子化ステップ値を変えることで、より細かな量子化ステップ値が設定されることになる。   Here, in the quantization process, data is compressed by determining a quantization step value and dividing the transform coefficient data for each subband by the frequency conversion process by the quantization step value. The quantization step value is determined, for example, by using the correlation that the images of each frame that has been continuously shot have in the time direction. Specifically, referring to the generated code amount of an image encoded one frame before, the quantization step value is determined based on the generated code amount. Further, when referring to the generated code amount, as described with reference to FIG. 4 above, not only the generated code amount for one frame but also the sub-band generated by encoding the quantized data for each sub-band. The generated code amount is referred to. In this way, a finer quantization step value is set by changing the quantization step value for each subband in accordance with the generated code amount for each subband.

ただし、図5の想定例の場合、時点T12以降でロッシー符号化への切り替えが行われるが、時点T12より前ではロスレス符号化が行われており、周波数変換処理及び量子化処理は行われていない。このため、入力データIN12の量子化データを生成する際に使用される量子化ステップ値は、1フレーム前に行われたロスレス符号化によるプレーンデータ毎の発生符号量のみを参照して決定された値となされている。したがって、入力データIN12は、周波数変換処理によるサブバンド毎の変換係数データを、プレーンデータ毎の発生符号量を参照して決定した量子化ステップ値を用いて量子化したデータとなる。すなわち、入力データIN12は、サブバンド毎の発生符号量に応じた細かく適切な量子化ステップ値ではなく、プレーンデータ毎の発生符号量に応じた大まかな量子化ステップ値を用いて、サブバンド毎の変換係数データを量子化したデータとなる。   However, in the case of the assumption example in FIG. 5, switching to lossy coding is performed after time T12, but lossless coding is performed before time T12, and frequency conversion processing and quantization processing are performed. Absent. For this reason, the quantization step value used when generating the quantized data of the input data IN12 is determined by referring only to the generated code amount for each plane data by the lossless encoding performed one frame before. Value. Therefore, the input data IN12 is data obtained by quantizing the transform coefficient data for each subband by the frequency transform process using the quantization step value determined with reference to the generated code amount for each plane data. That is, the input data IN12 is not a fine and appropriate quantization step value corresponding to the generated code amount for each subband, but a rough quantization step value corresponding to the generated code amount for each plane data. The conversion coefficient data is quantized data.

この入力データIN12のような量子化データをエントロピー符号化した場合、例えば図5の折れ線503に示すように、ロスレス符号化が行われた場合の発生符号量とあまり変わらない符号量が発生してしまうことがある。逆に、図5の折れ線504に示すように、発生符号量は少なくなるが、符号化による画質劣化が大きくなってしまうこともあり得る。折れ線503の例のように、ロスレス符号化の場合とさほど変わらない符号量が発生した場合には、時点T13でもバッファメモリの使用容量が減らずにバッファメモリの空き容量が少なくなって、符号化データの記憶が出来なくなる虞がある。一方、折れ線504の例のように発生符号量を少なくできれば、バッファメモリの使用容量を減らすことができ、バッファメモリの破綻を回避できる可能性が高くなる。しかしながら、この場合、符号化による画質劣化が大きくなったことで、符号化方式がロスレス符号化からロッシー符号化へ切り替えられた箇所での画質変動が目立つようになる。   When the quantized data such as the input data IN12 is entropy-encoded, for example, as shown by a broken line 503 in FIG. 5, a code amount that is not much different from the generated code amount when lossless encoding is performed is generated. May end up. Conversely, as indicated by the broken line 504 in FIG. 5, the amount of generated code is reduced, but image quality deterioration due to encoding may be increased. As in the example of the broken line 503, when a code amount that is not much different from that in the case of the lossless encoding occurs, the free space of the buffer memory is reduced without reducing the used capacity of the buffer memory even at the time T13, and the encoding is performed. Data may not be stored. On the other hand, if the amount of generated codes can be reduced as in the example of the broken line 504, the use capacity of the buffer memory can be reduced, and the possibility that the failure of the buffer memory can be avoided increases. However, in this case, since the image quality deterioration due to the encoding becomes large, the image quality fluctuation becomes conspicuous at the place where the encoding method is switched from the lossless encoding to the lossy encoding.

このように、図5の想定例の場合、ロスレス符号化とロッシー符号化を切り替える際に、量子化ステップ値を定めるための参照情報が不足し、符号量の制御が荒くなって、メモリ容量の圧迫、或いは、画質の劣化と画質変動が目立つという問題が生ずる虞がある。   Thus, in the case of the assumption example in FIG. 5, when switching between lossless coding and lossy coding, reference information for determining the quantization step value is insufficient, and the control of the code amount becomes rough, so that the memory capacity is reduced. There may be a problem that compression or deterioration of image quality and image quality fluctuation are conspicuous.

<本実施形態におけるロスレス符号化とロッシー符号化の切り替え制御>
そこで、本実施形態の撮像装置100は、連写撮影された静止画像や動画のフレームに対する符号化においてロスレス符号化とロッシー符号化の切り替えを行う際、メモリ107の圧迫と画質劣化及び画質変動を回避可能とする切り替え制御を実現している。
<Switching control between lossless coding and lossy coding in this embodiment>
Therefore, when switching between lossless encoding and lossy encoding in encoding of still images and moving image frames taken continuously, the imaging apparatus 100 according to the present embodiment reduces compression of the memory 107, image quality degradation, and image quality fluctuation. Switching control that can be avoided is realized.

図6は、本実施形態の撮像装置100が例えば静止画像の連写撮影を行っている際の制御フローチャートであり、撮影されたフレームの符号化に関連する各処理ステップを示している。
図6のフローチャートに示した各処理は、図1に示した撮像装置100のハードウェア構成により実現される場合だけでなく、本実施形態に係るプログラムをCPU等で実行することにより実現されてもよい。以下の説明では、フローチャートの各処理のステップS201〜ステップS214をS201〜S214と略記する。図6のフローチャートの処理は、静止画像の連写撮影開始によりスタートする。
FIG. 6 is a control flowchart when the imaging apparatus 100 of the present embodiment performs continuous shooting of still images, for example, and shows processing steps related to encoding of the shot frames.
Each process shown in the flowchart of FIG. 6 is not only realized by the hardware configuration of the imaging apparatus 100 shown in FIG. 1, but may be realized by executing the program according to the present embodiment by a CPU or the like. Good. In the following description, steps S201 to S214 of each process in the flowchart are abbreviated as S201 to S214. The process of the flowchart in FIG. 6 starts when continuous shooting of still images starts.

静止画像の連写撮影が開始されると、制御部110は、先ず、撮像装置100の動作モードを初期化する。初期化された動作モードを初期動作モードと呼ぶ。本実施形態において、動作モードには、初期動作モードと、前述した第1の動作モード、第2の動作モード、第3の動作モードがあり、各動作モードにおける制御の詳細は後述する。制御部110は、初期動作モードへの設定を行った後、S201の制御処理に進む。   When continuous shooting of still images is started, the control unit 110 first initializes the operation mode of the imaging apparatus 100. The initialized operation mode is referred to as an initial operation mode. In the present embodiment, the operation modes include an initial operation mode, the first operation mode, the second operation mode, and the third operation mode described above, and details of control in each operation mode will be described later. After setting the initial operation mode, the control unit 110 proceeds to the control process of S201.

また、撮像装置100において連写撮影が開始されると、撮像部101からは連写撮影による各フレームのRAWデータが出力され、そのRAWデータがプレーン変換部102に供給される。制御部110は、S201において、プレーン変換部102を制御して、RAWデータのプレーン変換処理を行わせる。S201の後、制御部110は、S202の制御処理に進む。   When continuous shooting is started in the imaging apparatus 100, RAW data of each frame by continuous shooting is output from the imaging unit 101, and the RAW data is supplied to the plane conversion unit 102. In step S <b> 201, the control unit 110 controls the plane conversion unit 102 to perform a RAW data plane conversion process. After S201, the control unit 110 proceeds to the control process of S202.

S202では、制御部110は、撮像装置100の動作モードが、第2又は第3の動作モードか否かを判断する。制御部110は、S202において、第2又は第3の動作モードであると判断した場合(YES)にはS207の制御処理に進む。一方、制御部110は、S202において、第2又は第3の動作モードでないと判断した場合(NO)には、S203の制御処理に進む。静止画像の連写撮影が開始されたときには、動作モードは前述のように初期動作モードに設定されているため、制御部110は、S202において、第2又は第3の動作モードでないと判断し、S203に制御処理を進める。   In S202, the control unit 110 determines whether the operation mode of the imaging apparatus 100 is the second or third operation mode. If the control unit 110 determines in S202 that the operation mode is the second or third operation mode (YES), the control unit 110 proceeds to the control process of S207. On the other hand, when the control unit 110 determines in S202 that the operation mode is not the second or third operation mode (NO), the control unit 110 proceeds to the control process of S203. When the continuous shooting of the still image is started, the operation mode is set to the initial operation mode as described above. Therefore, the control unit 110 determines in S202 that the operation mode is not the second or third operation mode, The control process proceeds to S203.

S203に進むと、制御部110は、メモリ107の使用容量が所定の閾値以上(Th以上)になったか否か判定する。閾値Thは、メモリ使用量の閾値であり、メモリ107が記憶可能な最大容量よりも小さい値として、制御部110に予め設定されている。制御部110は、メモリ107の最大容量と書き込み及び読み出しの速度を把握しており、また、エントロピー符号化部105による符号化で発生した符号量を監視することにより、メモリ107の使用容量がどのように推移しているかを認識している。このため、制御部110は、メモリ107の使用容量が所定の閾値Th以上になったか否かを判定可能である。なお、図1には図示していないが、メモリI/F部106がメモリ使用容量の情報を生成して制御部110に通知し、制御部110は、そのメモリ使用容量の情報を用いて、メモリ107の使用容量が閾値Th以上か否かを判定してもよい。制御部110は、S203において、メモリ107の使用容量が閾値Th以上であると判定した場合(YES)はS205に処理を進め、閾値未満(Th未満)であると判定した場合(NO)にはS204の制御処理に進む。静止画像の連写撮影が開始されたときには、メモリ107の容量は余裕があり、閾値Th未満であるため、制御部110は、S204に制御処理を進める。   In step S203, the control unit 110 determines whether or not the used capacity of the memory 107 is equal to or greater than a predetermined threshold (Th or greater). The threshold Th is a threshold for memory usage, and is preset in the control unit 110 as a value smaller than the maximum capacity that can be stored in the memory 107. The control unit 110 knows the maximum capacity of the memory 107 and the speed of writing and reading, and by monitoring the amount of code generated by the encoding by the entropy encoding unit 105, it can determine which capacity of the memory 107 is used. We are aware of how it is moving. For this reason, the control unit 110 can determine whether or not the used capacity of the memory 107 is equal to or greater than the predetermined threshold Th. Although not shown in FIG. 1, the memory I / F unit 106 generates information on the memory usage capacity and notifies the control unit 110 of the information, and the control unit 110 uses the information on the memory usage capacity. It may be determined whether the used capacity of the memory 107 is equal to or greater than the threshold Th. If the controller 110 determines in S203 that the used capacity of the memory 107 is greater than or equal to the threshold Th (YES), the control unit 110 proceeds to S205, and if it determines that the used capacity is less than the threshold (less than Th) (NO). Control proceeds to S204. When continuous shooting of a still image is started, the capacity of the memory 107 has a margin and is less than the threshold value Th, so the control unit 110 advances the control process to S204.

S204に進むと、制御部110は、静止画像の連写撮影が開始された際の初期動作モードを第1の動作モードに変更した後、S210の制御処理に進む。S210では、制御部110は、エントロピー符号化部105を制御してエントロピー符号化を行わせる。この時点では第1の動作モードに設定されており、第1の動作モードは、前述したように、プレーンデータを、直接、エントロピー符号化する動作モードとなされている。したがって、S210において、制御部110は、プレーン変換部102によるプレーンデータ(つまり周波数変換部103及び量子化部104を介していないプレーンデータ)が、直接、エントロピー符号化部105に入力されるようにMUX111を制御する。そして、エントロピー符号化部105により生成された符号化データは、メモリI/F部106を介してメモリ107に記憶される。したがって、このときのメモリ107には、周波数変換処理及び量子化処理が行われていないプレーンデータをエントロピー符号化した符号化データ、つまりロスレス符号化による符号化データが記憶されることになる。   When the process proceeds to S204, the control unit 110 changes the initial operation mode when the continuous shooting of still images is started to the first operation mode, and then proceeds to the control process of S210. In S210, the control unit 110 controls the entropy encoding unit 105 to perform entropy encoding. At this time, the first operation mode is set. As described above, the first operation mode is an operation mode in which plane data is directly entropy-encoded. Therefore, in S210, the control unit 110 causes the plane data from the plane conversion unit 102 (that is, plane data not passing through the frequency conversion unit 103 and the quantization unit 104) to be directly input to the entropy coding unit 105. The MUX 111 is controlled. The encoded data generated by the entropy encoding unit 105 is stored in the memory 107 via the memory I / F unit 106. Therefore, the memory 107 at this time stores encoded data obtained by entropy encoding plain data that has not been subjected to frequency conversion processing and quantization processing, that is, encoded data by lossless encoding.

前述したようにS210において第1の動作モードでのエントロピー符号化が行われた後、制御部110は、S211の制御処理に進む。S211では、制御部110は、撮像装置100の動作モードが第1の動作モードか否かを判断する。制御部110は、S211において第1の動作モードであると判断した場合(YES)にはS213の制御処理に進み、一方、第1の動作モードでないと判断した場合(NO)にはS212の制御処理に進む。静止画像の連写撮影が開始された際には、前述したように第1の動作モードに設定されているため、制御部110は、S211において第1の動作モードであると判断して、S213の制御処理に進む。   As described above, after the entropy encoding in the first operation mode is performed in S210, the control unit 110 proceeds to the control process in S211. In S211, the control unit 110 determines whether or not the operation mode of the imaging device 100 is the first operation mode. If the control unit 110 determines in S211 that the operation mode is the first operation mode (YES), the control unit 110 proceeds to the control process in S213. If the control unit 110 determines that the operation mode is not the first operation mode (NO), the control unit 110 performs the control. Proceed to processing. Since the first operation mode is set as described above when continuous shooting of still images is started, the control unit 110 determines in S211 that the operation mode is the first operation mode, and S213. Proceed to the control process.

S213では、制御部110は、連写撮影による全てのフレームのRAWデータについて前述したエントロピー符号化が終わったか否かを判定する。制御部110は、S213において、全てのフレームのRAWデータに対する符号化処理が終わっていないと判定した場合(NO)には、S201に処理を戻し、次のフレームのRAWデータについて、前述したS201以降の制御処理を行う。   In S213, the control unit 110 determines whether or not the above-described entropy encoding has been completed for RAW data of all frames by continuous shooting. When the control unit 110 determines in S213 that the encoding process for the RAW data of all the frames has not been completed (NO), the control unit 110 returns the process to S201, and the RAW data of the next frame is subjected to the above-described S201 and subsequent steps. The control process is performed.

S201の処理に戻ると、制御部110は、前述同様に、プレーン変換部102を制御して、連写撮影によるフレームのRAWデータのプレーン変換処理を行わせた後、S202の制御処理に進む。この時点の動作モードは、前述したように第1の動作モードに設定されているため、制御部110は、S202において第2又は第3の動作モードでないと判断して、S203に制御処理を進める。S203において、制御部110は、メモリ107の使用容量が所定の閾値Th以上になったか否か判定し、使用容量が所定の閾値Th未満であると判定した場合には、S204以降に処理を進める。   Returning to the processing of S201, the control unit 110 controls the plane conversion unit 102 to perform the plane conversion processing of the RAW data of the frame by continuous shooting as described above, and then proceeds to the control processing of S202. Since the operation mode at this point is set to the first operation mode as described above, the control unit 110 determines that the operation mode is not the second or third operation mode in S202, and advances the control process to S203. . In S203, the control unit 110 determines whether or not the used capacity of the memory 107 has become equal to or greater than the predetermined threshold Th. If it is determined that the used capacity is less than the predetermined threshold Th, the process proceeds to S204 and subsequent steps. .

そして、制御部110は、連写撮影による各フレームについて前述した一連の処理を繰り返し、S213において、連写撮影による全てのフレームのRAWデータについてエントロピー符号化が終わったと判断した場合(YES)には、S214の制御処理に進む。S214では、制御部110は、撮像装置100の動作モードを初期動作モードに設定した後、図6のフローチャートの連写撮影処理を終了する。   Then, the control unit 110 repeats the above-described series of processing for each frame by continuous shooting, and when it is determined in S213 that entropy encoding has been completed for RAW data of all frames by continuous shooting (YES). , The process proceeds to S214. In S214, the control unit 110 sets the operation mode of the imaging apparatus 100 to the initial operation mode, and then ends the continuous shooting process of the flowchart in FIG.

一方、制御部110は、連写撮影による各フレームについて前述した一連の処理を繰り返し、S203において、メモリ107の使用容量が所定の閾値Th以上になったと判定した場合に、S205に制御処理を進める。   On the other hand, the control unit 110 repeats the series of processes described above for each frame obtained by continuous shooting, and if it is determined in S203 that the used capacity of the memory 107 has become equal to or greater than the predetermined threshold Th, the control process proceeds to S205. .

S205では、制御部110は、動作モードを第2の動作モードに設定した後、S206の制御処理に進む。S206では、制御部110は、周波数変換部103を制御して周波数変換処理を行わせた後、S210の制御処理に進む。なお、S206では、周波数変換処理としてサブバンド分解(周波数分解)を3回行う例を挙げているが、サブバンド分解の回数は2回以上であればよい。本実施形態において、第2の動作モードは、前述したように、プレーンデータを周波数変換処理した後のサブバンドデータを、エントロピー符号化する動作モードとなされている。第2の動作モードの場合、制御部110は、プレーンデータを周波数変換部103で周波数変換した後のサブバンドデータ(つまり量子化部104を介していないサブバンドデータ)が、エントロピー符号化部105に入力されるようにMUX111を制御する。そして、S210において、エントロピー符号化部105により生成された符号化データは、メモリI/F部106を介してメモリ107に記憶される。第2の動作モードの場合、メモリ107には、サブバンドデータがエントロピー符号化された符号化データ、つまりサブバンド毎の変換係数データを符号化した符号化データが、記憶されることになる。また、第2の動作モードの場合、サブバンド毎の変換係数データが符号化されたことで発生する、サブバンド毎の発生符号量の情報が得られることになる。   In S205, the control unit 110 sets the operation mode to the second operation mode, and then proceeds to the control process in S206. In S206, the control unit 110 controls the frequency conversion unit 103 to perform the frequency conversion process, and then proceeds to the control process of S210. In S206, an example is given in which subband decomposition (frequency decomposition) is performed three times as frequency conversion processing, but the number of subband decomposition may be two or more. In the present embodiment, as described above, the second operation mode is an operation mode in which the subband data after the frequency conversion processing of the plane data is entropy encoded. In the case of the second operation mode, the control unit 110 uses the entropy encoding unit 105 to convert the subband data (that is, the subband data not through the quantization unit 104) after the frequency conversion of the plane data by the frequency conversion unit 103. The MUX 111 is controlled so as to be input to. In S210, the encoded data generated by the entropy encoding unit 105 is stored in the memory 107 via the memory I / F unit 106. In the second operation mode, the memory 107 stores encoded data obtained by entropy-encoding subband data, that is, encoded data obtained by encoding transform coefficient data for each subband. In the case of the second operation mode, information on the generated code amount for each subband, which is generated when the transform coefficient data for each subband is encoded, is obtained.

前述したように第2の動作モードにおいて、S210の制御処理がなされた後、制御部110は、S211の制御処理に進む。この時点では第2の動作モードに設定されているため、制御部110は、S211において第1の動作モードでないと判断してS212の制御処理に進む。   As described above, after the control process of S210 is performed in the second operation mode, the control unit 110 proceeds to the control process of S211. Since the second operation mode is set at this time, the control unit 110 determines that the operation mode is not the first operation mode in S211 and proceeds to the control process in S212.

S212に進んだ場合、制御部110は、第2の動作モードにおける符号化で得られるサブバンド毎の発生符号量の情報を、量子化部104内の記憶素子に記憶させる。S212の後、制御部110は、S213の制御処理に進む。そして、制御部110は、S213において、全てのフレームのRAWデータに対する符号化処理が終わっていないと判定した場合、S201に処理を戻し、次のフレームのRAWデータについて、前述したS201以降の制御処理を行う。   When the process proceeds to S <b> 212, the control unit 110 causes the storage element in the quantization unit 104 to store information on the generated code amount for each subband obtained by encoding in the second operation mode. After S212, the control unit 110 proceeds to the control process of S213. If the control unit 110 determines in S213 that the encoding process for the RAW data of all frames has not been completed, the control unit 110 returns the process to S201, and the control process after S201 described above for the RAW data of the next frame. I do.

このときの制御部110は、S201において連写撮影によるフレームのRAWデータのプレーン変換処理を行わせた後、S202の制御処理に進む。この時点の動作モードは、前述したように第2の動作モードに設定されているため、制御部110は、S202において第2の動作モードであると判断して、S207に制御処理を進める。   At this time, the control unit 110 performs the plane conversion process of the RAW data of the frame by continuous shooting in S201, and then proceeds to the control process of S202. Since the operation mode at this point is set to the second operation mode as described above, the control unit 110 determines that the operation mode is the second operation mode in S202, and advances the control process to S207.

S207に進んだ場合、制御部110は、動作モードを第3の動作モードに設定した後、S208の制御処理に進む。S208では、制御部110は、周波数変換部103を制御して周波数変換処理を行わせた後、S209の制御処理に進む。なお、S208においてもS206の場合と同様に、周波数変換処理としてサブバンド分解(周波数分解)を3回行う例を挙げているが、サブバンド分解の回数は2回以上であればよい。S209では、制御部110は、量子化部104を制御して量子化処理を行わせた後、S210の制御処理に進む。このときの量子化部104では、第2の動作モードに設定された際にS212で記憶素子に記憶したサブバンド毎の発生符号量の情報を参照して、量子化処理を行う。つまり、1フレーム前の同じサブバンドの発生符号量を参照して、サブバンド毎の量子化ステップ値を決定し、その量子化ステップ値を用いて量子化処理が行われる。   When the process proceeds to S207, the control unit 110 sets the operation mode to the third operation mode, and then proceeds to the control process of S208. In S208, the control unit 110 controls the frequency conversion unit 103 to perform the frequency conversion process, and then proceeds to the control process in S209. In S208, as in S206, an example is given in which subband decomposition (frequency decomposition) is performed three times as frequency conversion processing. However, the number of subband decomposition may be two or more. In S209, the control unit 110 controls the quantization unit 104 to perform the quantization process, and then proceeds to the control process in S210. At this time, the quantization unit 104 performs quantization processing with reference to the information of the generated code amount for each subband stored in the storage element in S212 when the second operation mode is set. That is, the quantization step value for each subband is determined with reference to the generated code amount of the same subband one frame before, and the quantization process is performed using the quantization step value.

前述したように第3の動作モードにおいて、S210の制御処理がなされた後、制御部110は、S211の制御処理に進む。この時点では第3の動作モードに設定されているため、制御部110は、S211において第1の動作モードでないと判断してS212の制御処理に進む。   As described above, after the control process of S210 is performed in the third operation mode, the control unit 110 proceeds to the control process of S211. Since the third operation mode is set at this time, the control unit 110 determines that the operation mode is not the first operation mode in S211 and proceeds to the control process in S212.

S212に進んだ場合、制御部110は、第3の動作モードにおける符号化で得られるサブバンド毎の発生符号量の情報を、量子化部104内の記憶素子に記憶させる。S212の後、制御部110は、S213の制御処理に進む。そして、制御部110は、S213において、全てのフレームのRAWデータに対する符号化処理が終わっていないと判定した場合、S201に処理を戻し、次のフレームのRAWデータについて、前述したS201以降の制御処理を行う。   When the process proceeds to S212, the control unit 110 causes the storage element in the quantization unit 104 to store information on the generated code amount for each subband obtained by encoding in the third operation mode. After S212, the control unit 110 proceeds to the control process of S213. If the control unit 110 determines in S213 that the encoding process for the RAW data of all frames has not been completed, the control unit 110 returns the process to S201, and the control process after S201 described above for the RAW data of the next frame. I do.

制御部110は、S201において連写撮影によるフレームのRAWデータのプレーン変換処理を行わせた後、S202の制御処理に進む。この時点の動作モードは、前述したように第3の動作モードに設定されているため、制御部110は、S202において第3の動作モードであると判断して、S207に制御処理を進める。   The control unit 110 proceeds to the control process of S202 after performing the plane conversion process of the RAW data of the frame by continuous shooting in S201. Since the operation mode at this point is set to the third operation mode as described above, the control unit 110 determines that the operation mode is the third operation mode in S202, and advances the control process to S207.

S207に進んだ場合、制御部110は、動作モードが既に第3の動作モードに設定済みであるため、第3の動作モードのまま次のS208の制御処理に進む。S208では、制御部110は、周波数変換部103を制御して周波数変換処理を行わせた後、S209の制御処理に進む。S209では、制御部110は、量子化部104を制御して量子化処理を行わせた後、S210の制御処理に進む。このときの量子化部104では、前のフレームの符号化が行われた際のS212で記憶素子に記憶したサブバンド毎の発生符号量の情報を参照して、サブバンド毎の量子化ステップ値を決定し、その量子化ステップ値を用いたサブバンド毎の量子化処理が行われる。   When the process proceeds to S207, the control unit 110 has already set the operation mode to the third operation mode, and thus proceeds to the control process of the next S208 while maintaining the third operation mode. In S208, the control unit 110 controls the frequency conversion unit 103 to perform the frequency conversion process, and then proceeds to the control process in S209. In S209, the control unit 110 controls the quantization unit 104 to perform the quantization process, and then proceeds to the control process in S210. At this time, the quantization unit 104 refers to the information of the generated code amount for each subband stored in the storage element in S212 when the previous frame was encoded, and the quantization step value for each subband. And a quantization process for each subband using the quantization step value is performed.

制御部110は、これ以降の各フレームについては第3の動作モードによる符号化が行われるように各部を制御する。そして、第3の動作モードにおいて、連写撮影による全てのフレームのRAWデータについてエントロピー符号化が終わった場合、制御部110は、撮像装置100の動作モードを初期動作モードに設定した後に処理を終了する。   The control unit 110 controls each unit so that the subsequent frames are encoded in the third operation mode. Then, in the third operation mode, when entropy encoding is completed for RAW data of all frames by continuous shooting, the control unit 110 ends the processing after setting the operation mode of the imaging device 100 to the initial operation mode. To do.

なお、図6のフローチャートでは省略しているが、第3の動作モードによる符号化が行われている際に、メモリ107の使用容量が閾値Th未満になった場合には、第1の動作モードに戻して、図6のフローチャートのS201以降の処理を行うようにしてもよい。   Although omitted in the flowchart of FIG. 6, when the use capacity of the memory 107 becomes less than the threshold Th during encoding in the third operation mode, the first operation mode is performed. Referring back to FIG. 6, the processing from S201 onward in the flowchart of FIG. 6 may be performed.

図7は、本実施形態の撮像装置100において前述の図6のフローチャートの処理が行われ、連写撮影されたフレームの符号化データをメモリ107に一時的に記憶した後、記録媒体109に記録する際のメモリ107の使用容量の遷移例を示す図である。図7の例においても前述の図5の例と同様、エントロピー符号化されてメモリ107に記憶される符号化データの単位時間当たりの符号量が、メモリ107から記録媒体109へ転送される単位時間当たりの転送データ量を超えているとする。   7, the processing of the flowchart of FIG. 6 described above is performed in the imaging apparatus 100 of the present embodiment, and the encoded data of the frames continuously shot is temporarily stored in the memory 107 and then recorded on the recording medium 109. It is a figure which shows the example of a transition of the used capacity of the memory 107 at the time of doing. In the example of FIG. 7 as well, the code amount per unit time of the encoded data that is entropy-coded and stored in the memory 107 is the unit time that is transferred from the memory 107 to the recording medium 109, as in the example of FIG. It is assumed that the amount of data transferred per hit is exceeded.

図7のグラフ700の横軸は時間を示しており、縦軸はメモリ107の容量を示しており、折れ線702がメモリ107の使用容量の遷移を表している。また、図7のグラフ700の横軸の各目盛は、連写撮影により1枚のフレームが撮影され、そのフレームのデータが符号化されてメモリ107に記録される時間を示している。また、図7中の時点T1は、連写撮影された1枚目のフレームの符号化データがメモリ107に記憶されたタイミングを示している。以下同様に、時点T2〜T29は2枚目〜29枚目の各フレームの符号化データがメモリ107に記憶されたタイミングを示している。また、時点T0は撮影開始のタイミングを表し、時点T0からT2までの間では、折れ線702で示されるメモリ使用量は徐々に増加するが、時点T2ではメモリ使用容量は低下する。これはメモリ107から記録媒体109へのデータ転送処理が終了したことでメモリ107内に1枚目の符号化データ分だけ容量の空きができたことを表している。図7の例でも前述の図5の例と同様に、メモリ107から記録媒体109へのデータ転送は、実際には1枚目のフレームがメモリ107に記憶された時点T1から始まっている。また、図7の例では、説明を分かりやすくするために、時点T2のデータ転送完了のタイミングで、メモリ使用量が1枚目の符号化データ分だけ空くようなイメージで折れ線702が描かれている。   The horizontal axis of the graph 700 in FIG. 7 indicates time, the vertical axis indicates the capacity of the memory 107, and the broken line 702 indicates the transition of the used capacity of the memory 107. In addition, each scale on the horizontal axis of the graph 700 in FIG. 7 indicates a time during which one frame is shot by continuous shooting and the data of the frame is encoded and recorded in the memory 107. In addition, a time point T1 in FIG. 7 indicates a timing at which the encoded data of the first frame that is continuously shot is stored in the memory 107. Similarly, time points T2 to T29 indicate timings at which the encoded data of the second to 29th frames are stored in the memory 107. The time point T0 represents the timing of the start of photographing. From the time point T0 to the time point T2, the memory usage indicated by the broken line 702 gradually increases, but the memory usage capacity decreases at the time point T2. This indicates that the data 107 from the memory 107 to the recording medium 109 has been completed, so that the memory 107 has a capacity for the first encoded data. In the example of FIG. 7 as well, as in the example of FIG. 5 described above, the data transfer from the memory 107 to the recording medium 109 actually starts at time T 1 when the first frame is stored in the memory 107. Further, in the example of FIG. 7, for easy understanding, a broken line 702 is drawn with an image in which the memory usage is empty for the first encoded data at the timing of data transfer completion at time T2. Yes.

また、図7のタイムチャート701は、エントロピー符号化部105に対して入力されるデータのタイミングを表している。この図7の例の場合、連写撮影の開始直後はメモリ107の容量に余裕があるため、前述した第1の動作モードにより、連写撮影による各フレームのプレーンデータがエントロピー符号化部105に入力されてエントロピー符号化が行われる。このため、図7の入力データIN0やIN1は、プレーン変換部102からのプレーンデータであって、周波数変換処理及び量子化処理が行われていないデータである。   A time chart 701 in FIG. 7 represents the timing of data input to the entropy encoding unit 105. In the case of the example in FIG. 7, since the capacity of the memory 107 is sufficient immediately after the start of continuous shooting, the plane data of each frame by continuous shooting is sent to the entropy encoding unit 105 in the first operation mode described above. It is input and entropy coding is performed. Therefore, the input data IN0 and IN1 in FIG. 7 are plane data from the plane conversion unit 102, and are data that has not been subjected to frequency conversion processing and quantization processing.

一方、図7のグラフ700の時点Txは、折れ線702で示されるメモリ107の使用容量が、所定の閾値Th以上になったタイミングを表している。本実施形態では、メモリ107の使用容量が所定の閾値Th以上になった場合、時点Txの後で少なくとも1フレーム分に相当する時点T12からT13の間は、第2の動作モードに設定される。これにより、時点T12からT13までの間は、周波数変換部103による周波数変換処理後のサブバンドデータが、エントロピー符号化部105への入力データIN12となされる。したがって、このときのエントロピー符号化部105では、サブバンド毎の変換係数データがエントロピー符号化され、それらサブバンド毎の符号化データが、メモリI/F部106を介してメモリ107に記憶される。また、エントロピー符号化部105による符号化で発生した、サブバンド毎の発生符号量の情報は、量子化部104に送られて内部の記憶素子に記憶される。   On the other hand, a time point Tx in the graph 700 in FIG. 7 represents a timing at which the used capacity of the memory 107 indicated by the broken line 702 becomes equal to or higher than a predetermined threshold Th. In the present embodiment, when the used capacity of the memory 107 becomes equal to or greater than the predetermined threshold Th, the second operation mode is set between time T12 and T13 corresponding to at least one frame after time Tx. . Thereby, from time T12 to T13, the subband data after the frequency conversion processing by the frequency conversion unit 103 is used as input data IN12 to the entropy encoding unit 105. Accordingly, at this time, the entropy encoding unit 105 entropy-encodes the transform coefficient data for each subband, and the encoded data for each subband is stored in the memory 107 via the memory I / F unit 106. . Also, information on the generated code amount for each subband generated by encoding by the entropy encoding unit 105 is sent to the quantization unit 104 and stored in an internal storage element.

本実施形態において、時点T12の次のフレームの時点T13では、第3の動作モードが設定される。これにより、時点T13のフレームでは、周波数変換部103による周波数変換処理後のサブバンドデータを更に量子化部104で量子化処理した後の量子化データが、エントロピー符号化部105への入力データIN13となされる。このとき、量子化部104の内部の記憶素子には、時点T12からT13までの間で行われたサブバンド毎の符号化により得られた、サブバンド毎の発生符号量の情報が記憶されている。したがって、量子化部104は、時点T13のフレームに対しては、1フレーム前に得られているサブバンド毎の発生符号量の情報を参照した、サブバンド毎の量子化ステップ値を決定することができる。そして、量子化部104においてサブバンド毎の量子化ステップ値を用いて量子化処理が行われた後の量子化データ(IN13)が、エントロピー符号化部105により符号化される。このサブバンド毎の符号化データは、メモリI/F部106を介してメモリ107に記憶される。また、時点T13のフレームについて、エントロピー符号化部105による符号化で発生したサブバンド毎の発生符号量の情報は、量子化部104にフィードバックされて内部の記憶素子に記憶される。なお、発生符号量の情報は制御部110が保持するようにしてもよく、この場合、制御部110が発生符号量の情報に基づいて量子化部104の量子化ステップ値を決定してもよい。   In the present embodiment, the third operation mode is set at time T13 of the next frame after time T12. As a result, in the frame at time T13, the quantized data obtained by further quantizing the subband data after the frequency conversion processing by the frequency conversion unit 103 by the quantization unit 104 is input data IN13 to the entropy encoding unit 105. It is made. At this time, information on the generated code amount for each subband obtained by encoding for each subband performed between time T12 and T13 is stored in the storage element inside the quantization unit 104. Yes. Therefore, the quantization unit 104 determines the quantization step value for each subband with reference to the generated code amount information for each subband obtained one frame before for the frame at time T13. Can do. The entropy encoding unit 105 encodes the quantized data (IN13) after the quantization process is performed using the quantization step value for each subband in the quantization unit 104. The encoded data for each subband is stored in the memory 107 via the memory I / F unit 106. Further, for the frame at time T13, information on the generated code amount for each subband generated by encoding by the entropy encoding unit 105 is fed back to the quantization unit 104 and stored in an internal storage element. The generated code amount information may be held by the control unit 110. In this case, the control unit 110 may determine the quantization step value of the quantization unit 104 based on the generated code amount information. .

以下、時点T13以降の各フレームについても同様に、それぞれ1フレーム前のサブバンド毎の発生符号量を基に量子化ステップ値が決定されて量子化が行われてからエントロピー符号化が行われることになる。そして、例えば時点T20で連写撮影が終了したとすると、メモリ107に残っている各フレームの符号化データが全て読み出されて無くなる時点T29まで、メモリ107から記録媒体109へのデータ転送が行われる。   Hereinafter, for each frame after time T13, similarly, the entropy encoding is performed after the quantization step value is determined and quantized based on the generated code amount for each subband one frame before. become. For example, if continuous shooting is completed at time T20, data transfer from the memory 107 to the recording medium 109 is performed until time T29 when all the encoded data of each frame remaining in the memory 107 is read and lost. Is called.

以上のように、本実施形態の撮像装置100は、可能な限りロスレス符号化を行って高画質の画像を記録可能としている。そして、本実施形態の撮像装置100は、メモリ107の使用容量が閾値Th以上になってロスレス符号化の継続が困難になった場合、ロッシー符号化に切り替えることでメモリの圧迫を回避しつつ、符号化方式の切り替えによる画質劣化を低減可能とする。また、ロスレス符号化からロッシー符号化への切り替えの際には、少なくとも1フレーム分の画像に対して周波数変換処理によるサブバンドデータの符号化処理が行われ、その際のサブバンド毎の発生符号量の情報が記憶される。そして、次のフレームでは、周波数変換処理によるサブバンドデータに対する量子化処理が行われるが、その量子化の際には、1フレーム前の符号化の際の発生符号量を参照して量子化ステップ値が決定される。これにより、符号化方式が切り替えられた後の量子化処理では、サブバンド毎の発生符号量を参照した最適な量子化ステップ値を用いた量子化が可能となり、符号化方式の切り替わりの際の画質劣化を低減可能となる。   As described above, the image capturing apparatus 100 according to the present embodiment can record a high-quality image by performing lossless encoding as much as possible. The imaging apparatus 100 according to the present embodiment avoids memory pressure by switching to lossy coding when the use capacity of the memory 107 exceeds the threshold Th and it is difficult to continue lossless coding. Image quality deterioration due to switching of the encoding system can be reduced. In addition, when switching from lossless encoding to lossy encoding, subband data encoding processing by frequency conversion processing is performed on an image of at least one frame, and the generated code for each subband at that time Quantity information is stored. In the next frame, the subband data is quantized by the frequency conversion process. When the quantization is performed, the quantization step is performed with reference to the generated code amount at the time of the previous frame encoding. The value is determined. As a result, in the quantization process after the coding method is switched, quantization using the optimum quantization step value referring to the generated code amount for each subband becomes possible, and the coding method is switched. Image quality deterioration can be reduced.

<第2の実施形態>
図8は、第2の実施形態の撮像装置800の概略構成を示す図である。
本実施形態の撮像装置800は、撮像部801、プレーン変換部802、周波数変換部803、量子化部804、エントロピー符号化部805、メモリI/F部806、メモリ807、記録処理部808、記録媒体809、制御部810、MUX811を有する。図8の撮像装置800において、前述した図1の撮像装置100と同一の構成についての説明は省略する。
<Second Embodiment>
FIG. 8 is a diagram illustrating a schematic configuration of an imaging apparatus 800 according to the second embodiment.
The imaging apparatus 800 of this embodiment includes an imaging unit 801, a plane conversion unit 802, a frequency conversion unit 803, a quantization unit 804, an entropy encoding unit 805, a memory I / F unit 806, a memory 807, a recording processing unit 808, and a recording. A medium 809, a control unit 810, and a MUX 811. In the imaging apparatus 800 of FIG. 8, the description of the same configuration as the imaging apparatus 100 of FIG.

図8に示す第2の実施形態の撮像装置800は、記録処理部808と制御部810の動作が、図1の撮像装置100の記録処理部108と制御部110とは異なる。これら記録処理部808と制御部810の動作の詳細については後述する。以下、第2の実施形態の撮像装置800において、前述した第1の実施形態の撮像装置100とは異なる部分についてのみ説明する。   In the image pickup apparatus 800 of the second embodiment shown in FIG. 8, the operations of the recording processing unit 808 and the control unit 810 are different from those of the recording processing unit 108 and the control unit 110 of the image pickup apparatus 100 of FIG. Details of operations of the recording processing unit 808 and the control unit 810 will be described later. Hereinafter, only the portions of the imaging apparatus 800 according to the second embodiment that are different from the imaging apparatus 100 according to the first embodiment will be described.

例えば、図8には図示していない各種処理部や撮像装置100に接続された外部装置等により、メモリ807に対して多数のアクセスが発生するような場合には、メモリ807からのデータ読み出し速度が低下する。ここで、例えば、メモリ807に対し、連写撮影等による各フレームの符号化データの書き込みが行われている状態で、メモリ807のデータ読み出し速度が低下すると、メモリ807の容量が圧迫されることになる。   For example, when a large number of accesses to the memory 807 are generated by various processing units not shown in FIG. 8 or external devices connected to the imaging device 100, the data reading speed from the memory 807 is high. Decreases. Here, for example, when the data reading speed of the memory 807 decreases while the encoded data of each frame is written to the memory 807 by continuous shooting or the like, the capacity of the memory 807 is compressed. become.

図9(a)は、連写撮影等による各フレームの符号化データをメモリ807に一時的に記憶した後、記録媒体809に記録する際、メモリ807の読み出し速度が低下した場合の、メモリ807の使用容量の遷移例を示す図である。図9(a)の例において、符号化されてメモリ807に記憶される符号化データの単位時間当たりの符号量は、メモリ807から記録媒体809へ転送される単位時間当たりの転送データ量を超えているとする。また、図9(a)の遷移例において、メモリI/F部806は、メモリ807に対する符号化データの書き込みと読み出しについて、読み出しよりも書き込みの優先度を高くするように設定されているとする。   FIG. 9A shows the memory 807 when the reading speed of the memory 807 decreases when the encoded data of each frame by continuous shooting or the like is temporarily stored in the memory 807 and then recorded on the recording medium 809. It is a figure which shows the example of a transition of the used capacity. In the example of FIG. 9A, the code amount per unit time of the encoded data encoded and stored in the memory 807 exceeds the transfer data amount per unit time transferred from the memory 807 to the recording medium 809. Suppose that In the transition example of FIG. 9A, the memory I / F unit 806 is set so that the writing priority is higher than the reading priority in writing and reading the encoded data to and from the memory 807. .

図9(a)のグラフ900の横軸は時間を示し、縦軸はメモリ807の容量を示しており、折れ線902がメモリ807の使用容量の遷移を表している。図9(a)のグラフ900の横軸の各目盛は、連写撮影により1枚のフレームが撮影され、そのフレームのデータが符号化されてメモリ807に記憶される時間を示している。図9(a)中の時点T0,T1,〜,T12,・・・は、図7の例と同様、撮影開始タイミング以降の各フレームの符号化データがメモリ807に記憶されたタイミングを示している。図9(a)の遷移例の場合、前述の図7の例よりもメモリ807の読み出し速度が低下しているため、時点T0〜T4までの間ではメモリ使用量が徐々に増加している。そして、図9(a)の遷移例の場合、時点T4において、メモリ807から記録媒体809へ1枚目のフレームの符号化データの転送処理が終了したことで、メモリ807内に1フレームの符号化データ分だけ容量の空きができたことを表している。なお、図9(a)の例でも前述の図7の例と同様に、メモリ807から記録媒体809へのデータ転送は、実際には1枚目のフレームの符号化データがメモリ807に記憶された時点T1から始まっている。   The horizontal axis of the graph 900 in FIG. 9A represents time, the vertical axis represents the capacity of the memory 807, and the broken line 902 represents the transition of the used capacity of the memory 807. Each scale on the horizontal axis of the graph 900 in FIG. 9A indicates a time during which one frame is shot by continuous shooting and the data of the frame is encoded and stored in the memory 807. In FIG. 9A, time points T0, T1,..., T12,... Indicate the timing at which the encoded data of each frame after the imaging start timing is stored in the memory 807, as in the example of FIG. Yes. In the case of the transition example in FIG. 9A, since the reading speed of the memory 807 is lower than that in the above-described example in FIG. 7, the memory usage gradually increases between time points T0 and T4. In the case of the transition example in FIG. 9A, since the process of transferring the encoded data of the first frame from the memory 807 to the recording medium 809 is completed at time T4, the code of one frame is stored in the memory 807. This indicates that there is enough free space for data. In the example of FIG. 9A as well, the encoded data of the first frame is actually stored in the memory 807 in the data transfer from the memory 807 to the recording medium 809 as in the example of FIG. It starts from time T1.

図9(a)のタイムチャート901は、図7の例と同様に、エントロピー符号化部805に対して入力されるデータのタイミングを表している。連写撮影の開始後でメモリ807の使用容量に余裕がある期間は前述同様に第1の動作モードとなされるため、図9(a)の入力データIN0やIN1は、周波数変換処理及び量子化処理が行われていないプレーンデータである。   A time chart 901 in FIG. 9A represents the timing of data input to the entropy encoding unit 805 as in the example of FIG. Since the first operation mode is set in the same manner as described above during a period in which the memory 807 has a sufficient capacity after the start of continuous shooting, the input data IN0 and IN1 in FIG. This is plain data that has not been processed.

図9(a)のグラフ900の時点Txは、折れ線902で示すメモリ807の使用容量が、予め設定されている所定の閾値Th以上になったタイミングを表している。第2の実施形態においても第1の実施形態と同様、メモリ807の使用容量が所定の閾値Th以上になった場合、時点Txの後の時点T8からT9の間は、第2の動作モードに設定される。これにより、時点T8からT9の間は、周波数変換部803による周波数変換処理後のサブバンドデータが、エントロピー符号化部805への入力データIN8となされる。このときのエントロピー符号化部805では、サブバンド毎の変換係数データが符号化され、それらサブバンド毎の符号化データがメモリI/F部806を介してメモリ807に記憶される。また、エントロピー符号化部805による符号化で発生した、サブバンド毎の発生符号量の情報は、量子化部804の内部の記憶素子に記憶される。   A time point Tx in the graph 900 of FIG. 9A represents a timing when the used capacity of the memory 807 indicated by the broken line 902 becomes equal to or higher than a predetermined threshold value Th. Also in the second embodiment, as in the first embodiment, when the used capacity of the memory 807 is equal to or greater than the predetermined threshold Th, the second operation mode is set between the time points T8 and T9 after the time point Tx. Is set. As a result, between time points T8 and T9, the subband data after the frequency conversion processing by the frequency conversion unit 803 becomes the input data IN8 to the entropy encoding unit 805. At this time, the entropy encoding unit 805 encodes the transform coefficient data for each subband, and the encoded data for each subband is stored in the memory 807 via the memory I / F unit 806. Also, information on the generated code amount for each subband generated by encoding by the entropy encoding unit 805 is stored in a storage element inside the quantization unit 804.

第2の実施形態においても第1の実施形態と同様に、時点T8の次のフレームの時点T9では、第3の動作モードが設定される。これにより、時点T9のフレームでは、周波数変換処理後のサブバンドデータを更に量子化処理した後の量子化データが、エントロピー符号化部805への入力データIN9となされる。またこのとき、量子化部804は、時点T9のフレームに対しては、時点T8〜T9の間の第2の動作モードの際に得られたサブバンド毎の発生符号量の情報を参照してサブバンド毎の量子化ステップ値を決定する。そして、量子化部804においてサブバンド毎の量子化ステップ値を用いて量子化処理が行われた後の量子化データ(IN9の量子化データ)はエントロピー符号化部805により符号化され、そのサブバンド毎の符号化データがメモリ807に記憶される。これ以降は第3の動作モードが継続される。   Also in the second embodiment, as in the first embodiment, the third operation mode is set at the time T9 of the next frame after the time T8. Thereby, in the frame at time T9, the quantized data obtained by further quantizing the subband data after the frequency conversion process is used as the input data IN9 to the entropy coding unit 805. At this time, the quantization unit 804 refers to the generated code amount information for each subband obtained in the second operation mode between the time points T8 and T9 for the frame at the time point T9. A quantization step value for each subband is determined. Then, the quantized data (the quantized data of IN9) after being quantized using the quantization step value for each subband in the quantizing unit 804 is encoded by the entropy encoding unit 805, and the sub data The encoded data for each band is stored in the memory 807. Thereafter, the third operation mode is continued.

ここで、図9(a)の遷移例の場合、第3の動作モードによる符号化を行って発生符号量を抑えたとしても、メモリ807の読み出し速度が低下しているため、例えば時点T12においてメモリ807の使用容量が最大容量に達してしまう可能性がある。この場合、例えば量子化部804の量子化ステップ値を、発生符号量が大幅に少なくなるような値にして量子化を行わせることにより、メモリ807が最大容量に達しないように制御することが考えられる。しかしながら、発生符号量が大幅に少なくなるような量子化ステップ値による量子化を行うと、画質が急激に劣化してしまうようになる。   Here, in the case of the transition example in FIG. 9A, even when the encoding in the third operation mode is performed and the generated code amount is suppressed, the reading speed of the memory 807 is reduced. There is a possibility that the used capacity of the memory 807 reaches the maximum capacity. In this case, for example, by controlling the quantization step value of the quantization unit 804 to a value that greatly reduces the generated code amount, the memory 807 can be controlled so as not to reach the maximum capacity. Conceivable. However, if quantization is performed with a quantization step value that significantly reduces the amount of generated code, the image quality deteriorates rapidly.

そこで、第2の実施形態では、メモリ807のデータ転送速度に応じて、メモリ使用容量に対する所定の閾値Thを制御することにより、メモリ807の使用容量が最大容量に達してしまうのを防ぐとともに、画質の急激な劣化をも防止可能としている。   Therefore, in the second embodiment, by controlling the predetermined threshold Th for the memory usage capacity according to the data transfer rate of the memory 807, the usage capacity of the memory 807 is prevented from reaching the maximum capacity, It is possible to prevent sudden deterioration of image quality.

第2の実施形態の撮像装置800において、記録処理部808は、メモリ807からデータが読み出されて記録媒体809に記録される際のデータ転送速度を求める。例えば、記録処理部808は、メモリI/F部806によるメモリ807の符号化データ読み出し開始時間と、メモリ807の符号化データ読み出し完了時間との差分により、メモリ807のデータ読み出し際の単位時間当たりの転送量を推定する。また例えば、記録処理部808は、メモリI/F部806によるメモリ807のデータ書き込み量と読み出し量との比により、メモリ807のデータ読み出しの際の単位時間当たりの転送量を推定してもよい。このような単位時間当たりの転送量の情報は、メモリ807から読み出されて記録媒体809に記録される際のデータ転送速度を示す情報として、制御部810に送られる。制御部810は、記録処理部808から受け取ったデータ転送速度の情報に基づいて、所定の閾値Thを変更する。具体的には、メモリ使用容量に対する閾値Thは、データ転送速度が遅くなればなるほど下げられるように変更される。   In the imaging apparatus 800 of the second embodiment, the recording processing unit 808 obtains a data transfer rate when data is read from the memory 807 and recorded on the recording medium 809. For example, the recording processing unit 808 uses the difference between the encoded data read start time of the memory 807 by the memory I / F unit 806 and the encoded data read completion time of the memory 807 per unit time when reading data from the memory 807. Estimate the transfer amount. Further, for example, the recording processing unit 808 may estimate the transfer amount per unit time when data is read from the memory 807 based on the ratio between the data write amount and the read amount of the memory 807 by the memory I / F unit 806. . Such information on the transfer amount per unit time is sent to the control unit 810 as information indicating a data transfer rate when the data is read from the memory 807 and recorded on the recording medium 809. The control unit 810 changes the predetermined threshold Th based on the data transfer rate information received from the recording processing unit 808. Specifically, the threshold value Th for the memory usage capacity is changed so as to decrease as the data transfer rate becomes slower.

なお、データ転送速度に応じた閾値の変更は、一例として、複数のデータ転送速度と複数の閾値との対応テーブルを参照するような手法を用いることで実現可能である。例えば、制御部810は、異なる複数のデータ転送速度と複数の閾値との対応テーブルを内部の記憶素子等に保持しており、記録処理部808から供給されたデータ転送速度に応じた閾値を対応テーブルから読み出すことで、閾値を変更する。もちろん対応テーブルを参照する手法は一例であり、この例に限定されるものではなく、データ転送速度に応じた閾値を演算により求めるようにしてもよい。   Note that the threshold value can be changed according to the data transfer rate by using a method of referring to a correspondence table between a plurality of data transfer rates and a plurality of threshold values as an example. For example, the control unit 810 holds a correspondence table of a plurality of different data transfer rates and a plurality of threshold values in an internal storage element or the like, and supports a threshold corresponding to the data transfer rate supplied from the recording processing unit 808. The threshold is changed by reading from the table. Of course, the method of referring to the correspondence table is an example, and is not limited to this example. A threshold value corresponding to the data transfer rate may be obtained by calculation.

図9(b)は、メモリ807のデータ転送速度が低下していることで、図9(a)で説明した所定の閾値Thが、閾値Th1のように低い値に変更された例を示す図である。図9(b)のグラフ920及び折れ線922とタイムチャート921は、前述した図9(a)のグラフ900及び折れ線902とタイムチャート901と同様に表されているものでるため、それらの詳細な説明は省略する。   FIG. 9B is a diagram showing an example in which the predetermined threshold Th described in FIG. 9A is changed to a low value like the threshold Th1 because the data transfer rate of the memory 807 is decreased. It is. Since the graph 920, the broken line 922, and the time chart 921 in FIG. 9B are the same as the graph 900, the broken line 902, and the time chart 901 in FIG. 9A described above, detailed description thereof will be given. Is omitted.

図9(b)の例の場合、閾値Th1は図9(a)の閾値Thよりも低い値に変更されているため、その閾値Th1をメモリ807の使用容量が超える時点Txは、図9(a)の例よりも時間軸上で前になる。図9(b)の例の場合、メモリ807の使用容量が所定の閾値Th1以上になるのは時点T6とT7の間であり、このため第1の動作モードから第2の動作モードへの切り替えは時点T7で行われる。したがって、時点T7からT8の間は、周波数変換処理後のサブバンドデータが、エントロピー符号化部805への入力データIN7となされる。   In the case of the example in FIG. 9B, the threshold Th1 is changed to a value lower than the threshold Th in FIG. 9A. Therefore, the time Tx when the used capacity of the memory 807 exceeds the threshold Th1 is shown in FIG. It is before the example of a) on the time axis. In the example of FIG. 9B, the used capacity of the memory 807 becomes equal to or greater than the predetermined threshold Th1 between the time points T6 and T7. Therefore, switching from the first operation mode to the second operation mode is performed. Is performed at time T7. Therefore, between time points T7 and T8, the subband data after the frequency conversion process is used as input data IN7 to the entropy encoding unit 805.

そして、図9(b)の例の場合、第2の動作モードから第3の動作モードへの切り替えは、時点T7の次のフレームの時点T8において行われる。これにより、時点T8のフレームでは、周波数変換処理及び量子化処理が行われ、その量子化データがエントロピー符号化部805への入力データIN8となされる。これ以降は第3の動作モードが継続されることになる。   In the example of FIG. 9B, the switching from the second operation mode to the third operation mode is performed at time T8 of the next frame after time T7. Thereby, in the frame at time T8, frequency conversion processing and quantization processing are performed, and the quantized data becomes input data IN8 to the entropy coding unit 805. Thereafter, the third operation mode is continued.

図9(b)の例の場合、図9(a)の閾値Thよりも低い閾値Th1に変更されているため、第1の動作モードから第2の動作モードへの遷移、更には第3の動作モードへの遷移が、メモリ807の使用容量が少ない(空き容量が多い)段階で行われる。すなわち、メモリ807に十分な空き容量が残っている早い段階で、第3の動作モードへの切り替えが行われるため、メモリ807の読み出し速度が低下していたとしても、メモリ807の使用容量が最大容量に達してしまう可能性が低くなる。したがって、第3の動作モードにおいて、量子化部804の量子化ステップ値を、発生符号量が大幅に少なくなるような値にしなくてもよくなり、その結果、画質が急激に劣化するような事態になることを防止可能となる。   In the case of the example in FIG. 9B, since the threshold value Th1 is lower than the threshold value Th in FIG. 9A, the transition from the first operation mode to the second operation mode, and further the third The transition to the operation mode is performed when the used capacity of the memory 807 is small (the free capacity is large). That is, since the switching to the third operation mode is performed at an early stage when sufficient free space remains in the memory 807, even if the reading speed of the memory 807 is reduced, the used capacity of the memory 807 is the maximum. The possibility of reaching capacity is reduced. Therefore, in the third operation mode, the quantization step value of the quantization unit 804 does not have to be a value that greatly reduces the generated code amount, and as a result, the image quality deteriorates rapidly. Can be prevented.

以上説明したように、第2の実施形態においては、メモリ807へのアクセスが多く、メモリ807のデータ転送速度が遅くなる場合でも、可能な限りロスレス符号化を行って高画質の画像を記録可能としている。また、第1の実施形態と同様に、第2の実施形態の撮像装置800は、メモリ807の使用容量が閾値以上になった場合には、ロッシー符号化に切り替えることでメモリの圧迫を回避しつつ、符号化方式の切り替えによる画質劣化を低減可能としている。また、符号化方式の切り替えの際には、前述同様、少なくとも1フレーム分の画像に対して周波数変換処理によるサブバンドデータの符号化を行い、次のフレームでは、1フレーム前の符号化の際の発生符号量を参照して量子化ステップ値が決定される。これにより、符号化方式の切り替わりの際の画質劣化が低減される。更に、第2の実施形態の撮像装置800は、データ転送速度に応じて閾値Thを変更可能となされており、メモリ807のデータ転送速度が遅くなる場合には、メモリ使用容量に対する閾値Thを、より低い閾値Th1に変更する。したがって、第2の実施形態によれば、メモリ807の使用容量が最大容量に達してしまうのを防ぐことができるとともに、動作モードを第3の動作モードに遷移させた後に画質が急激に劣化するのを防止可能である。   As described above, in the second embodiment, even when there are many accesses to the memory 807 and the data transfer speed of the memory 807 is slow, lossless encoding can be performed as much as possible to record a high-quality image. It is said. Similarly to the first embodiment, the imaging apparatus 800 according to the second embodiment avoids memory pressure by switching to lossy encoding when the used capacity of the memory 807 exceeds a threshold value. However, it is possible to reduce image quality deterioration due to switching of the encoding method. In addition, when switching the encoding method, as described above, subband data is encoded by frequency conversion processing on an image of at least one frame, and in the next frame, the previous frame is encoded. The quantization step value is determined with reference to the generated code amount. Thereby, image quality deterioration at the time of switching of an encoding system is reduced. Furthermore, the imaging apparatus 800 according to the second embodiment can change the threshold Th according to the data transfer speed. When the data transfer speed of the memory 807 is slow, the threshold Th for the memory usage capacity is set as follows. Change to a lower threshold Th1. Therefore, according to the second embodiment, the used capacity of the memory 807 can be prevented from reaching the maximum capacity, and the image quality is rapidly deteriorated after the operation mode is changed to the third operation mode. Can be prevented.

なお、第2の実施形態では、メモリ807の単位時間当たりのデータ転送量(転送速度)に応じて閾値を変更する例を挙げたが、制御部810は、例えば記録媒体809におけるデータ転送処理性能(記録処理能力)を基に閾値を制御してもよい。この例の場合、メモリ807へのアクセス量が多い場合ではなく、記録処理部808の転送速度が高く維持されている場合において効果を発揮する。例えば、制御部810は、記録媒体809が高速な転送処理能力を有する場合には閾値を高く設定し、記録媒体809が低速な転送処理能力を有する場合には閾値を低く設定するように制御する。また、制御部810は、メモリ807のデータ転送速度と記録媒体809のデータ転送処理性能の両者を基に閾値を制御してもよい。例えば、制御部810は、メモリ807のデータ転送速度と記録媒体809のデータ転送処理性能の両者が高ければ閾値を高くし、何れか一方でも低ければ閾値を低く制御するようにしてもよい。また例えば、制御部810は、メモリ807のデータ転送速度と記録媒体809のデータ転送処理性能の何れか一方が低い場合であっても、他方によりメモリ807の圧迫を回避できるのであれば、閾値を低く制御しないようにしてもよい。   In the second embodiment, the threshold value is changed according to the data transfer amount (transfer speed) per unit time of the memory 807. However, the control unit 810 performs, for example, the data transfer processing performance in the recording medium 809. The threshold value may be controlled based on (recording processing capability). In this example, the effect is exhibited not when the amount of access to the memory 807 is large but when the transfer speed of the recording processing unit 808 is maintained high. For example, the control unit 810 performs control so that the threshold is set high when the recording medium 809 has high-speed transfer processing capability, and is set low when the recording medium 809 has low-speed transfer processing capability. . Further, the control unit 810 may control the threshold based on both the data transfer speed of the memory 807 and the data transfer processing performance of the recording medium 809. For example, the control unit 810 may be configured to increase the threshold if both the data transfer speed of the memory 807 and the data transfer processing performance of the recording medium 809 are high, and to decrease the threshold if either of them is low. In addition, for example, the control unit 810 can set the threshold value if the memory 807 can be prevented from being compressed by the other even if either the data transfer speed of the memory 807 or the data transfer processing performance of the recording medium 809 is low. You may make it not control low.

また、図8の例では、記録処理部808が制御部810による制御を受けていない構成となっているが、記録処理部808も制御部810により制御される構成であってもよい。この場合、制御部810が前述したデータ転送速度や記録処理部808の単位時間当たりの読み出し速度を管理して、前述のように閾値の制御を行う。また、前述した発生符号量の情報は制御部810が保持していてもよく、制御部810が発生符号量を基に量子化部804の量子化ステップ値を決定してもよい。   In the example of FIG. 8, the recording processing unit 808 is not controlled by the control unit 810, but the recording processing unit 808 may be controlled by the control unit 810. In this case, the control unit 810 manages the data transfer rate and the reading rate per unit time of the recording processing unit 808, and controls the threshold as described above. The information on the generated code amount may be held by the control unit 810, and the control unit 810 may determine the quantization step value of the quantization unit 804 based on the generated code amount.

<その他の実施形態>
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
<Other embodiments>
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in the computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

上述の実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。即ち、本発明は、その技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。   The above-described embodiments are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed as being limited thereto. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.

100,800 撮像装置、101,801 撮像部、102,802 プレーン変換部、103,803 周波数変換部、104,804 量子化部、105,805 エントロピー符号化部、106,806 メモリI/F部、107,807 メモリ、108,808 記録処理部、109,809 記録媒体、110,810 制御部、111,811 MUX   100,800 imaging device, 101,801 imaging unit, 102,802 plane conversion unit, 103,803 frequency conversion unit, 104,804 quantization unit, 105,805 entropy coding unit, 106,806 memory I / F unit, 107,807 Memory, 108,808 Recording processing unit, 109,809 Recording medium, 110,810 Control unit, 111,811 MUX

Claims (12)

フレーム画像に対して周波数変換を行って第1の係数データを生成する周波数変換手段と、
前記第1の係数データを、量子化パラメータに基づいて量子化して第2の係数データを生成する量子化手段と、
入力されたデータを符号化して符号化データを生成する符号化手段と、
前記符号化を制御する制御手段と、を有し、
前記制御手段は、
複数のフレーム画像から生成された複数の符号化データをメモリに記憶させる際に、メモリ内で前記符号化データの占める容量が所定の閾値未満である場合には、前記フレーム画像のデータを符号化し、
前記メモリ内で前記符号化データの占める容量が所定の閾値以上となった場合には、少なくとも1フレーム分の前記第1の係数データを符号化した後、前記第2の係数データを符号化するように制御することを特徴とする撮像装置。
Frequency conversion means for performing frequency conversion on the frame image to generate first coefficient data;
Quantization means for quantizing the first coefficient data based on a quantization parameter to generate second coefficient data;
Encoding means for encoding input data to generate encoded data;
Control means for controlling the encoding,
The control means includes
When storing a plurality of encoded data generated from a plurality of frame images in a memory, if the capacity occupied by the encoded data in the memory is less than a predetermined threshold, the data of the frame image is encoded. ,
When the capacity occupied by the encoded data in the memory exceeds a predetermined threshold value, the first coefficient data for at least one frame is encoded, and then the second coefficient data is encoded. An image pickup apparatus that is controlled as described above.
前記制御手段は、前記メモリ内で前記符号化データの占める容量が所定の閾値以上となった場合には、少なくとも1フレーム分の前記第1の係数データを符号化した後、1フレーム前の発生符号量に応じた量子化パラメータを用いて前記量子化がなされた前記第2の係数データを符号化するように制御することを特徴とする請求項1に記載の撮像装置。   When the capacity occupied by the encoded data in the memory exceeds a predetermined threshold, the control means encodes the first coefficient data for at least one frame and then generates one frame before The imaging apparatus according to claim 1, wherein the second coefficient data that has been quantized is controlled to be encoded using a quantization parameter corresponding to a code amount. 前記周波数変換は、前記フレーム画像を複数のサブバンドに分解して、前記複数のサブバンド毎の前記第1の係数データを生成し、
前記量子化手段は、前記複数のサブバンド毎に、1フレーム前のサブバンドの発生符号量に応じて決定された量子化パラメータを用いて量子化を行うことを特徴とする請求項2に記載の撮像装置。
The frequency transform decomposes the frame image into a plurality of subbands to generate the first coefficient data for each of the plurality of subbands;
3. The quantization unit according to claim 2, wherein the quantization unit performs quantization for each of the plurality of subbands using a quantization parameter determined according to a generated code amount of a subband one frame before. Imaging device.
前記制御手段は、前記メモリから前記符号化データが読み出されて転送される際のデータ転送速度に基づいて、前記所定の閾値を制御することを特徴とする請求項1乃至3の何れか1項に記載の撮像装置。   4. The control unit according to claim 1, wherein the control unit controls the predetermined threshold value based on a data transfer rate when the encoded data is read from the memory and transferred. The imaging device according to item. 前記制御手段は、前記メモリに対する前記フレームの符号化データの読み出し開始時間と読み出し完了時間との差分に応じて前記所定の閾値を制御することを特徴とする請求項1乃至4の何れか1項に記載の撮像装置。   5. The control unit according to claim 1, wherein the control unit controls the predetermined threshold according to a difference between a read start time and a read completion time of the encoded data of the frame for the memory. The imaging device described in 1. 前記制御手段は、前記メモリに対する単位時間当たりの前記符号化データの書き込み量と読み出し量との比に応じて前記所定の閾値を制御することを特徴とする請求項1乃至3の何れか1項に記載の撮像装置。   4. The control unit according to claim 1, wherein the control unit controls the predetermined threshold according to a ratio between a write amount and a read amount of the encoded data per unit time with respect to the memory. The imaging device described in 1. 前記制御手段は、前記メモリから読み出された前記符号化データが転送されて記録される記録媒体の処理性能に応じて前記所定の閾値を制御することを特徴とする請求項1乃至6の何れか1項に記載の撮像装置。   7. The control unit according to claim 1, wherein the control unit controls the predetermined threshold according to processing performance of a recording medium on which the encoded data read from the memory is transferred and recorded. The imaging apparatus of Claim 1. 前記撮像によるフレーム画像のRAWデータを色成分毎のプレーンに変換したプレーンデータを生成するプレーン変換手段を有し、
前記周波数変換手段は、前記フレーム画像のRAWデータから変換された前記色成分毎の各プレーンデータを、前記周波数変換により複数のサブバンドに分解して、前記複数のサブバンド毎の前記第1の係数データを生成し、
前記量子化手段は、前記サブバンド毎の前記符号化による発生符号量に応じたサブバンド毎の量子化パラメータを用いて、前記サブバンド毎の前記第1の係数データを量子化して、前記サブバンド毎の第2の係数データを生成することを特徴とする請求項1乃至7の何れか1項に記載の撮像装置。
Plane conversion means for generating plane data obtained by converting RAW data of a frame image obtained by the imaging into a plane for each color component;
The frequency conversion means decomposes each plane data for each of the color components converted from the RAW data of the frame image into a plurality of subbands by the frequency conversion, and the first for each of the plurality of subbands. Generate coefficient data,
The quantization means quantizes the first coefficient data for each subband using a quantization parameter for each subband corresponding to a generated code amount by the encoding for each subband, and The imaging apparatus according to claim 1, wherein second coefficient data for each band is generated.
前記フレーム画像のデータと前記第1の係数データと前記第2の係数データとが入力されて、前記入力されたデータの中から何れかのデータを切り替え選択して前記符号化手段に出力する選択手段を有し、
前記制御手段は、
前記メモリ内で前記符号化データの占める容量が所定の閾値未満である場合には、前記選択手段から、前記フレーム画像のデータを前記符号化手段に出力させ、
前記メモリ内で前記符号化データの占める容量が所定の閾値以上となった場合には、前記選択手段から、少なくとも1フレーム分の前記第1の係数データを前記符号化手段に出力させた後、以降は1フレーム前の前記第2の係数データを前記符号化手段に出力させることを特徴とする請求項1乃至8の何れか1項に記載の撮像装置。
A selection in which the frame image data, the first coefficient data, and the second coefficient data are input, and one of the input data is switched and selected and output to the encoding means Having means,
The control means includes
When the capacity occupied by the encoded data in the memory is less than a predetermined threshold, the selection means outputs the frame image data to the encoding means,
When the capacity occupied by the encoded data in the memory is equal to or greater than a predetermined threshold, after the selection means outputs the first coefficient data for at least one frame to the encoding means, 9. The image pickup apparatus according to claim 1, wherein the second coefficient data of one frame before is output to the encoding unit thereafter.
前記フレーム画像は、連写撮影された静止画像の各フレーム画像、又は、動画撮影された動画の各フレーム画像であることを特徴とする請求項1乃至9の何れか1項に記載の撮像装置。   The imaging device according to any one of claims 1 to 9, wherein the frame image is each frame image of a still image captured by continuous shooting or each frame image of a moving image captured by a moving image. . フレーム画像に対して周波数変換を行って第1の係数データを生成する変換工程と、
前記第1の係数データを、量子化パラメータに基づいて量子化して第2の係数データを生成する量子化工程と、
入力されたデータを符号化して符号化データを生成する符号化工程と、を有し、
前記符号化工程では、
複数のフレーム画像から生成された複数の符号化データをメモリに記憶させる際に、メモリ内で前記符号化データの占める容量が所定の閾値未満である場合には、前記フレーム画像のデータを符号化し、
前記メモリ内で前記符号化データの占める容量が所定の閾値以上となった場合には、少なくとも1フレーム分の前記第1の係数データを符号化した後、前記第2の係数データを符号化することを特徴とする撮像装置の制御方法。
A conversion step of performing frequency conversion on the frame image to generate first coefficient data;
A quantization step of quantizing the first coefficient data based on a quantization parameter to generate second coefficient data;
Encoding the input data to generate encoded data, and
In the encoding step,
When storing a plurality of encoded data generated from a plurality of frame images in a memory, if the capacity occupied by the encoded data in the memory is less than a predetermined threshold, the data of the frame image is encoded. ,
When the capacity occupied by the encoded data in the memory exceeds a predetermined threshold value, the first coefficient data for at least one frame is encoded, and then the second coefficient data is encoded. And a method of controlling the imaging apparatus.
撮像装置が有するコンピュータを、請求項1乃至10の何れか1項に記載の撮像装置の各手段として機能させるためのプログラム。   The program for functioning the computer which an imaging device has as each means of the imaging device of any one of Claims 1 thru | or 10.
JP2016136861A 2016-07-11 2016-07-11 Imaging apparatus, control method for imaging apparatus, and program Pending JP2018011120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016136861A JP2018011120A (en) 2016-07-11 2016-07-11 Imaging apparatus, control method for imaging apparatus, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016136861A JP2018011120A (en) 2016-07-11 2016-07-11 Imaging apparatus, control method for imaging apparatus, and program

Publications (1)

Publication Number Publication Date
JP2018011120A true JP2018011120A (en) 2018-01-18

Family

ID=60994390

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016136861A Pending JP2018011120A (en) 2016-07-11 2016-07-11 Imaging apparatus, control method for imaging apparatus, and program

Country Status (1)

Country Link
JP (1) JP2018011120A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110418061A (en) * 2019-08-26 2019-11-05 Oppo广东移动通信有限公司 Image processing method, image processor, photographing device and electronic equipment
JP2020088537A (en) * 2018-11-21 2020-06-04 キヤノン株式会社 Imaging apparatus, control method of the same, and program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020088537A (en) * 2018-11-21 2020-06-04 キヤノン株式会社 Imaging apparatus, control method of the same, and program
JP7204441B2 (en) 2018-11-21 2023-01-16 キヤノン株式会社 IMAGING DEVICE, CONTROL METHOD AND PROGRAM THEREOF
CN110418061A (en) * 2019-08-26 2019-11-05 Oppo广东移动通信有限公司 Image processing method, image processor, photographing device and electronic equipment
CN110418061B (en) * 2019-08-26 2021-04-23 Oppo广东移动通信有限公司 Image processing method, image processor, photographing device and electronic equipment

Similar Documents

Publication Publication Date Title
JP2017085247A (en) Encoding method, encoding device, imaging apparatus and program
JP2016213528A (en) Image encoder, image processing apparatus, image coding method
JP6875821B2 (en) Image coding device, imaging device, image coding method and program
JP2019004428A (en) Image encoding device, image decoding device, image encoding method, image decoding method, and program
CN101253761B (en) Image encoding apparatus and image encoding method
JP6023596B2 (en) Image encoding device
JPWO2006098226A1 (en) Encoding device and moving image recording system provided with encoding device
JP6512916B2 (en) Image pickup apparatus, control method thereof and program
JP2011518527A (en) Video decoding
JP6806466B2 (en) Image coding device and its control method
JP6871727B2 (en) Imaging equipment, image processing methods, and programs
JP6929044B2 (en) Imaging device, control method of imaging device, and program
JP5943733B2 (en) Image encoding apparatus, control method therefor, and program
CN110087074B (en) Image processing device and method for operating the same
JP2018011120A (en) Imaging apparatus, control method for imaging apparatus, and program
JP2004166128A (en) Method, device and program for coding image information
JP2009010612A (en) Image compression apparatus and image compression method
JP6946671B2 (en) Image processing device and image processing method
US12069306B2 (en) Image encoding apparatus and method for controlling the same and non-transitory computer-readable storage medium
JP6775339B2 (en) Image coding device and its control method
JP7332399B2 (en) Image processing device and its control method
TWI846680B (en) Image processing device and method for operating image processing device
JP2010213187A (en) Video coding transmission apparatus
JP6916618B2 (en) Image coding device and its control method and program
JP6849880B2 (en) Image transmission system and its control method and imaging device