JP5163316B2 - Data transfer device, data transfer method and program - Google Patents

Data transfer device, data transfer method and program Download PDF

Info

Publication number
JP5163316B2
JP5163316B2 JP2008170065A JP2008170065A JP5163316B2 JP 5163316 B2 JP5163316 B2 JP 5163316B2 JP 2008170065 A JP2008170065 A JP 2008170065A JP 2008170065 A JP2008170065 A JP 2008170065A JP 5163316 B2 JP5163316 B2 JP 5163316B2
Authority
JP
Japan
Prior art keywords
data
rectangular area
transfer
extension
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008170065A
Other languages
Japanese (ja)
Other versions
JP2010009447A (en
Inventor
正之 樺沢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2008170065A priority Critical patent/JP5163316B2/en
Publication of JP2010009447A publication Critical patent/JP2010009447A/en
Application granted granted Critical
Publication of JP5163316B2 publication Critical patent/JP5163316B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Input (AREA)
  • Bus Control (AREA)

Description

本発明は、データ転送装置に関し、特に矩形領域のデータをメモリ間で転送するデータ転送装置、および、その処理方法ならびに当該方法をコンピュータに実行させるプログラムに関する。   The present invention relates to a data transfer device, and more particularly to a data transfer device that transfers data in a rectangular area between memories, a processing method thereof, and a program that causes a computer to execute the method.

近年、小型カメラの付いた携帯情報端末が市場に浸透し、カメラの高解像度化が進んできた。カメラが高解像度になる程、カメラで撮像した画像データを格納するフレームメモリの容量が大きくなり、また、画像処理に必要な演算量も増大する傾向にある。   In recent years, portable information terminals with small cameras have penetrated the market, and the resolution of cameras has been increasing. The higher the resolution of the camera, the larger the capacity of the frame memory that stores the image data captured by the camera, and the more the amount of calculation required for image processing tends to increase.

画像処理をLSIによって実現する場合、大容量のフレームメモリに保持される画像データを高速のプロセッサで直接処理するとデータ読出しにかかるレイテンシが大きくなるため、一般には階層構造でデータ転送が行われる。例えば、キャッシュメモリを用いる方法が挙げられる。特に画像処理の場合は、処理するデータ領域が予め定まっている場合が多いため、フレームメモリより容量が小さいローカルメモリを用いて、画像の一部をローカルメモリに転送して処理する方法がある。ローカルメモリは、フレームメモリにある画像データのうち一部の矩形画像領域だけを入れ替えて使用するため、ローカルメモリの容量を小さくすることができ、レイテンシを小さくすることができる。   When image processing is realized by an LSI, if image data held in a large-capacity frame memory is directly processed by a high-speed processor, latency for data reading increases, and therefore data transfer is generally performed in a hierarchical structure. For example, a method using a cache memory can be mentioned. Particularly in the case of image processing, since the data area to be processed is often determined in advance, there is a method in which a part of the image is transferred to the local memory and processed using a local memory having a smaller capacity than the frame memory. Since the local memory is used by exchanging only a part of the rectangular image area in the image data in the frame memory, the capacity of the local memory can be reduced and the latency can be reduced.

ローカルメモリを用いる場合、ローカルメモリを複数のメモリ領域に分割(例えば、3分割)する方法が知られている(例えば、特許文献1参照。)。この技術は、ローカルメモリの一部をデータの転送用に用い、別の一部の領域をプロセッサの演算に使用し、両方の処理が終わると領域を交換する方式である。多くの場合、DMA(Direct Memory Access)転送にかかる時間よりプロセッサの演算時間の方が長いため、データ転送にかかる時間を隠蔽することができる。画像の転送には、DMA転送が用いられ、DMAコントローラ(DMAC)と呼ばれる装置が用いられる。   In the case of using a local memory, a method of dividing the local memory into a plurality of memory areas (for example, divided into three) is known (for example, see Patent Document 1). In this technique, a part of the local memory is used for data transfer, another part of the area is used for calculation by the processor, and the areas are exchanged when both processes are completed. In many cases, since the computation time of the processor is longer than the time required for DMA (Direct Memory Access) transfer, the time required for data transfer can be concealed. For image transfer, DMA transfer is used, and a device called a DMA controller (DMAC) is used.

一般的なDMACは、転送用のパラメータとして、開始アドレス、終了アドレスおよび転送サイズを設定し、この設定に従って、連続したメモリ領域のデータを転送する。一方、上に示した矩形画像領域では、メモリ空間上は一部のアドレスが非連続であるが、このような矩形画像領域を転送するDMA転送装置の技術も開示されている(例えば、特許文献2参照。)。   A general DMAC sets a start address, an end address, and a transfer size as transfer parameters, and transfers data in successive memory areas according to these settings. On the other hand, in the rectangular image area shown above, some addresses are non-contiguous in the memory space, but a technique of a DMA transfer apparatus that transfers such a rectangular image area is also disclosed (for example, Patent Documents). 2).

画像処理LSIでは、画像処理を高速に行うため、デジタル信号処理に特化したDSP(Digital Signal Processor)が用いられる。そして、DSPが一時的にデータを保存するためのローカルメモリが設けられる。DMACは、フレームメモリからデータを読み出して、ローカルメモリに格納する。ローカルメモリは、DSPおよびDMACの2つのマスターからアクセスされる。このローカルメモリは、例えば4Kバイトの物理的に分かれた3つのメモリ(領域#0乃至#2)から構成され、各マスターが別の領域をアクセスする場合にはストールが発生しないよう構成される。一例として、領域#0および領域#1には画像データが格納され、領域#2にはDSPのプログラムが格納される。   In an image processing LSI, a DSP (Digital Signal Processor) specialized for digital signal processing is used to perform image processing at high speed. A local memory is provided for the DSP to temporarily store data. The DMAC reads data from the frame memory and stores it in the local memory. Local memory is accessed from two masters, DSP and DMAC. This local memory is composed of, for example, three physically separated memories (areas # 0 to # 2) of 4 Kbytes, and is configured so that no stall occurs when each master accesses another area. As an example, image data is stored in region # 0 and region # 1, and a DSP program is stored in region # 2.

入力画像の形式は、1色のデータだけの場合もあれば、三原色RGB(Red, Green, Blue)や、輝度および色差YCbCr配列のような特殊な配列構造の場合もある。ビット幅も1バイト長の場合や、10ビットのデータを2バイト長データとして配置して格納している場合もあるが、ここでは説明を簡単にするため、横1920画素×縦1024ラインの1バイト長の輝度データで説明する。このとき、全画素連続で配置して1920Kバイト毎に格納することを想定してもよい。また、扱いやすいように画像の右側に128バイトのブランク領域を設けて、横サイズの合計を2048画素として2048Kバイト毎に格納するようにしてもよい。   The format of the input image may be only one color data, or may be a special arrangement structure such as three primary colors RGB (Red, Green, Blue) or luminance and color difference YCbCr arrangement. In some cases, the bit width is 1 byte length, or 10-bit data is arranged and stored as 2-byte length data. However, for the sake of simplicity of explanation, 1 bit of horizontal 1920 pixels × vertical 1024 lines is used here. This will be explained using byte-length luminance data. At this time, it may be assumed that all pixels are continuously arranged and stored every 1920 Kbytes. For ease of handling, a 128-byte blank area may be provided on the right side of the image, and the total horizontal size may be stored as 2048 pixels every 2048 Kbytes.

入力画像は一旦フレームメモリに格納され、DMACを介してローカルメモリにDMA転送される。ローカルメモリの領域の容量は例えば4Kバイトとすると、入力データは横64画素×縦64ラインの4Kバイトの480個の矩形画像領域に分けて処理される。このうち最初の矩形画像領域のデータが、領域#0に転送される。   The input image is temporarily stored in the frame memory and DMA-transferred to the local memory via the DMAC. If the capacity of the local memory area is, for example, 4 Kbytes, the input data is processed by dividing it into 480 rectangular image areas of 4 Kbytes of 64 horizontal pixels × 64 vertical lines. Among these, the data of the first rectangular image area is transferred to the area # 0.

転送が終了すると、DSPは領域#0の画像処理を処理する。これと平行して、DMACは次に処理する矩形画像領域を、領域#1へ転送する。   When the transfer is completed, the DSP processes the image processing of area # 0. In parallel with this, the DMAC transfers the rectangular image area to be processed next to the area # 1.

DSPの画像処理とDMA転送が終了すると、次の演算と転送が開始される。すなわち、DSPは領域#1の画像を処理し、これと並列してDMACは領域#0にある処理結果をフレームメモリに転送する。そして、次に処理する矩形画像領域を領域#0に転送する。処理結果の格納先は、元の矩形画像データがあった領域でもよく、また、元の矩形画像データを残して別の領域に格納してもよい。   When the DSP image processing and DMA transfer are completed, the next calculation and transfer are started. That is, the DSP processes the image in the region # 1, and in parallel with this, the DMAC transfers the processing result in the region # 0 to the frame memory. Then, the rectangular image area to be processed next is transferred to area # 0. The storage destination of the processing result may be an area where the original rectangular image data was present, or may be stored in another area while leaving the original rectangular image data.

以下同様に繰り返し、画像の全ての画素に対して処理が行われる。このように、画像処理とDMA転送を並列に処理できる方式は、多くの場合DMA転送にかかる時間がDSPの演算時間より短いため、DMA転送の時間を画像処理時間に隠蔽することができる。最終結果はフレームメモリに1枚の画像データとして形成され、例えば液晶ディスプレイ(LCD:Liquid Crystal Display)に表示される。
特開昭60−201463号公報(第2図) 特開2006−209552号公報(図4)
In the same manner, the process is repeated for all the pixels of the image. As described above, in a method that can process image processing and DMA transfer in parallel, in many cases, the time required for DMA transfer is shorter than the computation time of the DSP, so that the time for DMA transfer can be concealed in the image processing time. The final result is formed as one piece of image data in the frame memory and displayed on, for example, a liquid crystal display (LCD).
JP-A-60-201443 (Fig. 2) Japanese Patent Laying-Open No. 2006-209552 (FIG. 4)

ここまでは、単純な画像処理で、矩形画像領域の大きさが変化しない場合を示した。しかし、画像処理の多くは複数の画素を用いて処理される。例えば、3タップの水平LPF(Low Pass Filter)処理を行う場合、横64画素×縦64ラインの画像データからは横62画素×縦64ラインの演算結果が生成される。また、横17タップ×縦17タップの画像処理を行う場合は、横48画素×縦48ラインが生成される。   Up to this point, the case where the size of the rectangular image area does not change by simple image processing has been shown. However, most image processing is performed using a plurality of pixels. For example, in the case of performing a 3-tap horizontal LPF (Low Pass Filter) process, a calculation result of horizontal 62 pixels × vertical 64 lines is generated from image data of horizontal 64 pixels × vertical 64 lines. When image processing of 17 horizontal taps × 17 vertical taps is performed, 48 horizontal pixels × 48 vertical lines are generated.

したがって、横17タップ×縦17タップの画像処理を行うには、横48画素×縦48ラインを有効領域と考え、入力する矩形画像領域は上下左右に8画素を付加した縦64画素×64画素の画像を用意する。そして、画像処理後に、横48画素×縦48ラインのみフレームメモリに書き込むと考えればよい。この周囲の画素を付加するには、矩形画像領域が画像の端に位置していなければ、単に周囲の上下左右8画素分を用いればよい。しかし、矩形画像領域が入力画像の端に接する場合は、別の値を用意する必要がある。   Therefore, in order to perform image processing of 17 horizontal taps × 17 vertical taps, the horizontal 48 pixels × vertical 48 lines is considered as an effective area, and the input rectangular image area is vertical 64 pixels × 64 pixels with 8 pixels added vertically and horizontally. Prepare images of. Then, after image processing, it may be considered that only 48 pixels wide × 48 lines vertically are written in the frame memory. In order to add the surrounding pixels, if the rectangular image area is not located at the edge of the image, it is only necessary to use the upper, lower, left, and right 8 pixels. However, when the rectangular image area touches the edge of the input image, it is necessary to prepare another value.

画像の端の拡張方法はいくつかある。例えば、画像の左上に位置し、左端と上端が画像データの端に接する矩形画像領域では、以下の3通りの端拡張方法が考えられる。
(A)近傍拡張: 拡張部分の値を最近傍の画素の値にする。
(B)ゼロ拡張: 拡張部分の値をゼロ値にする。
(C)設定値拡張: 拡張部分の値を設定値(例えば、「128」)にする。
多くの場合、画像の端のタップを伴う処理において誤った画像が発生しないように、(A)近傍拡張が行われる。ただし、画像抽出処理などにおいて誤った検出を行いたくない場合に(B)ゼロ拡張や(C)設定値拡張が行われる。処理規模の大きなプログラムでは、複数の拡張方法を使い分ける場合もある。
There are several ways to extend the edge of an image. For example, in the rectangular image region located at the upper left of the image and having the left end and the upper end in contact with the end of the image data, the following three end expansion methods are conceivable.
(A) Neighborhood extension: The value of the extension is set to the value of the nearest pixel.
(B) Zero extension: The value of the extended part is set to zero.
(C) Set value extension: The value of the extended part is set to a set value (for example, “128”).
In many cases, (A) neighborhood extension is performed so that an erroneous image is not generated in a process involving a tap at the edge of the image. However, (B) zero extension and (C) set value extension are performed when it is not desired to perform erroneous detection in image extraction processing or the like. A program with a large processing scale may use a plurality of expansion methods.

また、端拡張処理をするタイミングは以下の2つが考えられる。
(1)フレームメモリにある画像処理前の画像に対して行う。
(2)ローカルメモリに画像を転送後、画像処理前に拡張を行う。
しかしながら、(1)では端を拡張する分だけフレームメモリに余分なメモリが必要となり、(2)はDSPの処理の場合分けが必要になる。何れの場合も端拡張のプログラムを動作させるため、そのプログラムが動作している時間の分だけ処理時間が増大する。また、何れの場合もプログラムコードが増加するという問題が生じる。DSPは積和演算などの信号処理に特化しているため、端拡張のような場合分けは苦手であり、処理時間の増加とプログラムの増加を招きやすい。
Further, the following two timings are conceivable for the end extension processing.
(1) Perform on the image before image processing in the frame memory.
(2) After the image is transferred to the local memory, it is expanded before the image processing.
However, in (1), an extra memory is required for the frame memory as much as the end is expanded, and in (2), the case of DSP processing is required. In any case, since the end extension program is operated, the processing time is increased by the time during which the program is operating. In either case, there is a problem that the program code increases. Since the DSP specializes in signal processing such as product-sum operation, it is not good at dividing cases such as end extension, which tends to increase processing time and programs.

本発明はこのような状況に鑑みてなされたものであり、矩形画像領域を扱う際の端拡張処理を効率良く行うことを目的とする。   The present invention has been made in view of such a situation, and an object of the present invention is to efficiently perform end extension processing when a rectangular image region is handled.

本発明は、上記課題を解決するためになされたものであり、その第1の側面は、矩形領域を保持する転送元メモリから上記矩形領域のデータを読み出して保持するデータ保持部と、上記矩形領域における端の拡張幅を設定する拡張幅設定部と、上記設定された拡張幅に応じて上記データ保持部に保持されたデータを整列して上記矩形領域における端の拡張データを生成するデータ整列部と、上記データ保持部に保持されたデータおよび上記拡張データを転送先メモリに転送するデータ転送部とを具備するデータ転送装置またはその処理方法ならびにプログラムである。これにより、転送元メモリから転送先メモリに転送する際に矩形領域における端の拡張データを生成させるという作用をもたらす。   The present invention has been made to solve the above problems, and a first aspect of the present invention is that a data holding unit that reads and holds data of the rectangular area from a transfer source memory that holds the rectangular area, and the rectangle Data alignment for generating extended data at the end of the rectangular area by aligning the data held in the data holding unit in accordance with the set extended width and the extended width setting section for setting the extended width at the end of the area A data transfer device or a processing method therefor, and a program therefor, and a data transfer unit that transfers the data held in the data holding unit and the extension data to a transfer destination memory. This brings about the effect that the extension data at the end in the rectangular area is generated when transferring from the transfer source memory to the transfer destination memory.

また、この第1の側面において、上記矩形領域は複数の画素に対応する画像データを含み、上記データ整列部は、画素を単位として上記画像データを整列して上記矩形領域における端の拡張データを生成してもよい。これにより、画素を単位として矩形領域における端の拡張データを生成させるという作用をもたらす。   In the first aspect, the rectangular area includes image data corresponding to a plurality of pixels, and the data alignment unit aligns the image data in units of pixels to obtain extended data at an end of the rectangular area. It may be generated. This brings about the effect | action of producing | generating the extended data of the edge in a rectangular area per pixel.

また、この第1の側面において、上記矩形領域は二次元構造のデータを含み、上記データ整列部は、上記二次元構造のデータの上下左右の端のデータを上記拡張データとして使用してもよい。これにより、二次元構造のデータの上下左右の端のデータを拡張データとして生成させるという作用をもたらす。   In the first aspect, the rectangular area may include data having a two-dimensional structure, and the data alignment unit may use data on the upper, lower, left, and right ends of the two-dimensional structure data as the extension data. . This brings about the effect that data at the top, bottom, left, and right ends of the two-dimensional structure data is generated as extended data.

また、本発明の第2の側面は、矩形領域を保持する転送元メモリから上記矩形領域のデータを読み出して保持するデータ保持部と、上記矩形領域における端の拡張幅を設定する拡張幅設定部と、上記設定された拡張幅に応じてゼロ値データを整列して上記矩形領域における端の拡張データを生成するデータ整列部と、上記データ保持部に保持されたデータおよび上記拡張データを転送先メモリに転送するデータ転送部とを具備するデータ転送装置またはその処理方法ならびにプログラムである。これにより、転送元メモリから転送先メモリに転送する際に矩形領域における端の拡張データをゼロ値データにより生成させるという作用をもたらす。   According to a second aspect of the present invention, there is provided a data holding unit that reads and holds data of the rectangular area from a transfer source memory that holds the rectangular area, and an extended width setting unit that sets an extended width of an end of the rectangular area A data alignment unit that aligns zero value data according to the set extension width to generate extension data at the end of the rectangular area, and the data and extension data held in the data holding unit are transferred to A data transfer device including a data transfer unit that transfers data to a memory, a processing method thereof, and a program. As a result, when transferring from the transfer source memory to the transfer destination memory, the extended data at the end of the rectangular area is generated from the zero value data.

また、本発明の第3の側面は、矩形領域を保持する転送元メモリから上記矩形領域のデータを読み出して保持するデータ保持部と、上記矩形領域における端の拡張幅を設定する拡張幅設定部と、上記矩形領域における端に拡張される設定データを保持する設定データ保持部と、上記設定された拡張幅に応じて上記設定データを整列して上記矩形領域における端の拡張データを生成するデータ整列部と、上記データ保持部に保持されたデータおよび上記拡張データを転送先メモリに転送するデータ転送部とを具備するデータ転送装置またはその処理方法ならびにプログラムである。これにより、転送元メモリから転送先メモリに転送する際に矩形領域における端の拡張データを設定データにより生成させるという作用をもたらす。   The third aspect of the present invention provides a data holding unit that reads and holds data of the rectangular area from a transfer source memory that holds the rectangular area, and an extended width setting unit that sets an extended width of an end of the rectangular area A setting data holding unit that holds setting data extended to the end in the rectangular area, and data that generates the extended data at the end in the rectangular area by aligning the setting data according to the set extension width A data transfer apparatus, a processing method thereof, and a program including an alignment unit and a data transfer unit that transfers data held in the data holding unit and the extension data to a transfer destination memory. As a result, when transferring from the transfer source memory to the transfer destination memory, the extended data at the end of the rectangular area is generated from the setting data.

また、この第3の側面において、上記矩形領域は複数の画素に対応する画像データを含み、上記データ整列部は、画素を単位として上記設定データを整列して上記矩形領域における端の拡張データを生成してもよい。これにより、画素を単位として矩形領域における端の拡張データを生成させるという作用をもたらす。   Further, in the third aspect, the rectangular area includes image data corresponding to a plurality of pixels, and the data alignment unit aligns the setting data in units of pixels to obtain extended data at an end of the rectangular area. It may be generated. This brings about the effect | action of producing | generating the extended data of the edge in a rectangular area per pixel.

また、本発明の第4の側面は、矩形領域を保持する転送元メモリから上記矩形領域のデータを読み出して保持するデータ保持部と、上記矩形領域における端の拡張幅を設定する拡張幅設定部と、上記矩形領域における端の拡張モードを設定する拡張モード設定部と、上記矩形領域における端に拡張される設定データを保持する設定データ保持部と、上記設定された拡張幅および上記拡張モードに応じて上記データ保持部に保持されたデータ、ゼロ値データまたは上記設定データを整列して上記矩形領域における端の拡張データを生成するデータ整列部と、上記データ保持部に保持されたデータおよび上記拡張データを転送先メモリに転送するデータ転送部とを具備するデータ転送装置またはその処理方法ならびにプログラムである。これにより、転送元メモリから転送先メモリに転送する際に、設定された拡張モードに応じて矩形領域における端の拡張データを生成させるという作用をもたらす。   According to a fourth aspect of the present invention, there is provided a data holding unit that reads and holds data of the rectangular area from a transfer source memory that holds the rectangular area, and an extended width setting unit that sets an extended width of an end of the rectangular area An extension mode setting unit that sets an extension mode at the end of the rectangular area, a setting data holding unit that holds setting data extended at the end of the rectangular area, and the set extension width and extension mode. Accordingly, the data alignment unit that generates the extended data at the end of the rectangular area by aligning the data, zero value data, or the setting data held in the data holding unit, the data held in the data holding unit, and the data A data transfer apparatus including a data transfer unit that transfers extension data to a transfer destination memory, or a processing method and program thereof. As a result, when transferring from the transfer source memory to the transfer destination memory, the extended data at the end of the rectangular area is generated according to the set extended mode.

本発明によれば、矩形画像領域を扱う際の端拡張処理を効率良く行うことができるという優れた効果を奏し得る。すなわち、DMA転送時に端拡張処理が行われ、CPUやDSPが端拡張処理を行う必要がなくなるため、端拡張処理にかかるプログラムの処理時間を隠蔽することができ、画像処理にかかる処理時間を削減することができる。また、本発明は、より簡単なプログラムでタップのある画像処理の端拡張処理を行うことができるため、プログラムコードを削減することができ、プログラムを格納するROMやRAMなどのメモリ容量を削減することができる。   According to the present invention, it is possible to achieve an excellent effect that the edge expansion processing when handling a rectangular image region can be performed efficiently. In other words, edge extension processing is performed during DMA transfer, eliminating the need for the CPU and DSP to perform edge extension processing, so that the processing time of the program for edge extension processing can be concealed and the processing time for image processing is reduced. can do. In addition, since the present invention can perform edge expansion processing of tapped image processing with a simpler program, the program code can be reduced, and the memory capacity of a ROM or RAM for storing the program can be reduced. be able to.

次に本発明の実施の形態について図面を参照して詳細に説明する。   Next, embodiments of the present invention will be described in detail with reference to the drawings.

図1は、本発明の実施の形態におけるデータ転送装置の一構成例を示す図である。このデータ転送装置は、フレームメモリ140と、ローカルメモリ160と、両者間の転送を制御するDMA制御部170とを備える。また、このデータ転送装置は、CPU110と、ROM120と、画像信号入出力部130と、DSP150と、バス190とを備える。なお、フレームメモリ140およびROM120は、データ転送装置の外部に設けるようにしてもよい。   FIG. 1 is a diagram illustrating a configuration example of a data transfer apparatus according to an embodiment of the present invention. The data transfer apparatus includes a frame memory 140, a local memory 160, and a DMA control unit 170 that controls transfer between the two. The data transfer apparatus includes a CPU 110, a ROM 120, an image signal input / output unit 130, a DSP 150, and a bus 190. Note that the frame memory 140 and the ROM 120 may be provided outside the data transfer apparatus.

CPU(Central Processing Unit)110は、このデータ転送装置の全体的な制御を行うプロセッサである。ROM(Read Only Memory)120は、CPU110またはDSP150によって実行されるプログラム等を記憶するメモリである。画像信号入出力部130は、データ転送装置の外部との間で画像信号の入出力を行うものである。   A CPU (Central Processing Unit) 110 is a processor that performs overall control of the data transfer apparatus. A ROM (Read Only Memory) 120 is a memory that stores a program executed by the CPU 110 or the DSP 150. The image signal input / output unit 130 inputs and outputs image signals to and from the outside of the data transfer apparatus.

フレームメモリ140は、画像信号入出力部130から入力された画像データをフレーム単位で保持するメモリである。画像データのフレームとしては、例えば、横1920画素×縦1024ラインを想定する。   The frame memory 140 is a memory that holds the image data input from the image signal input / output unit 130 in units of frames. As a frame of image data, for example, horizontal 1920 pixels × vertical 1024 lines are assumed.

DSP(Digital Signal Processor)150は、画像処理を行うデジタル信号プロセッサである。ローカルメモリ160は、DSP150において画像処理を行うための作業用メモリである。一般に、ローカルメモリ160の容量は、フレームメモリ140よりも小さい。ここでは、一例として、物理的に別れた4Kバイトの3つの領域(領域#0乃至#2)を想定し、領域#0および#1に画像データを格納し、領域#2にDSP150のプログラムを格納するものとする。このローカルメモリ160は、DSP150およびDMA制御部170をマスターとし、各マスターが別の領域をアクセスする場合にはストールが発生しないよう構成される。   A DSP (Digital Signal Processor) 150 is a digital signal processor that performs image processing. The local memory 160 is a working memory for performing image processing in the DSP 150. In general, the capacity of the local memory 160 is smaller than that of the frame memory 140. Here, as an example, three physically separated 4 Kbyte areas (areas # 0 to # 2) are assumed, image data is stored in areas # 0 and # 1, and the program of the DSP 150 is stored in area # 2. Shall be stored. The local memory 160 is configured so that the DSP 150 and the DMA control unit 170 are masters, and a stall does not occur when each master accesses another area.

DMA(Direct Memory Access)制御部170は、フレームメモリ140とローカルメモリ160との間のデータ転送を制御するものである。このDMA制御部170の構成については次図を参照して後述する。   A DMA (Direct Memory Access) control unit 170 controls data transfer between the frame memory 140 and the local memory 160. The configuration of the DMA control unit 170 will be described later with reference to the following diagram.

バス190は、CPU110、ROM120、画像信号入出力部130、フレームメモリ140、および、DMA制御部170を相互に接続するバスである。   The bus 190 is a bus that interconnects the CPU 110, the ROM 120, the image signal input / output unit 130, the frame memory 140, and the DMA control unit 170.

CPU110は、ROM120に記憶されているプログラムを読み出して、このプログラムを実行する。また、このCPU110は、画像信号入出力部130およびDMA制御部170に対する制御を行う。また、このCPU110は、DSP150の処理開始および停止などの制御、画像信号入出力部130の初期設定、その他リセットなど、データ転送装置全体の挙動を監視して、必要に応じた制御を行う。また、このCPU110は、DSP150が動作するためのプログラムをローカルメモリ160へ転送する際、DMA制御部170を制御する。さらに、このCPU110は、画像の矩形領域への分割やDMA制御部170に設定するアドレスの計算も行う。   The CPU 110 reads a program stored in the ROM 120 and executes this program. The CPU 110 controls the image signal input / output unit 130 and the DMA control unit 170. The CPU 110 also monitors the behavior of the entire data transfer device, such as control for starting and stopping the processing of the DSP 150, initial setting of the image signal input / output unit 130, and other resets, and performs control as necessary. The CPU 110 controls the DMA control unit 170 when transferring a program for operating the DSP 150 to the local memory 160. Further, the CPU 110 also divides the image into rectangular areas and calculates an address set in the DMA control unit 170.

図2は、本発明の実施の形態におけるDMA制御部170の一構成例を示す図である。このDMA制御部170では、4バイト単位でデータ転送を行うものと想定する。したがって、画像データの境界は4バイト境界となる。   FIG. 2 is a diagram showing a configuration example of the DMA control unit 170 in the embodiment of the present invention. It is assumed that the DMA control unit 170 performs data transfer in units of 4 bytes. Therefore, the boundary of the image data is a 4-byte boundary.

このDMA制御部170は、ローカルメモリ160とフレームメモリ140との間で転送を行うが、転送方向により動作は非対称となる。フレームメモリ140からローカルメモリ160へのDMA転送の際、転送元のフレームメモリ140では矩形画像領域を指定することができ、転送先のローカルメモリ160では連続領域に書き込まれる。一方、ローカルメモリ160からフレームメモリ140へのDMA転送の際、転送元のローカルメモリ160では画像データは連続領域に格納されており、転送先のフレームメモリ140では矩形領域を指定することができる。また、フレームメモリ140からローカルメモリ160への転送では端拡張処理を行うことを指定できるが、ローカルメモリ160からフレームメモリ140への転送では端拡張処理を指定することはできない。   The DMA controller 170 performs transfer between the local memory 160 and the frame memory 140, but the operation is asymmetric depending on the transfer direction. At the time of DMA transfer from the frame memory 140 to the local memory 160, a rectangular image area can be specified in the transfer source frame memory 140, and written in a continuous area in the transfer destination local memory 160. On the other hand, during DMA transfer from the local memory 160 to the frame memory 140, the image data is stored in a continuous area in the transfer source local memory 160, and a rectangular area can be designated in the transfer destination frame memory 140. In addition, the end extension process can be specified in the transfer from the frame memory 140 to the local memory 160, but the end extension process cannot be specified in the transfer from the local memory 160 to the frame memory 140.

このDMA制御部170は、制御レジスタ171と、バス制御部172と、バッファ173と、データ整列部174と、データ制御部175と、転送制御部176とを備える。   The DMA control unit 170 includes a control register 171, a bus control unit 172, a buffer 173, a data alignment unit 174, a data control unit 175, and a transfer control unit 176.

制御レジスタ171は、このDMA制御部170の動作を制御するパラメータを保持するレジスタである。この制御レジスタ171の値は、バス190を介してCPU110によって設定されるが、DMA転送中は転送制御部176が更新することができる。この制御レジスタ171については、次図を参照して後述する。   The control register 171 is a register that holds parameters for controlling the operation of the DMA control unit 170. The value of the control register 171 is set by the CPU 110 via the bus 190, but can be updated by the transfer control unit 176 during the DMA transfer. The control register 171 will be described later with reference to the next figure.

バス制御部172は、バス190を制御してフレームメモリ140とバッファ173との間でデータのやりとりを制御するものである。   The bus control unit 172 controls data exchange between the frame memory 140 and the buffer 173 by controlling the bus 190.

バッファ173は、DMA転送中のデータを一旦蓄えるバッファである。このバッファ173は、フレームメモリ140またはローカルメモリ160から4バイトずつ読み出されたデータを保持する。フレームメモリ140からローカルメモリ160への転送の際には、このバッファ173に保持されたデータを利用して端拡張処理が行われる。なお、バッファ173は、特許請求の範囲に記載のデータ保持部の一例である。   The buffer 173 is a buffer that temporarily stores data during DMA transfer. The buffer 173 holds data read from the frame memory 140 or the local memory 160 by 4 bytes. At the time of transfer from the frame memory 140 to the local memory 160, end extension processing is performed using data held in the buffer 173. The buffer 173 is an example of a data holding unit described in the claims.

データ整列部174は、フレームメモリ140からローカルメモリ160への転送に際して、バッファ173におけるデータの並びを並び替えてローカルメモリ160に出力するものである。このデータ整列部174により、必要に応じて矩形画像領域における端拡張処理が行われる。なお、データ整列部174は、特許請求の範囲に記載のデータ整列部の一例である。   The data alignment unit 174 rearranges the data arrangement in the buffer 173 and outputs the data to the local memory 160 when transferring from the frame memory 140 to the local memory 160. The data alignment unit 174 performs edge extension processing on the rectangular image area as necessary. The data alignment unit 174 is an example of a data alignment unit described in the claims.

データ制御部175は、信号線169を介してローカルメモリ160とデータ整列部174との間でデータのやりとりを制御するものである。なお、データ制御部175は、特許請求の範囲に記載のデータ転送部の一例である。   The data control unit 175 controls data exchange between the local memory 160 and the data alignment unit 174 via the signal line 169. The data control unit 175 is an example of a data transfer unit described in the claims.

転送制御部176は、DMA制御部170の各部を制御するものである。この転送制御部176は、内部レジスタ177を備え、この内部レジスタ177を用いてDMA制御部170の各部の制御を行う。内部レジスタ177の初期値としては、制御レジスタ171の値が用いられる。転送制御部176は、DMA転送が終了すると、信号線179を介してCPU110に割込みを通知する。これにより、CPU110はDMA転送の終了を認識する。   The transfer control unit 176 controls each unit of the DMA control unit 170. The transfer control unit 176 includes an internal register 177 and controls each unit of the DMA control unit 170 using the internal register 177. As the initial value of the internal register 177, the value of the control register 171 is used. When the DMA transfer is completed, the transfer control unit 176 notifies the CPU 110 of an interrupt via the signal line 179. Thereby, the CPU 110 recognizes the end of the DMA transfer.

図3は、本発明の実施の形態における制御レジスタ171のアドレスマップの一例を示す図である。ここでは、制御レジスタ171として32ビットのレジスタを6語保持することを想定している。   FIG. 3 is a diagram showing an example of an address map of the control register 171 in the embodiment of the present invention. Here, it is assumed that six words of 32-bit registers are held as the control register 171.

制御レジスタ171の第0語(レジスタ#0)は、フレームメモリ開始アドレス(AF:Address of Frame Memory)610を保持する。このフレームメモリ開始アドレス(AF)610は、フレームメモリ140における開始アドレスである。   The 0th word (register # 0) of the control register 171 holds a frame memory start address (AF) 610. This frame memory start address (AF) 610 is a start address in the frame memory 140.

制御レジスタ171の第1語(レジスタ#1)は、ローカルメモリ開始アドレス(AL:Address of Local Memory)620を保持する。このローカルメモリ開始アドレス(AL)620は、ローカルメモリ160における開始アドレスである。   The first word (register # 1) of the control register 171 holds a local memory start address (AL: Address of Local Memory) 620. This local memory start address (AL) 620 is a start address in the local memory 160.

制御レジスタ171の第2語(レジスタ#2)は、MSB側の16ビットに矩形領域垂直サイズ(V:Vertical)630を保持し、LSB側の16ビットに矩形領域水平サイズ(H:Horizontal)640を保持する。矩形領域垂直サイズ(V)630は、フレームメモリ140における矩形領域の垂直方向のサイズである。矩形領域水平サイズ(H)640は、フレームメモリ140における矩形領域の水平方向のサイズである。   The second word (register # 2) of the control register 171 holds the rectangular area vertical size (V: Vertical) 630 in 16 bits on the MSB side, and the rectangular area horizontal size (H: Horizontal) 640 in 16 bits on the LSB side. Hold. The rectangular area vertical size (V) 630 is the vertical size of the rectangular area in the frame memory 140. The rectangular area horizontal size (H) 640 is the horizontal size of the rectangular area in the frame memory 140.

制御レジスタ171の第3語(レジスタ#3)は、MSB側から4ビットずつの領域に、上タップ(U:Up)651、下タップ(D:Down)652、左タップ(L:Left)653および右タップ(R:Right)654を保持する。また、LSB側の16ビットにフレームメモリ水平サイズ(W:Width)660を保持する。上タップ(U)651は、画像の上側の端拡張の幅を指定するものである。下タップ(D)652は、画像の下側の端拡張の幅を指定するものである。左タップ(L)653は、画像の左側の端拡張の幅を指定するものである。右タップ(R)654は、画像の右側の端拡張の幅を指定するものである。フレームメモリ水平サイズ(W)660は、フレームメモリ140における画像の水平方向のサイズである。なお、上タップ(U)651、下タップ(D)652、左タップ(L)653および右タップ(R)654は、特許請求の範囲に記載の拡張幅設定部の一例である。   The third word (register # 3) of the control register 171 has an upper tap (U: Up) 651, a lower tap (D: Down) 652, a left tap (L: Left) 653 in an area of 4 bits from the MSB side. And the right tap (R: Right) 654 is held. The frame memory horizontal size (W: Width) 660 is held in 16 bits on the LSB side. The upper tap (U) 651 designates the width of the upper end extension of the image. The lower tap (D) 652 designates the width of the lower end extension of the image. The left tap (L) 653 is used to specify the width of the left end extension of the image. The right tap (R) 654 is used to specify the width of the right end extension of the image. The frame memory horizontal size (W) 660 is the horizontal size of the image in the frame memory 140. The upper tap (U) 651, the lower tap (D) 652, the left tap (L) 653, and the right tap (R) 654 are examples of the expanded width setting unit described in the claims.

制御レジスタ171の第4語(レジスタ#4)は、転送制御レジスタ(CTL:ConTroL)670を保持する。この転送制御レジスタ(CTL)670は、DMA転送の転送方向や、転送サイズなどを保持する。   The fourth word (register # 4) of the control register 171 holds a transfer control register (CTL: ConTroL) 670. The transfer control register (CTL) 670 holds the transfer direction of DMA transfer, the transfer size, and the like.

制御レジスタ171の第5語(レジスタ#5)は、設定値レジスタ(PR:PReset)680を保持する。この設定値レジスタ(PR)680は、端拡張処理として設定値を拡張する際の設定値を保持する。   The fifth word (register # 5) of the control register 171 holds a set value register (PR: PReset) 680. The set value register (PR) 680 holds a set value when the set value is extended as the end extension processing.

図4は、本発明の実施の形態における1フレームの画像データを示す図である。ここでは、図4(a)に示すように、横1920画素×縦1024ラインの各画素からなる画像データにより1フレームを構成するものとしている。各画素は8ビットの輝度を表すものとする。画像データは、ライン間に128バイトの空き領域が設けられ、ラインの先頭アドレスが2048バイト境界に来るようにフレームメモリに格納されているものと想定して説明する。   FIG. 4 is a diagram showing image data of one frame in the embodiment of the present invention. Here, as shown in FIG. 4A, one frame is constituted by image data composed of pixels of horizontal 1920 pixels × vertical 1024 lines. Each pixel represents 8-bit luminance. The image data will be described on the assumption that a 128-byte free area is provided between the lines and the line address is stored in the frame memory so that the head address of the line comes to the 2048-byte boundary.

この例では、DSP150において、水平方向17タップ、垂直方向17タップの画像信号処理を行うことを想定する。すなわち、図4(b)に示すように、左右8タップずつ参照することにより、自身の矩形領域を入れて、水平方向に「8+1+8」タップとなる。また、上下8タップずつ参照することにより、自身の矩形領域を入れて、垂直方向に「8+1+8」タップとなる。   In this example, it is assumed that the DSP 150 performs image signal processing of 17 taps in the horizontal direction and 17 taps in the vertical direction. That is, as shown in FIG. 4B, by referring to the 8 taps on the left and right sides, the rectangular area is inserted and the “8 + 1 + 8” taps are formed in the horizontal direction. In addition, by referring to the upper and lower 8 taps each, the rectangular area is inserted, and “8 + 1 + 8” taps are formed in the vertical direction.

これにより、フレームメモリ140からローカルメモリ160へのロード時には縦64ライン×横64画素のDMA転送が行われ、ローカルメモリ160からフレームメモリ140へのストア時には縦48ライン×横48画素のDMA転送が行われる。すなわち、水平方向に40ブロック、垂直方向に(21+1/3)ブロック分の矩形領域を転送することになる。なお、フレームメモリ140の画像データはライン毎に区切られており、2048バイト境界に配置されているものとする。   As a result, when the frame memory 140 is loaded into the local memory 160, the DMA transfer of 64 vertical lines × 64 horizontal pixels is performed, and when the local memory 160 is stored in the frame memory 140, the DMA transfer of 48 vertical lines × 48 horizontal pixels is performed. Done. That is, a rectangular area of 40 blocks in the horizontal direction and (21 + 1/3) blocks in the vertical direction is transferred. It is assumed that the image data in the frame memory 140 is divided for each line and arranged at a 2048-byte boundary.

画像の端に接しない矩形領域を転送する場合、フレームメモリ140からローカルメモリ160へDMA転送を行う際には、制御レジスタ171には以下のように値が設定される。フレームメモリ開始アドレス(AF)610にはフレームメモリ140における矩形領域の先頭アドレスが設定される。ローカルメモリ開始アドレス(AL)620にはローカルメモリ160における先頭アドレスが設定される。矩形領域垂直サイズ(V)630には矩形領域の垂直サイズ「64」が設定される。矩形領域水平サイズ(H)640には矩形領域の水平サイズ「64」が設定される。   When transferring a rectangular area that does not contact the edge of the image, when performing DMA transfer from the frame memory 140 to the local memory 160, the following values are set in the control register 171. The frame memory start address (AF) 610 is set to the start address of the rectangular area in the frame memory 140. In the local memory start address (AL) 620, the head address in the local memory 160 is set. In the rectangular area vertical size (V) 630, the vertical size “64” of the rectangular area is set. In the rectangular area horizontal size (H) 640, the horizontal size “64” of the rectangular area is set.

また、この例では端拡張をしないため、上タップ(U)651、下タップ(D)652、左タップ(L)653および右タップ(R)654は、何れも「0」に設定される。フレームメモリ水平サイズ(W)660は、「2048」に設定される。   In this example, since end expansion is not performed, the upper tap (U) 651, the lower tap (D) 652, the left tap (L) 653, and the right tap (R) 654 are all set to “0”. The frame memory horizontal size (W) 660 is set to “2048”.

そして、転送制御レジスタ(CTL)670に、フレームメモリ140からローカルメモリ160への転送コマンドが書き込まれると、フレームメモリ140からローカルメモリ160へのDMA転送が開始する。   When a transfer command from the frame memory 140 to the local memory 160 is written in the transfer control register (CTL) 670, DMA transfer from the frame memory 140 to the local memory 160 starts.

図5は、本発明の実施の形態における端拡張の指定例を示す図である。この例では、矩形領域は画像データの左上端にあり、上側と左側が画像の端に接している。上述のように水平方向17タップ、垂直方向17タップの画像信号処理を行う場合、画像データの左上端の矩形領域をDMA転送する際には、上および左に8タップずつ端を拡張する。したがって、制御レジスタ171において、上タップ(U)651および左タップ(L)653は「8」に設定され、下タップ(D)652および右タップ(R)654は「0」に設定される。   FIG. 5 is a diagram showing a designation example of end extension in the embodiment of the present invention. In this example, the rectangular area is at the upper left corner of the image data, and the upper and left sides are in contact with the edge of the image. When image signal processing of 17 taps in the horizontal direction and 17 taps in the vertical direction is performed as described above, when the rectangular area at the upper left end of the image data is DMA-transferred, the end is expanded by 8 taps upward and left. Therefore, in the control register 171, the upper tap (U) 651 and the left tap (L) 653 are set to “8”, and the lower tap (D) 652 and the right tap (R) 654 are set to “0”.

また、矩形領域垂直サイズ(V)630には「64」から8タップ分を減じた「56」が設定される。同様に、矩形領域水平サイズ(H)640には「64」から8タップ分を減じた「56」が設定される。   The rectangular area vertical size (V) 630 is set to “56” obtained by subtracting 8 taps from “64”. Similarly, the rectangular area horizontal size (H) 640 is set to “56” obtained by subtracting 8 taps from “64”.

それ以外は、図4(b)の例と同様であり、フレームメモリ開始アドレス(AF)610にはフレームメモリ140における矩形領域の先頭アドレスが設定される。また、ローカルメモリ開始アドレス(AL)620にはローカルメモリ160における先頭アドレスが設定される。さらに、フレームメモリ水平サイズ(W)660は、「2048」に設定される。   Other than that, it is the same as the example of FIG. 4B, and the start address of the rectangular area in the frame memory 140 is set in the frame memory start address (AF) 610. The start address in the local memory 160 is set as the local memory start address (AL) 620. Further, the frame memory horizontal size (W) 660 is set to “2048”.

ここでは、左と上に端を拡張する場合の設定例を示したが、他の端を拡張する場合もタップ数を考慮して同様に設定である。例えば、矩形領域が画像の右端に接している場合には、右タップ(R)654が「8」に設定され、上タップ(U)651、下タップ(D)652および左タップ(L)653は「0」に設定される。また、矩形領域垂直サイズ(V)630には矩形領域の垂直サイズ「64」が設定される。そして、矩形領域水平サイズ(H)640には「64」から8タップ分を減じた「56」が設定される。   Here, the setting example in the case of extending the edge to the left and the upper side is shown, but the setting is similarly performed in consideration of the number of taps when extending the other edge. For example, when the rectangular area is in contact with the right edge of the image, the right tap (R) 654 is set to “8”, and the upper tap (U) 651, the lower tap (D) 652, and the left tap (L) 653. Is set to “0”. The rectangular area vertical size (V) 630 is set to a rectangular area vertical size “64”. The rectangular area horizontal size (H) 640 is set to “56” obtained by subtracting 8 taps from “64”.

また、矩形領域が画像からはみだしている場合も同様に対応できる。例えば、水平64画素×垂直16ラインが画像の有効領域にある場合には、下に48ラインの端拡張を行う。この場合、下タップ(D)652が「48」に設定され、上タップ(U)651、左タップ(L)653および右タップ(R)654は「0」に設定される。また、矩形領域水平サイズ(H)640には矩形領域の水平サイズ「64」が設定される。そして、矩形領域垂直サイズ(V)630には有効領域にある「16」が設定される。   The same can be done when the rectangular area extends beyond the image. For example, when the horizontal 64 pixels × vertical 16 lines are in the effective area of the image, the end extension of 48 lines is performed below. In this case, the lower tap (D) 652 is set to “48”, and the upper tap (U) 651, the left tap (L) 653, and the right tap (R) 654 are set to “0”. The rectangular area horizontal size (H) 640 is set to the horizontal size “64” of the rectangular area. The rectangular area vertical size (V) 630 is set to “16” in the effective area.

図6は、本発明の実施の形態における端拡張方法の種別を示す図である。ここでは、一例として、矩形領域が画像の左上に位置し、左端と上端が画像データの端に接する場合について示している。   FIG. 6 is a diagram showing types of end extension methods in the embodiment of the present invention. Here, as an example, a case where the rectangular region is located at the upper left of the image and the left end and the upper end are in contact with the end of the image data is shown.

図6(A)は、拡張部分の値を最近傍の画素の値にする近傍拡張の例である。この近傍拡張では、矩形領域の端の画素の値が端拡張の値として用いられる。   FIG. 6A shows an example of neighborhood extension in which the value of the extension portion is set to the value of the nearest pixel. In this neighborhood extension, the value of the pixel at the end of the rectangular area is used as the end extension value.

図6(B)は、拡張部分の値をゼロ値にするゼロ拡張の例である。このゼロ拡張では、端拡張の領域には「0」が設定される。   FIG. 6B is an example of zero extension in which the value of the extension part is zero. In this zero extension, “0” is set in the end extension area.

図6(C)は、拡張部分の値を設定値にする設定値拡張の例である。この設定値拡張では、制御レジスタ171の設定値レジスタ(PR)680に設定された値が端拡張の値として用いられる。   FIG. 6C is an example of setting value extension in which the value of the extension part is set as a setting value. In this set value extension, the value set in the set value register (PR) 680 of the control register 171 is used as the end extension value.

一般に、これらの端拡張方法のうち、(A)近傍拡張が用いられることが多い。これは、画像の端のタップを伴う処理において誤った画像が発生しないようにするためである。ただし、画像抽出処理などにおいて誤った検出を行いたくない場合に(B)ゼロ拡張や(C)設定値拡張が行われる。(B)ゼロ拡張ではゼロ値を用いればよいが、色差を扱う場合に「128」を用いた方がよい場合や、輝度を扱う場合に黒色を「16」と定める場合もあり、このような場合には(C)設定値拡張が用いられる。そこで、本発明の実施の形態では、制御レジスタ171の転送制御レジスタ(CTL)670において端拡張方法を指定できるようにして、(C)設定値拡張が指定された場合には設定値レジスタ(PR)680の値を設定値として用いるものとする。   In general, among these end extension methods, (A) neighborhood extension is often used. This is to prevent an erroneous image from being generated in a process involving a tap at the end of the image. However, (B) zero extension and (C) set value extension are performed when it is not desired to perform erroneous detection in image extraction processing or the like. (B) Zero value may be used for zero extension, but it may be better to use “128” when dealing with color difference, or black may be defined as “16” when dealing with luminance. In this case, (C) set value extension is used. Therefore, in the embodiment of the present invention, the transfer control register (CTL) 670 of the control register 171 can specify the end extension method, and (C) when the set value extension is specified, the set value register (PR ) A value of 680 is used as a set value.

図7は、本発明の実施の形態における転送制御レジスタ(CTL)670のフィールド構成例を示す図である。上述のように、転送制御レジスタ(CTL)670は制御レジスタ171の第4語(レジスタ#4)として保持されるものである。   FIG. 7 is a diagram showing a field configuration example of the transfer control register (CTL) 670 in the embodiment of the present invention. As described above, the transfer control register (CTL) 670 is held as the fourth word (register # 4) of the control register 171.

この転送制御レジスタ(CTL)670のLSB側の2ビット(第0乃至1ビット)は、転送コマンドを示すフィールドである。このフィールドは、「01」であればフレームメモリ140からローカルメモリ160への転送を意味し、「10」であればローカルメモリ160からフレームメモリ140への転送を意味する。   Two bits (0th to 1st bits) on the LSB side of the transfer control register (CTL) 670 are fields indicating a transfer command. In this field, “01” means transfer from the frame memory 140 to the local memory 160, and “10” means transfer from the local memory 160 to the frame memory 140.

転送制御レジスタ(CTL)670の第2乃至3ビットは、転送されるデータのデータ幅を示すフィールドである。このフィールドは、「00」であれば1バイト長を意味し、「01」であれば2バイト長を意味し、「10」であれば4バイト長を意味する。このデータ幅に応じて、端拡張のサイズが決定される。これについては、図14を参照して後述する。   The second to third bits of the transfer control register (CTL) 670 are fields indicating the data width of the transferred data. In this field, “00” means a 1-byte length, “01” means a 2-byte length, and “10” means a 4-byte length. The size of the end extension is determined according to the data width. This will be described later with reference to FIG.

転送制御レジスタ(CTL)670の第4乃至5ビットは、フレームメモリ140からローカルメモリ160へのDMA転送の際の端拡張の拡張方法(拡張モード)を示すフィールドである。このフィールドは、「00」であれば近傍拡張を意味し、「01」であればゼロ拡張を意味し、「10」であれば設定値拡張を意味する。なお、このフィールドは、特許請求の範囲に記載の拡張モード設定部の一例である。   The 4th to 5th bits of the transfer control register (CTL) 670 are fields indicating an extension method (extension mode) of end extension at the time of DMA transfer from the frame memory 140 to the local memory 160. In this field, “00” means neighborhood extension, “01” means zero extension, and “10” means set value extension. This field is an example of the extended mode setting unit described in the claims.

図8は、本発明の実施の形態におけるローカルメモリ160における画像データの遷移例を示す図である。   FIG. 8 is a diagram showing a transition example of image data in the local memory 160 according to the embodiment of the present invention.

図8(a)のように、ローカルメモリ160に64画素×64ラインでDMA転送された画像データは、DSP150によって画像処理が行われる。この例では、4バイトを単位として、16回の転送で1ライン分の画素が転送されることになる。   As shown in FIG. 8A, the DSP 150 performs image processing on image data DMA-transferred to the local memory 160 with 64 pixels × 64 lines. In this example, one line of pixels is transferred in 16 transfers in units of 4 bytes.

17タップの水平LPFを想定すると、この演算により1ラインは64画素から48画素に減少するため、演算結果を詰めてローカルメモリ160に格納すると、図8(b)のように、48画素×64ラインに減少する。   Assuming a 17-tap horizontal LPF, one line is reduced from 64 pixels to 48 pixels by this calculation. Therefore, when the calculation results are packed and stored in the local memory 160, as shown in FIG. 8B, 48 pixels × 64 Decrease in line.

次に17タップの垂直LPFを想定すると、この演算により48ラインに減少するため、演算結果を詰めて書き込めば、図8(c)のように、48画素×48ラインの連続データが得られる。   Next, assuming a 17-tap vertical LPF, the number of lines is reduced to 48 lines by this calculation. Therefore, if the calculation result is packed and written, continuous data of 48 pixels × 48 lines can be obtained as shown in FIG.

従来のDMACが搭載されている場合は、端拡張は転送と同時には行われないため、矩形領域が画像の端に接しているかに応じて、DSPにおける処理を切り替える必要がある。本発明の実施の形態のDMA制御部170によれば、DMA転送と同時に端拡張が行われるため、矩形領域が画像の端に接しているか否かに関わらず、同じ画像処理を行えば足りる。   When the conventional DMAC is installed, the edge extension is not performed at the same time as the transfer. Therefore, it is necessary to switch the processing in the DSP depending on whether the rectangular area is in contact with the edge of the image. According to the DMA control unit 170 of the embodiment of the present invention, the end extension is performed simultaneously with the DMA transfer. Therefore, it is sufficient to perform the same image processing regardless of whether the rectangular area is in contact with the end of the image.

また、従来、DSPで端の拡張処理を行った場合は、画像処理時間以外に端拡張に処理時間を要する。多くの場合において画像処理時間の方がDMA転送時間より長いため、本発明の実施の形態によれば、端拡張の処理時間をDSPの処理時間中に実行することができ、端拡張に伴う処理時間を隠蔽することができる。本発明の実施の形態では、CPU110による制御レジスタ171の設定を要するが、CPU110の制御プログラムはDMA制御部170の端拡張の処理のみ増えるだけで済む。したがって、DSP150で端拡張を行う場合のプログラムの増加と比較してより簡単なものになり、処理時間の増加も抑えることができる。   Conventionally, when edge extension processing is performed by a DSP, processing time is required for edge extension in addition to image processing time. In many cases, since the image processing time is longer than the DMA transfer time, according to the embodiment of the present invention, the processing time for edge extension can be executed during the processing time of the DSP. Time can be hidden. In the embodiment of the present invention, setting of the control register 171 by the CPU 110 is required, but the control program of the CPU 110 only needs to increase only the end expansion processing of the DMA control unit 170. Therefore, it becomes simpler than the increase in the program when the end extension is performed by the DSP 150, and the increase in the processing time can be suppressed.

次に本発明の実施の形態におけるデータ転送装置の動作について図面を参照して説明する。   Next, the operation of the data transfer apparatus according to the embodiment of the present invention will be described with reference to the drawings.

図9および図10は、本発明の実施の形態におけるフレームメモリ140からローカルメモリ160へのDMA転送の処理手順例を示す図である。   9 and 10 are diagrams showing an example of a processing procedure for DMA transfer from the frame memory 140 to the local memory 160 in the embodiment of the present invention.

転送の制御は、DMA制御部170内部の転送制御部176によって行われる。制御レジスタ171にフレームメモリ140からローカルメモリ160へのロードを指示する転送コマンド「01」が書き込まれると、転送制御部176は以下の手順により転送を指示する。なお、以下では、全て4バイト単位により処理されるものとする。したがって、フレームメモリ開始アドレス(AF)610、ローカルメモリ開始アドレス(AL)620、矩形領域水平サイズ(H)640、左タップ(L)653、右タップ(R)654、フレームメモリ水平サイズ(W)660は、4の倍数により指定される。また、各データのデータ幅は1バイトを想定している。   The transfer control is performed by the transfer control unit 176 in the DMA control unit 170. When a transfer command “01” for instructing loading from the frame memory 140 to the local memory 160 is written in the control register 171, the transfer control unit 176 instructs transfer according to the following procedure. In the following, it is assumed that processing is performed in units of 4 bytes. Therefore, frame memory start address (AF) 610, local memory start address (AL) 620, rectangular area horizontal size (H) 640, left tap (L) 653, right tap (R) 654, frame memory horizontal size (W) 660 is specified by a multiple of four. The data width of each data is assumed to be 1 byte.

まず、1ライン分の転送について説明する。このライン転送は、左右の端拡張処理を伴った転送である。   First, transfer for one line will be described. This line transfer is transfer accompanied by left and right end extension processing.

フレームメモリ140からローカルメモリ160へのロードが指示されると、転送制御部176はDMA転送を開始する。このDMA転送が開始する前に、予め制御レジスタ171には必要な値が設定される(ステップS910)。なお、ステップS910は、特許請求の範囲に記載の拡張幅設定手順の一例である。   When loading from the frame memory 140 to the local memory 160 is instructed, the transfer control unit 176 starts DMA transfer. Before the DMA transfer starts, a necessary value is set in the control register 171 in advance (step S910). Note that step S910 is an example of an extension width setting procedure described in the claims.

まず、制御レジスタ171のデータのうち、矩形領域水平サイズ(H)640、左タップ(L)653、右タップ(R)654、および、フレームメモリ開始アドレス(AF)610の各レジスタの値が、内部レジスタ177に保持される(ステップS911)。以下では、内部レジスタ177の値を制御レジスタ171の値と区別するために、それぞれ、矩形領域水平サイズ(H0)740、左タップ(L0)753、右タップ(R0)754、および、フレームメモリ開始アドレス(AF0)710と記載する。   First, among the data of the control register 171, the values of the registers of the rectangular area horizontal size (H) 640, the left tap (L) 653, the right tap (R) 654, and the frame memory start address (AF) 610 are as follows. It is held in the internal register 177 (step S911). In the following, in order to distinguish the value of the internal register 177 from the value of the control register 171, the rectangular area horizontal size (H0) 740, the left tap (L0) 753, the right tap (R0) 754, and the frame memory start, respectively. Address (AF0) 710 is described.

転送制御部176は、矩形領域水平サイズ(H0)740が正か否かを判断する(ステップS912)。矩形領域水平サイズ(H0)740が正である場合にはステップS913に進み、それ以外の場合にはステップS921に進む。矩形領域水平サイズ(H0)740が正である場合には、転送制御部176はバス制御部172を制御して、フレームメモリ開始アドレス(AF0)710の示すフレームメモリ140のアドレスからデータを読み出して、バッファ173に一旦蓄える(ステップS913)。そして、フレームメモリ開始アドレス(AF0)710に「4」が加算される(ステップS913)。なお、ステップS913は、特許請求の範囲に記載のデータ読出し手順の一例である。   The transfer control unit 176 determines whether or not the rectangular area horizontal size (H0) 740 is positive (step S912). If the rectangular area horizontal size (H0) 740 is positive, the process proceeds to step S913. Otherwise, the process proceeds to step S921. When the rectangular area horizontal size (H0) 740 is positive, the transfer control unit 176 controls the bus control unit 172 to read data from the address of the frame memory 140 indicated by the frame memory start address (AF0) 710. And temporarily stored in the buffer 173 (step S913). Then, “4” is added to the frame memory start address (AF0) 710 (step S913). Note that step S913 is an example of a data read procedure described in the claims.

転送制御部176は、次に、左タップ(L0)753が正か否かを判断する(ステップS914)。左タップ(L0)753が正である場合にはステップS915に進み、それ以外の場合にはステップS917に進む。左タップ(L0)753が正である場合には、データ整列部174は、バッファ173に保持されたデータのうちラインの最初の1バイトデータを4バイトに並び替えて、ローカルメモリ160に書込みを行う(ステップS915)。このとき、ローカルメモリ160側のアドレスには、ローカルメモリ開始アドレス(AL)620が用いられる。そして、ローカルメモリ開始アドレス(AL)620に「4」が加算される(ステップS915)。また、左タップ(L0)753から「4」が減算される(ステップS916)。そして、左タップ(L0)753が正ではなくなるまで、ステップS914乃至S916の手順が繰り返されて、左側の端拡張が4バイト単位で行われる。なお、ステップS915は、特許請求の範囲に記載のデータ整列手順およびデータ転送手順の一例である。   Next, the transfer control unit 176 determines whether or not the left tap (L0) 753 is positive (step S914). If the left tap (L0) 753 is positive, the process proceeds to step S915. Otherwise, the process proceeds to step S917. When the left tap (L0) 753 is positive, the data alignment unit 174 rearranges the first 1-byte data of the line among the data held in the buffer 173 into 4 bytes, and writes it to the local memory 160. This is performed (step S915). At this time, the local memory start address (AL) 620 is used as the address on the local memory 160 side. Then, “4” is added to the local memory start address (AL) 620 (step S915). Further, “4” is subtracted from the left tap (L0) 753 (step S916). Until the left tap (L0) 753 is not positive, the procedure from step S914 to S916 is repeated, and the left end expansion is performed in units of 4 bytes. Note that step S915 is an example of a data alignment procedure and a data transfer procedure described in the claims.

左拡張が終了すると、最初の有効領域のデータ書込みが行われる。 データは既にバッファ173に格納されているため、データ整列部174において並び替えは行われず、4バイトのデータがローカルメモリ160に書き込まれる(ステップS917)。そして、ローカルメモリ開始アドレス(AL)620に「4」が加算される(ステップS917)。また、矩形領域水平サイズ(H0)740から「4」が減算される(ステップS918)。そして、矩形領域水平サイズ(H0)740が正ではなくなるまで、ステップS912乃至S914、S917、S918の手順が繰り返されて、有効領域の転送が4バイト単位で行われる。なお、ステップS917は、特許請求の範囲に記載のデータ転送手順の一例である。   When the left extension is completed, data is written in the first valid area. Since the data is already stored in the buffer 173, the data sorting unit 174 does not rearrange the data and writes 4-byte data to the local memory 160 (step S917). Then, “4” is added to the local memory start address (AL) 620 (step S917). Further, “4” is subtracted from the rectangular area horizontal size (H0) 740 (step S918). Until the rectangular area horizontal size (H0) 740 is not positive, steps S912 to S914, S917, and S918 are repeated, and the effective area is transferred in units of 4 bytes. Note that step S917 is an example of a data transfer procedure described in the claims.

有効領域の転送が終了すると、次に右側の端拡張が行われる。転送制御部176は、右タップ(R0)754が正か否かを判断する(ステップS921)。右タップ(R0)754が正である場合にはステップS922に進み、それ以外の場合にはステップS931に進む。右タップ(R0)754が正である場合、既にバッファ173に有効画素の最後のデータが格納されているため、データ整列部174においてラインの最終の1バイトデータを4バイトに並び替えて、ローカルメモリ160に書込みを行う(ステップS922)。このとき、ローカルメモリ160側のアドレスには、ローカルメモリ開始アドレス(AL)620が用いられる。そして、ローカルメモリ開始アドレス(AL)620に「4」が加算される(ステップS922)。また、右タップ(R0)754から「4」が減算される(ステップS923)。そして、右タップ(R0)754が正ではなくなるまで、ステップS921乃至S923の手順が繰り返されて、右側の端拡張が4バイト単位で行われる。なお、ステップS922は、特許請求の範囲に記載のデータ整列手順およびデータ転送手順の一例である。   When the transfer of the valid area is completed, the right end expansion is performed next. The transfer control unit 176 determines whether or not the right tap (R0) 754 is positive (step S921). If the right tap (R0) 754 is positive, the process proceeds to step S922. Otherwise, the process proceeds to step S931. When the right tap (R0) 754 is positive, since the last data of the effective pixel is already stored in the buffer 173, the last 1 byte data of the line is rearranged into 4 bytes in the data alignment unit 174, and the local data Writing to the memory 160 is performed (step S922). At this time, the local memory start address (AL) 620 is used as the address on the local memory 160 side. Then, “4” is added to the local memory start address (AL) 620 (step S922). Also, “4” is subtracted from the right tap (R0) 754 (step S923). Then, until the right tap (R0) 754 is not positive, the procedure of steps S921 to S923 is repeated, and right end expansion is performed in units of 4 bytes. Note that step S922 is an example of a data alignment procedure and a data transfer procedure described in the claims.

ライン転送が終了すると、次に上側の端拡張が行われる。転送制御部176は、上タップ(U)651が正か否かを判断する(ステップS931)。上タップ(U)651が正である場合にはステップS932に進み、それ以外の場合にはステップS933に進む。上タップ(U)651が正である場合、上タップ(U)651から「1」が減算されて、最初の処理(ステップS911)に戻る(ステップS932)。このとき、フレームメモリ開始アドレス(AF)610は更新されないため、次のライン転送でもフレームメモリ140の同じラインがローカルメモリ160に転送される。このようにして、上タップ(U)651が正ではなくなるまで、ステップS911乃至S932の手順が繰り返されて、上側の端拡張の領域に1ライン目のデータの複製が転送される。   When the line transfer is completed, the upper end extension is performed next. The transfer control unit 176 determines whether or not the upper tap (U) 651 is positive (step S931). If the upper tap (U) 651 is positive, the process proceeds to step S932; otherwise, the process proceeds to step S933. When the upper tap (U) 651 is positive, “1” is subtracted from the upper tap (U) 651, and the process returns to the first process (step S911) (step S932). At this time, since the frame memory start address (AF) 610 is not updated, the same line in the frame memory 140 is transferred to the local memory 160 in the next line transfer. In this way, the procedure of steps S911 to S932 is repeated until the upper tap (U) 651 is not positive, and a copy of the data on the first line is transferred to the upper end extension region.

ライン転送後に上タップ(U)651が正ではなく、矩形領域垂直サイズ(V)630が「1」より大きい場合にはステップS934に進み、それ以外の場合にはステップS935に進む。矩形領域垂直サイズ(V)630が「1」より大きい場合、矩形領域垂直サイズ(V)630から「1」が減算される(ステップS934)。そして、次のフレームメモリ開始アドレス(AF)610にフレームメモリ水平サイズ(W)660が加算されて、最初の処理(ステップS911)に戻る(ステップS934)。ただし、最終ラインだけは処理が異なる。矩形領域垂直サイズ(V)630が「1」である場合には(ステップS935)、矩形領域垂直サイズ(V)630から「1」が減算された後に、フレームメモリ開始アドレス(AF)610の加算は行われずに、最初の処理(ステップS911)に戻る(ステップS936)。このようにして、矩形領域垂直サイズ(V)630が正ではなくなるまで、ステップS911乃至S931、S933乃至S936の手順が繰り返されて、有効ラインの転送が行われる。   If the upper tap (U) 651 is not positive after the line transfer and the rectangular area vertical size (V) 630 is larger than “1”, the process proceeds to step S934. Otherwise, the process proceeds to step S935. When the rectangular area vertical size (V) 630 is larger than “1”, “1” is subtracted from the rectangular area vertical size (V) 630 (step S934). Then, the frame memory horizontal size (W) 660 is added to the next frame memory start address (AF) 610, and the process returns to the first process (step S911) (step S934). However, only the final line is processed differently. When the rectangular area vertical size (V) 630 is “1” (step S935), “1” is subtracted from the rectangular area vertical size (V) 630, and then the frame memory start address (AF) 610 is added. Is not performed, and the process returns to the first process (step S911) (step S936). In this way, until the rectangular area vertical size (V) 630 is not positive, steps S911 to S931 and S933 to S936 are repeated to transfer the effective line.

最後に有効ライン外の下端のライン転送が行われる。ステップS935において矩形領域垂直サイズ(V)630が正ではない場合には、転送制御部176は、下タップ(D)652が正か否かを判断する(ステップS937)。下タップ(D)652が正である場合にはステップS938に進み、それ以外の場合にはDMA転送処理を終了する。下タップ(D)652が正である場合、下タップ(D)652から「1」が減算された後に、最初の処理(ステップS911)に戻る(ステップS938)。このとき、フレームメモリ開始アドレス(AF)610は有効領域の最終ラインの先頭アドレスから更新されていないため、次のライン転送では最終ラインがローカルメモリ160に転送される。このようにして、下タップ(D)652が正ではなくなるまで、ステップS911乃至S932、S933、S935乃至S938の手順が繰り返されて、下側の端拡張の領域に最終ラインのデータの複製が転送される。   Finally, line transfer at the lower end outside the effective line is performed. If the rectangular area vertical size (V) 630 is not positive in step S935, the transfer control unit 176 determines whether or not the lower tap (D) 652 is positive (step S937). If the lower tap (D) 652 is positive, the process proceeds to step S938; otherwise, the DMA transfer process ends. When the lower tap (D) 652 is positive, after “1” is subtracted from the lower tap (D) 652, the process returns to the first process (step S911) (step S938). At this time, since the frame memory start address (AF) 610 has not been updated from the head address of the last line of the effective area, the last line is transferred to the local memory 160 in the next line transfer. In this way, the steps S911 to S932, S933, and S935 to S938 are repeated until the lower tap (D) 652 is not positive, and a copy of the data of the last line is transferred to the lower end extension region. Is done.

下タップ(D)652が正ではなくなれば、全ての転送が終了するため、DMA転送処理は終了する。転送の終了は転送制御部176からCPU110に割込みとして通知される。   If the lower tap (D) 652 is not positive, all transfers are completed, and the DMA transfer process ends. The end of the transfer is notified from the transfer control unit 176 to the CPU 110 as an interrupt.

図11は、本発明の実施の形態におけるフレームメモリ140からローカルメモリ160へのDMA転送処理を行うプログラムの一例を示す図である。   FIG. 11 is a diagram showing an example of a program for performing a DMA transfer process from the frame memory 140 to the local memory 160 in the embodiment of the present invention.

第1行目のwhile文は、プログラム全体のループを形成するものである。第2行目は、内部レジスタ177を初期化するものであり、ステップS911に対応する。   The while statement on the first line forms a loop of the entire program. The second line initializes the internal register 177 and corresponds to step S911.

第3行目のwhile文は、矩形領域水平サイズ(H0)740が正である間、第13行目までのループを形成するものであり、ステップS912に対応する。第4行目は、フレームメモリ140から読み出されたデータを変数dataに代入して、フレームメモリ開始アドレス(AF)610を1つ(4バイト分)進めるものであり、ステップS913に対応する。ここでは、フレームメモリ開始アドレス(AF)610はフレームメモリ140のアドレスポインタとして用いられている。第5行目のwhile文は、左タップ(L0)753が正である間、第10行目までのループを形成するものであり、ステップS914に対応する。   The while statement on the third line forms a loop up to the thirteenth line while the rectangular area horizontal size (H0) 740 is positive, and corresponds to step S912. The fourth line substitutes the data read from the frame memory 140 for the variable data and advances the frame memory start address (AF) 610 by one (4 bytes), and corresponds to step S913. Here, the frame memory start address (AF) 610 is used as an address pointer of the frame memory 140. The while statement on the fifth line forms a loop up to the tenth line while the left tap (L0) 753 is positive, and corresponds to step S914.

第6行目は、読み出されたデータの下位(左端)1バイトを変数tempに代入するものである。第7行目は、1バイトデータを保持する変数tempを4つ接続して4バイトの変数wdataに代入するものである。第8行目は、変数wdataの内容をローカルメモリ160に書き込んで、ローカルメモリ開始アドレス(AL)620を1つ(4バイト分)進めるものである。これら第6乃至8行は、ステップS915に対応する。第9行目は、左タップ(L0)753から「4」を減算するものであり、ステップS916に対応する。   The sixth line substitutes the lower (leftmost) 1 byte of the read data for the variable temp. The seventh line connects four variables temp holding 1-byte data and substitutes them into a 4-byte variable wdata. The eighth line writes the contents of the variable wdata to the local memory 160 and advances the local memory start address (AL) 620 by one (4 bytes). These sixth to eighth lines correspond to step S915. The ninth line subtracts “4” from the left tap (L0) 753 and corresponds to step S916.

第11行目は、変数dataの内容をローカルメモリ160に書き込んで、ローカルメモリ開始アドレス(AL)620を1つ(4バイト分)進めるものであり、ステップS917に対応する。ここでは、ローカルメモリ開始アドレス(AL)620は、ローカルメモリ160のアドレスポインタとして用いられている。第9行目は、矩形領域水平サイズ(H0)740から「4」を減算するものであり、ステップS918に対応する。   The eleventh line writes the contents of the variable data to the local memory 160 and advances the local memory start address (AL) 620 by one (4 bytes), and corresponds to step S917. Here, the local memory start address (AL) 620 is used as an address pointer of the local memory 160. The ninth line is for subtracting “4” from the rectangular area horizontal size (H0) 740, and corresponds to step S918.

第14行目のwhile文は、右タップ(R0)754が正である間、第19行目までのループを形成するものであり、ステップS921に対応する。第15行目は、読み出されたデータの上位(右端)1バイトを変数tempに代入するものである。第16行目は、1バイトデータを保持する変数tempを4つ接続して4バイトの変数wdataに代入するものである。第17行目は、変数wdataの内容をローカルメモリ160に書き込んで、ローカルメモリ開始アドレス(AL)620を1つ(4バイト分)進めるものである。これら第15乃至17行は、ステップS922に対応する。第18行目は、右タップ(R0)754から「4」を減算するものであり、ステップS923に対応する。   The while statement on the 14th line forms a loop up to the 19th line while the right tap (R0) 754 is positive, and corresponds to step S921. The 15th line substitutes the upper byte (right end) 1 byte of the read data for the variable temp. The 16th line connects four variables temp holding 1-byte data and substitutes them into a 4-byte variable wdata. The 17th line writes the contents of the variable wdata to the local memory 160 and advances the local memory start address (AL) 620 by one (4 bytes). These 15th to 17th lines correspond to step S922. The 18th line is for subtracting “4” from the right tap (R0) 754 and corresponds to step S923.

第20行目は、上タップ(U)651が正である場合に上タップ(U)651から「1」を減算するものであり、ステップS931およびS932に対応する。第21行目は、矩形領域垂直サイズ(V)630が「1」より大きい場合に、次のフレームメモリ開始アドレス(AF)610にフレームメモリ水平サイズ(W)660を加算するものである。また、この第21行目は、矩形領域垂直サイズ(V)630から「1」を減算するものである。この第21行目は、ステップS933およびS934に対応する。第22行目は、矩形領域垂直サイズ(V)630が「0」より大きい場合に矩形領域垂直サイズ(V)630から「1」を減算するものであり、ステップS935およびS936に対応する。第23行目は、下タップ(D)652が「0」より大きい場合に下タップ(D)652から「1」を減算するものであり、ステップS937およびS938に対応する。第24行目は、第20乃至23行の何れの条件にも合致しなかった場合に、第1行目のwhile文によるループを抜けて処理を終了するものである。   The 20th line subtracts “1” from the upper tap (U) 651 when the upper tap (U) 651 is positive, and corresponds to steps S931 and S932. The 21st line adds the frame memory horizontal size (W) 660 to the next frame memory start address (AF) 610 when the rectangular area vertical size (V) 630 is larger than “1”. In the 21st line, “1” is subtracted from the rectangular area vertical size (V) 630. The 21st line corresponds to steps S933 and S934. The 22nd line subtracts “1” from the rectangular area vertical size (V) 630 when the rectangular area vertical size (V) 630 is larger than “0”, and corresponds to steps S935 and S936. The 23rd line subtracts “1” from the lower tap (D) 652 when the lower tap (D) 652 is larger than “0”, and corresponds to steps S937 and S938. In the 24th line, when any of the conditions in the 20th to 23rd lines is not met, the process exits the loop of the while statement in the 1st line.

なお、このプログラム例では、端拡張方法として近傍拡張を用いる例について説明したが、他の端拡張方法を用いることもできる。ゼロ拡張の場合には、書込みデータを生成する第6乃至7行および第15乃至16行目(ステップS915およびS922)において、
wdata=0;
とすれば実現することができる。
In the example of the program, an example in which neighborhood extension is used as the edge extension method has been described. However, other edge extension methods can also be used. In the case of zero extension, in the sixth to seventh lines and the fifteenth to sixteenth lines (steps S915 and S922) for generating write data,
wdata = 0;
This can be realized.

また、設定値拡張の場合には、まず左右の端を拡張する際は、1バイトの設定値presetを用いて生成された4バイト拡張データが書込みデータwdataとなる。
temp=preset&0xFF;
wdata=(temp<<24)|(temp<<16)|(temp<<8)|temp;
In the case of setting value extension, when the left and right ends are first extended, 4-byte extension data generated using a 1-byte setting value preset becomes the write data wdata.
temp = preset &0xFF;
wdata = (temp << 24) | (temp << 16) | (temp << 8) | temp;

また、近傍拡張の例では第11行目(ステップS917)においてバッファ173の4バイトデータをローカルメモリ160に書込んでいるが、設定値拡張において上下の端の拡張の端を拡張する際は、条件によってはバッファ173の値は用いられない。すなわち、上タップ(U)651が「0」より大きい場合、または、上タップ(U)651および矩形領域垂直サイズ(V)630がともに「0」以下の場合には、バッファ173の値は用いられず、上述の左右の端拡張と同様に4バイト拡張データが用いられる。   In the example of neighborhood extension, 4-byte data in the buffer 173 is written to the local memory 160 in the eleventh line (step S917), but when extending the upper and lower ends of extension in the setting value extension, Depending on the conditions, the value of the buffer 173 is not used. That is, when the upper tap (U) 651 is larger than “0”, or when both the upper tap (U) 651 and the rectangular area vertical size (V) 630 are “0” or less, the value of the buffer 173 is used. Instead, 4-byte extension data is used in the same manner as the left and right end extensions described above.

図12は、本発明の実施の形態におけるローカルメモリ160からフレームメモリ140へのDMA転送の処理手順例を示す図である。   FIG. 12 is a diagram showing an example of a processing procedure for DMA transfer from the local memory 160 to the frame memory 140 in the embodiment of the present invention.

この方向の転送は端の拡張を行う必要がないため、上タップ(U)651、下タップ(D)652、左タップ(L)653および右タップ(R)654の設定は無視される。矩形領域垂直サイズ(V)630にはLPF演算後の矩形領域の垂直サイズ「48」が設定される。同様に、矩形領域水平サイズ(H)640にはLPF演算後の矩形領域の水平サイズ「48」が設定される。さらに、フレームメモリ水平サイズ(W)660には「2048」が設定される。   Since the transfer in this direction does not require end extension, the settings of the upper tap (U) 651, the lower tap (D) 652, the left tap (L) 653, and the right tap (R) 654 are ignored. In the rectangular area vertical size (V) 630, the vertical size “48” of the rectangular area after the LPF calculation is set. Similarly, in the rectangular area horizontal size (H) 640, the horizontal size “48” of the rectangular area after the LPF calculation is set. Further, “2048” is set in the frame memory horizontal size (W) 660.

転送の制御は、DMA制御部170内部の転送制御部176によって行われる。制御レジスタ171にローカルメモリ160からフレームメモリ140へのストアを指示する転送コマンド「10」が書き込まれると、転送制御部176は以下の手順により転送を指示する。   The transfer control is performed by the transfer control unit 176 in the DMA control unit 170. When a transfer command “10” for instructing storage from the local memory 160 to the frame memory 140 is written in the control register 171, the transfer control unit 176 instructs transfer according to the following procedure.

転送制御部176は、まず矩形領域垂直サイズ(V)630が正か否かを判断する(ステップS941)。矩形領域垂直サイズ(V)630が正である場合にはステップS942に進み、それ以外の場合にはDMA転送処理を終了する。   The transfer control unit 176 first determines whether or not the rectangular area vertical size (V) 630 is positive (step S941). If the rectangular area vertical size (V) 630 is positive, the process proceeds to step S942, and otherwise, the DMA transfer process ends.

そして、転送制御部176は、制御レジスタ171のデータのうち、矩形領域水平サイズ(H)640およびフレームメモリ開始アドレス(AF)610の各レジスタの値を、内部レジスタ177に保持する(ステップS942)。   Then, the transfer control unit 176 holds the values of the registers of the rectangular area horizontal size (H) 640 and the frame memory start address (AF) 610 among the data of the control register 171 in the internal register 177 (step S942). .

ライン転送では、転送制御部176は、矩形領域水平サイズ(H0)740が正か否かを判断する(ステップS943)。矩形領域水平サイズ(H0)740が正である場合にはステップS944に進み、それ以外の場合にはステップS947に進む。矩形領域水平サイズ(H0)740が正である場合、ローカルメモリ160から4バイトのデータが読み出される(ステップS944)。このとき、ローカルメモリ160側のアドレスには、ローカルメモリ開始アドレス(AL)620が用いられる。そして、ローカルメモリ開始アドレス(AL)620に「4」が加算される(ステップS944)。この読み出された4バイトのデータは、フレームメモリ140に書き込まれる(ステップS945)。このとき、フレームメモリ140側のアドレスには、フレームメモリ開始アドレス(AF0)710が用いられる。そして、フレームメモリ開始アドレス(AF0)710に「4」が加算される(ステップS945)。また、矩形領域水平サイズ(H0)740から「4」が減算されて(ステップS946)、ステップS943に戻る。このように、ステップS943乃至S946を繰り返すことにより、1ライン分の転送が行われる。   In line transfer, the transfer control unit 176 determines whether or not the rectangular area horizontal size (H0) 740 is positive (step S943). If the rectangular area horizontal size (H0) 740 is positive, the process proceeds to step S944. Otherwise, the process proceeds to step S947. When the rectangular area horizontal size (H0) 740 is positive, 4-byte data is read from the local memory 160 (step S944). At this time, the local memory start address (AL) 620 is used as the address on the local memory 160 side. Then, “4” is added to the local memory start address (AL) 620 (step S944). The read 4-byte data is written into the frame memory 140 (step S945). At this time, the frame memory start address (AF0) 710 is used as the address on the frame memory 140 side. Then, “4” is added to the frame memory start address (AF0) 710 (step S945). Further, “4” is subtracted from the rectangular area horizontal size (H0) 740 (step S946), and the process returns to step S943. As described above, by repeating steps S943 to S946, transfer for one line is performed.

矩形領域水平サイズ(H0)740正ではなくなると、次のラインの転送のために、矩形領域垂直サイズ(V)630から「1」が減算される(ステップS947)。そして、フレームメモリ開始アドレス(AF)610にフレームメモリ水平サイズ(W)660が加算されて、最初の処理(ステップS941)に戻る(ステップS947)。このように、矩形領域垂直サイズ(V)630が正である間、ステップS941乃至S947が繰り返されて、最終的には矩形領域のDMA転送が完了する。転送の終了は転送制御部176からCPU110に割込みとして通知される。   When the rectangular area horizontal size (H0) 740 is not positive, “1” is subtracted from the rectangular area vertical size (V) 630 for the next line transfer (step S947). Then, the frame memory horizontal size (W) 660 is added to the frame memory start address (AF) 610, and the process returns to the first process (step S941) (step S947). As described above, while the rectangular area vertical size (V) 630 is positive, steps S941 to S947 are repeated, and finally the DMA transfer of the rectangular area is completed. The end of the transfer is notified from the transfer control unit 176 to the CPU 110 as an interrupt.

図13は、本発明の実施の形態におけるローカルメモリ160からフレームメモリ140へのDMA転送処理を行うプログラムの一例を示す図である。   FIG. 13 is a diagram showing an example of a program for performing a DMA transfer process from the local memory 160 to the frame memory 140 in the embodiment of the present invention.

第1行目のwhile文は、矩形領域垂直サイズ(V)630が正である間、第8行目までのループを形成するものであり、ステップS941に対応する。第2行目は、内部レジスタ177を初期化するものであり、ステップS942に対応する。   The while statement on the first line forms a loop up to the eighth line while the rectangular area vertical size (V) 630 is positive, and corresponds to step S941. The second line initializes the internal register 177 and corresponds to step S942.

第3行目のwhile文は、矩形領域水平サイズ(H0)740が正である間、第6行目までのループを形成するものであり、ステップS943に対応する。第4行目は、ローカルメモリ160から読み出されたデータをフレームメモリ140に書き込むものである。このとき、ローカルメモリ160側のアドレスにはローカルメモリ開始アドレス(AL)620がポインタとして用いられ、フレームメモリ140側のアドレスにはフレームメモリ開始アドレス(AF0)710がポインタとして用いられる。そして、ローカルメモリ開始アドレス(AL)620およびフレームメモリ開始アドレス(AF0)710はそれぞれ1つ(4バイト分)進められる。この第4行目は、ステップS944乃至S945に対応する。第5行目は、矩形領域水平サイズ(H0)740から「4」を減算するものであり、ステップS946に対応する。   The while statement in the third line forms a loop up to the sixth line while the rectangular area horizontal size (H0) 740 is positive, and corresponds to step S943. The fourth line is for writing data read from the local memory 160 to the frame memory 140. At this time, the local memory start address (AL) 620 is used as a pointer for the address on the local memory 160 side, and the frame memory start address (AF0) 710 is used for the address on the frame memory 140 side. Then, the local memory start address (AL) 620 and the frame memory start address (AF0) 710 are each advanced by one (4 bytes). The fourth line corresponds to steps S944 to S945. The fifth line is for subtracting “4” from the rectangular area horizontal size (H0) 740 and corresponds to step S946.

第7行目は、次のラインの転送のために、フレームメモリ開始アドレス(AF)610にフレームメモリ水平サイズ(W)660を加算するとともに、矩形領域垂直サイズ(V)630から「1」を減算するものであり、ステップS947に対応する。   The seventh line adds the frame memory horizontal size (W) 660 to the frame memory start address (AF) 610 and transfers “1” from the rectangular area vertical size (V) 630 to transfer the next line. This is to be subtracted and corresponds to step S947.

図14は、本発明の実施の形態における転送されるデータのデータ幅と端拡張との関係例を示す図である。   FIG. 14 is a diagram illustrating a relationship example between the data width of the transferred data and the end extension according to the embodiment of the present invention.

図14(a)は、転送されるデータのデータ幅が1バイトの場合に、左端拡張を行う例を示している。この例では、1バイトのデータ「Y0」が左端のデータであるため、「Y0」を4つ接続したものが4バイトの拡張データとなる。画像データが1バイトの輝度のみの場合がこれに該当する。上述の図11のプログラム例もデータ幅は1バイトであり、プログラム例の第6乃至7行が左端拡張を行っている部分である。
temp=(data&0xFF);
wdata=(temp<<24)|(temp<<16)|(temp<<8)|temp;
FIG. 14A shows an example in which the left end expansion is performed when the data width of the transferred data is 1 byte. In this example, 1-byte data “Y0” is the leftmost data, so that four “Y0” connected are 4-byte extension data. This is the case when the image data has only 1-byte luminance. The above-described program example of FIG. 11 also has a data width of 1 byte, and the sixth to seventh lines of the program example are portions where left end expansion is performed.
temp = (data &0xFF);
wdata = (temp << 24) | (temp << 16) | (temp << 8) | temp;

図14(b)は、転送されるデータのデータ幅が1バイトの場合に、右端拡張を行う例を示している。この例では、1バイトのデータ「Y3」が右端のデータであるため、「Y3」を4つ接続したものが4バイトの拡張データとなる。図11のプログラム例における第15乃至16行が右端拡張を行っている部分である。
temp=(data>>24)&0xFF;
wdata=(temp<<24)|(temp<<16)|(temp<<8)|temp;
FIG. 14B shows an example in which right end expansion is performed when the data width of the transferred data is 1 byte. In this example, 1-byte data “Y3” is the rightmost data, so that four “Y3” connected are 4-byte extension data. The 15th to 16th lines in the program example of FIG.
temp = (data >> 24) &0xFF;
wdata = (temp << 24) | (temp << 16) | (temp << 8) | temp;

図14(c)は、転送されるデータのデータ幅が2バイトの場合に、左端拡張を行う例を示している。この例では、2バイトのデータ「Y0a」「Y0b」が左端のデータであるため、「Y0a」「Y0b」を2つ接続したものが4バイトの拡張データとなる。具体的には、1画素が2バイト長の輝度信号を扱う場合が該当する。また、1バイト長の色差信号CbおよびCrが順に並んでいて、CbとCrを合わせて2バイトとして扱う場合もこれに該当する。この場合のプログラムは以下のようになる。
temp=(data&0xFFFF);
wdata=(temp<<16)temp;
FIG. 14C shows an example in which the left end extension is performed when the data width of the transferred data is 2 bytes. In this example, since the 2-byte data “Y0a” and “Y0b” are the leftmost data, a combination of two “Y0a” and “Y0b” becomes 4-byte extension data. Specifically, this corresponds to a case where a pixel handles a 2-byte long luminance signal. This is also the case when the 1-byte long color difference signals Cb and Cr are arranged in order, and Cb and Cr are combined and handled as 2 bytes. The program in this case is as follows.
temp = (data &0xFFFF);
wdata = (temp << 16) temp;

図14(d)は、転送されるデータのデータ幅が2バイトの場合に、右端拡張を行う例を示している。この例では、2バイトのデータ「Y1a」「Y1b」が右端のデータであるため、「Y1a」「Y1b」を2つ接続したものが4バイトの拡張データとなる。この場合のプログラムは以下のようになる。
temp=(data>>16)&0xFFFF;
wdata=(temp<<16)temp;
FIG. 14D shows an example in which right end expansion is performed when the data width of transferred data is 2 bytes. In this example, since the 2-byte data “Y1a” and “Y1b” are the rightmost data, the data obtained by connecting two “Y1a” and “Y1b” is the 4-byte extension data. The program in this case is as follows.
temp = (data >> 16) &0xFFFF;
wdata = (temp << 16) temp;

図14(e)は、転送されるデータのデータ幅が4バイトの場合に、左端拡張を行う例を示している。この例では、4バイトのデータ「Y0a」「Y0b」「Y0c」「Y0d」が左端のデータであるため、「Y0a」「Y0b」「Y0c」「Y0d」が4バイトの拡張データとなる。具体的には、RGBの他に透過率を表すαを追加した4つの1バイトデータを1画素に割り当てる場合がこれに該当する。   FIG. 14E shows an example in which left end expansion is performed when the data width of transferred data is 4 bytes. In this example, since 4-byte data “Y0a”, “Y0b”, “Y0c”, and “Y0d” are the leftmost data, “Y0a”, “Y0b”, “Y0c”, and “Y0d” are 4-byte extension data. Specifically, this corresponds to the case where four 1-byte data to which α representing transmittance is added in addition to RGB is assigned to one pixel.

図14(f)は、転送されるデータのデータ幅が4バイトの場合に、右端拡張を行う例を示している。この例では、4バイトのデータ「Y0a」「Y0b」「Y0c」「Y0d」が右端のデータであるため、「Y0a」「Y0b」「Y0c」「Y0d」が4バイトの拡張データとなる。したがって、これら図14(e)および(f)の場合のプログラムは何れも以下のようになる。
wdata=data;
FIG. 14F shows an example in which right end expansion is performed when the data width of the transferred data is 4 bytes. In this example, since 4-byte data “Y0a”, “Y0b”, “Y0c”, and “Y0d” are the rightmost data, “Y0a”, “Y0b”, “Y0c”, and “Y0d” are 4-byte extension data. Accordingly, the programs in FIGS. 14E and 14F are as follows.
wdata = data;

このようなデータ幅に応じたデータの並び替えは、データ整列部174において行われる。データ幅の値は、図7に示した制御レジスタ171の転送制御レジスタ(CTL)670のデータ幅に保持されており、この値に応じて転送制御部176からデータ整列部174に並び替えの指示がされる。   The data sorting according to the data width is performed in the data sorting unit 174. The data width value is held in the data width of the transfer control register (CTL) 670 of the control register 171 shown in FIG. 7, and the transfer control unit 176 instructs the data alignment unit 174 to rearrange according to this value. Is done.

なお、ここでは、近傍拡張の場合のデータ幅と端拡張との関係例について説明したが、設定値拡張においても同様に適用可能である。例えば、設定値拡張において2バイト長のデータを扱う場合は、設定値presetは2バイト分設定し、以下のように拡張データが生成される。
temp=preset&0xFFFF;
wdata= (temp<<16)|temp;
なお、図15は、本発明の実施の形態において2バイトの設定値拡張を行った例を示す図である。
Here, an example of the relationship between the data width and end extension in the case of neighborhood extension has been described, but the present invention can be similarly applied to setting value extension. For example, in the case of handling 2-byte data in setting value extension, the setting value preset is set for 2 bytes, and extension data is generated as follows.
temp = preset &0xFFFF;
wdata = (temp << 16) | temp;
FIG. 15 is a diagram illustrating an example in which a 2-byte set value extension is performed in the embodiment of the present invention.

また、設定値拡張において4バイト長のデータを扱う場合は、設定値presetは4バイト分設定し、4バイトデータをそのまま書き込む。
wdata= preset;
Also, when handling 4-byte length data in the set value extension, the set value preset is set for 4 bytes, and the 4-byte data is written as it is.
wdata = preset;

図16は、本発明の実施の形態における転送されるデータのデータ幅と端拡張との他の関係例を示す図である。   FIG. 16 is a diagram showing another example of the relationship between the data width of transferred data and end extension in the embodiment of the present invention.

画像データの端拡張の態様としては、他にも、輝度色差データに対応することが考えられる。輝度色差データ{Y0、Cb、Y0、Cr}の並びにより、4つの1バイトデータで2画素を表す場合がある。この場合、左端拡張を行う際には、図16(a)のように左端の輝度「Y0」を2画素分拡張して、色差については2画素を代表する「Cb」「Cr」を用いることができる。一方、右端拡張を行う際には、図16(b)のように右端の輝度「Y1」を2画素分拡張して、色差については2画素を代表する「Cb」「Cr」を同様に用いることができる。これらの並び替えもデータ整列部174において行われる。   As another aspect of the edge extension of the image data, it is conceivable to deal with luminance color difference data. There are cases in which two pixels are represented by four 1-byte data based on the sequence of luminance and color difference data {Y0, Cb, Y0, Cr}. In this case, when performing left end expansion, the left end luminance “Y0” is expanded by two pixels as shown in FIG. 16A, and “Cb” and “Cr” representing two pixels are used for the color difference. Can do. On the other hand, when performing the right end expansion, the right end luminance “Y1” is expanded by two pixels as shown in FIG. 16B, and “Cb” and “Cr” representing two pixels are similarly used for the color difference. be able to. These rearrangements are also performed in the data alignment unit 174.

このように、本発明の実施の形態によれば、フレームメモリ140からバッファ173に転送されたデータをデータ整列部174によって並び替えてローカルメモリ160に転送することにより、DMA転送と並行して端拡張処理を行うことができる。これにより、端拡張処理に要する時間を隠蔽することができ、全体の画像処理時間を短縮することができる。   As described above, according to the embodiment of the present invention, the data transferred from the frame memory 140 to the buffer 173 is rearranged by the data alignment unit 174 and transferred to the local memory 160, so that the data is transferred in parallel with the DMA transfer. Extended processing can be performed. Thereby, the time required for the edge extension processing can be concealed, and the entire image processing time can be shortened.

また、本発明の実施の形態によれば、より簡単なプログラムによって画像処理の端拡張を行うことができるため、プログラムコードを削減することができる。これにより、プログラムを格納するメモリの使用量を減少させることができる。   Further, according to the embodiment of the present invention, the end of image processing can be performed by a simpler program, so that the program code can be reduced. As a result, the amount of memory used to store the program can be reduced.

なお、本発明の実施の形態では、説明を簡単にするために最小限の機能のDMACを示したが、端拡張が実現できれば一般に広く知られているDMACの機能が搭載されていても構わない。   In the embodiment of the present invention, the DMAC having the minimum function is shown for the sake of simplicity. However, a generally well-known DMAC function may be installed as long as the end extension can be realized. .

一般的なDMACは、転送を高速に行うためにバースト機能を用いている。本発明の実施の形態では4バイト長の転送のみを示したが、バッファ173を、例えば16バイト幅のバッファにより構成し、バースト転送が可能か否かを転送制御部176が判断し、転送可能な場合は4バイトの4バースト転送を発行するように制御すると、より性能の高いDMACを実現することができる。   A general DMAC uses a burst function in order to perform transfer at high speed. In the embodiment of the present invention, only transfer of 4 bytes length is shown, but the buffer 173 is configured by a buffer of 16 bytes width, for example, and the transfer control unit 176 determines whether burst transfer is possible and transfer is possible. In such a case, if the control is performed so that 4-burst transfer of 4 bytes is issued, a higher-performance DMAC can be realized.

一般的なDMACでは、4バイト単位に限らず1バイト単位や2バイト単位の転送サイズを指定することができ、転送サイズに合わせたアドレスも指定可能である。本発明の実施の形態では4バイト境界のみサポートすることを想定したが、他の単位の転送に対応してもよい。   In a general DMAC, a transfer size in units of 1 byte or 2 bytes can be specified without being limited to a unit of 4 bytes, and an address corresponding to the transfer size can also be specified. In the embodiment of the present invention, it is assumed that only a 4-byte boundary is supported, but other units of transfer may be supported.

一般的なDMACは、同一バス間の転送をサポートし、転送の仕様は対称の場合が多い。本発明の実施の形態では、DMACをフレームメモリとローカルメモリとの間の転送のみに用いたが、同一メモリ間の転送に用いるようにしてもよい。また、本発明の実施の形態では、端拡張はフレームメモリからローカルメモリへの転送の場合のみ対応し、矩形領域もフレームメモリだけという非対称な仕様を想定したが、それ以外のメモリ転送でも対応して対称な仕様にしてもよい。例えば、ローカルメモリも矩形領域転送に対応している場合には、フィルタ処理の際に画素を詰める必要がなくなり、処理が平易になる利点がある。本発明の実施の形態では、非対称の仕様としたため、上述のようにフローチャートが2種類存在したが、フレームメモリからローカルメモリへ転送する図9および図10のフローチャートに合わせて他の転送も制御するようにしてもよい。   A general DMAC supports transfer between the same buses, and the transfer specifications are often symmetric. In the embodiment of the present invention, the DMAC is used only for the transfer between the frame memory and the local memory, but may be used for the transfer between the same memories. Further, in the embodiment of the present invention, the end extension corresponds only to the case of transfer from the frame memory to the local memory, and the asymmetric specification in which the rectangular area is only the frame memory is assumed, but other types of memory transfer are also supported. The specifications may be symmetrical. For example, when the local memory also supports rectangular area transfer, there is an advantage that the processing is simplified because it is not necessary to pack pixels in the filtering process. In the embodiment of the present invention, since the specification is asymmetric, there are two types of flowcharts as described above, but other transfers are also controlled in accordance with the flowcharts of FIGS. 9 and 10 for transferring from the frame memory to the local memory. You may do it.

公知のDMACの中には、バイトスワップ機能を備えているものもある。例えば、バイト長のデータのエンディアンを切り替える場合、{Y0、Y1、Y2、Y3}として転送されたデータを{Y3、Y2、Y1、Y0}に並び替える。本発明の実施の形態におけるDMA制御部170もバイトスワップ機能を備えてもよい。その場合、端拡張の並び替えとバイトスワップの並び替えを統合して、回路規模を削減することができる。並び替えの指定は、転送制御部176が判断し、データ整列部174に指示する。   Some known DMACs have a byte swap function. For example, when the endian of byte-length data is switched, the data transferred as {Y0, Y1, Y2, Y3} is rearranged to {Y3, Y2, Y1, Y0}. The DMA control unit 170 in the embodiment of the present invention may also have a byte swap function. In this case, the circuit scale can be reduced by integrating the rearrangement of the end extension and the rearrangement of the byte swap. The designation of the rearrangement is determined by the transfer control unit 176 and instructed to the data alignment unit 174.

公知のDMACの中には、DMA転送に必要なレジスタ設定をリストとしてメモリ上に生成しておき、そのアドレスを制御レジスタに設定しておき、転送が終わると次のリストを読み出し、自動的に次の転送を開始するリンクリスト機能を備えたものもある。本発明の実施の形態におけるDMA制御部170もリンクリスト機能を備えてもよい。DMA転送中にCPUがリンクリストを生成できるため、DMA転送の設定にかかる処理時間を裏に隠すことができ、さらに処理を高速に行うことが可能になる。   Among known DMACs, register settings necessary for DMA transfer are generated as a list on a memory, the address is set in a control register, the next list is read automatically after transfer is completed, and automatically Some have a linked list function that initiates the next transfer. The DMA control unit 170 in the embodiment of the present invention may also have a link list function. Since the CPU can generate the link list during the DMA transfer, the processing time required for the DMA transfer setting can be hidden, and the processing can be performed at high speed.

なお、本発明の実施の形態では、タップ数として上下左右の4つを想定したが、これに限られるものではない。通常は上下両方に拡張することはないため、例えば垂直タップレジスタを1つだけ用意し、負の値であれば上側の拡張を意味し、正の値であれば下側の拡張を意味し、「0」であれば上下方向には拡張しないことを意味するような仕様にしてもよい。水平の端拡張も同様である。この仕様により、設定すべきレジスタの数を減らすことができる。   In the embodiment of the present invention, the number of taps is assumed to be four, up, down, left and right, but is not limited to this. Normally, it does not expand both up and down, so for example, only one vertical tap register is prepared, a negative value means an upper expansion, a positive value means a lower expansion, If “0”, the specification may mean that it does not expand in the vertical direction. The same applies to the horizontal end extension. This specification can reduce the number of registers to be set.

本発明の実施の形態では、端拡張処理を伴う転送の設定の際に、矩形サイズと先頭アドレスは有効画素部分について指定したが、無効部分を合わせた全体に対して矩形サイズを指定する仕様にしてもよい。ここで、図17に示すように、無効部分を合わせた全体に対して矩形サイズを指定するフレームメモリ開始アドレス(AF')611、矩形領域垂直サイズ(V')631および矩形領域水平サイズ(H')641を想定すると、以下の関係式が成り立つ。
H=H'−(R+L)
V=V'−(U+D)
AF=AF'+ U×H'+L
したがって、転送制御部176において転送開始時に制御レジスタ171の書換えを一度行うように処理すれば、上述の構成によって実現することができる。このような仕様にすることにより、矩形領域が画像の端か否かにかかわらず、矩形領域垂直サイズ(V')631および矩形領域水平サイズ(H')641が同じ値になるため、DMACを設定するプログラムをより平易にすることができる。
In the embodiment of the present invention, the rectangle size and the start address are specified for the effective pixel portion when setting transfer with end extension processing. However, the specification is such that the rectangle size is specified for the entire invalid portion. May be. Here, as shown in FIG. 17, the frame memory start address (AF ′) 611, the rectangular area vertical size (V ′) 631, and the rectangular area horizontal size (H ') Assuming 641, the following relational expression holds.
H = H '-(R + L)
V = V '-(U + D)
AF = AF ′ + U × H ′ + L
Therefore, if the transfer control unit 176 performs processing such that the control register 171 is rewritten once at the start of transfer, the above configuration can be realized. With this specification, the rectangular area vertical size (V ′) 631 and the rectangular area horizontal size (H ′) 641 have the same value regardless of whether the rectangular area is the end of the image. The program to be set can be made simpler.

本発明の実施の形態のDMA制御部170は、制御レジスタ171の値を直接書き換えることにより転送を制御したが、制御レジスタ171をもう1セット内部に備えて、DMA転送の最初に全レジスタを取り込むようにしてもよい。このように構成することにより、CPUから認識されるレジスタの値はDMA転送を行っても値が変化しないため、矩形領域垂直サイズ(V)630および矩形領域水平サイズ(H)640など値を変える必要がない場合には書換えをしなくてもよくなる。これにより、プログラムを削減することができる。また、DMA転送中も次のDMA転送の設定を行うことが可能になる。   The DMA control unit 170 according to the embodiment of the present invention controls transfer by directly rewriting the value of the control register 171. However, the control register 171 is provided in another set, and all registers are fetched at the beginning of DMA transfer. You may do it. With this configuration, the value of the register recognized by the CPU does not change even when DMA transfer is performed. Therefore, the value of the rectangular area vertical size (V) 630 and the rectangular area horizontal size (H) 640 is changed. When it is not necessary, it is not necessary to rewrite. Thereby, a program can be reduced. It is also possible to set the next DMA transfer during the DMA transfer.

本発明の実施の形態では、プロセッサと並列に動作することができるDMA転送中に端拡張も同時に行うため、端拡張にかかる処理時間を隠蔽することが可能になる。特に、2次元データを高速に処理する画像処理LSIに有効であり、画像処理LSIを搭載した、デジタルカメラやデジタルビデオカメラ、ゲーム機などに応用することができる。   In the embodiment of the present invention, the end extension is performed simultaneously during the DMA transfer that can operate in parallel with the processor, so that the processing time for the end extension can be hidden. In particular, it is effective for an image processing LSI that processes two-dimensional data at high speed, and can be applied to a digital camera, a digital video camera, a game machine, or the like equipped with the image processing LSI.

なお、本発明の実施の形態は本発明を具現化するための一例を示したものであり、上述のように特許請求の範囲における発明特定事項とそれぞれ対応関係を有する。ただし、本発明は実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変形を施すことができる。   The embodiment of the present invention is an example for embodying the present invention, and has a corresponding relationship with the invention-specific matters in the claims as described above. However, the present invention is not limited to the embodiments, and various modifications can be made without departing from the scope of the present invention.

また、本発明の実施の形態において説明した処理手順は、これら一連の手順を有する方法として捉えてもよく、また、これら一連の手順をコンピュータに実行させるためのプログラム乃至そのプログラムを記憶する記録媒体として捉えてもよい。この記録媒体として、例えば、CD(Compact Disc)、MD(MiniDisc)、DVD(Digital Versatile Disk)、メモリカード、ブルーレイディスク(Blu-ray Disc(登録商標))等を用いることができる。   The processing procedure described in the embodiment of the present invention may be regarded as a method having a series of these procedures, and a program for causing a computer to execute the series of procedures or a recording medium storing the program May be taken as As this recording medium, for example, a CD (Compact Disc), an MD (MiniDisc), a DVD (Digital Versatile Disk), a memory card, a Blu-ray Disc (registered trademark), or the like can be used.

本発明の実施の形態におけるデータ転送装置の一構成例を示す図である。It is a figure which shows one structural example of the data transfer apparatus in embodiment of this invention. 本発明の実施の形態におけるDMA制御部170の一構成例を示す図である。It is a figure which shows the example of 1 structure of the DMA control part 170 in embodiment of this invention. 本発明の実施の形態における制御レジスタ171のアドレスマップの一例を示す図である。It is a figure which shows an example of the address map of the control register 171 in embodiment of this invention. 本発明の実施の形態における1フレームの画像データを示す図である。It is a figure which shows the image data of 1 frame in embodiment of this invention. 本発明の実施の形態における端拡張の指定例を示す図である。It is a figure which shows the example of designation | designated of the end extension in embodiment of this invention. 本発明の実施の形態における端拡張方法の種別を示す図である。It is a figure which shows the classification of the edge expansion method in embodiment of this invention. 本発明の実施の形態における転送制御レジスタ(CTL)670のフィールド構成例を示す図である。It is a figure which shows the example of a field structure of the transfer control register (CTL) 670 in embodiment of this invention. 本発明の実施の形態におけるローカルメモリ160における画像データの遷移例を示す図である。It is a figure which shows the example of a transition of the image data in the local memory 160 in embodiment of this invention. 本発明の実施の形態におけるフレームメモリ140からローカルメモリ160へのDMA転送の処理手順例の前半を示す図である。It is a figure which shows the first half of the example of a process sequence of the DMA transfer from the frame memory 140 to the local memory 160 in embodiment of this invention. 本発明の実施の形態におけるフレームメモリ140からローカルメモリ160へのDMA転送の処理手順例の後半を示す図である。It is a figure which shows the second half of the example of a process sequence of the DMA transfer from the frame memory 140 to the local memory 160 in embodiment of this invention. 本発明の実施の形態におけるフレームメモリ140からローカルメモリ160へのDMA転送処理を行うプログラムの一例を示す図である。It is a figure which shows an example of the program which performs the DMA transfer process from the frame memory 140 to the local memory 160 in embodiment of this invention. 本発明の実施の形態におけるローカルメモリ160からフレームメモリ140へのDMA転送の処理手順例を示す図である。It is a figure which shows the example of a process sequence of the DMA transfer from the local memory 160 to the frame memory 140 in embodiment of this invention. 本発明の実施の形態におけるローカルメモリ160からフレームメモリ140へのDMA転送処理を行うプログラムの一例を示す図である。It is a figure which shows an example of the program which performs the DMA transfer process from the local memory 160 to the frame memory 140 in embodiment of this invention. 本発明の実施の形態における転送されるデータのデータ幅と端拡張との関係例を示す図である。It is a figure which shows the example of a relationship between the data width of the data transferred, and an end extension in embodiment of this invention. 本発明の実施の形態において2バイトの設定値拡張を行った例を示す図である。It is a figure which shows the example which performed the setting value extension of 2 bytes in embodiment of this invention. 本発明の実施の形態における転送されるデータのデータ幅と端拡張との他の関係例を示す図である。It is a figure which shows the other example of a relationship between the data width of the data transferred in the embodiment of the present invention, and end extension. 本発明の実施の形態における端拡張の他の指定例を示す図である。It is a figure which shows the other example of an end extension in embodiment of this invention.

符号の説明Explanation of symbols

110 CPU
120 ROM
130 画像信号入出力部
140 フレームメモリ
160 ローカルメモリ
170 DMA制御部
171 制御レジスタ
172 バス制御部
173 バッファ
174 データ整列部
175 データ制御部
176 転送制御部
177 内部レジスタ
190 バス
610 フレームメモリ開始アドレス(AF)
620 ローカルメモリ開始アドレス(AL)
630 矩形領域垂直サイズ(V)
640 矩形領域水平サイズ(H)
651 上タップ(U)
652 下タップ(D)
653 左タップ(L)
654 右タップ(R)
660 フレームメモリ水平サイズ(W)
670 転送制御レジスタ(CTL)
680 設定値レジスタ(PR)
110 CPU
120 ROM
130 Image signal input / output unit 140 Frame memory 160 Local memory 170 DMA control unit 171 Control register 172 Bus control unit 173 Buffer 174 Data alignment unit 175 Data control unit 176 Transfer control unit 177 Internal register 190 Bus 610 Frame memory start address (AF)
620 Local memory start address (AL)
630 Rectangular area vertical size (V)
640 Horizontal size of rectangular area (H)
651 Upper tap (U)
652 Lower tap (D)
653 Left tap (L)
654 Right tap (R)
660 frame memory horizontal size (W)
670 Transfer control register (CTL)
680 Set value register (PR)

Claims (5)

二次元構造のデータを含む矩形領域を保持する転送元メモリから前記矩形領域のデータを読み出して保持するデータ保持部と、
前記矩形領域における端の拡張幅を設定する拡張幅設定部と、
前記設定された拡張幅に応じて前記データ保持部に保持されたデータを整列して前記矩形領域における端の拡張データを生成するデータ整列部と、
前記データ保持部に保持されたデータおよび前記拡張データを転送先メモリに転送するデータ転送部と
を具備し、
前記データ整列部は、前記二次元構造のデータの近傍の端のデータを前記拡張データとして使用する
データ転送装置。
A data holding unit that reads and holds data of the rectangular area from a transfer source memory that holds a rectangular area including data of a two-dimensional structure ;
An extension width setting unit for setting an extension width of an end in the rectangular area;
A data alignment unit for aligning data held in the data holding unit according to the set extension width to generate extended data at an end in the rectangular area;
A data transfer unit for transferring the data held in the data holding unit and the extension data to a transfer destination memory ;
The data alignment unit, wherein the data alignment unit uses end data in the vicinity of the two-dimensional structure data as the extension data .
前記矩形領域は複数の画素に対応する画像データを含み、
前記データ整列部は、画素を単位として前記画像データを整列して前記矩形領域における端の拡張データを生成する請求項1記載のデータ転送装置。
The rectangular area includes image data corresponding to a plurality of pixels,
The data transfer device according to claim 1, wherein the data alignment unit aligns the image data in units of pixels to generate extended data at an end in the rectangular area.
二次元構造のデータを含む矩形領域を保持する転送元メモリから前記矩形領域のデータを読み出して保持するデータ保持部と、
前記矩形領域における端の拡張幅を設定する拡張幅設定部と、
前記矩形領域における端の拡張モードを設定する拡張モード設定部と、
前記矩形領域における端に拡張される設定データを保持する設定データ保持部と、
前記設定された拡張幅および前記拡張モードに応じて前記データ保持部に保持された前記二次元構造のデータの近傍の端のデータ、ゼロ値データまたは前記設定データを整列して前記矩形領域における端の拡張データを生成するデータ整列部と、
前記データ保持部に保持されたデータおよび前記拡張データを転送先メモリに転送するデータ転送部と
を具備するデータ転送装置。
A data holding unit that reads and holds data of the rectangular area from a transfer source memory that holds a rectangular area including data of a two-dimensional structure ;
An extension width setting unit for setting an extension width of an end in the rectangular area;
An extension mode setting unit for setting an extension mode of an edge in the rectangular area;
A setting data holding unit that holds setting data extended to an end in the rectangular area;
Wherein in accordance with the set expanded width and the extended mode, the data end in the vicinity of the data of the two-dimensional structure which is held in the data holding unit, in the rectangular region by aligning the zero value data or the configuration data A data alignment unit for generating end extension data;
A data transfer apparatus comprising: a data transfer unit that transfers data held in the data holding unit and the extension data to a transfer destination memory.
二次元構造のデータを含む矩形領域を保持する転送元メモリから前記矩形領域のデータを読み出す際の前記矩形領域における端の拡張幅を設定する拡張幅設定手順と、
前記転送元メモリから前記矩形領域のデータを読み出すデータ読出し手順と、
前記設定された拡張幅に応じて前記読み出されたデータを整列して前記矩形領域における端の拡張データを生成するデータ整列手順と、
前記読み出されたデータおよび前記拡張データを転送先メモリに転送するデータ転送手順と
を具備し、
前記データ整列手順において、前記二次元構造のデータの近傍の端のデータを前記拡張データとして使用する
データ転送方法。
An extension width setting procedure for setting an extension width of an end of the rectangular area when reading the data of the rectangular area from a transfer source memory holding a rectangular area including data of a two-dimensional structure ;
A data read procedure for reading data of the rectangular area from the transfer source memory;
A data alignment procedure for aligning the read data according to the set expansion width to generate extended data at an end of the rectangular area;
A data transfer procedure for transferring the read data and the extension data to a transfer destination memory ,
The data transfer method , wherein, in the data alignment procedure, end data in the vicinity of the two-dimensional structure data is used as the extension data .
二次元構造のデータを含む矩形領域を保持する転送元メモリから前記矩形領域のデータを読み出す際の前記矩形領域における端の拡張幅を設定する拡張幅設定手順と、
前記転送元メモリから前記矩形領域のデータを読み出すデータ読出し手順と、
前記設定された拡張幅に応じて前記読み出されたデータを整列して、前記二次元構造のデータの近傍の端のデータを前記矩形領域における端の拡張データとして生成するデータ整列手順と、
前記読み出されたデータおよび前記拡張データを転送先メモリに転送するデータ転送手順と
をコンピュータに実行させるプログラム。
An extension width setting procedure for setting an extension width of an end of the rectangular area when reading the data of the rectangular area from a transfer source memory holding a rectangular area including data of a two-dimensional structure ;
A data read procedure for reading data of the rectangular area from the transfer source memory;
A data alignment procedure for aligning the read data according to the set extension width, and generating end data near the two-dimensional structure data as end extension data in the rectangular area;
A program for causing a computer to execute a data transfer procedure for transferring the read data and the extension data to a transfer destination memory.
JP2008170065A 2008-06-30 2008-06-30 Data transfer device, data transfer method and program Expired - Fee Related JP5163316B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008170065A JP5163316B2 (en) 2008-06-30 2008-06-30 Data transfer device, data transfer method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008170065A JP5163316B2 (en) 2008-06-30 2008-06-30 Data transfer device, data transfer method and program

Publications (2)

Publication Number Publication Date
JP2010009447A JP2010009447A (en) 2010-01-14
JP5163316B2 true JP5163316B2 (en) 2013-03-13

Family

ID=41589828

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008170065A Expired - Fee Related JP5163316B2 (en) 2008-06-30 2008-06-30 Data transfer device, data transfer method and program

Country Status (1)

Country Link
JP (1) JP5163316B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS638951A (en) * 1986-06-30 1988-01-14 Toshiba Corp Information memory device
JP3737943B2 (en) * 2000-11-06 2006-01-25 京セラミタ株式会社 Image processing device

Also Published As

Publication number Publication date
JP2010009447A (en) 2010-01-14

Similar Documents

Publication Publication Date Title
JP4789753B2 (en) Image data buffer device, image transfer processing system, and image data buffer method
US8904069B2 (en) Data processing apparatus and image processing apparatus
JP2001101396A (en) Processor and method for correcting image distortion and medium with program performing image distortion correction processing stored therein
CN111866408A (en) Graphic processing chip and video decoding display method
JP6171591B2 (en) Image processing apparatus and image processing method
JP6442867B2 (en) Image processing apparatus, imaging apparatus, and image processing method
US20120203942A1 (en) Data processing apparatus
JP5163316B2 (en) Data transfer device, data transfer method and program
KR102400104B1 (en) Image processing apparatus and Image processing method
JP4031996B2 (en) Digital still camera with memory device
JP4791399B2 (en) Imaging apparatus and image processing method
JP5327482B2 (en) Image processing apparatus and image processing method
JP6214367B2 (en) Image composition apparatus and image composition program
JP4978356B2 (en) Image reproduction control device, image reproduction control method, and program
US7457470B2 (en) Image processing apparatus
JPH01109432A (en) Memory card writing device
JPS6334658A (en) Dma controller for image processor
KR102522566B1 (en) Electronic devices for and methods of implementing memory transfers for image warping in an electronic device
JP2009100313A (en) Image processing device and image forming apparatus
WO2018220794A1 (en) Data transfer device and data transfer method
JP2006048378A (en) Memory controller and electronic device therewith
JP2823043B2 (en) Image display control device
JP2013109356A (en) Image display driving device and image display system
JP2011061603A (en) Image processing device, and method for processing image
JP4228867B2 (en) Image processing apparatus and control method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110414

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120406

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120417

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120605

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: 20121120

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121203

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

Free format text: PAYMENT UNTIL: 20151228

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20151228

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees