JP3733883B2 - Two-dimensional orthogonal transformation processing method and two-dimensional orthogonal transformation processing device - Google Patents

Two-dimensional orthogonal transformation processing method and two-dimensional orthogonal transformation processing device Download PDF

Info

Publication number
JP3733883B2
JP3733883B2 JP2001253482A JP2001253482A JP3733883B2 JP 3733883 B2 JP3733883 B2 JP 3733883B2 JP 2001253482 A JP2001253482 A JP 2001253482A JP 2001253482 A JP2001253482 A JP 2001253482A JP 3733883 B2 JP3733883 B2 JP 3733883B2
Authority
JP
Japan
Prior art keywords
point data
column
data
row
processing
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
JP2001253482A
Other languages
Japanese (ja)
Other versions
JP2003067362A (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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2001253482A priority Critical patent/JP3733883B2/en
Publication of JP2003067362A publication Critical patent/JP2003067362A/en
Application granted granted Critical
Publication of JP3733883B2 publication Critical patent/JP3733883B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Complex Calculations (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Description

【0001】
【産業上の利用分野】
本発明は、音情報、画像情報、映像情報などの情報圧縮、また符号化などの信号処理に用いられる2次元直交変換処理方法および2次元直交変換処理装置に関する。
【0002】
【従来の技術】
情報機器の高機能化により、情報の符号化、圧縮に欠かせない直交変換処理は、より重要度を増している。また、情報機器の汎用性の面から、また技術革新の速さへの対応のために、より汎用的なハードウェア、また、より一般的なデータ構造に対応できる直交変換処理方法が求められている。
【0003】
以下は具体的な説明のために、広く用いられている静止画符号化技術であるJPEG処理を例にとる。JPEGは、離散コサイン変換(DCT)、量子化、ランレングス符号化、ハフマン符号化などを技術要素として含む画像圧縮、符号化方法である。図17から図19はこれらを簡単に説明するためのものである。
【0004】
図17は、画像データD1からJPEG処理の単位となるデータブロックA1,A2,A3,…の切り出しを模式的に示すものである。JPEG処理は、NとMを自然数とし、8N×8Mのサイズのデータブロックに対して行われる。8N×8Mのデータブロックは、データを間引かれて、最終的に8×8のサイズとなり、JPEG処理そのものは、全て8×8のデータブロックに対して行われる。そのため、以降は8×8のデータブロックを例にして説明する。
【0005】
具体的な例として、あるデータブロックのデータが図18(a)のようなものであるとする。JPEG処理の第1ステップは、これにDCT処理を行うものである。DCT処理は直交変換の一種であり、画像データを周波数領域に変換するものである。DCT処理は数式で表現すると、
【0006】
【数1】

Figure 0003733883
【0007】
のように表される。この(1)式において、Pは画像データであり、Cは変換係数、i、jはそれぞれ横方向、縦方向の画素の位置を示す。また、m,nはそれぞれ横方向、縦方向の周波数成分を示す。また、Bは本来、符号無しデータである画素データを計算の都合上、符号有りデータへ変換するためのバイアス値である。上記の演算によって得られるSが、元画像を周波数領域へ変換したものである。
【0008】
この処理により、図18(a)のデータは、図18(b)のデータへ変換される。画像の復号時には、このデータに対し、以下に示す(2)式のような逆DCT処理を行うことにより、元のデータが復元される。
【0009】
【数2】
Figure 0003733883
【0010】
JPEG処理における次のステップは、量子化である。人間の視覚特性は周波数の低いデータに対して敏感であり、逆に周波数の高いデータに対して鈍感である。この特性を利用し、周波数の低い領域のデータをより細かなスケールで表現し、逆に周波数の高い領域のデータをより粗いスケールで表現することにより、全体としてのデータ量を削減することができる。このような操作をスカラー量子化と呼ぶ。
【0011】
仮に図18(d)のような量子化スケールを用いた場合、図18(b)のデータは、図18(c)のデータに量子化される。この図18(c)より明らかなように、零となる要素の数が増えている。
【0012】
JPEG処理における次のステップは、ランレングス符号化である。図19および図20はこれを説明するためのものである。まず最初に8×8の64個の要素は、図19(a)に示すようなジグザグスキャン順序で、図19(b)に示すような1列のデータへ並べ替えられる。これは、より最初の方に2次元的な意味での低周波側のデータがあり、後に行くほど高周波側のデータが並べられることになる。
【0013】
図20は、図18(c)のデータを並べ替えた例であり、図20(a)のデータは、図20(b)のように並べ替えられる。実際のランレングス符号化では、この並びの中の零の連鎖をさらに符号化する。たとえば、図20(c)に示すように、ある位置以降のデータが全て零である場合、その零の連鎖の全てを、一つのデータ終端記号(End Of Block、略してEOB)で置き換える。さらに、それ以外の零もそれぞれ記号に置き換えられるのであるが、本発明の要点からは離れるので省略する。
【0014】
JPEGにおける次のステップはハフマン符号化であるが、これも本発明の要点から離れるので省略する。
【0015】
ところで、JPEG全体の処理の中で、特にDCT処理は非常に大量の演算を必要とする。つまり、この部分を高速化することが、JPEG処理全体の高速化につながる。以下、DCT演算を例にとり、その高速化について説明する。
【0016】
DCT演算は前述の(1)式に示したようなものであるが、これは以下に示すような2段階の1次元処理として実行される。
【0017】
【数3】
Figure 0003733883
【0018】
【数4】
Figure 0003733883
【0019】
この計算を、より分かりやすくするために、変換係数を
【0020】
【数5】
Figure 0003733883
【0021】
とし、行列演算の形で書くと以下のような形となる。
【0022】
【数6】
Figure 0003733883
【0023】
【数7】
Figure 0003733883
【0024】
これは模式的に書くと、図21(a),(b)のように、行方向の演算処理と列方向の演算処理(処理方向それぞれ矢印で示す)を、行または列のいずれかから順次実行すると言うことである。ここで重要であるのは、(3)式と(4)式の実行順序についての自由度があると言うことである。原理的に言えば、演算が有限精度で行われることによる誤差を除き、最終的な結果は、この実行順序に依存しない。
【0025】
DCT演算の高速化は、このような行列演算を高速化することと同等になる。このような高速化において、従来例において用いられる方法は以下のようなものがある。
【0026】
特開平4−70060において用いられている手法は、データブロック内の全てのデータが零の時、そのDCT演算をスキップするというものである。
【0027】
上の式から明らかであるように、このような条件では、演算結果は全て零になるので、演算を省略することが可能である。このような条件は、特にプログレッシブ型と呼ばれる時に成立する可能性が高い。
【0028】
特開平4−137975において用いられている手法は、4並列演算が可能なハードウェアにおいて、その4要素が零の時に演算をスキップすると言うようなものである。
【0029】
DCT演算で用いられるデータの精度は16ビットであることが多く、64ビットの演算レジスタをもつハードウェアにおいては、4つのデータを同時に処理することができる。この並列演算により処理を高速化し、さらに、結果が自明であるデータが全て零の時に演算を省略することにより、より高速化を行うものである。この手法は特開平4−200079においても述べられている。
【0030】
また、特開平4−220081において用いられている手法は、上述の特開平4−70060と類似した手法であるが、データブロック内のデータが直流成分、つまり、(0、0)要素のみの場合に対応したものである。このとき、DCT演算結果は、全てのデータが同じ値となり、1つのデータの演算を行うだけで、演算結果を得ることができる。
【0031】
また、特開平10−63646で用いられている手法は、データの状態に対応した複数の演算手段を持ち、EOBの位置により、それらの演算手段の内から最適なものを選択することにより演算を高速化するものである。
【0032】
図22はこれを簡単に説明するものである。図22(a)に示す位置にEOBが現れたと仮定すると、先に説明したように、それ以降のデータは全て零である。逆に、それ以前のデータは零ではない可能性が高い。つまり、零ではないデータの位置を塗りつぶし、零であるデータの位置を塗りつぶさないで表示すると、ある点にEOBが現れた場合の零、非零のデータの分布は、図22(b)のようなものである可能性が高い。このデータの偏りに対応する演算手段を複数用意し、最も適切な演算手段を選択することにより、DCT演算を高速化することができる。
【0033】
特開平10−322699は、上述の例と類似した考え方であるが、予めデータ領域を2つの領域に分割し、データが零ではない可能性が高い低周波領域においては常に高速DCTアルゴリズムを用いた演算を行い、それ以外の領域では通常のDCTを行うものである。これは図23(a)に示すように、たとえば、データ領域を4つに分割し、左上の領域Z1は常にデータがあると仮定し、それ以外の領域は、個別に零、非零の判断と処理を行うものである。
【0034】
これは、処理をある程度固定することにより、先の従来例で必要であった条件判断のための負荷を軽減するものである。
【0035】
特開平11−41601は、以上で説明した4並列演算、複数の演算手段、またEOBの位置による条件判断の全てを用いるものである。
【0036】
【発明が解決しようとする課題】
先に述べたような従来例は、それぞれ有効なものであるが、以下に述べるような課題は残る。
【0037】
特開平4−70060および特開平4−220081に述べられているのは、データが特殊な状態である場合のみの高速化であり、より一般的な条件での有効性は劣る。
【0038】
特開平4−137975および特開平4−200079に述べられているような4並列演算ハードウェアを基本とするものは、4個のデータの整列、分解の負荷、また、4個のデータが零か非零かの判断の負荷が大きい。また、4並列演算処理の効果は非常に大きなものであるが、このような機能を持つハードウェア以外においては有効なものではない。
【0039】
具体的な例として、図24(a)のようなデータを仮定する。図中の塗りつぶした部分が非零要素であるとする。この場合、4並列演算を用いると、図24(b)の塗りつぶした位置の要素につき演算を行う必要がある。勿論、並列演算の効果により、演算処理時間の増大は少ないと考えられるが、同時に、単純な処理に比較した処理の高速化の効果もない。また、データの零、非零の判断、及び、データの整列、分解の処理が付加的に必要となる。
【0040】
特開平10−63646、および、特開平10−322699は複数の演算手段を持つものであり、処理の複雑さが増す。またEOBによる条件判断は、必ずしも有効なものではない。たとえば、上と同じ図25(a)のようなデータを仮定する。そうすると、EOBによる判断は、図25(b)のようなデータを仮定することになり、非常に冗長な演算を行う必要がでてくる。特開平11−41601も以上と同様である。
【0041】
以上のように従来例における直交変換処理の高速化手法は、特殊なデータの場合のみへ対応したものであり、また、特定のハードウェア構造を仮定したものである。また、一部は非常に複雑な構造を必要とするものである。
【0042】
本発明は、以上の課題を解決し、特殊なハードウェアを仮定せず、また、一般のデータへも適用可能なものとする2次元直交変換処理方法および2次元直交変換処理装置を提供することを目的としている。
【0043】
【課題を解決するための手段】
上述した目的を達成するため、本発明の2次元直交変換方法は、N×N要素のデータブロックにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第1の行開始点データとして記憶するとともに、処理方向の最も後方に存在する非零要素の位置を第1の行終了点データとして記憶し、かつ、各列ごとに、処理方向の最も手前に存在する非零要素の位置を第1の列開始点データとして記憶するともに、処理方向の最も後方に存在する非零要素の位置を第1の列終了点データとして記憶し、 前記第1の行開始点データと前記第1の行終了点データ間のみのデータ及び前記第1の列開始点データと前記第1の列終了点データ間のみのデータを用いて、行方向または列方向のいずれかの方向の積和演算を行う第1の処理と、前記第1の処理後に、前記第1の処理で行われていない方向の積和演算を行う第2の処理とを行う2次元直交換処理方法であって、前記第1の処理は、前記N×N要素のデータブロックにおける全ての要素が零である行または列の数を比較し、当該比較の結果、数の多い方向の積和演算を行い、前記全ての要素が零である行または列の数が同数である場合には、前記N×N要素のデータブロックにおける前記行開始点データと当該行開始点データに対応する行終了点データとの差の総和と、前記列開始点データと当該列開始点データに対応する列終了点データとの差の総和とを比較し、当該比較の結果、総和の少ない方向の積和演算を行うようにしている。
【0044】
この2次元直交変換方法において、前記第1の処理後に、前記第1の処理後のデータにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第2の行開始点データとして記憶するとともに、処理方向の最も後方に存在する非零要素の位置を第2の行終了点データとして記憶し、かつ、各列ごとに、処理方向の最も手前に存在する非零要素の位置を第2の列開始点データとして記憶するともに、処理方向の最も後方に存在する非零要素の位置を第2の列終了点データとして記憶し、前記第2の行開始点データと前記第2の行終了点データ間のみのデータ及び前記第2の列開始点データと前記第2の列終了点データ間のみのデータを用いて、前記第2の処理を行うようにしている。
【0047】
また、本発明の2次元直交変換処理装置は、N×N要素のデータブロックごとにデータ変換処理を行う2次元直交変換処理2次元直交変換処理装置であって、処理対象となるN×Nのデータブロックを記憶するデータ記憶手段と、前記データ記憶手段に記憶されたN×Nのデータブロックにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第1の行開始点データとして記憶する行開始点データ記憶手段と、処理方向の最も後方に存在する非零要素の位置を第1の行終了点データとして記憶する行終了点データ記憶手段と、前記N×Nのデータブロックにおける各列ごとに、処理方向の最も手前に存在する非零要素の位置を第1の列開始点データとして記憶する列開始点データ記憶手段と、当該列における処理方向の最も後方に存在する非零要素の位置を第1の列終了点データとして記憶する列終了点データ記憶手段と、前記第1の行開始点データと前記第1の行終了点データとの間のみのデータ及び前記列開始点データと前記列終了点データ記憶手段との間のみのデータを用いて、行方向または列方向のいずれかの積和演算を行う第1の積和演算手段と、前記第1の積和演算手段による積和演算の後、前記第1の積和演算手段による積和演算で行われていない方向の積和演算を行う第2の積和演算手段と、
を有し、前記第1の積和演算手段は、前記N×N要素のデータブロックにおける全ての要素が零である行または列のうち、数の多い方向の積和演算を行い、前記全ての要素が零である行または列の数が同数である場合には、前記N×N要素のデータブロックにおける前記行開始点データと当該行開始点データに対応する行終了点データとの差の総和と、前記列開始点データと当該列開始点データに対応する列終了点データとの差の総和のうち、少ない方向の積和演算を行うようにしている。
【0048】
この2次元直交変換処理装置において、前記第1の積和演算手段の積和演算後のデータにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第2の行開始点データとして記憶する行開始点データ記憶手段と、処理方向の最も後方に存在する非零要素の位置を第2の行終了点データとして記憶する行終了点データ記憶手段と、 前記第1の積和演算手段の積和演算後のデータにおける各列ごとに、処理方向の最も手前に存在する非零要素の位置を第2の列開始点データとして記憶する列開始点データ記憶手段と、処理方向の最も後方に存在する非零要素の位置を第2の列終了点データとして記憶する列終了点記憶手段と、を有し、前記第2の積和演算手段は、前記第2の行開始点データと前記第2の行終了点データ間のみのデータ及び前記第2の列開始点データと前記第2の列終了点データ間のみのデータを用いて、前記第1の積和演算手段による積和演算で行われていない方向の積和演算を行うようにしている。
【0051】
このように本発明は、行開始点データと行終了点データ間のみのデータ及び列開始点データと列終了点データ間のみのデータを用いて積和演算を行うようにしているので、非常に簡単な処理で積和演算を簡略化することができ、高速な直交変換処理が可能となる。また、積和演算を行うべき範囲を適正に設定することできることから、高精度な直交変換処理が可能となる。
【0053】
また、N×N要素のデータブロックにおける全ての要素が零である行または列の数を判断するだけで第1の処理の積和演算を行う方向を決定できる場合もある。この場合、行側の方が多ければ行方向から演算実行を行い、列側の方が多ければ列方向から演算実行を行うといった簡単な処理で演算実行順序を決定することができ、それによって、最小回数で効率よく演算を行うことができる。
【0054】
なお、この処理において、全ての要素が零である行または列の数が同数である場合には、N×N要素のデータブロックにおける行開始点データと当該行開始点データに対応する行終了点データとの差の総和と、列開始点データと当該列開始点データに対応する列終了点データとの差の総和を求めることで決定できるので、これによっても、比較的簡単な処理で演算実行順序を決定することができる。
【0055】
また、第1の処理後に、第1の処理後のデータにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第2の行開始点データとして記憶するとともに、処理方向の最も後方に存在する非零要素の位置を第2の行終了点データとして記憶し、かつ、各列ごとに、処理方向の最も手前に存在する非零要素の位置を第2の列開始点データとして記憶するともに、処理方向の最も後方に存在する非零要素の位置を第2の列終了点データとして記憶し、前記第2の行開始点データと前記第2の行終了点データ間のみのデータ及び前記第2の列開始点データと前記第2の列終了点データ間のみのデータを用いて、前記第2の処理を行うようにしているので、行方向および列方向のそれぞれについての積和演算処理を簡略化することができ、それによって、直交変換処理全体をより一層高速化することが可能となる。
【0056】
【発明の実施の形態】
以下、本発明の実施の形態について説明する。なお、この実施の形態で説明する内容は、本発明の2次元直交変換処理方法および2次元直交変換装置についての説明である。
【0057】
また、本発明は特定の直交変換に依存するものではないが、この実施の形態では具体的な説明のために、広く用いられている静止画符号化技術であるJPEG処理を例にとる。
【0058】
図1は本発明の基本的な2次元直交変換処理装置の概略的な構成を示すもので、処理対象となるN×N(8×8)のデータブロックを記録するデータ記録手段1、このデータ記憶手段1に記憶されている8×8のデータブロックの各行ごとに、その行における処理方向の最も手前(図1においては最も左側)に存在する非零要素の位置を行開始点データとして記憶する行開始点データ記憶手段Cs、当該行における処理方向の最も後方(図1においては最も右側)に存在する非零要素の位置を行終了点データとして記憶する行終了点データ記憶手段Ce、同じく、各列ごとに、その列における処理方向の最も手前(図1においては最も上側)に存在する非零要素の位置を列開始点データとして記憶する列開始点データ記憶手段Rs、当該列における処理方向の最も後方(図1においては最も下側)に存在する非零要素の位置を列終了点データとして記憶する列終了点データ記憶手段Re、これらデータ記録手段1、行開始点データ記憶手段Cs、行終了点データ記憶手段Ce、列開始点データ記憶手段Rs、列終了点データ記憶手段Reに存在するデータを選択して取得するデータ選択手段2、積和演算を行うための変数や係数を記憶する変換係数記憶手段3、データ選択手段2で選択されたデータに基づき、変数係数記憶手段3の変数や係数を用いて本発明の規則に基く積和演算を行う積和演算手段4を有した構成となっている。
【0059】
また、図2は図1の構成において、行開始点データ記憶手段Cs、行終了点データ記憶手段Ce、列開始点データ記憶手段Rs、列終了点データ記憶手段Reをそれぞれ2組持つ例であり、この場合、行開始点データ記憶手段Csは行開始点データ記憶手段Cs1,Cs2と表し、行終了点データを記憶する行終了点データ記憶手段Ceは行終了点データ記憶手段Ce1,Ce2と表し、列開始点データ記憶手段Rsは列開始点データ記憶手段Rs1,Rs2と表し、列終了点データ記憶手段Rは列終了点データ記憶手段Re1,Re2と表している。
【0060】
また、図3は本発明による2次元直交変換処理の全体的な流れを示したものであり、その処理の流れを大まかに説明すれば、データ端点処理を含む復号処理を行い(ステップs1)、そのあと、行と列のいずれかから演算を実行するかの実行順序の優先度の判定を行う(ステップs2)。そして、端点処理を含む行または列の直交変換処理を行って(ステップs3)、残る行または列の直交変換処理を行う(ステップs4)。
【0061】
このステップs1からs4の処理について、以下、適宜補足しながら、本発明を詳細に説明する。まず、ステップs1におけるデータ端点処理を含む復号処理について説明する。JPEG復号処理の最初の処理は、ハフマン復号と、ランレングス復号によるゼロの復元と、ジグザグスキャンの並び変えである。本発明によるこの処理は、図4および図5に示すように行われる。
【0062】
図4はこのデータ端点処理を含む復号処理の処理手順を説明する図であり、まず、図1に示した行開始点データ記憶手段Cs、行終了点データ記憶手段Ce、列開始点データ記憶手段Rs、列終了点データ記憶手段Reのそれぞれの開始点データと終了点データが初期化される(ステップs11)。
【0063】
この初期化というのは、図1におけるデータ記憶手段1に記憶された8×8のデータブロックにおける最も左上のデータ位置を1と考えるのであれば、行および列の開始点データと終了点データの初期データとしては、例えば、0を書き込むことであり、また、最も左上のデータ位置を0と考えるのであれば、行および列の開始点データと終了点データの初期データとしては、例えば、−1を書き込むことである。
【0064】
なお、この実施の形態では、8×8のデータブロックにおける最も左上のデータ位置を1とするものとし、したがって、初期化によって、行開始点データ記憶手段Cs、行終了点データ記憶手段Ce、列開始点データ記憶手段Rs、列終了点データ記憶手段Reのそれぞれの開始点データと終了点データにはそれぞれ0が書き込まれるものとする。
【0065】
図5(a)は行開始点データ記憶手段Cs、行終了点データ記憶手段Ce、列開始点データ記憶手段Rs、列終了点データ記憶手段Reのそれぞれに、初期データとして0が書き込まれた状態が示されている。なお、図5において、8×8のデータブロックの行方向の辺と列方向の辺にそれぞれ付された1,2,3,…,8の符号は行および列方向における位置を示している。
【0066】
その後、復号処理が進行し、図5(b)のような状態になったとする。ここで、塗りつぶされた要素は非零要素であり、塗りつぶされていない要素は零要素であるとする。このような状況になると、非零要素の存在する行や列において、行開始点データ記憶手段Cs、行終了点データ記憶手段Ce、列開始点データ記憶手段Rs、列終了点データ記憶手段Reのそれぞれに開始点データと終了点データが書き込まれる。
【0067】
たとえば、幾つか例を取って説明すれば、この時点での1行目の行開始点データは1、行終了点データは8であり、2行目の行開始点データは1、行終了点データは6である。また、列方向についてみれば、1列目の列開始点データは1、列終了点データは3であり、5列目の列開始点データは1、列終了点データは4である。
【0068】
さらに復号が進み、図5(c)の黒丸で示した要素が非零となったと仮定する。そうすると、図4に示した処理手順にしたがって、行および列それぞれの開始点データと終了点データが図5(c)のように更新される。
【0069】
以上の処理を図4により説明すると、図4の処理手順において、まず最初に、行および列のそれぞれの開始点データと終了点データの初期化(ステップs11)が終わったあと、処理対象となるデータブロックについての処理が終了したか否かを判断し(ステップs12)、そのデータブロックについての処理が終了していなければ、次のデータを読み込んで復号する処理を行い(ステップs13)、その復号されたデータが零であるか否かを判断する処理を行う(ステップs14)。
【0070】
そして、復号されたデータが零でなければ、ステップs15〜s20の処理(このステップs15〜s20の処理をここではデータ端点処理と呼ぶ)が行われる。このデータ端点処理は、行開始点データ記憶手段Cs、行終了点データ記憶手段Ce、列開始点データ記憶手段Rs、列終了点データ記憶手段Reのそれぞれの開始点データと終了点データを書き込む(更新する)動作であり、たとえば、図5(a)から(b)さらに(c)へというような処理である。このデータ端点処理について、図5(c)の黒丸を付した部分を例にとって説明する。
【0071】
この図5(c)の例は、図5(b)の状態以降の復号処理により、黒丸で示した位置が零で無かったということであり、この場合、図4におけるステップs15に入る。このステップs15では、その行の開始点データが零であるか否かを見て、行の開始点データが零である場合には、その行の開始点データを更新する(ステップs16)。
【0072】
つまり、この図5(c)の例では、それまでその位置の行開始点データは零であったので、ステップs16に進み、行開始点データの更新がなされる。この場合、その行開始位置は図示の左から5番目であるので、更新後の行開始点データは5となり、図5(c)に示すように行開始点データ記憶部Csに5が書き込まれる。続いて、行の行終了点データの更新が行われるが(ステップs17)、この場合、行終了点データも5となる。
【0073】
次に、列の列開始点データが零であるか否かを見て(ステップ18)、列の列開始点データが零である場合には、その列の列開始点データを更新する(ステップs19)。この図5(c)の例では、その5列目の列開始点データは零でないので、列の列開始点データの更新は行わずに、列の列終了点データのみの更新が行われる(ステップs20)。つまり、この場合、その列の列開始点データは1のままであるが、図5(c)に示すように列終了点データ記憶部Reが6に更新される。
【0074】
以上説明した図4の一連の処理手順で重要であるのは、この図4からもわかるように、ランレングス復号化は非零要素に注目した復号化であり、零要素に関しては、付加的な処理が何ら発生していないことである。つまり、従来例において見られたように、零要素、非零要素の判断は本発明では不要であるということである。
【0075】
以上のような処理を繰り返し行うことによって、処理対象となる8×8のデータブロックについてデータ端点処理を含む復号処理が終了する。これによって、図1に示したデータ記憶手段1には復号化された非零要素のデータが書き込まれるとともに、行開始点データ記憶手段Cs、行終了点データ記憶手段Ce、列開始点データ記憶手段Rs、列終了点データ記憶手段Reには、それぞれの行および列において、非零要素の開始点データと終了点データが書き込まれる。
【0076】
つまり、行開始点データ記憶手段Csには、その行に含まれる最も左側の非零要素の位置が行開始点データとして書き込まれ、行終了点データ記憶手段Csには、その行に含まれる最も右側の非零要素の位置が行終了点データとして書き込まれる。また、列開始点データ記憶手段Rsには、その列に含まれる最も上側の非零要素の位置が列開始点データとして書き込まれ、列終了点データ記憶手段Rsには、その列に含まれる最も下側の非零要素の位置が列終了点データとして書き込まれる。
【0077】
ここで、図3に示す全体的な処理の流れにおいて、ステップs1におけるデータ端点処理を含む復号処理の後に続く処理は、行と列における演算実行順序の優先度の判定である(ステップs2)。前述したように、2次元直交変換においては、行側の処理と列側の処理の実行順序には自由度がある。しかし、全体の計算量は、この順序に依存して変化する。その模式的な例を図6と図7に示す。
【0078】
図6(a)も図7(a)も同じデータを示し、ある行のみに非零要素(塗りつぶされている)を含むものであり、この例では3行目の1行がすべて非零である場合を示している。図6(b)はそれを行側から処理(矢印にて示す)を行う場合を示しており、また、図7(b)は列側から処理(矢印にて示す)を行う場合を示している。
【0079】
その処理の結果、中間状態として作られたデータの零、非零の状態を示したのが、図6(c)および図7(c)であり、この図6(c)および図7(c)からも明らかであるように、図6(c)は3行目の1行分のみが非零であり、その他が全て零であるのに対し、図7(c)では、8×8のデータブロック全ての要素が非零となる。
【0080】
つまり、図6(d)および図7(d)に示すような2段目の処理(この例では、図6の場合は1段目の処理が行方向処理であるので2段目の処理としては列方向処理、図7の場合は逆に1段目の処理が列方向処理であるので2段目の処理としては行方向処理)においては、図6と図7とでは非常に大きな計算量の差が発生することになる。
【0081】
そこで、本発明においては、図8に示すような行と列の演算実行順序の優先度の判定処理を行う。この図8のような行と列の演算実行順序の優先度の判定処理を行なうことによって、全体の計算量を小さくすることができる。
【0082】
なお、図6および図7の例においては、この図8における最初の段階の判断、つまり、ステップ23までの判断で演算実行順序の優先度が決定する。このステップs23までの処理は、まず、全ての要素が零である行の数をNC、全ての要素が零である列の数をNRとし(ステップs21)、NC>NRであれば、行側から処理を行ない、NC<NRであれば、列側から処理を行うというものである(ステップs22〜s25)。
【0083】
また、NC>NRでもなく、NC<NRでもない場合、つまり、全ての要素が零である行の数NCと全ての要素が零である列の数NRが同数である場合は、(終了点)−(開始点)の総和を求め、それを行についてはSCとし、列についてはSRとする(ステップs26)。なお、この(終了点)−(開始点)の総和は、
行方向においてはそれぞれの行開始点データとそれに対応するそれぞれの行終了点データの差の総和であって、それをSCとし、列方向においてはそれぞれの列開始点データとそれに対応するそれぞれの列終了点データの差の総和であって、それをSRとする。そして、SC>SRを判断し、SC>SRであれば、列側から処理を開始し(ステップs25)、SC>SRでなければ、行側から処理を開始する(ステップs24)。
【0084】
たとえば、図6および図7においては、全要素が零である行の数は7であり、全要素が零である列の数は0であるので、この図6および図7の場合、上述したように、図8におけるステップ23までの判断で演算実行順序の優先度が決定し、この場合、行の処理が優先される。
【0085】
また、図9および図10の場合は、より詳細な判断が必要であり、この場合は、図8の処理において、ステップs26以降の処理が必要となる。ここでは、行および列の双方において、それぞれ(終了点)−(開始点)の総和が求められ、求められた総和をSCとSRとする。
【0086】
これは単純に言って、積和演算処理の和の数に対応する。図9および図10の例では、行における(終了点)−(開始点)の総和SCは10となり、列における(終了点)−(開始点)の総和SRは13となり、図8ステップs27の判断によって、行の処理が優先されることになる。つまり、行を優先した方が演算量は少なく、この場合は、和の数が3だけ少なくなる。
【0087】
以上のような処理によって、行と列における演算実行順序の優先度が判定される。そして、その後の処理は、図3によれば、データ端点処理を含む行または列の直交変換処理を行うことになる。この処理の具体的な内容を図11に示す。
【0088】
この図11の処理では、ステップs31の処理として、2組目の行、列の開始点データと終了点データを初期化するという処理が存在するが、これは、図2の構成図で示したように、2組の行開始点データ記憶手段Cs1,Cs2と2組の行終了点データ記憶手段Ce1,Ce2、さらに、2組の列開始点データ記憶手段Rs1,Rs2と2組の列終了点データ記憶手段Re1,Re2を用意した場合に、2組目の行開始点データ記憶手段Cs2と行終了点データ記憶手段Ce2、列開始点データ記憶手段Rs2と列終了点データ記憶手段Re2をそれぞれ初期化するということである。この初期化処理は図4のステップs11で説明したと同じに考えればよい。
【0089】
また、この図11の処理の流れは全体的には、図4の処理と同じであるが、ステップs33の1つの行または列の直交変換処理が含まれている点が異なる。このステップs33の1つの行または列の直交変換処理の具体的な内容を図12に示す。
【0090】
この図12において、指定された行または列の開始点データ(これをPsとする)と終了点データ(これをPeとする)を読み込む(ステップs41)。そして、Psが零、かつ、Peも零かを判定し(ステップs42)、Psが零、かつ、Peも零であれば0を返値とする(ステップs43)。また、Psが零、かつ、Peも零でなければ、Psを開始位置、Peを終了位置とする(Pe−Ps+1)回の積和を行い、その結果であるSumを返値とする(ステップs44)。
【0091】
この図12からもわかるように、この1つの行または列の1次元の直交変換処理においては、その全ての要素が零である場合(Psが零、かつ、Peも零である場合)には、積和演算処理が完全に省略される。これにより、本発明においても従来例である特開平4−70060と同等の効果が得られる。また、上記以外の場合、(Psが零、かつ、Peも零でない場合)は、その非零要素の開始位置と終了位置の間のみにおいて積和演算が行われる。
【0092】
この効果を、図13と従来技術の説明で用いた図24、図25を参照して、従来例との比較で説明する。この図13、図24、図25におけるそれぞれ(a)の図が元データであり、これらの元データはどれも同じデータであるとする。また、これら図13、図24、図25における(b)の塗りつぶした部分が積和演算の対象となる領域である。
【0093】
図24は、従来例における行方向の4並列演算を行う場合を仮定したものである。この場合、図24(b)に黒く塗りつぶした位置のデータについての積和演算が必要となる。この図24からもわかるように4並列演算を行う場合は、図24(a)に示す元データに比較して、かなり多くのデータが積和演算の対象となる。
図25はEOBによる判断を行った場合の例であり、この場合も図25(a)に示す元データに比較して非常に多くのデータが積和演算の対象となることがわかる。
【0094】
これに対して、図13は本発明の処理を、行方向について行った場合であり、図13(b)に示すように、積和演算処理の対象となるデータは、図24(b)や図25(b)の従来例に比較してかなり少なくなっていることがわかる。
【0095】
また、図14は本発明の処理を、列方向について行ったものであり、この場合も、図13と同様に積和演算処理の対象となるデータは、図24(b)や図25(b)の従来例に比較してかなり少なくなっていることがわかる。
【0096】
また、この図13の例について、前述した本発明の行、列における演算実行順序の優先度判定処理(図8参照)を行うと、この場合は、図8のステップs26以降の処理によって、図13の行方向の処理が優先される。実際、このデータにおいては、図13の処理の方が図14に比べて、積和演算処理の回数が1つだけ少ない。
【0097】
以上のように、本発明の方法は、従来例に比較して非常に少ない処理で1段目(行または列のいずれか)の直交変換処理を行うことができる。
【0098】
以上説明した図12の処理(1つの行または列の直交変換処理)は、図11のステップs33の処理であり、この図12の処理が終了すると、図11において、ステップs34以降のデータ端点処理を行う。この場合、2組の行開始点データ記憶手段Cs1,Cs2と2組の行終了点データ記憶手段Ce1,Ce2、2組の列開始点データ記憶手段Rs1,Rs2と2組の列終了点データ記憶手段Re1,Re2が用意されているので、ここでのデータ端点処理は2組目の行開始点データ記憶手段Cs2、行終了点データ記憶手段Ce2、列開始点データ記憶手段Rs2、列終了点データ記憶手段Re2についての端点処理である。この端点処理は図4のステップs14以降の処理と同じである。
【0099】
このように、ある1つの行プまたは列の直交変換処理が終了した段階でもデータ端点処理が行われるが、この段階におけるデータ端点処理が有効である理由を図15により次に説明する。
【0100】
従来においても、本発明においても、零であるデータの処理を省略することにより高速化を行っているのであるが、同様の条件は1段目の処理後のデータにおいても発生する。たとえば、図15(a)のように、全ての要素が同じ値であるデータが存在するものとする。このようなデータについて、1段目の処理後の状態は、図15(b)に示すように、ある一つの列のみが、非零のデータとなり、それ以外は全て零となる。つまり、このように1段目の処理のよって得られたデータにおいても、これまで説明したようなデータ端点処理を行えば、積和演算回数をより削減することができる。
【0101】
これまでの説明によって、図3のステップs3までが終了したことになる。この 図3に示した最後の処理は、残る行または列の直交変換処理(ステップs4)であり、これは、単に、行または列についての直交変換処理である。これは単純に図16に示すように、データブロックの終わりか否かの判断(ステップs51)と、1つの行または列の直交変換処理な処理(ステップs52)を行うことで実現される。
【0102】
なお、本発明は以上説明した実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲で種々変形実施可能となるものである。
【0103】
また、本発明は、以上説明した本発明を実現するための処理手順が記述された処理プログラムを作成し、その処理プログラムをフロッピィディスク、光ディスク、ハードディスクなどの記録媒体に記録させておくことができ、本発明はその処理プログラムが記録された記録媒体をも含むものである。また、ネットワークから当該処理プログラムを得るようにしてもよい。
【0104】
以上で説明したように本発明によれば、N×Nのデータブロックにおける各行ごとに、その行における処理走査方向最も手前に存在する非零要素の位置を行開始点データ、その行における処理走査方向最も後方に存在する非零要素の位置を行終了点データとして記憶するとともに、各列ごとに、その列における処理走査方向最も手前に存在する非零要素の位置を列開始点データ、その列における処理走査方向最も後方に存在する非零要素の位置を列終了点データとして記憶し、それぞれの行においてはその行の開始点データと終了点データ間のみにおいて積和演算を行い、それぞれの列においてはその列の開始点データと終了点データ間のみにおいて積和演算を行うようにしているので、非常に簡単な処理で積和演算を簡略化することができ、また、積和すべき範囲を適正に判断することができることから高精度な直交変換処理が可能となる。
【0105】
また、この積和演算を行う際、その演算実行順序を行方向から行うか列方向から行うかを、N×Nのデータブロックにおけるデータ内容に基づき積和回数の数を考慮して決定するようにしている。このように、演算実行順序をN×Nのデータブロックにおけるデータ内容によって、行または列のいずれかに決めることで、積和演算を効率よく行うことができる。
【0106】
また、本発明においては、特別のハードウェアやデータを仮定するするものではなく、一般のデータに対し、汎用のCPUやDSPでの処理が可能なものである。
【図面の簡単な説明】
【図1】本発明の2次元直交変換装置の概略的な構成図である。
【図2】図1の構成において、行開始点データ記憶手段および行終了点データ記憶手段、列開始点データ記憶手段および列終了点データ記憶手段をそれぞれ2組有した場合の構成図である。
【図3】本発明の2次元直交変換処理の全体的な処理手順を説明するフローチャートである。
【図4】図3のフローチャートにおけるデータ端点処理を含む復号処理を説明するフローチャートである。
【図5】図3のフローチャートにおけるデータ端点処理を説明する図である。
【図6】ある行のみに零要素を含むデータブロックに対し、行方向に処理を行なう場合の計算量についてを模式的に説明する図であり、全ての要素が零である行と列の数のみで行方向からの処理を行なうか列方向からの処理を行なうかを判断する例を示す図である。
【図7】ある行のみに零要素を含むデータブロックに対し、列方向に処理を行なう場合の計算量についてを模式的に説明する図であり、全ての要素が零である行および列の数のみで行方向からの処理を行なうか列方向からの処理を行なうかを判断する例を示す図である。
【図8】図3のフローチャートにおける行と列の処理の優先度の判定処理を説明するフローチャートである。
【図9】複数の行や列に渡って複数の零要素を含むデータブロックに対し、行方向に処理を行なう場合の計算量についてを模式的に説明する図であり、図8のフローチャートにおける(終了点)−(開始点)の総和を行と列それぞれについて求め、その総和の大きさの比較に基づいて行方向からの処理を行なうか列方向からの処理を行なうかを判断する例を示す図である。
【図10】複数の行や列に渡って複数の零要素を含むデータブロックに対し、列方向に処理を行なう場合の計算量についてを模式的に説明する図であり、図8のフローチャートにおける(終了点)−(開始点)の総和を行と列それぞれについて求め、その総和の大きさの比較に基づいて列方向からの処理を行なうか列方向からの処理を行なうかを判断する例を示す図である。
【図11】図3のフローチャートにおけるデータ端点処理を含む行または列の直交変換処理を説明するフローチャートである。
【図12】図11おける1つの行又は列の直交変換処理を説明するフローチャートである。
【図13】本発明による積和演算処理の効果を行方向の処理を行なう場合について説明する図である。
【図14】本発明による積和演算処理の効果を列方向の処理を行なう場合について説明する図である。
【図15】1つの行または列の直交変換処理を終わった後にさらに端点処理を行う有効性について説明するための画像例を示す図である。
【図16】個々の行または列の直交変換処理の手順を説明するフローチャートである。
【図17】画像データから処理単位となるN×N(8×8)のデータブロックの切り出しを模式的に説明する図である。
【図18】処理単位となるN×N(8×8)のデータブロックのデータ例と、そのデータを周波数領域に変換したのち量子化する処理例を説明する図である。
【図19】ランレングス符号化処理について説明する図である。
【図20】図18(c)のデータを並べ替え、さらに、零の連鎖をEOBに置き換えた場合を示す図である。
【図21】処理単位となるN×N(8×8)のデータブロックに対する処理を行方向または列方向のいずれから行うかを説明する図である。
【図22】従来技術において、EOBの位置により最適な演算手段を選択して直交変換演算の簡略化を図る例を説明する図である。
【図23】 従来技術において、処理単位となるN×N(8×8)のデータブロックをいくつかの領域に分割して演算を行うことで直交演算の簡略化を図る例を説明する図である。
【図24】処理単位となるN×N(8×8)のデータブロックにおけるデータにおいて、従来技術の1つである4並列演算(行方向の4並列演算)により積和演算を行なう場合の問題点を説明する図である。
【図25】処理単位となるN×N(8×8)のデータブロックにおけるデータにおいて、従来技術の1つであるEOBの判断を用いて積和演算を行なう場合の問題点を説明する図である。
【符号の説明】
1 データ記録手段
2 データ選択手段
3 変換係数記憶手段
4 積和演算手段
Cs 行開始点データ記憶手段
Ce 行終了点データ記憶手段
Rs 列開始点データ記憶手段
Re 列終了点データ記憶手段[0001]
[Industrial application fields]
The present invention relates to a two-dimensional orthogonal transformation processing method and a two-dimensional orthogonal transformation processing device used for signal processing such as information compression and encoding of sound information, image information, and video information.
[0002]
[Prior art]
As the functionality of information equipment increases, orthogonal transform processing, which is indispensable for information encoding and compression, has become more important. In addition, from the viewpoint of versatility of information equipment and to cope with the speed of technological innovation, more general-purpose hardware and orthogonal transformation processing methods that can handle more general data structures are required. Yes.
[0003]
In the following, for specific explanation, JPEG processing, which is a widely used still image encoding technique, is taken as an example. JPEG is an image compression / encoding method that includes discrete cosine transform (DCT), quantization, run length encoding, Huffman encoding, and the like as technical elements. FIG. 17 to FIG. 19 are for simply explaining these.
[0004]
FIG. 17 schematically shows the extraction of data blocks A1, A2, A3,... That are units of JPEG processing from the image data D1. JPEG processing is performed on a data block having a size of 8N × 8M, where N and M are natural numbers. The 8N × 8M data block is thinned out to finally have a size of 8 × 8, and all JPEG processing itself is performed on the 8 × 8 data block. Therefore, the following description will be made taking an 8 × 8 data block as an example.
[0005]
As a specific example, assume that data of a certain data block is as shown in FIG. The first step of JPEG processing is to perform DCT processing on this. DCT processing is a type of orthogonal transform, and transforms image data into the frequency domain. The DCT process can be expressed by a mathematical formula.
[0006]
[Expression 1]
Figure 0003733883
[0007]
It is expressed as In this equation (1), P is image data, C is a conversion coefficient, and i and j are the pixel positions in the horizontal and vertical directions, respectively. M and n represent frequency components in the horizontal and vertical directions, respectively. B is a bias value for converting pixel data that is originally unsigned data into signed data for convenience of calculation. S obtained by the above calculation is obtained by converting the original image into the frequency domain.
[0008]
By this processing, the data in FIG. 18A is converted into the data in FIG. At the time of image decoding, the original data is restored by performing inverse DCT processing as shown in the following equation (2) on the data.
[0009]
[Expression 2]
Figure 0003733883
[0010]
The next step in JPEG processing is quantization. Human visual characteristics are sensitive to low frequency data, and insensitive to high frequency data. By utilizing this characteristic, data in the low frequency region can be expressed in a finer scale, and conversely, data in the high frequency region can be expressed in a coarser scale, thereby reducing the overall data volume. . Such an operation is called scalar quantization.
[0011]
If a quantization scale as shown in FIG. 18D is used, the data in FIG. 18B is quantized into the data in FIG. 18C. As apparent from FIG. 18C, the number of elements that become zero increases.
[0012]
The next step in JPEG processing is run-length encoding. 19 and 20 are for explaining this. First, the 64 elements of 8 × 8 are rearranged into one column of data as shown in FIG. 19B in the zigzag scan order as shown in FIG. This is because there is data on the low frequency side in a two-dimensional sense at the beginning, and the data on the high frequency side is arranged later.
[0013]
FIG. 20 shows an example in which the data in FIG. 18C is rearranged. The data in FIG. 20A is rearranged as shown in FIG. 20B. In actual run length encoding, the chain of zeros in this sequence is further encoded. For example, as shown in FIG. 20C, when all data after a certain position is zero, all of the zero chain is replaced with one end-of-data symbol (End Of Block, EOB for short). Further, other zeros are also replaced by symbols, but they are omitted from the point of the present invention.
[0014]
The next step in JPEG is Huffman coding, which is also omitted from the main point of the present invention.
[0015]
By the way, among the entire processing of JPEG, especially the DCT processing requires a very large amount of computation. In other words, speeding up this portion leads to speeding up the entire JPEG processing. In the following, the speeding up will be described by taking DCT calculation as an example.
[0016]
The DCT calculation is as shown in the above equation (1), but this is executed as a two-stage one-dimensional process as shown below.
[0017]
[Equation 3]
Figure 0003733883
[0018]
[Expression 4]
Figure 0003733883
[0019]
To make this calculation easier to understand, the conversion factor is
[0020]
[Equation 5]
Figure 0003733883
[0021]
When written in the form of matrix operation, the following form is obtained.
[0022]
[Formula 6]
Figure 0003733883
[0023]
[Expression 7]
Figure 0003733883
[0024]
When this is schematically written, as shown in FIGS. 21 (a) and 21 (b), row-direction arithmetic processing and column-direction arithmetic processing (respectively indicated by arrows in the processing direction) are sequentially performed from either row or column. It is to execute. What is important here is that there is a degree of freedom regarding the execution order of the expressions (3) and (4). In principle, the final result does not depend on this execution order, except for errors due to operations being performed with finite precision.
[0025]
The speeding up of the DCT operation is equivalent to speeding up such a matrix operation. In such speeding up, there are the following methods used in the conventional example.
[0026]
The technique used in Japanese Patent Laid-Open No. 4-70060 is to skip the DCT operation when all data in the data block is zero.
[0027]
As is clear from the above equation, under such conditions, the calculation results are all zero, so that the calculation can be omitted. Such a condition is highly likely to be satisfied particularly when called a progressive type.
[0028]
The method used in Japanese Patent Laid-Open No. 4-137975 is such that in hardware capable of four parallel operations, the operation is skipped when the four elements are zero.
[0029]
The accuracy of data used in DCT calculation is often 16 bits, and hardware having a 64-bit calculation register can process four data simultaneously. This parallel operation speeds up the processing, and further omits the operation when all the data whose result is self-evident is zero. This technique is also described in JP-A-4-200079.
[0030]
Further, the method used in Japanese Patent Laid-Open No. 4-220081 is a method similar to the above-mentioned Japanese Patent Laid-Open No. 4-70060, but the data in the data block is a direct current component, that is, only (0, 0) element. It corresponds to. At this time, the DCT calculation result has the same value for all the data, and the calculation result can be obtained simply by calculating one data.
[0031]
Further, the technique used in Japanese Patent Laid-Open No. 10-63646 has a plurality of calculation means corresponding to the data state, and the calculation is performed by selecting an optimum one from among the calculation means according to the position of the EOB. It will be faster.
[0032]
FIG. 22 briefly explains this. Assuming that EOB appears at the position shown in FIG. 22A, all the data after that is zero as described above. Conversely, it is highly possible that the previous data is not zero. That is, when the position of non-zero data is filled and the position of zero data is displayed without being filled, the distribution of zero and non-zero data when EOB appears at a certain point is as shown in FIG. There is a high possibility that By preparing a plurality of computing means corresponding to this data bias and selecting the most appropriate computing means, the DCT computation can be speeded up.
[0033]
Japanese Patent Laid-Open No. 10-322699 is similar in concept to the above example, but the data area is divided into two areas in advance, and the high-speed DCT algorithm is always used in the low-frequency area where the possibility that the data is not zero is high. An operation is performed, and normal DCT is performed in other areas. As shown in FIG. 23A, for example, it is assumed that the data area is divided into four, the upper left area Z1 always has data, and the other areas are individually determined to be zero or non-zero. And processing.
[0034]
This is to reduce the load for the condition determination required in the previous conventional example by fixing the processing to some extent.
[0035]
Japanese Patent Laid-Open No. 11-41601 uses all of the above-described four parallel calculations, a plurality of calculation means, and condition determination based on the position of the EOB.
[0036]
[Problems to be solved by the invention]
Each of the conventional examples as described above is effective, but the following problems remain.
[0037]
JP-A-4-70060 and JP-A-4-220081 describe speedup only when the data is in a special state, and the effectiveness under more general conditions is inferior.
[0038]
Those based on 4-parallel computing hardware as described in Japanese Patent Laid-Open Nos. 4-137975 and 4-200079 have four data alignment, decomposition loads, and whether the four data are zero. The load for judging whether it is non-zero is large. Further, although the effect of the four parallel arithmetic processing is very large, it is not effective except for hardware having such a function.
[0039]
As a specific example, data as shown in FIG. Assume that the filled portion in the figure is a non-zero element. In this case, if 4-parallel operation is used, it is necessary to perform the operation for the element at the filled position in FIG. Of course, it is considered that the increase in the computation processing time is small due to the effect of the parallel computation, but at the same time, there is no effect of speeding up the processing compared to the simple processing. In addition, it is necessary to determine whether the data is zero or non-zero, and to arrange and decompose the data.
[0040]
Japanese Patent Application Laid-Open No. 10-63646 and Japanese Patent Application Laid-Open No. 10-322699 have a plurality of calculation means, and the processing complexity increases. Also, the condition judgment by EOB is not always effective. For example, assume the same data as shown in FIG. Then, the determination by EOB assumes data as shown in FIG. 25B, and it is necessary to perform a very redundant calculation. JP-A-11-41601 is similar to the above.
[0041]
As described above, the method for speeding up the orthogonal transform processing in the conventional example is applicable only to the case of special data, and assumes a specific hardware structure. Some of them require a very complicated structure.
[0042]
The present invention provides a two-dimensional orthogonal transform processing method and a two-dimensional orthogonal transform processing apparatus that solve the above problems, do not assume special hardware, and are applicable to general data. It is an object.
[0043]
[Means for Solving the Problems]
In order to achieve the above-described object, the two-dimensional orthogonal transformation method of the present invention uses the first row start point to determine the position of the non-zero element existing in the forefront of the processing direction for each row in the N × N element data block. And storing the position of the non-zero element existing most backward in the processing direction as first row end point data, and for each column, the position of the non-zero element existing closest to the processing direction. The position is stored as the first column start point data, and the position of the non-zero element existing at the rearmost in the processing direction is stored as the first column end point data, and the first row start point data and the first row start data Using the data only between one row end point data and only the data between the first column start point data and the first column end point data, the product-sum operation in either the row direction or the column direction And a first process for performing the first A two-dimensional direct exchange processing method for performing a second process for performing a product-sum operation in a direction not performed in the first process after the process, wherein the first process includes N × N elements Compares the number of rows or columns in which all elements in the data block are zero, and performs a sum-of-product operation in the direction of the larger number as a result of the comparison, and the same number of rows or columns in which all the elements are zero The sum of the difference between the row start point data and the row end point data corresponding to the row start point data in the N × N element data block, the column start point data and the column start point The sum of differences from the column end point data corresponding to the data is compared, and as a result of the comparison, the product-sum operation is performed in the direction with the smaller sum.
[0044]
In this two-dimensional orthogonal transformation method, after the first processing, the position of the non-zero element existing in the forefront of the processing direction is used as the second row start point data for each row in the data after the first processing. And storing the position of the non-zero element existing most backward in the processing direction as second row end point data, and the position of the non-zero element existing closest to the processing direction for each column. The second column start point data is stored, and the position of the non-zero element that is present at the rearmost in the processing direction is stored as the second column end point data, and the second row start point data and the second row start point data are stored. The second process is performed using only data between the row end point data and only data between the second column start point data and the second column end point data.
[0047]
The two-dimensional orthogonal transformation processing apparatus of the present invention is a two-dimensional orthogonal transformation processing two-dimensional orthogonal transformation processing apparatus that performs data transformation processing for each data block of N × N elements, and is an N × N of processing target Data storage means for storing the data block, and the position of the non-zero element existing closest to the processing direction for each row in the N × N data block stored in the data storage means is the first row start point data A line start point data storage means for storing as a first line end point data, a line end point data storage means for storing the position of the non-zero element existing at the rearmost in the processing direction, and the N × N data block Column start point data storage means for storing, as the first column start point data, the position of the non-zero element existing closest to the processing direction for each column in the column, and the rearmost in the processing direction in the column Column end point data storage means for storing the position of an existing non-zero element as first column end point data; data between the first row start point data and the first row end point data; First product-sum operation means for performing product-sum operation in either the row direction or the column direction using data only between the column start point data and the column end point data storage means; and the first Second product-sum operation means for performing a product-sum operation in a direction not performed by the product-sum operation by the first product-sum operation means after the product-sum operation by the product-sum operation means;
The first product-sum operation means performs a product-sum operation in a direction with a larger number of rows or columns in which all elements in the N × N element data block are zero, If the number of rows or columns having zero elements is the same, the sum of the differences between the row start point data and the row end point data corresponding to the row start point data in the N × N element data block And the sum-of-products operation in the smaller direction among the sum of the differences between the column start point data and the column end point data corresponding to the column start point data.
[0048]
In this two-dimensional orthogonal transform processing apparatus, the position of the non-zero element existing closest to the processing direction is determined as the second row start point data for each row in the data after the product-sum operation of the first product-sum operation means. Line start point data storage means for storing the data, line end point data storage means for storing the position of the non-zero element that is present at the rearmost in the processing direction as second line end point data, and the first product-sum operation For each column in the data after the product-sum operation of the means, column start point data storage means for storing the position of the non-zero element existing closest to the processing direction as the second column start point data, Column end point storage means for storing the position of a non-zero element existing behind as second column end point data, and the second product-sum operation means includes the second row start point data and Data only between the second line end point data Data and the second column start point data and the data only between the second column end point data, the product-sum operation in the direction not performed by the product-sum operation by the first product-sum operation means is performed. Like to do.
[0051]
As described above, the present invention performs the product-sum operation using only the data between the row start point data and the row end point data and the data between the column start point data and the column end point data. The product-sum operation can be simplified with simple processing, and high-speed orthogonal transformation processing is possible. In addition, since the range in which the product-sum operation is to be performed can be set appropriately, highly accurate orthogonal transform processing can be performed.
[0053]
In some cases, the direction in which the product-sum operation of the first process is performed can be determined only by determining the number of rows or columns in which all the elements in the N × N element data block are zero. In this case, if there are more on the row side, the operation execution can be performed from the row direction, and if there are more on the column side, the operation execution can be determined from a simple process such as performing the operation execution from the column direction. The calculation can be performed efficiently with the minimum number of times.
[0054]
In this process, if the number of rows or columns in which all elements are zero is the same, the row start point data in the N × N element data block and the row end point corresponding to the row start point data Since it can be determined by calculating the sum of the difference between the data and the difference between the column start point data and the column end point data corresponding to the column start point data, the calculation can be executed with relatively simple processing. The order can be determined.
[0055]
In addition, after the first processing, for each row in the data after the first processing, the position of the non-zero element existing closest to the processing direction is stored as the second row start point data, and the highest in the processing direction. The position of the non-zero element existing behind is stored as the second row end point data, and the position of the non-zero element existing closest to the processing direction is used as the second column start point data for each column. In addition to storing, the position of the non-zero element existing at the rearmost in the processing direction is stored as the second column end point data, and the data is only between the second row start point data and the second row end point data. Since the second process is performed using only the data between the second column start point data and the second column end point data, the product sum in each of the row direction and the column direction is used. Arithmetic processing can be simplified, By Le, it is possible to further speed up more overall orthogonal transform processing.
[0056]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below. The contents described in this embodiment are descriptions of the two-dimensional orthogonal transformation processing method and the two-dimensional orthogonal transformation device of the present invention.
[0057]
Although the present invention does not depend on a specific orthogonal transform, in this embodiment, for the sake of specific explanation, JPEG processing, which is a widely used still image coding technique, is taken as an example.
[0058]
FIG. 1 shows a schematic configuration of a basic two-dimensional orthogonal transformation processing apparatus according to the present invention. Data recording means 1 for recording N × N (8 × 8) data blocks to be processed, and this data For each row of the 8 × 8 data block stored in the storage means 1, the position of the non-zero element existing in the foremost direction (leftmost in FIG. 1) in that row is stored as row start point data. A line start point data storage means Cs that stores the position of the non-zero element existing in the rearmost direction (rightmost in FIG. 1) in the row as line end point data; For each column, column start point data storage means Rs for storing, as column start point data, the position of the non-zero element existing in the foremost processing direction (uppermost in FIG. 1) in that column, Column end point data storage means Re for storing the position of the non-zero element existing at the rearmost in the processing direction (lowermost in FIG. 1) as column end point data, these data recording means 1, and row start point data storage Means Cs, row end point data storage means Ce, column start point data storage means Rs, data selection means 2 for selecting and acquiring data existing in the column end point data storage means Re, variables for performing product-sum operations, Based on the data selected by the conversion coefficient storage means 3 for storing the coefficients and the data selection means 2, the product-sum operation means 4 for performing the product-sum operation based on the rules of the present invention using the variables and coefficients of the variable coefficient storage means 3. It has the composition which has.
[0059]
FIG. 2 is an example having two sets of row start point data storage means Cs, row end point data storage means Ce, column start point data storage means Rs, and column end point data storage means Re in the configuration of FIG. In this case, the line start point data storage means Cs is represented as line start point data storage means Cs1, Cs2, and the line end point data storage means Ce for storing line end point data is represented as line end point data storage means Ce1, Ce2. The column start point data storage means Rs is indicated as column start point data storage means Rs1, Rs2, and the column end point data storage means R is indicated as column end point data storage means Re1, Re2.
[0060]
FIG. 3 shows the overall flow of the two-dimensional orthogonal transformation process according to the present invention. The flow of the process will be roughly described. A decoding process including a data end point process is performed (step s1). After that, the priority of the execution order as to whether to execute the operation from either the row or the column is determined (step s2). Then, the orthogonal transformation processing of the row or column including the end point processing is performed (step s3), and the orthogonal transformation processing of the remaining row or column is performed (step s4).
[0061]
Hereinafter, the present invention will be described in detail while appropriately supplementing the processes of steps s1 to s4. First, the decoding process including the data end point process in step s1 will be described. The first JPEG decoding process is Huffman decoding, zero restoration by run-length decoding, and rearrangement of zigzag scanning. This processing according to the present invention is performed as shown in FIGS.
[0062]
FIG. 4 is a diagram for explaining the processing procedure of the decoding processing including the data end point processing. First, the row start point data storage means Cs, the row end point data storage means Ce, and the column start point data storage means shown in FIG. The respective start point data and end point data of Rs and column end point data storage means Re are initialized (step s11).
[0063]
This initialization means that if the upper left data position in the 8 × 8 data block stored in the data storage means 1 in FIG. 1 is considered as 1, the start point data and end point data of the row and column As the initial data, for example, 0 is written, and if the upper left data position is considered to be 0, the initial data of the start point data and end point data of the row and column is, for example, -1. Is to write.
[0064]
In this embodiment, it is assumed that the uppermost data position in the 8 × 8 data block is 1, and therefore, by initialization, the row start point data storage unit Cs, the row end point data storage unit Ce, and the column It is assumed that 0 is written in each of the start point data and end point data of the start point data storage means Rs and the column end point data storage means Re.
[0065]
FIG. 5A shows a state in which 0 is written as initial data in each of the row start point data storage means Cs, the row end point data storage means Ce, the column start point data storage means Rs, and the column end point data storage means Re. It is shown. In FIG. 5, reference numerals 1, 2, 3,..., 8 respectively attached to the side in the row direction and the side in the column direction of the 8 × 8 data block indicate positions in the row and column directions.
[0066]
Thereafter, it is assumed that the decoding process proceeds and the state shown in FIG. Here, it is assumed that the filled elements are non-zero elements, and the unfilled elements are zero elements. In such a situation, the row start point data storage means Cs, the row end point data storage means Ce, the column start point data storage means Rs, and the column end point data storage means Re in the row or column where the non-zero element exists. Start point data and end point data are written to each.
[0067]
For example, taking some examples, the line start point data of the first line at this point is 1, the line end point data is 8, the line start point data of the second line is 1, and the line end point The data is 6. In the column direction, the column start point data of the first column is 1, the column end point data is 3, the column start point data of the fifth column is 1, and the column end point data is 4.
[0068]
Assume that decoding further proceeds and the elements indicated by black circles in FIG. 5C become non-zero. Then, the start point data and end point data of each row and column are updated as shown in FIG. 5C according to the processing procedure shown in FIG.
[0069]
The above processing will be described with reference to FIG. 4. In the processing procedure of FIG. 4, first, after the start point data and the end point data of each row and column are initialized (step s11), they are processed. It is determined whether or not the process for the data block has been completed (step s12). If the process for the data block has not been completed, the next data is read and decoded (step s13). Processing is performed to determine whether or not the obtained data is zero (step s14).
[0070]
If the decoded data is not zero, steps s15 to s20 (the steps s15 to s20 are referred to as data end point processing) are performed. In this data end point processing, the respective start point data and end point data of the row start point data storage means Cs, the row end point data storage means Ce, the column start point data storage means Rs, and the column end point data storage means Re are written ( Update), for example, a process from FIG. 5A to FIG. 5B and further to FIG. 5C. This data end point processing will be described by taking a black circled portion in FIG. 5C as an example.
[0071]
In the example of FIG. 5C, the position indicated by the black circle is not zero by the decoding process after the state of FIG. 5B, and in this case, the process enters step s15 in FIG. In this step s15, whether or not the starting point data of the row is zero, and if the starting point data of the row is zero, the starting point data of the row is updated (step s16).
[0072]
That is, in the example of FIG. 5C, since the line start point data at that position has been zero so far, the process proceeds to step s16, and the line start point data is updated. In this case, since the line start position is the fifth from the left in the figure, the updated line start point data is 5, and 5 is written in the line start point data storage unit Cs as shown in FIG. . Subsequently, the line end point data of the line is updated (step s17). In this case, the line end point data is also 5.
[0073]
Next, it is checked whether the column start point data of the column is zero (step 18). If the column start point data of the column is zero, the column start point data of the column is updated (step 18). s19). In the example of FIG. 5C, since the column start point data of the fifth column is not zero, only the column end point data of the column is updated without updating the column start point data of the column ( Step s20). That is, in this case, the column start point data of the column remains 1, but the column end point data storage unit Re is updated to 6 as shown in FIG.
[0074]
The important thing in the series of processing procedures of FIG. 4 described above is that run-length decoding is decoding focusing on non-zero elements, as can be seen from FIG. No processing has occurred. That is, as seen in the conventional example, the determination of the zero element and the non-zero element is not necessary in the present invention.
[0075]
By repeatedly performing the above process, the decoding process including the data end point process is completed for the 8 × 8 data block to be processed. As a result, the decoded non-zero element data is written in the data storage means 1 shown in FIG. 1, and the row start point data storage means Cs, the row end point data storage means Ce, and the column start point data storage means. In Rs and column end point data storage means Re, the start point data and end point data of non-zero elements are written in the respective rows and columns.
[0076]
That is, the position of the leftmost non-zero element included in the row is written as the row start point data in the row start point data storage unit Cs, and the row end point data storage unit Cs is the most contained in the row. The position of the right non-zero element is written as the line end point data. Further, the position of the uppermost non-zero element included in the column is written as column start point data in the column start point data storage means Rs, and the column end point data storage means Rs is the most contained in the column. The position of the lower non-zero element is written as column end point data.
[0077]
Here, in the overall processing flow shown in FIG. 3, the processing subsequent to the decoding processing including the data endpoint processing in step s1 is determination of the priority of the operation execution order in the row and column (step s2). As described above, in the two-dimensional orthogonal transformation, there is a degree of freedom in the execution order of row-side processing and column-side processing. However, the total calculation amount varies depending on this order. A typical example is shown in FIGS.
[0078]
6 (a) and FIG. 7 (a) show the same data, and include a non-zero element (filled) only in a certain row. In this example, all the first rows in the third row are non-zero. It shows a case. FIG. 6 (b) shows a case where processing (indicated by an arrow) is performed from the row side, and FIG. 7 (b) shows a case where processing (indicated by an arrow) is performed from the column side. Yes.
[0079]
As a result of the processing, FIG. 6 (c) and FIG. 7 (c) show the zero and non-zero states of the data created as the intermediate state. FIG. 6 (c) and FIG. 7 (c) As is clear from FIG. 6 (c), only one line in the third row is non-zero and the others are all zero, whereas in FIG. 7 (c), 8 × 8 All elements of the data block are non-zero.
[0080]
That is, the second stage processing as shown in FIGS. 6D and 7D (in this example, since the first stage processing is row direction processing in the case of FIG. Is a column direction process, and in the case of FIG. 7, the first stage process is a column direction process, so the second stage process is a row direction process). The difference will occur.
[0081]
Therefore, in the present invention, the determination processing of the priority of the row and column calculation execution order as shown in FIG. 8 is performed. By performing the processing for determining the priority of the row and column calculation execution order as shown in FIG. 8, the total amount of calculation can be reduced.
[0082]
In the example of FIGS. 6 and 7, the priority of the operation execution order is determined by the determination at the first stage in FIG. In the processing up to step s23, first, NC is set as the number of rows in which all elements are zero, and NR is set as the number of columns in which all elements are zero (step s21). The processing is performed from the column side if NC <NR (steps s22 to s25).
[0083]
If neither NC> NR nor NC <NR, that is, if the number NC of rows in which all elements are zero and the number NR of columns in which all elements are zero are equal, (end point )-(Start point) is summed, and it is SC for the row and SR for the column (step s26). The sum of (end point)-(start point) is
In the row direction, the sum of the difference between each row start point data and the corresponding row end point data is SC, and in the column direction, each column start point data and each corresponding column This is the sum of the differences of the end point data, which is designated as SR. Then, SC> SR is determined. If SC> SR, the process starts from the column side (step s25). If SC> SR is not satisfied, the process starts from the row side (step s24).
[0084]
For example, in FIGS. 6 and 7, the number of rows in which all elements are zero is 7, and the number of columns in which all elements are zero is 0. Thus, the priority of the operation execution order is determined by the determination up to step 23 in FIG. 8, and in this case, the row processing is prioritized.
[0085]
Further, in the case of FIG. 9 and FIG. 10, more detailed judgment is necessary, and in this case, the processing after step s26 is necessary in the processing of FIG. Here, the sum of (end point) − (start point) is obtained for both the row and the column, and the obtained sum is SC and SR.
[0086]
Simply speaking, this corresponds to the number of sums of product-sum operation processing. In the example of FIGS. 9 and 10, the sum SC of (end point) − (start point) in the row is 10, the sum SR of (end point) − (start point) in the column is 13, and step s27 in FIG. Depending on the judgment, the processing of the row is prioritized. That is, the amount of calculation is smaller when the row is prioritized. In this case, the number of sums is reduced by three.
[0087]
Through the processing as described above, the priority of the operation execution order in the rows and columns is determined. In the subsequent processing, according to FIG. 3, the orthogonal transformation processing of the row or column including the data end point processing is performed. The specific contents of this processing are shown in FIG.
[0088]
In the process of FIG. 11, there is a process of initializing the start point data and end point data of the second set of rows and columns as the process of step s31. This is shown in the configuration diagram of FIG. Thus, two sets of row start point data storage means Cs1, Cs2 and two sets of row end point data storage means Ce1, Ce2, and further two sets of column start point data storage means Rs1, Rs2 and two sets of column end points When data storage means Re1 and Re2 are prepared, the second set of row start point data storage means Cs2 and row end point data storage means Ce2, column start point data storage means Rs2 and column end point data storage means Re2 are initialized. It is to become. This initialization process may be considered the same as described in step s11 in FIG.
[0089]
The processing flow of FIG. 11 is generally the same as the processing of FIG. 4 except that one row or column orthogonal transformation processing in step s33 is included. FIG. 12 shows the specific contents of the orthogonal transformation processing of one row or column in step s33.
[0090]
In FIG. 12, start point data (referred to as Ps) and end point data (referred to as Pe) of a specified row or column are read (step s41). Then, it is determined whether Ps is zero and Pe is zero (step s42). If Ps is zero and Pe is zero, 0 is returned (step s43). If Ps is zero and Pe is not zero, the product sum is performed (Pe−Ps + 1) times with Ps as the start position and Pe as the end position, and the result Sum is returned (step). s44).
[0091]
As can be seen from FIG. 12, in the one-dimensional orthogonal transformation processing of one row or column, when all the elements are zero (when Ps is zero and Pe is also zero). The product-sum operation process is completely omitted. Thereby, also in this invention, the effect equivalent to Unexamined-Japanese-Patent No. 4-70060 which is a prior art is acquired. In other cases (when Ps is zero and Pe is not zero), the product-sum operation is performed only between the start position and end position of the non-zero element.
[0092]
This effect will be described in comparison with the conventional example with reference to FIG. 13 and FIGS. 24 and 25 used in the description of the prior art. In each of FIGS. 13, 24, and 25, (a) is the original data, and these original data are all the same data. In FIG. 13, FIG. 24, and FIG. 25, the filled portion (b) is an area to be subjected to the product-sum operation.
[0093]
FIG. 24 assumes a case where four parallel operations in the row direction in the conventional example are performed. In this case, a product-sum operation is required for the data at the position painted black in FIG. As can be seen from FIG. 24, when four parallel operations are performed, a considerably larger amount of data is subjected to the product-sum operation than the original data shown in FIG.
FIG. 25 shows an example in the case where the determination by EOB is performed. In this case as well, it can be seen that a larger amount of data is the target of the product-sum operation than the original data shown in FIG.
[0094]
On the other hand, FIG. 13 shows the case where the processing of the present invention is performed in the row direction. As shown in FIG. 13B, the data to be subjected to the product-sum operation processing is as shown in FIG. It can be seen that the number is considerably smaller than the conventional example of FIG.
[0095]
FIG. 14 shows the processing of the present invention performed in the column direction. In this case as well, as in FIG. 13, the data to be subjected to the product-sum operation processing is as shown in FIG. It can be seen that the number is considerably smaller than the conventional example.
[0096]
Further, when the above-described priority determination processing (see FIG. 8) of the operation execution order in the row and column of the present invention is performed on the example of FIG. 13, in this case, the processing is performed by the processing after step s26 in FIG. The processing in the 13th row direction is prioritized. In fact, in this data, the number of times of product-sum operation processing is one less in the processing of FIG. 13 than in FIG.
[0097]
As described above, the method of the present invention can perform the first-stage (either row or column) orthogonal transform process with very few processes compared to the conventional example.
[0098]
The process in FIG. 12 (orthogonal transformation process for one row or column) described above is the process in step s33 in FIG. 11. When the process in FIG. 12 ends, the data endpoint process in step s34 and subsequent steps in FIG. I do. In this case, two sets of row start point data storage means Cs1, Cs2 and two sets of row end point data storage means Ce1, Ce2, two sets of column start point data storage means Rs1, Rs2 and two sets of column end point data storage. Since means Re1 and Re2 are prepared, the data end point processing here is the second set of row start point data storage means Cs2, row end point data storage means Ce2, column start point data storage means Rs2, and column end point data. This is an end point process for the storage means Re2. This end point processing is the same as the processing after step s14 in FIG.
[0099]
As described above, the data end point processing is performed even when the orthogonal transformation processing of one row or column is completed. The reason why the data end point processing at this stage is effective will be described with reference to FIG.
[0100]
Conventionally, in the present invention, the processing speed is increased by omitting the processing of zero data, but the same condition also occurs in the data after the first stage processing. For example, as shown in FIG. 15A, it is assumed that there is data in which all elements have the same value. With regard to such data, as shown in FIG. 15B, the state after the first stage processing is non-zero data in only one column, and all other data is zero. That is, even in the data obtained by the first stage processing as described above, the number of product-sum operations can be further reduced by performing the data end point processing as described above.
[0101]
By the description so far, step s3 of FIG. 3 has been completed. The last processing shown in FIG. 3 is the orthogonal transformation processing (step s4) of the remaining rows or columns, which is simply the orthogonal transformation processing for the rows or columns. This is realized by simply determining whether or not the data block is ended (step s51) and performing orthogonal transformation processing (step s52) of one row or column as shown in FIG.
[0102]
The present invention is not limited to the embodiment described above, and various modifications can be made without departing from the gist of the present invention.
[0103]
In addition, the present invention can create a processing program in which the processing procedure for realizing the present invention described above is described, and the processing program can be recorded on a recording medium such as a floppy disk, an optical disk, or a hard disk. The present invention also includes a recording medium on which the processing program is recorded. Further, the processing program may be obtained from a network.
[0104]
As described above, according to the present invention, for each row in an N × N data block, the position of the non-zero element existing in the forefront in the processing scan direction in that row is used as the row start point data, and the processing scan in that row. Stores the position of the non-zero element present in the rearmost direction as row end point data, and for each column, sets the position of the non-zero element present in the forefront of the processing scan direction in that column as column start point data, the column The position of the non-zero element that is present at the rearmost in the scanning direction is stored as column end point data, and in each row, product-sum operation is performed only between the start point data and end point data of that row, and each column Since the product-sum operation is performed only between the start point data and the end point data of the column, the product-sum operation can be simplified with a very simple process. Moreover, high-precision orthogonal transform processing can be since it is possible to properly determine the range to be the product sum.
[0105]
In addition, when performing this sum-of-products operation, whether to perform the operation execution order from the row direction or from the column direction is determined in consideration of the number of product-sum times based on the data contents in the N × N data block. I have to. In this way, the product-sum operation can be efficiently performed by determining the operation execution order to be either a row or a column depending on the data content in the N × N data block.
[0106]
In the present invention, no special hardware or data is assumed, and general data can be processed by a general-purpose CPU or DSP.
[Brief description of the drawings]
FIG. 1 is a schematic configuration diagram of a two-dimensional orthogonal transform apparatus according to the present invention.
2 is a configuration diagram in the case of having two sets of row start point data storage means, row end point data storage means, column start point data storage means, and column end point data storage means in the configuration of FIG. 1; FIG.
FIG. 3 is a flowchart illustrating an overall processing procedure of a two-dimensional orthogonal transformation process according to the present invention.
4 is a flowchart for explaining a decoding process including a data end point process in the flowchart of FIG. 3. FIG.
FIG. 5 is a diagram for explaining data end point processing in the flowchart of FIG. 3;
FIG. 6 is a diagram schematically illustrating a calculation amount when processing in a row direction is performed on a data block including a zero element only in a certain row, and the number of rows and columns in which all elements are zero. It is a figure which shows the example which judges whether the process from a row direction or the process from a column direction is performed only by.
FIG. 7 is a diagram schematically illustrating a calculation amount when processing in a column direction is performed on a data block including a zero element only in a certain row, and the number of rows and columns in which all elements are zero. It is a figure which shows the example which judges whether the process from a row direction or the process from a column direction is performed only by.
FIG. 8 is a flowchart for describing priority determination processing for row and column processing in the flowchart of FIG. 3;
FIG. 9 is a diagram schematically illustrating a calculation amount when processing in a row direction is performed on a data block including a plurality of zero elements across a plurality of rows and columns; An example is shown in which the sum of (end point)-(start point) is obtained for each row and column, and whether processing from the row direction or processing from the column direction is determined based on a comparison of the magnitudes of the sums. FIG.
FIG. 10 is a diagram schematically illustrating a calculation amount when processing in a column direction is performed on a data block including a plurality of zero elements over a plurality of rows and columns, and is illustrated in the flowchart of FIG. An example is shown in which the sum of (end point)-(start point) is obtained for each row and column, and whether processing from the column direction or processing from the column direction is determined based on a comparison of the magnitudes of the sums. FIG.
FIG. 11 is a flowchart for explaining row or column orthogonal transformation processing including data end point processing in the flowchart of FIG. 3;
12 is a flowchart for explaining orthogonal transformation processing of one row or column in FIG. 11;
FIG. 13 is a diagram for explaining the effect of the product-sum operation processing according to the present invention when processing in the row direction is performed.
FIG. 14 is a diagram for explaining the effect of product-sum operation processing according to the present invention when processing in the column direction is performed.
FIG. 15 is a diagram illustrating an example of an image for explaining the effectiveness of performing end point processing after the orthogonal transformation processing of one row or column is completed.
FIG. 16 is a flowchart illustrating a procedure of orthogonal transform processing of individual rows or columns.
FIG. 17 is a diagram schematically illustrating extraction of N × N (8 × 8) data blocks serving as a processing unit from image data.
FIG. 18 is a diagram for explaining a data example of an N × N (8 × 8) data block serving as a processing unit and a processing example in which the data is converted into a frequency domain and then quantized.
FIG. 19 is a diagram for describing run-length encoding processing.
FIG. 20 is a diagram illustrating a case where the data in FIG. 18C is rearranged and the zero chain is replaced with EOB.
FIG. 21 is a diagram illustrating whether processing is performed on an N × N (8 × 8) data block serving as a processing unit from a row direction or a column direction;
FIG. 22 is a diagram for explaining an example of simplifying orthogonal transform calculation by selecting an optimal calculation means according to the position of EOB in the prior art.
FIG. 23 is a diagram for explaining an example of simplifying orthogonal calculation by dividing an N × N (8 × 8) data block, which is a processing unit, into several areas and performing calculation in the prior art. is there.
FIG. 24 shows a problem when performing product-sum operation on data in an N × N (8 × 8) data block as a processing unit by four parallel operations (four parallel operations in the row direction), which is one of the prior arts. It is a figure explaining a point.
FIG. 25 is a diagram for explaining a problem in a case where a product-sum operation is performed using data in an N × N (8 × 8) data block serving as a processing unit by using EOB determination, which is one of the prior arts. is there.
[Explanation of symbols]
1 Data recording means
2 Data selection means
3 Conversion coefficient storage means
4 Product-sum operation means
Cs Line start point data storage means
Ce line end point data storage means
Rs row start point data storage means
Re column end point data storage means

Claims (4)

N×N要素のデータブロックにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第1の行開始点データとして記憶するとともに、処理方向の最も後方に存在する非零要素の位置を第1の行終了点データとして記憶し、かつ、各列ごとに、処理方向の最も手前に存在する非零要素の位置を第1の列開始点データとして記憶するともに、処理方向の最も後方に存在する非零要素の位置を第1の列終了点データとして記憶し、
前記第1の行開始点データと前記第1の行終了点データ間のみのデータ及び前記第1の列開始点データと前記第1の列終了点データ間のみのデータを用いて、行方向または列方向のいずれかの方向の積和演算を行う第1の処理と、
前記第1の処理後に、前記第1の処理で行われていない方向の積和演算を行う第2の処理とを行う2次元直交換処理方法であって、
前記第1の処理は、
前記N×N要素のデータブロックにおける全ての要素が零である行または列の数を比較し、当該比較の結果、数の多い方向の積和演算を行い、
前記全ての要素が零である行または列の数が同数である場合には、前記N×N要素のデータブロックにおける前記行開始点データと当該行開始点データに対応する行終了点データとの差の総和と、前記列開始点データと当該列開始点データに対応する列終了点データとの差の総和とを比較し、当該比較の結果、総和の少ない方向の積和演算を行うことを特徴とする2次元直交換処理方法。
For each row in the N × N element data block, the position of the non-zero element existing in the forefront in the processing direction is stored as the first row start point data, and the non-zero element existing in the rearmost in the processing direction is stored. The position is stored as the first row end point data, and the position of the non-zero element existing closest to the processing direction is stored as the first column starting point data for each column, Storing the position of the non-zero element existing behind as the first column end point data;
Using the data only between the first row start point data and the first row end point data and the data only between the first column start point data and the first column end point data, A first process for performing a product-sum operation in any direction of the column direction;
A two-dimensional direct exchange processing method for performing, after the first processing, a second processing for performing a product-sum operation in a direction not performed in the first processing,
The first process includes
Compare the number of rows or columns in which all the elements in the N × N element data block are zero, and, as a result of the comparison, perform a product-sum operation in the direction of the larger number,
When the number of rows or columns in which all the elements are zero is the same, the row start point data in the N × N element data block and the row end point data corresponding to the row start point data Comparing the sum of differences with the sum of differences between the column start point data and the column end point data corresponding to the column start point data, and performing a product sum operation in a direction with less total sum as a result of the comparison A characteristic two-dimensional direct exchange processing method.
前記第1の処理後に、前記第1の処理後のデータにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第2の行開始点データとして記憶するとともに、処理方向の最も後方に存在する非零要素の位置を第2の行終了点データとして記憶し、かつ、各列ごとに、処理方向の最も手前に存在する非零要素の位置を第2の列開始点データとして記憶するともに、処理方向の最も後方に存在する非零要素の位置を第2の列終了点データとして記憶し、
前記第2の行開始点データと前記第2の行終了点データ間のみのデータ及び前記第2の列開始点データと前記第2の列終了点データ間のみのデータを用いて、前記第2の処理を行うことを特徴とする2次元直交換処理方法。
After the first processing, for each row in the data after the first processing, the position of the non-zero element existing closest to the processing direction is stored as second row start point data, and The position of the non-zero element existing behind is stored as the second row end point data, and the position of the non-zero element existing closest to the processing direction is used as the second column start point data for each column. And storing the position of the non-zero element existing at the rearmost in the processing direction as second column end point data,
Using the data only between the second row start point data and the second row end point data, and the data only between the second column start point data and the second column end point data, the second row start point data and the second row end point data are used. A two-dimensional direct exchange processing method characterized in that
N×N要素のデータブロックごとにデータ変換処理を行う2次元直交変換処理2次元直交変換処理装置であって、
処理対象となるN×Nのデータブロックを記憶するデータ記憶手段と、
前記データ記憶手段に記憶されたN×Nのデータブロックにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第1の行開始点データとして記憶する行開始点データ記憶手段と、
処理方向の最も後方に存在する非零要素の位置を第1の行終了点データとして記憶する行終了点データ記憶手段と、
前記N×Nのデータブロックにおける各列ごとに、処理方向の最も手前に存在する非零要素の位置を第1の列開始点データとして記憶する列開始点データ記憶手段と、
当該列における処理方向の最も後方に存在する非零要素の位置を第1の列終了点データとして記憶する列終了点データ記憶手段と、
前記第1の行開始点データと前記第1の行終了点データとの間のみのデータ及び前記列開始点データと前記列終了点データ記憶手段との間のみのデータを用いて、行方向または列方向のいずれかの積和演算を行う第1の積和演算手段と、
前記第1の積和演算手段による積和演算の後、前記第1の積和演算手段による積和演算で行われていない方向の積和演算を行う第2の積和演算手段と、
を有し、
前記第1の積和演算手段は、
前記N×N要素のデータブロックにおける全ての要素が零である行または列のうち、数の多い方向の積和演算を行い、
前記全ての要素が零である行または列の数が同数である場合には、前記N×N要素のデータブロックにおける前記行開始点データと当該行開始点データに対応する行終了点データとの差の総和と、前記列開始点データと当該列開始点データに対応する列終了点データとの差の総和のうち、少ない方向の積和演算を行うことを特徴とする2次元直交換処理装置。
A two-dimensional orthogonal transformation processing device that performs data transformation processing for each data block of N × N elements,
Data storage means for storing N × N data blocks to be processed;
Row start point data storage means for storing, as the first row start point data, the position of the non-zero element existing closest to the processing direction for each row in the N × N data block stored in the data storage means; ,
Line end point data storage means for storing the position of the non-zero element existing at the rearmost in the processing direction as first line end point data;
Column start point data storage means for storing, as the first column start point data, the position of the non-zero element existing closest to the processing direction for each column in the N × N data block;
Column end point data storage means for storing, as first column end point data, the position of a non-zero element existing at the rearmost in the processing direction in the column;
Using data only between the first row start point data and the first row end point data and data only between the column start point data and the column end point data storage means, a row direction or First product-sum operation means for performing any product-sum operation in the column direction;
Second product-sum operation means for performing a product-sum operation in a direction not performed in the product-sum operation by the first product-sum operation means after the product-sum operation by the first product-sum operation means;
Have
The first product-sum operation means includes:
Performing a multiply-accumulate operation in the direction of the larger number of rows or columns in which all elements in the N × N element data block are zero;
When the number of rows or columns in which all the elements are zero is the same, the row start point data in the N × N element data block and the row end point data corresponding to the row start point data A two-dimensional direct exchange processing device that performs a sum-of-products operation in a smaller direction out of a sum of differences and a sum of differences between the column start point data and the column end point data corresponding to the column start point data .
前記第1の積和演算手段の積和演算後のデータにおける各行ごとに、処理方向の最も手前に存在する非零要素の位置を第2の行開始点データとして記憶する行開始点データ記憶手段と、処理方向の最も後方に存在する非零要素の位置を第2の行終了点データとして記憶する行終了点データ記憶手段と、
前記第1の積和演算手段の積和演算後のデータにおける各列ごとに、処理方向の最も手前に存在する非零要素の位置を第2の列開始点データとして記憶する列開始点データ記憶手段と、処理方向の最も後方に存在する非零要素の位置を第2の列終了点データとして記憶する列終了点記憶手段と、
を有し、
前記第2の積和演算手段は、前記第2の行開始点データと前記第2の行終了点データ間のみのデータ及び前記第2の列開始点データと前記第2の列終了点データ間のみのデータを用いて、前記第1の積和演算手段による積和演算で行われていない方向の積和演算を行うことを特徴とする2次元直交換処理装置。
Row start point data storage means for storing, as the second row start point data, the position of the non-zero element existing closest to the processing direction for each row in the data after the product-sum operation of the first product-sum operation means. And a line end point data storage means for storing the position of the non-zero element existing at the rearmost in the processing direction as second line end point data;
Column start point data storage for storing, as second column start point data, the position of the non-zero element existing closest to the processing direction for each column in the data after the product-sum operation of the first product-sum operation means Means, and a column end point storage means for storing the position of the non-zero element existing at the rearmost in the processing direction as second column end point data;
Have
The second sum-of-products calculation means includes data between only the second row start point data and the second row end point data, and between the second column start point data and the second column end point data. A two-dimensional direct exchange processing apparatus characterized by performing product-sum operation in a direction not performed by product-sum operation by the first product-sum operation means using only data.
JP2001253482A 2001-08-23 2001-08-23 Two-dimensional orthogonal transformation processing method and two-dimensional orthogonal transformation processing device Expired - Fee Related JP3733883B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001253482A JP3733883B2 (en) 2001-08-23 2001-08-23 Two-dimensional orthogonal transformation processing method and two-dimensional orthogonal transformation processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001253482A JP3733883B2 (en) 2001-08-23 2001-08-23 Two-dimensional orthogonal transformation processing method and two-dimensional orthogonal transformation processing device

Publications (2)

Publication Number Publication Date
JP2003067362A JP2003067362A (en) 2003-03-07
JP3733883B2 true JP3733883B2 (en) 2006-01-11

Family

ID=19081800

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001253482A Expired - Fee Related JP3733883B2 (en) 2001-08-23 2001-08-23 Two-dimensional orthogonal transformation processing method and two-dimensional orthogonal transformation processing device

Country Status (1)

Country Link
JP (1) JP3733883B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4594688B2 (en) * 2004-06-29 2010-12-08 オリンパス株式会社 Image encoding processing method, image decoding processing method, moving image compression processing method, moving image expansion processing method, image encoding processing program, image encoding device, image decoding device, image encoding / decoding system, extended image compression / decompression Processing system

Also Published As

Publication number Publication date
JP2003067362A (en) 2003-03-07

Similar Documents

Publication Publication Date Title
CN102016829B (en) The error calculated during reverse discrete cosine transform reduces
CA2676099C (en) Method of compressing digital images
JP4718609B2 (en) Multidimensional digital signal filtering method and apparatus, and related encoding / decoding method and apparatus
US6799192B1 (en) Method and apparatus for inverse discrete cosine transform
US7188132B2 (en) Hadamard transformation method and apparatus
EP2112602A2 (en) Device, system, and method for solving systems of linear equations using parallel processing
JPH0652214A (en) Reverse discrete cosine conversion arithmetic unit
US8335811B2 (en) Method and system for high fidelity IDCT and DCT algorithms
CN110769263A (en) Image compression method and device and terminal equipment
JP3796432B2 (en) Filter processing apparatus and filter processing method
US7460722B2 (en) Encoding of digital data with determination of sample path
CN110650339A (en) Video compression method and device and terminal equipment
JP3733883B2 (en) Two-dimensional orthogonal transformation processing method and two-dimensional orthogonal transformation processing device
US7346640B2 (en) Image processing apparatus supporting both discrete cosine transform and discrete wavelet transform
US7539355B2 (en) Data transform method and apparatus
JP4097108B2 (en) Wavelet transform device and encoding / decoding device
KR20110052677A (en) Method for updating an encoder by filter interpolation
US9838704B2 (en) Method and apparatus for decoding video
US7555510B2 (en) Scalable system for inverse discrete cosine transform and method thereof
JP3951036B2 (en) Dynamic decimal point method, dynamic decimal point arithmetic method, two-dimensional inverse discrete cosine transform method and apparatus
JP2845098B2 (en) Decoding method and apparatus for multi-level image compression code
JP4405452B2 (en) Inverse conversion circuit
JP4738408B2 (en) Matrix operation unit
JP2003067360A (en) Method and device for sum of products calculation
JP3889738B2 (en) Inverse quantization apparatus, audio decoding apparatus, image decoding apparatus, inverse quantization method, and inverse quantization program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040219

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050301

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050308

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050506

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051010

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20101028

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101028

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20111028

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20121028

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121028

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20131028

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees