JP2013175074A - Execution method for a plurality of processes - Google Patents

Execution method for a plurality of processes Download PDF

Info

Publication number
JP2013175074A
JP2013175074A JP2012039573A JP2012039573A JP2013175074A JP 2013175074 A JP2013175074 A JP 2013175074A JP 2012039573 A JP2012039573 A JP 2012039573A JP 2012039573 A JP2012039573 A JP 2012039573A JP 2013175074 A JP2013175074 A JP 2013175074A
Authority
JP
Japan
Prior art keywords
processing
data
read
dma
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012039573A
Other languages
Japanese (ja)
Inventor
Masaru Ito
大 伊藤
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.)
Olympus Corp
Original Assignee
Olympus 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 Olympus Corp filed Critical Olympus Corp
Priority to JP2012039573A priority Critical patent/JP2013175074A/en
Publication of JP2013175074A publication Critical patent/JP2013175074A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an execution method for a plurality of processes, capable of reducing deterioration of system performance due to a handshake or a waiting time of processing in a system executing the plurality of processes.SOLUTION: An execution method for a plurality of processes in a data processing system comprising an external memory for storing data, a processor having a plurality of process divisions and a DMA part including a plurality of channels, and a host CPU for instructing execution of a process by each of the process divisions equipped in the processor includes: a read DMA step for starting reading of next data after reading of data corresponding to the process division instructed to execute by the host CPU is all completed; a step for executing the plurality of processes, making the process division instructed to execute by the host CPU execute the process in parallel with read-out of next data; and a write DMA step for starting writing of the resultant data for which process is completed by the process division instructed to execute by the host CPU.

Description

本発明は、複数処理実行方法に関する。特に、自身が割り込み制御機構を持たない、ホストCPUに制御されるプロセッサにおける複数処理の実行方法に関する。   The present invention relates to a multiple processing execution method. In particular, the present invention relates to a method for executing a plurality of processes in a processor controlled by a host CPU that does not have an interrupt control mechanism.

一般的に、予め定めた処理を実行する際に、ホストCPUでは性能が足りず、所望のシステム性能を満足できない場合、補助的に処理性能が高いプロセッサを用いて当該処理を行うことで、システム性能を満足させる方法がとられることがある。このような方法において、対象となる予め定めた処理が複数ある場合には、ホストCPUが実行する処理の優先度を決定し、プロセッサに対して最も優先度が高い処理を実行するよう指示を与える。そして、プロセッサは、指示された処理を完了したときに、ホストCPUに処理が完了したことを通知する。ホストCPUは、プロセッサから処理が完了した通知を受け取ると、プロセッサに対して次に優先度が高い処理を実行するよう指示を与える。このようなホストCPUとプロセッサとのハンドシェークを繰り返しながら、システムにおいて予め定められた複数の処理を実行する(非特許文献1参照)。   In general, when a predetermined process is executed, if the host CPU does not have sufficient performance and the desired system performance cannot be satisfied, the process is supplementarily performed by using a processor having high processing performance. A method may be taken to satisfy the performance. In such a method, when there are a plurality of predetermined processes to be processed, the priority of the process executed by the host CPU is determined, and an instruction is given to the processor to execute the process with the highest priority. . When the instructed process is completed, the processor notifies the host CPU that the process has been completed. When the host CPU receives a notification of completion of processing from the processor, the host CPU instructs the processor to execute processing with the next highest priority. While repeating such handshaking between the host CPU and the processor, a plurality of predetermined processes are executed in the system (see Non-Patent Document 1).

岸田昌巳、“サービス・コールの概要(1)――タスクの生成と終了”、Interface増刊 μITRON準拠TOPPERSの実践活用 インターフェース編集部/編 第15章、CQ出版社、p.181〜198、2007年3月1日発行Shogo Kishida, “Outline of Service Call (1) —Generation and Termination of Tasks”, Interface Special Issue Practical Application of μITRON Compliant TOPPERS Chapter 15, CQ Publisher, p. 181-198, issued March 1, 2007

しかしながら、従来の技術を用いた方法では、システムにおいて実行する処理の数分だけ、ホストCPUとプロセッサとの間のハンドシェークが発生する。一般的に、ハンドシェークは、割り込み処理で行われるため、ホストCPUは、プロセッサから処理が完了した割り込みの通知を受け取ると、ハンドシェークの処理を行うために現在実行中の処理をそのつど中断しなければならない。このため、ハンドシェークに要する処理時間分だけシステム全体の性能が低下してしまう。   However, in the method using the conventional technique, handshaking between the host CPU and the processor occurs by the number of processes executed in the system. In general, handshaking is performed by interrupt processing. Therefore, when the host CPU receives a notification of completion of processing from the processor, the host CPU must interrupt the currently executing processing to perform handshaking processing. Don't be. For this reason, the performance of the entire system is reduced by the processing time required for handshaking.

また、プロセッサが処理を行う場合、プロセッサは、演算(処理)に必要なデータを取得(転送)し、取得したデータをプロセッサ内に備えた内蔵メモリに一時的に記憶する。そして、プロセッサは、内蔵メモリに記憶しているデータを用いてホストCPUから指示された演算を実行し、演算後のデータを出力(転送)する。しかし、プロセッサ内に備える内蔵メモリの容量は、あまり多くないことが想定される。これは、内蔵メモリの容量を多くすることによって、プロセッサの回路規模の増大を防ぐためである。このため、プロセッサは、演算に使用するデータ、または演算した後のデータを、複数回に分けて転送することになる。このとき、プロセッサで実行する処理の内容によっては、例えば、実際に演算を実行する時間よりも、演算に使用するデータを転送する時間の方が、今回実行する処理全体の時間に対して支配的である場合がある。このような場合には、演算に使用するデータの転送が完了するまでの間、プロセッサにおける実際の演算を行うことができず、プロセッサの演算が非効率的になってしまう。   Further, when the processor performs processing, the processor acquires (transfers) data necessary for calculation (processing), and temporarily stores the acquired data in a built-in memory provided in the processor. Then, the processor executes a calculation instructed by the host CPU using the data stored in the built-in memory, and outputs (transfers) the calculated data. However, it is assumed that the capacity of the built-in memory provided in the processor is not so large. This is to prevent an increase in the circuit scale of the processor by increasing the capacity of the built-in memory. For this reason, the processor transfers the data used for the calculation or the data after the calculation in a plurality of times. At this time, depending on the contents of the processing executed by the processor, for example, the time for transferring the data used for the operation is more dominant than the time for the entire processing to be executed this time than the time for actually executing the operation. It may be. In such a case, until the transfer of the data used for the operation is completed, the actual operation in the processor cannot be performed, and the operation of the processor becomes inefficient.

また逆に、プロセッサで実行する処理の内容によっては、例えば、演算に使用するデータを転送する時間よりも、実際に演算を実行する時間の方が、今回実行する処理全体の時間に対して支配的である場合もある。このような場合には、プロセッサにおける実際の演算が完了するまでの間、次に演算に使用するデータの転送を行うことができず、プロセッサのデータ転送が非効率的になってしまう。   On the other hand, depending on the contents of the processing executed by the processor, for example, the time for actually executing the operation dominates the time for the entire processing to be executed this time, rather than the time for transferring the data used for the operation. It can be the target. In such a case, data used for the next calculation cannot be transferred until the actual calculation in the processor is completed, and the data transfer of the processor becomes inefficient.

以下に、従来の技術を用いた方法によるハンドシェークやデータの転送と、システムの処理時間との関係について説明する。図8は、従来のシステムにおけるハンドシェークやデータの転送と、システムの処理時間との関係の一例を模式的に示した図である。図8には、処理Aおよび処理Bの2つの処理を行うシステムの場合を示している。図8において、処理Aは、データの転送時間よりも演算時間の方が長い処理であり、処理Bは、データの転送時間よりも演算時間の方が短い処理である。また、処理Aの方が、処理Bよりも優先度が高い処理である。従って、ホストCPUは、最初に処理Aをプロセッサに実行させ、処理Aが完了した後に処理Bをプロセッサに実行させる。また、図8に示したそれぞれの処理では、処理に使用するデータを3回に分けて取得し、取得したデータに基づいてそれぞれの処理の演算を実行する。なお、図8においては、演算後のデータの転送(出力)は省略している。   The relationship between the handshake and data transfer by the method using the conventional technique and the processing time of the system will be described below. FIG. 8 is a diagram schematically showing an example of the relationship between handshaking and data transfer in the conventional system and the processing time of the system. FIG. 8 shows a system that performs two processes of process A and process B. In FIG. 8, process A is a process having a calculation time longer than the data transfer time, and process B is a process having a calculation time shorter than the data transfer time. Further, the process A is a process having a higher priority than the process B. Accordingly, the host CPU first causes the processor to execute the process A, and after the process A is completed, causes the processor to execute the process B. Moreover, in each process shown in FIG. 8, the data used for a process are acquired in 3 steps, and the calculation of each process is performed based on the acquired data. In FIG. 8, data transfer (output) after calculation is omitted.

まず、システムにおける予め定めた処理を開始する処理開始信号がホストCPUに入力されると、ホストCPUは、プロセッサに対して処理Aを実行するよう指示を与える。プロセッサは、処理Aの実行開始の指示がホストCPUから入力されると、処理Aに使用するデータの転送(取得)を開始する。そして、プロセッサは、1回目の処理Aの演算を実行することができるだけのデータ転送が完了すると、転送されたデータに基づいて1回目の処理Aの演算を開始する。   First, when a process start signal for starting a predetermined process in the system is input to the host CPU, the host CPU instructs the processor to execute the process A. When an instruction to start execution of process A is input from the host CPU, the processor starts transfer (acquisition) of data used for process A. Then, when the data transfer that can execute the calculation of the first process A is completed, the processor starts the calculation of the first process A based on the transferred data.

この処理Aは、上述したように、データの転送時間よりも演算時間の方が長い処理である。このため、例えば、1回目の処理Aの演算が完了していないことによって、2回目のデータ転送に引き続いて3回目のデータ転送を開始することができない場合がある。この場合には、図8に示したように、1回目の処理Aの演算が完了した後に、3回目のデータ転送を開始することになる。すなわち、処理Aでは、1回目の処理Aの演算が完了するまで、3回目のデータ転送を開始することができず、データ転送の待ち時間(転送待ち時間)が発生してしまう。   As described above, the process A is a process in which the calculation time is longer than the data transfer time. For this reason, for example, there is a case where the third data transfer cannot be started following the second data transfer because the calculation of the first process A is not completed. In this case, as shown in FIG. 8, the third data transfer is started after the calculation of the first process A is completed. That is, in the process A, the third data transfer cannot be started until the calculation of the first process A is completed, and a data transfer waiting time (transfer waiting time) occurs.

その後、プロセッサは、処理Aの全てのデータ転送と演算とが完了すると、処理Aが完了した通知を、ホストCPUに出力する。   After that, when all the data transfer and calculation in the process A are completed, the processor outputs a notification that the process A is completed to the host CPU.

続いて、ホストCPUは、プロセッサから処理Aが完了した通知を受け取ると、ハンドシェークの処理を行い、その後、プロセッサに対して次の処理Bを実行するよう指示を与える。プロセッサは、処理Bの実行開始の指示がホストCPUから入力されると、処理Bに使用するデータの転送(取得)を開始する。そして、プロセッサは、1回目の処理Bの演算を実行することができるだけのデータ転送が完了すると、転送されたデータに基づいて1回目の処理Bの演算を開始する。   Subsequently, when the host CPU receives a notification that the process A has been completed from the processor, the host CPU performs a handshake process, and then instructs the processor to execute the next process B. When an instruction to start execution of process B is input from the host CPU, the processor starts transfer (acquisition) of data used for process B. When the data transfer sufficient to execute the first process B operation is completed, the processor starts the first process B operation based on the transferred data.

この処理Bは、上述したように、データの転送時間よりも演算時間の方が短い処理である。このため、例えば、1回目の処理Bの演算が完了した後、2回目の処理Bの演算を実行することができるだけのデータ転送が完了していない場合がある。この場合には、図8に示したように、2回目の処理Bの演算を実行することができるだけのデータ転送が完了した後に、2回目の処理Bの演算を開始することになる。すなわち、処理Bでは、2回目のデータ転送が完了するまで、2回目の処理Bの演算を開始することができず、演算の待ち時間(演算待ち時間)が発生してしまう。   As described above, the process B is a process in which the calculation time is shorter than the data transfer time. For this reason, for example, after the calculation of the first process B is completed, there is a case where the data transfer that can execute the calculation of the second process B is not completed. In this case, as shown in FIG. 8, the calculation of the second process B is started after the data transfer that can execute the calculation of the second process B is completed. That is, in the process B, the calculation of the second process B cannot be started until the second data transfer is completed, and a calculation waiting time (calculation waiting time) occurs.

その後、プロセッサは、処理Bの全てのデータ転送と演算とが完了すると、処理Bが完了した通知を、ホストCPUに出力する。ホストCPUは、プロセッサから処理Bが完了した通知を受け取ると、システムにおける予め定めた処理を完了する。   Thereafter, when all the data transfer and calculation of the process B are completed, the processor outputs a notification that the process B is completed to the host CPU. When the host CPU receives a notification that the process B is completed from the processor, the host CPU completes a predetermined process in the system.

このように、従来の技術を用いた方法によってシステムを構成した場合には、ハンドシェークや待ち時間のような、実際にデータに対する処理を行っていない時間が存在する。この実際にデータに対する処理を行っていない時間は、システムの性能を低下させる要因となってしまう、という問題がある。   As described above, when a system is configured by a method using a conventional technique, there is a time during which data is not actually processed, such as handshaking or waiting time. There is a problem that the time during which data is not actually processed becomes a factor that degrades the performance of the system.

本発明は、上記の課題認識に基づいてなされたものであり、複数の処理を実行するシステムにおいて、ハンドシェークが頻発することや、それぞれの処理内での待ち時間が発生することによるシステム性能の低下を低減することができる複数処理実行方法を提供することを目的としている。   The present invention has been made on the basis of the above-mentioned problem recognition, and in a system that executes a plurality of processes, the system performance deteriorates due to frequent handshaking and the occurrence of waiting time within each process. It is an object of the present invention to provide a multi-process execution method that can reduce the above-described problem.

上記の課題を解決するため、本発明の複数処理実行方法は、データを格納する外部メモリと、前記データに対して処理を施す複数の処理部と、複数の前記処理部のそれぞれに対応した複数のチャンネルを有し、それぞれのチャンネル毎に前記外部メモリにアクセスするDMA部と、を具備したプロセッサと、前記プロセッサに具備されたそれぞれの前記処理部による処理の実行を指示するホストCPUと、を備えたデータ処理システムにおける複数処理実行方法であって、前記ホストCPUによって実行が指示された前記処理部に対応する前記DMA部のデータ読み出し用チャンネルによって、前記外部メモリからの前記データの読み出しが全て完了した後に、該データ読み出し用チャンネルに、前記外部メモリからの次の前記データの読み出しを開始させるリードDMAステップと、前記データ読み出し用チャンネルによる前記外部メモリからの次の前記データの読み出しと並行して、前記ホストCPUによって実行が指示された前記処理部に、前記外部メモリからの読み出しが完了した前記データに対する処理を実行させる複数処理実行ステップと、前記ホストCPUによって実行が指示された前記処理部に対応する前記DMA部のデータ書き込み用チャンネルに、該処理部が処理を完了した結果データの前記外部メモリへの書き込みを開始させるライトDMAステップと、を含む、ことを特徴とする。   In order to solve the above problems, a multiple processing execution method of the present invention includes an external memory that stores data, a plurality of processing units that perform processing on the data, and a plurality of processing units corresponding to the plurality of processing units, respectively. A processor that includes a plurality of channels and a DMA unit that accesses the external memory for each channel, and a host CPU that instructs execution of processing by each of the processing units included in the processor, A plurality of processing execution methods in the data processing system provided, wherein all of the reading of the data from the external memory is performed by the data reading channel of the DMA unit corresponding to the processing unit instructed to be executed by the host CPU. After completion, the next data read channel from the external memory is transferred to the data read channel. In parallel with the read DMA step for starting the data read and the next reading of the data from the external memory by the data read channel, the processing unit instructed to execute by the host CPU is sent from the external memory. The processing unit has completed processing on a plurality of processing execution steps for executing processing on the data that has been read and the data write channel of the DMA unit corresponding to the processing unit that is instructed to execute by the host CPU. A write DMA step for starting writing of the result data to the external memory.

また、本発明の前記リードDMAステップは、前記処理部が前記データに対する処理を実行するか否かの周期を表す、それぞれの前記処理部に対応した実行周期に基づいて、それぞれの前記処理部に対応する前記データ読み出し用チャンネルに、次の前記データの読み出しを開始させるか否かを判定するリードDMA実行判定ステップ、を含み、次の前記データの読み出しを開始させると判定した前記データ読み出し用チャンネルに、次の前記データの読み出しを開始させ、前記データの読み出しを開始させた前記データ読み出し用チャンネルによる前記外部メモリからの次の前記データの読み出しが全て完了した後に、次のリードDMA実行判定ステップを実行し、前記複数処理実行ステップは、前記リードDMA実行判定ステップによって次の前記データの読み出しを開始させるか否かを判定する前に前記データの読み出しを開始させた前記データ読み出し用チャンネルに対応する前記処理部に、前記外部メモリからの読み出しが完了した前記データに対する処理を実行させ、前記ライトDMAステップは、前記データに対する処理を実行した前記処理部に対応する前記データ書き込み用チャンネルに、該処理部が処理を完了した前記結果データの前記外部メモリへの書き込みを開始させる、ことを特徴とする。   Further, the read DMA step of the present invention may be configured so that each of the processing units is based on an execution cycle corresponding to each of the processing units, which represents a cycle of whether or not the processing unit executes processing for the data. A read DMA execution determination step for determining whether or not to start reading the next data in the corresponding data read channel, and the data read channel determined to start reading the next data Next, the next read DMA execution determination step is started after reading of the next data from the external memory by the data read channel that has started reading the data is completed. The multiple processing execution step is executed by the read DMA execution determination step. Before determining whether or not to start reading of the next data, the processing unit corresponding to the data reading channel that has started reading of the data is processed with respect to the data that has been read from the external memory. The write DMA step writes the result data, which has been processed by the processing unit, to the external memory in the data write channel corresponding to the processing unit that has performed the processing on the data. It is characterized by starting.

また、本発明の前記リードDMA実行判定ステップは、前記データ読み出し用チャンネルによって前記データの読み出しを実行するか否かを表す、それぞれの前記データ読み出し用チャンネルに対応したDMA実行状態と、前記処理部によって前記データに対する処理を実行するか否かを表す、それぞれの前記処理部に対応した処理実行状態と、を設定し、次の前記データの読み出しを開始させるか否かを判定する前に、現在の前記DMA実行状態を、前記処理実行状態にコピーすることによって、前記データの読み出しを実行する前記データ読み出し用チャンネルに対応した前記処理部による前記データに対する処理を実行する状態とし、次の前記データの読み出しを開始させるか否かの判定において、前記実行周期が、前記処理部が前記データに対する処理を実行するタイミングであるときに、次の前記データの読み出しを開始させると判定し、次の前記データの読み出しを開始させると判定した前記データ読み出し用チャンネルに対応する前記DMA実行状態を、前記データの読み出しを実行する状態に更新し、前記実行周期が、前記処理部が前記データに対する処理を実行しないタイミングであるときに、次の前記データの読み出しを開始させないと判定し、次の前記データの読み出しを開始させないと判定した前記データ読み出し用チャンネルに対応する前記DMA実行状態を、前記データの読み出しを実行しない状態に更新し、次の前記データの読み出しを開始させるか否かの判定をした後に、前記DMA実行状態が、前記データの読み出しを実行する状態である前記データ読み出し用チャンネルに、次の前記データの読み出しを開始させ、前記DMA実行状態が、前記データの読み出しを実行する状態である前記データ読み出し用チャンネルによる前記外部メモリからの次の前記データの読み出しが全て完了した後に、次の該リードDMA実行判定ステップを実行し、前記複数処理実行ステップは、前記処理実行状態が、前記データに対する処理を実行する状態である前記処理部に、前記外部メモリからの読み出しが完了した前記データに対する処理を実行させ、前記ライトDMAステップは、前記処理実行状態が、前記データに対する処理を実行する状態である前記処理部に対応する前記データ書き込み用チャンネルに、該処理部が処理を完了した前記結果データの前記外部メモリへの書き込みを開始させる、ことを特徴とする。   In the read DMA execution determination step of the present invention, the DMA execution state corresponding to each data read channel, which indicates whether or not the data read is executed by the data read channel, and the processing unit The process execution state corresponding to each of the processing units, which indicates whether or not to execute the process on the data, and before determining whether to start reading the next data, By copying the DMA execution state of the data to the processing execution state, the processing unit corresponding to the data reading channel for executing the data reading is set to a state in which processing for the data is executed, and the next data In determining whether to start reading, the execution period is determined by the processing unit. The DMA execution state corresponding to the data read channel determined to start reading the next data and to start reading the next data when it is time to execute processing on the data Is updated to a state in which the data is read, and when the execution cycle is a timing at which the processing unit does not execute the process on the data, it is determined that reading of the next data is not started, and Whether or not to update the DMA execution state corresponding to the data read channel determined not to start reading the data to a state in which the data reading is not executed, and to start reading the next data After the determination, the DMA execution state is a state in which reading of the data is executed. The next data read from the external memory by the data read channel in which the DMA execution state is a state in which the data read is executed. Is completed, the next read DMA execution determination step is executed, and the multiple-process execution step sends the processing execution state from the external memory to the processing unit in which the process for the data is executed. The write DMA step performs processing on the data write channel corresponding to the processing unit in which the processing execution state is a state of executing processing on the data. Start writing the result data to the external memory after the processing is completed It is characterized by that.

