JP3622473B2 - Variable length code decoding device - Google Patents

Variable length code decoding device Download PDF

Info

Publication number
JP3622473B2
JP3622473B2 JP02452598A JP2452598A JP3622473B2 JP 3622473 B2 JP3622473 B2 JP 3622473B2 JP 02452598 A JP02452598 A JP 02452598A JP 2452598 A JP2452598 A JP 2452598A JP 3622473 B2 JP3622473 B2 JP 3622473B2
Authority
JP
Japan
Prior art keywords
code
length
register
dct coefficient
bit
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
JP02452598A
Other languages
Japanese (ja)
Other versions
JPH11225077A (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 JP02452598A priority Critical patent/JP3622473B2/en
Publication of JPH11225077A publication Critical patent/JPH11225077A/en
Application granted granted Critical
Publication of JP3622473B2 publication Critical patent/JP3622473B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、可変長符号とそれに付加される付加情報を用いた符号化方式によって符号化された符号を高速に復号する装置に関するものであり、特にJPEG(Joint Photographic Experts Group)方式などの多階調画像符号化方式におけるハフマン符号を高速に復号する装置として適用できるものである。
【0002】
【従来の技術】
JPEG方式などの多階調画像符号化方式では、画像を例えば8×8画素のブロックに分割して以下のような操作を行なう。
【0003】
▲1▼ブロックの画素値を2次元離散コサイン変換(DCT)によって64個のDCT係数に変換する。
▲2▼この64個のDCT係数を量子化テーブルで持っている量子化ステップで量子化する。
▲3▼量子化された64個のDCT係数のうち1個のDC係数は前ブロックのDC係数との差分をとり、この差分をハフマン符号により可変長符号化し、必要に応じて可変長の付加情報ビットを可変長符号の後に付加し符号ビット列を得る。
▲4▼量子化された64個のDCT係数のうち63個のAC係数はジグザグスキャン順に配列し、この配列の中で連続するゼロの個数とその次にくる非ゼロの係数の値を組として可変長符号化し、必要に応じて可変長の付加情報ビットを可変長符号の後に付加することによって符号ビット列を得る。
【0004】
復号装置では前記符号化の過程を逆にたどることによって画像を復元する。
【0005】
上記の符号化方式で符号化された符号を復号する装置は、例えば、特開平4−133522号公報、特開平3−247020号公報、特開平4−23521号公報、特開平5−63586号公報、特開平9−130265号公報、特開平9−130266号公報に開示されている。
【0006】
図11は、これら従来の復号装置を説明するためのものであり、図11において、11、12は入力符号ビット列を保持するラッチ、13はバレルシフタ、14は変換回路、15は後段へのデータを一時保持する出力用ラッチ、16は累算回路、17はEOBの検出データを一時保持するEOB検出用ラッチである。
【0007】
符号ビット列は可変長符号(ハフマン符号)とこれに続く付加ビットを継続してなり、可変長符号は付加ビットのビット長またはビット長とゼロのランレングスとの組合わせを表す。変換回路14は符号ビット列の可変長符号を復号し、可変長符号のビット長、付加ビットのビット長、ゼロのランレングス等を生成し、ラッチ15を介して所望のデータを後続の付加ビット取出し部に送るものである。また、累算回路16は変換回路14から可変長符号および付加ビットのトータルのビット長を知り、バレルシフタ13やラッチのシフトを制御するものである。また、EOB検出用のラッチ17はEOBの検出によりつぎにDC係数が来ることを通知するものである。
【0008】
すなわち、従来の構成では、符号ビット列のなかの複数ビットを保持するレジスタまたはラッチ11、12を複数設け、このレジスタに保持された符号ビット列の中から復号に必要な有効ビット列をセレクタまたはバレルシフタ13を用いて取り出す。そして、この有効ビット列をROMまたはPLAなどで構成された変換回路14に入力し、変換回路14の出力の一部を復号データとして出力する。また変換回路14の出力の他の一部を用いて前記レジスタ11、12の内容の更新と前記セレクタ13による次の有効ビット列の取り出しを制御し、変換回路14の出力の他の一部を用いて可変長符号の後に付加されている付加情報ビットの取り出しを制御するようにしている。
【0009】
ところで、上記の多階調画像符号化方式による符号の復号において、DC係数の可変長符号の復号とAC係数の可変長符号の復号では違う変換回路を用いる必要があるが、従来技術に示した復号装置では変換回路を適切に使い分けることができない。特開平4−133522号公報に示された復号回路では、符号列中のEOB(End of Block)符号を検出することによって変換回路を切り替える回路としているが、AC係数の63番目が非ゼロの場合はブロックの最後にEOB符号が出力されないので、正しく切り替えることはできない。
【0010】
また、可変長符号の復号装置から出力される復号データは、次段の逆量子化装置へ入力されるが、現在出力している復号データがDCT係数の何番目なのかという情報を出力していないため、逆量子化装置において逆量子化に用いる量子化テーブルを管理する必要がある。
【0011】
【発明が解決しようとする課題】
本発明は、以上の事情を考慮してなされたものであり、AC係数の可変長符号とDC係数の可変長符号とを簡易かつ確実に区別できるようにすることを目的としている。
【0012】
【課題を解決するための手段】
本発明の可変長符号の復号装置は、複数ビット並列に入力される符号ビット列を保持するための第一のレジスタと、第一のレジスタに新たな符号ビット列が書き込まれた時に、それまで第一のレジスタに保持されていた符号ビット列を保持するための第二のレジスタと、第一と第二のレジスタに保持されている符号ビット列から復号すべき符号ビット列を取り出すためのセレクタと、復号すべき符号ビット列を入力として、復号データ、可変長符号の符号長、可変長の付加情報ビットのビット長、可変長符号の符号長と可変長の付加情報ビットのビット長を加算した復号済符号長を出力する変換回路と、変換回路から出力される復号済符号長を用いて第一と第二のレジスタの内容を更新し、次に復号する符号ビット列の取り出し位置をセレクタに指示し、本装置に符号を出力している前段の装置に対して新たな符号ビット列を要求する制御回路と、復号データに含まれるAC係数のゼロのランレングスとEOB(End of Block)符号を用いて現在復号しているDCT係数がブロックのなかの何番目のDCT係数かを管理するDCT係数位置レジスタと、DCT係数位置レジスタの出力を用いてDC係数用の変換回路とAC係数用の変換回路を切り替える装置と、前記セレクタの出力と前記変換回路の出力とDCT係数位置レジスタの出力を後段の装置に出力するためのレジスタとを含んで構成される。
【0013】
以上のように復号装置を構成することによって、1クロックサイクルで必ず1つの可変長符号を解釈し復号することができ、復号スピードを保証することができる。また、可変長符号に付加される付加情報ビットも次段の回路で容易に取り出すことができる。また、DCT係数位置レジスタを備えたことによって、DC係数用の変換回路とAC係数用の変換回路を適切にきりかえることができる。さらに、DCT係数位置レジスタの出力が後段の回路へ出力されているので、逆量子化回路では、この値を用いて量子化テーブルから必要な量子化ステップ値を容易に得ることができる。
【0014】
【発明の実施の態様】
以下、本発明の実施例について説明する。
【0015】
図1は本発明の実施例の可変長復号装置(付加ビット検出用前段)の構成を全体として示しており、この図において、可変長復号装置は、第一のレジスタ101、第二のレジスタ102、符号セレクタ回路103、変換回路104、復号起動回路105、符号選択制御回路106、DCT係数位置レジスタ107、出力レジスタ108を含んで構成されている。
【0016】
前段の装置から入力される符号ビット列CodeInは、第一のレジスタ101に保持される。第一のレジスタ101のビット数は、可変長符号の最大符号長と可変長付加情報ビットの最大ビット長を加えた値以上でなければならない。JPEG方式の一般的な符号化方法では、最大符号長は16ビット、最大付加情報ビット長は11ビットなので、レジスタ101のビット数は27ビット以上必要である。電子回路への実装が容易となるように、本実施例ではレジスタ101のビット数は32ビットとする。このレジスタは図2のようにマルチプレクサ111とフリップフロップ111とを接続し、さらにこれを並列に配列することによって実現することができる。第一のレジスタ101への符号ビット列のロードはロード信号で制御される。
【0017】
第二のレジスタ102は、第一のレジスタ101と同様に構成され、第一のレジスタ101に新たな符号ビット列がロードされたときに、それまで第一のレジスタ101に保持されていた符号ビット列をロードする。このロード動作は、第二のレジスタ102に保持されている符号ビット列の復号が全て終了した時に行なわれる。
【0018】
第一のレジスタ101の符号32ビットと第二レジスタ102の符号32ビットは連結されて、64ビットの符号列bit63−0として符号セレクタ103に入力される。本実施例では、32ビットの符号列のMSB側から順に符号が詰められているものとする。この場合、64ビットの上位半分の32ビットは第二レジスタ102の符号32ビットとし、下位32ビットは第一レジスタ101の符号32ビットとし、第一と第二のレジスタのMSB側が連結後の符号ビット列のMSB側となるように連結する。
【0019】
セレクタ回路103は、図3に示すように5ビットのセレクト信号によって、入力された64ビットの符号列bit63−0から27ビットの符号code26−0を切り出して出力する。セレクト信号が’00000’の場合はビット63−37を出力し、セレクト信号の値が1増加するごとに1ビット下位にずれた位置の符号を切り出し、セレクト信号が’11111’の場合はビット32−6を出力する。セレクタ回路103は、マルチプレクサを多段階、並列に接続して実現することができる。
【0020】
セレクタ回路103から出力される27ビットの符号列のうち、可変長符号を含む上位16ビットはハフマン符号テーブルによる変換を行う変換回路104に入力する。変換回路104の入力と出力の例として、JPEG方式の画像符号化において画像の輝度成分を復号する場合に一般的に用いられる変換テーブルの入力と出力を図4に示す。
【0021】
変換回路104の入力table−in16−0の最上位ビットはDC係数用の変換テーブルとAC係数用の変換テーブルを切り換える信号を入力する。入力の残り16ビットは、セレクタ回路103の出力の上位16ビットを入力する。図4の例において、セレクタ回路103からの入力ビットとして16ビット未満の入力パターンしか示されていないワードがあるが、これは不足分の下位ビットがドントケアであることを示している。例えば、3行目の入力パターンは’011’となっているが、これは入力された符号列のうち上位3ビットが’011’ならば、残りの13ビットの値にかかわらず、出力は右に示されている’00101 0000 0010’であることを示している。
【0022】
変換回路104の出力としては、復号データ、可変長符号の符号長、可変長の付加情報ビットのビット長、可変長符号の符号長と可変長の付加情報ビットのビット長を加算した復号済符号長の4つの情報が必要である。しかし、このうちの復号データ以外の3つについては、2つが判っていれば残り1つを容易に得ることができるので、かならずしも3つ全てを変換回路104から出力する必要はない。図4の例の出力信号table−out12−0では、上位5ビットは可変長符号の符号長と可変長の付加情報ビットのビット長を加算した復号済符号長、次の4ビットはAC係数列中のゼロのランレングスを示す復号データ、最下位の4ビットは付加情報ビットのビット長である。
【0023】
復号テーブルによる変換回路104の実装方法の一例として、図4のような入出力の関係を論理合成ツールに与えて、この関係を満足する論理回路を自動合成する方法がある。図4の例の復号テーブルの場合は、論理セル数が700以下、入力から出力までの遅延時間が論理セル15段分以下という、小規模で高速な回路で実装することができる。
【0024】
変換回路104の他の実装方法の一例として、ROM、RAMなどのメモリ回路による実装がある。この場合、図4の例の復号テーブルを実装するためには、アドレス入力17ビット、データ出力13ビット必要である。よって回路規模は、13ビット×131072ワードとなる。RAMを用いて実装した場合は、回路の動作中に適切なタイミングでRAMの内容を書き換えることによって、複数の符号化・復号化テーブルに対応することができるという利点がある。
【0025】
復号起動回路105の構成例を図5に示す。復号起動回路105はステートロジック112およびラッチ113を含む。Start信号によってStateが変化する例を図6に示す。この例では、Start信号がLになるとStateは’00’になり、Start信号がHになると次のクロックサイクルからStateは’01’→’10’→’11’と変化し、次にStart信号がLになるまでStateは’11’に留まる。Stateが’00’のときは回路は停止状態である。Stateが’01’と’10’のときは、第一のレジスタ101と第二のレジスタ102に最初の2ワード(64ビット)の符号列をロードしており、復号は開始されていない。Stateが’11’のときは、1サイクルに1符号が復号され、必要に応じて第一のレジスタ101と第二のレジスタ102に新たな符号列がロードされる。
【0026】
符号選択制御回路106の構成例を図7に示す。符号選択制御回路106は加算器116、第一のスタートロジック114、第二のスタートロジック115、ラッチ117を含む。この制御回路106から出力されるセレクト信号によってセレクタ回路103をきりかえて、ロード信号によって第一のレジスタ101と第二のレジスタ102と復号装置の前段にあって符号ビット列を出力する装置を制御する。セレクト信号は、変換回路104の出力の上位5ビットtable−out12−8を加算することによって毎サイクル更新する。ロード信号は、加算器116のキャリーアウトを出力する。また、復号装置が起動するときは、起動回路105のState信号によって、セレクト信号とロード信号は、図8のように出力される。
【0027】
DCT係数位置レジスタ107の構成例を図9に示す。DCT係数位置レジスタ107は、NAND回路118、AND回路121、NOR回路119、120、OR回路122、ラッチ123、加算器124、増分器125を含んで構成されている。DCT係数位置レジスタ107の出力CoefPositionは、変換回路104の出力table−out7−4と’1’を加算することによって毎サイクル更新する。復号装置が起動するときは、Stateが’11’になるまで、CoefPosition=’000000’とする。また、変換回路4は、EOB(End of Block)に対して、table−out7−0=’00000000’を出力するので、この場合もCoefPosition=’000000’とする。また、CoefPosition=’000000’のときはDC/AC=’0’とし、それ以外の場合はDC/AC=’1’として、変換回路104のDC係数用の変換テーブルとAC係数用の変換テーブルを切り換える。なお、図1に破線で示すように符号セレクタ回路103からの符号ビット列(TableIn16−0)を直接にDCT係数位置レジスタ107に供給してEOBを検出してDC/AC=’0’としてもよい。
【0028】
セレクタ回路103の出力、変換回路104の出力、DCT係数位置レジスタ107の出力は、出力レジスタ108で同期をとって次段の回路に出力する。レジスタ108は、フリップフロップを並列に接続して構成できる。
【0029】
この回路の次段に接続する回路の構成例を図10に示す。次段の回路は、DCT係数セレクタ回路126、差分符号復号回路127、マルチプレクサ128、乗算器129、量子化係数出力回路130、ランレングス符号復号回路131を含んで構成されている。変換回路104から出力される符号長と付加情報ビット長を使って、セレクタ回路103から出力される符号ビット列から量子化されたDCT係数を得る。DC係数の場合は、前ブロックとの差分からDCT係数に戻す。DCT係数位置レジスタ107の出力を使って量子化テーブルから量子化ステップを得、乗算器129で逆量子化する。このように、可変長符号復号装置にDCT係数位置レジスタ107を設けたことによって、次段の回路を単純な構成とすることができ、高速動作が可能な回路とすることができる。
【0030】
【発明の効果】
本発明によれば、1クロックサイクルで必ず1つの可変長符号を解釈し復号することができ、符号長によらず復号スピードを保証することができる。また、可変長符号に付加される付加情報ビットも次段の回路で容易に取り出すことができる。また、DCT係数位置レジスタを備えたことによって、DC係数用の変換回路とAC係数用の変換回路を適切にきりかえることができる。さらに、DCT係数位置レジスタの出力が次段の回路へ出力されているので、逆量子化回路では、この値を用いて量子化テーブルから必要な量子化ステップ値を容易に得ることができる。
【図面の簡単な説明】
【図1】本発明の実施例を全体として示すブロック図である。
【図2】第一と第二のレジスタを構成する1ビット分のレジスタの構成例を示すブロック図である。
【図3】符号セレクタ回路の構成例を示すブロック図である。
【図4】変換回路の入出力関係の一例を示す図である。
【図5】復号起動回路の構成例を示すブロック図である。
【図6】復号起動回路の入出力信号波形を示す波形図である。
【図7】第一と第二のレジスタとセレクタ回路を制御する符号選択制御回路の構成例を示すブロック図である。
【図8】符号選択制御回路の起動時の動作を説明する図である。
【図9】DCT係数位置レジスタの構成例を示すブロック図である。
【図10】本発明の可変長符号の復号装置の次段に接続する回路を全体として示すブロック図である。
【図11】従来技術を示すブロック図である。
【符号の説明】
101 符号ビット列を保持する第一のレジスタ
102 符号ビット列を保持する第二のレジスタ
103 符号セレクタ回路
104 変換回路
105 復号起動回路
106 符号選択制御回路
107 DCT係数位置レジスタ
108 出力レジスタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an apparatus for rapidly decoding a code encoded by an encoding method using a variable length code and additional information added thereto, and in particular, a multi-order such as a JPEG (Joint Photographic Experts Group) method. The present invention can be applied as a device that decodes a Huffman code in a video encoding system at high speed.
[0002]
[Prior art]
In a multi-tone image encoding method such as the JPEG method, an image is divided into blocks of 8 × 8 pixels, for example, and the following operations are performed.
[0003]
(1) The pixel value of the block is converted into 64 DCT coefficients by two-dimensional discrete cosine transform (DCT).
{Circle around (2)} The 64 DCT coefficients are quantized in the quantization step possessed by the quantization table.
(3) One of the 64 quantized DCT coefficients takes a difference from the DC coefficient of the previous block, and the difference is variable-length encoded by a Huffman code, and a variable length is added if necessary. An information bit is added after the variable length code to obtain a code bit string.
(4) 63 AC coefficients out of 64 quantized DCT coefficients are arranged in a zigzag scan order, and the number of consecutive zeros in this array and the value of the next nonzero coefficient are taken as a set. A code bit string is obtained by performing variable length coding and adding variable length additional information bits after the variable length code as necessary.
[0004]
The decoding apparatus restores the image by following the encoding process in reverse.
[0005]
For example, Japanese Patent Laid-Open Nos. 4-133522, 3-247020, 4-23521, and 5-63586 are disclosed as apparatuses for decoding codes encoded by the above-described encoding method. JP-A-9-130265 and JP-A-9-130266.
[0006]
FIG. 11 is a diagram for explaining these conventional decoding apparatuses. In FIG. 11, 11 and 12 are latches for holding an input code bit string, 13 is a barrel shifter, 14 is a conversion circuit, and 15 is data for the subsequent stage. An output latch for temporarily holding, an accumulation circuit 16, and an EOB detection latch 17 for temporarily holding EOB detection data.
[0007]
The code bit string is composed of a variable length code (Huffman code) followed by additional bits, and the variable length code represents a bit length of the additional bits or a combination of a bit length and a run length of zero. The conversion circuit 14 decodes the variable length code of the code bit string, generates the bit length of the variable length code, the bit length of the additional bits, the run length of zero, etc., and takes out the desired data through the latch 15 and the subsequent additional bits To send to the department. The accumulator circuit 16 knows the total bit length of the variable length code and additional bits from the conversion circuit 14, and controls the shift of the barrel shifter 13 and the latch. Further, the EOB detection latch 17 notifies that the next DC coefficient comes upon detection of EOB.
[0008]
That is, in the conventional configuration, a plurality of registers or latches 11 and 12 for holding a plurality of bits in a code bit string are provided, and a valid bit string necessary for decoding is selected from a code bit string held in the register by a selector or barrel shifter 13. Use to remove. Then, this effective bit string is input to the conversion circuit 14 constituted by ROM or PLA, and a part of the output of the conversion circuit 14 is output as decoded data. The other part of the output of the conversion circuit 14 is used to control the updating of the contents of the registers 11 and 12 and the extraction of the next valid bit string by the selector 13, and the other part of the output of the conversion circuit 14 is used. Thus, extraction of additional information bits added after the variable length code is controlled.
[0009]
By the way, in the decoding of the code by the above multi-tone image coding method, it is necessary to use different conversion circuits for the decoding of the variable length code of the DC coefficient and the decoding of the variable length code of the AC coefficient. The decoding device cannot properly use the conversion circuit properly. In the decoding circuit disclosed in Japanese Patent Laid-Open No. 4-133522, the conversion circuit is switched by detecting an EOB (End of Block) code in the code string. However, when the 63rd AC coefficient is non-zero Since the EOB code is not output at the end of the block, switching cannot be performed correctly.
[0010]
Also, the decoded data output from the variable length code decoding device is input to the next-stage inverse quantization device, which outputs information indicating what number of DCT coefficients the currently output decoded data is. Therefore, it is necessary to manage a quantization table used for inverse quantization in the inverse quantization apparatus.
[0011]
[Problems to be solved by the invention]
The present invention has been made in view of the above circumstances, and an object of the present invention is to make it possible to easily and reliably distinguish between a variable length code of an AC coefficient and a variable length code of a DC coefficient.
[0012]
[Means for Solving the Problems]
The variable length code decoding apparatus according to the present invention includes a first register for holding a code bit string input in parallel with a plurality of bits, and a new code bit string written to the first register until then. A second register for holding the code bit string held in the first register, a selector for taking out the code bit string to be decoded from the code bit strings held in the first and second registers, and With the code bit string as input, the decoded data, the code length of the variable length code, the bit length of the variable length additional information bit, the code length of the variable length code and the bit length of the variable length additional information bit are added. The conversion circuit to output and the decoded code length output from the conversion circuit are used to update the contents of the first and second registers, and the position to extract the code bit string to be decoded next is selected. And a control circuit that requests a new code bit string from the preceding apparatus outputting the code to the apparatus, a zero run length of the AC coefficient included in the decoded data, and an EOB (End of Block) code The DCT coefficient position register for managing the DCT coefficient currently decoded in the block using the DCT coefficient position register, the DCT coefficient position register using the output of the DCT coefficient position register and the DC coefficient conversion circuit A device for switching the conversion circuit, and a register for outputting the output of the selector, the output of the conversion circuit, and the output of the DCT coefficient position register to the subsequent device.
[0013]
By configuring the decoding device as described above, one variable length code can always be interpreted and decoded in one clock cycle, and the decoding speed can be guaranteed. Further, additional information bits added to the variable length code can be easily taken out by a circuit in the next stage. Further, by providing the DCT coefficient position register, the DC coefficient conversion circuit and the AC coefficient conversion circuit can be appropriately switched. Furthermore, since the output of the DCT coefficient position register is output to the subsequent circuit, the inverse quantization circuit can easily obtain the required quantization step value from the quantization table using this value.
[0014]
BEST MODE FOR CARRYING OUT THE INVENTION
Examples of the present invention will be described below.
[0015]
FIG. 1 shows the overall configuration of a variable-length decoding apparatus (previous stage for detecting additional bits) according to an embodiment of the present invention. In this figure, the variable-length decoding apparatus includes a first register 101 and a second register 102. , A code selector circuit 103, a conversion circuit 104, a decoding start circuit 105, a code selection control circuit 106, a DCT coefficient position register 107, and an output register 108.
[0016]
The code bit string CodeIn input from the preceding apparatus is held in the first register 101. The number of bits of the first register 101 must be equal to or greater than the value obtained by adding the maximum code length of the variable length code and the maximum bit length of the variable length additional information bits. In a general JPEG encoding method, the maximum code length is 16 bits and the maximum additional information bit length is 11 bits. Therefore, the number of bits of the register 101 is 27 bits or more. In this embodiment, the number of bits of the register 101 is 32 bits so that the electronic circuit can be easily mounted. This register can be realized by connecting the multiplexer 111 and the flip-flop 111 as shown in FIG. 2 and arranging them in parallel. The loading of the code bit string to the first register 101 is controlled by a load signal.
[0017]
The second register 102 is configured in the same manner as the first register 101. When a new code bit string is loaded into the first register 101, the code bit string held in the first register 101 until then is stored. Load it. This loading operation is performed when the decoding of the code bit string held in the second register 102 is completed.
[0018]
The code 32 bits of the first register 101 and the code 32 bits of the second register 102 are concatenated and input to the code selector 103 as a 64-bit code string bit 63-0. In this embodiment, it is assumed that codes are packed in order from the MSB side of a 32-bit code string. In this case, the upper 32 bits of the 64 bits are the 32 bits of the code of the second register 102, the lower 32 bits are the 32 bits of the code of the first register 101, and the MSB side of the first and second registers is the code after the connection. They are concatenated so that they are on the MSB side of the bit string.
[0019]
As shown in FIG. 3, the selector circuit 103 cuts out and outputs a 27-bit code code 26-0 from the input 64-bit code sequence bit 63-0 in response to a 5-bit select signal. When the select signal is “00000”, bits 63-37 are output, and whenever the value of the select signal increases by 1, the code at the position shifted to the lower one bit is cut out. When the select signal is “11111”, bit 32 is output. Output -6. The selector circuit 103 can be realized by connecting multiplexers in multiple stages in parallel.
[0020]
Of the 27-bit code string output from the selector circuit 103, the upper 16 bits including the variable length code are input to the conversion circuit 104 that performs conversion using the Huffman code table. As an example of input and output of the conversion circuit 104, FIG. 4 shows input and output of a conversion table that is generally used when decoding the luminance component of an image in JPEG image encoding.
[0021]
The most significant bit of the input table-in 16-0 of the conversion circuit 104 inputs a signal for switching between a DC coefficient conversion table and an AC coefficient conversion table. The remaining 16 bits of the input are the upper 16 bits of the output of the selector circuit 103. In the example of FIG. 4, there is a word in which only an input pattern of less than 16 bits is shown as an input bit from the selector circuit 103, which indicates that the insufficient lower-order bits are don't care. For example, the input pattern of the third row is “011”. If the upper 3 bits of the input code string are “011”, the output is right regardless of the remaining 13-bit value. '00101 0000 0010' shown in FIG.
[0022]
The output of the conversion circuit 104 includes decoded data, the code length of the variable length code, the bit length of the variable length additional information bit, and the decoded code obtained by adding the code length of the variable length code and the bit length of the variable length additional information bit Four pieces of long information are required. However, since it is possible to easily obtain the remaining one of the three other than the decoded data if the two are known, it is not always necessary to output all three from the conversion circuit 104. In the output signal table-out12-0 in the example of FIG. 4, the upper 5 bits are the decoded code length obtained by adding the code length of the variable length code and the bit length of the variable length additional information bit, and the next 4 bits are the AC coefficient sequence The decoded data indicating the run length of zero in the middle, and the least significant 4 bits are the bit length of the additional information bits.
[0023]
As an example of a method for mounting the conversion circuit 104 using a decoding table, there is a method in which an input / output relationship as shown in FIG. 4 is given to a logic synthesis tool and a logic circuit that satisfies this relationship is automatically synthesized. In the case of the decoding table in the example of FIG. 4, it can be implemented with a small and high-speed circuit in which the number of logic cells is 700 or less and the delay time from input to output is 15 stages or less of logic cells.
[0024]
As an example of another mounting method of the conversion circuit 104, there is mounting by a memory circuit such as a ROM or a RAM. In this case, 17 bits of address input and 13 bits of data output are required to implement the decoding table of the example of FIG. Therefore, the circuit scale is 13 bits × 131072 words. When implemented using a RAM, there is an advantage that a plurality of encoding / decoding tables can be handled by rewriting the contents of the RAM at an appropriate timing during the operation of the circuit.
[0025]
A configuration example of the decryption activation circuit 105 is shown in FIG. The decryption activation circuit 105 includes a state logic 112 and a latch 113. FIG. 6 shows an example in which the State changes according to the Start signal. In this example, when the Start signal becomes L, the State becomes “00”. When the Start signal becomes H, the State changes from “01” → “10” → “11” from the next clock cycle, and then the Start signal. State stays at “11” until becomes L. When State is “00”, the circuit is in a stopped state. When the State is '01' and '10', the first two words (64 bits) code string is loaded into the first register 101 and the second register 102, and decoding is not started. When State is “11”, one code is decoded in one cycle, and a new code string is loaded into the first register 101 and the second register 102 as necessary.
[0026]
A configuration example of the code selection control circuit 106 is shown in FIG. The sign selection control circuit 106 includes an adder 116, a first start logic 114, a second start logic 115, and a latch 117. The selector circuit 103 is switched by the select signal output from the control circuit 106, and the first register 101, the second register 102, and the device that outputs the code bit string in the preceding stage of the decoding device are controlled by the load signal. . The select signal is updated every cycle by adding the upper 5 bits table-out12-8 of the output of the conversion circuit 104. The load signal outputs the carry out of the adder 116. When the decoding device is activated, the select signal and the load signal are output as shown in FIG.
[0027]
A configuration example of the DCT coefficient position register 107 is shown in FIG. The DCT coefficient position register 107 includes a NAND circuit 118, an AND circuit 121, NOR circuits 119 and 120, an OR circuit 122, a latch 123, an adder 124, and an incrementer 125. The output CoefPosition of the DCT coefficient position register 107 is updated every cycle by adding “1” to the output table-out7-4 of the conversion circuit 104. When the decryption device is activated, CoefPosition = '000000' until State becomes '11'. In addition, since the conversion circuit 4 outputs table-out7-0 = '00000000' to EOB (End of Block), CoefPosition = '000000' is set in this case as well. Also, when CoefPosition = '000000', DC / AC = '0', otherwise DC / AC = '1', and the DC coefficient conversion table and AC coefficient conversion table of the conversion circuit 104. Switch. As indicated by a broken line in FIG. 1, the code bit string (TableIn16-0) from the code selector circuit 103 may be directly supplied to the DCT coefficient position register 107 to detect EOB and set DC / AC = '0'. .
[0028]
The output of the selector circuit 103, the output of the conversion circuit 104, and the output of the DCT coefficient position register 107 are synchronized with the output register 108 and output to the next stage circuit. The register 108 can be configured by connecting flip-flops in parallel.
[0029]
FIG. 10 shows a configuration example of a circuit connected to the next stage of this circuit. The circuit in the next stage includes a DCT coefficient selector circuit 126, a differential code decoding circuit 127, a multiplexer 128, a multiplier 129, a quantization coefficient output circuit 130, and a run length code decoding circuit 131. Using the code length output from the conversion circuit 104 and the additional information bit length, a DCT coefficient quantized from the code bit string output from the selector circuit 103 is obtained. In the case of a DC coefficient, the DCT coefficient is restored from the difference from the previous block. The output of the DCT coefficient position register 107 is used to obtain a quantization step from the quantization table, and the multiplier 129 performs inverse quantization. As described above, by providing the DCT coefficient position register 107 in the variable length code decoding apparatus, the circuit of the next stage can be made simple and a circuit capable of high speed operation can be obtained.
[0030]
【The invention's effect】
According to the present invention, one variable length code can always be interpreted and decoded in one clock cycle, and the decoding speed can be guaranteed regardless of the code length. Further, additional information bits added to the variable length code can be easily taken out by a circuit in the next stage. Further, by providing the DCT coefficient position register, the DC coefficient conversion circuit and the AC coefficient conversion circuit can be appropriately switched. Further, since the output of the DCT coefficient position register is output to the next-stage circuit, the inverse quantization circuit can easily obtain the necessary quantization step value from the quantization table using this value.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of the present invention as a whole.
FIG. 2 is a block diagram illustrating a configuration example of a 1-bit register configuring the first and second registers.
FIG. 3 is a block diagram illustrating a configuration example of a code selector circuit.
FIG. 4 is a diagram illustrating an example of an input / output relationship of a conversion circuit.
FIG. 5 is a block diagram illustrating a configuration example of a decoding start circuit.
FIG. 6 is a waveform diagram showing input / output signal waveforms of a decoding start circuit.
FIG. 7 is a block diagram illustrating a configuration example of a code selection control circuit that controls the first and second registers and the selector circuit;
FIG. 8 is a diagram for explaining an operation at the time of activation of a code selection control circuit;
FIG. 9 is a block diagram illustrating a configuration example of a DCT coefficient position register.
FIG. 10 is a block diagram showing the whole circuit connected to the next stage of the variable length code decoding apparatus of the present invention.
FIG. 11 is a block diagram showing a conventional technique.
[Explanation of symbols]
Reference Signs List 101 First register 102 that holds a sign bit string Second register 103 that holds a sign bit string 103 Sign selector circuit 104 Conversion circuit 105 Decode start circuit 106 Sign selection control circuit 107 DCT coefficient position register 108 Output register

Claims (4)

ゼロの交流成分のDCT係数のランレングスとこれに続く非ゼロの交流成分のDCT係数の値とからなる組を符号化する可変長符号復号装置において、
複数ビット並列に入力される符号ビット列を保持する第一のレジスタと、
上記第一のレジスタに新たな符号ビット列が書き込まれた時に、それまで上記第一のレジスタに保持されていた符号ビット列を保持する第二のレジスタと、
上記第一のレジスタおよび上記第二のレジスタに保持されている符号ビット列から復号すべき符号ビット列を取り出すセレクタと、
復号すべき符号ビット列を入力として、復号データ、可変長符号の符号長、可変長の付加情報ビットのビット長、可変長符号の符号長と可変長の付加情報ビットのビット長とを加算した復号済符号長を出力する変換回路と、
上記変換回路から出力される復号済符号長を用いて上記第一のレジスタおよび上記第二のレジスタの内容を更新し、次に復号する符号ビット列の取り出し位置を上記セレクタに指示する制御回路と、
復号データに含まれる、上記ゼロの交流成分のDCT係数のランレングスとこれに続く非ゼロの交流成分のDCT係数の値とからなる組ごとに、当該ゼロの交流成分のDCT係数のランレングスが示す当該ゼロの交流成分のDCT係数の個数と、当該非ゼロの交流成分のDCT係数の個数である1とを累積して得られる、現在復号しているDCT係数がブロックのなかの何番目のDCT係数かを示すDCT係数位置データを記憶するとともに、EOB(End ofBlock)符号により現在のDCT係数位置データを初期値にリセットするDCT係数位置レジスタと、
DCT係数位置レジスタの出力を用いて直流成分のDCT係数用の変換回路と交流成分用のDCT係数用の変換回路を切り替える手段と、
前記セレクタの出力と前記変換回路の出力とDCT係数位置レジスタの出力とを後段の装置に出力するレジスタとを有することを特徴とする可変長符号復号装置。
In a variable length code decoding apparatus that encodes a set consisting of a run length of a DCT coefficient of zero AC component and a value of a DCT coefficient of a non-zero AC component following this,
A first register holding a sign bit string input in parallel in a plurality of bits;
When a new code bit string is written in the first register, a second register that holds the code bit string held in the first register until then,
A selector for extracting a code bit string to be decoded from code bit strings held in the first register and the second register;
Decoding by adding the code bit string to be decoded as input and decoding data, variable length code length, variable length additional information bit length, variable length code length and variable length additional information bit length A conversion circuit for outputting a completed code length;
A control circuit for updating the contents of the first register and the second register using the decoded code length output from the conversion circuit and instructing the selector of the extraction position of the code bit string to be decoded next;
For each set consisting of the run length of the DCT coefficient of the zero alternating current component and the value of the DCT coefficient of the nonzero alternating current component included in the decoded data, the run length of the DCT coefficient of the zero alternating current component is The number of DCT coefficients of the zero AC component shown and the number of DCT coefficients of the non-zero AC component, which is obtained by accumulating the number of DCT coefficients currently being decoded , is the number of DCT coefficients currently decoded in the block. A DCT coefficient position register for storing DCT coefficient position data indicating whether it is a DCT coefficient, and resetting the current DCT coefficient position data to an initial value by an EOB (End of Block) code ;
Means for switching between a DCT coefficient conversion circuit for a DC component and a DCT coefficient conversion circuit for an AC component using the output of the DCT coefficient position register;
A variable-length code decoding apparatus comprising: a register that outputs an output of the selector, an output of the conversion circuit, and an output of a DCT coefficient position register to a subsequent apparatus.
上記変換回路を、入出力の関係を満足する論理回路で構成した請求項1記載の可変長符号復号装置。2. The variable length code decoding apparatus according to claim 1, wherein the conversion circuit is constituted by a logic circuit satisfying an input / output relationship. 上記変換回路を、書換可能なメモリ回路で構成した請求項1記載の可変長符号復号装置。2. The variable length code decoding apparatus according to claim 1 , wherein the conversion circuit is constituted by a rewritable memory circuit. 画像ブロックの直流成分のDCT係数の量子化データの差分を表す可変長の付加ビットと、この付加ビットのビット長に割り当てられた直流成分用の可変長符号と、各交流成分のDCT係数のノンゼロの量子化データを表す可変長の付加ビットと、この付加ビットのビット長および、DCT係数の量子化データがゼロとなる交流成分のランレングスの組合わせに割り当てられた交流成分用の可変長符号とを所定の順序で順次に継続して構成された符号ビット列から、可変長符号および可変長の付加ビットの組を順次に切り出す前段部と、上記前段部からの情報に基づいて上記符号ビット列から上記可変長の付加ビットを取出して復号を行なう後段部とを具備する可変長符号復号装置において、
上記前段部が、
複数ビット並列に入力される符号ビット列を保持する第一のレジスタと、
上記第一のレジスタに新たな符号ビット列が書き込まれた時に、それまで上記第一のレジスタに保持されていた符号ビット列を保持する第二のレジスタと、
上記第一のレジスタおよび上記第二のレジスタに保持されている符号ビット列から復号すべき符号ビット列を取り出すセレクタと、
復号すべき符号ビット列を入力として、可変長符号の符号長および可変長の付加情報ビットのビット長に関するデータ、ならびに復号データに含まれる交流成分のDCT係数の量子化データのゼロのランレングスに関するデータを出力する変換回路と、
上記変換回路から出力されるビット長に関するデータを用いて上記第一のレジスタおよび上記第二のレジスタの内容を更新し、次に復号する符号ビット列の取り出し位置を上記セレクタに指示する制御回路と、
上記交流成分用の可変長符号の各々の復号データに含まれる、上記ゼロの交流成分のD CT係数のランレングスが示す当該ゼロの交流成分のDCT係数の個数とこれに続く非ゼロの交流成分のDCT係数の個数である1とを順次に累積して得られる、現在復号している周波数成分のDCT係数がブロックのなかの何番目のDCT係数かを示すDCT係数位置情報を記憶するとともに、EOB(End of Block)符号により現在のDCT係数位置データを初期値にリセットするDCT係数位置レジスタと、
復号すべき符号ビット列と、可変長符号の符号長および可変長の付加ビットのビット長に関するデータと、上記DCT係数位置レジスタの出力とを上記後段部に出力するレジスタとを有することを特徴とする可変長符号復号装置。
A variable-length additional bit representing a difference in the quantized data of the DCT coefficient of the DC component of the image block, a variable-length code for the DC component assigned to the bit length of the additional bit, and a non-zero DCT coefficient of each AC component Variable-length additional bits representing the quantized data, and the variable length code for the AC component assigned to the combination of the bit length of this additional bit and the run length of the AC component for which the quantized data of the DCT coefficient is zero From the code bit string that is successively constructed in a predetermined order, and from the code bit string based on the information from the preceding stage and the preceding stage part that sequentially cuts out the set of the variable length code and the additional bit of the variable length A variable-length code decoding apparatus comprising a subsequent stage that extracts and decodes the variable-length additional bits;
The front part is
A first register holding a sign bit string input in parallel in a plurality of bits;
When a new code bit string is written in the first register, a second register that holds the code bit string held in the first register until then,
A selector for extracting a code bit string to be decoded from code bit strings held in the first register and the second register;
Data relating to code length of variable length code and bit length of additional information bit of variable length, and data relating to zero run length of quantized data of DCT coefficient of AC component included in decoded data with code bit string to be decoded as input A conversion circuit that outputs
A control circuit for updating the contents of the first register and the second register using data relating to the bit length output from the conversion circuit and instructing the selector of the extraction position of the code bit string to be decoded next;
Included in the decoded data for each variable length code for the AC component, the AC component of the number and the non-zeros which follow the DCT coefficients of the AC component of the zero indicating the run length of the D CT coefficients of the AC component of the zero DCT coefficient position information indicating which DCT coefficient of the frequency component being decoded is the DCT coefficient in the block obtained by sequentially accumulating 1 which is the number of DCT coefficients of A DCT coefficient position register for resetting current DCT coefficient position data to an initial value by an EOB (End of Block) code ;
A code bit sequence to be decoded, a register that outputs data relating to a code length of a variable length code and a bit length of a variable length additional bit, and an output of the DCT coefficient position register to the subsequent stage Variable length code decoding device.
JP02452598A 1998-02-05 1998-02-05 Variable length code decoding device Expired - Fee Related JP3622473B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP02452598A JP3622473B2 (en) 1998-02-05 1998-02-05 Variable length code decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP02452598A JP3622473B2 (en) 1998-02-05 1998-02-05 Variable length code decoding device

Publications (2)

Publication Number Publication Date
JPH11225077A JPH11225077A (en) 1999-08-17
JP3622473B2 true JP3622473B2 (en) 2005-02-23

Family

ID=12140581

Family Applications (1)

Application Number Title Priority Date Filing Date
JP02452598A Expired - Fee Related JP3622473B2 (en) 1998-02-05 1998-02-05 Variable length code decoding device

Country Status (1)

Country Link
JP (1) JP3622473B2 (en)

Also Published As

Publication number Publication date
JPH11225077A (en) 1999-08-17

Similar Documents

Publication Publication Date Title
JP4886755B2 (en) Context-adaptive binary arithmetic encoding and decoding system and method
US6587057B2 (en) High performance memory efficient variable-length coding decoder
US6014095A (en) Variable length encoding system
JP4422833B2 (en) Decoder and method for decoding variable length codeword
US5254991A (en) Method and apparatus for decoding Huffman codes
US5208593A (en) Method and structure for decoding Huffman codes using leading ones detection
US7343542B2 (en) Methods and apparatuses for variable length encoding
JP3227292B2 (en) Encoding device, encoding method, decoding device, decoding method, encoding / decoding device, and encoding / decoding method
JP2766302B2 (en) Variable length code parallel decoding method and apparatus
JPS6148298B2 (en)
Lee et al. $2^{n} $ pattern run-length for test data compression
JPH0645950A (en) Apparatus and method for generation of signal
JPH06104767A (en) Variable length code decoder
JPH1065549A (en) Device for determining length of variable length encoded data value, device for decoding data stream of variable length encoded data value, and method for determining length of variable length encoded data value
JP4065425B2 (en) Variable length coding packing architecture
EP1158807B1 (en) Data stream conversion apparatus and method, variable length coded data stream generation apparatus and method, and camera system
EP0681404A2 (en) Variable-length decoder
US7256719B2 (en) Digital data decompression implemented in a field programmable array device
JP3622473B2 (en) Variable length code decoding device
US5754128A (en) Variable-length code encoding and segmenting apparatus having a byte alignment unit
US6781528B1 (en) Vector handling capable processor and run length encoding
Rudberg et al. New approaches to high speed Huffman decoding
US6707398B1 (en) Methods and apparatuses for packing bitstreams
JP4013680B2 (en) Decoding device and decoding method
KR100292050B1 (en) Data simulator of variable length decoder

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040527

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040601

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040729

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040824

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041019

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041115

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20081203

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091203

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101203

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees