JP4833690B2 - Arithmetic circuit and arithmetic method - Google Patents
Arithmetic circuit and arithmetic method Download PDFInfo
- Publication number
- JP4833690B2 JP4833690B2 JP2006057810A JP2006057810A JP4833690B2 JP 4833690 B2 JP4833690 B2 JP 4833690B2 JP 2006057810 A JP2006057810 A JP 2006057810A JP 2006057810 A JP2006057810 A JP 2006057810A JP 4833690 B2 JP4833690 B2 JP 4833690B2
- Authority
- JP
- Japan
- Prior art keywords
- product
- sum
- register
- column
- columns
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
本発明は、2次元空間に配置されたデータに対し、畳み込み演算によって各種のフィルタ処理を行う演算回路およびその演算方法に関するものである。 The present invention relates to an arithmetic circuit that performs various types of filter processing on data arranged in a two-dimensional space by a convolution operation and an arithmetic method thereof.
元画像にデジタル処理を行い、画質の向上、ノイズ除去、エッヂ強調などのフィルタ処理を行う従来技術の1つとして畳み込み演算が知られている。畳み込み演算は、主に画像などのように、x列×y行からなる2次元空間に配置されたデータに対して各種のフィルタ処理をするために使用される。畳み込み演算は、一般的に上記の目的で使用される場合が多いが、その係数値を変えることによって、様々な特性を持つフィルタを構成することができる。 A convolution operation is known as one of conventional techniques for performing digital processing on an original image and performing filter processing such as image quality improvement, noise removal, and edge enhancement. The convolution operation is mainly used to perform various kinds of filter processing on data arranged in a two-dimensional space consisting of x columns × y rows, such as an image. In general, the convolution operation is often used for the above-mentioned purpose, but by changing the coefficient value, a filter having various characteristics can be configured.
例えば、5列×5行のフィルタ処理を行う場合、元画像の列方向(横方向)をx、行方向(縦方向)をy、元画像のx列y行目の画素値をLx,y、フィルタ処理後のx列y行目の画素値をPx,y、5列×5行のフィルタ係数のi列j行目の係数値をCi,jとすると、フィルタ処理後の画素値Px,yは下記式(1)により算出される。上記の通り、フィルタの特性は係数値Ci,jにより決定され、画質の向上、ノイズ除去、エッヂ強調などの各種の機能を果たす。 For example, when performing a filtering process of 5 columns × 5 rows, the column direction (horizontal direction) of the original image is x, the row direction (vertical direction) is y, and the pixel value of the x column y row of the original image is L x, If y is the pixel value in the x column and y row after the filter processing is P x, y , and the coefficient value in the i column j row of the 5 × 5 filter coefficients is C i, j , the filtered pixel The value P x, y is calculated by the following equation (1). As described above, the characteristics of the filter are determined by the coefficient values C i, j and perform various functions such as image quality improvement, noise removal, and edge enhancement.
以下、説明を簡単にするために、元画像(フィルタ処理前)の2列×2行の4画素分の画素値から、フィルタ処理後の1画素の画素値を算出する畳み込み演算を行うフィルタ(演算回路)について説明する。 Hereinafter, in order to simplify the description, a filter that performs a convolution operation for calculating a pixel value of one pixel after the filter processing from pixel values of four columns of 2 columns × 2 rows of the original image (before the filter processing) ( The arithmetic circuit will be described.
ここでは、図8に示す元画像の各画素の画素値L11,L12,L13,…、L21,L22,L23,…、L31,L32,L33,…に対して畳み込み演算によるフィルタ処理を行い、図9に示すフィルタ処理後の画像の各画素の画素値P11,P12,P12,…、P21,P22,P23,…を算出するものとする。 Here, the pixel values L11, L12, L13,..., L21, L22, L23,..., L31, L32, L33,. Assume that pixel values P11, P12, P12,..., P21, P22, P23,.
図10は、元画像の各画素の画素値とフィルタ処理後の画像の各画素の画素値との関係を表す一例の概念図である。すなわち、この例では、元画像の2列×2行=4画素分の画素値Li,j,Li,j+1,Li+1,j,Li+1,j+1を使用して、フィルタ処理後の1画素の画素値Pi,jが算出される。2列×2行のフィルタの場合、4個(=2列×2行)のフィルタ係数C1,1,C1,2,C2,1,C2,2が必要である。フィルタ処理後の各画素の画素値Pi,jは下記式(2)により算出される。 FIG. 10 is a conceptual diagram illustrating an example of a relationship between a pixel value of each pixel of the original image and a pixel value of each pixel of the image after filtering. That is, in this example, the pixel values L i, j , L i, j + 1 , L i + 1, j , L i + 1 , j + 1 of 2 columns × 2 rows = 4 pixels of the original image are used. Thus, the pixel value P i, j of one pixel after the filter processing is calculated. In the case of a filter of 2 columns × 2 rows, four (= 2 columns × 2 rows) filter coefficients C 1,1 , C 1,2 , C 2,1 , C 2,2 are required. The pixel value P i, j of each pixel after the filter processing is calculated by the following equation (2).
Pi,j=C1,1Li,j+C1,2Li,j+1+C2,1Li+1,j+C2,2Li+1,j+1 … (2) P i, j = C 1,1 L i, j + C 1,2 L i, j + 1 + C 2,1 L i + 1, j + C 2,2 L i + 1 , j + 1 (2)
例えば、フィルタ処理後の画像の最初の画素の画素値P11は、図11に示すように、四角の太枠で囲まれた元画像の1および2列目の4画素分の画素値L11,L21,L12,L22を使用して算出される。また、図13に示す順序でフィルタ処理を行う場合、フィルタ処理後の画像の2番目の画素の画素値P12は、図12に示すように、四角の太枠で囲まれた元画像の2及び3列目の4画素分の画素値L12,L22,L13,L23を使用して算出される。 For example, the pixel value P11 of the first pixel of the image after filtering is, as shown in FIG. 11, the pixel values L11 and L21 for four pixels in the first and second columns of the original image surrounded by a thick square frame. , L12, L22. Further, when the filtering process is performed in the order shown in FIG. 13, the pixel value P12 of the second pixel of the image after the filtering process is 2 and 2 of the original image surrounded by a square thick frame as shown in FIG. Calculation is performed using pixel values L12, L22, L13, and L23 for four pixels in the third column.
また、例えばノイズ除去のフィルタ処理を行う場合、元画像の4画素分の画素値Li,j,Li,j+1,Li+1,j,Li+1,j+1の平均値を算出するために、フィルタ係数C1,1,C1,2,C2,1,C2,2を下記式(3)のように全て同じ値の1/4に設定する。これにより、上記式(2)は下記式(4)の形式となる。このように、元画像の4画素分の画素値Li,j,Li,j+1,Li+1,j,Li+1,j+1の平均値を算出することにより、元画像における小さなノイズを除去する効果を得ることができる。 Also, for example, when performing noise removal filtering, the average of the pixel values L i, j , L i, j + 1 , L i + 1, j , L i + 1 , j + 1 of the four pixels of the original image In order to calculate the values, the filter coefficients C 1,1 , C 1,2 , C 2,1 , C 2,2 are all set to ¼ of the same value as in the following equation (3). Thereby, the said Formula (2) becomes a format of following Formula (4). Thus, by calculating the average value of the pixel values L i, j , L i, j + 1 , L i + 1, j , L i + 1 , j + 1 for the four pixels of the original image, An effect of removing small noise in the image can be obtained.
C1,1=C1,2=C2,1=C2,2=1/4 … (3)
Pi,j=(Li,j+Li,j+1+Li+1,j+Li+1,j+1)/4 … (4)
C 1,1 = C 1,2 = C 2,1 =
P i, j = (L i, j + L i, j + 1 + L i + 1, j + L i + 1 , j + 1 ) / 4 (4)
ここで、上記式(2)により、図13に示す順序でフィルタ処理を行う場合、例えばフィルタ処理後の画素の画素値P11とP12のように、隣りあう画素の演算において、図11と図12とを見比べると分かるように、1列の2画素分の画素値L12とL22が、P11とP12の演算の両方で使用されている。従って、例えば特許文献1などには、隣りあう画素の演算において共通に使用される元画像の同じ画素の画素値をメモリなどから2度読み出すことを防止する技術が提案されている。
Here, when the filter processing is performed in the order shown in FIG. 13 by the above equation (2), for example, in the calculation of adjacent pixels like the pixel values P11 and P12 of the pixels after the filter processing, FIG. 11 and FIG. As can be seen from the above, pixel values L12 and L22 for two pixels in one column are used in both the calculations of P11 and P12. Therefore, for example,
以下、特許文献1について説明する。
Hereinafter,
図14は、従来の畳み込み演算によるフィルタ処理を行う演算回路の構成を表す一例の概略図である。同図に示す演算回路140は、説明を簡単化するために、特許文献1によって提案された技術を2列×2行のフィルタとして構成したものである。演算回路140は、画像情報記憶装置141と、元画像用レジスタ142と、係数用シフトレジスタ144と、マルチプレクサ(MUX)145と、積和演算器146と、加算器148と、マルチプレクサ(MUX)149と、2つのフリップフロップ150a、150bからなる中間結果レジスタ154と、カウンタ156とによって構成されている。
FIG. 14 is a schematic diagram illustrating an example of a configuration of an arithmetic circuit that performs filter processing using a conventional convolution operation. An
また、図15および図16は、図14に示す演算回路140のカウンタ156のカウント値=0の場合と、カウント値=1の場合における演算回路140の状態を概念的に表したものである。また、図17は、演算回路140で用いられている積和演算器146の構成を表す概念図であって、係数値C1(C11またはC21)と画素値L1とを乗算する乗算器160aと、係数値C2(C12またはC22)と画素値L2とを乗算する乗算器160bと、2つの乗算器160a、160bの演算結果を加算する加算器162とによって構成されている。
15 and 16 conceptually show states of the
カウンタ156は、初期化後、0,1を繰り返しカウントする。カウンタ156のカウント値=0の場合、画像情報記憶装置141に記憶されている元画像の中から、処理対象となる1列の2画素分の画素値が読み出され、元画像用レジスタ142に、それぞれL1,L2として保持される。また、図15に示すように、係数用シフトレジスタ144からは、マルチプレクサ145を介して係数値C11,C21が出力される。
The
積和演算器146では、元画像用レジスタ142から入力される1列の2画素分の画素値L1,L2と、係数用シフトレジスタ144から入力される係数値C11,C21との積和演算C11L1+C21L2が行われる。加算器148では、積和演算器146の演算結果と0との加算が行われ、その加算結果C11L1+C21L2が、マルチプレクサ149を介して中間結果レジスタ154のフリップフロップ150aに入力される。
The product-
中間結果レジスタ154のフリップフロップ150aには、クロック信号に同期して、加算器148から入力される加算結果が保持される。フリップフロップ150bには、同じくクロック信号に同期して、フリップフロップ150aの出力が保持されるとともに、フィルタ処理後の画素の画素値として出力される。すなわち、フリップフロップ150bには、1サイクル(1クロック)前にフリップフロップ150aに保持された値が保持される。
The flip-
一方、カウンタ156のカウント値=1の場合、画像情報記憶装置141から新たな画素値の読み出しは行われない。従って、元画像用レジスタ142には、カウンタ156のカウント値=0の時の2画素分の画素値L1,L2が保持されている。係数用シフトレジスタ144からは、図16に示すように、係数値C12,C22が出力される。積和演算器146では、1列の2画素分の画素値L1,L2と、係数値C12,C22との積和演算C12L1+C22L2が行われる。
On the other hand, when the count value of the
加算器148では、積和演算器146の演算結果とフリップフロップ150bの出力とが加算される。これにより、3サイクル前にカウンタ156のカウンタ値=0であった時の積和演算器146の演算結果C11L1+C21L2とカウンタ値=1の時の演算結果C12L1+C22L2とが加算される。フリップフロップ150bには、クロック信号に同期して、加算器148の加算結果が保持されるとともに、フィルタ処理後の画素の画素値として出力される。フリップフロップ150aには、自分自身の1サイクル前の保持値が保持(維持)される。
The
次に、下記表1を参照しながら、演算回路140の動作を具体的に説明する。
Next, the operation of the
最初のサイクルは、初期化のサイクルである。中間結果レジスタ154の2つのフリップフロップ150a、150bの保持値P1,P2は0となる。また、表1中では省略しているが、係数用シフトレジスタ144には、係数値C11,C21,C12,C22が設定される。
The first cycle is an initialization cycle. The holding values P1 and P2 of the two flip-
サイクル1では、カウンタ156のカウント値=0である。従って、画像情報記憶装置141から、最初の1列目の2画素分の画素値L11,L21が読み出され、それぞれ元画像用レジスタ142にL1,L2として保持される。また、係数用シフトレジスタ144からは係数値C11,C21が出力される。そして、積和演算器146により、C11L11+C21L21が演算され、加算器148により、さらに0が加算される。加算器148の加算結果C11L11+C21L21は、クロック信号に同期して、中間結果レジスタ154のフリップフロップ150aに、保持値P1として保持される。フリップフロップ150bには、フリップフロップ150aに1サイクル前に保持された値である0が、保持値P2として保持される。
In
サイクル2では、カウンタ156のカウント値=1となる。従って、元画像用レジスタ142のL1,L2は、L11,L21のままである。一方、係数用シフトレジスタ144からは係数値C12,C22が出力される。そして、積和演算器146により、C12L11+C22L21が演算され、加算器148により、さらに中間結果レジスタ154のフリップフロップ150bの出力0が加算される。加算器148の加算結果C12L11+C22L21は、クロック信号に同期して、中間結果レジスタ154のフリップフロップ150bに保持される。フリップフロップ150aは、自分自身の出力であるC11L11+C21L21を維持する。
In
サイクル3では、再びカウンタ156のカウント値=0となる。2番目の1列の2画素分の画素値L12,L22が読み出され、それぞれ元画像用レジスタ142にL1,L2として保持される。係数用シフトレジスタ144からは係数値C11,C21が出力される。そして、積和演算器146により、C11L12+C21L22が演算され、加算器148により、さらに0が加算される。加算器148の加算結果C11L12+C21L22は、クロック信号に同期して、中間結果レジスタ154のフリップフロップ150aに保持される。フリップフロップ150bには、フリップフロップ150aの出力C11L11+C21L21が保持される。
In
サイクル4では、再びカウンタ156のカウント値=1となる。同じく元画像用レジスタ142のL1,L2は、L12,L22のままである。係数用シフトレジスタ144からは係数値C12,C22が出力される。そして、積和演算器146により、C12L12+C22L22が演算され、加算器148により、さらに中間結果レジスタ154のフリップフロップ150bの出力C11L11+C21L21が加算される。加算器148の加算結果C11L11+C21L21+C12L12+C22L22は、クロック信号に同期して、中間結果レジスタ154のフリップフロップ150bに保持され、フィルタ処理後の画素の画素値P11として出力される。フリップフロップ150aは、自分自身の出力C11L12+C21L22を維持する。
In
サイクル5以降の動作は、上記と同様である。すなわち、演算回路140では、初期化後、4サイクルでフィルタ処理後の最初の画素の画素値P11が出力され、以後、2サイクル毎に、フィルタ処理後の2番目以降の画素の画素値P12,P13,…が順次出力される。
The operations after
上記の通り、特許文献1では、隣りあう画素の演算で共通に使用される元画像の画素の画素値を、画像情報記憶装置から2度読み出す必要がないという利点がある。しかし、特許文献1では、初期化後、フィルタ処理後の最初の画素の画素値P11が出力されるまでに、4サイクルを必要とし、2番目以降の画素の画素値P12,P13,…が出力される毎に、2サイクルを必要とするため、フィルタ処理に処理時間(サイクル数)がかかりすぎるという問題がある。
As described above,
本発明の目的は、前記従来技術に基づく問題点を解消し、2次元空間に配置されたデータに対して、従来よりも少ないサイクル数で畳み込み演算によるフィルタ処理を行うことができる演算回路および演算方法を提供することにある。 SUMMARY OF THE INVENTION An object of the present invention is to solve the problems based on the prior art and to perform an arithmetic circuit and an arithmetic circuit capable of performing filter processing by convolution operation on data arranged in a two-dimensional space with fewer cycles than in the past. It is to provide a method.
また、本発明の他の目的は、畳み込み演算によるフィルタ処理に高速性が要求されない場合、処理速度よりも回路規模を優先させて、その回路規模を適宜削減することができる演算回路および演算方法を提供することにある。 Another object of the present invention is to provide an arithmetic circuit and an arithmetic method capable of appropriately reducing the circuit scale by giving priority to the circuit scale over the processing speed when high speed is not required for the filter processing by the convolution operation. It is to provide.
上記目的を達成するために、本発明は、2次元空間に配置されたデータの畳み込み演算を行う演算回路であって、
N列×N行(Nは3以上の整数)の係数を保持する係数用レジスタと、
N個のデータ値を保持するデータレジスタと、
m個(2≦m<N)の積和演算器を備えた前処理回路と、
1〜N番目の積和レジスタを備えた後処理回路とを有し、
初期化サイクルにおいて前記1〜N番目の内の1〜N−1番目の積和レジスタを初期化し、
その後、1〜Nサイクルにかけて順に、前記2次元空間のN列×N行の範囲の1〜N列目のデータ値を前記データレジスタに保持し、
各サイクル毎に、
前記前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、前記N個のデータ値と、前記N列×N行のいずれかの列のN個の係数との間の積和を演算する操作を、N回未満繰り返して行うことにより前記N個のデータ値と全ての列の係数との間の積和の演算を行い、
前記積和演算器が演算した、前記N個のデータ値と前記1列目のN個の係数との間の積和演算結果を前記後処理回路の1番目の積和レジスタに保持するとともに、前記N個のデータ値と前記n列目(n=2〜N)の係数との間の積和演算結果と、前サイクルで前記後処理回路のn−1番目の積和レジスタに保持した値との積算値を、該後処理回路のn番目の積和レジスタに保持することにより、
前記N番目の積和レジスタから、前記2次元空間の前記N列×N行の範囲の中心に位置する第1の演算対象点の畳み込み演算結果を出力することを特徴とする演算回路を提供する。
In order to achieve the above object , the present invention is an arithmetic circuit for performing a convolution operation of data arranged in a two-dimensional space,
A coefficient register for storing coefficients of N columns × N rows (N is an integer of 3 or more);
A data register holding N data values;
a pre-processing circuit including m (2 ≦ m <N) product-sum calculators;
And a post-processing circuit including 1st to Nth product-sum registers,
Initialize the 1-N-1 product-sum registers of the 1-Nth in the initialization cycle,
After that, in the order of 1 to N cycles, the data value of the 1st to Nth columns in the range of N columns × N rows of the two-dimensional space is held in the data register,
For each cycle,
In each of at least some of the m product-sum calculators of the preprocessing circuit, the product-sum between the N data values and the N coefficients of any column of the N columns × N rows. By calculating the product sum between the N data values and the coefficients of all the columns by repeating the operation of calculating N times less than N times,
A product-sum operation result between the N data values and the N coefficients in the first column calculated by the product-sum calculator is held in a first product-sum register of the post-processing circuit, and The product-sum operation result between the N data values and the coefficients of the n-th column (n = 2 to N), and the value held in the n−1th product-sum register of the post-processing circuit in the previous cycle Is held in the n-th product-sum register of the post-processing circuit,
Provided is an arithmetic circuit which outputs a convolution operation result of a first operation target point located at the center of the range of N columns × N rows in the two-dimensional space from the Nth product-sum register. .
ここで、前記後処理回路がさらに、前記1〜N番目の積和レジスタのそれぞれに対応して設けられた1〜N番目の一時レジスタを備え、
前記各サイクル毎に、前記積和演算器が演算した、前記データ値と前記1〜N列目の係数との間の積和演算結果のそれぞれを前記1〜N番目の一時レジスタに保持した後に、該一時レジスタのn番目に保持した積和演算結果と前記前サイクルでn−1番目の積和レジスタに保持された値との積算値を、前記n番目の積和レジスタに保持することが好ましい。
Here, the post-processing circuit further includes a 1-Nth temporary register provided corresponding to each of the 1-Nth product-sum registers,
After each product-sum operation result calculated by the product-sum operation unit between the data value and the coefficients in the 1st to Nth columns is held in the 1st to Nth temporary registers for each cycle. The integrated value of the n-th product-sum operation result held in the temporary register and the value held in the (n−1) -th product-sum register in the previous cycle may be held in the n-th product-sum register. preferable.
また、本発明は、2次元空間に配置されたデータの畳み込み演算を行う演算回路であって、
N列×N行(Nは2以上の整数)の係数を保持する係数用レジスタと、
N列×N行のデータレジスタと、
N個の積和演算器を備えた前処理回路と、
N個の積和レジスタを備えた後処理回路とを有し、
前記データレジスタに前記2次元空間のN列×N行の範囲の1〜N列目のデータを保持し、
第1サイクルにおいて、前記N個の内のn番目(n=1〜N)の積和演算器で、前記N列×N行のデータレジスタのn列目に保持されたN個のデータ値と前記N列×N行の1列目のN個の係数との間の積和を演算し、それぞれの演算結果を、前記後処理回路のn番目の積和レジスタに保持し、
その後、第k(k=2〜N)サイクルにかけて順に、
前記データレジスタに保持されたデータを−1列分シフトし、該データレジスタのN列目に、前記2次元空間のN列×N行の範囲に列方向に隣接するN+k−1列目のデータを保持し、
前記n番目の積和演算器で、前記N列×N行のデータレジスタのn列目に保持されたN個のデータ値と前記N列×N行のk列目のN個の係数との間の積和を演算し、それぞれの演算結果と、前サイクルで前記後処理回路のn番目の積和レジスタに保持された値との積算値を、前記後処理回路のn番目の積和レジスタに保持する操作を繰り返すことにより、
前記N個の積和レジスタのそれぞれから、前記2次元空間のN列×N行の範囲の中心に位置する第1演算対象点、および、該2次元空間の列方向に前記第1の演算対象点に順に隣りあう、2〜N番目の演算対象点の畳み込み演算結果を出力することを特徴とする演算回路を提供する。
The present invention is an arithmetic circuit for performing a convolution operation of data arranged in a two-dimensional space,
A coefficient register for holding coefficients of N columns × N rows (N is an integer of 2 or more);
N columns x N rows of data registers;
A preprocessing circuit having N product-sum calculators;
A post-processing circuit having N product-sum registers,
The data register holds the data of the 1st to Nth columns in the range of N columns × N rows of the two-dimensional space,
In the first cycle, the N data values held in the nth column of the data register of N columns × N rows in the nth (n = 1 to N) product-sum operation unit Calculate the sum of products with the N coefficients in the first column of the N columns × N rows, and store the respective operation results in the n th product sum register of the post-processing circuit,
Then, in order through the kth (k = 2 to N) cycle,
The data held in the data register is shifted by −1 column, and the N + k−1 column data adjacent to the N column × N row of the two-dimensional space in the column direction is shifted to the N column of the data register. Hold
In the nth product-sum operation unit, N data values held in the nth column of the N column × N row data register and N coefficients in the N column × N row k column The sum of the results of each operation and the value held in the nth product-sum register of the post-processing circuit in the previous cycle is calculated as the n-th product-sum register of the post-processing circuit. By repeating the operation to hold
From each of the N product-sum registers, a first calculation target point located in the center of a range of N columns × N rows of the two-dimensional space, and the first calculation target in the column direction of the two-dimensional space Provided is an arithmetic circuit characterized in that a convolution operation result of the 2nd to Nth operation target points that are adjacent to the point in order is output.
また、本発明は、2次元空間に配置されたデータとN列×N行(Nは2以上の整数)の係数との間の畳み込み演算を行う演算方法であって、
N個の積和演算器を備えた前処理回路と、
N個の積和レジスタを備えた後処理回路とを用意し、
第1サイクルにおいて、前記2次元空間のN列×N行の範囲のデータ値と、前記N列×N行の第1列のN個の係数とを前記前処理回路に供給し、前記N個の内のn番目(n=1〜N)の積和演算器で、前記2次元空間のn列目のN個のデータ値と前記N個の係数との間の積和を演算し、その演算結果を、前記後処理回路のn番目の積和レジスタに保持し、
その後、第k(k=2〜N)サイクルにかけて順に、
前記2次元空間のN列×N行のk列目から、該N列×N行の範囲に列方向に隣接する、N+k−1列目までのデータ値と、前記N列×N行の内のk列目のN個の係数とを前記前処理回路に供給し、前記n番目の積和演算器で、前記2次元空間の(N+k−1)列目のN個のデータ値と前記N個の係数との間の積和を演算し、それぞれの演算結果と、前サイクルで前記後処理回路のn番目の積和レジスタに保持された値との積算値を、前記後処理回路のn番目の積和レジスタに保持する操作を繰り返すことにより、
前記N個の積和レジスタのそれぞれから、前記2次元空間のN列×N行の範囲の中心に位置する第1演算対象点、および、該2次元空間の列方向に前記第1の演算対象点に順に隣りあう、2〜N番目の演算対象点の畳み込み演算結果を出力することを特徴とする演算方法を提供する。
Further, the present invention is an arithmetic method for performing a convolution operation between data arranged in a two-dimensional space and coefficients of N columns × N rows (N is an integer of 2 or more),
A preprocessing circuit having N product-sum calculators;
Prepare a post-processing circuit with N product-sum registers,
In the first cycle, a data value in a range of N columns × N rows of the two-dimensional space and N coefficients of the first column of N columns × N rows are supplied to the preprocessing circuit, and the N pieces The product-sum calculator between the N data values in the n-th column of the two-dimensional space and the N coefficients is calculated by an nth (n = 1 to N) product-sum calculator The operation result is held in the nth product-sum register of the post-processing circuit,
Then, in order through the kth (k = 2 to N) cycle,
The data values from the Nth column × Nth row kth column to the N + k−1th column adjacent to the Nth column × Nth row in the column direction, and the Nth column × Nth row N coefficients in the k-th column are supplied to the pre-processing circuit, and the N-th product-sum calculator calculates the N data values in the (N + k−1) -th column in the two-dimensional space and the N The sum of products between the coefficients is calculated, and an integrated value of each operation result and the value held in the nth product-sum register of the post-processing circuit in the previous cycle is calculated as n of the post-processing circuit. By repeating the operation held in the th product-sum register,
From each of the N product-sum registers, a first calculation target point located in the center of a range of N columns × N rows of the two-dimensional space, and the first calculation target in the column direction of the two-dimensional space Provided is a calculation method characterized by outputting a convolution calculation result of 2nd to Nth calculation target points that are adjacent to a point in order.
また、本発明は、2次元空間に配置されたデータの畳み込み演算を行う演算回路であって、
N列×N行(Nは2以上の整数)の係数を保持する係数用レジスタと、
N列×N行のデータレジスタと、
m個(m<N)の積和演算器を備えた前処理回路と、
N個の積和レジスタを備えた後処理回路とを有し、
前記データレジスタに前記2次元空間内のN列×N行の範囲の1〜N列目のデータを保持し、
第1サイクルにおいて、
前記前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、前記N列×N行のデータレジスタのいずれかの列に保持されたN個のデータ値と、前記N列×N行の1列目のN個の係数との間の積和を演算する操作を繰り返して行うことにより、前記データレジスタの全ての列に保持されたデータ値と前記1列目の係数との間の積和の演算を行い、
前記積和演算器が演算した、前記データレジスタのn列目(n=1〜N)に保持されたデータ値と前記1列目の係数との間の積和演算結果を、前記前処理回路のn番目の積和レジスタに保持し、
その後、第k(k=2〜N)サイクルにかけて順に、
前記データレジスタに保持されたデータを列方向に−1シフトし、該データレジスタのN列目に、前記2次元空間のN列×N行の範囲に列方向に隣接するN+k−1列目のデータを保持し、
前記前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、前記N列×N行のデータレジスタのいずれかの列に保持されたN個のデータ値と、前記N列×N行のk列目のN個の係数との間の積和を演算する操作を、繰り返して行うことにより、前記データレジスタの全ての列に保持されたデータ値と前記k列目の係数との間の積和の演算を行い、
前記積和演算器が演算した、前記データレジスタのn列目に保持されたデータ値と前記k列目の係数との間の積和演算結果と、前サイクルで前記後処理回路のn番目の積和レジスタに保持された値との積算値を、該後処理回路のn番目の積和レジスタに保持する操作を繰り返すことにより、
前記N個の積和レジスタのそれぞれから、前記2次元空間のN列×N行の範囲の中心に位置する第1の演算対象点、および、該2次元空間の列方向に前記第1の演算対象点に順に隣りあう、2〜N番目の演算対象点の畳み込み演算結果を出力することを特徴とする演算回路を提供する。
The present invention is an arithmetic circuit for performing a convolution operation of data arranged in a two-dimensional space,
A coefficient register for holding coefficients of N columns × N rows (N is an integer of 2 or more);
N columns x N rows of data registers;
a pre-processing circuit including m (m <N) product-sum calculators;
A post-processing circuit having N product-sum registers,
The data register holds data in the 1st to Nth columns in the range of N columns × N rows in the two-dimensional space,
In the first cycle,
In each of at least some of the m product-sum calculators of the preprocessing circuit, N data values held in any column of the N columns × N rows of data registers, and the N columns × N By repeating the operation of calculating the product sum between the N coefficients in the first column of the row, the data values held in all the columns of the data register and the coefficients in the first column are The sum of products of
The pre-processing circuit calculates the product-sum operation result between the data value held in the n-th column (n = 1 to N) of the data register and the coefficient in the first column, which is calculated by the product-sum calculator. In the nth sum of products register
Then, in order through the kth (k = 2 to N) cycle,
The data held in the data register is shifted by −1 in the column direction, and the N + k−1th column adjacent to the N column × N row in the two-dimensional space in the column direction is shifted to the Nth column of the data register. Keep the data,
In each of at least some of the m product-sum calculators of the preprocessing circuit, N data values held in any column of the N columns × N rows of data registers, and the N columns × N By repeatedly performing the operation of calculating the sum of products between the N coefficients in the k-th column of the row, the data values held in all the columns of the data register and the coefficients in the k-th column are calculated. Perform product-sum operation between
The product-sum operation result between the data value held in the n-th column of the data register and the coefficient in the k-th column, calculated by the product-sum calculator, and the nth of the post-processing circuit in the previous cycle By repeating the operation of holding the integrated value with the value held in the product-sum register in the nth product-sum register of the post-processing circuit,
From each of the N product-sum registers, a first calculation target point located at the center of a range of N columns × N rows of the two-dimensional space, and the first calculation in the column direction of the two-dimensional space Provided is an arithmetic circuit that outputs a convolution calculation result of the 2nd to N-th calculation target points that are adjacent to the target point in order.
本発明によれば、従来と同様に、隣りあうデータの演算で共通に使用されるデータ値を記憶装置から2度読み出す必要がないという利点がある。また、本発明では、複数の積和演算器を用いて演算処理を行うことよって、従来の演算回路の数倍の処理速度を実現することができる。一方、処理速度が要求されない用途であれば、使用する積和演算器の個数を適宜減らす構成とすることもできるので、回路規模を適宜削減することができる。 According to the present invention, as in the prior art, there is an advantage that it is not necessary to read out twice from the storage device a data value that is commonly used in calculation of adjacent data. In the present invention, the processing speed is several times that of a conventional arithmetic circuit by performing arithmetic processing using a plurality of product-sum arithmetic units. On the other hand, if the processing speed is not required, the number of product-sum calculators to be used can be appropriately reduced, so that the circuit scale can be appropriately reduced.
以下に、添付の図面に示す好適実施形態に基づいて、本発明の演算回路および演算方法を詳細に説明する。 The arithmetic circuit and the arithmetic method of the present invention will be described below in detail based on preferred embodiments shown in the accompanying drawings.
図1は、本発明の演算回路の構成を表す第1の実施形態の概略図である。同図に示す演算回路10は、2次元空間に配置された元画像の内の2列×2行の4画素分の画素値から、畳み込み演算によるフィルタ処理を順次行う。演算回路10は、元画像用レジスタ12と、係数用レジスタ14と、前処理回路22と、後処理回路24とによって構成されている。
FIG. 1 is a schematic diagram of the first embodiment showing the configuration of the arithmetic circuit of the present invention. The
元画像用レジスタ(本発明のデータレジスタ)12は、クロック信号に同期して、元画像の各画素の画素値が記憶されている画像情報記憶装置(図示省略、図14を参照)から処理順に読み出される、処理対象の1列の2画素分の画素値を、それぞれL1,L2として順次保持する。元画像用レジスタ12の出力L1,L2は、前処理回路22の積和演算器16a、16bの両方に共通に入力される。
The original image register (data register of the present invention) 12 is synchronized with the clock signal and is processed in the order of processing from an image information storage device (not shown, see FIG. 14) in which the pixel value of each pixel of the original image is stored. The read pixel values of two pixels in one column to be processed are sequentially held as L1 and L2, respectively. The outputs L1 and L2 of the
係数用レジスタ14は、演算回路10の機能(フィルタ処理)を決定する係数値を保持する。本実施形態の場合、係数用レジスタ14には、元画像の2列×2行=4画素に対応する4個の係数値C11,C21,C12,C22が保持されている。1列目の係数値C11,C21は積和演算器16aに入力され、2列目の係数値C12,C22は積和演算器16bに入力される。
The
前処理回路22は、列数分(行数分)の2つの積和演算器16a、16bによって構成されている。
The
積和演算器16aは、1列の2画素分の画素値L1,L2と、図1中左側から1列目の2つの係数値C11,C21との積和演算C11L1+C21L2を行う。
The product-
積和演算器16bは、1列の2画素分の画素値L1,L2と、同2列目の2つの係数値C12,C22との積和演算C12L1+C22L2を行う。積和演算器16bから出力される演算結果(b)は、加算器18に入力される。
The product-
積和演算器16a、16bは、例えば図17に示す構成とすることができる。なお、積和演算器16a、16bの構成は、何ら限定されず、同様の積和演算を行うことができる各種構成のものがいずれも使用可能である。
The product-
続いて、後処理回路24は、列数分の2つの積和レジスタ21a、21bによって構成されている。
Subsequently, the
積和レジスタ21aは、フリップフロップ20aによって構成されている。フリップフロップ20aは、クロック信号(図示省略)の有効エッジ(クロックエッジ)のタイミングで、積和演算器16aの出力T1を保持値P1として保持する。言い変えると、積和レジスタ21aは、積和演算器16aの出力と0との加算結果を保持する。このため、次に述べる積和レジスタ21bと比べて加算器が省略されている。フリップフロップ20aはまた、P1を保持する以前には、前サイクルで保持された値を、出力P1’として加算器18に出力する。
The product-
積和レジスタ21bは、加算器18と、フリップフロップ20bとによって構成されている。加算器18によって、積和演算器16bの出力T2と、フリップフロップ20aの出力P1’との加算が行われ、その加算結果(o)は、クロックエッジのタイミングで、フリップフロップ20bに保持値P2として保持される。このように、積和レジスタ21bは、加算器18とフリップフロップ20bとを備えることにより、積和演算器16bの演算結果と前サイクルで積和レジスタ21aに保持された値との積算値を算出し、保持する。フリップフロップ20bに保持された値P2は、フィルタ処理後の画像の各画素の画素値として出力される。
The product-
なお、演算結果を保持するためにフリップフロップ20a、20bに供給するクロック信号は、画素値を保持するために元画素用レジスタ12に供給するクロック信号と同一のものにすることができる。そして、クロック信号の第1の有効エッジのタイミングで元画像用レジスタ12に保持した画素値を利用した演算結果を、同一のクロック信号の次の有効エッジのタイミングで、フリップフロップ20a、20bに保持することができる。この場合、クロック信号の第1の有効エッジから、次の有効エッジまでの期間が、演算回路10の1つの演算サイクルになる。
The clock signal supplied to the flip-
次に、演算回路10の基本的な動作を説明する。
Next, the basic operation of the
演算回路10では、初期化のサイクルで、少なくともフリップフロップ20aが初期化され、その保持値は0となる。また、係数用レジスタ14には、4個の係数値C11,C21,C12,C22が設定(保持)される。
In the
続いて、各サイクル毎に、処理順に読み出される元画像の1列の2画素分の画素値が、L1,L2として元画像用レジスタ12に保持される。例えば、図8に示す元画像の各画素の画素値が画像情報記憶装置に記憶され、図13に示す順序でフィルタ処理が順次行われる場合、元画像用レジスタ12のL1,L2には、1サイクル毎に、図8中左側から、1列目のL11,L21、2列目のL12,L22、3列目のL13,L23…の順序で1列の2画素分の画素値が保持される。
Subsequently, for each cycle, pixel values for two pixels in one column of the original image read in the processing order are held in the
前処理回路22の積和演算器16aでは、元画像用レジスタ12から入力される1列の2画素分の画素値L1,L2と、係数用レジスタ14から入力される1列目の係数値C11,C21との積和演算C11L1+C21L2が行われる。また、積和演算器16bでは、同じく1列の2画素分の画素値L1,L2と、2列目の係数値C12,C22との積和演算C12L1+C22L2が行われる。
In the product-
積和演算器16aの出力T1は、クロックエッジのタイミングで後処理回路24の積和レジスタ21aのフリップフロップ20aに保持値P1として保持される。そして、加算器18により、積和演算器16bの出力T2と、フリップフロップ20aの出力P1’(=1サイクル前の積和演算器16aの出力T1)とが加算される。その加算結果(o)は、同じくクロックエッジのタイミングで、積和レジスタ21bのフリップフロップ20bに保持値P2として保持され、フィルタ処理後の画像の各画素の画素値として順次出力される。
The output T1 of the product-
なお、フィルタ処理後の画像の各画素(演算対象点)の画素値(畳み込み演算結果)は、図10〜図12に示すように、2次元空間の2列×2行の処理対象の画素の範囲の中心に位置する。 Note that the pixel value (convolution operation result) of each pixel (calculation target point) of the image after the filter processing is as shown in FIG. 10 to FIG. 12 of the pixel to be processed of 2 columns × 2 rows in the two-dimensional space. Located at the center of the range.
次に、下記表2を参照しながら、演算回路10の動作を具体的に説明する。以下の説明では、図8に示す元画像の各画素の画素値が画像情報記憶装置に記憶され、図13に示す順序でフィルタ処理が順次行われるものとする。
Next, the operation of the
表2には、各サイクルの開始時に元画像用レジスタ12に保持される画素値L1,L2、その画素値を利用して積和演算器16a、16bが算出する積和演算結果T1,T2、および、同一サイクルの最後にフリップフロップ20a、20bに保持される値P1,P2を示す。後から示す表3、4についても同様である。
Table 2 shows pixel values L1 and L2 held in the
最初のサイクルは、初期化のサイクルである。少なくともフリップフロップ20aの保持値が0に初期化される。
The first cycle is an initialization cycle. At least the hold value of the flip-
サイクル1では、クロック信号の最初のエッジのタイミングで画像情報記憶装置から、図8中左側から1列目の2画素分の画素値L11,L21が読み出され、元画像用レジスタ12に、それぞれL1,L2として保持される。その結果、積和演算器16aからは、演算結果T1=C11L11+C21L21が出力され、積和演算器16bからは、演算結果T2=C12L11+C22L21が出力される。
In
フリップフロップ20aには、クロック信号の次のエッジのタイミングで、積和演算器16aの出力T1=C11L11+C21L21が保持値P1として保持される。加算器18からは、フリップフロップ20aの出力P1’(表2では、前のサイクル、すなわち、初期化サイクルでのP1の値として示されている)=0と積和演算器16bの出力T2=C12L11+C22L21との積算結果(o)=C12L11+C22L21が出力される。フリップフロップ20bには、クロックエッジのタイミングで、この積算結果(o)が保持値P2として保持される。
The flip-
続いて、サイクル2では、画像情報記憶装置から、同2列目の2画素分の画素値L12,L22が読み出され、元画像用レジスタ12に、それぞれL1,L2として保持される。その結果、積和演算器16aからは、演算結果T1=C11L12+C21L22が出力され、積和演算器16bからは、演算結果T2=C12L12+C22L22が出力される。
Subsequently, in
フリップフロップ20aには、クロックエッジに同期して、積和演算器16aの出力T1=C11L11+C21L21が保持される。加算器18からは、前サイクル(サイクル1)でフリップフロップ20aに保持された値P1’(表2では、前のサイクル、すなわち、サイクル1でのP1の値として示されている)=C11L11+C21L21と積和演算器16bの出力T2=C12L12+C22L22との積算結果(o)=C11L11+C12L12+C21L21+C22L22が出力される。フリップフロップ20bには、クロックエッジのタイミングで、この積算結果(o)が保持値P2として保持される。そして、フリップフロップ20bからは、この保持値が、フィルタ処理後の画素値P11として出力される。
The flip-
続いて、サイクル3では、画像情報記憶装置から、同3列目の2画素分の画素値L13,L23が読み出され、元画像用レジスタ12に、それぞれL1,L2として保持される。その結果、積和演算器16aからは、演算結果T1=C11L13+C21L23が出力され、積和演算器16bからは、演算結果T2=C12L13+C22L23が出力される。
Subsequently, in
フリップフロップ20aには、クロックエッジのタイミングで、積和演算器16aの出力T1=C11L12+C21L22が保持される。加算器18からは、前サイクル(サイクル2)でフリップフロップ20aに保持された値P1’=C11L12+C21L22と積和演算器16bの出力T2=C12L13+C22L23との加算結果(o)=C11L12+C12L13+C21L22+C22L23が出力される。フリップフロップ20bには、クロックエッジのタイミングで、この加算結果(o)が保持され、フィルタ処理後の画素の画素値P12として出力される。
The flip-
これ以降の動作は、上記と同様である。演算回路10では、初期化後、2サイクルでフィルタ処理後の最初の画素の画素値P11が出力され、以後、1サイクル毎に、フィルタ処理後の2番目以降の画素の画素値P12,P13,…が順次出力される。
The subsequent operation is the same as described above. In the
なお、表2では、初期化サイクルにおいてフリップフロップ20bの保持値P2も0に初期化した場合を示した。しかし、サイクル1において、クロック信号以前に出力される値P1’が演算に利用されるフリップフロップ20aについては初期化の必要があるが、フリップフロップ20bについては初期化は必須ではない。また、図13に示す順序で1行目のフィルタ処理後の画素の画素値P11〜P15の出力を終えた後には、再び初期化サイクルを行ってから、1行目と同様のサイクルを繰り返すことによって2行目のフィルタ処理後の画素の画素値の保持および出力を行う。
Table 2 shows a case where the hold value P2 of the flip-
本実施形態の演算回路10では、図14に示す従来の演算回路140と同様に、隣りあう画素の演算で共通に使用される元画像の画素の画素値を画像情報記憶装置から2度読み出す必要がないという利点がある。また、従来の演算回路140では、積和演算器が1つだけしか用いられていないが、本実施形態の演算回路10では、2つの積和演算器を用いることによって、従来の演算回路140の2倍の処理速度が実現されている。さらに、従来の演算回路140とは異なり、カウンタ156やマルチプレクサ149を用いた複雑な制御を必要としない。従って、単純な構成で高い処理速度を実現することが可能である。
In the
次に、第1の実施形態の別の例として、元画像の5列×5行の25画素分の画素値を用いて畳み込み演算によるフィルタ処理を行う演算回路について説明する。 Next, as another example of the first embodiment, an arithmetic circuit that performs filter processing by convolution operation using pixel values for 25 pixels of 5 columns × 5 rows of the original image will be described.
図2は、本発明の演算回路の構成を表す第2の実施形態の概念図である。同図に示す演算回路30は、演算回路10と比べると抽象的な表現となっているが、2次元空間に配置された元画像の5列×5行の25画素分の画素値から、同様の畳み込み演算によるフィルタ処理を行う。演算回路30は、元画像用レジスタ32と、係数用レジスタ34と、前処理回路42と、後処理回路44とによって構成されている。
FIG. 2 is a conceptual diagram of the second embodiment showing the configuration of the arithmetic circuit of the present invention. The
以下、図2に示す演算回路30について、図1の演算回路10との違いを重点的に説明する。
Hereinafter, the difference between the
演算回路30において、元画像用レジスタ32および係数用レジスタ34は、図1の演算回路10の元画像用レジスタ12および係数用レジスタ14と同様の機能を有する。なお、図2では、元画像用レジスタ32が、Liと記された縦長の長方形で表現されている。これは、処理対象となる元画像のi番目の1列の5画素分の画素値L1i〜L5iをまとめてLiと簡略的に表現したものである。また、係数用レジスタ34のC1〜C5についても同様である。
In the
前処理回路42は、列数分の5つの積和演算器36a、36b、36c、36d、36eによって構成されている。前処理回路42も、図1の演算回路10の前処理回路22と同様の機能を有する。例えば、図2中、一番上側(上側から1番目)の積和演算器36aは、C1Li(=C11L1i+C21L2i+C31L3i+C41L4i+C51L5i)の演算を行い、その演算結果T1を出力する。また、2〜5番目の積和演算器36b、36c、36d、36eも同様である。
The
また、後処理回路44は、列数分の5つの積和レジスタ41a、41b、41c、41d、41eによって構成されている。後処理回路44も、図1の演算回路10の積和レジスタ21a、21bと同様に構成され、同様の機能を有する。すなわち、1つめの積和レジスタ41aはフリップフロップのみからなるが、2〜5つめの積和レジスタ41b〜41eは、加算器とフリップフロップとから構成されている。
The
一番上側(上側から1番目)の積和レジスタ41aは、クロックエッジのタイミングで、1番目の積和演算器36aの出力T1を保持値P1として保持する。
The uppermost (first from the top) product-
2番目の積和レジスタ41bは、クロックエッジのタイミングで、積和レジスタ41aの出力P1’と積和演算器36bの演算結果T2との加算結果を保持値P2として保持する。
The second product-
3〜5番目の積和レジスタ41c、41d、41eは、2番目の積和レジスタ41bと同様に動作する。そして、最後(5番目)の積和レジスタ41eにクロック信号に同期して保持された保持値P5が、フィルタ処理後の画像の各画素の画素値Pとして出力される。
The third to fifth product-
なお、画素値および係数値を8ビットとすると、図2に示すように、元画像用レジスタ32から前処理回路42に対しては8ビット×5=40本の配線が接続され、係数用レジスタ34から前処理回路42に対しては8ビット×5×5=200本の配線が接続される。また、演算結果T1〜T5を8ビットとすると、前処理回路42から後処理回路44に対しては8ビット×5=40本の配線が接続される。そして、フィルタ処理後の画素の画素値を8ビットとすると、後処理回路44からは、8ビット=8本の配線が接続される。また、これ以後の実施形態においても、必要に応じて、図中に配線のビット数を示す。
If the pixel value and the coefficient value are 8 bits, as shown in FIG. 2, 8 bits × 5 = 40 wires are connected from the original image register 32 to the
演算回路30の基本的な動作は、図1の演算回路10と同様であるから、ここでは、繰り返しの説明を省略する。
Since the basic operation of the
同様に、図8に示す元画像の各画素の画素値が画像情報記憶装置に記憶され、図13に示す順序でフィルタ処理が順次行われる場合、演算回路30の具体的な動作は、下記表3,4に示す通りである。
Similarly, when the pixel value of each pixel of the original image shown in FIG. 8 is stored in the image information storage device and the filtering process is sequentially performed in the order shown in FIG. 13, the specific operation of the
なお、上記表3,4において、元画像用レジスタ32の出力Liは、サイクル1でL1となっているが、L1=L11,L21,L31,L41,L51の意味である。サイクル2〜6のL2〜L6も同様である。また、積和演算器36aの出力T1は、サイクル1でC1L1となっているが、C1L1=C11L11+C21L21+C31L31+C41L41+C51L51の意味である。積和演算器36b、36c、36d、36eの出力T2〜T5、積和レジスタ41a、41b、41c、41d、41eの出力P1〜P5も同様である。
In Tables 3 and 4, the output L i of the original image register 32 is L1 in
演算回路30では、初期化後、5サイクルでフィルタ処理後の最初の画素の画素値Pが出力され、以後、1サイクル毎に、フィルタ処理後の2番目以降の画素の画素値Pが順次出力される。また、演算回路30では、同様に、隣りあう画素の演算で共通に使用される元画像の画素の画素値を画像情報記憶装置から2度読み出す必要がないという利点があるのはもちろん、5つの積和演算器が用いられているので、従来の5倍の処理速度が実現されている。
In the
なお、本発明は、上記第1および第2の実施形態のように、画像データに限らず、2次元空間に配置された、あらゆる種類のデータのデータ値を畳み込み演算によってフィルタ処理する演算回路にも同様に適用可能である。これ以後の実施形態においても同様である。また、上記第1および第2の実施形態の演算回路10,30は、2列×2行や5列×5行のフィルタ処理に限らず、N列×N行(Nは2以上の整数)のフィルタ処理を行う演算回路に適用可能である。
Note that the present invention is not limited to image data as in the first and second embodiments, and is an arithmetic circuit that filters data values of all types of data arranged in a two-dimensional space by a convolution operation. Is equally applicable. The same applies to the following embodiments. The
第1および第2の実施形態の演算回路では、一般的に、初期化後、第1〜Nサイクルにかけて順に、2次元空間のN列×N行の範囲の1〜N列目のデータ値がデータレジスタに保持され、1番目の積和演算器の演算結果が1番目の積和レジスタに保持される。また、n番目(n=2〜N)の積和演算器の演算結果と、前サイクルでn−1番目の積和レジスタに保持された値との積算値がn番目の積和レジスタに保持される。これにより、N番目の積和レジスタから、2次元空間のN列×N行の範囲の中心に位置する第1の演算対象点の畳み込み演算結果が出力される。 In the arithmetic circuits of the first and second embodiments, generally, after the initialization, the data values of the 1st to Nth columns in the range of N columns × N rows in the two-dimensional space are sequentially given from the 1st to Nth cycles. It is held in the data register and the operation result of the first product-sum operation unit is held in the first product-sum register. Also, the integrated value of the operation result of the nth (n = 2 to N) product-sum operation unit and the value held in the n−1th product-sum register in the previous cycle is held in the nth product-sum register. Is done. As a result, the convolution calculation result of the first calculation target point located at the center of the range of N columns × N rows in the two-dimensional space is output from the Nth product-sum register.
また、1〜Nサイクルに続くN+1サイクルにおいてさらに、順に、2次元空間のN列×N行の範囲に隣接するN+1列目以降のデータ値がデータレジスタに保持される。これにより、N+M(Mは1以上の整数)サイクル後に、N番目の積和レジスタから、第1の演算対象点から列方向に順に隣りあうM番目の演算対象点の畳み込み演算結果が出力される。 Further, in the (N + 1) cycle following the 1st to Nth cycles, the data values after the (N + 1) th column adjacent to the range of N columns × N rows in the two-dimensional space are sequentially held in the data register. As a result, after N + M cycles (M is an integer equal to or greater than 1), the Nth product-sum register outputs the convolution calculation result of the Mth calculation target point adjacent in the column direction from the first calculation target point. .
次に、本発明の第3の実施形態について説明する。 Next, a third embodiment of the present invention will be described.
図3は、本発明の演算回路の構成を表す第3の実施形態の概念図である。同図に示す演算回路50も、図2の演算回路30と同様に、2次元空間に配置された元画像の5列×5行の25画素分の画素値から、畳み込み演算によるフィルタ処理を行う。図3の演算回路50は、元画像用レジスタ52と、係数用レジスタ54と、前処理回路62と、後処理回路64と、カウンタ66とによって構成されている。
FIG. 3 is a conceptual diagram of the third embodiment showing the configuration of the arithmetic circuit of the present invention. Similar to the
また、図4は、図3の演算回路50を具体的に表現した概略図である。なお、図4では、その煩雑さを避けるために、カウンタ66の表示を省略し、そのカウント値がj=0〜2で表されている。例えば、フリップフロップ60a1のクロック端子はj=0となっているが、これは、フリップフロップ60a1には、カウンタ66のカウント値j=0である期間に、クロック信号が入力されることを意味する。
FIG. 4 is a schematic diagram specifically showing the
以下、図3および図4に示す演算回路50について、図2の演算回路30との違いを重点的に説明する。
Hereinafter, the difference between the
演算回路50において、元画像用レジスタ52および係数用レジスタ54は、図2の演算回路30の元画像用レジスタ32および係数用レジスタ34と同様の機能を有する。
In the
図2の演算回路30では、係数用レジスタ34から5つの積和演算器36a、36b、36c、36d、36eに各々対応する係数値C1〜C5が同時(並列)に出力される。これに対し、図3の演算回路50では、カウンタ66のカウント値jが変わる毎に、係数用レジスタ54から2つの積和演算器56a、56bに、1つまたは2つの係数値のみが同時(並列)に出力される。両者は、この点で異なっている。
In the
図2に示す演算回路30では、1つの係数値Cを8ビットとすると、8ビット×5×5=200本の配線が必要となる。これに対し、図3および図4に示す演算回路50では、係数用レジスタ54から出力される係数値は最大で2つであるから、同じく1つの係数値を8ビットとすると、8ビット×5×2=80本の配線だけしか必要がなく、配線数を2/5に削減することができる。
In the
つまり、本実施形態の場合、係数用レジスタ54の出力ビット幅を少なくできる。このように、出力ビット幅を少なくすることにより、係数用レジスタ54として、レジスタではなく、実際には、より面積が小さいメモリやFIFOなどを使用することが可能となる。また、このことは、係数用レジスタ54に限らず、以下の実施形態に示すように、元画像用レジスタについても同様である。
That is, in the present embodiment, the output bit width of the
続いて、前処理回路62は、列数(5)に比較して少ない2つの積和演算器56a、56bによって構成されている。
Subsequently, the
積和演算器56aは、C2j+1Liの演算を行い、その演算結果T2j+1を出力する。また、積和演算器56bは、C2j+2Liの演算を行い、その演算結果T2j+2を出力する。
カウンタ66は、初期化後、クロック信号に同期して、0〜2を繰り返しカウントする。本実施形態の場合、カウンタ66のカウント値j=0の時、フィルタ係数用レジスタ54から係数値C1,C2が出力され、それぞれ積和演算器56a、56bに入力される。また、カウント値jが1の時、係数値C3,C4が、それぞれ積和演算器56a、56bに入力され、カウント値jが2の時、係数値C5が積和演算器56aに入力される。
The
積和演算器56aでは、係数値C1が入力されると、その演算結果T1として、C11L1i+C21L2i+C31L3i+C41L4i+C51L5iが出力される。また、C3が入力されると、T3として、C13L1i+C23L2i+C33L3i+C43L4i+C53L5iが出力され、C5が入力されると、T5として、C15L1i+C25L2i+C35L3i+C45L4i+C55L5iが出力される。
When the coefficient sum C1 is input to the product-
積和演算器56bでは、係数値C2が入力されると、その演算結果T2として、C12L1i+C22L2i+C32L3i+C42L4i+C52L5iが出力される。また、C4が入力されると、T4として、C14L1i+C24L2i+C34L3i+C44L4i+C54L5iが出力される。
When the coefficient sum C2 is input to the product-
なお、積和演算器56aに係数値C5が入力される時、積和演算器56bの出力は後処理回路64で使用されないので、積和演算器56bに入力される係数値は何ら限定されない。
Note that when the coefficient value C5 is input to the product-
続いて、後処理回路64は、列数分の5つの積和レジスタ61a、61b、61c、61d、61eによって構成されている。
Subsequently, the
図4に示すように、1番目の積和レジスタ61aは、2つのフリップフロップ60a1,60a2によって構成されている。1段目のフリップフロップ60a1は、カウンタ66のカウント値j=0の時に、クロックエッジのタイミングで、積和演算器56aの出力を1列目の積和演算結果T1として一時的に保持する。具体的には、例えば、クロック信号の有効エッジのタイミングでカウンタ66が動作してカウント値jが0に変化し、クロック信号の1周期の間に、係数値の演算器56aへの入力、および、演算器56aからの積和演算結果の出力が行われ、次の有効エッジのタイミングで、フリップフロップ60a1に保持される。この、1段目のフリップフロップ(以降、「一時レジスタ」と呼ぶ)60a1に保持された積和演算結果は、次にカウント値j=0となる期間に、クロックエッジのタイミングで、2段目のフリップフロップ60a2に保持値P1として保持される。一方、P1が保持される以前には、前回カウント値j=0であった期間に2段目のフリップフロップ60a2に保持された値P1’が、フリップフロップ60a2から出力され、2番目の積和レジスタ61bの加算器58bに入力される。
As shown in FIG. 4, the first product-
積和レジスタ61bは、加算器58bと、2つのフリップフロップ60b1,60b2とによって構成されている。1段目のフリップフロップ(一時レジスタ)60b1には、カウンタ66のカウント値j=0である期間に、クロックエッジのタイミングで、積和演算器56bの出力を2列目の積和演算結果T2として保持する。加算器58bは、一時レジスタ60b1に保持された積和演算結果T2と、上記フリップフロップ60a2の出力P1’とを加算する。フリップフロップ60b2は、次にカウンタ66のカウント値j=0となる期間に、クロックエッジのタイミングで、加算器58bの出力P1’+T2を保持する。ここでの演算に利用されるP1’は、P1が保持される以前にフリップフロップ60a2に保持されていた値である。
The product-
積和レジスタ61c、61d、61eの構成および動作も、積和レジスタ61bの構成および動作と同様である。すなわち、積和レジスタ61cおよび積和レジスタ61dの一時レジスタ61c1,61d1は、カウンタ66のカウント値j=1である期間に、クロックエッジのタイミングで、それぞれ積和演算器56aおよび56bの出力を、3列目および4列目の積和演算結果T3,T4として保持する。積和レジスタ61eの一時レジスタ60e1は、カウンタ66のカウント値j=2である期間に、クロックエッジのタイミングで、積和演算器56aの出力を5列目の積和演算結果T5として保持する。また、積和レジスタ61c〜61eの加算器58c〜58eは、それぞれ、積和レジスタ61b〜61dの2段目のフリップフロップ60b2〜60d2に保持された値P2’〜P4’と、対応する一時レジスタに保持された積和演算結果T3〜T5との積算値を、2段目のフリップフロップ60c2〜60e2に出力する。そして、これらの積算値P2’+T3〜P4’+T5は、次にカウント値j=0になる期間に、クロックエッジのタイミングで、それぞれの積和レジスタの2段目のフリップフロップ60c2〜60e2に保持される。
The configuration and operation of the product-
次に、演算回路50の基本的な動作を説明する。
Next, the basic operation of the
演算回路50では、初期化処理として、係数用レジスタ14に、5つの列のそれぞれ5個の係数値C1〜C5が保持される。そして、少なくとも積和レジスタ61a、61b、61c、61dの一時レジスタおよび2段目のフリップフロップの保持値は全て0に初期化される。
In the
前述の通り、カウンタ66は、クロック信号に同期して、0〜2の順に繰り返しカウントを行い、そのカウント値j=0〜2を出力する。このカウント値jは、係数用レジスタ54、元画像用レジスタ52、前処理回路62および後処理回路64に入力される。そして、カウント値j=0になる毎に、処理対象となる元画像の1列の5画素分の画素値が、元画像用レジスタ52にLiとして保持される。
As described above, the
カウンタ66のカウント値j=0の期間には、係数値レジスタ54から、1および2番目の係数値C1,C2が出力され、それぞれ前処理回路62の積和演算器56a、56bに入力される。
During the period of the count value j = 0 of the
積和演算器56aでは、元画像用レジスタ52から入力される、1番目の1列の5画素分の画素値L1と、係数用レジスタ54から入力される、1番目の1列の5つの係数値C1との積和演算C1L1が行われ、その演算結果T1が出力される。また、積和演算器56bでは、1番目の1列の5画素分の画素値L1と、2番目の1列の5つの係数値C2との積和演算C2L1が行われ、その演算結果T2が出力される。
In the product-
積和演算器56a、56bの出力T1およびT2は、クロックエッジのタイミングで、それぞれ1番目の積和レジスタ61aのフリップフロップ60a1および2番目の積和レジスタ61bのフリップフロップ60b1に保持される。
The outputs T1 and T2 of the product-
続いて、カウンタ66のカウント値j=1の期間には、係数用レジスタ54から、3および4列目の係数値C3,C4が出力され、それぞれ積和演算器56a、56bに入力される。
Subsequently, during the period of the count value j = 1 of the
同様に、積和演算器56aでは、1番目の1列の5画素分の画素値L1と、3番目の1列の5つの係数値C3との積和演算C3L1が行われ、その演算結果T3が出力される。また、積和演算器56bでは、1番目の1列の5画素分の画素値L1と、4番目の1列の5つの係数値C4との積和演算C4L1が行われ、その演算結果T4が出力される。
Similarly, the product-
積和演算器56a、56bの出力T3およびT4は、クロックエッジのタイミングで、それぞれ3番目の積和レジスタ61cの一時レジスタ60c1および4番目の積和レジスタ61dの一時レジスタ60d1に保持される。
The outputs T3 and T4 of the product-
続いて、カウンタ66のカウント値j=2の期間には、係数用レジスタ54から、5番目の係数値C5が出力され、前処理回路62の積和演算器56aに入力される。
Subsequently, during the period of the count value j = 2 of the
積和演算器56aでは、1番目の1列の5画素分の画素値L1と、5番目の1列の5つの係数値C5との積和演算C5L1が行われ、その演算結果T5が出力される。
The product-
積和演算器56aの出力T5は、クロックエッジのタイミングで、5番目の積和レジスタ61eの一時レジスタ60e1に保持される。このように、演算回路50では、列数(5)よりも少ない個数(2個)の積和演算器56a、56bを使用して、カウンタ66のカウント値がj=0,1,2と変化する間に、5個の積和演算結果T1〜T5を算出し、それぞれの積和レジスタ61a〜61eの一時レジスタ60a1〜60e1に保持する。
The output T5 of the product-
そして、次のカウント値j=0の期間には、一時レジスタ60a1〜60e1に一時的に保持した積和演算結果を、そのまま、もしくは、積和レジスタ61a〜61dの2段目のフリップフロップに保持されていた値と積算した上で、2段目のフリップフロップ60a2〜60e2に保持する。
Then, during the next count value j = 0, the product-sum operation results temporarily held in the temporary registers 60a1 to 60e1 are held as they are or in the second-stage flip-flops of the product-
積和レジスタ61aでは、一時レジスタ60a1に保持された積和演算結果T1が、クロックエッジのタイミングでフリップフロップ60a2に保持される。また、積和レジスタ61bでは、加算器58bにより、一時レジスタ60b1に保持された積和演算結果T2と、フリップフロップ60a2の出力P1’とが加算され、その加算結果P1’+T1が、クロックエッジのタイミングでフリップフロップ60b2に、保持値P2として保持される。ここでの加算演算に利用されるフリップフロップ60a2の出力P1’は、前回、カウンタ66のカウント値j=0であった期間にフリップフロップ60a2に保持された値である。この場合には初期化後の値、すなわち0である。
In the product-
積和レジスタ61cでは、加算器58cにより、一時レジスタ60c1に保持された積和演算結果T3と、フリップフロップ60b2の出力P2’とが加算され、その加算結果P2’+T3が、クロックエッジのタイミングでフリップフロップ60c3に、保持値P3として保持される。また、積和レジスタ61dでは、加算器58dにより、一時レジスタ60d1に保持された積和演算結果T4と、フリップフロップ60c2の出力P3’とが加算され、その加算結果P3’+T4が、クロックエッジのタイミングでフリップフロップ60d2に、保持値P4として保持される。ここでの加算結果に利用されるフリップフロップ60b2および60c2の出力P2’およびP3’は、前回、カウント値j=0であった期間にフリップフロップ60b2および60c2に保持された値である。この場合には初期化後の値、すなわち0である。
In the product-
積和レジスタ61eでは、加算器58eにより、一時レジスタ60e1に保持された積和演算結果T5と、フリップフロップ60d2の出力P4’とが加算され、その加算結果P4’+T5が、クロックエッジのタイミングで、保持値P5としてフリップフロップ60e2に保持される。ここでの加算演算に利用されるフリップフロップ60d2の出力P4’は、前回、カウント値j=0であった期間に保持された値である。この場合には、初期化後の値、すなわち0である。そして、フリップフロップ60e2の出力P5が、フィルタ処理後の画像の各画素の画素値Pとして出力される。
In the product-
このように、演算回路50では、カウンタ66のカウンタ値jが0,1,2と変化する過程で、2個の積和演算器56a、56bを利用して積和演算C1L1〜C5L1を行い、その演算結果T1〜T5を、1〜5番目の積和レジスタ61a〜61eのそれぞれの一時レジスタ60a1〜60e1に保持する。そして、次にカウント値j=0になった期間に、1番目の積和レジスタ61aの一時レジスタ60a1に保持された積和演算結果T1が同一の積和レジスタ61aの2段目のフリップフロップ60a2に保持される。同時に、2〜5番目の積和レジスタ61b〜61eの2段目のフリップフロップ60b2〜60e2には、それぞれ、同一の積和レジスタ61b〜61eの一時レジスタ60b1〜60e1に保持された積和演算結果T2〜T5と、1〜4番目の積和レジスタ61a〜61dの2段目のフリップフロップ60a2〜60d2に、前回カウント値j=0であった期間に保持された値P1’〜P4’との積算値が、保持される。
As described above, the
すなわち、演算回路50では、カウンタ66のカウント値jが0,1,2と変化し、さらに0に戻る過程で、図2の演算回路30が1サイクルに実施する演算を実施する。これ以降、カウント値jが0,1,2であるそれぞれの期間を、演算のサイクルと区別するために、ステップと呼ぶ。
That is, in the
演算回路50では、さらに、カウンタ66によって、0〜2の順に繰り返しカウントが行われ、上記の動作が繰り返される。そして、演算回路30と同様に、初期化後5サイクルで、5列×5行の畳み込み演算によるフィルタ処理を行った最初の画素の画素値Pが後処理回路64の最後の積和レジスタ61eのフリップフロップ60e2に保持され、出力される。
In the
同様に、図8に示す元画像の各画素の画素値が画像情報記憶装置に記憶され、図13に示す順序でフィルタ処理が順次行われる場合、演算回路50の具体的な動作は、下記表5,6に示す通りである。
Similarly, when the pixel value of each pixel of the original image shown in FIG. 8 is stored in the image information storage device and the filter processing is sequentially performed in the order shown in FIG. 13, the specific operation of the
表5および表6には、各ステップにおけるカウント値jと、クロックエッジに同期して積和レジスタ61a〜61eのそれぞれの一時レジスタ60a1〜60e1に保持される積和演算結果T1〜T5、および、2段目のフリップフロップ60a2〜60e2に保持される値P1〜P5を示した。従って、カウント値j=0となるステップにおいて2段目のフリップフロップ60b2〜60e2に保持する値を算出するために、それぞれの積和レジスタ61b〜61eの加算器58b〜58eに供給される値P1’〜P4’は、同一ステップにおけるP1〜P4の値として表6に示された値とは異なる。例えば、表6には、第4ステップにおけるP1〜P4の値としては、それぞれT11,T21,T31,T41が示されている。しかし、同一ステップにおいて加算器58b〜58eに供給されるP1’〜P4’の値は、前回j=0であった第1ステップにおいてそれぞれのフリップフロップ60a2〜60d2に保持され、その後、第3ステップまで維持されていた値、すなわち、0である。なお、表5および表6において、例えばT11は、表4におけるC1L1と同じものである。T12,T13,…およびT21,T31,…、等についても同様である。
Tables 5 and 6 show the count value j in each step, the product-sum operation results T1 to T5 held in the temporary registers 60a1 to 60e1 of the product-
ここで、表4,5を参照しながら、カウンタ66のカウント値jが0,1,2と変化し、さらに0に戻る過程で、演算回路50が、図2の演算回路30が1サイクルに実施する演算を実施する処理を説明する。
Here, referring to Tables 4 and 5, in the process in which the count value j of the counter 66 changes to 0, 1, and 2 and further returns to 0, the
例えば、表5,6の第1ステップから開始される第1サイクルにおいては、まず、第1ステップにおいて、元画像用レジスタ52に1番目の1列の画素値L1が保持される。そして、第1〜第3ステップにかけて、2つの積和演算器56a、56bによって、元画像用レジスタ52に保持された1番目の1列の画素値L1と係数用レジスタ54に保持された係数値との間の積和演算が行われる。そして、この積和演算結果T11〜T51が、図4に示されたT1〜T5の値として、積和レジスタ61a〜61eの一時レジスタ60a1〜60e1に保持される。続いて、第4ステップにおいて、1番目の積和レジスタ61aの一時レジスタ60a1に保持された、1番目の1列の画素値と1列目の係数との間の積和演算結果T11が、1番目の積和レジスタ61aの2段目のフリップフロップ60a2に、表6のP1の値として保持される。また、2〜5番目の積和レジスタ61b〜61eの一時レジスタ60b1〜60e1に保持された、1番目の1列の画素値と2〜5列目の係数値との間の積和演算結果T21〜T51は、それぞれ、1〜4番目の積和レジスタ61a〜61dの2段目のフリップフロップ60a2〜60d2から供給される値P1’〜P4’(第1ステップにおいて保持された値P1〜P4)と積算され、2〜5番目の積和レジスタ61b〜61eの2段目のフリップフロップ60b2〜60e2に保持される。この場合には、第1ステップにおいてフリップフロップ60a2〜60d2に保持された値はいずれも0であるため、積和演算結果T21〜T51がそのまま、表6のP2〜P5の値として保持される。これによって、第1の処理サイクルが完了する。
For example, in the first cycle starting from the first step of Tables 5 and 6, first, the pixel value L1 of the first one column is held in the
この第4ステップにおいては、第1サイクルにおける第2段のフリップフロップ60a2〜60e2への積和演算結果もしくは積算値の保持と並行して、第2サイクルにおける元画像用レジスタ52への2番目の1列の画素値L2の保持、および、この画素値L2と係数値との間の積和演算とその結果の一時レジスタへの保持が開始される。すなわち、表5のT1,T2の値は、それぞれT12,T22に変化する。このように、演算回路50においては、カウンタ66のカウント値jが0になるステップにおいて、連続する2つのサイクルの処理の一部が並列して行われる。
In the fourth step, the second sum to the
第2サイクルの処理は、さらに第5〜第7ステップにおいて引き続いて行われる。すなわち、第4ステップに続いて第5,6ステップにおいて積和演算とその結果の一時レジスタへの保持が行われ、第7ステップにおいて、第2段のフリップフロップ60a2〜60e2への積和演算結果もしくは積算値の保持が行われる。ここで、第7ステップにおいて積算値の算出において利用される、1〜4番目の積和レジスタ61a〜61dの2段目のフリップフロップ60a〜60dに保持された値は、前サイクル、すなわち、第4ステップで、クロック信号に同期して保持されたものである。
The processing in the second cycle is further performed in the fifth to seventh steps. That is, following the fourth step, the product-sum operation is performed in the fifth and sixth steps and the result is stored in the temporary register. In the seventh step, the product-sum operation result to the second-stage flip-flops 60a2 to 60e2 is performed. Alternatively, the integrated value is held. Here, the values held in the second-stage flip-flops 60a to 60d of the first to fourth product-
ここで、上記第1サイクルの最後に、第4ステップにおいて行われる積算に利用される値P1’〜P4’は、初期化ステップに続く第1ステップにおいて2段目のフリップフロップ60a〜60dに保持値P1〜P4として保持されたものである。前述のように、第1ステップにおいては、既に第1サイクルの処理としての積和演算および積和演算結果の一時レジスタへの保持が開始されている。しかし、やはり前述のように、演算回路50においては、カウント値jが0になるステップにおいて、連続する2つのサイクルの処理の一部が並列して行われる。すなわち、第1ステップでの2段目のフリップフロップ60a〜60dへの保持値P1〜P4の保持は、前サイクルである初期化サイクルの一部として行われる。従って、第1サイクルの最後の第4ステップにおいて積算値の算出に利用される、1〜4番目の積和レジスタ61a〜61dの2段目のフリップフロップ60a〜60dの保持値も、前サイクルで保持された値である。
Here, at the end of the first cycle, values P1 ′ to P4 ′ used for integration performed in the fourth step are held in the second-stage flip-flops 60a to 60d in the first step following the initialization step. It is held as values P1 to P4. As described above, in the first step, the product-sum operation as the processing of the first cycle and the holding of the product-sum operation result in the temporary register are already started. However, as described above, in the
その後、第3以降のサイクルの処理も同様に行われ、第5サイクルが終了する第16ステップにおいて、最初のフィルタ処理後の画素の画素値Pが出力される。以後、3サイクル毎に、2番目以降のフィルタ処理後の画素の画素値Pが順次出力される。 Thereafter, the processes in the third and subsequent cycles are performed in the same manner, and the pixel value P of the pixel after the first filter process is output in the sixteenth step when the fifth cycle ends. Thereafter, every three cycles, the pixel value P of the pixel after the second and subsequent filter processing is sequentially output.
本実施形態の演算回路50においても、隣りあう画素の演算で共通に使用される元画像の画素の画素値を画像情報記憶装置から2度読み出す必要がないという利点がある。また、演算回路50では、2つの積和演算器56a、56bだけを用いている。これにより、その処理速度は、従来の1/3倍となるが、処理速度が要求されない用途であれば、回路規模を削減することができるという利点がある。
The
なお、本実施形態では、積和演算器56aには、係数値C1,C3,C5の順で順次係数値が入力され、積和演算器56bには、C2,C4の順で順次係数値が入力されている。しかし、本発明は、これに限らず、積和演算器に係数値が入力される順序はどのような順序であっても良い。また、積和演算器56a、56bのどちらにどの係数値を入力するかも任意である。
In the present embodiment, coefficient values are sequentially input to the product-
第3の実施形態の演算回路は、5列×5行に限らず、N列×N行(Nは3以上の整数)の畳み込み演算によるフィルタ処理に適用可能である。この時、前処理回路52の積和演算器の個数mは、2≦m<Nとする。
The arithmetic circuit of the third embodiment is not limited to 5 columns × 5 rows, but can be applied to filter processing by convolution operation of N columns × N rows (N is an integer of 3 or more). At this time, the number m of product-sum calculators in the
本実施形態の演算回路では、一般的に、初期化後、1〜Nサイクルにかけて順に、2次元空間のN列×N行の範囲の1〜N列目のデータ値をデータレジスタに保持し、各サイクル毎に、前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、N個のデータ値と、N列×N行のいずれかの列のN個の係数との間の積和を演算する操作を、N回(Nステップ)未満繰り返して行うことによりN個のデータ値と全ての列の係数との間の積和の演算を行う。そして、積和演算器が演算した、N個のデータ値と1列目のN個の係数との間の積和演算結果を後処理回路の1番目の積和レジスタに保持するとともに、N個のデータ値とn列目(n=2〜N)の係数との間の積和演算結果と、前サイクルでの後処理回路のn−1番目の積和レジスタに保持した値との積算値を、後処理回路のn番目の積和レジスタに保持する。これにより、N番目の積和レジスタから、2次元空間の前記N列×N行の範囲の中心に位置する第1の演算対象点の畳み込み演算結果が出力される。 In the arithmetic circuit of the present embodiment, generally, after initialization, data values in the 1st to Nth columns in the range of N columns × N rows in the two-dimensional space are sequentially stored in the data register over 1 to N cycles. For each cycle, between each of at least some of the m multiply-add calculators of the pre-processing circuit, between N data values and N coefficients in any column of N columns × N rows. The operation of calculating the sum of products is repeated less than N times (N steps), thereby calculating the sum of products between the N data values and the coefficients of all the columns. The product-sum operation result between the N data values and the N coefficients in the first column calculated by the product-sum calculator is held in the first product-sum register of the post-processing circuit, and N Of the product-sum operation between the data value of n and the coefficients of the n-th column (n = 2 to N) and the value held in the n−1th product-sum register of the post-processing circuit in the previous cycle Is held in the nth product-sum register of the post-processing circuit. As a result, the convolution calculation result of the first calculation target point located at the center of the range of N columns × N rows in the two-dimensional space is output from the Nth product-sum register.
また、図4に示すように、後処理回路がさらに、1〜N番目の積和レジスタのそれぞれに対応して設けられた1〜N番目の一時レジスタ(図4のフリップフロップ60a1,60b1,60c1,60d1,60e1)を備えることが好ましい。この場合、各サイクル毎に、積和演算器が演算した、データ値と1〜N列目の係数値との間の積和演算結果のそれぞれが1〜N番目の一時レジスタに保持された後に、一時レジスタのn番目に保持された積和演算結果と前サイクルでn−1番目の積和レジスタに保持された値との積算値が、n番目の積和レジスタに保持される。 Further, as shown in FIG. 4, the post-processing circuit is further provided with 1-Nth temporary registers (flip-flops 60a1, 60b1, 60c1 of FIG. 4) provided corresponding to each of the 1-Nth product-sum registers. , 60d1, 60e1). In this case, after each product-sum operation result between the data value and the coefficient value in the 1st to Nth columns calculated by the product-sum operation unit is held in the 1st to Nth temporary registers for each cycle. The integrated value of the nth product-sum operation result held in the temporary register and the value held in the n−1th product-sum register in the previous cycle is held in the nth product-sum register.
次に、本発明の第4の実施形態について説明する。 Next, a fourth embodiment of the present invention will be described.
図5は、本発明の演算回路の構成を表す第4の実施形態の概略図である。同図に示す演算回路70は、2次元空間に配置された元画像の2列×2行の4画素分の画素値から、畳み込み演算によるフィルタ処理を行う。演算回路70は、元画像用シフトレジスタ72と、係数用シフトレジスタ74と、前処理回路82と、後処理回路84と、カウンタ86とによって構成されている。
FIG. 5 is a schematic diagram of the fourth embodiment showing the configuration of the arithmetic circuit of the present invention. The
元画像用シフトレジスタ72は、処理対象となる元画像の2列×2行=4画素分の画素値を保持する。そして、1サイクル毎に、次の1列の2画素分の画素値が、図5中右側の1列にシフトインされ、各列の2画素分の画素値が左側に1列ずつシフトされる。 The original image shift register 72 holds pixel values of 2 columns × 2 rows = 4 pixels of the original image to be processed. Then, for each cycle, the pixel values for the two pixels in the next column are shifted into the right column in FIG. 5, and the pixel values for the two pixels in each column are shifted one column to the left. .
すなわち、元画像用シフトレジスタ72では、1サイクル毎に、左側(1列目)の1列の2画素分の画素値Liがシフトアウトされ、右側(2列目)の1列の2画素分の画素値Li+1が左側の1列にシフトされてLiとして保持され、処理対象となる次の1列の2画素分の画素値が新たなLi+1として右側の1列に保持される。1サイクル毎に、左側の1列の2画素分の画素値Liは積和演算器76aに入力され、右側の1列の2画素分の画素値Li+1は積和演算器76bに入力される。
That is, in the original image shift register 72, for each cycle, the pixel value L i of two pixels in one column of the left (first column) are shifted out, two pixels in one column on the right (second row) The pixel value L i + 1 of the minute is shifted to one column on the left side and held as L i , and the pixel value for two pixels in the next one column to be processed is a new column on the right side as a new L i + 1 Retained. For each cycle, the pixel values L i for two pixels in the left column are input to the product-
続いて、係数用シフトレジスタ74は、演算回路70の機能(フィルタ処理)を決定するための、元画像の2列×2行=4画素に対応する4個の係数値C11,C21,C12,C22を保持する。
Subsequently, the coefficient shift register 74 determines the function (filtering process) of the
係数用シフトレジスタ74では、1サイクル毎に、図5中、左側の1列の2つの係数値C11,C21と、右側の1列の2つの係数値C12,C22とが交互にシフト(ローテーション)され、左側の1列の2つの係数値が出力される。1列の2つの係数値C1(=C11,C21)もしくはC2(=C12,C22)は、1サイクル毎に、積和演算器76a、76bの両方に共通に入力される。
In the coefficient shift register 74, two coefficient values C11 and C21 in one column on the left side and two coefficient values C12 and C22 in one column on the right side in FIG. 5 are alternately shifted (rotated) every cycle. Then, two coefficient values in one column on the left side are output. Two coefficient values C1 (= C11, C21) or C2 (= C12, C22) in one column are input in common to both the product-
カウンタ86は、初期化後、クロック信号に同期して1〜2を繰り返しカウントする。このカウンタ86の計数と、係数用シフトレジスタ74のシフトとが、同一のクロック信号に同期して行われることにより、本実施形態の場合、カウント値k=1の時には係数値C1が、カウント値k=2の時には係数値C2が、積和演算器76a、76bに共通に入力される。
The counter 86 repeatedly counts 1 to 2 in synchronization with the clock signal after initialization. The count of the counter 86 and the shift of the coefficient shift register 74 are performed in synchronization with the same clock signal. In this embodiment, when the count value k = 1, the coefficient value C1 becomes the count value. When k = 2, the coefficient value C2 is commonly input to the product-
前処理回路82は、列数分の2つの積和演算器76a、76bによって構成されている。
The
積和演算器76aは、サイクル毎に、元画像用シフトレジスタ72の左側の1列の2画素分の画素値Li(例えば、サイクル1ではL1,サイクル2ではL2)と、係数用シフトレジスタ74の1番目(図5中、左側)の1列の2つの係数値Ck(例えば、サイクル1ではC1,サイクル2ではC2)との積和演算T1=CkLiを行う。積和演算器76aの出力T1は加算器78aに入力される。
The product-
一方、積和演算器76bは、元画像用シフトレジスタ72の右側の1列の2画素分の画素値Li+1(例えば、サイクル1ではL2,サイクル2ではL3)と、係数用シフトレジスタ74の1番目の1列の2つの係数値Ckとの積和演算T2=CkLi+1を行う。積和演算器76bの出力T2は加算器78bに入力される。
On the other hand, the product-
後処理回路84は、列数分の2つの積和レジスタ81a、81bによって構成されている。
The
積和レジスタ81aは、加算器78aと、セレクタ79aと、フリップフロップ80aによって構成されている。加算器78aは、積和演算器76aの出力T1とフリップフロップ80aの出力P1’とを加算する。セレクタ79aは、カウンタ86のカウント値k=1の時には積和演算器76aの出力T1を選択し、出力する。カウント値k=2の時には加算器78aの出力P1’+T1を選択し、出力する。フリップフロップ80aは、クロックエッジのタイミングで、セレクタ79aの出力を保持する。保持された値P1は、フィルタ処理後の画像の奇数番目の各画素の画素値として出力される。
The product-sum register 81a includes an
また、積和レジスタ81bは、加算器78bと、セレクタ79bと、フリップフロップ80bによって構成されている。加算器78bは、積和演算器76bの出力T2とフリップフロップ80bの出力P2’とを加算する。セレクタ79bは、カウンタ86のカウント値k=1の時には積和演算器76bの出力T1を選択し、出力する。カウント値k=2の時には加算器78bの出力P2’+T2を選択し、出力する。フリップフロップ80bは、クロック信号に同期して、セレクタ79bの出力を保持する。保持された値P2は、フィルタ処理後の画像の偶数番目の各画素の画素値として出力される。
The product-
次に、表7を参照しながら、図8に示す元画像の各画素の画素値が画像情報記憶装置に記憶され、図13に示す順序でフィルタ処理が順次行われる場合の演算回路70の動作を説明する。
Next, referring to Table 7, the operation of the
初期化のサイクルでは、元画像用シフトレジスタ72には、図5中上側に示すように、左側の1列の2画素分の画素値Liとして、元画像の1列目の2画素分の画素値L11,L21が保持され、右側の2画素分の画素値Li+1として、元画像の2列目の2画素分の画素値L12,L22が保持される。係数用シフトレジスタ74には、係数値C1(=C11,C21)およびC2(=C12,C22)が、最初にC1が出力される状態に保持される。 In the initialization cycle, the original image shift register 72, as shown in the upper side in FIG. 5, as the pixel value L i of two pixels of one column to the left, the first column of the original image of two pixels Pixel values L11 and L21 are held, and pixel values L12 and L22 for two pixels in the second column of the original image are held as pixel values L i + 1 for the two pixels on the right side. The coefficient shift register 74 holds the coefficient values C1 (= C11, C21) and C2 (= C12, C22) in a state where C1 is first output.
サイクル1では、積和演算器76aでは、元画像用レジスタ72から入力される左側の1列の2画素分の画素値L1=L11,L21と、係数用シフトレジスタ74から入力される2つの係数値C1=C11,C21との積和演算C1L1=C11L11+C21L21が行われる。
In
同様に、積和演算器76bでは、右側の1列の2画素分の画素値L2=L12,L22と、2つの係数値C1=C11,C21との積和演算C1L2=C11L12+C21L22が行われる。
Similarly, the product-
そして、サイクル1では、カウンタ86のカウント値k=1であるため、セレクタ79aにより、積和演算器76aの出力T1=C11L11+C21L21が選択され、クロックエッジのタイミングでフリップフロップ80aに保持される。
In
同様に、セレクタ79bにより、積和演算器76bの出力T2=C11L12+C21L22が選択され、クロックエッジのタイミングでフリップフロップ80bに保持される。
Similarly, the
サイクル2では、図5中下側に示すように、元画像用シフトレジスタ72の左側の1列の2画素分の画素値Liとして、元画像の2列目の2画素分の画素値L12,L22が保持され、右側の2画素分の画素値Li+1として、元画像の3列目の2画素分の画素値L13,L23が保持され、それぞれ、積和演算器76aおよび76bに入力される。また、係数用シフトレジスタ74からは、係数値C2(=C12,C22)が出力される。
In
従って、積和演算器76aでは、左側の1列の2画素分の画素値L2=L12,L22と、係数値C2=C12,C22との積和演算C2L2=C12L12+C22L22が行われる。
Accordingly, the product-
同様に、積和演算器76bでは、右側の1列の2画素分の画素値L3=L13,L23と、係数値C2=C12,C22との積和演算C2L3=C12L13+C22L23が行われる。
Similarly, the product-
積和レジスタ81aでは、加算器78aにより、積和演算器76aの出力T1=C12L12+C22L22とフリップフロップ80aの出力P1’=C11L11+C21L21とが加算される。そして、サイクル2では、カウンタ86のカウント値k=2であるため、セレクタ79aにより、加算器78aの出力P1’+T1=C11L11+C12L12+C21L21+C22L22が選択され、クロックエッジのタイミングでフリップフロップ80aに保持される。保持された値P1は、フィルタ処理後の画像の1番目の画素の画素値P11として出力される。
In the product-sum register 81a, the output T1 = C12L12 + C22L22 of the product-
同様に、積和レジスタ81bでは、加算器78bにより、積和演算器76bの出力T2=C12L13+C22L23と、クロック信号以前のフリップフロップ80bの出力P2’=C11L12+C21L22とが加算される。そして、セレクタ79bにより、加算器78bの出力P2’+T2=C11L12+C12L13+C21L22+C22L23が選択され、クロックエッジのタイミングでフリップフロップ80bに保持される。保持された値P2は、フィルタ処理後の画像の2番目の画素の画素値P11として出力される。
Similarly, in the product-
これ以降の動作は、上記と同様である。すなわち、演算回路70では、初期化後、2サイクルで1および2番目のフィルタ処理後の2画素分の画素値P11,P12が同時(並列)に出力される。これ以後、2サイクル毎に、フィルタ処理後の2画素分の画素値が同時に出力される。
The subsequent operation is the same as described above. That is, in the
本実施形態の演算回路70においても、隣りあう画素の演算で共通に使用される元画像の画素の画素値を画像情報記憶装置から2度読み出す必要がないという利点がある。また、本実施形態の演算回路70では、2つの積和演算器76a、76bと、2つの積和レジスタ81a、81bとが用いられている。これによって、従来の2倍の処理速度が実現されている。
The
次に、第4の実施形態の別の例として、元画像の5列×5行の25画素分の画素値を用いて畳み込み演算によるフィルタ処理を行う演算回路について説明する。 Next, as another example of the fourth embodiment, an arithmetic circuit that performs filter processing by convolution operation using pixel values of 25 pixels of 5 columns × 5 rows of the original image will be described.
図6は、本発明の演算回路の構成を表す第5の実施形態の概念図である。同図に示す演算回路100は、2次元空間に配置された元画像の5列×5行の25画素分の画素値から、畳み込み演算によるフィルタ処理を行う。演算回路100は、元画像用シフトレジスタ102と、係数用シフトレジスタ104と、前処理回路112と、後処理回路114と、カウンタ116とによって構成されている。
FIG. 6 is a conceptual diagram of the fifth embodiment showing the configuration of the arithmetic circuit of the present invention. The
以下、図6に示す演算回路100について、図5の演算回路70との違いを重点的に説明する。
Hereinafter, the difference between the
演算回路100において、元画像用シフトレジスタ102および係数用シフトレジスタ104は、図5の演算回路70の元画像用シフトレジスタ72および係数用シフトレジスタ74と同様の機能を有する。
In the
前処理回路112は、列数分の5つの積和演算器106a、106b、106c、106d、106eによって構成されている。前処理回路112も、図5の前処理回路82と同様の機能を有する。
The
また、後処理回路114は、列数分の5つの積和レジスタ111a、111b、111c、111d、111eによって構成されている。後処理回路114も、図5の演算回路70の後処理回路84と同様の機能を有する。
Further, the
カウンタ116は、初期化後、クロック信号に同期して、1サイクル毎に1〜5を繰り返しカウントする。本実施形態の場合、カウンタ116のカウント値k=1の時、係数用シフトレジスタ104から係数値C1(=C11,C21,C31,C41,C51)が出力され、全ての積和演算器106a、106b、106c、106d、106eに共通に入力される。また、カウント値k=2〜5の時に、係数値C2〜C5が、それぞれ出力される。
The
すなわち、カウンタ116のカウント値k=1〜5の時に、係数値C1〜C5についての処理がそれぞれ行われる。
That is, when the count value k of the
演算回路100の動作は、図5の演算回路70と同様である。前処理回路112では、前述のように、カウンタ116のカウント値k=1〜5の時に、それぞれ係数値C1〜C5を利用した積和演算処理が行われ、積和演算結果T1〜T5が出力される。後処理回路114では、k=1のときには、前処理回路から入力された積和演算結果T1〜T5がそのまま保持される。一方、k=2〜5のときには、前サイクルで(すなわち、それぞれk=1〜4のときに)保持された値P1’〜P5’とT1〜T5との積算値が保持される。そして、5サイクル毎に、後処理回路114から、フィルタ処理後の画像の5画素分の画素値Pが出力される。
The operation of the
同様に、図8に示す元画像の各画素の画素値が画像情報記憶装置に記憶され、図13に示す順序でフィルタ処理が順次行われる場合、演算回路100の具体的な動作は、下記表8〜10に示す通りである。
Similarly, when the pixel value of each pixel of the original image shown in FIG. 8 is stored in the image information storage device and the filter processing is sequentially performed in the order shown in FIG. 13, the specific operation of the
すなわち、演算回路100では、初期化後、5サイクルで最初のフィルタ処理後の5画素分の画素値P11〜P51が同時に出力される。これ以後、5サイクル毎に、フィルタ処理後の5画素分の画素値が同時に出力される。
That is, in the
本実施形態の演算回路100においても、隣りあう画素の演算で共通に使用される元画像の画素の画素値を画像情報記憶装置から2度読み出す必要がないという利点がある。また、本実施形態の演算回路100では、5つの積和演算器106a、106b、106c、106d、106eと、5つの積和レジスタ111a、111b、111c、111d、111eとを用いているため、従来の5倍の処理速度が実現されている。
The
なお、第4および第5の実施形態の演算回路70,100も、5列×5行に限らず、N列×N行(Nは2以上の整数)の畳み込み演算によるフィルタ処理に適用可能である。
The
第4および第5の実施形態の演算回路では、一般的に、データレジスタに2次元空間のN列×N行の範囲の1〜N列目のデータを保持する。そして、第1サイクルにおいて、N個の内のn番目(n=1〜N)の積和演算器で、N列×N行のデータレジスタのn列目に保持されたN個のデータ値と、N列×N行の1列目のN個の係数との間の積和を演算し、それぞれの演算結果を、後処理回路のn番目の積和レジスタに保持する。その後、第k(k=2〜N)サイクルにかけて順に、データレジスタに保持されたデータを−1列分シフトし、データレジスタのN列目に、2次元空間のN列×N行の範囲に列方向に隣接するN+k−1列目のデータを保持し、さらに、N個の内のn番目の積和演算器で、N列×N行のデータレジスタのn列目に保持されたN個のデータ値とN列×N行のk列目のN個の係数との間の積和を演算し、それぞれの演算結果と、前サイクルで後処理回路のn番目の積和レジスタに保持された値との積算値を、後処理回路のn番目の積和レジスタに保持する操作を繰り返す。これにより、N個の積和レジスタのそれぞれから、2次元空間のN列×N行の範囲の中心に位置する第1演算対象点、および、2次元空間の列方向に第1の演算対象点に順に隣りあう、2〜N番目の演算対象点の畳み込み演算結果が出力される。 In the arithmetic circuits of the fourth and fifth embodiments, generally, data in the 1st to Nth columns in the range of N columns × N rows in the two-dimensional space is held in the data register. Then, in the first cycle, the N data values held in the nth column of the data register of N columns × N rows are calculated by the nth (n = 1 to N) product-sum calculators out of N , N-column × N-row N-th coefficient of the first column is calculated, and each calculation result is held in the n-th product-sum register of the post-processing circuit. Thereafter, the data held in the data register is shifted by −1 column in order through the k-th (k = 2 to N) cycle, and the Nth column of the data register is shifted to the range of N columns × N rows in the two-dimensional space. N + k−1 columns of data adjacent in the column direction are held, and further, N pieces of data held in the nth column of the data register of N columns × N rows by the nth product-sum calculator. Is calculated and stored in the n-th product-sum register of the post-processing circuit in the previous cycle. The operation of holding the integrated value with the obtained value in the nth product-sum register of the post-processing circuit is repeated. Thereby, from each of the N product-sum registers, the first calculation target point located in the center of the range of N columns × N rows in the two-dimensional space, and the first calculation target point in the column direction of the two-dimensional space The results of the convolution calculation of the 2nd to Nth calculation target points that are adjacent to each other are output.
最後に、本発明の第6の実施形態について説明する。 Finally, a sixth embodiment of the present invention will be described.
図7は、本発明の演算回路の構成を表す第6の実施形態の概念図である。同図に示す演算回路120も、2次元空間に配置された元画像の5列×5行の25画素分の画素値から、畳み込み演算によるフィルタ処理を行う。図7の演算回路120は、元画像用シフトレジスタ122と、係数用シフトレジスタ124と、前処理回路132と、後処理回路134と、カウンタ136とによって構成されている。
FIG. 7 is a conceptual diagram of the sixth embodiment showing the configuration of the arithmetic circuit of the present invention. The
図7に示す演算回路120は、図6に示す演算回路100において、積和演算器の個数を減らし、図3に示す演算回路50のように、これを時系列(時分割)に使用する構成のものである。従って、カウンタ136は、図6に示す演算回路100のカウンタ116の機能と、図3に示す演算回路50のカウンタ66の機能とを併せ持つ。すなわち、後処理回路134の処理サイクルを制御するカウント値kと、前処理回路の処理のステップを制御するカウント値jとを生成する。カウント値jは、0に初期化された後、クロック信号に同期して0〜4のカウントを繰り返す。カウント値kは、1に初期化された後、カウント値jが0に戻る毎に1つずつ加算されて、1〜5のカウントを繰り返す。
The
以下、図7の演算回路120について、図6の演算回路100との違いを重点的に説明する。
Hereinafter, the difference between the
演算回路120において、元画像用シフトレジスタ122および係数用シフトレジスタ124は、図6の演算回路100の元画像用シフトレジスタ102および係数用シフトレジスタ104と同様の機能を有する。
In the
図6の演算回路100では、元画像用シフトレジスタ102から、前処理回路112の5つの積和演算器106a、106b、106c、106d、106eに対して、各々対応する各列の1画素分の画素値Li〜Li+4が同時に入力される。これに対し、図7の演算回路120では、1ステップ毎に、各列の5画素分の画素値Li+jがカウント値jの変化に従って順に、1つの積和演算器126に時系列に入力される。両者は、この点で異なっている。そして、カウント値jが0〜4に変化する過程で5ステップの処理が行われた後、カウント値jが0に戻り、次のサイクルに進むときに、処理対象となる次の1列の5画素分の画素値がシフトインされる。
In the
1つの画素の画素値を8ビットとすると、図6に示す演算回路100では、8ビット×5×5=200本の配線が必要となる。これに対し、図7に示す演算回路120では、元画像用シフトレジスタ122から出力される画素値は1列の5画素分だけであるから、同じく1つの画素値を8ビットとすると、8ビット×5=40本の配線だけしか必要がなく、配線数を1/5に削減することができる。
If the pixel value of one pixel is 8 bits, the
また、係数用シフトレジスタ124では、図6の係数用シフトレジスタ104と同様に、1サイクル毎に、すなわち、カウント値kが変化する毎に、図6中、5つの係数値C1〜C5が順次シフト(ローテーション)され、図中で最も左側の1列の5つの係数値が出力される。ただし、同一の係数値Ckの供給が、カウント値jが0〜4の間に変化する5ステップの期間継続して行われ、その後、カウント値kが変化し、次のサイクルに進む時に係数C1〜C5のシフトが行われる点で、図6の係数用シフトレジスタ104とは異なっている。
Further, in the
続いて、前処理回路62は、1つの積和演算器126によって構成されている。積和演算器126は、CkLi+jの積和演算を行い、その演算結果Tj+1を出力する。
Subsequently, the
また、後処理回路134は、列数分の5つの積和レジスタ131a、131b、131c、131d、131eによって構成されている。後処理回路134の積和レジスタ131a〜131eのそれぞれは、例えば、図5の積和レジスタ81a(または81b)の前段に、図4の一時レジスタ60a1(または60b1〜60e1)を組み合わせた構成とすることができる。この場合、図4に示した演算回路50と同様に、それぞれの積和レジスタ131a〜131eの一時レジスタには、カウント値jが対応する値である期間にクロック信号を供給する。また、2段目のフリップフロップには、カウント値jが0に戻った期間にクロック信号を供給する。
Further, the
次に、演算回路120の動作を説明する。
Next, the operation of the
演算回路120では、初期化のサイクルで、元画像用シフトレジスタ122には、1〜5列目の画素値L1〜L5が保持され、係数用レジスタ14には、5列分の係数値C1〜C5が保持される。
In the
サイクル1では、カウンタ136のカウント値j=0〜4に応じて、元画像用シフトレジスタ122から、1〜5列目の画素値L1〜L5が順次出力され、係数用シフトレジスタ124から、係数値C1(すなわち、k=1である)が出力される。
In
前処理回路132の積和演算器126では、カウンタ136のカウント値j=0〜4に応じて、1ステップ毎に、1〜5列目の画素値Li+j(=L1〜L5)と、係数値C1とから積和演算C1Li+jが行われ、その演算結果Tj+1(T1〜T5)が順次出力される。すなわち、積和演算器126では、カウント値j=0〜4に応じて、1ステップ毎に、積和演算C1L1、C1L2、C1L3、C1L4、C1L5が順次行われ、その演算結果T1〜T5が出力される。
In the sum-of-
ステップ1〜5の積和演算器126の出力T1〜T5(=C1L1、C1L2、C1L3、C1L4、C1L5)は、後処理回路134の積和レジスタ131a、131b、131c、131d、131eにそれぞれ入力され、クロックエッジのタイミングで保持される。
Outputs T1 to T5 (= C1L1, C1L2, C1L3, C1L4, C1L5) of the product-
次のサイクル2で、元画像用シフトレジスタ122に、処理対象となる次の1列の5画素分の画素値L6がシフトインされ、元画像用シフトレジスタ122には、2〜6列目の画素値L2〜L6が保持される。
In the
サイクル2におけるステップ1〜5では、カウンタ136のカウント値j=0〜4に応じて、元画像用シフトレジスタ122から、1〜5列目の画素値L2〜L6が順次出力され、係数用シフトレジスタ124から、係数値C2(すなわち、k=2である)が出力される。
In
同様に、積和演算器126では、カウンタ136のカウント値j=0〜4に応じて、1〜5列目の画素値Li+j(=L2〜L6)と、係数値C2とから積和演算C2Li+jが行われ、その演算結果Tj+1(T1〜T5)が順次出力される。すなわち、積和演算器132では、カウント値j=0〜4に応じて、1ステップ毎に、積和演算C2L2、C2L3、C2L4、C2L5、C2L6が順次行われ、その演算結果T1〜T5が出力される。
Similarly, the product-
サイクル2での積和演算器126の出力T1〜T5(=C2L2、C2L3、C2L4、C2L5、C2L6)は、それぞれサイクル1で積和レジスタ131a、131b、131c、131d、131eに保持された各々対応するP1’〜P5’(=C1L1、C1L2、C1L3、C1L4、C1L5)と加算される。そして、その加算結果が、クロックエッジのタイミングで、それぞれ積和レジスタ131a、131b、131c、131d、131eに再度保持される。
Outputs T1 to T5 (= C2L2, C2L3, C2L4, C2L5, C2L6) of the product-
すなわち、積和レジスタ131a、131b、131c、131d、131eには、それぞれC1L1+C2L2、C1L2+C2L3、C1L3+C2L4、C1L4+C2L5、C1L5+C2L6が保持される。
That is, C1L1 + C2L2, C1L2 + C2L3, C1L3 + C2L4, C1L4 + C2L5, and C1L5 + C2L6 are held in the product-
なお、前述のように、後処理回路134を、図3,4に示した演算回路50の場合のように、カウント値jが増大する過程で積和演算結果を一時レジスタに保持し、カウント値jが0に戻った期間に、そのまま、もしくは、前サイクルで保持した値と積算して、後段のフリップフロップに保持する構成とすることができる。このとき、カウント値jが0に戻るタイミングでカウント値kのカウントを進めた場合、サイクル1における積和演算結果の保持は、実際には、カウント値k=2に変化した後に行われる。また、サイクル2における積和演算結果と前のサイクルで保持した値との積算値の保持は、カウント値k=3に変化した後に行われる。従って、積和演算結果をそのまま保持するか、前のサイクルで保持した値と積算してから保持するかの制御を、図5に示した演算回路70のように、セレクタを用いて行う場合、カウント値k=2であるときには一時レジスタの出力を選択し、カウント値kが2以外であるときには加算器の出力を選択するように制御することができる。
As described above, the
以下同様にして、1サイクル毎に、元画像用シフトレジスタ122に、次の1列の5画素分の画素値がシフトインされ、係数用シフトレジスタ124から、次の係数値Ckが出力され、上記の動作が繰り返し行われる。その結果、初期化後、25サイクル毎に、フィルタ処理後の5画素分の画素値Pが同時に出力される。
In the same manner, the pixel values for the next five pixels are shifted into the original
本実施形態の演算回路120においても、隣りあう画素の演算で共通に使用される元画像の画素の画素値を画像情報記憶装置から2度読み出す必要がないという利点がある。また、演算回路120では、5つではなく、1つの積和演算器126だけを用いることによって、その処理速度は、従来の1/5倍となるが、処理速度が要求されない用途であれば、回路規模を削減することができるという利点がある。もちろん、図3の演算回路50のように、前処理回路132に複数の積和演算器を設け、5列の画素値を利用した積和演算結果T1〜T5を、列数(5)未満の繰り返し回数で得ることも可能である。これによって、処理速度と回路規模とのバランスをはかることが可能である。
The
なお、本実施形態の演算回路120では、積和演算器126に画素値をLiからLi+4の順序で入力しているが、これに限らず、画素値はどのような順序で入力しても良い。また、後処理回路134において、積和演算結果T1〜T4をそのまま保持するか、前のサイクルで保持した値P1’〜P5’と積和演算結果T1〜T5との積算値を保持するかの制御を、セレクタを用いて行うことは必須ではない。例えば、積和レジスタを構成するフリップフロップに加算器の出力を直接接続した構成とした場合であっても、フリップフロップからのフィルタ処理後の画素値Pの出力を終えた後に、次の画素についての積和演算結果T1〜T5の一時レジスタへの保持を行っている期間に、フリップフロップの初期化を行い、保持値P1〜P5を0とする処理を行うことが可能である。
In the
また、本実施形態の演算回路は、5列×5行に限らず、N列×N行(Nは2以上の整数)の畳み込み演算によるフィルタ処理に適用可能である。この場合、積和演算器の個数mは、1≦m<Nとする。 In addition, the arithmetic circuit according to the present embodiment is not limited to 5 columns × 5 rows, and can be applied to filter processing based on N columns × N rows (N is an integer of 2 or more). In this case, the number m of product-sum calculators is 1 ≦ m <N.
本実施形態の演算回路では、一般的に、データレジスタに2次元空間内のN列×N行の範囲の1〜N列目のデータを保持する。第1サイクルにおいて、前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、N列×N行のデータレジスタのいずれかの列に保持されたN個のデータ値と、N列×N行の1列目のN個の係数との間の積和を演算する操作を繰り返して行うことにより、データレジスタの全ての列に保持されたデータ値と1列目の係数との間の積和の演算を行う。そして、積和演算器が演算した、データレジスタのn列目(n=1〜N)に保持されたデータ値と1列目の係数との間の積和演算結果を、前処理回路のn番目の積和レジスタに保持する。その後、第k(k=2〜N)サイクルにかけて順に、データレジスタに保持されたデータを列方向に−1シフトし、データレジスタのN列目に、2次元空間のN列×N行の範囲に列方向に隣接するN+k−1列目のデータを保持し、前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、N列×N行のデータレジスタのいずれかの列に保持されたN個のデータ値と、N列×N行のk列目のN個の係数との間の積和を演算する操作を、繰り返して行うことにより、データレジスタの全ての列に保持されたデータ値とk列目の係数との間の積和の演算を行う。続いて、積和演算器が演算した、データレジスタのn列目に保持されたデータ値とk列目の係数との間の積和演算結果と、前サイクルで後処理回路のn番目の積和レジスタに保持された値との積算値を、後処理回路のn番目の積和レジスタに保持する操作を繰り返す。これにより、N個の積和レジスタのそれぞれから、2次元空間のN列×N行の範囲の中心に位置する第1の演算対象点、および、2次元空間の列方向に第1の演算対象点に順に隣りあう、2〜N番目の演算対象点の畳み込み演算結果が出力される。 In the arithmetic circuit of this embodiment, generally, data in the 1st to Nth columns in the range of N columns × N rows in the two-dimensional space is held in the data register. In the first cycle, N data values held in any column of N columns × N rows of data registers in each of at least some of the m product-sum calculators of the preprocessing circuit, and N columns X By repeating the operation of calculating the sum of products with the N coefficients in the first column of N rows, the data values held in all the columns of the data register and the coefficients in the first column Perform product-sum operation. Then, the product-sum operation result between the data value held in the n-th column (n = 1 to N) of the data register and the coefficient in the first column, which is calculated by the product-sum calculator, is expressed as n in the preprocessing circuit. Hold in the th product-sum register. Thereafter, the data held in the data register is sequentially shifted by −1 in the column direction over the kth (k = 2 to N) cycle, and the range of N columns × N rows in the two-dimensional space is shifted to the Nth column of the data register. N + k−1 columns of data adjacent to each other in the column direction are held in at least one part of the m product-sum calculators of the pre-processing circuit, and stored in any column of N columns × N rows of data registers. By repeatedly performing the operation of calculating the sum of products between the held N data values and the N coefficients of the N columns × N rows and the kth column, the data values are held in all the columns of the data register. The product-sum operation is performed between the obtained data value and the coefficient in the k-th column. Subsequently, the product-sum operation result between the data value held in the nth column of the data register and the coefficient in the kth column calculated by the product-sum calculator and the nth product of the post-processing circuit in the previous cycle The operation of holding the integrated value with the value held in the sum register in the nth product-sum register of the post-processing circuit is repeated. Thereby, from each of the N product-sum registers, the first calculation target point located in the center of the range of N columns × N rows in the two-dimensional space, and the first calculation target in the column direction of the two-dimensional space A convolution calculation result of the 2nd to Nth calculation target points that are adjacent to the point in order is output.
なお、本発明において、データレジスタは、記憶装置(例えば、元画像用レジスタは、画像情報記憶装置)から、ラインメモリやFIFOなどのバッファを介してデータを読み込む構成としても良い。また、前処理回路は、積和演算器以外の構成要素を含んでいても良いし、後処理回路は、積和レジスタ以外の構成要素を含んでいても良い。また、積和演算器や積和レジスタの具体的な構成も何ら限定されず、同様の機能を果たす各種構成のものが使用可能である。 In the present invention, the data register may be configured to read data from a storage device (for example, the original image register is an image information storage device) via a buffer such as a line memory or FIFO. The preprocessing circuit may include components other than the product-sum operation unit, and the post-processing circuit may include components other than the product-sum register. Further, the specific configurations of the product-sum operation unit and the product-sum register are not limited at all, and various configurations having the same functions can be used.
本発明は、基本的に以上のようなものである。
以上、本発明の演算回路および演算方法について詳細に説明したが、本発明は上記実施形態に限定されず、本発明の主旨を逸脱しない範囲において、種々の改良や変更をしてもよいのはもちろんである。
The present invention is basically as described above.
Although the arithmetic circuit and the arithmetic method of the present invention have been described in detail above, the present invention is not limited to the above-described embodiments, and various improvements and modifications may be made without departing from the gist of the present invention. Of course.
10,30,50,70,100,120,140 演算回路
12,32,52,102,142 元画像用レジスタ
14,34,54,104 係数用レジスタ
22,42,62,82,112,132 前処理回路
24,44,64,84,114,134 後処理回路
16a、16b、36a、36b、36c、36d、36e、56a、56b、76a、76b、106a、106b、106c、106d、106e、126,146 積和演算器
21a、21b、41a、41b、41c、41d、41e、61a、61b、61c、61d、61e、81a、81b、111a、111b、111c、111d、111e、131a、131b、131c、131d、131e 積和レジスタ
66,116,136,156 カウンタ
60a1,60a2,60b1,60b2,60c1,60c2,60d1,60d2,60e1,60e2、80a、80b、80c、80d、80e、150a、150b フリップフロップ
58b、58c、58d、58e、78a、78b、78c、78d、78e、148,162 加算器
72,122 元画像用シフトレジスタ
74,124,144 係数用シフトレジスタ
79a、79b セレクタ
86 カウンタ
141 画像情報記憶装置
145,149 マルチプレクサ(MUX)
154 中間結果レジスタ
160a、160b 乗算器
10, 30, 50, 70, 100, 120, 140
154
Claims (5)
N列×N行(Nは3以上の整数)の係数を保持する係数用レジスタと、
N個のデータ値を保持するデータレジスタと、
m個(2≦m<N)の積和演算器を備えた前処理回路と、
1〜N番目の積和レジスタを備えた後処理回路とを有し、
初期化サイクルにおいて前記1〜N番目の内の1〜N−1番目の積和レジスタを初期化し、
その後、1〜Nサイクルにかけて順に、前記2次元空間のN列×N行の範囲の1〜N列目のデータ値を前記データレジスタに保持し、
各サイクル毎に、
前記前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、前記N個のデータ値と、前記N列×N行のいずれかの列のN個の係数との間の積和を演算する操作を、N回未満繰り返して行うことにより前記N個のデータ値と全ての列の係数との間の積和の演算を行い、
前記積和演算器が演算した、前記N個のデータ値と前記1列目のN個の係数との間の積和演算結果を前記後処理回路の1番目の積和レジスタに保持するとともに、前記N個のデータ値と前記n列目(n=2〜N)の係数との間の積和演算結果と、前サイクルで前記後処理回路のn−1番目の積和レジスタに保持した値との積算値を、該後処理回路のn番目の積和レジスタに保持することにより、
前記N番目の積和レジスタから、前記2次元空間の前記N列×N行の範囲の中心に位置する第1の演算対象点の畳み込み演算結果を出力することを特徴とする演算回路。 An arithmetic circuit that performs a convolution operation of data arranged in a two-dimensional space,
A coefficient register for storing coefficients of N columns × N rows (N is an integer of 3 or more);
A data register holding N data values;
a pre-processing circuit including m (2 ≦ m <N) product-sum calculators;
And a post-processing circuit including 1st to Nth product-sum registers,
Initialize the 1-N-1 product-sum registers of the 1-Nth in the initialization cycle,
After that, in the order of 1 to N cycles, the data value of the 1st to Nth columns in the range of N columns × N rows of the two-dimensional space is held in the data register,
For each cycle,
In each of at least some of the m product-sum calculators of the preprocessing circuit, the product-sum between the N data values and the N coefficients of any column of the N columns × N rows. By calculating the product sum between the N data values and the coefficients of all the columns by repeating the operation of calculating N times less than N times,
A product-sum operation result between the N data values and the N coefficients in the first column calculated by the product-sum calculator is held in a first product-sum register of the post-processing circuit, and The product-sum operation result between the N data values and the coefficients of the n-th column (n = 2 to N), and the value held in the n−1th product-sum register of the post-processing circuit in the previous cycle Is held in the n-th product-sum register of the post-processing circuit,
An arithmetic circuit that outputs a convolution calculation result of a first calculation target point located in the center of the range of N columns × N rows in the two-dimensional space from the Nth product-sum register.
前記各サイクル毎に、前記積和演算器が演算した、前記データ値と前記1〜N列目の係数との間の積和演算結果のそれぞれを前記1〜N番目の一時レジスタに保持した後に、該一時レジスタのn番目に保持した積和演算結果と前記前サイクルでn−1番目の積和レジスタに保持された値との積算値を、前記n番目の積和レジスタに保持することを特徴とする請求項1記載の演算回路。 The post-processing circuit further includes a 1-Nth temporary register provided corresponding to each of the 1-Nth product-sum registers;
After each product-sum operation result calculated by the product-sum operation unit between the data value and the coefficients in the 1st to Nth columns is held in the 1st to Nth temporary registers for each cycle. The accumulated value of the n-th product-sum operation result held in the temporary register and the value held in the (n-1) -th product-sum register in the previous cycle is held in the n-th product-sum register. The arithmetic circuit according to claim 1 , wherein:
N列×N行(Nは2以上の整数)の係数を保持する係数用レジスタと、
N列×N行のデータレジスタと、
N個の積和演算器を備えた前処理回路と、
N個の積和レジスタを備えた後処理回路とを有し、
前記データレジスタに前記2次元空間のN列×N行の範囲の1〜N列目のデータを保持し、
第1サイクルにおいて、前記N個の内のn番目(n=1〜N)の積和演算器で、前記N列×N行のデータレジスタのn列目に保持されたN個のデータ値と前記N列×N行の1列目のN個の係数との間の積和を演算し、それぞれの演算結果を、前記後処理回路のn番目の積和レジスタに保持し、
その後、第k(k=2〜N)サイクルにかけて順に、
前記データレジスタに保持されたデータを−1列分シフトし、該データレジスタのN列目に、前記2次元空間のN列×N行の範囲に列方向に隣接するN+k−1列目のデータを保持し、
前記n番目の積和演算器で、前記N列×N行のデータレジスタのn列目に保持されたN個のデータ値と前記N列×N行のk列目のN個の係数との間の積和を演算し、それぞれの演算結果と、前サイクルで前記後処理回路のn番目の積和レジスタに保持された値との積算値を、前記後処理回路のn番目の積和レジスタに保持する操作を繰り返すことにより、
前記N個の積和レジスタのそれぞれから、前記2次元空間のN列×N行の範囲の中心に位置する第1演算対象点、および、該2次元空間の列方向に前記第1の演算対象点に順に隣りあう、2〜N番目の演算対象点の畳み込み演算結果を出力することを特徴とする演算回路。 An arithmetic circuit that performs a convolution operation of data arranged in a two-dimensional space,
A coefficient register for holding coefficients of N columns × N rows (N is an integer of 2 or more);
N columns x N rows of data registers;
A preprocessing circuit having N product-sum calculators;
A post-processing circuit having N product-sum registers,
The data register holds the data of the 1st to Nth columns in the range of N columns × N rows of the two-dimensional space,
In the first cycle, the N data values held in the nth column of the data register of N columns × N rows in the nth (n = 1 to N) product-sum operation unit Calculate the sum of products with the N coefficients in the first column of the N columns × N rows, and store the respective operation results in the n th product sum register of the post-processing circuit,
Then, in order through the kth (k = 2 to N) cycle,
The data held in the data register is shifted by −1 column, and the N + k−1 column data adjacent to the N column × N row of the two-dimensional space in the column direction is shifted to the N column of the data register. Hold
In the nth product-sum operation unit, N data values held in the nth column of the N column × N row data register and N coefficients in the N column × N row k column The sum of the results of each operation and the value held in the nth product-sum register of the post-processing circuit in the previous cycle is calculated as the n-th product-sum register of the post-processing circuit. By repeating the operation to hold
From each of the N product-sum registers, a first calculation target point located in the center of a range of N columns × N rows of the two-dimensional space, and the first calculation target in the column direction of the two-dimensional space An arithmetic circuit which outputs a convolution operation result of the 2nd to Nth operation target points adjacent to each other in order.
N個の積和演算器を備えた前処理回路と、
N個の積和レジスタを備えた後処理回路とを用意し、
第1サイクルにおいて、前記2次元空間のN列×N行の範囲のデータ値と、前記N列×N行の第1列のN個の係数とを前記前処理回路に供給し、前記N個の内のn番目(n=1〜N)の積和演算器で、前記2次元空間のn列目のN個のデータ値と前記N個の係数との間の積和を演算し、その演算結果を、前記後処理回路のn番目の積和レジスタに保持し、
その後、第k(k=2〜N)サイクルにかけて順に、
前記2次元空間のN列×N行のk列目から、該N列×N行の範囲に列方向に隣接する、N+k−1列目までのデータ値と、前記N列×N行の内のk列目のN個の係数とを前記前処理回路に供給し、前記n番目の積和演算器で、前記2次元空間の(N+k−1)列目のN個のデータ値と前記N個の係数との間の積和を演算し、それぞれの演算結果と、前サイクルで前記後処理回路のn番目の積和レジスタに保持された値との積算値を、前記後処理回路のn番目の積和レジスタに保持する操作を繰り返すことにより、
前記N個の積和レジスタのそれぞれから、前記2次元空間のN列×N行の範囲の中心に位置する第1演算対象点、および、該2次元空間の列方向に前記第1の演算対象点に順に隣りあう、2〜N番目の演算対象点の畳み込み演算結果を出力することを特徴とする演算方法。 An arithmetic method for performing a convolution operation between data arranged in a two-dimensional space and coefficients of N columns × N rows (N is an integer of 2 or more),
A preprocessing circuit having N product-sum calculators;
Prepare a post-processing circuit with N product-sum registers,
In the first cycle, a data value in a range of N columns × N rows of the two-dimensional space and N coefficients of the first column of N columns × N rows are supplied to the preprocessing circuit, and the N pieces The product-sum calculator between the N data values in the n-th column of the two-dimensional space and the N coefficients is calculated by an nth (n = 1 to N) product-sum calculator The operation result is held in the nth product-sum register of the post-processing circuit,
Then, in order through the kth (k = 2 to N) cycle,
The data values from the Nth column × Nth row kth column to the N + k−1th column adjacent to the Nth column × Nth row in the column direction, and the Nth column × Nth row N coefficients in the k-th column are supplied to the pre-processing circuit, and the N-th product-sum calculator calculates the N data values in the (N + k−1) -th column in the two-dimensional space and the N The sum of products between the coefficients is calculated, and an integrated value of each operation result and the value held in the nth product-sum register of the post-processing circuit in the previous cycle is calculated as n of the post-processing circuit. By repeating the operation held in the th product-sum register,
From each of the N product-sum registers, a first calculation target point located in the center of a range of N columns × N rows of the two-dimensional space, and the first calculation target in the column direction of the two-dimensional space A calculation method that outputs a convolution calculation result of the 2nd to Nth calculation target points that are adjacent to each other in order.
N列×N行(Nは2以上の整数)の係数を保持する係数用レジスタと、
N列×N行のデータレジスタと、
m個(m<N)の積和演算器を備えた前処理回路と、
N個の積和レジスタを備えた後処理回路とを有し、
前記データレジスタに前記2次元空間内のN列×N行の範囲の1〜N列目のデータを保持し、
第1サイクルにおいて、
前記前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、前記N列×N行のデータレジスタのいずれかの列に保持されたN個のデータ値と、前記N列×N行の1列目のN個の係数との間の積和を演算する操作を繰り返して行うことにより、前記データレジスタの全ての列に保持されたデータ値と前記1列目の係数との間の積和の演算を行い、
前記積和演算器が演算した、前記データレジスタのn列目(n=1〜N)に保持されたデータ値と前記1列目の係数との間の積和演算結果を、前記前処理回路のn番目の積和レジスタに保持し、
その後、第k(k=2〜N)サイクルにかけて順に、
前記データレジスタに保持されたデータを列方向に−1シフトし、該データレジスタのN列目に、前記2次元空間のN列×N行の範囲に列方向に隣接するN+k−1列目のデータを保持し、
前記前処理回路のm個の積和演算器の少なくとも一部のそれぞれで、前記N列×N行のデータレジスタのいずれかの列に保持されたN個のデータ値と、前記N列×N行のk列目のN個の係数との間の積和を演算する操作を、繰り返して行うことにより、前記データレジスタの全ての列に保持されたデータ値と前記k列目の係数との間の積和の演算を行い、
前記積和演算器が演算した、前記データレジスタのn列目に保持されたデータ値と前記k列目の係数との間の積和演算結果と、前サイクルで前記後処理回路のn番目の積和レジスタに保持された値との積算値を、該後処理回路のn番目の積和レジスタに保持する操作を繰り返すことにより、
前記N個の積和レジスタのそれぞれから、前記2次元空間のN列×N行の範囲の中心に位置する第1の演算対象点、および、該2次元空間の列方向に前記第1の演算対象点に順に隣りあう、2〜N番目の演算対象点の畳み込み演算結果を出力することを特徴とする演算回路。 An arithmetic circuit that performs a convolution operation of data arranged in a two-dimensional space,
A coefficient register for holding coefficients of N columns × N rows (N is an integer of 2 or more);
N columns x N rows of data registers;
a pre-processing circuit including m (m <N) product-sum calculators;
A post-processing circuit having N product-sum registers,
The data register holds data in the 1st to Nth columns in the range of N columns × N rows in the two-dimensional space,
In the first cycle,
In each of at least some of the m product-sum calculators of the preprocessing circuit, N data values held in any column of the N columns × N rows of data registers, and the N columns × N By repeating the operation of calculating the product sum between the N coefficients in the first column of the row, the data values held in all the columns of the data register and the coefficients in the first column are The sum of products of
The pre-processing circuit calculates the product-sum operation result between the data value held in the n-th column (n = 1 to N) of the data register and the coefficient in the first column, which is calculated by the product-sum calculator. In the nth sum of products register
Then, in order through the kth (k = 2 to N) cycle,
The data held in the data register is shifted by −1 in the column direction, and the N + k−1th column adjacent to the N column × N row in the two-dimensional space in the column direction is shifted to the Nth column of the data register. Keep the data,
In each of at least some of the m product-sum calculators of the preprocessing circuit, N data values held in any column of the N columns × N rows of data registers, and the N columns × N By repeatedly performing the operation of calculating the sum of products between the N coefficients in the k-th column of the row, the data values held in all the columns of the data register and the coefficients in the k-th column are calculated. Perform product-sum operation between
The product-sum operation result between the data value held in the n-th column of the data register and the coefficient in the k-th column, calculated by the product-sum calculator, and the nth of the post-processing circuit in the previous cycle By repeating the operation of holding the integrated value with the value held in the product-sum register in the nth product-sum register of the post-processing circuit,
From each of the N product-sum registers, a first calculation target point located at the center of a range of N columns × N rows of the two-dimensional space, and the first calculation in the column direction of the two-dimensional space An arithmetic circuit which outputs a convolution calculation result of the 2nd to Nth calculation target points adjacent to the target point in order.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006057810A JP4833690B2 (en) | 2006-03-03 | 2006-03-03 | Arithmetic circuit and arithmetic method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006057810A JP4833690B2 (en) | 2006-03-03 | 2006-03-03 | Arithmetic circuit and arithmetic method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2007233934A JP2007233934A (en) | 2007-09-13 |
JP4833690B2 true JP4833690B2 (en) | 2011-12-07 |
Family
ID=38554428
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006057810A Expired - Fee Related JP4833690B2 (en) | 2006-03-03 | 2006-03-03 | Arithmetic circuit and arithmetic method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4833690B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018067154A (en) * | 2016-10-19 | 2018-04-26 | ソニーセミコンダクタソリューションズ株式会社 | Arithmetic processing circuit and recognition system |
WO2021000285A1 (en) * | 2019-07-03 | 2021-01-07 | 华为技术有限公司 | Data processing system and method, encoding unit, processing engine, and storage medium |
CN111340208B (en) * | 2020-03-04 | 2023-05-23 | 开放智能机器(上海)有限公司 | Vectorization calculation depth convolution calculation method and device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS51141536A (en) * | 1975-05-31 | 1976-12-06 | Toshiba Corp | Image-paralleling calculation processing device |
JPS63219082A (en) * | 1987-10-23 | 1988-09-12 | Hitachi Ltd | Parallel image processor |
JP2001222712A (en) * | 2000-02-08 | 2001-08-17 | Sega Corp | Image processor, convolutional integration circuit and method therefor |
-
2006
- 2006-03-03 JP JP2006057810A patent/JP4833690B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2007233934A (en) | 2007-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5297069A (en) | Finite impulse response filter | |
JPS62286307A (en) | Apparatus and method for multiplication and addition of multiple stage digital signal | |
JP4833690B2 (en) | Arithmetic circuit and arithmetic method | |
JP2002158561A (en) | Fir filter, and data processing method therefor | |
JP3584027B2 (en) | Digital filter | |
US5886912A (en) | Processing elements connected in cascade having a controllable bypass | |
EP0988699A2 (en) | Sharing resources in a digital filter | |
JP4630056B2 (en) | Convolution arithmetic circuit | |
US5812866A (en) | Parallel processor with controllable relation between input and output data | |
JP4586114B1 (en) | Product-sum operation unit | |
JPH0998069A (en) | Fir type digital filter | |
JP2001160736A (en) | Digital filter circuit | |
CN116781041B (en) | Multi-rate conversion filter with high resource utilization rate | |
JP2000124773A (en) | Digital filter | |
JP2002300597A (en) | Digital filtering device | |
US5933545A (en) | Device for the decimation of digital data sequences | |
JPH1127563A (en) | Image filter circuit | |
JP5535101B2 (en) | Image processing apparatus and image forming apparatus | |
JPH05283979A (en) | Fir type filter | |
JP2009140040A (en) | Data processor | |
JP2010011493A (en) | Digital filter | |
JP3104001B2 (en) | Line buffer and image processing apparatus using the same | |
JPH0535865A (en) | Filter | |
JP2003076986A (en) | Data aligning circuit | |
JP5493646B2 (en) | Discrete Fourier transform apparatus and discrete Fourier transform / discrete inverse Fourier transform method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080724 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110131 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110215 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110415 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110920 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110922 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4833690 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140930 Year of fee payment: 3 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |