JP4963194B2 - Filter processing device, multiplier, and motion compensation processing device - Google Patents

Filter processing device, multiplier, and motion compensation processing device Download PDF

Info

Publication number
JP4963194B2
JP4963194B2 JP2006153363A JP2006153363A JP4963194B2 JP 4963194 B2 JP4963194 B2 JP 4963194B2 JP 2006153363 A JP2006153363 A JP 2006153363A JP 2006153363 A JP2006153363 A JP 2006153363A JP 4963194 B2 JP4963194 B2 JP 4963194B2
Authority
JP
Japan
Prior art keywords
partial product
filter
product generation
unit
generation unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2006153363A
Other languages
Japanese (ja)
Other versions
JP2007324980A (en
Inventor
陽一 片山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2006153363A priority Critical patent/JP4963194B2/en
Publication of JP2007324980A publication Critical patent/JP2007324980A/en
Application granted granted Critical
Publication of JP4963194B2 publication Critical patent/JP4963194B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、動画の圧縮符号化復号に使用される動き補償処理におけるフィルタ演算を実行するために好適なフィルタ処理装置及び乗算器、並びにこれらを具備する動き補償処理装置に関する。   The present invention relates to a filter processing device and a multiplier suitable for executing a filter operation in a motion compensation process used for compression coding / decoding of a moving image, and a motion compensation processing device including these.

次世代DVD(Digital Versatile Disk)やDTV(デジタルテレビ)に採用が決定しているH.264/AVCやVC−1といった新しいコーデックがある。これらの復号装置においては、動き補償部での動き補償予測フィルタのフィルタ演算をブースのアルゴリズムを適用した乗算器で構成される場合がある。   H. has been decided to be adopted for the next generation DVD (Digital Versatile Disk) and DTV (digital television). There are new codecs such as H.264 / AVC and VC-1. In these decoding apparatuses, the filter operation of the motion compensation prediction filter in the motion compensation unit may be configured by a multiplier to which Booth's algorithm is applied.

乗算器の演算時間は、部分積加算をするために必要とする時間と桁上げ信号吸収をするために必要な時間の総和であり、演算速度を高速にする上でこれらの処理時間の短縮が問題となる。その対策として加算回路を減らすために部分積の数そのものを削減する必要がある。そのためには乗数の連続する複数ビットを一まとめのグループにして、このグループに対応した部分積を生成すれば部分積を削減することができる。そこで部分積数削減のために用いられるのが2次のブースである。2次のブースとは、乗数を2ビットごとに区切り、各組と下位組の最上位ビットの計3ビットをひとまとめにするというアルゴリズムを適用した部分積削減の手法である。   The operation time of the multiplier is the sum of the time required to add the partial products and the time required to absorb the carry signal. In order to increase the operation speed, the processing time can be shortened. It becomes a problem. As a countermeasure, it is necessary to reduce the number of partial products in order to reduce the number of adder circuits. For this purpose, partial products can be reduced by grouping together a plurality of bits having consecutive multipliers and generating a partial product corresponding to this group. Therefore, the secondary booth is used to reduce the partial product number. The secondary booth is a partial product reduction technique to which an algorithm is applied in which a multiplier is divided every 2 bits, and a total of 3 bits of the most significant bits of each group and the lower group are combined.

しかしながら、上記のようなコーデックのフィルタ演算を行なう際、これをブースのアルゴリズムを適用した乗算器で構成すると、多数の乗算器が必要となり回路規模が増大する。また、同様にH.264の画面内予測における予測画像の生成に使用されるフィルタ演算をブースのアルゴリズムを適用した乗算器で適用すると回路規模は増大する。   However, when the codec filter operation as described above is performed by a multiplier to which the Booth algorithm is applied, a large number of multipliers are required and the circuit scale increases. Similarly, H. When the filter operation used to generate a predicted image in the H.264 intra-screen prediction is applied by a multiplier to which the Booth algorithm is applied, the circuit scale increases.

これは、H.264やVC−1といった規格では、従来のMPEG(Moving Picture Experts Group)2などに比べて極めて複雑な演算を要求されるからである。下記表1に、MPEG2、H.264、VC−1の機能比較を示す。   This is because of H.C. This is because standards such as H.264 and VC-1 require extremely complicated calculations as compared to conventional MPEG (Moving Picture Experts Group) 2 and the like. Table 1 below shows MPEG2, H.264. H.264, VC-1 functional comparison.

Figure 0004963194
Figure 0004963194

ところで、従来、動き補償のフィルタ演算回路の規模を縮小させる技術が特許文献1に開示されている。図12は、特許文献1に記載の画像処理装置における累積加算フィルタ(ディジタルフィルタ)を示すブロック図である。図12に示すように、従来のディジタルフィルタは、入力画像信号の画素ライン数を計測し、そのカウンタモジューロが拡大縮小率に応じて選択的に切り替えられるカウンタ503と、カウンタ503の係数値に応じたフィルタ係数を出力する係数データメモリ502と、入力画像信号に対しフィルタ係数を乗算する乗算器501と、乗算器501の出力又は累積加算値を保持する累積加算メモリ506と、乗算器501の出力に累積加算メモリ506内の保持内容を加算する加算器504と、カウンタ503の係数値に従って乗算器501又は加算器504の出力を選択的に累積加算メモリ506に伝達するセレクタ505とを有する。乗算器501、加算器504を1つとし、累積演算によりフィルタ出力を得ることで所要ハードウェア量を削減している。
特開2001−160140号公報
Conventionally, a technique for reducing the scale of a motion compensation filter arithmetic circuit is disclosed in Patent Document 1. FIG. 12 is a block diagram showing a cumulative addition filter (digital filter) in the image processing apparatus described in Patent Document 1. As shown in FIG. 12, the conventional digital filter measures the number of pixel lines of the input image signal, and the counter modulo thereof is selectively switched according to the enlargement / reduction ratio, and the coefficient value of the counter 503 is set. A coefficient data memory 502 that outputs the corresponding filter coefficient, a multiplier 501 that multiplies the input image signal by the filter coefficient, a cumulative addition memory 506 that holds the output of the multiplier 501 or a cumulative addition value, and a multiplier 501 An adder 504 that adds the content held in the cumulative addition memory 506 to the output, and a selector 505 that selectively transmits the output of the multiplier 501 or the adder 504 to the cumulative addition memory 506 in accordance with the coefficient value of the counter 503. The required hardware amount is reduced by using one multiplier 501 and one adder 504 and obtaining a filter output by cumulative calculation.
JP 2001-160140 A

しかしながら、上記特許文献1のように、累積演算することでハードウェア量を削減しようとしても、ステップ数が増大し、処理速度が遅くなり現実的ではない。特に、H.264やVC−1といったフィルタのタップ数が多い場合には、演算が複雑になるため、更に処理速度が遅くなるという問題点がある。   However, as in Patent Document 1, even if an attempt is made to reduce the amount of hardware by cumulative calculation, the number of steps increases and the processing speed becomes slow, which is not realistic. In particular, H.C. When the number of taps of a filter such as H.264 or VC-1 is large, the calculation becomes complicated, and thus there is a problem that the processing speed is further reduced.

本発明にかかるフィルタ処理装置は、複数のフィルタについて、複数の入力データとフィルタを構成する複数のフィルタ係数のそれぞれとをブースアルゴリズムを用いて積和演算するフィルタ処理装置であって、前記入力データと当該入力データに対応付けられたフィルタ係数とからなる1以上の組データが入力され、1以上の部分積を生成する複数の部分積生成ユニットと、前記複数の部分積生成ユニットにより生成される部分積の総和を生成する加算部と、前記組データに応じ、前記複数の部分積生成ユニットを1以上選択して当該組データを入力する部分積生成部選択部とを有するものである。   A filter processing apparatus according to the present invention is a filter processing apparatus that performs a product-sum operation on a plurality of filters using a Booth algorithm for a plurality of input data and a plurality of filter coefficients constituting the filter. And one or more sets of data composed of filter coefficients associated with the input data are input and generated by a plurality of partial product generation units that generate one or more partial products and the plurality of partial product generation units An addition unit that generates a sum of partial products, and a partial product generation unit selection unit that selects one or more of the plurality of partial product generation units and inputs the set data according to the set data.

本発明においては、一の組データから生成すべき部分積の一部が一の部分積生成ユニットでは生成不能な場合、2以上の部分積生成ユニットを使用して部分積を生成することで、個々の部分積生成ユニットの演算能力又は回路規模を低く抑えることができる。   In the present invention, when a partial product to be generated from one set of data cannot be generated by one partial product generation unit, a partial product is generated using two or more partial product generation units. The calculation capability or circuit scale of each partial product generation unit can be kept low.

本発明によれば、処理速度を低下させることなくハードウェア量を削減することができるブースアルゴリズムを利用したフィルタ処理装置、乗算器、及びこれを利用した動き補償処理装置を提供することができる。   According to the present invention, it is possible to provide a filter processing device, a multiplier, and a motion compensation processing device using the same, which use a Booth algorithm that can reduce the amount of hardware without reducing the processing speed.

以下、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。この実施の形態は、本発明を、異なる種類のフィルタ演算を実効させるフィルタ処理器(乗算器)に適用したものである。本実施の形態は、ブースアルゴリズムを利用したフィルタ演算器において、部分積生成ユニットの機能と、乗数となるフィルタ係数とに着目し、冗長な回路を省略することでハードウェア量を削減する。なお、本実施の形態においては、フィルタ演算器として説明するが、複数種類の予め定められた乗数群と任意の被乗数群とを乗算させる乗算器とすることも可能である。   Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings. In this embodiment, the present invention is applied to a filter processor (multiplier) that executes different types of filter operations. In this embodiment, the filter operation unit using the Booth algorithm pays attention to the function of the partial product generation unit and the filter coefficient to be a multiplier, and reduces the amount of hardware by omitting redundant circuits. In this embodiment, although described as a filter computing unit, a multiplier that multiplies a plurality of types of predetermined multiplier groups and an arbitrary multiplicand group may be used.

(1)ブースのアルゴリズムを適用した乗算器
本実施の形態にかかるフィルタ演算器は、ブースのアルゴリズムを使用して乗算を行うフィルタ演算器である。ここでは先ず、本発明の理解を容易とするため、2次のブースアルゴリズムを利用した乗算器について説明しておく。
(1) Multiplier to which Booth's algorithm is applied The filter arithmetic unit according to the present embodiment is a filter arithmetic unit that performs multiplication using the Booth's algorithm. Here, first, in order to facilitate understanding of the present invention, a multiplier using a second order Booth algorithm will be described.

乗数Yを符号付き8ビット整数
Y=−y[7]・2+y[6]・2+y[5]・2+y[4]・2+y[3]・2+y[2]・2+y[1]・2+y[0]・2
とすると、任意整数である被乗数Xとの積P=X×Yは以下のようになる。
Multiplier Y is a signed 8-bit integer Y = −y [7] · 2 7 + y [6] · 2 6 + y [5] · 2 5 + y [4] · 2 4 + y [3] · 2 3 + y [2]・ 2 2 + y [1] ・ 2 1 + y [0] ・ 2 0
Then, the product P = X × Y with the multiplicand X, which is an arbitrary integer, is as follows.

Figure 0004963194
Figure 0004963194

この(−2・y[2i+1]+y[2i]+y[2i-1])を算出するものをブースデコーダ、X×(−2・y[2i+1}+y[2i]+y[2i-1])×22iを部分積という。ここで、本明細書においては、ブースデコーダにより求められるデコード値(−2・y[2i+1]+y[2i]+y[2i-1])を符号データということとする。また、X×(−2・y[2i+1}+y[2i]+y[2i-1])×22i(部分積)を生成する回路を部分積生成ユニット、X×(−2・y[2i+1}+y[2i]+y[2i-1])×22iのうち、各iに対応した部分積を生成する回路を部分積生成部、符号データ(−2・y[2i+1]+y[2i]+y[2i-1])を求める回路をブースデコーダ、符号データ×被乗数からなる演算を行ない部分積を求める回路を乗算部、部分積のうち、×22iの演算を実行する部分をビットシフト部ということとする。 What calculates (−2 · y [2i + 1] + y [2i] + y [2i-1]) is a booth decoder, X × (−2 · y [2i + 1} + y [2i] + y [2i-1]) × 2 2i is called partial product. In this specification, the decode value (−2 · y [2i + 1] + y [2i] + y [2i−1]) obtained by the Booth decoder is referred to as code data. In addition, a circuit for generating X × (−2 · y [2i + 1} + y [2i] + y [2i−1]) × 2 2i (partial product) is a partial product generation unit, and X × (−2 · y [2i + 1} + Y [2i] + y [2i-1]) × 2 2i , a circuit that generates a partial product corresponding to each i is represented by a partial product generation unit, code data (−2 · y [2i + 1] + y [2i] + y [ 2i-1]) is a booth decoder, a circuit that performs an operation consisting of code data × multiplicand to obtain a partial product is a multiplication unit, and a portion of the partial product that is to execute an operation of × 2 2i is a bit shift unit. And

ここで、下記表2に示すように、符号データ(−2・y[2i+1]+y[2i]+y[2i-1])の値の組み合わせは8通りしかなく、0、±1、±2の値のみしかとらない。よって、乗算器は、0、±X、±2Xに22iを乗算した値(部分積)を算出して加算する値の組み合わせの対応(真理値表)として書ける。ここで、符号データの値は8通りしかないため、ブースデコーダは、単なる組み合わせ論理回路により得ることができる。 Here, as shown in Table 2 below, there are only eight combinations of values of the code data (−2 · y [2i + 1] + y [2i] + y [2i−1]), and 0, ± 1, ± 2 Takes only a value. Therefore, the multiplier can calculate a value (partial product) obtained by multiplying 0, ± X, ± 2X by 2 2i and write it as a correspondence (truth table) of combinations of values to be added. Here, since there are only eight values of the code data, the booth decoder can be obtained by a simple combinational logic circuit.

Figure 0004963194
Figure 0004963194

0、±X、±2Xのうち、2Xの生成は1ビットのシフトで行なうことができる。一方、負数の生成は被乗数Xが2の補数表現であるのでXの各ビットを反転させ最下位ビットに1を加えればよい。これを実現するために、例えば、符号データ(−2・y[2i+1]+y[2i]+y[2i-1])を生成する回路(ブースデコーダ)は、乗数Yの入力に対して部分積の絶対値(0、X、2X)を選択するための2つの信号と反転を選択するための1つの信号とからなる3つの信号を生成する。また、乗算部は、この3つの信号を受けて、絶対値が0の場合は0を、Xの場合は被乗数X を、2Xの場合は被乗数Xを1ビットシフトしたものを選択し、さらに、反転が必要な場合はその値を反転させて部分積を生成することができる。さらに、×22iを実行するビットシフト部は、単純にビット線を2iだけシフトさせればよい。 Of 0, ± X, and ± 2X, 2X can be generated by a 1-bit shift. On the other hand, since the multiplicand X is expressed in the complement of 2 when generating the negative number, it is only necessary to invert each bit of X and add 1 to the least significant bit. In order to realize this, for example, a circuit (Booth decoder) that generates code data (−2 · y [2i + 1] + y [2i] + y [2i−1]) Three signals including two signals for selecting an absolute value (0, X, 2X) and one signal for selecting inversion are generated. Further, the multiplication unit receives these three signals, and when the absolute value is 0, it is 0, and when it is X, the multiplicand X In the case of 2X, the multiplicand X shifted by 1 bit is selected, and if the inversion is necessary, the value can be inverted to generate a partial product. Furthermore, the bit shift unit that executes x2 2i may simply shift the bit line by 2i.

図1は、このような2次のブースのアルゴリズムに従って乗算を実行する乗算器を示すブロック図である。乗算器400は、被乗数Xを出力するレジスタF0と、乗数Yを出力するレジスタF7を有する。更に、乗数Y及び被乗数Xが入力され部分積を生成する部分積生成ユニット401と、部分積生成ユニット401にて生成された部分積を加算する加算器450とを有する。部分積生成ユニット401は、4つの部分積生成部410、420、430、440を有する   FIG. 1 is a block diagram illustrating a multiplier that performs multiplication according to such a second order Booth algorithm. The multiplier 400 includes a register F0 that outputs a multiplicand X and a register F7 that outputs a multiplier Y. Furthermore, a partial product generation unit 401 that receives a multiplier Y and a multiplicand X and generates a partial product, and an adder 450 that adds the partial products generated by the partial product generation unit 401 are provided. The partial product generation unit 401 includes four partial product generation units 410, 420, 430, and 440.

各部分積生成部は、上述したように、乗数Yのうち所定ビットが入力され、ブースのアルゴリズムに従って符号データ(0、±1、±2)を生成するブースデコーダと、得られた符号データと被乗数Xとの乗算結果を出力する乗算部と、乗算部の演算結果のビットシフトを行なうビットシフト部とから構成されるものとする。   As described above, each partial product generator receives a predetermined bit of the multiplier Y, generates a code data (0, ± 1, ± 2) according to Booth's algorithm, and the obtained code data It is assumed that a multiplication unit that outputs a multiplication result with the multiplicand X and a bit shift unit that performs a bit shift of a calculation result of the multiplication unit.

各部分積生成部は、X×(−2・y[2i+1}+y[2i]+y[2i-1])×22iの"i"に対応したものとなっており、例えば乗数Yが8ビット(y〜yとする)であれば、i=0〜3であり、それぞれX×(−2・y+y+0)×2、X×(−2・y+y+y)×2、X×(−2・y+y+y)×2、X×(−2・y+y+y)×2を求める。図1においては、これらの部分積を求める部分積生成部を、それぞれ410、420、430、440としている。なお、本実施の形態においては、ブースデコーダでデコードする乗数Xが8ビットを例にとって説明するが、これ未満、又は以上であってもよいことは勿論である。その場合は、部分積生成部の個数を適宜調整すればよい。 Each partial product generator corresponds to “i” of X × (−2 · y [2i + 1} + y [2i] + y [2i−1]) × 2 2i . For example, the multiplier Y is 8 bits. (Y 0 to y 7 ), i = 0 to 3, and X × (−2 · y 1 + y 0 +0) × 2 0 and X × (−2 · y 3 + y 2 + y 1, respectively. ) × 2 2 , X × (−2 · y 5 + y 4 + y 3 ) × 2 4 , and X × (−2 · y 7 + y 6 + y 5 ) × 2 6 are obtained. In FIG. 1, the partial product generation units for obtaining these partial products are 410, 420, 430, and 440, respectively. In the present embodiment, the multiplier X decoded by the Booth decoder will be described by taking 8 bits as an example, but it is needless to say that the multiplier X may be less than or more than this. In that case, what is necessary is just to adjust the number of partial product production | generation parts suitably.

次に、実際の演算を例にとって、この乗算器400の動作について説明する。8ビットの乗数Yは、図2(a)のように表すことができる。乗数を2ビットごとに区切り、各組と下位組の最上位ビットの計3ビット(ただしy−1=0)のデータから符号データが得られる。これらに被乗数を乗算し、対応するビットシフト(×2)を演算することで部分積を生成することができる。このため、図2(b)に示すように、レジスタF7は8ビットを出力するシフトレジスタからなり、乗数Y{y〜y}を出力する。このとき部分積生成部410には、乗数Yのうち下位2ビット{y、y}、部分積生成部420、430、440にはそれぞれ、{y、y、y}、{y、y、y}、{y、y、y}を入力する。部分積生成部410は、入力されたこれらの所定ビットから符号データを生成するブースデコーダ411と、得られた符号データと被乗数Xとの乗算を行なう乗算部412と、乗算結果を所定ビットシフトするビットシフト部413とを有する。他の部分積生成部420、430、440も同様に構成される。ここでは、被乗数X=358(166H)、乗数Y=123(7BH)の乗算について説明する。下記表2は、演算工程における各出力値を示す。 Next, the operation of the multiplier 400 will be described using an actual calculation as an example. The 8-bit multiplier Y can be expressed as shown in FIG. The multiplier is divided every 2 bits, and the code data is obtained from the data of a total of 3 bits (however, y −1 = 0) of the most significant bit of each group and the lower group. A partial product can be generated by multiplying these by a multiplicand and calculating a corresponding bit shift (× 2 i ). For this reason, as shown in FIG. 2B, the register F7 is composed of a shift register that outputs 8 bits, and outputs a multiplier Y {y 0 to y 7 }. At this time, the partial product generator 410 has the lower two bits {y 0 , y 1 } of the multiplier Y, and the partial product generators 420, 430, and 440 have {y 1 , y 2 , y 3 }, { Enter y 3 , y 4 , y 5 }, {y 5 , y 6 , y 7 }. The partial product generation unit 410 generates a code data from these inputted predetermined bits, a booth decoder 411, a multiplication unit 412 that multiplies the obtained code data and the multiplicand X, and shifts the multiplication result by a predetermined bit. A bit shift unit 413. The other partial product generation units 420, 430, and 440 are similarly configured. Here, the multiplication of the multiplicand X = 358 (166H) and the multiplier Y = 123 (7BH) will be described. Table 2 below shows each output value in the calculation process.

Figure 0004963194
Figure 0004963194

×Y=358×123=44034(AC02H)
Y=123(7BH)
=(−2・0+1+1)・2
+(−2・1+1+1)・2
+(−2・1+0+1)・2
+(−2・1+1+0)・2
=2・2+0・2+(−1)・2+(−1)・2
よって、下記となる。
X×Y={(2×356)×2} ・・・部分積生成部410にて演算
+{(0×356)×2} ・・・部分積生成部420にて演算
+{(−1×356)×2} ・・・部分積生成部430にて演算
+{(−1×356)×2} ・・・部分積生成部440にて演算
× Y = 358 × 123 = 44034 (AC02H)
Y = 123 (7BH)
= (-2 ・ 0 + 1 + 1) ・ 2 6
+ (− 2 · 1 + 1 + 1) · 2 4
+ (-2 · 1 + 0 + 1) · 2 2
+ (-2 · 1 + 1 + 0) · 2 0
= 2 · 2 6 + 0 · 2 4 + (− 1) · 2 2 + (− 1) · 2 0
Therefore, it becomes the following.
X × Y = {(2 × 356) × 2 6 }... Operation in partial product generation unit 410 + {(0 × 356) × 2 4 }... Operation in partial product generation unit 420 + {( −1 × 356) × 2 2 }... Operation in partial product generation unit 430 + {(− 1 × 356) × 2 0 }... Operation in partial product generation unit 440

先ず、被乗数入力部F0からは"358"が各部分積生成部410、420、430、440に入力される。乗数入力部F7からは、各部分積生成部410、420、430、440に、それぞれ{y、y}={1、1}、{y、y、y}={1、0、1}、{y、y、y}={1、1、1}、{y、y、y}={1、1、0}が入力される。ブースデコーダ411、421、431、441は入力された所定ビットから、それぞれ(−2・y[2i+1}+y[2i]+y[2i-1])=(−2・y+y+0)、(−2・y+y+y)、(−2・y+y+y)、(−2・y+y+y)の演算に対応する符号データを出力する。上記の式より本例では、各ブースデコーダ411、421、431、441は、それぞれ、"−1"、"−1"、"0"、"2"を出力する。 First, “358” is input to each partial product generation unit 410, 420, 430, 440 from the multiplicand input unit F0. From the multiplier input unit F7, each partial product generation unit 410, 420, 430, 440 receives {y 0 , y 1 } = {1, 1}, {y 1 , y 2 , y 3 } = {1, 0, 1}, {y 3 , y 4 , y 5 } = {1, 1, 1}, {y 5 , y 6 , y 7 } = {1, 1, 0} are input. The booth decoders 411, 421, 431, and 441 respectively receive (−2 · y [2i + 1} + y [2i] + y [2i−1]) = (− 2 · y 1 + y 0 +0), ( Code data corresponding to the calculation of (−2 · y 3 + y 2 + y 1 ), (−2 · y 5 + y 4 + y 3 ), (−2 · y 7 + y 6 + y 5 ) is output. From the above equation, in this example, each booth decoder 411, 421, 431, 441 outputs “−1”, “−1”, “0”, “2”, respectively.

各乗算部412、422、432、442は、上記符号データ×被乗数Xを演算して、それぞれビットシフト部413、423、433、443へ入力する。ビットシフト部413はそのまま加算器450へ出力する。なお、本例においては説明の明確のためビットシフト部413を設けているが設ける必要はない。ビットシフト部423、433、443は、受け取った結果をそれぞれ2ビット、4ビット、6ビットシフトさせた後、加算器450へ入力する。   Each of the multipliers 412, 422, 432, 442 calculates the code data × the multiplicand X and inputs them to the bit shift units 413, 423, 433, 443, respectively. The bit shift unit 413 outputs it to the adder 450 as it is. In this example, the bit shift unit 413 is provided for clarity of explanation, but it is not necessary to provide it. Bit shift sections 423, 433, and 443 shift the received results by 2 bits, 4 bits, and 6 bits, respectively, and input the result to adder 450.

本例の加算器450は、全加算器(フルアダー)451、452と、半加算器(ハーフアダー)453と、結果を受け取るレジスタ454とを有する。各ビットシフト部413、423、433、443から入力された値は、加算器450にて加算され、乗算結果Pとして出力される。   The adder 450 of this example includes full adders (full adders) 451 and 452, half adders (half adders) 453, and a register 454 for receiving the result. The values input from the bit shift units 413, 423, 433, and 443 are added by the adder 450 and output as the multiplication result P.

このように、2次のブースのアルゴリズムを使用すると、乗数を、0、±1、±2の符号データ×22iとし、被乗数と演算を行なわせるので、部分積の個数が略半分となる。よって加算器にて加算する部分積の個数を略半減させることができるので、乗算器を小型化することができる。 In this way, when the second-order Booth algorithm is used, the multiplier is set to 0, ± 1, ± 2 code data × 2 2i and the calculation is performed with the multiplicand, so that the number of partial products is substantially halved. Therefore, the number of partial products to be added by the adder can be substantially halved, so that the multiplier can be reduced in size.

ここで、部分積生成ユニットの機能について説明する。フィルタ演算器を構成する部分積生成ユニットは、複数の部分積生成部を備えるが、その演算能力に応じて当該部分積生成部の構成を異なるもとすることができる。すなわち、図1、2に示す部分積生成ユニットは、4つの部分積生成部を設け、X×(−2・y[2i+1}+y[2i]+y[2i-1])×22iのi=3まで、×64までの演算能力を有する。一方、乗数Xを6ビットで表すことができれば部分積生成部は3つ、すなわち×16までの演算能力を有すればよく、乗数Xを4ビットで表すことができればこれらの組は2つ、すなわち×4の演算能力を有すればよい。 Here, the function of the partial product generation unit will be described. Although the partial product generation unit constituting the filter arithmetic unit includes a plurality of partial product generation units, the configuration of the partial product generation unit may be different depending on the calculation capability. That is, the partial product generation unit shown in FIGS. 1 and 2 includes four partial product generation units, and i = (X × (−2 · y [2i + 1} + y [2i] + y [2i−1]) × 2 2i ) It has a computing capacity of up to 3 and up to x64. On the other hand, if the multiplier X can be represented by 6 bits, the partial product generation unit only needs to have three computing powers, that is, up to × 16, and if the multiplier X can be represented by 4 bits, these sets are two. That is, it only needs to have a computing capacity of x4.

このように部分積生成ユニットは、乗数Xに応じて部分積生成部が演算可能な最大の桁数が異なる。よって、生成可能な部分積の数が異なる。また、入力されるフィルタ係数によっては、例えば×1、×4、×16、×64のうち、×16の部分積生成部430のみを除いたような構成とすることも可能である。すなわち、部分積生成部を3つのみでも×64までの演算を可能な構成とすることもできる。更にまた、×1に対応する部分積生成部のビットシフト部は省略することが可能である。また、後述するように、符号データによっても部分積生成部の構成を異ならせることも可能である。つまり、生成される符号データが常に"0、1"であるような部分積生成部には、符号データ"0、1"にのみ対応できればよい。よって少なくとも符号データと入力データを乗算する乗算部は不要である。更に、生成される符号データが常に"0"であるような部分積生成部は、符号データ"0"にのみ対応できればよい。この場合は、出力が常に"0"となるため、乗算部及びビットシフト部は不要である。このように、フィルタ演算器に入力されるフィルタ係数が予め定められており、生成される符号データが予め定まる場合には、その符号データに応じた部分積生成部の構成とすることができる。   In this way, the partial product generation unit differs in the maximum number of digits that can be calculated by the partial product generation unit according to the multiplier X. Therefore, the number of partial products that can be generated is different. Further, depending on the input filter coefficient, for example, it is possible to configure such that only the x16 partial product generation unit 430 is excluded from x1, x4, x16, and x64. That is, it is possible to adopt a configuration capable of performing calculations up to x64 even with only three partial product generation units. Furthermore, the bit shift unit of the partial product generation unit corresponding to × 1 can be omitted. Further, as will be described later, the configuration of the partial product generation unit can be varied depending on the code data. That is, a partial product generation unit in which the generated code data is always “0, 1” is only required to support the code data “0, 1”. Therefore, a multiplication unit that multiplies at least the code data and the input data is unnecessary. Furthermore, the partial product generation unit in which the generated code data is always “0” only needs to support only the code data “0”. In this case, since the output is always “0”, the multiplication unit and the bit shift unit are unnecessary. As described above, when the filter coefficient input to the filter arithmetic unit is determined in advance and the code data to be generated is determined in advance, the partial product generation unit according to the code data can be configured.

このように、部分積生成ユニットは、それを構成する部分積生成部の個数、演算可能な最大桁数、生成可能な部分積の数、対応可能な符号データの種類などが異なり、演算能力を異ならせることができる。よって、後述するように、入力されるフィルタ係数や、当該フィルタ係数から得られる符号データ等に応じて最小限の演算能力の部分積生成ユニットとすれば、回路規模の削減につながる。   In this way, the partial product generation unit differs in the number of partial product generation units constituting it, the maximum number of digits that can be calculated, the number of partial products that can be generated, the types of code data that can be handled, etc. Can be different. Therefore, as will be described later, if a partial product generation unit having a minimum computing capacity is used in accordance with input filter coefficients, code data obtained from the filter coefficients, and the like, the circuit scale can be reduced.

(2)ハードウェア低減の原理
上述したように、本実施の形態にかかるフィルタ演算器は、部分積生成ユニットを構成する部分積生成部の演算能力とフィルタ係数(乗数)とに着目してハードウェア量を削減する。本実施の形態にかかるフィルタ演算器は、例えば、後述するH.264やVC−1の動き補償処理や、H.264の画面内予測処理等に使用されるフィルタ演算を実行させる演算器に適用することで得にそのハードウェア削減効果が大きくなる。これらはタップ数の多いフィルタの演算であって、極めて複雑であり、非常に大きな演算回路を必要とするからである。なお、上記フィルタ演算に限らず、複数のフィルタ演算を実行させるフィルタ演算器に適用することができる。またフィルタ演算に限らず、予め定められた乗数と任意の被乗数とを乗算する乗算器に適用することも可能である。
(2) Principle of Hardware Reduction As described above, the filter arithmetic unit according to the present embodiment is hardware based on the calculation capability and filter coefficient (multiplier) of the partial product generation unit constituting the partial product generation unit. Reduce the amount of wear. The filter arithmetic unit according to the present embodiment is, for example, an H.264 described later. H.264 and VC-1 motion compensation processing, By applying to a computing unit that executes a filter calculation used for H.264 intra-screen prediction processing or the like, the hardware reduction effect is greatly increased. This is because these operations are performed by a filter having a large number of taps, are extremely complicated, and require a very large arithmetic circuit. Note that the present invention is not limited to the above filter calculation, and can be applied to a filter calculator that executes a plurality of filter calculations. Further, the present invention is not limited to the filter operation, and can be applied to a multiplier that multiplies a predetermined multiplier and an arbitrary multiplicand.

先ず、簡単なフィルタ演算の例をとって、上記ブースのアルゴリズムを適用したフィルタ演算器のハードウェア削減の原理について説明する。図3は、フィルタ係数及びその符号データを示す図である。図3に示すように、フィルタ演算#1は、
G1=20×f0−8×f1+1×f2
を実行するものとする。ここで、f0、f1、f2は入力される入力データ(被乗数)、これに対応するフィルタ係数(乗数)が20、−8、1である。また、フィルタ演算#2は、
G2=9×f0−1×f1+16×f2
を実行するものとする。つまり、フィルタ演算#2における各フィルタ係数は9、−1、16である。
First, the principle of the hardware reduction of the filter arithmetic unit to which the Booth algorithm is applied will be described using a simple filter arithmetic example. FIG. 3 is a diagram showing filter coefficients and their code data. As shown in FIG. 3, the filter operation # 1 is
G1 = 20 * f0-8 * f1 + 1 * f2
Shall be executed. Here, f0, f1, and f2 are input data (multiplicands) to be input, and the filter coefficients (multipliers) corresponding thereto are 20, -8, and 1, respectively. Also, the filter operation # 2 is
G2 = 9 * f0-1 * f1 + 16 * f2
Shall be executed. That is, the filter coefficients in the filter calculation # 2 are 9, -1, and 16, respectively.

図4は、このフィルタ演算を行なうため、上述の乗算器を組み合せた通常のフィルタ演算器を示す図である。フィルタ演算器500は、係数データメモリ502と、被乗数f0、f1、f2である入力データを入力するレジスタF0、F1、F2と、入力データと当該入力データに対応付けられたフィルタ係数とからなる組データがそれぞれ入力される3つの部分積生成ユニット510、520、530と、加算器540とを有する。   FIG. 4 is a diagram showing a normal filter arithmetic unit in which the above-described multipliers are combined to perform this filter operation. The filter computing unit 500 includes a coefficient data memory 502, registers F0, F1, and F2 for inputting input data as multiplicands f0, f1, and f2, and a filter coefficient associated with the input data and the input data. It has three partial product generation units 510, 520, and 530 to which data is input, and an adder 540.

部分積生成ユニット510は、上記組データとして、フィルタ演算#1では入力データf0及びフィルタ係数"20"が入力され、フィルタ演算#2では入力データf0及びフィルタ係数"9"が入力される。そして、X×(−2・y[2i+1}+y[2i]+y[2i-1])×22i(Xは乗数)のi=0、1、2、すなわち×1、×4、×16に対応する部分積を求めるそれぞれ513、512、511を有する。 The partial product generation unit 510 receives the input data f0 and the filter coefficient “20” in the filter operation # 1 and the input data f0 and the filter coefficient “9” in the filter operation # 2 as the set data. And X × (−2 · y [2i + 1} + y [2i] + y [2i−1]) × 2 2i (X is a multiplier) i = 0, 1, 2, ie, x1, x4, x16 513, 512, and 511 are respectively obtained for corresponding partial products.

部分積生成ユニット520、530も同様に、フィルタ演算#1で、入力データf1及びフィルタ係数"−8"、入力データf2及びフィルタ係数"1"が入力され、フィルタ演算#2で、入力データf1及びフィルタ係数"−1"、入力データf2及びフィルタ係数"16"が入力される。また、それぞれ部分積生成部523、522、521とそれぞれ部分積生成部523、522、521を有する。加算器540は、8つの全加算器541、レジスタ542、543及び半加算器544を有する。   Similarly, the partial product generation units 520 and 530 receive the input data f1 and the filter coefficient “−8”, the input data f2 and the filter coefficient “1” in the filter operation # 1, and the input data f1 in the filter operation # 2. The filter coefficient “−1”, the input data f2, and the filter coefficient “16” are input. Also, partial product generation units 523, 522, and 521 and partial product generation units 523, 522, and 521, respectively. The adder 540 includes eight full adders 541, registers 542 and 543, and a half adder 544.

係数データメモリ502は、図2のレジスタF7に相当するものであり、3つのレジスタとして構成することも可能である。この係数データメモリ502より、フィルタ演算#1の場合には、部分積生成ユニット510、520、530にそれぞれ20、−8、1が入力される。またフィルタ演算#2の場合には、それぞれ9、−1、16が入力される。   The coefficient data memory 502 corresponds to the register F7 in FIG. 2, and can be configured as three registers. From the coefficient data memory 502, in the case of the filter calculation # 1, 20, -8, and 1 are input to the partial product generation units 510, 520, and 530, respectively. In the case of filter calculation # 2, 9, -1, and 16 are input, respectively.

次に、このフィルタ演算器500の動作について説明する。例えばフィルタ演算#1において、部分積生成ユニット510には、フィルタ係数"20"該当する2又は3ビットが各部分積生成部513、512、511に入力される。レジスタF0からは乗算すべき入力データ(被乗数)が入力される。なお、本実施の形態においては、乗数は、レジスタF0、F1、F2にシリアルに入力されるものとして説明するが、各レジスタF0〜F2にパラレルに入力するようにしてもよい。   Next, the operation of the filter calculator 500 will be described. For example, in the filter operation # 1, 2 or 3 bits corresponding to the filter coefficient “20” are input to the partial product generation units 510 to the partial product generation units 513, 512, and 511. Input data (multiplicand) to be multiplied is input from the register F0. In the present embodiment, the multiplier is described as being serially input to the registers F0, F1, and F2, but may be input to the registers F0 to F2 in parallel.

部分積生成部511、512、513は、図3に示すように、入力された所定ビットをブースのアルゴリズムにしたがってデコードした符号データを生成する。そして、符号データとレジスタF0からの入力データとを乗算し、部分積生成部511は演算結果を4ビットシフトして加算器540に出力する。部分積生成部512は演算結果を2ビットシフトして加算器540に出力する。部分積生成部513は演算結果をそのまま加算器540に出力する。他の部分積生成ユニット520、530も同様に演算する。   As shown in FIG. 3, the partial product generation units 511, 512, and 513 generate code data obtained by decoding the input predetermined bits according to Booth's algorithm. Then, the code data and the input data from the register F0 are multiplied, and the partial product generation unit 511 shifts the calculation result by 4 bits and outputs the result to the adder 540. The partial product generation unit 512 shifts the calculation result by 2 bits and outputs the result to the adder 540. The partial product generation unit 513 outputs the calculation result to the adder 540 as it is. The other partial product generation units 520 and 530 perform the same calculation.

ところで、フィルタ演算#1、#2における各符号データは、図5のようになっている。ここで、部分積生成部511〜513、521〜523、531〜533は、それぞれブースデコーダ(Booth Decoder:BTD)B00〜B02、B10〜B12、B20〜B22を有するものとする。   By the way, the respective code data in the filter operations # 1 and # 2 are as shown in FIG. Here, the partial product generation units 511 to 513, 521 to 523, and 531 to 533 have booth decoders (Booth Decoder: BTD) B00 to B02, B10 to B12, and B20 to B22, respectively.

各ブースデコーダで演算される符号データ(−2・y[2i+1]+y[2i]+y[2i-1])は、図5に示すようになるが、ここで、部分積生成部532のブースデコーダB21は、いずれのフィルタ演算においても符号データが"0"であり、部分積を生成する必要がない。また、フィルタ演算#1において、部分積生成部533のブースデコーダB22の符号データが"1"であるとき、部分積生成部513のブースデコーダB02の符号データは"0"であって部分積を生成する必要がない。逆に、フィルタ演算#2において、部分積生成部533のブースデコーダB22の符号データが"0"であり、部分積を生成する必要がないのに対し、部分積生成部513のブースデコーダB02の符号データは"1"となり部分積を生成する必要がある。同様に、フィルタ演算#2において、部分積生成部531のブースデコーダB20の符号データが"1"であって、部分積生成部511のブースデコーダB00の符号データは"0"となり部分積を生成する必要がない。   The code data (−2 · y [2i + 1] + y [2i] + y [2i−1]) calculated by each booth decoder is as shown in FIG. 5. Here, the booth decoder of the partial product generator 532 In B21, the code data is "0" in any filter operation, and there is no need to generate a partial product. In the filter operation # 1, when the code data of the booth decoder B22 of the partial product generation unit 533 is “1”, the code data of the booth decoder B02 of the partial product generation unit 513 is “0” and the partial product is There is no need to generate. On the contrary, in the filter operation # 2, the code data of the booth decoder B22 of the partial product generation unit 533 is “0”, and it is not necessary to generate a partial product, whereas the booth decoder B02 of the partial product generation unit 513 The code data is “1”, and it is necessary to generate a partial product. Similarly, in the filter operation # 2, the code data of the booth decoder B20 of the partial product generation unit 531 is “1”, the code data of the booth decoder B00 of the partial product generation unit 511 is “0”, and a partial product is generated. There is no need to do.

ここで、部分積生成部513、533は、同様の機能を有する。そして、フィルタ演算#1において部分積生成部513は使用する必要がなく、フィルタ演算#2では部分積生成部533は使用する必要がない。また、部分積生成部521、531は、同様の機能を有し、フィルタ演算#1において部分積生成部521は使用する必要がなく、フィルタ演算#2では部分積生成部531は使用する必要がない。そこで、本実施の形態においては、これら二つの部分積生成部511、531、及び521、531を共有することで、部分積生成部の個数を減らし、後段の加算器への入力数を減らすことで加算器の回路規模を削減する。   Here, the partial product generation units 513 and 533 have the same function. The partial product generation unit 513 does not need to be used in the filter calculation # 1, and the partial product generation unit 533 does not need to be used in the filter calculation # 2. Further, the partial product generation units 521 and 531 have the same function, and it is not necessary to use the partial product generation unit 521 in the filter operation # 1, and it is necessary to use the partial product generation unit 531 in the filter operation # 2. Absent. Therefore, in the present embodiment, by sharing these two partial product generators 511, 531 and 521, 531, the number of partial product generators is reduced and the number of inputs to the adder at the subsequent stage is reduced. To reduce the circuit scale of the adder.

図6は、本発明の実施の形態にかかるフィルタ演算器を示す図である。図6に示すように、フィルタ演算器1は、係数データメモリ2と、入力データf0、f1、f2を入力するレジスタF0〜F2と、部分積生成ユニット3、4と、加算器10とを有する。更に、セレクタ5〜8を有する。   FIG. 6 is a diagram showing a filter arithmetic unit according to the embodiment of the present invention. As shown in FIG. 6, the filter arithmetic unit 1 includes a coefficient data memory 2, registers F <b> 0 to F <b> 2 for inputting input data f <b> 0, f <b> 1, f <b> 2, partial product generation units 3, 4, and an adder 10. . Furthermore, it has selectors 5-8.

部分積生成ユニット3、4は、入力データf0〜f2と当該入力データf0〜f2に対応付けられたフィルタ係数とからなる1以上の組データが入力され、1以上の部分積を生成する。部分積生成ユニット3及び4は、それぞれ、X×(−2・y[2i+1}+y[2i]+y[2i-1])×22i(Xは乗数、フィルタ係数)のi=0、1、2、すなわち×1、×4、×16に対応する部分積を求めるそれぞれ部分積生成部33、32、31、及び部分積生成部43、42、41を有する。 The partial product generation units 3 and 4 receive one or more set data including input data f0 to f2 and filter coefficients associated with the input data f0 to f2, and generate one or more partial products. The partial product generating units 3 and 4 respectively have X = 0 (−2 · y [2i + 1} + y [2i] + y [2i−1]) × 2 2i (where X is a multiplier and a filter coefficient), i = 0, 1, 2, that is, partial product generation units 33, 32, and 31, and partial product generation units 43, 42, and 41 that calculate partial products corresponding to x1, x4, and x16, respectively.

部分積生成部31は、ブースデコーダB00、乗算部M00、4ビットシフト部S00を有する。部分積生成部32は、ブースデコーダB01、乗算部M01、及び2ビットシフト部S01を有する。部分積生成部33は、ブースデコーダB02及び乗算部M02を有する。部分積生成ユニット4の構成も同様に、部分積生成部41、42、43が、ブースデコーダB10、B11、B12、乗算部M10、M11、M12、及びビットシフト部S10、S11を有している。なお、部分積生成部43は、ビットシフト部は必要ない。   The partial product generation unit 31 includes a booth decoder B00, a multiplication unit M00, and a 4-bit shift unit S00. The partial product generation unit 32 includes a Booth decoder B01, a multiplication unit M01, and a 2-bit shift unit S01. The partial product generation unit 33 includes a booth decoder B02 and a multiplication unit M02. Similarly, in the configuration of the partial product generation unit 4, the partial product generation units 41, 42, and 43 include Booth decoders B10, B11, and B12, multiplication units M10, M11, and M12, and bit shift units S10 and S11. . The partial product generation unit 43 does not need a bit shift unit.

また、セレクタ7、8は、入力データf0〜f2を入力すべき部分積生成部を選択する部分積生成部選択部として機能する。また、セレクタ5、6は、フィルタ係数を入力すべき部分積生成部を選択する部分積生成部選択部として機能する。すなわち、これらのセレクタ5〜8は、上記組データを、部分積生成ユニット3、4のいずれか1以上に入力するものであって、例えば部分積生成ユニット3により、一の組データから生成すべき部分積の一部が生成不能な場合、部分積生成ユニット3共に部分積生成ユニット4の部分積生成部に当該組データを入力して部分積を生成させる。つまり、一の組データの演算を一の部分積生成ユニットではなく、複数の部分積生成ユニットで行なわせる。このことにより、本フィルタ演算器1は、上述のフィルタ演算器500と同様の演算を可能としつつ、部分積生成ユニットを1つ減らして2つとすることができる。   The selectors 7 and 8 function as a partial product generation unit selection unit that selects a partial product generation unit to which the input data f0 to f2 are to be input. The selectors 5 and 6 function as a partial product generation unit selection unit that selects a partial product generation unit to which a filter coefficient is to be input. That is, these selectors 5 to 8 input the set data to any one or more of the partial product generation units 3 and 4. For example, the partial product generation unit 3 generates the set data from one set data. When a part of the power partial product cannot be generated, the partial product generation unit 3 inputs the set data to the partial product generation unit of the partial product generation unit 4 to generate the partial product. In other words, one set of data is calculated by a plurality of partial product generation units, not by one partial product generation unit. Thus, the filter computing unit 1 can perform the same computation as the above-described filter computing unit 500, and can reduce the partial product generation unit by one to two.

このように、本実施の形態にかかるフィルタ演算器1は、図5に示すレジスタF2(入力データf0)に対応する部分積生成ユニットを有していない。図5に示す入力データf2の演算のうち、ブースデコーダB22を使用して行なうべきフィルタ演算#1は、代用部分積生成部としての部分積生成部33にて行なわせる。すなわち、部分積生成部33の入力データf0に対応するフィルタ係数の所定ビットから生成される符号データは"0"であるため、部分積を生成する必要がないため、これを代用するのである。このため、部分積生成部33の入力には、レジスタF0からのデータf0とレジスタF2からのデータf2を選択出力するセレクタ7が設けられている。また、このときの部分積生成部33のブースデコーダB02へのフィルタ係数の入力を切り替えるためのセレクタ5が設けられている。フィルタ演算#1における入力データf2の他の演算は、いずれも符号データが"0"になるため、部分積を計算する必要はない。よって、セレクタ5、7を設けることで、レジスタF0〜F2に入力される入力データf0〜f2と、フィルタ係数20、−8、1との乗算が実行可能となる。   Thus, the filter computing unit 1 according to the present embodiment does not have a partial product generation unit corresponding to the register F2 (input data f0) shown in FIG. Of the operations of the input data f2 shown in FIG. 5, the filter operation # 1 to be performed using the Booth decoder B22 is performed by the partial product generation unit 33 as a substitute partial product generation unit. That is, since the code data generated from the predetermined bits of the filter coefficient corresponding to the input data f0 of the partial product generation unit 33 is “0”, there is no need to generate a partial product, and this is used instead. For this reason, a selector 7 for selecting and outputting the data f0 from the register F0 and the data f2 from the register F2 is provided at the input of the partial product generator 33. In addition, a selector 5 is provided for switching the input of filter coefficients to the booth decoder B02 of the partial product generator 33 at this time. Since all the other operations of the input data f2 in the filter operation # 1 have the code data “0”, it is not necessary to calculate the partial product. Therefore, by providing the selectors 5 and 7, the input data f0 to f2 input to the registers F0 to F2 and the filter coefficients 20, -8, and 1 can be multiplied.

また、同様に、図5に示す入力データf2の演算のうち、ブースデコーダB20を使用して行なうべきフィルタ演算#2は、代用部分積生成部としての部分積生成部41にて行なわせる。すなわち、部分積生成部41の入力データf1に対応するフィルタ係数の所定ビットから生成される符号データは"0"であるため、部分積を生成する必要がないため、これを代用するのである。このため、部分積生成部41の入力には、レジスタF1からのデータf1とレジスタF2からのデータf2を選択出力するセレクタ8が設けられている。また、このときの部分積生成部41のブースデコーダB10へのフィルタ係数の入力を切り替えるためのセレクタ6が設けられている。フィルタ演算#2におけるF2の他の演算は、いずれも符号データが"0"になるため、部分積を計算する必要はない。よって、セレクタ6、8を設けることで、レジスタF0〜F2に入力される被乗数と、フィルタ係数9、−1、16との乗算が実行可能となる。   Similarly, of the operations of the input data f2 shown in FIG. 5, the filter operation # 2 to be performed using the Booth decoder B20 is performed by the partial product generation unit 41 as the substitute partial product generation unit. That is, since the code data generated from the predetermined bits of the filter coefficient corresponding to the input data f1 of the partial product generation unit 41 is “0”, it is not necessary to generate a partial product, and this is used instead. Therefore, a selector 8 that selectively outputs data f1 from the register F1 and data f2 from the register F2 is provided at the input of the partial product generation unit 41. Further, a selector 6 is provided for switching the input of filter coefficients to the booth decoder B10 of the partial product generation unit 41 at this time. In all the other operations of F2 in the filter operation # 2, the code data becomes “0”, so there is no need to calculate the partial product. Therefore, by providing the selectors 6 and 8, multiplication of the multiplicand input to the registers F0 to F2 and the filter coefficients 9, -1, and 16 can be executed.

本実施の形態においては、部分積生成ユニット3、4においてフィルタ演算に使用されない非活性な部分積生成部を利用し、部分積を生成する。この際、必要に応じて部分積生成ユニット3、4には、セレクタ5〜8により、2種以上の入力データと当該入力データに対応付けられたフィルタ係数とからなる組データが入力され、各部分積生成ユニット3、4はこの組データに応じた部分積を生成する。このように、フィルタ演算時に非活性な部分積生成部を利用して他のフィルタ係数演算を行なわせることで、本例においては部分積生成ユニットを図4に比して1つ分減らすことができる。   In the present embodiment, the partial product generation units 3 and 4 generate partial products using inactive partial product generation units that are not used for the filter operation. At this time, set data consisting of two or more types of input data and filter coefficients associated with the input data is input to the partial product generation units 3 and 4 by the selectors 5 to 8 as necessary. The partial product generation units 3 and 4 generate partial products corresponding to the set data. In this way, in this example, the partial product generation unit can be reduced by one compared to FIG. 4 by performing another filter coefficient calculation using the inactive partial product generation unit during the filter calculation. it can.

特に、フィルタ演算を実行する際、複数の部分積生成ユニットにおける同一機能の部分積生成部にて生成される部分積が常に1以上、0となる場合、同一機能の部分積生成部を一つにまとめ、複数の部分積生成ユニット間で部分積生成部を共有することができ、部分積生成部の個数、加算器への入力数を減らすことができ、よって加算器の回路規模を削減することができる。   In particular, when executing the filter operation, if the partial products generated by the partial product generating unit having the same function in the plurality of partial product generating units are always 1 or more and 0, one partial product generating unit having the same function is provided. In summary, a partial product generation unit can be shared among a plurality of partial product generation units, and the number of partial product generation units and the number of inputs to the adder can be reduced, thereby reducing the circuit scale of the adder. be able to.

すなわち、本実施の形態においては、3つの組データの演算を、2つの部分積生成ユニットで実行する。通常、一の組データの演算は、一の部分積生成ユニットで実行されるが、本実施の形態においては、部分積生成部選択部としてのセレクタ5〜8を設けることで、一の組データの演算を2以上の部分積生成ユニットで演算可能な構成とすると共に、2つの組データを一の部分積生成ユニット内で演算可能な構成とする。このことにより、同じ部分積生成ユニット内において、ある組データの演算中に非活性(未使用)又は符号データが"0"になる部分積生成部を含む場合、他の組データの演算の代用部分積生成部として使用することができる。こうして、部分積生成ユニット間で部分積生成部を共有させることができ、全体として部分積生成部を有効利用することで、部分積生成部の個数を減少させることができる。   That is, in the present embodiment, three sets of data are calculated by two partial product generation units. Usually, one set data operation is performed by one partial product generation unit. However, in this embodiment, by providing selectors 5 to 8 as partial product generation unit selection units, one set data is set. And a configuration in which two sets of data can be calculated in one partial product generation unit. As a result, in the same partial product generation unit, in the case of including a partial product generation unit in which the inactive (unused) or code data becomes “0” during the calculation of a certain set of data, the calculation of the other set data is substituted It can be used as a partial product generator. In this way, the partial product generation unit can be shared between the partial product generation units, and the number of partial product generation units can be reduced by effectively using the partial product generation unit as a whole.

(3)具体例
次に、本発明を適用した具体例について説明する。ここでは、H.264及びVC−1の両規格における動き補償処理におけるフィルタ演算を実行するフィルタ演算器に適用した場合について説明する。なお、本発明は、H.264及びVC−1の両規格におけるフィルタ演算が可能な動き補償回路について説明するが、H.264のみのフィルタ演算を行なう動き補償回路、VC−1のみのフィルタ演算を行なう動き補償回路にも適用可能であることは勿論である。
(3) Specific Example Next, a specific example to which the present invention is applied will be described. Here, a case will be described in which the present invention is applied to a filter arithmetic unit that executes a filter operation in motion compensation processing in both the H.264 and VC-1 standards. In addition, this invention is H.264. A motion compensation circuit capable of performing a filter operation in both H.264 and VC-1 standards will be described. Of course, the present invention is also applicable to a motion compensation circuit that performs a filter operation of only H.264 and a motion compensation circuit that performs a filter operation of only VC-1.

(3−1)画像復号装置
ここでは先ず、H.264、VC−1の画像復号装置について説明する。図7及び図8は、それぞれH.264及びVC−1に準拠して符号化された圧縮画像を復号する復号装置を示すブロック図である。H.264は、MPEG4 AVC(Advanced Video Coding)とも呼ばれ、データ圧縮率は、MPEG−2の2倍以上、MPEG−4の1.5倍以上とすることができる圧縮符号化方式である。また、VC−1(Windows Media Video(WMV)9)(登録商標)はマイクロソフト社が開発した動画圧縮技術であり、H.264と同程度のデータ圧縮率を有する。これらのアドバンスドコーデック(高圧縮コーデック)は、HD DVD(High Definition DVD)、又はブルーレイディスク等の次世代DVD規格に適用される。
(3-1) Image Decoding Device Here, first, an H.264, VC-1 image decoding device will be described. 7 and 8 are block diagrams illustrating a decoding device that decodes a compressed image encoded in accordance with H.264 and VC-1. H. H.264 is also referred to as MPEG4 AVC (Advanced Video Coding), and is a compression encoding method that can make the data compression rate more than twice that of MPEG-2 and 1.5 times that of MPEG-4. VC-1 (Windows Media Video (WMV) 9) (registered trademark) is a video compression technology developed by Microsoft Corporation. The data compression rate is about the same as H.264. These advanced codecs (high compression codecs) are applied to next-generation DVD standards such as HD DVD (High Definition DVD) or Blu-ray Disc.

図7に示すように、H.264の画像復号装置170は、可変長復号部172、逆量子化部173、逆アダマール変換部174、加算器175、デブロッキングフィルタ176、動き補償部182、重み付け予測部181、画面内予測部180及び復号画像178を表示するモニタ179を有する。   As shown in FIG. 7, the H.264 image decoding apparatus 170 includes a variable length decoding unit 172, an inverse quantization unit 173, an inverse Hadamard transform unit 174, an adder 175, a deblocking filter 176, a motion compensation unit 182 and a weighting. A prediction unit 181, an intra-screen prediction unit 180, and a monitor 179 that displays a decoded image 178 are included.

可変長復号部172は、圧縮データ171が入力され可変長符号化された圧縮データを、変換テーブルに基づき可変長復号する。そして、可変長復号された復号データは、逆量子化部173にて逆量子化され、逆アダマール変換部174にて逆アダマール変換され加算器175へ送られる。加算器175の出力は、デブロッキングフィルタ176によりブロック歪を除去され、復号画像178とされ、モニタ179を介して表示される。   The variable-length decoding unit 172 performs variable-length decoding on the compressed data that is input with the compressed data 171 and is variable-length encoded based on the conversion table. Then, the decoded data subjected to variable length decoding is inversely quantized by the inverse quantization unit 173, subjected to inverse Hadamard transform by the inverse Hadamard transform unit 174, and sent to the adder 175. The output of the adder 175 is subjected to block distortion removal by the deblocking filter 176 to obtain a decoded image 178, which is displayed via the monitor 179.

ここで、加算器175の出力が画面内予測部180にも入力され、予測画像183が生成される。また、復号画像が動き補償部182にて動き補償処理が行なわれ、重み付け予測部181にて重み付けされて予測画像183が生成される。加算器175は、Iフレーム処理の際には画面内予測部180からの予測画像183に予測誤差を加算し出力する。一方、P、Bフレーム処理の際には、切替部177にて切り替え、重み付け予測部181から送られる予測画像183に予測誤差を加算して出力する。   Here, the output of the adder 175 is also input to the in-screen prediction unit 180, and a predicted image 183 is generated. Also, the motion compensation unit 182 performs motion compensation processing on the decoded image, and the weighted prediction unit 181 weights the decoded image to generate a predicted image 183. The adder 175 adds the prediction error to the prediction image 183 from the intra-screen prediction unit 180 and outputs it when performing the I frame processing. On the other hand, in the P and B frame processing, switching is performed by the switching unit 177, and a prediction error is added to the prediction image 183 sent from the weighted prediction unit 181 and output.

また、図8に示すように、VC−1の画像復号装置190も、画像復号装置170とほぼ同様に構成され、可変長復号部192、逆量子化部193、逆DCT変換部194、加算器195、ループフィルタ196、重み付け予測部199、動き補償部200、及び復号画像197を表示するモニタ198を有する。VC−1の画像復号装置190は、画面内予測を行なわない点、重み付け予測を行なってから動き補償処理を行う点、デブロッキングフィルタ176の代わりにループフィルタ196が使用される点が異なる。   As shown in FIG. 8, the VC-1 image decoding apparatus 190 is also configured in substantially the same manner as the image decoding apparatus 170, and includes a variable length decoding unit 192, an inverse quantization unit 193, an inverse DCT conversion unit 194, and an adder. 195, a loop filter 196, a weighted prediction unit 199, a motion compensation unit 200, and a monitor 198 for displaying a decoded image 197. The VC-1 image decoding apparatus 190 is different in that intra-screen prediction is not performed, motion compensation processing is performed after weighted prediction, and a loop filter 196 is used instead of the deblocking filter 176.

(3−2)動き補償部
図9は、H.264及びVC−1の規格に準拠したフィルタ演算を含む動き補償処理を実行する動き補償(MC)部を示すブロック図である。この動き補償部150は、H.264及びVC−1のいずれの動き補償部でも使用可能な構成とされている。すなわち、両規格にて共有できる。この動き補償部150は、フィルタ演算部1c、1dと、セレクタ151、154、157、160、161と、乗算器152、159、加算器153、155、158と、ラインメモリ156とを有する。
(3-2) Motion Compensation Unit FIG. 9 is a block diagram showing a motion compensation (MC) unit that executes a motion compensation process including a filter operation based on the standards of H.264 and VC-1. This motion compensation unit 150 is an H.264 standard. H.264 and VC-1 motion compensators can be used. That is, it can be shared by both standards. The motion compensation unit 150 includes filter operation units 1 c and 1 d, selectors 151, 154, 157, 160 and 161, multipliers 152 and 159, adders 153, 155 and 158, and a line memory 156.

H.264では、フィルタ演算部1c、1dにてフィルタ演算施した後、上述した重み付け係数を使用してオフセット付き重み補間信号を求め、予測画像183を得る。ここで、入力INから入力された参照ピクチャR0の画素値が、フィルタ演算部1cにて垂直方向フィルタによるフィルタ演算が実行され、フィルタ演算部1dにて水平方向フィルタによるフィルタ演算が施される。そして、生成されたフィルタ演算済みのデータがラインメモリ156に格納される。次に、参照ピクチャR1の画素値が入力INから入力されると、同様に、フィルタ演算部1c、1dにてフィルタ演算が施され、フィルタ演算済みのデータに乗算器152にて重み係数を乗算し、加算器153にてオフセット値を加算する。一方、ラインメモリに格納されているデータがセレクタ160を介して乗算器159にて重み付き係数と乗算され、これらが加算器155にて加算され、オフセット付き重み補間信号W+W+Dを生成する。生成されたデータは、ラインメモリ156を経て出力OUTから出力される。 H. In H.264, after the filter operation is performed by the filter operation units 1c and 1d, a weighted interpolation signal with an offset is obtained using the above-described weighting coefficient, and a predicted image 183 is obtained. Here, the pixel value of the reference picture R0 input from the input IN is subjected to a filter operation using a vertical filter in the filter operation unit 1c, and a filter operation using a horizontal filter is performed in the filter operation unit 1d. The generated filter-calculated data is stored in the line memory 156. Next, when the pixel value of the reference picture R1 is input from the input IN, similarly, the filter operation is performed by the filter operation units 1c and 1d, and the weighted coefficient is multiplied by the multiplier 152 by the multiplier 152 Then, the adder 153 adds the offset value. On the other hand, the data stored in the line memory is multiplied by the weighted coefficient by the multiplier 159 via the selector 160, and these are added by the adder 155, and the weighted interpolation signal W 0 X 0 + W 1 X with offset is added. 1 + D is generated. The generated data is output from the output OUT via the line memory 156.

VC−1の場合は、入力INからのデータがセレクタ160、セレクタ157を介し、更にセレクタ151から乗算器152、加算器153をとおり、そしてセレクタ161を介してフィルタ演算器1c、1dに入力される。フィルタ演算部1dの結果は、セレクタ151、セレクタ154を介してそのままラインメモリ156へ格納され、出力OUTから出力される。乗算器159、加算器158、乗算器152、加算器153では、以下の重み付けが実行される。
H=(iScale×F+iShift+32)>>6
ここで、Fは入力値、iScale、iShiftは重み係数を示す。
In the case of VC-1, the data from the input IN is input to the filter arithmetic units 1c and 1d via the selector 160 and the selector 157, further from the selector 151 through the multiplier 152 and the adder 153, and via the selector 161. The The result of the filter operation unit 1d is directly stored in the line memory 156 via the selector 151 and the selector 154, and is output from the output OUT. The multiplier 159, the adder 158, the multiplier 152, and the adder 153 perform the following weighting.
H = (iScale × F + iShift + 32) >> 6
Here, F is an input value, and iScale and iShift are weighting factors.

このように構成された動き補償部150は、セレクタ161、151、154、160にてフィルタ演算部1c、1dへの入力、出力を適宜選択するため、重み付けをフィルタ演算後に実行するH.264であっても、重み付けをフィルタ演算前に実行するVC−1であっても、いずれの演算にも適用可能である。   The motion compensator 150 configured in this way is selected by the selectors 161, 151, 154, 160 so that the inputs and outputs to the filter arithmetic units 1c, 1d are appropriately selected. Even if it is H.264, even if it is VC-1 which performs weighting before a filter calculation, it is applicable to any calculation.

(3−3)フィルタ演算器
次に、H.264及びVC−1の両規格のフィルタ演算が可能なフィルタ演算部1c、1eについて更に詳細に説明する。図10は、フィルタ演算部1c、1eの詳細を示す図であって、本実施の形態にかかるフィルタ演算器を示すブロック図である。また、下記表4は、H.264及びVC−1における輝度信号Gy、色差信号Gcに対するフィルタ係数を示す。更に、図11は、上述のH.264及びVC−1のフィルタ演算をフィルタ演算器100で実行させる際の各部分積生成部で生成される符号データを示す図である。
(3-3) Filter computing unit The filter operation units 1c and 1e capable of performing filter operations of both H.264 and VC-1 standards will be described in more detail. FIG. 10 is a diagram showing details of the filter arithmetic units 1c and 1e, and is a block diagram showing the filter arithmetic unit according to the present embodiment. Table 4 below shows H.264. The filter coefficients for the luminance signal Gy and the color difference signal Gc in H.264 and VC-1 are shown. Further, FIG. 2 is a diagram illustrating code data generated by each partial product generation unit when the filter arithmetic unit 100 executes H.264 and VC-1 filter operations.

Figure 0004963194
Figure 0004963194

この表4に示すように、H.264は、輝度信号Gyが6タップフィルタ、色差信号Gcは2タップフィルタのフィルタ演算となる。また、VC−1の輝度信号Gyが4タップフィルタ、色差信号Gcは2タップフィルタのフィルタ演算となる。フィルタ演算器1は、これら全てのフィルタ演算を可能としつつ、上述の方法により、ハードウェア資源を削減したものである。   As shown in Table 4, H. In H.264, the luminance signal Gy is a 6-tap filter, and the color difference signal Gc is a 2-tap filter. The luminance signal Gy of VC-1 is a 4-tap filter, and the color difference signal Gc is a 2-tap filter. The filter computing unit 1 is a hardware resource reduced by the above-mentioned method while enabling all these filter computations.

図10に示すように、フィルタ演算器1は、入力される画素値(入力データf0〜f5)を格納するレジスタF0〜F5と、部分積生成部選択部102と、係数データメモリ103と、部分積生成ユニット110、120、130、140、140、160と、加算器104とを有する。部分積生成部選択部102は、入力データf0〜f5及びこれに乗算すべきフィルタ係数の演算が可能な1以上の部分積生成ユニットを選択して入力データf0〜f5を入力する。係数データメモリ103は、上記入力データf0〜f5に対応するフィルタ係数を各部分積生成ユニットに入力する。この場合、上述と同様、必要に応じて、2以上の、入力データ及びそれに対応したフィルタ係数からなる組データが1つの部分積生成ユニットに入力される。   As shown in FIG. 10, the filter arithmetic unit 1 includes registers F0 to F5 that store input pixel values (input data f0 to f5), a partial product generation unit selection unit 102, a coefficient data memory 103, a partial data Product generation units 110, 120, 130, 140, 140, 160 and an adder 104 are included. The partial product generation unit selection unit 102 selects one or more partial product generation units capable of calculating input data f0 to f5 and filter coefficients to be multiplied by the input data f0 to f5, and inputs the input data f0 to f5. The coefficient data memory 103 inputs filter coefficients corresponding to the input data f0 to f5 to each partial product generation unit. In this case, as described above, two or more sets of input data and corresponding filter coefficients are input to one partial product generation unit as necessary.

部分積生成ユニット110は、フィルタ係数から符号データを生成し、F0〜F5のいずれかを介して入力される入力データとの乗算結果を求めるブースデコーダ及び乗算部の機能を有する回路部(BTD・乗算部)114を有する。部分積生成ユニット120は、×4、×1に対応するBTD・乗算部123、124を有する。なお、本図においては、×4、16、64のビットシフト部は図示を省略している。   The partial product generation unit 110 generates code data from the filter coefficients and obtains a multiplication result with input data input through any of F0 to F5, and a circuit unit (BTD · A multiplication unit) 114. The partial product generation unit 120 includes BTD / multipliers 123 and 124 corresponding to x4 and x1. In this figure, the x4, 16, and 64 bit shift units are not shown.

部分積生成ユニット130は、×4、×1にそれぞれ対応するBTD・乗算部132、133を有する。部分積生成ユニット140は、×64、×16、×4にそれぞれ対応するBTD・乗算部141、142、143を有する。部分積生成ユニット150は、×4、×1にそれぞれ対応するBTD・乗算部153、154を有する。部分積生成ユニット60は、×1に対応するBTD・乗算部164を有する。   The partial product generation unit 130 includes BTD / multipliers 132 and 133 corresponding to x4 and x1, respectively. The partial product generation unit 140 includes BTD / multipliers 141, 142, and 143 corresponding to x64, x16, and x4, respectively. The partial product generation unit 150 includes BTD / multipliers 153 and 154 corresponding to x4 and x1, respectively. The partial product generation unit 60 includes a BTD / multiplication unit 164 corresponding to × 1.

これらの部分積生成ユニットにおいて、各フィルタ演算にて入力されるフィルタ係数は図11のようになる。ここで、例えば、H.264の色差信号Gcの演算においては、部分積生成ユニット120、140、150、160は使用しない。   In these partial product generation units, the filter coefficients input in each filter calculation are as shown in FIG. Here, for example, the partial product generation units 120, 140, 150, and 160 are not used in the calculation of the color difference signal Gc of H.264.

ところで、VC−1の輝度信号Gyの演算の場合、フィルタ係数は−4、53、18、−3であり、いずれの部分積生成ユニットを使用してもフィルタ係数"53"の部分積を生成することができない。そこで、部分積生成部選択部102は、このフィルタ係数"53"の演算の場合には、部分積生成ユニット140及び110を使用させる。フィルタ係数"53"の演算には、×64、×16、×4、×1に対応する部分積生成部が必要であるが、部分積生成ユニット140には、×1に対応する部分積生成部が存在しない。そこで、部分積生成部選択部102は、部分積生成ユニット110の×1を演算可能なBTD・乗算部114を、部分積生成ユニット140と共に使用してフィルタ係数"53"の演算をさせる(図11のA1参照)。   By the way, in the case of the calculation of the luminance signal Gy of VC-1, the filter coefficients are −4, 53, 18, and −3, and the partial product of the filter coefficient “53” is generated regardless of which partial product generation unit is used. Can not do it. Therefore, the partial product generation unit selection unit 102 causes the partial product generation units 140 and 110 to be used in the case of the calculation of the filter coefficient “53”. The calculation of the filter coefficient “53” requires a partial product generation unit corresponding to x64, x16, x4, and x1, but the partial product generation unit 140 generates a partial product corresponding to x1. There is no part. Therefore, the partial product generation unit selection unit 102 uses the BTD / multiplication unit 114 capable of calculating x1 of the partial product generation unit 110 together with the partial product generation unit 140 to calculate the filter coefficient “53” (FIG. 11 A1).

また、フィルタ係数"18"の演算には、×1と×16に対応する部分積生成部が必要であるが、いずれの部分積生成ユニットも両演算機能を備えたものが存在しない。そこで、部分積生成部選択部102は、×1に対応する部分積生成部として部分積生成ユニット160のBTD・乗算部164を使用し、×16に対応する部分積生成部として部分積生成ユニット130のBTD・乗算部132(図11のA2参照)を使用させる。   Further, for the calculation of the filter coefficient “18”, partial product generation units corresponding to × 1 and × 16 are required, but none of the partial product generation units has both calculation functions. Therefore, the partial product generation unit selection unit 102 uses the BTD / multiplication unit 164 of the partial product generation unit 160 as the partial product generation unit corresponding to x1, and the partial product generation unit as the partial product generation unit corresponding to x16. 130 BTD / multipliers 132 (see A2 in FIG. 11) are used.

このようにフィルタ係数を、入力データとフィルタ係数の乗算をするに適切な1又は2以上の部分積生成ユニットを選択して入力させ、また、当該フィルタ係数に対応する入力データを部分積生成部選択部102により部分積生成ユニットに入力させることで、部分積生成ユニットの演算機能を超えた演算を行なわせることができると共に、部分積生成部の個数を最小限に抑えることができる。   Thus, the filter coefficient is input by selecting one or more partial product generation units suitable for multiplying the input data and the filter coefficient, and the input data corresponding to the filter coefficient is input to the partial product generation unit. By causing the selection unit 102 to input the partial product generation unit, it is possible to perform an operation that exceeds the operation function of the partial product generation unit, and to minimize the number of partial product generation units.

なお、本実施の形態においては、使用されない部分積生成部を利用することで、演算を可能とする場合について説明したが、上述したように、生成される符号データが"0"となる部分積生成部を利用して演算させることも可能である。また、本実施の形態においては、入力データを適宜選択して部分積生成ユニットに入力する部分積生成部選択部102を設けた場合について説明したが、フィルタ係数についても、同様に部分積生成部選択部を設け、選択した部分積生成ユニットに入力すればよい。   In the present embodiment, a case has been described in which an operation can be performed by using a partial product generation unit that is not used. However, as described above, the partial product in which the generated code data is “0”. It is also possible to perform calculation using the generation unit. In the present embodiment, the case where the partial product generation unit selection unit 102 that appropriately selects input data and inputs the input data to the partial product generation unit has been described. However, the partial product generation unit similarly applies to the filter coefficient. A selection unit may be provided and input to the selected partial product generation unit.

いずれにせよ、フィルタ演算において、一の部分積生成ユニットにより、一の組データから生成すべき部分積の一部が生成不能な場合、2以上の部分積生成ユニットを使用して一の組データを演算させる。この場合、生成される部分積が"0"となる部分積生成部、又は当該フィルタ演算には使用されない非活性(未使用)部分積生成部を含む部分積生成ユニットを選択し、当該生成不能な部分積を生成させる。このことにより、部分積が"0"となる部分積生成部又は非活性な部分積生成部を有効利用することができ、部分積生成部の個数を最小限に抑えることができる。   In any case, in the filter operation, when one partial product generation unit cannot generate a part of a partial product to be generated from one set data, one set data is generated using two or more partial product generation units. Is calculated. In this case, a partial product generation unit in which the generated partial product is “0” or a partial product generation unit including an inactive (unused) partial product generation unit that is not used in the filter operation is selected and cannot be generated. To generate a partial product. This makes it possible to effectively use a partial product generation unit having a partial product of “0” or an inactive partial product generation unit, and to minimize the number of partial product generation units.

例えば図11の例では、部分積生成ユニット140は、フィルタ係数"53"を演算するためには、×1、×4、×16、×64の4つの部分積生成部を具備する必要があるが、この×1に対応する部分積生成部を省略した構成とし、"53"の演算を行なう場合には、部分積生成ユニット140及びこのとき未使用の部分積生成ユニット110の2つの部分積生成ユニットにより演算を行なわせる。すなわち、部分積生成ユニット110は、部分積生成ユニット140の不足する部分積生成部の代用となる。図11の例では、フィルタ演算"53"とこれに対応する入力データからなる組データから生成すべき部分積の一部は、いずれの部分積生成ユニットでも生成不能であるが、2以上の部分積生成ユニットを使用すれば演算が可能となる。このように、フィルタ演算器100は、組データに応じて、当該組データを演算させるための1又は2以上の部分積生成ユニットを選択する部分積生成部選択部102を備えることで、全ての組みデータについて、それらを演算可能な対応する部分積生成ユニットを備えていなくても、部分積生成ユニット又は部分積生成ユニットを構成する部分積生成部の組み合せにより演算させることができ、結果部分積生成部の個数を減少させることができる。   For example, in the example of FIG. 11, the partial product generation unit 140 needs to include four partial product generation units of × 1, × 4, × 16, and × 64 in order to calculate the filter coefficient “53”. However, when the partial product generation unit corresponding to the × 1 is omitted and the operation of “53” is performed, two partial products of the partial product generation unit 140 and the unused partial product generation unit 110 at this time are used. Let the generation unit perform the operation. That is, the partial product generation unit 110 is a substitute for the partial product generation unit that the partial product generation unit 140 lacks. In the example of FIG. 11, the partial product to be generated from the set data composed of the filter operation “53” and the corresponding input data cannot be generated by any partial product generation unit. If a product generation unit is used, an operation can be performed. As described above, the filter calculator 100 includes the partial product generation unit selection unit 102 that selects one or more partial product generation units for calculating the set data in accordance with the set data. Even if it does not have a corresponding partial product generation unit that can calculate them, the combination data can be operated by a combination of partial product generation units or partial product generation units constituting the partial product generation unit. The number of generation units can be reduced.

なお、本発明は上述した実施の形態のみに限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変更が可能であることは勿論である。例えば、本実施の形態は、画像復号装置として説明したが、画像符号化の際の動き補償部としても使用可能である。また、上記に例示したフィルタ演算のみならず、予め定められた乗数が入力される乗算器に本発明を適用することで、冗長な回路を削減しハードウェア低減することができる。   It should be noted that the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the present invention. For example, although the present embodiment has been described as an image decoding device, it can also be used as a motion compensation unit in image encoding. Further, by applying the present invention not only to the filter operation exemplified above but also to a multiplier to which a predetermined multiplier is input, redundant circuits can be reduced and hardware can be reduced.

また、本実施の形態においては、2次のブースのアルゴリズムを適用した乗算器(フィルタ演算器)について説明したが、これに限るものではない。すなわち、3次以上の高次のブースのアルゴリズムであっても同様に適用することができる。   In the present embodiment, the multiplier (filter arithmetic unit) to which the second-order Booth algorithm is applied has been described. However, the present invention is not limited to this. That is, even a third-order or higher-order booth algorithm can be similarly applied.

2次のブースのアルゴリズムに従って乗算を実行する乗算器を示すブロック図である。FIG. 3 is a block diagram illustrating a multiplier that performs multiplication according to a second order Booth algorithm. (a)は、ブースのアルゴリズムにより符号データ生成に使用されるビットを説明する図、(b)は、図1に示す乗算器の部分積生成ユニットの詳細を示す図である。(A) is a figure explaining the bit used for code | cord | chord data generation by Booth's algorithm, (b) is a figure which shows the detail of the partial product production | generation unit of the multiplier shown in FIG. フィルタ係数及びその符号データを示す図である。It is a figure which shows a filter coefficient and its code | symbol data. 上記フィルタ演算を行なうため、図2に示す乗算器を組み合せた通常のフィルタ演算器を示す図である。It is a figure which shows the normal filter arithmetic unit which combined the multiplier shown in FIG. 2 in order to perform the said filter calculation. フィルタ演算#1、#2における各符号データを示す図である。It is a figure which shows each code | symbol data in filter calculation # 1 and # 2. 本実施の形態にかかるフィルタ演算器を示す図である。It is a figure which shows the filter computing unit concerning this Embodiment. H.264に準拠して符号化された圧縮画像を復号する復号装置を示すブロック図である。It is a block diagram which shows the decoding apparatus which decodes the compressed image encoded based on H.264. VC−1に準拠して符号化された圧縮画像を復号する復号装置を示すブロック図である。It is a block diagram which shows the decoding apparatus which decodes the compressed image encoded based on VC-1. 本発明の実施の形態にかかる動き補償処理を実行する動き補償部を示すブロック図である。It is a block diagram which shows the motion compensation part which performs the motion compensation process concerning embodiment of this invention. 本発明の実施の形態にかかるフィルタ演算器の具体例を示すブロック図である。It is a block diagram which shows the specific example of the filter arithmetic unit concerning embodiment of this invention. 同フィルタ演算装置に入力されるフィルタ係数及び符号データの値を示す図である。It is a figure which shows the value of the filter coefficient and code | symbol data input into the same filter arithmetic unit. 特許文献1に記載の画像処理装置における累積加算フィルタ(ディジタルフィルタ)を示すブロック図である。10 is a block diagram showing a cumulative addition filter (digital filter) in the image processing apparatus described in Patent Document 1. FIG.

符号の説明Explanation of symbols

1、1c、1d、100 フィルタ演算器
2、103、502 係数データメモリ
3、4、110、120、130、140、150、160、401、510、520、530 部分積生成ユニット
5〜8、154、157、160、161、505 セレクタ
10、104、153、155、158、175、450、540 加算器
31〜33、41〜43、410、420、430、511〜513、521〜523、531〜533 部分積生成部
102 部分積生成部選択部
114、123、124、132、133、141、142、143、153、154、164 BTD・乗算部
150 動き補償部
151 セレクタ
152、159 乗算器
156 ラインメモリ
160 部分積生成ユニット
170 画像復号装置
171 圧縮データ
172 可変長復号部
173 逆量子化部
174 逆アダマール変換部
176 デブロッキングフィルタ
177 切替部
178 復号画像
179 モニタ
180 画面内予測部
181 重み付け予測部
182 補償部
183 予測画像
190 画像復号装置
192 可変長復号部
193 逆量子化部
194 変換部
195 加算器
196 ループフィルタ
197 復号画像
198 モニタ
199 予測部
200 補償部
400、501 乗算器
411、421、431、441 ブースデコーダ
412、422、432、442 乗算部
413、423、433、443 ビットシフト部
454、542 レジスタ
500 フィルタ演算器
503 カウンタ
506 累積加算メモリ
541 全加算器
544 半加算器
1, 1c, 1d, 100 Filter operation unit 2, 103, 502 Coefficient data memory 3, 4, 110, 120, 130, 140, 150, 160, 401, 510, 520, 530 Partial product generation units 5-8, 154 157, 160, 161, 505 Selector 10, 104, 153, 155, 158, 175, 450, 540 Adders 31-33, 41-43, 410, 420, 430, 511-513, 521-523, 531 533 Partial product generation unit 102 Partial product generation unit selection unit 114, 123, 124, 132, 133, 141, 142, 143, 153, 154, 164 BTD / multiplication unit 150 Motion compensation unit 151 Selector 152, 159 Multiplier 156 Line Memory 160 Partial product generation unit 170 Image decoding device 171 Compressed data 172 Variable length decoding unit 173 Inverse quantization unit 174 Inverse Hadamard transform unit 176 Deblocking filter 177 Switching unit 178 Decoded image 179 Monitor 180 In-screen prediction unit 181 Weighted prediction unit 182 Compensation unit 183 Predicted image 190 Image decoding device 192 Variable length decoding unit 193 Inverse quantization unit 194 Conversion unit 195 Adder 196 Loop filter 197 Decoded image 198 Monitor 199 Prediction unit 200 Compensation unit 400, 501 Multiplier 411, 421, 431, 441 Booth decoder 412, 422, 432, 442 Multiplication unit 413, 423, 433, 443 Bit shift units 454, 542 Register 500 Filter calculator 503 Counter 506 Cumulative addition memory 541 Full adder 544 Half adder

Claims (17)

複数のフィルタについて、複数の入力データとフィルタを構成する複数のフィルタ係数のそれぞれとをブースアルゴリズムを用いて積和演算するフィルタ処理装置であって、
前記入力データと当該入力データに対応付けられたフィルタ係数とからなる1以上の組データが入力され、1以上の部分積を生成する複数の部分積生成ユニットと、
前記複数の部分積生成ユニットにより生成される部分積の総和を生成する加算部と、
前記組データに応じ、前記複数の部分積生成ユニットを1以上選択して当該組データを入力する部分積生成部選択部とを有するフィルタ処理装置。
For a plurality of filters, a filter processing device that performs a sum of products operation using a Booth algorithm with a plurality of input data and a plurality of filter coefficients constituting the filter,
A plurality of partial product generation units that receive one or more set data including the input data and filter coefficients associated with the input data, and generate one or more partial products;
An adding unit for generating a sum of partial products generated by the plurality of partial product generating units;
A filter processing apparatus comprising: a partial product generation unit selection unit that selects one or more of the plurality of partial product generation units and inputs the set data according to the set data.
前記部分積生成部選択部は、一の前記組データから生成すべき部分積の一部が一の部分積生成ユニットでは生成不能な場合、当該一の部分積生成ユニット、及び他の部分積生成ユニットに当該組データを入力して部分積を生成させる
ことを特徴とする請求項1記載のフィルタ処理装置。
The partial product generation unit selection unit generates one partial product generation unit and another partial product generation when a partial product to be generated from the one set data cannot be generated by one partial product generation unit. The filter processing apparatus according to claim 1, wherein the set data is input to the unit to generate a partial product.
前記部分積生成ユニットの数は、前記複数のフィルタを構成するフィルタ係数の最大個数より少ない
ことを特徴とする請求項1又は2記載のフィルタ処理装置。
The filter processing apparatus according to claim 1, wherein the number of the partial product generation units is smaller than a maximum number of filter coefficients constituting the plurality of filters.
前記複数の部分積生成ユニットは、少なくとも一は他とは演算能力が異なる
ことを特徴とする請求項1乃至3のいずれか1項記載のフィルタ処理装置。
4. The filter processing device according to claim 1, wherein at least one of the plurality of partial product generation units has a different computing ability from the others. 5.
前記複数の部分積生成ユニットは、生成可能な部分積のうち最も大きいものの桁数が異なるものを含む
ことを特徴とする請求項4項記載のフィルタ処理装置。
The filter processing apparatus according to claim 4, wherein the plurality of partial product generation units include a largest partial product that can be generated and having a different number of digits.
前記複数の部分積生成ユニットは、生成可能な部分積の数が異なるものを含む
ことを特徴とする請求項4又は5項記載のフィルタ処理装置。
The filter processing apparatus according to claim 4, wherein the plurality of partial product generation units include ones having different numbers of partial products that can be generated.
前記部分積生成ユニットは、22i(i≧0)のiに対応する複数の部分積生成部からなる
ことを特徴とする請求項1乃至6のいずれか1項記載のフィルタ処理装置。
The filter processing apparatus according to claim 1, wherein the partial product generation unit includes a plurality of partial product generation units corresponding to i of 2 2i (i ≧ 0).
前記部分積生成部選択部は、一の前記組データから生成すべき部分積の一部が一の部分積生成ユニットでは生成不能な場合、当該一の部分積生成ユニット、及び他の部分積生成ユニットに含まれる代用部分積生成部を選択し、当該組データを入力して部分積を生成させるものであって、
前記代用部分積生成部は、前記他の部分積生成部に入力されるフィルタ係数の所定ビットからブースのアルゴリズムに従ってデコードした符号データが零になるものである
ことを特徴とする請求項7記載のフィルタ処理装置。
The partial product generation unit selection unit generates one partial product generation unit and another partial product generation when a partial product to be generated from the one set data cannot be generated by one partial product generation unit. A substitute partial product generation unit included in a unit is selected, and the set data is input to generate a partial product,
8. The substitute partial product generation unit is one in which code data decoded according to Booth's algorithm from a predetermined bit of a filter coefficient input to the other partial product generation unit becomes zero. Filter processing device.
前記部分積生成部選択部は、一の前記組データから生成すべき部分積の一部が一の部分積生成ユニットでは生成不能な場合、当該一の部分積生成ユニット、及び他の部分積生成ユニットに含まれる未使用の部分積生成部を選択し、当該組データを入力して部分積を生成させる
ことを特徴とする請求項7記載のフィルタ処理装置。
The partial product generation unit selection unit generates one partial product generation unit and another partial product generation when a partial product to be generated from the one set data cannot be generated by one partial product generation unit. The filter processing apparatus according to claim 7, wherein an unused partial product generation unit included in the unit is selected, and the set data is input to generate a partial product.
2i(i≧0)のiに対応する複数の部分積生成部の少なくとも一部の部分積生成部は、前記フィルタ係数の所定ビットからブースのアルゴリズムに従ってデコードした符号データを求めるブースデコーダと、前記ブースデコーダと前記入力データとの積を求める乗算部と、前記乗算部の選択結果を前記iに応じて所定ビットシフトするビットシフト部とを有する
ことを特徴とする請求項7乃至9のいずれか1項記載のフィルタ処理装置。
A booth decoder for obtaining code data decoded in accordance with Booth's algorithm from a predetermined bit of the filter coefficient, at least part of the plurality of partial product generators corresponding to i of 2 2i (i ≧ 0); 10. The multiplier according to claim 7, further comprising: a multiplier that obtains a product of the Booth decoder and the input data; and a bit shift unit that shifts a selection result of the multiplier by a predetermined bit according to the i. The filter processing apparatus of Claim 1.
前記部分積生成部は、対応付けられるフィルタ係数の所定ビットについて、ブースのアルゴリズムに従ってデコードした符号データがいずれも1である場合、前記入力データをビットシフトするビットシフト部のみから構成される
ことを特徴とする請求項7乃至10のいずれか1項記載のフィルタ処理装置。
The partial product generation unit includes only a bit shift unit that bit-shifts the input data when the code data decoded according to Booth's algorithm is 1 for the predetermined bit of the associated filter coefficient. The filter processing device according to claim 7, wherein the filter processing device is a filter processing device.
前記部分積生成部は、対応付けられるフィルタ係数の所定ビットについて、ブースのアルゴリズムに従ってデコードした符号データがいずれも0である場合、前記フィルタ係数の所定ビットからブースのアルゴリズムに従ってデコードした符号データを求めるブースデコーダのみから構成される
ことを特徴とする請求項7乃至10のいずれか1項記載のフィルタ処理装置。
The partial product generation unit obtains code data decoded according to the Booth algorithm from the predetermined bits of the filter coefficient when the code data decoded according to the Booth algorithm is 0 for the predetermined bit of the associated filter coefficient The filter processing apparatus according to claim 7, comprising only a booth decoder.
前記一部の部分積生成部は、対応付けられるフィルタ係数の所定ビットについて、ブースのアルゴリズムに従ってデコードした符号データの1以上が−2、−1、2のいずれかである
ことを特徴とする請求項7乃至10のいずれか1項記載のフィルタ処理装置。
The partial partial product generation unit is characterized in that one or more of code data decoded in accordance with Booth's algorithm is either −2, −1, or −1 for predetermined bits of associated filter coefficients. Item 11. The filter processing device according to any one of Items 7 to 10.
フィルタのうち1つは、6タップフィルタであって、
H.264に準拠した動き補償処理及び/又は画面内予測処理におけるフィルタ演算を実行する
ことを特徴とする請求項1乃至13のいずれか1項記載のフィルタ処理装置。
One of the filters is a 6-tap filter,
H. The filter processing device according to any one of claims 1 to 13, wherein a filter operation in motion compensation processing and / or intra-screen prediction processing compliant with H.264 is executed.
フィルタのうち1つは、6タップフィルタであって、
H.264、又はH.264及びVC−1に準拠した動き補償処理におけるフィルタ演算を実行するフィルタ演算器である
ことを特徴とする請求項1乃至13のいずれか1項記載のフィルタ処理装置。
One of the filters is a 6-tap filter,
H. H.264 or H.264 The filter processing device according to any one of claims 1 to 13, wherein the filter processing device executes a filter operation in a motion compensation process based on H.264 and VC-1.
複数種類の乗数群と被乗数群との乗算を実行する、ブースアルゴリズムを適用した乗算器であって、
前記被乗数と当該被乗数に対応付けられた乗数とからなる組データが入力され、1以上の部分積を生成する複数の部分積生成ユニットと、
前記複数の部分積生成ユニットにより生成される部分積の総和を生成する加算部と、
前記組データに応じ、前記複数の部分積生成ユニットを1以上選択して当該組データを入力する部分積生成部選択部とを有する乗算器。
A multiplier applying a booth algorithm that performs multiplication of multiple types of multiplier groups and multiplicand groups,
A plurality of partial product generation units that receive the set data including the multiplicand and a multiplier associated with the multiplicand and generate one or more partial products;
An adding unit for generating a sum of partial products generated by the plurality of partial product generating units;
A multiplier having a partial product generation unit selection unit that selects one or more of the plurality of partial product generation units according to the set data and inputs the set data.
予測画像を生成する動き補償処理装置であって、
垂直方向の入力データに対してフィルタ演算を行なう第1フィルタ演算部と、
水平方向の入力データに応じてフィルタ演算を行なう第2フィルタ演算部と、
前記第1及び第2フィルタ演算部の演算結果又は第1及び第2のフィルタ演算に入力する入力データに対して重み付けを行なう重み付け演算部とを有し、
前記第1及び第2フィルタ演算部は、複数のフィルタについて、複数の前記入力データとフィルタを構成する複数のフィルタ係数のそれぞれとをブースアルゴリズムを用いて積和演算するフィルタ演算部であって、
前記入力データと当該入力データに対応付けられたフィルタ係数とからなる1以上の組データが入力され、1以上の部分積を生成する複数の部分積生成ユニットと、
前記複数の部分積生成ユニットにより生成される部分積の総和を生成する加算部と、
前記前記組データに応じ、前記複数の部分積生成ユニットを1以上選択して当該組データを入力する部分積生成部選択部とを有する動き補償処理装置。
A motion compensation processing device for generating a predicted image,
A first filter operation unit that performs a filter operation on vertical input data;
A second filter operation unit that performs a filter operation according to horizontal input data;
A weighting calculation unit that performs weighting on calculation results of the first and second filter calculation units or input data input to the first and second filter calculations;
The first and second filter operation units are filter operation units that perform a product-sum operation on a plurality of filters using a Booth algorithm with each of the plurality of input data and a plurality of filter coefficients constituting the filter,
A plurality of partial product generation units that receive one or more set data including the input data and filter coefficients associated with the input data, and generate one or more partial products;
An adding unit for generating a sum of partial products generated by the plurality of partial product generating units;
A motion compensation processing device comprising: a partial product generation unit selection unit that selects one or more of the plurality of partial product generation units according to the set data and inputs the set data.
JP2006153363A 2006-06-01 2006-06-01 Filter processing device, multiplier, and motion compensation processing device Expired - Fee Related JP4963194B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006153363A JP4963194B2 (en) 2006-06-01 2006-06-01 Filter processing device, multiplier, and motion compensation processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006153363A JP4963194B2 (en) 2006-06-01 2006-06-01 Filter processing device, multiplier, and motion compensation processing device

Publications (2)

Publication Number Publication Date
JP2007324980A JP2007324980A (en) 2007-12-13
JP4963194B2 true JP4963194B2 (en) 2012-06-27

Family

ID=38857374

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006153363A Expired - Fee Related JP4963194B2 (en) 2006-06-01 2006-06-01 Filter processing device, multiplier, and motion compensation processing device

Country Status (1)

Country Link
JP (1) JP4963194B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5086675B2 (en) * 2007-03-26 2012-11-28 ルネサスエレクトロニクス株式会社 Filter calculator and motion compensation device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06204795A (en) * 1992-12-16 1994-07-22 Mega Chips:Kk Digital filter
JPH0773022A (en) * 1993-03-08 1995-03-17 Nkk Corp Method and device for digital signal processing
JPH08152994A (en) * 1994-11-29 1996-06-11 Mitsubishi Electric Corp Multiplier and digital filter
JPH09101877A (en) * 1995-10-06 1997-04-15 Ricoh Co Ltd Operation method and device for multipilcation
JP3558436B2 (en) * 1995-12-27 2004-08-25 松下電器産業株式会社 Multiplier and product-sum operation unit

Also Published As

Publication number Publication date
JP2007324980A (en) 2007-12-13

Similar Documents

Publication Publication Date Title
JP4881270B2 (en) Filter calculator and motion compensation device
US9172959B2 (en) Method and encoding/decoding of video using common merging candidate set of asymmetric partitions
JP4988627B2 (en) Filter calculator and motion compensation device
JP4516051B2 (en) Filter processing device, multiplier, and motion compensation processing device
JP4963220B2 (en) Filter calculator and motion compensation device
CN101083769B (en) Coder/decoder and coding/decoding method for processing N bit video data
JP4519807B2 (en) Multiplier and filter processing apparatus
JP4963194B2 (en) Filter processing device, multiplier, and motion compensation processing device
JP5086675B2 (en) Filter calculator and motion compensation device
KR101412964B1 (en) Low area and high performance multi-mode 1D transform block for HEVC and data processing method using thereof
KR101151352B1 (en) Context-based adaptive variable length coding decoder for h.264/avc
JP5195674B2 (en) Image encoding device
JP2011186592A (en) Filter operation unit, filter operation method, and motion compensation processing device
Vimala et al. Enhanced ambtc for image compression using block classification and interpolation
JP2009124353A (en) Data transform apparatus and control method thereof
KR20100013142A (en) Copression methode for frame memmory
JP2008532335A (en) Image interpolation method and pixel interpolation device
JP2011090362A (en) Filter computing unit, filter operation method, and motion compensation processing device
Ahmad Efficient HEVC and VVC motion estimation hardware
KR20130137951A (en) Method of inverse transform for ultra-high resoultion video codec
Hatim et al. Efficient hardware architecture for direct 2D DCT computation and its FPGA implementation
Hsia et al. A configurable IP for mode decision of H. 264/AVC encoder
KR101742765B1 (en) Interpolator and interpolator pixel generation method
KR101760779B1 (en) Method for transformation and quantization based on transformation mode and apparatus for transformation and quantization based on transformation mode
US20130223516A1 (en) Block quantizer in h.264 with reduced computational stages

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090413

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120322

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150406

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees