JP2011039660A - Memory controller, image processing system and control method for memory access - Google Patents

Memory controller, image processing system and control method for memory access Download PDF

Info

Publication number
JP2011039660A
JP2011039660A JP2009184635A JP2009184635A JP2011039660A JP 2011039660 A JP2011039660 A JP 2011039660A JP 2009184635 A JP2009184635 A JP 2009184635A JP 2009184635 A JP2009184635 A JP 2009184635A JP 2011039660 A JP2011039660 A JP 2011039660A
Authority
JP
Japan
Prior art keywords
access
memory
frame
unit
memory map
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.)
Granted
Application number
JP2009184635A
Other languages
Japanese (ja)
Other versions
JP5556082B2 (en
Inventor
Kentaro Kawakami
健太郎 川上
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2009184635A priority Critical patent/JP5556082B2/en
Publication of JP2011039660A publication Critical patent/JP2011039660A/en
Application granted granted Critical
Publication of JP5556082B2 publication Critical patent/JP5556082B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Input (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To improve the access efficiency of a semiconductor memory to/from which image data is written and read. <P>SOLUTION: An access cost calculation part calculates the number of cycles necessary for at least either readout access or write access for each of a plurality of memory maps as access costs. A memory map selection part selects the memory map whose access costs are the lowest from the memory maps. A parameter conversion part converts an access address based on the memory map selected by the memory map selection part. An access control part generates a control signal for performing access to a semiconductor memory based on the converted access address, Thus, it is possible to improve the access efficiency of a semiconductor memory by performing access to the semiconductor memory by using the memory map whose access costs are low. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、メモリコントローラ、画像処理システムおよびメモリアクセスの制御方法に関する。   The present invention relates to a memory controller, an image processing system, and a memory access control method.

動画像データは、情報量が膨大であるためそのまま扱うことは現実的でない。例えば、動画像データは、H.264やMPEG−2(Moving Picture Experts Group-2)などの国際標準規格にしたがって圧縮符号化され、ビットストリームとして扱われる。この種の圧縮符号化では、フレームを構成するマクロブロック毎に動きベクトルが検出され、動きベクトルと前のフレームの画像データである参照画像とから予測画像が生成される。そして、予測画像と圧縮処理対象画像との差分である差分画像データが生成され、圧縮符号化される。圧縮符号化は、マクロブロック単位で行われる。圧縮符号化する前の差分画像データは、再構成画像を生成するために、予測画像データが加算される。参照画像や再構成画像は、フレームデータとしてフレームメモリ等の半導体メモリに保持される。   Since moving image data has an enormous amount of information, it is not realistic to handle it as it is. For example, moving image data is H.264. The data is compressed and encoded in accordance with international standards such as H.264 and MPEG-2 (Moving Picture Experts Group-2) and handled as a bit stream. In this type of compression encoding, a motion vector is detected for each macroblock constituting a frame, and a predicted image is generated from the motion vector and a reference image that is image data of the previous frame. Then, difference image data that is a difference between the predicted image and the compression processing target image is generated and compressed and encoded. Compression encoding is performed on a macroblock basis. The difference image data before compression coding is added with the predicted image data in order to generate a reconstructed image. The reference image and the reconstructed image are held in a semiconductor memory such as a frame memory as frame data.

例えば、動きベクトルの検出では、参照画像が半導体メモリから読み出される。再構成画像は、マクロブロック毎に半導体メモリに書き込まれる。このため、符号化処理における半導体メモリのアクセス頻度は高い。復号処理においても同様に、半導体メモリのアクセス頻度は高い。   For example, in detecting a motion vector, a reference image is read from a semiconductor memory. The reconstructed image is written into the semiconductor memory for each macroblock. For this reason, the access frequency of the semiconductor memory in the encoding process is high. Similarly, in the decoding process, the access frequency of the semiconductor memory is high.

半導体メモリへのアクセス頻度を減らすために、符号化処理部内にバッファメモリを設け、バッファメモリに保持されていない画素データのみを半導体メモリから読み出す手法が提案されている(例えば、特許文献1−2参照。)。また、動き量の検出を複数階層の画像データを用いて動き量を検出することにより、動き量の検出精度を向上する手法が提案されている(例えば、特許文献3参照。)。半導体記憶装置において、複数の行のメモリセルを同時に選択することで、アクセス効率を向上する手法が提案されている(例えば、特許文献4参照。)さらに、画像データを縮小した縮小画像の動きベクトルを用いて、元の画像の動きベクトルを検出する手法が提案されている(例えば、特許文献5参照。)。   In order to reduce the access frequency to the semiconductor memory, a method has been proposed in which a buffer memory is provided in the encoding processing unit, and only pixel data not held in the buffer memory is read from the semiconductor memory (for example, Patent Document 1-2). reference.). In addition, there has been proposed a technique for improving the detection accuracy of the motion amount by detecting the motion amount using image data of a plurality of hierarchies (see, for example, Patent Document 3). In a semiconductor memory device, a method for improving access efficiency by simultaneously selecting memory cells in a plurality of rows has been proposed (see, for example, Patent Document 4). Further, a motion vector of a reduced image obtained by reducing image data. A method for detecting a motion vector of an original image using the method has been proposed (for example, see Patent Document 5).

特開2008−271292号公報JP 2008-271292 A 特開2006−340139号公報JP 2006-340139 A 特開平7−222169号公報Japanese Patent Laid-Open No. 7-222169 特開2001−312885号公報JP 2001-312885 A 特開2004−193906号公報JP 2004-193906 A

フレームメモリとして使用されるDRAM等の半導体メモリは、ロウアドレスにより選択される複数のページを有している。各ページは、コラムアドレスにより選択される複数の記憶領域を有している。半導体メモリは、予め割り当てられたメモリマップにしたがってアクセスされる。一般に、半導体メモリのメモリマップは、各フレーム画像を表示するときに使用される、いわゆる水平アクセス時にアクセス効率がよくなるように割り当てられている。しかし、このメモリマップは、符号化処理および復号処理において使用される、いわゆる矩形アクセス時にアクセス効率がよくなるわけではない。   A semiconductor memory such as a DRAM used as a frame memory has a plurality of pages selected by row addresses. Each page has a plurality of storage areas selected by column addresses. The semiconductor memory is accessed according to a memory map assigned in advance. In general, a memory map of a semiconductor memory is assigned so as to improve access efficiency at the time of so-called horizontal access used when displaying each frame image. However, this memory map does not improve the access efficiency at the time of so-called rectangular access used in the encoding process and the decoding process.

例えば、動きベクトルの検出に使用する矩形形状の参照画像が、1つのページ内に保持されているとき、アクセス効率は高くなる。一方、参照画像が複数のページにまたがって保持されているとき、アクセス効率は低くなる。参照画像が1つのページ内に保持されていても、参照画像の記憶領域がコラムアドレスの境界に沿っていない場合、アクセス効率は低くなる。   For example, when a rectangular reference image used for motion vector detection is held in one page, the access efficiency is high. On the other hand, when the reference image is held across a plurality of pages, the access efficiency is lowered. Even if the reference image is held in one page, the access efficiency is low if the storage area of the reference image is not along the boundary of the column address.

本発明の目的は、画像データを読み書きする半導体メモリのアクセス効率を向上することにある。   An object of the present invention is to improve the access efficiency of a semiconductor memory that reads and writes image data.

本発明の一形態における半導体メモリに読み出しアクセスもしくは書き込みアクセスするメモリコントローラは、読み出しアクセスおよび書き込みアクセスの少なくともいずれかに必要なサイクル数をアクセスコストとして複数のメモリマップ毎に計算するアクセスコスト計算部と、メモリマップの中からアクセスコストが最も低いメモリマップを選択するメモリマップ選択部と、メモリマップ選択部が選択したメモリマップに基づいて、アクセスアドレスを変換するパラメータ変換部と、変換されたアクセスアドレスに基づいて半導体メモリにアクセスするための制御信号を生成するアクセス制御部とを有している。   A memory controller that performs read access or write access to a semiconductor memory according to an embodiment of the present invention includes an access cost calculation unit that calculates the number of cycles required for at least one of read access and write access as an access cost for each of a plurality of memory maps. A memory map selection unit that selects a memory map having the lowest access cost from the memory map, a parameter conversion unit that converts an access address based on the memory map selected by the memory map selection unit, and a converted access address And an access control unit that generates a control signal for accessing the semiconductor memory.

アクセスコストの低いメモリマップを用いて半導体メモリにアクセスすることで、半導体メモリのアクセス効率を向上できる。   Access efficiency of the semiconductor memory can be improved by accessing the semiconductor memory using a memory map with a low access cost.

一実施形態におけるメモリコントローラの例を示している。2 illustrates an example of a memory controller in one embodiment. 別の実施形態における画像処理システムの例を示している。The example of the image processing system in another embodiment is shown. 図2に示したDRAMの内部構成の例を示している。3 shows an example of the internal configuration of the DRAM shown in FIG. 図3に示したDRAMの水平アクセスの例を示している。An example of horizontal access of the DRAM shown in FIG. 3 is shown. 図3に示したDRAMの矩形アクセスの例を示している。An example of rectangular access of the DRAM shown in FIG. 3 is shown. 図3に示したDRAMの矩形アクセスの別の例を示している。4 shows another example of rectangular access of the DRAM shown in FIG. 図3に示したDRAMの矩形アクセスの別の例を示している。4 shows another example of rectangular access of the DRAM shown in FIG. 図2に示したメモリマップ選択部により選択されるメモリマップの例を示している。3 shows an example of a memory map selected by a memory map selection unit shown in FIG. 図2に示したメモリマップ選択部により選択されるメモリマップの別の例を示している。3 shows another example of a memory map selected by the memory map selection unit shown in FIG. 図2に示したメモリマップ選択部により選択されるメモリマップの別の例を示している。3 shows another example of a memory map selected by the memory map selection unit shown in FIG. 図2に示したメモリマップ選択部により選択されるメモリマップの別の例を示している。3 shows another example of a memory map selected by the memory map selection unit shown in FIG. 図2に示した動画像処理部内の符号化処理回路の例を示している。3 illustrates an example of an encoding processing circuit in the moving image processing unit illustrated in FIG. 2. 図2に示した動画像処理部内の復号処理回路の例を示している。3 illustrates an example of a decoding processing circuit in the moving image processing unit illustrated in FIG. 2. 図2に示した画像処理システムによる動画像の撮影、再生動作の例を示している。3 shows an example of moving image shooting and playback operations by the image processing system shown in FIG. 図2に示した画像処理システムによる動画像の撮影、再生動作の別の例を示している。FIG. 4 shows another example of moving image shooting and reproduction operations by the image processing system shown in FIG. 2. FIG. 図2に示した画像処理システムによる動画像の撮影、再生動作の別の例を示している。FIG. 4 shows another example of moving image shooting and reproduction operations by the image processing system shown in FIG. 2. FIG. 図12に示した符号化処理回路による動きベクトルの検出の例を示している。13 shows an example of motion vector detection by the encoding processing circuit shown in FIG. 図13に示した復号処理回路の動作の例を示している。14 shows an example of the operation of the decoding processing circuit shown in FIG. 図2に示した画像処理システムの動作の例を示している。3 shows an example of the operation of the image processing system shown in FIG. 図2に示したメモリマップ保存メモリの状態変化の例を示している。An example of a state change of the memory map storage memory shown in FIG. 2 is shown. 図2に示した画像処理システムの動作タイミングの例を示している。3 shows an example of operation timing of the image processing system shown in FIG. 別の実施形態における画像処理システムの例を示している。The example of the image processing system in another embodiment is shown. 図22に示した動画像処理部の動作の例を示している。The example of operation | movement of the moving image process part shown in FIG. 22 is shown. 図22に示した画像処理システムの動作の例を示している。23 shows an example of the operation of the image processing system shown in FIG. 図22に示した画像処理システムの動作タイミングの例を示している。The example of the operation | movement timing of the image processing system shown in FIG. 22 is shown. 画像処理システムの別の例を示している。3 shows another example of an image processing system. 画像処理システムの別の例を示している。3 shows another example of an image processing system.

以下、図面を用いて本発明の実施形態を説明する。但し、本発明の技術的範囲はこれらの実施形態に限定されず、特許請求の範囲に記載された事項とその均等物まで及ぶものである。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the technical scope of the present invention is not limited to these embodiments, but extends to the matters described in the claims and equivalents thereof.

図1は、一実施形態におけるメモリコントローラの例を示している。例えば、メモリコントローラは、DRAM等の半導体メモリに読み出しアクセスもしくは書き込みアクセスするために、アクセスコスト計算部、メモリマップ選択部、パラメータ変換部およびアクセス制御部を有している。アクセスコスト計算部は、DRAMにアクセスするために必要なアクセス情報を受ける。アクセス情報は、メモリコントローラに供給されるアクセス要求AREQに含まれる。アクセスコスト計算部は、読み出しアクセスおよび書き込みアクセスの少なくともいずれかに必要なサイクル数をアクセスコストとして複数のメモリマップMAP(この例では、MAP1−3)毎に計算する。アクセスコスト計算部は、メモリマップMAP毎に求めたアクセスコストACSTを出力する。   FIG. 1 shows an example of a memory controller in one embodiment. For example, the memory controller includes an access cost calculation unit, a memory map selection unit, a parameter conversion unit, and an access control unit in order to perform read access or write access to a semiconductor memory such as a DRAM. The access cost calculation unit receives access information necessary for accessing the DRAM. The access information is included in the access request AREQ supplied to the memory controller. The access cost calculation unit calculates the number of cycles required for at least one of read access and write access as the access cost for each of the plurality of memory maps MAP (MAP1-3 in this example). The access cost calculation unit outputs the access cost ACST obtained for each memory map MAP.

メモリマップ選択部は、メモリマップMAP1−3の中からアクセスコストが最も低いメモリマップMAPを選択する。パラメータ変換部は、メモリマップ選択部が選択したメモリマップMAPに基づいて、アクセスアドレスを変換し、アクセスパラメータAPRMの一部として出力する。アクセスアドレスは、メモリコントローラに供給されるアクセス要求AREQに含まれる。例えば、パラメータ変換部は、過去のフレームに対して計算されたアクセスコストに基づいて選択されたメモリマップMAPを使用して、現在のフレームデータをアクセスするためにアクセスアドレスを変換する。あるいは、パラメータ変換部は、将来発生するフレームに対して予め計算されたアクセスコストに基づいて選択されたメモリマップMAPを使用して、対応するフレームデータをアクセスするためにアクセスアドレスを変換する。   The memory map selection unit selects the memory map MAP having the lowest access cost from the memory maps MAP1-3. The parameter conversion unit converts the access address based on the memory map MAP selected by the memory map selection unit, and outputs it as a part of the access parameter APRM. The access address is included in the access request AREQ supplied to the memory controller. For example, the parameter conversion unit converts the access address to access the current frame data using the memory map MAP selected based on the access cost calculated for the past frame. Alternatively, the parameter conversion unit converts an access address to access corresponding frame data using a memory map MAP selected based on an access cost calculated in advance for a frame that will occur in the future.

アクセス制御部は、変換されたアクセスアドレスに基づいてDRAMにアクセスするための制御信号CNTを生成する。制御信号CNTは、コマンドCOM、バンクアドレスBA、ロウアドレスRA、コラムアドレスCAなどのDRAMにアクセス動作(リード動作またはライト動作)を実行させるための情報を含む。DRAMは、リードアクセスされるとき、リードデータをデータ端子DQから出力する。DRAMは、ライトアクセスされるとき、ライトデータをデータ端子DQで受ける。   The access control unit generates a control signal CNT for accessing the DRAM based on the converted access address. The control signal CNT includes information for causing the DRAM to perform an access operation (read operation or write operation) such as a command COM, a bank address BA, a row address RA, and a column address CA. When the DRAM is read-accessed, the DRAM outputs read data from the data terminal DQ. When the DRAM is write-accessed, it receives write data at the data terminal DQ.

以上より、ライトデータは、最もアクセス効率が高いメモリマップを用いてDRAMに書き込むことができる。リードデータも、最もアクセス効率が高いメモリマップを用いてDRAMから読み出すことができる。このように、アクセスコストの低いメモリマップを用いてDRAMにアクセスすることで、DRAMのアクセス効率を向上できる。   As described above, the write data can be written into the DRAM using the memory map having the highest access efficiency. Read data can also be read from the DRAM using a memory map with the highest access efficiency. In this way, access efficiency of the DRAM can be improved by accessing the DRAM using a memory map having a low access cost.

図2は、別の実施形態における画像処理システムSYSの例を示している。上述した実施形態で説明した要素と同一の要素については、同一の符号を付し、これ等については、詳細な説明を省略する。例えば、図2に示した画像処理システムSYSは、デジタルビデオカメラの一部を示している。なお、画像処理システムSYSは、画像データの符号化機能および画像データの復号機能の少なくともいずれかを実現するために、携帯電話、デジタルスチルカメラ、ビデオレコーダ、ビデオプレーヤなどに適用されてもよい。ここで、画像データは、1フレーム(1画面)を表示するためのデータ、または1フレーム内に含まれる複数のマクロブロックのデータを示す。動画像は、複数フレームの画像データを順次に再生することで生成される。   FIG. 2 shows an example of an image processing system SYS in another embodiment. The same elements as those described in the above-described embodiment are denoted by the same reference numerals, and detailed description thereof will be omitted. For example, the image processing system SYS shown in FIG. 2 shows a part of a digital video camera. The image processing system SYS may be applied to a mobile phone, a digital still camera, a video recorder, a video player, and the like in order to realize at least one of an image data encoding function and an image data decoding function. Here, the image data indicates data for displaying one frame (one screen) or data of a plurality of macroblocks included in one frame. A moving image is generated by sequentially reproducing a plurality of frames of image data.

画像処理システムSYSは、例えば、メモリコントローラ100、動画像処理部200、カメラモジュール300、DRAM400および蓄積部500を有する。メモリコントローラ100は、調停部10、アクセスコスト計算部12、アクセスコスト保存メモリ14、メモリマップ選択部16、メモリマップ保存メモリ18、パラメータ変換部20、アクセス制御部22、入力切替部24、出力切替部28および書き込みバッファ26を有する。   The image processing system SYS includes, for example, a memory controller 100, a moving image processing unit 200, a camera module 300, a DRAM 400, and a storage unit 500. The memory controller 100 includes an arbitration unit 10, an access cost calculation unit 12, an access cost storage memory 14, a memory map selection unit 16, a memory map storage memory 18, a parameter conversion unit 20, an access control unit 22, an input switching unit 24, and an output switching. A unit 28 and a write buffer 26.

動画像処理部200は、符号化処理回路210および復号処理回路240を有する。符号化処理回路210は、カメラモジュール300で撮影されDRAM400に保持されている画像データを、マクロブロック単位でDRAM400のデータ端子DQからリードデータRDD0として読み出す。符号化処理回路210は、H.264やMPEG−2(Moving Picture Experts Group-2)などの圧縮符号化規格にしたがって圧縮符号化処理を行い、ビットストリームを生成する。符号化処理回路210は、1マクロブロックの圧縮符号化が完了したら、次のマクロブロックの画像データをDRAM400から読み出し、圧縮符号化を行う。以降、符号化処理回路210は、フレームに含まれるすべてのマクロブロックに対して圧縮符号化を行う。生成されたビットストリームは、ライトデータWRD0として入力切替部24を介してDRAM400に書き込まれる。なお、ビットストリームは、蓄積部500に書き込まれてもよい。入力切替部24は、調停部10が調停信号ARBS0を出力しているときに、ライトデータWRD0を選択し、書き込みバッファ26に出力する。入力切替部24は、調停部10が調停信号ARBS1を出力しているときに、ライトデータWRD1を選択し、書き込みバッファ26に出力する。   The moving image processing unit 200 includes an encoding processing circuit 210 and a decoding processing circuit 240. The encoding processing circuit 210 reads image data captured by the camera module 300 and held in the DRAM 400 from the data terminal DQ of the DRAM 400 as read data RDD0 in units of macroblocks. The encoding processing circuit 210 is an H.264 signal. A bit stream is generated by performing compression coding processing according to a compression coding standard such as H.264 or MPEG-2 (Moving Picture Experts Group-2). When the compression encoding of one macro block is completed, the encoding processing circuit 210 reads the image data of the next macro block from the DRAM 400 and performs compression encoding. Thereafter, the encoding processing circuit 210 performs compression encoding on all macroblocks included in the frame. The generated bit stream is written into the DRAM 400 via the input switching unit 24 as write data WRD0. Note that the bitstream may be written in the storage unit 500. The input switching unit 24 selects the write data WRD0 and outputs it to the write buffer 26 when the arbitrating unit 10 outputs the arbitration signal ARBS0. The input switching unit 24 selects the write data WRD1 and outputs it to the write buffer 26 when the arbitration unit 10 outputs the arbitration signal ARBS1.

動画像処理部200は、1マクロブロックの圧縮符号化処理毎に、メモリコントローラ100に複数のアクセス要求AREQ0を出力する。例えば、圧縮符号化対象フレームのマクロブロックの読み出しのためのリードアクセスが行われ、図12に示す動き補償部226、動き検出部228が使用する参照画像のリードアクセスが行われる。また、デブロッキングフィルタ部222が出力する再構成画像のライトアクセスが行われる。動画像処理部200は、1フレームの画像データの処理を開始するときに、メモリコントローラ100にフレーム同期信号SYSCを出力する。   The moving image processing unit 200 outputs a plurality of access requests AREQ0 to the memory controller 100 for each compression encoding process of one macroblock. For example, read access for reading a macroblock of a compression encoding target frame is performed, and read access of a reference image used by the motion compensation unit 226 and the motion detection unit 228 shown in FIG. 12 is performed. Further, a write access of the reconstructed image output from the deblocking filter unit 222 is performed. The moving image processing unit 200 outputs a frame synchronization signal SYSC to the memory controller 100 when starting processing of one frame of image data.

カメラモジュール300は、動画像を撮影する撮像素子を含む。カメラモジュール300は、撮影した動画像のデータWRD1をDRAM400に書き込むために入力切替部24に出力する。また、カメラモジュール300は、DRAM400内の画像データRDD1を出力切替部28を介して受け、液晶ディスプレイLCD等の表示デバイスに表示する。蓄積部500は、DVDメディアやブルーレイメディアなどの記録ディスクと、ディスクドライブ装置を含む。あるいは、蓄積部500は、ハードディスクドライブ装置またはフラッシュメモリである。復号処理回路240は、DRAM400あるいは蓄積部500内のビットストリームを復号し、画像データを生成する。   The camera module 300 includes an image sensor that captures a moving image. The camera module 300 outputs the captured moving image data WRD1 to the input switching unit 24 in order to write it into the DRAM 400. The camera module 300 receives the image data RDD1 in the DRAM 400 via the output switching unit 28 and displays it on a display device such as a liquid crystal display LCD. The storage unit 500 includes a recording disk such as a DVD medium or a Blu-ray medium, and a disk drive device. Alternatively, the storage unit 500 is a hard disk drive device or a flash memory. The decoding processing circuit 240 decodes the bit stream in the DRAM 400 or the storage unit 500 to generate image data.

メモリコントローラ100は、動画像処理部200およびカメラモジュール300からのアクセス要求AREQ0−1に応じてDRAM400にアクセスするためのアクセス制御信号CNTを生成する。アクセス要求AREQ0は、リードライト種別RW0、アクセス座標XY0、アクセスサイズSIZE0(横方向サイズXSIZEおよび縦方向サイズYSIZE)、アクセスフレーム番号FNO0を含む。アクセス要求AREQ1は、リードライト種別RW1、アクセス座標XY1、アクセスサイズSIZE1(横方向サイズXSIZEおよび縦方向サイズYSIZE)、アクセスフレーム番号FNO1を含む。   The memory controller 100 generates an access control signal CNT for accessing the DRAM 400 in response to an access request AREQ0-1 from the moving image processing unit 200 and the camera module 300. The access request AREQ0 includes a read / write type RW0, an access coordinate XY0, an access size SIZE0 (horizontal size XSIZE and vertical size YSIZE), and an access frame number FNO0. The access request AREQ1 includes a read / write type RW1, an access coordinate XY1, an access size SIZE1 (horizontal size XSIZE and vertical size YSIZE), and an access frame number FNO1.

アクセス要求AREQ0を受けた調停部10は、アクセス要求AREQ0の受け付けを示す調停信号ARBS0を動画像処理部200に出力する。但し、調停部10は、カメラモジュール300からのアクセス要求AREQ1に応答する処理を実施しているとき、調停信号ARBS0の出力を、アクセス要求AREQ1に応答する処理が完了するまで保留する。同様に、アクセス要求AREQ1を受けた調停部10は、アクセス要求AREQ1の受け付けを示す調停信号ARBS1をカメラモジュール300に出力する。但し、調停部10は、動画像処理部200からのアクセス要求AREQ0に応答する処理を実施しているとき、調停信号ARBS1の出力を、アクセス要求AREQ0に応答する処理が完了するまで保留する。調停部10は、アクセス要求AREQ0またはAREQ1に含まれる情報をアクセスパラメータAPRM0としてアクセスコスト計算部12およびパラメータ変換部20に出力する。   Upon receiving the access request AREQ0, the arbitration unit 10 outputs an arbitration signal ARBS0 indicating acceptance of the access request AREQ0 to the moving image processing unit 200. However, when executing the process in response to the access request AREQ1 from the camera module 300, the arbitration unit 10 holds the output of the arbitration signal ARBS0 until the process in response to the access request AREQ1 is completed. Similarly, the arbitration unit 10 that has received the access request AREQ1 outputs an arbitration signal ARBS1 indicating acceptance of the access request AREQ1 to the camera module 300. However, when the arbitration unit 10 is executing a process in response to the access request AREQ0 from the moving image processing unit 200, the arbitration unit 10 holds the output of the arbitration signal ARBS1 until the process in response to the access request AREQ0 is completed. The arbitration unit 10 outputs the information included in the access request AREQ0 or AREQ1 to the access cost calculation unit 12 and the parameter conversion unit 20 as the access parameter APRM0.

パラメータ変換部20は、アクセスパラメータAPRM0に含まれるアクセスフレーム番号FNO(FNO0またはFNO1)に対応するメモリマップを示すマップ情報MINFをメモリマップ保存メモリ18から読み出す。パラメータ変換部20は、アクセスパラメータAPRM0に含まれるアクセス座標XY(XY0またはXY1)を、読み出したマップ情報MINFに対応するアクセス座標XY’に変換する。パラメータ変換部20は、変換したアクセス座標XY’をアクセスサイズSIZE(SIZE0またはSIZE1)およびアクセスフレーム番号FNOとともにアクセスパラメータAPRM1としてアクセス制御部22に出力する。これにより、DRAM400は、動画像処理部200およびカメラモジュール300から出力されるアクセス座標XYではなく、パラメータ変換部20により変換されたアクセス座標XY’を用いてアクセスされる。   The parameter converter 20 reads map information MINF indicating a memory map corresponding to the access frame number FNO (FNO0 or FNO1) included in the access parameter APRM0 from the memory map storage memory 18. The parameter conversion unit 20 converts the access coordinates XY (XY0 or XY1) included in the access parameter APRM0 into access coordinates XY ′ corresponding to the read map information MINF. The parameter conversion unit 20 outputs the converted access coordinates XY ′ to the access control unit 22 as the access parameter APRM1 together with the access size SIZE (SIZE0 or SIZE1) and the access frame number FNO. Accordingly, the DRAM 400 is accessed using the access coordinates XY ′ converted by the parameter conversion unit 20 instead of the access coordinates XY output from the moving image processing unit 200 and the camera module 300.

アクセス制御部22は、パラメータ変換部20からのアクセス座標XY’、リードライト種別RW(RW0またはRW1)、アクセスサイズSIZE0(またはSIZE1)およびアクセスフレーム番号FNO0(またはFNO1)基づいて、アクセス制御信号CNTをDRAM400に出力する。制御信号CNTは、コマンドCOM、バンクアドレスBA、ロウアドレスRA、コラムアドレスCAなどのDRAM400にアクセス動作(ライト動作またはリード動作)を実行させるための情報を含む。   Based on the access coordinates XY ′, the read / write type RW (RW0 or RW1), the access size SIZE0 (or SIZE1), and the access frame number FNO0 (or FNO1) from the parameter conversion unit 20, the access control unit 22 Is output to the DRAM 400. The control signal CNT includes information for causing the DRAM 400 to perform an access operation (write operation or read operation) such as a command COM, a bank address BA, a row address RA, and a column address CA.

アクセスパラメータARRM1に含まれるリードライト種別RWがリード動作を示す場合、DRAM400内のアクセスフレーム番号FNOに対応する領域から画像データが読み出される。例えば、画像データは、矩形アクセスによりアクセス座標XY’とアクセスサイズSIZE0(またはSIZE1)で指定される矩形領域が読み出され、あるいは、水平アクセスによりフレーム単位で読み出される。読み出された画像データは、リードデータRDDとして出力切替部28に供給される。出力切替部28は、アクセス要求AREQ0に対応してリードデータRDD0を動画像処理部200に出力し、アクセス要求AREQ1に対応してリードデータRDD1をカメラモジュール300に出力する。   When the read / write type RW included in the access parameter ARRM1 indicates a read operation, image data is read from the area corresponding to the access frame number FNO in the DRAM 400. For example, as for the image data, a rectangular area designated by the access coordinates XY ′ and the access size SIZE0 (or SIZE1) is read by rectangular access, or is read by frame unit by horizontal access. The read image data is supplied to the output switching unit 28 as read data RDD. The output switching unit 28 outputs the read data RDD0 to the moving image processing unit 200 in response to the access request AREQ0, and outputs the read data RDD1 to the camera module 300 in response to the access request AREQ1.

一方、アクセスパラメータARRM1に含まれるリードライト種別RWがライト動作を示す場合、書き込みバッファ26は、入力切替部24を介して受けるライトデータWRD(WRD0またはWRD1)を一時保存する。書き込みバッファ26は、保存している書き込みデータWRDを複数の書き込みアクセス毎に生成される制御信号CNTに同期して、ライトデータWRDとしてDRAM400のデータ端子DQに出力する。ライトデータWRDは、次に読み出されるまでにDRAM400に書き込まれていればよい。このため、書き込みバッファ26によりDRAM400への書き込みアクセス頻度を下げることで、アクセス効率が向上する。   On the other hand, when the read / write type RW included in the access parameter ARRM1 indicates a write operation, the write buffer 26 temporarily stores the write data WRD (WRD0 or WRD1) received via the input switching unit 24. The write buffer 26 outputs the stored write data WRD to the data terminal DQ of the DRAM 400 as write data WRD in synchronization with the control signal CNT generated for each of a plurality of write accesses. The write data WRD only needs to be written in the DRAM 400 until the next read. Therefore, the access efficiency is improved by reducing the frequency of write access to the DRAM 400 by the write buffer 26.

一般に、DRAM400等の画像メモリを使用する画像処理システムでは、フレームメモリとしても動作する画像メモリの転送レートは、画面表示動作に必要な表示装置への書き込みレートよりも速く設定される。これにより、水平アクセスにより画像メモリから読み出された画像データを画面に表示している間に、矩形アクセスにより新しいフレームデータを読み書きできる。したがって、フレームデータの作成とフレームデータの出力とをとぎれることなく行うことができる。このように、実際の画像処理システムでは水平アクセスと矩形アクセスとは混在する。   In general, in an image processing system using an image memory such as the DRAM 400, the transfer rate of the image memory that also operates as a frame memory is set faster than the writing rate to the display device necessary for the screen display operation. Thus, new frame data can be read and written by rectangular access while image data read from the image memory by horizontal access is displayed on the screen. Therefore, the creation of frame data and the output of frame data can be performed without interruption. Thus, horizontal access and rectangular access are mixed in an actual image processing system.

アクセスコスト計算部12は、アクセス要求AREQのパラメータに含まれる矩形アクセス領域のアクセス座標XYとアクセスサイズSIZEを受ける。アクセスコスト計算部12は、予め設定されている複数のメモリマップMAPj(例えば、j=1、2、3、4;図8から図11に示すMAP1−4)をそれぞれ用いて、DRAM400にアクセスしたときのアクセスコストを計算する。具体的には、アクセスコスト計算部12は、1フレームを符号化処理、または、復号処理するために必要なデータをDRAM400から読み出すときに必要なアクセスコスト、および書き込むときに必要なアクセスコストの合計値Nj(j=1、2、3、4)を、メモリマップMAP1−4毎に計算する。   The access cost calculation unit 12 receives the access coordinates XY and the access size SIZE of the rectangular access area included in the parameters of the access request AREQ. The access cost calculation unit 12 accesses the DRAM 400 by using a plurality of preset memory maps MAPj (for example, j = 1, 2, 3, 4; MAP1-4 shown in FIGS. 8 to 11). Calculate the access cost when. Specifically, the access cost calculation unit 12 calculates the sum of the access cost required when reading data necessary for encoding or decoding one frame from the DRAM 400 and the access cost required for writing. A value Nj (j = 1, 2, 3, 4) is calculated for each memory map MAP1-4.

特に限定されないが、アクセスコストは、DRAM400のアクセスに必要なクロックサイクル数である。例えば、アクセスコストは、アクティブコマンドの回数やリード/ライトコマンドの回数に基づいて計算してもよい。アクセスコスト計算部12は、メモリマップMAP1−4毎に計算したアクセスコストの合計値N1−4を、フレーム番号FNOに対応させてアクセスコスト保存メモリ14に書き込む。アクセスコスト計算部12の具体的な動作の例は、図19から図21で説明する。   Although not particularly limited, the access cost is the number of clock cycles necessary for accessing the DRAM 400. For example, the access cost may be calculated based on the number of active commands and the number of read / write commands. The access cost calculation unit 12 writes the total access cost value N1-4 calculated for each memory map MAP1-4 in the access cost storage memory 14 in association with the frame number FNO. An example of a specific operation of the access cost calculation unit 12 will be described with reference to FIGS.

メモリマップ選択部16は、フレーム番号FNO0に対応してアクセスコスト保存メモリ14に保持されているアクセスコストの合計値N1−4を読み出す。メモリマップ選択部16は、合計値N1−4に基づいて最小のアクセスコストが得られるメモリマップMAP(MAP1−4のいずれか)を示すマップ情報MINFを、次に処理を行うフレームのメモリマップMAPとして、メモリマップ保存メモリ18に書き込む。   The memory map selection unit 16 reads the total value N1-4 of access costs held in the access cost storage memory 14 corresponding to the frame number FNO0. The memory map selection unit 16 uses the map information MINF indicating the memory map MAP (any one of MAP1-4) for obtaining the minimum access cost based on the total value N1-4, and the memory map MAP of the frame to be processed next. Is written in the memory map storage memory 18.

なお、この実施形態では、アクセスコスト計算部12は、処理対象のフレームのアクセスパラメータAPRM0に基づいてアクセスコストを計算する。このため、求められたアクセスコストに基づいて選択されたメモリマップMAPは、処理対象のフレームのアクセスには使用されない。選択されたメモリマップMAPは、将来の処理対象のフレームのアクセスに使用される。換言すれば、アクセスコスト計算部12は、過去の処理フレームに対してアクセスコストを計算する。そのために、メモリマップ選択部16は、選択したメモリマップMAPを将来の処理対象のフレーム番号に対応させてメモリマップ保存メモリ18に書き込む。   In this embodiment, the access cost calculation unit 12 calculates the access cost based on the access parameter APRM0 of the processing target frame. Therefore, the memory map MAP selected based on the obtained access cost is not used for accessing the processing target frame. The selected memory map MAP is used for accessing a frame to be processed in the future. In other words, the access cost calculation unit 12 calculates an access cost for a past processing frame. For this purpose, the memory map selection unit 16 writes the selected memory map MAP in the memory map storage memory 18 in association with the future processing target frame number.

図3は、図2に示したDRAM400の内部構成の例を示している。例えば、DRAM400は、クロックに同期して動作するSDRAMであり、半導体基板上に集積回路が形成された大容量且つ高速の半導体メモリである。DRAM400は、システムLSI等に搭載されるマクロ(IP)として設計されてもよく、パッケージに封入された半導体メモリ装置として設計されてもよい。DRAM400は、複数のバンクBK(図3では4つのバンクBK0−3)を有している。各バンクBK0−3は、複数のブロックBLKを有し、各ブロックBLKは複数のワード線WLとビット線BLとその交差位置に配置されたメモリセルMCとを有する。メモリセルMCは、ワード線WLにゲートが接続されたMOSトランジスタと、MOSトランジスタに接続されたキャパシタとを有する。   FIG. 3 shows an example of the internal configuration of the DRAM 400 shown in FIG. For example, the DRAM 400 is an SDRAM that operates in synchronization with a clock, and is a large-capacity and high-speed semiconductor memory in which an integrated circuit is formed on a semiconductor substrate. The DRAM 400 may be designed as a macro (IP) mounted on a system LSI or the like, or may be designed as a semiconductor memory device enclosed in a package. The DRAM 400 has a plurality of banks BK (four banks BK0-3 in FIG. 3). Each bank BK0-3 has a plurality of blocks BLK, and each block BLK has a plurality of word lines WL, bit lines BL, and memory cells MC arranged at the intersections thereof. Memory cell MC has a MOS transistor whose gate is connected to word line WL, and a capacitor connected to the MOS transistor.

図3の例では、4つのバンクBK0−3はバンクアドレスBA(BA0−BA3)に対応付けられる。ワード線WLはロウアドレスRA(RA0−RA7)に対応付けられ、ビット線BLはコラムアドレスCA(CA0−CA127)に対応付けられる。バンクアドレスBAによりバンクBK0−3のいずれかが選択される。ロウアドレスRAにより、選択されたバンクBK内のワード線WLのいずれかが選択される。コラムアドレスCAにより、選択されたバンクBK内のビット線が選択される。   In the example of FIG. 3, four banks BK0-3 are associated with bank addresses BA (BA0-BA3). The word line WL is associated with the row address RA (RA0-RA7), and the bit line BL is associated with the column address CA (CA0-CA127). One of the banks BK0-3 is selected by the bank address BA. One of the word lines WL in the selected bank BK is selected by the row address RA. A bit line in the selected bank BK is selected by the column address CA.

バンクアドレスBA、ロウアドレスRA、コラムアドレスCAにより、1回のリードコマンドまたは1回のライトコマンドにより、4バイトBY0−3のデータがアクセスされる。1バイトは8ビットであるので、1回のアクセスで4バイト、つまり4×8=32ビットのデータが、DRAM400のデータ入出力端子DQに関連付けられて、読み出され、あるいは書き込まれる。すなわち、この例では、DRAM400のデータ端子DQは32ビットである。   With the bank address BA, the row address RA, and the column address CA, data of 4 bytes BY0-3 is accessed by one read command or one write command. Since one byte is 8 bits, data of 4 bytes, that is, 4 × 8 = 32 bits, is read or written in association with the data input / output terminal DQ of the DRAM 400 by one access. That is, in this example, the data terminal DQ of the DRAM 400 is 32 bits.

図2に示した画像処理システムSYSにおける表示画像データは、フレーム毎にDRAM400内に記憶される。表示画像データは、各画素の輝度信号Yと色差信号Cb、Crや、各画素のRGB階調信号などのデータで構成され、各信号は例えば8ビット(1バイト)のデータを含む。このように、1画素の情報量が1バイト(8ビット)のとき、一度のアクセスで4画素のデータを入力または出力できる。これにより、DRAM400に対する帯域幅を大きくすることができる。ここで、帯域幅は、単位時間に読み出し、もしくは書き込みできる画素数を意味する
図3に示すメモリマップでは、バンクアドレスBAとロウアドレスRAにより特定されるページ領域PAGEが行列状に配置される。そして、1つのページ領域PAGEは、コラムアドレスCA0−127で特定される128個のメモリ単位領域を有する。各メモリ単位領域は4バイトBY0−3のデータを記憶する。この4バイトBY0−3のデータが、DRAM400の32ビットのデータ入出力端子DQ0−7、DQ8−15、DQ16−23、DQ24−31を経由して入力または出力される。各バイトの8ビットデータは画素の信号データに対応する。
Display image data in the image processing system SYS shown in FIG. 2 is stored in the DRAM 400 for each frame. The display image data includes data such as a luminance signal Y and color difference signals Cb and Cr of each pixel and an RGB gradation signal of each pixel, and each signal includes, for example, 8-bit (1 byte) data. Thus, when the information amount of one pixel is 1 byte (8 bits), data of 4 pixels can be input or output by one access. Thereby, the bandwidth for the DRAM 400 can be increased. Here, the bandwidth means the number of pixels that can be read or written per unit time. In the memory map shown in FIG. 3, page areas PAGE specified by the bank address BA and the row address RA are arranged in a matrix. One page area PAGE has 128 memory unit areas specified by column addresses CA0-127. Each memory unit area stores 4-byte data BY0-3. The 4-byte data BY0-3 is input or output via the 32-bit data input / output terminals DQ0-7, DQ8-15, DQ16-23, and DQ24-31 of the DRAM 400. The 8-bit data of each byte corresponds to the pixel signal data.

図3に示したメモリマップは、複数のバンクBKを有するDRAM400などの画像メモリを高速動作させるのに適している。DRAM400は、バンクアドレスBAとロウアドレスRAとともに与えられるアクティブコマンドACTに応答して、選択されたバンクBK内の選択されたワード線WLを駆動する。そして、DRAM400は、メモリセルMC内のデータをビット線BL上に読み出し、ビット線BLに対応付けられたセンスアンプを活性化してビット線電位を増幅するアクティブ動作を行う。その後、コラムアドレスCAと共に与えられるリードコマンドに応答して、選択されたビット線BLからデータを読み出すリード動作を行う。あるいは、DRAMは、アクティブ動作後に、コラムアドレスCAとライトデータと共に与えられるライトコマンドに応答して、選択されたビット線BLにライトデータを書き込むライト動作を行う。リード動作またはライト動作の後にプリチャージコマンドによるプリチャージ動作が行われ、再度、アクティブ動作、リード動作またはライト動作が行われる。このように、DRAM400では、各バンクが独立してアクティブ動作、リード動作、ライト動作を行うことができる。   The memory map shown in FIG. 3 is suitable for operating an image memory such as a DRAM 400 having a plurality of banks BK at high speed. The DRAM 400 drives the selected word line WL in the selected bank BK in response to the active command ACT given together with the bank address BA and the row address RA. Then, the DRAM 400 reads data in the memory cell MC onto the bit line BL, and performs an active operation of activating the sense amplifier associated with the bit line BL to amplify the bit line potential. Thereafter, in response to a read command given together with the column address CA, a read operation for reading data from the selected bit line BL is performed. Alternatively, the DRAM performs a write operation for writing the write data to the selected bit line BL in response to a write command given together with the column address CA and the write data after the active operation. After the read operation or the write operation, a precharge operation by a precharge command is performed, and the active operation, the read operation, or the write operation is performed again. As described above, in the DRAM 400, each bank can independently perform an active operation, a read operation, and a write operation.

図3のメモリマップによれば、上下左右に隣接するページ領域PAGEには異なるバンクアドレスBA0−3が対応付けられる。すなわち、メモリマップの奇数行にはバンクアドレスBA0−1が交互に配置され、偶数行にはバンクアドレスBA2−3が交互に配置される。さらに、メモリマップのラスタ方向(行方向;図の横方向)に、ロウアドレスRA0−7が2つずつ繰り返しながらインクリメントされる。メモリマップの各行は、4つのロウアドレスRA0−3、RA4−7で折り返されている。   According to the memory map of FIG. 3, different bank addresses BA0-3 are associated with page areas PAGE that are adjacent vertically and horizontally. That is, bank addresses BA0-1 are alternately arranged in odd rows of the memory map, and bank addresses BA2-3 are alternately arranged in even rows. Further, the row address RA0-7 is incremented by two in the raster direction (row direction; horizontal direction in the figure) of the memory map. Each row of the memory map is folded at four row addresses RA0-3 and RA4-7.

このようにフレーム画像上のページ領域PAGEは、DRAM400上において、同一バンクBKのページ領域PGAEがロウ方向とコラム方向のいずれにも隣接しないように割り当てられる。このようなメモリマッピングを採用することで、水平アクセスでは、2つのバンクBKで同時にアクティブ動作とリード動作またはライト動作とを実行させながらアクセスすることができ、アクセス効率を高めることができる。ここで、水平アクセスは、DRAM400等の画像メモリへの代表的なアクセスであり、ページ領域PAGEを行方向に移動して選択するアクセスである。また、垂直方向にアクセスする場合も同様にアクセス効率を高めることができる。なお、図3から図7に示すメモリマップは、DRAM400の動作を分かりやすく説明するための一例であり、実施形態の動作を説明する図8−11に示すメモリマップとは異なる。   As described above, the page area PAGE on the frame image is allocated on the DRAM 400 so that the page area PGAE of the same bank BK is not adjacent in either the row direction or the column direction. By adopting such memory mapping, in the horizontal access, the two banks BK can be accessed while simultaneously executing the active operation and the read operation or the write operation, and the access efficiency can be improved. Here, the horizontal access is a typical access to an image memory such as the DRAM 400, and is an access for moving and selecting the page area PAGE in the row direction. Similarly, the access efficiency can be improved when accessing in the vertical direction. The memory map shown in FIGS. 3 to 7 is an example for explaining the operation of the DRAM 400 in an easy-to-understand manner, and is different from the memory map shown in FIGS. 8-11 for explaining the operation of the embodiment.

図4は、図3に示したDRAM400の水平アクセスの例を示している。水平アクセスは、映像のフレーム画像の入力時および出力時に多く発生するアクセスであり、画像を左上から右下に向けて水平方向(図4の横方向)にアクセスするラスタスキャンに相当する。水平アクセスでは、水平方向にスキャンされるので、隣接するバンクを同時にアクティブさせながら効率的にメモリアクセスを行うことができる。   FIG. 4 shows an example of horizontal access of the DRAM 400 shown in FIG. The horizontal access is an access that frequently occurs when a video frame image is input and output, and corresponds to a raster scan in which the image is accessed in the horizontal direction (the horizontal direction in FIG. 4) from the upper left to the lower right. In horizontal access, scanning is performed in the horizontal direction, so that memory access can be efficiently performed while simultaneously activating adjacent banks.

例えば、図4に黒い太枠で示したメモリ領域のアクセスは、いずれもコラムアドレスCAで選択されるメモリ単位領域(4バイト領域)の境界を越えるアクセスである。前述したとおり、バンクアドレスBAとロウアドレスRAで特定されるページ領域PAGE内は、コラムアドレスCA0−127で選択される複数のメモリ単位領域に区分され、1つのコラムアドレスCAにより4バイトBY0−3のデータが同時にアクセスされる。そのため、水平アクセスでは比較的無駄なくアクセスが行われる。   For example, the access to the memory area indicated by the black thick frame in FIG. 4 is an access that exceeds the boundary of the memory unit area (4-byte area) selected by the column address CA. As described above, the page area PAGE specified by the bank address BA and the row address RA is divided into a plurality of memory unit areas selected by the column addresses CA0-127, and 4 bytes BY0-3 by one column address CA. Are simultaneously accessed. For this reason, the horizontal access is performed with relatively little waste.

具体的には、黒い太枠で示したメモリ領域をアクセスする場合、まず、メモリコントローラ100は、ページ領域BA2/RA5を指定するアクティブコマンドACTを発行する。次に、メモリコントローラ100は、4つのリードコマンドRDをコラムアドレスCA0−3とともに発行する。そして、コラムアドレスCA0−3にそれぞれ対応する4バイトデータBY0−3が連続して入力または出力される。この場合、黒い太枠で示したメモリ領域は、コラムアドレスCA0のバイトBY2−3からコラムアドレスCA3のバイトBY0−1までを含む。このため、コラムアドレスCA0に対応する4バイトの入出力データDQのうち、バイトBY0−1のデータは必要ない。コラムアドレスCA3に対応する4バイトの入出力データDQのうち、バイトBY2−3のデータも必要ない。よって、有効出力データは、12バイト/16バイトである。   Specifically, when accessing a memory area indicated by a black thick frame, first, the memory controller 100 issues an active command ACT that designates the page area BA2 / RA5. Next, the memory controller 100 issues four read commands RD together with the column addresses CA0-3. Then, 4-byte data BY0-3 respectively corresponding to the column addresses CA0-3 are continuously input or output. In this case, the memory area indicated by the black thick frame includes the bytes BY2-3 of the column address CA0 to the bytes BY0-1 of the column address CA3. For this reason, of the 4-byte input / output data DQ corresponding to the column address CA0, the data of the bytes BY0-1 is not necessary. Of the 4-byte input / output data DQ corresponding to the column address CA3, the data of the bytes BY2-3 is not necessary. Therefore, the valid output data is 12 bytes / 16 bytes.

図5は、図3に示したDRAM400の矩形アクセスの例を示している。矩形アクセスは、MPEG2やH.264などの画像の符号化処理と復号処理で多く発生するアクセスで、任意の縦横比の矩形領域内を左上から右下に向けてアクセスする動作に相当する。矩形領域は、MPEG2やH.264の動きベクトル検出対象のマクロブロック領域や参照領域などに対応する。   FIG. 5 shows an example of rectangular access of the DRAM 400 shown in FIG. Rectangle access is MPEG2 or H.264. The access frequently occurs in the encoding process and decoding process of an image such as H.264, and corresponds to an operation in which a rectangular area having an arbitrary aspect ratio is accessed from the upper left to the lower right. The rectangular area is MPEG2 or H.264. H.264 motion vector detection target macroblock regions, reference regions, and the like.

例えば、図5に黒い太枠で示した矩形領域は、いずれもコラムアドレスCAで選択されるメモリ単位領域(4バイト領域)の境界に沿っている。黒い太枠で示したメモリ領域をアクセスする場合、まず、メモリコントローラ100は、ページ領域BA2/RA5を指定するアクティブコマンドACTを発行する。次に、メモリコントローラ100は、4つのリードコマンドRDをコラムアドレスCA6、7、10、11とともに発行する。そして、コラムアドレスCA6、7、10、11にそれぞれ対応する4バイトデータBY0−3が連続して入力または出力される。図5では、アクセスした領域のデータが全て入力または出力されるため、有効出力データは、16バイト/16バイトである。   For example, each rectangular area indicated by a black thick frame in FIG. 5 is along the boundary of the memory unit area (4-byte area) selected by the column address CA. When accessing the memory area indicated by the thick black frame, first, the memory controller 100 issues an active command ACT that designates the page area BA2 / RA5. Next, the memory controller 100 issues four read commands RD together with column addresses CA6, 7, 10, and 11. Then, 4-byte data BY0-3 respectively corresponding to the column addresses CA6, 7, 10, 11 is continuously input or output. In FIG. 5, since all data in the accessed area is input or output, valid output data is 16 bytes / 16 bytes.

このように、矩形アクセスでは、アクセスされる矩形領域の位置を、単一のバンクBKを越えないように設定し、更にバンクBK内のページ領域PAGEを超えないようにすることで、効率的なメモリアクセスを行うことができる。これは、バンクアドレスBAとロウアドレスRAとを指定する1回のアクティブ動作で矩形領域内のデータをアクセスできるためである。   As described above, in the rectangular access, the position of the accessed rectangular area is set so as not to exceed the single bank BK, and further, the page area PAGE in the bank BK is not exceeded. Memory access can be performed. This is because the data in the rectangular area can be accessed by one active operation that designates the bank address BA and the row address RA.

図6は、図3に示したDRAM400の矩形アクセスの別の例を示している。例えば、図6に黒い太枠で示した矩形領域のアクセスは、いずれもコラムアドレスCAで選択されるメモリ単位領域(4バイト領域)の境界を越えるアクセスである。黒い太枠で示したメモリ領域をアクセスする場合、まず、メモリコントローラ100は、ページ領域BA2/RA5を指定するアクティブコマンドACTを発行する。次に、メモリコントローラ100は、6つのリードコマンドRDをコラムアドレスCA0、1、4、5、8、9とともに発行する。そして、コラムアドレスCA0、1、4、5、8、9にそれぞれ対応する4バイトデータBY0−3が連続して入力または出力される。   FIG. 6 shows another example of rectangular access of the DRAM 400 shown in FIG. For example, the access to the rectangular area indicated by the thick black frame in FIG. 6 is an access that exceeds the boundary of the memory unit area (4-byte area) selected by the column address CA. When accessing the memory area indicated by the thick black frame, first, the memory controller 100 issues an active command ACT that designates the page area BA2 / RA5. Next, the memory controller 100 issues six read commands RD together with column addresses CA0, 1, 4, 5, 8, and 9. Then, 4-byte data BY0-3 corresponding to the column addresses CA0, 1, 4, 5, 8, and 9 is continuously input or output.

しかし、黒い太枠で示した矩形領域は、コラムアドレスCAで選択されるメモリ単位領域(4バイト領域)の境界と一致せず、且つ4バイト領域の境界を越えている。このため、各4バイトデータBY0−3のうちの半分は必要のないデータである。つまり、有効出力データは、12バイト/24バイトである。図6は、1つのページ領域PAGEを矩形アクセスするときのワーストケースを示している。   However, the rectangular area indicated by the thick black frame does not coincide with the boundary of the memory unit area (4-byte area) selected by the column address CA and exceeds the boundary of the 4-byte area. For this reason, half of each 4-byte data BY0-3 is unnecessary data. That is, the valid output data is 12 bytes / 24 bytes. FIG. 6 shows the worst case when one page area PAGE is rectangularly accessed.

このように、同じバイト数のデータであっても、矩形アクセスと水平アクセスでは、アクセス効率が異なる場合がある。具体的には、図6の矩形アクセスでは、6回のリードコマンドRDにより24バイトのデータを入力または出力する必要がある。これに対して、図4の水平アクセスでは、4回のリードコマンドRDにより16バイトのデータを入力または出力すれば良い。したがって、1つのコラムアドレスCAで選択される4バイト領域(メモリ単位領域)の境界を越える矩形領域のアクセスでは、実効的な帯域幅が低下する。   Thus, even with the same number of bytes of data, the access efficiency may differ between rectangular access and horizontal access. Specifically, in the rectangular access of FIG. 6, it is necessary to input or output 24 bytes of data by six read commands RD. On the other hand, in the horizontal access of FIG. 4, 16 bytes of data may be input or output by four read commands RD. Therefore, when accessing a rectangular area that exceeds the boundary of a 4-byte area (memory unit area) selected by one column address CA, the effective bandwidth decreases.

図7は、図5に示したDRAMの矩形アクセスの別の例を示している。矩形アクセスは、任意の矩形領域に対するアクセスであるため、矩形領域が隣接するページ領域PAGEの境界を越える場合がある。例えば、図7に黒い太枠で示した矩形領域のアクセスでは、矩形領域は4つの隣接するページ領域BA3/RA2、BA2/RA3、BA1/RA6、BA0/RA7にまたがる16バイト領域である。   FIG. 7 shows another example of rectangular access of the DRAM shown in FIG. Since the rectangular access is an access to an arbitrary rectangular area, the rectangular area may exceed the boundary of adjacent page areas PAGE. For example, in the access of the rectangular area indicated by the thick black frame in FIG. 7, the rectangular area is a 16-byte area extending over four adjacent page areas BA3 / RA2, BA2 / RA3, BA1 / RA6, and BA0 / RA7.

黒い太枠で示したメモリ領域をアクセスする場合、まず、メモリコントローラ100は、ページ領域BA3/RA2、BA2/RA3、BA1/RA6、BA0/RA7についての4回のアクティブコマンドACTを発行する。次に、メモリコントローラ100は、コラムアドレスCA127(BA3)、CA124(BA2)、CA3(BA1)、CA0(BA0)についての4回のリードコマンドRDを発行する。そして、コラムアドレスCA127、124、3、0にそれぞれ対応する4バイトデータBY0−3が連続して入力または出力される。このように、アクセスする矩形領域が隣接するページ領域PAGEを含む場合、異なるバンクBKをアクティブ動作させるために、複数回のアクティブコマンドACTを発行しなければならない。よって、単位時間当たりにアクセスできるデータ量が減り、実効的な帯域幅が狭くなる。   When accessing the memory area indicated by the thick black frame, first, the memory controller 100 issues four active commands ACT for the page areas BA3 / RA2, BA2 / RA3, BA1 / RA6, and BA0 / RA7. Next, the memory controller 100 issues four read commands RD for the column addresses CA127 (BA3), CA124 (BA2), CA3 (BA1), and CA0 (BA0). Then, 4-byte data BY0-3 respectively corresponding to the column addresses CA127, 124, 3, 0 are continuously input or output. As described above, when the rectangular area to be accessed includes the adjacent page area PAGE, the active command ACT must be issued a plurality of times in order to activate different banks BK. Therefore, the amount of data that can be accessed per unit time is reduced, and the effective bandwidth is reduced.

なお、図7に黒い太枠で示した矩形領域が、コラムアドレスCAで選択されるメモリ単位領域(4バイト領域)の途中で区画される場合、図6に示したように、4バイトデータBY0−3の少なくともいずれかは不要なデータになる。この場合、より一層、実効的な帯域の低下を招く。このように、バンクBKをまたぐ矩形アクセスや、矩形領域がデータの入出力単位であるメモリ単位領域をまたぐ矩形アクセスは、画像メモリのアクセス効率の低下を招く。この実施形態では、現状の矩形アクセスを分析し、その後の矩形アクセスにおいて、アクセス効率が低下しないようなメモリマップを選択し、選択したメモリマップにしたがって画像データをDRAM400に書き込む。これにより、画像処理システムSYSにおけるDRAM400のアクセス効率を向上できる。   When the rectangular area indicated by the black thick frame in FIG. 7 is partitioned in the middle of the memory unit area (4-byte area) selected by the column address CA, as shown in FIG. 6, 4-byte data BY0 At least one of −3 is unnecessary data. In this case, the effective bandwidth is further reduced. As described above, the rectangular access straddling the bank BK or the rectangular access straddling the memory unit area where the rectangular area is a data input / output unit causes a reduction in the access efficiency of the image memory. In this embodiment, the current rectangular access is analyzed, a memory map that does not lower the access efficiency in the subsequent rectangular access is selected, and image data is written into the DRAM 400 according to the selected memory map. Thereby, the access efficiency of the DRAM 400 in the image processing system SYS can be improved.

図8は、図2に示したメモリマップ選択部16により選択されるメモリマップの例を示している。図中に太枠で示すメモリマップMAP1は、1画面を表示するための1フレームの画素データを保持する領域を示し、かつ各画素に割り当てられるアドレスとの関係を示している。図8に示すメモリマップMAP1では、例えば、バンクアドレスBA2およびロウアドレスRA495で指定されるページPAGEには、フレームのx座標が0から63、y座標が1072から1087までの画素データが保持される。さらに、このページPAGEのコラムアドレスCA240で指定される領域には、x座標が0から3、y座標が1087で指定される4バイトBY0−3の画素データが保持される。図8中の小さい斜線枠は、アクセス座標XY0((X、Y)=(62、16))、アクセスサイズSIZE((XSIZE、YSIZE)=(8、2))のアクセス領域の例を示す。この場合、左右に隣接するページPAGEをまたぐアクセスとなる。   FIG. 8 shows an example of a memory map selected by the memory map selection unit 16 shown in FIG. A memory map MAP1 indicated by a thick frame in the drawing indicates an area for holding one frame of pixel data for displaying one screen, and indicates a relationship with an address assigned to each pixel. In the memory map MAP1 shown in FIG. 8, for example, the page PAGE specified by the bank address BA2 and the row address RA495 holds pixel data having an x coordinate of 0 to 63 and a y coordinate of 1072 to 1087. . Further, in the area specified by the column address CA240 of this page PAGE, 4-byte BY0-3 pixel data whose x coordinate is 0 to 3 and whose y coordinate is 1087 is held. A small hatched frame in FIG. 8 shows an example of an access area of access coordinates XY0 ((X, Y) = (62, 16)) and access size SIZE ((XSIZE, YSIZE) = (8, 2)). In this case, the access is made across the page PAGE adjacent to the left and right.

図9は、図2に示したメモリマップ選択部16により選択されるメモリマップの別の例を示している。図中に太枠で示すメモリマップMAP2は、1フレームの画素データを保持する領域を示し、かつ各画素に割り当てられるアドレスとの関係を示している。図9に示すメモリマップMAP2は、メモリマップMAP1と比較して、各画素の格納位置がx方向に+32ずれたマッピングとなっている。フレームFLの左端の画素を保持するページ領域PAGEは、x座標が0から31までの32列分の画素データを右側半分のコラムであるCAn(n=16m+8、16m+9、16m+10、・・・、16m+15。ただしm=0、1、2、・・・、15)を使用して保持する。残りの左側半分のコラムでは画素データを保持せず空き領域とする。同様に、フレームの右端の画素を保持するページ領域PAGEは、x座標が1888から1919までの32列分の画素データを左側半分のコラムであるCAn(n=16m、16m+1、16m+2、・・・、16m+7。ただしm=0、1、2、・・・、15)を使用して保持する。残りの右側半分のコラムでは画素データを保持せず空き領域とする。図9中の小さい斜線枠は、アクセス座標XY0((X、Y)=(62、16))、アクセスサイズSIZE((XSIZE、YSIZE)=(8、2))のアクセス領域の例を示す。この場合、1つのページPAGE内でアクセスが完了する。   FIG. 9 shows another example of the memory map selected by the memory map selection unit 16 shown in FIG. A memory map MAP2 indicated by a thick frame in the figure indicates an area for holding one frame of pixel data and indicates a relationship with an address assigned to each pixel. The memory map MAP2 illustrated in FIG. 9 is a mapping in which the storage position of each pixel is shifted by +32 in the x direction as compared with the memory map MAP1. The page region PAGE that holds the leftmost pixel of the frame FL has 32 columns of pixel data from 0 to 31 in the x coordinate, CAn (n = 16m + 8, 16m + 9, 16m + 10,..., 16m + 15 However, hold using m = 0, 1, 2,..., 15). In the remaining left half column, the pixel data is not held and is set as an empty area. Similarly, the page area PAGE that holds the pixel at the right end of the frame has pixel data for 32 columns with x coordinates from 1888 to 1919 as CAn (n = 16 m, 16 m + 1, 16 m + 2,... 16m + 7, where m = 0, 1, 2,. The remaining right half of the column does not hold pixel data and is a free area. A small hatched frame in FIG. 9 shows an example of an access area of access coordinates XY0 ((X, Y) = (62, 16)) and access size SIZE ((XSIZE, YSIZE) = (8, 2)). In this case, access is completed within one page PAGE.

図10は、図2に示したメモリマップ選択部16により選択されるメモリマップの別の例を示している。図中に太枠で示すメモリマップMAP3は、1フレームの画素データを保持する領域を示し、かつ各画素に割り当てられるアドレスとの関係を示している。図10に示すメモリマップMAP3は、メモリマップMAP1と比較して、各画素の格納位置がy方向に+8ずれたマッピングとなっている。フレームFLの上端の画素を保持するページ領域PAGEは、y座標が0から7までの8行分の画素データを下側半分のコラムであるCAn(n=128、129、130、・・・、255)を使用して保持する。残りの上側半分のコラムでは画素データを保持せず空き領域とする。同様に、フレームの下端の画素を保持するページは、y座標が1080から1087までの8行分の画素データを上側半分のコラムであるCAn(n=0、1、2、・・・、127)を使用して保持する。残りの下側半分のコラムでは画素データを保持せず空き領域とする。   FIG. 10 shows another example of the memory map selected by the memory map selection unit 16 shown in FIG. A memory map MAP3 indicated by a thick frame in the drawing shows an area for holding one frame of pixel data, and shows a relationship with an address assigned to each pixel. The memory map MAP3 illustrated in FIG. 10 is a mapping in which the storage position of each pixel is shifted by +8 in the y direction compared to the memory map MAP1. The page area PAGE that holds the pixel at the upper end of the frame FL has pixel data for eight rows with y coordinates from 0 to 7 as the lower half column CAn (n = 128, 129, 130,... 255). The remaining upper half of the column does not hold pixel data and is a free area. Similarly, the page holding the pixel at the lower end of the frame has the pixel data for eight rows with y coordinates from 1080 to 1087, CAn (n = 0, 1, 2,..., 127) as upper half columns. ) To hold. In the remaining lower half of the column, pixel data is not retained and is set as an empty area.

図11は、図2に示したメモリマップ選択部16により選択されるメモリマップの別の例を示している。図中に太枠で示すメモリマップMAP4は、1フレームの画素データを保持する領域を示し、かつ各画素に割り当てられるアドレスとの関係を示している。図11に示すメモリマップMAP4では、バンクアドレスBA2、ロウアドレスRA480で指定されるページPAGEには、フレームのx座標が0から31、y座標が1056から1087までの画素データが保持される。さらに、このページPAGEのコラムアドレスCA248で指定される領域にはx座標が0から3、y座標が1087で指定される4バイトBY0−3の画素データが保持される。   FIG. 11 shows another example of the memory map selected by the memory map selection unit 16 shown in FIG. A memory map MAP4 indicated by a thick frame in the drawing shows an area for holding one frame of pixel data, and shows a relationship with an address assigned to each pixel. In the memory map MAP4 shown in FIG. 11, the page PAGE designated by the bank address BA2 and the row address RA480 holds pixel data having an x coordinate of 0 to 31 and a y coordinate of 1056 to 1087. Further, the area specified by the column address CA248 of this page PAGE holds 4-byte BY0-3 pixel data whose x coordinate is 0 to 3 and whose y coordinate is 1087.

図12は、図2に示した動画像処理部200内の符号化処理回路210の例を示している。符号化処理回路210は、誤差画像生成部212、直交変換・量子化部214、エントロピー符号化部216、逆量子化・逆直交変換部218、再構成画像生成部220、デブロッキングフィルタ部222、画面内予測部224、動き補償部226、動き検出部228および切替部230を有している。この例では、符号化処理回路210は、H.264での動画像符号化処理を行うが、MPEG−2等での動画像符号化処理を行ってもよい。符号化処理回路210は、圧縮処理対象画像を例えば、水平方向16画素、垂直方向16画素からなるマクロブロックごとに、動き検出、動き補償、画面内予測、誤差画像生成、直交変換・量子化、逆量子化・逆直交変換、再構成画像生成、デブロッキング用のフィルタリング、エントロピー符号化を行い、画像データを圧縮符号化したビットストリームを生成する。   FIG. 12 illustrates an example of the encoding processing circuit 210 in the moving image processing unit 200 illustrated in FIG. The encoding processing circuit 210 includes an error image generation unit 212, an orthogonal transform / quantization unit 214, an entropy encoding unit 216, an inverse quantization / inverse orthogonal transform unit 218, a reconstructed image generation unit 220, a deblocking filter unit 222, An in-screen prediction unit 224, a motion compensation unit 226, a motion detection unit 228, and a switching unit 230 are included. In this example, the encoding processing circuit 210 has the H.264 format. The moving image encoding process in H.264 is performed, but the moving image encoding process in MPEG-2 or the like may be performed. The encoding processing circuit 210 performs, for example, motion detection, motion compensation, intra prediction, error image generation, orthogonal transformation / quantization, for each macroblock composed of 16 pixels in the horizontal direction and 16 pixels in the vertical direction. Inverse quantization / inverse orthogonal transformation, reconstructed image generation, filtering for deblocking, and entropy encoding are performed to generate a bit stream obtained by compression encoding image data.

動き検出部228は、符号化処理が完了しているフレームの画像データを参照画像として用いて、処理対象のマクロブロック(現画像)が参照画像内のどの位置に対応するかを検出し動きベクトルとして算出する。動き補償部226は、対象のマクロブロック(現画像)に対応する参照画像内のマクロブロックと動きベクトルとから画面間(フレーム間)での予測画像を生成する。   The motion detection unit 228 uses the image data of the frame for which the encoding process has been completed as a reference image, detects which position in the reference image the macroblock (current image) to be processed corresponds to, and a motion vector Calculate as The motion compensation unit 226 generates a predicted image between screens (between frames) from a macroblock and a motion vector in a reference image corresponding to the target macroblock (current image).

画面内予測部224は、処理対象のマクロブロックを含むフレームにおいて、すでに符号化処理が完了している隣接するマクロブロックの画像データを用いて、処理対象のマクロブロックの画面内での予測画像を生成する。なお、H.264/AVCによる圧縮符号化では、各マクロブロックの予測画像の生成方式として、画面内予測方式と画面間予測方式のいずれかが選択できる。切替部230は、動き補償部226が動作するときに画面間の予測画像を選択し、画面内予測部224が動作するときに画面内の予測画像を選択する。切替部230は、選択した予測画像を誤差画像生成部212および再構成画像生成部220に出力する。   The intra-screen prediction unit 224 uses the image data of the adjacent macroblocks that have already been encoded in the frame including the macroblock to be processed, to calculate the predicted image in the screen of the macroblock to be processed. Generate. H. In compression encoding by H.264 / AVC, either an intra-screen prediction method or an inter-screen prediction method can be selected as a prediction image generation method for each macroblock. The switching unit 230 selects an inter-screen prediction image when the motion compensation unit 226 operates, and selects an intra-screen prediction image when the intra-screen prediction unit 224 operates. The switching unit 230 outputs the selected predicted image to the error image generation unit 212 and the reconstructed image generation unit 220.

誤差画像生成部212は、処理対象のマクロブロック(原画像)と予測画像の差分をとり、誤差画像を生成する。直交変換・量子化部214は、誤差画像を直交変換した後に量子化処理を行い、量子化された変換係数を求める。エントロピー符号化部216は、情報量が圧縮された画像情報であるビットストリームを生成するために、量子化された変換係数を符号化処理する。   The error image generation unit 212 calculates a difference between the macro block (original image) to be processed and the predicted image, and generates an error image. The orthogonal transform / quantization unit 214 performs quantization processing after orthogonally transforming the error image, and obtains a quantized transform coefficient. The entropy encoding unit 216 performs encoding processing on the quantized transform coefficient in order to generate a bit stream that is image information in which the information amount is compressed.

逆量子化・逆直交変換部218は、量子化された変換係数を逆量子化して、逆直交変換し、誤差画像を復元する。再構成画像生成部220は、復元された誤差画像と誤差画像計算部212で用いた予測画像とから、再構成画像を生成する。デブロッキングフィルタ部222は、直交変換・量子化部214と逆量子化・逆直交変換部218での処理によって再構成画像に生じたブロック歪みを減少させる処理を行う。ブロック歪みが減少された再構成画像は、対象フレームの画像データとしてフレームメモリ(DRAM400)に書き込まれる。なお、実際には、参照画像のDRAM400からの読み出しおよび再構成画像のDRAM400への書き込みは、メモリコントローラ100を介して行われる。   The inverse quantization / inverse orthogonal transform unit 218 performs inverse quantization on the quantized transform coefficient, performs inverse orthogonal transform, and restores an error image. The reconstructed image generation unit 220 generates a reconstructed image from the restored error image and the predicted image used by the error image calculation unit 212. The deblocking filter unit 222 performs a process of reducing block distortion generated in the reconstructed image by the processes in the orthogonal transform / quantization unit 214 and the inverse quantization / inverse orthogonal transform unit 218. The reconstructed image with reduced block distortion is written to the frame memory (DRAM 400) as image data of the target frame. In practice, reading of the reference image from the DRAM 400 and writing of the reconstructed image to the DRAM 400 are performed via the memory controller 100.

保存された画像データは、次のフレームの符号化処理に参照画像として使用される。特に限定されないが、DRAM400は、フレームメモリとしても機能する。すなわち、DRAM400は、所定数のフレーム(例えば、15フレーム)の画像データを保持するフレーム画像領域を有する。フレーム画像領域は、図2に示したアクセスコスト計算部12により、アクセス効率の高いメモリマップを選択するために、フレーム毎にアクセスコストが計算される。   The stored image data is used as a reference image for the encoding process of the next frame. Although not particularly limited, the DRAM 400 also functions as a frame memory. That is, the DRAM 400 has a frame image area that holds image data of a predetermined number of frames (for example, 15 frames). In the frame image area, the access cost calculation unit 12 shown in FIG. 2 calculates an access cost for each frame in order to select a memory map with high access efficiency.

図13は、図2に示した動画像処理部200内の復号処理回路240の例を示している。復号処理回路240は、エントロピー復号部242、逆量子化・逆直交変換部244、再構成画像生成部246、デブロッキングフィルタ部248、動き補償部250、画面内予測部252および切替部254を有している。動画像の復号処理は、符号化処理と同様にマクロブロック単位で行われる。1つのマクロブロックの復号では、エントロピー復号、逆量子化・逆直交変換、誤差画像生成、動き補償、画面内予測、デブロッキング用のフィルタリングを行い、ビットストリームから再構成画像が生成される。   FIG. 13 shows an example of the decoding processing circuit 240 in the moving image processing unit 200 shown in FIG. The decoding processing circuit 240 includes an entropy decoding unit 242, an inverse quantization / inverse orthogonal transform unit 244, a reconstructed image generation unit 246, a deblocking filter unit 248, a motion compensation unit 250, an intra-screen prediction unit 252 and a switching unit 254. is doing. The moving image decoding process is performed in units of macroblocks as in the encoding process. In the decoding of one macroblock, entropy decoding, inverse quantization / inverse orthogonal transformation, error image generation, motion compensation, intra prediction, and deblocking filtering are performed, and a reconstructed image is generated from the bitstream.

動き補償部250は、エントロピー復号部242により伸張復号された動き予測情報(動きベクトル)とマクロブロックタイプを受ける。動き補償部250は、動きベクトルで指定される座標をアクセス座標とし、マクロブロックタイプで指定されるブロックサイズをアクセスサイズとするアクセス要求をフレームメモリ(DRAM400)に発行し、処理対象のマクロブロックの予測画像を生成するために必要な参照画像をフレームメモリから受ける。そして、動き補償部250は、受け取った参照画像から画面間の予測画像を生成する。   The motion compensation unit 250 receives the motion prediction information (motion vector) and macroblock type that have been decompressed and decoded by the entropy decoding unit 242. The motion compensation unit 250 issues an access request with the coordinates specified by the motion vector as the access coordinates and the block size specified by the macroblock type as the access size to the frame memory (DRAM 400). A reference image necessary for generating a predicted image is received from the frame memory. Then, the motion compensation unit 250 generates a predicted image between screens from the received reference image.

画面内予測部252は、エントロピー復号部242により伸張復号された画面内予測情報を受ける。画面内予測部252は、処理対象のマクロブロックを含むフレームにおいて、すでに復号処理が完了している隣接するマクロブロックの画像データを受け取る。そして、画面内予測部252は、画面内予測情報と受け取った画像データから画面内の予測画像を生成する。   The intra-screen prediction unit 252 receives the intra-screen prediction information that has been decompressed and decoded by the entropy decoding unit 242. The in-screen prediction unit 252 receives image data of adjacent macroblocks that have already been decoded in a frame including the macroblock to be processed. Then, the intra-screen prediction unit 252 generates an intra-screen prediction image from the intra-screen prediction information and the received image data.

切替部254は、処理対象のマクロブロックの符号化処理が画面内予測方式と画面間予測方式のいずれによって行われたかの情報をエントロピー復号部242から受ける。これ等情報は、ビットストリームに含まれる。画面内予測方式で符号化されているとき、切替部254は、画面内予測部252からの画面内の予測画像を選択する。画面間予測方式で符号化されているとき、切替部254は、動き補償部250からの画面間の予測画像を選択する。切替部254は、選択した予測画像を再構成画像生成部246に出力する。   The switching unit 254 receives, from the entropy decoding unit 242, information on whether the encoding process of the processing target macroblock has been performed by the intra prediction method or the inter prediction method. Such information is included in the bitstream. When encoding is performed using the intra-screen prediction method, the switching unit 254 selects a predicted image within the screen from the intra-screen prediction unit 252. When the encoding is performed using the inter-screen prediction method, the switching unit 254 selects the inter-screen prediction image from the motion compensation unit 250. The switching unit 254 outputs the selected predicted image to the reconstructed image generation unit 246.

エントロピー復号部242は、情報量が圧縮された画像情報であるビットストリームを復号処理し、量子化された変換係数を生成する。逆量子化・逆直交変換部244、再構成画像生成部246およびデブロッキングフィルタ部248の動作は、図12に示した逆量子化・逆直交変換部218、再構成画像生成部220およびデブロッキングフィルタ部222の動作と同じである。デブロッキングフィルタ処理がなされた再構成画像は、フレームメモリ(DRAM400)に書き込まれる。再構成画像は、以降のフレームの復号処理において画面間の予測画像を生成するための参照画像として読み出される。なお、実際には、DRAM400へのアクセス要求は、図2に示したメモリコントローラ100を介して行われる。参照画像のDRAM400からの読み出しおよび再構成画像のDRAM400への書き込みも、メモリコントローラ100を介して行われる。   The entropy decoding unit 242 decodes a bit stream that is image information in which the information amount is compressed, and generates a quantized transform coefficient. The operations of the inverse quantization / inverse orthogonal transform unit 244, the reconstructed image generation unit 246, and the deblocking filter unit 248 are the same as the inverse quantization / inverse orthogonal transform unit 218, the reconstructed image generation unit 220, and the deblocking shown in FIG. The operation is the same as that of the filter unit 222. The reconstructed image that has been subjected to the deblocking filter processing is written into the frame memory (DRAM 400). The reconstructed image is read as a reference image for generating a predicted image between screens in the subsequent frame decoding process. In practice, an access request to the DRAM 400 is made via the memory controller 100 shown in FIG. Reading of the reference image from the DRAM 400 and writing of the reconstructed image to the DRAM 400 are also performed via the memory controller 100.

図14は、図2に示した画像処理システムSYSによる動画像の撮影、再生動作の例を示している。黒い太枠は、各フレームFL(FLt、FLt+1など)において、H.264やMPEG2などの動画像の処理に必要な時間を示している。例えば、30フレーム/秒毎の動画像を処理対象としている場合では、各フレームFLは1/30秒(ほぼ0.033秒)で処理を完了しなければならない。動画の撮影時、カメラモジュールは、1/30秒毎にシャッターSHTを駆動する。   FIG. 14 shows an example of moving image shooting and reproduction operations by the image processing system SYS shown in FIG. The black thick frame indicates the H.264 in each frame FL (FLt, FLt + 1, etc.). The time required for processing a moving image such as H.264 or MPEG2 is shown. For example, when a moving image every 30 frames / second is to be processed, each frame FL must be completed in 1/30 seconds (approximately 0.033 seconds). When shooting a moving image, the camera module drives the shutter SHT every 1/30 seconds.

この例では、撮影時の符号化処理は、処理に必要なメモリアクセスの実効的な帯域が十分確保されているおり、すべてのフレームが1/30秒以内に完了している。符号化された画像データ(ビットストリーム)は、例えば、蓄積メディアSMに書き込まれる。画像データを蓄積メディアSMから読み出し、動画を再生するときの復号処理も、1/30秒以内に完了している。このため、動画を表示装置に表示する表示処理において、全てのフレームが順次に再生される。   In this example, in the encoding process at the time of shooting, an effective bandwidth of memory access necessary for the process is sufficiently secured, and all the frames are completed within 1/30 second. The encoded image data (bit stream) is written in the storage medium SM, for example. The decoding process when reading the image data from the storage medium SM and reproducing the moving image is completed within 1/30 second. For this reason, in the display process for displaying the moving image on the display device, all the frames are sequentially reproduced.

図15は、図2に示した画像処理システムSYSによる動画像の撮影、再生動作の別の例を示している。この例では、撮影時の符号化処理において、フレームFLt+1で実効的な帯域が不足する。帯域不足から、符号化処理は1/30秒で完了しない。このため、フレームFLt+1の処理は、本来はフレームFLt+2の処理が行われているべき時間に継続して行われる。この場合、フレームFLt+2の符号化処理はスキップされる。符号化され、フレームFLt+2が欠落した画像データ(ビットストリーム)は、例えば、蓄積メディアSMに書き込まれる。   FIG. 15 shows another example of moving image shooting and playback operations by the image processing system SYS shown in FIG. In this example, an effective band is insufficient in the frame FLt + 1 in the encoding process at the time of shooting. Due to insufficient bandwidth, the encoding process is not completed in 1/30 seconds. For this reason, the processing of the frame FLt + 1 is continuously performed at the time when the processing of the frame FLt + 2 should be originally performed. In this case, the encoding process of the frame FLt + 2 is skipped. The encoded image data (bit stream) from which the frame FLt + 2 is missing is written, for example, in the storage medium SM.

動画を再生するための復号処理では、フレームFLt+2の画像データが蓄積メディアSM内に存在しない。このため、復号処理では、本来フレームFLt+2を復号処理する時間には何も処理を行わない。動画を表示装置に表示する表示処理では、フレームFL+1が2回再生される。表示再生時間は、フレームFLt+1のみ本来の1/30秒から2/30秒となり、視聴していて違和感が生ずる画像となる。   In the decoding process for reproducing the moving image, the image data of the frame FLt + 2 does not exist in the storage medium SM. For this reason, in the decoding process, no process is originally performed during the time for decoding the frame FLt + 2. In the display process for displaying the moving image on the display device, the frame FL + 1 is reproduced twice. The display / reproduction time is changed from the original 1/30 second to 2/30 second only for the frame FLt + 1, and it becomes an image in which the viewer feels uncomfortable.

図16は、図2に示した画像処理システムSYSによる動画像の撮影、再生動作の別の例を示している。この例では、動画を再生するための復号処理において、フレームFLt+1で実効的な帯域が不足する。帯域不足から、復号処理は1/30秒で完了しない。このため、フレームFLt+1の処理は、本来はフレームFLt+2の処理が行われているべき時間に継続して行われる。この場合、フレームFLt+2以降の復号処理は、順次に遅れる。   FIG. 16 shows another example of moving image shooting and reproduction operations by the image processing system SYS shown in FIG. In this example, in the decoding process for reproducing a moving image, an effective band is insufficient in the frame FLt + 1. Decoding processing is not completed in 1/30 seconds due to insufficient bandwidth. For this reason, the processing of the frame FLt + 1 is continuously performed at the time when the processing of the frame FLt + 2 should be originally performed. In this case, the decoding process after the frame FLt + 2 is sequentially delayed.

動画を表示装置に表示する表示処理では、フレームFLtの表示が完了したときに、フレームFL+1の復号処理が完了していない。このため、フレームFLtが2回再生される。この結果、図15と同様に、表示再生時間は、フレームFLtのみ本来の1/30秒から2/30秒となり、視聴していて違和感が生ずる画像となる。   In the display process for displaying the moving image on the display device, the decoding process for the frame FL + 1 is not completed when the display of the frame FLt is completed. For this reason, the frame FLt is reproduced twice. As a result, as in FIG. 15, the display / reproduction time is changed from the original 1/30 second to 2/30 second only for the frame FLt, and an image that is uncomfortable when viewed is generated.

図17は、図12に示した符号化処理回路210による動きベクトルの検出の例を示している。動画像の符号化処理において、フレームメモリ(DRAM400)との間で最も帯域が必要となるのは動き検出である。動きベクトルの検出では、先ず、参照フレーム中に参照領域を設定する。参照フレームは、既に符号化処理が完了しているフレームの中から自由に設定できる。次に、参照領域の中で処理対象マクロブロックと最も類似している矩形領域を検出する。処理対象マクロブロックの左上の画素から見た検出した矩形領域の左上画素の相対座標が動きベクトルとなる。類似度判定をするために参照領域の画像データが必要となるため、フレームメモリに格納されている参照フレームへの読み出しアクセスが発生する。   FIG. 17 shows an example of motion vector detection by the encoding processing circuit 210 shown in FIG. In the moving image encoding process, motion detection requires the most bandwidth with the frame memory (DRAM 400). In detecting a motion vector, first, a reference area is set in a reference frame. The reference frame can be freely set from frames that have already been encoded. Next, a rectangular area most similar to the processing target macroblock is detected in the reference area. The relative coordinates of the upper left pixel of the detected rectangular area as viewed from the upper left pixel of the processing target macroblock are the motion vector. Since the image data of the reference area is necessary to determine the similarity, a read access to the reference frame stored in the frame memory occurs.

例えば、フレームメモリのアクセス頻度を下げるために、参照領域は、フレームメモリから動き検出部228内に設けられる参照領域用のメモリに取り込まれた後、処理対象のマクロブロックとの類似度を判定の計算のために参照される。図17に示した処理は、処理対象フレームFLt内の全てのマクロブロックについて順次に行われる。   For example, in order to reduce the access frequency of the frame memory, the reference area is fetched from the frame memory to the memory for the reference area provided in the motion detection unit 228, and then the similarity with the macro block to be processed is determined. Referenced for calculation. The processing shown in FIG. 17 is sequentially performed for all the macroblocks in the processing target frame FLt.

例えば、H.264のLevel4.0では、動き検出で出力するベクトルとしてx方向は−2048から+2047.75まで、y方向は−512から+511.75まで符号化可能である。符号化処理した画像の画質の点からは、上述の範囲のすべての座標で類似度を判定し、もっとも類似度の高い座標を算出するのが望ましい。しかし、動き検出処理の演算量、フレームメモリから参照領域をリードするために必要な帯域の点から、フレームメモリからリードする参照領域を制限し、制限した領域の中でもっとも類似した座標を算出する方法が一般的である。   For example, H.M. In Level 4.0 of H.264, the vector output by motion detection can be encoded from -2048 to +2047.75 in the x direction and from -512 to +511.75 in the y direction. From the viewpoint of the image quality of the encoded image, it is desirable to determine the similarity at all the coordinates in the above range and calculate the coordinate with the highest similarity. However, the reference area to be read from the frame memory is limited based on the amount of calculation of the motion detection process and the bandwidth necessary for reading the reference area from the frame memory, and the most similar coordinates are calculated in the limited area. The method is common.

図18は、図13に示した復号処理回路240の動作の例を示している。図18は、エントロピー復号部242で復元された動きベクトルと参照領域のリードアクセスとの関係を示している。参照領域のリードアクセスのサイズは(16画素、16画素)、アクセス座標は動きベクトルが指し示す点(MVx、MVy)となる。ここで、参照領域のメモリマップとメモリアクセスの関係が、図5に示したように同一のページPAGE内となるときに効率的にアクセスできる。参照領域のメモリマップとメモリアクセスの関係が、図6や図7に示したように、ページPAGEの境界やバンクBKの境界をまたぐ場合は、非効率的なアクセスとなる。   FIG. 18 shows an example of the operation of the decoding processing circuit 240 shown in FIG. FIG. 18 shows the relationship between the motion vector restored by the entropy decoding unit 242 and the read access of the reference area. The size of the read access in the reference area is (16 pixels, 16 pixels), and the access coordinates are points (MVx, MVy) indicated by the motion vector. Here, when the relationship between the memory map of the reference area and the memory access is within the same page PAGE as shown in FIG. As shown in FIGS. 6 and 7, when the relationship between the memory map of the reference area and the memory access crosses the page PAGE boundary or the bank BK boundary, the access becomes inefficient.

図19は、図2に示した画像処理システムSYSの動作の例を示している。この例は、カメラモジュール300により撮影された動画のH.264等による符号化処理を示している。時間T1−T4は、各フレームの処理時間を示している。   FIG. 19 shows an example of the operation of the image processing system SYS shown in FIG. In this example, H.264 of a moving image shot by the camera module 300 is shown. The encoding process by H.264 etc. is shown. Times T1 to T4 indicate the processing time of each frame.

例えば、カメラモジュール300は、1フレームの処理時間T1の間に、フレームFLt+s(sは2以上の整数)の画像データ(原画像)をメモリコントローラ100を介してDRAM400に書き込む。処理時間T1の間に、動画像処理部200は、フレームFLt+1のマクロブロックを、符号化するためにDRAM400から読み出す。また、動画像処理部200は、動きベクトルを検出するために、1つ前のフレームFLtの参照画像をDRAM400から読み出す。そして、動画像処理部200は、デブロッキングフィルタ部222が生成した再構成画像をフレームFLt+1の対応するマクロブロックの再構成画像としてDRAM400に書き込む。   For example, the camera module 300 writes the image data (original image) of the frame FLt + s (s is an integer of 2 or more) into the DRAM 400 via the memory controller 100 during the processing time T1 of one frame. During the processing time T1, the moving image processing unit 200 reads the macroblock of the frame FLt + 1 from the DRAM 400 for encoding. In addition, the moving image processing unit 200 reads a reference image of the previous frame FLt from the DRAM 400 in order to detect a motion vector. Then, the moving image processing unit 200 writes the reconstructed image generated by the deblocking filter unit 222 in the DRAM 400 as a reconstructed image of the corresponding macroblock of the frame FLt + 1.

ここで、フレームFLtの画像データは、予め指定されたメモリマップMAP(例えば、MAP1)を用いてカメラモジュールがDRAM400に書き込んでいる。一方、アクセスコスト計算部12は、フレームFLtがメモリマップMAP1、MAP2、MAP3、MAP4のそれぞれで保持されていたと仮定した場合のリードサイクル数Nj(j=0、1、2、3)を計算し、アクセスコスト保存メモリ14に書き込む。   Here, the image data of the frame FLt is written in the DRAM 400 by the camera module using a memory map MAP (for example, MAP1) designated in advance. On the other hand, the access cost calculation unit 12 calculates the number of read cycles Nj (j = 0, 1, 2, 3) when it is assumed that the frame FLt is held in each of the memory maps MAP1, MAP2, MAP3, and MAP4. To the access cost storage memory 14.

メモリマップ選択部16は、Nj(j=0、1、2、3)の値の中で最も小さい値を持つものを判定し、そのメモリマップMAP(この例では、MAP3)を示すマップ情報MINFを、将来のフレームFLt+2がアクセスされるときのメモリマップMAPとしてメモリマップ保存メモリ18に書き込む。パラメータ変換部20は、アクセスするフレームに対応してメモリマップ保存メモリ18で指定されるメモリマップMAPに基づいてアクセス要求AREQに含まれるアクセス座標XYを、実際にDRAM400にアクセスするためのアクセス座標XY’に変換する。   The memory map selection unit 16 determines the one having the smallest value among the values of Nj (j = 0, 1, 2, 3) and maps information MINF indicating the memory map MAP (MAP3 in this example). Are written in the memory map storage memory 18 as the memory map MAP when the future frame FLt + 2 is accessed. The parameter conversion unit 20 uses the access coordinates XY included in the access request AREQ based on the memory map MAP specified by the memory map storage memory 18 corresponding to the frame to be accessed as the access coordinates XY for actually accessing the DRAM 400. Convert to '.

処理時間T2では、フレームFLt+2のマクロブロックが符号化される。FLt+2の原画像データは、あらかじめ指定されたメモリマップMAP(例えば、MAP1)を用いてカメラモジュールがDRAM400に書き込んでいるため、このメモリマップMAPを用いて読み出す。符号化処理後の再構成画像の書き込みは、予め計算されたアクセスコストが最も小さいメモリマップMAP3を用いて行われる。そして、上述と同様に、参照画像として読み出されるフレームFLt+1について、最もアクセスコストが低いメモリマップMAP(この例では、MAP1)が求められる。メモリマップ選択部16は、メモリマップMAP1を示すマップ情報MINFを、処理時間T3でフレームFLt+3の再構成画像が書き込みアクセスされるとき、および処理時間T4で参照画像として読み出しアクセスされるときのメモリマップMAPとしてメモリマップ保存メモリ18に書き込む。これにより、処理時間T3では、フレームFLt+2およびFLt+3を、最もアクセスコストの小さいメモリマップMAPでアクセスできる。以降のフレーム処理でも同様に、最もアクセスコストの小さいメモリマップMAPでアクセスできる。   In the processing time T2, the macro block of the frame FLt + 2 is encoded. The original image data of FLt + 2 is read using the memory map MAP because the camera module has written in the DRAM 400 using a memory map MAP (for example, MAP1) specified in advance. The reconstructed image after the encoding process is written using the memory map MAP3 having the lowest access cost calculated in advance. Similarly to the above, the memory map MAP (MAP1 in this example) having the lowest access cost is obtained for the frame FLt + 1 read as the reference image. The memory map selection unit 16 stores the map information MINF indicating the memory map MAP1 when the reconstructed image of the frame FLt + 3 is written and accessed at the processing time T3 and when it is read and accessed as the reference image at the processing time T4. Write to the memory map storage memory 18 as MAP. Thereby, at the processing time T3, the frames FLt + 2 and FLt + 3 can be accessed with the memory map MAP having the lowest access cost. Similarly, the subsequent frame processing can be accessed with the memory map MAP having the lowest access cost.

なお、アクセスコスト計算部12は、読み出しアクセスのコストだけでなく、書き込みアクセスのコストを計算してもよい。具体的には、アクセスコスト計算部12は、再構成画像を書き込むフレームFLについて、アクセスコストを計算し、アクセスコスト保存メモリ14に書き込んでもよい。すなわち、処理時間T1において、フレームFLt+1の再構成画像書き込みのためのアクセスコストを計算してもよい。この場合、メモリマップ選択部16は、処理時間T2において、フレームFLt+1の読み出しアクセスのアクセスコストと書き込みアクセスのアクセスコストの平均値が最も小さいメモリマップMAPを選択する。選択されたメモリマップMAPは、フレームFLt+3をアクセスするときのメモリマップとして使用される。あるいは、アクセスコスト計算部12は、書き込みアクセスのコストのみを計算してもよい。   Note that the access cost calculation unit 12 may calculate not only the read access cost but also the write access cost. Specifically, the access cost calculation unit 12 may calculate an access cost for the frame FL in which the reconstructed image is written and write it in the access cost storage memory 14. That is, the access cost for writing the reconstructed image of the frame FLt + 1 may be calculated at the processing time T1. In this case, the memory map selection unit 16 selects the memory map MAP having the smallest average value of the access cost for the read access and the write access for the frame FLt + 1 at the processing time T2. The selected memory map MAP is used as a memory map when accessing the frame FLt + 3. Alternatively, the access cost calculation unit 12 may calculate only the cost of write access.

図8および図9に示したメモリマップMAP1−2の斜線枠のアクセスでは、アクセスに必要なサイクル数は次のようになる。図8では、メモリコントローラ100がBA=2、RA=0のアクティブコマンドおよびBA=3、RA=0をDRAM400に出力してから、最後のコラムアドレスCAへのアクセスが完了するまでのn1サイクルである。図9では、メモリコントローラ100がBA=3、RA=0のアクティブコマンドをDRAM400に出力してから、最後のコラムアドレスCAへのアクセスが完了するまでのn2サイクルである。   In accessing the hatched frame of the memory map MAP1-2 shown in FIGS. 8 and 9, the number of cycles required for the access is as follows. In FIG. 8, the memory controller 100 outputs an active command of BA = 2, RA = 0 and BA = 3, RA = 0 to the DRAM 400 until n1 cycle from the completion of access to the last column address CA. is there. In FIG. 9, n2 cycles from when the memory controller 100 outputs the active command of BA = 3 and RA = 0 to the DRAM 400 until the access to the last column address CA is completed.

アクセスコスト計算部12は、メモリマップMAP1〜2でのアクセスサイクル数n1〜2を計算する。同様に、アクセスコスト計算部12は、メモリマップMAP3〜4でのアクセスサイクル数n3〜n4を計算する。算出された各メモリマップMAP1〜4でのアクセスサイクル数n1〜n4は、1フレームFLの処理で発生したすべてのアクセス要求に対して累積加算される。動画像処理部200が1フレームFLの処理を行う間に調停部10にm回のアクセス要求を送信し、i番目のアクセス要求をメモリマップMAP1〜4に対して行った場合のアクセスサイクル数をそれぞれn1(i)、n2(i)、n3(i)、n4(i)とする。メモリマップMAPjでの1フレームの処理で発生したすべてのアクセス要求に必要なサイクル数の合計値NjはNj=nj(1)+nj(2)+・・・+nj(m)となる。ただし、j=1、2、3、4である。   The access cost calculation unit 12 calculates the number of access cycles n1-2 in the memory maps MAP1-2. Similarly, the access cost calculation unit 12 calculates the access cycle numbers n3 to n4 in the memory maps MAP3 to MAP4. The calculated access cycle numbers n1 to n4 in each of the memory maps MAP1 to MAP4 are cumulatively added to all access requests generated in the processing of one frame FL. While the moving image processing unit 200 performs processing of one frame FL, m access requests are transmitted to the arbitration unit 10, and the number of access cycles when the i-th access request is made to the memory maps MAP1 to MAP4. Let n1 (i), n2 (i), n3 (i), and n4 (i), respectively. The total value Nj of the number of cycles required for all access requests generated in the processing of one frame in the memory map MAPj is Nj = nj (1) + nj (2) +... + Nj (m). However, j = 1, 2, 3, and 4.

なお、図13に示した復号処理回路240による復号処理においても、上述と同様に、将来アクセスされるフレームFLについて、アクセスコストが最も小さいメモリマップMAPを指定できる。復号処理時の画像処理システムSYSの動作は、カメラモジュール300の処理がないことと、マクロブロック読み出しがないことを除き、図19と同じである。例えば、フレームFLt+1のビットストリームを復号するとき、1つ前のフレームFLtの参照画像をDRAM400から読み出す。そして、復号されたフレームFLt+1の再構成画像がマクロブロック単位でDRAM400に書き込まれる。アクセスコスト計算部12およびメモリマップ選択部16の動作は、符号化処理時と同じである。   Note that, also in the decoding process by the decoding processing circuit 240 shown in FIG. 13, the memory map MAP having the lowest access cost can be specified for the frame FL to be accessed in the same manner as described above. The operation of the image processing system SYS during the decoding process is the same as that in FIG. 19 except that there is no processing of the camera module 300 and no macroblock reading. For example, when decoding the bit stream of the frame FLt + 1, the reference image of the previous frame FLt is read from the DRAM 400. Then, the reconstructed image of the decoded frame FLt + 1 is written into the DRAM 400 in units of macro blocks. The operations of the access cost calculation unit 12 and the memory map selection unit 16 are the same as in the encoding process.

図20は、図2に示したメモリマップ保存メモリ18の状態変化の例を示している。最初の状態において、動画像処理部200がフレームFLt+1を処理している間、フレームFLtのリードアクセスとフレームFLt+1へのライトアクセスが発生する。このため、メモリマップ保存メモリ18には、フレームFLtとフレームFLt+1の2フレーム分のメモリマップMAP1、4を示す情報が保存されている。フレームFLt+1の処理が完了すると、それ以降の処理でフレームFLtへのアクセスが発生しないので、メモリマップ選択部16はフレームFLtのメモリマップが保存されている領域に、フレームFLt+2のメモリマップMAP3を示す情報を上書きする。   FIG. 20 shows an example of a state change of the memory map storage memory 18 shown in FIG. In the initial state, while the moving image processing unit 200 processes the frame FLt + 1, read access to the frame FLt and write access to the frame FLt + 1 occur. For this reason, the memory map storage memory 18 stores information indicating the memory maps MAP1 and MAP2 for two frames of the frame FLt and the frame FLt + 1. When the processing of the frame FLt + 1 is completed, access to the frame FLt does not occur in the subsequent processing. Therefore, the memory map selection unit 16 indicates the memory map MAP3 of the frame FLt + 2 in the area where the memory map of the frame FLt is stored. Overwrite information.

上記手順によると、フレームFLt+2のメモリマップMAP3は、フレームFLt+1で発生するフレームFLtのリードアクセスに必要なサイクルが最小となるように選択される。このため、動画像処理部200がフレームFLt+2を処理する際に発生するメモリアクセスのサイクル数が最小になるメモリマップを選択することを保証できない。しかし、動画像の処理においては、時間的に近いフレーム間では画像の特徴の相関が高いことが期待できる。したがって、処理の過程で発生するメモリアクセスも非常に似ていることが期待できる。すなわち、フレームFLt+1の処理で発生するメモリアクセスの特徴は、フレームFLt+2の処理で発生するメモリアクセスの特徴およびフレームFLt+3の処理で発生するメモリアクセスの特徴と類似する。このため、本実施形態においてアクセスサイクル数削減の効果は損なわれない。   According to the above procedure, the memory map MAP3 of the frame FLt + 2 is selected so that the cycle necessary for the read access of the frame FLt generated in the frame FLt + 1 is minimized. For this reason, it cannot be guaranteed that the moving image processing unit 200 selects a memory map that minimizes the number of memory access cycles that occur when the frame FLt + 2 is processed. However, in moving image processing, it can be expected that the correlation of image features is high between frames that are close in time. Therefore, it can be expected that the memory access generated in the process is very similar. That is, the characteristics of the memory access that occurs in the process of the frame FLt + 1 are similar to the characteristics of the memory access that occurs in the process of the frame FLt + 2 and the characteristics of the memory access that occur in the process of the frame FLt + 3. For this reason, in this embodiment, the effect of reducing the number of access cycles is not impaired.

図21は、図2に示した画像処理システムSYSの動作タイミングの例を示している。図21では、動画の撮影時の符号化処理時の動作を示している。各フレームの処理を始める前に、動画像処理部200は、アクセスコスト計算部12内に保持されているアクセスコストをリセットするために、同期信号SYNCを出力する(RESET)。カメラモジュール300は、1フレームの処理期間に、撮影した1フレーム分の画像データを、メモリコントローラを介してm回に分けてDRAM400へ書き込む(WR1−WRm)。動画像処理部200は、撮影された画像からストリームデータを生成するために、マクロブロックの符号化処理を行う(CODE1−CODEp)。   FIG. 21 shows an example of the operation timing of the image processing system SYS shown in FIG. FIG. 21 shows an operation at the time of encoding processing when shooting a moving image. Before starting the processing of each frame, the moving image processing unit 200 outputs a synchronization signal SYNC in order to reset the access cost held in the access cost calculation unit 12 (RESET). The camera module 300 writes the captured image data for one frame into the DRAM 400 in m times via the memory controller during the processing period of one frame (WR1-WRm). The moving image processing unit 200 performs a macroblock encoding process (CODE1-CODEp) in order to generate stream data from the captured image.

調停部10は、カメラモジュール300からのアクセスと動画像処理部200からのアクセスを調停する。アクセスコスト計算部12は、パラメータ変換部20からのアクセスパラメータAPRM0に応じて、メモリマップMAP1−4を使用したときのアクセスコストをマクロブロック毎に求め、アクセスコストを累積加算する(CALC)。パラメータ変換部20は、アクセスパラメータAPRM0に含まれるアクセスフレーム番号FLに基づいて、対応するメモリマップMAPの種類をメモリマップ保存メモリ18から読み出す。パラメータ変換部20は、アクセスパラメータAPRM0を、読み出したメモリマップMAPの種類に応じてアクセスパラメータAPRM1に変換し(PCNV)、アクセス制御部22に出力する。   The arbitration unit 10 arbitrates access from the camera module 300 and access from the moving image processing unit 200. The access cost calculation unit 12 obtains an access cost for each macroblock when using the memory map MAP1-4 according to the access parameter APRM0 from the parameter conversion unit 20, and cumulatively adds the access cost (CALC). The parameter conversion unit 20 reads the type of the corresponding memory map MAP from the memory map storage memory 18 based on the access frame number FL included in the access parameter APRM0. The parameter conversion unit 20 converts the access parameter APRM0 into the access parameter APRM1 according to the type of the read memory map MAP (PCNV) and outputs it to the access control unit 22.

次のフレームの処理の最初では、アクセスコスト計算部12は、同期信号SYNCに応答して、前のフレームのアクセスコストをメモリマップMAP毎にアクセスコスト保存メモリ14に出力する(COST)。メモリマップ選択部16は、アクセスコスト保存メモリ14に書き込まれたアクセスコストのうち、最小のコストを示すメモリマップMAPを示すマップ情報MINFを選択する。メモリマップ選択部16は、選択したマップ情報MINFをメモリマップ保存部18に書き込む。これにより、DRAM400のアクセス効率を向上できる。   At the beginning of the processing of the next frame, the access cost calculation unit 12 outputs the access cost of the previous frame to the access cost storage memory 14 for each memory map MAP in response to the synchronization signal SYNC (COST). The memory map selection unit 16 selects map information MINF indicating the memory map MAP indicating the minimum cost among the access costs written in the access cost storage memory 14. The memory map selection unit 16 writes the selected map information MINF into the memory map storage unit 18. Thereby, the access efficiency of the DRAM 400 can be improved.

なお、符号化処理において、すべてのフレームで同一のメモリマップを使用する従来では、メモリアクセスに必要なサイクル数は、すべてのマクロブロックが参照領域としてアライメントがずれた位置を要求した場合に最大(Cworst0)となる。ここで、”アライメントのずれ”は、アクセス領域がメモリ単位領域(4バイト領域)の境界をまたぐ場合、またはアクセス領域がページ領域PAGEの境界をまたぐ場合を意味する。   It should be noted that in the conventional encoding method using the same memory map for all frames, the number of cycles required for memory access is the maximum when all macroblocks require a misaligned position as a reference area ( Cworst0). Here, “alignment deviation” means that the access area crosses the boundary of the memory unit area (4-byte area), or the access area crosses the boundary of the page area PAGE.

一方、2種類のメモリマップMAP1−2を切り替えて使用する場合、メモリマップMAP1においてすべてのマクロブロックでアライメントがずれている場合、メモリマップMAP2を選択することで回避される。メモリマップMAP2においてすべてのマクロブロックでアライメントがずれている場合、メモリマップMAP1を選択することで回避される。このため、メモリマップMAP1−2の両方において、半分のマクロブロックで要求する参照領域のアライメントがずれた場合に、アクセスサイクル数が最大となる。   On the other hand, when switching between the two types of memory maps MAP1-2, if all the macroblocks in the memory map MAP1 are misaligned, this can be avoided by selecting the memory map MAP2. When all the macroblocks in the memory map MAP2 are misaligned, this can be avoided by selecting the memory map MAP1. For this reason, in both of the memory maps MAP1-2, the number of access cycles is maximized when the alignment of the reference areas required by half of the macroblocks is shifted.

したがって、2種類のメモリマップMAP1−2を使用する場合、メモリアクセスの最悪のサイクル数は(Cworst1+Cbest2)/2、もしくは、(Cbest1+Cworst2)/2となる。ここで、Cworst1は、メモリマップMAP1での最悪のアクセスサイクル数である。Cworst2は、メモリマップMAP2での最悪のアクセスサイクル数である。Cbest1は、メモリマップMAP1でアライメントが合っている場合のアクセスサイクル数である。Cbest2は、メモリマップMAP2でアライメントが合っている場合のアクセスサイクル数である。例えば、Cbest2がCworst1の半分であり、仮にCbest2=50サイクル、Cworst1=100サイクルとする。このとき、メモリアクセスの最悪のサイクル数((Cworst1+Cbest2)/2)は、75サイクルになる。すなわち、本実施形態の適用により、アクセスサイクル数を25%削減することができる。4つのメモリマップMAP1−4を選択的に使用することで、アクセスサイクル数をさらに削減できる。   Therefore, when two types of memory maps MAP1-2 are used, the worst cycle number of memory access is (Cworst1 + Cbest2) / 2 or (Cbest1 + Cworst2) / 2. Here, Cworst1 is the worst number of access cycles in the memory map MAP1. Cworst2 is the worst number of access cycles in the memory map MAP2. Cbest1 is the number of access cycles when the alignment is matched in the memory map MAP1. Cbest2 is the number of access cycles when the alignment is matched in the memory map MAP2. For example, Cbest2 is half of Cworst1, and Cbest2 = 50 cycles and Cworst1 = 100 cycles. At this time, the worst cycle number of memory access ((Cworst1 + Cbest2) / 2) is 75 cycles. That is, by applying this embodiment, the number of access cycles can be reduced by 25%. By selectively using the four memory maps MAP1-4, the number of access cycles can be further reduced.

以上、この実施形態においても、上述した実施形態と同様の効果を得ることができる。さらに、動画像を構成する各フレームに対応してメモリマップMAP1−4毎にアクセスコストを計算することで、フレーム単位に最適なアクセス効率を得ることができる。さらに、マクロブロック毎にアクセスコストを計算し、累積加算することで、細かいブロック毎に符号化処理または復号処理が行われる場合にも、アクセス効率の高いメモリマップMAPを平均的に求めることができる。   As described above, also in this embodiment, the same effect as that of the above-described embodiment can be obtained. Furthermore, by calculating the access cost for each memory map MAP1-4 corresponding to each frame constituting the moving image, it is possible to obtain optimum access efficiency for each frame. Furthermore, by calculating the access cost for each macroblock and accumulating, the memory map MAP with high access efficiency can be obtained on average even when encoding processing or decoding processing is performed for each fine block. .

フレーム間での相関が高い動画像の符号化処理または復号処理において、計算したアクセスコストを、将来発生するフレームのメモリマップの選択に使用することで、DRAM400のアクセス効率を向上できる。これにより、画像処理システムSYSの性能を向上できる。具体的には、アクセス効率を向上することで、符号化処理時間および復号処理時間を短縮でき、図15および図16に示した不具合を防止できる。あるいは、アクセス効率を向上することで、低速の画像メモリを採用できる。この結果、消費電力を削減でき、かつシステムコストを削減できる。   The access efficiency of the DRAM 400 can be improved by using the calculated access cost in the selection of a memory map of a frame to be generated in the future in the encoding process or decoding process of a moving image having a high correlation between frames. Thereby, the performance of the image processing system SYS can be improved. Specifically, by improving the access efficiency, the encoding processing time and the decoding processing time can be shortened, and the problems shown in FIGS. 15 and 16 can be prevented. Alternatively, a low-speed image memory can be employed by improving access efficiency. As a result, power consumption can be reduced and system cost can be reduced.

このように、アクセスサイズやアクセス座標が適応的に変更される画像処理において、アクセス効率を高め、アクセスサイクル数を最小限にすることができる。特に、MPEGやH.264の符号化処理、復号処理のように、矩形アクセスが多く発生する装置に適用すると有用である。また、上述したように、最悪の条件下でも必ず25%のアクセスサイクル数の削減を保証できる。   As described above, in the image processing in which the access size and the access coordinates are adaptively changed, the access efficiency can be improved and the number of access cycles can be minimized. In particular, MPEG and H.264. It is useful when applied to an apparatus that frequently generates rectangular accesses, such as H.264 encoding processing and decoding processing. Further, as described above, a reduction in the number of access cycles of 25% can always be guaranteed even under the worst conditions.

図22は、別の実施形態における画像処理システムSYSの例を示している。上述した実施形態で説明した要素と同一の要素については、同一の符号を付し、これ等については、詳細な説明を省略する。この実施形態の画像処理システムSYSは、図2のメモリコントローラ100の代わりにメモリコントローラ100Aを有している。メモリコントローラ100Aは、図2のアクセスコスト計算部12の代わりにアクセスコスト計算部12Aを有している。さらに、画像処理システムSYSは、前処理部600を有している。画像処理システムSYSのその他の構成は、図2と同じである。   FIG. 22 shows an example of an image processing system SYS in another embodiment. The same elements as those described in the above-described embodiment are denoted by the same reference numerals, and detailed description thereof will be omitted. The image processing system SYS of this embodiment has a memory controller 100A instead of the memory controller 100 of FIG. The memory controller 100A has an access cost calculation unit 12A instead of the access cost calculation unit 12 of FIG. Further, the image processing system SYS has a preprocessing unit 600. Other configurations of the image processing system SYS are the same as those in FIG.

前処理部600は、動画像処理部200による符号化処理に先立って、カメラモジュール300で撮影された原画像および参照画像を、ローパスフィルタによる高周波成分の除去と、サブサンプリングによって、もしくはローパスフィルタを用いずサブサンプリングのみによって縮小画像をそれぞれ生成する。ここで、原画像は、ある時刻に撮影された画像であり、参照画像は、ある時刻より前に撮影された画像の一部である。例えば、横1920画素、縦1088画素からなる符号化対象画像を縦1/4、横1/4の縮小率で縮小する場合、縮小画像は、横480画素、縦272画素である。縮小画像において、マクロブロックを構成する画素数は、横4画素、縦4画素となる。縮小画像の縮小率は、縦横1/4以外でもよい。   Prior to the encoding process by the moving image processing unit 200, the preprocessing unit 600 removes high-frequency components by using a low-pass filter and subsampling, or applies a low-pass filter to an original image and a reference image captured by the camera module 300. Reduced images are generated only by sub-sampling without using them. Here, the original image is an image taken at a certain time, and the reference image is a part of an image taken before the certain time. For example, when an encoding target image composed of 1920 pixels in the horizontal direction and 1088 pixels in the vertical direction is reduced at a reduction ratio of 1/4 in the vertical direction and 1/4 in the horizontal direction, the reduced image has 480 pixels in the horizontal direction and 272 pixels in the vertical direction. In the reduced image, the number of pixels constituting the macroblock is 4 horizontal pixels and 4 vertical pixels. The reduction ratio of the reduced image may be other than 1/4 in the vertical and horizontal directions.

前処理部600は、縮小した原画像と縮小した参照画像の間で動き検出を行い、縮小動きベクトルを求める。この例では、元々の画像の解像度に対して、縮小率をx方向1/4、y方向1/4とする。このため、縮小画像での動きベクトル検出により、元々の画像での動き検出処理の対象となる参照領域をx方向7画素(縮小動きベクトルのx成分を中心とした±3の範囲)、y方向7画素(縮小動きベクトルのy成分を中心とした±3の範囲)まで限定することができる。このように動きベクトルの検出を階層的に行うことにより、広い参照領域で動きベクトルを探索しつつも、演算量と帯域の大幅な削減が可能となる。なお、縮小画像のマクロブロックの動き検出処理は、扱う画素数が異なることを除き、図17と同じである。   The preprocessing unit 600 performs motion detection between the reduced original image and the reduced reference image to obtain a reduced motion vector. In this example, the reduction ratio is 1/4 in the x direction and 1/4 in the y direction with respect to the resolution of the original image. For this reason, by detecting a motion vector in a reduced image, a reference area to be subjected to motion detection processing in the original image is set to 7 pixels in the x direction (a range of ± 3 centering on the x component of the reduced motion vector), and the y direction It can be limited to 7 pixels (range of ± 3 around the y component of the reduced motion vector). By performing motion vector detection hierarchically in this way, it is possible to significantly reduce the amount of computation and bandwidth while searching for motion vectors in a wide reference region. Note that the motion detection processing of the macroblock of the reduced image is the same as that in FIG. 17 except that the number of pixels handled is different.

さらに、前処理部600は、検出した縮小動きベクトルに基づいて、動画像処理部200での将来のフレーム処理において発生するアクセスパラメータAPRM0に対応するアクセスパターン情報APINFを生成し、アクセスコスト計算部12Aに出力する。アクセスパターン情報APINFは、アクセスパラメータAPRM0と同様に、リードライト種別RW1、アクセス座標XY1、アクセスサイズSIZE1、アクセスフレーム番号FNO1を含む。   Further, the preprocessing unit 600 generates access pattern information APINF corresponding to the access parameter APRM0 that will occur in the future frame processing in the moving image processing unit 200 based on the detected reduced motion vector, and the access cost calculation unit 12A Output to. Similar to the access parameter APRM0, the access pattern information APINF includes a read / write type RW1, an access coordinate XY1, an access size SIZE1, and an access frame number FNO1.

アクセスコスト計算部12Aは、入力されたアクセスパターン情報APINFに基づいて、メモリマップMAP1−4でのアクセスサイクル数を計算し、その合計値N1−4をアクセスコスト保存メモリ14に書き込む。メモリマップ選択部16およびメモリマップ保存部18の動作は、図2と同じである。   Based on the input access pattern information APINF, the access cost calculation unit 12A calculates the number of access cycles in the memory map MAP1-4 and writes the total value N1-4 to the access cost storage memory 14. The operations of the memory map selection unit 16 and the memory map storage unit 18 are the same as those in FIG.

この後、動画像処理部200は、縮小動きベクトルが既に求められたフレームFLの画像データを符号化するために、処理対象のマクロブロックおよび対応する参照画像をDRAM400から読み出す。具体的には、動画像処理部200は、DRAM400からマクロブロックおよび参照画像を読み出すために、アクセス要求AREQ0をメモリコントローラ100に出力する。調停部10は、アクセス要求AREQ0をアクセスパラメータAPRM0として出力する。   Thereafter, the moving image processing unit 200 reads out the macroblock to be processed and the corresponding reference image from the DRAM 400 in order to encode the image data of the frame FL for which the reduced motion vector has already been obtained. Specifically, the moving image processing unit 200 outputs an access request AREQ0 to the memory controller 100 in order to read a macroblock and a reference image from the DRAM 400. The arbitration unit 10 outputs the access request AREQ0 as the access parameter APRM0.

パラメータ変換部20は、アクセスパラメータAPRM0に含まれるアクセスフレーム番号FNO0に対応するメモリマップMAPを示すマップ情報MINFをメモリマップ保存メモリ18から読み出す。パラメータ変換部20は、アクセスパラメータAPRM0に含まれるアクセス座標XY0を、読み出したマップ情報MINFに対応するアクセス座標XY’に変換する。アクセス制御部22は、変換されたアクセス座標XY’に基づいて、DRAM400にアクセスする。そして、動画像処理部200は、処理対象のマクロブロックの動きベクトルを求める。ここで、動きベクトルの検出は、図23に示すように、縮小画像を用いて算出した縮小動きベクトルに対応する座標の周辺にのみ限定して行う。   The parameter conversion unit 20 reads map information MINF indicating the memory map MAP corresponding to the access frame number FNO0 included in the access parameter APRM0 from the memory map storage memory 18. The parameter conversion unit 20 converts the access coordinates XY0 included in the access parameter APRM0 into access coordinates XY ′ corresponding to the read map information MINF. The access control unit 22 accesses the DRAM 400 based on the converted access coordinates XY ′. Then, the moving image processing unit 200 obtains a motion vector of the processing target macroblock. Here, as shown in FIG. 23, the motion vector is detected only in the vicinity of the coordinates corresponding to the reduced motion vector calculated using the reduced image.

図23は、図22に示した動画像処理部200の動作の例を示している。例えば、符号化処理部210は、縮小画像での縮小動きベクトルの検出結果に基づいて、参照領域をDRAM400から読み出し、実際の動きベクトルを検出する。この例では、縮小動きベクトルに対応する擬似動きベクトルは、縮小動きベクトルを4倍することで生成される。図22に示した画像処理システムSYSでは、動画像処理部200が動きベクトルを検出する前に、前処理部600により縮小動きベクトルが検出される。このため、処理対象のマクロブロックの動きベクトルを求めるために必要な参照領域のサイズは、図17に比べて大幅に小さい。   FIG. 23 shows an example of the operation of the moving image processing unit 200 shown in FIG. For example, the encoding processing unit 210 reads the reference area from the DRAM 400 based on the detection result of the reduced motion vector in the reduced image, and detects the actual motion vector. In this example, the pseudo motion vector corresponding to the reduced motion vector is generated by multiplying the reduced motion vector by four. In the image processing system SYS illustrated in FIG. 22, the reduced motion vector is detected by the preprocessing unit 600 before the moving image processing unit 200 detects the motion vector. For this reason, the size of the reference area required for obtaining the motion vector of the macroblock to be processed is significantly smaller than that in FIG.

図23に示した動き検出では、擬似動きベクトルに対応する参照画像(図の破線枠)を中心とし、x方向で−3から+3まで、y方向で−3から+3までの画像データが必要である。このため、参照領域をDRAM400から読み出すために、アクセスサイズSIZE(22、22)、アクセス座標XY(MVx−3、MVy−3)のメモリアクセスが必要となる。ここで、座標(MVx、MVy)は、擬似動きベクトルが指し示す点である。参照領域のメモリマップと上記メモリアクセスの関係が、図5に示すように同一のページPAGE内になるとき、効率的にアクセスできる。参照画像のメモリマップと上記メモリアクセスの関係が、図6や図7に示すように、ページPAGEの境界やバンクBKの境界をまたぐ場合は、非効率的なアクセスとなる。   In the motion detection shown in FIG. 23, image data from −3 to +3 in the x direction and from −3 to +3 in the y direction is required centering on the reference image (broken frame in the figure) corresponding to the pseudo motion vector. is there. For this reason, in order to read the reference area from the DRAM 400, memory access of the access size SIZE (22, 22) and the access coordinates XY (MVx-3, MVy-3) is required. Here, the coordinates (MVx, MVy) are points indicated by the pseudo motion vector. When the relationship between the memory map of the reference area and the memory access is within the same page PAGE as shown in FIG. As shown in FIG. 6 and FIG. 7, when the relationship between the memory map of the reference image and the memory access crosses the page PAGE boundary and the bank BK boundary, the access is inefficient.

図24は、図22に示したシステムSYSの動作の例を示している。この例は、カメラモジュール300により撮影された動画のH.264等による符号化処理を示している。時間T1−T4は、各フレームの処理時間を示している。カメラモジュール300、動画像処理部200およびメモリマップ選択部16の動作については、図19と同じであるため、詳細な説明は省略する。   FIG. 24 shows an example of the operation of the system SYS shown in FIG. In this example, H.264 of a moving image shot by the camera module 300 is shown. The encoding process by H.264 etc. is shown. Times T1 to T4 indicate the processing time of each frame. Since operations of the camera module 300, the moving image processing unit 200, and the memory map selection unit 16 are the same as those in FIG. 19, detailed description thereof is omitted.

この例では、前処理部600は、検出した縮小動きベクトルに基づいて、将来、符号化処理を行うときに発生するメモリアクセスのパターンを解析する。アクセスコスト計算部12Aは、解析されたアクセスパターンに基づいて、メモリマップMAP1−4毎に、将来生成されるフレームのデータの読み出しに必要なアクセスサイクル数を計算し、アクセスコスト保存メモリ14に書き込む。アクセスコスト保存メモリ14の動作は、図19と同じである。   In this example, the pre-processing unit 600 analyzes a memory access pattern that will occur when performing an encoding process in the future, based on the detected reduced motion vector. Based on the analyzed access pattern, the access cost calculation unit 12A calculates the number of access cycles required for reading data of a frame generated in the future for each memory map MAP1-4, and writes it in the access cost storage memory 14. . The operation of the access cost storage memory 14 is the same as that in FIG.

この後、動画像処理部200は、符号化処理を行うとき、アクセス要求AREQ0(ライトアクセス要求とリードアクセス要求)を調停部10に供給する。調停部10は、これ等アクセス要求AREQ0をアクセスパラメータAPRM0としてパラメータ変換部20に出力する。パラメータ変換部20は、アクセスコストの最も低いメモリマップMAPを用いて、アクセスパラメータAPRM0をアクセスパラメータAPRM1に変換する。そして、アクセス制御部22は、変換されたアクセスパラメータAPRM1を用いて、DRAM400にアクセスする。   Thereafter, the moving image processing unit 200 supplies an access request AREQ0 (write access request and read access request) to the arbitrating unit 10 when performing the encoding process. The arbitration unit 10 outputs the access request AREQ0 as an access parameter APRM0 to the parameter conversion unit 20. The parameter conversion unit 20 converts the access parameter APRM0 into the access parameter APRM1 using the memory map MAP with the lowest access cost. Then, the access control unit 22 accesses the DRAM 400 using the converted access parameter APRM1.

アクセスパターン解析は、符号化処理されるフレームより2フレーム以上先のフレームに対して行う。例えば、動画像処理部200がフレームFLt+1のマクロブロックを読み出し符号化処理している処理時間T1では、前処理部600はフレームFLt+3の縮小動きベクトル検出を行い、アクセスパターン情報APINFをアクセスコスト計算部12Aへ通知する。アクセスコスト計算部12Aは、将来、フレームFLt+3を符号化処理する際に発生するフレームFLt+2へのリードアクセスのサイクル数を計算し、アクセスコスト保存メモリ14に書き込む。メモリマップ選択部16は、アクセスコスト保存メモリ14に保存されているフレームFLt+2のリードアクセスのサイクル数の合計値をMAP1−4のそれぞれに対して計算し、サイクル数が最小となるメモリマップMAPをメモリマップ保存メモリ18に書き込む。処理時間T2では、動画像処理部200においてフレームFLt+2が符号化処理され、フレームFLt+2の再構成画像がDRAM400に書き込まれるが、処理時間T1においてメモリマップ選択部16がメモリマップ保存メモリ18に書き込んだメモリマップMAPを用いて書き込まれる。処理時間T3ではフレームFLt+3の符号化処理において、フレームFLt+2を参照画像として読み出すが、フレームFLt+2の再構成画像は処理時間T3で発生する読み出しアクセスのサイクル数が最小となるメモリマップMAPで書き込まれているため、アクセスに必要なサイクル数が削減されることになる。   The access pattern analysis is performed on a frame that is two frames or more ahead of the frame to be encoded. For example, in the processing time T1 when the moving image processing unit 200 reads and encodes the macroblock of the frame FLt + 1, the preprocessing unit 600 performs the reduced motion vector detection of the frame FLt + 3, and uses the access pattern information APINF as the access cost calculation unit. 12A is notified. The access cost calculation unit 12A calculates the number of cycles of read access to the frame FLt + 2 that will occur when the frame FLt + 3 is encoded in the future, and writes it in the access cost storage memory 14. The memory map selection unit 16 calculates the total number of read access cycles of the frame FLt + 2 stored in the access cost storage memory 14 for each of the MAPs 1-4, and determines the memory map MAP that minimizes the number of cycles. Write to the memory map storage memory 18. At the processing time T2, the frame FLt + 2 is encoded by the moving image processing unit 200, and the reconstructed image of the frame FLt + 2 is written to the DRAM 400. At the processing time T1, the memory map selection unit 16 writes to the memory map storage memory 18. It is written using the memory map MAP. At the processing time T3, in the encoding process of the frame FLt + 3, the frame FLt + 2 is read as a reference image, but the reconstructed image of the frame FLt + 2 is written in the memory map MAP that minimizes the number of read access cycles generated at the processing time T3. Therefore, the number of cycles required for access is reduced.

なお、アクセスコスト計算部12Aは、読み出しアクセスのコストだけでなく、書き込みアクセスのコストを計算してもよい。具体的には、アクセスコスト計算部12Aは、再構成画像を書き込むフレームFLについて、アクセスコストを計算し、アクセスコスト保存メモリ14に書き込んでもよい。すなわち、処理時間T1において、処理時間T2で発生するフレームFLt+2の再構成画像を書き込むアクセスコストを計算してもよい。この場合、メモリマップ選択部16は、処理時間T2におけるフレームFLt+2の再構成画像の書き込みアクセスのアクセスコストと処理時間T3におけるフレームFLt+2の参照画像の読み出しアクセスのアクセスコストの平均値が最も小さいメモリマップMAPを選択する。選択されたメモリマップMAPは、処理時間T2において、フレームFLt+2の再構成画像を書き込みアクセスするときのメモリマップとして使用される。再構成画像の書き込みはマクロブロック単位で行われるので、アクセスサイズSIZEは(16,16)、アクセス座標XYは(16m,16n)となる。ただし、(m=0,1,2,3,・・・、n=0,1,2,3,・・・)である。   Note that the access cost calculation unit 12A may calculate not only the read access cost but also the write access cost. Specifically, the access cost calculation unit 12 </ b> A may calculate an access cost for the frame FL into which the reconstructed image is written, and write it in the access cost storage memory 14. That is, the access cost for writing the reconstructed image of the frame FLt + 2 generated at the processing time T2 may be calculated at the processing time T1. In this case, the memory map selection unit 16 has the smallest average value of the access cost of the write access for the reconstructed image of the frame FLt + 2 at the processing time T2 and the access cost of the read access for the reference image of the frame FLt + 2 at the processing time T3. Select MAP. The selected memory map MAP is used as a memory map when the reconstructed image of the frame FLt + 2 is written and accessed at the processing time T2. Since the reconstructed image is written in units of macroblocks, the access size SIZE is (16, 16) and the access coordinates XY are (16m, 16n). However, (m = 0, 1, 2, 3,..., N = 0, 1, 2, 3,...).

図25は、図22に示した画像処理システムSYSの動作タイミングの例を示している。カメラモジュール300および動画像処理部200の動作は図21と同様であるので、説明を省略する。   FIG. 25 shows an example of the operation timing of the image processing system SYS shown in FIG. The operations of the camera module 300 and the moving image processing unit 200 are the same as those in FIG.

前処理部600は、1マクロブロックごとに縮小動きベクトルの検出を行う(DETV)。縮小動きベクトルの検出で得られた擬似動きベクトルから、アクセスパターン情報APINFを計算し、アクセスコスト計算部12Aへ出力する。具体的には、参照領域の読み出しであるため、リードライト種別RW1はリードアクセスである。図23に示したように、アクセス座標XY1は、検出された縮小動きベクトルを(MVx、MVy)とすると、(MVx−3、MVy−3)である。アクセスサイズSIZE1は(22、22)、アクセスフレーム番号FNO1は、”(縮小動きベクトルの検出対象のフレーム番号)−1”である。例えば、縮小動きベクトルの検出の処理対象フレームがフレームFLtの場合、アクセスフレーム番号FNO1は”t−1”となる。アクセスコスト計算部12Aは、前処理部600から入力されるアクセスパターン情報APINFを用いてアクセスコストを計算することを除き、アクセスコスト計算部12と同様に動作する。   The preprocessing unit 600 detects a reduced motion vector for each macroblock (DETV). The access pattern information APINF is calculated from the pseudo motion vector obtained by the detection of the reduced motion vector, and is output to the access cost calculation unit 12A. Specifically, since the reference area is read, the read / write type RW1 is read access. As shown in FIG. 23, the access coordinate XY1 is (MVx-3, MVy-3), where (MVx, MVy) is the detected reduced motion vector. The access size SIZE1 is (22, 22), and the access frame number FNO1 is “(frame number of detection target of reduced motion vector) −1”. For example, when the process target frame for detecting the reduced motion vector is the frame FLt, the access frame number FNO1 is “t−1”. The access cost calculation unit 12A operates in the same manner as the access cost calculation unit 12 except that the access cost is calculated using the access pattern information APINF input from the preprocessing unit 600.

この実施形態では、フレームFLtの再構成画像の書き込みで使用されるメモリマップMAPを直接にフレームFLtに対して発生するメモリアクセスの情報を用いて判定、選択しているため、上述した実施形態よりも、より正確にアクセスサイクル数が最小となるメモリマップMAPを選択することができる。具体的には、H.264等による符号化処理において、前処理として縮小画像での縮小動きベクトルを検出し、縮小動きベクトルに基づいてアクセスパターン情報APINFを生成する。フレームの符号化処理で発生する参照領域のリードアクセスのアクセスサイズとアクセス座標は、縮小画像での動きベクトルによって正確に知ることができるので、各フレームの符号化処理において発生するリードアクセスのサイクル数を正確に見積もることができる。   In this embodiment, the memory map MAP used for writing the reconstructed image of the frame FLt is determined and selected using the information of the memory access generated for the frame FLt directly. However, the memory map MAP that minimizes the number of access cycles can be selected more accurately. Specifically, H.C. In the encoding process using H.264 or the like, a reduced motion vector in a reduced image is detected as preprocessing, and access pattern information APINF is generated based on the reduced motion vector. Since the access size and access coordinates of the read access of the reference area generated in the frame encoding process can be accurately known from the motion vector in the reduced image, the number of read access cycles generated in the encoding process of each frame Can be estimated accurately.

H.264等による復号処理に適用した場合も、符号化処理と同様に図25に示すタイミングでメモリマップが選択される。H.264等の復号処理では、図13を用いて説明した各処理の内、エントロピー復号部242で行っている処理を前処理部600で行う処理とする。エントロピー復号部242はストリームデータをエントロピー復号し、アクセスパターン情報APINFとして動きベクトルとマクロブロックタイプを生成する。フレームの復号処理で発生する参照画像のリードアクセスのアクセスサイズSIZE1とアクセス座標XY1は、動きベクトルとマクロブロックタイプによって正確に知ることができる。このため、各フレームの復号処理において発生するリードアクセスのサイクル数を正確に見積もることができる。例えば、動画像処理部200がフレームFLt+1の復号処理を行っている処理時間T1では、前処理部600はフレームFLt+3のエントロピー復号処理を行い、アクセスパターン情報APINFをアクセスコスト計算部12Aへ通知する。アクセスコスト計算部12Aは、将来、フレームFLt+3を復号処理する際に発生するフレームFLt+2へのリードアクセスのサイクル数を計算し、アクセスコスト保存メモリ14に書き込む。メモリマップ選択部16は、アクセスコスト保存メモリ14に保存されているフレームFLt+2のリードアクセスのサイクル数の合計値をMAP1−4のそれぞれに対して計算し、サイクル数が最小となるメモリマップMAPをメモリマップ保存メモリ18に書き込む。処理時間T2では、動画像処理部200においてフレームFLt+2が復号処理され、フレームFLt+2の再構成画像がDRAM400に書き込まれるが、処理時間T1においてメモリマップ選択部16がメモリマップ保存メモリ18に書き込んだメモリマップMAPを用いて書き込まれる。処理時間T3ではフレームFLt+3の復号処理において、フレームFLt+2を参照画像として読み出すが、フレームFLt+2の再構成画像は処理時間T3で発生する読み出しアクセスのサイクル数が最小となるメモリマップMAPで書き込まれているため、アクセスに必要なサイクル数が削減されることになる。   H. When applied to decoding processing by H.264 or the like, the memory map is selected at the timing shown in FIG. 25 as in the encoding processing. H. In the decoding processing such as H.264, the processing performed by the entropy decoding unit 242 among the processing described with reference to FIG. The entropy decoding unit 242 performs entropy decoding on the stream data, and generates a motion vector and a macroblock type as access pattern information APINF. The access size SIZE1 and access coordinates XY1 of the read access of the reference image generated in the frame decoding process can be accurately known by the motion vector and the macroblock type. Therefore, it is possible to accurately estimate the number of read access cycles generated in the decoding process of each frame. For example, at the processing time T1 when the moving image processing unit 200 is performing the decoding process of the frame FLt + 1, the preprocessing unit 600 performs the entropy decoding process of the frame FLt + 3 and notifies the access pattern information APINF to the access cost calculation unit 12A. The access cost calculation unit 12A calculates the number of cycles of read access to the frame FLt + 2 that will occur when the frame FLt + 3 is decoded in the future, and writes it in the access cost storage memory 14. The memory map selection unit 16 calculates the total number of read access cycles of the frame FLt + 2 stored in the access cost storage memory 14 for each of the MAPs 1-4, and determines the memory map MAP that minimizes the number of cycles. Write to the memory map storage memory 18. At the processing time T2, the frame FLt + 2 is decoded by the moving image processing unit 200, and the reconstructed image of the frame FLt + 2 is written into the DRAM 400, but the memory that the memory map selection unit 16 has written into the memory map storage memory 18 at the processing time T1. Written using map MAP. At the processing time T3, in the decoding process of the frame FLt + 3, the frame FLt + 2 is read as a reference image, but the reconstructed image of the frame FLt + 2 is written in the memory map MAP that minimizes the number of read access cycles generated at the processing time T3. Therefore, the number of cycles required for access is reduced.

以上、この実施形態においても、上述した実施形態と同様の効果を得ることができる。さらに、縮小画像を用いて符号化処理を行う画像処理システムにおいて、DRAM400のアクセス効率を向上でき、画像処理システムの性能を向上できる。   As described above, also in this embodiment, the same effect as that of the above-described embodiment can be obtained. Furthermore, in an image processing system that performs encoding processing using a reduced image, the access efficiency of the DRAM 400 can be improved, and the performance of the image processing system can be improved.

なお、上述した実施形態は、メモリコントローラ100がDRAM400をアクセスする例について述べた。しかし、例えば、メモリコントローラ100は、SRAM、擬似SRAM、フラッシュメモリおよび強誘電体メモリ等の他の半導体メモリをアクセスしてもよい。   In the above-described embodiment, the example in which the memory controller 100 accesses the DRAM 400 has been described. However, for example, the memory controller 100 may access other semiconductor memories such as SRAM, pseudo SRAM, flash memory, and ferroelectric memory.

上述した実施形態は、画像データを符号化または復号する扱う画像処理システムについて述べた。しかし、上述した実施形態により符号化されるデータおよび復号されるデータは、ブロック単位で時系列に扱われるデータであれば、画像データでなくてもよい。   The above-described embodiment has described an image processing system that handles image data encoding or decoding. However, the data encoded and decoded according to the above-described embodiment may not be image data as long as the data is handled in time series in units of blocks.

図12に示した符号化処理回路210は、メモリマップ選択部16が選択したメモリマップMAPの種類を示すマップ情報MINFをビットストリーム中に書き込むメモリマップ種類書き込み部を有していてもよい。この場合、図13に示した復号処理回路240は、ビットストリーム中に書き込まれたメモリマップMAPの種類を示すマップ情報MINFを読み出すメモリマップ種類読み込み部を有していてもよい。このとき、メモリマップ保存メモリ18は、メモリマップ種類読み込み部が読み出したメモリマップMAPの種類を保存する。パラメータ変換部20は、メモリマップ保存メモリ18に保存されているメモリマップMAPに基づいてアクセスアドレスを変換する。   The encoding processing circuit 210 illustrated in FIG. 12 may include a memory map type writing unit that writes map information MINF indicating the type of the memory map MAP selected by the memory map selection unit 16 into the bitstream. In this case, the decoding processing circuit 240 illustrated in FIG. 13 may include a memory map type reading unit that reads map information MINF indicating the type of the memory map MAP written in the bit stream. At this time, the memory map storage memory 18 stores the type of the memory map MAP read by the memory map type reading unit. The parameter conversion unit 20 converts the access address based on the memory map MAP stored in the memory map storage memory 18.

上述した実施形態は、図26および図27に示す画像処理システムに適用されてもよい。図26および図27に示すメモリコントローラは、図2に示したメモリコントローラ100または図22に示したメモリコントローラ100Aの機能を有している。   The above-described embodiments may be applied to the image processing system shown in FIGS. The memory controller shown in FIGS. 26 and 27 has the function of the memory controller 100 shown in FIG. 2 or the memory controller 100A shown in FIG.

図26はデジタル画像データを圧縮符号化し、記録・保存するデジタルビデオカメラを示している。カメラで撮影されたデジタルの入力画像データはメモリコントローラを介してDRAMに蓄積される。符号化処理部ではメモリコントローラを介してDRAMに蓄積されたデジタル画像データを読み出し、MPEG−2やH.264などの国際標準規格に従って符号化処理を行い、デジタル画像データの圧縮データとしてビットストリームを生成する。生成されたビットストリームは、SDカード、ハードディスクドライブ、DVD−Rなど、蓄積メディアに書き込み、保存される。符号化処理の過程で発生し、後続の画像データの符号化処理で参照する必要がある再構成画像はメモリコントローラを介してDRAMに対して書き込まれ、後続の画像データの符号化処理時にと読み出される。   FIG. 26 shows a digital video camera that compresses and encodes digital image data and records / stores it. Digital input image data photographed by the camera is stored in the DRAM via the memory controller. The encoding processing unit reads the digital image data stored in the DRAM via the memory controller, and performs MPEG-2 or H.264. An encoding process is performed according to an international standard such as H.264, and a bit stream is generated as compressed data of digital image data. The generated bit stream is written and stored in a storage medium such as an SD card, a hard disk drive, or a DVD-R. A reconstructed image that is generated during the encoding process and needs to be referred to in the subsequent image data encoding process is written to the DRAM via the memory controller, and is read out during the subsequent image data encoding process. It is.

図27は圧縮符号化されたビットストリームを伸張復号し、デジタル画像データを再生・表示するデジタル画像データ再生装置を示している。SDカード、ハードディスクドライブ、DVDなど、蓄積メディアに書き込み、保存されているビットストリームが復号処理部に入力される。復号処理部では、MPEG−2やH.264など、ビットストリームが符号化された規格に従って復号処理を行い、デジタル画像データである再構成画像を復元、生成する。生成された再構成画像はメモリコントローラを介してDRAMに蓄積される。DRAMに格納されている復元済みの再構成画像は、後続のビットストリームの復元処理に必要なため、メモリコントローラを介して復号処理部から読み出される。また、再生表示のためディスプレイ、テレビモニタなどの表示装置もメモリコントローラを介してDRAMから再構成画像を読み出す。   FIG. 27 shows a digital image data reproducing apparatus that decompresses and decodes a compression-encoded bit stream and reproduces / displays digital image data. A bit stream written and stored in a storage medium such as an SD card, a hard disk drive, or a DVD is input to the decoding processing unit. In the decoding processing unit, MPEG-2 or H.264 is used. The decoding process is performed according to a standard such as H.264, in which a bitstream is encoded, and a reconstructed image that is digital image data is restored and generated. The generated reconstructed image is stored in the DRAM via the memory controller. The restored reconstructed image stored in the DRAM is read from the decoding processing unit via the memory controller because it is necessary for the subsequent bitstream restoration processing. In addition, a display device such as a display or a television monitor also reads a reconstructed image from the DRAM via a memory controller for reproduction display.

以上の実施形態において説明した発明を整理して、付記として開示する。
(付記1)
半導体メモリに読み出しアクセスもしくは書き込みアクセスするメモリコントローラであって、
読み出しアクセスおよび書き込みアクセスの少なくともいずれかに必要なサイクル数をアクセスコストとして複数のメモリマップ毎に計算するアクセスコスト計算部と、
前記メモリマップの中からアクセスコストが最も低いメモリマップを選択するメモリマップ選択部と、
前記メモリマップ選択部が選択したメモリマップに基づいて、アクセスアドレスを変換するパラメータ変換部と、
変換されたアクセスアドレスに基づいて前記半導体メモリにアクセスするための制御信号を生成するアクセス制御部と、
を備えていることを特徴とするメモリコントローラ。
(付記2)
付記1記載のメモリコントローラにおいて、
前記半導体メモリは、1画面を表示するためのフレーム毎に画像データを保持し、
前記アクセスコスト計算部は、処理対象のフレームをアクセスするときのアクセスコストを、前記複数のメモリマップ毎に計算し、
前記メモリマップ選択部は、処理対象のフレームより先に処理が行われるフレームに対して前記アクセスコスト計算部が計算したアクセスコストに基づいて、処理対象のフレームのアクセスに使用する前記メモリマップのいずれかを選択すること
を特徴とするメモリコントローラ。
(付記3)
付記1記載のメモリコントローラにおいて、
前記半導体メモリは、1画面を表示するためのフレーム毎に画像データを保持し、
前記アクセスコスト計算部は、処理対象のフレームより後に処理が行われるフレームの前記半導体メモリへのアクセスに関するアクセスパターン情報を受け、前記アクセスパターン情報に基づいて読み出しアクセスおよび書き込みアクセスの少なくともいずれかに必要なサイクル数をアクセスコストとして前記メモリマップ毎に計算し、
前記メモリマップ選択部は、前記アクセスコスト計算部が計算したアクセスコストに基づいて、対応する処理対象のフレームのアクセスに使用する前記メモリマップのいずれかを選択すること
を特徴とするメモリコントローラ。
(付記4)
付記3記載のメモリコントローラにおいて、
縮小画像における動きベクトルに基づいて前記アクセスパターン情報を生成する前処理部を備えていることを特徴とするメモリコントローラ。
(付記5)
付記3または付記4記載のメモリコントローラにおいて、
前記前処理部は、前記動きベクトルとマクロブロックタイプに基づいて前記アクセスパターン情報を生成することを特徴とするメモリコントローラ。
(付記6)
付記2ないし付記5のいずれか1項記載のメモリコントローラにおいて、
前記アクセスコスト計算部は、前記フレームにそれぞれ対応して、前記メモリマップ毎に前記アクセスコストを計算し、
前記メモリマップ選択部は、前記フレーム毎に前記メモリマップの中からアクセスコストが最も低いメモリマップを選択すること
を特徴とするメモリコントローラ。
(付記7)
付記2ないし付記6のいずれか1項記載のメモリコントローラにおいて、
前記アクセスコスト計算部は、前記複数のメモリマップに対して、前記各フレームを複数に分割したブロック毎に前記アクセスコストを計算するとともに、前記フレーム毎に前記アクセスコストを累積し、
前記メモリマップ選択部は、前記アクセスコストの累積値が最も小さいメモリブロックを選択すること
を特徴とするメモリコントローラ。
(付記8)
付記1ないし付記7のいずれか1項記載のメモリコントローラにおいて、
書き込みアクセス時の書き込みデータを一時保存する書き込みバッファを有し、複数の書き込みアクセスごとに前記半導体メモリに書き込みアクセスを行うこと
を特徴とするメモリコントローラ。
(付記9)
付記2ないし付記8のいずれか1項記載のメモリコントローラと、
画像データを符号化する符号化処理回路と
を備えていることを特徴とする画像処理システム。
(付記10)
付記9記載の画像処理システムにおいて、
前記符号化処理回路は、前記メモリマップ選択部が選択したメモリマップの種類をビットストリーム中に書き込むメモリマップ種類書き込み部を備えていることを特徴とする画像処理システム。
(付記11)
付記10記載の画像処理システムにおいて、
圧縮符号化された画像データを復号する復号処理回路を備え、
前記復号処理回路は、前記ビットストリーム中に書き込まれたメモリマップの種類を読み出すメモリマップ種類読み込み部を備え、
前記メモリコントローラは、メモリマップ種類読み込み部が読み出したメモリマップの種類を保存するメモリマップ保存メモリを備え、
前記パラメータ変換部は、メモリマップ保存メモリに保存されているメモリマップに基づいてアクセスアドレスを変換すること
を特徴とする画像処理システム。
(付記12)
付記2ないし付記8のいずれか1項記載のメモリコントローラと、
圧縮符号化された画像データを復号する復号処理回路と
を備えていることを特徴とする画像処理システム。
(付記13)
半導体メモリに読み出しアクセスもしくは書き込みアクセスするためのメモリアクセスの制御方法であって、
読み出しアクセスおよび書き込みアクセスの少なくともいずれかに必要なサイクル数をアクセスコストとして複数のメモリマップ毎に計算し、
前記メモリマップの中からアクセスコストが最も低いメモリマップを選択し、
選択したメモリマップに基づいて、アクセスアドレスを変換し、
変換されたアクセスアドレスに基づいて前記半導体メモリにアクセスするための制御信号を生成すること
を特徴とするメモリアクセスの制御方法。
The invention described in the above embodiments is organized and disclosed as an appendix.
(Appendix 1)
A memory controller for read access or write access to a semiconductor memory,
An access cost calculator that calculates the number of cycles required for at least one of read access and write access as an access cost for each of the plurality of memory maps;
A memory map selection unit for selecting a memory map having the lowest access cost from the memory map;
A parameter converter that converts an access address based on the memory map selected by the memory map selector;
An access control unit for generating a control signal for accessing the semiconductor memory based on the converted access address;
A memory controller comprising:
(Appendix 2)
In the memory controller described in Appendix 1,
The semiconductor memory holds image data for each frame for displaying one screen,
The access cost calculation unit calculates an access cost when accessing a processing target frame for each of the plurality of memory maps,
The memory map selection unit is configured to access any of the memory maps used for accessing the processing target frame based on the access cost calculated by the access cost calculation unit for a frame to be processed before the processing target frame. A memory controller characterized by selecting whether or not.
(Appendix 3)
In the memory controller described in Appendix 1,
The semiconductor memory holds image data for each frame for displaying one screen,
The access cost calculation unit receives access pattern information related to access to the semiconductor memory of a frame to be processed after a frame to be processed, and is necessary for at least one of read access and write access based on the access pattern information Calculate the number of cycles as the access cost for each memory map,
The memory controller, wherein the memory map selection unit selects one of the memory maps used for accessing a corresponding frame to be processed based on the access cost calculated by the access cost calculation unit.
(Appendix 4)
In the memory controller described in Appendix 3,
A memory controller, comprising: a preprocessing unit that generates the access pattern information based on a motion vector in a reduced image.
(Appendix 5)
In the memory controller according to appendix 3 or appendix 4,
The memory controller, wherein the preprocessing unit generates the access pattern information based on the motion vector and a macroblock type.
(Appendix 6)
In the memory controller according to any one of appendix 2 to appendix 5,
The access cost calculation unit calculates the access cost for each memory map corresponding to each of the frames,
The memory controller, wherein the memory map selection unit selects a memory map having the lowest access cost from the memory map for each frame.
(Appendix 7)
In the memory controller according to any one of appendix 2 to appendix 6,
The access cost calculation unit calculates the access cost for each block obtained by dividing each frame into a plurality of the plurality of memory maps, and accumulates the access cost for each frame,
The memory controller, wherein the memory map selection unit selects a memory block having the smallest accumulated access cost.
(Appendix 8)
In the memory controller according to any one of appendices 1 to 7,
A memory controller having a write buffer for temporarily storing write data at the time of write access, and performing write access to the semiconductor memory for each of a plurality of write accesses.
(Appendix 9)
The memory controller according to any one of appendix 2 to appendix 8, and
An image processing system comprising: an encoding processing circuit that encodes image data.
(Appendix 10)
In the image processing system according to attachment 9,
The image processing system, wherein the encoding processing circuit includes a memory map type writing unit that writes a type of the memory map selected by the memory map selection unit into a bitstream.
(Appendix 11)
In the image processing system according to attachment 10,
A decoding processing circuit for decoding the compression-encoded image data;
The decoding processing circuit includes a memory map type reading unit that reads a type of a memory map written in the bitstream,
The memory controller includes a memory map storage memory for storing a memory map type read by a memory map type reading unit,
The parameter conversion unit converts an access address based on a memory map stored in a memory map storage memory.
(Appendix 12)
The memory controller according to any one of appendix 2 to appendix 8, and
An image processing system comprising: a decoding processing circuit that decodes compression-encoded image data.
(Appendix 13)
A memory access control method for read access or write access to a semiconductor memory,
Calculate the number of cycles required for at least one of read access and write access as the access cost for each memory map,
Select the memory map with the lowest access cost from the memory map,
Based on the selected memory map, the access address is converted,
A method for controlling memory access, comprising: generating a control signal for accessing the semiconductor memory based on the converted access address.

以上の詳細な説明により、実施形態の特徴点および利点は明らかになるであろう。これは、特許請求の範囲がその精神および権利範囲を逸脱しない範囲で前述のような実施形態の特徴点および利点にまで及ぶことを意図するものである。また、当該技術分野において通常の知識を有する者であれば、あらゆる改良および変更に容易に想到できるはずであり、発明性を有する実施形態の範囲を前述したものに限定する意図はなく、実施形態に開示された範囲に含まれる適当な改良物および均等物に拠ることも可能である。   From the above detailed description, features and advantages of the embodiments will become apparent. This is intended to cover the features and advantages of the embodiments described above without departing from the spirit and scope of the claims. Further, any person having ordinary knowledge in the technical field should be able to easily come up with any improvements and modifications, and there is no intention to limit the scope of the embodiments having the invention to those described above. It is also possible to rely on suitable improvements and equivalents within the scope disclosed in.

10‥調停部;12‥アクセスコスト計算部;14‥アクセスコスト保存メモリ;16‥メモリマップ選択部;18‥メモリマップ保存メモリ;20‥パラメータ変換部;22‥アクセス制御部;24‥入力切替部;26‥出力切替部;26‥書き込みバッファ;100‥メモリコントローラ;200‥動画像処理部;210‥符号化処理回路;212‥誤差画像生成部;214‥直交変換・量子化部;216‥エントロピー符号化部;218‥逆量子化・逆直交変換部;220‥再構成画像生成部;222‥デブロッキングフィルタ部;224‥画面内予測部;226‥動き補償部;228‥動き検出部;230‥切替部;240‥復号処理回路;242‥エントロピー復号部;244‥逆量子化・逆直交変換部;246‥再構成画像生成部;248‥デブロッキングフィルタ部;250‥動き補償部;252‥画面内予測部;254‥切替部;300‥カメラモジュール;400‥DRAM;500‥蓄積部   DESCRIPTION OF SYMBOLS 10 ... Arbitration part; 12 ... Access cost calculation part; 14 ... Access cost preservation | save memory; 16 ... Memory map selection part; 18 ... Memory map preservation | save memory; 20 ... Parameter conversion part; 22 ... Access control part; , 26 output switching unit, 26 write buffer, 100 memory controller, 200 moving image processing unit, 210 encoding circuit, 212 error image generation unit, 214 orthogonal transform / quantization unit, 216 entropy 218. Inverse quantization / inverse orthogonal transform unit; 220. Reconstructed image generation unit; 222. Deblocking filter unit; 224 .. In-screen prediction unit; 226 ... Motion compensation unit; ...... Switching unit; 240, decoding processing circuit; 242, entropy decoding unit; 244, inverse quantization / inverse orthogonal transform unit; 246, reconstructed image generation ; 248 ‥ deblocking filter unit; 250 ‥ motion compensator; 252 ‥ intra prediction unit; 254 ‥ switching unit; 300 ‥ camera module; 400 ‥ DRAM; 500 ‥ storage unit

Claims (8)

半導体メモリに読み出しアクセスもしくは書き込みアクセスするメモリコントローラであって、
読み出しアクセスおよび書き込みアクセスの少なくともいずれかに必要なサイクル数をアクセスコストとして複数のメモリマップ毎に計算するアクセスコスト計算部と、
前記メモリマップの中からアクセスコストが最も低いメモリマップを選択するメモリマップ選択部と、
前記メモリマップ選択部が選択したメモリマップに基づいて、アクセスアドレスを変換するパラメータ変換部と、
変換されたアクセスアドレスに基づいて前記半導体メモリにアクセスするための制御信号を生成するアクセス制御部と、
を備えていることを特徴とするメモリコントローラ。
A memory controller for read access or write access to a semiconductor memory,
An access cost calculator that calculates the number of cycles required for at least one of read access and write access as an access cost for each of the plurality of memory maps;
A memory map selection unit for selecting a memory map having the lowest access cost from the memory map;
A parameter converter that converts an access address based on the memory map selected by the memory map selector;
An access control unit for generating a control signal for accessing the semiconductor memory based on the converted access address;
A memory controller comprising:
請求項1記載のメモリコントローラにおいて、
前記半導体メモリは、1画面を表示するためのフレーム毎に画像データを保持し、
前記アクセスコスト計算部は、処理対象のフレームをアクセスするときのアクセスコストを、前記複数のメモリマップ毎に計算し、
前記メモリマップ選択部は、処理対象のフレームより先に処理が行われるフレームに対して前記アクセスコスト計算部が計算したアクセスコストに基づいて、処理対象のフレームのアクセスに使用する前記メモリマップのいずれかを選択すること
を特徴とするメモリコントローラ。
The memory controller of claim 1, wherein
The semiconductor memory holds image data for each frame for displaying one screen,
The access cost calculation unit calculates an access cost when accessing a processing target frame for each of the plurality of memory maps,
The memory map selection unit is configured to access any of the memory maps used for accessing the processing target frame based on the access cost calculated by the access cost calculation unit for a frame to be processed before the processing target frame. A memory controller characterized by selecting whether or not.
請求項1記載のメモリコントローラにおいて、
前記半導体メモリは、1画面を表示するためのフレーム毎に画像データを保持し、
前記アクセスコスト計算部は、処理対象のフレームより後に処理が行われる前記半導体メモリへのアクセスに関するアクセスパターン情報を受け、前記アクセスパターン情報に基づいて読み出しアクセスおよび書き込みアクセスの少なくともいずれかに必要なサイクル数をアクセスコストとして前記メモリマップ毎に計算し、
前記メモリマップ選択部は、前記アクセスコスト計算部が計算したアクセスコストに基づいて、対応する処理対象のフレームのアクセスに使用する前記メモリマップのいずれかを選択すること
を特徴とするメモリコントローラ。
The memory controller of claim 1, wherein
The semiconductor memory holds image data for each frame for displaying one screen,
The access cost calculation unit receives access pattern information related to access to the semiconductor memory to be processed after a frame to be processed, and is a cycle necessary for at least one of read access and write access based on the access pattern information Calculate the number as the access cost for each memory map,
The memory controller, wherein the memory map selection unit selects one of the memory maps used for accessing a corresponding frame to be processed based on the access cost calculated by the access cost calculation unit.
請求項3記載のメモリコントローラにおいて、
縮小画像における動きベクトルに基づいて前記アクセスパターン情報を生成する前処理部を備えていることを特徴とするメモリコントローラ。
The memory controller of claim 3,
A memory controller, comprising: a preprocessing unit that generates the access pattern information based on a motion vector in a reduced image.
請求項2ないし請求項4のいずれか1項記載のメモリコントローラにおいて、
前記アクセスコスト計算部は、前記複数のメモリマップに対して、前記各フレームを複数に分割したブロック毎に前記アクセスコストを計算するとともに、前記フレーム毎に前記アクセスコストを累積し、
前記メモリマップ選択部は、前記アクセスコストの累積値が最も小さいメモリブロックを選択すること
を特徴とするメモリコントローラ。
The memory controller according to any one of claims 2 to 4,
The access cost calculation unit calculates the access cost for each block obtained by dividing each frame into a plurality of the plurality of memory maps, and accumulates the access cost for each frame,
The memory controller, wherein the memory map selection unit selects a memory block having the smallest accumulated access cost.
請求項2ないし請求項5のいずれか1項記載のメモリコントローラと、
画像データを符号化する符号処理回路と
を備えていることを特徴とする画像処理システム。
A memory controller according to any one of claims 2 to 5,
An image processing system comprising: a code processing circuit that encodes image data.
請求項2ないし請求項5のいずれか1項記載のメモリコントローラと、
圧縮符号化された画像データを復号する復号処理回路と
を備えていることを特徴とする画像処理システム。
A memory controller according to any one of claims 2 to 5,
An image processing system comprising: a decoding processing circuit that decodes compression-encoded image data.
半導体メモリに読み出しアクセスもしくは書き込みアクセスするためのメモリアクセスの制御方法であって、
読み出しアクセスおよび書き込みアクセスの少なくともいずれかに必要なサイクル数をアクセスコストとして複数のメモリマップ毎に計算し、
前記メモリマップの中からアクセスコストが最も低いメモリマップを選択し、
選択したメモリマップに基づいて、アクセスアドレスを変換し、
変換されたアクセスアドレスに基づいて前記半導体メモリにアクセスするための制御信号を生成すること
を特徴とするメモリアクセスの制御方法。
A memory access control method for read access or write access to a semiconductor memory,
Calculate the number of cycles required for at least one of read access and write access as the access cost for each memory map,
Select the memory map with the lowest access cost from the memory map,
Based on the selected memory map, the access address is converted,
A method for controlling memory access, comprising: generating a control signal for accessing the semiconductor memory based on the converted access address.
JP2009184635A 2009-08-07 2009-08-07 Memory controller, image processing system, and memory access control method Expired - Fee Related JP5556082B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009184635A JP5556082B2 (en) 2009-08-07 2009-08-07 Memory controller, image processing system, and memory access control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009184635A JP5556082B2 (en) 2009-08-07 2009-08-07 Memory controller, image processing system, and memory access control method

Publications (2)

Publication Number Publication Date
JP2011039660A true JP2011039660A (en) 2011-02-24
JP5556082B2 JP5556082B2 (en) 2014-07-23

Family

ID=43767385

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009184635A Expired - Fee Related JP5556082B2 (en) 2009-08-07 2009-08-07 Memory controller, image processing system, and memory access control method

Country Status (1)

Country Link
JP (1) JP5556082B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012124251A1 (en) * 2011-03-16 2012-09-20 パナソニック株式会社 Data processing device, data processing method, and data sharing system
JP2015108972A (en) * 2013-12-04 2015-06-11 富士通株式会社 Calculation device, determination method of calculation device, and program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05128241A (en) * 1991-11-05 1993-05-25 Matsushita Electric Ind Co Ltd Picture processor
JPH07240844A (en) * 1993-03-19 1995-09-12 Mitsubishi Electric Corp Image data processing unit and image data processing method
JP2004518343A (en) * 2001-01-12 2004-06-17 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Apparatus and method for memory address translation and image processing apparatus including such an apparatus
JP2008176660A (en) * 2007-01-19 2008-07-31 Fujitsu Ltd Memory device, memory controller, and memory system
WO2010086919A1 (en) * 2009-01-27 2010-08-05 パナソニック株式会社 Memory access device and techniques related thereto

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05128241A (en) * 1991-11-05 1993-05-25 Matsushita Electric Ind Co Ltd Picture processor
JPH07240844A (en) * 1993-03-19 1995-09-12 Mitsubishi Electric Corp Image data processing unit and image data processing method
JP2004518343A (en) * 2001-01-12 2004-06-17 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Apparatus and method for memory address translation and image processing apparatus including such an apparatus
JP2008176660A (en) * 2007-01-19 2008-07-31 Fujitsu Ltd Memory device, memory controller, and memory system
WO2010086919A1 (en) * 2009-01-27 2010-08-05 パナソニック株式会社 Memory access device and techniques related thereto

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012124251A1 (en) * 2011-03-16 2012-09-20 パナソニック株式会社 Data processing device, data processing method, and data sharing system
US9201781B2 (en) 2011-03-16 2015-12-01 Panasonic Intellectual Property Management Co., Ltd. Data processing apparatus, data processing method and data sharing system
JP2015108972A (en) * 2013-12-04 2015-06-11 富士通株式会社 Calculation device, determination method of calculation device, and program

Also Published As

Publication number Publication date
JP5556082B2 (en) 2014-07-23

Similar Documents

Publication Publication Date Title
US20060182181A1 (en) Apparatus and method for controlling data write/read in image processing system
US9509992B2 (en) Video image compression/decompression device
EP1998569A1 (en) Method for mapping image addresses in memory
US20120169900A1 (en) Image processing device and image processing method
JP5260757B2 (en) Moving picture encoding method, moving picture decoding method, moving picture encoding apparatus, and moving picture decoding apparatus
US20120147023A1 (en) Caching apparatus and method for video motion estimation and compensation
JP4675383B2 (en) Image decoding apparatus and method, and image encoding apparatus
JP5556082B2 (en) Memory controller, image processing system, and memory access control method
KR20140091058A (en) Capturing multiple video channels for video analytics and encoding
US8045021B2 (en) Memory organizational scheme and controller architecture for image and video processing
KR19980081641A (en) Moving picture decoding method and moving picture decoding device
TWI418219B (en) Data-mapping method and cache system for use in a motion compensation system
JP5053774B2 (en) Video encoding device
US9990900B2 (en) Image processing device and method thereof
US20110122952A1 (en) Motion estimation device
US8180195B2 (en) Memory structures and methods for video codec
US20030123555A1 (en) Video decoding system and memory interface apparatus
JP4559785B2 (en) Signal processing method and signal processing apparatus
JP2009130599A (en) Moving picture decoder
JP2011097488A (en) Video compression encoder
JP2009232004A (en) Signal processor and signal processing method, and imaging apparatus and control method of the imaging apparatus
US20080137745A1 (en) Method and device for processing video data
KR100982465B1 (en) Memory control method for a camera
TWI532378B (en) Image encoding data temporary storage device and the image encoding data temporary storage method thereof
JP2012043191A (en) Image processing device and operation method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120405

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130722

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130730

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130926

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140121

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140311

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140507

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140520

R150 Certificate of patent or registration of utility model

Ref document number: 5556082

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees