[go: up one dir, main page]

JPH11149554A - Simd calculation of filter based on 3x3 grid rank - Google Patents

Simd calculation of filter based on 3x3 grid rank

Info

Publication number
JPH11149554A
JPH11149554A JP25044398A JP25044398A JPH11149554A JP H11149554 A JPH11149554 A JP H11149554A JP 25044398 A JP25044398 A JP 25044398A JP 25044398 A JP25044398 A JP 25044398A JP H11149554 A JPH11149554 A JP H11149554A
Authority
JP
Japan
Prior art keywords
row
calculating
rows
minimum
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.)
Pending
Application number
JP25044398A
Other languages
Japanese (ja)
Inventor
Korute Puriyadashan
プリヤダシャン・コルテ
W Su Uen
ウェン・ダブリュー・ス
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Motorola Solutions Inc
Original Assignee
Motorola Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Motorola Inc filed Critical Motorola Inc
Publication of JPH11149554A publication Critical patent/JPH11149554A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To execute a filter processing in a graphic picture so as to remove a picture omission or shot noise while preserving whole picture quality by including a step, etc., for calculating a center filter value after calculating a center value from an aggregation consisting of a max. intermediate value, a min. intermediate value and a center intermediate value. SOLUTION: In the step 130, a min. intermediate row is calculated through the use of three columns and respective elements in the min. intermediate row are calculated so as to be equal to a min. element in the corresponding column. In the step 140, a max. value is calculated from a class of entries consisting of the min. intermediate column so that the max. intermediate value is calculated. In the step 150, the center value is calculated from a class of entries consisting of a center intermediate row so that the center intermediate value is calculated. In the step 160, the min. value is calculated from a class of entries consisting of the max. intermediate row so that the min. intermediate value. In the step 170, the center value is calculated from the aggregation consisting of the max. intermediate value, the min. intermediate value and the center intermediate value so that the center filter value is calculated.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、一般的に、グラフ
ィカル・フィルタに関し、更に特定すれば、3x3グリ
ッドに組織化された9要素のためにランクに基づくフィ
ルタ計算を行う効率的なSIMD方法および装置に関す
るものである。
FIELD OF THE INVENTION The present invention relates generally to graphical filters, and more particularly to an efficient SIMD method for rank-based filter computation for nine elements organized in a 3x3 grid. It concerns the device.

【0002】[0002]

【従来の技術】コンピュータが増々高速化されるに連れ
て、コンピュータ・ユーザは一層進んだアプリケーショ
ンの使用が可能となり、そのために、彼らのコンピュー
タに対する高速化の要求が更に高まることになる。今日
最も重要な応用分野の1つはグラフィックスである。
2. Description of the Related Art As computers become faster and faster, computer users can use more advanced applications, thereby increasing the demand for higher speeds on their computers. One of the most important application areas today is graphics.

【0003】グラフィックスでは、二次元ラスタ画像の
フィルタ処理を必要とする場合が多い。「ショット」ノ
イズ,画素の欠落,および単一画素範囲のその他の疑似
フィーチャ(spurious features) を除去しつつ、全体と
しての画質を保存するために用いられる非線形フィルタ
の1つに、各入力画素を、それ自体および周囲の8つの
入力画素値の中央値で置換するというものがある。
[0003] Graphics often require filtering of two-dimensional raster images. Each input pixel is one of the non-linear filters used to preserve overall image quality while eliminating "shot" noise, missing pixels, and other spurious features in a single pixel range. , Itself and the median of the eight surrounding input pixel values.

【0004】[0004]

【発明が解決しようとする課題】9つの要素の中央値を
求める一例が、Andrew S. Glassner編集のGraphics Gem
s 、第171ないし175ページ(著作権1990年、
Academic Press, Inc.,Harcourt Brace Jananovich, Pu
blishers, ISBN 0-12-286165-5 )に示されている。こ
のアルゴリズムの実際のコードは、第711ないし71
2ページに示されている。このアルゴリズムは、余りに
多くの比較演算を実行しなければならないという欠点が
ある。
An example of finding the median of the nine elements is Graphic Gem, edited by Andrew S. Glassner.
s, pages 171 to 175 (copyright 1990,
Academic Press, Inc., Harcourt Brace Jananovich, Pu
blishers, ISBN 0-12-286165-5). The actual code of this algorithm is
It is shown on page 2. This algorithm has the disadvantage that too many comparison operations have to be performed.

【0005】9つの要素の中央値を判定する方法が、"R
ank Order Filter" と題するMaashiro Kohne, et al.の
米国特許番号第5,532,948号に開示されている
が、この方法は、9つの要素においてある値を比較し、
中央値を判定するために実行すべき演算を決定するの
で、制御の流れが自由でない(control-flow-free) 。対
照的に、本特許明細書に開示する方法は、制御の流れが
自由な方法を用いて9つの数値の中央値を判定する。何
故なら、実行すべき演算が9つの数値に依存しないから
である。制御の流れが自由な方法の利点は、単一命令多
数データ(SIMD:Single Instruction Multiple Da
ta)プロセッサにそれを実装すると、同じSIMDプロ
セッサ上に制御の流れが自由でない方法を実装する場合
よりも、プロセッサの並列性を効率的に利用できる点に
ある。
A method for determining the median value of nine elements is "R
No. 5,532,948 to Maashiro Kohne, et al., entitled "ank Order Filter," which compares certain values in nine elements,
Since the operation to be performed to determine the median is determined, the control flow is not free (control-flow-free). In contrast, the method disclosed in this patent determines the median of the nine numbers using a free-flowing control method. This is because the operation to be performed does not depend on the nine numerical values. The advantage of the method in which the control flow is free is that a single instruction multiple data (SIMD) is used.
ta) Implementing it in a processor allows more efficient use of the parallelism of the processor than implementing a non-flexible control flow method on the same SIMD processor.

【0006】制御の流れが自由なアルゴリズムを用いて
9つの要素を完全にソートする方法が、Donald E.Knuth
によるThe Art of Computer Programming,第3巻(著作
権1973年、Addison-Wesley Publishing Company, I
SBN 0-201-03803-X )の第228ページに示されてい
る。本特許明細書に開示する3x3グリッド内の9つの
数値を完全にソートする方法は、隣接する重複3x3グ
リッド間で共有される行および列を利用して、比較演算
の総数を減少させることによって、従来技術の改善を図
るものである。
[0006] A method of completely sorting the nine elements using a free-flowing algorithm is described by Donald E. Knuth.
The Art of Computer Programming, Volume 3 (Copyright 1973, Addison-Wesley Publishing Company, I
SBN 0-201-03803-X) on page 228. The method of completely sorting the nine numbers in a 3x3 grid disclosed in this patent specification utilizes the rows and columns shared between adjacent overlapping 3x3 grids to reduce the total number of comparison operations, It is intended to improve the prior art.

【0007】本発明の特徴および利点は、添付図面に関
連付けた以下の詳細の説明から、一層明らかに理解され
よう。尚、図面では、同様の番号は同様の部分および対
応する部分を示す。
[0007] The features and advantages of the present invention will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. In the drawings, like numbers indicate like parts and corresponding parts.

【0008】[0008]

【発明の実施の形態】これより、従来技術によって必要
とされるよりも必要な比較演算を大幅に減らし、並列ベ
クトル演算に適した、9つの数値の中央値を求める最適
化された方法を開示する。この最適化された中央値の計
算は、更に、隣接するグリッド,第1の共有行,そして
更に列のための演算を組み合わせることによって拡張
し、一層の処理能力改善が得られる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An optimized method for finding the median of nine numbers, which is significantly less required for comparison operations than required by the prior art and is suitable for parallel vector operations, is disclosed. I do. The calculation of this optimized median is further extended by combining operations for adjacent grids, first shared rows, and further columns, resulting in further performance improvements.

【0009】図1は、画像スキャナ,デジタル・カメ
ラ,コピー機,レーザ・プリンタ,ビデオ・モニタ,お
よびFAX機械によって受信されるような、二次元ラス
タ画像を示す図である。ラスタ画像は、二次元(2D)
マトリクス100として表現され、マトリクス内の各セ
ルが、当該ラスタ画像内の1つの画素を表す。標準と同
様に、列とは垂直方向に配列されたマトリクス・セルの
集合のことであり、一方行とは水平方向に配列されたマ
トリクス・セルの集合のことである。
FIG. 1 is a diagram illustrating a two-dimensional raster image as received by an image scanner, digital camera, copier, laser printer, video monitor, and fax machine. Raster images are two-dimensional (2D)
Expressed as a matrix 100, each cell in the matrix represents one pixel in the raster image. As in the standard, a column is a set of matrix cells arranged in a vertical direction, while a row is a set of matrix cells arranged in a horizontal direction.

【0010】先に注記したように、非線形フィルタの一
種に、各ラスタ画素を、それ自体および8つの周囲の画
素の中央値と置換するというものがある。これを「メデ
ィアン」フィルタ(median filter) と呼ぶ。図2は、か
かる中央値を計算するために用いられる画素の3x3マ
トリクス110を示す図である。3x3マトリクス11
0は、3つの行1,2,3を含み、かかる行の各々が3
つの要素即ち画素を含み、3つの連続的に付番された
(1,2,3)列も、同様に、各々が3つの要素即ち画
素を含んでいる。
As noted above, one type of non-linear filter is to replace each raster pixel with the median of itself and eight surrounding pixels. This is called a "median filter". FIG. 2 is a diagram showing a 3 × 3 matrix 110 of pixels used to calculate such a median. 3x3 matrix 11
0 includes three rows 1, 2, 3, where each such row is 3
The three consecutively numbered (1,2,3) columns that contain three elements or pixels similarly contain three elements or pixels each.

【0011】図3は、3x3マトリクスに組織化された
9つの数値の中央値を求める方法を示すフローチャート
である。ステップ120から開始し、ステップ130に
おいて第2の3x3マトリクスを形成する。その第1行
(行A)は、3つの列の各々からの最小値を含み、その
第2の行(行B)は3つの列の各々からの中央値を含
み、その第3行(行C)は3つの列の各々からの最大値
を含む。次に、3−エントリ・ベクトル(M)を形成す
る。ステップ140において、このベクトルにおける第
1要素を、第1行(行A)の最大要素とし、ステップ1
50において、第2の要素を、第2行(行B)の中央要
素とし、ステップ160において、第3要素を、第3行
(行C)の最小要素とする。最後に、ステップ170に
おいて、3x3グリッドに組織化された9つの数値の中
央値を計算し、3−エントリ・ベクトル(M)の中央値
とする。
FIG. 3 is a flowchart showing a method for determining the median of nine numerical values organized in a 3 × 3 matrix. Beginning at step 120, at step 130 a second 3x3 matrix is formed. The first row (row A) contains the minimum from each of the three columns, the second row (row B) contains the median from each of the three columns, and the third row (row A). C) contains the maximum from each of the three columns. Next, a 3-entry vector (M) is formed. In step 140, the first element in this vector is set as the largest element in the first row (row A), and
At 50, the second element is the center element of the second row (row B), and at step 160, the third element is the smallest element of the third row (row C). Finally, in step 170, the median of the nine numbers organized in a 3x3 grid is calculated and taken as the median of the 3-entry vector (M).

【0012】尚、ステップ130,140,150,1
60は、3つのオペランドの最小値,中央値,および最
大値演算を示すことを注記しておく。これは、先に開示
した方法を例示する目的のみのために用いたもので、実
際の方法の簡略化であることは明らかである。即ち、こ
れらのステップでは、最初に第1中間最小値を計算して
第1オペランドおよび第2オペランドの最小値とし、次
いで第1中間中央値を計算して第1オペランドおよび第
2オペランドの最大値とし、次いで第2中間中央値を計
算して第1中間中央値および第3オペランドの最小値と
し、次いで3つのオペランドの最大値を計算して第1中
間中央値および第3オペランドの最大値とし、次いで3
オペランド最小値を計算して第1中間最小値および第2
中間中央値の最小値とし、最後に3オペランド中央値を
計算して第1中間最小値および第2中間中央値の最大値
とする。文中で別の意味であることを示さない限り、3
つのオペランドの最小値,中央値,最大値計算が本明細
書において示される場合はいつでも、前述の実施態様を
意図することとする。
Steps 130, 140, 150, 1
Note that 60 indicates the minimum, median, and maximum operations of the three operands. This is used only for the purpose of illustrating the method disclosed above and is obviously a simplification of the actual method. That is, in these steps, first the first intermediate minimum is calculated to be the minimum of the first and second operands, and then the first intermediate median is calculated to obtain the maximum of the first and second operands. And then calculate the second intermediate median to be the minimum of the first intermediate median and the third operand, and then calculate the maximum of the three operands to be the maximum of the first intermediate median and the third operand. , Then 3
Calculate the operand minimum to determine the first intermediate minimum and the second
The median value is set to the minimum value, and finally the median value of the three operands is calculated to be the maximum value of the first and second median values. 3 unless indicated otherwise in the sentence
Whenever a minimum, median, or maximum value calculation for one operand is indicated herein, the foregoing embodiment is intended.

【0013】図4は、図3に示した方法を利用して、9
つの数値の中央値を求める一例を示す図である。元の3
x3グリッド200は、その列の各々がソートされてい
る(210)。次に、第1行(A)の最大要素,第2行
(B)の中央要素,および第3行(C)の最小要素か
ら、ベクトル220を形成する。このベクトル220か
らの中央値を、9つの数値の中央値230とする。
FIG. 4 shows an example of the method shown in FIG.
It is a figure showing an example which asks for the median of two numerical values. Original 3
The x3 grid 200 has each of its columns sorted (210). Next, a vector 220 is formed from the maximum element in the first row (A), the central element in the second row (B), and the minimum element in the third row (C). The median from this vector 220 is the median 230 of the nine numbers.

【0014】図5は、2つの重複した3x3マトリクス
を表す4x3マトリクス310の図である。かかる4x
3マトリクス310は、2つの垂直方向に隣接する中央
フィルタ値(median filtered values)を計算するために
用いることができる。行には、連続的に、1,2,3,
4と付番してある。
FIG. 5 is a diagram of a 4 × 3 matrix 310 representing two overlapping 3 × 3 matrices. 4x such
The three matrix 310 can be used to calculate two vertically adjacent median filtered values. The rows are consecutively 1, 2, 3,
It is numbered four.

【0015】図6は、図5に示す2つの重複3x3マト
リクスに対して中央値の発生を可能とする、本発明によ
る図3の方法の最適化を示すフローチャートである。ま
ず、2つの新たな行を計算する。ステップ330におい
て、行Aは行2,3の各列からの最小要素を含み、行B
は行2,3の各列からの最大要素を含む。これらの計算
は、最小および最大関数を利用すると、効率的に実行可
能であることを注記しておく。次に、第1 の中間3x3
マトリクスを形成する。即ち、ステップ340におい
て、その第1行(C)は、行1,A,Bにおける3つの
列の各々からの最小値を含み、その第2行(D)は、行
1,A,Bにおける3つの列の各々からの中央値を含
み、その第3行(E)は、行1,A,Bにおける3つの
列の各々からの最大値を含む。次に、第1の3−エント
リ中間ベクトル(M)を形成する。ステップ350にお
いて、このベクトルにおける第1要素(M1 )は第1行
(行C)の最大要素であり、ステップ360において、
第2要素(M2 )は第2行(行D)の中央要素であり、
ステップ370において、第3要素(M3 )は第3行
(E)の最小要素である。最後に、ステップ380にお
いて、第1の重複3x3マトリクスに組織化された9つ
の数値に対する中央値を計算し、第1の中間ベクトル
(M)の中央要素とする。
FIG. 6 is a flowchart illustrating the optimization of the method of FIG. 3 according to the present invention, which allows the generation of median values for the two overlapping 3 × 3 matrices shown in FIG. First, two new rows are calculated. In step 330, row A contains the smallest element from each column of rows 2 and 3, and row B
Contains the largest element from each column of rows 2 and 3. Note that these calculations can be performed efficiently using minimum and maximum functions. Next, the first intermediate 3x3
Form a matrix. That is, in step 340, the first row (C) contains the minimum value from each of the three columns in rows 1, A, B, and the second row (D) contains the minimum values in rows 1, A, B. It contains the median from each of the three columns, and its third row (E) contains the maximum value from each of the three columns in rows 1, A, B. Next, a first 3-entry intermediate vector (M) is formed. In step 350, the first element (M 1 ) in this vector is the largest element in the first row (row C), and in step 360,
The second element (M 2 ) is the center element of the second row (row D),
In step 370, a third element (M 3) is the smallest element of the third row (E). Finally, in step 380, the median for the nine numbers organized in the first overlapping 3x3 matrix is calculated and taken as the central element of the first intermediate vector (M).

【0016】この方法は、第2の重複3x3マトリクス
における9つの数値に対する中央値を計算する際も同様
である。しかしながら、共有される行A,Bに対する計
算は共有されることを注記しておく。これは、行2,3
が2つの3x3マトリクス間で共有されるからである。
まず、ステップ390において、第2の中間3x3マト
リクスを形成する。その第1行(F)は、行4,A,B
における3つの列の各々からの最小値を含み、その第2
行(G)は、行4,A,Bにおける3つの列の各々から
の中央値を含み、その第3行(H)は、行4,A,Bに
おける3つの列の各々からの最大値を含む。次に、第2
の中間3−エントリ・ベクトル(N)を形成する。ステ
ップ400において、このベクトルにおける第1要素
(N1 )は第1行(F)の最大値であり、ステップ41
0において、第2要素(N2 )は第2行(G)の中央値
であり、ステップ420において、第3要素(N3 )は
第3行(H)の最小要素である。最後に、ステップ43
0において、第2の重複3x3マトリクスに組織化され
た9つの数値に対する中央値を計算し、第2の中間ベク
トル(N)の中央要素とする。
This method is the same when calculating the median for nine values in the second overlapping 3 × 3 matrix. Note, however, that the calculations for rows A and B that are shared are shared. This is for rows 2, 3
Is shared between the two 3 × 3 matrices.
First, in step 390, a second intermediate 3x3 matrix is formed. The first row (F) is row 4, A, B
Contains the minimum value from each of the three columns in
Row (G) contains the median from each of the three columns in rows 4, A and B, and its third row (H) shows the maximum from each of the three columns in rows 4, A and B. including. Next, the second
To form an intermediate 3-entry vector (N). In step 400, the first element (N 1 ) in this vector is the maximum value of the first row (F), and step 41
At 0, the second element (N 2 ) is the median value of the second row (G), and at step 420, the third element (N 3 ) is the smallest element of the third row (H). Finally, step 43
At 0, calculate the median for the nine numbers organized in the second overlapping 3x3 matrix and make it the central element of the second intermediate vector (N).

【0017】図7は、図6に示した方法の動作の一例を
示す。元の4x3マトリクス450は、その中央行(行
2,3)が行A,B460にソートされている。第1の
3x3中間マトリクス470は、行A,B,1の列をソ
ートすることによって形成される。第2の3x3中間マ
トリクス500は、行A,B,4の列をソートすること
によって形成される。第1中間ベクトル(M)480
は、第1の3x3中間マトリクス470から形成され、
第2の中間ベクトル(N)510は第2の3x3中間マ
トリクス500から形成される。最後に、2つの中央値
を形成する。第1中央値490は、第1の中間ベクトル
(M)480における中央要素から形成し、第2中央値
520は、第2の中間ベクトル(N)510における中
央要素から形成する。
FIG. 7 shows an example of the operation of the method shown in FIG. The original 4 × 3 matrix 450 has its center row (rows 2 and 3) sorted into rows A and B 460. A first 3x3 intermediate matrix 470 is formed by sorting the columns of rows A, B, 1. A second 3x3 intermediate matrix 500 is formed by sorting the columns of rows A, B, and 4. First intermediate vector (M) 480
Is formed from a first 3x3 intermediate matrix 470;
A second intermediate vector (N) 510 is formed from a second 3x3 intermediate matrix 500. Finally, two medians are formed. The first median 490 is formed from the central element in the first intermediate vector (M) 480, and the second median 520 is formed from the central element in the second intermediate vector (N) 510.

【0018】図8は、図6に示した方法のベクトル長V
を用いた、ベクトル化による最適化(vectorized optimi
zation) を示すために用いられる4xVマトリクス53
0である。図9,図10,および図11は、全体とし
て、図6に示した方法のベクトル化による最適化を示す
フローチャートである。図9は、上位動作および外部ル
ープを示し、一方図10および図11は、図9における
ループの内側で実行されるベクトル化動作を示す。尚、
図9は、図22ないし図25とも同様に用いられること
を注記しておく。
FIG. 8 shows the vector length V of the method shown in FIG.
Optimization using vectorization (vectorized optimi
4xV matrix 53 used to indicate
0. 9, 10, and 11 are flowcharts showing the optimization by vectorization of the method shown in FIG. 6 as a whole. FIG. 9 shows the upper operation and the outer loop, while FIGS. 10 and 11 show the vectorization operation performed inside the loop in FIG. still,
It should be noted that FIG. 9 is used similarly to FIGS.

【0019】図9を参照すると、開始時に、ステップ5
50において、行番号インデックスを0に初期化する。
次に、外側ループに入る。ステップ560において、他
に行があるか否かについて検査を行い、処理すべき行が
もはやない場合、外側ループを完了し、本方法を終了す
る。逆に、処理すべき行が未だある場合、ステップ58
0において列番号インデックスを0に初期化する。次
に、内側ループに入り、ステップ590において他に処
理すべき列があるか否かについて検査を行う。処理すべ
き列が未だある限り、ステップ620から開始しステッ
プ740で終了する図10および図11に示すブロック
を実行する。図10および図11の機能性(functionali
ty) を実行した後、ステップ750において列番号イン
デックスをベクトル長(V)だけ増分し、次いで、内側
ループを繰り返し、ステップ590における、他に処理
すべき列があるか否かについての検査から開始する。処
理すべき列が他に残っていない場合、ステップ760に
おいて、行番号を2だけ増分し、外側ループを繰り返
し、ステップ560における、他の処理すべき行がある
か否かについての検査から開始する。
Referring to FIG. 9, at the start, step 5
At 50, the row number index is initialized to zero.
Next, enter the outer loop. At step 560, a check is made as to whether there are any more rows, and if there are no more rows to process, the outer loop is completed and the method ends. Conversely, if there are more rows to process, step 58
At 0, the column number index is initialized to 0. Next, an inner loop is entered to check in step 590 if there are any more columns to process. As long as there are more columns to be processed, the blocks shown in FIGS. 10 and 11 starting at step 620 and ending at step 740 are executed. The functionalities of FIGS. 10 and 11
ty), the column number index is incremented by the vector length (V) in step 750, and then the inner loop is repeated, starting with a check in step 590 for any additional columns to process. I do. If there are no more columns to process, step 760 increments the row number by 2 and repeats the outer loop, starting with a test at step 560 for any other rows to process. .

【0020】次に図10を参照すると、内側本体はステ
ップ620から開始し、4つのベクトル・レジスタにロ
ードする。即ち、ステップ625において、行1には、
指定された行および列から始まるV個の要素をロードす
る。ここでVはベクトル長である。行2には、次の行
(行+1)および現在の列から始まるV個の要素をロー
ドする。行3には、3番目の行(行+2)および現在の
列から始まるV個の要素をロードする。行4には、4番
目の行(行+3)および現在の列から始まるV個の要素
をロードする。
Referring now to FIG. 10, the inner body starts at step 620 and loads four vector registers. That is, in step 625, row 1 contains:
Load V elements starting at the specified row and column. Here, V is the vector length. Row 2 is loaded with V elements starting at the next row (row +1) and the current column. Row 3 is loaded with V elements starting at the third row (row + 2) and the current column. Row 4 is loaded with V elements starting from the fourth row (row + 3) and the current column.

【0021】まず、2つの新たな行を計算する。即ち、
ステップ630において、行Aは、行2,3に対する各
列からの最小要素を含み、一方行Bは、行2,3に対す
る各列からの最大要素を含む。尚、これらの計算は、V
個の対の入力オペランドを利用してV個の結果を並列に
生成するSIMDベクトル最小および最大関数(SIMDvec
tor minimum and maximum functions) を利用すると、
効率的に算出できることを注記しておく。次に、第1の
中間3xVマトリクスを形成する。即ち、ステップ64
0において、その第1行(行C)は、行1,A,Bにお
けるV個の列の各々からの最小値を含み、その第2行
(行D)は、行1,A,BにおけるV個の列の各々から
の中央値を含み、その第3行(行E)は、行1,A,B
におけるV個の列の各々からの最大値を含む。
First, two new rows are calculated. That is,
In step 630, row A contains the smallest element from each column for rows 2 and 3, while row B contains the largest element from each column for rows 2 and 3. Note that these calculations are based on V
SIMD vector min and max functions (SIMDvec) that generate V results in parallel using the pairs of input operands
tor minimum and maximum functions)
Note that it can be calculated efficiently. Next, a first intermediate 3xV matrix is formed. That is, step 64
At 0, its first row (row C) contains the minimum value from each of the V columns in rows 1, A, B, and its second row (row D) in rows 1, A, B It contains the median from each of the V columns, the third row (row E) being row 1, A, B
. Contains the maximum value from each of the V columns.

【0022】次に、第1の3−ベクトル中間マトリクス
(M)を形成する。即ち、このマトリクスにおける第1
ベクトル(M1 )は、最大要素を含み、第2ベクトル
(M2)は中央要素を含み、第3ベクトル(M3 )は最
小要素を含む。ステップ650において、第1ベクトル
(M1 )を計算する際、行Cの最初の(V−1)個の要
素と連結された、行Prev_Cの最後の1つの要素を含む行
S をロードし、行Cの最初の(V−2)要素と連結さ
れた、行Prev_Cの最後の2つの要素を含む行CSSをロー
ドし、行M1 は、行C,CS ,CSSに対するV個の列の
各々における最大要素を含むように計算する。同様に、
ステップ660において、第2ベクトル(M2 )を計算
する場合、行Dの最初の(V−1)個の要素と連結され
た行Prev_Dの最後の1つの要素を含む行DS をロード
し、行Dの最初の(V−2)個の要素と連結された行Pr
ev_Dの最後の2つの要素を含む行DSSをロードし、行M
2 は、行D,DS ,DSSに対するV個の列の各々におけ
る中央要素を含むように計算する。同様に、ステップ6
70において、第3ベクトル(M3 )を計算する場合、
行Eの最初の(V−1)個の要素と連結された、行Prev
_Eの最後の1つの要素を含む行ES をロードし、行Eの
最初の(V−2)個の要素と連結された行Prev_Eの最後
の2つの要素を含む行ESSをロードし、行M3 は、行
E,ES ,ESSに対するV個の列の各々における最小要
素を含むように計算する。次に、ステップ680におい
て、第1のV個の重複3x3マトリクスに組織化され
た、V組の9つの数値に対するV個の中央値を計算し、
1要素左にシフトした行M1 ,M2 ,M3 を含む、第1
中間マトリクス(M)の中央要素とする。最後に、ステ
ップ685において、行CをベクトルPrev_Cにセーブ
し、行DをベクトルPrev_Dにセーブし、行Eをベクトル
Prev_Eにセーブする。
Next, a first 3-vector intermediate matrix (M) is formed. That is, the first in this matrix
The vector (M 1 ) contains the largest element, the second vector (M 2 ) contains the central element, and the third vector (M 3 ) contains the smallest element. In step 650, when calculating the first vector (M 1), to load the line C S containing coupled with the first (V-1) number of elements in the row C, and the last one element row Prev_C , Load a row C SS containing the last two elements of row Prev_C, concatenated with the first (V-2) element of row C, and row M 1 contains V rows for rows C, C S , C SS Is calculated to include the largest element in each of the columns. Similarly,
In step 660, load case, the line D S including the first (V-1) last one element of the individual elements and the connecting row Prev_D line D to calculate a second vector (M 2), Row Pr connected to the first (V-2) elements of row D
Load row D SS containing the last two elements of ev_D, and add row M
2 is calculated to include the central element in each of the V columns for rows D, D S , and D SS . Similarly, step 6
At 70, when calculating the third vector (M 3 ),
Row Prev concatenated with the first (V-1) elements of row E
Load row E S containing the last one element of _E, load row E SS containing the last two elements of row Prev_E concatenated with the first (V-2) elements of row E, Row M 3 is calculated to include the smallest element in each of the V columns for rows E, E S , and E SS . Next, at step 680, calculate V medians for the V sets of 9 numbers, organized into a first V overlapping 3x3 matrix,
The first, including rows M 1 , M 2 , M 3 shifted one element to the left
This is the central element of the intermediate matrix (M). Finally, in step 685, row C is saved in vector Prev_C, row D is saved in vector Prev_D, and row E is saved in vector Prev_D.
Save to Prev_E.

【0023】第2組のV個の重複3x3マトリクスにお
けるV組の9つの数値に対して中央値を計算する際に利
用する方法および装置も同様である。しかしながら、共
有される行A,Bに対する計算は、この計算では共有さ
れることを注記しておく。この共有の理由は、行2,3
が2組のV個の3x3マトリクス間で共有されているか
らである。ステップ690において、まず、第2の中間
3x3マトリクスを形成する。その第1行(行F)は行
4,A,Bにおける3つの列の各々からの最小値を含
み、その第2行(行G)は行4,A,Bにおける3つの
列の各々からの中央値を含み、その第3行(行H)は、
行4,A,Bにおける3つの列の各々からの最大値を含
む。
The same applies to the method and apparatus used in calculating the median for the V sets of nine numbers in the second set of V overlapping 3x3 matrices. Note, however, that the calculations for shared rows A and B are shared in this calculation. The reason for this sharing is that rows 2, 3
Is shared between two sets of V 3 × 3 matrices. In step 690, a second intermediate 3x3 matrix is first formed. The first row (row F) contains the minimum from each of the three columns in rows 4, A and B, and the second row (row G) from each of the three columns in rows 4, A and B And the third row (row H) contains
Contains the maximum value from each of the three columns in rows 4, A, B.

【0024】次に、第2の3−ベクトル中間マトリクス
(N)を形成する。即ち、このマトリクスの第1ベクト
ル(N1 )は最大要素を含み、第2ベクトル(N2 )は
中央要素を含み、第3ベクトル(N3 )は最小要素を含
む。第1ベクトル(N1 )を計算する際、ステップ70
0において、行Fの最初の(V−1)個の要素と連結さ
れた、行Prev_Fの最後の1つの要素を含む行FS をロー
ドし、行Fの最初の(V−2)個の要素と連結された、
行Prev_Fの最後の2つの要素を含む行FSSをロードし、
行N1 は、行F,FS ,FSSに対するV個の列の各々に
おける最大要素を含むように計算する。同様に、第2ベ
クトル(N2 )を計算する場合、ステップ710におい
て、行Gの最初の(V−1)個の要素と連結された行Pr
ev_Gの最後の1つの要素を含む行GS をロードし、行G
の最初の(V−2)個の要素と連結された行Prev_Gの最
後の2つの要素を含む行GSSをロードし、行N2 は、行
G,GS ,GSSに対するV個の列の各々における中央要
素を含むように計算する。同様に、第3ベクトル(N
3 )を計算する場合、ステップ720において、行Hの
最初の(V−1)個の要素と連結された、行Prev_Hの最
後の1つの要素を含む行HS をロードし、行Hの最初の
(V−2)個の要素と連結された、行Prev_Hの最後の2
つの要素を含む行HSSをロードし、行N3 は、行H,H
S ,HSSに対するV個の列の各々における最小要素を含
むように計算する。次に、ステップ730において、第
2のV個の重複3x3マトリクスに組織化された、V組
の9つの数値に対するV個の中央値を計算し、1要素左
にシフトした行N1 ,N2 ,N3を含む、第2中間マト
リクス(M)の中央要素とする。最後に、ステップ73
5において、行FをベクトルPrev_Fにセーブし、行Gを
ベクトルPrev_Gにセーブし、行HをベクトルPrev_Hにセ
ーブする。
Next, a second 3-vector intermediate matrix (N) is formed. That is, the first vector (N 1 ) of this matrix contains the largest element, the second vector (N 2 ) contains the central element, and the third vector (N 3 ) contains the smallest element. When calculating the first vector (N 1 ), step 70
At 0, connected with the first (V-1) number of elements in the row F, loads the row F S containing the last one element row Prev_F, first row F (V-2) number of Concatenated with the element,
To load the line F SS, including the last two elements of the line Prev_F,
Row N 1 is calculated to include the largest element in each of the V columns for rows F, F S , and F SS . Similarly, when calculating the second vector (N 2 ), in step 710, the row Pr connected to the first (V-1) elements of row G
Load row G S containing the last one element of ev_G, and
Load row G SS containing the last two elements of row Prev_G concatenated with the first (V-2) elements of row N 2 , and row N 2 contains V columns for rows G, G S , and G SS Is calculated to include the central element in each of the. Similarly, the third vector (N
When calculating the 3), at step 720, which is connected with the first (V-1) number of elements in the row H, to load the line H S containing the last one element row prev_h, first row H Last 2 of row Prev_H concatenated with the (V-2) elements of
Load row H SS containing two elements, row N 3 contains rows H, H
Calculate to include the smallest element in each of the V columns for S , H SS . Next, at step 730, the V medians for the 9 values of the V set, organized into a second V overlapping 3x3 matrix, are calculated and the rows N 1 , N 2 shifted left by one element. , N 3 as the central element of the second intermediate matrix (M). Finally, step 73
At 5, save row F in vector Prev_F, save row G in vector Prev_G, and save row H in vector Prev_H.

【0025】図12は、図10および図11に示した方
法の動作の一例を示す。元の4x6マトリクス790
は、その2つの中央行(行2,3)が、行A,B800
にソートされている。また、このステップへの入力とし
ては、Prev_C, Prev_D, Prev_E700およびPrev_F,
Prev_G, Prev_H780として記憶された、直前の実行か
らの結果である。行C,D,Eを含む第1の3x6中間
マトリクス810は、行A,B,1の列をソートするこ
とによって形成される。行F,G,Hを含む第2の3x
6中間マトリクス820は、行A,B,4の列をソート
することによって形成される。第1組の中間ベクトル
(M)は、行C,CS ,CSS830からの各列における
最大要素を含む第1ベクトル(M1 )850,列D,D
S ,DSS870からの各列における中央要素を含む第2
ベクトル(M2 )890,および行E,ES ,ESS91
0からの各列における最小要素を含む第3ベクトル(M
3 )930から形成される。第2組の中間ベクトル
(N)は、行F,FS ,FSS840からの各列における
最大要素を含む第1ベクトル(N1 )860,列G,G
S ,GSS880からの各列における中央要素を含む第2
ベクトル(N2 )900,および行H,HS ,HSS92
0からの各列における最小要素を含む第3ベクトル(N
3 )940から形成される。尚、行CS は行Cを1要素
ずらしたもの、また行CSSは行Cを2要素ずらしたもの
であり、直前のループの実行からの要素をベクトルPrev
_Cにセーブすることによってシフトされ、要素が置き換
えられ、行CS,CSS双方に入ることを注記しておく。
このベクトル命名規則(vector naming convention)は、
行D,E、F,G,Hにも適用される。最後に、2つの
中央値を形成する。第1のV個の中央値950は、第1
組の中間ベクトル(M)850,890,930からの
各列における中央要素を選択することによって形成し、
第2のV個の中央値960は、第2組の中間ベクトル
(N)860,900,940からの各列における中央
要素を選択することによって形成する。第1のV個の中
央値950および第2のV個の中央値960は双方共、
1要素左にシフトされている。
FIG. 12 shows an example of the operation of the method shown in FIGS. Original 4x6 matrix 790
Means that the two center rows (rows 2 and 3) are rows A and B800
Has been sorted. The inputs to this step include Prev_C, Prev_D, Prev_E700 and Prev_F,
This is the result from the previous run, stored as Prev_G, Prev_H780. A first 3 × 6 intermediate matrix 810 including rows C, D, and E is formed by sorting the columns of rows A, B, and 1. Second 3x including rows F, G, H
The six intermediate matrix 820 is formed by sorting the columns of rows A, B, and 4. The first set of intermediate vectors (M) is the first vector (M 1 ) 850 containing the largest element in each column from rows C, C S , C SS 830, columns D, D
S , the second including the central element in each column from D SS 870
Vector (M 2 ) 890 and rows E, E S , E SS 91
A third vector (M) containing the smallest element in each column from 0
3 ) formed from 930; The second set of intermediate vectors (N) is a first vector (N 1 ) 860 containing the largest element in each column from rows F, F S , F SS 840, columns G, G
S , the second containing the central element in each column from G SS 880
Vector (N 2 ) 900 and rows H, H S , H SS 92
A third vector (N
3 ) formed from 940; The row C S is obtained by shifting the row C by one element, and the row C SS is obtained by shifting the row C by two elements.
Note that by saving to _C, the elements are replaced and replaced, entering both rows C S and C SS .
This vector naming convention is
Also applies to rows D, E, F, G, H. Finally, two medians are formed. The first V medians 950 are
Formed by selecting the central element in each column from the set of intermediate vectors (M) 850, 890, 930;
The second V medians 960 are formed by selecting the median elements in each column from the second set of intermediate vectors (N) 860,900,940. The first V medians 950 and the second V medians 960 are both:
It has been shifted one element to the left.

【0026】図13は、9つの数値を完全にソートする
方法を示すための、3x3マトリクス1010の図であ
る。図14は、9つのソートした数値を利用した加重フ
ィルタ処理を示すための3x3係数マトリクス1020
の図である。図15は、3x3マトリクスに組織化した
9つの数値を完全にソートする方法の動作を示す、4つ
の3x3マトリクスの図である。図示の各3x3マトリ
クスにおける矢印の方向は、ソートの順序を示し、矢印
の先端は、数値が大きくなる方向を示し、矢尻は数値が
小さくなる方向を示すことを注記しておく。まず、列を
ソートする(2110)。次に、行をソートする(21
20)。第3に、Y=X対角線に平行な線上の要素をソ
ートする(2130)。最後に、2* Y=X対角線に平
行な線上の要素をソートする(2140)。その結果得
られる3x3マトリクスは、その要素が行の大きい順に
ソートされている。以下に示す基本的な方法は、列の大
きい順にソートされたマトリクスを生成するように変更
することができる。その際、Y=X対角線ソートの方向
を逆転し、2* Y=X対角線ソートを、逆のY=2*
対角線ソートと置換する。行の大きい順のソートを好適
実施例において利用するのは、そのSIMDベクトル化
特性が改善されるためである。
FIG. 13 is a diagram of a 3 × 3 matrix 1010 to illustrate a method of completely sorting nine numerical values. FIG. 14 shows a 3 × 3 coefficient matrix 1020 for illustrating a weighted filtering process using nine sorted numerical values.
FIG. FIG. 15 is a diagram of four 3 × 3 matrices showing the operation of the method of completely sorting the nine numerical values organized in a 3 × 3 matrix. It should be noted that the direction of the arrow in each 3x3 matrix shown indicates the order of sorting, the tip of the arrow indicates the direction in which the numerical value increases, and the arrowhead indicates the direction in which the numerical value decreases. First, the columns are sorted (2110). Next, sort the rows (21
20). Third, elements on a line parallel to the Y = X diagonal are sorted (2130). Finally, the elements on the line parallel to the 2 * Y = X diagonal are sorted (2140). The resulting 3x3 matrix has its elements sorted in ascending row order. The basic method described below can be modified to produce a matrix sorted in descending order of columns. At that time, the direction of Y = X diagonal sort is reversed, and 2 * Y = X diagonal sort is performed, and Y = 2 * X
Replace with diagonal sort. Sorting by row order is used in the preferred embodiment because of its improved SIMD vectorization characteristics.

【0027】図16は、9つの要素を完全にソートし、
3x3マトリクスに組織化された9つの数値の加重フィ
ルタ値を計算する方法を示すフローチャートである。開
始すると、まずステップ1040において、第2の3x
3マトリクス(B)を形成する。その第1行(B1 )は
3つの列の各々からの最小値を含み、その第2行(B
2 )は3つの列の各々からの中央値を含み、その第3行
(B3 )は3つの列の各々からの最大値を含む。次に、
ステップ1050において、第2の3x3マトリクス
(C)を形成する。その第1行(C1 )は3つの列の各
々からの最小値を含み、その第2行(C2 )は3つの列
の各々からの中央値を含み、その第3行(C3 )は3つ
の列の各々からの最大値を含む。次に、Y=X線に平行
な線上の要素をソートする。ステップ1060におい
て、3つの中央対角線要素(C13,C22,C31)の最小
値に設定された要素D13,3つの中央対角線要素
(C13,C22,C31)の中央値に設定された要素D22
および3つの中央対角線要素(C13,C22,C31)の最
大値に設定された要素D31から、中央対角線を形成す
る。ステップ1070において、2つの上側対角線要素
(C12,C21)の最小値に設定された要素D12,および
2つの上側対角線要素(C12,C21)の最大値に設定さ
れた要素D21から上側の対角線を形成する。ステップ1
080において、2つの上側対角線要素(C23,C32
の最小値にセットされた要素D23,および2つの上側対
角線要素(C23,C32)の最大値にセットされた要素D
32から、下側対角線を形成する。次に、2* Y=Xによ
って規定される線に平行な線上の要素をソートする。ス
テップ1090において、2つの上側対角線要素
(D13,D21)の最小値に設定された要素E13,および
2つの上側対角線要素(D13,D21)の最大値に設定さ
れた要素E21から上側の対角線を形成する。ステップ1
100において、2つの上側対角線要素(D23,D31
の最小値にセットされた要素E23,および2つの上側対
角線要素(D23,D31)の最大値にセットされた要素E
31から、下側対角線を形成する。この時点において、元
の入力マトリクス(A)は、ランクによって事実上ソー
トされている。即ち、第1行はC11,D12,E13を含
み、第2行はE21,D22,E23を含み、第3行はE31
32,C33を含む。したがって、9つの数値のソート順
序は(最少から最大)、C11,D12,E13,E21
22,E23,E31,D32,C33となる。最後に、ステッ
プ1110において、第1重みマトリクス(K)102
0内の各エントリを、対応するソート済みマトリクス要
素と乗算することによって、加重フィルタ値を計算す
る。
FIG. 16 completely sorts the nine elements,
9 is a flowchart illustrating a method of calculating a weighted filter value of nine numerical values organized in a 3 × 3 matrix. Upon start, first in step 1040, the second 3x
A three matrix (B) is formed. The first row (B 1 ) contains the minimum from each of the three columns, and the second row (B 1 )
2 ) contains the median value from each of the three columns, and its third row (B 3 ) contains the maximum value from each of the three columns. next,
In step 1050, a second 3x3 matrix (C) is formed. Its first row (C 1 ) contains the minimum value from each of the three columns, its second row (C 2 ) contains the median value from each of the three columns, and its third row (C 3 ) Contains the maximum value from each of the three columns. Next, elements on a line parallel to the Y = X-ray are sorted. In step 1060, set to the median value of the three central diagonal elements (C 13, C 22, C 31) element D 13, which is set to the minimum value of the three central diagonal elements (C 13, C 22, C 31) Element D 22 ,
And three central diagonal elements (C 13, C 22, C 31) element D 31 which is set to the maximum value of, forming a central diagonal. In step 1070, the two upper diagonal elements (C 12, C 21) the minimum value set to the element D 12 and of two upper diagonal elements (C 12, C 21) up to set the value element of D 21, To form an upper diagonal line. Step 1
080, two upper diagonal elements (C 23 , C 32 )
D 23 set to the minimum value of, and the element D set to the maximum value of the two upper diagonal elements (C 23 , C 32 )
From 32 , a lower diagonal is formed. Next, the elements on the line parallel to the line defined by 2 * Y = X are sorted. In step 1090, the two upper diagonal elements (D 13, D 21) Min Max set to value elements of the set elements E 13, and two upper diagonal element values (D 13, D 21) E 21 To form an upper diagonal line. Step 1
At 100, two upper diagonal elements (D 23 , D 31 )
E 23 set to the minimum value of E and the element E set to the maximum value of the two upper diagonal elements (D 23 , D 31 )
From 31 , a lower diagonal is formed. At this point, the original input matrix (A) has been effectively sorted by rank. That is, the first row contains C 11 , D 12 and E 13 , the second row contains E 21 , D 22 and E 23 , and the third row contains E 31 , D 22 and E 23 .
D 32 and C 33 are included. Thus, the sort order of the nine numbers (from smallest to largest) is C 11 , D 12 , E 13 , E 21 ,
The D 22, E 23, E 31 , D 32, C 33. Finally, in step 1110, the first weight matrix (K) 102
A weighted filter value is calculated by multiplying each entry in 0 by the corresponding sorted matrix element.

【0028】図17は、図16に示した方法の動作の一
例を示す図である。元のマトリクス(A)1130を列
でソートし、列ソート・マトリクス(B)1140を形
成する。列ソート・マトリクス(B)1140を行でソ
ートし、行ソート・マトリクス(C)1150を形成す
る。Y=X線に平行な線上の行ソート・マトリクス
(C)1150からの要素をソートし、第1対角線マト
リクス(D)1160を形成する。その結果2* Y=X
線に平行な線上に得られたマトリクス内の要素をソート
して、第2対角線マトリクス(E)1170を形成す
る。最後に、行ソート・マトリクス1150,第1対角
線マトリクス1160,および第2対角線マトリクス1
170から選択した要素を、重みマトリクス1180内
の対応する要素と乗算し、加算して、加重フィルタ値1
190を算出する。
FIG. 17 is a diagram showing an example of the operation of the method shown in FIG. The original matrix (A) 1130 is sorted by column to form a column sort matrix (B) 1140. The column sort matrix (B) 1140 is sorted by rows to form a row sort matrix (C) 1150. The elements from the row sort matrix (C) 1150 on a line parallel to the Y = X line are sorted to form a first diagonal matrix (D) 1160. As a result, 2 * Y = X
The elements in the matrix obtained on a line parallel to the line are sorted to form a second diagonal matrix (E) 1170. Finally, the row sort matrix 1150, the first diagonal matrix 1160, and the second diagonal matrix 1
The element selected from 170 is multiplied by the corresponding element in weight matrix 1180 and added to produce a weighted filter value 1
190 is calculated.

【0029】図18は、2つの重複3x3マトリクスを
表す4x3マトリクス1200の図である。かかる4x
2マトリクス1200は、2つの垂直方向に隣接した、
ランクに基づく加重フィルタ値を計算するために用いる
ことができる。行には連続的にA1j,A2j,...A4j
と付番し、列には連続的にA1i,A2i,およびA3iと付
番してある。第1の3x3マトリクスは、行A1j
2j,A3jを含む。第2の3x3マトリクスは、行
2j,A3j,A4jを含む。
FIG. 18 is a diagram of a 4 × 3 matrix 1200 representing two overlapping 3 × 3 matrices. 4x such
The two matrices 1200 are two vertically adjacent,
It can be used to calculate a weighted filter value based on rank. A 1j , A 2j,. . . A 4j
, And the columns are sequentially numbered A 1i , A 2i , and A 3i . The first 3x3 matrix has rows A 1j ,
A 2j and A 3j are included. The second 3x3 matrix includes rows A2j , A3j , A4j .

【0030】図19および図20は、全体として、図1
8に示す4x3マトリクスに結合された2つの重複3x
3マトリクスに対する加重フィルタ値の生成を可能とす
る、図16に示す方法の最適化を示すフローチャートで
ある。まず、2つの新たな列を計算する。即ち、ステッ
プ1220において、行Bは、共有行A2j,A3jにおけ
る各列からの最少要素を含み、行Cは、共有行A2j,A
3jにおける各列からの最大要素を含む。尚、これらの計
算は、最少および最大関数を利用すると、効率的に実行
可能であることを注記しておく。次に、第1中間3x3
マトリクスを形成する(D)。即ち、ステップ1230
において、その第1行(D1j)は行A1j,B,Cにおけ
る3つの列の各々からの最小値を含み、その第2行(D
2j)は行A1j,B,Cにおける3つの列の各々からの中
央値を含み、その第3行(D3j)は行A1j,B,Cにお
ける3つの列の各々からの最大値を含む。次に、第1の
中間3x3マトリクス(D)から、第2の中間3x3マ
トリクス(E)を形成する。即ち、ステップ1240に
おいて、その第1列(Ei1)は第1の中間3x3マトリ
クス(D)における3つの行の各々からの最小値を含
み、その第2列(Ei2)は第1の中間3x3マトリクス
(D)における3つの行の各々からの最小値を含み、そ
の第3列(Ei3)は第1の中間3x3マトリクス(D)
における3つの行の各々からの最大値を含む。次に、Y
=X線に平行な線上の要素をソートする。ステップ12
50において、要素F13を要素E13,E22,E31の最小
値に設定し、要素F22を要素E13,E22,E31の中央値
に設定し、要素F31を要素E13,E22,E31の最大値に
設定する。ステップ1260において、要素F12を要素
12,E21の最小値に設定し、要素F21を要素E12,E
21の最大値に設定する。ステップ1270において、要
素F23を要素E23,E32の最小値に設定し、要素F32
要素E23,E32の最大値に設定する。次に、2* Y=X
線に平行な線上の要素をソートする。ステップ1280
において、要素G13を要素F13,F21の最小値に設定
し、要素G21を要素F13,F21の最大値に設定する。ス
テップ1290において、要素G23を要素F23,F31
最小値に設定し、要素G31を要素F23,F31の最大値に
設定する。最後に、ステップ1300において、上側の
3x3グリッドに対して得られる加重ランク基準フィル
タ値を、得られた各マトリクス数値と対応する重みとの
積の和に等しくなるように計算する。即ち、結果=E11
*11+F12 *12+G13 *13+G21 *21+F22 *
22+G23 *23+G31 *31+F32 *32+E33 *
33となる。
FIGS. 19 and 20 show the overall structure of FIG.
Two overlapping 3x combined into a 4x3 matrix as shown in Figure 8
17 is a flowchart illustrating optimization of the method shown in FIG. 16 that enables generation of weighted filter values for three matrices. First, two new columns are calculated. That is, in step 1220, the line B comprises minimal elements from each column in the shared row A 2j, A 3j, row C is shared row A 2j, A
Include the largest element from each column in 3j . Note that these calculations can be performed efficiently using minimum and maximum functions. Next, the first intermediate 3 × 3
A matrix is formed (D). That is, step 1230
, Its first row (D 1j ) contains the minimum value from each of the three columns in rows A 1j , B, C and its second row (D 1j )
2j ) contains the median from each of the three columns in rows A 1j , B, and C, and the third row (D 3j ) contains the maximum value from each of the three columns in rows A 1j , B, and C. Including. Next, a second intermediate 3 × 3 matrix (E) is formed from the first intermediate 3 × 3 matrix (D). That is, in step 1240, the first column (E i1 ) contains the minimum from each of the three rows in the first intermediate 3 × 3 matrix (D), and the second column (E i2 ) contains the first intermediate (E i2 ). The third column (E i3 ) contains the minimum value from each of the three rows in the 3 × 3 matrix (D) and the first intermediate 3 × 3 matrix (D)
Contains the maximum from each of the three rows in. Next, Y
= Sort elements on line parallel to X-ray. Step 12
In 50 sets the elements F 13 to the minimum value of the elements E 13, E 22, E 31 , sets the elements F 22 to the median value of the elements E 13, E 22, E 31 , elements F 31 elements E 13 , E 22 and E 31 are set to the maximum values. In step 1260, the element F 12 elements E 12, set to the minimum value of E 21, elements F 21 elements E 12, E
Set to the maximum value of 21 . In step 1270, sets the elements F 23 to the minimum value of element E 23, E 32, sets the elements F 32 to a maximum value of the elements E 23, E 32. Next, 2 * Y = X
Sort elements on a line parallel to the line. Step 1280
In sets the element G 13 to a minimum of elements F 13, F 21, sets the elements G 21 to the maximum value of the elements F 13, F 21. In step 1290, sets the elements G 23 to a minimum of elements F 23, F 31, sets the elements G 31 to the maximum value of the elements F 23, F 31. Finally, in step 1300, the weighted rank criterion filter value obtained for the upper 3x3 grid is calculated to be equal to the sum of the products of each obtained matrix value and the corresponding weight. That is, result = E 11
* K 11 + F 12 * K 12 + G 13 * K 13 + G 21 * K 21 + F 22 *
K 22 + G 23 * K 23 + G 31 * K 31 + F 32 * K 32 + E 33 * K
It becomes 33 .

