JPH0423521A - Decoding circuit for variable length code - Google Patents

Decoding circuit for variable length code

Info

Publication number
JPH0423521A
JPH0423521A JP12665890A JP12665890A JPH0423521A JP H0423521 A JPH0423521 A JP H0423521A JP 12665890 A JP12665890 A JP 12665890A JP 12665890 A JP12665890 A JP 12665890A JP H0423521 A JPH0423521 A JP H0423521A
Authority
JP
Japan
Prior art keywords
code
data
code string
length
circuit
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.)
Granted
Application number
JP12665890A
Other languages
Japanese (ja)
Other versions
JP3032239B2 (en
Inventor
Masashi Tokuda
正志 徳田
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

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PURPOSE:To rapidly execute decoding processing by processing coded variable length codes in each parallel plural bits so that one code length can be processed by one processing. CONSTITUTION:Variable length coded code strings are entered into data registers l, 2 in each parallel 8 bits e.g. the 1st input code string is inputted to the data input part 3a of a barrel shifter 3 and the 2nd input code string is inputted to the expanded input part 3b of the shifter 3. Namely, two code strings are inputted to the shifter 3 as a parallel 16-bit code string. The shifter 3 extracts an 8-bit code string from the 16-bit code string and outputs the extracted code string to a conversion circuit 4, which detects a variable length code from the inputted code string and outputs its corresponding decoding data and code length data. Since variable length codes to be decoded are processed in each plural bits in parallel, the decoding processing can rapidly be executed.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、ハフマン符号のような複数の異なる符号長
の符号群からなる可変長符号を、高速で復号処理するこ
との出来る可変長符号の復号回路に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention is a variable-length code that can decode a variable-length code such as a Huffman code, which is made up of a group of codes with a plurality of different code lengths, at high speed. Regarding decoding circuits.

〔従来の技術〕[Conventional technology]

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

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

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

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

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

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

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

〔作 用〕[For production]

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

次いで、次に復号する符号列の頭出しを行うために、累
算手段で求めた符号長の累算値をバレルシフタにシフト
ビット数データとして供給する。
Next, in order to locate the beginning of the code string to be decoded next, the cumulative value of the code length obtained by the accumulating means is supplied to the barrel shifter as shift bit number data.

バレルシフタはこのシフトビット数データで指定される
ビット数分入力符号列をLSB側にシフトし、新たな8
ビツトの符号列を抽出して変換手段に出力する。符号長
データの累算値が所定値「8」を超えると、第1のデー
タレジスタにセットされている符号列を上記第2のデー
タレジスタにセットし、第1のデータレジスタに次の新
たな入力符号列をセットして復号処理を繰り返す。
The barrel shifter shifts the input code string to the LSB side by the number of bits specified by this shift bit number data, and creates a new 8 bits.
The bit code string is extracted and output to the conversion means. When the accumulated value of the code length data exceeds the 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. Set the input code string and repeat the decoding process.

〔実施例〕〔Example〕

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

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

データレジスタ1および2はハフマン符号化された並列
複数ビット、例えば8ビットの入力符号列IDo=ID
7を、制御回路6からのロード信号LDtによって順次
−時的に記憶する直列2段構成のレジスタである。
Data registers 1 and 2 are Huffman encoded parallel multiple bits, for example, an 8-bit input code string IDo=ID
This is a two-stage register in series that sequentially and temporally stores 7 in response to a load signal LDt from the control circuit 6.

バレルシフタ3は、データレジスタ2に記憶された符号
列が符号列BDo”−BD7として入力されるデータ入
力部3a、データレジスタ1に記憶された符号列が符号
列BDe〜BD、とじて入力される拡張入力部3b、符
号列BDo〜BD7を所定のビット数分シフトさせるた
めのシフトビット数データSFO〜SF3が入力される
制御部3Cおよび符号列HDo=HD7が出力されるデ
ータ出力部3dを備える。バレルシフタ3は符号列BD
o”BD7をデータSFo〜SFaで指定されるビット
数分ビットBDO側にシフトし、空いたビット位置に符
号列BDa〜BD、、、を補って符号列HDo〜HD7
としてデータ出力部3dから出力する。このとき、バレ
ルシフタ3ば人力符号列をシフトするビット数に関係な
く一定時間でシフトすることができるので、1クロツク
パルスで1ビツトシフトするシフトレジスタに比べ高速
処理が可能となる。
The barrel shifter 3 has a data input section 3a to which the code string stored in the data register 2 is input as a code string BDo''-BD7, and a data input section 3a to which the code string stored in the data register 1 is input as a code string BDe to BD. It includes an extended input section 3b, a control section 3C to which shift bit number data SFO to SF3 for shifting the code strings BDo to BD7 by a predetermined number of bits is input, and a data output section 3d to which the code string HDo=HD7 is output. .Barrel shifter 3 is code string BD
o'' BD7 is shifted to the bit BDO side by the number of bits specified by data SFo to SFa, and the vacant bit positions are supplemented with code strings BDa to BD, . . . to create code strings HDo to HD7.
The data output unit 3d outputs the data as the data output unit 3d. At this time, since the barrel shifter 3 can shift the manual code string in a fixed time regardless of the number of bits to be shifted, high-speed processing is possible compared to a shift register that shifts one bit with one clock pulse.

変換回路4は、第2図に示すように、2分木回路41、
復号データ生成回路42および符号長データ生成回路4
3からなるP L A (Programmable 
LogicArrey )構成の回路である。2分木回
路41は符号列HDo”−HD7からハフマン符号を検
出して対応する記号Sl〜SI6を出力する回路で、第
3図に示すように、符号HDoが“0゛のとき出力(記
号S1)  “′1゛となるインバータIN、符号HD
o=HDtが“10””のとき出力゛1”となるアンド
回路A1、符号HDo〜HD1が“11′のとき出力“
1゛となるアンド回路A2、符号HDO−HD2が′1
00°”のとき出力(記号S2)1“となるアンド回路
A3、・・・、符号HDO〜HD7が全ビット“1゛の
とき出力(記号S、6)1”となるアンド回路A2.か
ら構成されている。
As shown in FIG. 2, the conversion circuit 4 includes a binary tree circuit 41,
Decoded data generation circuit 42 and code length data generation circuit 4
PLA (Programmable) consisting of 3
This is a circuit with a LogicArray) configuration. The binary tree circuit 41 is a circuit that detects a Huffman code from the code string HDo"-HD7 and outputs the corresponding symbols Sl to SI6. As shown in FIG. S1) Inverter IN, code HD which becomes “'1゛”
AND circuit A1 outputs "1" when o=HDt is "10", and outputs "1" when code HDo~HD1 is "11'"
AND circuit A2 which becomes 1゛, code HDO-HD2 becomes '1
AND circuit A3 whose output (symbol S2) is 1'' when the signal is ``00°'', . It consists of

従って、例えば符号列HDo〜HD7が“′11010
000”であれば、最初の5ビットの符号列HDo=H
D+が’1101−0”であるため、アンド回路A 1
5の出力(記号Ss)が1゛となり、その他の出力は“
0“となってハフマン符号“′11010”が検出され
る。このように2分木回路41は入力される符号列HD
o=HD7に対し先頭ピッ)HDoから第4図(a)に
示す「符号の木」をたどるようにして対応する記号を見
つけ出し、第4図(b)に示すように、その記号のみを
“1°′とする処理を行う。また、復号データ生成回路
42は記号S1〜S 16から8ピツI・の復号データ
ODO〜OD7を生成する回路で、第5図(a)に示す
ように、8個のオア回路OR1〜OR8からなり、第5
図(b)のコード表に示す入出力関係となるように構成
されている。また、符号長データ生成回路43は2分水
回路41で復号したハフマン符号の符号長を示す4ビツ
トの符号長データ5Lo=SLaを出力する回路で、第
6図(a)に示すように、4個のオア回路OR,、〜O
R14からなり、第6図(b)のコード表に示す入出力
関係となるように構成されている。
Therefore, for example, the code string HDo to HD7 is "'11010
000”, the first 5-bit code string HDo=H
Since D+ is '1101-0', AND circuit A1
The output of 5 (symbol Ss) is 1゛, and the other outputs are “
0", and the Huffman code "'11010" is detected. In this way, the binary tree circuit 41 receives the input code string HD.
Find the corresponding symbol by following the "code tree" shown in FIG. 4(a) from HDo (starting with the first pip for HD7), and as shown in FIG. 4(b), change only that symbol to " The decoded data generation circuit 42 is a circuit that generates decoded data ODO to OD7 of 8 pins I from the symbols S1 to S16, as shown in FIG. 5(a). Consisting of eight OR circuits OR1 to OR8, the fifth
It is configured to have the input/output relationship shown in the code table in Figure (b). Further, the code length data generation circuit 43 is a circuit that outputs 4-bit code length data 5Lo=SLa indicating the code length of the Huffman code decoded by the bifurcation circuit 41, as shown in FIG. 6(a). 4 OR circuits OR,, ~O
R14, and is configured to have the input/output relationship shown in the code table of FIG. 6(b).

累算回路5は現在復号処理している符号列の次の符号列
の頭出しを行うために、符号列BDo〜BD7を何ビッ
トBDo側にシフトすればよいかを示す4ビツトのシフ
トビット数データSFo〜SFsを出力する回路で、加
算回路51と累積レジスタ52とから構成される。加算
回路51は変換回路4から供給される符号長データSL
o〜SL3とレジスタ52に記憶されている符号長累算
値とを加算する回路で、加算結果はレジスタ52に符号
長累算値として格納し、加算結果が「8」を超える場合
はオーバーフローデータOVFを出力する。レジスタ5
2に格納された符号長累算値はシフトビ・ソIfデータ
5Fo−3F3としてバレルシフタ3の制御端子3Cに
供給される。
The accumulator circuit 5 uses a 4-bit shift bit number indicating how many bits of the code strings BDo to BD7 should be shifted to the BDo side in order to cue the next code string of the code string currently being decoded. This circuit outputs data SFo to SFs and is composed of an adder circuit 51 and an accumulation register 52. The addition circuit 51 receives the code length data SL supplied from the conversion circuit 4.
A circuit that adds o~SL3 and the code length accumulated value stored in the register 52. The addition result is stored in the register 52 as the code length accumulated value, and if the addition result exceeds "8", overflow data is stored. Output OVF. register 5
The code length accumulated value stored in 2 is supplied to the control terminal 3C of the barrel shifter 3 as shift bi/so If data 5Fo-3F3.

制御回路6はレジスタ1〜累算回路5の動作を■ 制御する回路で、レジスタ1および2にロード信号LD
1を出力して入力符号列ID0−ID7をデータレジス
タ1および2に順次取り込み、また、累算回路5の累積
レジスタ52にロード信号LD2を出力して加算回路5
1の加算結果を累積レジスタ52に格納する。また、加
算回路51の加算結果が「8」を超える場合に、加算回
路51からオーバーフローデータOVFが供給される。
Control circuit 6 is a circuit that controls the operations of register 1 to accumulation circuit 5, and sends a load signal LD to registers 1 and 2.
1 and sequentially captures the input code strings ID0-ID7 into data registers 1 and 2, and also outputs a load signal LD2 to the accumulation register 52 of the accumulation circuit 5 to load the input code strings ID0-ID7 into the data registers 1 and 2.
The result of addition of 1 is stored in the accumulation register 52. Further, when the addition result of the addition circuit 51 exceeds "8", overflow data OVF is supplied from the addition circuit 51.

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

いま、ハフマン符号化された入力符号列TD。Now, the input code string TD is Huffman encoded.

〜ID7を、第7図(a)に示すように、第1列目は”
01100111”、第2列目は“’11010000
°゛、第3列目は’01111010”、第4列目は1
0111110’″ 、・・・とすると、制御回路6か
ら供給されるロード信号LD1の最初のロードパルスに
よって第1列目の符号列がデータレジスタ1にセットさ
れ、続(第2のロードパルスによって第1列目の符号列
がデータレジスタ2に、第2列目の符号列がデータレジ
スタ1にそれぞれセットされる。従って、バレルシフタ
3には、第1列目の符号列”01100111”および
第2列目の符号列゛11010000”が16ビツトの
符号列BDo 〜BD+s (”0110011111
010000”)として入力される(図(b))。バレ
ルシフタ3の制御部3Cに入力されるシフトビット数デ
ータSFo〜SFaは、最初は「0」 (10進)であ
るので、符号列BDo〜BD7が出力符号列HDo−H
D7としてそのまま変換回路4に出力される(図(C)
)。
~ID7, as shown in Figure 7(a), the first column is "
01100111", the second column is "'11010000
°゛, 3rd column is '01111010', 4th column is 1
0111110''',..., the first load pulse of the load signal LD1 supplied from the control circuit 6 sets the code string in the first column in the data register 1, and the code string in the first column is set in the data register 1 by the second load pulse. The code string in the first column is set to data register 2, and the code string in the second column is set to data register 1. Therefore, the barrel shifter 3 stores the code string "01100111" in the first column and the code string in the second column. The code string “11010000” is a 16-bit code string BDo ~ BD+s (“0110011111
010000") (Figure (b)). Since the shift bit number data SFo to SFa input to the control unit 3C of the barrel shifter 3 is initially "0" (decimal), the code string BDo to BD7 is the output code string HDo-H
It is output as is to the conversion circuit 4 as D7 (Figure (C)
).

変換回路4では、2分木回路41で符号列HD。In the conversion circuit 4, the binary tree circuit 41 converts the code string HD.

〜HD7の先頭ビットHDoがハフマン符号″0゛であ
ることを検出し、対応する記号S1を出力する。復号デ
ータ生成回路42および符号長データ生成回路43はこ
の記号S1を受けて復号値「1」および符号長「1jを
出力する。
~Detects that the first bit HDo of HD7 is a Huffman code "0" and outputs the corresponding symbol S1.Decoded data generation circuit 42 and code length data generation circuit 43 receive this symbol S1 and generate a decoded value "1". ” and code length “1j”.

累算回路5は符号長「1」をレジスタ52に記憶されて
いる符号長累算値と加算回路51で加算し、その加算結
果をレジスタ52に格納する。そして、レジスタ524
こ格納した累算値を、シフトビ、ット数データ5FO−
3F3としてバレルシフタ3の制御部3Cに入力する。
The accumulating circuit 5 adds the code length "1" to the code length accumulated value stored in the register 52 using an adder circuit 51, and stores the addition result in the register 52. And register 524
The stored accumulated value is shifted bit number data 5FO-
It is input to the control section 3C of the barrel shifter 3 as 3F3.

いまの例では、レジスタ52に記憶されている符号長累
算値は「0」であるので、加算結果は「1」となり、バ
レルシフタ3にシフトビット数データ「1」を供給する
In the present example, the code length accumulated value stored in the register 52 is "0", so the addition result is "1", and shift bit number data "1" is supplied to the barrel shifter 3.

バレルシフタ3は、このシフトビット数データ「1」を
受けて符号列BDo−BD、、、を1ビット左側(L 
S B側)にシフトし、符号列BDt〜BD8を新たな
符号列HDo ”HD?  (”11001111°”
)として出力する(図(d))。2分木回路41は符号
列HD、−HD7のうち符号列HDO〜HDsがハフマ
ン符号“’110011”であることを検出し、復号デ
ータ生成回路42および符号長データ生成回路43に記
号S7を供給する。復号データ生成回路42および符号
長データ生成回路43はこの記号S7を受けて復号値「
16」および符号長「6」を出力し、累算回路5に供給
する。
The barrel shifter 3 receives this shift bit number data "1" and shifts the code string BDo-BD, , 1 bit to the left (L
SB side), and the code strings BDt to BD8 are converted to a new code string HDo "HD? ("11001111°")
) (Figure (d)). The binary tree circuit 41 detects that the code strings HDO to HDs among the code strings HD and -HD7 are Huffman codes "'110011", and supplies the symbol S7 to the decoded data generation circuit 42 and the code length data generation circuit 43. do. The decoded data generation circuit 42 and the code length data generation circuit 43 receive this symbol S7 and generate the decoded value "
16'' and code length ``6'' are output and supplied to the accumulator circuit 5.

累算回路5は符号長「6」をレジスタ52に記憶されて
いる符号長累算値「1」と加算回路51で加算し、その
加算結果「7」をレジスタ52に格納する。そして、こ
の格納した累算値「7」をシフトヒツト数データ5Fo
−3Faとしてバレルシフタ30制御部3Cに供給する
The accumulating circuit 5 adds the code length "6" to the code length accumulated value "1" stored in the register 52 using the adding circuit 51, and stores the addition result "7" in the register 52. Then, this stored accumulated value "7" is shifted to the hit number data 5Fo.
-3Fa is supplied to the barrel shifter 30 control unit 3C.

バレルシフタ3は、このシフトヒツト数データ「7」に
よって符号列BDo−BIIl+sを今度は7ビツト左
側にシフトし、符号列BD7〜BD、4を新たな符号列
HDo”−HD7  (”11101000“)として
出力する(図(e))。2分木回路41は符号列HDo
”HD7のうち符号列■1DO〜11D3がハフマン符
号” 1110”であることを検出して記号S I+を
“′1゛″として復号データ生成回路42および符号長
データ生成回路43に供給する。復号データ生成回路4
2はこの記号S I+を受けて復号値「60」を出力し
、同しく符号長データ生成回路43は符号長「4」を出
力する。
The barrel shifter 3 shifts the code string BDo-BIIl+s to the left by 7 bits using this shift hit number data "7" and outputs the code string BD7 to BD,4 as a new code string HDo"-HD7 ("11101000"). (Figure (e)).The binary tree circuit 41 generates the code string HDo
It is detected that the code string 1DO to 11D3 of "HD7" is a Huffman code "1110" and the symbol S I+ is set as "'1" and is supplied to the decoded data generation circuit 42 and code length data generation circuit 43.Decoding Data generation circuit 4
2 receives this symbol S I+ and outputs the decoded value "60", and similarly the code length data generation circuit 43 outputs the code length "4".

累算回路5は加算回路51で符号長「4」とレジスタ5
2に記憶されている符号長累算値「7」とを加算し、加
算値が「8」を超えたことを意味するオーバーフローデ
ータOVFを制御皿回路6に出力すると共に、加算結果
「3」をレジスタ52に格納する。制御皿回路6はこの
オーバ−フローデータOVFを受けてデータレジスタ1
および2にロード信号1.Dlを供給し、データレジス
タ1にセットされている第2列目の符号列をデータレジ
スタ2にセットし、データレジスタ1に第3列目の符号
列をセットする。従って、バレルシフタ3には符号列B
Do〜BDI、として”11010000011110
10“が入力される(図(f))。バレルシフタ3はこ
の符号列B D o = B D +sをレジスタ52
から供給されるシフトビット数データ「3」によってL
 S B側に3ビットシフ1−シ、符号列BDa〜BD
1oを新たな符号列HDo 〜HD7  (”1000
0011″”)として出力する(図(g))。
The accumulator circuit 5 inputs the code length "4" and the register 5 in the adder circuit 51.
The code length accumulated value "7" stored in 2 is added, and overflow data OVF, which means that the added value exceeds "8", is output to the control plate circuit 6, and the addition result is "3". is stored in the register 52. The control plate circuit 6 receives this overflow data OVF and registers the data register 1.
and load signal 1 to 2. Dl is supplied, the second column code string set in data register 1 is set in data register 2, and the third column code string is set in data register 1. Therefore, the barrel shifter 3 has the code string B.
Do~BDI, as”11010000011110
10" is input (FIG. (f)). The barrel shifter 3 stores this code string B D o = B D +s in the register 52.
L by the shift bit number data “3” supplied from
3-bit shift 1-S on B side, code string BDa to BD
1o as a new code string HDo ~ HD7 ("1000
0011″”) (Figure (g)).

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

〔発明の効果〕〔Effect of the invention〕

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

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

第1図はこの発明による可変長符号の復号回路の一実施
例を示す構成図、 第2図は第1図に示す変換回路の構成図、第3図および
第4図は第2図に示す2分木回路の構成および動作を説
明する図、 第5図は第2図に示す復号データ生成回路の構成および
動作を説明する図、 第6図は第2図に示す符号長データ生成回路の構成およ
び動作を説明する図、 第7図はこの実施例の動作を説明する図、第8図はハフ
マン符号の構成法を説明する図である。 2・・・データレジスタ、 3・・・バレルシフタ、 4・・・変換回路、 5・・・累算回路、 6・・・nil制御回路。
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 the conversion circuit shown in FIG. 1, and FIGS. 3 and 4 are shown in FIG. Figure 5 is a diagram explaining the configuration and operation of the binary tree circuit; Figure 5 is a diagram explaining the configuration and operation of the decoded data generation circuit shown in Figure 2; Figure 6 is a diagram explaining the configuration and operation of the code length data generation circuit shown in Figure 2. FIG. 7 is a diagram illustrating the operation of this embodiment. FIG. 8 is a diagram illustrating a Huffman code construction method. 2...Data register, 3...Barrel shifter, 4...Conversion circuit, 5...Accumulation circuit, 6...Nil control circuit.

Claims (1)

【特許請求の範囲】 可変長符号化された入力符号列を並列複数ビット単位で
順次取り込む第1および第2のデータレジスタと、 上記第1および第2のデータレジスタに記憶した各入力
符号列を、指定されたビット数分LSB側にシフトして
上記並列複数ビットの符号列として出力するバレルシフ
タと、 上記バレルシフタの出力符号列から可変長符号を検出し
、その復号データおよび符号長データを出力する変換手
段と、 上記変換回路から出力される符号長データを累算し、そ
の累算結果を上記バレルシフタにシフトビット数データ
として供給する累算手段とを備え、上記バレルシフタは
上記変換手段で検出した可変長符号の次の符号列の頭出
しを行うために、上記シフトビット数データで指定され
るビット数分上記各入力符号列をLSB側にシフトし、
上記第1および第2のデータレジスタは上記累算手段の
累算結果が所定値を超えるときに上記第1のデータレジ
スタにセットされている符号列を上記第2のデータレジ
スタにセットし、上記第1のデータレジスタに次の新た
な入力符号列をセットすることを特徴とする可変長符号
の復号回路。
[Scope of Claims] First and second data registers that sequentially take in variable-length coded input code strings in units of parallel plural bits, and each input code string stored in the first and second data registers. , a barrel shifter that shifts to the LSB side by a specified number of bits and outputs it as the above-mentioned parallel multi-bit code string, and detects a variable length code from the output code string of the barrel shifter and outputs its decoded data and code length data. converting means; and an accumulating means for accumulating the code length data output from the converting circuit and supplying the accumulated result to the barrel shifter as shift bit number data, the barrel shifter detecting the data by the converting means. In order to locate the beginning of the next code string of the variable length code, shift each input code string to the LSB side by the number of bits specified by the shift bit number data,
The first and second data registers set the code string set in the first data register in the second data register when the accumulation result of the accumulation means exceeds a predetermined value, and A variable length code decoding circuit characterized in that a next new input code string is set in a 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 true JPH0423521A (en) 1992-01-27
JP3032239B2 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
JP3032239B2 (en) 2000-04-10

Similar Documents

Publication Publication Date Title
JPH03274920A (en) Signal encoder
US5218563A (en) Data round-off device for rounding-off m-bit digital data into (m-n)-bit digital data
JPH0577226B2 (en)
JP2746109B2 (en) Huffman code decoding circuit
JPH0423521A (en) Decoding circuit for variable length code
EP0193592B1 (en) Method and apparatus for processing digital signals prior to recording
JP2766133B2 (en) Parallel-serial data conversion circuit
KR100448282B1 (en) Method for balanced encoding and decoding of locks having the different constant weight
JP4280172B2 (en) Bar graph code conversion method
JP3776319B2 (en) Binary data counting device, area information extracting device, and Hough transform device
JPH03286622A (en) Decoding circuit for variable length code
JP2007088677A (en) D/a converter, system using it, and d/a converting method
JPH10187664A (en) Read-only memory and arithmetic unit
JP3138342B2 (en) Variable length code decoding device
JP3257002B2 (en) Packet majority circuit
JPH05259922A (en) Variable length coder
CN1230987C (en) Code generation circuit
JP2998532B2 (en) Address generation circuit for two-dimensional encoding table
JPH11102284A (en) Method and circuit for selection
JP2594699B2 (en) 5B6B code rule inversion circuit
JP2516247B2 (en) Viterbi decoding circuit
KR0182499B1 (en) Variable-length code converter and conversion method thereof
JP3141265B2 (en) Analog / digital conversion circuit
JP3648944B2 (en) Data encoding method, data encoding device, data decoding method, and data decoding device
JPH0345093A (en) Variable length code decoding circuit

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