JP3032239B2 - Variable-length code decoding circuit - Google Patents

Variable-length code decoding circuit

Info

Publication number
JP3032239B2
JP3032239B2 JP2126658A JP12665890A JP3032239B2 JP 3032239 B2 JP3032239 B2 JP 3032239B2 JP 2126658 A JP2126658 A JP 2126658A JP 12665890 A JP12665890 A JP 12665890A JP 3032239 B2 JP3032239 B2 JP 3032239B2
Authority
JP
Japan
Prior art keywords
code
data
circuit
code string
length
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
JP2126658A
Other languages
Japanese (ja)
Other versions
JPH0423521A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2126658A priority Critical patent/JP3032239B2/en
Publication of JPH0423521A publication Critical patent/JPH0423521A/en
Application granted granted Critical
Publication of JP3032239B2 publication Critical patent/JP3032239B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、ハフマン符号のような複数の異なる符号
長の符号群からなる可変長符号を、高速で復号処理する
ことの出来る可変長符号の復号回路に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention relates to a variable-length code capable of decoding a variable-length code such as a Huffman code composed of a plurality of codes having different code lengths at a high speed. It relates to a decoding circuit.

〔従来の技術〕[Conventional technology]

少ないビット数で能率よくディジタル信号の伝送また
は記録を行うために、出現確率の高いデータを表す符号
列は短く、出現確率の低いデータを表す符号列は長く設
定し、全体としての平均符号長が最小となるように設定
する符号方式が、可変長符号方式または不等長符号方式
として知られている。その代表的なものにハフマン符号
がある。
In order to efficiently transmit or record digital signals with a small number of bits, the code string representing data with a high probability of occurrence should be short, and the code string representing data with a low probability of occurrence should be long. A coding scheme set to be the minimum is known as a variable-length coding scheme or an unequal-length coding scheme. A typical example is the Huffman code.

第8図にハフマン符号の構成法を示す。ハフマン符号
は、同図(a)に示すように、まず複数M個、例えば6
個の情報源信号R1〜R6を生起確率の大きいものから順に
並べ、生起確率の最も小さい情報源記号2つをまとめて
一つの情報源記号に置き換え、その合成確率を新しい情
報源記号の生起確率とする。この例では、記号R5とR6
をまとめて一つの情報源記号に置き換え、その合成確率
を新しい情報源記号の生起確率としている。この結果、
記号数の一つ少ない新たな情報源記号の組が得られる。
次いで、再び生起確率の大きいものから順に並べ換え、
最後に生起確率「1」の記号が残るまで前述の処理を繰
り返す。このようにして「符号の木」を作り(図
(b))、最後に枝分かれにしたがって“0"と“1"との
符号を各記号に割り当て(図(c))、符号化を終了す
る。
FIG. 8 shows a configuration method of the Huffman code. As shown in FIG. 3A, first, a plurality of Huffman codes, for example, 6
Source information signals R 1 to R 6 are arranged in descending order of occurrence probability, the two information source symbols having the smallest occurrence probability are collectively replaced by one information source symbol, and the combined probability is replaced with the new information source symbol. Probability of occurrence. In this example, replaced by a single information source symbols together and symbols R 5 and R 6, are the combined probability and the probability of occurrence of new sources symbol. As a result,
A new set of source symbols with one less number of symbols is obtained.
Then, rearrange them again in descending order of occurrence probability,
Finally, the above-described processing is repeated until the symbol of the occurrence probability “1” remains. In this way, a "code tree" is created (Fig. (B)). Finally, codes "0" and "1" are assigned to each symbol according to branching (Fig. (C)), and encoding is completed. .

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

こうして生成したハフマン符号の復号は、例えば、復
号するハフマン符号の符号列の各ビットを1ビットづつ
入力し、ビット毎に変換テーブルを参照して行う(特開
昭64−60113号参照)。しかし、この方式によると符号
長が長い符号列については変換テーブルを参照する回数
が増え、高速な復号処理が行えないという不都合があ
る。従って、カラー画像のファイリングシステムのよう
に大量のデータを高速で処理し、利用者が欲しい画像を
瞬時に画面上に表示する必要があるシステムには不適で
ある。
Decoding of the Huffman code generated in this manner is performed, for example, by inputting each bit of a code string of the Huffman code to be decoded one bit at a time and referring to a conversion table for each bit (see JP-A-64-60113). However, according to this method, the number of times of referring to the conversion table for a code string having a long code length increases, and there is a disadvantage that high-speed decoding cannot be performed. Therefore, it is not suitable for a system which needs to process a large amount of data at a high speed and display an image desired by a user on a screen instantly, such as a color image filing system.

この発明は復号する可変長符号を複数ビット単位で並
列処理することにより、復号処理の高速化を図るように
した可変長符号の復号回路を提供することを目的とす
る。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a variable-length code decoding circuit that speeds up a decoding process by performing parallel processing of variable-length codes to be decoded in units of a plurality of bits.

〔課題を解決するための手段〕[Means for solving the problem]

この発明による可変長符号の復号回路は、可変長符号
化された入力符号列を並列複数ビット単位で順次取り込
む第1および第2のデータレジスタと、上記第1および
第2のデータレジスタに記憶した各入力符号列を、指定
されたビット数分LSB側にシフトして上記並列複数ビッ
トの符号列として出力するバレルシフタと、上記バレル
シフタの出力符号列から可変長符号を検出し、その復号
データおよび符号長データを出力する変換手段と、上記
変換回路から出力される符号長データを累算し、その累
算結果を上記バレルシフタにシフトビット数データとし
て供給する累算手段とを設け、上記バレルシフタは上記
変換手段で検出した可変長符号の次の符号列の頭出しを
行うために、上記シフトビット数データで指定されるビ
ット数分上記各入力符号列をLSB側にシフトし、上記第
1および第2のデータレジスタは上記累算手段の累算結
果が所定値を超えるときに上記第1のデータレジスタに
セットされている符号列を上記第2のデータレジスタに
セットし、上記第1のデータレジスタに次の新たな入力
符号列をセットするようにする。
A variable-length code decoding circuit according to the present invention stores first and second data registers for sequentially inputting variable-length-coded input code strings in units of a plurality of parallel bits, and stores the input code strings in the first and second data registers. A barrel shifter that shifts each input code string to the LSB side by a designated number of bits and outputs the parallel multiple-bit code string, and detects a variable-length code from the output code string of the barrel shifter, and decodes the decoded data and code. Conversion means for outputting length data; and accumulation means for accumulating code length data output from the conversion circuit and supplying the accumulation result to the barrel shifter as shift bit number data. In order to perform cueing of a code string next to the variable-length code detected by the conversion means, each of the input codes corresponds to the number of bits specified by the shift bit number data. The first and second data registers shift the code string set in the first data register to the second data register when the accumulation result of the accumulation means exceeds a predetermined value. And the next new input code string is set in the first data register.

〔作 用〕(Operation)

この発明の構成において、可変長符号化された符号列
は並列複数ビット、例えば並列8ビット単位でデータレ
ジスタに取り込まれ、第1の入力符号列はバレルシフタ
のデータ入力部に、第2の入力符号列はバレルシフタの
拡張入力部にそれぞれ入力される。従って、バレルシフ
タには、2組の符号列が並列16ビットの符号列として入
力されることになる。バラルシフタはこの16ビットの符
号列から8ビットの符号列を抽出して変換手段に出力
し、変換手段はこの符号列の中から可変長符号を検出し
て対応する復号データおよび符号長データを出力する。
符号長データは累算手段に入力され、これまで得られた
符号長データの累算値と累算される。
In the configuration of the present invention, the variable-length-encoded code string is fetched into the data register in units of a plurality of parallel bits, for example, 8 bits in parallel, and the first input code string is provided to the data input section of the barrel shifter. The columns are input to the barrel shifter's extended input. Therefore, two sets of code strings are input to the barrel shifter as parallel 16-bit code strings. The balal shifter extracts an 8-bit code string from the 16-bit code string and outputs it to the conversion means. The conversion means detects a variable-length code from the code string and outputs the corresponding decoded data and code length data. I do.
The code length data is input to the accumulating means, and is accumulated with the accumulated value of the code length data obtained so far.

次いで、次に復号する符号列の頭出しを行うために、
累算手段で求めた符号長の累算値をバレルシフタにシフ
トビット数データとして供給する。バレルシフタはこの
シフトビット数データで指定されるビット数分入力符号
列をLSB側にシフトし、新たな8ビットの符号列の抽出
して変換手段に出力する。符号長データの累算値が所定
値「8」を超えると、第1のデータレジスタにセットさ
れている符号列を上記第2のデータレジスタにセット
し、第1のデータレジスタに次の新たな入力符号列をセ
ットして復号処理を繰り返す。
Next, in order to find the beginning of the code string to be decoded next,
The accumulated value of the code length obtained by the accumulation means is supplied to the barrel shifter as shift bit number data. The barrel shifter shifts the input code string to the LSB side by the number of bits specified by the shift bit number data, extracts a new 8-bit code string, and outputs it to the conversion means. When the accumulated value of the code length data exceeds a predetermined value "8", the code string set in the first data register is set in the second data register, and the next new data is stored in the first data register. The input code string is set and the decoding process is repeated.

〔実施例〕〔Example〕

第1図はこの発明による可変長符号の復号回路の一実
施例を示す構成図である。なお、この実施例では、可変
長符号としてハフマン符号を例に取り説明する。
FIG. 1 is a block diagram showing one embodiment of a variable length code decoding circuit according to the present invention. In this embodiment, a Huffman code will be described as an example of a variable length code.

この復号回路は、ハフマン符号化された入力符号列を
並列複数ビット単位で順次取り込む第1および第2のデ
ータレジスタ1および2と、この第1および第2のデー
タレジスタ1および2に記憶された符号列を、後述する
シフトビット数データによって所定のビット数分シフト
して出力するバレルシフタ3と、このバレルシフタ3の
出力からハフマン符号を検出し、その復号データおよび
符号長データを出力する変換回路4と、現在復号処理し
ている符号列の次の符号列の頭出しを行うために、バレ
ルシフタ3にシフトビット数データを供給する累算回路
5と、これらレジスタ1〜累算回路5の動作を制御する
制御回路6とから構成されている。
The decoding circuit includes first and second data registers 1 and 2 which sequentially take in a Huffman-encoded input code sequence in units of a plurality of bits, and store the data in the first and second data registers 1 and 2. A barrel shifter 3 that shifts the code string by a predetermined number of bits according to shift bit number data to be described later and outputs the same, and a conversion circuit 4 that detects a Huffman code from the output of the barrel shifter 3 and outputs decoded data and code length data. And an accumulation circuit 5 for supplying shift bit number data to the barrel shifter 3 in order to find the beginning of a code string next to the code string currently being decoded, and the operation of these registers 1 to 5 And a control circuit 6 for controlling.

データレジスタ1および2はハフマン符号化された並
列複数ビット、例えば8ビットの入力符号列ID0〜ID
7を、制御回路6からのロード信号LD1によって順次一時
的に記憶する直列2段構成のレジスタである。
The data registers 1 and 2 are Huffman-coded parallel plural bits, for example, 8-bit input code strings ID 0 to ID.
7, a register sequentially temporarily stores series two stages by the load signal LD 1 from the control circuit 6.

バレルシフタ3は、データレジスタ2に記憶された符
号列が符号列BD0〜BD7として入力されるデータ入力部3
a、データレジスタ1に記憶された符号列が符号列BD8
BD15として入力される拡張入力部3b、符号列BD0〜BD7
所定のビット数分シフトさせるためのシフトビット数デ
ータSF0〜BF3が入力される制御部3cおよび符号列HD0〜H
D7が出力されるデータ出力部3dを備える。バレルシフタ
3は符号列BD0〜BD7をデータSF0〜BF3で指定されるビッ
ト数分ビットBD0側にシフトし、空いたビット位置に符
号列BD8〜BD15を補って符号列HD0〜HD7としてデータ出
力部3dから出力する。このとき、バレルシフタ3は入力
符号列をシフトするビット数に関係なく一定時間でシフ
トすることができるので、1クロックパルスで1ビット
シフトするシフトレジスタに比べ高速処理が可能とな
る。
Barrel shifter 3, the data input unit 3 stored code sequence in the data register 2 is inputted as the code string BD 0 ~BD 7
a, the code string stored in the data register 1 is a code string BD 8 to
Extended input unit 3b which is input as a BD 15, the code string BD 0 ~BD 7 a predetermined control section 3c and the code sequence shift bit number of data SF 0 ~BF 3 for causing the number of shift bits are input HD 0 ~ H
A data output unit 3d which D 7 is output. Barrel shifter 3 code string BD 0 ~BD 7 was shifted to the number of bits BD 0 side bit specified by the data SF 0 ~BF 3, compensates for the code string BD 8 ~BD 15 vacated bit position code string HD outputted from the data output unit 3d as 0 ~HD 7. At this time, since the barrel shifter 3 can shift the input code string in a fixed time irrespective of the number of bits to shift, high-speed processing can be performed as compared with a shift register that shifts one bit by one clock pulse.

