JP2010074597A - Image processing device, image processing method, program and imaging device - Google Patents

Image processing device, image processing method, program and imaging device Download PDF

Info

Publication number
JP2010074597A
JP2010074597A JP2008240688A JP2008240688A JP2010074597A JP 2010074597 A JP2010074597 A JP 2010074597A JP 2008240688 A JP2008240688 A JP 2008240688A JP 2008240688 A JP2008240688 A JP 2008240688A JP 2010074597 A JP2010074597 A JP 2010074597A
Authority
JP
Japan
Prior art keywords
unit
data
word length
block
quantized
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.)
Withdrawn
Application number
JP2008240688A
Other languages
Japanese (ja)
Inventor
Fumiaki Kato
文昭 加藤
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.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2008240688A priority Critical patent/JP2010074597A/en
Publication of JP2010074597A publication Critical patent/JP2010074597A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Studio Devices (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing device capable of: random access to the data corresponding to an arbitrary area in image data; and improving the compression efficiency of the image data, an image processing method, a program and an imaging device. <P>SOLUTION: A compression section included in the image processing device includes: a frequency measuring portion for measuring the frequency of the dynamic range of the block consisting of pixel data of a predetermined number with regard to image data; a quantization word length allocation calculation portion for computing the quantization word length assigned to each dynamic range for every block based on the frequency; and a padding portion for adding 0 or 1 until reaching a predetermined code amount with respect to the compressed image data including the coding data for every block quantized based on the computed quantization word length by predetermined blocks. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、画像処理装置、画像処理方法、プログラムおよび撮像装置に関する。   The present invention relates to an image processing device, an image processing method, a program, and an imaging device.

近年、デジタルスチルカメラやデジタルビデオカメラなど、固体撮像素子を用いて撮像を行い、得られた撮像画像をデジタルデータとして保存可能な撮像装置が広く普及している。このような撮像装置では、撮像素子の多画素化や、装置の高機能化・高性能化が進んでおり、特に、撮像素子の多画素化が進むと、撮像信号の処理負荷が増大する。他方、操作性に関してユーザにストレスを感じさせないようにするためには、処理の高速化が必要となる。   2. Description of the Related Art In recent years, imaging apparatuses capable of capturing an image using a solid-state image sensor, such as a digital still camera and a digital video camera, and storing the obtained captured image as digital data are widely used. In such an image pickup apparatus, the number of pixels of the image sensor is increased, and the function and performance of the apparatus are increased. In particular, when the number of pixels of the image sensor is increased, the processing load of the image signal increases. On the other hand, in order to prevent the user from feeling stress regarding operability, it is necessary to increase the processing speed.

ここで、一般的な撮像装置では、撮像素子から出力されたRAWデータを、一旦SDRAM(Synchronous Dynamic Random Access Memory)等の画像メモリに格納した後、読み出してカメラ信号処理などを施すことが行われる。そこで、以下に示す特許文献1では、画像メモリにおける画像データの読み書きに要する時間を短縮して、高速な撮像動作を実現することが行われている。   Here, in a general imaging device, RAW data output from an imaging device is temporarily stored in an image memory such as SDRAM (Synchronous Dynamic Random Access Memory), and then read and subjected to camera signal processing and the like. . Therefore, in Patent Document 1 shown below, a time required for reading and writing image data in an image memory is shortened to realize a high-speed imaging operation.

特開2007−228515号公報JP 2007-228515 A

しかしながら、上記特許文献1に記載の方法では、画像データに対して固定長圧縮を行っているため、画像データ中の任意の領域に対応するデータへのランダムアクセスは可能となったものの、画像データの圧縮効率をより高くすることが困難であるという問題があった。   However, in the method described in Patent Document 1, since fixed length compression is performed on image data, random access to data corresponding to an arbitrary area in the image data is possible. There has been a problem that it is difficult to further increase the compression efficiency.

そこで、本発明は、このような問題に鑑みてなされたもので、その目的は、画像データ中の任意の領域に対応するデータへのランダムアクセスが可能であり、かつ、画像データの圧縮効率を向上させることが可能な、新規かつ改良された画像処理装置、画像処理方法、プログラムおよび撮像装置を提供することにある。   Therefore, the present invention has been made in view of such a problem, and an object of the present invention is to enable random access to data corresponding to an arbitrary area in the image data and to improve the compression efficiency of the image data. It is an object of the present invention to provide a new and improved image processing apparatus, image processing method, program, and imaging apparatus that can be improved.

上記課題を解決するために、本発明のある観点によれば、撮像素子から出力された画像データを圧縮する圧縮部と、圧縮された前記画像データを保持する記憶部と、を有し、前記圧縮部は、前記画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測する頻度計測部と、前記頻度に基づいて、前記ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出する量子化語長割当算出部と、算出された前記量子化語長に基づいて量子化された前記ブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加するパディング部と、を備える画像処理装置が提供される。   In order to solve the above-described problem, according to an aspect of the present invention, the image processing apparatus includes a compression unit that compresses image data output from an image sensor, and a storage unit that holds the compressed image data. The compression unit, for the image data, a frequency measurement unit that measures the frequency of a dynamic range of a block made up of a predetermined number of pixel data, and a quantized word assigned to each dynamic range for each block based on the frequency A quantized word length allocation calculating unit for calculating a length, and a predetermined code for compressed image data including a predetermined block of encoded data for each block quantized based on the calculated quantized word length An image processing apparatus is provided that includes a padding unit that adds 0 or 1 until the amount reaches.

かかる構成によれば、画像処理装置の圧縮部が備える頻度計測部は、画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測する。また、量子化語長割当算出部は、測定された頻度に基づいて、ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出する。また、パディング部は、算出された量子化語長に基づいて量子化されたブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加する。   According to such a configuration, the frequency measurement unit included in the compression unit of the image processing apparatus measures the frequency of the dynamic range of the block including a predetermined number of pixel data for the image data. Further, the quantized word length allocation calculation unit calculates the quantized word length allocated to each dynamic range for each block based on the measured frequency. The padding unit adds 0 or 1 to the compressed image data including a predetermined block of encoded data for each block quantized based on the calculated quantization word length until the predetermined code amount is reached. To do.

前記画像処理装置は、前記各ダイナミックレンジに割り当てられる量子化語長の組み合わせが互いに異なる複数のパターンが記載された量子化語長テーブルを予め保持しており、前記量子化語長割当算出部は、前記量子化語長テーブルに記載された前記複数のパターンと前記頻度とに基づいて各パターンにおける前記所定ブロック分の圧縮画像データの確定符号量を算出し、前記確定符号量が所望の符号量以下となる前記パターンにおける前記量子化語長の組み合わせを選択することが好ましい。   The image processing apparatus holds in advance a quantization word length table in which a plurality of patterns having different combinations of quantization word lengths assigned to each dynamic range are described, and the quantization word length assignment calculation unit includes: , Calculating a determined code amount of compressed image data for the predetermined block in each pattern based on the plurality of patterns described in the quantized word length table and the frequency, and the determined code amount is a desired code amount It is preferable to select a combination of the quantized word lengths in the pattern to be as follows.

前記量子化語長割当算出部は、前記確定符号量が前記所望の符号量超過となる場合に、前記各ダイナミックレンジに割り当てられる量子化語長を所定の固定値に設定してもよい。   The quantized word length allocation calculating unit may set the quantized word length allocated to each dynamic range to a predetermined fixed value when the determined code amount exceeds the desired code amount.

前記量子化語長割当算出部は、前記所定の符号量と、選択された前記量子化語長の組み合わせにおける前記確定符号量との差を、パディング量として前記パディング部に伝送してもよい。   The quantized word length allocation calculating unit may transmit a difference between the predetermined code amount and the determined code amount in the selected combination of quantized word lengths as a padding amount to the padding unit.

前記圧縮部は、前記算出された量子化語長に基づいて前記ブロックごとに前記画像データを量子化する量子化実行部を更に備え、前記量子化実行部は、所定のビット数を有し、前記算出された量子化語長を表す情報を少なくとも含む固定長部と、前記所定数の画素データに対応した前記符号化データを含む可変長部と、から構成される符号化データを生成してもよい。   The compression unit further includes a quantization execution unit that quantizes the image data for each block based on the calculated quantization word length, and the quantization execution unit has a predetermined number of bits, Generating encoded data composed of a fixed length part including at least information indicating the calculated quantization word length and a variable length part including the encoded data corresponding to the predetermined number of pixel data; Also good.

前記画像処理装置は、前記記憶部に保持されている前記圧縮された画像データを取得し、当該圧縮された画像データの中から任意の矩形領域に対応するデータを伸張する伸張部を更に備え、前記伸張部は、前記固定長部に含まれる前記量子化語長を表す情報に基づいて、前記任意の矩形領域に対応するデータの位置を特定してもよい。   The image processing apparatus further includes a decompression unit that obtains the compressed image data held in the storage unit and decompresses data corresponding to an arbitrary rectangular area from the compressed image data, The decompression unit may specify the position of data corresponding to the arbitrary rectangular region based on information representing the quantization word length included in the fixed length unit.

上記課題を解決するために、本発明の別の観点によれば、撮像素子から出力された画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測するステップと、前記頻度に基づいて、前記ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出するステップと、算出された前記量子化語長に基づいて量子化された前記ブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加するステップと、を含む画像処理方法が提供される。   In order to solve the above problems, according to another aspect of the present invention, a step of measuring a frequency of a dynamic range of a block composed of a predetermined number of pixel data for image data output from an image sensor, And calculating a quantized word length allocated to each dynamic range for each block, and encoding the encoded data for each block quantized based on the calculated quantized word length for a predetermined block. And adding 0 or 1 to the compressed image data including a predetermined code amount.

上記課題を解決するために、本発明の更に別の観点によれば、撮像素子から出力された画像データが入力され、入力された前記画像データを圧縮して保持可能なコンピュータに、入力された前記画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測する頻度計測機能と、前記頻度に基づいて、前記ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出する量子化語長割当算出機能と、算出された善意量子化語長に基づいて量子化された前記ブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加するパディング機能と、を実現させるための、プログラムが提供される。   In order to solve the above problems, according to still another aspect of the present invention, image data output from an image sensor is input, and the input image data is input to a computer capable of compressing and storing the input image data. For the image data, a frequency measurement function for measuring the frequency of a dynamic range of a block composed of a predetermined number of pixel data, and a quantization word length assigned to each dynamic range is calculated for each block based on the frequency. Quantized word length allocation calculation function and compressed image data including predetermined blocks of encoded data for each block quantized based on the calculated bona fide quantized word length until a predetermined code amount is reached A program for realizing a padding function for adding 0 or 1 is provided.

かかる構成によれば、コンピュータプログラムは、コンピュータが備える記憶部に格納され、コンピュータが備えるCPUに読み込まれて実行されることにより、そのコンピュータを上記の画像処理装置として機能させる。また、コンピュータプログラムが記録された、コンピュータで読み取り可能な記録媒体も提供することができる。記録媒体は、例えば、磁気ディスク、光ディスク、光磁気ディスク、フラッシュメモリなどである。また、上記のコンピュータプログラムは、記録媒体を用いずに、例えばネットワークを介して配信してもよい。   According to this configuration, the computer program is stored in the storage unit included in the computer, and is read and executed by the CPU included in the computer, thereby causing the computer to function as the image processing apparatus. A computer-readable recording medium in which a computer program is recorded can also be provided. The recording medium is, for example, a magnetic disk, an optical disk, a magneto-optical disk, a flash memory, or the like. Further, the above computer program may be distributed via a network, for example, without using a recording medium.

上記課題を解決するために、本発明の更に別の観点によれば、撮像素子から出力された画像データを圧縮する圧縮部と、圧縮された前記画像データを保持する記憶部と、を有し、前記圧縮部は、前記画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測する頻度計測部と、前記頻度に基づいて、前記ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出する量子化語長割当算出部と、算出された前記量子化語長に基づいて量子化された前記ブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加するパディング部と、を備える撮像装置が提供される。   In order to solve the above-described problem, according to still another aspect of the present invention, a compression unit that compresses image data output from an image sensor and a storage unit that stores the compressed image data are provided. The compression unit includes a frequency measurement unit that measures the frequency of a dynamic range of a block including a predetermined number of pixel data for the image data, and a quantum allocated to each dynamic range for each block based on the frequency. A quantized word length allocation calculating unit that calculates a quantized word length, and a predetermined amount of compressed image data including a predetermined block of encoded data for each block quantized based on the calculated quantized word length An imaging device is provided that includes a padding unit that adds 0 or 1 until the amount of codes becomes.

本発明によれば、画像データ中の任意の領域に対応するデータへのランダムアクセスが可能であり、かつ、画像データの圧縮効率を向上させることが可能である。   According to the present invention, random access to data corresponding to an arbitrary area in image data is possible, and the compression efficiency of image data can be improved.

以下に添付図面を参照しながら、本発明の好適な実施の形態について詳細に説明する。なお、本明細書及び図面において、実質的に同一の機能構成を有する構成要素については、同一の符号を付することにより重複説明を省略する。   Exemplary embodiments of the present invention will be described below in detail with reference to the accompanying drawings. In addition, in this specification and drawing, about the component which has the substantially same function structure, duplication description is abbreviate | omitted by attaching | subjecting the same code | symbol.

なお、説明は、以下の順序で行うものとする。
(1)従来の撮像装置について
(2)第1の実施形態
撮像装置の構成について
撮像装置の全体構成について
RAW圧縮部の構成について
RAW伸張部の構成について
(3)まとめ
圧縮処理に関するまとめ
伸張処理に関するまとめ
The description will be made in the following order.
(1) About conventional imaging device (2) First embodiment About configuration of imaging device
About the overall configuration of the imaging device
About the configuration of the RAW compression unit
Configuration of RAW decompression unit (3) Summary Summary on compression processing Summary on decompression processing

<従来の撮像装置について>
まず、図14を参照しながら、従来の撮像装置について、詳細に説明する。図14は、従来の撮像装置の構成を説明するためのブロック図である。
<Regarding conventional imaging apparatus>
First, a conventional imaging device will be described in detail with reference to FIG. FIG. 14 is a block diagram for explaining the configuration of a conventional imaging apparatus.

従来の撮像装置900は、例えばデジタルスチルカメラ、デジタルビデオカメラなどであり、被写体像をデジタルデータとして記録することができる。以下では、撮像装置900がデジタルスチルカメラである場合を例にとって説明を行う。   A conventional imaging apparatus 900 is, for example, a digital still camera or a digital video camera, and can record a subject image as digital data. In the following description, the case where the imaging apparatus 900 is a digital still camera will be described as an example.

撮像装置900は、図14に示すように、例えば、撮像素子901、アナログフロントエンド(Analog Front End:AFE)回路部903、デジタル画像処理回路部905、ROM(Read Only Memory)919、ストレージデバイス921およびSDRAM929等を備えている。   As illustrated in FIG. 14, the imaging apparatus 900 includes, for example, an imaging element 901, an analog front end (AFE) circuit unit 903, a digital image processing circuit unit 905, a ROM (Read Only Memory) 919, and a storage device 921. And SDRAM 929 and the like.

また、デジタル画像処理回路部905は、カメラ信号前処理部907、カメラ信号処理部911、解像度変換部913、JPEGエンジン915、CPU(Central Processing Unit)917、ビデオ出力エンコーダ923及びSDRAMコントローラ927などを有する。これらの各構成要素は、内部バス909によって相互に接続されている。   The digital image processing circuit unit 905 includes a camera signal preprocessing unit 907, a camera signal processing unit 911, a resolution conversion unit 913, a JPEG engine 915, a CPU (Central Processing Unit) 917, a video output encoder 923, an SDRAM controller 927, and the like. Have. Each of these components is connected to each other by an internal bus 909.

撮像素子901は、例えばCCD(Charge Coupled Devices)、CMOS(Complementary Metal Oxide Semiconductor)などの固体撮像素子であり、図示しないレンズブロック(光学系)を通じて被写体から入射された光を電気信号に変換する。   The imaging device 901 is a solid-state imaging device such as a CCD (Charge Coupled Devices) or CMOS (Complementary Metal Oxide Semiconductor), and converts light incident from a subject through an unillustrated lens block (optical system) into an electrical signal.

AFE回路部903は、撮像素子901から出力された画像信号に対して、相関二重サンプリング(Corelated Double Sampling:CDS)処理によりS/N(Signal/Noise)比を良好に保つようにサンプルホールドを行う。AFE回路903は、オートマティックゲインコントロール(Automatic Gain Control:AGC)処理により利得(ゲイン)を制御し、A/D(Analog/Digital)変換を行ってデジタル画像信号を出力する。   The AFE circuit unit 903 performs sample hold on the image signal output from the image sensor 901 so as to maintain a good S / N (Signal / Noise) ratio by correlated double sampling (CDS) processing. Do. The AFE circuit 903 controls the gain (gain) by automatic gain control (Automatic Gain Control: AGC) processing, performs A / D (Analog / Digital) conversion, and outputs a digital image signal.

デジタル画像処理回路部905は、例えば、SoC(System on a Chip)回路などとして形成される。デジタル画像処理回路部905において、カメラ信号前処理部907は、AFE回路部903から供給された画像信号に対して、撮像素子901における欠陥画素の信号補正処理、レンズの周辺光量落ちを補正するシェーディング処理などを施す。また、カメラ信号前処理部907は、処理後の信号を、RAWデータとして出力する。   The digital image processing circuit unit 905 is formed as, for example, a SoC (System on a Chip) circuit. In the digital image processing circuit unit 905, the camera signal preprocessing unit 907 performs signal correction processing for defective pixels in the image sensor 901 and shading for correcting the peripheral light loss of the lens with respect to the image signal supplied from the AFE circuit unit 903. Apply processing. The camera signal preprocessing unit 907 outputs the processed signal as RAW data.

カメラ信号処理部911は、自動焦点(Auto Focus:AF)制御、自動露光(Auto Exposure:AE)制御、ホワイトバランス制御などのための信号検波処理や、ホワイトバランス調整に代表される信号補正処理など、いわゆるカメラ信号処理、またはその処理の一部を実行する。また、カメラ信号処理部911は、信号補正後の画像データを、例えば4:2:2などの所定フォーマットの輝度信号(Y)と色差信号(R−Y,B−Y)に変換する。   The camera signal processing unit 911 includes signal detection processing for automatic focus (Auto Focus: AF) control, automatic exposure (Auto Exposure: AE) control, white balance control, and signal correction processing represented by white balance adjustment. , So-called camera signal processing, or a part of the processing is executed. Further, the camera signal processing unit 911 converts the image data after the signal correction into a luminance signal (Y) and a color difference signal (RY, BY) in a predetermined format such as 4: 2: 2.

解像度変換部913は、カメラ信号処理部911で処理された画像データ、または、後述するJPEGエンジン915で伸張復号化された画像データの入力を受けて、所定の解像度に変換する。   The resolution conversion unit 913 receives image data processed by the camera signal processing unit 911 or image data decompressed and decoded by a JPEG engine 915 described later, and converts the image data to a predetermined resolution.

JPEGエンジン915は、解像度変換部913で処理された画像データを圧縮符号化し、JPEG方式の符号化データを生成する。また、JPEGエンジン915は、ストレージデバイス921から読み出されたJPEG画像データを伸張復号化する。なお、デジタル画像処理回路部905には、このJPEGエンジン915以外の他の静止画圧縮方式、または動画圧縮方式のエンコード/デコードエンジンが設けられていてもよい。   The JPEG engine 915 compresses and encodes the image data processed by the resolution conversion unit 913, and generates JPEG encoded data. The JPEG engine 915 decompresses and decodes JPEG image data read from the storage device 921. Note that the digital image processing circuit unit 905 may be provided with an encoding / decoding engine of a still image compression method or a moving image compression method other than the JPEG engine 915.

CPU917は、後述するROM919に格納されたプログラムを実行することにより、デジタル画像処理回路部905および撮像装置900全体を統括的に制御し、また、その制御のための各種演算を実行する。   The CPU 917 performs overall control of the digital image processing circuit unit 905 and the entire imaging apparatus 900 by executing a program stored in a ROM 919 described later, and executes various calculations for the control.

ROM919は、CPU917が実行するプログラムや各種データを保持する。ROM919は、例えば、EEPROM(Electronically Erasable and Programmable ROM)、フラッシュメモリなどの不揮発性メモリである。   The ROM 919 holds programs executed by the CPU 917 and various data. The ROM 919 is a non-volatile memory such as an EEPROM (Electronically Erasable and Programmable ROM) or a flash memory, for example.

ストレージデバイス921は、符号化された画像データのファイルを記録するためのデバイスである。ストレージデバイス921は、例えば、フラッシュメモリ、各種の光ディスク、磁気テープなどの記録媒体と、記録媒体の記録/再生ドライブなどからなる。   The storage device 921 is a device for recording a file of encoded image data. The storage device 921 includes, for example, a recording medium such as a flash memory, various optical disks, and a magnetic tape, and a recording / reproducing drive for the recording medium.

ビデオ出力エンコーダ923は、例えばNTSC(National Television Standards Committee)エンコーダなどである。ビデオ出力エンコーダ923は、解像度変換部913などから出力された画像データを基に、モニタ表示用の画像信号を生成し、モニタ(図示せず。)またはビデオ出力端子925に出力する。   The video output encoder 923 is, for example, an NTSC (National Television Standards Committee) encoder. The video output encoder 923 generates an image signal for monitor display based on the image data output from the resolution conversion unit 913 and the like, and outputs the image signal to a monitor (not shown) or the video output terminal 925.

SDRAMコントローラ927は、後述するSDRAM929に対するインタフェースブロックであり、アドレスデコーダなどを有する。SDRAMコントローラ927は、CPU917からの制御信号に従って、SDRAM929の書き込みおよび読み出し動作を制御する。   The SDRAM controller 927 is an interface block for an SDRAM 929, which will be described later, and includes an address decoder and the like. The SDRAM controller 927 controls writing and reading operations of the SDRAM 929 according to a control signal from the CPU 917.

SDRAM929は、DDR(Double Data Rate)SDRAMなどの揮発性のメモリである。SDRAM929は、デジタル画像処理回路部905におけるデータ処理のためのワークエリアである。SDRAM929は、キャプチャデータエリア931と、JPEG符号エリア933と、CPUワークエリア935などを含む。キャプチャデータエリア931は、撮像素子901からキャプチャされたデータであるRAWデータを一時的に格納する。JPEG符号エリア933は、JPEGエンジン915により符号化された画像データや、その符号化・復号化処理で利用されるデータなどを一時的に格納する。CPUワークエリア935は、CPU917の処理で利用されるデータを一時的に格納する。   The SDRAM 929 is a volatile memory such as a DDR (Double Data Rate) SDRAM. The SDRAM 929 is a work area for data processing in the digital image processing circuit unit 905. The SDRAM 929 includes a capture data area 931, a JPEG code area 933, a CPU work area 935, and the like. The capture data area 931 temporarily stores RAW data that is data captured from the image sensor 901. The JPEG code area 933 temporarily stores image data encoded by the JPEG engine 915, data used in the encoding / decoding process, and the like. The CPU work area 935 temporarily stores data used in the processing of the CPU 917.

上記のような撮像装置900において、撮像素子901による撮像信号は、順次AFE回路部903に伝送され、CDS処理やAGC処理が施された後、デジタル信号に変換されて、デジタル画像処理回路部905のカメラ信号前処理部907に伝送される。カメラ信号前処理部907では、入力された画像信号に対して、欠陥画素補正やシェーディング補正などを施したRAWデータが生成される。このRAWデータは、SDRAM929に一旦書き込まれる。   In the imaging apparatus 900 as described above, an imaging signal from the imaging element 901 is sequentially transmitted to the AFE circuit unit 903, subjected to CDS processing and AGC processing, converted into a digital signal, and then converted into a digital image processing circuit unit 905. To the camera signal pre-processing unit 907. The camera signal preprocessing unit 907 generates RAW data obtained by performing defective pixel correction, shading correction, or the like on the input image signal. This RAW data is temporarily written in the SDRAM 929.

上記RAWデータは、SDRAM929から読み出されると、カメラ信号処理部911により各種画質補正処理が施される。処理後の画像データは、例えばSDRAM929に一旦格納された後、解像度変換部913により、表示に適した解像度のデータに変換される。また、解像度変換後の画像データは、例えばSDRAM929に格納された後、ビデオ出力エンコーダ923に伝送される。これにより、カメラスルー画像がモニタに表示される。   When the RAW data is read from the SDRAM 929, various image quality correction processes are performed by the camera signal processing unit 911. The processed image data is temporarily stored in the SDRAM 929, for example, and then converted into data having a resolution suitable for display by the resolution conversion unit 913. Further, the image data after resolution conversion is stored in, for example, the SDRAM 929 and then transmitted to the video output encoder 923. Thereby, a camera through image is displayed on the monitor.

また、図示しない入力部などを通じて画像の記録が要求されると、解像度変換部913は、カメラ信号処理部911で処理された画像データを、必要に応じて記録用に設定された解像度のデータに変換して、例えばSDRAM929に一旦格納する。JPEGエンジン915は、画像データを圧縮符号化して、符号化データを生成する。符号化データは、例えばSDRAM929に一旦記録された後、ストレージデバイス921に記録される。   When image recording is requested through an input unit (not shown), the resolution conversion unit 913 converts the image data processed by the camera signal processing unit 911 into data having a resolution set for recording as necessary. For example, the data is converted and temporarily stored in the SDRAM 929. The JPEG engine 915 compresses and encodes image data to generate encoded data. For example, the encoded data is once recorded in the SDRAM 929 and then recorded in the storage device 921.

また、ストレージデバイス921に記録された画像データ(符号化データ)は、JPEGエンジン915で伸張復号化され、解像度変換部913で解像度変換される。その後、画像データは、ビデオ出力エンコーダ923に出力されることで、モニタに画像を表示させることができる。   Further, the image data (encoded data) recorded in the storage device 921 is decompressed and decoded by the JPEG engine 915 and the resolution is converted by the resolution converter 913. Thereafter, the image data is output to the video output encoder 923 so that the image can be displayed on the monitor.

ここで、デジタル画像処理回路部905とSDRAM929との間でRAWデータの書き込み処理や読み出し処理がなされる場合、キャプチャサイズのRAWデータが、デジタル画像処理回路部905内の内部バス909を介して転送されることとなる。そのため、RAWデータを圧縮してメモリ上に保持することが可能となれば、より多くのRAWデータをキャプチャできることになる。また、RAWデータのキャプチャと読み出しは、全画面分のデータが内部バス909上を流れることとなるため、撮影時のバス帯域のかなりの部分を占めることとなる。そのため、RAWデータの圧縮によりデータサイズが減少すれば、撮影時に使用するバス帯域を削減することが可能となる。   Here, when a RAW data write process or a read process is performed between the digital image processing circuit unit 905 and the SDRAM 929, capture size RAW data is transferred via the internal bus 909 in the digital image processing circuit unit 905. Will be. Therefore, if RAW data can be compressed and stored in the memory, more RAW data can be captured. In addition, since the RAW data is captured and read out, data for the entire screen flows on the internal bus 909, and therefore occupies a considerable portion of the bus bandwidth at the time of shooting. Therefore, if the data size is reduced due to the compression of RAW data, the bus bandwidth used at the time of shooting can be reduced.

また、いわゆる連写撮影機能などでは、複数フレームの撮影画像をメモリ上に高速に貼り付け、その後順次信号処理を行ってゆく手順を踏むことで、連写枚数上限を増やす事ができる。また、連写間隔と信号処理スピードによっては、ストレージ容量の上限までではあるが、無限連写的に撮影を行うことが可能となる。   In addition, in the so-called continuous shooting function or the like, the upper limit of the number of continuous shots can be increased by following a procedure in which a plurality of frames of captured images are pasted on a memory at high speed and then signal processing is performed sequentially. Further, depending on the continuous shooting interval and the signal processing speed, it is possible to perform infinite continuous shooting even though the storage capacity is up to the upper limit.

このように、RAW信号の転送バス帯域削減は、デジタルスチルカメラやデジタルビデオカメラ等の撮像装置の性能に大きく関わる要素である。   Thus, reduction of the transfer bus bandwidth of the RAW signal is a factor that greatly affects the performance of the imaging apparatus such as a digital still camera or a digital video camera.

そこで、上述の特許文献1では、RAWデータの圧縮を行う際に、RAWデータの固定長圧縮を行い、バス帯域を一定とし、ブロック毎のランダムアクセスの実現が可能となったが、圧縮効率を高くすることはできなかった。   Therefore, in the above-mentioned Patent Document 1, when RAW data is compressed, fixed length compression of RAW data is performed, the bus bandwidth is fixed, and random access for each block can be realized. It couldn't be high.

また、RAWデータの圧縮を、可逆圧縮で実現することが考えられるが、ハフマン符号等の可変長となる要素を取り入れると、1画面の圧縮を終了するまで符号量が確定しない。そのため、キャプチャメモリサイズは小さくすることができず、1フレームキャプチャした後などに、符号量あふれ等の破綻処理が必要となるという問題があった。また、圧縮した画面の任意の一部分を伸張したい場合は、1フレームを全てデコードしたうえで、ラスタ順の並びに戻した後でないと、データへのアクセスができない。そのため、処理時間やメモリエリアが必要となるという問題があった。   Further, although it is conceivable to compress the RAW data by lossless compression, if an element having a variable length such as a Huffman code is incorporated, the code amount is not fixed until the compression of one screen is completed. For this reason, there is a problem that the capture memory size cannot be reduced and a failure process such as overflow of code amount is required after capturing one frame. In addition, when it is desired to expand an arbitrary part of the compressed screen, data cannot be accessed unless all frames are decoded and then returned in the raster order. Therefore, there is a problem that processing time and a memory area are required.

そこで、本願発明者は、上述のような問題を解決するために鋭意研究を行い、以下で説明するような画像処理装置および画像処理方法に想到した。   Therefore, the inventor of the present application has intensively studied in order to solve the above-described problems, and has come up with an image processing apparatus and an image processing method as described below.

(第1の実施形態)
<撮像装置の構成について>
次に、図1〜図13を参照しながら、本発明の第1の実施形態に係る画像処理装置の一例である撮像装置の構成について、詳細に説明する。
(First embodiment)
<About the configuration of the imaging device>
Next, the configuration of an imaging apparatus that is an example of an image processing apparatus according to the first embodiment of the present invention will be described in detail with reference to FIGS.

[撮像装置の全体構成について]
まず、図1を参照しながら、本実施形態に係る撮像装置の全体構成について、詳細に説明を行う。図1は、本実施形態に係る画像処理装置の一例である撮像装置の構成を説明するためのブロック図である。
[Overall configuration of imaging device]
First, the overall configuration of the imaging apparatus according to the present embodiment will be described in detail with reference to FIG. FIG. 1 is a block diagram for explaining a configuration of an imaging apparatus which is an example of an image processing apparatus according to the present embodiment.

本実施形態に係る撮像装置10は、例えばデジタルスチルカメラ、デジタルビデオカメラなどであり、被写体像をデジタルデータとして記録することができる。以下では、撮像装置10がデジタルスチルカメラである場合を例にとって説明を行う。   The imaging apparatus 10 according to the present embodiment is a digital still camera, a digital video camera, or the like, for example, and can record a subject image as digital data. In the following description, the case where the imaging device 10 is a digital still camera will be described as an example.

撮像装置10は、図1に示すように、例えば、撮像素子11、AFE回路部13、デジタル画像処理回路部15、ROM29、ストレージデバイス31およびSDRAM39等を備えている。   As shown in FIG. 1, the imaging apparatus 10 includes, for example, an imaging device 11, an AFE circuit unit 13, a digital image processing circuit unit 15, a ROM 29, a storage device 31, an SDRAM 39, and the like.

また、デジタル画像処理回路部15は、カメラ信号前処理部17、カメラ信号処理部21、解像度変換部23、JPEGエンジン25、CPU27、ビデオ出力エンコーダ33及びSDRAMコントローラ37などを有する。さらに、本実施形態に係るデジタル画像処理回路部15は、RAW圧縮部101およびRAW伸張部103を有する。これらの各構成要素は、内部バス19によって相互に接続されている。   The digital image processing circuit unit 15 includes a camera signal preprocessing unit 17, a camera signal processing unit 21, a resolution conversion unit 23, a JPEG engine 25, a CPU 27, a video output encoder 33, an SDRAM controller 37, and the like. Furthermore, the digital image processing circuit unit 15 according to the present embodiment includes a RAW compression unit 101 and a RAW expansion unit 103. Each of these components is connected to each other by an internal bus 19.

撮像素子11は、例えばCCD、CMOSなどの固体撮像素子であり、図示しないレンズブロック(光学系)を通じて被写体から入射された光を電気信号に変換する。   The imaging device 11 is a solid-state imaging device such as a CCD or CMOS, and converts light incident from a subject through an unillustrated lens block (optical system) into an electrical signal.

AFE回路部13は、撮像素子11から出力された画像信号に対して、CDS処理によりS/N比を良好に保つようにサンプルホールドを行う。AFE回路13は、AGC処理により利得(ゲイン)を制御し、A/D変換を行ってデジタル画像信号を出力する。   The AFE circuit unit 13 samples and holds the image signal output from the image sensor 11 so as to maintain a good S / N ratio by CDS processing. The AFE circuit 13 controls the gain by AGC processing, performs A / D conversion, and outputs a digital image signal.

デジタル画像処理回路部15は、例えば、SoC回路などとして形成される。デジタル画像処理回路部15において、カメラ信号前処理部17は、AFE回路部13から供給された画像信号に対して、撮像素子11における欠陥画素の信号補正処理、レンズの周辺光量落ちを補正するシェーディング処理などを施す。また、カメラ信号前処理部17は、処理後の信号を、RAWデータとして出力する。   The digital image processing circuit unit 15 is formed as a SoC circuit, for example. In the digital image processing circuit unit 15, the camera signal preprocessing unit 17 performs a signal correction process for a defective pixel in the image sensor 11 and a shading that corrects a decrease in the peripheral light amount of the lens for the image signal supplied from the AFE circuit unit 13. Apply processing. In addition, the camera signal preprocessing unit 17 outputs the processed signal as RAW data.

RAW圧縮部101は、カメラ信号前処理部17から伝送されたRAWデータを、後述する圧縮方法により圧縮し、SDRAMコントローラ37を介して、SDRAM39に伝送する。   The RAW compression unit 101 compresses the RAW data transmitted from the camera signal preprocessing unit 17 by a compression method described later, and transmits the compressed data to the SDRAM 39 via the SDRAM controller 37.

RAW伸張部103は、SDRAM39からSDRAMコントローラ37を介して読み出した圧縮されたRAWデータを、後述する方法により伸張して、カメラ信号処理部21に出力する。   The RAW decompression unit 103 decompresses the compressed RAW data read from the SDRAM 39 via the SDRAM controller 37 by a method described later and outputs the decompressed data to the camera signal processing unit 21.

カメラ信号処理部21は、AF制御、AE制御、ホワイトバランス制御などのための信号検波処理や、ホワイトバランス調整に代表される信号補正処理など、いわゆるカメラ信号処理、またはその処理の一部を実行する。また、カメラ信号処理部21は、信号補正後の画像データを、例えば4:2:2などの所定フォーマットの輝度信号(Y)と色差信号(R−Y,B−Y)に変換する。   The camera signal processing unit 21 executes so-called camera signal processing such as signal detection processing for AF control, AE control, white balance control, signal correction processing represented by white balance adjustment, or a part of the processing. To do. The camera signal processing unit 21 converts the image data after signal correction into a luminance signal (Y) and color difference signals (RY, BY) in a predetermined format such as 4: 2: 2.

解像度変換部23は、カメラ信号処理部21で処理された画像データ、または、JPEGエンジン25で伸張復号化された画像データの入力を受けて、所定の解像度に変換する。   The resolution conversion unit 23 receives image data processed by the camera signal processing unit 21 or image data decompressed and decoded by the JPEG engine 25 and converts the image data into a predetermined resolution.

JPEGエンジン25は、解像度変換部23で処理された画像データを圧縮符号化し、JPEG方式の符号化データを生成する。また、JPEGエンジン25は、ストレージデバイス31から読み出されたJPEG画像データを伸張復号化する。なお、デジタル画像処理回路部15には、このJPEGエンジン25以外の他の静止画圧縮方式、または動画圧縮方式のエンコード/デコードエンジンが設けられていてもよい。   The JPEG engine 25 compresses and encodes the image data processed by the resolution converter 23 to generate JPEG encoded data. The JPEG engine 25 decompresses and decodes JPEG image data read from the storage device 31. The digital image processing circuit unit 15 may be provided with an encoding / decoding engine of a still image compression method or a moving image compression method other than the JPEG engine 25.

CPU27は、後述するROM29に格納されたプログラムを実行することにより、デジタル画像処理回路部15および撮像装置10全体を統括的に制御し、また、その制御のための各種演算を実行する。   The CPU 27 comprehensively controls the digital image processing circuit unit 15 and the entire imaging apparatus 10 by executing a program stored in a ROM 29 described later, and executes various calculations for the control.

ROM29は、CPU27が実行するプログラムや各種データを保持する。ROM29は、例えば、EEPROM、フラッシュメモリなどの不揮発性メモリである。   The ROM 29 holds programs executed by the CPU 27 and various data. The ROM 29 is a nonvolatile memory such as an EEPROM or a flash memory, for example.

ストレージデバイス31は、符号化された画像データのファイルを記録するためのデバイスである。ストレージデバイス31は、例えば、フラッシュメモリ、各種の光ディスク、磁気テープなどの記録媒体と、記録媒体の記録/再生ドライブなどからなる。   The storage device 31 is a device for recording an encoded image data file. The storage device 31 includes, for example, a recording medium such as a flash memory, various optical disks, and a magnetic tape, and a recording / reproducing drive for the recording medium.

ビデオ出力エンコーダ33は、例えばNTSCエンコーダなどである。ビデオ出力エンコーダ33は、解像度変換部23などから出力された画像データを基に、モニタ表示用の画像信号を生成し、モニタ(図示せず。)またはビデオ出力端子35に出力する。   The video output encoder 33 is, for example, an NTSC encoder. The video output encoder 33 generates an image signal for monitor display based on the image data output from the resolution conversion unit 23 and the like, and outputs it to a monitor (not shown) or the video output terminal 35.

SDRAMコントローラ37は、後述するSDRAM39に対するインタフェースブロックであり、アドレスデコーダなどを有する。SDRAMコントローラ37は、CPU27からの制御信号に従って、SDRAM39の書き込みおよび読み出し動作を制御する。   The SDRAM controller 37 is an interface block for an SDRAM 39 to be described later, and includes an address decoder and the like. The SDRAM controller 37 controls writing and reading operations of the SDRAM 39 according to a control signal from the CPU 27.

SDRAM39は、DDRSDRAMなどの揮発性のメモリであって、撮像装置10が備える記憶部の一例である。SDRAM39は、デジタル画像処理回路部15におけるデータ処理のためのワークエリアである。SDRAM39は、キャプチャデータエリア41と、JPEG符号エリア43と、CPUワークエリア45などを含む。キャプチャデータエリア41は、撮像素子11からキャプチャされたデータであるRAWデータを一時的に格納する。JPEG符号エリア43は、JPEGエンジン25により符号化された画像データや、その符号化・復号化処理で利用されるデータなどを一時的に格納する。CPUワークエリア45は、CPU27の処理で利用されるデータを一時的に格納する。   The SDRAM 39 is a volatile memory such as a DDR SDRAM, and is an example of a storage unit included in the imaging device 10. The SDRAM 39 is a work area for data processing in the digital image processing circuit unit 15. The SDRAM 39 includes a capture data area 41, a JPEG code area 43, a CPU work area 45, and the like. The capture data area 41 temporarily stores RAW data that is data captured from the image sensor 11. The JPEG code area 43 temporarily stores image data encoded by the JPEG engine 25, data used in the encoding / decoding process, and the like. The CPU work area 45 temporarily stores data used for processing by the CPU 27.

上記のような撮像装置10において、撮像素子11による撮像信号は、順次AFE回路部13に供給され、CDS処理やAGC処理が施された後、デジタル信号に変換されて、デジタル画像処理回路部15のカメラ信号前処理部17に伝送される。カメラ信号前処理部17では、入力された画像信号に対して、欠陥画素補正やシェーディング補正などを施したRAWデータが生成される。このRAWデータは、RAW圧縮部101により圧縮された後、SDRAM39に一旦書き込まれる。   In the image pickup apparatus 10 as described above, the image pickup signal from the image pickup element 11 is sequentially supplied to the AFE circuit unit 13, subjected to CDS processing and AGC processing, converted into a digital signal, and then converted into a digital image processing circuit unit 15. To the camera signal pre-processing unit 17. The camera signal preprocessing unit 17 generates RAW data obtained by performing defective pixel correction, shading correction, or the like on the input image signal. This RAW data is compressed by the RAW compression unit 101 and then temporarily written in the SDRAM 39.

上記RAWデータは、SDRAM39から読み出されると、RAW伸張部103により伸張された後、カメラ信号処理部21により各種画質補正処理が施される。処理後の画像データは、例えばSDRAM39に一旦格納された後、解像度変換部23により、表示に適した解像度のデータに変換される。また、解像度変換後の画像データは、例えばSDRAM39に格納された後、ビデオ出力エンコーダ33に供給される。これにより、カメラスルー画像がモニタに表示される。   When the RAW data is read from the SDRAM 39, it is expanded by the RAW expansion unit 103 and then subjected to various image quality correction processes by the camera signal processing unit 21. The processed image data is temporarily stored in, for example, the SDRAM 39 and then converted into data having a resolution suitable for display by the resolution conversion unit 23. The image data after resolution conversion is supplied to the video output encoder 33 after being stored in the SDRAM 39, for example. Thereby, a camera through image is displayed on the monitor.

また、図示しない入力部などを通じて画像の記録が要求されると、解像度変換部23は、カメラ信号処理部21で処理された画像データを、必要に応じて記録用に設定された解像度のデータに変換して、例えばSDRAM39に一旦格納する。JPEGエンジン25は、画像データを圧縮符号化して、符号化データ(以下、圧縮符号データとも称する。)を生成する。符号化データは、例えばSDRAM39に一旦記録された後、ストレージデバイス31に記録される。   When image recording is requested through an input unit (not shown) or the like, the resolution conversion unit 23 converts the image data processed by the camera signal processing unit 21 into data having a resolution set for recording as necessary. For example, it is temporarily stored in the SDRAM 39 after conversion. The JPEG engine 25 compresses and encodes image data to generate encoded data (hereinafter also referred to as compressed code data). For example, the encoded data is once recorded in the SDRAM 39 and then recorded in the storage device 31.

また、ストレージデバイス31に記録された画像データ(圧縮符号データ)は、JPEGエンジン25で伸張復号化され、解像度変換部23で解像度変換される。その後、画像データは、ビデオ出力エンコーダ33に出力されることで、モニタに画像を表示させることができる。   The image data (compressed code data) recorded in the storage device 31 is decompressed and decoded by the JPEG engine 25 and the resolution is converted by the resolution converter 23. Thereafter, the image data is output to the video output encoder 33 so that the image can be displayed on the monitor.

本実施形態のデジタル画像処理回路部15には、カメラ信号前処理部17から内部バス19に対する画像データの入力位置に、RAWデータを圧縮するRAW圧縮部101が設けられる。これにより、内部バス19を通じてSDRAM39に伝送されるRAWデータのデータ量を低減することができる。また、内部バス19からカメラ信号処理部21に対する画像データの入力位置に、RAWデータを伸張するRAW伸張部103が設けられる。これにより、SDRAM39からカメラ信号処理部21に伝送されるRAWデータのデータ量を低減することができる。   The digital image processing circuit unit 15 of the present embodiment is provided with a RAW compression unit 101 that compresses RAW data at an input position of image data from the camera signal preprocessing unit 17 to the internal bus 19. Thereby, the amount of RAW data transmitted to the SDRAM 39 through the internal bus 19 can be reduced. In addition, a RAW expansion unit 103 that expands RAW data is provided at an input position of image data from the internal bus 19 to the camera signal processing unit 21. As a result, the amount of raw data transmitted from the SDRAM 39 to the camera signal processing unit 21 can be reduced.

本実施形態によれば、撮像動作中の内部バス19の伝送負荷を軽減し、SDRAM39に対する書き込み/読み出し処理に要する時間を短縮することが可能となる。特に、圧縮/伸張の処理をできるだけ簡単にすることで、処理時間の短縮効果を上げることができる。また、バス上の伝送周波数を低減して、消費電力を抑制することもできる。   According to the present embodiment, it is possible to reduce the transmission load of the internal bus 19 during the imaging operation, and to shorten the time required for the write / read processing for the SDRAM 39. In particular, by simplifying the compression / decompression process as much as possible, the effect of shortening the processing time can be increased. In addition, power consumption can be suppressed by reducing the transmission frequency on the bus.

また、本実施形態によれば、SDRAM39の容量を小さくすることができる。更に、SDRAM39の領域を他の処理に利用したり、複数フレーム分のRAWデータを格納して、連写できる枚数を増やしたり、あるいは連写速度を向上させたりなど、高画質化・高機能化に寄与する。従って、撮像処理やデータ記録処理に必要な時間を短くすることができる、高性能かつ小型、低コストの撮像装置10を実現できる。   Further, according to the present embodiment, the capacity of the SDRAM 39 can be reduced. In addition, use of the SDRAM 39 area for other processing, storing RAW data for multiple frames, increasing the number of continuous shots, or increasing the continuous shooting speed, etc. Contribute to. Therefore, it is possible to realize a high-performance, small, and low-cost imaging device 10 that can shorten the time required for the imaging process and the data recording process.

なお、図1に示したRAW圧縮部101およびRAW伸張部103の設置位置は、あくまでも一例であり、システム構成によっては、SDRAMコントローラ37側に設置してもよい。   The installation positions of the RAW compression unit 101 and the RAW expansion unit 103 shown in FIG. 1 are merely examples, and may be installed on the SDRAM controller 37 side depending on the system configuration.

[RAW圧縮部の構成について]
続いて、図2〜図8を参照しながら、本発明に係る圧縮部の一例であるRAW圧縮部101の構成について、詳細に説明する。本実施形態に係るRAW圧縮部101は、非可逆RAW信号圧縮方法を用いた圧縮部である。
[Configuration of Raw Compression Unit]
Next, the configuration of the RAW compression unit 101, which is an example of the compression unit according to the present invention, will be described in detail with reference to FIGS. The RAW compression unit 101 according to the present embodiment is a compression unit using an irreversible RAW signal compression method.

なお、以下の説明において、RAWデータ信号を1画素(ピクセル)当たり14ビットとする。また、例えば図5に示すように、同一色成分を持つ水平方向の16画素分を、1ブロックの圧縮符号データに変換する。図5は、ベイヤ配列と抽出された同色1ラインとを説明するための説明図であるが、図5については、以下で改めて詳細に説明する。本実施形態に係るRAW圧縮部101は、後述する折れ線圧縮部121により15ビットのRAWデータ信号を10ビットに圧縮した後、量子化語長Q=1〜6ビットで、ブロック単位に量子化を行う。ここで、1ブロック内では、量子化語長Qは同じであり、ブロック毎に量子化語長Qが変動する。また、以下では、目標符号量を1ピクセルあたり6ビット(6bit/pix)と設定した場合について説明する。   In the following description, it is assumed that the RAW data signal is 14 bits per pixel. Further, for example, as shown in FIG. 5, 16 pixels in the horizontal direction having the same color component are converted into one block of compressed code data. FIG. 5 is an explanatory diagram for explaining the Bayer array and the extracted one line of the same color. FIG. 5 will be described in detail later. The RAW compression unit 101 according to the present embodiment compresses a 15-bit RAW data signal to 10 bits by a polygonal line compression unit 121, which will be described later, and then performs quantization in block units with a quantization word length Q = 1 to 6 bits. Do. Here, the quantized word length Q is the same within one block, and the quantized word length Q varies from block to block. In the following, a case where the target code amount is set to 6 bits (6 bits / pix) per pixel will be described.

本実施形態に係るRAW圧縮部101は、画素データの最大値、最小値の差分をブロック単位で取得し、ダイナミックレンジの大きさに応じて、1ブロックあたり32〜112ビット(32〜112bit/BLOCK)の可変長に圧縮する。また、本実施形態に係るRAW圧縮部101は、後述する量子化語長割当算出部127により、常に、ライン単位で1ピクセルあたり6ビット(6bit/pix)に圧縮する。従って、本実施形態に係るRAW圧縮部101は、フレーム単位に、固定長6bit/pixの圧縮を実現することができる。   The RAW compression unit 101 according to the present embodiment acquires the difference between the maximum value and the minimum value of the pixel data in units of blocks, and 32 to 112 bits (32 to 112 bits / BLOCK per block) according to the size of the dynamic range. ) To a variable length. Also, the RAW compression unit 101 according to the present embodiment always compresses to 6 bits per pixel (6 bits / pix) by a quantized word length allocation calculation unit 127 described later. Therefore, the RAW compression unit 101 according to the present embodiment can realize compression with a fixed length of 6 bits / pix for each frame.

図2は、本実施形態に係るRAW圧縮部の構成を説明するためのブロック図である。本実施形態に係るRAW圧縮部101は、例えば図2に示したように、折れ線圧縮部121と、頻度計測部123と、1ライン遅延部125と、量子化語長割当算出部127と、量子化実行部129と、パディング部131と、を主に備える。   FIG. 2 is a block diagram for explaining the configuration of the RAW compression unit according to this embodiment. As shown in FIG. 2, for example, the RAW compression unit 101 according to the present embodiment includes a polygonal line compression unit 121, a frequency measurement unit 123, a one-line delay unit 125, a quantization word length allocation calculation unit 127, Mainly includes a conversion execution unit 129 and a padding unit 131.

折れ線圧縮部121は、入力された14ビットのRAWデータを、折れ線を用いた近似により10ビットのデータに非線形で圧縮する。折れ線圧縮部121は、この後の圧縮手順の前に、できるだけ階調を下げておくことで、全体的な圧縮効率を向上させることを目的として設けられる。目的とする圧縮率によっては、省略されてもよい。なお、この場合には、後の図12で説明するRAW伸張部103の出力段に設けられる逆折れ線伸張部231についても、省略可能である。   The polygonal line compression unit 121 nonlinearly compresses the input 14-bit RAW data into 10-bit data by approximation using a polygonal line. The polygonal line compression unit 121 is provided for the purpose of improving the overall compression efficiency by lowering the gradation as much as possible before the subsequent compression procedure. Depending on the target compression rate, it may be omitted. In this case, the reverse broken line extension unit 231 provided at the output stage of the RAW extension unit 103 described later with reference to FIG. 12 can also be omitted.

ここで、図3は、折れ線圧縮部121で用いられる折れ線の例を示すグラフである。折れ線圧縮部121は、図3に示すグラフによって入力データの階調を変換する。この例では、人間の視覚特性に合わせて、入力データが小さいほど、すなわち暗いほど(または色がうすいほど)、高い階調を割り当てるようにしている。このような折れ線は、例えば色成分ごとに用意し、入力画素の色成分ごとに切り換えて利用してもよい。   Here, FIG. 3 is a graph showing an example of a broken line used in the broken line compression unit 121. The polygonal line compression unit 121 converts the gradation of the input data using the graph shown in FIG. In this example, in accordance with human visual characteristics, a higher gradation is assigned as input data is smaller, that is, darker (or lighter in color). Such a polygonal line may be prepared for each color component, for example, and used by switching for each color component of the input pixel.

折れ線圧縮部121では、例えば、このような折れ線を用いて、入力データの階調を変換した後、変換後のデータを16で除算(すなわち4ビット分下位にシフト)して、10ビットデータに圧縮する。このとき、捨てられる下位ビットは、例えば四捨五入する。なお、以上のような演算に基づく、入力データと圧縮後の出力データとを対応付けて記憶したROMテーブルを用意し、折れ線圧縮部121では、このROMテーブルに従って入出力データの変換が行われてもよい。また、折れ線圧縮部121は、例えば4点程度の折れ点を設定するような、演算回路であってもよい。   In the polygonal line compression unit 121, for example, after converting the gradation of the input data using such a polygonal line, the converted data is divided by 16 (that is, shifted down by 4 bits) to become 10-bit data. Compress. At this time, the discarded lower bits are rounded off, for example. A ROM table that stores input data and compressed output data in association with each other based on the above calculation is prepared, and the polygonal line compression unit 121 converts input / output data according to the ROM table. Also good. The broken line compression unit 121 may be an arithmetic circuit that sets, for example, about four broken points.

折れ線圧縮部121により圧縮されたRAWデータは、後述する頻度計測部123へと伝送される。また、頻度計測部123への圧縮符号データの伝送が行われたタイミングは、後述する1ライン遅延部125に伝送される。   The RAW data compressed by the polygonal line compression unit 121 is transmitted to the frequency measurement unit 123 described later. The timing at which the compressed code data is transmitted to the frequency measuring unit 123 is transmitted to the 1-line delay unit 125 described later.

頻度計測部123は、ブロック単位ごとに、画素データの最大値と最小値を検出し、検出した最大値と最小値との差分から、ダイナミックレンジを算出する。続いて、頻度計測部123は、算出したダイナミックレンジの語長(桁数)を検出し、ダイナミックレンジの語長DRの頻度を計測する。頻度計測部123による頻度の計測期間は、例えば1ラインに相当する期間である。本実施形態においては、ダイナミックレンジの語長DRは、DR=1からDR=10までの10通りが存在する。頻度計測部123は、それぞれのダイナミックレンジの語長DRの頻度を、ヒストグラムHIST1〜HIST10として、量子化語長割当算出部127に伝送する。   The frequency measurement unit 123 detects the maximum value and the minimum value of the pixel data for each block unit, and calculates the dynamic range from the difference between the detected maximum value and the minimum value. Subsequently, the frequency measurement unit 123 detects the calculated word length (number of digits) of the dynamic range, and measures the frequency of the word length DR of the dynamic range. The frequency measurement period by the frequency measurement unit 123 is, for example, a period corresponding to one line. In the present embodiment, there are ten dynamic range word lengths DR from DR = 1 to DR = 10. The frequency measuring unit 123 transmits the frequency of the word length DR of each dynamic range to the quantized word length allocation calculating unit 127 as histograms HIST1 to HIST10.

ここで、図4は、頻度計測部123の詳細な構成を説明するためのブロック図である。本実施形態に係る頻度計測部123は、例えば図4に示したように、ブロック化部141と、最大/最小検出部143と、ダイナミックレンジ算出部145と、語長検出部147と、コンパレータ149A〜149Jと、カウンタ151A〜151Jと、を主に備える。   Here, FIG. 4 is a block diagram for explaining a detailed configuration of the frequency measurement unit 123. For example, as shown in FIG. 4, the frequency measurement unit 123 according to the present embodiment includes a blocking unit 141, a maximum / minimum detection unit 143, a dynamic range calculation unit 145, a word length detection unit 147, and a comparator 149A. To 149J and counters 151A to 151J.

ブロック化部141は、折れ線圧縮部121から伝送されたデータを、水平方向に隣接する16画素分の同色成分画素からなるブロックに分割し、分割したブロック毎に出力する。これにより、ブロック内のデータの相関が強くなり、この後の量子化処理による画質劣化を抑制することができる。   The blocking unit 141 divides the data transmitted from the polygonal line compression unit 121 into blocks composed of the same color component pixels for 16 pixels adjacent in the horizontal direction, and outputs the divided blocks. Thereby, the correlation of the data in a block becomes strong, and the image quality deterioration by subsequent quantization processing can be suppressed.

例えば、図5に示すようなベイヤ配列の撮像素子が用いられた場合、出力データには、R成分とGr成分の繰り返しと、B成分とGb成分の繰り返しとが、1ラインごとに出現する。例えば、ブロック化部141への入力データに、R,Gr,R,Gr,・・・,R15,Gr15のように、R成分とGr成分が繰り返し現れる場合には、R,R,R,・・・,R15,Gr,Gr,・・・,Gr15のように、同色成分の画素が16個連続して現れるように、出力順序を変換して、ブロック化する。 For example, when a Bayer array image sensor as shown in FIG. 5 is used, in the output data, the repetition of the R component and the Gr component and the repetition of the B component and the Gb component appear for each line. For example, when the R component and the Gr component repeatedly appear in the input data to the blocking unit 141 as R 0 , Gr 0 , R 1 , Gr 1 ,..., R 15 , Gr 15 , 0, R 1, R 2, ···, R 15, Gr 0, Gr 1, ···, as Gr 15, so that the pixel of the same color component appears 16 continuously converts the output order To block.

最大/最小検出部143は、ブロック毎に、ブロック化された水平16画素のデータのなかから最大値(MAX)及び最小値(min)を検出する。最大/最小検出部143は、検出した最大値(MAX)及び最小値(min)を、ダイナミックレンジ算出部145に伝送する。   The maximum / minimum detection unit 143 detects the maximum value (MAX) and the minimum value (min) from the block data of 16 horizontal pixels for each block. The maximum / minimum detection unit 143 transmits the detected maximum value (MAX) and minimum value (min) to the dynamic range calculation unit 145.

ダイナミックレンジ算出部145は、1つのブロック内の最大値(MAX)及び最小値(min)の差分(MAX−min)を計算して、1つのブロックでのダイナミックレンジを算出する。ダイナミックレンジ算出部145は、算出したダイナミックレンジを語長検出部147に伝送する。   The dynamic range calculation unit 145 calculates the difference (MAX−min) between the maximum value (MAX) and the minimum value (min) in one block, and calculates the dynamic range in one block. The dynamic range calculation unit 145 transmits the calculated dynamic range to the word length detection unit 147.

語長検出部147は、伝送されたダイナミックレンジから、1つのブロック内に存在する画素データのダイナミックレンジの桁数(すなわち、ダイナミックレンジの語長)DRを検出する。語長検出部147は、検出したダイナミックレンジの桁数DRを、後述するコンパレータ149A〜149Jに出力する。   The word length detection unit 147 detects the number of digits of the dynamic range of the pixel data existing in one block (that is, the word length of the dynamic range) DR from the transmitted dynamic range. The word length detection unit 147 outputs the detected number DR of the dynamic range to the comparators 149A to 149J described later.

コンパレータ149A〜149Jは、語長検出部147から出力されたダイナミックレンジの桁数DRと、それぞれのコンパレータに入力されている基準値とを比較する。各コンパレータは、ダイナミックレンジが入力されている基準値に等しい場合に、各コンパレータにそれぞれ接続されているカウンタに対して、1を出力する。本実施形態では、ダイナミックレンジの桁数DRは、DR=1〜DR=10の10通りが存在するため、コンパレータ149A〜149Jには、それぞれ基準値として1〜10が入力されている。語長検出部147から伝送されたダイナミックレンジの桁数DRは、1〜10のいずれかの値を有するため、コンパレータ149A〜149Jのいずれか1つが、1を表す信号を出力することとなる。   The comparators 149A to 149J compare the dynamic range digit number DR output from the word length detection unit 147 with the reference value input to each comparator. Each comparator outputs 1 to the counter connected to each comparator when the dynamic range is equal to the input reference value. In this embodiment, since there are ten dynamic range digits DR, DR = 1 to DR = 10, 1 to 10 are input to the comparators 149A to 149J as reference values, respectively. Since the number of digits DR of the dynamic range transmitted from the word length detection unit 147 has any value of 1 to 10, any one of the comparators 149A to 149J outputs a signal representing 1.

例えば、語長検出部147から出力されたダイナミックレンジの桁数DRが1であった場合、基準値1が入力されているコンパレータ149Aの出力が1となり、コンパレータ149B〜149Jの出力は0となる。   For example, when the number of digits DR of the dynamic range output from the word length detection unit 147 is 1, the output of the comparator 149A to which the reference value 1 is input is 1, and the outputs of the comparators 149B to 149J are 0. .

カウンタ151A〜151Jは、対応するコンパレータ149A〜149Jから1を表す信号が伝送された回数をカウントする。これらのカウンタ151A〜151Jから出力された回数が、ダイナミックレンジの桁数DRの頻度、すなわちヒストグラムHIST1〜HIST10となる。各カウンタ151A〜151Jから出力された値は、量子化語長割当算出部127に伝送される。   The counters 151A to 151J count the number of times a signal representing 1 is transmitted from the corresponding comparators 149A to 149J. The number of times output from these counters 151A to 151J is the frequency of the dynamic range digit number DR, that is, the histograms HIST1 to HIST10. The values output from the counters 151A to 151J are transmitted to the quantized word length allocation calculating unit 127.

例えば、カウンタ151Aから出力された回数は、コンパレータ149Aから1を表す信号が出力された回数に等しい。すなわち、カウンタ151Aから出力された値は、ダイナミックレンジの桁数DRが1であるブロックの個数を表すこととなる。   For example, the number of times output from the counter 151A is equal to the number of times that a signal representing 1 is output from the comparator 149A. That is, the value output from the counter 151A represents the number of blocks whose dynamic range digit number DR is 1.

以上説明したような方法を用いて、頻度計測部123は、ダイナミックレンジの桁数DRの頻度を計測する。   Using the method described above, the frequency measurement unit 123 measures the frequency of the dynamic range digit number DR.

再び図2に戻って、本実施形態に係るRAW圧縮部101の構成について詳細に説明する。   Returning to FIG. 2 again, the configuration of the RAW compression unit 101 according to the present embodiment will be described in detail.

1ライン遅延部125は、1水平同期期間(1H)の長さのディレイラインである。頻度計測部123が入力されたデータのDRの計測を開始してから、量子化語長割当算出部127が量子化語長を決定するまでに、1ラインの期間を要する。そのため、1ライン遅延部125は、折れ線圧縮部121からの出力を量子化できるまでの時間を合わせるために用いられる。   The one-line delay unit 125 is a delay line having a length of one horizontal synchronization period (1H). A period of one line is required after the frequency measurement unit 123 starts measuring DR of the input data until the quantized word length allocation calculating unit 127 determines the quantized word length. Therefore, the 1-line delay unit 125 is used to match the time until the output from the polygonal line compression unit 121 can be quantized.

量子化語長割当算出部127は、頻度計測部123から伝送された頻度に基づいて、ブロックごとに、ダイナミックレンジの桁数DR=1〜DR=10それぞれに割り当てられる量子化語長を算出する。より詳細には、量子化語長割当算出部127は、後述する量子化語長テーブルに記載された複数のパターンと、伝送された頻度と、に基づいて、各パターンにおける所定ブロック分の圧縮画像データの確定符号量を算出する。続いて、量子化語長割当算出部127は、算出した確定符号量が所望の符号量以下となるパターンにおける量子化語長の組み合わせを、データの圧縮に利用する量子化語長として選択する。   Based on the frequency transmitted from the frequency measurement unit 123, the quantization word length allocation calculation unit 127 calculates the quantization word length allocated to each of the dynamic range digits DR = 1 to DR = 10 for each block. . More specifically, the quantized word length allocation calculating unit 127 compresses a predetermined block of compressed images in each pattern based on a plurality of patterns described in a quantized word length table to be described later and the transmitted frequency. Calculate the definite code amount of the data. Subsequently, the quantized word length allocation calculating unit 127 selects a quantized word length combination in a pattern in which the calculated determined code amount is equal to or smaller than a desired code amount as a quantized word length used for data compression.

量子化語長テーブルは、各ダイナミックレンジの桁数DR=1〜DR=10に割り当てられる量子化語長の組み合わせが互いに異なる複数のパターンが記載されたものである。この量子化語長テーブルは、例えば、本実施形態に係るROM29等に予め格納されている。   The quantized word length table describes a plurality of patterns having different combinations of quantized word lengths assigned to the number of digits DR = 1 to DR = 10 of each dynamic range. The quantized word length table is stored in advance in the ROM 29 according to the present embodiment, for example.

図6に、上述のような量子化語長テーブルの一例を示す。図6に示したテーブルでは、各ダイナミックレンジの桁数DRに割り当てられる量子化語長の組み合わせが、桁数に応じて変化するように設定された13個のパターンが記載されている。また、図6に示したテーブルでは、上記13個のパターンに加えて、全てのダイナミックレンジの桁数DRに同じ量子化語長が割り当てられるパターン(インデックス13に該当)もあわせて記載されている。   FIG. 6 shows an example of the quantization word length table as described above. The table shown in FIG. 6 describes 13 patterns in which the combinations of quantization word lengths assigned to the number of digits DR of each dynamic range are set to change according to the number of digits. In addition to the above 13 patterns, the table shown in FIG. 6 also describes a pattern (corresponding to the index 13) in which the same quantization word length is assigned to the number of digits DR of all dynamic ranges. .

例えば、図6のインデックス0〜インデックス3は、ダイナミックレンジの桁数DRが小さいものに対して、できるだけ符号量を抑制することなく量子化語長を割り当てることを意図したパターンとなっている。また、図6のインデックス4〜インデックス12は、桁数の小さいブロックの発生符号量を抑えて、抑制できた分を桁数の大きなダイナミックレンジを有するブロックに割り当てることを意図したパターンとなっている。また、図6から明らかなように、インデックス値の小さいものほど量子化語長はダイナミックレンジの桁数DRの値に近いようになっている。これは、インデックス値が小さいものほど、圧縮後の画質が良いことを意味している。   For example, index 0 to index 3 in FIG. 6 are patterns intended to assign quantization word lengths with as little code amount as possible to those having a small number of dynamic range digits DR. In addition, the index 4 to the index 12 in FIG. 6 are patterns intended to suppress the generated code amount of a block with a small number of digits and to allocate the suppressed amount to a block having a dynamic range with a large number of digits. . As is clear from FIG. 6, the smaller the index value, the closer the quantized word length is to the value of the dynamic range digit number DR. This means that the smaller the index value, the better the image quality after compression.

図6から明らかなように、インデックス0〜インデックス12に記載されているパターンでは、全てのダイナミックレンジの桁数で同じ量子化語長の値となっていない。そのため、これらの量子化語長の組み合わせを用いることで、ブロック単位では可変長圧縮となることがわかる。また、インデックス13に記載されているパターンでは、全てのダイナミックレンジの桁数で同じ量子化語長の値となっている。そのため、この量子化語長の組み合わせを用いることで、ブロック単位(ひいてはライン単位)で固定長圧縮となることがわかる。   As is clear from FIG. 6, in the patterns described in the index 0 to index 12, the values of the same quantized word length are not obtained for all the dynamic ranges. Therefore, it is understood that variable length compression is performed in units of blocks by using a combination of these quantized word lengths. Also, in the pattern described in the index 13, the same quantized word length value is used for all the dynamic range digits. Therefore, it can be seen that by using this combination of quantized word lengths, fixed length compression is performed in block units (and in line units).

ここで、本実施形態に係るRAW圧縮部101では、例えば図8に示すように、1ブロックの圧縮符号データの形式を、固定部および可変長部の2種類の部分からなる量子化データ形式とする。また、このデータ形式では、1ブロックの画素数と、固定部の語長のアラインメントが等しくなっている。例えば、本実施形態のように1ブロックが16画素から構成される場合、固定部の語長は、16ビットまたはその倍数とし、量子化語長Qビットの場合、可変長部となる量子化データ部は、16×Qビットとなるようにする。   Here, in the RAW compression unit 101 according to the present embodiment, for example, as shown in FIG. 8, the compression code data format of one block is converted into a quantized data format consisting of two types of parts, a fixed part and a variable length part. To do. In this data format, the number of pixels in one block and the word length alignment of the fixed part are equal. For example, when one block is composed of 16 pixels as in this embodiment, the word length of the fixed part is 16 bits or a multiple thereof, and when the quantized word length is Q bits, the quantized data that becomes the variable length part The part is set to 16 × Q bits.

このような圧縮符号データ形式を利用することで、量子化語長割当算出部127は、以下の式1に示した計算を行って、圧縮処理を行うことなく符号量の確定値を算出することができる。   By using such a compressed code data format, the quantized word length allocation calculation unit 127 performs the calculation shown in the following Equation 1 and calculates the determined value of the code amount without performing compression processing. Can do.

ダイナミックレンジの桁数DRの確定符号量=
1〜10までの(DR毎の頻度×DR毎の量子化語長)の総和
+(1ラインのブロック数×固定部のword数)
・・・(式1)
Deterministic code amount of the number of digits DR of the dynamic range =
Sum of 1 to 10 (frequency for each DR × quantized word length for each DR) + (number of blocks in one line × number of words in a fixed part)
... (Formula 1)

ここで、上記式1において、DR毎の量子化語長は、図6に示したような量子化語長テーブルに記載されている値であり、1ラインのブロック数および固定部のword数は、撮像装置において予め設定されている値である。また、上記式1において、DR毎の頻度は、頻度計測部123から伝送される値である。   Here, in the above equation 1, the quantization word length for each DR is a value described in the quantization word length table as shown in FIG. 6, and the number of blocks in one line and the number of words in the fixed part are This is a value set in advance in the imaging apparatus. Further, in Equation 1 above, the frequency for each DR is a value transmitted from the frequency measurement unit 123.

量子化語長割当算出部127は、上記式1を用いて、量子化語長テーブルに記載されている固定長圧縮となるもの以外のパターン全てについて、確定符号量の算出を行う。他方、量子化語長割当算出部127は、設定されている目標符号量を利用して、要求符号量を以下の式2のように算出する。   The quantized word length allocation calculating unit 127 calculates the deterministic code amount for all patterns other than those that are fixed length compression described in the quantized word length table, using Equation 1 above. On the other hand, the quantized word length allocation calculating unit 127 calculates the required code amount as shown in the following Expression 2, using the set target code amount.

要求符号量=(目標符号量×1ラインの総画素数) ・・・(式2)   Required code amount = (target code amount × total number of pixels in one line) (Expression 2)

例えば、本実施形態のように、目標符号量が6bit/pixである場合には、式2より、要求符号量=6ビット×1ラインの総画素数となる。   For example, when the target code amount is 6 bits / pix as in the present embodiment, the required code amount is 6 bits × the total number of pixels of one line from Equation 2.

続いて、量子化語長割当算出部127は、算出した確定符号量と、要求符号量とを比較する。量子化語長割当算出部127は、比較の結果、要求符号量以下であり、かつ、最も大きな確定符号量となるパターン(インデックス)を、選択すべき量子化語長の組み合わせとして選択する。また、図6のように、インデックス値の小さいものほど画質が良い様に配列されているテーブルであれば、要求符号量以下の確定符号量を有し、かつ、インデックス値が一番小さいものを選択するようにしてもよい。   Subsequently, the quantized word length allocation calculation unit 127 compares the calculated determined code amount with the requested code amount. As a result of the comparison, the quantized word length allocation calculation unit 127 selects a pattern (index) that is equal to or smaller than the required code amount and has the largest deterministic code amount as a combination of quantized word lengths to be selected. Further, as shown in FIG. 6, if the table is arranged so that the smaller the index value is, the better the image quality is, and the table has a determined code amount equal to or less than the required code amount and the smallest index value. You may make it select.

量子化語長の組み合わせパターンの選択が終了すると、量子化語長割当算出部127は、選択した量子化語長の組み合わせ(すなわち、選択した量子化語長テーブルに記載されている、量子化語長Q1〜Q10の組み合わせ)を、量子化実行部129に伝送する。例えば、インデックス値3の量子化語長テーブルが選択された場合には、量子化語長割当算出部127は、Q1=1、Q2=2、Q3=3、Q4=4、Q5=5、Q6=5、Q7=5、Q8=5、Q9=6、Q10=6を、量子化実行部129に伝送する。   When the selection of the quantization word length combination pattern is completed, the quantization word length allocation calculating unit 127 selects the combination of the selected quantization word lengths (that is, the quantization words described in the selected quantization word length table). The combination of the long Q1 to Q10) is transmitted to the quantization execution unit 129. For example, when a quantized word length table having an index value of 3 is selected, the quantized word length allocation calculating unit 127 performs Q1 = 1, Q2 = 2, Q3 = 3, Q4 = 4, Q5 = 5, Q6. = 5, Q7 = 5, Q8 = 5, Q9 = 6, and Q10 = 6 are transmitted to the quantization execution unit 129.

また、算出した確定符号量が、全て要求符号量よりも大きな値であった場合には、量子化語長割当算出部127は、例えば図6のインデックス13に示したような、全てのダイナミックレンジの桁数DRにおいて同一の量子化語長となる組み合わせを選択する。この量子化語長の組み合わせは、固定長圧縮を行うための組み合わせであり、全てのDRにおいて、目標符号量よりも1ビット小さな値を有する量子化語長が設定されている。これは、図8に示したデータ形式において、固定部の部分では、word0(min値)の分で1bit/pix相当のビットを使用するためである。このような値が設定されることにより、確定符号量は、必ず要求符号量に収まることとなる。   If the calculated determined code amounts are all larger than the requested code amount, the quantized word length assignment calculating unit 127, for example, displays all dynamic ranges as indicated by the index 13 in FIG. A combination having the same quantized word length in the number of digits DR is selected. This combination of quantized word lengths is a combination for performing fixed length compression, and a quantized word length having a value smaller by 1 bit than the target code amount is set in all DRs. This is because, in the data format shown in FIG. 8, the bit corresponding to 1 bit / pix is used for the word 0 (min value) in the fixed portion. By setting such a value, the determined code amount always falls within the required code amount.

固定長圧縮を行った場合、ダイナミックレンジの桁数DRが大きなブロックは、圧縮ノイズが多めに発生することとなる。しかしながら、1ラインごとに圧縮パラメータを変更するため、1画面全体を見た場合の画像へのダメージは軽減される。また、圧縮処理前に見積もり符号量ではなく確定符号量が算出できるため、圧縮処理後に符号量が超過してしまい圧縮が失敗したという事態が生じない。   When fixed-length compression is performed, a block having a large dynamic range digit number DR generates a large amount of compression noise. However, since the compression parameter is changed for each line, damage to the image when the entire screen is viewed is reduced. Further, since the deterministic code amount can be calculated before the compression process, there is no situation where the code amount exceeds the compression process and the compression fails after the compression process.

また、量子化語長割当算出部127は、各ダイナミックレンジの桁数DRにおける量子化語長Q1〜Q10が決定すると、要求符号量と、決定した量子化語長Q1〜Q10を用いた場合の確定符号量との差を算出する。この差が、パディング量となる。量子化語長割当算出部127は、算出したパディング量を、パディング部131に伝送する。   Further, when the quantized word length allocation unit 127 determines the quantized word lengths Q1 to Q10 in the number of digits DR of each dynamic range, the quantized word length allocation unit 127 uses the requested code amount and the determined quantized word lengths Q1 to Q10. The difference from the determined code amount is calculated. This difference is the amount of padding. The quantized word length allocation calculating unit 127 transmits the calculated padding amount to the padding unit 131.

なお、図6に示した量子化語長テーブルは、あくまでも一例であって、量子化語長テーブルに記載されている各パターンは、画質や圧縮効率等の様々な要因に基づいて任意に決定することが可能である。   The quantization word length table shown in FIG. 6 is merely an example, and each pattern described in the quantization word length table is arbitrarily determined based on various factors such as image quality and compression efficiency. It is possible.

また、ダイナミックレンジの桁数DRの頻度等によって、さらに細かく量子化語長テーブルを枝分かれさせるなどの構成とすることで、量子化語長割当算出部127は、より画質および圧縮効率の良い圧縮処理を行うことが可能な量子化語長を選択することが可能となる。   Further, the quantized word length allocation calculation unit 127 can perform compression processing with higher image quality and compression efficiency by further finely branching the quantized word length table according to the frequency DR of the dynamic range. It is possible to select a quantized word length that can be used.

また、量子化語長Qの割り当ての決定は、圧縮対象となるブロックの圧縮時にどの組み合わせを選択すればよいかが容易に判別可能であれば、ブロック毎のダイナミックレンジの桁数DRの頻度に加えて、他の画像的特徴を併用してもよい。例えば、ブロック内のエッジとなる部分の検出を頻度計測と同時に行い、エッジとなる部分の数により量子化語長Qの選択をさらに細かくする等の方法を行うことが可能である。例えば、ダイナミックレンジの桁数DRが大きく、さらに1ブロック内に1、2回の小数のエッジが存在する場合、画像レベルが暗から明のように大きく変化しているため、量子化語長Qを特に多めにしておかないと画質劣化が目立つ。反対に、ダイナミックレンジの桁数DRが大でもエッジが多い縞模様の場合では、ほどほどの量子化語長でも画質劣化は目立たない。エッジの数は、ブロック圧縮時の最大値/最小値検出においても計測する事は容易である。   In addition, the determination of the allocation of the quantization word length Q can be made in addition to the frequency DR of the dynamic range for each block if it can be easily determined which combination should be selected when compressing the block to be compressed. Thus, other image features may be used in combination. For example, it is possible to detect a portion that becomes an edge in a block at the same time as frequency measurement, and to further select the quantization word length Q according to the number of portions that become an edge. For example, when the number of dynamic range digits DR is large and there are one or two decimal edges in one block, the image level changes greatly from dark to bright. The image quality degradation is conspicuous unless a large amount is set. On the other hand, in the case of a striped pattern with many edges even though the number of digits DR of the dynamic range is large, image quality degradation is not noticeable even with a moderate quantization word length. It is easy to measure the number of edges even in maximum / minimum value detection during block compression.

量子化実行部129は、量子化語長割当算出部127によって算出された量子化語長Q1〜Q10に基づいて、ブロック毎に画像データを量子化する。以下では、図7を参照しながら、本実施形態に係る量子化実行部129の構成について、詳細に説明する。図7は、本実施形態に係る量子化実行部129の構成を説明するためのブロック図である。   The quantization execution unit 129 quantizes the image data for each block based on the quantization word lengths Q1 to Q10 calculated by the quantization word length allocation calculation unit 127. Hereinafter, the configuration of the quantization execution unit 129 according to the present embodiment will be described in detail with reference to FIG. FIG. 7 is a block diagram for explaining the configuration of the quantization execution unit 129 according to the present embodiment.

本実施形態に係る量子化実行部129は、例えば図7に示したように、ブロック化部161と、最大/最小検出部163と、バッファ165、減算部167と、ダイナミックレンジ算出部169と、シフト量算出部171と、量子化器173と、語長選択部175と、量子化データバッファ177と、パッキング部179と、を主に備える。   For example, as illustrated in FIG. 7, the quantization execution unit 129 according to the present embodiment includes a blocking unit 161, a maximum / minimum detection unit 163, a buffer 165, a subtraction unit 167, a dynamic range calculation unit 169, A shift amount calculation unit 171, a quantizer 173, a word length selection unit 175, a quantized data buffer 177, and a packing unit 179 are mainly provided.

ブロック化部161は、折れ線圧縮部131から出力され、1ライン遅延部125により所定の期間遅延されたデータを、水平方向に隣接する16画素分の同色成分画素からなるブロックに分割し、分割したブロック毎に出力する。これにより、ブロック内のデータの相関が強くなり、この後の量子化処理による画質劣化を抑制することができる。   The blocking unit 161 divides the data output from the polygonal line compression unit 131 and delayed for a predetermined period by the one-line delay unit 125 into blocks composed of the same color component pixels for 16 pixels adjacent in the horizontal direction. Output for each block. Thereby, the correlation of the data in a block becomes strong, and the image quality deterioration by subsequent quantization processing can be suppressed.

最大/最小検出部163は、ブロック毎に、ブロック化された水平16画素のデータのなかから、最大値(MAX)及び最小値(min)を検出する。最大/最小検出部163は、検出した最大値(MAX)及び最小値(min)を、ダイナミックレンジ算出部169に伝送する。また、最大/最小検出部163は、検出した最小値(min)を、減算部167およびパッキング部179に伝送する。   The maximum / minimum detection unit 163 detects the maximum value (MAX) and the minimum value (min) from the block data of 16 horizontal pixels for each block. The maximum / minimum detection unit 163 transmits the detected maximum value (MAX) and minimum value (min) to the dynamic range calculation unit 169. Further, the maximum / minimum detection unit 163 transmits the detected minimum value (min) to the subtraction unit 167 and the packing unit 179.

バッファ165は、ブロック化部161から伝送されたデータを、所定期間保持する。バッファ165は、最大/最小検出部163において最大値および最小値が算出されるまでの間、入力データに対応するブロックを保持し、遅延時間合わせをする。   The buffer 165 holds the data transmitted from the blocking unit 161 for a predetermined period. The buffer 165 holds a block corresponding to input data until the maximum / minimum detection unit 163 calculates the maximum value and the minimum value, and adjusts the delay time.

減算部167は、バッファ165から伝送された画素データから、最大/最小検出部163が伝送した、対応するブロック内の最小値を減算する。この減算は、圧縮画素の領域に共通するDCオフセット分を、各画素のデータから差し引くことと等価である。   The subtraction unit 167 subtracts the minimum value in the corresponding block transmitted by the maximum / minimum detection unit 163 from the pixel data transmitted from the buffer 165. This subtraction is equivalent to subtracting the DC offset common to the compressed pixel area from the data of each pixel.

ダイナミックレンジ算出部169は、1つのブロック内の最大値(MAX)及び最小値(min)の差分(MAX−min)を計算して、1つのブロックでのダイナミックレンジを算出する。ダイナミックレンジ算出部169は、算出したダイナミックレンジを、語長検出部171と、シフト量算出部173とに伝送する。   The dynamic range calculation unit 169 calculates the difference (MAX−min) between the maximum value (MAX) and the minimum value (min) in one block and calculates the dynamic range in one block. The dynamic range calculation unit 169 transmits the calculated dynamic range to the word length detection unit 171 and the shift amount calculation unit 173.

語長選択部171は、量子化語長割当算出部127から伝送された量子化語長Q1〜Q10を取得し、ダイナミックレンジ算出部169から伝送されたダイナミックレンジの大きさに従って、量子化語長Q1〜Q10の中から、適切な量子化語長Qを選択する。量子化語長Q1〜Q10は、ダイナミックレンジの桁数DR=1〜10にそれぞれ対応しているため、ダイナミックレンジ算出部169から伝送されたダイナミックレンジの大きさに従って、ブロック毎に適した量子化語長Qを選択することが可能である。語長選択部171は、選択した量子化語長Qを、シフト量算出部173と、パッキング部179とに伝送する。   The word length selection unit 171 acquires the quantized word lengths Q1 to Q10 transmitted from the quantized word length allocation calculating unit 127, and the quantized word length according to the size of the dynamic range transmitted from the dynamic range calculating unit 169. An appropriate quantization word length Q is selected from Q1 to Q10. Since the quantization word lengths Q1 to Q10 correspond to the dynamic range digits DR = 1 to 10, respectively, quantization suitable for each block is performed according to the size of the dynamic range transmitted from the dynamic range calculation unit 169. It is possible to select the word length Q. The word length selection unit 171 transmits the selected quantized word length Q to the shift amount calculation unit 173 and the packing unit 179.

シフト量算出部173は、ダイナミックレンジ算出部169から伝送されたダイナミックレンジの大きさと、語長選択部171から伝送された量子化語長Qと、を用いて、シフト量を算出する。シフト量SFT=ダイナミックレンジの大きさDR−量子化語長Qである。シフト量算出部173は、算出したシフト量SFTを、量子化器175と、パッキング部179と、に伝送する。   The shift amount calculation unit 173 calculates the shift amount using the dynamic range size transmitted from the dynamic range calculation unit 169 and the quantized word length Q transmitted from the word length selection unit 171. Shift amount SFT = dynamic range size DR−quantized word length Q. The shift amount calculation unit 173 transmits the calculated shift amount SFT to the quantizer 175 and the packing unit 179.

量子化器175は、減算部167から伝送されたデータを、シフト量算出部173から伝送されたシフト量SFTに従って量子化する。本実施形態では、一例として、1〜6ビットに量子化する。   The quantizer 175 quantizes the data transmitted from the subtraction unit 167 according to the shift amount SFT transmitted from the shift amount calculation unit 173. In this embodiment, as an example, quantization is performed to 1 to 6 bits.

この量子化器175として、例えば、右シフタを適用することが可能である。この場合、量子化器175は、減算部167から伝送されたデータを、シフト量算出部173から伝送されたシフト量SFTだけ右シフトする。量子化器175として右シフタを適用することで、回路規模を削減することができる。なお、圧縮処理側で右シフタを利用すると、伸張処理側の逆量子化においても同様に回路規模を削減できる。   As this quantizer 175, for example, a right shifter can be applied. In this case, the quantizer 175 right-shifts the data transmitted from the subtraction unit 167 by the shift amount SFT transmitted from the shift amount calculation unit 173. By applying a right shifter as the quantizer 175, the circuit scale can be reduced. If the right shifter is used on the compression processing side, the circuit scale can be similarly reduced in the inverse quantization on the decompression processing side.

量子化データバッファ177は、量子化器175から伝送される16画素分の量子化データを、一時的に保持する。   The quantized data buffer 177 temporarily holds the quantized data for 16 pixels transmitted from the quantizer 175.

パッキング部179は、最大/最小検出部163から伝送された最小値min、シフト量算出部173から伝送されたシフト量SFT、語長選択部171から伝送された量子化語長Q、および量子化データバッファ177から伝送された16画素分の量子化データを、パッキングする。   The packing unit 179 receives the minimum value min transmitted from the maximum / minimum detection unit 163, the shift amount SFT transmitted from the shift amount calculation unit 173, the quantized word length Q transmitted from the word length selection unit 171 and the quantization The 16-pixel quantized data transmitted from the data buffer 177 is packed.

パッキング部179は、これらのデータを、例えば図8に示したようなデータ形式にパッキングする。パッキングされたデータは、図8に示したように、先頭に量子化語長Q、最小値minおよびシフト量SFTが格納された固定部が設けられ、固定部の後に16画素分の量子化データが格納された可変長部が設けられる。   The packing unit 179 packs these data in a data format as shown in FIG. 8, for example. As shown in FIG. 8, the packed data is provided with a fixed portion in which the quantization word length Q, the minimum value min, and the shift amount SFT are stored at the head, and the quantized data for 16 pixels is provided after the fixed portion. Is provided.

なお、本実施形態における固定部では、圧縮対象となるブロックのダイナミックレンジの桁数DRが解らずデコードが不可能となることを防ぐために、量子化語長Qだけでなく、最小値minおよびシフト量SFTが併せて格納されている。量子化語長Qおよびシフト量SFTを用いることで、ダイナミックレンジの桁数(大きさ)DR=量子化語長Q+シフト量SFTとして算出することができる。   In the fixed unit in the present embodiment, not only the quantized word length Q but also the minimum value min and the shift are used in order to prevent the dynamic range digit number DR of the block to be compressed from being understood and decoding impossible. The quantity SFT is also stored. By using the quantized word length Q and the shift amount SFT, the number of dynamic range digits (size) DR = quantized word length Q + shift amount SFT can be calculated.

上述のような量子化処理を実行することで、16ピクセル×14ビット/ピクセル=224ビットのデータを、ダイナミックレンジの桁数DRに応じて、かつ、1ラインの固定符号量を遵守しながら、32〜112ビットに圧縮できたこととなる。これは、データ量を約14%〜50%に低減する圧縮率を実現できたことを意味している。   By executing the quantization process as described above, the data of 16 pixels × 14 bits / pixel = 224 bits can be converted according to the number of digits DR of the dynamic range and while complying with the fixed code amount of one line. This means that the data can be compressed to 32 to 112 bits. This means that a compression ratio that reduces the data amount to about 14% to 50% can be realized.

再び図2に戻って、本実施形態に係るRAW圧縮部101の構成について詳細に説明する。   Returning to FIG. 2 again, the configuration of the RAW compression unit 101 according to the present embodiment will be described in detail.

パディング部131は、量子化実行部129から伝送されたブロック単位で可変長(2〜7word、1word=16ビット)となっている圧縮符号データに対して0または1を追加し、ライン単位で固定長とする処理部である。パディング部131は、量子化語長割当算出部127から伝送されたパディングの量に応じて、量子化実行部129から伝送された圧縮符号データのうしろに、データ「0」またはデータ「1」を詰める。これにより、ブロック単位では可変長となっており、圧縮効率が向上している圧縮符号データが、ライン単位では固定長となる。   The padding unit 131 adds 0 or 1 to the compressed code data having a variable length (2 to 7 words, 1 word = 16 bits) transmitted from the quantization execution unit 129 and fixed in units of lines. It is a processing unit to be long. In accordance with the amount of padding transmitted from the quantized word length allocation calculating unit 127, the padding unit 131 receives data “0” or data “1” behind the compressed code data transmitted from the quantization executing unit 129. Stuff. As a result, the compressed code data having a variable length in block units and improved compression efficiency has a fixed length in line units.

このパディング部131は、例えば、水平方向総画素数×目標符号量(bit/pix)×2バンク分のバッファから構成される。これにより、1バンク分のバッファがSDRAMへの符号の書き込みに利用されている間に、他方のバッファがSDRAMからの符号の読み出しに利用されることが可能となる。   The padding unit 131 is composed of, for example, buffers in the horizontal direction total number of pixels × target code amount (bit / pix) × 2 banks. As a result, while the buffer for one bank is used for writing the code to the SDRAM, the other buffer can be used for reading the code from the SDRAM.

以上、図2〜図8を参照しながら、本実施形態に係るRAW圧縮部101の構成について、詳細に説明した。   The configuration of the RAW compression unit 101 according to the present embodiment has been described in detail above with reference to FIGS.

なお、上述の例では、圧縮処理における固定長の区間が1H(1水平同期期間)である場合について説明を行ったが、固定長の区間は、上記の例に限定されるわけではない。例えば、システムが取り扱いやすい長さ、または、効率が良くなる長さ等を基準にして、H/4や2H等の長さに柔軟に設定することが可能である。例えば、固定長の区間を2Hにすることで、1Hの場合には固定長にするため0詰めまたは1詰めにしていた部分も符号に使える可能性が高まり、圧縮効率を向上させることが可能となる。   In the above-described example, the case where the fixed-length section in the compression process is 1H (one horizontal synchronization period) has been described. However, the fixed-length section is not limited to the above example. For example, it is possible to flexibly set a length such as H / 4 or 2H based on a length that the system can easily handle or a length that improves efficiency. For example, by setting the fixed-length section to 2H, the possibility of using a portion that has been zero-padded or 1-padded to increase the fixed length in the case of 1H is increased, and compression efficiency can be improved. Become.

[RAW伸張部の構成について]
続いて、図9〜図13を参照しながら、本発明に係る伸張部の一例であるRAW伸張部103の構成について、詳細に説明する。
[Configuration of RAW decompression unit]
Next, the configuration of the RAW expansion unit 103, which is an example of the expansion unit according to the present invention, will be described in detail with reference to FIGS.

なお、本実施形態に係る撮像装置では、上述のように水平方向の16画素を1ブロックとして圧縮している。以下では、簡便のために、この水平方向の16画素からなる1ブロックを、「block」という単位で表すこととする。   Note that in the imaging apparatus according to the present embodiment, 16 pixels in the horizontal direction are compressed as one block as described above. In the following, for the sake of simplicity, one block consisting of 16 pixels in the horizontal direction is expressed in units of “block”.

また、以下の説明では、本実施形態に係るRAW伸張部103が、例えば図10に示したように、ある1フレームの画像50の中から、任意の矩形領域51を伸張する場合について、説明を行う。ここで、1フレームの画像50は、図10に示したように、widthMAX[block]×heightMAX[line]から構成されるものとする。また、伸張する矩形領域51は、図10に示したように、width[block]×height[line]の大きさを有し、原点から水平方向にoffx[block]、垂直方向にoffy[line]だけ離れているものとする。   Further, in the following description, a case where the RAW expansion unit 103 according to the present embodiment expands an arbitrary rectangular area 51 from an image 50 of one frame as illustrated in FIG. 10 will be described. Do. Here, it is assumed that the image 50 of one frame is composed of widthMAX [block] × heightMAX [line] as shown in FIG. Further, as shown in FIG. 10, the rectangular area 51 to be expanded has a size of width [block] × height [line], and is offx [block] in the horizontal direction and offy [line] in the vertical direction from the origin. Suppose they are only separated.

図9は、本実施形態に係るRAW伸張部の構成を説明するためのブロック図である。本実施形態に係るRAW伸張部103は、例えば図9に示したように、データ読み出し部201と、制御信号生成部203と、先頭アドレス設定部205と、1ブロック伸張部207と、アドレス保持部209と、を主に備える。   FIG. 9 is a block diagram for explaining the configuration of the RAW decompression unit according to the present embodiment. As shown in FIG. 9, for example, the RAW expansion unit 103 according to the present embodiment includes a data reading unit 201, a control signal generation unit 203, a head address setting unit 205, a one-block expansion unit 207, and an address holding unit. 209.

データ読み出し部201は、SDRAMコントローラ37に対して、ユーザにより指定された画像に対応する圧縮符号データの読み出し要求信号を伝送し、内部バス19を通じて、SDRAM39から該当する圧縮符号データの特定のアドレスから始まるデータを読み出す。データ読み出し部201は、取得した圧縮符号データを、1ブロック伸張部207に伝送する。また、データ読み出し部201は、DEC_START信号を1ブロック伸張部207に出力することで、1ブロック伸張部207に対して伸張処理の開始要求を行う。さらに、データ読み出し部201は、取得した圧縮符号データの先頭3ビット(より詳細には、固定部の先頭3ビット)分に位置するデータを参照し、記載されている量子化語長Qの値(換言すれば、可変長部のword数)を、アドレス保持部209に伝送する。   The data reading unit 201 transmits a compression code data read request signal corresponding to an image designated by the user to the SDRAM controller 37, and from the specific address of the corresponding compression code data from the SDRAM 39 through the internal bus 19. Read the starting data. The data reading unit 201 transmits the acquired compressed code data to the 1-block decompression unit 207. In addition, the data reading unit 201 outputs a DEC_START signal to the 1-block decompression unit 207, thereby requesting the 1-block decompression unit 207 to start decompression processing. Further, the data reading unit 201 refers to the data positioned in the first 3 bits (more specifically, the first 3 bits of the fixed part) of the acquired compressed code data, and describes the value of the quantization word length Q described therein. (In other words, the number of words of the variable length part) is transmitted to the address holding unit 209.

制御信号生成部203は、カウンタを有しており、CPU27等から伝送された各種の設定値(例えば、widthMAX、heightMAX、offx、offy、width、height)に基づいて、伸張不要の領域で1となる制御信号SKIPを生成する。制御信号生成部203は、生成した制御信号であるSKIP信号を、アドレス保持部209が備えるセレクタ211に伝送する。なお、上記伸張不要の領域は、例えば図10に示した1フレームの画像50のうち、伸張が要求されている矩形領域51に該当しない部分を意味する。   The control signal generation unit 203 has a counter, and is set to 1 in an area that does not need to be expanded based on various setting values (for example, widthMAX, heightMAX, offx, offy, width, height) transmitted from the CPU 27 or the like. The control signal SKIP is generated. The control signal generation unit 203 transmits the SKIP signal that is the generated control signal to the selector 211 provided in the address holding unit 209. Note that the area that does not need to be decompressed means, for example, a portion of the one-frame image 50 shown in FIG. 10 that does not correspond to the rectangular area 51 that is requested to be decompressed.

また、制御信号生成部203は、データの伸張を行う領域では、1ブロック伸張部207から伝送される終了信号BLOCK_DEC_ENDを待って、次の水平方向のカウントアップを行う。さらに、制御信号生成部203は、1ラインのスキップまたは伸張処理が終了したら、制御信号であるADR_INIT信号を「1」にして、次のライン先頭のアドレスに、ターゲットアドレスを現すパラメータ「Tagadr」を初期化する。制御信号生成部203は、生成したADR_INIT信号を、先頭アドレス設定部205およびアドレス保持部209が備えるセレクタ215に伝送する。本実施形態においては、1ラインの符号量が固定長となっているため、パラメータ「Tagadr」の値を一意に設定することができる。   Further, the control signal generation unit 203 waits for the end signal BLOCK_DEC_END transmitted from the 1-block expansion unit 207 and performs the next horizontal count-up in the area where data expansion is performed. Further, when the skip or expansion process for one line is completed, the control signal generation unit 203 sets the ADR_INIT signal, which is a control signal, to “1”, and sets the parameter “Tagadr” representing the target address to the next line head address. initialize. The control signal generation unit 203 transmits the generated ADR_INIT signal to the selector 215 included in the head address setting unit 205 and the address holding unit 209. In the present embodiment, since the code amount of one line has a fixed length, the value of the parameter “Tagadr” can be set uniquely.

先頭アドレス設定部205は、CPU27等から伝送された各種の設定値(例えば、widthMAX、heightMAX、offx、offy、width、height)に基づいて、ターゲットとなるライン先頭のアドレスの設定値TAG_INIT_VALを生成する。先頭アドレス設定部205は、生成したアドレスの設定値TAG_INIT_VALを、アドレス保持部209が備えるセレクタ215に伝送する。   The head address setting unit 205 generates a target line head address setting value TAG_INIT_VAL based on various setting values (for example, widthMAX, heightMAX, offx, offy, width, height) transmitted from the CPU 27 or the like. . The start address setting unit 205 transmits the generated address setting value TAG_INIT_VAL to the selector 215 included in the address holding unit 209.

先頭アドレス設定部205は、1ラインごとの伸張処理(デコード)が終了する毎に、
圧縮符号データの次のラインの先頭アドレスを以下のように計算する。すなわち、伸張する矩形領域51は、原点からoffy[line]、offx[block]離れているため、先頭アドレス設定部205は、ライン単位では、「offy×(圧縮レート×widthMAX)」を初期値とする。これにより、垂直方向(図10におけるheightMAXに沿った方向)のoffyラインの読み飛ばしが可能となる。また、次のラインの先頭アドレスは、初期値に対して、「(圧縮レート×widthMAX)」を順次加算していけばよい。
Each time the start address setting unit 205 ends the decompression process (decode) for each line,
The head address of the next line of the compression code data is calculated as follows. That is, since the rectangular area 51 to be expanded is offy [line] and offx [block] away from the origin, the head address setting unit 205 sets “offy × (compression rate × widthMAX)” as an initial value in units of lines. To do. As a result, it is possible to skip the offy line in the vertical direction (the direction along heightMAX in FIG. 10). The start address of the next line may be obtained by sequentially adding “(compression rate × widthMAX)” to the initial value.

1ブロック伸張部207は、データ読み出し部201から伝送された圧縮符号データを、1ブロックごとに伸張する。1ブロック伸張部207による伸張処理は、データ読み出し部201から出力されたDEC_START信号を受信した際に開始される。以下では、図11を参照しながら、本実施形態に係る1ブロック伸張部207の構成について、詳細に説明する。図11は、本実施形態に係る1ブロック伸張部207の構成を説明するためのブロック図である。   The 1-block decompression unit 207 decompresses the compressed code data transmitted from the data reading unit 201 for each block. The decompression process by the 1-block decompression unit 207 is started when the DEC_START signal output from the data reading unit 201 is received. Hereinafter, the configuration of the 1-block decompression unit 207 according to the present embodiment will be described in detail with reference to FIG. FIG. 11 is a block diagram for explaining the configuration of the 1-block decompression unit 207 according to this embodiment.

本実施形態に係る1ブロック伸張部207は、例えば図11に示したように、圧縮符号データラッチ部221と、カウンタ223と、シフトレジスタ225と、逆量子化器227と、加算器229と、逆折れ線伸張部231と、を主に備える。   For example, as illustrated in FIG. 11, the 1-block decompression unit 207 according to the present embodiment includes a compression code data latch unit 221, a counter 223, a shift register 225, an inverse quantizer 227, an adder 229, An inverted broken line extending portion 231 is mainly provided.

圧縮符号データラッチ部221は、DEC_START信号を受信すると、データ読み出し部201から伝送された圧縮符号データをラッチし、圧縮符号データの固定部(word0)から、量子化語長Q、シフト量SFTおよび最小値minに該当する値を取得する。また、圧縮符号データラッチ部221は、量子化語長Qをword数として、word1からword6を、可変長の量子化データ(符号データ)として保持する。   When the compression code data latch unit 221 receives the DEC_START signal, the compression code data latch unit 221 latches the compression code data transmitted from the data reading unit 201, and from the compression code data fixing unit (word0), the quantization word length Q, the shift amount SFT, and A value corresponding to the minimum value min is acquired. Further, the compression code data latch unit 221 holds the quantized word length Q as the number of words and words 1 to word 6 as variable length quantized data (code data).

圧縮符号データラッチ部221は、保持している量子化データである符号データと、量子化語長Qを、シフトレジスタ225に伝送する。また、圧縮符号データラッチ部221は、保持しているシフト量SFTを、逆量子化器227に伝送する。さらに、圧縮符号データラッチ部221は、保持している最小値minを、加算器229に伝送する。   The compression code data latch unit 221 transmits the code data that is the quantized data and the quantized word length Q to the shift register 225. Further, the compression code data latch unit 221 transmits the held shift amount SFT to the inverse quantizer 227. Further, the compression code data latch unit 221 transmits the held minimum value min to the adder 229.

カウンタ223は、DEC_START信号を受信して伸張処理が開始されると、伸張処理を施した画素数をカウントし、1ブロック分の画素(すなわち、16画素)の伸張処理が終了した時点で、BLOCK_DEC_END信号を出力する。カウンタ223が出力するBLOCK_DEC_END信号は、制御信号生成部203に伝送される。   When the expansion process is started upon reception of the DEC_START signal, the counter 223 counts the number of pixels subjected to the expansion process. Output a signal. The BLOCK_DEC_END signal output from the counter 223 is transmitted to the control signal generation unit 203.

シフトレジスタ225は、圧縮符号データラッチ部221に保持されたデータのうち、量子化語長Qに関するデータを受け取る。続いて、シフトレジスタ225は、受信した量子化語長Qに基づいて、圧縮符号データの中から語長Qずつ量子化データをシフト動作によって抽出し、逆量子化器227に伝送する。   The shift register 225 receives data related to the quantization word length Q among the data held in the compression code data latch unit 221. Subsequently, based on the received quantized word length Q, the shift register 225 extracts quantized data for each word length Q from the compressed code data by a shift operation, and transmits the quantized data to the inverse quantizer 227.

逆量子化器227は、シフトレジスタ225から伝送される画素毎の量子化データを、圧縮符号データラッチ部221から伝送されるシフト量SFTに応じて、逆量子化する。本実施形態では、逆量子化器227は、1〜6ビットの符号を逆量子化して、10ビットのデータを出力する。   The inverse quantizer 227 inversely quantizes the quantized data for each pixel transmitted from the shift register 225 according to the shift amount SFT transmitted from the compression code data latch unit 221. In the present embodiment, the inverse quantizer 227 performs inverse quantization on the 1 to 6-bit code and outputs 10-bit data.

この逆量子化器227として、例えば、左シフタを適用することが可能である。この場合、逆量子化器227は、シフトレジスタ225から伝送されたデータを、圧縮符号データラッチ部221から伝送されたシフト量SFTだけ左シフトする。逆量子化器227として左シフタを適用することで、回路規模を削減することができる。   As the inverse quantizer 227, for example, a left shifter can be applied. In this case, the inverse quantizer 227 shifts the data transmitted from the shift register 225 to the left by the shift amount SFT transmitted from the compression code data latch unit 221. By applying a left shifter as the inverse quantizer 227, the circuit scale can be reduced.

加算部229は、逆量子化器227が出力した符号データに、ブロック毎の共通DCオフセット値となる最小値を加算する。この最小値は、圧縮符号データラッチ部221から伝送されたものである。加算部229は、最小値を加算したデータを逆折れ線伸張部231に伝送する。   The adder 229 adds the minimum value that is a common DC offset value for each block to the code data output from the inverse quantizer 227. This minimum value is transmitted from the compression code data latch unit 221. The adding unit 229 transmits the data added with the minimum value to the reverse polygonal line extending unit 231.

逆折れ線伸張部231は、加算部229から伝送されたデータを、RAW圧縮部101の折れ線圧縮部121と逆の特性により、10ビットから14ビットのデータへと伸張する。   The reverse broken line expansion unit 231 expands the data transmitted from the addition unit 229 from 10 bits to 14 bits of data with the reverse characteristics of the broken line compression unit 121 of the RAW compression unit 101.

ここで、図12は、逆折れ線伸張部231で用いられる折れ線の例を示す図である。この図12の折れ線は、図3で示した折れ線圧縮部121における折れ線と、逆の特性により階調を変換するようになっている。なお、入力データと伸張後の出力データとを対応付けて記憶したROMテーブルを用意し、このROMテーブルに従って入出力データの変換が行われてもよい。なお、圧縮時に、折れ線圧縮部121による圧縮が適用されなかった場合には、伸張時には、この逆折れ線伸張部231でのデータ変換もバイパスされる。   Here, FIG. 12 is a diagram illustrating an example of a polygonal line used in the reverse polygonal line extending unit 231. The polygonal line in FIG. 12 is adapted to convert the gradation by characteristics opposite to those of the polygonal line compression unit 121 shown in FIG. A ROM table in which input data and decompressed output data are stored in association with each other may be prepared, and input / output data conversion may be performed according to the ROM table. If compression by the polygonal line compression unit 121 is not applied at the time of compression, data conversion at the reverse polygonal line expansion unit 231 is also bypassed at the time of expansion.

再び図9に戻って、本実施形態に係るRAW伸張部103の構成について詳細に説明する。   Returning to FIG. 9 again, the configuration of the RAW decompression unit 103 according to the present embodiment will be described in detail.

アドレス保持部209は、圧縮符号データの中から指定された矩形領域51を読み出す際のアドレスを算出するとともに、算出したアドレスを保持する。アドレス保持部209は、例えば図9に示したように、セレクタ211、215と、加算器213と、アクセス用アドレス保持部217と、を有する。   The address holding unit 209 calculates an address when reading the designated rectangular area 51 from the compressed code data, and holds the calculated address. For example, as illustrated in FIG. 9, the address holding unit 209 includes selectors 211 and 215, an adder 213, and an access address holding unit 217.

セレクタ211は、データ読み出し部201から伝送された固定部の先頭3ビットに相当するデータと、当該セレクタ211に直接入力されている「1」を表すデータと、の何れか一方を選択して、加算器213に出力する。セレクタ211によるデータの選択は、制御信号生成部203から伝送される制御信号であるSKIP信号に従って行われる。   The selector 211 selects either one of data corresponding to the first 3 bits of the fixed part transmitted from the data reading unit 201 and data representing “1” directly input to the selector 211, The result is output to the adder 213. The selection of data by the selector 211 is performed according to the SKIP signal that is a control signal transmitted from the control signal generation unit 203.

加算器213は、アクセス用アドレス保持部217が保持しているアドレスに対して、セレクタ211から伝送された値を加算する。加算器213は、加算の結果得られた値を、セレクタ215に伝送する。   The adder 213 adds the value transmitted from the selector 211 to the address held by the access address holding unit 217. The adder 213 transmits the value obtained as a result of the addition to the selector 215.

セレクタ215は、加算器213から伝送されるデータと、先頭アドレス設定部205から伝送される設定値TAG_INIT_VALと、の何れか一方を選択して、アクセス用アドレス保持部217に出力する。セレクタ215によるデータの選択は、制御信号生成部203から伝送される制御信号であるADR_INIT信号に従って行われる。   The selector 215 selects one of the data transmitted from the adder 213 and the setting value TAG_INIT_VAL transmitted from the head address setting unit 205 and outputs the selected value to the access address holding unit 217. The selection of data by the selector 215 is performed according to an ADR_INIT signal that is a control signal transmitted from the control signal generation unit 203.

アクセス用アドレス保持部217は、SDRAM39から読み出す圧縮符号データのアドレスを保持する。データ読み出し部201は、このアクセス用アドレス保持部217に保持されているアドレスに基づいて、SDRAM39から圧縮符号データの読み出しを行う。   The access address holding unit 217 holds the address of the compressed code data read from the SDRAM 39. The data reading unit 201 reads the compressed code data from the SDRAM 39 based on the address held in the access address holding unit 217.

続いて、アクセス用のアドレスが設定される流れについて、以下で詳細に説明する。   Next, the flow of setting an access address will be described in detail below.

まず、先頭アドレス設定部205から伝送される設定値TAG_INIT_VALを用いて、アクセス用アドレス保持部217の初期化が行われ、データ読み出し部201は、垂直方向へoffy[line]だけ読み飛ばしを行う。ここで、初期化の結果入力される値は、「TAG_INIT_VAL=offy×widthMax×圧縮レート[bit/pix]」となる。   First, the access address holding unit 217 is initialized using the set value TAG_INIT_VAL transmitted from the head address setting unit 205, and the data reading unit 201 skips offy [line] in the vertical direction. Here, the value input as a result of the initialization is “TAG_INIT_VAL = offy × widthMax × compression rate [bit / pix]”.

続いて、アドレス保持部209において、offxブロック分アドレスをスキップする処理が行われる。データ読み出し部201は、アクセス用アドレス保持部217に保持されているアドレスを用いてSDRAM39のデータを読み出すと、ライン先頭のブロックのword0にアクセスできる。ここで、データ読み出し部201は、圧縮符号データのフォーマットに従い3ビットの量子化語長Qを取り出し、セレクタ211に伝送する。セレクタ211は、量子化語長Qの値を加算器213に伝送する。加算器213は、アクセス用アドレス保持部217が現在保持しているアドレスに対して、量子化語長Qを加算し、セレクタ215に伝送する。セレクタ215は、伝送された値を、新たなアドレスとして、アクセス用アドレス保持部217に伝送する。これにより、データ読み出し部201は、図10に示したように、次のブロックのアドレスのword0へスキップすることができる。   Subsequently, the address holding unit 209 performs processing for skipping offx block addresses. When the data reading unit 201 reads the data in the SDRAM 39 using the address held in the access address holding unit 217, the data reading unit 201 can access word0 of the block at the head of the line. Here, the data reading unit 201 extracts a 3-bit quantized word length Q according to the format of the compressed code data, and transmits it to the selector 211. The selector 211 transmits the value of the quantized word length Q to the adder 213. The adder 213 adds the quantized word length Q to the address currently held by the access address holding unit 217 and transmits the result to the selector 215. The selector 215 transmits the transmitted value to the access address holding unit 217 as a new address. As a result, the data reading unit 201 can skip to word0 of the address of the next block as shown in FIG.

上述の処理は、図9からも明らかなように、1側に倒したセレクタ211(SEL0)と、加算器213との動作となる。かかる処理をoffx回分繰り返すことで、可変長で記録されている符号データの中から、そのラインの中で必要とする矩形領域51の先頭へと、伸張処理を実行することなくアクセスすることができる。   As is apparent from FIG. 9, the above-described processing is the operation of the selector 211 (SEL0) tilted to one side and the adder 213. By repeating this process for offx times, it is possible to access from the code data recorded in variable length to the head of the rectangular area 51 required in the line without executing the decompression process. .

次に、RAW伸張部103では、伸張処理を伴う可変長符号部の読み出しを行う。この処理に先立ち、アクセス用アドレス保持部217に保持されているアドレスは、必要とする矩形領域51の先頭に対応するアドレスとなっているため、制御信号生成部203から伝送される制御信号であるSKIP信号は、0となる。データ読み出し部201は、まず、アクセス用アドレス保持部217に保持されている矩形領域51の先頭に対応するブロックのWord0を読み出す。続いて、データ読み出し部201は、3ビットの量子化語長Qの示す数値と同じだけ、圧縮符号データをSDRAM39から読み出す。   Next, the RAW expansion unit 103 reads out the variable length code unit accompanied by the expansion process. Prior to this processing, the address held in the access address holding unit 217 is a control signal transmitted from the control signal generating unit 203 because it is an address corresponding to the head of the required rectangular area 51. The SKIP signal becomes zero. The data reading unit 201 first reads Word 0 of the block corresponding to the head of the rectangular area 51 held in the access address holding unit 217. Subsequently, the data reading unit 201 reads the compressed code data from the SDRAM 39 by the same amount as the numerical value indicated by the 3-bit quantization word length Q.

上述の処理は、図9からも明らかなように、0側に倒したセレクタ211(SEL0)と、加算器213との動作となる。データ読み出し部201は、これらの(1+Q)wordのデータを1ブロック伸張部207へ伝送する。1ブロック伸張部207は、伝送された圧縮符号データを、16画素のRAW信号に伸張する。この間、1ブロック伸張部207に設けられたカウンタ223は、1ブロックの伸張終了を表す「BLOCK_DEC_END=1」となるのを待ち受ける。   As is apparent from FIG. 9, the above-described processing is the operation of the selector 211 (SEL0) tilted to the 0 side and the adder 213. The data reading unit 201 transmits these (1 + Q) word data to the 1-block decompression unit 207. The 1-block decompression unit 207 decompresses the transmitted compressed code data into a 16-pixel RAW signal. During this time, the counter 223 provided in the 1-block decompression unit 207 waits for “BLOCK_DEC_END = 1” indicating the end of decompression of one block.

かかる処理をwidth回分繰り返すことで、所望の矩形領域51の1ラインの伸張処理を実行することができる。   By repeating such processing for width times, it is possible to execute the expansion processing for one line of the desired rectangular area 51.

続いて、制御信号生成部203は、次のラインのスキップ/伸張処理を行う前処理として、制御信号であるADR_INIT信号を出力する。これにより、セレクタ215(SEL1)は切り替わり、先頭アドレス設定部205から伝送される設定値TAG_INIT_VALを、アクセス用アドレス保持部217へと出力する。ここで「TAG_INIT_VAL=TAG_INIT_VAL+1ライン分の読み飛ばし」とする。この様な処理を、RAW信号伸張部103は、height回分繰り返す。   Subsequently, the control signal generation unit 203 outputs an ADR_INIT signal, which is a control signal, as preprocessing for performing skip / decompression processing for the next line. As a result, the selector 215 (SEL1) is switched, and the setting value TAG_INIT_VAL transmitted from the head address setting unit 205 is output to the access address holding unit 217. Here, “TAG_INIT_VAL = TAG_INIT_VAL + 1 line skipping” is assumed. The RAW signal decompression unit 103 repeats such processing as high times.

本実施形態に係るRAW伸張部103は、このような処理を行うことで、任意の矩形領域51を無駄な伸張処理をせずに高速に伸張することが可能となる。水平方向のブロック数分の伸張処理が終了して、更に下側に位置するブロックへアクセスを行うためには、各ラインの先頭のブロックの符号を示すようにアドレスを更新しなければならない。ここで、本実施形態に係る撮像装置では、圧縮符号データがライン単位で固定長となっているため、上記アドレスを一意に定めることができる。   By performing such processing, the RAW decompression unit 103 according to the present embodiment can decompress an arbitrary rectangular area 51 at high speed without performing unnecessary decompression processing. In order to access the lower block after the expansion process for the number of blocks in the horizontal direction is completed, the address must be updated to indicate the code of the head block of each line. Here, in the imaging apparatus according to the present embodiment, since the compression code data has a fixed length in units of lines, the address can be uniquely determined.

なお、上述の例では、任意の矩形領域51を、1ラインごとに読み出して伸張する場合について説明を行ったが、例えば図13に示すように、任意の矩形領域51の内部を複数のタイル53に区分して、タイル状に伸張処理を行うことも可能である。ここで、タイル53は、伸張の対象となるブロック×所定のライン数からなる大きさを有する。   In the above-described example, the case where the arbitrary rectangular area 51 is read and expanded for each line has been described. However, for example, as illustrated in FIG. It is also possible to perform expansion processing in a tile shape. Here, the tile 53 has a size of a block to be expanded × a predetermined number of lines.

図13に示したような矩形領域51をタイル状に伸張する場合、伸張開始位置までの読み飛ばし処理は、1ラインごとに伸張処理を行う上述の場合と同様に行うことが可能である。この際に、アクセス用アドレス保持部217は、タイル53ひとつ分に含まれるライン数分だけSDRAM等のデータ保持手段を有しており、各ラインにおける伸張中の可変長符号のアドレスを保持しておく必要がある。   When the rectangular area 51 as shown in FIG. 13 is expanded in a tile shape, the skipping process up to the expansion start position can be performed in the same manner as described above in which the expansion process is performed for each line. At this time, the access address holding unit 217 has data holding means such as SDRAM for the number of lines included in one tile 53, and holds the address of the variable length code being expanded in each line. It is necessary to keep.

このような処理を行うことで、右横に位置するタイル53を順に伸張することが可能となる。なお、通常処理の単位となるタイルの大きさは小さいため、ライン数分だけアクセス用アドレス保持部217を保持したとしても、その規模は小さくてすむ。   By performing such processing, the tile 53 located on the right side can be expanded in order. Since the size of the tile as a unit of normal processing is small, even if the access address holding unit 217 is held for the number of lines, the scale can be small.

以上、本実施形態に係る撮像装置10の機能の一例を示した。上記の各構成要素は、汎用的な部材や回路を用いて構成されていてもよいし、各構成要素の機能に特化したハードウェアにより構成されていてもよい。また、各構成要素の機能を、CPU等が全て行ってもよい。従って、本実施形態を実施する時々の技術レベルに応じて、適宜、利用する構成を変更することが可能である。   Heretofore, an example of the function of the imaging device 10 according to the present embodiment has been shown. Each component described above may be configured using a general-purpose member or circuit, or may be configured by hardware specialized for the function of each component. In addition, the CPU or the like may perform all functions of each component. Therefore, it is possible to appropriately change the configuration to be used according to the technical level at the time of carrying out the present embodiment.

<まとめ>
[圧縮処理に関するまとめ]
以上説明したように、本実施形態に係るRAW圧縮部101は、ブロック単位の可変長量子化を行い、14bit/pixのデータを6bit/pixに圧縮する。これにより、
RAWキャプチャ時のBUS帯域の削減、メモリエリアの削減(ひいては、連写枚数の向上)を実現することが可能となる。また、パディング部131によってデータ「0」またはデータ「1」のパディング処理を行うため、圧縮符号データは、ライン単位では固定長となる。その結果、圧縮符号データは、フレーム単位でも固定長となる。
<Summary>
[Summary about compression processing]
As described above, the RAW compression unit 101 according to the present embodiment performs variable-length quantization in units of blocks and compresses 14-bit / pix data to 6-bit / pix. This
It is possible to reduce the BUS bandwidth and the memory area (and thus improve the number of continuous shots) during RAW capture. In addition, since the padding unit 131 performs padding processing on the data “0” or the data “1”, the compression code data has a fixed length in units of lines. As a result, the compressed code data has a fixed length even in frame units.

また、本実施形態に係るRAW圧縮部101は、予測符号化、可変長符号を使用しない。そのため、簡便な演算で伸張処理を行うことが可能である。また、ライン間の相関を利用しないため、CMOSだけでなくフィールド読み出しが必要なCCDにも対応可能である。   Further, the RAW compression unit 101 according to the present embodiment does not use predictive coding and variable length codes. Therefore, the decompression process can be performed with a simple calculation. Further, since the correlation between lines is not used, it is possible to deal with not only CMOS but also CCD that requires field readout.

また、従来の可変長圧縮を用いた圧縮方法の場合、最終的に符号量が元の画像サイズを超過してしまうという可能性があるため、符号量超過という事態を検知、処理する仕組みが必要であった。このような仕組みは、具体的には、CPUへの割り込み信号生成回路や、圧縮データを破棄してユーザへ撮影失敗等の表示を行う処理を実行する割り込み処理プログラムとして、従来では実現されていた。しかしながら、本実施形態に係る圧縮方法では、最終的に符号量が目標符号量を超過してしまうことがないため、このような仕組みは不要となり、制御が簡便となる。   Also, in the case of the compression method using the conventional variable length compression, there is a possibility that the code amount will eventually exceed the original image size, so a mechanism for detecting and processing the situation where the code amount is exceeded is necessary. Met. Specifically, such a mechanism has conventionally been realized as an interrupt signal generation circuit to the CPU or an interrupt processing program that executes processing for discarding compressed data and displaying a shooting failure to the user. . However, in the compression method according to the present embodiment, since the code amount does not eventually exceed the target code amount, such a mechanism is unnecessary and the control is simple.

また、本実施形態に係る圧縮方法では、撮影時のRAWデータを取り込むためのリアルタイム性を確保しつつ、量子化語長の割り当てを決定する際に、1ラインの符号量を見積もり値ではなく確定値で得ることができる。そのため、可変長という要素を量子化にとりいれているものの、必ず生成された符号は固定長にすることができる。また、本実施形態に係る圧縮方法は、可変長方式で圧縮しながら符号量を監視して設定を超過した場合それ以降を固定長方式に変更して圧縮するやり方とは異なり、ライン単位で符号量を超過した場合に固定長とするため、画面全体へのダメージは小さくなる。   Further, in the compression method according to the present embodiment, the code amount of one line is determined instead of the estimated value when determining the allocation of the quantization word length while ensuring the real-time property for capturing RAW data at the time of shooting. Can be obtained by value. For this reason, although the variable length element is included in the quantization, the generated code can always be a fixed length. Also, the compression method according to the present embodiment is different from the method of compressing by changing to the fixed length method after monitoring the code amount while compressing by the variable length method and exceeding the setting. Since the fixed length is used when the amount is exceeded, the damage to the entire screen is reduced.

[伸張処理に関するまとめ]
以上説明したように、本実施形態に係るRAW圧縮部101は、フレーム単位で固定長となっているため、伸張処理時では、連写で連続してメモリ上にキャプチャしておいた任意のフレームへのランダムアクセスが可能となる。また、本実施形態においては、1ブロックの圧縮符号データ内の量子化語長+1(あるいは固定値)が、圧縮符号データのワード数になる様な符号フォーマットを採用しているため、符号長を表すデータを圧縮符号内に特に必要としない。これにより、圧縮効率の向上を図ることが可能である。
[Summary about decompression processing]
As described above, since the RAW compression unit 101 according to the present embodiment has a fixed length in units of frames, any frame that has been continuously captured in the memory by continuous shooting at the time of expansion processing. Random access to is possible. In the present embodiment, since the code format is adopted such that the quantization word length + 1 (or a fixed value) in the compression code data of one block is the number of words of the compression code data, the code length is The data to be represented is not particularly required in the compression code. Thereby, it is possible to improve the compression efficiency.

本実施形態に係るRAW伸張部103は、伸張処理時に、固定長1ライン分のストリームをメモリに読み込み、先頭から1word目を順にサーチして量子化語長のみを取得してアドレスへ加算してゆく。これにより、本実施形態に係る撮像装置では、伸張処理をすることなく、目的のブロックの1word目へアクセスすることができる。   The RAW decompression unit 103 according to the present embodiment reads a stream of one line of fixed length into a memory during decompression processing, sequentially searches the first word from the head, acquires only the quantized word length, and adds it to the address. go. Thereby, the imaging apparatus according to the present embodiment can access the first word of the target block without performing the expansion process.

これは、1フレーム全体を伸張しなくとも、1フレーム内の希望のブロックへのアクセスが可能となることを意味しており、1フレーム内の任意矩形領域を取り出す事が必要なEズーム、トリミング等の処理で、処理時間、メモリの削減を図ることが可能となる。   This means that it is possible to access a desired block in one frame without expanding the entire frame, and E-zoom and trimming that require extraction of an arbitrary rectangular area in one frame. Thus, it is possible to reduce processing time and memory.

また、従来、圧縮効率向上のために可変長符号を用いる場合には、1フレーム先頭から伸張処理をしなくてはならない。これは、数ブロック、数ライン毎に符号の切れ目を入れると、そこで符号打ち切りの印となる符号を挿入したり、次の符号化単位までの長さ等を記録したりする必要が生じるため、圧縮効率向上という側面から導入しにくいからである。これは、所望のブロックへのアクセスを考えた場合、1フレーム分のバッファを用意しておき、このバッファへ一度データを伸張してから、所望の矩形領域へアクセスしなくてはならない事を意味する。このような処理は、メモリエリアの拡大、処理時間の増加につながる。   Conventionally, when a variable length code is used to improve compression efficiency, the decompression process must be performed from the beginning of one frame. This is because if there is a break in the code every several blocks and several lines, it will be necessary to insert a code that will be a code truncation mark or record the length to the next coding unit, etc. This is because it is difficult to introduce from the aspect of improving the compression efficiency. This means that if you want to access a desired block, you must prepare a buffer for one frame, expand the data once to this buffer, and then access the desired rectangular area. To do. Such processing leads to expansion of the memory area and increase in processing time.

しかしながら、本実施形態に係る圧縮・伸張方法では、ブロック単位では可変長となっているものの、ライン単位では固定長となっているため、メモリ上にキャプチャしておいた任意のフレームへのランダムアクセスが可能となる。これにより、メモリエリアの拡大や処理時間の増加を抑制することが可能となる。   However, in the compression / decompression method according to this embodiment, although the length is variable in units of blocks, the length is fixed in units of lines, so that random access to any frame captured on the memory is performed. Is possible. Thereby, it is possible to suppress expansion of the memory area and increase in processing time.

以上、添付図面を参照しながら本発明の好適な実施形態について説明したが、本発明はかかる例に限定されないことは言うまでもない。当業者であれば、特許請求の範囲に記載された範疇内において、各種の変更例または修正例に想到し得ることは明らかであり、それらについても当然に本発明の技術的範囲に属するものと了解される。   As mentioned above, although preferred embodiment of this invention was described referring an accompanying drawing, it cannot be overemphasized that this invention is not limited to this example. It will be apparent to those skilled in the art that various changes and modifications can be made within the scope of the claims, and these are naturally within the technical scope of the present invention. Understood.

本発明の第1の実施形態に係る情報処理装置の一例である撮像装置の構成を説明するためのブロック図である。It is a block diagram for demonstrating the structure of the imaging device which is an example of the information processing apparatus which concerns on the 1st Embodiment of this invention. 同実施形態に係る圧縮部の構成を説明するためのブロック図である。It is a block diagram for demonstrating the structure of the compression part which concerns on the same embodiment. ベイヤ配列と抽出された同色1ラインとを説明するための説明図である。It is explanatory drawing for demonstrating a Bayer arrangement | sequence and the extracted same color 1 line. 同実施形態に係る折れ線圧縮部で用いられる折れ線の例を説明するためのグラフ図である。It is a graph for demonstrating the example of the broken line used in the broken line compression part which concerns on the same embodiment. 同実施形態に係る頻度計測部の構成を説明するためのブロック図である。It is a block diagram for demonstrating the structure of the frequency measurement part which concerns on the same embodiment. 同実施形態に係る量子化語長割当算出部が参照する量子化語長テーブルの一例を示した説明図である。It is explanatory drawing which showed an example of the quantization word length table which the quantization word length allocation calculation part which concerns on the embodiment refers. 同実施形態に係る量子化実行部の構成を説明するためのブロック図である。It is a block diagram for demonstrating the structure of the quantization execution part which concerns on the same embodiment. 同実施形態に係る圧縮画像データのデータ構成を説明するための説明図である。It is explanatory drawing for demonstrating the data structure of the compressed image data which concerns on the embodiment. 同実施形態に係る伸張部の構成を説明するためのブロック図である。It is a block diagram for demonstrating the structure of the expansion | extension part which concerns on the same embodiment. 圧縮画像データにおけるデータ読み出し位置を特定するために用いられるパラメータを説明するための説明図である。It is explanatory drawing for demonstrating the parameter used in order to specify the data reading position in compressed image data. 同実施形態に係る1ブロック伸張部の構成を説明するためのブロック図である。It is a block diagram for demonstrating the structure of the 1-block expansion | extension part which concerns on the same embodiment. 同実施形態に係る逆折れ線変換部における変換特性の一例を説明するためのグラフ図である。It is a graph for demonstrating an example of the conversion characteristic in the reverse broken line conversion part which concerns on the same embodiment. 圧縮画像データにおけるデータ読み出し方法の一例を説明するための説明図である。It is explanatory drawing for demonstrating an example of the data reading method in compressed image data. 従来の撮像装置の構成を説明するためのブロック図である。It is a block diagram for demonstrating the structure of the conventional imaging device.

符号の説明Explanation of symbols

10 撮像装置
11 撮像素子
13 AFE回路部
15 デジタル画像処理回路部
17 カメラ信号前処理部
19 内部バス
21 カメラ信号処理部
23 解像度変換部
25 JPEGエンジン
27 CPU
29 ROM
31 ストレージデバイス
33 ビデオ出力エンコーダ
35 ビデオ出力端子
37 SDRAMコントローラ
39 SDRAM
50 1フレームの画像
51 矩形領域
53 ブロック
101 RAW圧縮部
103 RAW伸張部
DESCRIPTION OF SYMBOLS 10 Image pick-up device 11 Image sensor 13 AFE circuit part 15 Digital image processing circuit part 17 Camera signal pre-processing part 19 Internal bus 21 Camera signal processing part 23 Resolution conversion part 25 JPEG engine 27 CPU
29 ROM
31 Storage Device 33 Video Output Encoder 35 Video Output Terminal 37 SDRAM Controller 39 SDRAM
50 1-frame image 51 Rectangular area 53 Block 101 RAW compression unit 103 RAW expansion unit

Claims (9)

撮像素子から出力された画像データを圧縮する圧縮部と、
圧縮された前記画像データを保持する記憶部と、
を有し、
前記圧縮部は、
前記画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測する頻度計測部と、
前記頻度に基づいて、前記ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出する量子化語長割当算出部と、
算出された前記量子化語長に基づいて量子化された前記ブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加するパディング部と、
を備える、画像処理装置。
A compression unit that compresses image data output from the image sensor;
A storage unit for holding the compressed image data;
Have
The compression unit is
For the image data, a frequency measurement unit that measures the frequency of the dynamic range of a block composed of a predetermined number of pixel data;
Based on the frequency, for each block, a quantized word length allocation calculating unit that calculates a quantized word length allocated to each dynamic range;
A padding unit for adding 0 or 1 to a compressed image data including a predetermined block of encoded data for each block quantized based on the calculated quantized word length until a predetermined code amount is reached; ,
An image processing apparatus comprising:
前記画像処理装置は、前記各ダイナミックレンジに割り当てられる量子化語長の組み合わせが互いに異なる複数のパターンが記載された量子化語長テーブルを予め保持しており、
前記量子化語長割当算出部は、前記量子化語長テーブルに記載された前記複数のパターンと前記頻度とに基づいて各パターンにおける前記所定ブロック分の圧縮画像データの確定符号量を算出し、前記確定符号量が所望の符号量以下となる前記パターンにおける前記量子化語長の組み合わせを選択する、請求項1に記載の画像処理装置。
The image processing apparatus holds in advance a quantization word length table in which a plurality of patterns having different combinations of quantization word lengths assigned to the respective dynamic ranges are described,
The quantized word length allocation calculating unit calculates a determined code amount of compressed image data for the predetermined block in each pattern based on the plurality of patterns and the frequency described in the quantized word length table, The image processing apparatus according to claim 1, wherein a combination of the quantization word lengths in the pattern in which the determined code amount is equal to or less than a desired code amount is selected.
前記量子化語長割当算出部は、前記確定符号量が前記所望の符号量超過となる場合に、前記各ダイナミックレンジに割り当てられる量子化語長を所定の固定値に設定する、請求項2に記載の画像処理装置。   The quantization word length allocation calculation unit sets a quantization word length allocated to each dynamic range to a predetermined fixed value when the determined code amount exceeds the desired code amount. The image processing apparatus described. 前記量子化語長割当算出部は、前記所定の符号量と、選択された前記量子化語長の組み合わせにおける前記確定符号量との差を、パディング量として前記パディング部に伝送する、請求項2に記載の画像処理装置。   The quantized word length allocation calculating unit transmits a difference between the predetermined code amount and the determined code amount in the selected combination of quantized word lengths as a padding amount to the padding unit. An image processing apparatus according to 1. 前記圧縮部は、前記算出された量子化語長に基づいて前記ブロックごとに前記画像データを量子化する量子化実行部を更に備え、
前記量子化実行部は、所定のビット数を有し、前記算出された量子化語長を表す情報を少なくとも含む固定長部と、前記所定数の画素データに対応した前記符号化データを含む可変長部と、から構成される符号化データを生成する、請求項1に記載の画像処理装置。
The compression unit further includes a quantization execution unit that quantizes the image data for each block based on the calculated quantization word length,
The quantization execution unit has a predetermined number of bits, a fixed-length unit including at least information indicating the calculated quantization word length, and a variable including the encoded data corresponding to the predetermined number of pixel data The image processing apparatus according to claim 1, wherein the encoded data includes a long part.
前記画像処理装置は、前記記憶部に保持されている前記圧縮された画像データを取得し、当該圧縮された画像データの中から任意の矩形領域に対応するデータを伸張する伸張部を更に備え、
前記伸張部は、前記固定長部に含まれる前記量子化語長を表す情報に基づいて、前記任意の矩形領域に対応するデータの位置を特定する、請求項5に記載の画像処理装置。
The image processing apparatus further includes a decompression unit that obtains the compressed image data held in the storage unit and decompresses data corresponding to an arbitrary rectangular area from the compressed image data,
The image processing apparatus according to claim 5, wherein the decompressing unit specifies a position of data corresponding to the arbitrary rectangular area based on information representing the quantization word length included in the fixed length unit.
撮像素子から出力された画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測するステップと、
前記頻度に基づいて、前記ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出するステップと、
算出された前記量子化語長に基づいて量子化された前記ブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加するステップと、
を含む、画像処理方法。
Measuring the frequency of the dynamic range of a block composed of a predetermined number of pixel data for the image data output from the image sensor;
Calculating a quantized word length assigned to each dynamic range for each block based on the frequency;
Adding 0 or 1 to compressed image data including a predetermined block of encoded data for each block quantized based on the calculated quantized word length until a predetermined code amount is reached;
Including an image processing method.
撮像素子から出力された画像データが入力され、入力された前記画像データを圧縮して保持可能なコンピュータに、
入力された前記画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測する頻度計測機能と、
前記頻度に基づいて、前記ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出する量子化語長割当算出機能と、
算出された前記量子化語長に基づいて量子化された前記ブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加するパディング機能と、
を実現させるための、プログラム。
The image data output from the image sensor is input, and the computer can compress and hold the input image data.
For the input image data, a frequency measurement function for measuring the frequency of the dynamic range of a block consisting of a predetermined number of pixel data;
Based on the frequency, for each block, a quantization word length allocation calculation function for calculating a quantization word length allocated to each dynamic range;
A padding function for adding 0 or 1 to the compressed image data including a predetermined block of encoded data for each block quantized based on the calculated quantized word length until a predetermined code amount is reached; ,
A program to realize
撮像素子から出力された画像データを圧縮する圧縮部と、
圧縮された前記画像データを保持する記憶部と、
を有し、
前記圧縮部は、
前記画像データについて、所定数の画素データからなるブロックのダイナミックレンジの頻度を計測する頻度計測部と、
前記頻度に基づいて、前記ブロックごとに、各ダイナミックレンジに割り当てられる量子化語長を算出する量子化語長割当算出部と、
算出された前記量子化語長に基づいて量子化された前記ブロックごとの符号化データを所定ブロック分含む圧縮画像データに対して、所定の符号量となるまで0または1を追加するパディング部と、
を備える、撮像装置。
A compression unit that compresses image data output from the image sensor;
A storage unit for holding the compressed image data;
Have
The compression unit is
For the image data, a frequency measurement unit that measures the frequency of the dynamic range of a block composed of a predetermined number of pixel data;
Based on the frequency, for each block, a quantized word length allocation calculating unit that calculates a quantized word length allocated to each dynamic range;
A padding unit that adds 0 or 1 to compressed image data including a predetermined block of encoded data for each block quantized based on the calculated quantized word length until a predetermined code amount is reached; ,
An imaging apparatus comprising:
JP2008240688A 2008-09-19 2008-09-19 Image processing device, image processing method, program and imaging device Withdrawn JP2010074597A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008240688A JP2010074597A (en) 2008-09-19 2008-09-19 Image processing device, image processing method, program and imaging device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008240688A JP2010074597A (en) 2008-09-19 2008-09-19 Image processing device, image processing method, program and imaging device

Publications (1)

Publication Number Publication Date
JP2010074597A true JP2010074597A (en) 2010-04-02

Family

ID=42205952

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008240688A Withdrawn JP2010074597A (en) 2008-09-19 2008-09-19 Image processing device, image processing method, program and imaging device

Country Status (1)

Country Link
JP (1) JP2010074597A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011148573A1 (en) * 2010-05-28 2011-12-01 パナソニック株式会社 Image pickup device
JP2017511045A (en) * 2014-02-26 2017-04-13 ドルビー ラボラトリーズ ライセンシング コーポレイション Luminance-based coding tool for video compression
JP2019201288A (en) * 2018-05-15 2019-11-21 キヤノン株式会社 Image processing apparatus, image processing method, and program

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011148573A1 (en) * 2010-05-28 2011-12-01 パナソニック株式会社 Image pickup device
CN102812698A (en) * 2010-05-28 2012-12-05 松下电器产业株式会社 Image pickup device
US20130002905A1 (en) * 2010-05-28 2013-01-03 Panasonic Corporation Imaging apparatus
US8823832B2 (en) 2010-05-28 2014-09-02 Panasonic Corporation Imaging apparatus
JP5793716B2 (en) * 2010-05-28 2015-10-14 パナソニックIpマネジメント株式会社 Imaging device
JP2017511045A (en) * 2014-02-26 2017-04-13 ドルビー ラボラトリーズ ライセンシング コーポレイション Luminance-based coding tool for video compression
US11032553B2 (en) 2014-02-26 2021-06-08 Dolby Laboratories Licensing Corporation Luminance based coding tools for video compression
US11729400B2 (en) 2014-02-26 2023-08-15 Dolby Laboratories Licensing Corporation Luminance based coding tools for video compression
JP2019201288A (en) * 2018-05-15 2019-11-21 キヤノン株式会社 Image processing apparatus, image processing method, and program
US11503296B2 (en) 2018-05-15 2022-11-15 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
JP7193929B2 (en) 2018-05-15 2022-12-21 キヤノン株式会社 Image processing device, image processing method, and program

Similar Documents

Publication Publication Date Title
JP4337911B2 (en) Imaging device, imaging circuit, and imaging method
JP4508132B2 (en) Imaging device, imaging circuit, and imaging method
KR101241662B1 (en) Image data processing device, image data processing method, and recording medium
JP4687216B2 (en) Image signal processing apparatus, camera system, and image signal processing method
JP4687215B2 (en) Image signal processing apparatus, camera system, and image signal processing method
US8538174B2 (en) Image processing device
JP4799438B2 (en) Image recording apparatus, image recording method, image encoding apparatus, and program
US8073269B2 (en) Image decoding apparatus and image decoding method
JP4804107B2 (en) Image encoding apparatus, image encoding method and program thereof
US8823832B2 (en) Imaging apparatus
KR20070110517A (en) Encoding device and dynamic image recording system having the encoding device
US20120229636A1 (en) Image coding method and decoding method, image coding apparatus and decoding apparatus, camera, and imaging device
JP4359773B2 (en) Image compression processing apparatus, image compression processing method, and image compression processing program
JP2008113070A (en) Imaging device and imaging method
JP2010098352A (en) Image information encoder
JP2016021731A (en) Image capturing apparatus, method for controlling the same, and program
JP2010074597A (en) Image processing device, image processing method, program and imaging device
JP2009290556A (en) Image information processing apparatus and image information processing method
US10516896B2 (en) Encoding device, encoding method, and storage medium
JP2010147531A (en) Imaging apparatus and imaging method
JP2006197181A (en) Signal processing apparatus and signal processing method for solid-state imaging device and image processing apparatus
KR100771138B1 (en) Imaging device and image correcting method
JP2009130563A (en) Unit, method, and program for processing data, imaging apparatus, and method and program for controlling the same
JP2007228514A (en) Imaging apparatus and method
JP2010183401A (en) Image encoding device and method thereof

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20111206