また、本発明の複数処理実行方法は、さらに、予め計測した前記処理部が前記データに対する処理を実行する際に要する処理時間と、該処理部に対応した前記データ読み出し用チャンネルによって前記外部メモリからの前記データを読み出す際に要するデータ転送時間との差に基づいて、前記ホストCPUが前記プロセッサに実行を指示する前記処理部の組み合わせを決定する実行処理決定ステップと、前記ホストCPUによって実行が指示された前記処理部の組み合わせに応じて、組み合わされた該処理部のそれぞれが処理を実行する際に要する、該処理部に対応する前記データ読み出し用チャンネルによって読み出した前記データを一時的に記憶する内蔵メモリの容量を動的に確保するバッファ確保ステップと、を含み、前記複数処理実行ステップは、前記実行処理決定ステップによって組み合わされ、前記ホストCPUによって実行が指示されたそれぞれの前記処理部に、対応する前記データ読み出し用チャンネルによって前記外部メモリからの読み出しが完了したそれぞれの前記データに対する処理を実行させ、前記ライトDMAステップは、前記実行処理決定ステップによって組み合わされ、前記ホストCPUによって実行が指示されたそれぞれの前記処理部に対応する前記データ書き込み用チャンネルに、それぞれの該処理部が処理を完了したそれぞれの前記結果データの前記外部メモリへの書き込みを開始させる、ことを特徴とする。   Further, the multiple processing execution method of the present invention further includes a processing time required for the processing unit measured in advance to execute processing on the data, and the data read channel corresponding to the processing unit from the external memory. An execution process determining step in which the host CPU determines a combination of the processing units to instruct the processor to execute based on a difference from a data transfer time required for reading the data, and execution is instructed by the host CPU The data read by the data read channel corresponding to the processing unit, which is required when each of the combined processing units executes processing, is temporarily stored in accordance with the combination of the processing units that has been set. A buffer securing step for dynamically securing a capacity of the built-in memory, Steps are combined by the execution processing determination step, and each of the processing units instructed to be executed by the host CPU are processed with respect to each of the data that has been read from the external memory by the corresponding data read channel. The processing is executed, and the write DMA step is combined by the execution processing determination step, and the processing unit is connected to the data write channel corresponding to the processing unit instructed to be executed by the host CPU. The writing of each result data that has been processed to the external memory is started.

本発明によれば、複数の処理を実行するシステムにおいて、ハンドシェークが頻発することや、それぞれの処理内での待ち時間が発生することによるシステム性能の低下を低減することができるという効果が得られる。   According to the present invention, in a system that executes a plurality of processes, it is possible to reduce the deterioration in system performance due to frequent handshaking and the occurrence of waiting time in each process. .

本発明の第1の実施形態における複数処理実行方法を適用した撮像装置の概略構成を示したブロック図である。1 is a block diagram illustrating a schematic configuration of an imaging apparatus to which a multiple processing execution method according to a first embodiment of the present invention is applied. 本第1の実施形態の複数処理実行方法の実行に係わる撮像装置における概略構成を示したブロック図である。It is the block diagram which showed schematic structure in the imaging device concerning execution of the multiple processing execution method of the 1st embodiment. 本第1の実施形態における複数処理実行方法の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the multiple process execution method in the 1st embodiment. 本第1の実施形態の複数処理実行方法におけるハンドシェークやデータの転送と、システムの処理時間との関係の一例を模式的に示した図である。It is the figure which showed typically an example of the relationship between the handshaking and the transfer of data in the multiple processing execution method of the 1st embodiment, and the processing time of a system. 本発明の第2実施形態の複数処理実行方法を適用した撮像装置におけるデータの分割方法の一例を模式的に示した図である。It is the figure which showed typically an example of the data division | segmentation method in the imaging device to which the multiple processing execution method of 2nd Embodiment of this invention is applied. 本第2の実施形態における複数処理実行方法の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the multiple process execution method in the 2nd embodiment. 本発明の第3の実施形態における複数処理実行方法の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the multiple process execution method in the 3rd Embodiment of this invention. 従来のシステムにおけるハンドシェークやデータの転送と、システムの処理時間との関係の一例を模式的に示した図である。It is the figure which showed typically an example of the relationship between the handshaking and the transfer of data in the conventional system, and the processing time of a system.

<第1の実施形態>
以下、本発明の実施形態について、図面を参照して説明する。本第1の実施形態においては、例えば、デジタルスチルカメラなどの撮像装置に、本第1の実施形態の複数処理実行方法を適用した場合の一例について説明する。図1は、本第1の実施形態における複数処理実行方法を適用した撮像装置の概略構成を示したブロック図である。図1に示した撮像装置10は、レンズ1と、イメージャ2と、キャプチャ部3と、DRAM4と、画像処理プロセッサ5と、ホストCPU6と、画像処理部7と、記録部8と、メモリカード9と、を備えている。
<First Embodiment>
Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the first embodiment, an example in which the multi-processing execution method of the first embodiment is applied to an imaging apparatus such as a digital still camera will be described. FIG. 1 is a block diagram illustrating a schematic configuration of an imaging apparatus to which the multiple processing execution method according to the first embodiment is applied. An imaging apparatus 10 illustrated in FIG. 1 includes a lens 1, an imager 2, a capture unit 3, a DRAM 4, an image processor 5, a host CPU 6, an image processor 7, a recording unit 8, and a memory card 9. And.

イメージャ2は、レンズ1によって結像された被写体の光学像を光電変換する固体撮像素子を備え、被写体光に応じた画像信号をキャプチャ部3に出力する。
キャプチャ部3は、イメージャ2から出力された画像信号をキャプチャし、キャプチャした画像信号を、入力画像データとしてDRAM4に格納する。また、キャプチャ部3は、入力画像データのDRAM4への格納が完了したときに、イメージャ2から出力された画像信号のキャプチャが完了したことを表す割り込み信号(以下、「キャプチャ完了信号」という)を、ホストCPU6に出力する。
The imager 2 includes a solid-state imaging device that photoelectrically converts an optical image of a subject formed by the lens 1, and outputs an image signal corresponding to the subject light to the capture unit 3.
The capture unit 3 captures the image signal output from the imager 2 and stores the captured image signal in the DRAM 4 as input image data. The capture unit 3 also outputs an interrupt signal (hereinafter referred to as “capture completion signal”) indicating that the capture of the image signal output from the imager 2 is completed when the input image data is completely stored in the DRAM 4. To the host CPU 6.

ホストCPU6は、撮像装置10内の各構成要素をそれぞれ制御することによって、撮像装置10全体の制御を行う。また、ホストCPU6は、キャプチャ部3からキャプチャ完了信号が入力された後、画像処理プロセッサ5に予め定めたタスク(画像処理)を実行させるための指示(以下、「実行指示」という)を、画像処理プロセッサ5に出力する。また、ホストCPU6は、画像処理プロセッサ5から画像処理が完了したことを表す割り込み信号(以下、「終了割り込み信号」という)が入力された後、次に画像処理プロセッサ5に実行させる画像処理がある場合には、次のタスク(画像処理)を実行させるための実行指示を、画像処理プロセッサ5に出力する。   The host CPU 6 controls the entire imaging apparatus 10 by controlling each component in the imaging apparatus 10. Further, after the capture completion signal is input from the capture unit 3, the host CPU 6 sends an instruction (hereinafter referred to as “execution instruction”) for causing the image processor 5 to execute a predetermined task (image processing). Output to the processor 5. Further, the host CPU 6 receives the interrupt signal indicating that the image processing is completed from the image processor 5 (hereinafter referred to as “end interrupt signal”), and then performs image processing to be executed by the image processor 5 next. In this case, an execution instruction for executing the next task (image processing) is output to the image processing processor 5.

画像処理プロセッサ5は、ホストCPU6から入力された実行指示に応じて、今回実行するタスク(画像処理)に必要な画像データ(例えば、入力画像データ)をDRAM4から読み出し、読み出した画像データに対してホストCPU6から指示された画像処理を施す。そして、画像処理プロセッサ5は、画像処理を施した後の画像処理結果を、再びDRAM4に書き戻す。また、画像処理プロセッサ5は、画像処理結果のDRAM4への書き戻しが完了したときに、画像処理が完了したことを表す割り込み信号(以下、「終了割り込み信号」という)を、ホストCPU6に出力する。   The image processor 5 reads image data (for example, input image data) necessary for the task (image processing) to be executed this time from the DRAM 4 in response to the execution instruction input from the host CPU 6, Image processing instructed by the host CPU 6 is performed. Then, the image processing processor 5 writes the image processing result after the image processing back to the DRAM 4 again. Further, the image processor 5 outputs an interrupt signal (hereinafter referred to as “end interrupt signal”) indicating the completion of the image processing to the host CPU 6 when the writing back of the image processing result to the DRAM 4 is completed. .

なお、画像処理プロセッサ5は、DRAM4へのアクセスにおいて、DMA(Direct Memory Access)を用いる。すなわち、画像処理プロセッサ5によるDRAM4からの画像データの読み出しと、DRAM4への画像処理結果の書き戻しとは、DMAで行われる。また、画像処理プロセッサ5は、複数種類(例えば、N種類)の異なる画像処理を、画像データに対して同時期に(並行して)施すことができる。そのため、画像処理プロセッサ5は、それぞれの画像処理に応じた画像データを、DMAによってDRAM4から同時期に(並行して)読み出すことができ、それぞれの画像処理結果をDMAによってDRAM4に同時期に(並行して)書き戻すことができる。なお、画像処理プロセッサ5の構成、およびホストCPU6と画像処理プロセッサ5とによる画像処理の実行手順に関する詳細な説明は、後述する。   The image processor 5 uses DMA (Direct Memory Access) in accessing the DRAM 4. That is, reading of image data from the DRAM 4 by the image processor 5 and writing back of the image processing result to the DRAM 4 are performed by DMA. Further, the image processor 5 can perform a plurality of types (for example, N types) of different image processing on the image data at the same time (in parallel). Therefore, the image processor 5 can read out image data corresponding to each image processing from the DRAM 4 by DMA at the same time (in parallel), and each image processing result can be read from the DRAM 4 by DMA at the same time ( Can be written back in parallel). A detailed description of the configuration of the image processor 5 and the execution procedure of the image processing by the host CPU 6 and the image processor 5 will be described later.

画像処理部7は、ホストCPU6から入力された実行指示に応じて、DRAM4に格納された画像処理結果を読み出し、読み出した画像処理結果に対して各種の画像処理を施す。そして、画像処理部7は、画像処理を施した後の画像処理結果を、出力画像データとして記録部8に出力する。
記録部8は、画像処理部7から入力された出力画像データに対して、メモリカード9に格納するための圧縮処理などを施して、記録用の画像データを生成する。そして、記録部8は、生成した記録用の画像データをメモリカード9に書き込む。
The image processing unit 7 reads out the image processing result stored in the DRAM 4 in accordance with the execution instruction input from the host CPU 6 and performs various image processing on the read image processing result. Then, the image processing unit 7 outputs the image processing result after the image processing to the recording unit 8 as output image data.
The recording unit 8 performs compression processing for storing in the memory card 9 on the output image data input from the image processing unit 7 to generate image data for recording. Then, the recording unit 8 writes the generated image data for recording into the memory card 9.

次に、撮像装置10において、本第1の実施形態の複数処理実行方法を実行するための構成について説明する。図2は、本第1の実施形態の複数処理実行方法の実行に係わる撮像装置10における概略構成を示したブロック図である。図2に示したように、本第1の実施形態の複数処理実行方法の実行に係わる撮像装置10の構成要素は、DRAM4と、画像処理プロセッサ5と、ホストCPU6とである。   Next, a configuration for executing the multiple processing execution method of the first embodiment in the imaging apparatus 10 will be described. FIG. 2 is a block diagram showing a schematic configuration of the imaging apparatus 10 related to the execution of the multiple processing execution method of the first embodiment. As shown in FIG. 2, the components of the imaging apparatus 10 related to the execution of the multiple processing execution method of the first embodiment are a DRAM 4, an image processing processor 5, and a host CPU 6.

また、画像処理プロセッサ5は、上述したように、DMAによるDRAM4へのアクセス、およびDRAM4から読み出した画像データに対する画像処理を、同時期に(並行して)行うことができる。このため、画像処理プロセッサ5は、図2に示したように、DMAによってDRAM4にアクセスする複数チャンネルのDMA部51と、DMA部51がそれぞれのチャンネルでDRAM4から読み出したそれぞれの画像データに対して、それぞれの画像処理を施す複数種類(例えば、N種類)の画像処理演算部52とを備えている。   Further, as described above, the image processor 5 can perform access to the DRAM 4 by DMA and image processing on image data read from the DRAM 4 at the same time (in parallel). For this reason, as shown in FIG. 2, the image processor 5 accesses a plurality of channels of DMA units 51 that access the DRAM 4 by DMA, and each image data read from the DRAM 4 by the DMA unit 51 in each channel. A plurality of types (for example, N types) of image processing calculation units 52 that perform the respective image processing are provided.

DMA部51は、それぞれのチャンネル毎に、DMAによるDRAM4へのアクセスを行う。DMA部51は、DRAM4に格納されている画像データを読み出す際、DMAによって読み出した画像データを、画像処理プロセッサ5の内部に備える内蔵メモリ(不図示)に一時記憶する。また、DMA部51は、画像処理を施した後の画像処理結果をDRAM4に書き戻す際、内蔵メモリに一時記憶されている画像処理結果を、DMAによってDRAM4に格納する。
画像処理演算部52のそれぞれは、内蔵メモリに一時記憶されている画像データに対して画像処理を施し、画像処理を施した後の画像処理結果を、再び内蔵メモリに一時記憶する。
The DMA unit 51 accesses the DRAM 4 by DMA for each channel. When reading the image data stored in the DRAM 4, the DMA unit 51 temporarily stores the image data read by the DMA in a built-in memory (not shown) provided in the image processor 5. The DMA unit 51 stores the image processing result temporarily stored in the built-in memory in the DRAM 4 by DMA when the image processing result after the image processing is written back to the DRAM 4.
Each of the image processing arithmetic units 52 performs image processing on the image data temporarily stored in the built-in memory, and temporarily stores again the image processing result after the image processing is performed in the built-in memory.

このような構成によって、画像処理プロセッサ5は、ホストCPU6から入力された実行指示に応じて、DMA部51が、対応するチャンネルのDMAによってDRAM4から画像データを読み出し、対応する画像処理演算部52が、読み出した画像データに対して画像処理を施す。そして、画像処理プロセッサ5は、DMA部51が、対応するチャンネルのDMAによって画像処理を施した後の画像処理結果をDRAM4に書き戻し、画像処理が完了したことを表す終了割り込み信号をホストCPU6に出力する。   With this configuration, in the image processor 5, the DMA unit 51 reads image data from the DRAM 4 by the DMA of the corresponding channel according to the execution instruction input from the host CPU 6, and the corresponding image processing arithmetic unit 52 Then, image processing is performed on the read image data. Then, the image processor 5 writes back the image processing result after the DMA unit 51 performs the image processing by the DMA of the corresponding channel to the DRAM 4, and sends an end interrupt signal indicating the completion of the image processing to the host CPU 6. Output.

次に、撮像装置10における本第1の実施形態の複数処理実行方法の処理手順について説明する。図3は、本第1の実施形態における複数処理実行方法の処理手順を示したフローチャートである。図3に示したフローチャートでは、本第1の実施形態の複数処理実行方法におけるホストCPU6および画像処理プロセッサ5の動作を示している。なお、画像処理プロセッサ5は、上述したように、複数種類(例えば、N種類)の異なる画像処理を同時期に(並行して)施すことができる。以下の説明においては、入力画像データに対して2種類の異なる画像処理(処理Aおよび処理B)を、同時期に(並行して)施す場合の処理手順について説明する。   Next, a processing procedure of the multiple processing execution method of the first embodiment in the imaging apparatus 10 will be described. FIG. 3 is a flowchart showing a processing procedure of the multiple processing execution method according to the first embodiment. The flowchart shown in FIG. 3 shows operations of the host CPU 6 and the image processor 5 in the multiple processing execution method of the first embodiment. Note that, as described above, the image processor 5 can perform a plurality of types (for example, N types) of different image processing at the same time (in parallel). In the following description, a processing procedure when two kinds of different image processing (processing A and processing B) are performed on input image data at the same time (in parallel) will be described.

撮像装置10の動作が開始されると、ホストCPU6は、複数処理実行の処理を開始する。複数処理実行の処理において、ホストCPU6は、まず、割り込み処理を実行する(ステップS1)。ステップS1の割り込み処理では、ホストCPU6が、撮像装置10内の各構成要素からの割り込み信号を受け付ける。その後、キャプチャ部3は、イメージャ2から出力された画像信号を1フレーム分キャプチャした入力画像データをDRAM4に格納すると、ホストCPU6にキャプチャ完了信号を出力する。   When the operation of the imaging apparatus 10 is started, the host CPU 6 starts a process for executing a plurality of processes. In the multi-process execution process, the host CPU 6 first executes an interrupt process (step S1). In the interrupt process of step S1, the host CPU 6 receives an interrupt signal from each component in the imaging device 10. Thereafter, when the capture unit 3 stores the input image data obtained by capturing one frame of the image signal output from the imager 2 in the DRAM 4, the capture unit 3 outputs a capture completion signal to the host CPU 6.

ホストCPU6が、撮像装置10内の各構成要素からの割り込み信号を受け付けると、受け付けた割り込みの要因を判定する(ステップS2)。ステップS2において、割り込みの要因がキャプチャ部3からのキャプチャ完了信号である場合には、ホストCPU6は、画像処理プロセッサ5を起動する(ステップS3)。ホストCPU6が画像処理プロセッサ5を起動する際、ホストCPU6は、画像処理プロセッサ5に実行指示を出力するとともに、今回実行する2種類の画像処理がどの画像処理であるか、すなわち、複数種類(例えば、N種類)備えた画像処理演算部52の内、どの画像処理演算部52の演算を実行するかを表す情報を画像処理プロセッサ5に出力する。   When the host CPU 6 receives an interrupt signal from each component in the imaging device 10, the cause of the received interrupt is determined (step S2). In step S2, if the cause of the interrupt is a capture completion signal from the capture unit 3, the host CPU 6 activates the image processor 5 (step S3). When the host CPU 6 activates the image processing processor 5, the host CPU 6 outputs an execution instruction to the image processing processor 5, and which image processing is the two types of image processing to be executed this time, that is, a plurality of types (for example, , N types) of the image processing calculation units 52 provided, information indicating which image processing calculation unit 52 is to be executed is output to the image processing processor 5.

画像処理プロセッサ5は、ホストCPU6によって起動が指示される、すなわち、ホストCPU6から実行指示と実行する画像処理の情報が入力されると、指示された2種類の画像処理の実行を開始する。なお、画像処理プロセッサ5は、小容量の内蔵メモリしか持たないため、キャプチャ部3が1フレーム分キャプチャした入力画像データを、複数個(例えば、M個)に分割し、分割した入力画像データのそれぞれに対する画像処理を、分割した数分(例えば、M回)だけ繰り返すことによって、1フレーム分の画像処理を完了する。   When the host CPU 6 instructs activation, that is, when an execution instruction and information on image processing to be executed are input from the host CPU 6, the image processor 5 starts execution of the two types of designated image processing. Since the image processor 5 has only a small-capacity built-in memory, the input image data captured by the capture unit 3 for one frame is divided into a plurality (for example, M), and the divided input image data The image processing for one frame is completed by repeating the image processing for each of the divided number (for example, M times).

まず、画像処理プロセッサ5は、2種類の画像処理に必要な、分割した最初(1個目)の入力画像データ(1/Mの入力画像データ)をDRAM4から読み出すためのリードDMA(1回目のリードDMA)を起動する(ステップS5)。次に、画像処理プロセッサ5は、分割した処理の1回目のループにおいて、1回目のリードDMAの終了を待つ(ステップS6)。1回目のリードDMAが終了すると、画像処理プロセッサ5は、次(2個目)の入力画像データ(1/Mの入力画像データ)を事前にDRAM4から読み出すためのリードDMA(2回目のリードDMA)を起動する(ステップS7)。   First, the image processor 5 reads the first divided (first) input image data (1 / M input image data) necessary for the two types of image processing from the DRAM 4 (first DMA). Read DMA) is started (step S5). Next, the image processor 5 waits for the end of the first read DMA in the first loop of the divided processing (step S6). When the first read DMA is completed, the image processor 5 reads the next (second) input image data (1 / M input image data) from the DRAM 4 in advance (second read DMA). ) Is activated (step S7).

画像処理プロセッサ5は、2回目のリードDMAによって2個目の入力画像データをDRAM4から読み出している間に、1個目の入力画像データに対する2種類の画像処理(処理Aおよび処理Bの演算)を、同時期に(並行して)実行する(ステップS8およびステップS9)。なお、図3に示したフローチャートでは、処理Aの演算(ステップS8)と処理Bの演算(ステップS9)とを、順次実行する場合の一例を示している。   The image processor 5 reads out the second input image data from the DRAM 4 by the second read DMA, and performs two types of image processing on the first input image data (calculation of processing A and processing B). Are executed at the same time (in parallel) (steps S8 and S9). Note that the flowchart shown in FIG. 3 shows an example in which the calculation of process A (step S8) and the calculation of process B (step S9) are executed sequentially.

その後、2種類の画像処理が完了すると、画像処理プロセッサ5は、今回の処理のループが1回目のループであるか否かを判定する(ステップS10)。ステップS10において、今回の処理のループが1回目のループである場合には、画像処理プロセッサ5は、1個目の入力画像データ(1/Mの入力画像データ)に対して画像処理を施した後のそれぞれの1個目の画像処理結果をDRAM4に書き戻すためのライトDMA(1回目のライトDMA)を起動する(ステップS12)。   Thereafter, when the two types of image processing are completed, the image processing processor 5 determines whether or not the current processing loop is the first loop (step S10). In step S10, when the current processing loop is the first loop, the image processor 5 performs image processing on the first input image data (1 / M input image data). A write DMA (first write DMA) for writing back each of the subsequent first image processing results to the DRAM 4 is activated (step S12).

なお、図3に示したフローチャートでは、処理Aの演算(ステップS8)と処理Bの演算(ステップS9)とを順次実行し、2種類の画像処理が完了した後にライトDMAを起動する(ステップS12)場合について説明した。しかし、画像処理を実行し、画像処理を施した後の画像処理結果をDRAM4に書き戻す手順は、図3に示したステップS8〜ステップS12までの処理手順のみに限定されるものではない。例えば、ライトDMAを起動させるための判断の処理(ステップS10)とライトDMAを起動させる処理(ステップS12)との負荷が小さく、ライトDMAによる画像処理結果のDRAM4への書き戻しに多くの時間を要しない場合もある。この場合には、処理Aの演算(ステップS8)、および処理Bの演算(ステップS9)が完了する毎に、ステップS10〜ステップS12までの処理を行う、すなわち、それぞれの画像処理が完了する毎に、画像処理を施した後の画像処理結果をDRAM4に書き戻す手順にすることもできる。   In the flowchart shown in FIG. 3, the calculation of the process A (step S8) and the calculation of the process B (step S9) are sequentially executed, and the write DMA is activated after the two types of image processing are completed (step S12). ) Explained the case. However, the procedure for executing the image processing and writing back the image processing result after the image processing to the DRAM 4 is not limited to the processing procedure from step S8 to step S12 shown in FIG. For example, the load of the determination process for starting the write DMA (step S10) and the process for starting the write DMA (step S12) is small, and it takes a lot of time to write back the image processing result by the write DMA to the DRAM 4. It may not be necessary. In this case, every time the calculation of the process A (step S8) and the calculation of the process B (step S9) are completed, the processes from step S10 to step S12 are performed, that is, each time the respective image processes are completed. In addition, it is possible to use a procedure for writing back the image processing result after the image processing to the DRAM 4.

そして、画像処理プロセッサ5は、分割した処理の2回目のループにおいて、2回目のリードDMAの終了を待つ(ステップS6)。2回目のリードDMAが終了すると、画像処理プロセッサ5は、次(3個目)の入力画像データ(1/Mの入力画像データ)を事前にDRAM4から読み出すためのリードDMA(3回目のリードDMA)を起動する(ステップS7)。   Then, the image processor 5 waits for the end of the second read DMA in the second loop of the divided processing (step S6). When the second read DMA is completed, the image processor 5 reads the next (third) input image data (1 / M input image data) from the DRAM 4 in advance (third read DMA). ) Is activated (step S7).

画像処理プロセッサ5は、3回目のリードDMAによって3個目の入力画像データをDRAM4から読み出している間に、2個目の入力画像データに対する2種類の画像処理(処理Aおよび処理Bの演算)を、同時期に(並行して)実行する(ステップS8およびステップS9)。   While the third input image data is being read from the DRAM 4 by the third read DMA, the image processor 5 performs two types of image processing on the second input image data (calculation of processing A and processing B). Are executed at the same time (in parallel) (steps S8 and S9).

その後、2種類の画像処理が完了すると、画像処理プロセッサ5は、今回の処理のループが1回目のループであるか否かを判定する(ステップS10)。ステップS10において、今回の処理のループが1回目のループでない場合には、画像処理プロセッサ5は、1回目のライトDMAの終了を待つ(ステップS11)。1回目のライトDMAが終了すると、画像処理プロセッサ5は、2個目の入力画像データ(1/Mの入力画像データ)に対して画像処理を施した後のそれぞれの2個目の画像処理結果をDRAM4に書き戻すためのライトDMA(2回目のライトDMA)を起動する(ステップS12)。   Thereafter, when the two types of image processing are completed, the image processing processor 5 determines whether or not the current processing loop is the first loop (step S10). If the current processing loop is not the first loop in step S10, the image processor 5 waits for the end of the first write DMA (step S11). When the first write DMA is completed, the image processor 5 performs each second image processing result after performing image processing on the second input image data (1 / M input image data). Is started to write back to the DRAM 4 (second write DMA) (step S12).

以降、同様に、画像処理プロセッサ5は、ステップS6〜ステップS12までの処理を、入力画像データを分割した数分(例えば、M回)だけ繰り返す。その後、画像処理プロセッサ5は、ステップS6〜ステップS12までの処理の繰り返しを、入力画像データを分割した数と同じ回数行うと、すなわち、キャプチャ部3がキャプチャした1フレーム分の入力画像データに対する2種類の画像処理が完了すると、処理のループを抜け出し、最後のライトDMAの終了を待つ(ステップS13)。最後のライトDMAが終了する、すなわち、キャプチャ部3がキャプチャした1フレーム分の画像処理結果をDRAM4に書き戻すと、画像処理プロセッサ5は、終了割り込み信号をホストCPU6に出力する(ステップS14)。   Thereafter, similarly, the image processor 5 repeats the processing from step S6 to step S12 by the number of times (for example, M times) obtained by dividing the input image data. Thereafter, when the image processor 5 repeats the processing from step S6 to step S12 as many times as the number of divided input image data, that is, 2 for the input image data for one frame captured by the capture unit 3. When the type of image processing is completed, the process loops out and waits for the end of the last write DMA (step S13). When the last write DMA ends, that is, when the image processing result for one frame captured by the capture unit 3 is written back to the DRAM 4, the image processor 5 outputs an end interrupt signal to the host CPU 6 (step S14).

ホストCPU6は、割り込み処理において、画像処理プロセッサ5からの終了割り込み信号を受け付ける(ステップS1)。ホストCPU6が、画像処理プロセッサ5からの終了割り込み信号を受け付けると、受け付けた割り込みの要因を判定する(ステップS2)。ここでは、ステップS2において、割り込みの要因が画像処理プロセッサ5からの終了割り込み信号であると判定されるため、ホストCPU6は、画像処理部7を起動し、画像処理プロセッサ5がDRAM4に書き戻した画像処理結果に対して各種の画像処理を施させる(ステップS4)。   In the interrupt process, the host CPU 6 receives an end interrupt signal from the image processor 5 (step S1). When the host CPU 6 receives an end interrupt signal from the image processor 5, it determines the cause of the received interrupt (step S2). Here, in step S2, since it is determined that the cause of the interruption is the end interruption signal from the image processor 5, the host CPU 6 activates the image processor 7, and the image processor 5 writes back to the DRAM 4. Various image processing is performed on the image processing result (step S4).

ここで、本第1の実施形態の複数処理実行方法におけるハンドシェークやデータの転送と、システムの処理時間との関係について説明する。図4は、本第1の実施形態の複数処理実行方法におけるハンドシェークやデータの転送と、システムの処理時間との関係の一例を模式的に示した図である。図4には、処理Aおよび処理Bの2つの画像処理を行うシステムの場合を示している。図4において、処理Aは、データの転送時間よりも演算時間の方が長い画像処理であり、処理Bは、データの転送時間よりも演算時間の方が短い画像処理である。ホストCPU6は、画像処理プロセッサ5に、処理Aと処理Bとの2つの画像処理を、同時期に(並行して)実行させる。また、画像処理プロセッサ5は、それぞれの画像処理に必要な入力画像データを、複数個(例えば、M個)に分割して処理する。なお、図4においては、2種類の画像処理に必要な入力画像データ(1/Mの入力画像データ)をDRAM4から読み出すためのリードDMAの時間、およびそれぞれの画像処理における演算時間のみを示し、画像処理を施した後の画像処理結果をDRAM4に書き戻すためのライトDMAは省略している。   Here, the relationship between the handshake and data transfer in the multiple processing execution method of the first embodiment and the processing time of the system will be described. FIG. 4 is a diagram schematically illustrating an example of a relationship between handshaking and data transfer and system processing time in the multiple processing execution method of the first embodiment. FIG. 4 shows the case of a system that performs two image processes of process A and process B. In FIG. 4, process A is an image process whose calculation time is longer than the data transfer time, and process B is an image process whose calculation time is shorter than the data transfer time. The host CPU 6 causes the image processor 5 to execute two image processes of process A and process B at the same time (in parallel). Further, the image processor 5 processes the input image data necessary for each image processing by dividing it into a plurality (for example, M). FIG. 4 shows only the read DMA time for reading out the input image data (1 / M input image data) necessary for the two types of image processing from the DRAM 4 and the calculation time in each image processing. The write DMA for writing back the image processing result after the image processing to the DRAM 4 is omitted.

まず、キャプチャ部3からのキャプチャ完了信号がホストCPU6に入力されると、ホストCPU6は、画像処理プロセッサ5に対して処理Aおよび処理Bの実行指示を出力する(図3のステップS1〜ステップS3参照)。画像処理プロセッサ5は、ホストCPU6から入力された実行指示に応じて、リードDMAを起動し、処理Aおよび処理Bに必要な、分割した最初(1個目)の入力画像データをDRAM4から読み出す。そして、次(2個目)の入力画像データのリードDMA(2回目のリードDMA)を起動する(図3のステップS5〜ステップS7参照)。   First, when a capture completion signal from the capture unit 3 is input to the host CPU 6, the host CPU 6 outputs an execution instruction for processing A and processing B to the image processor 5 (steps S1 to S3 in FIG. 3). reference). The image processor 5 activates the read DMA in response to the execution instruction input from the host CPU 6, and reads the first (first) divided input image data necessary for the processes A and B from the DRAM 4. Then, the next (second) input image data read DMA (second read DMA) is activated (see steps S5 to S7 in FIG. 3).

その後、画像処理プロセッサ5は、2回目のリードDMAによって2個目の入力画像データをDRAM4から読み出している間に、1個目の入力画像データに対する処理Aの演算および処理Bの演算を、同時期に(並行して)実行する(図3のステップS8およびステップS9参照)。なお、図4では、処理Aと処理Bとを、順次実行する場合の一例を示している。このとき、図4を見てわかるように、処理Aと処理Bとが連続的に実行されるため、一方の処理の待ち時間を、他方の処理で使用することができる。   After that, the image processor 5 reads out the second input image data from the DRAM 4 by the second read DMA, and performs the same processing A and B processing on the first input image data. It is executed at the time (in parallel) (see step S8 and step S9 in FIG. 3). FIG. 4 shows an example in which the process A and the process B are sequentially executed. At this time, as can be seen from FIG. 4, since the process A and the process B are continuously executed, the waiting time of one process can be used in the other process.

より具体的には、処理Aは、データの転送時間よりも演算時間の方が長い画像処理であるため、処理Aを連続的に実行すると、前回の演算が完了するまで次のデータ転送を開始することができないことによるデータ転送の待ち時間(転送待ち時間)が発生してしまうが、この転送待ち時間を処理BのDMA(データ転送)に使用することができる。また、処理Bは、データの転送時間よりも演算時間の方が短い画像処理であるため、処理Bを連続的に実行すると、前回のデータ転送が完了するまで次の演算を開始することができないことによる演算の待ち時間(演算待ち時間)が発生してしまうが、この演算待ち時間を処理Aの演算に使用することができる。   More specifically, since the process A is an image process in which the calculation time is longer than the data transfer time, if the process A is continuously executed, the next data transfer is started until the previous calculation is completed. Data transfer waiting time (transfer waiting time) due to the inability to do so occurs, and this transfer waiting time can be used for DMA (data transfer) of process B. Further, since the process B is an image process whose calculation time is shorter than the data transfer time, if the process B is continuously executed, the next calculation cannot be started until the previous data transfer is completed. The calculation waiting time (calculation waiting time) occurs, but this calculation waiting time can be used for the calculation of the process A.

なお、図4に示した一例では、処理Aおよび処理Bに必要な最初(1個目)の入力画像データのDRAM4からの読み出し、すなわち、処理Aに対応したチャンネルのリードDMAと、処理Bに対応したチャンネルのリードDMAとが終了した後に、処理Aの演算を開始する場合の一例を示している。これは、処理Aに対応したチャンネルのリードDMAと、処理Bに対応したチャンネルのリードDMAとが、同時期に(並行して)行われる、すなわち、2つのチャンネルのリードDMAが終了した時点で、処理Aおよび処理Bのそれぞれの演算に必要な入力画像データが揃う場合を示したものである。しかし、システムによるDMAの制御では、例えば、処理Aに対応したチャンネルのリードDMAがDRAM4からの入力画像データの読み出しを占有することができる場合がある。この場合には、処理Aに対応したチャンネルのリードDMAが先に終了し、処理Aに対応したチャンネルのリードDMAが終了した時点で、処理Aの演算に必要な入力画像データが揃うことになる。従って、このような場合には、処理Aに対応したチャンネルのリードDMAが終了した後に、先に処理Aの演算を開始し、その後、処理Bに対応したチャンネルのリードDMAが終了した後に、処理Bの演算を開始することができる。このようにすると、全ての処理Aおよび処理Bが終了するまでの時間、すなわち、処理Aおよび処理Bを実行している期間を短くすることもできる。   In the example shown in FIG. 4, the first (first) input image data required for the process A and the process B is read from the DRAM 4, that is, the read DMA of the channel corresponding to the process A and the process B. An example is shown in which the operation of the process A is started after the read DMA of the corresponding channel is completed. This is because the read DMA of the channel corresponding to the process A and the read DMA of the channel corresponding to the process B are performed at the same time (in parallel), that is, when the read DMA of the two channels is completed. The case where the input image data necessary for each calculation of the processing A and the processing B is prepared is shown. However, in the DMA control by the system, for example, the read DMA of the channel corresponding to the process A may occupy the reading of the input image data from the DRAM 4 in some cases. In this case, when the read DMA of the channel corresponding to the process A is finished first and the read DMA of the channel corresponding to the process A is finished, the input image data necessary for the calculation of the process A is prepared. . Therefore, in such a case, after the read DMA of the channel corresponding to the process A is completed, the calculation of the process A is started first, and then the read DMA of the channel corresponding to the process B is completed. The calculation of B can be started. In this way, the time until all the processes A and B are completed, that is, the period during which the processes A and B are executed can be shortened.

上記に述べたように、本第1の実施形態の複数処理実行方法を適用した撮像装置10では、ホストCPU6が、画像処理プロセッサ5に複数種類(例えば、N種類)の異なる画像処理を、同時期に(並行して)施させる。これにより、画像処理プロセッサ5は、複数種類(例えば、N種類)の画像処理に対応するリードDMAおよびライトDMAを一纏めにして同時期に(並行して)起動し、複数種類(例えば、N種類)の画像処理を、同時期に(並行して)実行する。すなわち、本第1の実施形態の複数処理実行方法では、複数種類(例えば、N種類)の異なる画像処理を一纏めにして、対応するデータ転送(DMA)と、それぞれの画像処理の演算とを連続的に実行する。これにより、本第1の実施形態の複数処理実行方法では、従来のプロセッサの処理において、それぞれの処理を単体で実行することで、システムの性能を低下させてしまう要因となっていたデータ転送や演算の待ち時間を、同時期に(並行して)実行している他の処理を実行する時間に充てることができる。このことにより、本第1の実施形態の複数処理実行方法では、システム全体の処理における待ち時間を少なくし、システム性能の低下を防止することができる。   As described above, in the imaging apparatus 10 to which the multiple processing execution method of the first embodiment is applied, the host CPU 6 performs multiple types (for example, N types) of different image processing on the image processor 5. Give it to the time (in parallel). As a result, the image processor 5 starts a plurality of types (for example, N types) of read DMA and write DMA corresponding to a plurality of types (for example, N types) of image processing at the same time (in parallel). ) Is executed at the same time (in parallel). That is, in the multiple processing execution method of the first embodiment, a plurality of types (for example, N types) of different image processing are grouped together, and corresponding data transfer (DMA) and calculation of each image processing are continuously performed. Run it. As a result, in the multiple processing execution method of the first embodiment, in the conventional processor processing, by executing each processing alone, data transfer, which has been a factor of reducing system performance, The calculation wait time can be used as a time for executing another process that is executed at the same time (in parallel). As a result, in the multiple processing execution method of the first embodiment, the waiting time in the processing of the entire system can be reduced, and the system performance can be prevented from deteriorating.

また、本第1の実施形態の複数処理実行方法では、複数種類(例えば、N種類)の異なる画像処理を一纏めにして、同時期に(並行して)施させるため、ハンドシェークの処理の回数を削減することができる。すなわち、本第1の実施形態の複数処理実行方法では、従来のプロセッサの処理において、それぞれの処理を単体で実行するたびに行われているハンドシェークの処理の回数を、同時期に(並行して)実行する複数種類(例えば、N種類)の処理毎に1回に削減することができる。このことにより、本第1の実施形態の複数処理実行方法では、システム全体の処理におけるハンドシェークに要する処理時間を少なくし、システム性能の低下をさらに防止することができる。   Further, in the multiple processing execution method of the first embodiment, a plurality of types (for example, N types) of different image processing are grouped and performed at the same time (in parallel). Can be reduced. That is, in the multi-process execution method of the first embodiment, in the conventional processor process, the number of handshake processes performed each time each process is executed alone is set at the same time (in parallel). ) It can be reduced once for each of a plurality of types (for example, N types) of processing to be executed. As a result, in the multiple processing execution method of the first embodiment, the processing time required for handshaking in the processing of the entire system can be reduced, and deterioration in system performance can be further prevented.

なお、本第1の実施形態の複数処理実行方法は、画像処理プロセッサ5において同時期に(並行して)実行するそれぞれの画像処理に必要な画像データが、同じ分割数に分割されている場合に有効である。しかし、撮像装置10においては、全ての画像処理で使用する画像データが、同じ分割数に分割されているとは限らない。また、同時期に(並行して)実行するそれぞれの画像処理で処理する画像データが、異なる構成要素が生成した画像データであることも考えられる。   Note that the multi-processing execution method of the first embodiment is when the image data required for each image processing to be executed at the same time (in parallel) in the image processor 5 is divided into the same number of divisions. It is effective for. However, in the imaging device 10, the image data used in all image processing is not necessarily divided into the same number of divisions. It is also conceivable that the image data to be processed in each image processing executed at the same time (in parallel) is image data generated by different components.

