JP4963220B2 - Filter calculator and motion compensation device - Google Patents
Filter calculator and motion compensation device Download PDFInfo
- Publication number
- JP4963220B2 JP4963220B2 JP2006314037A JP2006314037A JP4963220B2 JP 4963220 B2 JP4963220 B2 JP 4963220B2 JP 2006314037 A JP2006314037 A JP 2006314037A JP 2006314037 A JP2006314037 A JP 2006314037A JP 4963220 B2 JP4963220 B2 JP 4963220B2
- Authority
- JP
- Japan
- Prior art keywords
- filter
- unit
- data
- bits
- partial product
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
本発明は、動画の圧縮符号化復号に使用される動き補償処理におけるフィルタ演算を実行するために好適なフィルタ処理装置及びこれを具備する動き補償処理装置に関する。 The present invention relates to a filter processing apparatus 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 apparatus including the filter processing apparatus.
次世代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.
ところで、特許文献1には、乗算器の数を極力少なくし、回路規模を小さくした離散コサイン変換器が開示されている。図13は、特許文献1に記載の離散コサイン変換器を示す図である。この離散コサイン変換器は、加算器612、640、642、差分器610、レジスタ614、マルチプレクサ616、652、マルチプレクサ乗算器618、620、622、634、バタフライ加算器626、628、630、632、644、646、648、650、乗算器624、636、638、及び量子化器654を有する。画像データの交流成分として差分器610による差分データを得て、これに対しDCTを行う。そして、差分についてのDCTとすることによって、必要な係数の数が少なくなるため、乗算器の数を減少できる。さらに、同一の係数を異なるデータに対し乗算する場合にはマルチプレクサ乗算器618、620、622、634を用い、時分割で乗算を行う。このため、乗算器の数をさらに減少することができる。また、乗算すべき係数を量子化器654の量子化テーブルに対し予め乗算しておくため、乗算回数を減少することができる。このように、特許文献1に記載の離散コサイン変換器は、離散コサイン変換の特性を利用し、乗算とバタフライ演算を利用して高速に同演算を実行するものである。
By the way,
また、特許文献2には、空間フィルタリング等の画像信号処理を時系列的に行なう信号処理装置が開示されている。この信号処理装置は、同じ部分積乗算器を繰り返し用いることで乗算器の回路規模を削減するものである。図14は、特許文献2に記載の情報処理装置におけるプロセッサ、レジスタ回路及び係数レジスタを示す図である。情報処理装置は、入出力バッファ回路740、5個の係数W1〜W5を保持する係数レジスタ711、及びプロセッサ710を有する。入出力バッファ回路740は、バス820に、5行分の画素データを保持するRAM746、及び画素データD1〜D5をそれぞれ保持する5個のレジスタ741〜745を有する。プロセッサ710は、2個の乗算器710a、710b、加算器710c、レジスタ710d、ゲート回路710e、データ入力側のマルチプレクサ710f、710g、及び係数入力側のマルチプレクサ710h、710iを有する。
この情報処理装置においては、乗算器710a、710bにてそれぞれ部分積P1=W1×D1、P2=W2×D2を計算する。部分積P1、P2及びレジスタ710dの値がゲート回路710eを解して加算器710cに入力され、和が求められ、その結果がレジスタ710dに保持される。ゲート回路710eには図示しない制御回路からゲート信号が印加されレジスタ710dの値が部分積と加算される。次に乗算器710a、710bにてそれぞれ部分積P3=W3×D3、P4=W4×D4を計算し、前回の部分積の和に加算される。さらに、乗算器710aにて部分積P5=W5×D5が計算され、乗算器710bには零が入力される。よって、P5のみ前回までの部分積の和に加算され、レジスタ710dに保持される。レジスタ710dの内容をゲート717及びバス810を解して図示せぬメモリセル部に保存する。こうして注目データD3について隣接するデータD2、D1、D4、D5についての5次のベクトルコンボリューションインテグラルを得ることができる。このように、特許文献2に記載の情報処理装置においては、ベクトルコンボリューションの次数5に対し2個の乗算器710a、710bとすることができる。
しかしながら、特許文献1に記載の離散コサイン変換器においては、高速に乗算を実施するために、大規模な乗算器を使用するため回路規模が大きいという問題点がある。また汎用的に処理させるために、特に画像の性質を利用するものではないため、演算精度が求められる場合には、その分だけ演算器も演算精度分だけ回路規模も大きくなり、消費電力増大につながる。
However, the discrete cosine transformer described in
また、特許文献2に記載の情報処理装置においては、プロセッサ内においては、乗算器を5つ設ける場合に比して演算時間が3倍となってしまうという問題点がある。
In addition, the information processing apparatus described in
本発明に係るフィルタ演算器は、入力データとフィルタ係数とをブースアルゴリズムを用いて積和演算するフィルタ演算器であって、現在のデータと前回のデータとの差分を求める減算器と、前記減算器からの減算結果とフィルタ係数とを乗算する部分積乗算部と、前記減算結果に基づき前記部分積乗算部での繰り返し演算回数を決定する回数決定部と、前記前回のデータまでの累積結果と前記現在のデータの乗算結果とを加算する累積加算器とを有するものである。 A filter arithmetic unit according to the present invention is a filter arithmetic unit that performs a product-sum operation on input data and filter coefficients using a Booth algorithm, and calculates a difference between current data and previous data, and the subtraction A partial product multiplier that multiplies the subtraction result from the filter by the filter coefficient, a number determination unit that determines the number of iterations in the partial product multiplier based on the subtraction result, and a cumulative result up to the previous data; And a cumulative adder for adding the multiplication result of the current data.
本発明にかかる動き補償処理装置は、予測画像を生成する動き補償処理装置であって、垂直方向の入力データに対してフィルタ演算を行なう第1フィルタ演算部と、水平方向の入力データに応じてフィルタ演算を行なう第2フィルタ演算部と、前記第1及び第2フィルタ演算部の演算結果又は第1及び第2のフィルタ演算に入力する入力データに対して重み付けを行なう重み付け演算部とを有し、前記第1及び第2フィルタ演算部は、入力データとフィルタ係数とをブースアルゴリズムを用いて積和演算するフィルタ演算器であって、現在のデータと前回のデータとの差分を求める減算器と、前記減算器からの減算結果とフィルタ係数とを乗算する部分積乗算部と、前記減算結果に基づき前記部分積乗算部での繰り返し演算回数を決定する回数決定部と、前記前回のデータまでの累積結果と前記現在のデータの乗算結果とを加算する累積加算器とを有するものである。 A motion compensation processing apparatus according to the present invention is a motion compensation processing apparatus that generates a predicted image, and includes a first filter operation unit that performs a filter operation on input data in the vertical direction, and the input data in the horizontal direction. A second filter operation unit that performs a filter operation; and a weighting operation unit that performs weighting on the operation results of the first and second filter operation units or the input data input to the first and second filter operations. The first and second filter arithmetic units are filter arithmetic units that perform a product-sum operation on the input data and the filter coefficients using a Booth algorithm, and a subtractor that obtains a difference between the current data and the previous data; A partial product multiplier that multiplies the subtraction result from the subtracter by a filter coefficient, and a circuit that determines the number of iterations in the partial product multiplier based on the subtraction result. A determination unit, the cumulative result of the up previous data and has a cumulative adder for adding the multiplication result of the current data.
本発明においては、現在のデータと前回のデータとの差分を求め、この差分を、一の部分積乗算部を繰り返し使用してフィルタ演算する。部分積乗算器を繰り返し使用することで、演算回路規模を大幅に削減し、差分信号を使用することで、繰り返し回数を最小限として演算処理時間の短縮化を図ることができる。 In the present invention, a difference between the current data and the previous data is obtained, and this difference is subjected to a filter operation by repeatedly using one partial product multiplier. By repeatedly using the partial product multiplier, the operation circuit scale can be significantly reduced, and by using the difference signal, the number of repetitions can be minimized and the operation processing time can be shortened.
本発明によれば、ハードウェア量及び消費電力を削減することができるブースアルゴリズムを利用したフィルタ演算器及び動き補償装置を提供することができる。 According to the present invention, it is possible to provide a filter arithmetic unit and a motion compensation device using a booth algorithm that can reduce the amount of hardware and power consumption.
以下、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。本実施の形態は、ブースアルゴリズムを利用したフィルタ演算器において、繰り返し演算することで演算器の規模を劇的に小さくするものである。また、画像の性質を利用し、隣接画素間の画素値の差分量が小さいことを利用して繰り返し演算を行なっても演算処理時間を短縮化する。 Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings. In the present embodiment, the scale of a computing unit is drastically reduced by repeatedly performing computation in a filter computing unit using a booth algorithm. In addition, even if the calculation is performed repeatedly using the nature of the image and the fact that the difference in pixel values between adjacent pixels is small, the calculation processing time is shortened.
先ず、本実施の形態にかかるフィルタ演算器を適用することができる画像復号装置について説明する。ここでは、一例として、H.264及びVC−1における動き補償処理におけるフィルタ演算を実行するフィルタ演算器に適用した場合について説明する。なお、本発明は、H.264及びVC−1の両規格におけるフィルタ演算が可能な動き補償回路について説明するが、H.264のみのフィルタ演算を行なう動き補償回路、VC−1のみのフィルタ演算を行なう動き補償回路、又はその他MPEG(Moving Picture Experts Group)2、4等のフィルタ演算器にも適用可能であることは勿論である。 First, an image decoding apparatus to which the filter arithmetic unit according to this embodiment can be applied will be described. Here, as an example, a case will be described in which the present invention is applied to a filter computing unit that executes filter computation in motion compensation processing in H.264 and VC-1. 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 can also be applied to a motion compensation circuit that performs a filter operation of only H.264, a motion compensation circuit that performs a filter operation of only VC-1, or other filter operation units such as MPEG (Moving Picture Experts Group) 2, 4 and the like. It is.
先ず、H.264、VC−1の画像復号装置について説明する。図1及び図2は、それぞれ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規格に適用される。 First, an H.264, VC-1 image decoding apparatus will be described. 1 and 2 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.
図1に示すように、H.264の画像復号装置100は、可変長復号部102と、逆量子化部103と、逆アダマール変換部104と、加算器105と、デブロッキングフィルタ106と、動き補償部112と、重み付け予測部111と、画面内予測部110と、復号画像108を表示するモニタ109を有する。
As shown in FIG. 1, the H.264
可変長復号部102は、圧縮データ101が入力され可変長符号化された圧縮データを、変換テーブルに基づき可変長復号する。そして、可変長復号された復号データは、逆量子化部103にて逆量子化され、逆アダマール変換部104にて逆アダマール変換され加算器105へ送られる。加算器105の出力は、デブロッキングフィルタ106によりブロック歪を除去され、復号画像108とされ、モニタ109を介して表示される。
The variable
ここで、加算器105の出力が画面内予測部110にも入力され、予測画像113が生成される。また、復号画像が動き補償部112にて動き補償処理が行なわれ、重み付け予測部111にて重み付けされて予測画像113が生成される。加算器105は、Iフレーム処理の際には画面内予測部110からの予測画像113に予測誤差を加算し出力する。一方、P、Bフレーム処理の際には、切替部107にて切り替え、重み付け予測部111から送られる予測画像113に予測誤差を加算して出力する。
Here, the output of the
また、図2に示すように、VC−1の画像復号装置200も、画像復号装置100とほぼ同様に構成され、可変長復号部202、逆量子化部203、逆DCT変換部204、加算器205、ループフィルタ206、重み付け予測部209、動き補償部210、及び復号画像207を表示するモニタ208を有する。VC−1の画像復号装置200は、画面内予測を行なわない点、重み付け予測を行なってから動き補償処理を行う点、デブロッキングフィルタ106の代わりにループフィルタ206が使用される点が異なる。
(3−2)動き補償部
As shown in FIG. 2, the VC-1
(3-2) Motion compensation unit
図3は、H.264及びVC−1の規格に準拠したフィルタ演算を含む動き補償処理を実行する動き補償(MC)部を示すブロック図である。この動き補償部300は、H.264及びVC−1のいずれの動き補償部でも使用可能な構成とされている。すなわち、両規格にて共有できる。この動き補償部300は、フィルタ演算部302、303と、セレクタ301、304、307、310、313と、乗算器304、312、加算器306、308、311と、ラインメモリ309とを有する。
FIG. 3 is a block diagram showing a motion compensation (MC) unit that executes a motion compensation process including a filter operation conforming to the standards of H.264 and VC-1. This
H.264では、フィルタ演算部302、303にてフィルタ演算施した後、上述した重み付け係数を使用してオフセット付き重み補間信号を求め、予測画像213を得る。ここで、入力INから入力された参照ピクチャR0の画素値が、フィルタ演算部302にて垂直方向フィルタによるフィルタ演算が実行され、フィルタ演算部303にて水平方向フィルタによるフィルタ演算が施される。そして、生成されたフィルタ演算済みのデータがラインメモリ309に格納される。次に、参照ピクチャR1の画素値が入力INから入力されると、同様に、フィルタ演算部302、303にてフィルタ演算が施され、フィルタ演算済みのデータに乗算器305にて重み係数を乗算し、加算器306にてオフセット値を加算する。一方、ラインメモリに格納されているデータがセレクタ313を介して乗算器312にて重み付き係数と乗算され、これらが加算器308にて加算され、オフセット付き重み補間信号W0X0+W1X1+Dを生成する。生成されたデータは、ラインメモリ309を経て出力OUTから出力される。
H. In H.264, after the filter calculation is performed by the
VC−1の場合は、入力INからのデータがセレクタ313、セレクタ310を介し、更にセレクタ304から乗算器305、加算器306を介し、そしてセレクタ301を介してフィルタ演算部302、303に入力される。フィルタ演算部303の結果は、セレクタ304、セレクタ307を介してそのままラインメモリ309へ格納され、出力OUTから出力される。乗算器312、加算器311、乗算器305、加算器306では、以下の重み付けが実行される。
H=(iScale×F+iShift+32)>>6
ここで、Fは入力値、iScale、iShiftは重み係数を示す。
In the case of VC-1, data from the input IN is input to the filter
H = (iScale × F + iShift + 32) >> 6
Here, F is an input value, and iScale and iShift are weighting factors.
このように構成された動き補償部300は、セレクタ301、304、307、310、313にてフィルタ演算部302、303への入力、出力を適宜選択するため、重み付けをフィルタ演算後に実行するH.264であっても、重み付けをフィルタ演算前に実行するVC−1であっても、いずれの演算にも適用可能である。
The
次に、このような動き補償部等に使用することができるフィルタ演算部について詳細に説明する。なお、上記においては、H.264やVC−1を例にとって説明したが、本実施の形態にかかるフィルタ演算器は、MPEG4、2などにおけるフィルタ演算部としても使用することが可能である。図4は、フィルタ演算部302、303の詳細を示す図であって、本実施の形態にかかるフィルタ演算器を示すブロック図である。フィルタ演算部302、303は同様の構成のため、ここではフィルタ演算部302について説明する。また、下記表1は、H.264及びVC−1における輝度信号Gy、色差信号Gcに対するフィルタ係数を示す。
Next, a filter calculation unit that can be used for such a motion compensation unit will be described in detail. In addition, in the above, H.H. The H.264 and VC-1 have been described as examples, but the filter calculator according to the present embodiment can also be used as a filter calculator in MPEG4, 2. FIG. 4 is a diagram showing details of the
この表1に示すように、H.264は、輝度信号Gyが6タップフィルタ、色差信号Gcは2タップフィルタのフィルタ演算となる。また、VC−1の輝度信号Gyが4タップフィルタ、色差信号Gcは2タップフィルタのフィルタ演算となる。このため、図4に示に示すフィルタ演算部302は、例えば6個のフィルタ演算器10a、10b、10c、・・・を有する。なお、フィルタ演算器を1つとして繰り返し演算を行なうようにしてもよい。フィルタ演算部10a、10b、10c、・・・の各演算結果は加算器30にて加算され出力される。フィルタ演算器10a、10b、10c、・・・は同じ構成のため、以下では、フィルタ演算器10として説明する。
As shown in Table 1, H.P. 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. For this reason, the
図5は、フィルタ演算器10を示すブロック図である。本実施の形態にかかるフィルタ演算器10は、ブースデコーダ及び部分積生成部からなる回路部分を1つとし、これを繰り返し使用することで回路規模を削減する。また、減算器13により、現在の画像データと1つ前の画像データとの差分をとってフィルタ演算することで演算量を低減し、これにより、演算時間を短縮化するものである。
FIG. 5 is a block diagram showing the
ここで、本実施の形態にかかるフィルタ演算器は、ブースのアルゴリズムを使用して乗算を行うフィルタ演算器である。そこで、本実施の形態にかかるフィルタ演算器の理解を容易とするため、先ず、2次のブースアルゴリズムを利用した乗算器について説明する。 Here, the filter arithmetic unit according to the present embodiment is a filter arithmetic unit that performs multiplication using Booth's algorithm. In order to facilitate understanding of the filter arithmetic unit according to the present embodiment, first, a multiplier using a second order Booth algorithm will be described.
乗数Yを符号付き8ビット整数
Y=−y[7]・27+y[6]・26+y[5]・25+y[4]・24+y[3]・23+y[2]・22+y[1]・21+y[0]・20
とすると、任意整数である被乗数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.
この(−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. Further, since there are only 8 values of the code data, the booth decoder can be obtained by a simple combinational logic circuit.
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.
図6は、このような2次のブースのアルゴリズムに従って乗算を実行する乗算器を示すブロック図である。乗算器400は、被乗数Xを出力するレジスタF0と、乗数Yを出力するレジスタF7を有する。更に、乗数Y及び被乗数Xが入力され部分積を生成する部分積生成ユニット401と、部分積生成ユニット401にて生成された部分積を加算する加算器450とを有する。部分積生成ユニット401は、4つの部分積生成部410、420、430、440を有する。
FIG. 6 is a block diagram illustrating a multiplier that performs multiplication according to such a second order Booth algorithm. The
各部分積生成部は、上述したように、乗数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ビット(y0〜y7とする)であれば、i=0〜3であり、それぞれX×(−2・y1+y0+0)×20、X×(−2・y3+y2+y1)×22、X×(−2・y5+y4+y3)×24、X×(−2・y7+y6+y5)×26を求める。図6においては、これらの部分積を求める部分積生成部を、それぞれ410、420、430、440としている。なお、本実施の形態においては、ブースデコーダでデコードする乗数Yが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. 6, the partial product generation units for obtaining these partial products are 410, 420, 430, and 440, respectively. In the present embodiment, the multiplier Y decoded by the Booth decoder is described by taking 8 bits as an example, but it is needless to say that the multiplier Y 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は、図7(a)のように表すことができる。乗数を2ビットごとに区切り、各組と下位組の最上位ビットの計3ビット(ただしy−1=0)のデータから符号データが得られる。これらに被乗数Xを乗算し、対応するビットシフト(×2i)を演算することで部分積を生成することができる。このため、図7(b)に示すように、レジスタF7は8ビットを出力するシフトレジスタからなり、乗数Y{y0〜y7}を出力する。このとき部分積生成部410には、乗数Yのうち下位2ビット{y0、y1}、部分積生成部420、430、440にはそれぞれ、{y1、y2、y3}、{y3、y4、y5}、{y5、y6、y7}を入力する。部分積生成部410は、入力されたこれらの所定ビットから符号データを生成するブースデコーダ411と、得られた符号データと被乗数Xとの乗算を行なう乗算部412と、乗算結果を所定ビットシフトするビットシフト部413とを有する。他の部分積生成部420、430、440も同様に構成される。ここでは、被乗数X=358(166H)、乗数Y=123(7BH)の乗算について説明する。下記表3は、演算工程における各出力値を示す。
Next, the operation of the
X×Y=358×123=44034(AC02H)
Y=123(7BH)
=(−2・0+1+1)・26
+(−2・1+1+1)・24
+(−2・1+0+1)・22
+(−2・1+1+0)・20
=2・26+0・24+(−1)・22+(−1)・20
よって、下記となる。
X×Y={(2×358)×26} ・・・部分積生成部410にて演算
+{(0×358)×24} ・・・部分積生成部420にて演算
+{(−1×358)×22} ・・・部分積生成部430にて演算
+{(−1×358)×20} ・・・部分積生成部440にて演算
X × 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 × 358) × 2 6 }... Operation by partial
先ず、被乗数入力部F0からは"358"が各部分積生成部410、420、430、440に入力される。乗数入力部F7からは、各部分積生成部410、420、430、440に、それぞれ{y0、y1}={1、1}、{y1、y2、y3}={1、0、1}、{y3、y4、y5}={1、1、1}、{y5、y6、y7}={1、1、0}が入力される。ブースデコーダ411、421、431、441は入力された所定ビットから、それぞれ(−2・y[2i+1}+y[2i]+y[2i-1])=(−2・y1+y0+0)、(−2・y3+y2+y1)、(−2・y5+y4+y3)、(−2・y7+y6+y5)の演算に対応する符号データを出力する。上記の式より本例では、各ブースデコーダ411、421、431、441は、それぞれ、"−1"、"−1"、"0"、"2"を出力する。
First, “358” is input to each partial
各乗算部412、422、432、442は、上記符号データ×被乗数Xを演算して、それぞれビットシフト部413、423、433、443へ入力する。ビットシフト部413はそのまま加算器450へ出力する。なお、本例においては説明の明確のためビットシフト部413を設けているが設ける必要はない。ビットシフト部423、433、443は、受け取った結果をそれぞれ2ビット、4ビット、6ビットシフトさせた後、加算器450へ入力する。
Each of the
本例の加算器450は、全加算器(フルアダー)451、452と、半加算器(ハーフアダー)453と、結果を受け取るレジスタ454とを有する。各ビットシフト部413、423、433、443から入力された値は、加算器450にて加算され、乗算結果Pとして出力される。
The
このように、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.
このような部分積生成ユニットを使用すると図5に示すフィルタ演算器は図8に示すような演算回路となる。図8は、従来の構成のフィルタ演算器を示す図である。すなわち上述したように、例えば8ビットであれば4つの部分積生成部を要し、例えば10ビットであれば5つの部分積生成部を要する。なお、図8には簡単のため3つの部分積生成部のみを示している。 When such a partial product generating unit is used, the filter arithmetic unit shown in FIG. 5 becomes an arithmetic circuit as shown in FIG. FIG. 8 is a diagram illustrating a filter arithmetic unit having a conventional configuration. That is, as described above, for example, if it is 8 bits, four partial product generators are required, and if it is 10 bits, for example, five partial product generators are required. In FIG. 8, only three partial product generators are shown for simplicity.
図8を簡単に説明すると、フィルタ演算器501はレジスタ(フリップフロップ:FF)502、510、511、513、516、部分積生成部503〜505、加算器509、加算器512、514、リミッタ回路515を有する。部分積生成部503〜505はそれぞれブースデコーダ506〜508を有する。画素データが乗数Yとして入力されFF502に保持される。FF502から、各ビットに応じた部分積生成部506〜508へ値が入力され部分積が生成される。加算器509はそれを加算し、上位ビットと下位ビットをそれぞれFF512、511に入力する。加算器512はFF510及びFF511からの値を加算してFF513に出力する加算器514はFF513からの値とフィルタ係数Bとを加算し、リミッタ回路515は加算器514の値を例えば0〜255の範囲に制限してFF516へ出力する。
Briefly describing FIG. 8, the filter
このフィルタ演算器は、
[出力画素]=Lim([入力画素]×A+B)
の演算を実行する。ここで、Aはフィルタ係数を示す。Bは各フィルタ演算において必要に応じて加算される所定の定数である。従来のフィルタ演算器においては、外部のメモリ等から読み出したデータは、バースト的に読み出される。この際、通常、高速演算する場合は、大規模な乗算器によりパイプライン処理する方式になっている。このため、例えば入力画素データが10ビットであれば部分積生成部が5つ必要となり、回路規模が大きく、よって消費電力も大きい。
This filter operator
[Output pixel] = Lim ([Input pixel] × A + B)
Execute the operation. Here, A indicates a filter coefficient. B is a predetermined constant added as needed in each filter operation. In a conventional filter arithmetic unit, data read from an external memory or the like is read in bursts. At this time, in general, when high-speed computation is performed, the pipeline processing is performed by a large-scale multiplier. For this reason, for example, if the input pixel data is 10 bits, five partial product generation units are required, which results in a large circuit scale and thus high power consumption.
これに対し、本実施の形態においては、これら部分積生成部506〜508を1つの部分積生成部とし、1つの部分積生成部を繰り返し使用することで回路規模を縮小し、消費電力を削減する。図5に戻って、本実施の形態にかかるフィルタ演算器1は、前データとの差分をとるためにデータを保持するレジスタ(FF)11、現データと前データとの差分をとる減算器13、この減算器13からの出力結果から部分積生成部18による乗算回数を決定する繰り返し回数決定部15、減算器13からの減算結果とある係数Aと乗算する部分積生成部18、前データまでの累算結果と現部分乗算結果の出力を加算する累算加算器20、乗算結果に対しある定数Bを加算する加算器23、及びリミッタ回路24を有する。本フィルタ演算器1では以下演算を行う。
[出力画素]=Lim([入力画素]×A+B)
On the other hand, in the present embodiment, the partial
[Output pixel] = Lim ([Input pixel] × A + B)
このフィルタ演算器1は、通常外部メモリからのデータはバースト的に転送されてくるため、必ずしも常に連続にデータが入力されるとは限らない。また画像データは隣同士の画素同士には比較的相関関係があるため、画素同士の差分も比較的小さい。以上の特徴を利用することで、小規模な部分積生成部を使用し回路規模を大幅に削減させることができる。同時に前データとの差分が少ない場合にはほぼ連続的にデータを出力させ、例外的に差分が大きくなり乗算時間が伸びてもバーストデータ間に若干の時間があるため、それほどの性能劣化を伴わずに処理を可能にすることができる。更に、回路規模削減により消費電力を削減することも可能である。
Since the data from the external memory is normally transferred in bursts in the
以下、本実施の形態にかかるフィルタ演算器1について更に詳細に説明する。減算器13は、入力される現在の画像データからFF11に保持されている1つ前の画像データを減算して差分データを求める。この理由について説明する。図9は、画像について水平方向の隣り合った画素間の差信号の振幅分布を示す図である(画像情報圧縮、テレビジョン学会偏、P71)。横軸は振幅、縦軸は周波数を示す。差信号は0近傍の狭い範囲に集中する。よって、減算器13により差信号を求めることで、0に近い値とすることができる。差分データとして入力を0に近い値とすることで、後述する繰り返し演算回数を最小限とすることができ、演算処理時間を短縮化することができる。この値はFF14に保持される。
Hereinafter, the
次に、FF14の値に基づき繰り返し回数決定部15が部分積生成部18における繰り返し演算回数を決定する。繰り返し回数決定部15の繰り返し回数決定方法について説明する。図10は、10ビットの画像データを示す模式図、図11は繰り返し回数決定部15の構成を示す図である。先ず、図10に示すように、画像データは、y0〜y9(ただし、y9は符号ビット(Sign))の10ビットとする。ここで、上述したように、ブースのアルゴリズムにおいては、画像データ(乗数Y)を2ビットごとに区切り、各組と下位組の最上位ビットの計3ビットのデータ群(グループ)S0〜S4から符号データが得られる。y0、y1の組は、y−1=0としたビットを仮定してデータ群(グループ)S0とする。
Next, the iteration
10ビットのデータは、例えば−1は(y9y8y7y6y5y4y3y2y1y0y−1)=(11111111110)であり、−2は(11111111100)である。 10-bit data, for example, -1 is (y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y -1) = (11111111110), -2 is the (11111111100) .
符号データは、y2i−1+y2i−2y2i+1で求まるが、データ群を構成する3ビットが全て同じ符号、すなわち(111)又は(000)であれば、符号データは"0"となる。すなわち、ブースデコーダ17から出力される値が"0"となるため部分積は必ず"0"となり、演算する必要がない。本実施の形態においては、この符号データが"0"となるデータ群の演算を省くことで部分積生成部の繰り返し演算回数を削減するのである。 The code data is obtained by y 2i-1 + y 2i -2y 2i + 1. If all 3 bits constituting the data group are the same code, that is, (111) or (000), the code data is “0”. That is, since the value output from the booth decoder 17 is “0”, the partial product is always “0”, and there is no need to perform an operation. In the present embodiment, the number of iterations of the partial product generation unit is reduced by omitting the computation of the data group in which the code data is “0”.
繰り返し回数の決定方法としては、以下に説明する方法がある。例えば、繰り返し回数は、10ビットの並びに応じて決定するが、予め10ビットの並びに応じた繰り返し回数が対応付けられたテーブルを用意し、図11(a)に示すように、このテーブル41を参照して繰り返し回数を出力する方法がある。 As a method for determining the number of repetitions, there is a method described below. For example, the number of repetitions is determined according to the arrangement of 10 bits, but a table in which the number of repetitions corresponding to the arrangement of 10 bits is associated in advance is prepared, and this table 41 is referred to as shown in FIG. There is a method of outputting the number of repetitions.
また、他の方法としては、上位ビットから符号を判定していき、符号の変化点を検出する方法がある。例えば、−1であれば、図10に示すように、上位ビットy9からy0までは全て1であり、y−1で0となるため、変化点はデータ群S0に含まれる。この場合は、データ群S0の演算のみを行なえばよく、繰り返し回数は1回である。−2であれば、上位ビットy9からy1までは全て1であり、y0で0となるため、変化点はデータ群S0に含まれる。この場合も、データ群S0の演算のみを行なえばよく、繰り返し回数は1回である。また、65であれば、上位ビットy9からy7までは全て0であり、y6で1となるため、変化点はデータ群S3に含まれる。この場合は、データ群S0からデータ群S3までの4グループの演算を行えばよく、繰り返し回数は4回である。 As another method, there is a method in which a code is determined from higher bits and a change point of the code is detected. For example, if -1, as shown in FIG. 10, are all the high-order bits y 9 to y 0 1, to become zero at y -1, change point is included in the data group S0. In this case, only the calculation of the data group S0 needs to be performed, and the number of repetitions is one. If it is −2, the upper bits y 9 to y 1 are all 1 and y 0 becomes 0, so the change point is included in the data group S0. Also in this case, it is only necessary to perform the operation on the data group S0, and the number of repetitions is one. Further, if 65 are all the high-order bits y 9 to y 7 0, since the 1 y 6, the change point is included in the data group S3. In this case, four groups of operations from the data group S0 to the data group S3 may be performed, and the number of repetitions is four.
さらに他の方法として、同じく65において、変化点が検出されてもさらに最下位ビットまで全ビットをサーチを続ける方法がある。この場合、さらにy6とy5の間に変化点があり、y5からy1はまでは0である。そして、y1とy0の間、y0とy−1との間に変化点がある。この場合、変化点を含むデータ群は、データ群S3、S0のみである。よって繰り返し回数を2とすることができる。上述の場合は、変化点が発見された時点で繰り返し回数を決定するので早く繰り返し回数を決定することができる。一方、最上位ビットから最下位ビットまで全ビットをサーチして変化点を検出する方法であると、より繰り返し回数を減らすことができる。この場合、上位ビットから始めたが、最後まで変化点を検出する場合は下位ビットから検出してもよい。例えば−128であれば、y−1からy6までは"0"であり、y7からy9までは"1"であり、y6とy7の間に変化点がある。この場合は、データ群S3のみの演算を行なえばよい。 As another method, in 65, there is a method in which the search is continued for all the bits up to the least significant bit even if a change point is detected. In this case, there is a transition point between y 6 and y 5 , and y 5 to y 1 are 0. Then, between y 1 and y 0, there is a change point between y 0 and y -1. In this case, the data group including the change point is only the data groups S3 and S0. Therefore, the number of repetitions can be set to 2. In the case described above, the number of repetitions is determined when a change point is found, so that the number of repetitions can be determined earlier. On the other hand, the method of searching all bits from the most significant bit to the least significant bit to detect the change point can further reduce the number of repetitions. In this case, although starting from the upper bit, when the change point is detected to the end, it may be detected from the lower bit. For example, in the case of −128, y −1 to y 6 is “0”, y 7 to y 9 is “1”, and there is a change point between y 6 and y 7 . In this case, only the data group S3 needs to be calculated.
さらにまた、他の方法としては、データ群毎に、データ群が(000)又は(111)であるか否かを検出するようにしてもよい。理由は、2次のブースデコード結果を0にするためである。この場合は、上位ビット側からであっても下位ビット側からであっても、又は全ビット同時に行なうようにしてもよい。例えば127であれば、データ群S0、S3が演算対象であり繰り返し回数は2回である。2であれば、データ群S0のみが演算対象であり繰り返し回数は1である。また1であれば、データ群S0のみが演算対象であり繰り返し回数は1である。
Furthermore, as another method, for each data group, it may be detected whether the data group is (000) or (111). The reason is to make the secondary
図11(b)は、データ群毎に(000)又は(111)であるか否かを検出する回路の一例を示す図である。10ビットのデータをデータ群S0〜S4に分け、それぞれ判定部51〜55に入力し、(000)又は(111)であるか否かを判定する。例えば、(000)又は(111)であれば0を、そうでなければ1を出力する。テーブル56は判定部51〜55の出力に応じて繰り返し回数を出力する。このとき、どのデータ群の演算を行なうかの情報(以下データ群情報という。)を一緒に出力する。
FIG. 11B is a diagram illustrating an example of a circuit that detects whether the data group is (000) or (111). The 10-bit data is divided into data groups S0 to S4 and input to the
図11(c)は、変化点がどの位置にあるかを検出することで繰り返し回数を決定する具体的な回路の一例を示す図である。上位ビットからFF61に画像データを入力する。FF61に保持された上位のビットと次に入力されるそれより下位のビットとを比較器62で比較し、一致であれば例えば"0"、不一致であれば例えば"1"を出力する。カウンタ63はダウンカウンタでありカウント値を9から0までカウントする。回数決定部64は、"1"が入力されたときのカウンタ値に基づき、繰り返し回数をMUX16、19へ出力する。
FIG. 11C is a diagram illustrating an example of a specific circuit that determines the number of repetitions by detecting where the change point is located. Image data is input to the
以上のようにして、繰り返し回数決定部15は、少なくとも繰り返し回数を出力する。また、全データ群について(000)又は(111)であるか否かを検出するような場合は、繰り返し回数と、どのデータ群で演算が必要かを示すデータ群情報とをMUX16、19へ出力する。
As described above, the repetition
MUX16は、繰り返し回数のみが入力される場合は、繰り返し回数に応じたデータ群を部分積生成部18へ出力する。たとえば繰り返し回数が3の場合、先ず、(y1,y0,0)を入力し、次のタイミングで(y3,y2,y1)を入力し、次のタイミングで(y5,y4,y3)を入力する。
When only the number of repetitions is input, the
また、繰り返し回数とデータ群情報が入力される場合には、データ群情報に基づきデータ群を部分積生成部18へ出力する。例えば上述の65の場合であれば、データ群S0、及びS3にて変化点が検出される。この場合、最初のタイミングで(y1,y0,0)を入力し、次のタイミングで(y7,y6,y5)を入力する。
When the repetition count and data group information are input, the data group is output to the
部分積生成部18及びブースデコーダ17は、上述した演算を行なう。すなわち、ブースデコーダ17はデータ群から符号データを求め、部分積生成部が符号データにフィルタ係数Aを乗算する。ここでビットシフトは行なわず、MUX19へ出力する。
The
MUX19にも、MUX16と同様に繰り返し回数が入力されている。したがって、繰り返し回数が1のときはビットシフトを行なわず(×1のため)そのまま加算器20へ出力する。繰り返し回数2のときは、2ビットシフト(×22のため)し、加算器20へ出力する。同様に、繰り返し回数が3のときは4ビットシフト(×24のため)、繰り返し回数が4のときは6ビットシフト(×26のため)、繰り返し回数が5のときは8ビットシフト(×28のため)して加算器20へ出力する。
Similar to the
また、MUX19、MUX16に繰り返し回数及びデータ群情報が入力されている場合は、データ群情報に基づきビットシフトを行なう。例えば上述の65の場合であれば、データ群S0の演算結果に対してはビットシフトせずに出力し、次のタイミングのデータ群S3の演算の際は、6ビットシフトした値を加算器20へ出力する。なお、MUX16、部分積生成部18及びMUX19により、減算器からの減算結果とフィルタ係数とを乗算する部分積乗算部を構成する。
When the number of repetitions and data group information are input to MUX19 and MUX16, bit shift is performed based on the data group information. For example, in the case of 65 described above, the operation result of the data group S0 is output without being bit-shifted, and the value of 6-bit shift is added to the
加算器20は、MUX19からの出力と、FF21に保持されている前回出力した値とを加算し、繰り返し演算が終了するまで再度FF21に保存する。セレクタ22は、初回の繰り返し演算の際には0を選択し、その他はFF21の値を選択出力する。この加算器20は、各データ群S0〜S4から得られた部分積を加算すると共に、前回の加算結果に今回の加算結果を加算することで、現在の画素データのフィルタ演算結果を得ることができる。すなわち、前回の加算結果及び今回の加算結果はいずれも差分データにフィルタ係数Aを乗算した部分積和からなるため、これらを加算することで、差分データではない画素データのフィルタ演算結果を求めることができる。
The
加算器23は、必要であれば係数Bを加算し、演算結果をリミッタ回路24へ出力する。リミッタ回路24は、例えば0〜255までの間に演算結果がおさまるよう制限してFF25に出力する。
The
図12は、本実施の形態にかかるフィルタ演算器の効果を説明する図である。図12(a)は、本実施の形態にかかるフィルタ演算器の演算タイミングを示している。図12(b)は、図8に示す従来のフィルタ演算器の演算タイミングを示す。図12(b)に示すように、従来のフィルタ演算器は、繰り返し演算を行なわないため、入力から出力まで所定のタイミングですばやく演算することができる。一方、図12(a)に示すように、本実施の形態にかかるフィルタ演算器は、例えばデータF00では4回の繰り返し演算をおこなうため、従来の4倍の演算時間を要している。一方、上述したように、画像データは差分信号とすると0近傍にデータが集まるため、最初の数回以降の演算においては0近傍のデータが多くなる。このため、上述した方法で繰り返し演算回数を決定しても、繰り返し演算回数は1乃至2回程度となり演算処理時間が長期化しない。 FIG. 12 is a diagram for explaining the effect of the filter arithmetic unit according to this embodiment. FIG. 12A shows calculation timings of the filter calculator according to the present embodiment. FIG.12 (b) shows the calculation timing of the conventional filter calculator shown in FIG. As shown in FIG. 12 (b), the conventional filter calculator does not repeatedly perform calculations, so that it can quickly calculate from input to output at a predetermined timing. On the other hand, as shown in FIG. 12A, the filter arithmetic unit according to the present embodiment requires four times the calculation time of the conventional method because, for example, the data F00 performs four repetitive calculations. On the other hand, as described above, if the image data is a difference signal, the data gathers in the vicinity of 0. Therefore, in the first and subsequent calculations, the data in the vicinity of 0 increases. For this reason, even if the number of repetitive calculations is determined by the above-described method, the number of repetitive calculations is about 1 to 2, and the calculation processing time is not prolonged.
さらに、例えば画像データをSDRAMから読み出す場合、CASレイテンシやRASレイテンシのために画像データと画像データの入力タイミングの間に、図12(b)に示すように、待ち時間Tが生じてしまう。本実施の形態にかかるフィルタ演算器は、繰り返し演算を行なう場合もあるが、差分画像信号を使用することに加え、このような待ち時間を有効に使用することで、繰り返し演算を行なわない従来のフィルタ演算器と比べても演算処理時間をそれほど長時間化させることがない。 Furthermore, for example, when image data is read from the SDRAM, a waiting time T occurs between the input timing of the image data and the image data due to CAS latency and RAS latency, as shown in FIG. The filter arithmetic unit according to the present embodiment may repeatedly perform calculations, but in addition to using the difference image signal, the filter arithmetic unit according to the present embodiment effectively uses such a waiting time, and does not perform repeated calculations. Compared with the filter calculator, the calculation processing time is not so long.
本実施の形態においては、画像データは隣同士の画素同士には比較的相関関係があるため、画素同士の差分も比較的小さい。このことを利用し、入力画像データについて現在のデータと次のデータとの差分をとってフィルタ係数と乗算し、それを加算してフィルタ演算を行なう。このとき、差分をとった入力データは0近傍の値となるため、繰り返し回数を激減させることができる。また、通常外部メモリからのデータはバースト的に転送されてくるため、常に連続にデータが入力されない。すなわち、データ入力の待ち時間があるため、たとえ繰り返し演算が含まれても待ち時間の間に行なうことができる。 In the present embodiment, since the image data has a relatively correlation between adjacent pixels, the difference between the pixels is also relatively small. Using this fact, the difference between the current data and the next data is calculated for the input image data, multiplied by the filter coefficient, and added to perform the filter operation. At this time, since the input data obtained by the difference becomes a value near 0, the number of repetitions can be drastically reduced. Also, since data from the external memory is normally transferred in bursts, data is not always input continuously. In other words, since there is a waiting time for data input, even if repetitive calculation is included, it can be performed during the waiting time.
したがって、小規模な部分積生成部を使用し回路規模を大幅に削減させることができる。また、前データとの差分が少ない場合にはほぼ連続的にデータを出力することができ、また、例外的に差分が大きくなり繰り返し演算回数が多くなってもデータ転送間の待ち時間を利用することで処理時間をそれほど長期化させることがない。更に、回路規模削減により消費電力を削減することができる。 Therefore, the circuit scale can be greatly reduced by using a small partial product generation unit. In addition, when the difference with the previous data is small, the data can be output almost continuously, and even when the difference is exceptionally large and the number of repeated operations increases, the waiting time between data transfers is used. Therefore, the processing time is not prolonged so much. Furthermore, power consumption can be reduced by reducing the circuit scale.
なお、本発明は上述した実施の形態のみに限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変更が可能であることは勿論である。例えば、上述の実施の形態では、ハードウェアの構成として説明したが、これに限定されるものではなく、任意の処理を、CPU(Central Processing Unit)にコンピュータプログラムを実行させることにより実現することも可能である。この場合、コンピュータプログラムは、記録媒体に記録して提供することも可能であり、また、インターネットその他の伝送媒体を介して伝送することにより提供することも可能である。 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, in the above-described embodiment, the hardware configuration has been described. However, the present invention is not limited to this, and arbitrary processing may be realized by causing a CPU (Central Processing Unit) to execute a computer program. Is possible. In this case, the computer program can be provided by being recorded on a recording medium, or can be provided by being transmitted via the Internet or another transmission medium.
1、10 フィルタ演算器
13 減算器
15 回数決定部
17、411、421、431、441 ブースデコーダ
18、410、420、430、440 部分積生成部
20、23、30、105、205、306、308、311、450 加算器
21、25、61、454 レジスタ
22、301、304、307、310、313 セレクタ
24 リミッタ回路
41、56 テーブル
51−55 判定部
62 比較器
63 カウンタ
64 回数決定部
100、200 画像復号装置
101 圧縮データ
102、202 可変長復号部
103、203 逆量子化部
104 逆アダマール変換部
106 デブロッキングフィルタ
107 切替部
108、207 復号画像
109、208 モニタ
110 画面内予測部
111、209 重み付け予測部
112、210300 動き補償部
113 予測画像
204 逆DCT変換部
206 ループフィルタ
302、303 フィルタ演算部
304、305、312 乗算器
309 ラインメモリ
401 部分積生成ユニット
412、422、432、442 乗算部
413、423、433、443 ビットシフト部
1, 10
Claims (8)
現在のデータと前回のデータとの差分を求める減算器と、
前記減算器からの減算結果とフィルタ係数とを乗算する部分積乗算部と、
前記減算結果に基づき前記部分積乗算部での繰り返し演算回数を決定する回数決定部と、
前記前回のデータまでの累積結果と前記現在のデータの乗算結果とを加算する累積加算器とを有するフィルタ演算器。 A filter arithmetic unit that performs a product-sum operation on input data and filter coefficients using a Booth algorithm,
A subtractor that calculates the difference between the current data and the previous data;
A partial product multiplier for multiplying the subtraction result from the subtracter by the filter coefficient;
A number-of-times determining unit that determines the number of iterations in the partial product multiplying unit based on the subtraction result;
A filter arithmetic unit comprising: a cumulative adder that adds a cumulative result up to the previous data and a multiplication result of the current data.
ことを特徴とする請求項1記載のフィルタ演算器。 2. The filter arithmetic unit according to claim 1, wherein the number determination unit searches a position where the bit value is changed from the upper bits of the subtraction result, and determines the number of multiplications based on the search result.
ことを特徴とする請求項1記載のフィルタ演算器。 The number-of-times deciding unit searches for a position where the value of the bit is changed for all the bits from the lower bit to the upper bit of the subtraction result, and decides the number of multiplications based on the search result. The filter arithmetic unit according to 1.
ことを特徴とする請求項1記載のフィルタ演算器。 The number determination unit divides the subtraction result into 2 bits from the lower order to form groups of 3 bits in total, each set and the most significant bit of the lower set, and whether or not the values of all bits are the same for each group. The filter arithmetic unit according to claim 1, wherein the number of multiplications is determined based on the determination result.
ことを特徴とする請求項1記載のフィルタ演算器。 The number-of-times determination unit divides the subtraction result into two bits from the lower order, and groups each set and the most significant bit of the lower group into a total of 3 bits, and all the bits from the lower bit to the upper bit of the subtraction result 2. The filter arithmetic unit according to claim 1, wherein a search is performed as to whether or not there is a change in a bit value in each group, and the number of multiplications is determined based on the search result.
ことを特徴とする請求項1乃至5のいずれか1項記載のフィルタ演算器。 The number determination unit, together with the number of multiplications, divides the subtraction result into 2 bits from the lower order, and when each group and the most significant bit of the lower set are grouped in groups of 3 bits, 3 bits constituting the group 6. The filter arithmetic unit according to claim 1, wherein order information indicating the number of groups from the lower order of groups whose values are not the same is output.
ことを特徴とする請求項1記載のフィルタ演算器。 The partial product multiplication unit includes a data selection unit to which the number of multiplications is input, a partial product generation unit that calculates a partial product based on the data selected by the data selection unit, and a portion generated by the partial product generation unit The filter arithmetic unit according to claim 1, further comprising: a bit shift unit that shifts a product by a predetermined bit.
垂直方向の入力データに対してフィルタ演算を行なう第1フィルタ演算部と、
水平方向の入力データに応じてフィルタ演算を行なう第2フィルタ演算部と、
前記第1及び第2フィルタ演算部の演算結果又は第1及び第2のフィルタ演算に入力する入力データに対して重み付けを行なう重み付け演算部とを有し、
前記第1及び第2フィルタ演算部は、入力データとフィルタ係数とをブースアルゴリズムを用いて積和演算するフィルタ演算器であって、
現在のデータと前回のデータとの差分を求める減算器と、
前記減算器からの減算結果とフィルタ係数とを乗算する部分積乗算部と、
前記減算結果に基づき前記部分積乗算部での繰り返し演算回数を決定する回数決定部と、
前記前回のデータまでの累積結果と前記現在のデータの乗算結果とを加算する累積加算器とを有する動き補償処理装置。 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 arithmetic units are filter arithmetic units that perform a product-sum operation on input data and filter coefficients using a Booth algorithm,
A subtractor that calculates the difference between the current data and the previous data;
A partial product multiplier for multiplying the subtraction result from the subtracter by the filter coefficient;
A number-of-times determining unit that determines the number of iterations in the partial product multiplying unit based on the subtraction result;
A motion compensation processing apparatus comprising: a cumulative adder that adds a cumulative result up to the previous data and a multiplication result of the current data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006314037A JP4963220B2 (en) | 2006-11-21 | 2006-11-21 | Filter calculator and motion compensation device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006314037A JP4963220B2 (en) | 2006-11-21 | 2006-11-21 | Filter calculator and motion compensation device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008131336A JP2008131336A (en) | 2008-06-05 |
JP4963220B2 true JP4963220B2 (en) | 2012-06-27 |
Family
ID=39556756
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006314037A Expired - Fee Related JP4963220B2 (en) | 2006-11-21 | 2006-11-21 | Filter calculator and motion compensation device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4963220B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5086675B2 (en) * | 2007-03-26 | 2012-11-28 | ルネサスエレクトロニクス株式会社 | Filter calculator and motion compensation device |
JP4988627B2 (en) * | 2008-03-05 | 2012-08-01 | ルネサスエレクトロニクス株式会社 | Filter calculator and motion compensation device |
JP5668391B2 (en) * | 2010-09-27 | 2015-02-12 | 富士通セミコンダクター株式会社 | Arithmetic circuit |
JP2012209755A (en) * | 2011-03-29 | 2012-10-25 | Fujitsu Ltd | Arithmetic circuit and binary number conversion method |
JP7230744B2 (en) * | 2019-08-28 | 2023-03-01 | 株式会社デンソー | Convolution operation method and operation processing device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04116720A (en) * | 1990-09-07 | 1992-04-17 | Hitachi Ltd | Semiconductor device |
JPH09101877A (en) * | 1995-10-06 | 1997-04-15 | Ricoh Co Ltd | Operation method and device for multipilcation |
JP3753466B2 (en) * | 1996-04-22 | 2006-03-08 | 松下電器産業株式会社 | Arithmetic unit |
-
2006
- 2006-11-21 JP JP2006314037A patent/JP4963220B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2008131336A (en) | 2008-06-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4881270B2 (en) | Filter calculator and motion compensation device | |
US8345764B2 (en) | Motion estimation device having motion estimation processing elements with adder tree arrays | |
JP4963220B2 (en) | Filter calculator and motion compensation device | |
US5563813A (en) | Area/time-efficient motion estimation micro core | |
EP2112602A2 (en) | Device, system, and method for solving systems of linear equations using parallel processing | |
JP4988627B2 (en) | Filter calculator and motion compensation device | |
JP4536109B2 (en) | Semiconductor device and signal processing method | |
JP5086675B2 (en) | Filter calculator and motion compensation device | |
JP4516051B2 (en) | Filter processing device, multiplier, and motion compensation processing device | |
Silveira et al. | Low power SATD architecture employing multiple sizes Hadamard transforms and adder compressors | |
JP4519807B2 (en) | Multiplier and filter processing apparatus | |
JP2008125078A (en) | Motion compensation method and apparatus supporting multi-codec | |
JP4957780B2 (en) | Motion compensated predictive coding apparatus, motion compensated predictive coding method, and program | |
KR101151352B1 (en) | Context-based adaptive variable length coding decoder for h.264/avc | |
JP4963194B2 (en) | Filter processing device, multiplier, and motion compensation processing device | |
JP5195674B2 (en) | Image encoding device | |
JP2011186592A (en) | Filter operation unit, filter operation method, and motion compensation processing device | |
JP2008532335A (en) | Image interpolation method and pixel interpolation device | |
JP2011090362A (en) | Filter computing unit, filter operation method, and motion compensation processing device | |
WO2015121701A1 (en) | Methods and apparatus to perform fractional-pixel interpolation filtering for media coding | |
JP5353560B2 (en) | Image processing circuit and image encoding apparatus | |
TWI402771B (en) | Fast inverse integer dct method on multi-core processor | |
JP5287624B2 (en) | Image processing circuit and image encoding apparatus | |
Fatemi et al. | Fast algorithm analysis and bit-serial architecture design for sub-pixel motion estimation in H. 264 | |
KR101742765B1 (en) | Interpolator and interpolator pixel generation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090910 |
|
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 |