JP4963220B2 - Filter calculator and motion compensation device - Google Patents

Filter calculator and motion compensation device Download PDF

Info

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
Application number
JP2006314037A
Other languages
Japanese (ja)
Other versions
JP2008131336A (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 JP2006314037A priority Critical patent/JP4963220B2/en
Publication of JP2008131336A publication Critical patent/JP2008131336A/en
Application granted granted Critical
Publication of JP4963220B2 publication Critical patent/JP4963220B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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, Patent Document 1 discloses a discrete cosine transformer in which the number of multipliers is reduced as much as possible and the circuit scale is reduced. FIG. 13 is a diagram illustrating a discrete cosine transformer described in Patent Document 1. In FIG. The discrete cosine transformer includes adders 612, 640, and 642, a difference unit 610, a register 614, multiplexers 616 and 652, multiplexer multipliers 618, 620, 622, and 634, butterfly adders 626, 628, 630, 632, and 644. , 646, 648, 650, multipliers 624, 636, 638, and a quantizer 654. Difference data by the difference unit 610 is obtained as an AC component of the image data, and DCT is performed on the difference data. Since the number of necessary coefficients is reduced by using the DCT for the difference, the number of multipliers can be reduced. Further, when multiplying different data by the same coefficient, multiplexer multipliers 618, 620, 622, and 634 are used to perform multiplication in a time division manner. For this reason, the number of multipliers can be further reduced. In addition, since the coefficient to be multiplied is previously multiplied with the quantization table of the quantizer 654, the number of multiplications can be reduced. As described above, the discrete cosine transformer described in Patent Document 1 uses the characteristics of the discrete cosine transform and performs the same operation at high speed using multiplication and butterfly operations.

また、特許文献2には、空間フィルタリング等の画像信号処理を時系列的に行なう信号処理装置が開示されている。この信号処理装置は、同じ部分積乗算器を繰り返し用いることで乗算器の回路規模を削減するものである。図14は、特許文献2に記載の情報処理装置におけるプロセッサ、レジスタ回路及び係数レジスタを示す図である。情報処理装置は、入出力バッファ回路740、5個の係数W〜Wを保持する係数レジスタ711、及びプロセッサ710を有する。入出力バッファ回路740は、バス820に、5行分の画素データを保持するRAM746、及び画素データD〜Dをそれぞれ保持する5個のレジスタ741〜745を有する。プロセッサ710は、2個の乗算器710a、710b、加算器710c、レジスタ710d、ゲート回路710e、データ入力側のマルチプレクサ710f、710g、及び係数入力側のマルチプレクサ710h、710iを有する。 Patent Document 2 discloses a signal processing apparatus that performs image signal processing such as spatial filtering in a time series. This signal processing apparatus reduces the circuit scale of a multiplier by repeatedly using the same partial product multiplier. FIG. 14 is a diagram illustrating a processor, a register circuit, and a coefficient register in the information processing apparatus described in Patent Document 2. The information processing apparatus includes an input / output buffer circuit 740, a coefficient register 711 that holds five coefficients W 1 to W 5 , and a processor 710. The input / output buffer circuit 740 includes a RAM 746 that holds pixel data for five rows and five registers 741 to 745 that respectively hold pixel data D 1 to D 5 on the bus 820. The processor 710 includes two multipliers 710a and 710b, an adder 710c, a register 710d, a gate circuit 710e, multiplexers 710f and 710g on the data input side, and multiplexers 710h and 710i on the coefficient input side.

この情報処理装置においては、乗算器710a、710bにてそれぞれ部分積P=W×D、P=W×Dを計算する。部分積P、P及びレジスタ710dの値がゲート回路710eを解して加算器710cに入力され、和が求められ、その結果がレジスタ710dに保持される。ゲート回路710eには図示しない制御回路からゲート信号が印加されレジスタ710dの値が部分積と加算される。次に乗算器710a、710bにてそれぞれ部分積P=W×D、P=W×Dを計算し、前回の部分積の和に加算される。さらに、乗算器710aにて部分積P=W×Dが計算され、乗算器710bには零が入力される。よって、Pのみ前回までの部分積の和に加算され、レジスタ710dに保持される。レジスタ710dの内容をゲート717及びバス810を解して図示せぬメモリセル部に保存する。こうして注目データDについて隣接するデータD、D、D、Dについての5次のベクトルコンボリューションインテグラルを得ることができる。このように、特許文献2に記載の情報処理装置においては、ベクトルコンボリューションの次数5に対し2個の乗算器710a、710bとすることができる。
特開平6−44291号公報 特開昭62−105287号公報
In this information processing apparatus, multipliers 710a and 710b calculate partial products P 1 = W 1 × D 1 and P 2 = W 2 × D 2 , respectively. The partial products P 1 and P 2 and the value of the register 710d are input to the adder 710c through the gate circuit 710e, the sum is obtained, and the result is held in the register 710d. A gate signal is applied to the gate circuit 710e from a control circuit (not shown), and the value in the register 710d is added to the partial product. Next, multipliers 710a and 710b calculate partial products P 3 = W 3 × D 3 and P 4 = W 4 × D 4 , respectively, and add them to the sum of the previous partial products. Further, the partial product P 5 = W 5 × D 5 is calculated by the multiplier 710a, and zero is input to the multiplier 710b. Therefore, is added to the sum of partial products only up to the last P 5, it is held in the register 710d. The contents of the register 710d are stored in a memory cell unit (not shown) through the gate 717 and the bus 810. In this way, a fifth-order vector convolution integral can be obtained for the data D 2 , D 1 , D 4 , and D 5 adjacent to the data of interest D 3 . Thus, in the information processing apparatus described in Patent Document 2, two multipliers 710a and 710b can be used for the degree 5 of vector convolution.
JP-A-6-44291 JP-A-62-105287

しかしながら、特許文献1に記載の離散コサイン変換器においては、高速に乗算を実施するために、大規模な乗算器を使用するため回路規模が大きいという問題点がある。また汎用的に処理させるために、特に画像の性質を利用するものではないため、演算精度が求められる場合には、その分だけ演算器も演算精度分だけ回路規模も大きくなり、消費電力増大につながる。   However, the discrete cosine transformer described in Patent Document 1 has a problem that the circuit scale is large because a large-scale multiplier is used to perform multiplication at high speed. In addition, since image processing is not particularly used for general-purpose processing, when computing accuracy is required, the computing unit and the circuit scale are increased by that amount, which increases power consumption. Connected.

また、特許文献2に記載の情報処理装置においては、プロセッサ内においては、乗算器を5つ設ける場合に比して演算時間が3倍となってしまうという問題点がある。   In addition, the information processing apparatus described in Patent Document 2 has a problem that the computation time is three times longer than that in the case where five multipliers are provided in the processor.

本発明に係るフィルタ演算器は、入力データとフィルタ係数とをブースアルゴリズムを用いて積和演算するフィルタ演算器であって、現在のデータと前回のデータとの差分を求める減算器と、前記減算器からの減算結果とフィルタ係数とを乗算する部分積乗算部と、前記減算結果に基づき前記部分積乗算部での繰り返し演算回数を決定する回数決定部と、前記前回のデータまでの累積結果と前記現在のデータの乗算結果とを加算する累積加算器とを有するものである。   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 image decoding apparatus 100 includes a variable length decoding unit 102, an inverse quantization unit 103, an inverse Hadamard transform unit 104, an adder 105, a deblocking filter 106, a motion The compensation unit 112, the weighted prediction unit 111, the in-screen prediction unit 110, and the monitor 109 that displays the decoded image 108 are included.

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

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

また、図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 image decoding apparatus 200 is also configured in substantially the same manner as the image decoding apparatus 100, and includes a variable length decoding unit 202, an inverse quantization unit 203, an inverse DCT conversion unit 204, an adder. 205, a loop filter 206, a weighted prediction unit 209, a motion compensation unit 210, and a monitor 208 that displays a decoded image 207. The VC-1 image decoding apparatus 200 is different in that intra-screen prediction is not performed, motion compensation processing is performed after weighted prediction, and a loop filter 206 is used instead of the deblocking filter 106.
(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 motion compensation unit 300 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 300 includes filter calculation units 302 and 303, selectors 301, 304, 307, 310, and 313, multipliers 304 and 312, adders 306, 308, and 311, and a line memory 309.

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

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 arithmetic units 302 and 303 via the selector 313 and the selector 310, and further from the selector 304 via the multiplier 305 and the adder 306, and via the selector 301. The The result of the filter operation unit 303 is stored as it is in the line memory 309 via the selector 304 and the selector 307 and is output from the output OUT. In the multiplier 312, the adder 311, the multiplier 305, and the adder 306, the following weighting is executed.
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 motion compensator 300 configured in this way is selected by the selectors 301, 304, 307, 310, and 313 so that the inputs and outputs to the filter calculators 302 and 303 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.

次に、このような動き補償部等に使用することができるフィルタ演算部について詳細に説明する。なお、上記においては、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 filter calculation units 302 and 303, and is a block diagram showing the filter calculation unit according to the present embodiment. Since the filter calculation units 302 and 303 have the same configuration, the filter calculation unit 302 will be described here. Table 1 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.

Figure 0004963220
Figure 0004963220

この表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 filter calculation unit 302 shown in FIG. 4 includes, for example, six filter calculation units 10a, 10b, 10c,. It should be noted that the calculation may be repeated with one filter operation unit. The calculation results of the filter calculation units 10a, 10b, 10c,... Are added by the adder 30 and output. Since the filter arithmetic units 10a, 10b, 10c,... Have the same configuration, the filter arithmetic units 10a, 10b, 10c,.

図5は、フィルタ演算器10を示すブロック図である。本実施の形態にかかるフィルタ演算器10は、ブースデコーダ及び部分積生成部からなる回路部分を1つとし、これを繰り返し使用することで回路規模を削減する。また、減算器13により、現在の画像データと1つ前の画像データとの差分をとってフィルタ演算することで演算量を低減し、これにより、演算時間を短縮化するものである。   FIG. 5 is a block diagram showing the filter calculator 10. The filter arithmetic unit 10 according to this exemplary embodiment uses one circuit part including a booth decoder and a partial product generation unit, and reduces the circuit scale by repeatedly using the circuit part. Further, the subtractor 13 takes the difference between the current image data and the previous image data and performs a filter operation to reduce the amount of calculation, thereby shortening the calculation time.

ここで、本実施の形態にかかるフィルタ演算器は、ブースのアルゴリズムを使用して乗算を行うフィルタ演算器である。そこで、本実施の形態にかかるフィルタ演算器の理解を容易とするため、先ず、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]・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 0004963220
Figure 0004963220

この(−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.

Figure 0004963220
Figure 0004963220

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 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を求める。図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を乗算し、対応するビットシフト(×2)を演算することで部分積を生成することができる。このため、図7(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)の乗算について説明する。下記表3は、演算工程における各出力値を示す。 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 the multiplicand X and calculating the corresponding bit shift (× 2 i ). For this reason, as shown in FIG. 7B, the register F7 is formed 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 3 below shows each output value in the calculation process.

Figure 0004963220
Figure 0004963220

X×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×358)×2} ・・・部分積生成部410にて演算
+{(0×358)×2} ・・・部分積生成部420にて演算
+{(−1×358)×2} ・・・部分積生成部430にて演算
+{(−1×358)×2} ・・・部分積生成部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 product generation unit 410 + {(0 × 358) × 2 4 }... Operation by partial product generation unit 420 + {( −1 × 358) × 2 2 }... Operation by partial product generation unit 430 + {(− 1 × 358) × 2 0 }... Operation by 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.

このような部分積生成ユニットを使用すると図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 arithmetic unit 501 includes registers (flip-flops: FFs) 502, 510, 511, 513, 516, partial product generation units 503 to 505, an adder 509, adders 512, 514, and a limiter circuit. 515. The partial product generators 503 to 505 have booth decoders 506 to 508, respectively. Pixel data is input as a multiplier Y and held in the FF 502. A value is input from the FF 502 to the partial product generation units 506 to 508 corresponding to each bit to generate a partial product. The adder 509 adds them and inputs the upper and lower bits to the FFs 512 and 511, respectively. The adder 512 adds the values from the FF 510 and the FF 511 and outputs the result to the FF 513. The adder 514 adds the value from the FF 513 and the filter coefficient B. The limiter circuit 515 sets the value of the adder 514 to 0 to 255, for example. Limit to the range and output to FF516.

このフィルタ演算器は、
[出力画素]=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 product generation units 506 to 508 are used as one partial product generation unit, and the circuit scale is reduced and power consumption is reduced by repeatedly using one partial product generation unit. To do. Returning to FIG. 5, the filter arithmetic unit 1 according to the present exemplary embodiment includes a register (FF) 11 that holds data in order to obtain a difference from the previous data, and a subtractor 13 that obtains a difference between the current data and the previous data. From the output result from the subtractor 13, the iteration number determination unit 15 that determines the number of multiplications by the partial product generation unit 18, the partial product generation unit 18 that multiplies the subtraction result from the subtractor 13 by a certain coefficient A, and the previous data And the output of the current partial multiplication result, an adder 23 for adding a constant B to the multiplication result, and a limiter circuit 24. The filter calculator 1 performs the following calculation.
[Output pixel] = Lim ([Input pixel] × A + B)

このフィルタ演算器1は、通常外部メモリからのデータはバースト的に転送されてくるため、必ずしも常に連続にデータが入力されるとは限らない。また画像データは隣同士の画素同士には比較的相関関係があるため、画素同士の差分も比較的小さい。以上の特徴を利用することで、小規模な部分積生成部を使用し回路規模を大幅に削減させることができる。同時に前データとの差分が少ない場合にはほぼ連続的にデータを出力させ、例外的に差分が大きくなり乗算時間が伸びてもバーストデータ間に若干の時間があるため、それほどの性能劣化を伴わずに処理を可能にすることができる。更に、回路規模削減により消費電力を削減することも可能である。   Since the data from the external memory is normally transferred in bursts in the filter computing unit 1, the data is not always input continuously. In addition, since the image data has a relatively correlation between adjacent pixels, the difference between the pixels is also relatively small. By utilizing the above features, the circuit scale can be greatly reduced using a small partial product generator. At the same time, when the difference from the previous data is small, the data is output almost continuously, and even if the difference is large and the multiplication time is extended, there is a little time between burst data, so there is a considerable performance degradation. Processing can be made without Furthermore, power consumption can be reduced by reducing the circuit scale.

以下、本実施の形態にかかるフィルタ演算器1について更に詳細に説明する。減算器13は、入力される現在の画像データからFF11に保持されている1つ前の画像データを減算して差分データを求める。この理由について説明する。図9は、画像について水平方向の隣り合った画素間の差信号の振幅分布を示す図である(画像情報圧縮、テレビジョン学会偏、P71)。横軸は振幅、縦軸は周波数を示す。差信号は0近傍の狭い範囲に集中する。よって、減算器13により差信号を求めることで、0に近い値とすることができる。差分データとして入力を0に近い値とすることで、後述する繰り返し演算回数を最小限とすることができ、演算処理時間を短縮化することができる。この値はFF14に保持される。   Hereinafter, the filter computing unit 1 according to the present embodiment will be described in more detail. The subtracter 13 subtracts the previous image data held in the FF 11 from the input current image data to obtain difference data. The reason for this will be described. FIG. 9 is a diagram illustrating an amplitude distribution of a difference signal between adjacent pixels in the horizontal direction for an image (image information compression, Television Society bias, P71). The horizontal axis represents amplitude and the vertical axis represents frequency. The difference signal is concentrated in a narrow range near zero. Therefore, a value close to 0 can be obtained by obtaining the difference signal by the subtractor 13. By setting the input as the difference data to a value close to 0, it is possible to minimize the number of repeated calculations described later, and to shorten the calculation processing time. This value is held in FF14.

次に、FF14の値に基づき繰り返し回数決定部15が部分積生成部18における繰り返し演算回数を決定する。繰り返し回数決定部15の繰り返し回数決定方法について説明する。図10は、10ビットの画像データを示す模式図、図11は繰り返し回数決定部15の構成を示す図である。先ず、図10に示すように、画像データは、y〜y(ただし、yは符号ビット(Sign))の10ビットとする。ここで、上述したように、ブースのアルゴリズムにおいては、画像データ(乗数Y)を2ビットごとに区切り、各組と下位組の最上位ビットの計3ビットのデータ群(グループ)S0〜S4から符号データが得られる。y、yの組は、y−1=0としたビットを仮定してデータ群(グループ)S0とする。 Next, the iteration number determination unit 15 determines the number of iterations in the partial product generation unit 18 based on the value of the FF 14. The repetition number determination method of the repetition number determination unit 15 will be described. FIG. 10 is a schematic diagram illustrating 10-bit image data, and FIG. 11 is a diagram illustrating a configuration of the repetition count determination unit 15. First, as shown in FIG. 10, the image data has 10 bits y 0 to y 9 (where y 9 is a sign bit). Here, as described above, in the Booth algorithm, the image data (multiplier Y) is divided into 2 bits, and a total of 3 bits of data groups (groups) S0 to S4 of each set and the most significant bit of the lower set are used. Code data is obtained. A set of y 0 and y 1 is assumed to be a data group (group) S 0 assuming a bit with y −1 = 0.

10ビットのデータは、例えば−1は(y−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に示すように、上位ビットyからyまでは全て1であり、y−1で0となるため、変化点はデータ群S0に含まれる。この場合は、データ群S0の演算のみを行なえばよく、繰り返し回数は1回である。−2であれば、上位ビットyからyまでは全て1であり、yで0となるため、変化点はデータ群S0に含まれる。この場合も、データ群S0の演算のみを行なえばよく、繰り返し回数は1回である。また、65であれば、上位ビットyからyまでは全て0であり、yで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において、変化点が検出されてもさらに最下位ビットまで全ビットをサーチを続ける方法がある。この場合、さらにyとyの間に変化点があり、yからyはまでは0である。そして、yとyの間、yとy−1との間に変化点がある。この場合、変化点を含むデータ群は、データ群S3、S0のみである。よって繰り返し回数を2とすることができる。上述の場合は、変化点が発見された時点で繰り返し回数を決定するので早く繰り返し回数を決定することができる。一方、最上位ビットから最下位ビットまで全ビットをサーチして変化点を検出する方法であると、より繰り返し回数を減らすことができる。この場合、上位ビットから始めたが、最後まで変化点を検出する場合は下位ビットから検出してもよい。例えば−128であれば、y−1からyまでは"0"であり、yからyまでは"1"であり、yとyの間に変化点がある。この場合は、データ群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 booth decoding result 0. In this case, the processing may be performed from the upper bit side, the lower bit side, or all the bits simultaneously. For example, in the case of 127, the data groups S0 and S3 are calculation targets, and the number of repetitions is two. If it is 2, only the data group S0 is the object of calculation and the number of repetitions is 1. If it is 1, only the data group S0 is a calculation target and the number of repetitions is 1.

図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 determination units 51 to 55, respectively, and it is determined whether the data is (000) or (111). For example, if (000) or (111), 0 is output, otherwise 1 is output. The table 56 outputs the number of repetitions according to the output of the determination units 51 to 55. At this time, information on which data group is operated (hereinafter referred to as data group information) is output together.

図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 FF 61 from the upper bits. The higher order bit held in the FF 61 is compared with the next lower order input bit by the comparator 62, and for example, “0” is output if they match, and “1” is output if they do not match. The counter 63 is a down counter and counts the count value from 9 to 0. The number-of-times determination unit 64 outputs the number of repetitions to the MUXs 16 and 19 based on the counter value when “1” is input.

以上のようにして、繰り返し回数決定部15は、少なくとも繰り返し回数を出力する。また、全データ群について(000)又は(111)であるか否かを検出するような場合は、繰り返し回数と、どのデータ群で演算が必要かを示すデータ群情報とをMUX16、19へ出力する。   As described above, the repetition count determination unit 15 outputs at least the repetition count. When it is detected whether or not all data groups are (000) or (111), the number of repetitions and data group information indicating which data group needs to be calculated are output to the MUXs 16 and 19. To do.

MUX16は、繰り返し回数のみが入力される場合は、繰り返し回数に応じたデータ群を部分積生成部18へ出力する。たとえば繰り返し回数が3の場合、先ず、(y,y,0)を入力し、次のタイミングで(y,y,y)を入力し、次のタイミングで(y,y,y)を入力する。 When only the number of repetitions is input, the MUX 16 outputs a data group corresponding to the number of repetitions to the partial product generation unit 18. For example, when the number of repetitions is 3, first, (y 1 , y 0 , 0) is input, (y 3 , y 2 , y 1 ) is input at the next timing, and (y 5 , y at the next timing). 4 , y 3 ).

また、繰り返し回数とデータ群情報が入力される場合には、データ群情報に基づきデータ群を部分積生成部18へ出力する。例えば上述の65の場合であれば、データ群S0、及びS3にて変化点が検出される。この場合、最初のタイミングで(y,y,0)を入力し、次のタイミングで(y,y,y)を入力する。 When the repetition count and data group information are input, the data group is output to the partial product generator 18 based on the data group information. For example, in the case of 65 described above, change points are detected in the data groups S0 and S3. In this case, (y 1 , y 0 , 0) is input at the first timing, and (y 7 , y 6 , y 5 ) is input at the next timing.

部分積生成部18及びブースデコーダ17は、上述した演算を行なう。すなわち、ブースデコーダ17はデータ群から符号データを求め、部分積生成部が符号データにフィルタ係数Aを乗算する。ここでビットシフトは行なわず、MUX19へ出力する。   The partial product generator 18 and the booth decoder 17 perform the above-described calculation. That is, the booth decoder 17 obtains code data from the data group, and the partial product generation unit multiplies the code data by the filter coefficient A. Here, the bit shift is not performed and the data is output to the MUX 19.

MUX19にも、MUX16と同様に繰り返し回数が入力されている。したがって、繰り返し回数が1のときはビットシフトを行なわず(×1のため)そのまま加算器20へ出力する。繰り返し回数2のときは、2ビットシフト(×2のため)し、加算器20へ出力する。同様に、繰り返し回数が3のときは4ビットシフト(×2のため)、繰り返し回数が4のときは6ビットシフト(×2のため)、繰り返し回数が5のときは8ビットシフト(×2のため)して加算器20へ出力する。 Similar to the MUX 16, the number of repetitions is also input to the MUX 19. Therefore, when the number of repetitions is 1, the bit shift is not performed (because it is x1) and is output to the adder 20 as it is. When the number of repetitions 2, shifted by 2 bits (for × 2 2), and outputs to the adder 20. Similarly, (for × 2 4) repeat count 4 bit shift when the 3, (for × 2 6) repeat count 6 bit shift when the 4, 8-bit shift when the number of repetitions of 5 ( × for 2 8) and outputs to the adder 20.

また、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 adder 20 in the operation of the data group S3 at the next timing. Output to. The MUX 16, the partial product generator 18 and the MUX 19 constitute a partial product multiplier that multiplies the subtraction result from the subtracter and the filter coefficient.

加算器20は、MUX19からの出力と、FF21に保持されている前回出力した値とを加算し、繰り返し演算が終了するまで再度FF21に保存する。セレクタ22は、初回の繰り返し演算の際には0を選択し、その他はFF21の値を選択出力する。この加算器20は、各データ群S0〜S4から得られた部分積を加算すると共に、前回の加算結果に今回の加算結果を加算することで、現在の画素データのフィルタ演算結果を得ることができる。すなわち、前回の加算結果及び今回の加算結果はいずれも差分データにフィルタ係数Aを乗算した部分積和からなるため、これらを加算することで、差分データではない画素データのフィルタ演算結果を求めることができる。   The adder 20 adds the output from the MUX 19 and the previously output value held in the FF 21 and stores it again in the FF 21 until the repetition operation is completed. The selector 22 selects 0 for the first iterative calculation, and otherwise selects and outputs the value of the FF 21. The adder 20 adds the partial products obtained from the data groups S0 to S4, and adds the current addition result to the previous addition result, thereby obtaining the filter operation result of the current pixel data. it can. That is, both the previous addition result and the current addition result are composed of partial product sums obtained by multiplying the difference data by the filter coefficient A, and by adding these, the filter operation result of pixel data that is not difference data is obtained. Can do.

加算器23は、必要であれば係数Bを加算し、演算結果をリミッタ回路24へ出力する。リミッタ回路24は、例えば0〜255までの間に演算結果がおさまるよう制限してFF25に出力する。   The adder 23 adds the coefficient B if necessary, and outputs the calculation result to the limiter circuit 24. For example, the limiter circuit 24 limits the calculation result to fall within the range of 0 to 255 and outputs the result to the FF 25.

図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.

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. H.264及びVC−1の規格に準拠したフィルタ演算を含む動き補償処理を実行する動き補償(MC)部を示すブロック図である。It is a block diagram which shows the motion compensation (MC) part which performs the motion compensation process containing the filter calculation based on the specification of H.264 and VC-1. 本発明の実施の形態にかかるフィルタ演算器を示すブロック図である。It is a block diagram which shows the filter arithmetic unit concerning embodiment of this invention. 本発明の実施の形態にかかるフィルタ演算器の詳細を示すブロック図である。It is a block diagram which shows the detail of the filter arithmetic unit concerning embodiment of this invention. 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 the conventional filter calculator. 画像について水平方向の隣り合った画素間の差信号の振幅分布を示す図である。It is a figure which shows the amplitude distribution of the difference signal between the adjacent pixels of the horizontal direction about an image. 10ビットの画像データを示す模式図である。It is a schematic diagram which shows 10-bit image data. 本発明の実施の形態にかかるフィルタ演算器における繰り返し回数決定部の構成を示す図である。It is a figure which shows the structure of the repetition frequency determination part in the filter arithmetic unit concerning embodiment of this invention. (a)は、本実施の形態にかかるフィルタ演算器の演算タイミングを示す図、(b)は、図8に示す従来のフィルタ演算器の演算タイミングを示す図である。(A) is a figure which shows the calculation timing of the filter arithmetic unit concerning this Embodiment, (b) is a figure which shows the calculation timing of the conventional filter arithmetic unit shown in FIG. 特許文献1に記載の離散コサイン変換器を示す図である。It is a figure which shows the discrete cosine transformer of patent document 1. 特許文献2に記載の情報処理装置におけるプロセッサ、レジスタ回路及び係数レジスタを示す図である。FIG. 11 is a diagram illustrating a processor, a register circuit, and a coefficient register in the information processing apparatus described in Patent Document 2.

符号の説明Explanation of symbols

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 Filter operation unit 13 Subtractor 15 Number determination unit 17, 411, 421, 431, 441 Booth decoder 18, 410, 420, 430, 440 Partial product generation unit 20, 23, 30, 105, 205, 306, 308 311, 450 Adder 21, 25, 61, 454 Register 22, 301, 304, 307, 310, 313 Selector 24 Limiter circuit 41, 56 Table 51 -55 Judgment unit 62 Comparator 63 Counter 64 Count determination unit 100, 200 Image decoding apparatus 101 Compressed data 102, 202 Variable length decoding unit 103, 203 Inverse quantization unit 104 Inverse Hadamard transform unit 106 Deblocking filter 107 Switching unit 108, 207 Decoded image 109, 208 Monitor 110 In-screen prediction unit 111, 209 Weighting Prediction unit 112, 210300 Compensation unit 113 predicted image 204 inverse DCT transform unit 206 loop filter 302, 303 filter operation unit 304, 305, 312 multiplier 309 line memory 401 partial product generation unit 412, 422, 432, 442 multiplier 413, 423, 433, 443 bit shift section

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.
前記回数決定部は、前記減算結果を下位から2ビットごとに区切り、各組と下位組の最上位ビットの計3ビット毎のグループとし、各グループについて、全てのビットの値が同一か否かを判定し、当該判定結果に基づき乗算回数を決定する
ことを特徴とする請求項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.
前記回数決定部は、前記減算結果を下位から2ビットごとに区切り、各組と下位組の最上位ビットの計3ビット毎のグループとし、前記減算結果の下位ビットから上位ビットまでの全ビットについて、前記各グループ内でビットの値に変化があるか否かをサーチし、当該サーチ結果に基づき乗算回数を決定する
ことを特徴とする請求項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.
前記回数決定部は、前記乗算回数と共に、前記減算結果を下位から2ビットごとに区切り、各組と下位組の最上位ビットの計3ビット毎のグループとした場合、当該グループを構成する3ビットの値が同一でないグループが下位から何番目のグループかを示す順序情報を出力する
ことを特徴とする請求項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.
JP2006314037A 2006-11-21 2006-11-21 Filter calculator and motion compensation device Expired - Fee Related JP4963220B2 (en)

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)

* 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
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)

* Cited by examiner, † Cited by third party
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

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
JP4290608B2 (en) Image processing circuit and image processing 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