JPH07235877A - Variable length code packing device - Google Patents

Variable length code packing device

Info

Publication number
JPH07235877A
JPH07235877A JP6051412A JP5141294A JPH07235877A JP H07235877 A JPH07235877 A JP H07235877A JP 6051412 A JP6051412 A JP 6051412A JP 5141294 A JP5141294 A JP 5141294A JP H07235877 A JPH07235877 A JP H07235877A
Authority
JP
Japan
Prior art keywords
flop
data
output
flip
code
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.)
Pending
Application number
JP6051412A
Other languages
Japanese (ja)
Inventor
Yukari Toda
ゆかり 戸田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP6051412A priority Critical patent/JPH07235877A/en
Publication of JPH07235877A publication Critical patent/JPH07235877A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide the variable length code packing device in which it is not required to modify a code to a serial one once and synchronization of packing with one clock is feasible. CONSTITUTION:The device is provided with an adder section 101 adding length of received signals to calculate a total length, a delay section 102 delaying the total length by one clock cycle to generate delayed data, and a multiplexer section 103 applying barrel shift to the received codes to generate rearranged data, and also with a control section 104 receiving the total length and the delayed data and generating 1st and 2nd control signals 1,2, a 2-stages of flip- flop section 105 storing tentatively the rearranged data based on the 1st control signal and a selection section selecting one of the data stored in the 2-stages of flip-flop section 105 based on the 2nd control signal.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、可変長符号を一定長に
パッキングするパッキング装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a packing device for packing variable length codes into a fixed length.

【0002】[0002]

【従来の技術】一般に、データ圧縮で代表的なハフマン
符号化は、データの出現確率から符号化する手法で、出
現確率の大きいものには短い符号を、出現確率の小さい
ものには長い符号を割り当てることにより、限りなくそ
のデータのエントロピー値に近づけることができる。
2. Description of the Related Art Generally, Huffman coding, which is a typical data compression method, is a method of coding from the appearance probability of data. By assigning it, the entropy value of the data can be approached infinitely.

【0003】このような符号長が変化する符号化のこと
を可変長符号化という。そして、その優秀性から、従
来、ハフマン符号を拡張利用する符号化手法が多く、た
とえば、MH、MR、MMR、ADCTも可変長符号で
ある。
Coding in which the code length changes in this way is called variable length coding. Because of its superiority, conventionally, there are many encoding methods that make extensive use of Huffman codes. For example, MH, MR, MMR, and ADCT are also variable-length codes.

【0004】ところで、このような可変長符号は、最終
的には一定のビット深さにパッキングしなけれなならな
いが、それを実現するためには符号を1ビットずつ取り
出して、容器につめていき、溜ったら出力していた。す
なわち、パラレルなものを一度シリアルに直してまたパ
ラレルにするということをしていた。
By the way, such a variable-length code must be finally packed to a constant bit depth, but in order to realize it, the code is taken out bit by bit and packed in a container. , It was output when it was collected. In other words, the parallel thing was once converted to serial and then made parallel again.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上記従
来の方法では、処理速度が遅くなる欠点がある。
However, the above-mentioned conventional method has a drawback that the processing speed becomes slow.

【0006】そして、1クロックでパラレルに出力され
る符号をシリアルに直すのに時間がかかるため、次の符
号をストップする必要があった。
Since it takes time to convert a code output in parallel in one clock to serial, it is necessary to stop the next code.

【0007】なお、さらに周波数の高いクロックを作成
してそのクロックを用いてシリアルにし、普通のクロッ
クで符号を出力する手段も考えられるが、異なるクロッ
クを使用すると同期をとるのに困難になり、実現的では
ない。
It is possible to use a clock having a higher frequency, serialize the clock using the clock, and output the code with an ordinary clock. However, if different clocks are used, it becomes difficult to achieve synchronization. Not feasible.

【0008】本発明は、符号を一度シリアルに直す必要
がなく、かつ、1つのクロックで同期を取ったパッキン
グが可能な可変長符号パッキング装置を提供することを
目的とする。
It is an object of the present invention to provide a variable-length code packing device which does not need to serialize a code once and can perform packing in synchronization with one clock.

【0009】[0009]

【課題を解決するための手段】本発明は、入力される符
号長を加算してトータル長を演算する加算手段と、前記
トータル長を1クロックサイクル遅延させて遅延データ
を作成する遅延手段と、入力される符号をバレルシフト
して並び変えデータを作成するマルチプレクサ手段と、
前記トータル長と前記遅延データとを入力して第1制御
信号と第2制御信号2とを発生する制御手段と、前記並
び変えデータを前記第1制御信号に基づいて一次記憶す
る2段のフリップフロップ手段と、前記2段のフリップ
フロップ手段に記憶されたデータのうちの一方を前記第
2制御信号に基づいて選択する選択手段とを有すること
により、符号をシリアルに直すことも必要なくなり、1
つのクロックで同期を取ったパッキングが可能となる。
SUMMARY OF THE INVENTION The present invention comprises an adding means for adding input code lengths to calculate a total length, and a delay means for delaying the total length by one clock cycle to create delay data. Multiplexer means for barrel shifting the input code and rearranging to create data,
Control means for inputting the total length and the delay data to generate a first control signal and a second control signal 2, and a two-stage flip-flop for temporarily storing the rearranged data based on the first control signal. By having the switching means and the selecting means for selecting one of the data stored in the two-stage flip-flop means based on the second control signal, it is not necessary to serialize the code.
Packing in synchronization with one clock is possible.

【0010】[0010]

【実施例】図1は、本発明の一実施例におけるパッキン
グ装置の構成を示すブロック図である。
1 is a block diagram showing the structure of a packing device according to an embodiment of the present invention.

【0011】なお、本実施例では、制御信号出力手段と
してPLDを使用し、扱う符号は最長8ビットとする。
In this embodiment, the PLD is used as the control signal output means, and the code to be handled has a maximum length of 8 bits.

【0012】加算器101は、入力される符号長(le
n[2..0])と以前のトータル符号(pad
[2..0])とを加算してトータル符号(nad
[3..0])を出力する。
The adder 101 receives an input code length (le
n [2. . 0]) and the previous total code (pad
[2. . 0]) and the total code (nad
[3. . 0]) is output.

【0013】遅延部102は、加算器101から出力さ
れるトータル符号(nad[3..0])をクロックに
同期して記憶し、1クロック分遅延してpad[2..
0]とvalidを出力する。
The delay unit 102 stores the total code (nad [3..0]) output from the adder 101 in synchronization with the clock, delays the clock by one clock, and pads [2. .
0] and valid are output.

【0014】バレルシフト部103は、入力される符号
(code[7..0])を遅延部102からの出力デ
ータ(pad[2..0])の制御で並び変えを行な
い、rcode[7..0]を出力する。
The barrel shift unit 103 rearranges the input code (code [7..0]) under the control of the output data (pad [2..0]) from the delay unit 102, and rcode [7]. . . 0] is output.

【0015】PLD(プログラマブル・ロジック・デバ
イス)104は、加算器101からの出力(nad
[2..0])と遅延部102からの出力(pad
[2..0])とを入力とし、第1制御信号(we
[7..0])および第2制御信号(sel[7..
1])を出力する。
A PLD (Programmable Logic Device) 104 outputs the output (nad) from the adder 101.
[2. . 0]) and the output from the delay unit 102 (pad
[2. . 0]) as input, and the first control signal (we
[7. . 0]) and the second control signal (sel [7 ..
1]) is output.

【0016】2段フリップフロップ部105は、バレル
シフト部103からの出力(rcode[7..0])
を入力し、第1制御信号(we[7..0])および第
2制御信号(sel[7..1])の制御でパッキング
されたデータ(packed[7..0])を出力す
る。
The two-stage flip-flop unit 105 outputs the output (rcode [7 ... 0]) from the barrel shift unit 103.
, And outputs the data (packed [7..0]) packed under the control of the first control signal (we [7..0]) and the second control signal (sel [7..1]). .

【0017】図2は、2段フリップフロップ部105の
構成を示すブロック図である。
FIG. 2 is a block diagram showing the configuration of the two-stage flip-flop unit 105.

【0018】第1制御信号(we[7..0])はライ
トイネーブル信号であり、それぞれのフリップフロップ
を制御し、このライトイネーブル信号がHIGHの時、
それぞれのフリップフロップは書き込み可能であり、L
OWの時、それぞれのフリップフロップは書き込み不可
能である。
The first control signal (we [7..0]) is a write enable signal which controls each flip-flop, and when this write enable signal is HIGH,
Each flip-flop is writable and L
When OW, each flip-flop cannot be written.

【0019】第2制御信号(sel[7..1])はセ
レクタ(マルチプレクサ)203を制御するセレクト信
号であり、これがHIGHの時、セレクタ203は奥の
フリップフロップ群202からの出力2aを選択し、L
OWの時、セレクタ203は手前のフリップフロップ群
201からの出力2bを選択する。
The second control signal (sel [7..1]) is a select signal for controlling the selector (multiplexer) 203. When this is HIGH, the selector 203 selects the output 2a from the flip-flop group 202 at the back. Then L
At OW, the selector 203 selects the output 2b from the front flip-flop group 201.

【0020】手前のフリップフロップ群201は、第1
制御信号(we[7..0])の制御で入力されるrc
ode[7..0]を記憶する。奥のフリップフロップ
群202は、第1制御信号(we[7..0])の制御
で入力される手前のフリップフロップ群201の出力2
b[7..0]を記憶する。
The front flip-flop group 201 is the first
Rc input by control of control signal (we [7 ... 0])
ode [7. . 0] is stored. The flip-flop group 202 in the back is the output 2 of the front flip-flop group 201 which is input by the control of the first control signal (we [7 ... 0]).
b [7. . 0] is stored.

【0021】マルチプレクサ203は、奥のフリップフ
ロップからの出力2aと手前のフリップフロップ群の出
力2bを入力し、sel[7..0]の制御でどちらか
を選択して出力する。
The multiplexer 203 inputs the output 2a from the back flip-flop and the output 2b from the front flip-flop group, and inputs sel [7. . 0] control to select either one and output.

【0022】図3は、PDLの動作内容を示す表であ
る。
FIG. 3 is a table showing the operation contents of PDL.

【0023】図中、横軸はpadであり、縦軸はnad
である。各表の中の上半分は、左からwe7、we6、
we5、we4、we3、we2、we1、we0を示
してる。また、これに対して下半分は、左からsel
7、sel6、sel5、sel4、sel3、sel
2、sel1を示している。
In the figure, the horizontal axis is pad and the vertical axis is nad.
Is. The upper half of each table is we7, we6 from the left.
We5, we4, we3, we2, we1, and we0 are shown. On the other hand, the lower half is sel from the left.
7, sel6, sel5, sel4, sel3, sel
2 and sel1 are shown.

【0024】また、表中では、sel0に値するビット
値も示してあるが、それは常に0であるので必要ないこ
とがわかる。また、斜線で消してあるのは、その状態が
ない、または必要ないことを示してる。
In the table, the bit value corresponding to sel0 is also shown, but it is understood that it is not necessary because it is always 0. Also, the hatched lines indicate that the condition does not exist or is not necessary.

【0025】ここで、we[7..0]は、入力される
pad、nadに従って出力される。例えば、pad=
4、nad=7の時は、we[7..0]は“0001
110”である。
Here, we [7. . 0] is output according to the input pad and nad. For example, pad =
4, when nad = 7, we [7. . 0] is “0001
110 ".

【0026】それに対して、sel[7..1]は、入
力されるpad、nadに従って算出された結果をクロ
ックで遅延したものが出力される。
On the other hand, sel [7. . 1] is the result of delaying the result calculated according to the input pad and nad with the clock.

【0027】例えばpad=5、nad=10の時は、
sel[7..1]は“110000”であるが、それ
を1クロック分遅延した値がPDLから出力される。
For example, when pad = 5 and nad = 10,
sel [7. . 1] is “110000”, a value obtained by delaying it by 1 clock is output from the PDL.

【0028】次に、具体的な計算式は、&をAND、#
をORとすると、we7=(pad==0)#(nad
≧9)、we6=((1≧pd)&(nad≧2))#
(nad≧10)、……となる。
Next, the concrete calculation formula is that AND is AND, #
Is an OR, we7 = (pad == 0) # (nad
≧ 9), we6 = ((1 ≧ pd) & (nad ≧ 2)) #
(Nad ≧ 10), and so on.

【0029】一方、sel_reg.dをフリップフロ
ップの入力、sel_reg.qをフリップフロップの
出力とすると、sel7=sel_reg7.q、se
l_reg7.d=(nad2==0)&(nad1=
=0)&(nad0==0)となる。
On the other hand, sel_reg. d is the input of the flip-flop, sel_reg. Let q be the output of the flip-flop, sel7 = sel_reg7. q, se
l_reg7. d = (nad2 == 0) & (nad1 =
= 0) & (nad0 == 0).

【0030】このような式により、実現することができ
る。なお、本実施例では、nadの下位3ビットのみ参
照してselを作成する。
It can be realized by such a formula. In this embodiment, sel is created by referring to only the lower 3 bits of nad.

【0031】図4は、本実施例におけるサンプルデータ
の波形図である。
FIG. 4 is a waveform diagram of sample data in this embodiment.

【0032】401はクロックであり、他の回路は、こ
のクロック401の立ち上がりによって同期をとってい
る。
Reference numeral 401 is a clock, and the other circuits are synchronized with the rising edge of the clock 401.

【0033】402は入力される3ビットの符号長(l
en[2..0])の1例であり、この順序で入力され
た場合の図1のブロック図の動作を説明する。
Reference numeral 402 denotes an input 3-bit code length (l
en [2. . 0]), and the operation of the block diagram of FIG. 1 when input in this order will be described.

【0034】まず、初期状態として、pad[2..
0]は0である。
First, as an initial state, pad [2. .
0] is 0.

【0035】そこへ、第1のデータlen[2..0]
=2が入力されると、加算器101はpadとlenを
加算してnad=2を出力する。
There, the first data len [2. . 0]
When = 2 is input, the adder 101 adds pad and len and outputs nad = 2.

【0036】一方、バレルシフタ部103は、入力され
る符号code[7..0]をpad[2..0]に従
って並び変えを行なうが、pad[2..0]は0であ
るので、rcode7=code7、rcode6=c
ode6、……と出力する。図4の409にその様子を
示している。図中の数字(76543210)は、co
deのビット番号を示す。
On the other hand, the barrel shifter unit 103 receives the input code code [7. . 0] to pad [2. . 0], but the pad [2. . 0] is 0, so rcode7 = code7, rcode6 = c
The output is ode6 .... This is shown at 409 in FIG. The number (76543210) in the figure is co
Indicates the bit number of de.

【0037】PDL104は、pad=0、nad=2
を入力し、we[7..0]として“1100000
0”を出力する。
The PDL 104 has pad = 0 and nad = 2.
By inputting we [7. . 0] as “1100000
0 "is output.

【0038】一方、sel[7..1]は、nad=2
であるので、sel_regに“1100000”が入
力される(上位1ビットを参照していないため)。そし
て、次のクロックの立ち上がりでPDL104の内部フ
リップフロップに記憶され、“1100000”が出力
される。
On the other hand, sel [7. . 1] is nad = 2
Therefore, “1100000” is input to sel_reg (because the upper 1 bit is not referred to). Then, at the next rising edge of the clock, it is stored in the internal flip-flop of the PDL 104 and "1100000" is output.

【0039】pad[2..0]404は、nad
[3..0]の下位3ビット(nad[2..0])を
ラッチしたフリップフロップの出力となるので、次のク
ロックの立ち上がりに同期してpad=2となる。
Pad [2. . 0] 404 is nad
[3. . 0] is the output of the flip-flop that latches the lower 3 bits (nad [2..0]), so that pad = 2 in synchronization with the rising edge of the next clock.

【0040】valid407は、nad[3..0]
の上位1ビット(nad3)をラッチしたフリップフロ
ップの出力となるので、次のクロックの立ち上がりに同
期してvalid=0となる。
The valid 407 is the nad [3. . 0]
Since it becomes the output of the flip-flop that latches the upper 1 bit (nad3) of, the valid = 0 becomes in synchronization with the rising edge of the next clock.

【0041】408は、2段フリップフロップのイメー
ジを示しており、チェック(斜め格子網)で示した部分
は、we信号がHIGHの部分にrcodeを記憶した
ことを示している。また、ストライプ(斜め縞)の部分
は、すでに有効なデータが書き込まれていることを示し
ている。
Reference numeral 408 shows an image of a two-stage flip-flop, and the portion indicated by a check (oblique lattice network) indicates that rcode is stored in the portion where the we signal is HIGH. The stripe (diagonal stripe) portion indicates that valid data has already been written.

【0042】そして、ここでは、rcode7(=co
de7)、rcode6(=code6)を2段フリッ
プフロップに記憶した(図中、411の点)。
Then, here, rcode7 (= co
de7) and rcode6 (= code6) were stored in a two-stage flip-flop (point 411 in the figure).

【0043】次に、第2のデータlen[2..0]=
1が入力されると、加算器101はpadとlenを加
算し、nad=3を出力する。
Next, the second data len [2. . 0] =
When 1 is input, the adder 101 adds pad and len, and outputs nad = 3.

【0044】一方、バレルシフタ部103は、入力され
る符号code[7..0]をpad[2..0]に従
って並び変えを行なうが、pad[2..0]は2であ
るので、rcode7=code1、rcode6=c
ode0、rcode5=code7、rcode4=
code6、rcode3=code5、rcode2
=code4、rcode1=code3、rcode
0=code2を出力する。
On the other hand, the barrel shifter unit 103 receives the input code code [7. . 0] to pad [2. . 0], but the pad [2. . 0] is 2, rcode7 = code1, rcode6 = c
ode0, rcode5 = code7, rcode4 =
code6, rcode3 = code5, rcode2
= Code4, rcode1 = code3, rcode
0 = output code2

【0045】図4の409にその様子を示している。図
中の数字(10765432)は、codeのビット番
号を示す。
This is shown at 409 in FIG. The numeral (10765432) in the figure indicates the bit number of the code.

【0046】PDL104は、pad=2、nad=3
を入力し、we[7..0]として“0010000
0”を出力する。
The PDL 104 has pad = 2 and nad = 3.
By inputting we [7. . 0] as “00100000
0 "is output.

【0047】一方、sel[7..1]はnad=3で
あるので、sel_regに“1110000”が入力
される(上位1ビットを参照していないため)。そし
て、次のクロックの立ち上がりで、PDL103の内部
フリップフロップに記憶され、“1110000”が出
力される。
On the other hand, sel [7. . 1] is nad = 3, so “1110,000” is input to sel_reg (because the upper 1 bit is not referred to). Then, at the next rising edge of the clock, the data is stored in the internal flip-flop of the PDL 103 and "1110,000" is output.

【0048】pad[2..0]404は、nad
[3..0]の下位3ビット(nad[2..0])を
ラッチしたフリップフロップの出力となるので、次のク
ロックの立ち上がりに同期してpad=3となる。
Pad [2. . 0] 404 is nad
[3. . 0] is the output of the flip-flop that latches the lower 3 bits (nad [2..0]), so that pad = 3 in synchronization with the rising edge of the next clock.

【0049】valid407は、nad[3..0]
の上位1ビット(nad3)をラッチしたフリップフロ
ップの出力となるので、次のクロックの立ち上がりに同
期してvalid=0となる。
The valid 407 is the nad [3. . 0]
Since it becomes the output of the flip-flop that latches the upper 1 bit (nad3) of, the valid = 0 becomes in synchronization with the rising edge of the next clock.

【0050】408の412の点で、rcode5(=
code7)を2段フリップフロップに新たに記憶し
た。
At point 412 of 408, rcode5 (=
The code 7) is newly stored in a two-stage flip-flop.

【0051】次に、第3のデータlen[2..0]=
4が入力されると、加算器101はpadとlenを加
算し、nad=7を出力する。
Next, the third data len [2. . 0] =
When 4 is input, the adder 101 adds pad and len, and outputs nad = 7.

【0052】一方、バレルシフタ部103は、入力され
る符号code[7..0]をpad[2..0]に従
って並び変えを行なうが、pad[2..0]は3であ
るので、rcode7=code2、rcode6=c
ode1、rcode5=code0、rcode4=
code7、rcode3=code6、rcode2
=code5、rcode1=code4、rcode
7=code3を出力する。
On the other hand, the barrel shifter unit 103 receives the input code code [7. . 0] to pad [2. . 0], but the pad [2. . 0] is 3, rcode7 = code2, rcode6 = c
ode1, rcode5 = code0, rcode4 =
code7, rcode3 = code6, rcode2
= Code5, rcode1 = code4, rcode
7 = output code3.

【0053】409にその様子を示している。図中の数
字(21076543)はcodeのビット番号を示
す。
This is shown in 409. The number (21076543) in the figure shows the bit number of the code.

【0054】PDL104は、pad=3、nad=7
を入力し、we[7..0]として“0001111
0”を出力する。
The PDL 104 has pad = 3 and nad = 7.
By inputting we [7. . 0] as “0001111
0 "is output.

【0055】一方、sel[7..1]は、nad=7
であるので、sel_regに“1111111”が入
力される(上位1ビットを参照していないため)。そし
て、次のクロックの立ち上がりで、PDL104の内部
フリップフロップに記憶され“1110000”が出力
される。
On the other hand, sel [7. . 1] is nad = 7
Therefore, “1111111” is input to sel_reg (because the upper 1 bit is not referred to). Then, at the next rising edge of the clock, it is stored in the internal flip-flop of the PDL 104 and "1110,000" is output.

【0056】pad[2..0]404は、nad
[3..0]の下位3ビット(nad[2..0])を
ラッチしたフリップフロップの出力となるので、次のク
ロックの立ち上がりに同期してpad=7となる。
Pad [2. . 0] 404 is nad
[3. . 0] is the output of the flip-flop that latches the lower 3 bits (nad [2..0]), so that pad = 7 in synchronization with the rising edge of the next clock.

【0057】valid407は、nad[3..0]
の上位1ビット(nad3)をラッチしたフリップフロ
ップの出力となるので、次のクロックの立ち上がりに同
期してvalid=0となる。
The valid 407 is the nad [3. . 0]
Since it becomes the output of the flip-flop that latches the upper 1 bit (nad3) of, the valid = 0 becomes in synchronization with the rising edge of the next clock.

【0058】408の413の点に示すように、rco
de4(=code7)、rcode3(=code
6)、rcode2(=code5)、rcode1
(=code4)を2段フリップフロップに新たに記憶
した。
As shown at 413 of 408, rco
de4 (= code7), rcode3 (= code
6), rcode2 (= code5), rcode1
(= Code4) is newly stored in the two-stage flip-flop.

【0059】次に、第4のデータlen[2..0]=
4が入力されると、加算器101はpadとlenを加
算し、nad=11を出力する。
Next, the fourth data len [2. . 0] =
When 4 is input, the adder 101 adds pad and len, and outputs nad = 11.

【0060】一方、バレルシフタ部103は、入力され
る符号code[7..0]をpad[2..0]に従
って並び変えを行なうが、pad[2..0]は7であ
るので、rcode7=code6、rcode6=c
ode5、rcode5=code4、rcode4=
code3、rcode3=code2、rcode2
=code1、rcode1=code0、rcode
0=code7を出力する。
On the other hand, the barrel shifter section 103 receives the input code code [7. . 0] to pad [2. . 0], but the pad [2. . 0] is 7, rcode7 = code6, rcode6 = c
ode5, rcode5 = code4, rcode4 =
code3, rcode3 = code2, rcode2
= Code1, rcode1 = code0, rcode
0 = output code7.

【0061】409にその様子を示している。図中の数
字(65432107)はcodeのビット番号を示
す。
The state is shown at 409. The number (65432107) in the figure shows the bit number of the code.

【0062】PDL104は、pad=7、nad=1
1を入力し、we[7..0]として“1110000
1”を出力する。
The PDL 104 has pad = 7 and nad = 1.
1 and input we [7. . 0] as “1110,000
1 ”is output.

【0063】一方、sel[7..1]は、nad=1
1であるので、sel_regに“1110000”が
入力される。そして、次のクロックの立ち上がりで、P
DLの内部フリップフロップに記憶され“111000
0”が出力される。
On the other hand, sel [7. . 1] is nad = 1
Since it is 1, “1110,000” is input to sel_reg. Then, at the next rising edge of the clock, P
The value is stored in the internal flip-flop of the DL, “111000”.
0 "is output.

【0064】pad[2..0]404は、nad
[3..0]の下位3ビット(nad[2..0])を
ラッチしたフリップフロップの出力となるので、次のク
ロックの立ち上がりに同期してpad=3となる。
Pad [2. . 0] 404 is nad
[3. . 0] is the output of the flip-flop that latches the lower 3 bits (nad [2..0]), so that pad = 3 in synchronization with the rising edge of the next clock.

【0065】valid407は、nad[3..0]
の上位1ビット(nad3)をラッチしたフリップフロ
ップの出力となるので、次のクロックの立ち上がりに同
期してvalid=1となる。
The valid 407 is the nad [3. . 0]
Since the upper 1 bit (nad3) of the above is output from the flip-flop latched, valid = 1 in synchronization with the next rising edge of the clock.

【0066】408の414の点に示すように、rco
de0(=code7)、rcode7(=code
6)、rcode6(=code5)、rcode5
(=code4)を2段フリップフロップに新たに記憶
した。
As indicated by point 414 in 408, rco
de0 (= code7), rcode7 (= code
6), rcode6 (= code5), rcode5
(= Code4) is newly stored in the two-stage flip-flop.

【0067】また、ここではじめて次のクロックで、v
alidが“1”となる(図中、421の点)。
Also, for the first time at the next clock, v
The alid becomes “1” (point 421 in the figure).

【0068】その時の408の2段フリップフロップの
イメージで丸で示した部分が、sel[7..1]によ
って選択され、2段フリップフロップ部105から出力
されているので、そこが有効データであることを示して
いる。したがって、この丸で示した部分がパッキングさ
れたデータ(packed[7..0])である(図
中、414)。
The circled portion of the image of the 408 two-stage flip-flop at that time is sel [7. . 1] and output from the two-stage flip-flop unit 105, it indicates that the data is valid data. Therefore, the circled portion is the packed data (packed [7..0]) (414 in the figure).

【0069】次に、第5のデータlen[2..0]=
5が入力されると、加算器101はpadとlenを加
算し、nad=8を出力する。
Next, the fifth data len [2. . 0] =
When 5 is input, the adder 101 adds pad and len, and outputs nad = 8.

【0070】一方、バレルシフタ部103は、入力され
る符号code[7..0]をpad[2..0]に従
って並び変えを行なうが、pad[2..0]は3であ
るので、rcode7=code2、rcode6=c
ode1、rcode5=code0、rcode4=
code7、rcode3=code6、rcode2
=code5、rcode1=code4、rcode
0=code3を出力する。
On the other hand, the barrel shifter section 103 receives the input code code [7. . 0] to pad [2. . 0], but the pad [2. . 0] is 3, rcode7 = code2, rcode6 = c
ode1, rcode5 = code0, rcode4 =
code7, rcode3 = code6, rcode2
= Code5, rcode1 = code4, rcode
0 = output code3

【0071】409にその様子を示している。図中の数
字(21076543)はcodeのビット番号を示
す。
This is shown in 409. The number (21076543) in the figure shows the bit number of the code.

【0072】PDL104は、pad=3、nad=8
を入力し、we[7..0]として“0001111
1”を出力する。
The PDL 104 has pad = 3 and nad = 8.
By inputting we [7. . 0] as “0001111
1 ”is output.

【0073】一方、sel[7..1]は、nad=8
であるので、sel_regに“0000000”が入
力される。そして、次のクロックの立ち上がりで、PD
L104の内部フリップフロップに記憶され、“000
0000”が出力される。
On the other hand, sel [7. . 1] is nad = 8
Therefore, “0000000” is input to sel_reg. Then, at the next rising edge of the clock, PD
Stored in the internal flip-flop of L104,
0000 "is output.

【0074】pad[2..0]404は、nad
[3..0]の下位3ビット(nad[2..0])を
ラッチしたフリップフロップの出力となるので、次のク
ロックの立ち上がりに同期してpad=0となる。
Pad [2. . 0] 404 is nad
[3. . 0] is the output of the flip-flop that latches the lower 3 bits (nad [2..0]), so that pad = 0 is set in synchronization with the rising edge of the next clock.

【0075】valid407は、nad[3..0]
の上位1ビット(nad3)をラッチしたフリップフロ
ップの出力となるので、次のクロックの立ち上がりに同
期してvalid=1となる。
The valid 407 is the nad [3. . 0]
Since the upper 1 bit (nad3) of the above is output from the flip-flop latched, valid = 1 in synchronization with the next rising edge of the clock.

【0076】408の415の点に示すように、rco
de4(=code7)、rcode3(=code
6)、rcode2(=code5)、rcode1
(=code4)、rcode0(=code3)を2
段フリップフロップに新たに記憶した。
As indicated by point 415 of 408, rco
de4 (= code7), rcode3 (= code
6), rcode2 (= code5), rcode1
(= Code4), rcode0 (= code3) to 2
Newly stored in the stage flip-flop.

【0077】また、ここでも次のクロックでvalid
が“1”となる(図中、422)。その時の408の2
段フリップフロップのイメージで丸で示した部分が、s
el[7..1]によって選択され、2段フリップフロ
ップ部105から出力されているので、そこが有効デー
タであることを示している。したがって、この丸で示し
た部分がパッキングされたデータ(packed
[7..0])である。
Here again, the next clock is valid.
Becomes "1" (422 in the figure). 2 of 408 at that time
The circled part in the image of the stage flip-flop is s
el [7. . 1] and output from the two-stage flip-flop unit 105, it indicates that the data is valid data. Therefore, the data indicated by the circle is packed data (packed).
[7. . 0]).

【0078】同様に、図4の402にしたがってlen
[2..0]とcode[7..0]を入力していく
と、2、1、4、4、5、1、3、2、3、、、とラン
ダムに続く可変長符号がきれいにパッキングされて出力
される。そして、その出力は、validが1の時のみ
有効である。
Similarly, according to 402 in FIG.
[2. . 0] and code [7. . [0] is input, variable length codes randomly following 2, 1, 4, 4, 5, 1, 3, 2, 3, ... Are neatly packed and output. The output is valid only when valid is 1.

【0079】なお、以上の実施例では、可変長データの
最長を8としたが、その限りではなく、例えば16また
は6にしても簡単に応用できることは明らかである。
Although the maximum length of the variable length data is set to 8 in the above embodiments, it is obvious that the present invention is not limited to this and can be easily applied to 16 or 6, for example.

【0080】また、上記実施例では、制御信号を出力す
る手段としてPDLを使用したが、TTLを用いて作成
しても良いし、その他にもいろいろ方法がある。
Further, in the above embodiment, the PDL is used as the means for outputting the control signal, but it may be created by using TTL, and there are various other methods.

【0081】また、図5に示すように、2段のフリップ
フロップ手段を構成してもよい。この場合には、sel
およびvalidは遅延させずダイレクトに出力する構
成になる。なお、この場合、valid=HIGHのあ
と、手前のFFに書かれたデータを次に渡す作業が必要
になる。
Further, as shown in FIG. 5, two-stage flip-flop means may be constructed. In this case, sel
And valid are directly output without delay. In this case, after valid = HIGH, it is necessary to pass the data written in the front FF next.

【0082】[0082]

【発明の効果】以上説明したように、本発明によれば、
入力される符号長を加算してトータル長を演算する加算
手段と、前記トータル長を1クロックサイクル遅延させ
て遅延データを作成する遅延手段と、入力される符号を
バレルシフトして並び変えデータを作成するマルチプレ
クサ手段と、前記トータル長と前記遅延データとを入力
して第1制御信号と第2制御信号2とを発生する制御手
段と、前記並び変えデータを前記第1制御信号に基づい
て一次記憶する2段のフリップフロップ手段と、前記2
段のフリップフロップ手段に記憶されたデータのうちの
一方を前記第2制御信号に基づいて選択する選択手段と
を有することにより、パッキングデータをシステムクロ
ックに同期して次の符号を停止させることなく出力する
ことが可能となる効果がある。
As described above, according to the present invention,
Addition means for adding the input code lengths to calculate the total length, delay means for delaying the total length by one clock cycle to create delay data, and barrel-shifting the input codes for rearranging data. Multiplexer means for creating, control means for inputting the total length and the delay data to generate a first control signal and a second control signal 2, and the rearrangement data based on the first control signal. A two-stage flip-flop means for storing the data;
By having one of the data stored in the flip-flop means of the stage selected based on the second control signal, the packing data is synchronized with the system clock without stopping the next code. There is an effect that it is possible to output.

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

【図1】本発明の一実施例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】上記実施例の2段フリップフロップ部の構成を
示すブロック図である。
FIG. 2 is a block diagram showing a configuration of a two-stage flip-flop unit of the above embodiment.

【図3】上記実施例のPDLの動作内容を示す表であ
る。
FIG. 3 is a table showing operation contents of the PDL of the above embodiment.

【図4】上記実施例におけるサンプルデータの波形図で
ある。
FIG. 4 is a waveform diagram of sample data in the above embodiment.

【図5】本発明の他の実施例を示すブロック図である。FIG. 5 is a block diagram showing another embodiment of the present invention.

【符号の説明】[Explanation of symbols]

101…加算器、 102…遅延部、 103…バレルシフト部、 104…PLD、 105…2段フリップフロップ部。 101 ... Adder, 102 ... Delay unit, 103 ... Barrel shift unit, 104 ... PLD, 105 ... Two-stage flip-flop unit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 入力される符号長を加算してトータル長
を演算する加算手段と;前記トータル長を1クロックサ
イクル遅延させて遅延データを作成する遅延手段と;入
力される符号をバレルシフトして並び変えデータを作成
するマルチプレクサ手段と;前記トータル長と前記遅延
データとを入力して第1制御信号と第2制御信号2とを
発生する制御手段と;前記並び変えデータを前記第1制
御信号に基づいて一次記憶する2段のフリップフロップ
手段と;前記2段のフリップフロップ手段に記憶された
データのうちの一方を前記第2制御信号に基づいて選択
する選択手段と;を有することを特徴とする可変長符号
パッキング装置。
1. Addition means for adding input code lengths to calculate total length; delay means for delaying the total length by one clock cycle to create delay data; barrel-shifting input codes. Multiplexer means for creating rearrangement data by the above; control means for inputting the total length and the delay data to generate a first control signal and a second control signal 2; the rearrangement data for the first control Two-stage flip-flop means for temporarily storing based on a signal; and selecting means for selecting one of the data stored in the two-stage flip-flop means based on the second control signal. Characteristic variable length code packing device.
JP6051412A 1994-02-24 1994-02-24 Variable length code packing device Pending JPH07235877A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6051412A JPH07235877A (en) 1994-02-24 1994-02-24 Variable length code packing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6051412A JPH07235877A (en) 1994-02-24 1994-02-24 Variable length code packing device

Publications (1)

Publication Number Publication Date
JPH07235877A true JPH07235877A (en) 1995-09-05

Family

ID=12886222

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6051412A Pending JPH07235877A (en) 1994-02-24 1994-02-24 Variable length code packing device

Country Status (1)

Country Link
JP (1) JPH07235877A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100397905C (en) * 2004-01-13 2008-06-25 C&S技术有限公司 Video coding system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100397905C (en) * 2004-01-13 2008-06-25 C&S技术有限公司 Video coding system

Similar Documents

Publication Publication Date Title
Arps et al. A multi-purpose VLSI chip for adaptive data compression of bilevel images
US6150847A (en) Device and method for generating a variable duty cycle clock
US5272478A (en) Method and apparatus for entropy coding
US6583674B2 (en) Fractional multimodulus prescaler
EP0071680B1 (en) Data recording or transmission system using run length limited coding
EP0468732A2 (en) Sequence control apparatus
US7579883B2 (en) Frequency divider
JPH05508528A (en) Apparatus and method for performing asynchronous cyclic redundancy check of digital receiver
EP0158980A2 (en) Digital time base corrector
US5974433A (en) High speed M-sequence generator and decoder circuit
JPS63301624A (en) Pulse series frequency demultiplying circuit
GB2236934A (en) Maximum length shift register sequence generator circuit
US5608802A (en) Data ciphering device
JPH07235877A (en) Variable length code packing device
US4234849A (en) Programmable frequency divider and method
KR100795173B1 (en) Frequency synthesizer
EP0802681A2 (en) Variable length code decoder
US5621337A (en) Iterative logic circuit
JP2010124228A (en) Frequency division circuit and electronic apparatus
KR0177194B1 (en) Variable-length decoding device
EP0629050B1 (en) High-throughput variable length decoder and apparatus comprising such decoder
KR100234048B1 (en) Dividing circuit
KR960019997A (en) Arbitrary divided clock generation circuit
JPH05283993A (en) Pulse width modulating method and pulse width modulation circuit
JP2592522B2 (en) PN code phase modulation circuit