<第2の実施形態>
次に、本発明の第2の実施形態の複数処理実行方法について説明する。以下の説明においては、第1の実施形態と同様に、本第2の実施形態の複数処理実行方法を、撮像装置10に適用した場合について説明する。なお、本第2の実施形態の複数処理実行方法を適用した撮像装置10、および本第2の実施形態の複数処理実行方法の実行に係わる撮像装置10における概略構成は、図1および図2に示した第1の実施形態の複数処理実行方法を適用した撮像装置10と同様であるため、詳細な説明は省略する。従って、以下の説明においては、図1および図2に示した第1の実施形態の複数処理実行方法を適用した撮像装置10が、本第2の実施形態の複数処理実行方法を実行するものとして説明を行う。本第2の実施形態の複数処理実行方法は、撮像装置10に備えた画像処理プロセッサ5が、それぞれの画像処理に使用する画像データを異なる分割数に分割して処理する場合に有効である。
<Second Embodiment>
Next, a multiple processing execution method according to the second embodiment of the present invention will be described. In the following description, similarly to the first embodiment, a case where the multi-processing execution method of the second embodiment is applied to the imaging apparatus 10 will be described. The schematic configuration of the imaging apparatus 10 to which the multiple processing execution method of the second embodiment is applied and the imaging apparatus 10 related to the execution of the multiple processing execution method of the second embodiment are shown in FIGS. 1 and 2. Since it is the same as that of the imaging device 10 to which the multiple processing execution method of the first embodiment shown is applied, detailed description thereof is omitted. Therefore, in the following description, it is assumed that the imaging apparatus 10 to which the multiple processing execution method of the first embodiment shown in FIGS. 1 and 2 is applied executes the multiple processing execution method of the second embodiment. Give an explanation. The multi-processing execution method of the second embodiment is effective when the image processor 5 provided in the imaging apparatus 10 processes image data used for each image processing by dividing it into different numbers of divisions.

まず、画像処理プロセッサ5における画像データの分割方法について説明する。図5は、本第2実施形態の複数処理実行方法を適用した撮像装置10におけるデータの分割方法の一例を模式的に示した図である。図5(a)には、画像データの分割数が、同時期に(並行して)実行する異なる画像処理で同じ場合を示し、図5(b)には、画像データの分割数が、同時期に(並行して)実行する異なる画像処理で異なる場合を示している。   First, a method for dividing image data in the image processor 5 will be described. FIG. 5 is a diagram schematically illustrating an example of a data dividing method in the imaging apparatus 10 to which the multiple processing execution method according to the second embodiment is applied. FIG. 5A shows a case where the number of divisions of image data is the same in different image processing executed at the same time (in parallel), and FIG. 5B shows that the number of divisions of image data is the same. The case where it differs by the different image processing performed in time (in parallel) is shown.

図5(a)に示した一例では、処理Aにおいて処理する画像データと、処理Bにおいて処理する縮小画像データとが、どちらも横方向の短冊に分割されて処理される、すなわち、処理Aおよび処理Bによってそれぞれ画像処理する1フレーム内の短冊の数は、いずれも同じである。このように、画像処理に使用する画像データが同じ分割数に分割されている場合には、それぞれの画像処理において処理する画像データの大きさが異なる大きさであっても、それぞれの画像処理を同時期に終了することができる。すなわち、図3に示した第1の実施形態の複数処理実行方法の処理手順におけるステップS6〜ステップS12までの処理のループを実行する回数は、画像データを分割した数分となる。   In the example shown in FIG. 5A, the image data to be processed in the process A and the reduced image data to be processed in the process B are both processed by being divided into horizontal strips. The number of strips in one frame subjected to image processing by processing B is the same. Thus, when the image data used for image processing is divided into the same number of divisions, each image processing is performed even if the size of the image data processed in each image processing is different. It can end at the same time. That is, the number of executions of the processing loop from step S6 to step S12 in the processing procedure of the multiple processing execution method of the first embodiment shown in FIG. 3 is equal to the number of divided image data.

一方、図5(b)に示した一例では、処理Aにおいて画像データがブロック単位で処理されるのに対し、処理Bにおいては、縮小画像データが横方向の短冊単位で処理される、すなわち、処理Aおよび処理Bが1フレームの画像データを画像処理する際のそれぞれの処理単位が、処理Aと処理Bとで異なる。例えば、図5(b)に示した処理Aのブロックが、処理Bの短冊を横方向に4分割したものであれば、処理Aと処理Bとにおける1フレームの分割数の比は、処理A:処理B=4:1となる。   On the other hand, in the example shown in FIG. 5B, the image data is processed in units of blocks in the process A, whereas the reduced image data is processed in units of horizontal strips in the process B. The processing units when the processing A and the processing B perform image processing on one frame of image data are different between the processing A and the processing B. For example, if the block of process A shown in FIG. 5B is obtained by dividing the strip of process B into four in the horizontal direction, the ratio of the number of divisions of one frame between process A and process B is the process A : Processing B = 4: 1

このように、処理に使用する画像データが異なる分割数に分割されている場合には、図3に示した第1の実施形態の複数処理実行方法であると、それぞれの画像処理において処理する画像データの大きさに係わらず、それぞれの画像処理を同時期に終了することができない。すなわち、図5(b)に示した処理Aにおける画像データの分割数分の回数に合わせて、図3に示した第1の実施形態の複数処理実行方法の処理手順におけるステップS6〜ステップS12までの処理のループを実行すると、処理Bで不要な処理を実行してしまうことになる。また、逆に、図5(b)に示した処理Bにおける画像データの分割数分の回数に合わせて、図3に示した第1の実施形態の複数処理実行方法の処理手順におけるステップS6〜ステップS12までの処理のループを実行すると、処理Aによる画像処理が終わらない、すなわち、1フレーム分の画像データの全てに対して処理Aが実行されないことになる。   As described above, when the image data used for processing is divided into different numbers of divisions, the image to be processed in each image processing is the multi-processing execution method of the first embodiment shown in FIG. Regardless of the size of the data, each image processing cannot be completed at the same time. That is, from step S6 to step S12 in the processing procedure of the multiple processing execution method of the first embodiment shown in FIG. 3 according to the number of times of the number of divisions of the image data in the processing A shown in FIG. When the process loop is executed, an unnecessary process is executed in the process B. Conversely, steps S6 to S6 in the processing procedure of the multiple processing execution method of the first embodiment shown in FIG. 3 are matched with the number of times of the number of divisions of the image data in the processing B shown in FIG. When the processing loop up to step S12 is executed, the image processing by the processing A does not end, that is, the processing A is not executed for all the image data for one frame.

このため、本第2の実施形態の複数処理実行方法では、図3に示した第1の実施形態の複数処理実行方法の処理手順におけるステップS6〜ステップS12までの処理のループに対応する処理のループ内で、同時期に(並行して)実行する異なる画像処理における画像データの分割数に応じて、それぞれの画像処理を実行するが否かを切り替える。   Therefore, in the multiple processing execution method of the second embodiment, the processing corresponding to the processing loop from step S6 to step S12 in the processing procedure of the multiple processing execution method of the first embodiment shown in FIG. In the loop, whether or not each image processing is executed is switched according to the number of divisions of the image data in different image processing executed simultaneously (in parallel).

次に、撮像装置10における本第2の実施形態の複数処理実行方法の処理手順について説明する。図6は、本第2の実施形態における複数処理実行方法の処理手順を示したフローチャートである。図6に示したフローチャートでは、本第2の実施形態の複数処理実行方法におけるホストCPU6および画像処理プロセッサ5の動作を示している。なお、画像処理プロセッサ5は、上述したように、複数種類(例えば、N種類)の異なる画像処理を同時期に(並行して)施すことができる。以下の説明においては、入力画像データを異なる分割数で処理する2種類の異なる画像処理(処理Aおよび処理B)を、同時期に(並行して)施す場合の処理手順について説明する。   Next, the processing procedure of the multiple processing execution method of the second embodiment in the imaging apparatus 10 will be described. FIG. 6 is a flowchart showing the processing procedure of the multiple processing execution method in the second embodiment. The flowchart shown in FIG. 6 shows the operations of the host CPU 6 and the image processor 5 in the multiple processing execution method of the second embodiment. Note that, as described above, the image processor 5 can perform a plurality of types (for example, N types) of different image processing at the same time (in parallel). In the following description, a processing procedure in the case of performing two types of different image processing (processing A and processing B) for processing input image data with different division numbers at the same time (in parallel) will be described.

ここで、処理Aは画像データをブロック単位で処理し、処理Bは画像データを横方向の短冊単位で処理するものとし、処理Aのブロックが、処理Bの短冊を横方向に2分割したもの、すなわち、処理Aと処理Bとにおける1フレームの分割数の比が、処理A:処理B=2:1であるものとする(図5(b)参照)。   Here, process A is a process in which image data is processed in units of blocks, process B is a process in which image data is processed in units of horizontal strips, and a block of process A is obtained by dividing the strip of process B into two in the horizontal direction. That is, it is assumed that the ratio of the number of divisions of one frame in process A and process B is process A: process B = 2: 1 (see FIG. 5B).

撮像装置10の動作が開始されると、ホストCPU6は、複数処理実行の処理を開始する。複数処理実行の処理において、ホストCPU6は、まず、割り込み処理を実行する(ステップS101)。ステップS101の割り込み処理では、ホストCPU6が、撮像装置10内の各構成要素からの割り込み信号を受け付ける。その後、キャプチャ部3は、イメージャ2から出力された画像信号を1フレーム分キャプチャした入力画像データをDRAM4に格納すると、ホストCPU6にキャプチャ完了信号を出力する。   When the operation of the imaging apparatus 10 is started, the host CPU 6 starts a process for executing a plurality of processes. In the multi-process execution process, the host CPU 6 first executes an interrupt process (step S101). In the interrupt process of step S101, the host CPU 6 receives an interrupt signal from each component in the imaging device 10. Thereafter, when the capture unit 3 stores the input image data obtained by capturing one frame of the image signal output from the imager 2 in the DRAM 4, the capture unit 3 outputs a capture completion signal to the host CPU 6.

ホストCPU6が、撮像装置10内の各構成要素からの割り込み信号を受け付けると、受け付けた割り込みの要因を判定する(ステップS102)。ステップS102において、割り込みの要因がキャプチャ部3からのキャプチャ完了信号である場合には、ホストCPU6は、画像処理プロセッサ5を起動する(ステップS103)。ホストCPU6が画像処理プロセッサ5を起動する際、ホストCPU6は、画像処理プロセッサ5に実行指示を出力するとともに、今回実行する2種類の画像処理がどの画像処理であるか、すなわち、複数種類(例えば、N種類)備えた画像処理演算部52の内、どの画像処理演算部52の演算を実行するかを表す情報を画像処理プロセッサ5に出力する。   When the host CPU 6 receives an interrupt signal from each component in the imaging device 10, the cause of the received interrupt is determined (step S102). In step S102, when the cause of the interruption is a capture completion signal from the capture unit 3, the host CPU 6 activates the image processor 5 (step S103). When the host CPU 6 activates the image processing processor 5, the host CPU 6 outputs an execution instruction to the image processing processor 5, and which image processing is the two types of image processing to be executed this time, that is, a plurality of types (for example, , N types) of the image processing calculation units 52 provided, information indicating which image processing calculation unit 52 is to be executed is output to the image processing processor 5.

画像処理プロセッサ5は、ホストCPU6によって起動が指示される、すなわち、ホストCPU6から実行指示と実行する画像処理の情報が入力されると、指示された2種類の画像処理の実行を開始する。なお、画像処理プロセッサ5は、小容量の内蔵メモリしか持たないため、キャプチャ部3が1フレーム分キャプチャした入力画像データを、それぞれの処理に応じた複数個に分割し、分割した入力画像データのそれぞれに対する画像処理を、それぞれの処理に応じて分割した数分だけ繰り返すことによって、1フレーム分の画像処理を完了する。以下の説明においては、処理Aの画像処理における入力画像データの分割数を分割数Ma、処理Bの画像処理における入力画像データの分割数を分割数Mbとし、今回実行する全ての画像処理(処理Aおよび処理B)における入力画像データの分割数の最大値を、分割数MAXとする。また、処理Aの分割数Maが、分割数MAXであるとする。   When the host CPU 6 instructs activation, that is, when an execution instruction and information on image processing to be executed are input from the host CPU 6, the image processor 5 starts execution of the two types of designated image processing. Since the image processor 5 has only a small internal memory, the input image data captured by the capture unit 3 for one frame is divided into a plurality of pieces according to the respective processes, and the divided input image data The image processing for one frame is completed by repeating the image processing for each of the number of times divided according to each processing. In the following description, the division number Ma of the input image data in the image processing of the process A is the division number Ma, and the division number of the input image data in the image processing of the process B is the division number Mb. The maximum value of the number of divisions of input image data in A and process B) is defined as the number of divisions MAX. Further, it is assumed that the division number Ma of the process A is the division number MAX.

まず、画像処理プロセッサ5は、2種類の画像処理のそれぞれに必要な、分割した最初(1個目)の入力画像データ(1/Maの入力画像データ、および1/Mbの入力画像データ)をDRAM4から読み出すため、2種類の画像処理のそれぞれに対応した全てのチャンネルのリードDMA(1回目のリードDMA)を起動する(ステップS105)。次に、画像処理プロセッサ5は、処理Aおよび処理Bのそれぞれに対応したチャンネルのリードDMAを起動したか否かを表すDMA実行状態のフラグ(以下、「プレフラグ」という)を全てON(リードDMAを起動した状態)にする(ステップS106)。   First, the image processor 5 obtains divided first (first) input image data (1 / Ma input image data and 1 / Mb input image data) necessary for each of the two types of image processing. In order to read from the DRAM 4, the read DMA (first read DMA) of all channels corresponding to each of the two types of image processing is started (step S105). Next, the image processor 5 turns on all the DMA execution state flags (hereinafter referred to as “pre-flags”) indicating whether or not the read DMA of the channel corresponding to each of the processes A and B has been activated (read DMA). Is activated) (step S106).

続いて、画像処理プロセッサ5は、分割数MAX分の回数(仮に、“i”とする)だけ繰り返すループ(i)の1回目(i=1)の処理において、プレフラグがONである処理(ここでは、処理Aおよび処理B)に対応したチャンネルの1回目のリードDMAの終了を待つ(ステップS107)。1回目のリードDMAが終了すると、画像処理プロセッサ5は、処理Aおよび処理Bのそれぞれに対応し、処理の演算を実行するか否かを表す処理実行状態のフラグ(以下、「ポストフラグ」という)に、プレフラグの状態をコピーする(ステップS108)。   Subsequently, the image processor 5 performs processing in which the pre-flag is ON in the first processing (i = 1) of the loop (i) that is repeated by the number of divisions MAX (assuming “i”) (here). Then, the end of the first read DMA of the channel corresponding to the processing A and the processing B) is waited (step S107). When the first read DMA is completed, the image processor 5 corresponds to each of the processing A and the processing B, and indicates a processing execution state flag (hereinafter referred to as “post flag”) indicating whether or not the processing operation is executed. ), The state of the pre-flag is copied (step S108).

続いて、画像処理プロセッサ5は、同時期に(並行して)実行する画像処理の種類(仮に、“j”とする)だけ繰り返すループ(j)において、それぞれの画像処理毎に、次(2個目)の入力画像データを事前にDRAM4から読み出すためのリードDMA(2回目のリードDMA)を起動するか否かを判定する(ステップS109)。この判定では、分割数MAX分の回数iだけ繰り返すループ(i)のカウント値を、それぞれの画像処理を実行する周期(以下、「実行周期T」という)で除算したときの余りを算出する。そして、余りが“0”のときに、事前にDRAM4から読み出すためのリードDMA(2回目のリードDMA)を起動し、余りが“0”以外のときに、事前にDRAM4から読み出すためのリードDMA(2回目のリードDMA)を起動しないと判定する。なお、実行周期Tは、分割数MAX分の回数iだけ繰り返すループ(i)において、それぞれの画像処理の演算を何回に1回実行するかを表す値であり、分割数MAXを、それぞれの画像処理における入力画像データの分割数で除算した商である。   Subsequently, the image processing processor 5 performs the following (2) for each image processing in a loop (j) that repeats only for the type of image processing to be executed at the same time (in parallel) (assuming “j”). It is determined whether or not to activate a read DMA (second read DMA) for reading the input image data from the DRAM 4 in advance (step S109). In this determination, a remainder is calculated when the count value of the loop (i) that repeats the number of times i corresponding to the number of divisions MAX is divided by a period for executing each image processing (hereinafter referred to as “execution period T”). When the remainder is “0”, a read DMA (second read DMA) for reading from the DRAM 4 in advance is activated, and when the remainder is other than “0”, the read DMA for reading from the DRAM 4 in advance. It is determined not to start (second read DMA). The execution period T is a value representing how many times each image processing operation is executed in the loop (i) that repeats the number of times i corresponding to the number of divisions MAX. This is a quotient divided by the number of divisions of input image data in image processing.

例えば、処理Aの分割数Ma=10、処理Bの分割数Mb=5である場合を考える。この場合、分割数MAX=10である。このとき、処理Aに対応した実行周期T(以下「実行周期Ta」という)は、分割数MAX=分割数Maであるため、実行周期Ta=10/10=1である。すなわち、処理Aは、1回に1回実行、すなわち、毎回実行することになる。また、処理Bに対応した実行周期T(以下「実行周期Tb」という)は、分割数MAX≠分割数Mbであり、実行周期Tb=10/5=2である。すなわち、処理Bは、2回に1回実行することになる。   For example, consider a case where the division number Ma of process A = 10 and the division number Mb of process B = 5. In this case, the division number MAX = 10. At this time, the execution cycle T (hereinafter referred to as “execution cycle Ta”) corresponding to the process A is the number of divisions MAX = the number of divisions Ma, so the execution cycle Ta = 10/10 = 1. That is, the process A is executed once at a time, that is, executed every time. Further, the execution cycle T (hereinafter referred to as “execution cycle Tb”) corresponding to the process B is the division number MAX ≠ the division number Mb, and the execution cycle Tb = 10/5 = 2. That is, the process B is executed once every two times.

そして、1回目のループ(j=1)では、1つ目(j=1)の画像処理である処理Aに必要な、次(2個目)の入力画像データ(1/Maの入力画像データ)を事前にDRAM4から読み出すために、処理Aに対応したチャンネルのリードDMA(2回目のリードDMA)を起動するか否かを判定する。ここでは、ループ(i)のカウント値(ここでは、i=1)を実行周期Ta=1で除算したときの余りは“0”になるため、処理Aに対応したチャンネルのリードDMAを起動すると判定する。   In the first loop (j = 1), the next (second) input image data (1 / Ma input image data) necessary for the process A, which is the first (j = 1) image processing. ) Is read from the DRAM 4 in advance, it is determined whether or not to activate the read DMA (second read DMA) of the channel corresponding to the process A. Here, since the remainder when the count value of loop (i) (here, i = 1) is divided by the execution cycle Ta = 1 is “0”, when the read DMA of the channel corresponding to the process A is activated. judge.

また、2回目のループ(j=2)では、2つ目(j=2)の画像処理である処理Bに必要な、次(2個目)の入力画像データ(1/Mbの入力画像データ)を事前にDRAM4から読み出すために、処理Bに対応したチャンネルのリードDMA(2回目のリードDMA)を起動するか否かを判定する。ここでは、ループ(i)のカウント値(ここでは、i=1)を実行周期Tb=2で除算したときの余りは“0”以外になるため、処理Bに対応したチャンネルのリードDMAを起動しないと判定する。   In the second loop (j = 2), the next (second) input image data (1 / Mb input image data) necessary for the second (j = 2) image processing B ) Is read from the DRAM 4 in advance, it is determined whether to activate the read DMA (second read DMA) of the channel corresponding to the process B. Here, since the remainder when the count value of loop (i) (here, i = 1) is divided by the execution cycle Tb = 2 is other than “0”, the read DMA of the channel corresponding to the process B is activated. Judge that not.

ステップS109において、処理に対応したチャンネルのリードDMAを起動すると判定した場合には、対応するプレフラグをON(リードDMAを起動する状態)にし(ステップS110)、処理に対応したチャンネルのリードDMAを起動しないと判定した場合には、対応するプレフラグをOFF(リードDMAを起動しない状態)にする(ステップS111)。   If it is determined in step S109 that the read DMA of the channel corresponding to the process is to be activated, the corresponding pre-flag is turned ON (read DMA is activated) (step S110), and the read DMA of the channel corresponding to the process is activated. If it is determined not to do so, the corresponding pre-flag is turned OFF (read DMA is not activated) (step S111).

ステップS109〜ステップS111のループ(j)では、上述した次の入力画像データを事前にDRAM4から読み出すためのリードDMAを起動するか否かの判定と、それぞれの処理に対応するプレフラグの変更とを、同時期に(並行して)実行する画像処理の種類だけ繰り返す。そして、同時期に(並行して)実行するそれぞれの画像処理に対する判定が完了すると、ループ(j)を抜け出す。   In the loop (j) from step S109 to step S111, it is determined whether or not to start the read DMA for reading the next input image data from the DRAM 4 in advance, and changing the preflag corresponding to each process. Repeat for the types of image processing to be executed at the same time (in parallel). When the determination for each image processing executed at the same time (in parallel) is completed, the loop (j) is exited.

続いて、画像処理プロセッサ5は、プレフラグがONであるチャンネル、すなわち、事前にDRAM4から読み出すためのリードDMAを起動すると判定された処理に対応するチャンネルのリードDMA(2回目のリードDMA)を起動する(ステップS112)。
ここでは、ステップS109〜ステップS111の処理の結果に応じて、処理Aに対応したチャンネルのリードDMAのみが起動される。
Subsequently, the image processor 5 activates the read DMA (second read DMA) of the channel corresponding to the process in which the pre-flag is turned on, that is, the read DMA for reading from the DRAM 4 in advance is activated. (Step S112).
Here, only the read DMA of the channel corresponding to the process A is activated according to the results of the processes in steps S109 to S111.

画像処理プロセッサ5は、処理Aに対応したチャンネルの2回目のリードDMAによって2個目の入力画像データをDRAM4から読み出している間に、ポストフラグがON(演算を実行する状態)になっている処理の1個目の入力画像データに対するそれぞれの画像処理の演算を同時期に(並行して)実行する。ここでは、処理Aに必要な2個目の入力画像データ(1/Maの入力画像データ)をDRAM4から読み出している間に、1個目の入力画像データ(1/Maの入力画像データ、および1/Mbの入力画像データ)に対する2種類の画像処理(処理Aおよび処理Bの演算)を、同時期に(並行して)実行する(ステップS113およびステップS114)。なお、図6に示したフローチャートでは、処理Aの演算(ステップS113)と処理Bの演算(ステップS114)とを、順次実行する場合の一例を示している。   In the image processor 5, while the second input image data is being read from the DRAM 4 by the second read DMA of the channel corresponding to the process A, the post flag is ON (the state in which the calculation is executed). The respective image processing operations on the first input image data of the processing are executed at the same time (in parallel). Here, while the second input image data (1 / Ma input image data) necessary for the process A is being read from the DRAM 4, the first input image data (1 / Ma input image data, and Two types of image processing (calculation of processing A and processing B) for 1 / Mb input image data) are executed at the same time (in parallel) (step S113 and step S114). Note that the flowchart shown in FIG. 6 shows an example in which the calculation of process A (step S113) and the calculation of process B (step S114) are executed sequentially.

その後、2種類の画像処理が完了すると、画像処理プロセッサ5は、今回のループ(i)が1回目のループ(i=1)であるか否かを判定する(ステップS115)。ステップS115において、今回のループ(i)が1回目のループ(i=1)である場合には、画像処理プロセッサ5は、ポストフラグがON(演算を実行する状態)になっている処理の1個目の入力画像データに対して画像処理を施した後の1個目の画像処理結果をDRAM4に書き戻すためのライトDMA(1回目のライトDMA)を起動する(ステップS117)。ここでは、1個目の入力画像データ(1/Maの入力画像データ、および1/Mbの入力画像データ)に対して処理Aおよび処理Bの演算を施しているため、処理Aおよび処理Bのそれぞれに対応したチャンネルのライトDMA(1回目のライトDMA)が起動される。   Thereafter, when the two types of image processing are completed, the image processor 5 determines whether or not the current loop (i) is the first loop (i = 1) (step S115). In step S115, when the current loop (i) is the first loop (i = 1), the image processor 5 is one of the processes in which the post flag is ON (the state in which the calculation is executed). A write DMA (first write DMA) for writing back the first image processing result after image processing is performed on the first input image data to the DRAM 4 is started (step S117). Here, since processing A and processing B are performed on the first input image data (1 / Ma input image data and 1 / Mb input image data), processing A and processing B The write DMA (first write DMA) of the channel corresponding to each is activated.

なお、図6に示したフローチャートでは、処理Aの演算(ステップS113)と処理Bの演算(ステップS114)とを順次実行し、2種類の画像処理が完了した後に、それぞれの処理に対応するチャンネルのライトDMAを起動する(ステップS117)場合について説明した。しかし、画像処理を実行し、画像処理を施した後の画像処理結果をDRAM4に書き戻す手順は、図6に示したステップS113〜ステップS117までの処理手順のみに限定されるものではない。例えば、図3に示した第1の実施形態の複数処理実行方法の処理手順におけるステップS8〜ステップS12までの処理と同様に、それぞれの画像処理が完了する毎に、画像処理を施した後の画像処理結果をDRAM4に書き戻す手順にすることもできる。   In the flowchart shown in FIG. 6, the calculation of process A (step S113) and the calculation of process B (step S114) are sequentially executed, and after two types of image processing are completed, the channels corresponding to the respective processes are executed. The case where the write DMA is activated (step S117) has been described. However, the procedure for executing the image processing and writing back the image processing result after the image processing to the DRAM 4 is not limited to the processing procedure from step S113 to step S117 shown in FIG. For example, in the same manner as the processing from step S8 to step S12 in the processing procedure of the multiple processing execution method of the first embodiment shown in FIG. A procedure for writing back the image processing result to the DRAM 4 may be employed.

そして、画像処理プロセッサ5は、分割数MAX分の回数iだけ繰り返すループ(i)の2回目(i=2)の処理において、プレフラグがONである処理(ここでは、処理Aのみ)に対応したチャンネルの2回目のリードDMAの終了を待つ(ステップS107)。2回目のリードDMAが終了すると、画像処理プロセッサ5は、ポストフラグにプレフラグの状態(ここでは、処理AのみがONになっている)をコピーする(ステップS108)。   The image processor 5 corresponds to a process in which the pre-flag is ON (here, only the process A) in the second process (i = 2) of the loop (i) that repeats the number i of the number of divisions MAX. Wait for the end of the second read DMA of the channel (step S107). When the second read DMA is completed, the image processor 5 copies the pre-flag state (here, only process A is ON) to the post flag (step S108).

続いて、画像処理プロセッサ5は、同時期に(並行して)実行する画像処理の種類だけ繰り返すループ(j)において、それぞれの画像処理毎に、次(3個目または2個目)の入力画像データを事前にDRAM4から読み出すためのリードDMA(3回目または2回目のリードDMA)を起動するか否かを判定する(ステップS109)。   Subsequently, the image processor 5 inputs the next (third or second) input for each image processing in the loop (j) that repeats the type of image processing to be executed at the same time (in parallel). It is determined whether or not to activate read DMA (third or second read DMA) for reading image data from the DRAM 4 in advance (step S109).

ここでは、2回目のループ(j=2)であるため、1つ目(j=1)の画像処理である処理Aに必要な、次(3個目)の入力画像データ(1/Maの入力画像データ)を事前にDRAM4から読み出すために、処理Aに対応したチャンネルのリードDMA(3回目のリードDMA)を起動するか否かを判定する。また、2つ目(j=2)の画像処理である処理Bに必要な、次(2個目)の入力画像データ(1/Mbの入力画像データ)を事前にDRAM4から読み出すために、処理Bに対応したチャンネルのリードDMA(2回目のリードDMA)を起動するか否かを判定する。   Here, since it is the second loop (j = 2), the next (third) input image data (1 / Ma) required for the process A which is the first (j = 1) image processing. In order to read the input image data) from the DRAM 4 in advance, it is determined whether or not to activate the read DMA (third read DMA) of the channel corresponding to the process A. Further, in order to read out the next (second) input image data (1 / Mb input image data) necessary for the second (j = 2) image processing B in advance from the DRAM 4, the processing is performed. It is determined whether or not to activate the read DMA (second read DMA) of the channel corresponding to B.

例えば、処理Aの分割数Ma=10、処理Bの分割数Mb=5、分割数MAX=10である場合、ステップS109では、2回目のループ(i)のカウント値(ここでは、i=2)を実行周期Ta=1で除算したときの余りは“0”になるため、処理Aに対応したチャンネルのリードDMAを起動すると判定する。また、2回目のループ(i)のカウント値(ここでは、i=2)を実行周期Tb=2で除算したときの余りは“0”になるため、処理Bに対応したチャンネルのリードDMAも起動すると判定する。   For example, if the division number Ma of process A = 10, the division number Mb of process B = 5, and the division number MAX = 10, in step S109, the count value of the second loop (i) (here, i = 2) ) Is divided by the execution cycle Ta = 1, the remainder is “0”, and it is determined that the read DMA of the channel corresponding to the process A is activated. Since the remainder when the count value (here i = 2) of the second loop (i) is divided by the execution cycle Tb = 2 is “0”, the read DMA of the channel corresponding to the process B is also performed. Determine to start.

そして、ステップS109において、処理に対応したチャンネルのリードDMAを起動すると判定した処理Aおよび処理Bに対応するプレフラグをON(リードDMAを起動する状態)にする(ステップS110)。そして、同時期に(並行して)実行するそれぞれの画像処理に対する判定が完了すると、ループ(j)を抜け出す。   In step S109, the pre-flag corresponding to process A and process B determined to activate the read DMA of the channel corresponding to the process is set to ON (read DMA is activated) (step S110). When the determination for each image processing executed at the same time (in parallel) is completed, the loop (j) is exited.

続いて、画像処理プロセッサ5は、プレフラグがONであるチャンネル、すなわち、事前にDRAM4から読み出すためのリードDMAを起動すると判定された、処理Aに対応するチャンネルのリードDMA(3回目のリードDMA)と、処理Bに対応するチャンネルのリードDMA(2回目のリードDMA)とを起動する(ステップS112)。   Subsequently, the image processor 5 reads the channel whose pre-flag is ON, that is, the read DMA (third read DMA) of the channel corresponding to the processing A that has been determined to activate the read DMA for reading from the DRAM 4 in advance. Then, the read DMA (second read DMA) of the channel corresponding to the process B is activated (step S112).

画像処理プロセッサ5は、処理Aおよび処理Bに対応したチャンネルのリードDMAによって入力画像データをDRAM4から読み出している間に、ポストフラグがON(演算を実行する状態)になっている処理の2個目の入力画像データに対するそれぞれの画像処理の演算を同時期に(並行して)実行する。ここでは、処理Aに必要な3個目の入力画像データ(1/Maの入力画像データ)と、処理Bに必要な2個目の入力画像データ(1/Mbの入力画像データ)とをDRAM4から読み出している間に、2個目の入力画像データ(1/Maの入力画像データ)に対する処理Aの演算を実行する(ステップS113)。なお、処理Bの演算(ステップS114)は実行しない。   The image processing processor 5 performs two processes in which the post flag is ON (a state in which the operation is executed) while the input image data is being read from the DRAM 4 by the read DMA of the channels corresponding to the processes A and B. Each image processing operation on the input image data of the eye is executed at the same time (in parallel). Here, the third input image data (1 / Ma input image data) required for the process A and the second input image data (1 / Mb input image data) required for the process B are stored in the DRAM 4. During the reading, the processing A is performed on the second input image data (1 / Ma input image data) (step S113). Note that the calculation of the process B (step S114) is not executed.

その後、処理Aの画像処理が完了すると、画像処理プロセッサ5は、今回のループ(i)が1回目のループ(i=1)であるか否かを判定する(ステップS115)。ステップS115において、今回のループ(i)が1回目のループ(i=1)でない場合には、画像処理プロセッサ5は、ポストフラグがON(演算を実行する状態)になっている処理の1回目のライトDMAの終了を待つ(ステップS111)。ここでは、ポストフラグが処理AのみONになっているので、処理Aの1回目のライトDMAの終了を待つ。   Thereafter, when the image processing of process A is completed, the image processor 5 determines whether or not the current loop (i) is the first loop (i = 1) (step S115). In step S115, when the current loop (i) is not the first loop (i = 1), the image processor 5 performs the first process in which the post flag is ON (the state in which the calculation is executed). The end of the write DMA is awaited (step S111). Here, since only the process A is ON, the end of the first write DMA of process A is awaited.

処理Aの1回目のライトDMAが終了すると、画像処理プロセッサ5は、ポストフラグがON(演算を実行する状態)になっている処理の2個目の入力画像データに対して画像処理を施した後の2個目の画像処理結果をDRAM4に書き戻すためのライトDMA(2回目のライトDMA)を起動する(ステップS117)。ここでは、ポストフラグが処理AのみONになっているため、2個目の入力画像データ(1/Maの入力画像データ)に対して画像処理を施した処理Aの2個目の画像処理結果をDRAM4に書き戻すため、処理Aに対応したチャンネルのライトDMA(3回目のライトDMA)が起動される。   When the first write DMA of the process A is completed, the image processor 5 performs the image process on the second input image data of the process whose post flag is ON (a state in which the calculation is executed). The write DMA (second write DMA) for writing back the subsequent second image processing result to the DRAM 4 is activated (step S117). Here, since the post flag is ON only for process A, the second image processing result of process A obtained by performing image processing on the second input image data (1 / Ma input image data). Is written back into the DRAM 4, the write DMA (third write DMA) of the channel corresponding to the process A is started.

以降、同様に、画像処理プロセッサ5は、ステップS107〜ステップS117までのループ(i)の処理を、今回実行する全ての画像処理における入力画像データの最大の分割数の数分(分割数MAX分の回数i)だけ繰り返す。その後、画像処理プロセッサ5は、ステップS107〜ステップS117までのループ(i)の処理の繰り返しを、分割数MAXと同じ回数iだけ行うと、すなわち、キャプチャ部3がキャプチャした1フレーム分の入力画像データに対する2種類の画像処理が完了すると、処理のループを抜け出す。そして、画像処理プロセッサ5は、ポストフラグがON(演算を実行する状態)になっている処理の最後のライトDMAの終了を待つ(ステップS118)。ポストフラグがONになっている処理の最後のライトDMAが終了する、すなわち、キャプチャ部3がキャプチャした1フレーム分の画像処理結果をDRAM4に書き戻すと、画像処理プロセッサ5は、終了割り込み信号をホストCPU6に出力する(ステップS119)。   Thereafter, similarly, the image processor 5 performs the processing of the loop (i) from step S107 to step S117 as many as the maximum number of divisions of the input image data in all the image processing executed this time (the number of divisions MAX). I) is repeated. Thereafter, when the image processor 5 repeats the processing of the loop (i) from step S107 to step S117 for the same number i as the division number MAX, that is, the input image for one frame captured by the capture unit 3. When the two types of image processing for the data are completed, the processing loop is exited. Then, the image processor 5 waits for the end of the last write DMA of the process in which the post flag is ON (the state in which the calculation is executed) (step S118). When the last write DMA of the process in which the post flag is ON ends, that is, when the image processing result for one frame captured by the capture unit 3 is written back to the DRAM 4, the image processor 5 sends an end interrupt signal. The data is output to the host CPU 6 (step S119).

ホストCPU6は、割り込み処理において、画像処理プロセッサ5からの終了割り込み信号を受け付ける(ステップS101)。ホストCPU6が、画像処理プロセッサ5からの終了割り込み信号を受け付けると、受け付けた割り込みの要因を判定する(ステップS102)。ここでは、ステップS102において、割り込みの要因が画像処理プロセッサ5からの終了割り込み信号であると判定されるため、ホストCPU6は、画像処理部7を起動し、画像処理プロセッサ5がDRAM4に書き戻した画像処理結果に対して各種の画像処理を施させる(ステップS104)。   In the interrupt process, the host CPU 6 accepts an end interrupt signal from the image processor 5 (step S101). When the host CPU 6 receives the end interrupt signal from the image processor 5, it determines the cause of the received interrupt (step S102). Here, since it is determined in step S <b> 102 that the cause of the interruption is an end interruption signal from the image processor 5, the host CPU 6 activates the image processor 7 and the image processor 5 writes back to the DRAM 4. Various image processing is performed on the image processing result (step S104).

上記に述べたように、本第2の実施形態の複数処理実行方法を適用した撮像装置10では、画像処理プロセッサ5が、複数種類(例えば、N種類)の画像処理を、同時期に(並行して)実行する異なる画像処理における画像データの分割数の比に基づいて、DMAの起動と演算の実行とを制御する。すなわち、本第2の実施形態の複数処理実行方法では、複数種類(例えば、N種類)の画像処理に対応するチャンネルのリードDMAおよびライトDMAの起動、およびそれぞれの画像処理の演算の実行を、それぞれの画像処理における画像データの分割数に応じて制御する。言い換えれば、本第2の実施形態の複数処理実行方法では、分割数が最大である処理Aのループ(i)を実行している間に、分割数が最大ではない処理Bを実行することによって、第1の実施形態の複数処理実行方法と同様に、ホストCPU6が、画像処理プロセッサ5に複数種類(例えば、N種類)の異なる画像処理を、同時期に(並行して)施させる。これにより、本第2の実施形態の複数処理実行方法では、画像データを異なる分割数で処理する複数種類(例えば、N種類)の異なる画像処理を、同時期に(並行して)実行する場合でも、対応するデータ転送(DMA)と、それぞれの画像処理の演算とを連続的に実行することができる。このことにより、本第2の実施形態の複数処理実行方法でも、第1の実施形態の複数処理実行方法と同様に、従来のプロセッサの処理においてシステムの性能を低下させてしまう要因となっていたデータ転送や演算の待ち時間を、同時期に(並行して)実行している他の処理を実行する時間に充てることができ、システム全体の処理における待ち時間を少なくし、システム性能の低下を防止することができる。   As described above, in the imaging apparatus 10 to which the multiple processing execution method of the second embodiment is applied, the image processor 5 performs multiple types (for example, N types) of image processing at the same time (in parallel). Based on the ratio of the number of divisions of the image data in the different image processing to be executed, the activation of the DMA and the execution of the operation are controlled. That is, in the multiple processing execution method of the second embodiment, activation of read DMA and write DMA of channels corresponding to multiple types (for example, N types) of image processing, and execution of respective image processing operations are performed. Control is performed according to the number of divisions of image data in each image processing. In other words, in the multiple process execution method of the second embodiment, while executing the loop (i) of the process A having the maximum number of divisions, the process B having the maximum number of divisions is executed. Similar to the multiple processing execution method of the first embodiment, the host CPU 6 causes the image processor 5 to perform multiple types (for example, N types) of different image processing at the same time (in parallel). As a result, in the multiple processing execution method of the second embodiment, multiple types (for example, N types) of different image processing for processing image data with different division numbers are executed at the same time (in parallel). However, the corresponding data transfer (DMA) and the respective image processing operations can be executed continuously. As a result, the multi-process execution method of the second embodiment is a factor that degrades the performance of the system in the conventional processor processing, as in the multi-process execution method of the first embodiment. The waiting time for data transfer and computation can be used for the time to execute other processes executed at the same time (in parallel), reducing the waiting time for the entire system processing and reducing the system performance. Can be prevented.

また、本第2の実施形態の複数処理実行方法でも、第1の実施形態の複数処理実行方法と同様に、従来のプロセッサの処理において、それぞれの処理を単体で実行するたびに行われているハンドシェークの処理の回数を、同時期に(並行して)実行する複数種類(例えば、N種類)の処理毎に1回に削減することができる。このことにより、本第2の実施形態の複数処理実行方法でも、第1の実施形態の複数処理実行方法と同様に、システム全体の処理におけるハンドシェークに要する処理時間を少なくし、システム性能の低下をさらに防止することができる。   Also, in the multi-process execution method of the second embodiment, as in the multi-process execution method of the first embodiment, in the conventional processor process, each time each process is executed alone. The number of handshake processes can be reduced to once for each of a plurality of types (for example, N types) of processes executed simultaneously (in parallel). As a result, in the multi-process execution method of the second embodiment, as in the multi-process execution method of the first embodiment, the processing time required for handshaking in the entire system process is reduced, and the system performance is reduced. Further, it can be prevented.

なお、本第2の実施形態の複数処理実行方法の処理手順では、入力画像データをそれぞれ異なる分割数で処理する2種類の異なる画像処理(処理Aおよび処理B)を、同時期に(並行して)実行する場合の処理手順について説明した。しかし、上述したように、本第2の実施形態の複数処理実行方法では、画像処理を実行する際の画像データの分割数に応じて、DMAの起動と演算の実行とを制御することができる。このため、本第2の実施形態の複数処理実行方法では、同時期に(並行して)実行する画像処理のいずれかが、画像データを分割せずに画像処理を実行する画像処理であっても、分割数を“1”として考えることによって、同様にDMAの起動と演算の実行とを制御することができる。   In the processing procedure of the multiple processing execution method according to the second embodiment, two different types of image processing (processing A and processing B) for processing the input image data with different division numbers are performed at the same time (in parallel). Explained the processing procedure for execution. However, as described above, in the multiple processing execution method of the second embodiment, it is possible to control the start of DMA and the execution of computations according to the number of divisions of image data when executing image processing. . For this reason, in the multiple processing execution method of the second embodiment, any one of the image processes executed at the same time (in parallel) is an image process for executing the image process without dividing the image data. However, by considering the number of divisions as “1”, it is possible to similarly control the activation of the DMA and the execution of the calculation.

なお、第1の実施形態の複数処理実行方法、および本第2の実施形態の複数処理実行方法では、画像処理プロセッサ5において2種類の異なる画像処理(処理Aおよび処理B)を、同時期に(並行して)施す場合について説明した。しかし、画像処理プロセッサ5が同時期に(並行して)実行する画像処理の数は、2種類に限定されるものではなく、画像処理を実行する際に使用する内蔵メモリの容量が、画像処理プロセッサ5に備えた内蔵メモリの容量を超えない範囲で、さらに多くの種類の画像処理を組み合わせて、同時期に(並行して)実行することができる。   In the multiple processing execution method of the first embodiment and the multiple processing execution method of the second embodiment, the image processor 5 performs two different types of image processing (Process A and Process B) at the same time. The case of applying (in parallel) has been described. However, the number of image processes that the image processor 5 executes at the same time (in parallel) is not limited to two types, and the capacity of the built-in memory used when executing the image process is not limited to the image process. As long as the capacity of the built-in memory included in the processor 5 is not exceeded, more types of image processing can be combined and executed at the same time (in parallel).

<第3の実施形態>
次に、本発明の第3の実施形態の複数処理実行方法について説明する。以下の説明においては、第1の実施形態および第2の実施形態と同様に、本第3の実施形態の複数処理実行方法を、撮像装置10に適用した場合について説明する。なお、本第3の実施形態の複数処理実行方法を適用した撮像装置10、および本第3の実施形態の複数処理実行方法の実行に係わる撮像装置10における概略構成は、図1および図2に示した第1の実施形態の複数処理実行方法を適用した撮像装置10と同様であるため、詳細な説明は省略する。従って、以下の説明においては、図1および図2に示した第1の実施形態の複数処理実行方法を適用した撮像装置10が、本第3の実施形態の複数処理実行方法を実行するものとして説明を行う。本第3の実施形態の複数処理実行方法は、撮像装置10に備えたホストCPU6が、画像処理プロセッサ5に実行させる画像処理の組み合わせを、画像処理プロセッサ5に備えた内蔵メモリの容量を考慮して動的に変更する方法である。
<Third Embodiment>
Next, a multiple processing execution method according to the third embodiment of the present invention will be described. In the following description, similarly to the first embodiment and the second embodiment, a case where the multiple processing execution method of the third embodiment is applied to the imaging apparatus 10 will be described. The schematic configuration of the imaging apparatus 10 to which the multiple processing execution method of the third embodiment is applied and the imaging apparatus 10 related to the execution of the multiple processing execution method of the third embodiment are shown in FIGS. 1 and 2. Since it is the same as that of the imaging device 10 to which the multiple processing execution method of the first embodiment shown is applied, detailed description thereof is omitted. Therefore, in the following description, it is assumed that the imaging apparatus 10 to which the multiple processing execution method of the first embodiment shown in FIGS. 1 and 2 is applied executes the multiple processing execution method of the third embodiment. Give an explanation. In the multiple processing execution method of the third embodiment, the host CPU 6 provided in the imaging apparatus 10 considers the capacity of the built-in memory provided in the image processor 5 for the image processing combination that the image processor 5 executes. It is a method to change dynamically.

本第3の実施形態の複数処理実行方法では、画像処理プロセッサ5に備えている全ての画像処理演算部52で実行する複数種類(例えば、N種類)の画像処理について、データの転送時間と演算時間とのそれぞれを事前に計測し、計測したそれぞれの値をホストCPU6のプログラムデータとして、例えば、プログラムメモリに格納しておく。ホストCPU6は、予め計測したデータの転送時間と演算時間とに基づいて、今回画像処理プロセッサ5に実行を指示する画像処理の組み合わせを決定する。ホストCPU6による画像処理プロセッサ5に実行を指示する画像処理の組み合わせの決定は、データの転送時間と演算時間との差の時間に基づいて行う。従って、予めプログラムデータとして格納しておく値は、データの転送時間と演算時間との差の時間であっても良い。   In the multiple processing execution method of the third embodiment, data transfer time and calculation are performed for multiple types (for example, N types) of image processing executed by all the image processing calculation units 52 included in the image processing processor 5. Each time is measured in advance, and each measured value is stored as program data of the host CPU 6 in, for example, a program memory. The host CPU 6 determines a combination of image processings to be instructed to be executed this time by the image processor 5 based on the data transfer time and calculation time measured in advance. The host CPU 6 determines the combination of image processings for instructing the image processing processor 5 to execute based on the difference between the data transfer time and the calculation time. Therefore, the value stored in advance as the program data may be a difference time between the data transfer time and the calculation time.

また、本第3の実施形態の複数処理実行方法では、画像処理プロセッサ5において同時期に(並行して)実行する、すなわち、組み合わせて実行する最大の処理の数が、「最大結合処理数」として予め定義されている。この最大結合処理数は、撮像装置10の動作モードに応じて実行する画像処理を複数種類組み合わせた場合に、画像処理を実行する際に使用する内蔵メモリの容量が、画像処理プロセッサ5に備えた内蔵メモリの容量を超えない範囲で設定される必要がある。   In the multiple processing execution method of the third embodiment, the maximum number of processes executed in the image processor 5 at the same time (in parallel), that is, executed in combination is “the maximum number of combined processes”. As previously defined. The maximum number of combined processes is such that the image processor 5 has a capacity of a built-in memory used when executing image processing when a plurality of types of image processing executed in accordance with the operation mode of the imaging apparatus 10 are combined. It must be set within the range that does not exceed the capacity of the internal memory.

次に、撮像装置10における本第3の実施形態の複数処理実行方法の処理手順について説明する。図7は、本第3の実施形態における複数処理実行方法の処理手順を示したフローチャートである。図7に示したフローチャートでは、本第3の実施形態の複数処理実行方法におけるホストCPU6および画像処理プロセッサ5の動作を示している。なお、画像処理プロセッサ5は、上述したように、複数種類(例えば、N種類)の異なる画像処理を同時期に(並行して)施すことができる。以下の説明においては、入力画像データに対して4種類の異なる画像処理(処理A、処理B、処理C、および処理D)を施す場合の処理手順について説明する。   Next, a processing procedure of the multiple processing execution method of the third embodiment in the imaging apparatus 10 will be described. FIG. 7 is a flowchart showing the processing procedure of the multiple processing execution method according to the third embodiment. The flowchart shown in FIG. 7 shows the operations of the host CPU 6 and the image processor 5 in the multiple processing execution method of the third embodiment. Note that, as described above, the image processor 5 can perform a plurality of types (for example, N types) of different image processing at the same time (in parallel). In the following description, a processing procedure when four types of different image processing (processing A, processing B, processing C, and processing D) are performed on input image data will be described.

ここで、処理Aおよび処理Bは、データの転送時間よりも演算時間の方が長い画像処理であり、処理Cおよび処理Dは、データの転送時間よりも演算時間の方が短い画像処理であるものとする。そして、処理Aと処理Bとでは、データの転送時間と演算時間との差の時間が処理Aの方が大きく、処理Cと処理Dとでは、データの転送時間と演算時間との差の時間が処理Cの方が大きいものとする。また、ホストCPU6には、最大結合処理数として“2”が予め設定されているものとする。従って、以下の説明においては、画像処理プロセッサ5が、4種類の画像処理を2種類ずつ2回に分けて実行する場合について説明する。   Here, the processing A and the processing B are image processing whose calculation time is longer than the data transfer time, and the processing C and the processing D are image processing whose calculation time is shorter than the data transfer time. Shall. In the processing A and the processing B, the time of the difference between the data transfer time and the calculation time is larger in the processing A, and in the processing C and the processing D, the time of the difference between the data transfer time and the calculation time. Suppose that process C is larger. Further, it is assumed that “2” is preset as the maximum number of combined processes in the host CPU 6. Therefore, in the following description, a case will be described in which the image processor 5 executes four types of image processing in two steps twice.

撮像装置10の動作が開始されると、ホストCPU6は、撮像装置10の動作モードに応じて、実行する画像処理を選択する(ステップS201)。ここでは、上述したように、4種類の異なる画像処理(処理A、処理B、処理C、および処理D)を選択する。   When the operation of the imaging device 10 is started, the host CPU 6 selects image processing to be executed according to the operation mode of the imaging device 10 (step S201). Here, as described above, four different image processes (Process A, Process B, Process C, and Process D) are selected.

続いて、ホストCPU6は、選択したそれぞれの画像処理におけるデータの転送時間と演算時間との時間差diff[i]を算出する(ステップS202)。ステップS202における時間差diff[i]の算出では、それぞれの画像処理(処理A、処理B、処理C、および処理D)毎に、「演算時間」から「データの転送時間」を減算した時間差diff[i]を算出する。ここで、“i”は、それぞれの画像処理に対応する時間差diffを区別するものである。以下の説明においては、処理A、処理B、処理C、および処理Dのそれぞれに対応した時間差diffをそれぞれ、時間差diff[A]、時間差diff[B]、時間差diff[C]、および時間差diff[D]とする。なお、データの転送時間と演算時間との差の時間、すなわち、時間差diff[i]をプログラムデータとして予め格納している場合には、ステップS202は不要となる。   Subsequently, the host CPU 6 calculates a time difference diff [i] between the data transfer time and the calculation time in each selected image processing (step S202). In the calculation of the time difference diff [i] in step S202, for each image processing (process A, process B, process C, and process D), the time difference diff [ i] is calculated. Here, “i” distinguishes the time difference diff corresponding to each image processing. In the following description, the time differences diff corresponding to the processes A, B, C, and D are respectively the time difference diff [A], the time difference diff [B], the time difference diff [C], and the time difference diff [ D]. Note that if the time difference between the data transfer time and the calculation time, that is, the time difference diff [i] is stored in advance as program data, step S202 is not necessary.

ここでは、上述したように、処理Aおよび処理Bは、データの転送時間よりも演算時間の方が長く、処理Cおよび処理Dは、データの転送時間よりも演算時間の方が短い。従って、時間差diff[A]と時間差diff[B]とは正の値であり、時間差diff[C]と時間差diff[D]とは負の値である。また、上述したように、処理Aと処理Bとでは、処理Aの方がデータの転送時間と演算時間との差の時間が大きく、処理Cと処理Dとでは、処理Cの方がデータの転送時間と演算時間との差の時間が大きい。従って、時間差diff[A]と時間差diff[B]とでは、時間差diff[A]の方が大きく、時間差diff[C]と時間差diff[D]とでは、時間差diff[C]の方が絶対値が大きい。   Here, as described above, processing A and processing B have a calculation time longer than the data transfer time, and processing C and processing D have a calculation time shorter than the data transfer time. Therefore, the time difference diff [A] and the time difference diff [B] are positive values, and the time difference diff [C] and the time difference diff [D] are negative values. Further, as described above, in the processing A and the processing B, the processing A has a larger time difference between the data transfer time and the calculation time. In the processing C and the processing D, the processing C is more data. The difference between the transfer time and the calculation time is large. Therefore, the time difference diff [A] and the time difference diff [B] have a larger time difference diff [A], and the time difference diff [C] and the time difference diff [D] have the absolute value of the time difference diff [C]. Is big.

続いて、ホストCPU6は、最大結合処理数の回数だけ繰り返すループを、時間差diff[i]が正の値である処理の数(以下、「処理数TASK_NUM」という)の回数だけ繰り返し、画像処理プロセッサ5が同時期に(並行して)実行を指示する画像処理の組み合わせを決定する。なお、上述したように、時間差diff[i]が正の値である処理は、処理Aと処理Bとである。従って、処理数TASK_NUMは“2”である。   Subsequently, the host CPU 6 repeats the loop that repeats the number of times of the maximum number of combined processes as many times as the number of processes (hereinafter referred to as “the number of processes TASK_NUM”) for which the time difference diff [i] is a positive value, 5 determines a combination of image processings instructed to be executed at the same time (in parallel). As described above, the processes in which the time difference diff [i] is a positive value are the processes A and B. Therefore, the processing number TASK_NUM is “2”.

まず、処理数TASK_NUMの回数だけ繰り返す1回目の処理(ここでは、処理Aに対応する処理)において、最大結合処理数の回数だけ繰り返すループを実行する。最大結合処理数の回数だけ繰り返すループでは、まず、今回の対象としている処理に組み合わせる他の処理を検索する(ステップS203)。ステップS203における処理の検索では、それぞれの処理の時間差diff[i]の絶対値が、今回の対象としている処理の時間差diff[i]の内輪の値に最も近い負の値である処理を検索する。ここでは、対象としている処理が処理Aであるため、処理Aの時間差diff[A]の内輪の値に最も近い方の時間差diff[C]の絶対値または処理Dの時間差diff[D]の絶対値を検出する。そして、処理Cまたは処理Dのいずれかを、処理Aに組み合わせる処理として選択する。なお、処理Bは、時間差diff[B]が正の値であるため、検索の対象、すなわち、処理Aに組み合わせる処理ではない。   First, in a first process (here, a process corresponding to process A) that is repeated by the number of processes TASK_NUM, a loop that is repeated by the number of times of the maximum number of combined processes is executed. In the loop that repeats the number of times of the maximum number of combined processes, first, search for other processes to be combined with the current target process (step S203). In the process search in step S203, a process is searched for in which the absolute value of the time difference diff [i] of each process is a negative value closest to the value of the inner ring of the time difference diff [i] of the current process. . Here, since the target process is the process A, the absolute value of the time difference diff [C] closest to the inner ring value of the time difference diff [A] of the process A or the absolute value of the time difference diff [D] of the process D Detect value. Then, either process C or process D is selected as a process to be combined with process A. Note that the process B is not a process to be combined with the search target, that is, the process A because the time difference diff [B] is a positive value.

続いて、ホストCPU6は、組み合わせる処理があるか否かを判定する(ステップS204)。ステップS204において、組み合わせる処理がある場合には、ホストCPU6は、今回の対象としている処理の時間差diff[i]に選択した処理の時間差diff[i]を加算し、処理を組み合わせた後の新たな時間差diff[i]を算出する(ステップS205)。ここで算出される新たな時間差diff[i]の値は、今回の対象としている処理の時間差diff[i]の値から選択した処理の時間差diff[i]の値を減算した正の値となる。   Subsequently, the host CPU 6 determines whether or not there is a combination process (step S204). In step S204, if there is a process to be combined, the host CPU 6 adds the time difference diff [i] of the selected process to the time difference diff [i] of the process that is the current target, and a new one after combining the processes. The time difference diff [i] is calculated (step S205). The value of the new time difference diff [i] calculated here is a positive value obtained by subtracting the value of the time difference diff [i] of the selected process from the value of the time difference diff [i] of the current process. .

以降、ホストCPU6は、今回の対象としている処理の時間差diff[i]を、算出した新たな時間差diff[i]に置き換えて、ステップS203〜ステップS205までのループの処理を、最大結合処理数の回数だけ繰り返す。その後、ホストCPU6は、ステップS203〜ステップS205までのループの処理の繰り返しを、最大結合処理数と同じ回数だけ行うと、処理のループを抜け出す。また、ステップS204において、組み合わせる処理がない場合、すなわち、最大結合処理数と同じ回数だけ繰り返す前であっても、対象としている処理の時間差diff[i]の内輪の値に最も近い負の値である処理がない場合には、ステップS203〜ステップS205までの処理のループを抜け出す。   Thereafter, the host CPU 6 replaces the time difference diff [i] of the current target process with the calculated new time difference diff [i], and performs the loop process from step S203 to step S205 to the maximum number of combined processes. Repeat as many times. Thereafter, when the host CPU 6 repeats the loop processing from step S203 to step S205 for the same number of times as the maximum number of combined processes, the host CPU 6 exits the processing loop. In step S204, if there is no combination process, that is, before repeating the same number of times as the maximum number of combined processes, the negative value closest to the value of the inner ring of the time difference diff [i] of the target process is a negative value. If there is no process, the process loops from step S203 to step S205 is exited.

続いて、ホストCPU6は、同様に、処理数TASK_NUMの回数だけ繰り返す2回目の処理(ここでは、処理Bに対応する処理)において、最大結合処理数の回数だけ繰り返すループの処理を実行する。   Subsequently, the host CPU 6 similarly executes a loop process that repeats the number of times of the maximum number of combined processes in the second process (here, the process corresponding to the process B) that is repeated by the number of processes TASK_NUM.

以降、同様に、ホストCPU6は、最大結合処理数の回数だけ繰り返すループの処理を処理数TASK_NUMの回数だけ繰り返す。その後、ホストCPU6は、最大結合処理数の回数だけ繰り返すループの処理の繰り返しを、処理数TASK_NUMと同じ回数だけ行うと、すなわち、時間差diff[i]が正の値である全ての処理に対して、画像処理プロセッサ5で同時期に(並行して)実行する他の画像処理の組み合わせを決定すると、処理のループを抜け出す。   Thereafter, similarly, the host CPU 6 repeats the loop processing that is repeated the number of times of the maximum number of combined processings as many times as the processing number TASK_NUM. After that, the host CPU 6 repeats the loop process that repeats the number of times of the maximum number of combined processes as many times as the number of processes TASK_NUM, that is, for all processes in which the time difference diff [i] is a positive value. When the image processing processor 5 determines another combination of image processing to be executed at the same time (in parallel), the processing loop is exited.

なお、ここでは、処理数TASK_NUM=2であるため、ホストCPU6は、処理数TASK_NUMの回数だけ繰り返すループの処理を2回繰り返す。また、最大結合処理数=2であるため、ホストCPU6は、最大で2種類の画像処理を結合する。以下の説明においては、処理Aに処理Cが組み合わされ、処理Bに処理Dが組み合わされたものとして説明を行う。   Here, since the number of processes TASK_NUM = 2, the host CPU 6 repeats the loop process repeated twice as many times as the number of processes TASK_NUM. Since the maximum number of combined processes = 2, the host CPU 6 combines two types of image processes at maximum. In the following description, it is assumed that process A is combined with process A, and process D is combined with process B.

続いて、ホストCPU6は、画像処理プロセッサ5が実行した画像処理の組み合わせの数を表すカウント値task_cntをリセット(初期化)、すなわち、“0”にする。そして、ホストCPU6は、複数処理実行の処理を開始する。   Subsequently, the host CPU 6 resets (initializes) a count value task_cnt indicating the number of combinations of image processing executed by the image processor 5, that is, sets it to “0”. Then, the host CPU 6 starts a process for executing a plurality of processes.

複数処理実行の処理において、ホストCPU6は、まず、割り込み処理を実行する(ステップS207)。ステップS207の割り込み処理では、ホストCPU6が、撮像装置10内の各構成要素からの割り込み信号を受け付ける。その後、キャプチャ部3は、イメージャ2から出力された画像信号を1フレーム分キャプチャした入力画像データをDRAM4に格納すると、ホストCPU6にキャプチャ完了信号を出力する。   In the multi-process execution process, the host CPU 6 first executes an interrupt process (step S207). In the interrupt process of step S207, the host CPU 6 receives an interrupt signal from each component in the imaging device 10. Thereafter, when the capture unit 3 stores the input image data obtained by capturing one frame of the image signal output from the imager 2 in the DRAM 4, the capture unit 3 outputs a capture completion signal to the host CPU 6.

ホストCPU6が、撮像装置10内の各構成要素からの割り込み信号を受け付けると、受け付けた割り込みの要因を判定する(ステップS208)。ステップS208において、割り込みの要因がキャプチャ部3からのキャプチャ完了信号である場合には、ホストCPU6は、画像処理プロセッサ5を起動する(ステップS211)。ホストCPU6が画像処理プロセッサ5を起動する際、ホストCPU6は、画像処理プロセッサ5に実行指示を出力するとともに、最初に実行する画像処理の組み合わせ(ここでは、まず、処理Aと処理Cとの2種類の組み合わせ)を表す情報を画像処理プロセッサ5に出力する。この実行する画像処理の組み合わせを表す情報には、画像処理プロセッサ5に備えた複数種類(例えば、N種類)の画像処理演算部52のそれぞれを、異なるそれぞれのビットで表したフラグが用いられる。この場合、ホストCPU6は、今回実行する画像処理に対応するビットをONにしたフラグを、画像処理プロセッサ5に出力する。   When the host CPU 6 accepts an interrupt signal from each component in the imaging device 10, the cause of the accepted interrupt is determined (step S208). In step S208, if the cause of the interruption is a capture completion signal from the capture unit 3, the host CPU 6 activates the image processor 5 (step S211). When the host CPU 6 activates the image processing processor 5, the host CPU 6 outputs an execution instruction to the image processing processor 5, and the combination of image processing to be executed first (here, first, processing A and processing C 2 Information representing the combination of types is output to the image processor 5. For the information representing the combination of image processing to be executed, a flag representing each of a plurality of types (for example, N types) of image processing arithmetic units 52 provided in the image processing processor 5 with different bits is used. In this case, the host CPU 6 outputs a flag with the bit corresponding to the image processing to be executed this time turned ON to the image processing processor 5.

画像処理プロセッサ5は、ホストCPU6によって起動が指示される、すなわち、ホストCPU6から実行指示と実行する画像処理の情報を表すフラグが入力されると、指示された組み合わせの画像処理の実行を開始する。まず、画像処理プロセッサ5は、入力されたフラグにおいてONになっているビットに対応した画像処理演算部52が、画像処理する際に必要とする内蔵メモリの容量を動的に確保する(ステップS214)。   When the activation is instructed by the host CPU 6, that is, when an execution instruction and a flag indicating information of image processing to be executed are input from the host CPU 6, the image processing processor 5 starts executing the image processing of the instructed combination. . First, the image processor 5 dynamically secures the capacity of the built-in memory required for image processing by the image processing arithmetic unit 52 corresponding to the bit turned ON in the input flag (step S214). ).

なお、画像処理プロセッサ5は、キャプチャ部3が1フレーム分キャプチャした入力画像データを、それぞれの処理に応じた複数個(例えば、M個)に分割し、分割した入力画像データのそれぞれに対する画像処理を、それぞれの処理に応じて分割した数分だけ繰り返すことによって、1フレーム分の画像処理を完了する。従って、それぞれの画像処理演算部52に対応して動的に確保する内蔵メモリの容量は、分割した入力画像データに対して画像処理を施すために必要な小容量である。以下の説明においては、処理A、処理B、処理C、および処理Dのそれぞれの画像処理における入力画像データの分割数を、それぞれ分割数Ma、分割数Mb、分割数Mc、および分割数Mdとする。   The image processor 5 divides the input image data captured by the capture unit 3 for one frame into a plurality (for example, M) corresponding to each process, and performs image processing on each of the divided input image data. Is repeated for the number of times divided according to each processing, thereby completing the image processing for one frame. Therefore, the capacity of the built-in memory that is dynamically secured in correspondence with each image processing calculation unit 52 is a small capacity necessary for performing image processing on the divided input image data. In the following description, the number of divisions of input image data in each of the image processing of process A, process B, process C, and process D is represented as division number Ma, division number Mb, division number Mc, and division number Md, respectively. To do.

続いて、画像処理プロセッサ5は、今回実行する2種類の画像処理(処理Aおよび処理C)のそれぞれに必要な、分割した最初(1個目)の入力画像データ(1/Maの入力画像データ、および1/Mcの入力画像データ)をDRAM4から読み出すため、フラグがONになっているビットに対応したリードDMA(1回目のリードDMA)を起動する(ステップS215)。次に、画像処理プロセッサ5は、分割した処理の1回目のループにおいて、フラグがONになっているビットに対応した1回目のリードDMAの終了を待つ(ステップS216)。1回目のリードDMAが終了すると、画像処理プロセッサ5は、次(2個目)の入力画像データ(1/Maの入力画像データ、および1/Mcの入力画像データ)を事前にDRAM4から読み出すため、フラグがONになっているビットに対応したリードDMA(2回目のリードDMA)を起動する(ステップS217)。   Subsequently, the image processor 5 splits the first (first) input image data (1 / Ma input image data) necessary for each of the two types of image processing (processing A and processing C) to be executed this time. , And 1 / Mc input image data) is read from the DRAM 4, the read DMA (first read DMA) corresponding to the bit whose flag is ON is activated (step S 215). Next, the image processor 5 waits for the end of the first read DMA corresponding to the bit whose flag is ON in the first loop of the divided processing (step S216). When the first read DMA is completed, the image processor 5 reads the next (second) input image data (1 / Ma input image data and 1 / Mc input image data) from the DRAM 4 in advance. Then, the read DMA (second read DMA) corresponding to the bit whose flag is ON is activated (step S217).

画像処理プロセッサ5は、2回目のリードDMAによって2個目の入力画像データをDRAM4から読み出している間に、1個目の入力画像データに対して、フラグがONになっているビットに対応した2種類の画像処理(処理Aおよび処理Cの演算)を、同時期に(並行して)実行する(ステップS218およびステップS219)。なお、図7に示したフローチャートでは、第1の処理の演算(ステップS218)と第2の処理の演算(ステップS219)とを、順次実行する場合の一例を示している。ここでは、処理Aが第1の処理に対応し、処理Cが第2の処理に対応する。   The image processor 5 corresponds to the bit for which the flag is ON for the first input image data while the second input image data is being read from the DRAM 4 by the second read DMA. Two types of image processing (operations of processing A and processing C) are executed at the same time (in parallel) (steps S218 and S219). Note that the flowchart shown in FIG. 7 shows an example in which the calculation of the first process (step S218) and the calculation of the second process (step S219) are sequentially executed. Here, process A corresponds to the first process, and process C corresponds to the second process.

その後、フラグがONになっているビットに対応した2種類の画像処理が完了すると、画像処理プロセッサ5は、今回の処理のループが1回目のループであるか否かを判定する(ステップS220)。ステップS220において、今回の処理のループが1回目のループである場合には、画像処理プロセッサ5は、1個目の入力画像データ(1/Maの入力画像データ、および1/Mcの入力画像データ)に対して画像処理を施した後のそれぞれの1個目の画像処理結果をDRAM4に書き戻すため、フラグがONになっているビットに対応したライトDMA(1回目のライトDMA)を起動する(ステップS222)。   Thereafter, when the two types of image processing corresponding to the bit whose flag is ON are completed, the image processing processor 5 determines whether or not the current processing loop is the first loop (step S220). . In step S220, when the current processing loop is the first loop, the image processor 5 determines that the first input image data (1 / Ma input image data and 1 / Mc input image data). ) To write back each first image processing result after image processing to DRAM 4 to activate the write DMA (first write DMA) corresponding to the bit whose flag is ON. (Step S222).

なお、図7に示したフローチャートでは、第1の処理(処理A)の演算(ステップS218)と第2の処理(処理C)の演算(ステップS219)とを順次実行し、2種類の画像処理が完了した後に、フラグがONになっているビットに対応したライトDMAを起動する(ステップS222)場合について説明した。しかし、画像処理を実行し、画像処理を施した後の画像処理結果をDRAM4に書き戻す手順は、図7に示したステップS218〜ステップS222までの処理手順のみに限定されるものではない。例えば、図3に示した第1の実施形態の複数処理実行方法の処理手順におけるステップS8〜ステップS12までの処理と同様に、それぞれの画像処理が完了する毎に、画像処理を施した後の画像処理結果をDRAM4に書き戻す手順にすることもできる。   In the flowchart shown in FIG. 7, the calculation of the first process (process A) (step S218) and the calculation of the second process (process C) (step S219) are sequentially executed, and two types of image processing are performed. A case has been described in which the write DMA corresponding to the bit whose flag is ON is started after step S <b> 222 is completed (step S <b> 222). However, the procedure of executing the image processing and writing back the image processing result after the image processing to the DRAM 4 is not limited to the processing procedure from step S218 to step S222 shown in FIG. For example, in the same manner as the processing from step S8 to step S12 in the processing procedure of the multiple processing execution method of the first embodiment shown in FIG. A procedure for writing back the image processing result to the DRAM 4 may be employed.

そして、画像処理プロセッサ5は、分割した処理の2回目のループにおいて、フラグがONになっているビットに対応した2回目のリードDMAの終了を待つ(ステップS216)。2回目のリードDMAが終了すると、画像処理プロセッサ5は、次(3個目)の入力画像データ(1/Maの入力画像データ、および1/Mcの入力画像データ)を事前にDRAM4から読み出すため、フラグがONになっているビットに対応したリードDMA(3回目のリードDMA)を起動する(ステップS217)。   Then, the image processor 5 waits for the end of the second read DMA corresponding to the bit whose flag is ON in the second loop of the divided processing (step S216). When the second read DMA is completed, the image processor 5 reads the next (third) input image data (1 / Ma input image data and 1 / Mc input image data) from the DRAM 4 in advance. Then, the read DMA (third read DMA) corresponding to the bit whose flag is ON is activated (step S217).

画像処理プロセッサ5は、3回目のリードDMAによって3個目の入力画像データをDRAM4から読み出している間に、2個目の入力画像データに対して、フラグがONになっているビットに対応した2種類の画像処理(処理Aおよび処理Cの演算)を、同時期に(並行して)実行する(ステップS218およびステップS219)。   While the third input image data is being read from the DRAM 4 by the third read DMA, the image processor 5 corresponds to the bit for which the flag is ON for the second input image data. Two types of image processing (operations of processing A and processing C) are executed at the same time (in parallel) (steps S218 and S219).

その後、フラグがONになっているビットに対応した2種類の画像処理が完了すると、画像処理プロセッサ5は、今回の処理のループが1回目のループであるか否かを判定する(ステップS220)。ステップS220において、今回の処理のループが1回目のループでない場合には、画像処理プロセッサ5は、フラグがONになっているビットに対応した1回目のライトDMAの終了を待つ(ステップS221)。フラグがONになっているビットに対応した1回目のライトDMAが終了すると、画像処理プロセッサ5は、2個目の入力画像データ(1/Maの入力画像データ、および1/Mcの入力画像データ)に対して画像処理を施した後のそれぞれの2個目の画像処理結果をDRAM4に書き戻すため、フラグがONになっているビットに対応したライトDMA(2回目のライトDMA)を起動する(ステップS222)。   Thereafter, when the two types of image processing corresponding to the bit whose flag is ON are completed, the image processing processor 5 determines whether or not the current processing loop is the first loop (step S220). . If the current processing loop is not the first loop in step S220, the image processor 5 waits for the end of the first write DMA corresponding to the bit whose flag is ON (step S221). When the first write DMA corresponding to the bit whose flag is ON is completed, the image processor 5 reads the second input image data (1 / Ma input image data and 1 / Mc input image data). ) Is started, the write DMA corresponding to the bit whose flag is ON (second write DMA) is started in order to write back each second image processing result after the image processing to the DRAM 4. (Step S222).

以降、同様に、画像処理プロセッサ5は、ステップS216〜ステップS222までの処理を、入力画像データを分割した数分(例えば、M回)だけ繰り返す。その後、画像処理プロセッサ5は、ステップS216〜ステップS222までの処理の繰り返しを、入力画像データを分割した数と同じ回数行うと、すなわち、キャプチャ部3がキャプチャした1フレーム分の入力画像データに対して実行した、フラグがONになっているビットに対応した2種類の画像処理が完了すると、処理のループを抜け出す。そして画像処理プロセッサ5は、フラグがONになっているビットに対応した最後のライトDMAの終了を待つ(ステップS223)。フラグがONになっているビットに対応した最後のライトDMAが終了する、すなわち、キャプチャ部3がキャプチャした1フレーム分の入力画像データに対して実行した、フラグがONになっているビットに対応した2種類の画像処理結果(処理Aおよび処理Cの画像処理結果)をDRAM4に書き戻すと、画像処理プロセッサ5は、終了割り込み信号をホストCPU6に出力する(ステップS224)。   Thereafter, similarly, the image processor 5 repeats the processing from step S216 to step S222 by the number of times (for example, M times) obtained by dividing the input image data. Thereafter, when the image processor 5 repeats the processing from step S216 to step S222 as many times as the number of divided input image data, that is, for one frame of input image data captured by the capture unit 3 When the two types of image processing corresponding to the bit for which the flag is ON are completed, the processing loop is exited. Then, the image processor 5 waits for the end of the last write DMA corresponding to the bit whose flag is ON (step S223). The last write DMA corresponding to the bit whose flag is ON ends, that is, corresponding to the bit whose flag is ON executed for one frame of input image data captured by the capture unit 3 When the two types of image processing results (image processing results of processing A and processing C) are written back to the DRAM 4, the image processing processor 5 outputs an end interrupt signal to the host CPU 6 (step S224).

ホストCPU6は、割り込み処理において、画像処理プロセッサ5からの終了割り込み信号を受け付ける(ステップS207)。ホストCPU6が、画像処理プロセッサ5からの終了割り込み信号を受け付けると、受け付けた割り込みの要因を判定する(ステップS208)。ここでは、ステップS208において、割り込みの要因が画像処理プロセッサ5からの終了割り込み信号であると判定される。   In the interrupt process, the host CPU 6 accepts an end interrupt signal from the image processor 5 (step S207). When the host CPU 6 receives the end interrupt signal from the image processor 5, it determines the cause of the received interrupt (step S208). Here, in step S208, it is determined that the cause of the interruption is the end interruption signal from the image processor 5.

続いて、ホストCPU6は、カウント値task_cntに“1”を加算する、すなわち、カウント値task_cntの値を1つ進める(ステップS209)。そして、ホストCPU6は、入力画像データに対して施す全ての画像処理(処理A、処理B、処理C、および処理D)が完了したか否かを判定する(ステップS210)。ステップS210の判定では、カウント値task_cntの値が、処理数TASK_NUMの値に到達しているか否かによって、全ての画像処理が完了したか否かを判定する。そして、カウント値task_cntの値が処理数TASK_NUMの値に到達している場合に、全ての画像処理が完了したと判定し、カウント値task_cntの値が処理数TASK_NUMの値に到達していない場合に、全ての画像処理が完了していないと判定する。これは、本第3の実施形態の複数処理実行方法では、時間差diff[i]が正の値である処理に時間差diff[i]が負の値である処理を組み合わせている。従って、時間差diff[i]が正の値である処理の数である処理数TASK_NUMの値だけ画像処理の組み合わせができる。このことから、画像処理プロセッサ5が、処理数TASK_NUMの回数だけ組み合わせた画像処理を実行すると、全ての画像処理が完了したことになるためである。   Subsequently, the host CPU 6 adds “1” to the count value task_cnt, that is, advances the value of the count value task_cnt by one (step S209). Then, the host CPU 6 determines whether or not all image processing (processing A, processing B, processing C, and processing D) to be performed on the input image data has been completed (step S210). In the determination in step S210, it is determined whether or not all image processing has been completed depending on whether or not the count value task_cnt has reached the value of the processing number TASK_NUM. When the count value task_cnt has reached the value of the processing number TASK_NUM, it is determined that all image processing has been completed, and when the count value task_cnt has not reached the value of the processing number TASK_NUM. It is determined that all image processing has not been completed. In the multi-process execution method of the third embodiment, the process in which the time difference diff [i] is a positive value is combined with the process in which the time difference diff [i] is a negative value. Therefore, image processing can be combined by the value of the processing number TASK_NUM, which is the number of processes for which the time difference diff [i] is a positive value. For this reason, when the image processing processor 5 executes image processing that is combined by the number of processing times TASK_NUM, all image processing is completed.

ここでは、ステップS210において、全ての画像処理が完了していないと判定されるため、ホストCPU6は、再度、画像処理プロセッサ5を起動する(ステップS211)。ホストCPU6が画像処理プロセッサ5を起動する際、ホストCPU6は、画像処理プロセッサ5に実行指示を出力するとともに、次に実行する画像処理の組み合わせ(ここでは、まず、処理Bと処理Dとの2種類の組み合わせ)を表す情報を画像処理プロセッサ5に出力する。   Here, since it is determined in step S210 that all image processing has not been completed, the host CPU 6 activates the image processing processor 5 again (step S211). When the host CPU 6 activates the image processing processor 5, the host CPU 6 outputs an execution instruction to the image processing processor 5 and a combination of image processing to be executed next (here, first, processing B and processing D are 2 Information representing the combination of types is output to the image processor 5.

画像処理プロセッサ5は、ホストCPU6によって起動が指示されると、指示された組み合わせの画像処理の実行を開始し、入力されたフラグにおいてONになっているビットに対応した処理Bと処理Dとの2種類の画像処理演算部52が、画像処理する際に必要とする内蔵メモリの容量を動的に確保する(ステップS214)。   When the activation is instructed by the host CPU 6, the image processor 5 starts executing the image processing of the instructed combination, and performs processing B and processing D corresponding to the bit turned ON in the input flag. The two types of image processing arithmetic units 52 dynamically secure the capacity of the built-in memory necessary for image processing (step S214).

続いて、画像処理プロセッサ5は、今回実行する2種類の画像処理(処理Bおよび処理D)のそれぞれに必要な、分割した最初(1個目)の入力画像データ(1/Mbの入力画像データ、および1/Mdの入力画像データ)をDRAM4から読み出すため、フラグがONになっているビットに対応したリードDMA(1回目のリードDMA)を起動する(ステップS215)。   Subsequently, the image processor 5 splits the first (first) input image data (1 / Mb input image data) necessary for each of the two types of image processing (processing B and processing D) to be executed this time. , And 1 / Md input image data) is read from the DRAM 4, the read DMA (first read DMA) corresponding to the bit whose flag is ON is activated (step S 215).

以降、上述した処理Aと処理Cとの2種類の画像処理と同様の手順で、処理Bと処理Dとの2種類の画像処理を実行する。なお、処理Bと処理Dとの2種類の画像処理は、処理Bが第1の処理(ステップS218)に対応し、処理Dが第2の処理(ステップS219)に対応する以外は、上述した処理Aと処理Cとの2種類の画像処理と同様の手順で実行されるため、詳細な説明は省略する。   Thereafter, the two types of image processing of the processing B and the processing D are executed in the same procedure as the two types of image processing of the processing A and the processing C described above. Note that the two types of image processing, processing B and processing D, have been described above except that processing B corresponds to the first processing (step S218) and processing D corresponds to the second processing (step S219). Since it is executed in the same procedure as the two types of image processing of processing A and processing C, detailed description is omitted.

その後、フラグがONになっているビットに対応した2種類の画像処理(処理Bおよび処理D)が完了する、すなわち、キャプチャ部3がキャプチャした1フレーム分の入力画像データに対して実行した、フラグがONになっているビットに対応した2種類の画像処理結果(処理Bおよび処理Dの画像処理結果)をDRAM4に書き戻すと、画像処理プロセッサ5は、終了割り込み信号をホストCPU6に出力する(ステップS224)。   Thereafter, two types of image processing (processing B and processing D) corresponding to the bit whose flag is ON are completed, that is, executed for one frame of input image data captured by the capture unit 3, When the two types of image processing results (image processing results of processing B and processing D) corresponding to the bit whose flag is ON are written back to the DRAM 4, the image processing processor 5 outputs an end interrupt signal to the host CPU 6. (Step S224).

ホストCPU6は、割り込み処理において、画像処理プロセッサ5からの終了割り込み信号を受け付ける(ステップS207)。ホストCPU6が、画像処理プロセッサ5からの終了割り込み信号を受け付けると、受け付けた割り込みの要因を判定する(ステップS208)。ここでは、ステップS208において、割り込みの要因が画像処理プロセッサ5からの終了割り込み信号であると判定される。   In the interrupt process, the host CPU 6 accepts an end interrupt signal from the image processor 5 (step S207). When the host CPU 6 receives the end interrupt signal from the image processor 5, it determines the cause of the received interrupt (step S208). Here, in step S208, it is determined that the cause of the interruption is the end interruption signal from the image processor 5.

続いて、ホストCPU6は、カウント値task_cntに“1”を加算して、カウント値task_cntの値を1つ進める(ステップS209)。そして、ホストCPU6は、入力画像データに対して施す全ての画像処理(処理A、処理B、処理C、および処理D)が完了したか否かを判定する(ステップS210)。ここでは、ステップS210において、全ての画像処理が完了したと判定されるため、ホストCPU6は、画像処理部7を起動し、画像処理プロセッサ5がDRAM4に書き戻した画像処理結果に対して各種の画像処理を施させる(ステップS212)。そして、ホストCPU6は、カウント値task_cntをリセット(初期化)、すなわち、“0”にする。   Subsequently, the host CPU 6 adds “1” to the count value task_cnt and advances the count value task_cnt by one (step S209). Then, the host CPU 6 determines whether or not all image processing (processing A, processing B, processing C, and processing D) to be performed on the input image data has been completed (step S210). Here, since it is determined in step S210 that all image processing has been completed, the host CPU 6 activates the image processing unit 7 and performs various processing on the image processing results written back to the DRAM 4 by the image processing processor 5. Image processing is performed (step S212). Then, the host CPU 6 resets (initializes) the count value task_cnt, that is, sets it to “0”.

上記に述べたように、本第3の実施形態の複数処理実行方法を適用した撮像装置10では、ホストCPU6が、画像処理プロセッサ5に実行させる画像処理の組み合わせを、画像処理プロセッサ5に備えた内蔵メモリの容量を考慮して動的に決定する。これにより、第1の実施形態の複数処理実行方法と同様に、ホストCPU6が、画像処理プロセッサ5に複数種類(例えば、N種類)の異なる画像処理を、同時期に(並行して)施させる。これにより、本第3の実施形態の複数処理実行方法でも、第1の実施形態の複数処理実行方法と同様に、従来のプロセッサの処理においてシステムの性能を低下させてしまう要因となっていたデータ転送や演算の待ち時間を、同時期に(並行して)実行している他の処理を実行する時間に充てることができ、システム全体の処理における待ち時間を少なくし、システム性能の低下を防止することができる。   As described above, in the imaging device 10 to which the multiple processing execution method of the third embodiment is applied, the image processing processor 5 includes a combination of image processing that the host CPU 6 causes the image processing processor 5 to execute. Dynamically determined in consideration of the capacity of the built-in memory. As a result, like the multiple processing execution method of the first embodiment, the host CPU 6 causes the image processor 5 to perform multiple types (for example, N types) of different image processing at the same time (in parallel). . As a result, in the multi-process execution method of the third embodiment as well, as in the multi-process execution method of the first embodiment, data that has been a factor of reducing the system performance in the conventional processor processing The waiting time for transfer and computation can be used for the time to execute other processes executed at the same time (in parallel), reducing the waiting time for the entire system processing and preventing the system performance from degrading. can do.

また、本第3の実施形態の複数処理実行方法を適用した撮像装置10では、ホストCPU6が、画像処理プロセッサ5に実行させる画像処理の組み合わせを決定する際に、必要以上に多くの種類の画像処理を組み合わせないようにすることができる。そして、画像処理プロセッサ5が、ホストCPU6から指示された画像処理を実行する際に必要な入力画像データを一時記憶するための内蔵メモリの容量を動的に確保する。これにより、本第3の実施形態の複数処理実行方法では、画像処理プロセッサ5に備えた内蔵メモリの容量を圧迫することがなくなる。   In the imaging apparatus 10 to which the multiple processing execution method of the third embodiment is applied, when the host CPU 6 determines combinations of image processing to be executed by the image processor 5, more types of images than necessary are required. It is possible not to combine the processes. The image processor 5 dynamically secures a capacity of a built-in memory for temporarily storing input image data required when executing image processing instructed by the host CPU 6. Thereby, in the multiple processing execution method of the third embodiment, the capacity of the built-in memory provided in the image processor 5 is not compressed.

なお、本第3の実施形態の複数処理実行方法を適用した撮像装置10では、ホストCPU6が、画像処理プロセッサ5に実行させる画像処理を、必要以上に多くしないように画像処理の組み合わせを決定するため、ハンドシェークの処理の回数が、第1の実施形態の複数処理実行方法や第2の実施形態の複数処理実行方法よりも多くなることも考えられる。しかし、本第3の実施形態の複数処理実行方法でも、複数種類(例えば、N種類)の異なる画像処理を一纏めにして、同時期に(並行して)施させるため、従来のプロセッサの処理において、それぞれの処理を単体で実行するたびに行われているハンドシェークの処理の回数よりは、ハンドシェークの処理の回数を削減することができる。このことにより、本第3の実施形態の複数処理実行方法でも、システム全体の処理におけるハンドシェークに要する処理時間を少なくし、システム性能の低下をさらに防止することができる。   In the imaging apparatus 10 to which the multiple processing execution method of the third embodiment is applied, the host CPU 6 determines a combination of image processing so that the image processing to be executed by the image processing processor 5 is not more than necessary. For this reason, the number of handshaking processes may be greater than the multiple process execution method of the first embodiment and the multiple process execution method of the second embodiment. However, even in the multi-process execution method of the third embodiment, a plurality of types (for example, N types) of different image processes are grouped and performed at the same time (in parallel). The number of handshake processes can be reduced from the number of handshake processes performed each time each process is executed alone. As a result, even in the multiple processing execution method of the third embodiment, it is possible to reduce the processing time required for handshaking in the processing of the entire system and further prevent the system performance from being deteriorated.

なお、本第3の実施形態の複数処理実行方法では、画像処理プロセッサ5の処理手順が、第1の実施形態の複数処理実行方法とほぼ同様の手順である場合について説明したが、画像処理プロセッサ5の処理手順を、第2の実施形態の複数処理実行方法とほぼ同様の手順にすることもできる。   In the multiple processing execution method of the third embodiment, the case has been described where the processing procedure of the image processing processor 5 is substantially the same as the multiple processing execution method of the first embodiment. The processing procedure 5 can be substantially the same as the multiple processing execution method of the second embodiment.

上記に述べたとおり、本発明を実施するための形態によれば、画像処理プロセッサにおいて、データ転送を行う入出力部(DMA部51)と、画像処理の演算を行う演算部(画像処理演算部52)との動作を分け、それぞれの入出力部の制御と、それぞれの演算部の制御とを一纏めにして制御する。これにより、本発明を実施するための形態では、画像処理プロセッサにおけるデータ転送と画像処理の演算とを、同時期に(並行して)実行することができる。このことにより、本発明を実施するための形態では、従来のプロセッサの処理においてシステムの性能を低下させてしまう要因となっていたデータ転送や演算の待ち時間を、同時期に(並行して)実行している他の画像処理を実行する時間に充てることができる。また、本発明を実施するための形態では、複数種類の異なる画像処理を組み合わせて(一纏めにして)、同時期に(並行して)実行することができる。このことにより、本発明を実施するための形態では、従来のプロセッサの処理において、それぞれの処理を単体で実行するたびに行われているハンドシェークの処理の回数を、同時期に(並行して)実行する画像処理の組み合わせの回数に削減することができる。これらのことにより、本発明を実施するための形態では、複数の処理を実行するシステムにおいて、ハンドシェークが頻発することや、それぞれの処理内での待ち時間が発生することによるシステム性能の低下を低減することができる。   As described above, according to the embodiment for carrying out the present invention, in the image processor, the input / output unit (DMA unit 51) that performs data transfer and the calculation unit (image processing calculation unit) that performs calculation of image processing. 52), the control of each input / output unit and the control of each calculation unit are collectively controlled. Thereby, in the form for implementing this invention, the data transfer in an image processor and the calculation of image processing can be performed at the same time (in parallel). As a result, in the mode for carrying out the present invention, the waiting time for data transfer and calculation, which has been a factor of degrading the system performance in the processing of the conventional processor, is set at the same time (in parallel). It can be devoted to the time to execute other image processing being executed. In the embodiment for carrying out the present invention, a plurality of different types of image processing can be combined (collectively) and executed at the same time (in parallel). As a result, in the mode for carrying out the present invention, the number of handshaking processes performed each time each process is executed alone in the conventional processor process is set at the same time (in parallel). The number of image processing combinations to be executed can be reduced. As a result, in the embodiment for carrying out the present invention, in a system that executes a plurality of processes, reduction of system performance due to frequent handshaking and waiting time in each process is reduced. can do.

なお、本実施形態においては、画像処理プロセッサ5が、2種類の異なる画像処理を同時期に(並行して)実行する場合について説明した。しかし、画像処理プロセッサ5が同時期に(並行して)実行する画像処理の数は、2種類に限定されるものではなく、さらに多くの種類の画像処理を同時期に(並行して)実行する場合であっても、同様に本発明の複数処理実行方法を適用することができる。   In the present embodiment, the case where the image processor 5 executes two types of different image processes at the same time (in parallel) has been described. However, the number of image processes that the image processor 5 executes at the same time (in parallel) is not limited to two types, and more types of image processing are executed at the same time (in parallel). Even in this case, the multi-processing execution method of the present invention can be similarly applied.

なお、本実施形態においては、本発明の複数処理実行方法を、撮像装置10に適用した場合について説明した。しかし、本発明の複数処理実行方法を適用することができるシステムは、本発明を実施するための形態に限定されるものではなく、ホストCPUと、ホストCPUに制御される割り込み制御機構を持たないプロセッサとを備え、プロセッサで複数の処理を行うシステムであれば、どのようなシステムも適用することができる。   In the present embodiment, the case where the multiple processing execution method of the present invention is applied to the imaging apparatus 10 has been described. However, the system to which the multiple processing execution method of the present invention can be applied is not limited to the mode for carrying out the present invention, and does not have a host CPU and an interrupt control mechanism controlled by the host CPU. Any system can be applied as long as the system includes a processor and the processor performs a plurality of processes.

以上、本発明の実施形態について、図面を参照して説明してきたが、具体的な構成はこの実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲においての種々の変更も含まれる。   The embodiment of the present invention has been described above with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes various modifications within the scope of the present invention. It is.

10・・・撮像装置(データ処理システム)
1・・・レンズ
2・・・イメージャ
3・・・キャプチャ部
4・・・DRAM(外部メモリ)
5・・・画像処理プロセッサ(プロセッサ)
51・・・DMA部
52・・・画像処理演算部(処理部)
6・・・ホストCPU
7・・・画像処理部
8・・・記録部
9・・・メモリカード
10 ... Imaging device (data processing system)
DESCRIPTION OF SYMBOLS 1 ... Lens 2 ... Imager 3 ... Capture part 4 ... DRAM (external memory)
5. Image processing processor (processor)
51... DMA unit 52... Image processing calculation unit (processing unit)
6 ... Host CPU
7: Image processing unit 8: Recording unit 9: Memory card

Claims (4)

データを格納する外部メモリと、
前記データに対して処理を施す複数の処理部と、複数の前記処理部のそれぞれに対応した複数のチャンネルを有し、それぞれのチャンネル毎に前記外部メモリにアクセスするDMA部と、を具備したプロセッサと、
前記プロセッサに具備されたそれぞれの前記処理部による処理の実行を指示するホストCPUと、
を備えたデータ処理システムにおける複数処理実行方法であって、
前記ホストCPUによって実行が指示された前記処理部に対応する前記DMA部のデータ読み出し用チャンネルによって、前記外部メモリからの前記データの読み出しが全て完了した後に、該データ読み出し用チャンネルに、前記外部メモリからの次の前記データの読み出しを開始させるリードDMAステップと、
前記データ読み出し用チャンネルによる前記外部メモリからの次の前記データの読み出しと並行して、前記ホストCPUによって実行が指示された前記処理部に、前記外部メモリからの読み出しが完了した前記データに対する処理を実行させる複数処理実行ステップと、
前記ホストCPUによって実行が指示された前記処理部に対応する前記DMA部のデータ書き込み用チャンネルに、該処理部が処理を完了した結果データの前記外部メモリへの書き込みを開始させるライトDMAステップと、
を含む、
ことを特徴とする複数処理実行方法。
External memory for storing data,
A processor comprising: a plurality of processing units that process the data; and a DMA unit that has a plurality of channels corresponding to each of the plurality of processing units and accesses the external memory for each channel. When,
A host CPU that instructs execution of processing by each of the processing units included in the processor;
A method for executing multiple processes in a data processing system comprising:
After all the data read from the external memory is completed by the data read channel of the DMA unit corresponding to the processing unit instructed to be executed by the host CPU, the external memory is connected to the data read channel. A read DMA step for starting reading of the next data from
In parallel with the reading of the next data from the external memory by the data reading channel, the processing unit instructed to execute by the host CPU performs processing on the data that has been read from the external memory. Multiple process execution steps to be executed;
A write DMA step for starting writing the result data that the processing unit has completed processing to the external memory into the data write channel of the DMA unit corresponding to the processing unit that is instructed to be executed by the host CPU;
including,
A method for executing multiple processes.
前記リードDMAステップは、
前記処理部が前記データに対する処理を実行するか否かの周期を表す、それぞれの前記処理部に対応した実行周期に基づいて、それぞれの前記処理部に対応する前記データ読み出し用チャンネルに、次の前記データの読み出しを開始させるか否かを判定するリードDMA実行判定ステップ、
を含み、
次の前記データの読み出しを開始させると判定した前記データ読み出し用チャンネルに、次の前記データの読み出しを開始させ、
前記データの読み出しを開始させた前記データ読み出し用チャンネルによる前記外部メモリからの次の前記データの読み出しが全て完了した後に、次のリードDMA実行判定ステップを実行し、
前記複数処理実行ステップは、
前記リードDMA実行判定ステップによって次の前記データの読み出しを開始させるか否かを判定する前に前記データの読み出しを開始させた前記データ読み出し用チャンネルに対応する前記処理部に、前記外部メモリからの読み出しが完了した前記データに対する処理を実行させ、
前記ライトDMAステップは、
前記データに対する処理を実行した前記処理部に対応する前記データ書き込み用チャンネルに、該処理部が処理を完了した前記結果データの前記外部メモリへの書き込みを開始させる、
ことを特徴とする請求項1に記載の複数処理実行方法。
The read DMA step includes:
Based on the execution cycle corresponding to each of the processing units, which represents the cycle of whether or not the processing unit executes the processing on the data, the data reading channel corresponding to each of the processing units is set to the following A read DMA execution determination step for determining whether to start reading the data;
Including
In the data read channel determined to start reading the next data, start reading the next data,
After all the next reading of the data from the external memory by the data reading channel that has started reading the data is completed, a next read DMA execution determination step is executed,
The multiple processing execution step includes:
Before the read DMA execution determination step determines whether or not to start reading the next data, the processing unit corresponding to the data read channel that has started the data read from the external memory Causing the data that has been read to be processed,
The write DMA step includes:
Causing the data writing channel corresponding to the processing unit that has performed processing on the data to start writing the result data that the processing unit has completed to the external memory;
The multiple processing execution method according to claim 1, wherein:
前記リードDMA実行判定ステップは、
前記データ読み出し用チャンネルによって前記データの読み出しを実行するか否かを表す、それぞれの前記データ読み出し用チャンネルに対応したDMA実行状態と、
前記処理部によって前記データに対する処理を実行するか否かを表す、それぞれの前記処理部に対応した処理実行状態と、
を設定し、
次の前記データの読み出しを開始させるか否かを判定する前に、
現在の前記DMA実行状態を、前記処理実行状態にコピーすることによって、前記データの読み出しを実行する前記データ読み出し用チャンネルに対応した前記処理部による前記データに対する処理を実行する状態とし、
次の前記データの読み出しを開始させるか否かの判定において、
前記実行周期が、前記処理部が前記データに対する処理を実行するタイミングであるときに、次の前記データの読み出しを開始させると判定し、次の前記データの読み出しを開始させると判定した前記データ読み出し用チャンネルに対応する前記DMA実行状態を、前記データの読み出しを実行する状態に更新し、
前記実行周期が、前記処理部が前記データに対する処理を実行しないタイミングであるときに、次の前記データの読み出しを開始させないと判定し、次の前記データの読み出しを開始させないと判定した前記データ読み出し用チャンネルに対応する前記DMA実行状態を、前記データの読み出しを実行しない状態に更新し、
次の前記データの読み出しを開始させるか否かの判定をした後に、
前記DMA実行状態が、前記データの読み出しを実行する状態である前記データ読み出し用チャンネルに、次の前記データの読み出しを開始させ、
前記DMA実行状態が、前記データの読み出しを実行する状態である前記データ読み出し用チャンネルによる前記外部メモリからの次の前記データの読み出しが全て完了した後に、次の該リードDMA実行判定ステップを実行し、
前記複数処理実行ステップは、
前記処理実行状態が、前記データに対する処理を実行する状態である前記処理部に、前記外部メモリからの読み出しが完了した前記データに対する処理を実行させ、
前記ライトDMAステップは、
前記処理実行状態が、前記データに対する処理を実行する状態である前記処理部に対応する前記データ書き込み用チャンネルに、該処理部が処理を完了した前記結果データの前記外部メモリへの書き込みを開始させる、
ことを特徴とする請求項2に記載の複数処理実行方法。
The read DMA execution determination step includes:
A DMA execution state corresponding to each of the data read channels, which indicates whether or not to perform the data read by the data read channel;
A process execution state corresponding to each of the processing units, which indicates whether or not to execute the process on the data by the processing unit;
Set
Before determining whether to start reading the next data,
By copying the current DMA execution state to the processing execution state, the processing unit corresponding to the data read channel for executing the data reading is in a state of executing processing on the data,
In determining whether to start reading the next data,
When the execution cycle is the timing at which the processing unit executes processing on the data, the data read is determined to start reading the next data and is determined to start reading the next data Updating the DMA execution state corresponding to the communication channel to a state in which the data is read out;
When the execution cycle is a timing at which the processing unit does not execute the process on the data, the data read is determined not to start reading the next data and not to start reading the next data Updating the DMA execution state corresponding to the communication channel to a state in which the reading of the data is not executed,
After determining whether to start reading the next data,
The DMA execution state starts reading the next data to the data read channel in which the data read is executed,
The DMA execution state is a state in which reading of the data is executed. After the next reading of the data from the external memory by the data reading channel is completed, the next read DMA execution determination step is executed. ,
The multiple processing execution step includes:
The processing execution state is a state of executing processing on the data, causing the processing unit to execute processing on the data that has been read from the external memory,
The write DMA step includes:
The processing execution state causes the data writing channel corresponding to the processing unit in a state of executing processing on the data to start writing the result data that has been processed by the processing unit to the external memory. ,
The multiple processing execution method according to claim 2, wherein:
該複数処理実行方法は、さらに、
予め計測した前記処理部が前記データに対する処理を実行する際に要する処理時間と、該処理部に対応した前記データ読み出し用チャンネルによって前記外部メモリからの前記データを読み出す際に要するデータ転送時間との差に基づいて、前記ホストCPUが前記プロセッサに実行を指示する前記処理部の組み合わせを決定する実行処理決定ステップと、
前記ホストCPUによって実行が指示された前記処理部の組み合わせに応じて、組み合わされた該処理部のそれぞれが処理を実行する際に要する、該処理部に対応する前記データ読み出し用チャンネルによって読み出した前記データを一時的に記憶する内蔵メモリの容量を動的に確保するバッファ確保ステップと、
を含み、
前記複数処理実行ステップは、
前記実行処理決定ステップによって組み合わされ、前記ホストCPUによって実行が指示されたそれぞれの前記処理部に、対応する前記データ読み出し用チャンネルによって前記外部メモリからの読み出しが完了したそれぞれの前記データに対する処理を実行させ、
前記ライトDMAステップは、
前記実行処理決定ステップによって組み合わされ、前記ホストCPUによって実行が指示されたそれぞれの前記処理部に対応する前記データ書き込み用チャンネルに、それぞれの該処理部が処理を完了したそれぞれの前記結果データの前記外部メモリへの書き込みを開始させる、
ことを特徴とする請求項1に記載の複数処理実行方法。
The multiple processing execution method further includes:
A processing time required for the processing unit measured in advance to execute processing on the data, and a data transfer time required to read the data from the external memory by the data reading channel corresponding to the processing unit. An execution process determining step for determining a combination of the processing units that the host CPU instructs the processor to execute based on the difference;
According to the combination of the processing units instructed to be executed by the host CPU, each of the combined processing units read by the data reading channel corresponding to the processing unit required when executing the processing. A buffer securing step for dynamically securing a capacity of an internal memory for temporarily storing data;
Including
The multiple processing execution step includes:
The processing for each piece of data that has been read from the external memory by the corresponding data reading channel is executed on each processing unit that is combined by the execution processing determining step and instructed to be executed by the host CPU. Let
The write DMA step includes:
Combined by the execution process determination step, the data write channel corresponding to each of the processing units instructed to be executed by the host CPU has the processing data of each of the result data that has been processed by each of the processing units. Start writing to external memory,
The multiple processing execution method according to claim 1, wherein:
JP2012039573A 2012-02-27 2012-02-27 Execution method for a plurality of processes Pending JP2013175074A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012039573A JP2013175074A (en) 2012-02-27 2012-02-27 Execution method for a plurality of processes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012039573A JP2013175074A (en) 2012-02-27 2012-02-27 Execution method for a plurality of processes

Publications (1)

Publication Number Publication Date
JP2013175074A true JP2013175074A (en) 2013-09-05

Family

ID=49267916

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012039573A Pending JP2013175074A (en) 2012-02-27 2012-02-27 Execution method for a plurality of processes

Country Status (1)

Country Link
JP (1) JP2013175074A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107949838A (en) * 2015-09-10 2018-04-20 富士胶片株式会社 Information processing system, information processing method, message handling program and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107949838A (en) * 2015-09-10 2018-04-20 富士胶片株式会社 Information processing system, information processing method, message handling program and storage medium
CN107949838B (en) * 2015-09-10 2021-02-19 富士胶片株式会社 Information processing system, information processing method, and storage medium

Similar Documents

Publication Publication Date Title
US7602394B2 (en) Image processing device, method, and storage medium which stores a program
JP5340088B2 (en) Information processing method and apparatus
CN111523652B (en) Processor, data processing method thereof and image pickup device
US20060274965A1 (en) Image processing device, method, and storage medium which stores a program
WO2013006512A2 (en) Image signal processor architecture optimized for low-power, processing flexibility, and user experience
US20130036426A1 (en) Information processing device and task switching method
JP2002328881A (en) Image processor, image processing method and portable video equipment
KR102637732B1 (en) Image signal processor, method of operating the image signal processor, and application processor including the image signal processor
US10877811B1 (en) Scheduler for vector processing operator allocation
KR102400104B1 (en) Image processing apparatus and Image processing method
JP2013175074A (en) Execution method for a plurality of processes
JP2008072585A (en) Method of supplying data for arithmetic processing and image processing apparatus
WO2020107616A1 (en) Parallel computing method and apparatus
US10089561B2 (en) Generating a raster image region by rendering in parallel plural regions of smaller height and segmenting the generated raster image region into plural regions of smaller width
US11216307B1 (en) Scheduler for vector processing operator readiness
US20160127613A1 (en) Memory control circuit and image forming apparatus
US10754817B2 (en) Information processing apparatus and information processing method for process order in reconfigurable circuit
JP6521763B2 (en) Image processing apparatus, imaging apparatus, image processing method, program, and recording medium
JP6622546B2 (en) Image processing apparatus and method
US20230385102A1 (en) Hardware event triggered pipeline control
JP6099418B2 (en) Semiconductor device and data processing method thereof
JP2014170476A (en) Data processor and method for controlling the same
JP2009053829A (en) Information processor and information processing program
JP2024015829A (en) Image processing apparatus and image processing circuit
US9019404B2 (en) Image processing apparatus and method for preventing image degradation