変換回路4は、第2図に示すように、2分木回路41、
復号データ生成回路42および符号長データ生成回路43か
らなるPLA(Programmable Logic Arrey)構成の回路で
ある。2分木回路41は符号列HD0〜HD7からハフマン符号
を検出して対応する信号S1〜S16を出力する回路で、第
3図に示すように、符号HD0が“0"のとき出力(信号
S1)“1"となるインバータIN、符号HD0〜HD1が“10"の
とき出力“1"となるアンド回路A1、符号HD0〜HD1が“1
1"のとき出力“1"となるアンド回路A2、符号HD0〜HD2
“100"のとき出力(記号S2)“1"となるアンド回路A3
…、符号HD0〜HD7が全ビット“1"のとき出力(信号
S16)“1"となるアンド回路A28から構成されている。従
って、例えば符号列HD0〜HD7が“11010000"であれば、
最初の5ビットの符号列HD0〜HD4が“11010"であるた
め、アンド回路A15の出力(記号S8)が“1"となり、そ
の他の出力は“0"となってハフマン符号“11010"が検出
される。このように2分木回路41は入力される符号列HD
0〜HD7に対し先頭ビットHD0から第4図(a)に示す
「符号の木」をたどるようにして対応する記号を見つけ
出し、第4図(b)に示すように、その記号のみを“1"
とする処理を行う。また、復号データ生成回路42は記号
S1〜S16から8ビットの復号データOD0〜OD7を生成する
回路で、第5図(a)に示すように、8個のオア回路OR
1〜OR8からなり、第5図(b)のコード表に示す入出力
関係となるように構成されている。また、符号長データ
生成回路43は2分木回路41で復号したハフマン符号の符
号長を示す4ビットの符号長データSL0〜SL3を出力する
回路で、第6図(a)に示すように、4個のオア回路OR
11〜OR14からなり、第6図(b)のコード表に示す入出
力関係となるように構成されている。
The conversion circuit 4 includes a binary tree circuit 41, as shown in FIG.
This is a PLA (Programmable Logic Arrey) configuration circuit including a decoded data generation circuit 42 and a code length data generation circuit 43. The binary tree circuit 41 in the circuit for outputting a signal S 1 to S 16 indicative of the sensed Huffman code from a code string HD 0 ~HD 7, as shown in FIG. 3, reference numeral HD 0 is "0" When output (signal
S 1 ) Inverter IN that becomes “1”, AND circuit A 1 that outputs “1” when code HD 0 to HD 1 is “10”, and code HD 0 to HD 1 becomes “1”
"AND circuit A 2 becomes, code HD 0 ~HD 2 is" 1 "output when the" 1 "output when the (symbol S 2)" 100 1 "become the AND circuit A 3,
..., the output when the sign HD 0 ~HD 7 is all bits "1" (signal
S 16 ) It is composed of an AND circuit A 28 which becomes “1”. Thus, if for example the code sequence HD 0 ~HD 7 is "11010000",
Since the first five-bit code strings HD 0 to HD 4 are “11010”, the output (symbol S 8 ) of the AND circuit A 15 is “1”, and the other outputs are “0” and the Huffman code “ 11010 "is detected. As described above, the binary tree circuit 41 receives the input code string HD
0 ~HD 7 finds symbol corresponding to the first bit HD 0 to FIG. 4 follow a "code tree" shown in (a) to, as shown in FIG. 4 (b), only the symbol “1”
Is performed. Also, the decrypted data generation circuit 42
A circuit for generating a decoded data OD 0 ~OD 7 of 8 bits from S 1 to S 16, as shown in FIG. 5 (a), 8 pieces of the OR circuit OR
Consists 1 ~OR 8, it is configured such that the input-output relation shown in the code table of FIG. 5 (b). Further, the circuit for outputting the code length data generating circuit 43 is 4-bit code length data SL 0 to SL 3 showing the code length of the Huffman code decoded by the binary tree circuit 41, as shown in FIG. 6 (a) And four OR circuits OR
11 to OR 14 , and are configured to have the input / output relationship shown in the code table of FIG. 6 (b).

累積回路5は現在復号処理している符号列の次の符号
列の頭出しを行うために、符号列BD0〜BD7を何ビットBD
0側にシフトすればよいかを示す4ビットのシフトビッ
ト数データSF0〜SF3を出力する回路で、加算回路51と累
積レジスタ52とから構成される。加算回路51は変換回路
4から供給される符号長データSL0〜SL3とレジスタ52に
記憶されている符号長累算値とを加算する回路で、加算
結果はレジスタ52に符号長累算値として格納し、加算結
果が「8」を超える場合はオーバーフローデータOVFを
出力する。レジスタ52に格納された符号長累算値はシフ
トビット数データSF0〜SF3としてバレルシフタ3の制御
端子3cに供給される。
Accumulation circuit 5 in order to perform the beginning of the next code string of the code string that is currently decoding, the code string BD 0 ~BD 7 many bits BD
A circuit for outputting 4-bit shift bit number data SF 0 to SF 3 indicating whether the shift is to be performed to the 0 side, and includes an adder circuit 51 and an accumulation register 52. Adder circuit 51 is a circuit for adding the code length accumulated value stored in the code length data SL 0 to SL 3 and register 52 supplied from the conversion circuit 4, the addition result code length accumulated value in the register 52 If the addition result exceeds “8”, overflow data OVF is output. Stored code length accumulated value in the register 52 is supplied as a shift bit number of data SF 0 - SF 3 to the control terminal 3c of the barrel shifter 3.

制御回路6はレジスタ1〜累算回路5の動作を制御す
る回路で、レジスタ1および2にロード信号LD1を出力
して入力符号列ID0〜ID7をデータレジスタ1および2に
順次取り込み、また、累算回路5の累積レジスタ52にロ
ード信号LD2を出力して加算回路51の加算結果を累積レ
ジスタ52に格納する。また、加算回路51の加算結果が
「8」を超える場合に、加算回路51からオーバーフロー
データOVFが供給される。
The control circuit 6 is a circuit for controlling the operation of the register 1 to the accumulation circuit 5 sequentially takes an input code string ID 0 ~ID 7 outputs a load signal LD 1 to the register 1 and 2 to the data register 1 and 2, The load signal LD 2 is output to the accumulation register 52 of the accumulation circuit 5, and the addition result of the addition circuit 51 is stored in the accumulation register 52. When the addition result of the addition circuit 51 exceeds “8”, the overflow data OVF is supplied from the addition circuit 51.

次に、この構成を有する実施例の動作を、具体的な入
力符号列の例を挙げて説明する。
Next, the operation of the embodiment having this configuration will be described with reference to a specific example of an input code string.

いま、ハフマン符号化された入力符号列ID0〜ID7を、
第7図(a)に示すように、第1列目は“01100111",第
2列目は“11010000",第3列目は“01111010",第4列目
は“10111110",…とすると、制御回路6から供給される
ロード信号LD1の最初のロードパルスによって第1列目
の符号列がデータレジスタ1にセットされ、続く第2の
ロードパルスによって第1列目の符号列がデータレジス
タ2に、第2列目の符号列がデータレジスタ1にそれぞ
れセットされる。従って、バレルシフタ3には、第1列
目の符号列“01100111"および第2列目の符号列“11010
000"が16ビットの符号列BD0〜BD15(“011001111101000
0")として入力される(図(b))。バレルシフタ3の
制御部3cに入力されるシフトビット数データSF0〜SF
3は、最初は「0」(10進)であるので、符号列BD0〜BD
7が出力符号列HD0〜HD7としてそのまま変換回路4に出
力される(図(c))。
Now, an input code string ID 0 ~ID 7 which are Huffman coding,
As shown in FIG. 7 (a), if the first column is “01100111”, the second column is “11010000”, the third column is “01111010”, the fourth column is “10111110”,. , the control circuit 6 first column of the code string by the first load pulse of the load signal LD 1 supplied is set in the data register 1 from the subsequent second first column of the code string data register by the load pulse 2, the second code string is set in the data register 1. Therefore, the first code string “01100111” and the second code string “11010” are stored in the barrel shifter 3.
000 "of 16-bit code sequence BD 0 ~BD 15 (" 011001111101000
0 ") is input (FIG. (B)). The number of shift bits data SF 0 input to the control unit 3c of the barrel shifter 3 - SF
3, because the first is "0" (decimal), the code string BD 0 ~BD
7 is output to the conversion circuit 4 as an output code string HD 0 ~HD 7 (FIG. (C)).

変換回路4では、2分木回路41で符号列HD0〜HD7の先
頭ビットHD0がハフマン符号“0"であることを検出し、
対応する記号S1を出力する。復号データ生成回路42およ
び符号長データ生成回路43はこの信号S1を受けて符号値
「1」および復号長「1」を出力する。
The conversion circuit 4 detects that in a binary tree circuit 41 first bit HD 0 code sequence HD 0 ~HD 7 is Huffman code "0",
And outputs the corresponding symbol S 1. Decoded data generating circuit 42 and the code length data generating circuit 43 outputs the code value "1" and the decoding length "1" receives the signal S 1.

累積回路5は符号長「1」をレジスタ52に記憶されて
いる符号長累算値と加算回路51で加算し、その加算結果
をレジスタ52に格納する。そして、レジスタ52に格納し
た累積値を、シフトビット数データSF0〜SF3としてバレ
ルシフタ3の制御部3cに入力する。いまの例では、レジ
スタ52に記憶されている符号長累算値は「0」であるの
で、加算結果は「1」となり、バレルシフタ3にシフト
ビット数データ「1」を供給する。
The accumulating circuit 5 adds the code length “1” to the accumulated code length value stored in the register 52 by the adding circuit 51, and stores the addition result in the register 52. Then, the cumulative value stored in the register 52, and inputs the shift bit number of data SF 0 - SF 3 to the control unit 3c of the barrel shifter 3. In the present example, since the accumulated code length value stored in the register 52 is “0”, the addition result is “1”, and the shift bit number data “1” is supplied to the barrel shifter 3.

バレルシフタ3は、このシフトビット数データ「1」
を受けて符号列BD0〜BD15を1ビット左側(LSB側)にシ
フトし、符号列BD1〜BD8を新たな符号列HD0〜HD7(“11
001111")として出力する(図(d))。2本木回路41
は符号列HD0〜HD7のうち符号列HD0〜HD5がハフマン符号
“110011"であることを検出し、復号データ生成回路42
および符号長データ生成回路43に記号S7を供給する。復
号データ生成回路42および符号長データ生成回路43はこ
の記号S7を受けて復号値「16」および符号長「6」を出
力し、累算回路5に供給する。
The barrel shifter 3 outputs the shift bit number data “1”.
Shifts the code sequence BD 0 ~BD 15 to 1-bit left (LSB side) receives the code string BD 1 ~BD 8 a new code sequence HD 0 ~HD 7 ( "11
001111 ") (FIG. 6D).
Detects that the code sequence HD 0 ~HD 5 out of the code string HD 0 ~HD 7 is Huffman code "110011", the decoded data generating circuit 42
And supplies the symbol S 7 to the code length data generating circuit 43. Decoded data generating circuit 42 and the code length data generating circuit 43 outputs the symbol S 7 receiving and decoding value "16" and the code length of "6", and supplies the accumulation circuit 5.

累算回路5は符号長「6」をレジスタ52に記憶されて
いる符号長累算値「1」と加算回路51で加算し、その加
算結果「7」をレジスタ52に格納する。そして、この格
納した累算値「7」をシフトビット数データSF0〜SF3
してバレルシフタ3の制御部3cに供給する。
The accumulation circuit 5 adds the code length "6" to the code length accumulated value "1" stored in the register 52 by the addition circuit 51, and stores the addition result "7" in the register 52. Then, to the control section 3c of the barrel shifter 3 accumulated value this stores "7" as the shift bit number of data SF 0 - SF 3.

バレルシフタ3は、このシフトビット数データ「7」
によって符号BD0〜BD15を今度は7ビット左側にシフト
し、符号列BD7〜BD14を新たな符号列HD0〜HD7(“11101
000")として出力する(図(e))。2分木回路41は符
号列HD0〜HD7のうち符号列HD0〜HD3がハフマン符号“11
10"であることを検出して記号S11を“1"として復号デー
タ生成回路42および符号長データ生成回路43に供給す
る。復号データ生成回路42はこの記号S11を受けて復号
値「60」を出力し、同じく符号長データ生成回路43は符
号長「4」を出力する。
The barrel shifter 3 outputs the shift bit number data “7”.
The code BD 0 ~BD 15 now shifts to 7 bits left by code string BD 7 ~BD 14 a new code sequence HD 0 ~HD 7 ( "11101
000 ") is output (FIG. (E)). The binary tree circuit 41 code string HD 0 ~HD 3 Huffman codes of the code string HD 0 ~HD 7" 11
10 and supplies the decoded data generating circuit 42 and the code length data generating circuit 43 as a "" symbol S 11 detects that the ". Decoded data generating circuit 42 is decoded values In response to the symbol S 11" 60 , And the code length data generation circuit 43 similarly outputs a code length “4”.

累算回路5は加算回路51で符号長「4」とレジスタ52
に記憶されている符号長累算値「7」とを加算し、加算
値が「8」を超えたことを意味するオーバーフローデー
タOVFを制御回路6に出力すると共に、加算結果「3」
をレジスタ52に格納する。制御回路6はこのオーバーフ
ローデータOVFを受けてデータレジスタ1および2にロ
ード信号LD1を供給し、データレジスタ1にセットされ
ている第2列目の符号列をデータレジスタ2にセット
し、データレジスタ1に第3列目の符号列をセットす
る。従って、バレルシフタ3には符号列BD0〜BD15とし
て“1101000001111010"が入力される(図(f))。バ
レルシフタ3はこの符号列BD0〜BD15をレジスタ52から
供給されるシフトビット数データ「3」によってLSB側
に3ビットシフトし、符号列BD3〜BD10を新たな符号列H
D0〜HD7(“10000011")として出力する(図(g))。
The accumulating circuit 5 has a code length “4” and a register 52
And outputs the overflow data OVF indicating that the added value exceeds “8” to the control circuit 6 and the addition result “3”.
Is stored in the register 52. The control circuit 6 supplies a load signal LD 1 to the data register 1 and 2 receives the overflow data OVF, sets the code string of the second row, which is set in the data register 1 to the data register 2, data register The code string of the third column is set to 1. Accordingly, the barrel shifter 3 is inputted is "1101000001111010" as a code string BD 0 ~BD 15 (Fig. (F)). The barrel shifter 3 shifts the code strings BD 0 to BD 15 toward the LSB side by the shift bit number data “3” supplied from the register 52 by 3 bits, and converts the code strings BD 3 to BD 10 to a new code string H.
It is output as D 0 to HD 7 (“10000011”) (FIG. 9G).

以下、同様の動作を繰り返し、結局第7図(a)に示
す第1〜第4列の符号列は、変換回路4において第7図
(h)に示す各記号に変換され、それぞれ対応する復号
データを得る。
Hereinafter, the same operation is repeated, and eventually the code strings of the first to fourth columns shown in FIG. 7A are converted into the respective symbols shown in FIG. Get the data.

〔発明の効果〕〔The invention's effect〕

この発明によれば、符号化された可変長符号を、並列
複数ビット単位で処理するので、1回の処理で1符号長
を処理することができ、復号処理の高速化を図ることが
出来る。また、バレルシフタによって次の符号列の頭出
しを行うようにしているので、符号長に関係なく一定の
時間で次の符号列の頭出しを行うことができ、復号処理
の高速化を更に図ることが出来る。
According to the present invention, the encoded variable-length code is processed in units of a plurality of parallel bits, so that one code length can be processed in one process, and the decoding process can be speeded up. In addition, since the next code string is searched for by the barrel shifter, the next code string can be searched for in a fixed time regardless of the code length, and the decoding process can be further speeded up. Can be done.

【図面の簡単な説明】[Brief description of the drawings]

第1図はこの発明による可変長符号の復号回路の一実施
例を示す構成図、 第2図は第1図に示す変換回路の構成図、 第3図および第4図は第2図に示す2分木回路の構成お
よび動作を説明する図、 第5図は第2図に示す復号データ生成回路の構成および
動作を説明する図、 第6図は第2図に示す符号長データ生成回路の構成およ
び動作を説明する図、 第7図はこの実施例の動作を説明する図、 第8図はハフマン符号の構成法を説明する図である。 1,2……データレジスタ、3……バレルシフタ、4……
変換回路、5……累算回路、6……制御回路。
FIG. 1 is a block diagram showing an embodiment of a variable-length code decoding circuit according to the present invention, FIG. 2 is a block diagram of a conversion circuit shown in FIG. 1, and FIGS. 3 and 4 are shown in FIG. FIG. 5 illustrates the configuration and operation of the binary tree circuit, FIG. 5 illustrates the configuration and operation of the decoded data generation circuit illustrated in FIG. 2, and FIG. 6 illustrates the code length data generation circuit illustrated in FIG. FIG. 7 is a diagram illustrating the configuration and operation, FIG. 7 is a diagram illustrating the operation of this embodiment, and FIG. 8 is a diagram illustrating the configuration method of the Huffman code. 1,2 ... data register, 3 ... barrel shifter, 4 ...
Conversion circuit, 5: accumulation circuit, 6: control circuit.

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) H03M 7/40 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 7 , DB name) H03M 7/40

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】可変長符号化された入力符号列を並列複数
ビット単位で順次取り込む第1および第2のデータレジ
スタと、 上記第1および第2のデータレジスタに記憶した各入力
符号列を、指定されたビット数分LSB側にシフトして上
記並列複数ビットの符号列として出力するバレルシフタ
と、 上記バレルシフタの出力符号列から可変長符号を検出
し、その復号データおよび符号長データを出力する変換
手段と、 上記変換回路から出力される符号長データを累算し、そ
の累算結果を上記バレルシフタにシフトビット数データ
として供給する累算手段とを備え、 上記バレルシフタは上記変換手段で検出した可変長符号
の次の符号列の頭出しを行うために、上記シフトビット
数データで指定されるビット数分上記各入力符号列をLS
B側にシフトし、上記第1および第2のデータレジスタ
は上記累算手段の累算結果が所定値を超えるときに上記
第1のデータレジスタにセットされている符号列を上記
第2のデータレジスタにセットし、上記第1のデータレ
ジスタに次の新たな入力符号列をセットすることを特徴
とする可変長符号の復号回路。
A first and a second data register for sequentially taking in an input code string that has been subjected to variable length coding in units of a plurality of parallel bits, and an input code string stored in the first and second data registers, A barrel shifter that shifts to the LSB side by the designated number of bits and outputs the parallel multiple-bit code string, and a conversion that detects a variable-length code from the output code string of the barrel shifter and outputs decoded data and code length data thereof Means, and accumulating means for accumulating the code length data output from the conversion circuit, and supplying the accumulation result to the barrel shifter as shift bit number data, wherein the barrel shifter is a variable detector detected by the conversion means. In order to perform cueing of the code sequence next to the long code, each of the input code sequences is LS
The first and second data registers shift to the B side, and when the accumulation result of the accumulation means exceeds a predetermined value, the code string set in the first data register is shifted to the second data register. A variable length code decoding circuit, wherein the variable length code is set in a register and the next new input code string is set in the first data register.
JP2126658A 1990-05-18 1990-05-18 Variable-length code decoding circuit Expired - Fee Related JP3032239B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2126658A JP3032239B2 (en) 1990-05-18 1990-05-18 Variable-length code decoding circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2126658A JP3032239B2 (en) 1990-05-18 1990-05-18 Variable-length code decoding circuit

Publications (2)

Publication Number Publication Date
JPH0423521A JPH0423521A (en) 1992-01-27
JP3032239B2 true JP3032239B2 (en) 2000-04-10

Family

ID=14940670

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2126658A Expired - Fee Related JP3032239B2 (en) 1990-05-18 1990-05-18 Variable-length code decoding circuit

Country Status (1)

Country Link
JP (1) JP3032239B2 (en)

Also Published As

Publication number Publication date
JPH0423521A (en) 1992-01-27

Similar Documents

Publication Publication Date Title
US3675211A (en) Data compaction using modified variable-length coding
US4286256A (en) Method and means for arithmetic coding utilizing a reduced number of operations
US4989000A (en) Data string compression using arithmetic encoding with simplified probability subinterval estimation
US5436626A (en) Variable-length codeword encoder
US5652583A (en) Apparatus for encoding variable-length codes and segmenting variable-length codewords thereof
US5696507A (en) Method and apparatus for decoding variable length code
KR0138971B1 (en) Huffman code decoder
KR0163464B1 (en) Huffman code decoding circuit
JPH0669813A (en) Decoding device of variable-length code
JP3032239B2 (en) Variable-length code decoding circuit
US5754128A (en) Variable-length code encoding and segmenting apparatus having a byte alignment unit
US5729725A (en) Mask data generator and bit field operation circuit
US5691930A (en) Booth encoder in a binary multiplier
US4325056A (en) BCD To binary converter
JPS6126853B2 (en)
KR100207428B1 (en) Variable length coding apparatus and method adaptive to changes of the hoffman codes
KR0182169B1 (en) Log arithmathic value calculator
JP2003273746A (en) Variable length code decoder
US20030118118A1 (en) High speed leading or trailing bit value detection
JPH04280517A (en) Data compression and restoring system
JP2934603B2 (en) Method and apparatus for decoding variable length code
EP1385084A1 (en) Logarithmic transformer and method of logarithmic transformation
JPH08167855A (en) Huffman decoding circuit
JP3054787B2 (en) Variable length code decoding device
JP2998532B2 (en) Address generation circuit for two-dimensional encoding table

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080210

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090210

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100210

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees