JP2018088231A - Image processing circuit - Google Patents

Image processing circuit Download PDF

Info

Publication number
JP2018088231A
JP2018088231A JP2017161038A JP2017161038A JP2018088231A JP 2018088231 A JP2018088231 A JP 2018088231A JP 2017161038 A JP2017161038 A JP 2017161038A JP 2017161038 A JP2017161038 A JP 2017161038A JP 2018088231 A JP2018088231 A JP 2018088231A
Authority
JP
Japan
Prior art keywords
filter
data
tap
coefficient
coefficients
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2017161038A
Other languages
Japanese (ja)
Other versions
JP7005228B2 (en
Inventor
成緒 兒玉
Naruo Kodama
成緒 兒玉
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.)
Canon Inc
Original Assignee
Canon 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 Canon Inc filed Critical Canon Inc
Priority to US15/812,713 priority Critical patent/US10572985B2/en
Publication of JP2018088231A publication Critical patent/JP2018088231A/en
Application granted granted Critical
Publication of JP7005228B2 publication Critical patent/JP7005228B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing circuit that appropriately mounts a plurality of filter processes while suppressing an increase in circuit scale.SOLUTION: An image processing circuit for executing filter processing using a filter on image data, includes generating means that generates M (M: natural number) pieces of data of a filter tap from target data in the image data and a data group in a vicinity of the target data, a plurality of multipliers that hold coefficients of a predetermined number of bits, and setting means that assigns the coefficients to the M pieces of data of the filter tap generated by the generating means on the basis of filter coefficients constituting the filter.SELECTED DRAWING: Figure 1

Description

本発明は、デジタル信号データに対してフィルタ処理を行う画像処理回路に関する。   The present invention relates to an image processing circuit that performs filter processing on digital signal data.

デジタル機器の発展に伴い、画像データなどのデジタル信号データに対する様々なフィルタ処理を高速に実行することが求められている。高速であることが要求されるフィルタ処理は、専用ハードウェアであるフィルタ回路によって実現することが一般的である。一方で、専用のフィルタ回路は、その回路規模が大きく複雑化するほど製品コストを上昇させてしまうため、従来から回路規模削減のための技術が提案されている。   With the development of digital equipment, it is required to execute various filter processes on digital signal data such as image data at high speed. Filter processing that is required to be fast is generally realized by a filter circuit that is dedicated hardware. On the other hand, since the dedicated filter circuit increases the product cost as the circuit scale becomes larger and more complicated, techniques for reducing the circuit scale have been proposed.

特許文献1は、フィルタ係数の対称性を利用して、対称な係数に対するタップの出力どうしを予め加算し、加算出力及び中央タップの出力を演算語長に応じてビットシフトしてからそれぞれのフィルタ係数を乗算する乗算器に供給する技術を開示する。これにより、対称な係数を有するフィルタにおける乗算回数を削減している。
特許文献2は、乗算係数を係数値が大の部分では倍精度で、係数が小の部分では単精度で記憶させ、倍精度係数については上位桁及び下位桁に分けて入力サンプル列と乗算を行うことにより、倍精度乗算を実行する技術を開示する。
また、特許文献3は、可変遅延フィルタユニット内のトランスバーサルフィルタをフィルタ中央からフィルタ端へ向かって係数ビット数が小さくなるように構成することで、乗算器のビット幅を小さくする技術が開示されている。
Patent Document 1 uses the symmetry of filter coefficients to pre-add tap outputs for symmetric coefficients, and bit-shifts the addition output and the center tap output according to the operation word length before filtering each filter. A technique for supplying a multiplier that multiplies a coefficient is disclosed. As a result, the number of multiplications in the filter having a symmetric coefficient is reduced.
In Patent Document 2, the multiplication coefficient is stored in double precision when the coefficient value is large, and is stored in single precision when the coefficient is small, and the double precision coefficient is divided into upper and lower digits and multiplied by the input sample string. A technique for performing double precision multiplication by performing is disclosed.
Patent Document 3 discloses a technique for reducing the bit width of the multiplier by configuring the transversal filter in the variable delay filter unit so that the number of coefficient bits decreases from the filter center toward the filter end. ing.

特開昭61−118012号公報JP-A-61-118012 特開昭62−105518号公報JP 62-105518 A 特開平5−103228号公報JP-A-5-103228

ところで、従来、様々なフィルタ処理に対応可能なフィルタを1つのフィルタ回路で構成するためには、各フィルタ処理に求められる仕様(例えば、フィルタタップ数、フィルタ係数等)のうち、最大の仕様を満たす構成要素を選択しなければならなかった。
例えば、フィルタタップ数は、各フィルタ処理のうち最大のものを選択する必要があった。
また、フィルタ係数は可変のものを選択し、フィルタ係数のビット幅は最大のものを選択とする必要があった。このように、複数のフィルタ処理のうち最大の仕様を満たすよう構成されたフィルタ回路では、実際には使用されることのない仕様も実現可能な、回路規模が増大し非効率な回路構成となってしまう。
By the way, conventionally, in order to configure a filter that can handle various filter processes with a single filter circuit, the maximum specifications among the specifications (for example, the number of filter taps, filter coefficients, etc.) required for each filter process are set. You had to select the components to meet.
For example, the maximum number of filter taps must be selected from each filter process.
Further, it is necessary to select a variable filter coefficient and to select a filter coefficient having a maximum bit width. In this way, a filter circuit configured to satisfy the maximum specification among a plurality of filter processes can realize a specification that is not actually used, increasing the circuit scale and inefficient circuit configuration. End up.

ここで、特許文献1及び特許文献3に開示された技術は、特定のフィルタ処理を個別に最適化するフィルタ回路であるため、複数のフィルタ処理を切り替えて使用することを想定したものではない。
また、特許文献2記載の技術では、1回の倍精度の乗算のために2回の単精度の乗算を実行し、桁シフタによって桁合わせを行ってから累積加算しているため、高速なフィルタ処理用途のフィルタ回路には適切ではない。
本発明は上記課題を解決するために成されたものであり、回路規模の増大を抑制しつつ、複数のフィルタ処理を適切に実装することができる画像処理回路を提供することを目的とする。
Here, since the technique disclosed in Patent Document 1 and Patent Document 3 is a filter circuit that optimizes specific filter processing individually, it is not assumed that a plurality of filter processing is switched and used.
In the technique described in Patent Document 2, two single-precision multiplications are performed for one double-precision multiplication, and the digit addition is performed after digit alignment by a digit shifter. It is not suitable for filter circuits for processing applications.
The present invention has been made to solve the above problems, and an object of the present invention is to provide an image processing circuit capable of appropriately mounting a plurality of filter processes while suppressing an increase in circuit scale.

上記課題を解決するため、本発明に係る信号処理装置のある態様によれば、画像データに対してフィルタを用いたフィルタ処理を実行する画像処理回路において、前記画像データにおける注目データ及び注目データ近傍のデータ群から、フィルタタップのM(M:自然数)個のデータを生成する生成手段と、所定のビット数の係数を保持する複数の乗算器と、前記フィルタを構成するフィルタ係数に基づいて、前記係数を前記生成手段が生成したM個の前記フィルタタップのデータに割り当てる設定手段と、を有する画像処理回路が提供される。   In order to solve the above problems, according to an aspect of the signal processing device of the present invention, in an image processing circuit that performs filter processing using a filter on image data, the attention data in the image data and the vicinity of the attention data Based on the generation means for generating M (M: natural number) data of filter taps from the data group, a plurality of multipliers holding coefficients of a predetermined number of bits, and the filter coefficients constituting the filter, There is provided an image processing circuit having setting means for assigning the coefficient to data of the M filter taps generated by the generation means.

以上の構成を有する本発明によれば、回路規模の増大を抑制しつつ、複数のフィルタ処理を適切に実装することができる。   According to the present invention having the above configuration, it is possible to appropriately implement a plurality of filter processes while suppressing an increase in circuit scale.

実施形態1におけるフィルタ回路の構成例を示すブロック図1 is a block diagram illustrating a configuration example of a filter circuit according to a first embodiment. 実施形態1におけるフィルタタップを説明する図The figure explaining the filter tap in Embodiment 1. 実施形態1における注目データの供給を説明する図The figure explaining supply of attention data in Embodiment 1. 実施形態1におけるフィルタタップのデータの供給を説明する図The figure explaining the supply of the data of the filter tap in Embodiment 1. 実施形態1におけるフィルタ係数の割り当てを説明する図The figure explaining the allocation of the filter coefficient in Embodiment 1. 実施形態1におけるフィルタ係数の割り当てを説明する図The figure explaining the allocation of the filter coefficient in Embodiment 1. 実施形態2におけるフィルタ回路の構成例を示すブロック図FIG. 9 is a block diagram illustrating a configuration example of a filter circuit according to a second embodiment. 実施形態2における係数対称性のある場合のタップデータを説明する図The figure explaining tap data in the case of the coefficient symmetry in Embodiment 2. フィルタタップとタップデータの間の位置関係を示す図Diagram showing the positional relationship between filter taps and tap data 実施形態2におけるフィルタ係数の割り当て処理のフローチャートFlowchart of filter coefficient assignment processing in the second embodiment 実施形態2における注目データからタップデータへの距離順を示す図The figure which shows the order of distance from attention data in Embodiment 2 to tap data 実施形態2におけるIIRフィルタ処理の例Example of IIR filter processing in Embodiment 2 実施形態2におけるフィルタ係数の割り当て処理のフローチャートFlowchart of filter coefficient assignment processing in the second embodiment 実施形態2における注目データからタップデータへの距離順算出を説明する図The figure explaining distance order calculation from attention data in Embodiment 2 to tap data 実施形態3におけるフィルタ回路の構成例を示すブロック図FIG. 9 is a block diagram illustrating a configuration example of a filter circuit according to a third embodiment. 実施形態3におけるタップデータ圧縮を説明する図The figure explaining tap data compression in Embodiment 3. 実施形態3におけるフレーム間フィルタ処理時のタップデータを説明する図The figure explaining the tap data at the time of the inter-frame filter process in Embodiment 3. 公知技術を適用したフィルタ演算回路の概要を示す模式図Schematic diagram showing the outline of a filter operation circuit to which a known technology is applied 実施形態1におけるフィルタ演算回路を示す模式図FIG. 3 is a schematic diagram illustrating a filter operation circuit according to the first embodiment. 実施形態1におけるフィルタ演算回路を示す模式図FIG. 3 is a schematic diagram illustrating a filter operation circuit according to the first embodiment.

以下、添付図面を参照して、本発明を実施するための実施形態について詳細に説明する。なお、以下に説明する実施形態は、本発明の実現手段としての一例であり、本発明が適用される装置の構成や各種条件によって適宜修正又は変更されるべきものであり、本発明は以下の実施形態に必ずしも限定されるものではない。また、本実施形態で説明されている特徴の組み合わせの全てが本発明の解決手段に必須のものとは限らない。なお、同一の構成については、同じ符号を付して説明する。   DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the accompanying drawings. The embodiment described below is an example as means for realizing the present invention, and should be appropriately modified or changed according to the configuration and various conditions of the apparatus to which the present invention is applied. It is not necessarily limited to the embodiment. In addition, not all combinations of features described in the present embodiment are essential for the solving means of the present invention. In addition, about the same structure, the same code | symbol is attached | subjected and demonstrated.

<実施形態1>
以下、画像処理回路であるフィルタ回路の実施形態1を説明する。実施形態1では、フィルタ係数の対称性の有無に応じて、画像データに対する2種類のFIR(Finite Inpulse Response)フィルタ処理を切り替えるものとして説明する。なお、フィルタは、画像データにおける各画素から生成したタップデータを保持する複数のタップからなる。各タップにはフィルタ係数が対応し、タップデータとフィルタ係数との積和を算出するために用いられる。例えば図2(a)に示すフィルタは、5画素×5画素の領域に対応するウィンドウにおいて、5タップ×5タップ(合計25タップ)に対応するフィルタ係数を有することになる。ここで、フィルタにおいて中心に位置するタップを中央タップと呼ぶ。画像データに対してフィルタを用いたフィルタ処理を実行する際には、画像データにおける各画素に対してフィルタの中央タップを順次、対応付ける。以降、中央タップに対応する処理対象の画素を注目画素とよぶ。従って、図2(a)に示すフィルタを用いた演算においては、中央タップに対応する注目画素の画素値と(注目データ)、その近傍の画素(図2(a)のフィルタの場合は24画素)の画素値それぞれがタップデータとしてフィルタ回路に入力されることになる。
<Embodiment 1>
Hereinafter, a first embodiment of a filter circuit which is an image processing circuit will be described. The first embodiment will be described on the assumption that two types of FIR (Finite Impulse Response) filter processing for image data are switched in accordance with the presence or absence of symmetry of filter coefficients. The filter includes a plurality of taps that hold tap data generated from each pixel in the image data. Each tap corresponds to a filter coefficient and is used to calculate a product sum of the tap data and the filter coefficient. For example, the filter shown in FIG. 2A has filter coefficients corresponding to 5 taps × 5 taps (25 taps in total) in a window corresponding to an area of 5 pixels × 5 pixels. Here, the tap located at the center of the filter is referred to as a center tap. When performing filter processing using a filter on image data, the center tap of the filter is sequentially associated with each pixel in the image data. Hereinafter, the pixel to be processed corresponding to the center tap is referred to as a target pixel. Therefore, in the calculation using the filter shown in FIG. 2A, the pixel value of the pixel of interest corresponding to the center tap and the pixel of interest (24-pixel in the case of the filter of FIG. 2A) are shown. ) Are input to the filter circuit as tap data.

(第1の実施形態の構成)
図1は、第1の実施形態におけるフィルタ回路の構成例を示すブロック図である。本実施形態のフィルタ回路は、画像データ入力部10と、フィルタタップ供給部11と、フィルタ演算部12と、正規化部13と、画像データ出力部14とを備える。
画像データ入力部10は、外部の装置から入力されるデジタル信号データ(以下、「画像データ」を例として説明する。)を、フィルタタップ供給部11に供給する。フィルタタップ供給部11は、画像データにおける注目画素に対して実現すべきフィルタ処理に必要なタップ数のフィルタタップのデータ(タップデータ)をフィルタ演算部12に供給する。フィルタ演算部12は、フィルタタップ供給部11により供給されたタップデータに対してフィルタ演算(積和演算)を行い、積和演算結果を正規化部13に供給する。正規化部13は、フィルタ演算部12で算出した積和演算結果を正規化して画像データ出力部14に供給する。画像データ出力部14は、正規化部13で正規化された出力データを出力用の画像データとして外部の装置に出力する。
(Configuration of the first embodiment)
FIG. 1 is a block diagram illustrating a configuration example of a filter circuit according to the first embodiment. The filter circuit of the present embodiment includes an image data input unit 10, a filter tap supply unit 11, a filter calculation unit 12, a normalization unit 13, and an image data output unit 14.
The image data input unit 10 supplies digital signal data (hereinafter, “image data” will be described as an example) input from an external device to the filter tap supply unit 11. The filter tap supply unit 11 supplies the filter operation unit 12 with filter tap data (tap data) having the number of taps necessary for the filter processing to be realized for the target pixel in the image data. The filter operation unit 12 performs a filter operation (product-sum operation) on the tap data supplied from the filter tap supply unit 11 and supplies the product-sum operation result to the normalization unit 13. The normalization unit 13 normalizes the product-sum operation result calculated by the filter operation unit 12 and supplies the result to the image data output unit 14. The image data output unit 14 outputs the output data normalized by the normalization unit 13 to an external device as output image data.

(フィルタ処理概要)
以下、本実施形態のフィルタ回路が実行するフィルタ処理の概要を説明する。
図18〜図20は、フィルタ演算部12における処理を説明する模式図である。
図18(a)及び(b)は公知技術を適用したフィルタ演算部100、110を模式的に示している。このフィルタ演算部100、110では、入力されるタップデータに対して乗算器102、102、103(105、106)が一対一に対応付けられている。各乗算器には、予め設定されたフィルタ係数が対応付けられており、各乗算器は、フィルタ係数とタップデータとを乗算する。画像処理装置において、複数の異なるフィルタを用いたフィルタ演算を実現するためには、各フィルタに応じて様々な乗算器が必要となる。
(Filter processing overview)
Hereinafter, an outline of the filter processing executed by the filter circuit of the present embodiment will be described.
18 to 20 are schematic diagrams for explaining processing in the filter calculation unit 12.
FIGS. 18A and 18B schematically show filter operation units 100 and 110 to which a known technique is applied. In the filter calculation units 100 and 110, the multipliers 102, 102, and 103 (105 and 106) are associated one-to-one with the input tap data. Each multiplier is associated with a preset filter coefficient, and each multiplier multiplies the filter coefficient by tap data. In the image processing apparatus, in order to realize a filter operation using a plurality of different filters, various multipliers are required for each filter.

例えば、図18(a)に示すフィルタ演算部100では、タップデータが3つ(タップデータ1、タップデータ2、タップデータ3)あり、夫々のタップデータに対して4ビットの乗算、8ビットの乗算、4ビットの乗算が必要となる。一方、図18(b)に示すフィルタ演算部110では、タップデータが2つ(タップデータ1、タップデータ2)あり、夫々のタップデータに6ビットの乗算、8ビットの乗算が必要となる。
図18(a)に示すフィルタ演算部100は、必要な乗算器(乗算器101〜103)の数が多く、図18(b)に示すフィルタ演算部110は、必要な乗算器(乗算器105、106)のビット数が大きい。このため、フィルタ演算部100とフィルタ演算部110を共通の回路で実現するためには、少なくとも8ビットの乗算器、6ビットの乗算器、及び4ビットの乗算器を用意しておき、切り替えて使用する必要がある。
For example, in the filter operation unit 100 shown in FIG. 18A, there are three tap data (tap data 1, tap data 2, and tap data 3), and each tap data is multiplied by 4 bits and 8 bits. Multiplication, 4-bit multiplication is required. On the other hand, in the filter calculation unit 110 shown in FIG. 18B, there are two tap data (tap data 1 and tap data 2), and 6-bit multiplication and 8-bit multiplication are required for each tap data.
The filter operation unit 100 illustrated in FIG. 18A has a large number of necessary multipliers (multipliers 101 to 103), and the filter operation unit 110 illustrated in FIG. 18B includes a necessary multiplier (multiplier 105). 106) is large. Therefore, in order to implement the filter operation unit 100 and the filter operation unit 110 with a common circuit, at least an 8-bit multiplier, a 6-bit multiplier, and a 4-bit multiplier are prepared and switched. Need to use.

図19及び図20は、本実施形態におけるフィルタ演算部12を模式的に示している。このフィルタ演算部12では、所定のビット数(ここでは2ビット)の乗算が可能な乗算器を複数供えている。なお、1つのタップデータに対して複数の乗算器が対応付けられる。このように、本実施形態では、各フィルタ演算に必要なビット数に応じて、タップデータに対して乗算器を割当てる。例えば、図19に示すように、4ビットの乗算が必要な場合は2つの乗算器111(113)を割り当て、8ビットの乗算が必要な場合は4つの乗算器112を割り当てる。また、図20のフィルタ演算回路の場合には、6ビットの乗算のために3つの乗算器115を割り当て、8ビットの乗算には4つの乗算器を割り当てればよい。   19 and 20 schematically show the filter calculation unit 12 in the present embodiment. The filter operation unit 12 includes a plurality of multipliers that can multiply a predetermined number of bits (here, 2 bits). A plurality of multipliers are associated with one tap data. Thus, in the present embodiment, multipliers are assigned to tap data according to the number of bits necessary for each filter operation. For example, as shown in FIG. 19, two multipliers 111 (113) are assigned when 4-bit multiplication is required, and four multipliers 112 are assigned when 8-bit multiplication is required. In the case of the filter operation circuit of FIG. 20, three multipliers 115 may be assigned for 6-bit multiplication, and four multipliers may be assigned for 8-bit multiplication.

ただし、この場合、図19に示すフィルタ演算のためには、2ビットの乗算が可能な乗算器は8つ必要である。このため、フィルタ回路を共用する場合、図20に示すフィルタ演算では1つの乗算器が余る。そこで、本実施形態では、係数割り当て部12において、8ビットの演算に相当する演算に5つの乗算器116を割り当てて、10ビット相当の演算としている。これにより、図18(a)、(b)のフィルタ回路を共用した場合に比較して、複数のフィルタ処理を切り替えるフィルタ処理回路において必要とする乗算器の規模を抑えることができる。また、1つの乗算器のビット数をフィルタ係数のビット数より小さくすることで、図20に示す場合のように、余った乗算器をいずれかのタップデータに対して割り当てることができる。すなわち、フィルタのビット幅を上回るように乗算器に対応する係数を割り当てることができる。
これにより、余りの乗算器を割り当てられたタップデータに対しては、より高精度なフィルタ係数を設定できる。特に本実施形態では、乗算器が余る場合は、注目データからの距離が近いタップデータに対して割り当てを優先する。その結果、フィルタ演算においてより重要な注目データ近傍のタップデータに対してより精度良くフィルタ演算することが可能となる。
In this case, however, eight multipliers capable of 2-bit multiplication are required for the filter operation shown in FIG. For this reason, when the filter circuit is shared, one filter is left in the filter operation shown in FIG. Therefore, in the present embodiment, the coefficient assigning unit 12 assigns five multipliers 116 to an operation corresponding to an 8-bit operation to obtain an operation corresponding to 10 bits. This makes it possible to reduce the scale of the multiplier required in the filter processing circuit that switches between a plurality of filter processes, as compared with the case where the filter circuits of FIGS. 18A and 18B are shared. Further, by making the number of bits of one multiplier smaller than the number of bits of the filter coefficient, a surplus multiplier can be assigned to any tap data as shown in FIG. That is, the coefficient corresponding to the multiplier can be assigned so as to exceed the bit width of the filter.
As a result, more accurate filter coefficients can be set for tap data to which the remaining multipliers are assigned. In particular, in this embodiment, when there are more multipliers, priority is given to allocation to tap data that is close to the target data. As a result, it is possible to perform the filter operation with higher accuracy on tap data near the data of interest that is more important in the filter operation.

(フィルタ処理詳細)
以下、本実施形態におけるフィルタ回路が実行するフィルタ処理を詳細に説明する。画像データ入力部10は、外部の装置からフィルタ処理の対象となるデジタル画像データ(画像データ)を取得し、フィルタタップ供給部11に画像データを供給する。画像データを入力する外部の装置としては、例えばイメージセンサのようにリアルタイムに画像データを取得する機器でもよいし、主記憶装置のように画像データを一時的に保持する記憶装置であってもよい。
フィルタタップ供給部11は、後段のフィルタ演算部12におけるフィルタ処理に応じて、画像データにおける注目画素に対して実現すべきフィルタ処理に必要なタップ数を有するタップデータをフィルタ演算部12に供給する。なお、本実施形態では、後段のフィルタ演算部12は、複数のフィルタ処理を切り替える。複数のフィルタ処理のそれぞれに必要なタップ数、フィルタ係数等については、予めフィルタタップ供給部11及びフィルタ演算部12のレジスタ等に保持しておけばよい。本実施形態では、以下、フィルタ演算部12において、図2(a)に示す係数対称性の無い5×5タップのフィルタと、図2(b)に示す係数対称性の有る4×4タップのフィルタを切り替える例について説明する。
(Filter processing details)
Hereinafter, the filter processing executed by the filter circuit in the present embodiment will be described in detail. The image data input unit 10 acquires digital image data (image data) to be filtered from an external device and supplies the image data to the filter tap supply unit 11. As an external device that inputs image data, for example, a device that acquires image data in real time, such as an image sensor, or a storage device that temporarily stores image data, such as a main storage device, may be used. .
The filter tap supply unit 11 supplies tap data having the number of taps necessary for the filter processing to be realized for the target pixel in the image data to the filter calculation unit 12 according to the filter processing in the subsequent filter calculation unit 12. . In the present embodiment, the subsequent-stage filter calculation unit 12 switches a plurality of filter processes. The number of taps, filter coefficients, and the like necessary for each of the plurality of filter processes may be stored in advance in the registers of the filter tap supply unit 11 and the filter calculation unit 12. In the present embodiment, in the filter operation unit 12, a 5 × 5 tap filter having no coefficient symmetry shown in FIG. 2A and a 4 × 4 tap having coefficient symmetry shown in FIG. An example of switching filters will be described.

なお、図2(a)に示す5×5タップのフィルタでは、フィルタ係数に対称性はない。この場合中央のタップに対して注目画素が対応し、注目画素の画素値が注目データとして、注目画素を中心とする5画素×5画素の領域に含まれる近傍画素の画素値がタップデータとして入力される。つまり、注目画素に対するフィルタ処理結果は、注目画素を中心とした5画素×5画素の画素値の積和演算により得られる。
一方、係数対称性のある4×4タップのフィルタについて説明する。本来、7×7タップのフィルタにおけるフィルタ係数について考える。図2(c)は、7×7タップのフィルタ係数のうち中心位置を中央タップとして、等方的なフィルタ係数である例を示す。ここで、同じアルファベットは同じ値のフィルタ係数であることを意味する。この場合、7×7タップのフィルタ係数と対応する49画素の画素値との積和演算ではなく、同じフィルタ係数に対応する画素の画素値の和(タップデータ)を算出した後に、フィルタ係数を積算してもよい。
そこで、本実施形態では、図2(c)に示すフィルタを用いたフィルタ処理をするために、同じフィルタ係数は省略して4×4タップのフィルタとして保持するものとする。つまり図2(b)に示すフィルタでは、中央タップは左上に位置する。また、図2(b)に示すフィルタを用いたフィルタ処理では、注目画素のフィルタ処理結果は、注目画素を中心とした7画素×7画素の画素値とフィルタ係数との積和演算により得られることになる。
In the 5 × 5 tap filter shown in FIG. 2A, the filter coefficients are not symmetrical. In this case, the target pixel corresponds to the center tap, the pixel value of the target pixel is input as the target data, and the pixel values of neighboring pixels included in the 5 pixel × 5 pixel region centered on the target pixel are input as the tap data. Is done. That is, the filter processing result for the pixel of interest is obtained by a product-sum operation of 5 × 5 pixel values centered on the pixel of interest.
On the other hand, a 4 × 4 tap filter having coefficient symmetry will be described. Consider filter coefficients in a 7 × 7 tap filter. FIG. 2C shows an example of isotropic filter coefficients with the center position being the center tap among the 7 × 7 tap filter coefficients. Here, the same alphabet means that the filter coefficient has the same value. In this case, after calculating the sum (tap data) of the pixel values of the pixels corresponding to the same filter coefficient rather than the product-sum operation of the 7 × 7 tap filter coefficient and the corresponding pixel value of 49 pixels, the filter coefficient is You may accumulate.
Therefore, in the present embodiment, in order to perform the filter processing using the filter shown in FIG. 2C, the same filter coefficient is omitted and held as a 4 × 4 tap filter. That is, in the filter shown in FIG. 2B, the center tap is located at the upper left. Further, in the filter processing using the filter shown in FIG. 2B, the filter processing result of the target pixel is obtained by the product-sum operation of the pixel value of 7 pixels × 7 pixels around the target pixel and the filter coefficient. It will be.

一般的にFIRフィルタは、フィルタの性能を高めるために比較的大きなタップ数を必要とする。一方で、フィルタタップ数を多くすると、タップデータを保持するためのバッファ(シフトレジスタ等)や、タップデータとフィルタ係数の乗算を多く必要とする。このため、フィルタのタップ数は少ない方がよい。
ここで、前述の通りフィルタ係数に対称性がある場合、係数対称性を利用してフィルタのタップ数を減らす。係数対称性のあるフィルタを用いたフィルタ演算について以下に説明するように、フィルタタップ数を増加させずにフィルタ性能を高めることができる。
図3及び図4は、フィルタ係数に対称性がある場合における、フィルタタップ供給部11がタップデータを供給する方法を説明する図である。
図3は、画像データを示している。画像データ入力部10は、各画素の画像データ(画素値)を主走査方向及び副走査方向の順番で、フィルタタップ供給部11に順次に入力する。フィルタタップ供給部11は、所定数の画素の画像データ(画素値)を保持するラインメモリ等のバッファ31を備えている。
In general, FIR filters require a relatively large number of taps in order to improve the performance of the filter. On the other hand, when the number of filter taps is increased, a large number of buffers (such as a shift register) for holding tap data and multiplication of tap data and filter coefficients are required. For this reason, it is better that the number of filter taps is small.
Here, as described above, when the filter coefficient has symmetry, the number of filter taps is reduced by using coefficient symmetry. As will be described below for filter operations using a filter with coefficient symmetry, the filter performance can be improved without increasing the number of filter taps.
FIG. 3 and FIG. 4 are diagrams for explaining a method by which the filter tap supply unit 11 supplies tap data when the filter coefficients have symmetry.
FIG. 3 shows image data. The image data input unit 10 sequentially inputs the image data (pixel value) of each pixel to the filter tap supply unit 11 in the order of the main scanning direction and the sub scanning direction. The filter tap supply unit 11 includes a buffer 31 such as a line memory that holds image data (pixel values) of a predetermined number of pixels.

画像データ入力部10から新たに画像データ32が供給されると、フィルタ処理を行う範囲の中心の画像データ(注目画素データまたは注目データ)38の近傍のデータ群を用いた処理が可能な状態となる。なお、図3では、画像データ38の近傍のデータ群を、画像データ38を中心とした7画素×7画素分の画像データとした例を示している。
このような状態となると、フィルタタップ供給部11は、画像データ入力部10から入力された画像データ32と、予めバッファ31に格納されている画像データ列33を読み出し、フィルタ処理に必要な1カラム分のデータを取得する。ここで、1カラム分のデータとは、画像データ32及び画像データ32から副走査方向と逆に所定数(この場合は6)の画像データ(すなわち6ライン前迄のラインの同一カラムのデータ)のことである。
When new image data 32 is supplied from the image data input unit 10, processing using a data group in the vicinity of the image data (attention pixel data or attention data) 38 at the center of the range to be filtered is possible. Become. FIG. 3 shows an example in which the data group in the vicinity of the image data 38 is image data of 7 pixels × 7 pixels with the image data 38 as the center.
In such a state, the filter tap supply unit 11 reads the image data 32 input from the image data input unit 10 and the image data string 33 stored in the buffer 31 in advance, and one column necessary for the filter processing Get the minute data. Here, the data for one column is a predetermined number (6 in this case) of image data from the image data 32 and the image data 32 (in this case, 6) (that is, data in the same column of lines up to 6 lines before). That is.

フィルタタップ供給部11は、取得した1カラム分の画像データを、図4に示すように、第1の対称軸34により折り返し加算する。更に、フィルタタップ供給部11は、折り返し加算したデータ39を主走査方向(例えば画像データの横[X]方向)に連続するシフトレジスタ35に格納する。なお、シフトレジスタ35は、画像データ入力部10から新たな画素の画像データ32が入力される度に、格納している画像データを主走査方向にシフトさせ、空いた領域に第1の対称軸34により折り返し加算されたデータ39を格納する。   The filter tap supply unit 11 folds and adds the acquired image data for one column using the first symmetry axis 34 as shown in FIG. Further, the filter tap supply unit 11 stores the data 39 obtained by the folding addition in the shift register 35 that is continuous in the main scanning direction (for example, the horizontal [X] direction of the image data). The shift register 35 shifts the stored image data in the main scanning direction every time image data 32 of a new pixel is input from the image data input unit 10, and the first symmetry axis is set in the empty area. The data 39 obtained by the loopback addition at 34 is stored.

さらに、フィルタタップ供給部11は、シフトレジスタ35中のデータを第2の対称軸36により折り返し加算して、フィルタ係数に対称性がある場合のM(M:自然数)個のタップデータを生成する。以上の折り返し加算により、図2(c)に示すフィルタにおいて同じフィルタ係数に対応する画像データ(画素値)を加算したことになる。従って、図2(b)に示すフィルタを用いたフィルタ処理回路のタップデータ数は16個である。ここで生成されたタップデータのうち、タップデータ37は、入力された画像データ32に対して、主走査方向及び副走査方向に3画素ずつ遅延した図3中の画像データ38(すなわち注目データ)そのものである。
換言すると、画像データ38を通る第1の対称軸34及び第2の対称軸36によって、7画素×7画素の領域の画像データを折り畳み加算(畳み込み加算)して、M(4×4:16)個のタップデータが生成される。このようなタップデータ群をフィルタ演算回路の入力として用いてフィルタ処理を行う。これにより、図2(c)に示すフィルタを用いて7画素×7画素の領域の49個の画像データをそのままタップデータ群とした場合と同等のフィルタ性能のフィルタ処理を行うことが可能となる。
Further, the filter tap supply unit 11 folds and adds the data in the shift register 35 by the second symmetry axis 36 to generate M (M: natural number) tap data when the filter coefficients are symmetric. . With the above folding addition, image data (pixel values) corresponding to the same filter coefficient is added in the filter shown in FIG. Therefore, the number of tap data in the filter processing circuit using the filter shown in FIG. Of the tap data generated here, the tap data 37 is the image data 38 in FIG. 3 (that is, the data of interest) delayed by 3 pixels in the main scanning direction and the sub-scanning direction with respect to the input image data 32. It is itself.
In other words, the image data of the region of 7 pixels × 7 pixels is folded and added (convolution added) by the first symmetry axis 34 and the second symmetry axis 36 that pass through the image data 38, and M (4 × 4: 16). ) Pieces of tap data are generated. Filter processing is performed using such a tap data group as an input of the filter arithmetic circuit. This makes it possible to perform filter processing with the same filter performance as when the 49 image data in the 7 pixel × 7 pixel region is directly used as the tap data group using the filter shown in FIG. .

次に、フィルタ演算部12は、フィルタタップ供給部11により供給されたフィルタタップのそれぞれのタップデータに乗算器(係数に対応する)を対応付けて(割り当てて)積和演算を実行することで、フィルタ演算を行う。
以下、本実施形態では、フィルタ仕様に応じて、符号付き8ビットのN(N:自然数、例えば25)個の乗算器の、タップデータに対する割り当てを切り替えてフィルタ演算を行う例について説明する。1つの乗算器は、符号を含めた8ビットの係数C(z)(z:0〜24)を設定可能である。所定ビット幅の係数C(z)は、1つ、もしくは複数によって1つのフィルタ係数を構成する。例えばここでは、1つの乗算器を1つのタップデータに割り当てると、8ビットの係数C(z)(z:0〜24)と入力されたタップデータとを乗算することができる。すなわち、フィルタ演算部12は、フィルタ係数の対称性の有無に応じ、タップデータの数(M)と、フィルタ係数のビット数を決定づける乗算器の数(N)に基づいて、それぞれのタップデータに乗算器を割り当ててフィルタ演算を行う。本実施形態においてフィルタ演算部12は、8ビットの係数を設定可能な乗算器を25個、保持しているものとする。
Next, the filter operation unit 12 associates (assigns) a multiplier (corresponding to a coefficient) to each tap data of the filter tap supplied by the filter tap supply unit 11 and executes a product-sum operation. , Perform filter operation.
Hereinafter, in the present embodiment, an example will be described in which filter calculation is performed by switching the assignment of signed 8-bit N (N: natural number, for example, 25) multipliers to tap data according to filter specifications. One multiplier can set an 8-bit coefficient C (z) (z: 0 to 24) including a sign. One or a plurality of coefficients C (z) having a predetermined bit width constitute one filter coefficient. For example, here, when one multiplier is assigned to one tap data, the 8-bit coefficient C (z) (z: 0 to 24) can be multiplied by the input tap data. That is, the filter calculation unit 12 applies each tap data to the tap data based on the number of tap data (M) and the number of multipliers (N) that determine the number of bits of the filter coefficient according to the presence or absence of the symmetry of the filter coefficient. A filter operation is performed by assigning a multiplier. In the present embodiment, it is assumed that the filter operation unit 12 holds 25 multipliers that can set 8-bit coefficients.

なお、予め用意する乗算器の個数と乗算可能なビット幅は、例えば、kビットのフィルタ係数からなるa×aタップのフィルタと、lビットのフィルタ係数からなるb×bタップのフィルタで共有する場合、以下のように決定することができる。
乗算器のビット幅cを、kビットとlビットのうち、符号ビットを除く絶対値の有効ビット幅における(最大公約数+1(符号ビット))以上とする。すなわち、乗算器の数は、フィルタ係数のビット幅の公約数の乗算ができるようにする。乗算器のビット幅cを、kビットとlビットの最大公約数以外の公約数+1とすることも可能だが、乗算器のビット幅を小さくすると回路上のオーバーヘッドが大きくなる。このため、最大公約数が1ビットの場合には、乗算器のビット幅cを2ビット以上にすることが好ましい。
また、乗算器の個数dは、乗算器のビット幅cが決まれば、a×aタップのフィルタと、b×bタップのフィルタにおける総乗算数(乗算器によるタップ毎の乗算回数の合計)が大きい方に決まる。もしくは、上記で算出した論理的な乗算器の個数dに対して、フィルタ回路のスループット(サイクル当りの乗算数、もしくは乗算器の時分割数の逆数)を乗じることで、物理的な乗算器の個数d´を算出することができる。本実施形態における乗算器の個数は、論理的な乗算器の個数もしくはスループットが1の場合の物理的な乗算器の個数を示す。すなわち、乗算器の数は、複数のフィルタごとの最大総乗算数とスループットとに応じた数とすることができる。
The number of multipliers prepared in advance and the bit width that can be multiplied are shared by, for example, an a × a tap filter composed of k-bit filter coefficients and a b × b tap filter composed of l-bit filter coefficients. The case can be determined as follows:
The bit width c of the multiplier is set to be equal to or greater than (the greatest common divisor + 1 (sign bit)) in the effective bit width of the absolute value excluding the sign bit of k bits and l bits. That is, the number of multipliers allows multiplication of a common divisor of the bit width of the filter coefficient. The bit width c of the multiplier can be set to a common divisor +1 other than the greatest common divisor of k bits and l bits. However, if the bit width of the multiplier is reduced, the overhead on the circuit increases. For this reason, when the greatest common divisor is 1 bit, the bit width c of the multiplier is preferably 2 bits or more.
The number of multipliers d is determined by the total number of multiplications (total number of multiplications for each tap by the multiplier) in the a × a tap filter and the b × b tap filter if the bit width c of the multiplier is determined. Determined by the larger one. Alternatively, the number of logical multipliers d calculated above is multiplied by the throughput of the filter circuit (the number of multiplications per cycle or the reciprocal of the number of time divisions of the multipliers). The number d ′ can be calculated. The number of multipliers in this embodiment indicates the number of logical multipliers or the number of physical multipliers when the throughput is 1. That is, the number of multipliers can be a number corresponding to the maximum total multiplication number and throughput for each of the plurality of filters.

図5は、図2(a)に示すフィルタ係数の対称性が無い場合のフィルタに対するタップデータの例を示す。図5の場合は、フィルタタップ供給部11は、フィルタタップのタップデータの数(M)とフィルタ係数の数が等しいため、注目データとその周囲の5画素×5画素分の画像データをそのままタップデータとしてフィルタ演算部12に供給する。また乗算器の数も25個であり、タップデータの数(M)とフィルタ係数の数と等しい。すなわち、タップデータT(x,y)と乗算器とを1対1に対応付ければよく、フィルタ演算部12は、積和演算S=Σ(T(z%5,z÷5)*C(z))を実行してフィルタ処理を行う。ここで、%は剰余算を意味しており、÷は余りを切り捨てる除算を意味している。   FIG. 5 shows an example of tap data for a filter when the filter coefficients shown in FIG. In the case of FIG. 5, since the number of filter tap tap data (M) is equal to the number of filter coefficients, the filter tap supply unit 11 taps the data of interest and the surrounding image data of 5 pixels × 5 pixels as it is. The data is supplied to the filter calculation unit 12 as data. The number of multipliers is 25, which is equal to the number of tap data (M) and the number of filter coefficients. That is, the tap data T (x, y) and the multiplier need only be correlated one-to-one, and the filter operation unit 12 performs the product-sum operation S = Σ (T (z% 5, z ÷ 5) * C ( z)) to execute the filtering process. Here,% means remainder calculation, and ÷ means division that rounds off the remainder.

一方、図6は、フィルタ係数に対称性が有る場合のフィルタタップのタップデータに対する乗算器の割り当て方法を示す。この場合は、フィルタタップのタップデータの数(M)が16であるのに対し、乗算器の数(N)がMより大きい25である。このため、タップデータと乗算器(8ビットの係数)を1対1に対応付けると、乗算器が7個余ることになる。
そこで、本実施形態では、フィルタ演算部12は、1順目として、まず、図6(a)及び図6(d)に示すように、16個のタップデータのそれぞれに乗算器を1つずつ割り当てる(1対1に対応付ける)。つまり、8ビットの係数C(0)〜C(15)が各タップに対応することになる。そして、フィルタ演算部12は、対応付けた乗算器とタップデータに対して、部分的な積和演算を行う。
On the other hand, FIG. 6 shows a method of assigning multipliers to tap data of filter taps when the filter coefficients have symmetry. In this case, the number of tap data (M) of the filter tap is 16, whereas the number of multipliers (N) is 25, which is larger than M. For this reason, when the tap data and the multiplier (8-bit coefficient) are associated with each other on a one-to-one basis, seven multipliers are left.
Therefore, in the present embodiment, as shown in FIGS. 6 (a) and 6 (d), first, the filter operation unit 12 includes one multiplier for each of the 16 tap data. Assign (one-to-one correspondence). That is, 8-bit coefficients C (0) to C (15) correspond to each tap. Then, the filter operation unit 12 performs a partial product-sum operation on the associated multiplier and tap data.

さらに、フィルタ演算部12は、2順目として、図6(d)に示すように、残った9個の乗算器をフィルタタップのタップデータに割り当てる。従って残りの乗算器に対応する係数C(16)〜C(24)が、図6(c)に示す通りに各タップに対応付けられる。2つの乗算器を割り当てられたタップデータは、16ビットのフィルタ係数が対応付けられたことを意味する。ここで、本実施形態では、フィルタ演算部12は、フィルタ中心の画素データ38(注目画素データ)から近傍の画素データへの距離に応じて、乗算器をフィルタタップのタップデータに割り当てる。フィルタの中心の画素データ38(注目画素データ)は、対称軸を通っており、この対称軸に折り畳まれたものがフィルタタップとなっている。このため、フィルタ中心の画素データ38から各フィルタタップを形成する各画素データまでの距離は同一となる。従って、この場合、フィルタタップ上における距離に応じて、乗算器を割り当てればよい。   Furthermore, as shown in FIG. 6D, the filter operation unit 12 assigns the remaining nine multipliers to the tap data of the filter taps in the second order. Accordingly, the coefficients C (16) to C (24) corresponding to the remaining multipliers are associated with each tap as shown in FIG. 6 (c). Tap data to which two multipliers are assigned means that 16-bit filter coefficients are associated with each other. Here, in the present embodiment, the filter calculation unit 12 assigns the multiplier to the tap data of the filter tap according to the distance from the filter center pixel data 38 (target pixel data) to the neighboring pixel data. The pixel data 38 (target pixel data) at the center of the filter passes through the axis of symmetry, and the one folded on this axis of symmetry is the filter tap. For this reason, the distance from the filter center pixel data 38 to each pixel data forming each filter tap is the same. Therefore, in this case, multipliers may be assigned according to the distance on the filter tap.

フィルタ中心の画像データ38に対応するT(0,0)のタップデータからの距離に応じて順番付けすると、図6(b)に示すとおりとなる。ただし、図6(b)では、フィルタ中心から同距離に位置するタップデータについては、右上に位置するタップデータを優先している。
フィルタ演算部12は、フィルタ中心からの距離の順番に従って残りの9個の乗算器をタップデータに割り当てる。上記の割り当てにより、図6(c)に示すように、フィルタの中心に近いタップデータには8ビットの係数に対応する乗算器が2つ割り当てられ、フィルタの周辺部のタップデータには8ビットの係数に対応する乗算器が1つ割り当てられる。すなわち、フィルタ演算部12は、注目データからの距離が近いデータ群(タップデータ)に対してフィルタ係数のビット数を優先的に対応付ける。この結果、注目データからの距離が近いデータ群(タップデータ)に対してより多くのビット数のフィルタ係数が対応付けされる。
When ordering is performed according to the distance from the tap data of T (0,0) corresponding to the filter-centered image data 38, the result is as shown in FIG. However, in FIG. 6B, the tap data located at the upper right is prioritized for the tap data located at the same distance from the filter center.
The filter calculation unit 12 assigns the remaining nine multipliers to the tap data according to the order of the distance from the filter center. As a result of the above assignment, as shown in FIG. 6C, two multipliers corresponding to 8-bit coefficients are assigned to the tap data near the center of the filter, and 8-bits are assigned to the tap data in the periphery of the filter. One multiplier corresponding to the coefficient is assigned. That is, the filter calculation unit 12 preferentially associates the bit number of the filter coefficient with a data group (tap data) that is close to the data of interest. As a result, a filter coefficient having a larger number of bits is associated with a data group (tap data) that is close to the data of interest.

フィルタ係数に対称性が有る場合のフィルタ演算では、フィルタ演算部12は、上記のように1順目に割り当てた係数を用いて、部分的な積和演算S(1)=Σ(T(z%4、z÷4)*C(z))(z:0〜15)を実行する。ただし、z=0〜8の係数については、対応するタップデータに割り当てた2つの係数を使用したフィルタ係数のダイナミックレンジの拡大に影響を及ばす符号ビットについては、無視するか、若しくは、符号なしを示す0に設定する。さらに、フィルタ演算部12は、2順目に割り当てた係数を用いて、部分的な積和演算S(2)=Σ(T(D(z))*C(z))(z:16〜24)を実行する。ここで、D(z)は、係数C(z)が割り当てられたフィルタタップのフィルタ中心からの距離順を示し、T(D(z))は、距離順D(z)に対応するタップデータを示すものとする。   In the filter calculation when the filter coefficients are symmetric, the filter calculation unit 12 uses the coefficients assigned in the first order as described above, and performs partial product-sum calculation S (1) = Σ (T (z % 4, z ÷ 4) * C (z)) (z: 0 to 15). However, for the coefficient of z = 0 to 8, the sign bit that affects the expansion of the dynamic range of the filter coefficient using the two coefficients assigned to the corresponding tap data is ignored or unsigned. Set to 0 to indicate. Further, the filter operation unit 12 uses the coefficients assigned in the second order to perform partial product-sum operation S (2) = Σ (T (D (z)) * C (z)) (z: 16 to 24) is executed. Here, D (z) indicates the order of distance from the filter center of the filter tap to which the coefficient C (z) is assigned, and T (D (z)) is tap data corresponding to the distance order D (z). It shall be shown.

次に、フィルタ演算部12は、上記により算出した部分的な積和演算結果を合成し、積和演算S=S(2)*128+S(1)を実行する。ここで、積和演算S(2)の結果に乗じられる128は、1順目の係数レンジ(0〜127)の上位の桁を表現するための値であり、係数のビット幅から符号ビット分を除いた値による2のべき乗となる。これにより、部分的な積和演算S(1)により7ビットレンジの係数が表現され、部分的な積和演算S(2)により、その上位の符号付き8ビットの係数が表現される。このように算出した積和演算Sの結果は、フィルタ中心部分において、フィルタ係数のダイナミックレンジが符号付き15ビット相当のフィルタ結果となる。したがって、回路規模を増大させることなく、フィルタ中心におけるフィルタ係数のビット幅を拡大することができる。なお、上記では、タップデータに対する乗算器(所定ビット幅の係数を保持する)の割り当てを変更する処理を例に説明したが、これに替えて、タップデータに対する係数のビット数の対応付けを変更する処理を行ってもよい。   Next, the filter operation unit 12 synthesizes the partial product-sum operation results calculated as described above, and executes product-sum operation S = S (2) * 128 + S (1). Here, 128 multiplied by the result of the product-sum operation S (2) is a value for expressing the upper digit of the coefficient range (0 to 127) in the first order. It is a power of 2 by the value excluding. As a result, a 7-bit range coefficient is expressed by the partial product-sum operation S (1), and a signed 8-bit coefficient higher than that is expressed by the partial product-sum operation S (2). The result of the product-sum operation S calculated in this way is a filter result corresponding to a signed 15-bit dynamic range of the filter coefficient in the filter center portion. Therefore, the bit width of the filter coefficient at the filter center can be expanded without increasing the circuit scale. In the above description, the process of changing the allocation of multipliers (holding a coefficient having a predetermined bit width) to tap data has been described as an example, but instead, the correspondence between the number of coefficient bits and the tap data is changed. You may perform the process to do.

上記のフィルタ処理は、フィルタタップ供給部11がフィルタ演算部12に供給する画像データの画素を順次移動させながら、画像データの全範囲にわたって実行する。これにより、画像データ全体に対するフィルタ処理が実行される。
上記のフィルタ処理が実行された後、正規化部13は、フィルタ演算部12で算出した積和演算Sの結果を、出力する画像データのレンジ(ビット幅)に合せて正規化する。
画像データ出力部14は、正規化部13で正規化された出力データを外部の装置に出力する。外部の装置としては、ディスプレイのような表示装置でもよいし、主記憶装置のように画像データを一時的に保持する記憶装置でもよい。
The filter processing is executed over the entire range of the image data while sequentially moving the pixels of the image data supplied from the filter tap supply unit 11 to the filter calculation unit 12. Thereby, the filtering process is performed on the entire image data.
After the above filter processing is executed, the normalization unit 13 normalizes the result of the product-sum operation S calculated by the filter operation unit 12 according to the range (bit width) of the output image data.
The image data output unit 14 outputs the output data normalized by the normalization unit 13 to an external device. The external device may be a display device such as a display, or a storage device that temporarily holds image data, such as a main storage device.

以上説明したように、本実施形態では、画像データに対する複数のフィルタ回路を、フィルタ係数の対称性に応じて設定することにより、回路規模の増大を抑制しつつ、複数のフィルタ処理を適切に実装することができる。
フィルタ処理では、フィルタの中心に近い部分(中心部)のフィルタ係数の絶対値がフィルタの周辺部に比べて大きいことがあり、この傾向はタップの数が多くなると更に強くなる。本実施形態では、フィルタ係数の対称性が有る場合に、フィルタタップ供給部11が、画像データを折り返し加算してすることで、実質的にフィルタタップのタップデータ数を拡大してフィルタタップを生成する。
As described above, in the present embodiment, by setting a plurality of filter circuits for image data in accordance with the symmetry of the filter coefficients, a plurality of filter processes are appropriately implemented while suppressing an increase in circuit scale. can do.
In the filter process, the absolute value of the filter coefficient near the center (center) of the filter may be larger than that in the periphery of the filter, and this tendency becomes stronger as the number of taps increases. In the present embodiment, when the filter coefficients are symmetric, the filter tap supply unit 11 generates the filter tap by substantially expanding the number of tap data of the filter tap by adding the image data in a folded manner. To do.

また、実質的にフィルタタップのタップデータ数を拡大したことで、フィルタの中心部で求められるフィルタ係数のダイナミックレンジも拡大することが求められる。ここで、本実施形態では、フィルタ演算部12が、フィルタ中心の注目画素データから近傍の画素データへの距離に応じて、乗算器をタップデータへ割り当てる。これにより、フィルタ中心におけるビット幅を拡大してダイナミックレンジを拡大することができる。
このように、本実施形態によれば、フィルタタップのタップデータ数もフィルタ係数のダイナミックレンジも拡大しつつ、複数のフィルタの切り替えが可能なフィルタ回路を実現することができる。しかも、このようなフィルタ回路の実現に際して、フィルタ演算における演算量や係数レジスタ等の演算リソースをそれに伴い増大させることもなく、回路規模の増加を抑制することができる。
また、本実施形態では、フィルタタップの数よりも乗算器の数が多い場合にも、フィルタ中心からの距離に応じて乗算器を割り当てることが可能であり、効率的な演算リソースの使用が可能となる。
Moreover, it is required to increase the dynamic range of the filter coefficient obtained at the center of the filter by substantially increasing the number of tap data of the filter tap. Here, in the present embodiment, the filter calculation unit 12 assigns multipliers to the tap data according to the distance from the target pixel data at the filter center to the neighboring pixel data. As a result, the dynamic range can be expanded by increasing the bit width at the filter center.
Thus, according to the present embodiment, it is possible to realize a filter circuit capable of switching a plurality of filters while expanding the number of tap data of filter taps and the dynamic range of filter coefficients. In addition, when realizing such a filter circuit, it is possible to suppress an increase in the circuit scale without increasing the calculation amount in the filter calculation and the calculation resources such as the coefficient register.
In this embodiment, even when the number of multipliers is larger than the number of filter taps, it is possible to assign multipliers according to the distance from the filter center, and efficient use of computing resources is possible. It becomes.

<実施形態2>
実施形態1では、フィルタ係数の対称性に応じて画像データに対するフィルタ処理を切り替える例を説明したが、以下、本発明の実施形態2に係るフィルタ回路を、信号データに対する様々なフィルタ処理を切り替えながら処理を行う場合の例として説明する。なお実施形態1ではフィルタ処理に用いるフィルタのタップに対して乗算器を割り当てるとして説明したが、本実施形態では、乗算器に対応する係数を割り当ての対象として説明するが、乗算器と係数は対応しているので、実質的には同じことを意味する。
本実施形態のフィルタ回路のブロック図を図7に示す。本実施形態におけるフィルタ回路は、信号データ入力部51と、フィルタタップ供給部53と、係数割り当て部50と、フィルタ演算部54と、正規化部55と、信号データ出力部52とを備える。各構成要素について実施形態1で説明した構成要素に対応するものについては説明を省略する。
<Embodiment 2>
In the first embodiment, the example in which the filter processing for the image data is switched in accordance with the symmetry of the filter coefficient has been described. Hereinafter, the filter circuit according to the second embodiment of the present invention is switched while switching various filter processing on the signal data. A description will be given as an example of processing. In the first embodiment, the multiplier is assigned to the filter tap used for the filter processing. However, in the present embodiment, the coefficient corresponding to the multiplier is described as the assignment target. However, the multiplier and the coefficient correspond to each other. So it means substantially the same thing.
FIG. 7 shows a block diagram of the filter circuit of this embodiment. The filter circuit in this embodiment includes a signal data input unit 51, a filter tap supply unit 53, a coefficient allocation unit 50, a filter calculation unit 54, a normalization unit 55, and a signal data output unit 52. The description of each component corresponding to the component described in the first embodiment is omitted.

信号データ入力部51は、外部の装置からフィルタ処理の対象となる信号データを入力する。
信号データ出力部52は、外部の装置へフィルタ処理済みの信号データを出力する。
係数割り当て部50は、フィルタタップ供給部53から得られる注目画素データの位置情報とタップデータの位置関係から、注目画素データからの距離に応じた、タップデータへの所定ビット幅の係数の割り当てを行う。フィルタ演算部54は、係数の割り当ての情報に基づいて、タップデータと各係数の積和演算を実行する。本実施形態で説明する係数割り当て部50は、実施形態1で説明したフィルタ演算部12の機能を一部切り出したものに該当する。
The signal data input unit 51 inputs signal data to be filtered from an external device.
The signal data output unit 52 outputs the filtered signal data to an external device.
The coefficient allocation unit 50 allocates a coefficient having a predetermined bit width to the tap data according to the distance from the target pixel data based on the positional information between the target pixel data obtained from the filter tap supply unit 53 and the positional relationship between the tap data. Do. The filter operation unit 54 performs a product-sum operation on the tap data and each coefficient based on the coefficient assignment information. The coefficient assignment unit 50 described in the present embodiment corresponds to a part of the function of the filter calculation unit 12 described in the first embodiment.

(フィルタ処理詳細)
以下、実施形態2が実現するフィルタ処理として、係数対称性のある2次元FIRフィルタ処理と、1次元IIR(Infinite Inpulse Response)フィルタ処理とを切り替える例について説明する。なお、以下、2次元FIRフィルタ処理が対象とする信号データは画像データ等の2次元のデータであり、1次元IIRフィルタ処理が処理対象とする信号データは画像データの1ライン分のデータあるいは音声データ等の1次元のデータである場合を例に説明する。
(Filter processing details)
Hereinafter, an example of switching between a two-dimensional FIR filter process having coefficient symmetry and a one-dimensional IIR (Infinite Impulse Response) filter process will be described as the filter process realized by the second embodiment. In the following, the signal data targeted for the two-dimensional FIR filter processing is two-dimensional data such as image data, and the signal data targeted for the one-dimensional IIR filter processing is data for one line of image data or audio. A case where the data is one-dimensional data such as data will be described as an example.

2次元FIRフィルタ処理の係数対称性については、実施形態1で説明したX軸Y軸の2軸に加え、もう1軸の対称性をもたせた例について説明する。すなわち、図8(a)で示すようにX軸Y軸対称となるようなフィルタ係数(図中の数は、同一のフィルタ係数を示す)から、さらに、対角軸による対称性を持たせると図8(b)に示すようなフィルタ係数となる。図8(b)に示すフィルタ係数は、X軸、Y軸に差がなく等方性のあるフィルタ係数となっている。このようなフィルタ係数をフィルタ中心の注目画素データを通るそれぞれの対称軸によって折り畳み加算すると、図9に示すフィルタタップと、タップデータの間の位置関係とを得ることができる。なお、タップデータ60はフィルタ中心の画像データ(注目画素データ)そのものである。
本実施形態において、係数割り当て部50は、図10のフローチャートに示す処理によって、各タップデータへの係数の割り当て数をカウントする係数割り当てカウンタCcnt(x)の値を得る。なお、本実施形態では、フィルタタップのタップデータの数をM個とし、係数の数をN個とする。
Regarding the coefficient symmetry of the two-dimensional FIR filter processing, an example in which the symmetry of the other axis is provided in addition to the two axes of the X axis and the Y axis described in the first embodiment will be described. That is, as shown in FIG. 8A, if the filter coefficients that are symmetric with respect to the X-axis and the Y-axis (the numbers in the figure indicate the same filter coefficient) are further given symmetry with the diagonal axis. The filter coefficients are as shown in FIG. The filter coefficient shown in FIG. 8B is an isotropic filter coefficient with no difference between the X axis and the Y axis. When such filter coefficients are folded and added along the respective symmetry axes that pass through the pixel-of-interest data at the filter center, the filter taps shown in FIG. 9 and the positional relationship between the tap data can be obtained. Note that the tap data 60 is the filter-centered image data (target pixel data) itself.
In the present embodiment, the coefficient allocation unit 50 obtains the value of a coefficient allocation counter Ccnt (x) that counts the number of coefficients allocated to each tap data by the process shown in the flowchart of FIG. In the present embodiment, the number of tap data of the filter tap is M, and the number of coefficients is N.

ステップS1において、係数割り当て部50は、フィルタの中心からの距離順ソート結果D(x)を算出する。図9に示すフィルタタップ供給部53から出力されるフィルタの中心の位置とタップデータの間の位置関係の情報を元に距離順のソートを行うと、図11に示すような結果D(x)が得られる。
ステップS2において、係数割り当て部50は、係数割り当てカウンタCcnt(x)を初期化し、全てのタップデータに対するカウント値を0にする。また、係数割り当て部50は、タップ位置xを0に初期化する。
In step S <b> 1, the coefficient assigning unit 50 calculates a sorting result D (x) in order of distance from the center of the filter. When sorting in order of distance is performed based on the positional relationship information between the center position of the filter and the tap data output from the filter tap supply unit 53 illustrated in FIG. 9, a result D (x) as illustrated in FIG. Is obtained.
In step S2, the coefficient allocation unit 50 initializes a coefficient allocation counter Ccnt (x) and sets the count values for all tap data to zero. The coefficient assigning unit 50 initializes the tap position x to 0.

ステップS3において、係数割り当て部50は、全ての係数割り当てカウンタCcnt(x)の合計値が係数の数Nとなったか否かを判断する。全ての係数割り当てカウンタCcnt(x)の合計値が係数の数Nとなった場合は、全ての係数の割り当てが完了しており、係数割り当て部50は、フローチャートの処理を終了し、係数をフィルタ演算部54に出力する。全ての係数割り当てカウンタCcnt(x)の合計値がNに達していない場合には、ステップS4に進む。   In step S3, the coefficient allocation unit 50 determines whether or not the total value of all coefficient allocation counters Ccnt (x) has reached the number N of coefficients. When the total value of all the coefficient allocation counters Ccnt (x) reaches the number N of coefficients, the allocation of all the coefficients has been completed, and the coefficient allocation unit 50 ends the process of the flowchart and filters the coefficients The result is output to the calculation unit 54. If the total value of all coefficient assignment counters Ccnt (x) has not reached N, the process proceeds to step S4.

ステップS4において、係数割り当て部50は、距離順に係数の割り当てを実行し、現在のタップ位置xの係数割り当てカウンタCcnt(x)をインクリメント(増加)させる。なお、係数割り当てカウンタCcnt(x)のカウント値は、各タップに割り当てられた係数の数に相当する。
ステップS5において、係数割り当て部50は、タップ位置xの更新を行う。タップ位置xを1増加させて、フィルタタップのタップデータの数M以上となっている場合には、係数割り当て部50は、タップ位置xをMで割って余りをタップ位置xとする。このステップS5においてタップ位置の更新を行った後に、係数割り当て部50は、ステップS3に戻り、処理の終了判定を実行する。
In step S4, the coefficient assignment unit 50 assigns coefficients in order of distance, and increments (increases) the coefficient assignment counter Ccnt (x) at the current tap position x. Note that the count value of the coefficient allocation counter Ccnt (x) corresponds to the number of coefficients allocated to each tap.
In step S5, the coefficient allocation unit 50 updates the tap position x. When the tap position x is incremented by 1 and the number of tap data of the filter tap is M or more, the coefficient assigning unit 50 divides the tap position x by M and sets the remainder as the tap position x. After updating the tap position in step S5, the coefficient assigning unit 50 returns to step S3 to execute the process end determination.

以上の処理により、フィルタタップのタップデータの数M及び係数の数Nに依らず、タップデータ毎の係数割り当てカウント値、すなわち、割り当てられた係数の数が算出される。
係数割り当て部50は、得られた係数の数に応じて、フィルタの中心からの距離が近い順に順番にフィルタタップのタップデータに係数の割り当てを行う。さらに、係数割り当て部50は、フィルタタップの全てのタップデータに係数を割り当てた後に、再度フィルタ中心から順番に係数の割り当てを行う。従って、フィルタタップ全面に均等に係数が割り当てられ、かつ、余った係数はフィルタの中心に割り当てられるため、タップ数の多いフィルタ処理にも対応可能となる。
Through the above processing, the coefficient assignment count value for each tap data, that is, the number of assigned coefficients is calculated regardless of the number M of tap data and the number N of coefficients of the filter tap.
The coefficient assigning unit 50 assigns coefficients to the tap data of the filter taps in order from the shortest distance from the center of the filter according to the number of obtained coefficients. Further, the coefficient assigning unit 50 assigns coefficients to all the tap data of the filter taps, and then assigns coefficients in order from the filter center again. Accordingly, coefficients are uniformly assigned to the entire surface of the filter tap, and the remaining coefficients are assigned to the center of the filter, so that it is possible to cope with filter processing with a large number of taps.

フィルタ演算部54では、上記で得られたタップデータ毎の係数の対応付けの数(割り当て数)に従って、タップデータとの積和演算を行い、フィルタ演算を実行する。例えば、符号付きvビットの係数が1つのみ割り当てられたタップデータでは、フィルタ演算部54は、部分積P=T(x,y)*C(z)を算出する。また、係数がw個割り当てられたタップデータでは、フィルタ演算部54は、部分積P=T(x,y)*C(z)+T(x,y)*C(z+1)*(2^(v−1))+・・・+T(x,y)*C(z+w)*(2^((v−1)*w))を算出する。ただし、所定ビット幅の係数C(z)以外の係数は、正の数か、もしくは、符号ビットを除いた(v−1)ビットの係数である必要がある。上記の複数個の係数が割り当てられたタップデータの部分積で、2のべき乗を乗じる演算を等価なビットシフト演算と考えると、係数の割り当て数とフィルタ演算における乗算の回数は一致する。従って、係数に対応させる乗算器の対応付けを考える場合も、図10に示すフローチャートに従って処理すればよい。なお、フィルタ演算部54では、タップデータ毎の部分積の総和をとって、フィルタ演算結果とする。   The filter operation unit 54 performs a product-sum operation with the tap data in accordance with the number of coefficients associated with each tap data obtained above (the number of assignments), and executes the filter operation. For example, for tap data to which only one signed v-bit coefficient is assigned, the filter operation unit 54 calculates a partial product P = T (x, y) * C (z). In addition, for tap data to which w coefficients are assigned, the filter calculation unit 54 uses the partial product P = T (x, y) * C (z) + T (x, y) * C (z + 1) * (2 ^ ( v-1)) +... + T (x, y) * C (z + w) * (2 ^ ((v-1) * w)) is calculated. However, the coefficient other than the coefficient C (z) having a predetermined bit width needs to be a positive number or a coefficient of (v−1) bits excluding the sign bit. If an operation of multiplying a power of 2 by a partial product of tap data to which a plurality of coefficients are assigned is considered as an equivalent bit shift operation, the number of assigned coefficients and the number of multiplications in the filter operation are the same. Therefore, when considering the association of multipliers to be associated with coefficients, processing may be performed according to the flowchart shown in FIG. Note that the filter calculation unit 54 takes the sum of the partial products for each tap data to obtain a filter calculation result.

次に、1次元IIRフィルタの例について説明する。
図12は、IIRフィルタの典型的な処理の例を示す。図12の上部のパスは、FIRフィルタと等価なフィードフォワードパスとなっており、下部のパスはフィルタ結果をもとに補正値を算出するフィードバックパスになっている。図12では、フィードフォワードパスにおけるタップデータを注目データT(0)とし、時間軸方向に遅延したタップデータをT(1)、T(2)、T(3)、T(4)としている。また、フィードバックパスにおけるタップデータは、出力結果を1つずつ遅延させたT(5)、T(6)、T(7)、T(8)から成る。フィルタ演算部54は、これらのタップデータに所定の係数を乗じてフィルタ処理結果を得る。
一般的に、IIRフィルタはFIRフィルタに比べ、少ないタップ数で同等のフィルタ性能を出すことができる。一方で、IIRフィルタは、係数感度が高く出力安定性が悪いという欠点を持っている。このため、IIRフィルタには、フィルタ係数のビット幅がかなり必要で、必要なビット幅は用途により異なる。
Next, an example of a one-dimensional IIR filter will be described.
FIG. 12 shows an example of typical processing of the IIR filter. The upper path in FIG. 12 is a feedforward path equivalent to the FIR filter, and the lower path is a feedback path for calculating a correction value based on the filter result. In FIG. 12, tap data in the feedforward path is set as data of interest T (0), and tap data delayed in the time axis direction is set as T (1), T (2), T (3), and T (4). The tap data in the feedback path is composed of T (5), T (6), T (7), and T (8) obtained by delaying the output result one by one. The filter calculation unit 54 multiplies these tap data by a predetermined coefficient to obtain a filter processing result.
In general, the IIR filter can provide the same filter performance with a smaller number of taps than the FIR filter. On the other hand, the IIR filter has a drawback that coefficient sensitivity is high and output stability is poor. For this reason, the IIR filter requires a considerable bit width of the filter coefficient, and the required bit width differs depending on the application.

本実施形態では、タップデータ毎に必要なビット幅をP(T(x))とする。各タップデータに対する係数の割り当てについて、図13に示すフローチャートを用いて説明する。
ステップS1において、係数割り当て部50は、フィルタの中心からの距離順ソート結果D(x)を算出する。本実施形態のIIRフィルタ処理の場合、注目画素データとなるタップデータと、その他のデータ群との距離は時間的な距離となる。注目画素データとデータ群のデータを入力、もしくは、出力されたときの時間軸を直線上に並べると、図14(a)のようになる。これを時間距離順に並べると、図14(b)に示す順番になる。但し、同一時間距離となるフィードフォワードパスのタップデータとフィードバックパスのタップデータでは、フィードバックパスのタップデータを優先させている。IIRフィルタの場合は、特にフィードバックパスの方が、係数感度が高いため最終的に割り当てる係数を多くするためである。
ステップS2からステップS5の説明は、前述の通りであるため説明を省略する。
In the present embodiment, the required bit width for each tap data is P (T (x)). The assignment of coefficients to each tap data will be described using the flowchart shown in FIG.
In step S <b> 1, the coefficient assigning unit 50 calculates a sorting result D (x) in order of distance from the center of the filter. In the case of the IIR filter processing of the present embodiment, the distance between the tap data serving as the target pixel data and the other data group is a temporal distance. When the time axis when the pixel-of-interest data and data of the data group are input or output is arranged on a straight line, the result is as shown in FIG. If these are arranged in order of time distance, the order shown in FIG. However, the tap data of the feedback path is prioritized in the tap data of the feed forward path and the tap data of the feedback path that have the same time distance. This is because in the case of an IIR filter, the feedback path has a higher coefficient sensitivity, so that more coefficients are finally assigned.
The description of step S2 to step S5 is as described above, and thus the description thereof is omitted.

ステップS6において、係数割り当て部50は、タップ位置xのタップデータT(x)の要求ビット幅P(T(x))を満たしているか否かの判定を行う。割り当てを行う係数のビット幅をwとすると、Ccnt(x)が0の場合は割り当てる係数のビット幅は0であり、それ以外の場合は割り当てる係数のビット幅は(Ccnt(x)−1)*(w−1)+wとなる。係数割り当て部50は、このビット幅が、要求ビット幅P(T(x))以上か否かを判定し、越えていない場合にはステップS3に進む。ビット幅が要求ビット幅P(T(x))を越えている場合には、係数割り当て部50は、ステップS5に進み、タップデータT(x)への係数の割り当てを完了する。   In step S6, the coefficient allocation unit 50 determines whether or not the requested bit width P (T (x)) of the tap data T (x) at the tap position x is satisfied. If the bit width of the coefficient to be assigned is w, the bit width of the coefficient to be assigned is 0 when Ccnt (x) is 0, and the bit width of the coefficient to be assigned is (Ccnt (x) −1) in other cases. * (W-1) + w. The coefficient assigning unit 50 determines whether or not the bit width is equal to or larger than the requested bit width P (T (x)). If not, the process proceeds to step S3. If the bit width exceeds the required bit width P (T (x)), the coefficient assigning unit 50 proceeds to step S5 and completes the assignment of the coefficient to the tap data T (x).

上記の処理において、係数割り当て部50は、距離順に並べたタップデータT(x)の要求ビット幅P(T(x))を満たすように係数の割り当てを行う。係数が全タップデータT(x)の要求ビット幅P(T(x))を満たすだけのビット幅と個数が無い場合には、係数割り当て部50は、注目データから距離の遠いタップデータに関しては、係数を割り当てない。IIRフィルタは、FIRフィルタに比べて少ないフィルタタップで同等のフィルタ性能を実現でき、係数感度が高いためにタップデータの要求ビット幅を満たす必要があるため、上記のような係数の割り当てが望ましい。
フィルタ演算部54は、上記で得られたタップデータ毎のフィルタ係数に従って、タップデータとの積和演算を行い、フィルタ演算を実行する。
In the above processing, the coefficient assigning unit 50 assigns coefficients so as to satisfy the required bit width P (T (x)) of the tap data T (x) arranged in order of distance. When there is no bit width and number sufficient for the coefficient to satisfy the required bit width P (T (x)) of all tap data T (x), the coefficient allocating unit 50 regards tap data far from the target data. , Do not assign coefficients. Since the IIR filter can realize the same filter performance with fewer filter taps than the FIR filter and has a high coefficient sensitivity, it is necessary to satisfy the required bit width of tap data. Therefore, the coefficient assignment as described above is desirable.
The filter operation unit 54 performs a product-sum operation with the tap data according to the filter coefficient for each tap data obtained above, and executes the filter operation.

以上説明したように、本実施形態では、フィルタタップ数がM個の様々なフィルタ処理に対し、N個の係数を割り当ててフィルタ処理する。いずれのフィルタ処理においても、予め用意していた係数を最大限活用し、様々なフィルタ処理を実現することができる。
これにより、本実施形態では、回路規模の増大を抑制しつつ、複数のフィルタ処理を適切に実装することができる。なお、本実施形態で用いた係数はタップデータに1対1に対応するものではなく、フィルタ処理における乗算リソースに設定する乗数という位置付けである。従って、本実施形態における係数を乗算リソースと言い換えてもよい。
As described above, in this embodiment, N coefficients are assigned to various filter processes with M filter taps, and the filter process is performed. In any of the filter processes, various filter processes can be realized by utilizing the coefficients prepared in advance to the maximum.
Thereby, in this embodiment, a plurality of filter processes can be appropriately implemented while suppressing an increase in circuit scale. Note that the coefficients used in the present embodiment do not correspond to the tap data on a one-to-one basis, but are positioned as multipliers set in the multiplication resources in the filter processing. Therefore, the coefficients in this embodiment may be rephrased as multiplication resources.

<実施形態3>
本発明の第3の実施形態に係るフィルタ回路は、映像データに対してフレーム間とフレーム内のフィルタ処理を切り替え可能とするものである。
本実施形態のフィルタ回路のブロック図を図15に示す。本実施形態のフィルタ回路は、映像データ入力部70と、タップデータ圧縮部71と、タップデータ記憶部72と、フィルタタップ供給部74と、フィルタ演算部75と、係数割り当て部76と、正規化部77と、映像データ出力部73とを備える。各構成要素について、実施形態1及び実施形態2において説明した構成要素に対応するものについては説明を省略する。
映像データ入力部70は、外部の装置から処理対象となる映像データを入力する。映像データは、フレームの画像データ毎に順次入力される。
映像データ出力部73は、外部の装置へフィルタ処理済みの映像データを出力する。
タップデータ圧縮部71は、フィルタ処理対象となるフレーム内のタップデータを圧縮し、フィルタタップ供給部74若しくはタップデータ記憶部72に出力する。
<Embodiment 3>
The filter circuit according to the third embodiment of the present invention can switch between intra-frame and intra-frame filter processing for video data.
A block diagram of the filter circuit of the present embodiment is shown in FIG. The filter circuit of the present embodiment includes a video data input unit 70, a tap data compression unit 71, a tap data storage unit 72, a filter tap supply unit 74, a filter calculation unit 75, a coefficient allocation unit 76, and a normalization. Unit 77 and video data output unit 73. For each component, the description corresponding to the component described in the first and second embodiments is omitted.
The video data input unit 70 inputs video data to be processed from an external device. The video data is sequentially input for each frame image data.
The video data output unit 73 outputs the filtered video data to an external device.
The tap data compression unit 71 compresses the tap data in the frame to be filtered, and outputs the compressed tap data to the filter tap supply unit 74 or the tap data storage unit 72.

ここで、タップデータの圧縮方法について、図16を用いて説明する。図16(a)に示すのは、フレーム内にのみフィルタ処理を施す場合のフィルタタップである。タップデータ圧縮部71は、このフィルタの中心を注目画素データとしてXY軸に対して折りたたみ加算し、図16(b)のタップデータを算出する。タップデータ圧縮部71は、このタップデータを注目画素データ80に対応するタップデータ群としてタップデータ記憶部72に出力する。1つの注目画素データに対して、多数のタップデータが記憶され、それが複数フレーム分のデータ容量となるため、出来る限りタップデータを少容量にすることが望ましい。例えば、タップデータ生成時、別の対称軸による折り返し加算を実施してタップデータ数を削減してもよいし、タップデータ群に対して公知のデータ圧縮技術を利用してデータ容量を削減してもよい。
タップデータ記憶部72は、タップデータ圧縮部71で生成された注目データに対するタップデータを一時的に保持し、フィルタタップ供給部74の要求に応じて、注目データに対するタップデータを供給する。
Here, a tap data compression method will be described with reference to FIG. FIG. 16A shows a filter tap when the filter process is performed only in the frame. The tap data compression unit 71 calculates the tap data of FIG. 16B by folding and adding the center of this filter with respect to the XY axes as the target pixel data. The tap data compression unit 71 outputs the tap data to the tap data storage unit 72 as a tap data group corresponding to the target pixel data 80. A large number of tap data is stored for one pixel of interest data, and this has a data capacity for a plurality of frames. Therefore, it is desirable to make the tap data as small as possible. For example, at the time of tap data generation, the number of tap data may be reduced by performing folding addition with another symmetry axis, or the data capacity may be reduced using a known data compression technique for the tap data group. Also good.
The tap data storage unit 72 temporarily holds tap data for the attention data generated by the tap data compression unit 71, and supplies tap data for the attention data in response to a request from the filter tap supply unit 74.

フィルタタップ供給部74は、フィルタ処理の切り替えに応じて、タップデータをフィルタ演算部75に供給する。フィルタ処理がフレーム内のフィルタ処理である場合には、フィルタタップ供給部74は、タップデータ圧縮部71で圧縮されたタップデータをバイパスしてフィルタ演算部75に供給する。若しくは、フィルタタップ供給部74は、入力される映像データをもとにフレーム内のフィルタタップのデータを生成する。フレーム間のフィルタ処理である場合には、フィルタタップ供給部74は、タップデータ圧縮部71で生成された図16(b)で示したタップデータと、タップデータ記憶部72から読み出されるタップデータを用いてフィルタ処理に必要なタップデータを供給する。   The filter tap supply unit 74 supplies tap data to the filter calculation unit 75 in accordance with the switching of the filter processing. When the filter process is a filter process within a frame, the filter tap supply unit 74 bypasses the tap data compressed by the tap data compression unit 71 and supplies the tap data to the filter calculation unit 75. Alternatively, the filter tap supply unit 74 generates filter tap data in the frame based on the input video data. In the case of inter-frame filtering, the filter tap supply unit 74 uses the tap data shown in FIG. 16B generated by the tap data compression unit 71 and the tap data read from the tap data storage unit 72. Used to supply tap data necessary for filtering.

図17に示すように、あるフレームの注目画素データ90とタップデータ91は、タップデータ圧縮部71で生成されたものである。また、注目画素データ90と同じ位置にあり、フレームが異なる画像データに対するタップデータ93及び94は、タップデータ記憶部72より読み出されたものである。フィルタタップ供給部74は、複数の注目画素データのうち、時間軸上のフレームの中心となる画像データ92を注目画素データと設定し、フィルタ演算部75、及び係数割り当て部76に出力する。
係数割り当て部76は、フィルタタップ供給部74から得られる注目データの位置情報とタップデータの位置関係から、注目データからの各タップデータへの距離に応じた係数の割り当てを行う。
As shown in FIG. 17, the pixel-of-interest data 90 and the tap data 91 of a certain frame are generated by the tap data compression unit 71. Further, tap data 93 and 94 for image data in the same position as the target pixel data 90 and different frames are read from the tap data storage unit 72. The filter tap supply unit 74 sets the image data 92 that is the center of the frame on the time axis among the plurality of target pixel data as the target pixel data, and outputs the target pixel data to the filter calculation unit 75 and the coefficient allocation unit 76.
The coefficient assigning unit 76 assigns a coefficient according to the distance from the target data to each tap data from the positional information of the target data obtained from the filter tap supply unit 74 and the positional relationship between the tap data.

(フィルタ処理詳細)
以下、本実施形態におけるフィルタ処理の詳細について説明する。なお、フレーム内のフィルタ処理である場合には、他の実施形態で示してきたため、フレーム間のフィルタ処理について図17を使用して説明する。
係数割り当て部76は、フレーム間のタップデータを、注目データ92から各フレームのタップデータへの距離順にソートして、係数を設定する。注目データとタップデータ間の距離は、同一フレーム内のタップデータに対する空間的な距離Ds(x)と、フレーム間のタップデータに対する時間的な距離Dt(x)に分けられる。係数割り当て部76は、それぞれの距離の合成により、距離D(x)=a*Ds(x)+b*Dt(x)(a,b:重み係数)を算出し、この距離D(x)に基づいて、注目データからの距離順にソート処理を行う。なお、重み係数となっているa及びbに関しては、映像データの解像度とフレームレートの相対関係により変化する。距離順が定まった後に、係数を割り当てる方法は、図10、若しくは、図13のフローチャートに従えばよい。
(Filter processing details)
Hereinafter, the details of the filter processing in the present embodiment will be described. In addition, since it was shown by other embodiment in the case of the filter process in a flame | frame, the filter process between frames is demonstrated using FIG.
The coefficient allocation unit 76 sorts the tap data between frames in the order of distance from the data of interest 92 to the tap data of each frame, and sets coefficients. The distance between the data of interest and the tap data is divided into a spatial distance Ds (x) for tap data in the same frame and a temporal distance Dt (x) for tap data between frames. The coefficient assigning unit 76 calculates a distance D (x) = a * Ds (x) + b * Dt (x) (a, b: weighting coefficient) by combining the distances, and sets the distance D (x). Based on the distance from the data of interest, the sort processing is performed. Note that a and b that are weighting factors change depending on the relative relationship between the resolution of the video data and the frame rate. After the distance order is determined, a method for assigning the coefficients may follow the flowchart of FIG. 10 or FIG.

以上説明したように、本実施形態では、映像データに対してフレーム内のフィルタ処理とフレーム間のフィルタ処理を切り替える例を示した。どちらのフィルタ処理を選択した場合でも、予め用意している乗算リソースを効率的に使用することができ、フィルタ性能を最大限に高めることができる。
これにより、本実施形態では、回路規模の増大を抑制しつつ、複数のフィルタ処理を適切に実装することができる。
なお、映像データの解像度、フレームレートに応じて、タップデータ間の空間的距離と時間的距離の比率を変更することで、より重要なタップデータの感度を高めることが可能となる。
As described above, in the present embodiment, an example in which the filtering process within a frame and the filtering process between frames are switched with respect to video data has been described. Whichever filter processing is selected, the multiplication resources prepared in advance can be used efficiently, and the filter performance can be maximized.
Thereby, in this embodiment, a plurality of filter processes can be appropriately implemented while suppressing an increase in circuit scale.
It is possible to increase the sensitivity of more important tap data by changing the ratio of the spatial distance and the temporal distance between tap data according to the resolution and frame rate of the video data.

10…画像データ入力部、11、53、74…フィルタタップ供給部、12、54、75…フィルタ演算部、13、55、77…正規化部、14…画像データ出力部、50…係数割り当て部、51…信号データ入力部、52…信号データ出力部、70…映像データ入力部、71…タップデータ圧縮部、72…タップデータ記憶部、73…映像データ出力部   DESCRIPTION OF SYMBOLS 10 ... Image data input part, 11, 53, 74 ... Filter tap supply part, 12, 54, 75 ... Filter operation part, 13, 55, 77 ... Normalization part, 14 ... Image data output part, 50 ... Coefficient allocation part , 51 ... Signal data input section, 52 ... Signal data output section, 70 ... Video data input section, 71 ... Tap data compression section, 72 ... Tap data storage section, 73 ... Video data output section

Claims (11)

画像データに対してフィルタを用いたフィルタ処理を実行する画像処理回路において、
前記画像データにおける注目データ及び該注目データ近傍のデータ群から、フィルタタップのM(M:自然数)個のデータを生成する生成手段と、
所定のビット数の係数を保持する複数の乗算器と、
前記フィルタを構成するフィルタ係数に基づいて、前記係数を前記生成手段が生成したM個の前記フィルタタップのデータに割り当てる設定手段と、
を有することを特徴とする画像処理回路。
In an image processing circuit that executes filter processing using a filter on image data,
Generating means for generating M (M: natural number) data of filter taps from the attention data in the image data and the data group in the vicinity of the attention data;
A plurality of multipliers holding coefficients of a predetermined number of bits;
Setting means for allocating the coefficients to the data of the M filter taps generated by the generation means, based on filter coefficients constituting the filter;
An image processing circuit comprising:
前記生成手段により生成された前記フィルタタップの前記M個のデータと前記フィルタ係数を対応付けて積和演算を実行する演算手段をさらに有する請求項1に記載の画像処理回路。   The image processing circuit according to claim 1, further comprising a calculation unit that executes a product-sum calculation by associating the M data of the filter tap generated by the generation unit with the filter coefficient. 前記乗算器が保持する前記所定のビット数は、前記フィルタ係数のビット数よりも少ないビット幅のビット数であることを特徴とする請求項1または2に記載の画像処理回路。   3. The image processing circuit according to claim 1, wherein the predetermined number of bits held by the multiplier is a number of bits having a bit width smaller than the number of bits of the filter coefficient. 前記設定手段は、前記演算手段が積和演算する前記フィルタそれぞれのビット幅を上回るように前記係数を割り当てることを特徴とする請求項1乃至3の何れか一項に記載の画像処理回路。   4. The image processing circuit according to claim 1, wherein the setting unit assigns the coefficient so as to exceed a bit width of each of the filters for which the arithmetic unit performs a product-sum operation. 5. 前記複数の乗算器それぞれは、前記フィルタ係数のビット幅の公約数の乗算ができることを特徴とする請求項1乃至4の何れか一項に記載の画像処理回路。   5. The image processing circuit according to claim 1, wherein each of the plurality of multipliers is capable of multiplying a common divisor of a bit width of the filter coefficient. 前記演算手段は、互いに異なる複数のフィルタを用いて積和演算を実行し、
前記複数の乗算器として、前記複数のフィルタごとの最大総乗算数とスループットとに応じた数の乗算器を有することを特徴とする請求項2に記載の画像処理回路。
The computing means performs a product-sum operation using a plurality of different filters,
The image processing circuit according to claim 2, wherein the plurality of multipliers include a number of multipliers corresponding to a maximum total multiplication number and a throughput for each of the plurality of filters.
前記生成手段は、
前記フィルタが前記フィルタ係数の対称性を有しない場合は、前記画像データにおける前記注目データおよび該注目データ近傍のデータをそのままフィルタタップのM個のデータとして前記演算手段に供給し、
前記フィルタが前記フィルタ係数の対称性を有する場合は、前記注目データおよび該注目データ近傍のデータを畳み込み加算することにより前記フィルタタップの前記M個のデータを生成し、前記演算手段に供給する、
ことを特徴とする請求項1乃至6の何れか一項に記載の画像処理回路。
The generating means includes
When the filter does not have symmetry of the filter coefficient, the data of interest in the image data and the data in the vicinity of the data of interest are supplied as they are to M data of filter taps to the arithmetic means,
When the filter has symmetry of the filter coefficient, the M data of the filter tap is generated by convolutionally adding the data of interest and data in the vicinity of the data of interest, and is supplied to the calculation means.
An image processing circuit according to claim 1, wherein
前記設定手段は、前記注目データからの距離が近い前記データ群に対して前記係数を優先的に対応付けることを特徴とする請求項1から7のいずれか1項に記載の画像処理回路。   The image processing circuit according to claim 1, wherein the setting unit preferentially associates the coefficient with the data group having a short distance from the attention data. 前記設定手段は、前記注目データからの距離が近い前記データ群に対して前記係数をより多く対応付けることを特徴とする請求項1から8のいずれか1項に記載の画像処理回路。   The image processing circuit according to claim 1, wherein the setting unit associates more coefficients with the data group having a short distance from the data of interest. 前記演算手段は、少なくとも前記画像データの解像度により重み付けした空間的距離と前記画像データのフレームレートによる重み付けした時間的距離のいずれかに基づいて前記係数を前記フィルタタップに対応付けることを特徴とする請求項1から9のいずれか1項に記載の画像処理回路。   The calculation means associates the coefficient with the filter tap based on at least one of a spatial distance weighted by a resolution of the image data and a temporal distance weighted by a frame rate of the image data. Item 10. The image processing circuit according to any one of Items 1 to 9. 前記設定手段は、前記空間的距離と前記時間的距離を合成した距離に基づいて、前記係数を前記フィルタタップに対応付けることを特徴とする請求項10に記載の画像処理回路。
The image processing circuit according to claim 10, wherein the setting unit associates the coefficient with the filter tap based on a distance obtained by combining the spatial distance and the temporal distance.
JP2017161038A 2016-11-18 2017-08-24 Image processing circuit Active JP7005228B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/812,713 US10572985B2 (en) 2016-11-18 2017-11-14 Image processing circuit with multipliers allocated based on filter coefficients

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2016224915 2016-11-18
JP2016224915 2016-11-18

Publications (2)

Publication Number Publication Date
JP2018088231A true JP2018088231A (en) 2018-06-07
JP7005228B2 JP7005228B2 (en) 2022-01-21

Family

ID=62493689

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017161038A Active JP7005228B2 (en) 2016-11-18 2017-08-24 Image processing circuit

Country Status (1)

Country Link
JP (1) JP7005228B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61118012A (en) * 1984-11-14 1986-06-05 Sony Corp Digital filter
JPH05103228A (en) * 1991-10-03 1993-04-23 Sharp Corp Ghost removing device
JP2001339279A (en) * 2000-05-29 2001-12-07 Canon Inc Filter circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61118012A (en) * 1984-11-14 1986-06-05 Sony Corp Digital filter
JPH05103228A (en) * 1991-10-03 1993-04-23 Sharp Corp Ghost removing device
JP2001339279A (en) * 2000-05-29 2001-12-07 Canon Inc Filter circuit

Also Published As

Publication number Publication date
JP7005228B2 (en) 2022-01-21

Similar Documents

Publication Publication Date Title
JP4790791B2 (en) Multiplier, digital filter, signal processing device, synthesis device, synthesis program, and synthesis program recording medium
Vun et al. A new RNS based DA approach for inner product computation
US6609143B1 (en) Method and apparatus for arithmetic operation
JP2544326B2 (en) Digital filter
JP7005228B2 (en) Image processing circuit
US10572985B2 (en) Image processing circuit with multipliers allocated based on filter coefficients
US20060155793A1 (en) Canonical signed digit (CSD) coefficient multiplier with optimization
US20190384574A1 (en) Semiconductor device and method of controlling the semiconductor device
US20220075598A1 (en) Systems and Methods for Numerical Precision in Digital Multiplier Circuitry
CN113485751B (en) Method for performing Galois field multiplication, arithmetic unit and electronic device
CN111630509B (en) Arithmetic circuit for performing product-sum operation
JPH08152994A (en) Multiplier and digital filter
CN109981077B (en) Multiplier-based programmable filter
CN108268690B (en) FPGA internal ALU circuit
WO2023100372A1 (en) Data processing device, data processing method, and data processing program
Tasdizen et al. Computation reduction techniques for vector median filtering and their hardware implementation
US20230206061A1 (en) Deep learning acceleration with mixed precision
CN116737390B (en) Atomic operation processing method and device, electronic equipment and storage medium
US20230206043A1 (en) Deep learning acceleration with mixed precision
US20230206045A1 (en) Deep learning acceleration with mixed precision
US20230206042A1 (en) Deep learning acceleration with mixed precision
US20230206044A1 (en) Deep learning acceleration with mixed precision
US20230206041A1 (en) Deep learning acceleration with mixed precision
US20230206046A1 (en) Deep learning acceleration with mixed precision
JP2012089947A (en) Image reduction system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200722

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210928

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211126

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20211207

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220105