【0031】第2の(下側の)重複する3x3グリッド
に対して加重フィルタ値を計算する方法も同様である。
尚、共有行B,Cに対する計算は、上側3x3グリッド
および下側3x3グリッドの算出の間で共有されること
を注記しておく。まず、第1の中間3x3マトリクス
(H)を形成する。即ち、ステップ1310において、
その第1行(H1j)は行A4j,B,Cにおける3つの列
の各々からの最小値を含み、その第2行(H2j)は行A
4j,B,Cにおける3つの列の各々からの中央値を含
み、その第3行(H3j)は行A4j,B,Cにおける3つ
の列の各々からの最大値を含む。次に、第1の中間3x
3マトリクス(H)から、第2の中間3x3マトリクス
(I)を形成する。即ち、ステップ1320において、
その第1列(Ii1)は第1の中間3x3マトリクス
(H)における3つの行の各々からの最小値を含み、そ
の第2列(Ii2)は第1の中間3x3マトリクス(H)
における3つの行の各々からの中央値を含み、その第3
列(Ii3)は第1の中間3x3マトリクス(H)におけ
る3つの行の各々からの最大値を含む。次に、Y=X線
に平行な線上の要素をソートする。ステップ1330に
おいて、要素J13を要素I13,I22,I31の最小値に設
定し、要素J22を要素I13,I22,I31の中央値に設定
し、要素J31を要素I13,I22,I31の最大値に設定す
る。ステップ1340において、要素J12を要素I12
21の最小値に設定し、要素J21を要素I12,I21の最
大値に設定する。ステップ1350において、要素J23
を要素I23,I 32の最小値に設定し、要素J32を要素I
23,I32の最大値に設定する。次に、2* Y=X線に平
行な線上の要素をソートする。ステップ1360におい
て、要素L13を要素J13,J21の最小値に設定し、要素
21を要素J13,J21の最大値に設定する。ステップ1
370において、要素L23を要素J23,J31の最小値に
設定し、要素L31を要素J23,J31の最大値に設定す
る。最後に、ステップ1380において、下側の3x3
グリッドに対して得られる加重ランク基準フィルタ値
を、得られた各マトリクス要素と対応する重みとの積の
和に等しくなるように計算する。即ち、結果=I11 *
11+J12 *12+L13 *13+L21 *21+J22 *22
+L23 *23+L31 *31+J32 *32+I33 *33
なる。
Second (lower) overlapping 3x3 grid
The same applies to a method of calculating a weighted filter value for.
The calculation for the shared rows B and C is performed on the upper 3x3 grid.
To be shared between and the calculation of the lower 3x3 grid
Is noted. First, the first intermediate 3x3 matrix
(H) is formed. That is, in step 1310,
The first line (H1j) Is row A4j, B, C, three columns
, And its second row (H2j) Is row A
4j, B, and C contain the median from each of the three columns.
The third line (H3j) Is row A4j, B and C
Contains the maximum value from each of the columns. Next, the first intermediate 3x
From the 3 matrix (H) to the second intermediate 3x3 matrix
(I) is formed. That is, in step 1320,
The first column (Ii1) Is the first intermediate 3x3 matrix
Containing the minimum from each of the three rows in (H),
In the second column (Ii2) Is the first intermediate 3 × 3 matrix (H)
Containing the median from each of the three rows in
Column (Ii3) In the first intermediate 3x3 matrix (H)
Contains the maximum value from each of the three rows. Next, Y = X-ray
Sort elements on a line parallel to. To step 1330
And element J13Is the element I13, Itwenty two, I31Set to the minimum
And element Jtwenty twoIs the element I13, Itwenty two, I31Set to the median of
Then element J31Is the element I13, Itwenty two, I31To the maximum value of
You. In step 1340, the element J12Is the element I12,
Itwenty oneSet to the minimum value oftwenty oneIs the element I12, Itwenty oneMost
Set to a large value. In step 1350, the element Jtwenty three
Is the element Itwenty three, I 32Set to the minimum value of32Is the element I
twenty three, I32Set to the maximum value of. Next, 2* Y = X-ray flat
Sort elements on a line. Step 1360
And the element L13To element J13, Jtwenty oneSet to the minimum of the element
Ltwenty oneTo element J13, Jtwenty oneSet to the maximum value of. Step 1
At 370, the element Ltwenty threeTo element Jtwenty three, J31To the minimum of
Set the element L31To element Jtwenty three, J31To the maximum value of
You. Finally, in step 1380, the lower 3x3
Weighted rank criterion filter value obtained for the grid
Is the product of each obtained matrix element and the corresponding weight.
Calculate to be equal to the sum. That is, result = I11 * K
11+ J12 * K12+ L13 * K13+ Ltwenty one * Ktwenty one+ Jtwenty two * Ktwenty two
+ Ltwenty three * Ktwenty three+ L31 * K31+ J32 * K32+ I33 * K33When
Become.

【0032】図21は、図19および図20に示した方
法の動作の一例を示す図である。元の4x3マトリクス
(A)1400は、その2つの中央行(A2j,A3j)が
共有されている。これら2つの共有行(A2j,A3j
を、行B,C1410にソートする。行A1j,B,Cか
ら形成されたマトリクスの列をソートすることによっ
て、中間マトリクスD1420を形成する。行A4j
B,Cから形成されたマトリクスの列をソートすること
によって、中間マトリクスH1480を形成する。マト
リクスD1420内の行をソートすることによって、中
間マトリクスE1430を形成する。マトリクスH14
80内の行をソートすることによって、中間マトリクス
I1490を形成する。中間マトリクスE1430内の
Y=X対角線に平行な要素をソートすることによって、
対角線マトリクスF1440を形成する。中間マトリク
スI1490内のY=X対角線に並列な要素をソートす
ることによって、対角線マトリクスJ1500を形成す
る。中間マトリクスF1440内の2* Y=X対角線に
平行な要素をソートすることによって、対角線マトリク
スG1450を形成する。中間マトリクスJ1500に
おける2* Y=X対角線に平行な要素をソートすること
によって、対角線マトリクスL1510を形成する。マ
トリクスG1450,L1510は、マトリクスG14
50に対するマトリクスF1440,E1430内の対
応する素子で満たし、マトリクスL1510に対するマ
トリクスJ1500,I1490内の対応する素子で満
たすと、一体となって4x3マトリクス(A)1400
を構成する2つの元の3x3マトリクスからの要素を、
ソートした順序で含むことになる。上側3x3マトリク
スに対する加重フィルタ値1470は、マトリクスG1
450内のソートされた要素を、重みマトリクス(K)
1460内の対応する要素と乗算した積を加算すること
によって計算する。下側3x3マトリクスに対する加重
フィルタ値1520は、マトリクスL1510内のソー
トされた要素を、重みマトリクス(K)1460内の対
応する要素と乗算した積を加算することによって計算す
る。
FIG. 21 is a diagram showing an example of the operation of the method shown in FIG. 19 and FIG. The original 4 × 3 matrix (A) 1400 shares its two center rows (A 2j , A 3j ). These two shared rows (A 2j , A 3j )
Are sorted into rows B and C1410. An intermediate matrix D 1420 is formed by sorting the columns of the matrix formed from rows A 1j , B, and C. Row A 4j ,
An intermediate matrix H1480 is formed by sorting the columns of the matrix formed from B and C. The intermediate matrix E1430 is formed by sorting the rows in the matrix D1420. Matrix H14
By sorting the rows in 80, an intermediate matrix I 1490 is formed. By sorting the elements parallel to the Y = X diagonal in the intermediate matrix E1430,
A diagonal matrix F1440 is formed. The diagonal matrix J1500 is formed by sorting the elements parallel to the Y = X diagonals in the intermediate matrix I1490. A diagonal matrix G1450 is formed by sorting the elements parallel to the 2 * Y = X diagonals in the intermediate matrix F1440. A diagonal matrix L1510 is formed by sorting the elements parallel to the 2 * Y = X diagonals in the intermediate matrix J1500. The matrices G1450 and L1510 are
When the matrix 50 is filled with the corresponding elements in the matrices F1440 and E1430, and the matrix L1510 is filled with the corresponding elements in the matrices J1500 and I1490, the 4x3 matrix (A) 1400 is integrated.
The elements from the two original 3x3 matrices that make up
They will be included in sorted order. The weighted filter value 1470 for the upper 3x3 matrix is the matrix G1
The sorted elements in 450 are weighted (K)
Calculated by adding the product multiplied by the corresponding element in 1460. The weighted filter value 1520 for the lower 3x3 matrix is calculated by adding the product of the sorted elements in matrix L1510 multiplied by the corresponding elements in weight matrix (K) 1460.

【0033】図22ないし図25は、全体として、4x
Vの完全なソートのベクトル演算および2xVの加重フ
ィルタ値の計算を示すフロー・チャートである。これら
4枚の図は、機能的に図10および図11と置き換え、
図9の内側ループに挿入するものであることを注記して
おく。図10および図11に示した方法は、重みマトリ
クス(K)が中心を除く全要素に0を含み、中心に1を
含む、特殊な最適化された場合として見なすことができ
る。
FIGS. 22 to 25 show a 4 ×
5 is a flow chart showing a vector operation for a complete sort of V and the calculation of a weighted filter value of 2 × V. These four figures are functionally replaced with FIGS. 10 and 11,
Note that it is inserted into the inner loop of FIG. The methods shown in FIGS. 10 and 11 can be viewed as a special optimized case where the weight matrix (K) contains 0 for all elements except the center and 1 for the center.

【0034】内側本体は、ステップ620から開始し、
4つのベクトル・レジスタにロードする。即ち、ステッ
プ1530において、行A1 には指定された行および列
から始まるV個の要素をロードする。ここでVはベクト
ル長である。行A2 には、次の行(行+1)および現在
の列から始まるV個の要素をロードする。行A3 には、
3番目の行(行+2)および現在の列から始まるV個の
要素をロードする。行A4 には、4番目の行(行+3)
および現在の列から始まるV個の要素をロードする。
The inner body starts at step 620,
Load four vector registers. That is, in step 1530, the row A 1 loads the V-number of elements starting from the specified row and column. Here, V is the vector length. To the line A 2 is, to load the V-number of elements starting from the next row (row + 1) and the current column. In line A 3 is,
Load the V elements starting at the third row (row + 2) and the current column. In line A 4 is the fourth row (row +3)
And V elements starting from the current column.

【0035】最初に、2つの新たな行を計算する。ステ
ップ1540において、行Bは行A2 ,A3 に対する各
列からの最少要素を含み、行Cは行A2 ,A3 に対する
各列からの最大要素を含む。これらの計算は、V個の対
の入力オペランドを利用してV個の結果を並列に生成す
るSIMDベクトル最少および最大関数(SIMD vectormi
nimum and maximum functions) を利用すると、効率的
に算出できることを注記しておく。次に、第1の中間3
xVマトリクス(D)を形成する。即ち、ステップ15
50において、その第1行(D1 )は、行A1 ,A2
3 におけるV個の列の各々からの最小値を含み、その
第2行(D2 )は、行A1 ,A2 ,A3におけるV個の
列の各々からの中央値を含み、その第3行(D3 )は、
行A1 ,A2 ,A3 におけるV個の列の各々からの最大
値を含む。行A1 ,A2 ,A3 に対する各列の最少要素
は、行A1 ,Bの最小を取ることによって計算する。行
1 ,B,Cに対する各列の中央要素は、行A1 ,Bの
最大値、あるいは行A1 ,Cの最小値を計算することに
よって算出することができる。行に対する各列の最大要
素は、行A1 ,Cの最大値を取ることによって計算す
る。
First, two new rows are calculated. In step 1540, includes a minimal elements from each column for a row B row A 2, A 3, including the maximum elements from each column for a row C row A 2, A 3. These calculations are based on SIMD vectormimic functions that use V pairs of input operands to generate V results in parallel.
It should be noted that the calculation can be performed efficiently by using (nimum and maximum functions). Next, the first intermediate 3
An xV matrix (D) is formed. That is, step 15
At 50, the first row (D 1 ) includes rows A 1 , A 2 ,
The second row (D 2 ) contains the minimum value from each of the V columns in A 3, and contains the median value from each of the V columns in rows A 1 , A 2 , A 3 , and The third line (D 3 )
Contains the maximum value from each of the V columns in rows A 1 , A 2 , A 3 . The minimum element of each column for rows A 1 , A 2 , A 3 is calculated by taking the minimum of rows A 1 , B. The central element of each column for rows A 1 , B, and C can be calculated by calculating the maximum value of rows A 1 and B or the minimum value of rows A 1 and C. The maximum element of each column for a row is calculated by taking the maximum value of rows A 1 and C.

【0036】次に、第1の3−ベクトル中間マトリクス
(E1j)を形成する。即ち、このマトリクスにおける第
1ベクトル(E11)は、最小要素を含み、第2ベクトル
(E12)は中央要素を含み、第3ベクトル(E13)は最
大要素を含む。ステップ1560において、第1ベクト
ル(E11)を計算する際、行D1 の最初の(V−1)個
の要素と連結された、行Prev_D1 の最後の1つの要素を
含む行D1Sをロードし、行D1 の最初の(V−2)要素
と連結された、行Prev_D1 の最後の2つの要素を含む行
1SS をロードし、行E11は、行D1 ,D1S,D1SS
対するV個の列の各々における最小要素を含むように計
算し、行E12は、行D1 ,D1S,D1SSに対するV個の
列の各々における中央要素を含むように計算し、行E13
は、行D1 ,D1S,D1SS に対するV個の列の各々にお
ける最大要素を含むように計算する。
Next, a first 3-vector intermediate matrix (E 1j ) is formed. That is, the first vector (E 11 ) in this matrix contains the smallest element, the second vector (E 12 ) contains the central element, and the third vector (E 13 ) contains the largest element. In step 1560, when calculating the first vector (E 11), is connected with the first (V-1) number of elements in the row D 1, the line D 1S including the last one element row Prev_D 1 loaded, linked with the first (V-2) elements in the row D 1, to load the line D 1SS containing the last two elements of the row Prev_D 1, row E 11 is the line D 1, D 1S, Calculate to include the smallest element in each of the V columns for D 1SS , and Row E 12 to include the central element in each of the V columns for rows D 1 , D 1S , D 1SS , Row E 13
Is calculated to include the largest element in each of the V columns for rows D 1 , D 1S , D 1SS .

【0037】同様に、第2の3−ベクトル中間マトリク
ス(E2j)を計算する場合、ステップ1570におい
て、行D2 の最初の(V−1)個の要素と連結された、
行Prev_D2 の最後の1つの要素を含む行D2Sをロード
し、行D2 の最初の(V−2)個の要素と連結された、
行Prev_D2 の最後の2つの要素を含む行D2SS をロード
し、行E21は、行D2 ,D2S,D2SS に対するV個の列
の各々における最小要素を含むように計算し、行E
22は、行D2 ,D2S,D2SS に対するV個の列の各々に
おける中央要素を含むように計算し、行E23は、行D
2 ,D2S,D2SS に対するV個の列の各々における最大
要素を含むように計算する。
Similarly, when calculating the second 3-vector intermediate matrix (E 2j ), at step 1570, the first (V-1) elements of row D 2 are concatenated with
Load the line D 2S containing the last one element row Prev_D 2, coupled with the first (V-2) number of elements in the row D 2,
Load row D 2SS containing the last two elements of row Prev_D 2 and calculate row E 21 to include the smallest element in each of the V columns for rows D 2 , D 2S , D 2SS , E
22 is calculated to include the central element in each of the V columns for rows D 2 , D 2S , D 2SS , and row E 23 is
Calculate to include the largest element in each of the V columns for 2 , D2S , D2SS .

【0038】同様に、第3の3−ベクトル中間マトリク
ス(E3j)を計算する場合、ステップ1580におい
て、行D3 の最初の(V−1)個の要素と連結された、
行Prev_D3 の最後の1つの要素を含む行D3Sをロード
し、行D3 の最初の(V−2)個の要素と連結された、
行Prev_D3 の最後の2つの要素を含む行D3SS をロード
し、行E31は、行D3 ,D3S,D3SS に対するV個の列
の各々における最小要素を含むように計算し、行E
32は、行D3 ,D3S,D3SS に対するV個の列の各々に
おける中央要素を含むように計算し、行E33は、行D
3 ,D3S,D3SS に対するV個の列の各々における最大
要素を含むように計算する。
Similarly, when calculating the third 3-vector intermediate matrix (E 3j ), in step 1580, the first (V-1) elements of row D 3 are concatenated with
Load row D 3S containing the last one element of row Prev_D 3 , concatenated with the first (V−2) elements of row D 3 ,
Load row D 3SS containing the last two elements of row Prev_D 3 , and calculate row E 31 to include the smallest element in each of the V columns for rows D 3 , D 3S , D 3SS , E
32 is calculated to include the central element in each of the V columns for rows D 3 , D 3S , D 3SS , and row E 33 is
Calculate to include the largest element in each of the V columns for 3 , D3S , D3SS .

【0039】次に、第1組のY=X対角線マトリクス・
ベクトルを計算する。ステップ1590において、行F
13は、行E13,E22,E31に対するV個の列の各々にお
ける最小要素を含むように計算する。行F22は、行
13,E22,E31に対するV個の列の各々における中央
要素を含むように計算する。行F31は、行E13,E22
31に対するV個の列の各々における最大要素を含むよ
うに計算する。次に、第2組のY=X対角線マトリクス
・ベクトルを計算する。ステップ1600において、行
12は、行E12,E21に対するV個の列の各々における
最小要素を含むように計算し、行F21は、行E12,E21
に対するV個の列の各々における最大要素を含むように
計算する。次に、第3組のY=X対角線マトリクス・ベ
クトルを計算する。ステップ1610において、行F23
は、行E23,E32に対するV個の列の各々における最小
要素を含むように計算し、行F32は、行E23,E32に対
するV個の列の各々における最大要素を含むように計算
する。
Next, a first set of Y = X diagonal matrices
Compute the vector. In step 1590, row F
13 is calculated as including the smallest element in each of the V-number of columns for row E 13, E 22, E 31 . Row F 22 are calculated to include the central element in each of the V-number of columns for row E 13, E 22, E 31 . Row F 31, the row E 13, E 22,
Calculated as including the maximum element in each of the V-number of columns for E 31. Next, a second set of Y = X diagonal matrix vectors is calculated. In step 1600, the row F 12 are calculated to include the minimum element in each of the V-number of columns for row E 12, E 21, row F 21, the row E 12, E 21
To include the largest element in each of the V columns. Next, a third set of Y = X diagonal matrix vectors is calculated. In step 1610, row F 23
Is calculated to include the smallest element in each of the V columns for rows E 23 and E 32 , and row F 32 is to include the largest element in each of the V columns for rows E 23 and E 32 . calculate.

【0040】次に、第1組の2* Y=X対角線マトリク
ス・ベクトルを計算する。即ち、ステップ1620にお
いて、行F13,F21に対するV個の列の各々における最
小要素を含むように行G13を計算し、行F13,F21に対
するV個の列の各々における最大要素を含むように行G
21を計算する。次に、第2組の2* Y=X対角線マトリ
クス・ベクトルを計算する。即ち、ステップ1630に
おいて、行F23,F3 1 に対するV個の列の各々におけ
る最小要素を含むように行G23を計算し、行F23,F31
に対するV個の列の各々における最大要素を含むように
行G31を計算する。
Next, a first set of 2 * Y = X diagonal matrix vectors is calculated. That is, in step 1620, the line G 13 calculated to include the minimum element in each of the V-number of columns for row F 13, F 21, the maximum element in each of the V-number of columns for row F 13, F 21 Row G to include
Calculate 21 . Next, a second set of 2 * Y = X diagonal matrix vectors is calculated. That is, in step 1630, the line G 23 calculated to include the minimum element in each of the V-number of columns for row F 23, F 3 1, row F 23, F 31
Calculating the line G 31 to include a maximum element in each of the V-number of columns for.

【0041】重みマトリクス(K)と対応するソートし
たベクトルとの積の和を、左に1位置だけずらすことに
よって、得られた上側の3xVマトリクスに対する加重
フィルタ値のベクトルを算出する。即ち、ステップ16
40において、結果=K11 *(行)E11+K12 * (行)
12+K13 * (行)G13+K21 * (行)G21+K
22 *(行)F22+K23 * (行)G23+K31 * (行)G31
+K32 * (行)F32+K33 *(行)E33となる。最後
に、ステップ1650において、行D1 をベクトルPrev
_D1 にセーブし、行D2 をベクトルPrev_D2 にセーブ
し、行D3 をベクトルPrev_D3 にセーブする。下側の組
のV個の重複3x3マトリクスにおけるV組の9つの数
値に対する加重フィルタ値のベクトルを計算するために
利用する方法および装置も同様である。しかしながら、
共有行B,Cに対する計算は、この算出では共有される
ことを注記しておく。この共有は、行A2 ,A3 が、2
組のV個の3x3マトリクス間で共有されるからであ
る。まず、ステップ1660において、第1の中間3x
Vマトリクス(H)を形成する。即ち、ステップ167
0において、その第1行(H1 )は行A2 ,A3 ,A4
におけるV個の列の各々からの最小値を含み、その第2
行(H2 )は行A2 ,A3 ,A4 におけるV個の列の各
々からの中央値を含み、その第3行(H3 )は行A2
3 ,A4 におけるV個の列の各々からの最大値を含
む。行A4 ,Bの最小値を計算することによって、行A
2 ,A3 ,A4に対する各列の最小要素を算出する。行
2 ,A3 ,A4 に対する各列の中央要素は、行A4
Bの最大値または行A4 ,Cの最小値のいずれかを計算
することによって算出することができる。行A2 ,A
3 ,A4 に対する各列の最大要素は、行A4 ,Cの最大
値を計算することによって算出する。
By shifting the sum of the product of the weight matrix (K) and the corresponding sorted vector by one position to the left, a vector of the obtained weighted filter values for the upper 3 × V matrix is calculated. That is, step 16
At 40, the result = K 11 * (row) E 11 + K 12 * (row)
F 12 + K 13 * (row) G 13 + K 21 * (row) G 21 + K
22 * (row) F 22 + K 23 * (row) G 23 + K 31 * (row) G 31
+ K 32 * (line) F 32 + K 33 * (line) E 33 Finally, in step 1650, the row D 1 vector Prev
Saved in _D 1, save the line D 2 in vector Prev_D 2, saving the line D 3 vector Prev_D 3. The same applies to the method and apparatus used to calculate the vector of weighted filter values for the V sets of 9 values in the lower set of V overlapping 3x3 matrices. However,
Note that the calculations for shared rows B and C are shared in this calculation. This sharing shows that rows A 2 and A 3 are 2
This is because the set of V 3 × 3 matrices is shared. First, in step 1660, the first intermediate 3x
A V matrix (H) is formed. That is, step 167
0, the first row (H 1 ) is the row A 2 , A 3 , A 4
, Including the minimum value from each of the V columns in
Row (H 2 ) contains the median from each of the V columns in rows A 2 , A 3 , A 4 , and the third row (H 3 ) contains rows A 2 ,
Contains the maximum value from each of the V columns in A 3 , A 4 . By calculating the minimum of rows A 4 and B,
2, to calculate the minimum element of each column for A 3, A 4. The central element of each column for rows A 2 , A 3 , A 4 is the row A 4 ,
It can be calculated by calculating either the maximum value of B or the minimum value of rows A 4 and C. Row A 2 , A
The maximum element of each column for 3 and A 4 is calculated by calculating the maximum value of rows A 4 and C.

【0042】次に、第1の3−ベクトル中間マトリクス
(I1j)を形成する。このマトリクスの第1ベクトル
(I11)は最小要素を含み、第2ベクトル(I12)は中
央要素を含み、第3ベクトル(I13)最大要素を含む。
ステップ1680において、第1ベクトル(I11)を計
算する際、行H1 の最初の(V−1)個の要素と連結さ
れた、行Prev_H1 の最後の1つの要素を含む行H1Sをロ
ードし、行H1 の最初の(V−2)個の要素と連結され
た、行Prev_H1 の最後の2つの要素を含む行H1SS をロ
ードし、行H1 ,H1S,H1SS に対するV個の列の各々
における最小要素を含むように行I11を計算し、行H
1 ,H1S,H1SS に対するV個の列の各々における中央
要素を含むように行I12を計算し、行H1 ,H1S,H
1SS に対するV個の列の各々における最大要素を含むよ
うに行I13を計算する。
Next, a first 3-vector intermediate matrix (I 1j ) is formed. The first vector (I 11 ) of this matrix contains the smallest element, the second vector (I 12 ) contains the central element, and the third vector (I 13 ) contains the largest element.
In step 1680, when calculating first vector (I 11), connected with the first (V-1) number of elements in the row H 1, row H 1S including the last one element row prev_h 1 load, is connected with the first (V-2) number of elements in the row H 1, load the line H 1SS containing the last two elements of the row prev_h 1, row H 1, H 1S, against H 1SS Calculate row I 11 to include the smallest element in each of the V columns,
1, H 1S, lines I 12 to include a central element in each of the V-number of rows calculated for H 1SS, rows H 1, H 1S, H
Calculating the line I 13 to include a maximum element in each of the V-number of columns for 1SS.

【0043】同様に、ステップ1690において、第2
の3−ベクトル中間マトリクス(I2j)を計算する場
合、行H2 の最初の(V−1)個の要素と連結された、
行Prev_H2 の最後の1つの要素を含む行H2Sをロード
し、行H2 の最初の(V−2)個の要素と連結された行
Prev_H2 の最後の2つの要素を含む行H2SS をロード
し、行H2 ,H2S,H2SS に対するV個の列の各々にお
ける最小要素を含むように行I21を計算し、行H2 ,H
2S,H2SS に対するV個の列の各々における中央要素を
含むように行I22を計算し、行H2 ,H2S,H2SS に対
するV個の列の各々における最大要素を含むように行I
23を計算する。
Similarly, in step 1690, the second
To calculate the three-vector intermediate matrix (I 2j ) of, concatenated with the first (V−1) elements of row H 2 ,
Load the line H 2S containing the last one element row prev_h 2, coupled with the first (V-2) number of elements in the row H 2 rows
Load row H 2SS containing the last two elements of Prev_H 2 , calculate row I 21 to include the smallest element in each of the V columns for rows H 2 , H 2S , H 2SS , and calculate row H 2 , H
2S, the line I 22 calculated to include the central element in each of the V-number of columns for H 2SS, row H 2, H 2S, line to include the maximum element in each of the V-number of columns for H 2SS I
Calculate 23 .

【0044】同様に、ステップ1700において、第3
の3−ベクトル中間マトリクス(I3j)を計算する場
合、行H3 の最初の(V−1)個の要素と連結された、
行Prev_H3 の最後の1つの要素を含む行H3Sをロード
し、行H3 の最初の(V−2)個の要素と連結された、
行Prev_H3 の最後の2つの要素を含む行H3SS をロード
し、行H3 ,H3S,H3SS に対するV個の列の各々にお
ける最小要素を含むように行I31を計算し、行H3 ,H
3S,H3SS に対するV個の列の各々における中央要素を
含むように行I32を計算し、行H3 ,H3S,H3SS に対
するV個の列の各々における最大要素を含むように行I
33を計算する。
Similarly, in step 1700, the third
When calculating of 3-vector intermediate matrix (I 3j), connected with the first (V-1) number of elements in the row H 3,
Load the line H 3S including the last one element row prev_h 3, connected with the first (V-2) number of elements in the row H 3,
Load row H 3SS containing the last two elements of row Prev_H 3 and calculate row I 31 to include the smallest element in each of the V columns for rows H 3 , H 3S , H 3SS , 3 , H
Calculate row I 32 to include the central element in each of the V columns for 3S , H 3SS and row I 32 to include the largest element in each of the V columns for rows H 3 , H 3S , H 3SS .
Calculate 33 .

【0045】次に、第1組のY=X対角線マトリクス・
ベクトルを算出する。即ち、ステップ1710におい
て、行I13,I22,I31に対するV個の列の各々におけ
る最小要素を含むように行J13を計算し、行I13
22,I31に対するV個の列の各々における中央要素を
含むように行J22を計算し、行I13,I22,I31に対す
るV個の列の各々における最大要素を含むように行J31
を計算する。次に、第2組のY=X対角線マトリクス・
ベクトルを算出する。即ち、ステップ1720におい
て、行I12,I21に対するV個の列の各々における最小
要素を含むように行J12を計算し、行I12,I21に対す
るV個の列の各々における最大要素を含むように行J21
を計算する。次に、第3組のY=X対角線マトリクス・
ベクトルを計算する。即ち、ステップ1730におい
て、行I23,I32に対するV個の列の各々における最小
要素を含むように行J23を計算し、行I23,I32に対す
るV個の列の各々における最大要素を含むように行J32
を計算する。
Next, the first set of Y = X diagonal matrices
Calculate the vector. That is, in step 1710, the row J 13 calculated to include the minimum element in each of the V-number of columns for row I 13, I 22, I 31 , row I 13,
The line J 22 calculated to include a central element in each of the V-number of columns for I 22, I 31, line to include the maximum element in each of the V-number of columns for row I 13, I 22, I 31 J 31
Is calculated. Next, a second set of Y = X diagonal matrices
Calculate the vector. That is, in step 1720, the row J 12 calculated to include the minimum element in each of the V-number of columns for row I 12, I 21, the maximum element in each of the V-number of columns for row I 12, I 21 Line J 21 to include
Is calculated. Next, a third set of Y = X diagonal matrices
Compute the vector. That is, in step 1730, the row J 23 calculated to include the minimum element in each of the V-number of columns for row I 23, I 32, the maximum element in each of the V-number of columns for row I 23, I 32 row J 32 so as to include
Is calculated.

【0046】次に、第1組の2* Y=X対角線マトリク
ス・ベクトルを算出する。即ち、ステップ1740にお
いて、行J13,J21に対するV個の列の各々における最
小要素を含むように行L13を計算し、行J13,J21に対
するV個の列の各々における最大要素を含むように行L
21を計算する。次に、第2組の2* Y=X対角線マトリ
クス・ベクトルを算出する。即ち、ステップ1750に
おいて、行J23,J31に対するV個の列の各々における
最小要素を含むように行L23を計算し、行J23,J31
対するV個の列の各々における最大要素を含むように行
31を計算する。
Next, a first set of 2 * Y = X diagonal matrix vectors is calculated. That is, in step 1740, the line L 13 calculated to include the minimum elements in each of the V column for the row J 13, J 21, the maximum element in each of the V-number of columns for row J 13, J 21 Row L to include
Calculate 21 . Next, a second set of 2 * Y = X diagonal matrix vectors is calculated. That is, in step 1750, the line L 23 calculated to include the minimum elements in each of the V column for the row J 23, J 31, the maximum element in each of the V-number of columns for row J 23, J 31 calculating the line L 31 to contain.

【0047】重みマトリクス(K)と対応するソートし
たベクトルとの積の和を、左に1位置だけずらすことに
よって、得られた下側の3xVマトリクスに対する加重
フィルタ値のベクトルを算出する。即ち、ステップ17
60において、結果=K11 *(行)I11+K12 * (行)
12+K13 * (行)L13+K21 * (行)L21+K
22 *(行)J22+K23 * (行)L23+K31 * (行)L31
+K32 * (行)J32+K33 *(行)I33となる。最後
に、ステップ1770において、行H1 をベクトルPrev
_H1 にセーブし、行H2 をベクトルPrev_H2 にセーブ
し、行H3 をベクトルPrev_H3 にセーブする。次いで、
本方法はステップ740に進み、図9における内側ルー
プを繰り返す。
By shifting the sum of the products of the weight matrix (K) and the corresponding sorted vectors by one position to the left, a vector of the obtained weighted filter values for the lower 3 × V matrix is calculated. That is, step 17
At 60, the result = K 11 * (row) I 11 + K 12 * (row)
J 12 + K 13 * (row) L 13 + K 21 * (row) L 21 + K
22 * (row) J 22 + K 23 * (row) L 23 + K 31 * (row) L 31
+ K 32 * (line) J 32 + K 33 * (line) I 33 . Finally, in step 1770, the row H 1 vector Prev
Saved in _H 1, save the line H 2 vector prev_h 2, saving the line H 3 vector prev_h 3. Then
The method proceeds to step 740 and repeats the inner loop in FIG.

【0048】図26および図27は、全体として、図2
2ないし図25に示した方法の動作の一例を示す。入力
行A1 ,A2 ,A3 ,A4 1785から開始し、ステッ
プ1540において、行A2 ,A3 の最小値および最大
値として、行B,C1800を算出する。行Prev_D1
Prev_D2 ,Prev_D3 1780は、内側ループ590の直
前の繰り返しから得ることができる。ステップ1550
において、行A1 ,A2 ,A3 の最小値,中央値,およ
び最大値として、行D1 ないしD3 1810を計算す
る。ステップ1560において、行D1 をシフトし、行
1S,D1SS 1820としてセーブし、行E11,E12
131830を、行D1 ,D1S,D1SS 1820の最小
値,中央値,および最大値としてそれぞれ計算する際に
用いる。ステップ1570において、行D2 をシフト
し、行D2S,D2SS 1840としてセーブし、行E21
22,E231850を、行D2 ,D2S,D2SS 1840
の最小値,中央値,および最大値としてそれぞれ計算す
る際に用いる。ステップ1580において、行D3 をシ
フトし、行D3S,D3SS 1860としてセーブし、行E
31,E32,E331870を、行D3 ,D3S,D3SS 18
60の最小値,中央値,および最大値としてそれぞれ計
算する際に用いる。
FIGS. 26 and 27 show the overall structure of FIG.
An example of the operation of the method shown in FIGS. Starting from the input rows A 1 , A 2 , A 3 , A 4 1785, in step 1540, the rows B and C 1800 are calculated as the minimum and maximum values of the rows A 2 and A 3 . Row Prev_D 1 ,
Prev_D 2 , Prev_D 3 1780 can be obtained from the previous iteration of inner loop 590. Step 1550
, The rows D 1 to D 3 1810 are calculated as the minimum, median, and maximum of the rows A 1 , A 2 , A 3 . In step 1560, row D 1 is shifted and saved as rows D 1S , D 1SS 1820 and rows E 11 , E 12 ,
E 13 1830 is used in calculating the minimum value, the median value, and the maximum value of the rows D 1 , D 1S , and D 1SS 1820, respectively. In step 1570, row D 2 is shifted and saved as rows D 2S , D 2SS 1840 and rows E 21 ,
E 22 and E 23 1850 are added to rows D 2 , D 2S and D 2SS 1840
It is used when calculating as the minimum value, median value, and maximum value, respectively. In step 1580, row D 3 is shifted, saved as rows D 3S , D 3SS 1860, and row E 3
31 , E 32 , and E 33 1870 are added to rows D 3 , D 3S , and D 3SS 18
It is used when calculating the minimum value, median value, and maximum value of 60, respectively.

【0049】次に、Y=X対角線要素をソートする。ス
テップ1590において、行F13,F22,F311880
を、行E13,E22,E31の最大値,中央値,最大値とし
てそれぞれ算出する。ステップ1600において、行F
12,F211890を、行E12,E21の最小値および最大
値としてそれぞれ算出する。ステップ1610におい
て、行F23,F321900を、行E23,E32の最小値お
よび最大値としてそれぞれ算出する。これに続いて、2
* Y=X対角線要素をソートする。ステップ1620に
おいて、行G13,G211910を、行F13,F21の最小
値および最大値としてそれぞれ算出する。ステップ16
30において、行G23,G311920を、行F23,F31
の最小値および最大値としてそれぞれ算出する。次に、
ステップ1640において、E,F,およびGマトリク
ス行からの対応する要素に、重みマトリクスK1790
における対応するエントリを乗算した積を加算すること
によって、得られた上側の3xVマトリクスに対する加
重フィルタ・ベクトル1930を算出する。最後に、ス
テップ1650において、D1 ,D2 ,D3 行1810
を、行Prev_D1 ,Prev_D2 ,Prev_D3 としてセーブし、
次のループの繰り返しの間にD1 ,D2 ,D3 行1 8
10に対するシフト値を計算する際に用いる。下側の3
xVマトリクスの算出も同様である。行Prev_H1 ,Prev
_H2 ,Prev_H31940は、内側ループ590の直前の
繰り返しから得ることができる。ステップ1670にお
いて、行A2 ,A3 ,A4 の最小値,中央値,および最
大値として、行H1 ,H2 ,H3 1950を算出する。
ステップ1680において、行H1 をシフトし、行
1S,H1SS 1960としてセーブし、行I11,I12
131970を、行H11,H12,H131960の最小
値,中央値,および最大値としてそれぞれ計算する際に
用いる。ステップ1690において、行H2 をシフト
し、行H2S,H2SS 1980としてセーブし、行I21
22,I231990を、行H2 ,H2S,H2SS 1980
の最小値,中央値,および最大値としてそれぞれ計算す
る際に用いる。ステップ1700において、行H3 をシ
フトし、行H3S,H3SS 2000としてセーブし、行I
31,I32,I332010を、行H3 ,H3S,H3SS の最
小値,中央値,および最大値としてそれぞれ計算する際
に用いる。
Next, the Y = X diagonal elements are sorted. In step 1590, the row F 13, F 22, F 31 1880
Are calculated as the maximum value, the median value, and the maximum value of the rows E 13 , E 22 and E 31 , respectively. In step 1600, row F
12 and F 21 1890 are calculated as the minimum and maximum values of the rows E 12 and E 21 , respectively. In step 1610, the row F 23, F 32 1900, calculated respectively as minimum and maximum values of the row E 23, E 32. Following this, 2
* Sort Y = X diagonal elements. In step 1620, the row G 13, G 21 1910, calculated respectively as minimum and maximum values of the row F 13, F 21. Step 16
30, rows G 23 and G 31 1920 are replaced with rows F 23 and F 31
Is calculated as the minimum value and the maximum value, respectively. next,
At step 1640, the corresponding elements from the E, F, and G matrix rows are assigned weight matrix K1790.
Are calculated by adding the products multiplied by the corresponding entries in the above 3xV matrix. Finally, in step 1650, D 1, D 2, D 3 , line 1810
As the lines Prev_D 1 , Prev_D 2 , Prev_D 3 ,
D 1 , D 2 , D 3 rows 18 during the next loop iteration
Used when calculating the shift value for 10. Lower 3
The same applies to the calculation of the xV matrix. Row Prev_H 1 , Prev
_H 2 , Prev_H 3 1940 can be obtained from the immediately preceding iteration of inner loop 590. In step 1670, the rows H 1 , H 2 , and H 3 1950 are calculated as the minimum value, the median value, and the maximum value of the rows A 2 , A 3 , and A 4 .
In step 1680, row H 1 is shifted and saved as rows H 1S , H 1SS 1960, and rows I 11 , I 12 ,
I 13 1970 is used in calculating the minimum value, the median value, and the maximum value of the rows H 11 , H 12 , and H 13 1960, respectively. In step 1690, row H 2 is shifted and saved as rows H 2S , H 2SS 1980 and row I 21 ,
I 22 and I 23 1990 are assigned to rows H 2 , H 2S and H 2SS 1980
It is used when calculating as the minimum value, median value, and maximum value, respectively. In step 1700, row H 3 is shifted and saved as rows H 3S , H 3SS 2000 and row I 3
31 , I 32 , and I 33 2010 are used in calculating the minimum value, the median value, and the maximum value of the rows H 3 , H 3S , and H 3SS , respectively.

【0050】次に、Y=X対角線要素をソートする。ス
テップ1710において、行J13,J22,J312020
を、行I13,I22,I31の最小値,中央値,最大値とし
てそれぞれ算出する。ステップ1720において、行J
12,J212030を、行I12,I21の最小値および最大
値としてそれぞれ算出する。ステップ1730におい
て、行J23,J322040を、行I23,I32の最小値お
よび最大値としてそれぞれ算出する。これに続いて、2
* Y=X対角線要素をソートする。ステップ1740に
おいて、行L13,L212050を、行J13,J21の最小
値および最大値としてそれぞれ算出する。ステップ17
50において、行L23,L312060を、行J23,J31
の最小値および最大値としてそれぞれ算出する。次に、
ステップ1760において、I,J,およびLマトリク
ス行からの対応する要素に、重みマトリクスK1790
における対応するエントリを乗算した積を加算すること
によって、得られた下側の3xVマトリクスに対する加
重フィルタ・ベクトル2070を算出する。最後に、ス
テップ1770において、H1 ,H2 ,H3 行1950
を、行Prev_H1 ,Prev_H2 ,Prev_H3 としてセーブし、
次のループの繰り返しの間にH1 ,H2 ,H3 行181
0に対するシフト値を計算する際に用いる。
Next, the Y = X diagonal elements are sorted. In step 1710, rows J 13 , J 22 , J 31 2020
Are calculated as the minimum value, the median value, and the maximum value of the rows I 13 , I 22 , and I 31 , respectively. At step 1720, row J
12 and J 21 2030 are calculated as the minimum value and the maximum value of the rows I 12 and I 21 , respectively. In step 1730, the rows J 23 and J 32 2040 are calculated as the minimum and maximum values of the rows I 23 and I 32 , respectively. Following this, 2
* Sort Y = X diagonal elements. In step 1740, the line L 13, L 21 2050, calculated respectively as minimum and maximum values of the row J 13, J 21. Step 17
At 50, rows L 23 and L 31 2060 are replaced with rows J 23 and J 31
Is calculated as the minimum value and the maximum value, respectively. next,
In step 1760, the corresponding elements from the I, J, and L matrix rows are weighted K1790
To calculate the weighted filter vector 2070 for the resulting lower 3xV matrix. Finally, in step 1770, H 1, H 2, H 3 , line 1950
As the lines Prev_H 1 , Prev_H 2 , Prev_H 3 ,
H 1, H 2 during the next iteration of the loop, H 3 rows 181
Used when calculating the shift value for 0.

【0051】当業者には、上述の方法の異なる置換も明
白であろう。図16,図19および図20,ならびに図
22ないし図25にフローチャートとして示した方法は
全て、結果として、行を大きい順にソートしたマトリク
スを生成する。これらの方法は、標準的な最適化技法を
用いて、あらゆる不要な要素を排除することによって計
算する要素のランク数を減らし、簡略化することができ
る。何故なら、全てのランク要素は、これらの図の方法
によって計算したからである。かかる簡略化の結果の1
つが、図3、図6、ならびに図10および図11のフロ
ーチャートに関して先に開示した中央フィルタ値の計算
方法である。
Different permutations of the above-described methods will be apparent to those skilled in the art. The methods illustrated in the flowcharts of FIGS. 16, 19 and 20 and FIGS. 22-25 all result in a matrix with the rows sorted in descending order. These methods can reduce and simplify the number of ranks of the calculated elements by eliminating any unnecessary elements using standard optimization techniques. This is because all rank elements were calculated by the method of these figures. One of the results of this simplification
One is the method of calculating the median filter value disclosed above with reference to FIGS. 3, 6, and the flowcharts of FIGS.

【0052】図28は、3x3,4x3,3xV,およ
び4xVマトリクスに格納された9つの要素に対する中
央値および加重フィルタ値の効率的な算出のために、こ
こに開示した方法を実施する際に使用可能な汎用コンピ
ュータ20を示すブロック図である。汎用コンピュータ
20は、バス26によって接続されたコンピュータ・プ
ロセッサ22およびメモリ24を有する。メモリ24
は、DRAM,SRAM,ROM,FLASH,EEP
ROM,およびバブル・メモリのような、比較的高速な
機械読み取り可能媒体を含む。また、バスには、二次記
憶装置30,外部記憶装置32,モニタ34のような出
力デバイス,キーボード(マウス付き)36のような入
力デバイス,およびプリンタ38が接続されている。二
次記憶装置30は、ハード・ディスク・ドライバ,磁気
ドラム,およびバブル・メモリのような機械読み取り可
能媒体を含む。外部記憶装置32は、フロッピ・ディス
ク,リムーバブル・ハード・ドライブ,磁気テープ,C
D−ROMのような機械読み取り可能媒体,および通信
回線を通じて接続可能な、他のコンピュータをも含む。
ここで二次記憶装置30と外部記憶装置32との間に設
ける区別は、主に本発明を説明する際の都合によるもの
である。したがって、これらの構成要素にはかなりの機
能的な重複があることは認められよう。3x3,4x
3,3xV,および4xVマトリクスに格納された9つ
の要素に対する中央値および加重フィルタ値の計算のた
めにここに開示した方法を実施するプログラムのよう
な、コンピュータ・プログラム33の実行可能なバージ
ョンは、外部記憶装置32から読み込み、メモリ34に
直接読み込んで実行することができ、あるいは実行のた
めにメモリ34にロードする前に、二次記憶装置30上
に格納することも可能である。ここに開示した方法は、
図28に示すような従来の単一命令単一データ(SIS
D)プロセッサを用いて、3x3,4x3,3xV,お
よび4xVマトリクスに格納された9つの要素に対する
中央値および加重フィルタ値の効率的な算出を可能にす
るものであるが、これらは、単一命令多数データ(SI
MD)ベクトル・プロセッサと共に用いる場合に特に有
用である。最大および最小ベクトル演算に対応するかか
るSIMDプロセッサの1つが、"Data Processing Sys
tem and Method Thereof" と題するMichael Gallup, et
al.の米国特許番号第5,600,846号に開示され
ている。この特許は、本願の譲受人に譲渡され、本願に
おいても使用可能である。
FIG. 28 illustrates the use of the disclosed method for efficient calculation of median and weighted filter values for nine elements stored in 3x3, 4x3, 3xV, and 4xV matrices. FIG. 2 is a block diagram illustrating a possible general-purpose computer 20. The general-purpose computer 20 has a computer processor 22 and a memory 24 connected by a bus 26. Memory 24
Means DRAM, SRAM, ROM, FLASH, EEP
Includes relatively high speed machine readable media, such as ROM and bubble memory. The bus is connected to a secondary storage device 30, an external storage device 32, an output device such as a monitor 34, an input device such as a keyboard (with a mouse) 36, and a printer 38. Secondary storage 30 includes machine readable media such as hard disk drivers, magnetic drums, and bubble memory. The external storage device 32 includes a floppy disk, a removable hard drive, a magnetic tape,
It also includes a machine-readable medium such as a D-ROM, and other computers connectable through a communication line.
Here, the distinction provided between the secondary storage device 30 and the external storage device 32 is mainly for convenience in describing the present invention. Thus, it will be appreciated that there is considerable functional overlap between these components. 3x3,4x
An executable version of computer program 33, such as a program that implements the methods disclosed herein for calculating median and weighted filter values for nine elements stored in 3,3xV, and 4xV matrices, is: It can be read from the external storage device 32 and read directly into the memory 34 for execution, or it can be stored on the secondary storage device 30 before being loaded into the memory 34 for execution. The method disclosed here:
Conventional single instruction single data (SIS) as shown in FIG.
D) Using a processor to allow efficient calculation of median and weighted filter values for the nine elements stored in the 3x3, 4x3, 3xV, and 4xV matrices, which are single instruction Many data (SI
It is particularly useful when used with an MD) vector processor. One such SIMD processor that supports maximum and minimum vector operations is the "Data Processing Sys
Michael Gallup, et entitled "tem and Method Thereof"
al. in U.S. Patent No. 5,600,846. This patent is assigned to the assignee of the present application and can be used herein.

【0053】本発明の精神から逸脱することなく、変更
や変様が可能であることを当業者は認めよう。したがっ
て、本発明は、特許請求の範囲に該当するような変様や
変更は全て包含することを意図する。
Those skilled in the art will recognize that changes and modifications may be made without departing from the spirit of the invention. Accordingly, the present invention is intended to embrace all such modifications and changes as fall within the scope of the appended claims.

【0054】ここでは、請求項の構成要素および段階に
は参照番号および/または参照符号を付してあるが、こ
れは読解容易性(readability) および理解を助けるため
に過ぎない。したがって、参照番号および/または参照
符号を付すること自体は、特許請求の範囲における構成
要素および/または段階の順序を示すことを意図するも
のでなく、かつそのように解釈すべきではない。
[0054] Wherein, elements and steps in the claims are provided with a reference numeral and / or reference numeral, but only to aid readability and understanding. Accordingly, the use of reference numerals and / or reference signs in their own right is not intended to and should not be construed as indicating the order of the components and / or steps in the claims.

【図面の簡単な説明】[Brief description of the drawings]

【図1】画像スキャナ,デジタル・カメラ,コピー機,
レーザ・プリンタ,ビデオ・モニタ,およびFAX機械
によって受信されるような二次元ラスタ画像を示す図。
Fig. 1 Image scanner, digital camera, copier,
FIG. 2 illustrates a two-dimensional raster image as received by a laser printer, video monitor, and fax machine.

【図2】中央値または加重ランク・フィルタを計算する
ために用いられる画素の3x3マトリクスを示す図。
FIG. 2 shows a 3 × 3 matrix of pixels used to calculate a median or weighted rank filter.

【図3】本発明にしたがって、3x3マトリクスに組織
化された9つの数値の中央値を求める方法を示すフロー
チャート。
FIG. 3 is a flowchart illustrating a method for determining the median of nine numerical values organized in a 3 × 3 matrix according to the present invention.

【図4】図3に示す方法を利用して、9つの数値の中央
値を求める一例を示す図。
FIG. 4 is a diagram showing an example of obtaining a median of nine numerical values using the method shown in FIG. 3;

【図5】2つの重複3x3マトリクスを表す4x3マト
リクスを示す図。
FIG. 5 shows a 4 × 3 matrix representing two overlapping 3 × 3 matrices.

【図6】図5に示す2つの重複3x3マトリクスに対し
て中央値の生成を可能とする、本発明による図3の方法
の最適化を示すフローチャート。
FIG. 6 is a flow chart illustrating the optimization of the method of FIG. 3 according to the present invention, which allows the generation of a median for the two overlapping 3 × 3 matrices shown in FIG. 5;

【図7】図6に示す方法の動作の一例を示す図。FIG. 7 is a view showing an example of the operation of the method shown in FIG. 6;

【図8】図6に示す方法のベクトル化による最適化を示
すために用いられる4xVマトリクスを示す図。
FIG. 8 is a diagram showing a 4 × V matrix used to show optimization by vectorization of the method shown in FIG. 6;

【図9】図10および図11と共に、本発明による、図
6に示す方法のベクトル化による最適化を示すフローチ
ャート。
FIG. 9 is a flow chart showing the optimization by vectorization of the method shown in FIG. 6 according to the present invention, in conjunction with FIGS. 10 and 11;

【図10】図9および図11と共に、本発明による、図
6に示す方法のベクトル化による最適化を示すフローチ
ャート。
10 is a flow chart showing the optimization by vectorization of the method shown in FIG. 6, according to the present invention, in conjunction with FIGS. 9 and 11. FIG.

【図11】図9および図10と共に、本発明による、図
6に示す方法のベクトル化による最適化を示すフローチ
ャート。
FIG. 11 is a flowchart showing the optimization by vectorization of the method shown in FIG. 6 according to the present invention, in conjunction with FIGS. 9 and 10;

【図12】図10および図11に示す方法の動作の一例
を示す図。
FIG. 12 is a diagram showing an example of the operation of the method shown in FIGS. 10 and 11;

【図13】9つの数値を完全にソートする方法を示すた
めの3x3マトリクスの図。
FIG. 13 is a diagram of a 3 × 3 matrix to show how to completely sort nine numerical values.

【図14】9つのソートした数値を利用した加重フィル
タ処理を示すための3x3係数マトリクスの図。
FIG. 14 is a diagram of a 3 × 3 coefficient matrix for illustrating a weighted filtering process using nine sorted numerical values.

【図15】3x3マトリクスに組織化した9つの数値を
完全にソートする方法の動作を示す4個の3x3マトリ
クスの図。
FIG. 15 is a diagram of four 3 × 3 matrices illustrating the operation of a method for completely sorting nine numbers organized in a 3 × 3 matrix.

【図16】本発明にしたがって、9つの数値を完全にソ
ートし、次いで3X3マトリクスに組織化された9つの
数値の加重フィルタ値を計算する方法を示すフローチャ
ート。
FIG. 16 is a flowchart illustrating a method of completely sorting nine numbers and then calculating a weighted filter value of the nine numbers organized in a 3 × 3 matrix according to the present invention.

【図17】図16に示す方法の動作の一例を示す図。FIG. 17 is a diagram showing an example of the operation of the method shown in FIG. 16;

【図18】2つの重複3x3マトリクスを表す4x3マ
トリクスの図。
FIG. 18 is a diagram of a 4 × 3 matrix representing two overlapping 3 × 3 matrices.

【図19】本発明にしたがって、図18に示す4x3マ
トリクスに結合された2つの重複3x3マトリクスに対
する加重フィルタ値の生成を可能とする、図16に示す
方法の最適化を、図20と共に示すフローチャート。
FIG. 19 is a flowchart, together with FIG. 20, illustrating the optimization of the method shown in FIG. 16 to enable the generation of weighted filter values for two overlapping 3 × 3 matrices combined into the 4 × 3 matrix shown in FIG. 18 in accordance with the present invention. .

【図20】本発明にしたがって、図18に示す4x3マ
トリクスに結合された2つの重複3x3マトリクスに対
する加重フィルタ値の生成を可能とする、図16に示す
方法の最適化を、図19と共に示すフローチャート。
FIG. 20 is a flowchart, along with FIG. 19, of an optimization of the method shown in FIG. 16 to enable the generation of weighted filter values for two overlapping 3 × 3 matrices combined into the 4 × 3 matrix shown in FIG. 18 in accordance with the present invention. .

【図21】図19および図20に示す方法の動作の一例
を示す図。
FIG. 21 is a diagram showing an example of the operation of the method shown in FIGS. 19 and 20.

【図22】本発明による4xVの完全なソートおよび2
xVの加重フィルタ値の計算のベクトル演算を、図23
ないし図25と共に示すフローチャート。
FIG. 22: Complete 4 × V sort and 2 according to the invention
The vector operation for calculating the weighted filter value of xV is shown in FIG.
26 is a flowchart shown together with FIG.

【図23】本発明による4xVの完全なソートのベクト
ル演算および2xVの加重フィルタ値の計算を、図2
2、図24および図25と共に示すフローチャート。
FIG. 23 illustrates a vector operation of a 4 × V perfect sort and calculation of a 2 × V weighted filter value according to the present invention.
2, a flowchart shown together with FIGS. 24 and 25.

【図24】本発明による4xVの完全なソートのベクト
ル演算および2xVの加重フィルタ値の計算を、図2
2、図23および図25と共に示すフローチャート。
FIG. 24 shows a vector operation of a 4 × V perfect sort and calculation of a 2 × V weighted filter value according to the present invention.
2, a flowchart shown together with FIG. 23 and FIG. 25.

【図25】本発明による4xVの完全なソートのベクト
ル演算および2xVの加重フィルタ値の計算を、図22
ないし図24と共に示すフローチャート。
FIG. 25 illustrates a vector operation of a 4 × V perfect sort and calculation of a 2 × V weighted filter value according to the present invention.
25 is a flowchart shown together with FIG.

【図26】図22および図23に示す方法の動作の一例
を図27と共に示す図。
FIG. 26 is a diagram showing an example of the operation of the method shown in FIGS. 22 and 23 together with FIG. 27;

【図27】図22および図23に示す方法の動作の一例
を図26と共に示す図。
FIG. 27 is a view showing an example of the operation of the method shown in FIGS. 22 and 23 together with FIG. 26;

【図28】本明細書に開示した方法を実施するために使
用可能な汎用コンピュータを示すブロック図。
FIG. 28 is a block diagram illustrating a general-purpose computer that can be used to implement the methods disclosed herein.

【符号の説明】[Explanation of symbols]

20 汎用コンピュータ 22 コンピュータ・プロセッサ 24 メモリ 26 バス 30 二次記憶装置 32 外部記憶装置 33 コンピュータ・プログラム 34 モニタ 36 キーボード 100 二次元マトリクス 110 3x3マトリクス 200 3x3グリッド 220 ベクトル 230 中央値 310 4x3マトリクス 450 4x3マトリクス 470 第1の3x3中間マトリクス 480 第1中間ベクトル(M) 490 第1中央値 500 第2の3x3中間マトリクス 510 第2中間ベクトル(N) 520 第2中央値 530 4xVマトリクス Reference Signs List 20 general-purpose computer 22 computer processor 24 memory 26 bus 30 secondary storage device 32 external storage device 33 computer program 34 monitor 36 keyboard 100 two-dimensional matrix 110 3x3 matrix 200 3x3 grid 220 vector 230 median 310 4x3 matrix 450 4x3 matrix 470 First 3x3 intermediate matrix 480 First intermediate vector (M) 490 First median 500 Second 3x3 intermediate matrix 510 Second intermediate vector (N) 520 Second median 530 4xV matrix

【手続補正書】[Procedure amendment]

【提出日】平成10年9月24日[Submission date] September 24, 1998

【手続補正1】[Procedure amendment 1]

【補正対象書類名】図面[Document name to be amended] Drawing

【補正対象項目名】図24[Correction target item name] FIG.

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【図24】 FIG. 24

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】メモリ(24)内に格納された3x3グリ
ッド(110)に配列された複数の要素に対して中央フ
ィルタ値を計算する方法であって:前記3x3グリッド
(110)は、3つの行、即ち、第1行,第2行,およ
び第3行を有し、 前記3x3グリッド(110)は、3つの列、即ち、第
1列,第2列,および第3列を有し、 前記方法は:3つの列を用いて最小中間行を計算し、該
最小中間行内の各要素を、対応する列内の最小要素と等
しくなるように算出する段階(130);3つの列を用
いて中央中間行を計算し、該中央中間行内の各要素を、
対応する列内の中央要素と等しくなるように算出する段
階(130);3つの列を用いて最大中間行を計算し、
該最大中間行内の各要素を、対応する列内の最大要素と
等しくなるように算出する段階(130);前記最小中
間行から成る1組のエントリから最大値を算出すること
によって、最大中間値を計算する段階(140);前記
中央中間行から成る1組のエントリから中央値を算出す
ることによって、中央中間値を計算する段階(15
0);前記最大中間行から成る1組のエントリから最小
値を算出することによって、最小中間値を計算する段階
(160);および前記最大中間値,前記最小中間値,
および前記中央中間値から成る集合から、中央値を計算
することによって、前記中央フィルタ値を計算する段階
(170);から成ることを特徴とする方法。
1. A method for calculating a central filter value for a plurality of elements arranged in a 3 × 3 grid (110) stored in a memory (24), said 3 × 3 grid (110) comprising three The 3x3 grid (110) has three columns, i.e., first, second, and third columns, and has three rows, i.e., first, second, and third rows. The method includes: calculating a minimum middle row using three columns, and calculating each element in the minimum middle row to be equal to a minimum element in a corresponding column (130); using the three columns To calculate the middle middle row, and replace each element in the middle middle row by
Calculating 130 to be equal to the central element in the corresponding column; calculating the largest middle row using the three columns;
Calculating each element in the largest middle row to be equal to the largest element in the corresponding column (130); calculating a largest value from a set of entries consisting of the smallest middle row to obtain a largest middle value Calculating the median value by calculating the median value from the set of entries consisting of the median row (140);
0); calculating a minimum intermediate value by calculating a minimum value from a set of entries consisting of the maximum intermediate row (160); and the maximum intermediate value, the minimum intermediate value,
And calculating the median filter value by calculating a median value from the set of median median values (170).
【請求項2】3つの列を用いて初期最小行を計算し、該
初期最小行内の各要素を、前記第1行および前記第2行
を含む1組の行の1つからの対応する列における最小要
素に等しくなるように算出する段階;3つの列を用いて
第1初期中央行を計算し、該第1初期中央行内の各要素
を、前記第1行および前記第2行を含む前記1組の行の
1つからの対応する列における最大要素に等しくなるよ
うに算出する段階;および3つの列を用いて第2初期中
央行を計算し、該第2初期中央行内の各要素を、前記第
1初期中央行および前記第3行を含む1組の行の1つか
らの対応する列における最小要素に等しくなるように算
出する段階;を更に含み、 前記最小中間行を計算する段階は:前記第2初期中央行
および前記初期最小行から成る1組の行における各列内
の最小エントリを算出する段階を含み;前記中央中間行
を計算する段階は:前記第2初期中央行および前記初期
最小行から成る前記1組の行における各列内の最大エン
トリを算出する段階を含み;前記最大中間行を計算する
段階は:前記第1初期中央行および前記第3行から成る
前記1組の行における各列内の最大エントリを算出する
段階を含む、ことを特徴とする請求項1記載の方法。
2. An initial minimum row is calculated using three columns, and each element in the initial minimum row is represented by a corresponding column from one of a set of rows including the first row and the second row. Calculating to be equal to the smallest element in; calculating a first initial center row using the three columns, each element in the first initial center row including the first row and the second row. Calculating to be equal to the largest element in the corresponding column from one of the set of rows; and calculating a second initial center row using the three columns, and replacing each element in the second initial center row. Calculating to be equal to a minimum element in a corresponding column from one of a set of rows including the first initial center row and the third row; and calculating the minimum middle row. : In a set of rows consisting of the second initial center row and the initial minimum row Calculating the minimum entry in each column of the set; calculating the middle intermediate row: determining the largest entry in each column in the set of the second initial center row and the initial minimum row. Calculating the largest intermediate row includes: calculating a largest entry in each column in the set of rows consisting of the first initial center row and the third row. The method of claim 1, wherein:
【請求項3】3つの列を用いて初期最大行を計算し、該
初期最大行内の各要素を、前記第1行および第2行を含
む1組の行の1つからの対応する列における最大要素に
等しくなるように算出する段階;3つの列を用いて第1
初期中央行を計算し、該第1初期中央行内の各要素を、
前記第1行および前記第2行を含む前記1組の行の1つ
からの対応する列における最小要素に等しくなるように
算出する段階;および3つの列を用いて第2初期中央行
を計算し、該第2初期中央行内の各要素を、前記第1初
期中央行および前記第3行から成る1組の行の1つから
の対応する列における最大要素に等しくなるように算出
する段階;を更に含み、 前記最小中間行を計算する段階は:前記第1初期中央行
および前記第3行から成る前記1組の行内の各列におけ
る最小エントリを算出する段階を含み;前記中央中間行
を計算する段階は:前記第2初期中央行および前記初期
最大行から成る1組の行内の各列における最小エントリ
を算出する段階を含み;前記最大中央行を計算する段階
は:前記第2初期中央行および前記初期最大行から成る
前記1組の行内の各列における最大エントリを算出する
段階を含む、ことを特徴とする請求項1記載の方法。
3. An initial maximum row is calculated using three columns, and each element in the initial maximum row is calculated in a corresponding column from one of a set of rows including the first row and the second row. Calculating to be equal to the largest element; first using three columns
Calculate the initial center row and replace each element in the first initial center row with
Calculating to be equal to the smallest element in a corresponding column from one of the set of rows including the first row and the second row; and calculating a second initial center row using the three columns Calculating each element in the second initial center row to be equal to the largest element in a corresponding column from one of the set of rows comprising the first initial center row and the third row; Calculating the minimum middle row includes: calculating a minimum entry in each column in the set of rows consisting of the first initial center row and the third row; Calculating comprises: calculating a minimum entry in each column in the set of rows comprising the second initial center row and the initial maximum row; calculating the maximum center row comprises: the second initial center. Row and the initial maximum row The method of claim 1, comprising calculating a maximum entry in each column in the set of rows.
【請求項4】メモリ(24)内に格納された2つの重複
する3x3グリッド(310)に配列された複数の要素
に対して、上側中央フィルタ値および下側中央フィルタ
値を計算する方法であって:前記2つの重複する3x3
グリッド(310)の各々は3つの行を有し、 前記2つの重複する3x3グリッド(310)の各々は
3つの列を有し、 第1共有行および第2共有行が前記2つの重複3x3グ
リッド(310)の各々によって共有され、 前記2つの重複する3x3グリッド(310)の上側の
グリッドは、上側に非共有行を有し、 前記2つの重複する3x3グリッド(310)の下側の
グリッドは、下側に非共有行を有し、 前記方法は: A)3つの列を用いて共有最小行を計算し、該共有最小
行における各要素を、前記第1共有行および前記第2共
有行から成る1組の行内の対応する列における最小要素
に等しくなるように算出する段階(330); B)3つの列を用いて共有最大行を計算し、該共有最大
行における各要素を、前記第1共有行および前記第2共
有行から成る前記1組の行内の対応する列における最大
要素に等しくなるように算出する段階(330); C)3つの列を用いて上側最小中間行を計算し、該上側
最小中間行における各要素を、前記共有最小行および前
記上側非共有行から成る1組の行内の対応する列におけ
る最小要素に等しくなるように算出する段階(34
0); D)3つの列を用いて上側中央中間行を計算し、該上側
中央中間行における各要素を、前記上側非共有行,前記
第1共有行,および前記第2共有号から成る1組の行内
の対応する列における中央要素に等しくなるように算出
する段階(340); E)3つの列を用いて上側最大中間行を計算し、該上側
最大中間行における各要素を、前記共有最大行および前
記上側非共有行から成る1組の行内の対応する列におけ
る最大要素に等しくなるように算出する段階(34
0); F)前記上側最小中間行を構成する1組の要素から、最
大値を算出することによって、上側最大中間値を計算す
る段階(350); G)前記上側中央中間行を構成する1組の要素から、中
央値を算出することによって、上側中央中間値を計算す
る段階(360); H)前記上側最大中間行を構成する1組の要素から、最
小値を算出することによって、上側最小中間値を計算す
る段階(370); I)前記上側最大中間値,前記上側最小中間値,および
前記上側中央中間値から成る1組の要素から、中央値を
算出することにより、上側中央フィルタ値を計算する段
階(380); J)3つの列を用いて下側最小中間行を計算し、該下側
最小中間行における各要素を、前記共有最小行および前
記下側非共有行から成る1組の行内の対応する列におけ
る最小要素に等しくなるように算出する段階(39
0); K)3つの列を用いて下側中央中間行を計算し、該下側
中央中間行における各要素を、前記下側非共有行,前記
第1共有行,および前記第2共有行から成る1組の行内
の対応する列における中央要素に等しくなるように算出
する段階(390); L)3つの列を用いて下側最大中間行を計算し、該下側
最大中間行における各要素を、前記共有最大行および前
記下側非共有行から成る1組の行内の対応する列におけ
る最大要素に等しくなるように算出する段階(39
0); M)前記下側最小中間行を構成する1組の要素から、最
大値を算出することによって、下側最大中間値を計算す
る段階(400); N)前記下側中央中間行を構成する1組の要素から、中
央値を算出することによって、下側中央中間値を計算す
る段階(410); O)前記下側最大中間行を構成する1組の要素から、最
小値を算出することによって、下側最小中間値を計算す
る段階(420);および P)前記下側最大中間値,前記下側最小中間値,および
前記下側中央中間値から成る1組の要素から、中央値を
算出することにより、下側中央フィルタ値を計算する段
階(430);から成ることを特徴とする方法。
4. A method for calculating an upper central filter value and a lower central filter value for a plurality of elements arranged in two overlapping 3 × 3 grids (310) stored in a memory (24). T: the two overlapping 3x3
Each of the grids (310) has three rows, each of the two overlapping 3x3 grids (310) has three columns, and a first shared row and a second shared row are the two overlapping 3x3 grids. (310), wherein the upper grid of the two overlapping 3x3 grids (310) has unshared rows on the upper side and the lower grid of the two overlapping 3x3 grids (310) is , Having a non-shared row below, the method comprising: A) calculating a shared minimum row using three columns, and replacing each element in the shared minimum row with the first shared row and the second shared row. (330) calculating to be equal to the smallest element in the corresponding column in the set of rows consisting of: B) calculating a shared maximum row using the three columns; First shared line and before Calculating to be equal to the largest element in the corresponding column in said set of rows consisting of said second shared row (330); C) calculating an upper minimum intermediate row using the three columns; Calculating each element in the middle row to be equal to the smallest element in the corresponding column in the set of rows consisting of the shared minimum row and the upper unshared row (34).
0); D) Calculate the upper middle middle row using the three columns, and replace each element in the upper middle middle row with 1 consisting of the upper unshared row, the first shared row, and the second shared row. Calculating to be equal to the central element in the corresponding column in the set of rows (340); E) calculating an upper maximum middle row using the three columns, and each element in the upper maximum middle row is shared. Calculating to be equal to the largest element in the corresponding column in the set of rows comprising the largest row and said upper unshared row (34)
0); F) calculating an upper maximum intermediate value by calculating a maximum value from a set of elements constituting the upper minimum intermediate row (350); G) forming 1 the upper central intermediate row 1 Calculating an upper median value by calculating a median value from the elements of the set (360); H) calculating a minimum value from a set of elements constituting the upper maximum intermediate row; Calculating a minimum median value (370); I) calculating the median value from a set of elements consisting of the upper maximum median value, the upper minimum median value, and the upper median median value; Calculating a value (380); J) calculating a lower minimum middle row using the three columns, each element in the lower minimum middle row consisting of the shared minimum row and the lower non-shared row. Correspondence within a set of rows Step of calculating to be equal to the smallest element in that column (39
0); K) Calculate the lower middle middle row using the three columns and replace each element in the lower middle middle row with the lower unshared row, the first shared row, and the second shared row. Calculating (390) to be equal to the median element in the corresponding column in the set of rows consisting of: L) calculating the lowermost middle row using the three columns; Calculating an element to be equal to the largest element in the corresponding column in the set of rows consisting of the shared largest row and the lower unshared row (39).
0); M) calculating a lower maximum intermediate value by calculating a maximum value from a set of elements constituting the lower minimum intermediate line (400); N) calculating the lower central intermediate line. Calculating the lower median value by calculating the median value from the set of constituent elements (410); O) calculating the minimum value from the set of elements forming the lower largest intermediate row; Computing a lower minimum median value (420); and P) calculating a median value from a set of elements consisting of the lower maximum median value, the lower minimum median value, and the lower median value. Calculating a lower center filter value by calculating the value (430).
【請求項5】メモリ(24)内に格納された2つの重複
する3x3グリッド(1200)に配列された複数の要
素を完全にソートし、その結果、上側ソート・マトリク
スおよび下側ソート・マトリクスを生成する方法であっ
て:前記2つの重複する3x3グリッド(1200)の
各々は3つの行を有し、 前記2つの重複する3x3グリッド(1200)の各々
は3つの列を有し、 第1共有行および第2共有行が前記2つの重複3x3グ
リッド(1200)の各々によって共有され、 前記2つの重複3x3グリッド(1200)の上側グリ
ッドが上側に非共有行を有し、 前記2つの重複3x3グリッド(1200)の下側グリ
ッドが下側に非共有行を有し、 前記方法は: A)3つの列を用いて共有最小行を計算し、該共有最小
行内の各要素を、前記第1共有行および前記第2共有行
から成る1組の行内の対応する列における最小要素に等
しくなるように算出する段階(1220); B)3つの列を用いて共有最大行を計算し、該共有最大
行内の各要素を、前記第1共有行および前記第2共有行
から成る前記1組の行内の対応する列における最大要素
に等しくなるように算出する段階(1220); C)3つの列を用いて上側最小中間行を計算し、該上側
最小中間行内の各要素を、前記共有最小行および前記上
側非共有行から成る1組の行内の対応する列における最
小要素に等しくなるように算出する段階(1230); D)3つの列を用いて上側中央中間行を計算し、該上側
中央中間行内の各要素を、前記上側非共有行,前記第1
共有行,および前記第2共有行から成る1組の行内の対
応する列における中央要素に等しくなるように算出する
段階(1230); E)3つの列を用いて上側最大中間行を計算し、該上側
最大中間行内の各要素を、前記共有最大行および前記上
側非共有行から成る1組の行内の対応する列における最
大要素に等しくなるように算出する段階(1230); F)3つの列を用いて下側最小中間行を計算し、該下側
最小中間行内の各要素を、前記共有最小行および前記下
側非共有行から成る1組の行内の対応する列における最
大要素に等しくなるように算出する段階(1310); G)3つの列を用いて下側中央中間行を計算し、該下側
中央中間行内の各要素を、前記下側非共有行,前記第1
共有行,および前記第2共有行から成る1組の行内の対
応する列における中央要素に等しくなるように算出する
段階(1310); H)3つの列を用いて下側最大中間行を計算し、該下側
最大中間行内の各要素を、前記共有最大行および前記下
側非共有行から成る1組の行内の対応する列における最
大要素に等しくなるように算出する段階(1310); I)前記3つの列の各々に対して、前記上側最大中間
行,前記上側中央中間行,および前記上側最小中間行か
ら成る第1上側ソート・マトリクスの各列における各要
素をソートし、第2上側ソート・マトリクスを形成する
段階(1240); J)前記3つの列の各々に対して、前記下側最大中間
行,前記下側中央中間行,および前記下側最小中間行か
ら成る第1下側ソート・マトリクスの各列における各要
素をソートし、第2下側ソート・マトリクスを形成する
段階(1320); K)前記第2上側ソート・マトリクスにおいて、原点を
通過する第1対角線に平行な線上に各々位置する複数の
要素をソートし、第3上側ソート・マトリクスを形成す
る段階(1250,1260,1270); L)前記第2下側ソート・マトリクスにおいて、原点を
通過する第2対角線に平行な線上に各々位置する複数の
要素をソートし、第3下側ソート・マトリクスを形成す
る段階(1330,1340,1350); M)前記第3上側ソート・マトリクスにおいて、原点を
通過する第3対角線に平行な線上に各々位置する複数の
要素をソートし、その結果、上側ソート・マトリクスを
形成する段階(1280,1290);および N)前記第3下側ソート・マトリクスにおいて、原点を
通過する第4対角線に平行な線上に各々位置する複数の
要素をソートし、その結果、下側ソート・マトリクスを
形成する段階(1360,1370);から成ることを
特徴とする方法。
5. A complete sorting of a plurality of elements arranged in two overlapping 3 × 3 grids (1200) stored in a memory (24) so that an upper sorting matrix and a lower sorting matrix are sorted. A method of generating: each of the two overlapping 3x3 grids (1200) has three rows; each of the two overlapping 3x3 grids (1200) has three columns; A row and a second shared row are shared by each of the two overlapping 3x3 grids (1200); an upper grid of the two overlapping 3x3 grids (1200) has an unshared row on an upper side; and the two overlapping 3x3 grids (1200) The lower grid has unshared rows on the lower side, the method comprising: A) calculating a shared minimum row using three columns, and each element in the shared minimum row; Calculating (1220) to be equal to the smallest element in the corresponding column in the set of rows consisting of the first shared row and the second shared row (1220); B) calculating the largest shared row using the three columns Calculating each element in the largest shared row to be equal to the largest element in a corresponding column in the set of rows consisting of the first shared row and the second shared row (1220); C) Calculate the upper minimum intermediate row using three columns, and make each element in the upper minimum intermediate row equal to the minimum element in the corresponding column in the set of rows consisting of the shared minimum row and the upper unshared row. D) calculating the upper middle middle row using the three columns, and replacing each element in the upper middle middle row with the upper non-shared row, the first middle row.
Calculating (1230) equal to the central element in a corresponding row in the set of rows comprising the shared row and said second shared row (1230); E) calculating the uppermost middle row using the three columns; Calculating each element in the uppermost middle row to be equal to the largest element in a corresponding column in the set of rows consisting of the shared largest row and the upper unshared row (1230); F) three columns , And calculate each element in the lower minimum middle row to be equal to the largest element in the corresponding column in the set of rows consisting of the shared minimum row and the lower unshared row. G) Calculate the lower middle middle row using three columns, and replace each element in the lower middle middle row with the lower non-shared row, the first middle row.
Calculating (1310) equal to the central element in a corresponding row in the set of shared rows and said second shared row in the set of rows (1310); H) calculating a lower maximum middle row using the three columns; Calculating each element in the lower largest intermediate row to be equal to the largest element in a corresponding column in a set of rows consisting of the shared largest row and the lower unshared row (1310); I). For each of the three columns, sort each element in each column of a first upper sort matrix consisting of the upper middle intermediate row, the upper middle middle row, and the upper minimum middle row, and a second upper sort Forming a matrix (1240); J) for each of the three columns, a first lower sort comprising the lower largest middle row, the lower middle middle row, and the lower smallest middle row.・ Matrix Sorting each element in each column to form a second lower sort matrix (1320); K) in the second upper sort matrix, each being located on a line parallel to a first diagonal passing through the origin. Sorting a plurality of elements to form a third upper sort matrix (1250, 1260, 1270); L) in the second lower sort matrix, each on a line parallel to a second diagonal passing through the origin. Sorting the located plurality of elements to form a third lower sort matrix (1330, 1340, 1350); M) in the third upper sort matrix, on a line parallel to a third diagonal passing through the origin. N) before sorting a plurality of elements, each located at, thereby forming an upper sort matrix (1280, 290); and N) In the third lower sort matrix, sorting a plurality of elements each located on a line parallel to the fourth diagonal passing through the origin, thereby forming a lower sort matrix (1360, 1370); A method characterized by comprising:
JP25044398A 1997-08-21 1998-08-19 Simd calculation of filter based on 3x3 grid rank Pending JPH11149554A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US91861197A 1997-08-21 1997-08-21
US918611 1997-08-21

Publications (1)

Publication Number Publication Date
JPH11149554A true JPH11149554A (en) 1999-06-02

Family

ID=25440661

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25044398A Pending JPH11149554A (en) 1997-08-21 1998-08-19 Simd calculation of filter based on 3x3 grid rank

Country Status (1)

Country Link
JP (1) JPH11149554A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7500089B2 (en) 2001-04-02 2009-03-03 Ricoh Company, Ltd. SIMD processor with exchange sort instruction operating or plural data elements simultaneously
US8098913B2 (en) * 2007-01-23 2012-01-17 Kabushiki Kaisha Toshiba Ultrasonic diagnostic apparatus and image filtering method of the same
JP2015121877A (en) * 2013-12-20 2015-07-02 東芝デジタルメディアエンジニアリング株式会社 Center value search method and center value search device
CN117314730A (en) * 2023-11-28 2023-12-29 进迭时空(杭州)科技有限公司 Median filtering computing device and method for accelerating digital image processing

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7500089B2 (en) 2001-04-02 2009-03-03 Ricoh Company, Ltd. SIMD processor with exchange sort instruction operating or plural data elements simultaneously
US8098913B2 (en) * 2007-01-23 2012-01-17 Kabushiki Kaisha Toshiba Ultrasonic diagnostic apparatus and image filtering method of the same
JP2015121877A (en) * 2013-12-20 2015-07-02 東芝デジタルメディアエンジニアリング株式会社 Center value search method and center value search device
CN117314730A (en) * 2023-11-28 2023-12-29 进迭时空(杭州)科技有限公司 Median filtering computing device and method for accelerating digital image processing
CN117314730B (en) * 2023-11-28 2024-03-15 进迭时空(杭州)科技有限公司 Median filtering computing device and method for accelerating digital image processing

Similar Documents

Publication Publication Date Title
US11196953B2 (en) Block operations for an image processor having a two-dimensional execution lane array and a two-dimensional shift register
US6058405A (en) SIMD computation of rank based filters for M×N grids
US7337205B2 (en) Matrix multiplication in a vector processing system
US6742012B2 (en) Apparatus and method for performing multiplication operations
EP0602886A2 (en) Masks for selecting multi-bit components in a composite operand
US7400781B2 (en) Symmetric type image filter processing apparatus and program and method therefor
JP3526976B2 (en) Processor and data processing device
TWI780116B (en) Element by vector operations for data processing apparatus, method, computer-readable storage medium and virtual machine
US20160335082A1 (en) Multi-dimensional sliding window operation for a vector processor
JP2018022339A (en) Calculation processor and control method of calculation processor
JP3955741B2 (en) SIMD type microprocessor having sort function
US20190213006A1 (en) Multi-functional execution lane for image processor
US11586442B2 (en) System and method for convolving image with sparse kernels
US20050257026A1 (en) Bit serial processing element for a SIMD array processor
US10424084B2 (en) Digital content rendering that supports alpha is shape (AIS) as part of knockout groups
JPH11149554A (en) Simd calculation of filter based on 3x3 grid rank
CN109298886A (en) SIMD instruction executes method, apparatus and processor
US6538657B1 (en) High-performance band combine function
CN117787365B (en) A convolution data stream scheduling method, device, medium and equipment
US6580836B2 (en) Scan line rendering of convolutions
CN110930290B (en) Data processing method and device
CN113868592A (en) Method and system for realizing convolution calculation based on G2D
JP2734959B2 (en) Temporary labeling method
CN114581281B (en) Optimization method based on first layer 4bit convolution calculation
JPH09293137A (en) Scale change of picture at parallel processor