JP4013680B2 - Decoding device and decoding method - Google Patents

Decoding device and decoding method Download PDF

Info

Publication number
JP4013680B2
JP4013680B2 JP2002210499A JP2002210499A JP4013680B2 JP 4013680 B2 JP4013680 B2 JP 4013680B2 JP 2002210499 A JP2002210499 A JP 2002210499A JP 2002210499 A JP2002210499 A JP 2002210499A JP 4013680 B2 JP4013680 B2 JP 4013680B2
Authority
JP
Japan
Prior art keywords
decoding
output
code
decoding table
information
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
JP2002210499A
Other languages
Japanese (ja)
Other versions
JP2004056417A (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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation 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 Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2002210499A priority Critical patent/JP4013680B2/en
Publication of JP2004056417A publication Critical patent/JP2004056417A/en
Application granted granted Critical
Publication of JP4013680B2 publication Critical patent/JP4013680B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、ハフマン符号などの可変長符号の復号装置に関し、特に復号速度が高速である復号装置に関する。
【0002】
【従来の技術】
データの伝送時の高速化、蓄積時の効率化のために、データ圧縮、データ符号化の技術が広く用いられている。画像データの圧縮符号化については様々な方式があるが、その中の1つとして、DCT(離散コサイン変換)とハフマン符号などの可変長符号化を組み合わせた方式が用いられている。この方式の代表的な例としてJPEG方式がある。
【0003】
このようなDCTと可変長符号化を組み合わせた方式による画像符号化について図2をもとに説明する。フルカラーの画像の場合は、複数の色成分を、Y-Cb-Crや、R-G-Bや、Y-M-C-Kなどのように、単色成分に分離して、それぞれの色成分ごとに独立して処理する。画像の中の8×8画素の領域を、DCT、量子化、ジグザグ変換によって、64個の係数の数列に変換する。
【0004】
この数列の中で、連続するゼロとその後に現れる非ゼロの係数に対して、可変長のビット列の符号語シンボル1個を割り当てる。非ゼロの係数が連続するときは、係数1個に符号語シンボル1個を割り当てる。この符号語のビット列の集合が符号ファイルである。以上は、符号化の過程について説明したが、この過程を逆にたどることによって符号ファイルを復号し画像を得ることができる。
【0005】
このような方式の復号をおこなうための装置の従来例としては、特開平5−63586号公報に開示されて復号装置がある。図5をもとに、この装置について説明する。符号入力部11は記憶手段(図示せず)を備えており、符号ビット列中の処理中の複数ビットを保持する。
【0006】
符号切り出し部12は、符号入力部11が保持するビット列の中から、復号処理が終わっていない部分を切り出すための選択回路(図示せず)を備える。この符号切り出し部12は、バレルシフタなどの回路で実装される。切り出された符号ビット列は、復号のためのテーブルTに入力される。
【0007】
テーブルTは、ROM(Read Only Memory)、RAM(Random Access Memory)や、それと同等の動作をするPLD(programmable logic device)、組み合わせ論理回路などで実装される。テーブルTの出力は、後段の復号結果出力部15を介して逆量子化回路、IDCT(逆離散コサイン変換)回路に出力される。
【0008】
テーブルTからは、復号した可変長符号の符号長も出力され、この値は符号位置管理部13で累積加算され、次の符号語の切り出し位置を決めたり、符号入力部11に次の符号ビット列を取り込むために使う。
【0009】
このような装置をクロック信号に同期させて動作させると、1クロックサイクルに1シンボルを復号することができる。このように、符号切り出し部、復号テーブルを持ち、復号済みの符号のビット長を累積加算することによって、1クロックサイクルに1シンボルをデコードする例は、この公報以外にも多数公開されている。
【0010】
別の従来例として、特開平9−246988号公報に開示される技術がある。この技術では、複数シンボルを1サイクルで復号するために複数の復号テーブル(デコードRAM)を備えている。しかし、第1のテーブルの出力を第2のテーブルの入力とするような構成になっているので、回路のクリティカルパス(遅延時間が最大の信号伝播経路)が長くなり、動作クロックの周波数を上げられない。例えば、前例の回路が100MHzで1クロックサイクルに1シンボルをデコードし、この例の回路が50MHzで1クロックサイクルに2シンボルをデコードするならば、復号結果の出力速度は変わらないことになる。
【0011】
さらに別の従来例として、特開平8−265165号公報に開示される技術がある。この技術では、1サイクルに2シンボルをデコードするために、クロック信号の上昇エッジと下降エッジの両方をつかっており、やはりクロック周波数を上げられない。むしろ、回路が複雑化するため、動作速度が低下してしまう。
【0012】
さらに別の従来例として、特開平9−261076号公報に開示される技術がある。この技術では、1回の復号テーブルアクセスで複数のシンボルをデコードするために、複数シンボルが連続して表れるビット列に対する復号情報をテーブルに持っている。
【0013】
例えばJPEG(Joint Photographic coding Experts Group)方式では、前述の例のように1サイクルに1シンボルを復号する場合のテーブルのエントリ数は約160である。しかし、この例の方法で1サイクルに2シンボルを復号する場合は160×160=25600エントリ、1サイクルに3シンボルを復号する場合は160×160×160=4096000エントリ必要となり、テーブルが巨大化する。
【0014】
さらに別の従来例として、特開平7−249994号公報に開示される技術がある。図6をもとに、この例について説明する。この例では、1サイクル2シンボル復号するために、1個目のシンボル用のテーブル1面と、2個目のシンボル用のテーブルを複数面備えている。
【0015】
すなわち、符号入力部21は記憶手段(図示せず)を備えており、符号ビット列中の処理中の複数ビットを保持する。符号切り出し部22は、符号入力部21が保持するビット列の中から、復号処理が終わっていない部分を切り出すための選択回路(図示せず)を備える。
【0016】
2個目のシンボル用のテーブルは、1個目のシンボルのビット長が分かる前に2個目のシンボルのデコードができるように、1個目のシンボルのビット長として予測される分だけ符号ビット列をずらして複数用意されている。
【0017】
1個目のシンボルのビット長が確定したら、2個目のシンボル用の複数のテーブルの出力からセレクタ24によって1個だけを選んで2個目のシンボルの復号結果とする。セレクタ24からの出力は、後段の復号結果出力部25を介して逆量子化回路、IDCT(逆離散コサイン変換)回路に出力される。
【0018】
また、テーブルからは、復号した可変長符号の符号長も出力され、この値はセレクタ24を介して符号位置管理部23で累積加算され、次の符号語の切り出し位置を決めたり、符号入力部21に次の符号ビット列を取り込むために使う。
【0019】
この例では、回路のクリティカルパスがあまり長くならないので、高速動作が期待できる。しかし、JPEGの符号をこの回路で復号するためには2個目のシンボル用の復号テーブルが24面も必要になる。
【0020】
【発明が解決しようとする課題】
上記従来例のように、1クロックサイクルに1シンボルを復号する回路は、比較的容易に達成できるが、それ以上の復号速度を得るのは困難であった。クリティカルパスが長くなりクロック周波数を上げられず復号結果の出力速度があまり変わらなかったり、回路規模が膨大になりコストに見合ったパフォーマンス効果が得られないといった問題がある。そこで、本発明では、回路規模の増大をある程度に抑えて、クロック周波数を上げることができ、復号結果の出力速度を高速にできる復号装置を提供することを目的とする。
【0021】
【課題を解決するための手段】
本発明は、このような課題を解決するために成されたものである。すなわち、本発明は、所定の情報に対して可変長のビット列からなる符号語を割り当てて符号化した符号データを復号するための復号装置において、1つの符号語の入力に対して復号情報を出力する第1の復号テーブルと、ゼロランが所定量より少ない符号語が複数連続した符号語パターンの入力に対して複数符号語分の復号情報を出力する第2の復号テーブルと、第1の復号テーブルの出力と第2の復号テーブルの出力とのどちらか一方を選択するための選択手段とを備えている。
【0022】
また、DCT(離散コサイン変換)と可変長符号を組み合わせて用い、DCT係数の数列の連続するゼロ係数とその後の非ゼロ係数に可変長ビットの符号語を割り当てた画像符号化方式で符号化された符号データを復号するための復号装置において、全ての種類の符号語のうち1個の符号語が現れたときに復号情報を出力する第1の復号テーブルと、ゼロランがある所定量より少ない情報に割り当てられた符号語が複数連続した符号語パターンの入力に対して複数符号語分の復号情報を出力する第2の復号テーブルと、第1の復号テーブルの出力と第2の復号テーブルの出力とのどちらか一方を選択するための選択手段とを備えるものでもある。
【0023】
また、上記復号装置を用い、符号データを第1の復号テーブルと第2の復号テーブルとの両方に与えて復号を並列におこない、第2の復号テーブルによって複数符号語が同時に復号された場合は前記選択手段によって第2の復号テーブルの出力を選択し、第2の復号テーブルによって復号できなかった場合は選択手段によって第1の復号テーブルの出力を選択する復号方法でもある。
【0024】
このような本発明では、多数のDCT係数に割り当てられた符号語シンボルは、第1の復号テーブルで1シンボルずつ復号され、少数のDCT係数に割り当てられた符号語シンボルは、第2の復号テーブルで複数個のシンボルをまとめて復号されるので、出力結果は多数のDCT係数に相当する情報になり、復号結果の出力速度が高速化される。
【0025】
【発明の実施の形態】
以下、本発明の実施の形態を図に基づき説明する。図1は、本実施形態に係る復号装置を説明するブロック図である。すなわち、この復号装置は、符号入力部1、符号切り出し部2、第1の復号テーブルT1、第2の復号テーブルT2、復号テーブルT1、T2の出力を切換えるセレクタ4、復号結果出力部5、符号位置管理部3で構成される。
【0026】
符号入力部1は、符号ファイルの先頭から順に符号ビット列を読み出して複数ビットを保持し、この複数ビットを並列に符号切り出し部に与える。保持しているビット列の復号がすすむと、復号済みのビット列を破棄して、新たなビット列を読み込む。符号切り出し部に符号ビット列を継続的に提供し続けるために、縦続接続された2段以上のシフトレジスタで構成する。
【0027】
符号切り出し部2は、符号入力部1から提供されたビット列から、処理済みのビットと、未処理のビットを切り分ける。後段のテーブルへの出力は、テーブルアクセスのためのアドレスとして使うので、未処理のビットの先頭がアドレスの最上位ビットになるように出力する。バレルシフタなどで実装する。
【0028】
符号位置管理部3は、符号入力部1から符号切り出し部2に渡されるビット列のどの位置が処理済ビットと未処理ビットの境目であるかを管理する。そのために、符号語シンボルを復号するたびに復号した符号のビット長を累積加算する。この符号位置管理部3は、符号切り出し部2に対してバレルシフタのシフト量を与える。さらに、符号入力部1に対して新たなビット列の読み込みを指示する信号を与える。
【0029】
第1の復号テーブルT1では、すべての種類の符号語シンボルが1語だけ現れた場合に復号結果を得ることができる。テーブルは、ROM(Read Only Memory)、RAM(Random Access Memory)や、それと同等の動作をするPLD(programmable logic device)、組み合わせ論理回路などで実装する。
【0030】
符号切り出し部2から入力されるビット列は、復号テーブルT1のアドレス入力とする。出力は、復号した符号語シンボルのビット長、ゼロランの個数、符号語シンボルの後に付加されている付加ビットのビット長、符号語と付加ビットの合計のビット長などである。
【0031】
JPEG(Joint Photographic coding Experts Group)の符号割り当ての場合は、符号語シンボルの種類は約160である。これを単純にROMに実装すると、同じデータを保持するアドレスが大量に存在してしまうので非効率である。復号テーブルの有効なエントリ160種類の情報を与えて、論理合成用のソフトウエアツールを用いて、ROMと同等の動作をする組み合わせ論理回路を生成すると回路規模を削減できる。
【0032】
第2の復号テーブルT2では、ゼロランが小さい符号語シンボルが複数連続して現れた場合に復号結果を得ることができる。テーブルT2の入力は符号のビット列で、出力は、復号した符号語シンボルのビット長、ゼロランの個数、符号語シンボルの後に付加されている付加ビットのビット長、複数の符号語と付加ビットの合計のビット長などに加えて、複数シンボルの同時復号ができたのかできなかったのかを示す信号である。
【0033】
例として、JPEGの符号割り当てで、ゼロランがゼロのシンボルが2回連続して現れたときに同時復号する場合を考えてみる。ゼロランがゼロのシンボルは10種類である。これが2個連続して現れる場合のパターンは10×10=100種類である。
【0034】
これをROMに実装すると入力ビット数が増えるのでワード数の多いROMが必要になるが、前述のように論理合成ツールで組み合わせ論理回路を生成すると、テーブルのエントリ数で回路規模が決まるので、回路規模を削減できる。よって、第1のテーブルと第2のテーブルはほぼ同規模の回路になる。
【0035】
復号テーブルの出力を切換えるセレクタ4は、第2の復号テーブルT2から出力される「複数シンボルの同時復号ができたのかできなかったのかを示す信号」によって、第1の復号テーブルT1の出力と第2の復号テーブルT2の出力とを切換える。
【0036】
つまり、第2の復号テーブルT2で複数シンボルの復号ができた場合は第2の復号テーブルT2の出力を出力し、第2の復号テーブルT2で複数シンボルの復号ができなかった場合は第1の復号テーブルT1の出力を出力する。
【0037】
復号結果出力部5は、符号切り出し部2から出力される符号ビット列と、セレクタ4からの出力とを同期をとって後段に出力する。後段では、これらの値からDCT(離散コサイン変換)係数の数列を復元し、さらに、逆量子化、IDCT(逆離散コサイン変換)をおこなって画像を復元する。
【0038】
ここで、図2に示すように、1個の符号語シンボルを復号したときに、何個のDCT係数が得られるかは、ゼロの連続する数(ゼロラン)によってきまる。ゼロランの多い符号語シンボルを復号すると多数のDCT係数が得られ、ゼロランがゼロの符号語シンボルを復号すると1個のDCT係数しか得られない。
【0039】
そこで、本実施形態では、上記のような復号装置を用いることで、ゼロランが少ない符号語シンボルを複数まとめて1サイクルで復号できるようにし、ゼロランが多い符号語シンボルは1個を1サイクルで復号する。
【0040】
つまり、すべての種類の符号語シンボルが1語だけ現れた場合に復号結果を得るための第1の復号テーブルと、ゼロランが少ない符号語シンボルが連続して現れた場合に復号結果を得るための第2の復号テーブルとを持ち、両方のテーブルに同時に符号ビット列を入力し、第2のテーブルに該当する情報が有った場合は第2のテーブルの出力を復号結果とし、第2のテーブルに該当する情報が無かった場合は第1のテーブルの出力を復号結果とする。
【0041】
これにより、多数のDCT係数に割り当てられた符号語シンボルは、第1の復号テーブルで1シンボルずつ復号され、少数のDCT係数に割り当てられた符号語シンボルは、第2の復号テーブルで複数個のシンボルをまとめて復号されるので、出力結果は多数のDCT係数に相当する情報になり、復号結果の出力速度が高速化される。
【0042】
次に、本実施形態と従来技術との比較を行う。本実施形態(図1)と従来技術▲1▼(図5)、従来技術▲2▼(図6)とを比較する。これらの構成は、クリティカルパスの長さがほぼ同等なので、ほぼ同等のクロック周波数で動作すると仮定する。
【0043】
JPEG方式の符号を復号する場合、従来技術▲1▼では1個のテーブルが必要である。従来技術▲2▼の場合は、1個目のシンボルのビット長によって必要なテーブルの個数が決まり、JPEG方式の場合は24個のテーブルが必要である。本実施形態の場合は、ゼロランがゼロのシンボルを2個まとめて復号するならば、前述の実施例のように2面のテーブルが必要である。よって、回路規模を比較すると、
本実施形態:従来技術▲1▼:従来技術▲2▼ = 2:1:25
となる。
【0044】
次に、復号速度を比較する。復号速度は、DCT係数の数列にいくつゼロが出現するか、つまり処理する画像に依存する。DCT係数にゼロがほとんど現れないような最悪値の場合で評価する。
【0045】
まったくゼロが無かった場合を図3に示す。それぞれの構成での処理サイクル数は、従来技術▲1▼=64サイクル、従来技術▲2▼=33サイクル、本実施形態=33サイクルである。
【0046】
本実施形態でサイクル数が最悪値になるのは、第2のテーブルが全く機能しないような場合である。このような場合の例を図4に示す。それぞれの構成での処理サイクル数は、従来技術▲1▼=43サイクル、従来技術▲2▼=22サイクル、本実施形態=43サイクルである。
【0047】
図3と図4の場合を合わせて考えると、サイクル数の最悪値は、従来技術▲1▼=64サイクル、従来技術▲2▼=33サイクル、本実施形態=43サイクルである。よって、復号速度を比較すると、
本発明:従来技術▲1▼:従来技術▲2▼ = 1.5 :1:2
となる。
【0048】
まとめると、従来例▲1▼のように1サイクル1シンボルのよくある構成を基準に考えると、従来技術▲2▼は復号速度は2倍になっているが、回路規模が25倍になっており、回路規模増大に見合った効果が得られていない。本技術は、復号速度1.5倍に対して、回路規模は2倍に抑えられている。
【0049】
【発明の効果】
本発明の復号装置によれば、ゼロランの少ないシンボルを複数まとめて復号するので、DCT係数の数列を少ないサイクル数で得ることができ、復号結果の画像を高速に得ることが可能となる。
【図面の簡単な説明】
【図1】 本実施形態を説明する構成図である。
【図2】 DCTとハフマン符号を組み合わせた画像符号化方式の説明図である。
【図3】 復号速度を比較する説明図である。
【図4】 復号速度を比較する説明図である。
【図5】 従来例(その1)を示す構成図である。
【図6】 従来例(その2)を示す構成図である。
【符号の説明】
1…符号入力部、2…符号切り出し部、3…符号位置管理部、4…セレクタ、5…復号結果出力部、T1…第1の復号テーブル、T2…第2の復号テーブル
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a decoding device for a variable length code such as a Huffman code, and more particularly to a decoding device having a high decoding speed.
[0002]
[Prior art]
Data compression and data encoding techniques are widely used to increase the speed at the time of data transmission and the efficiency at the time of storage. There are various methods for compressing and encoding image data, and one of them is a method combining DCT (Discrete Cosine Transform) and variable length encoding such as Huffman code. A representative example of this method is the JPEG method.
[0003]
Image coding by a method combining such DCT and variable length coding will be described with reference to FIG. In the case of a full-color image, a plurality of color components are separated into single color components such as Y-Cb-Cr, RGB, and YMCK, and each color component is processed independently. An 8 × 8 pixel region in the image is converted into a sequence of 64 coefficients by DCT, quantization, and zigzag transformation.
[0004]
In this sequence, one codeword symbol of a variable length bit sequence is assigned to consecutive zeros and non-zero coefficients appearing thereafter. When non-zero coefficients are consecutive, one codeword symbol is assigned to one coefficient. A set of bit strings of the code word is a code file. The encoding process has been described above. By following this process in reverse, the code file can be decoded and an image can be obtained.
[0005]
As a conventional example of an apparatus for performing decoding of such a system, there is a decoding apparatus disclosed in Japanese Patent Laid-Open No. 5-63586. This apparatus will be described with reference to FIG. The code input unit 11 includes storage means (not shown) and holds a plurality of bits being processed in the code bit string.
[0006]
The code cutout unit 12 includes a selection circuit (not shown) for cutting out a portion of the bit string held by the code input unit 11 that has not been decoded. The code cutout unit 12 is implemented by a circuit such as a barrel shifter. The extracted code bit string is input to the table T for decoding.
[0007]
The table T is implemented by a ROM (Read Only Memory), a RAM (Random Access Memory), a PLD (programmable logic device) that performs the same operation, a combinational logic circuit, or the like. The output of the table T is output to an inverse quantization circuit and an IDCT (Inverse Discrete Cosine Transform) circuit via a decoding result output unit 15 at the subsequent stage.
[0008]
The code length of the decoded variable-length code is also output from the table T, and this value is cumulatively added by the code position management unit 13 to determine the next code word cut-out position or to the code input unit 11 for the next code bit string. Used to capture
[0009]
When such a device is operated in synchronization with a clock signal, one symbol can be decoded in one clock cycle. In addition to this publication, there are many examples of decoding one symbol in one clock cycle by accumulating and adding the bit lengths of decoded codes having a code cutout unit and a decoding table.
[0010]
As another conventional example, there is a technique disclosed in JP-A-9-246988. This technique includes a plurality of decoding tables (decoding RAMs) for decoding a plurality of symbols in one cycle. However, since the output of the first table is used as the input of the second table, the critical path (signal propagation path with the longest delay time) of the circuit becomes long, and the frequency of the operation clock is increased. I can't. For example, if the circuit of the previous example decodes one symbol in one clock cycle at 100 MHz and the circuit of this example decodes two symbols in one clock cycle at 50 MHz, the output speed of the decoding result does not change.
[0011]
As another conventional example, there is a technique disclosed in JP-A-8-265165. In this technique, in order to decode two symbols in one cycle, both the rising edge and falling edge of the clock signal are used, and the clock frequency cannot be increased. Rather, the operation speed decreases because the circuit becomes complicated.
[0012]
As another conventional example, there is a technique disclosed in Japanese Patent Application Laid-Open No. 9-261076. In this technique, in order to decode a plurality of symbols by one decoding table access, the table has decoding information for a bit string in which a plurality of symbols appear continuously.
[0013]
For example, in the JPEG (Joint Photographic coding Experts Group) method, the number of entries in the table when decoding one symbol per cycle as in the above example is about 160. However, if 2 symbols are decoded in one cycle by the method of this example, 160 × 160 = 25600 entries are required. If 3 symbols are decoded in 1 cycle, 160 × 160 × 160 = 4096000 entries are required, and the table becomes huge. .
[0014]
As another conventional example, there is a technique disclosed in Japanese Patent Laid-Open No. 7-249994. This example will be described with reference to FIG. In this example, one table for the first symbol and a plurality of tables for the second symbol are provided in order to decode two symbols per cycle.
[0015]
That is, the code input unit 21 includes storage means (not shown), and holds a plurality of bits being processed in the code bit string. The code cutout unit 22 includes a selection circuit (not shown) for cutting out a portion of the bit string held by the code input unit 21 that has not been decoded.
[0016]
The table for the second symbol is a code bit string corresponding to the predicted bit length of the first symbol so that the second symbol can be decoded before the bit length of the first symbol is known. Several are prepared by shifting.
[0017]
When the bit length of the first symbol is determined, only one is selected by the selector 24 from the outputs of the plurality of tables for the second symbol, and the result is the decoding result of the second symbol. The output from the selector 24 is output to an inverse quantization circuit and an IDCT (Inverse Discrete Cosine Transform) circuit via a decoding result output unit 25 at the subsequent stage.
[0018]
Further, the code length of the decoded variable length code is also output from the table, and this value is cumulatively added by the code position management unit 23 via the selector 24 to determine the cutout position of the next codeword or the code input unit. 21 is used to capture the next code bit string.
[0019]
In this example, since the critical path of the circuit is not so long, high speed operation can be expected. However, in order to decode the JPEG code with this circuit, 24 decoding tables for the second symbol are required.
[0020]
[Problems to be solved by the invention]
A circuit that decodes one symbol in one clock cycle as in the above-described conventional example can be achieved relatively easily, but it has been difficult to obtain a higher decoding speed. There is a problem that the critical path becomes long and the clock frequency cannot be increased, so that the output speed of the decoding result does not change much, or the circuit scale becomes enormous and the performance effect corresponding to the cost cannot be obtained. Accordingly, an object of the present invention is to provide a decoding device that can increase the clock frequency and increase the output speed of the decoding result while suppressing an increase in circuit scale to some extent.
[0021]
[Means for Solving the Problems]
The present invention has been made to solve such problems. That is, the present invention provides a decoding apparatus for decoding code data obtained by allocating codewords composed of variable-length bit strings to predetermined information and decoding information is output with respect to one codeword input. A first decoding table, a second decoding table that outputs decoding information for a plurality of codewords in response to an input of a codeword pattern in which a plurality of codewords having a zero run less than a predetermined amount are continuous, and a first decoding table Selecting means for selecting one of the output and the output of the second decoding table.
[0022]
In addition, a combination of DCT (Discrete Cosine Transform) and variable-length code is used, and is encoded by an image encoding method in which variable-length bit codewords are assigned to consecutive zero coefficients of a sequence of DCT coefficients and subsequent non-zero coefficients. In the decoding device for decoding the encoded data, the first decoding table that outputs the decoding information when one of the codewords of all types appears, and the information that is less than a predetermined amount of zero run A second decoding table that outputs decoding information for a plurality of codewords in response to an input of a codeword pattern in which a plurality of codewords assigned to is continuous, an output of the first decoding table, and an output of the second decoding table And a selection means for selecting one of the above.
[0023]
In addition, when the above decoding apparatus is used, code data is given to both the first decoding table and the second decoding table and decoding is performed in parallel, and a plurality of codewords are simultaneously decoded by the second decoding table. In the decoding method, the output of the second decoding table is selected by the selection unit, and when the decoding cannot be performed by the second decoding table, the output of the first decoding table is selected by the selection unit.
[0024]
In the present invention, codeword symbols assigned to a large number of DCT coefficients are decoded one symbol at a time in the first decoding table, and codeword symbols assigned to a small number of DCT coefficients are decoded in the second decoding table. Since a plurality of symbols are decoded together, the output result is information corresponding to a large number of DCT coefficients, and the output speed of the decoding result is increased.
[0025]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram illustrating a decoding device according to this embodiment. That is, the decoding apparatus includes a code input unit 1, a code cutout unit 2, a first decoding table T1, a second decoding table T2, a selector 4 for switching the outputs of the decoding tables T1 and T2, a decoding result output unit 5, a code The location management unit 3 is configured.
[0026]
The code input unit 1 reads a code bit string in order from the top of the code file, holds a plurality of bits, and applies the plurality of bits to the code cutout unit in parallel. When the held bit string is decoded, the decoded bit string is discarded and a new bit string is read. In order to continuously provide the code bit string to the code cutout unit, it is configured by two or more stages of shift registers connected in cascade.
[0027]
The code cutout unit 2 cuts out processed bits and unprocessed bits from the bit string provided from the code input unit 1. Since the output to the subsequent table is used as an address for table access, output is performed so that the head of the unprocessed bit becomes the most significant bit of the address. Mount with a barrel shifter.
[0028]
The code position management unit 3 manages which position of the bit string passed from the code input unit 1 to the code cutout unit 2 is the boundary between the processed bit and the unprocessed bit. For this purpose, every time the codeword symbol is decoded, the bit length of the decoded code is cumulatively added. The code position management unit 3 gives the shift amount of the barrel shifter to the code cutout unit 2. Further, a signal instructing the code input unit 1 to read a new bit string is given.
[0029]
In the first decoding table T1, decoding results can be obtained when only one word of all types of codeword symbols appears. The table is implemented by a ROM (Read Only Memory), a RAM (Random Access Memory), a PLD (programmable logic device) that performs the same operation, a combinational logic circuit, or the like.
[0030]
The bit string input from the code cutout unit 2 is used as the address input of the decoding table T1. The output includes the bit length of the decoded codeword symbol, the number of zero runs, the bit length of additional bits added after the codeword symbol, the total bit length of the codeword and additional bits, and the like.
[0031]
In the case of JPEG (Joint Photographic coding Experts Group) code assignment, there are about 160 types of codeword symbols. If this is simply implemented in a ROM, a large number of addresses holding the same data exist, which is inefficient. By providing information on 160 types of valid entries in the decoding table and generating a combinational logic circuit that operates in the same manner as a ROM using a logic synthesis software tool, the circuit scale can be reduced.
[0032]
In the second decoding table T2, a decoding result can be obtained when a plurality of codeword symbols having a small zero run appear continuously. The input of the table T2 is a bit string of the code, and the output is the bit length of the decoded code word symbol, the number of zero runs, the bit length of the additional bits added after the code word symbol, and the sum of a plurality of code words and additional bits Is a signal indicating whether or not simultaneous decoding of a plurality of symbols was possible.
[0033]
As an example, let us consider a case where simultaneous decoding is performed when a symbol whose zero run is zero appears twice consecutively in JPEG code assignment. There are 10 types of zero run zero symbols. There are 10 × 10 = 100 patterns when two of these appear in succession.
[0034]
When this is implemented in ROM, the number of input bits increases, so a ROM with a large number of words is required. However, when a combinational logic circuit is generated with a logic synthesis tool as described above, the circuit scale is determined by the number of entries in the table. The scale can be reduced. Therefore, the first table and the second table are almost the same scale circuit.
[0035]
The selector 4 for switching the output of the decoding table uses the output of the first decoding table T1 and the output of the first decoding table T1 according to the “signal indicating whether or not simultaneous decoding of a plurality of symbols has been performed” output from the second decoding table T2. 2 is switched to the output of the decoding table T2.
[0036]
That is, if the second decoding table T2 can decode a plurality of symbols, the output of the second decoding table T2 is output. If the second decoding table T2 cannot decode a plurality of symbols, the first symbol is output. The output of the decoding table T1 is output.
[0037]
The decoding result output unit 5 outputs the code bit string output from the code cutout unit 2 and the output from the selector 4 to the subsequent stage in synchronization. In the subsequent stage, a sequence of DCT (discrete cosine transform) coefficients is restored from these values, and further, inverse quantization and IDCT (inverse discrete cosine transform) are performed to restore the image.
[0038]
Here, as shown in FIG. 2, how many DCT coefficients are obtained when one codeword symbol is decoded is determined by the number of consecutive zeros (zero run). When a codeword symbol with many zero runs is decoded, a large number of DCT coefficients are obtained, and when a codeword symbol with zero runs is zero, only one DCT coefficient is obtained.
[0039]
Therefore, in the present embodiment, by using the decoding device as described above, a plurality of codeword symbols with few zero runs can be decoded together in one cycle, and one codeword symbol with many zero runs is decoded in one cycle. To do.
[0040]
That is, a first decoding table for obtaining a decoding result when only one type of codeword symbol appears, and a decoding result for obtaining a codeword symbol with few zero runs continuously. A second decoding table, and a code bit string is input to both tables at the same time. If there is information corresponding to the second table, the output of the second table is set as a decoding result, and the second table contains If there is no corresponding information, the output of the first table is taken as the decoding result.
[0041]
As a result, codeword symbols assigned to a large number of DCT coefficients are decoded one symbol at a time in the first decoding table, and codeword symbols assigned to a small number of DCT coefficients are converted to a plurality of codeword symbols in the second decoding table. Since symbols are decoded together, the output result is information corresponding to a large number of DCT coefficients, and the output speed of the decoding result is increased.
[0042]
Next, the present embodiment is compared with the prior art. This embodiment (FIG. 1) is compared with the prior art (1) (FIG. 5) and the prior art (2) (FIG. 6). These configurations are assumed to operate at approximately the same clock frequency because the critical path lengths are approximately the same.
[0043]
When decoding a JPEG code, the prior art {circle over (1)} requires one table. In the case of the prior art (2), the number of necessary tables is determined by the bit length of the first symbol, and in the case of the JPEG system, 24 tables are required. In the case of the present embodiment, if two symbols with zero run are zero are decoded together, a two-sided table is required as in the above-described example. Therefore, comparing the circuit scale,
This embodiment: Conventional technique {circle around (1)}: Conventional technique {circle around (2)} = 2: 1: 25
It becomes.
[0044]
Next, the decoding speed is compared. The decoding speed depends on how many zeros appear in the sequence of DCT coefficients, that is, the image to be processed. Evaluation is made in the case of the worst value such that zero hardly appears in the DCT coefficient.
[0045]
The case where there is no zero at all is shown in FIG. The number of processing cycles in each configuration is the prior art {circle around (1)} = 64 cycles, the prior art {circle around (2)} = 33 cycles, and the present embodiment = 33 cycles.
[0046]
In this embodiment, the number of cycles becomes the worst value when the second table does not function at all. An example of such a case is shown in FIG. The number of processing cycles in each configuration is the prior art (1) = 43 cycles, the prior art (2) = 22 cycles, and the present embodiment = 43 cycles.
[0047]
Considering the case of FIG. 3 and FIG. 4 together, the worst value of the number of cycles is the prior art (1) = 64 cycles, the prior art (2) = 33 cycles, and the present embodiment = 43 cycles. Therefore, when comparing the decoding speed,
The present invention: Conventional technique (1): Conventional technique (2) = 1.5: 1: 2
It becomes.
[0048]
In summary, considering the common configuration of one symbol per cycle as in the conventional example (1), the decoding speed of the conventional technique (2) is doubled, but the circuit scale is 25 times larger. Therefore, an effect commensurate with the increase in circuit scale has not been obtained. In the present technology, the circuit scale is suppressed to twice the decoding speed of 1.5 times.
[0049]
【The invention's effect】
According to the decoding apparatus of the present invention, since a plurality of symbols having a small number of zero runs are decoded together, a sequence of DCT coefficients can be obtained with a small number of cycles, and a decoding result image can be obtained at high speed.
[Brief description of the drawings]
FIG. 1 is a configuration diagram illustrating an embodiment.
FIG. 2 is an explanatory diagram of an image encoding method combining DCT and Huffman code.
FIG. 3 is an explanatory diagram for comparing decoding speeds.
FIG. 4 is an explanatory diagram for comparing decoding speeds.
FIG. 5 is a configuration diagram showing a conventional example (No. 1).
FIG. 6 is a configuration diagram showing a conventional example (No. 2).
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Code input part, 2 ... Code extraction part, 3 ... Code position management part, 4 ... Selector, 5 ... Decoding result output part, T1 ... 1st decoding table, T2 ... 2nd decoding table

Claims (4)

所定の情報に対して可変長のビット列からなる符号語を割り当てて符号化した符号データを復号するための復号装置において、
1つの符号語の入力に対して復号情報を出力する第1の復号テーブルと、
ゼロランが所定量より少ない符号語が複数連続した符号語パターンの入力に対して複数符号語分の復号情報を出力する第2の復号テーブルと、
前記第1の復号テーブルの出力と前記第2の復号テーブルの出力とのどちらか一方を選択するための選択手段と
を備えることを特徴とする復号装置。
In a decoding device for decoding code data obtained by allocating and encoding a code word consisting of a variable-length bit string for predetermined information,
A first decoding table for outputting decoding information in response to input of one codeword;
A second decoding table for outputting decoding information for a plurality of code words in response to an input of a code word pattern in which a plurality of code words having a zero run less than a predetermined amount are continuous;
A decoding device comprising: selection means for selecting one of the output of the first decoding table and the output of the second decoding table.
DCT(離散コサイン変換)と可変長符号を組み合わせて用い、DCT係数の数列の連続するゼロ係数とその後の非ゼロ係数に可変長ビットの符号語を割り当てた画像符号化方式で符号化された符号データを復号するための復号装置において、
全ての種類の符号語のうち1個の符号語が現れたときに復号情報を出力する第1の復号テーブルと、
ゼロランがある所定量より少ない情報に割り当てられた符号語が複数連続した符号語パターンの入力に対して複数符号語分の復号情報を出力する第2の復号テーブルと、
前記第1の復号テーブルの出力と前記第2の復号テーブルの出力とのどちらか一方を選択するための選択手段と
を備えることを特徴とする復号装置。
A code encoded by an image encoding method using a combination of DCT (Discrete Cosine Transform) and a variable-length code, and assigning a variable-length bit codeword to consecutive zero coefficients of a sequence of DCT coefficients and subsequent non-zero coefficients. In a decoding device for decoding data,
A first decoding table that outputs decoding information when one of the codewords of all types appears;
A second decoding table that outputs decoding information for a plurality of codewords in response to an input of a plurality of codeword patterns in which a plurality of codewords assigned to information having a zero run less than a predetermined amount;
A decoding apparatus comprising: a selecting unit for selecting one of the output of the first decoding table and the output of the second decoding table.
所定の情報に対して可変長のビット列からなる符号語を割り当てて符号化した符号データを復号するための復号方法において、
1つの符号語の入力に対して復号情報を出力する第1の復号テーブルと、ゼロランが所定量より少ない符号語が複数連続した符号語パターンの入力に対して複数符号語分の復号情報を出力する第2の復号テーブルと、前記第1の復号テーブルの出力と前記第2の復号テーブルの出力とのどちらか一方を選択するための選択手段とを備える復号装置を用い、
符号データを前記第1の復号テーブルと前記第2の復号テーブルとの両方に与えて復号を並列におこない、前記第2の復号テーブルによって複数符号語が同時に復号された場合は前記選択手段によって前記第2の復号テーブルの出力を選択し、
前記第2の復号テーブルによって復号できなかった場合は前記選択手段によって前記第1の復号テーブルの出力を選択する
ことを特徴とする復号方法。
In a decoding method for decoding code data obtained by allocating and encoding a code word consisting of a variable-length bit string for predetermined information,
A first decoding table that outputs decoding information in response to an input of one codeword, and outputs decoding information for a plurality of codewords in response to an input of a codeword pattern in which a plurality of codewords having zero runs less than a predetermined amount are continuous Using a decoding device comprising: a second decoding table; and a selection means for selecting one of the output of the first decoding table and the output of the second decoding table;
Code data is supplied to both the first decoding table and the second decoding table to perform decoding in parallel, and when a plurality of codewords are simultaneously decoded by the second decoding table, the selection means Select the output of the second decoding table,
The decoding method, wherein when the decoding cannot be performed by the second decoding table, the selection unit selects an output of the first decoding table.
DCT(離散コサイン変換)と可変長符号を組み合わせて用い、DCT係数の数列の連続するゼロ係数とその後の非ゼロ係数に可変長ビットの符号語を割り当てた画像符号化方式で符号化された符号データを復号するための復号方法において、
全ての種類の符号語のうち1個の符号語が現れたときに復号情報を出力する第1の復号テーブルと、ゼロランがある所定量より少ない情報に割り当てられた符号語が複数連続した符号語パターンの入力に対して複数符号語分の復号情報を出力する第2の復号テーブルと、前記第1の復号テーブルの出力と前記第2の復号テーブルの出力とのどちらか一方を選択するための選択手段とを備える復号装置を用い、
符号データを前記第1の復号テーブルと前記第2の復号テーブルとの両方に与えて復号を並列におこない、前記第2の復号テーブルによって複数符号語が同時に復号された場合は前記選択手段によって前記第2の復号テーブルの出力を選択し、
前記第2の復号テーブルによって復号できなかった場合は前記選択手段によって前記第1の復号テーブルの出力を選択する
ことを特徴とする復号方法。
A code encoded by an image encoding method using a combination of DCT (Discrete Cosine Transform) and a variable-length code, and assigning a variable-length bit codeword to consecutive zero coefficients of a sequence of DCT coefficients and subsequent non-zero coefficients. In a decoding method for decoding data,
A first decoding table that outputs decoding information when one codeword of all types of codewords appears, and a codeword in which a plurality of codewords assigned to information less than a predetermined amount of zero run are consecutive A second decoding table for outputting decoding information for a plurality of code words in response to a pattern input, and an output for selecting one of the output of the first decoding table and the output of the second decoding table. Using a decoding device comprising selection means,
Code data is supplied to both the first decoding table and the second decoding table to perform decoding in parallel, and when a plurality of codewords are simultaneously decoded by the second decoding table, the selection means Select the output of the second decoding table,
A decoding method characterized by selecting an output of the first decoding table by the selection means when the second decoding table cannot be decoded.
JP2002210499A 2002-07-19 2002-07-19 Decoding device and decoding method Expired - Fee Related JP4013680B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002210499A JP4013680B2 (en) 2002-07-19 2002-07-19 Decoding device and decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002210499A JP4013680B2 (en) 2002-07-19 2002-07-19 Decoding device and decoding method

Publications (2)

Publication Number Publication Date
JP2004056417A JP2004056417A (en) 2004-02-19
JP4013680B2 true JP4013680B2 (en) 2007-11-28

Family

ID=31933984

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002210499A Expired - Fee Related JP4013680B2 (en) 2002-07-19 2002-07-19 Decoding device and decoding method

Country Status (1)

Country Link
JP (1) JP4013680B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4841496B2 (en) * 2007-04-26 2011-12-21 パナソニック株式会社 Variable length code decoding apparatus
JP2013016897A (en) 2011-06-30 2013-01-24 Toshiba Corp Variable-length code decoder, code system and variable-length code decoding method
JP2014161012A (en) * 2014-02-24 2014-09-04 European Space Agency Receiver and transmitter for use in satellite navigation system
JP6492471B2 (en) * 2014-09-11 2019-04-03 富士ゼロックス株式会社 Decoding processing apparatus and program
US9538044B2 (en) * 2015-03-20 2017-01-03 Kyocera Document Solutions Inc. Apparatus and method for data decoding

Also Published As

Publication number Publication date
JP2004056417A (en) 2004-02-19

Similar Documents

Publication Publication Date Title
JP3136796B2 (en) Variable length code decoder
US6587057B2 (en) High performance memory efficient variable-length coding decoder
US5045852A (en) Dynamic model selection during data compression
US7894532B2 (en) Variable-length encoding apparatus and method
JP3778087B2 (en) Data encoding apparatus and data decoding apparatus
US20110019730A1 (en) Image encoding method, image decoding method, image encoding apparatus, image decoding apparatus, image encoding program, and image decoding program
US6043765A (en) Method and apparatus for performing a parallel speculative Huffman decoding using both partial and full decoders
JP2006211621A (en) Data compression device and data decompression device
JP3235555B2 (en) Signal decoding apparatus, signal decoding method, and recording medium recording program for causing computer to perform signal decoding processing
JP4013680B2 (en) Decoding device and decoding method
US6313767B1 (en) Decoding apparatus and method
JP2004056758A (en) Variable length coding apparatus and coding method therefor
WO1999059330A2 (en) Method and apparatus for decoding jpeg symbols
US7256719B2 (en) Digital data decompression implemented in a field programmable array device
WO1999059105A1 (en) Method and apparatus utilizing a simplified content-addressable memory for jpeg decoding
KR20050010918A (en) A method and a system for variable-length decoding, and a device for the localization of codewords
JP2003174365A (en) Decoding device and its method
JPH04100390A (en) High efficient encoding system
KR100207428B1 (en) Variable length coding apparatus and method adaptive to changes of the hoffman codes
JPH09307456A (en) Variable length encoding and decoding device and method
Chang et al. Direct mapping architecture for JPEG Huffman decoder
JP2002016501A (en) Variable length decoder
JP4095454B2 (en) Data decoding apparatus and data decoding method
JP2001007706A (en) Decoding device for variable length code
JP3622473B2 (en) Variable length code decoding device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050621

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070329

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070410

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070608

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070903

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

Free format text: PAYMENT UNTIL: 20100921

Year of fee payment: 3

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120921

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120921

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130921

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees