[go: up one dir, main page]

JP3409845B2 - Variable length bit string processing apparatus and variable length bit string processing method using the same - Google Patents

Variable length bit string processing apparatus and variable length bit string processing method using the same

Info

Publication number
JP3409845B2
JP3409845B2 JP33300899A JP33300899A JP3409845B2 JP 3409845 B2 JP3409845 B2 JP 3409845B2 JP 33300899 A JP33300899 A JP 33300899A JP 33300899 A JP33300899 A JP 33300899A JP 3409845 B2 JP3409845 B2 JP 3409845B2
Authority
JP
Japan
Prior art keywords
bit string
register
variable length
bit
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
JP33300899A
Other languages
Japanese (ja)
Other versions
JP2001156645A (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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP33300899A priority Critical patent/JP3409845B2/en
Publication of JP2001156645A publication Critical patent/JP2001156645A/en
Application granted granted Critical
Publication of JP3409845B2 publication Critical patent/JP3409845B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、MPU(マイクロ
プロセッサ)やDSP(ディジタル・シグナル・プロセ
ッサ)等のプロセッサにおける可変長符号化処理時に、
符号化された可変長符号語をビットストリームとしてレ
ジスタ等に格納したり、プロセッサにおける可変長復号
化処理時に、レジスタ等に格納されたビットストリーム
から可変長符号語を抽出したりするための可変長ビット
列処理装置及びこれを用いた可変長ビット列処理方法に
関し、特に、ハードウェア規模が小さな可変長ビット列
処理装置及びこれを用いた可変長ビット列処理方法に関
する。
The present invention relates to a variable length coding process in a processor such as MPU (microprocessor) or DSP (digital signal processor).
A variable length for storing the encoded variable-length codeword as a bitstream in a register or the like, or for extracting a variable-length codeword from the bitstream stored in the register or the like during variable-length decoding processing in a processor. The present invention relates to a bit string processing device and a variable length bit string processing method using the same, and more particularly to a variable length bit string processing device having a small hardware scale and a variable length bit string processing method using the same.

【0002】[0002]

【従来の技術】ディジタル信号処理の対象となる画像信
号や音声信号は、複数の符号語に符号化され、更に、こ
の複数の符号語が連結された形(以下、ビットストリー
ムと称する)で伝送されたり蓄積されたりする。
2. Description of the Related Art Image signals and audio signals to be subjected to digital signal processing are coded into a plurality of code words and are further transmitted in a form in which the plurality of code words are connected (hereinafter referred to as a bit stream). It is done and accumulated.

【0003】将来的に仕様変更のないシステムに用いら
れる画像信号や音声信号に対する単純な符号化及び復号
化処理を行う場合には、符号化及び復号化処理を専用に
行うためのハードウェアが設けられている。
When performing simple encoding and decoding processing for image signals and audio signals used in a system whose specifications are not changed in the future, hardware for exclusively performing the encoding and decoding processing is provided. Has been.

【0004】しかしながら、近年、画像信号や音声信号
等のデータに対する符号化及び復号化処理を、複雑な制
御やシステムの仕様変更に素早く適応できるようにMP
UやDSP等のプロセッサのソフトウェア上で実現させ
る技術が望まれている。
However, in recent years, MPs have been adopted so that encoding and decoding processes for data such as image signals and audio signals can be quickly adapted to complicated control and system specification changes.
There is a demand for a technique realized by software of a processor such as U or DSP.

【0005】ここで、MPUやDSP等のプロセッサの
ソフトウェア上で行われる符号化及び復号化処理につい
て説明する。
Here, the encoding and decoding processes performed on the software of the processor such as MPU and DSP will be described.

【0006】画像信号や音声信号のデータに対する符号
化処理においては、符号化される画像信号や音声信号の
データを、予め設定されたテーブルを参照して符号語に
変換する。その後、この符号語は、レジスタ上で作成中
のビットストリームに挿入される。
In the encoding process for the image signal and audio signal data, the encoded image signal and audio signal data is converted into a code word by referring to a preset table. This codeword is then inserted into the bitstream being created on the register.

【0007】一方、符号語に対する復号化処理において
は、復号化される符号語をレジスタに格納されたビット
ストリームから抽出し、抽出された符号語(或いは、こ
の符号語を含むビット列)をアドレスとして上記テーブ
ルを参照して画像信号や音声信号のデータを再生する。
On the other hand, in the decoding process for a codeword, the codeword to be decoded is extracted from the bitstream stored in the register, and the extracted codeword (or a bit string including this codeword) is used as an address. The data of the image signal and the audio signal is reproduced with reference to the above table.

【0008】なお、ビットストリームには、固定長の符
号語と可変長の符号語とが混在しており、テーブル参照
により可変長符号語の復号化処理を行う場合には、復号
化された可変長符号語に対応する画像信号や音声信号の
データを再生すると同時に、この可変長符号語のビット
列長を得ることが可能である。
It should be noted that the bitstream contains a mixture of fixed-length codewords and variable-length codewords, and when the variable-length codeword is decoded by referring to a table, the decoded variable It is possible to reproduce the data of the image signal and the audio signal corresponding to the long codeword and at the same time obtain the bit string length of the variable length codeword.

【0009】このため、テーブル参照により可変長符号
語の復号化処理を行う場合には、直前に復号化された可
変長符号語のビット列長に基づいてビットストリームか
ら次に復号化される可変長符号語を抽出する。
Therefore, when the variable length code word is decoded by referring to the table, the variable length coded from the bit stream is decoded next based on the bit string length of the variable length code word decoded immediately before. Extract the codeword.

【0010】しかしながら、可変長符号化処理時に、符
号化された可変長符号語をレジスタ上で作成中のビット
ストリームに挿入したり、復号化処理時に、レジスタに
格納されたビットストリームから可変長符号語を抽出し
たりする処理をMPUやDSP等のプロセッサのソフト
ウェア上で実現する場合、可変長符号化及び可変長復号
化処理の効率が悪化するおそれがある。
However, at the time of the variable length coding process, the coded variable length code word is inserted into the bitstream being created on the register, or at the time of the decoding process, the variable length code is changed from the bitstream stored in the register. When the process of extracting a word is implemented by software of a processor such as MPU or DSP, the efficiency of the variable length encoding and variable length decoding processes may be deteriorated.

【0011】このため、特に、ビットレートが高いビッ
トストリームに可変長符号語を挿入したり、ビットレー
トが高いビットストリームに含まれる可変長符号語を抽
出したりする場合には、これらの可変長ビット列処理を
専用に行うための可変長ビット列処理装置を設け、この
可変長ビット列処理装置を用いて可変長ビット列処理を
行うことが多い。
Therefore, particularly when a variable length code word is inserted into a bit stream having a high bit rate or a variable length code word included in a bit stream having a high bit rate is extracted, these variable length code words are extracted. In many cases, a variable-length bit string processing device is provided for exclusive use in bit-string processing, and the variable-length bit string processing device is used to perform variable-length bit string processing.

【0012】従来の可変長ビット列処理装置は、複数の
シフタが設けられた専用のハードウェアとして実現され
ており、例えば、その技術が特開平5−250139号
公報に開示されている。
The conventional variable length bit string processing device is realized as a dedicated hardware provided with a plurality of shifters, and its technique is disclosed in, for example, Japanese Unexamined Patent Publication No. 5-250139.

【0013】図9は、従来の可変長ビット列処理装置の
一構成例を示すブロック図である。なお、図9において
は、シフト量入力904及び入力ビット列905が、外
部から入力されるものとする。
FIG. 9 is a block diagram showing an example of the configuration of a conventional variable length bit string processing device. In FIG. 9, the shift amount input 904 and the input bit string 905 are input from the outside.

【0014】図9に示すように本従来例は、32ビット
のバッファ901と、入力ビット列905をシフト量入
力904に基づいてシフトし、このシフト結果を出力す
る32ビットのシフタ902と、バッファ901の内容
とシフタ902から出力されたシフト結果とを連接し、
この連接結果をシフト量入力904に基づいてシフト
し、このシフト結果を抽出ビット列906として出力す
る32ビットのシフタ903とから構成されている。
As shown in FIG. 9, in this conventional example, a 32-bit buffer 901, a 32-bit shifter 902 that shifts an input bit string 905 based on a shift amount input 904, and outputs the shift result, and a buffer 901. And the shift result output from the shifter 902 are connected,
This concatenation result is shifted based on the shift amount input 904, and this shift result is output as an extracted bit string 906 and is composed of a 32-bit shifter 903.

【0015】なお、シフタ903から抽出ビット列90
6が出力されると、バッファ901の内容が、シフタ9
03から出力された抽出ビット列906の内容に更新さ
れる。
The bit string 90 extracted from the shifter 903.
When 6 is output, the contents of the buffer 901 are changed to the shifter 9
03 is updated to the content of the extracted bit string 906.

【0016】上記のように構成された可変長ビット列処
理装置においては、シフタ902において、入力ビット
列905がシフト量入力904に基づいてシフトされ、
このシフト結果が出力され、シフタ903において、ビ
ット列バッファ901の内容とシフタ902から出力さ
れたシフト結果とが連接され、更に、この連接結果がシ
フト量入力904に基づいてシフトされ、このシフト結
果が抽出ビット列906として出力される。
In the variable length bit string processing device having the above-mentioned configuration, the shifter 902 shifts the input bit string 905 based on the shift amount input 904,
This shift result is output, the contents of the bit string buffer 901 and the shift result output from the shifter 902 are concatenated in the shifter 903, and the concatenation result is further shifted based on the shift amount input 904. The extracted bit string 906 is output.

【0017】以下に、MPUやDSP等のプロセッサの
ソフトウェア上で図9に示した従来の可変長ビット列処
理装置を用いて行われる可変長ビット列抽出処理につい
て説明する。
A variable length bit string extraction process performed by using the conventional variable length bit string processing device shown in FIG. 9 on software of a processor such as MPU or DSP will be described below.

【0018】なお、通常の可変長ビット列抽出処理にお
いては、抽出される可変長符号語の先頭ビットが所定の
レジスタにおける最上位ビットに一致するように、この
可変長符号語が所定のレジスタに格納される。
In the normal variable length bit string extraction processing, this variable length codeword is stored in a predetermined register so that the leading bit of the extracted variable length codeword matches the most significant bit in a predetermined register. To be done.

【0019】図10は、図9に示した従来の可変長ビッ
ト列処理装置を用いた可変長ビット列抽出処理を説明す
るための図である。ここでは、バッファ901に格納さ
れた符号語Aの先頭ビットがレジスタ1004の最上位
ビットに一致するように、符号語Aをレジスタ1004
に格納する場合の可変長ビット列抽出処理について説明
する。
FIG. 10 is a diagram for explaining a variable length bit string extraction process using the conventional variable length bit string processing device shown in FIG. Here, the code word A is stored in the register 1004 so that the first bit of the code word A stored in the buffer 901 matches the most significant bit of the register 1004.
The variable-length bit string extraction processing for storing in the following will be described.

【0020】なお、図10においては、バッファ901
は、既に復号化処理が行われてテーブル参照用アドレス
として抽出された可変長の復号済み符号語1003a
と、次に復号化される可変長の符号語Aと、可変長の符
号語Bの一部とからなる符号語1003bとを計32ビ
ットのビットストリームとして格納しているものとす
る。
In FIG. 10, the buffer 901
Is a variable-length decoded codeword 1003a that has already been decoded and is extracted as a table reference address.
Then, it is assumed that the codeword 1003b consisting of the variable-length codeword A to be decoded next and a part of the variable-length codeword B is stored as a bit stream of 32 bits in total.

【0021】また、シフト量レジスタ1002は、バッ
ファ901に格納された復号済み符号語1003aのビ
ット列長LENビットと同一のビット列長を具備するビ
ット列1002aを格納しているものとする。このビッ
ト列1002aのビット列長は、テーブル参照により復
号済み符号語1003aが復号化処理された際に得られ
たビット列長に基づくものである。
The shift amount register 1002 is assumed to store a bit string 1002a having the same bit string length as the bit string length LEN bits of the decoded codeword 1003a stored in the buffer 901. The bit string length of the bit string 1002a is based on the bit string length obtained when the decoded codeword 1003a is subjected to the decoding process by referring to the table.

【0022】また、外部入力バッファ1001は、バッ
ファ901に格納された符号語1003bの内容に続く
符号語1001aを格納しているものとする。なお、符
号語1001aは、ビット列長が復号済み符号語100
3aのビット列長LENビットと同一であり、符号語B
の一部及び符号語Cから構成されている。
Further, it is assumed that the external input buffer 1001 stores a codeword 1001a following the content of the codeword 1003b stored in the buffer 901. The codeword 1001a has a bit string length of 100
3a is the same as the bit string length LEN bits, and the code word B
And a codeword C.

【0023】まず、外部入力バッファ1001の内容を
入力ビット列905としてシフタ902に入力し、更
に、シフト量レジスタ1002の内容をシフト量入力9
04としてシフタ902及びシフタ903に入力する。
First, the content of the external input buffer 1001 is input to the shifter 902 as an input bit string 905, and the content of the shift amount register 1002 is input to the shift amount 9
04 is input to the shifter 902 and the shifter 903.

【0024】すると、シフタ902において、入力ビッ
ト列905として入力された外部入力バッファ1001
の内容がシフト量入力904に基づいてビット列100
2aのビット列長分だけ左にシフトされ、このシフト結
果がシフタ903に対して出力される。
Then, in the shifter 902, the external input buffer 1001 input as the input bit string 905 is input.
Of the bit string 100 based on the shift amount input 904.
The bit string length of 2a is shifted to the left, and the shift result is output to the shifter 903.

【0025】これにより、外部入力バッファ1001に
格納された符号語1001aが外部入力バッファ100
1から掃き出され、掃き出された符号語1001aがシ
フタ903に入力されることになる。
As a result, the codeword 1001a stored in the external input buffer 1001 is stored in the external input buffer 1001.
The codeword 1001a that has been swept out from 1 is input to the shifter 903.

【0026】ここで、バッファ901の内容をシフタ9
03に入力する。
Here, the contents of the buffer 901 are transferred to the shifter 9
Enter in 03.

【0027】すると、シフタ903において、外部入力
バッファ1001から掃き出された符号語1001aが
バッファ901の内容の最下位ビット側から連接され、
更に、この連接結果がシフト量レジスタ1002の内容
に基づいてビット列1002aのビット列長分だけ左に
シフトされる。このシフト結果は、32ビットの抽出ビ
ット列906として装置外部に出力され、その後、装置
外部に出力された抽出ビット列906の内容がレジスタ
1004に格納される。
Then, in the shifter 903, the code word 1001a swept from the external input buffer 1001 is concatenated from the least significant bit side of the contents of the buffer 901,
Further, the concatenation result is shifted to the left by the bit string length of the bit string 1002a based on the contents of the shift amount register 1002. The shift result is output to the outside of the device as a 32-bit extracted bit string 906, and then the content of the extracted bit string 906 output to the outside of the device is stored in the register 1004.

【0028】これにより、符号語Aの先頭ビットがレジ
スタ1004における最上位ビットに一致した状態でレ
ジスタ1004に格納され、符号語A及び符号語Aの復
号化処理に用いられるテーブル参照アドレス用ビット列
の抽出が完了する。
As a result, the first bit of the code word A is stored in the register 1004 in a state where it matches the most significant bit in the register 1004, and the code word A and the bit string for the table reference address used for decoding the code word A are stored. The extraction is complete.

【0029】その後、バッファ901の内容をレジスタ
1004の内容に更新して次回の可変長ビット列抽出処
理時に備える。
After that, the contents of the buffer 901 are updated to the contents of the register 1004 in preparation for the next variable length bit string extraction processing.

【0030】[0030]

【発明が解決しようとする課題】しかしながら、上述し
たような従来の可変長ビット列処理装置においては、複
数のシフタや内部バッファが設けられており、これによ
り、ハードウェア規模が大きくなってしまうという問題
点がある。
However, in the conventional variable-length bit string processing apparatus as described above, a plurality of shifters and internal buffers are provided, which increases the hardware scale. There is a point.

【0031】本発明は上述したような従来の技術が有す
る問題点に鑑みてなされたものであって、小さなハード
ウェア規模で可変長ビット列処理を効率良く実行するこ
とができる可変長ビット列処理装置及びこれを用いた可
変長ビット列処理方法を提供することを目的とする。
The present invention has been made in view of the problems of the above-mentioned conventional techniques, and a variable length bit string processing apparatus and a variable length bit string processing device capable of efficiently executing variable length bit string processing with a small hardware scale. An object is to provide a variable length bit string processing method using this.

【0032】[0032]

【課題を解決するための手段】上記目的を達成するため
に本発明は、プロセッサにおける可変長符号化或いは可
変長復号化処理時に、可変長符号語の挿入処理或いは抽
出処理を行うための可変長ビット列処理装置において、
第1の入力ビット列及びシフト量信号が入力され、該第
1の入力ビット列を該シフト量信号に基づいてシフト
し、該シフト結果を出力するシフト手段と、第2の入力
ビット列が入力され、前記プロセッサにおける処理内容
に基づいて該第2の入力ビット列或いは前記シフト手段
から出力された前記シフト結果の下位半分のビット列の
いずれかを選択し、該選択結果を出力する選択手段と、
前記シフト手段から出力された前記シフト結果の上位半
分のビット列と前記選択手段から出力された選択結果と
を連接し、該連接結果を出力ビット列として出力する連
接手段とを有することを特徴とする。
In order to achieve the above object, the present invention provides a variable length variable length codeword variable length codeword insertion process or variable length codeword insertion process or variable length codeword decoding process in a processor. In the bit string processor,
Is input first input bit string and the shift amount signal, an input bit sequence of the first shifted based on the shift amount signal, a shift means for outputting the shift result, the second input bit string is input, the Processing content in the processor
Selecting means for selecting either the second input bit string or the bit string of the lower half of the shift result output from the shift means based on the above, and outputting the selection result,
And a concatenation unit that concatenates the upper half bit string of the shift result output from the shift unit and the selection result output from the selection unit, and outputs the concatenation result as an output bit string.

【0033】[0033]

【0034】また、前記シフト手段は、バレルシフタで
あることを特徴とする。
Further, the shift means is a barrel shifter.

【0035】また、前記選択手段は、マルチプレクサで
あることを特徴とする。
Further, the selection means is a multiplexer.

【0036】また、前記可変長ビット列処理装置を用い
た可変長ビット列処理方法であって、前記プロセッサに
よって、前記連接手段における処理を行うことを特徴と
する。
A variable-length bit string processing method using the variable-length bit string processing device is characterized in that the processing in the connecting means is performed by the processor.

【0037】また、前記プロセッサによって、前記第1
の入力ビット列、前記第2の入力ビット列及び前記シフ
ト量信号を予め設定して当該可変長ビット列処理装置に
入力することを特徴とする。
Further, by the processor, the first
Of the input bit string, the second input bit string, and the shift amount signal are preset and input to the variable length bit string processing device.

【0038】(作用)上記のように構成された本発明に
おいては、プロセッサにおける処理内容に基づいて選択
するビット列が切り換わる選択手段に第1の入力ビット
列のシフト結果の下位半分のビット列と第2の入力ビッ
ト列とが入力され、両ビット列のうち選択手段にて選択
されたビット列と第1の入力ビット列のシフト結果の上
位半分のビット列とが連結手段にて連結されるので、第
1の入力ビット列がシフト量信号に基づいてシフトされ
た出力ビット列、或いは、第1の入力ビット列がシフト
量信号に基づいてシフトされたシフト結果の下位半分の
ビット列が第2の入力ビット列で置換された出力ビット
列のいずれかが本可変長ビット列処理装置から出力され
ることになる。
(Operation) In the present invention configured as described above, the selection means for switching the bit string to be selected based on the processing content in the processor is used as the selecting means for switching the bit string of the lower half of the shift result of the first input bit string and the second bit string. Input bit string of the first input bit string and the bit string selected by the selection means of both bit strings and the upper half bit string of the shift result of the first input bit string are connected by the connection means. Of the output bit string that is shifted based on the shift amount signal, or the output bit string in which the lower half bit string of the shift result obtained by shifting the first input bit string based on the shift amount signal is replaced with the second input bit string. Either of them will be output from the variable length bit string processing device.

【0039】このため、プロセッサのソフトウェア上で
第1の入力ビット列、第2の入力ビット列及びシフト量
信号を予め設定して本可変長ビット列処理装置に入力す
ることにより種々の可変長ビット列処理が可能となり、
これにより、通常のシフト処理、可変長ビット列抽出処
理及び可変長ビット列挿入処理が効率良く実行される。
Therefore, various variable length bit string processing can be performed by presetting the first input bit string, the second input bit string and the shift amount signal on the software of the processor and inputting them to the variable length bit string processing device. Next to
As a result, normal shift processing, variable-length bit string extraction processing, and variable-length bit string insertion processing are efficiently executed.

【0040】また、プロセッサによって連接手段におけ
る処理を行う場合においては、シフト手段及び選択手段
のみで本可変長ビット列処理装置が構成されるため、ハ
ードウェア規模が削減される。
Further, in the case where the processor performs the processing in the connecting means, since the present variable length bit string processing device is constituted only by the shifting means and the selecting means, the hardware scale is reduced.

【0041】また、シフト手段がバレルシフタである場
合においては、バレルシフタが搭載されたプロセッサに
本可変長ビット列処理装置を実装した時に、プロセッサ
及び本可変長ビット列処理装置におけるバレルシフタの
共有化が可能になる。
In the case where the shift means is a barrel shifter, when the variable length bit string processor is mounted on the processor equipped with the barrel shifter, the barrel shifter can be shared by the processor and the variable length bit string processor. .

【0042】これにより、バレルシフタが搭載されたプ
ロセッサに本可変長ビット列処理装置を実装した場合に
は、プロセッサに搭載されたバレルシフタに1個の選択
手段を接続することにより本可変長ビット列処理装置が
実現されるため、ハードウェア規模が大幅に削減され
る。
As a result, when the variable length bit string processor is mounted on the processor equipped with the barrel shifter, the variable length bit string processor is connected to the barrel shifter mounted on the processor by one selecting means. As a result, the scale of hardware is significantly reduced.

【0043】[0043]

【発明の実施の形態】以下に、本発明の実施の形態につ
いて図面を参照して説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the drawings.

【0044】図1は、本発明の可変長ビット列処理装置
の実施の一形態を示すブロック図である。なお、図1に
おいては、第1の入力ビット列である被シフト信号(A
[31:0])105、シフト量信号106及び第2の入力ビ
ット列である16ビットの被挿入信号(C[15:0])10
7が外部から入力されるものとする。ここで、{A[31:1
6]}の記号は、信号Aにおけるビット31からビット1
6までのビット列を示し、また、{B[31:16],D[15:0]}の
記号は、信号B[31:16]の最下位ビット側から信号D[1
5:0]を連接した信号を示す。
FIG. 1 is a block diagram showing an embodiment of a variable length bit string processing device of the present invention. Note that in FIG. 1, the shifted signal (A
[31: 0]) 105, shift amount signal 106, and 16-bit inserted signal (C [15: 0]) 10 that is the second input bit string.
It is assumed that 7 is input from the outside. Where (A [31: 1
6]} sign is bit 31 to bit 1 in signal A
6 shows a bit string up to 6, and the symbols {B [31:16], D [15: 0]} indicate that the signal D [1 is from the least significant bit side of the signal B [31:16].
5: 0] is a concatenated signal.

【0045】図1に示すように本形態は、32ビットの
被シフト信号(A[31:0])105をシフト量信号106
に基づいてシフトし、このシフト結果を32ビットのシ
フト結果(B[31:0])108として出力する32ビット
のシフタ101と、シフタ101から出力されたシフト
結果(B[31:0])108を上位16ビットの信号と下位
16ビットの信号とに分配し、分配されたそれぞれの信
号を上位16ビット信号(B[31:16])109及び下位
16ビット信号(B[15:0])110として出力する分配
手段102と、分配手段102から出力された下位16
ビット信号(B[15:0])110及び外部から入力された
16ビットの被挿入信号(C[15:0])107のいずれか
を選択し、この選択結果を選択結果(D[15:0])111
として出力するマルチプレクサ103と、分配手段10
2から出力された上位16ビット信号(B[31:16])1
09とマルチプレクサ103から出力された選択結果
(D[15:0])111とを連接し、この連接結果を32ビ
ットの出力ビット列(B[31:16],D[15:0])112として
装置外部に出力する連接手段104とから構成されてい
る。
In the present embodiment, as shown in FIG. 1, the 32-bit shifted signal (A [31: 0]) 105 is changed to the shift amount signal 106.
The shift result (B [31: 0]) output from the shifter 101 and the 32-bit shifter 101 that outputs the shift result as a 32-bit shift result (B [31: 0]) 108. 108 is divided into a high-order 16-bit signal and a low-order 16-bit signal, and the respective divided signals are divided into a high-order 16-bit signal (B [31:16]) 109 and a low-order 16-bit signal (B [15: 0]). ) 110 as the distribution means 102 and the lower 16 output from the distribution means 102
Either the bit signal (B [15: 0]) 110 or the 16-bit inserted signal (C [15: 0]) 107 input from the outside is selected, and the selection result (D [15: 0]) 111
Multiplexer 103 for outputting as and distribution means 10
Upper 16-bit signal (B [31:16]) 1 output from 2
09 and the selection result (D [15: 0]) 111 output from the multiplexer 103 are connected, and the connection result is used as a 32-bit output bit string (B [31:16], D [15: 0]) 112. It is composed of a connecting means 104 for outputting to the outside of the device.

【0046】シフタ101は、MPUやDSP等のプロ
セッサに搭載されている通常の32ビットのバレルシフ
タであり、算術右シフト、論理右シフト及び論理左シフ
ト等の演算が可能である。
The shifter 101 is a normal 32-bit barrel shifter mounted on a processor such as MPU or DSP, and can perform arithmetic right shift, logical right shift, logical left shift and the like.

【0047】なお、分配手段102及び連接手段104
のそれぞれは、単に信号線を分流或いは合流させるだけ
のものである。このため、実際には、分配手段102及
び連接手段104専用のハードウェアが存在するわけで
はなく、MPUやDSP等のプロセッサのソフトウェア
上で信号線の分流或いは合流処理が行われる。
The distributing means 102 and the connecting means 104
Each of them simply divides or merges the signal line. For this reason, in practice, there is no dedicated hardware for the distribution means 102 and the connection means 104, and the shunting or merging processing of the signal lines is performed by the software of the processor such as MPU or DSP.

【0048】以下に、上記のように構成された可変長ビ
ット列処理装置の動作について説明する。
The operation of the variable length bit string processing device configured as described above will be described below.

【0049】本形態においては、被シフト信号105を
シフト量信号106に基づいてシフトするシフト動作モ
ード(算術右シフト、論理右シフト及び論理左シフト)
と、被シフト信号105をシフト量信号106に基づい
てシフトした後、このシフト結果108の下位16ビッ
トの信号を被挿入信号107で置換するビット列挿入動
作モードとの2種類の動作モードに基づいて動作が行わ
れる。なお、これらの動作モードは、MPUやDSP等
のプロセッサからの命令種別により決定される。
In this embodiment, a shift operation mode in which the shifted signal 105 is shifted based on the shift amount signal 106 (arithmetic right shift, logical right shift and logical left shift).
And a bit string insertion operation mode in which the shifted signal 105 is shifted based on the shift amount signal 106, and the lower 16 bits of the shift result 108 are replaced with the inserted signal 107. The action is taken. Note that these operation modes are determined by the instruction type from the processor such as MPU or DSP.

【0050】まず、シフト動作について図2を参照して
説明する。
First, the shift operation will be described with reference to FIG.

【0051】図2は、図1に示した可変長ビット列処理
装置におけるシフト動作を説明するための図である。な
お、図2においては、シフト動作時に選択される信号線
を実線で示し、また、シフト動作時に選択されない信号
線を破線で示す。
FIG. 2 is a diagram for explaining a shift operation in the variable length bit string processing device shown in FIG. In FIG. 2, signal lines selected during the shift operation are indicated by solid lines, and signal lines not selected during the shift operation are indicated by broken lines.

【0052】まず、32ビットの被シフト信号(A[31:
0])105及びシフト量信号106がシフタ101に入
力され、また、16ビットの被挿入信号107がマルチ
プレクサ103に入力される。
First, the 32-bit shifted signal (A [31:
0]) 105 and shift amount signal 106 are input to shifter 101, and 16-bit inserted signal 107 is input to multiplexer 103.

【0053】次に、シフタ101において、被シフト信
号(A[31:0])105が、シフト量信号106に基づい
てシフトされ、このシフト結果が32ビットのシフト結
果(B[31:0])108として出力される。
Next, in the shifter 101, the shifted signal (A [31: 0]) 105 is shifted based on the shift amount signal 106, and this shift result is a 32-bit shift result (B [31: 0]). ) 108 is output.

【0054】次に、分配手段102において、シフタ1
01から出力されたシフト結果(B[31:0])108が上
位16ビットと下位16ビットとに分配され、分配され
た信号のそれぞれが上位16ビット信号(B[31:16])1
09及び下位16ビット信号(B[15:0])110として
出力される。
Next, in the distributing means 102, the shifter 1
The shift result (B [31: 0]) 108 output from 01 is distributed to the upper 16 bits and the lower 16 bits, and each of the distributed signals is the upper 16-bit signal (B [31:16]) 1
09 and the lower 16-bit signal (B [15: 0]) 110 are output.

【0055】次に、マルチプレクサ103において、分
配手段102から出力された下位16ビット信号(B[1
5:0])110及び外部から入力された被挿入信号107
の2種類の信号のうち、分配手段102から出力された
下位16ビット信号(B[15:0])110が選択され、選
択された下位16ビット信号(B[15:0])110が選択
結果(B[15:0])111として出力される。
Next, in the multiplexer 103, the lower 16-bit signal (B [1
5: 0]) 110 and the inserted signal 107 input from the outside
Of the two types of signals, the lower 16-bit signal (B [15: 0]) 110 output from the distribution means 102 is selected, and the selected lower 16-bit signal (B [15: 0]) 110 is selected. The result (B [15: 0]) 111 is output.

【0056】次に、連接手段104において、マルチプ
レクサ103から出力された選択結果(B[15:0])11
1が、分配手段102から出力された上位16ビット信
号(B[31:16])109の最下位ビット側から連接され、
この連接結果が32ビットの出力ビット列(B[31:16],B
[15:0])112として出力される。
Next, in the connecting means 104, the selection result (B [15: 0]) 11 output from the multiplexer 103
1 is concatenated from the least significant bit side of the upper 16-bit signal (B [31:16]) 109 output from the distribution means 102,
This concatenation result is a 32-bit output bit string (B [31:16], B
[15: 0]) 112 is output.

【0057】上述したように、シフト動作モードにおい
ては、連接手段104から出力された出力ビット列(B
[31:16],B[15:0])112の内容とシフタ101から出
力されたシフト結果(B[31:0])108の内容とが同一
である。これにより、被シフト信号105として入力さ
れた内容がシフト量信号106に基づいてシフトされ、
このシフト結果が出力ビット列112として本可変長ビ
ット列処理装置の外部に出力されることになる。
As described above, in the shift operation mode, the output bit string (B
The contents of [31:16], B [15: 0]) 112 and the contents of the shift result (B [31: 0]) 108 output from the shifter 101 are the same. As a result, the content input as the shifted signal 105 is shifted based on the shift amount signal 106,
This shift result is output as an output bit string 112 to the outside of the variable length bit string processing device.

【0058】また、被挿入信号107がいかなる信号で
あっても出力ビット列112に影響しないため、被挿入
信号107は任意の信号で構わない。
Since the inserted signal 107 does not affect the output bit string 112, any signal may be used as the inserted signal 107.

【0059】次に、ビット列挿入動作について図3を参
照して説明する。
Next, the bit string inserting operation will be described with reference to FIG.

【0060】図3は、図1に示した可変長ビット列処理
装置におけるビット列挿入動作を説明するための図であ
る。なお、図3においては、ビット列挿入動作時に選択
される信号線を実線で示し、その他の信号線を破線で示
す。
FIG. 3 is a diagram for explaining a bit string insertion operation in the variable length bit string processing device shown in FIG. In FIG. 3, signal lines selected during the bit string insertion operation are shown by solid lines, and other signal lines are shown by broken lines.

【0061】まず、32ビットの被シフト信号(A[31:
0])105及びシフト量信号106がシフタ101に入
力され、また、被挿入信号(C[15:0])107がマルチ
プレクサ103に入力される。
First, the 32-bit shifted signal (A [31:
0]) 105 and the shift amount signal 106 are input to the shifter 101, and the inserted signal (C [15: 0]) 107 is input to the multiplexer 103.

【0062】次に、シフタ101において、被シフト信
号(A[31:0])105がシフト量信号106に基づいて
シフトされ、このシフト結果が32ビットのシフト結果
(B[31:0])108として出力される。
Next, in the shifter 101, the shifted signal (A [31: 0]) 105 is shifted based on the shift amount signal 106, and this shift result is a 32-bit shift result (B [31: 0]). It is output as 108.

【0063】次に、分配手段102において、シフタ1
01から出力されたシフト結果(B[31:0])108が上
位16ビットの信号と下位16ビットの信号とに分配さ
れ、分配された信号のそれぞれが上位16ビット信号
(B[31:16])109及び下位16ビット信号(B[15:
0])110として出力される。
Next, in the distributing means 102, the shifter 1
The shift result (B [31: 0]) 108 output from 01 is distributed to the upper 16-bit signal and the lower 16-bit signal, and each of the distributed signals is the upper 16-bit signal (B [31:16] ] 109 and lower 16-bit signal (B [15:
0]) 110 is output.

【0064】次に、マルチプレクサ103において、分
配手段102から出力された下位16ビット信号(B[1
5:0])110及び外部から入力された被挿入信号(C[1
5:0])107の2種類の信号のうち、外部から入力され
た被挿入信号(C[15:0])107が選択され、選択され
た被挿入信号(C[15:0])107が選択結果(C[15:0])
111として出力される。
Next, in the multiplexer 103, the lower 16-bit signal (B [1
5: 0]) 110 and the signal to be inserted (C [1
5: 0]) 107, the inserted signal (C [15: 0]) 107 input from the outside is selected, and the selected inserted signal (C [15: 0]) 107 is selected. Is the selection result (C [15: 0])
It is output as 111.

【0065】次に、連接手段104において、マルチプ
レクサ103から出力された選択結果(C[15:0])11
1が、分配手段102から出力された上位16ビット信
号(B[31:16])109の最下位ビット側から連接され、
この連接結果が32ビットの出力ビット列(B[31:0],C
[15:0])112として装置外部に出力される。
Next, in the connecting means 104, the selection result (C [15: 0]) 11 output from the multiplexer 103 is output.
1 is concatenated from the least significant bit side of the upper 16-bit signal (B [31:16]) 109 output from the distribution means 102,
This concatenation result is a 32-bit output bit string (B [31: 0], C
[15: 0]) 112 is output to the outside of the device.

【0066】上述したように、ビット列挿入動作モード
においては、被シフト信号105として入力された内容
がシフト量信号106に基づいてシフトされ、更に、こ
のシフト結果の上位16ビットの信号の最下位ビット側
から被挿入信号107が連接され、この連接結果が出力
ビット列112として本可変長ビット列処理装置の外部
に出力されることになる。
As described above, in the bit string insertion operation mode, the content input as the shifted signal 105 is shifted based on the shift amount signal 106, and the least significant bit of the upper 16-bit signal of the shift result is further shifted. The inserted signal 107 is concatenated from the side, and the concatenation result is output as an output bit string 112 to the outside of the variable length bit string processing device.

【0067】以下に、MPUやDSP等のプロセッサの
ソフトウェア上で本発明の可変長ビット列処理装置を用
いて行われる可変長ビット列処理について説明する。
The variable length bit string processing performed by using the variable length bit string processing device of the present invention on the software of the processor such as MPU or DSP will be described below.

【0068】ここでは、可変長ビット列処理として、M
PUやDSP等のプロセッサが可変長符号化処理を行う
場合に、符号化された可変長符号語及びこの可変長符号
語のテーブル参照アドレス用ビット列をレジスタ上で作
成中のビットストリームに挿入する可変長ビット列挿入
処理と、プロセッサが可変長復号化処理を行う場合に、
レジスタに格納されたビットストリームから可変長符号
語及びこの可変長符号語のテーブル参照アドレス用ビッ
ト列を抽出する可変長ビット列抽出処理とについて説明
する。
Here, as the variable length bit string processing, M
When a processor such as PU or DSP performs variable-length coding processing, a variable that inserts the coded variable-length codeword and the bit string for table reference address of this variable-length codeword into the bitstream being created on the register When the long bit string insertion process and the variable length decoding process are performed by the processor,
The variable length bit string extraction processing for extracting the variable length code word and the table reference address bit string of the variable length code word from the bit stream stored in the register will be described.

【0069】なお、以下の記載では、可変長ビット列処
理に用いるレジスタとして、プロセッサに搭載された3
2ビット汎用レジスタを用いることとし、これらの汎用
レジスタから被シフト信号105、シフト量信号106
及び被挿入信号107が本可変長ビット列抽出処理装置
内に入力され、本可変長ビット列抽出処理装置から出力
された出力ビット列112の内容がこれらの汎用レジス
タに格納されるものとして説明する。
In the following description, as a register used for variable-length bit string processing, 3 registers installed in the processor are used.
A 2-bit general-purpose register is used, and the shifted signal 105 and the shift amount signal 106 are output from these general-purpose registers.
The inserted signal 107 and the inserted signal 107 are input into the variable length bit string extraction processing device, and the contents of the output bit string 112 output from the variable length bit string extraction processing device are stored in these general-purpose registers.

【0070】まず、可変長ビット列抽出処理について図
4を参照して説明する。
First, the variable length bit string extraction processing will be described with reference to FIG.

【0071】図4は、図1に示した可変長ビット列処理
回路を用いた可変長ビット列抽出処理を説明するための
図である。ここでは、レジスタ401に格納された符号
語401cの先頭ビットがレジスタ403における最上
位ビットに一致するように、符号語401cをレジスタ
403に格納する可変長ビット列抽出処理について説明
する。
FIG. 4 is a diagram for explaining a variable length bit string extraction process using the variable length bit string processing circuit shown in FIG. Here, a variable length bit string extraction process of storing the code word 401c in the register 403 so that the leading bit of the code word 401c stored in the register 401 matches the most significant bit in the register 403 will be described.

【0072】なお、図4においては、レジスタ401
は、既に復号化が行われてテーブル参照用アドレスとし
て抽出された可変長の復号済み符号語401b及び可変
長の符号語401c,401dからなるビットストリー
ム401aを格納しているものとする。
In FIG. 4, the register 401
Is assumed to store a bitstream 401a including variable-length decoded codewords 401b and variable-length codewords 401c and 401d that have already been decoded and extracted as table reference addresses.

【0073】また、レジスタ402は、復号済み符号語
401bが復号化されると同時に得られた復号済み符号
語401bのビット列長LENビットと同一のビット列
長を具備するビット列402aを格納しているものとす
る。
Further, the register 402 stores the bit string 402a having the same bit string length as the bit string length LEN bits of the decoded code word 401b obtained at the same time when the decoded code word 401b is decoded. And

【0074】このような状態で、レジスタ401,40
2の内容を、それぞれ被シフト信号105及びシフト量
信号106として本可変長ビット列処理装置に入力し、
本可変長ビット列処理装置のシフト動作を実行する。
In this state, the registers 401 and 40
The contents of 2 are input to the variable length bit string processing device as the shifted signal 105 and the shift amount signal 106, respectively,
The shift operation of the variable length bit string processing device is executed.

【0075】すると、本可変長ビット列処理装置におい
て、被シフト信号105として入力されたレジスタ40
1の内容がシフト量信号106に基づいてビット列長4
02a分だけ左にシフトされ、このシフト結果が出力ビ
ット列112として装置外部に出力される。
Then, in this variable length bit string processing device, the register 40 input as the shifted signal 105 is input.
The content of 1 is the bit string length 4 based on the shift amount signal 106.
It is shifted to the left by 02a, and the shift result is output to the outside of the device as an output bit string 112.

【0076】次に、本可変長ビット列処理装置から出力
された出力ビット列112の内容をレジスタ403に格
納する。
Next, the contents of the output bit string 112 output from this variable length bit string processing device are stored in the register 403.

【0077】これにより、符号語401cの先頭ビット
がレジスタ403における最上位ビットに一致した状態
でレジスタ403に格納され、符号語401c及び符号
語401cの復号化処理に用いられるテーブル参照アド
レス用ビット列の抽出が完了する。
As a result, the first bit of the code word 401c is stored in the register 403 in a state where the leading bit of the code word 401c matches the most significant bit of the register 403, and the code word 401c and the bit string for the table reference address used for the decoding process of the code word 401c are stored. The extraction is complete.

【0078】その後、レジスタ401の内容をレジスタ
403の内容に更新し、また、レジスタ402に格納す
るビット列を、符号語401cと同一のビット列長を具
備するビット列に更新して次の可変長ビット列抽出処理
に備える。
After that, the contents of the register 401 are updated to the contents of the register 403, and the bit string stored in the register 402 is updated to a bit string having the same bit string length as the code word 401c to extract the next variable length bit string. Prepare for processing.

【0079】上述した可変長ビット列抽出処理において
は、レジスタ401に格納されているビットストリーム
401aが徐々に左へ掃き出されるため、最終的には全
てのビットストリームが掃き出されてレジスタ401内
のビットストリームが尽きてしまうという問題が生じ
る。
In the above-described variable length bit string extraction processing, the bit stream 401a stored in the register 401 is gradually swept out to the left, so that finally all bit streams are swept out and stored in the register 401. There is a problem of running out of bitstream.

【0080】図9に示した従来の可変長ビット列処理装
置においては、内部バッファから符号語が抽出される度
に、装置外部から内部バッファに符号語が補充されてい
るため、このような問題は生じない。
In the conventional variable length bit string processing device shown in FIG. 9, such a problem is caused because the code word is replenished from the outside of the device to the internal buffer every time the code word is extracted from the internal buffer. Does not happen.

【0081】このため、本発明においては、被シフト信
号を供給するレジスタ内のビットストリームが、次に可
変長ビット列抽出処理が行われると16ビット以下にな
る場合には、被シフト信号を供給するレジスタに別のレ
ジスタから16ビットのビットストリームを新たに補充
し、その後、可変長ビット列抽出処理を行う。
Therefore, in the present invention, when the bit stream in the register which supplies the shifted signal becomes 16 bits or less when the variable length bit string extraction processing is performed next, the shifted signal is supplied. A register is newly supplemented with a 16-bit bit stream from another register, and then variable length bit string extraction processing is performed.

【0082】これにより、被シフト信号を供給するレジ
スタ内に16ビット以上のビットストリームが絶えず格
納されることになり、このレジスタ内のビットストリー
ムが尽きてしまうという問題が回避される。
As a result, the bit stream of 16 bits or more is constantly stored in the register supplying the shifted signal, and the problem that the bit stream in this register is exhausted is avoided.

【0083】なお、以下の記載では、被シフト信号を供
給するレジスタ内のビットストリームに、別のレジスタ
から16ビットのビットストリームを新たに補充した後
に行われる可変長ビット列抽出処理を、図4に示した可
変長ビット列抽出処理と区別するために、特に、ビット
ストリーム補充を伴う可変長ビット列抽出処理と称す
る。
In the following description, FIG. 4 shows the variable length bit string extraction processing performed after a bit stream in a register supplying a shifted signal is newly supplemented with a 16-bit bit stream from another register. In order to distinguish from the illustrated variable length bit string extraction process, it is particularly referred to as a variable length bit string extraction process with bit stream supplementation.

【0084】以下に、図1に示した可変長ビット列処理
回路を用いたビットストリーム補充を伴う可変長ビット
列抽出処理について図5を参照して説明する。
A variable length bit string extraction process involving bit stream supplementation using the variable length bit string processing circuit shown in FIG. 1 will be described below with reference to FIG.

【0085】図5は、図1に示した可変長ビット列処理
回路を用いたビットストリーム補充を伴う可変長ビット
列抽出処理を説明するための図である。ここでは、レジ
スタ501に格納された符号語501cの先頭ビットが
レジスタ506における最上位ビットに一致するよう
に、符号語501cをレジスタ506に格納する可変長
ビット列抽出処理について説明する。
FIG. 5 is a diagram for explaining a variable length bit string extraction process involving bit stream supplementation using the variable length bit string processing circuit shown in FIG. Here, a variable-length bit string extraction process of storing the codeword 501c in the register 506 so that the leading bit of the codeword 501c stored in the register 501 matches the most significant bit in the register 506 will be described.

【0086】なお、図5においては、レジスタ501
は、既に復号化が行われてテーブル参照用アドレスとし
て抽出された可変長の復号済み符号語501b、可変長
の符号語501c,501dからなるビットストリーム
501aを格納しているものとし、次に可変長ビット列
抽出処理が行われて復号済み符号語501bが掃き出さ
れると、ビットストリーム501aが16ビット以下に
なる状態にある。
In FIG. 5, the register 501
Is assumed to store a bitstream 501a composed of variable-length decoded codewords 501b and variable-length codewords 501c and 501d that have already been decoded and extracted as table reference addresses. When the long bit string extraction processing is performed and the decoded codeword 501b is swept out, the bit stream 501a is in a state of 16 bits or less.

【0087】このような状態を避けるために、まず、レ
ジスタ501に格納された復号済み符号語501bの一
部を削除することによりレジスタ501における下位1
6ビットをすべてゼロにし、レジスタ501における下
位16ビットがすべてゼロである状態で、レジスタ50
1における下位16ビットにレジスタ503に格納され
たビットストリーム503aを挿入する処理を行う。
In order to avoid such a state, first, by deleting a part of the decoded codeword 501b stored in the register 501, the lower 1 in the register 501 is deleted.
With all 6 bits zeroed and the lower 16 bits in register 501 all zeros, register 50
A process of inserting the bit stream 503a stored in the register 503 into the lower 16 bits of 1 is performed.

【0088】ここで、レジスタ501〜503の内容
を、それぞれ被シフト信号105、シフト量信号106
及び被挿入信号107として本可変長ビット列処理装置
に入力し、本可変長ビット列処理装置のビット列挿入動
作を実行する。
Here, the contents of the registers 501 to 503 are changed to the shifted signal 105 and the shift amount signal 106, respectively.
And the signal 107 to be inserted into the variable length bit string processing device, and the bit string inserting operation of the variable length bit string processing device is executed.

【0089】なお、レジスタ502は、レジスタ501
の下位16ビットに残っているビットストリームのビッ
ト列長LAビットと同一のビット列長を具備するビット
列502aを格納しているものとする。レジスタ502
に格納されたビット列502aは、新たに16ビットを
補充するか否かを判断するために用いられるものであ
り、算出方法は後述する。
The register 502 is the register 501.
It is assumed that the bit string 502a having the same bit string length as the bit string length LA bits of the bit stream remaining in the lower 16 bits of is stored. Register 502
The bit string 502a stored in is used to determine whether to newly supplement 16 bits, and the calculation method will be described later.

【0090】また、レジスタ503は、レジスタ501
に格納されたビットストリーム501aの内容に続くビ
ットストリーム503aを格納しているものとする。
Further, the register 503 is the register 501.
It is assumed that the bitstream 503a following the contents of the bitstream 501a stored in the above is stored.

【0091】すると、本可変長ビット列処理装置におい
て、被シフト信号105として入力されたレジスタ50
1の内容が、シフト量信号106に基づいてビット列長
502a分だけ左にシフトされる。これにより、中間結
果として、レジスタ501に格納された復号済み符号語
501bの一部が削除され、レジスタ501における下
位16ビットが全てゼロになる。続いて、全てゼロにな
った下位16ビットに被挿入信号107として入力され
たレジスタ503の内容が連接され、この連接結果が出
力ビット列112として装置外部に出力される。
Then, in this variable length bit string processor, the register 50 input as the shifted signal 105 is input.
The content of 1 is shifted to the left by the bit string length 502a based on the shift amount signal 106. As a result, a part of the decoded codeword 501b stored in the register 501 is deleted as an intermediate result, and the lower 16 bits in the register 501 are all zero. Subsequently, the contents of the register 503 input as the inserted signal 107 are connected to the lower 16 bits that have become all zeros, and the connection result is output as an output bit string 112 to the outside of the device.

【0092】次に、本可変長ビット列処理装置から出力
された出力ビット列112の内容をレジスタ504に一
時的に格納する。
Next, the contents of the output bit string 112 output from this variable length bit string processing device are temporarily stored in the register 504.

【0093】これにより、レジスタ504における上位
16ビットに、レジスタ501に格納されていたビット
ストリーム501aのうち復号済み符号語501bの一
部が削除されたビットストリーム501aが格納され、
レジスタ504における下位16ビットに、レジスタ5
03に格納されていたビットストリーム503aが挿入
される。
As a result, the upper 16 bits of the register 504 stores the bitstream 501a in which a part of the decoded codeword 501b of the bitstream 501a stored in the register 501 is deleted,
In the lower 16 bits in register 504, register 5
The bit stream 503a stored in 03 is inserted.

【0094】このとき、レジスタ504に格納されたビ
ットストリーム501aには、復号済み符号語501b
の一部が残っている。
At this time, the bitstream 501a stored in the register 504 contains the decoded codeword 501b.
Some of the remains.

【0095】このため、レジスタ504内に残った復号
済み符号語501bを掃き出すために、復号済み符号語
501bのビット列長LENビットからビット列502
aのビット列長を減じることにより、レジスタ504内
に残った復号済み符号語501bのビット列長LBビッ
トを算出し、算出されたビット列長LBビットと同一の
ビット列長を具備するビット列505aをレジスタ50
5に格納する。
Therefore, in order to sweep out the decoded codeword 501b remaining in the register 504, from the bit string length LEN bits of the decoded codeword 501b to the bit string 502.
By subtracting the bit string length of a, the bit string length LB bits of the decoded codeword 501b remaining in the register 504 is calculated, and the bit string 505a having the same bit string length as the calculated bit string length LB bits is registered in the register 50.
Store in 5.

【0096】また、レジスタ504における下位16ビ
ットにビットストリーム503aが補充されているた
め、レジスタ502に格納されているビット列502a
のビット列長を「16」に更新する。
Since the lower 16 bits in the register 504 are supplemented with the bit stream 503a, the bit string 502a stored in the register 502 is stored.
The bit string length of is updated to "16".

【0097】ここで、レジスタ504,505の内容
を、それぞれ被シフト信号105及びシフト量信号10
6として本可変長ビット列処理装置に再度入力し、本可
変長ビット列処理装置のシフト動作を実行する。
Here, the contents of the registers 504 and 505 are changed to the shifted signal 105 and the shift amount signal 10, respectively.
The value 6 is input again to the variable length bit string processor, and the shift operation of the variable length bit string processor is executed.

【0098】すると、本可変長ビット列処理装置におい
て、被シフト信号105として入力されたレジスタ50
4の内容が、シフト量信号106に基づいてビット列5
05aのビット列長分だけ左にシフトされ、このシフト
結果が出力ビット列112として装置外部に出力され
る。
Then, in this variable length bit string processing device, the register 50 input as the shifted signal 105 is input.
4 is a bit string 5 based on the shift amount signal 106.
The bit string length of 05a is shifted to the left, and the shift result is output as an output bit string 112 to the outside of the device.

【0099】次に、本可変長ビット列処理装置から出力
された出力ビット列112の内容をレジスタ506に格
納する。
Next, the contents of the output bit string 112 output from the present variable length bit string processing device are stored in the register 506.

【0100】これにより、符号語501cの先頭ビット
がレジスタ506における最上位ビットに一致した状態
でレジスタ506に格納され、符号語501c及び符号
語501cの復号化処理に用いられるテーブル参照アド
レス用ビット列の抽出が完了する。
As a result, the first bit of the code word 501c is stored in the register 506 in a state where the leading bit of the code word 501c matches the most significant bit of the register 506, and the code word 501c and the bit string for the table reference address used in the decoding process of the code word 501c are stored. The extraction is complete.

【0101】その後、レジスタ506に格納された符号
語501cの復号化処理がテーブル参照により行われる
と、符号語501cが復号化されたデータが得られると
同時に、符号語501cのビット列長が得られることに
なる。
After that, when the decoding process of the codeword 501c stored in the register 506 is performed by referring to the table, the data in which the codeword 501c is decoded is obtained and at the same time, the bit string length of the codeword 501c is obtained. It will be.

【0102】ここで、レジスタ502に格納されている
ビット列502aのビット列長(この時点で16ビッ
ト)から符号語501cのビット列長を減じることによ
り新たなビット列長LAビットを算出し、算出されたビ
ット列長LAビットと同一のビット列長を具備するビッ
ト列を新たなビット列502aとしてレジスタ502に
格納し、また、レジスタ501の内容をレジスタ506
の内容に更新する。これにより、次回のビット列抽出に
備える。
Here, a new bit string length LA bit is calculated by subtracting the bit string length of the codeword 501c from the bit string length of the bit string 502a (16 bits at this point) stored in the register 502, and the calculated bit string A bit string having the same bit string length as the long LA bits is stored in the register 502 as a new bit string 502a, and the contents of the register 501 are stored in the register 506.
Update to the contents of. This prepares for the next bit string extraction.

【0103】本発明においては、可変長ビット列抽出処
理を行う場合に、図4及び図5に示した可変長ビット列
抽出処理のうち、どちらの可変長ビット列抽出処理を行
なうかは、以下のように決定される。
In the present invention, when performing the variable length bit string extraction process, which of the variable length bit string extraction processes shown in FIGS. 4 and 5 is to be executed is as follows. It is determined.

【0104】レジスタ501に格納されたビットストリ
ーム501aのうち、レジスタ501における下位16
ビットに残っているビットストリームのビット列長LA
ビットから復号済み符号語501bのビット列長LEN
ビットを減じることによりDIFFを算出し、算出され
たDIFFが正である場合には、図4に示した可変長ビ
ット列抽出処理を行い、また、DIFFがゼロまたは負
である場合には、図5に示したビットストリーム補充を
伴う可変長ビット列抽出処理を行う。
Of the bit stream 501a stored in the register 501, the lower 16 bits in the register 501
Bit stream length LA of bit stream remaining in bits
Bit string length LEN of decoded codeword 501b
The DIFF is calculated by subtracting the bits, and when the calculated DIFF is positive, the variable length bit string extraction processing shown in FIG. 4 is performed, and when the DIFF is zero or negative, the DIFF is calculated as shown in FIG. The variable-length bit string extraction processing with the bit stream supplementation shown in is performed.

【0105】次に、可変長ビット列挿入処理について図
6を参照して説明する。
Next, the variable length bit string insertion processing will be described with reference to FIG.

【0106】図6は、図1に示した可変長ビット列処理
回路を用いた可変長ビット列挿入処理を説明するための
図である。ここでは、レジスタ601に格納されたビッ
トストリーム601aに、レジスタ603に格納された
符号語603aを挿入する可変長ビット列挿入処理につ
いて説明する。
FIG. 6 is a diagram for explaining a variable length bit string insertion process using the variable length bit string processing circuit shown in FIG. Here, a variable length bit string insertion process of inserting the codeword 603a stored in the register 603 into the bitstream 601a stored in the register 601 will be described.

【0107】なお、図6においては、レジスタ601
は、可変長の符号語601d,601b,601cを格
納しているものとする。なお、これらの符号語のうち符
号語601bの一部及び符号語601cからなるビット
ストリーム601aが作成中であるものとする。
In FIG. 6, the register 601 is used.
Is assumed to store variable-length code words 601d, 601b, 601c. It is assumed that, of these code words, a bit stream 601a including a part of the code word 601b and the code word 601c is being created.

【0108】また、レジスタ602は、符号語601c
のビット列長LENビットと同一のビット列長を具備す
るビット列602aを格納しているものとする。なお、
符号語601cのビット列長LENビットは、テーブル
参照による符号語601cの符号化処理時に、符号語6
01cと同時に得られたビット列長の値である。
Further, the register 602 has a code word 601c.
It is assumed that a bit string 602a having the same bit string length as the bit string length LEN bit of is stored. In addition,
The bit string length LEN bits of the code word 601c is set to the code word 6 when the code word 601c is encoded by the table reference.
This is the value of the bit string length obtained at the same time as 01c.

【0109】また、レジスタ603は、レジスタ601
上で作成中のビットストリーム601aに新たに挿入す
る可変長の符号語603aを、符号語603aの先頭ビ
ットがレジスタ603における下位16ビットの最上位
ビットに一致した状態で格納しているものとする。
Further, the register 603 is the register 601.
It is assumed that the variable-length codeword 603a to be newly inserted in the bitstream 601a being created above is stored in a state in which the first bit of the codeword 603a matches the most significant bit of the lower 16 bits in the register 603. .

【0110】上述したように、可変長符号化処理を行う
場合には、通常、テーブル参照により音声信号や画像信
号等のデータを可変長符号語に変換するため、例えば、
16ビットの固定長のメモリ領域をテーブル要素とする
テーブルに、可変長符号語の先頭ビットがテーブルの1
6ビット領域における最上位ビットに一致した状態にな
るように、可変長符号語を格納する。
As described above, when variable length coding processing is performed, data such as an audio signal or an image signal is usually converted into a variable length code word by referring to a table.
In a table having a 16-bit fixed-length memory area as a table element, the first bit of the variable-length codeword is 1 in the table.
The variable-length codeword is stored so that it matches the most significant bit in the 6-bit area.

【0111】このように可変長符号語を上記テーブルに
格納することにより、テーブル参照により符号化された
可変長符号語をレジスタ603の下位16ビットに格納
する場合に、格納された可変長符号語の先頭ビットがレ
ジスタ603の下位16ビットにおける最上位ビットに
一致した状態になる。
By storing the variable-length codeword in the table as described above, when the variable-length codeword encoded by the table reference is stored in the lower 16 bits of the register 603, the stored variable-length codeword is stored. The leading bit of the register 603 matches the most significant bit of the lower 16 bits of the register 603.

【0112】ここで、レジスタ601〜603の内容
を、それぞれ被シフト信号105、シフト量信号106
及び被挿入信号107として本可変長ビット列処理装置
に入力し、本可変長ビット列処理装置のビット列挿入動
作を実行する。
Here, the contents of the registers 601 to 603 are changed to the shifted signal 105 and the shift amount signal 106, respectively.
And the signal 107 to be inserted into the variable length bit string processing device, and the bit string inserting operation of the variable length bit string processing device is executed.

【0113】すると、本可変長ビット列処理装置におい
て、被シフト信号105として入力されたレジスタ60
1の内容がシフト量信号106に基づいてビット列60
2aのビット列長分だけ左にシフトされ、このシフト結
果が出力ビット列112として装置外部に出力される。
これにより、中間結果として、レジスタ601における
下位16ビットが全てゼロになる。続いて、全てゼロに
なった下位16ビットに被挿入信号107として入力さ
れたレジスタ503の内容が連接され、この連接結果が
出力ビット列112として装置外部に出力される。
Then, in this variable length bit string processor, the register 60 input as the shifted signal 105
The content of 1 is the bit string 60 based on the shift amount signal 106.
The bit string length of 2a is shifted to the left, and the shift result is output as an output bit string 112 to the outside of the device.
As a result, the lower 16 bits in the register 601 are all zero as an intermediate result. Subsequently, the contents of the register 503 input as the inserted signal 107 are connected to the lower 16 bits that have become all zeros, and the connection result is output as an output bit string 112 to the outside of the device.

【0114】次に本可変長ビット列処理装置から出力さ
れた出力ビット列112の内容をレジスタ604に格納
する。
Next, the contents of the output bit string 112 output from this variable length bit string processing device are stored in the register 604.

【0115】次に、レジスタ601の内容をレジスタ6
04の内容に更新して次回のビット列挿入処理に備え
る。
Next, the contents of the register 601 are changed to the register 6
The contents of 04 are updated to prepare for the next bit string insertion processing.

【0116】これにより、レジスタ601にて作成中の
ビットストリーム601aに符号語603aが挿入され
たことになる。
As a result, the code word 603a is inserted into the bit stream 601a being created by the register 601.

【0117】上述した可変長ビット列挿入処理において
は、レジスタ601にて作成中のビットストリームがメ
モリに待避されることなく徐々に左へ掃き出されるた
め、レジスタ601内に一定量のビットストリームが蓄
積された場合には、蓄積されたビットストリームをメモ
リに待避する必要がある。
In the variable length bit string insertion processing described above, the bit stream being created by the register 601 is gradually swept to the left without being saved in the memory, so a certain amount of bit stream is accumulated in the register 601. In that case, it is necessary to save the accumulated bitstream in the memory.

【0118】このため、本発明においては、作成中のビ
ットストリームを16ビット単位で管理し、ビットスト
リームが16ビット蓄積された場合に、このビットスト
リームをメモリに待避し、その後、可変長ビット列挿入
処理を行う。
Therefore, in the present invention, the bit stream being created is managed in units of 16 bits, and when 16 bits of the bit stream are accumulated, this bit stream is saved in the memory and then the variable length bit string is inserted. Perform processing.

【0119】なお、以下の記載では、被シフト信号を供
給するレジスタ内のビットストリームをメモリに待避し
た後に行われる可変長ビット列挿入処理を、図6に示し
た可変長ビット列挿入処理と区別するために、特に、ビ
ットストリーム待避を伴う可変長ビット列抽出処理と称
する。
In the following description, in order to distinguish the variable-length bit string insertion processing shown in FIG. 6 from the variable-length bit string insertion processing performed after saving the bit stream in the register that supplies the shifted signal to the memory. In particular, it is called a variable-length bit string extraction process involving saving of a bit stream.

【0120】以下に、図1に示した可変長ビット列処理
装置を用いたビットストリーム待避を伴う可変長ビット
列挿入処理について図7を参照して説明する。
A variable length bit string insertion process involving saving of a bit stream using the variable length bit string processing device shown in FIG. 1 will be described below with reference to FIG.

【0121】図7は、図1に示した可変長ビット列処理
装置を用いたビットストリーム待避を伴う可変長ビット
列挿入処理を説明するための図である。ここでは、レジ
スタ701にて作成中のビットストリーム701aに、
レジスタ705に格納された符号語705aを挿入する
可変長ビット列挿入処理について説明する。
FIG. 7 is a diagram for explaining a variable length bit string insertion process involving saving of a bit stream using the variable length bit string processing device shown in FIG. Here, in the bit stream 701a being created by the register 701,
A variable length bit string insertion process for inserting the codeword 705a stored in the register 705 will be described.

【0122】なお、図7においては、レジスタ701
は、可変長の符号語701e,701b,701c,7
01dを格納しているものとし、これらの符号語のうち
符号語701b,701c,701dからなるビットス
トリーム701aが作成中であり、メモリに待避してい
ないものとする。
In FIG. 7, the register 701 is used.
Is a variable-length codeword 701e, 701b, 701c, 7
01d is stored, and a bitstream 701a composed of the codewords 701b, 701c, and 701d among these codewords is being created and is not saved in the memory.

【0123】また、レジスタ701にて作成中のビット
ストリーム701aに、レジスタ705に格納された符
号語705aを挿入すると、メモリに待避していないビ
ットストリーム701aの一部がレジスタ701から掃
き出されてしまう状態にある。
When the codeword 705a stored in the register 705 is inserted into the bitstream 701a being created by the register 701, a part of the bitstream 701a not saved in the memory is swept out from the register 701. It is in a state of closing.

【0124】このような状態を避けるために、まず、メ
モリに待避していないビットストリーム701aが掃き
出されないように、ビットストリーム701aのうち、
16ビットのビットストリームをメモリ(不図示)に待
避する処理を行う。
In order to avoid such a state, first, of the bitstream 701a, the bitstream 701a is not swept out in the memory so that the bitstream 701a is not swept out.
A process of saving a 16-bit bit stream in a memory (not shown) is performed.

【0125】ここで、レジスタ701,702の内容
を、それぞれ被シフト信号105及びシフト量信号10
6として本可変長ビット列処理装置に入力し、本可変長
ビット列処理装置のシフト動作を実行する。
Here, the contents of the registers 701 and 702 are changed to the shifted signal 105 and the shift amount signal 10, respectively.
The value 6 is input to the variable length bit string processor, and the shift operation of the variable length bit string processor is executed.

【0126】なお、レジスタ702は、レジスタ701
に格納された符号語701eのビット列長LAビットと
同じビット列長を具備するビット列702aを格納して
いるものとする。符号語701eのビット列長LAビッ
トの算出方法の詳細な説明は後述する。
The register 702 is the register 701.
It is assumed that a bit string 702a having the same bit string length as the bit string length LA bits of the codeword 701e stored in the above is stored. A detailed description of the method of calculating the bit string length LA bits of the code word 701e will be given later.

【0127】すると、本可変長ビット列処理装置におい
て、被シフト信号105として入力されたレジスタ70
1の内容がシフト量信号106に基づいてビット列70
2aのビット列長分だけ左にシフトされ、このシフト結
果が出力ビット列112として装置外部に出力される。
Then, in this variable length bit string processor, the register 70 input as the shifted signal 105 is input.
The contents of 1 are bit strings 70 based on the shift amount signal 106.
The bit string length of 2a is shifted to the left, and the shift result is output as an output bit string 112 to the outside of the device.

【0128】次に、本可変長ビット列処理装置から出力
された出力ビット列112の内容をレジスタ703に一
時的に格納する。
Next, the contents of the output bit string 112 output from this variable length bit string processing device are temporarily stored in the register 703.

【0129】これにより、レジスタ701上で作成中で
あり、メモリに待避していないビットストリーム701
aの内容が、ビットストリーム701aの先頭ビットが
レジスタ703における最上位ビットと一致した状態で
レジスタ703に格納されたことになる。
As a result, the bit stream 701 that is being created on the register 701 and is not saved in the memory.
The contents of a are stored in the register 703 in a state where the leading bit of the bitstream 701a matches the most significant bit in the register 703.

【0130】ここで、レジスタ703上で作成中のビッ
トストリーム701aのうち、上位16ビットのビット
ストリームをメモリに待避する。
Here, of the bitstream 701a being created on the register 703, the upper 16-bit bitstream is saved in the memory.

【0131】次に、レジスタ703に格納されている符
号語701dのうちレジスタ703における下位16ビ
ットに残っている符号語のビット列長LBビットを算出
し、算出されたビット列長LBビットと同一のビット列
長を具備するビット列704aをレジスタ704に格納
する。このビット列長LBビットは、符号語701dの
ビット列長LENビットから、レジスタ702に格納さ
れたビット列702aのビット列長を減ずることにより
算出される。
Next, the bit string length LB bits of the code word remaining in the lower 16 bits in the register 703 of the code word 701d stored in the register 703 is calculated, and the same bit string as the calculated bit string length LB bit is calculated. The bit string 704a having the length is stored in the register 704. This bit string length LB bit is calculated by subtracting the bit string length of the bit string 702a stored in the register 702 from the bit string length LEN bit of the code word 701d.

【0132】また、レジスタ703における上位16ビ
ットがメモリに待避されたため、レジスタ702に格納
されているビット列702aのビット列長を「16」に
更新する。
Since the upper 16 bits in the register 703 are saved in the memory, the bit string length of the bit string 702a stored in the register 702 is updated to "16".

【0133】ここで、レジスタ703〜705の内容
を、それぞれ被シフト信号105、シフト量信号106
及び被挿入信号107として本可変長ビット列処理装置
に再度入力し、本可変長ビット列処理装置のビット列挿
入動作を実行する。
Here, the contents of the registers 703 to 705 are changed to the shifted signal 105 and the shift amount signal 106, respectively.
And the signal 107 to be inserted is input again to the variable length bit string processing device, and the bit string inserting operation of the variable length bit string processing device is executed.

【0134】なお、レジスタ705は、レジスタ701
上で作成中のビットストリーム701aに挿入する符号
語705aを、符号語705aの先頭ビットがレジスタ
705の下位16ビットにおける最上位のビットと一致
するように格納しているものとする。
The register 705 corresponds to the register 701.
It is assumed that the codeword 705a to be inserted into the bitstream 701a being created above is stored so that the leading bit of the codeword 705a matches the most significant bit in the lower 16 bits of the register 705.

【0135】すると、本可変長ビット列処理装置におい
て、被シフト信号105として入力されたレジスタ70
3の内容が、シフト量信号106に基づいてビット列7
04aのビット列長分だけ左にシフトされる。これによ
り、中間結果として、レジスタ703における下位16
ビットが全てゼロになる。続いて、全てゼロになった下
位16ビットに被挿入信号107として入力されたレジ
スタ705の内容が連接され、この連接結果が出力ビッ
ト列112として装置外部に出力される。
Then, in this variable length bit string processor, the register 70 input as the shifted signal 105 is input.
3 of the bit string 7 based on the shift amount signal 106.
The bit string length of 04a is shifted to the left. Thereby, as an intermediate result, the lower 16 bits in the register 703 are
All bits are zero. Then, the contents of the register 705 input as the inserted signal 107 are connected to the lower 16 bits that have become all zeros, and the connection result is output as an output bit string 112 to the outside of the device.

【0136】次に、本可変長ビット列処理装置から出力
された出力ビット列112の内容をレジスタ706に格
納する。
Next, the contents of the output bit string 112 output from this variable length bit string processing device are stored in the register 706.

【0137】次に、レジスタ701の内容をレジスタ7
06の内容に更新し、また、レジスタ702に格納され
たビット列702aのビット列長(この時点で16ビッ
ト)からレジスタ704に格納されたビット列704a
のビット列長を減じることにより、新たなビット列長L
Aビットを算出し、算出されたビット列長LAビットと
同一のビット列長を具備するビット列を新たにレジスタ
702に格納して次回の可変長ビット列挿入処理に備え
る。なお、図6に示したビット列長LAビットは、前回
の可変長ビット列挿入処理時のビット列長LAビットか
らビット列長LENビットを減じた値に更新される。
Next, the contents of the register 701 are changed to the register 7
The bit string 704a stored in the register 704 is updated from the bit string length of the bit string 702a stored in the register 702 (16 bits at this point).
By reducing the bit string length of
A bit is calculated, and a bit string having the same bit string length as the calculated bit string length LA bit is newly stored in the register 702 to prepare for the next variable length bit string insertion process. The bit string length LA bit shown in FIG. 6 is updated to a value obtained by subtracting the bit string length LEN bit from the bit string length LA bit at the previous variable length bit string insertion processing.

【0138】これにより、レジスタ701上で作成中の
ビットストリーム701aに、レジスタ705に格納さ
れた符号語705aが挿入されたことになる。
As a result, the codeword 705a stored in the register 705 is inserted into the bitstream 701a being created in the register 701.

【0139】本発明においては、可変長ビット列挿入処
理を行う場合に、図6及び図7に示した可変長ビット列
挿入処理のうち、どちらの可変長ビット列挿入処理を行
なうかは、以下のように決定される。
In the present invention, when performing the variable length bit string insertion process, which of the variable length bit string insertion processes shown in FIGS. 6 and 7 is to be executed is as follows. It is determined.

【0140】レジスタ701に格納された符号語のうち
既にメモリに待避された符号語のビット列長LAビット
から、レジスタ701における下位16ビットに残って
いる符号語のビット列長LENビットを減じることによ
りDIFFを算出し、算出されたDIFFが正である場
合には、図6に示した可変長ビット列挿入処理を行い、
また、DIFFがゼロまたは負である場合には、図7に
示したビットストリーム待避を伴う可変長ビット列挿入
処理を行う。
DIFF is obtained by subtracting the bit string length LEN bit of the code word remaining in the lower 16 bits in the register 701 from the bit string length LA bit of the code word already saved in the memory among the code words stored in the register 701. Is calculated, and if the calculated DIFF is positive, the variable length bit string insertion processing shown in FIG.
If DIFF is zero or negative, the variable-length bit string insertion process with the bitstream saving shown in FIG. 7 is performed.

【0141】本発明においては、図9に示した従来の可
変長ビット列処理装置に対して、可変長復号化処理時に
行われる可変長ビット列抽出処理の実行時間は増加する
が、シフタ1個分とバッファとが削減されているため、
ハードウェア量を削減することができる。
In the present invention, the execution time of the variable length bit string extraction process performed at the time of the variable length decoding process is increased as compared with the conventional variable length bit string processing device shown in FIG. Since the buffer and has been reduced,
The amount of hardware can be reduced.

【0142】なお、可変長符号化処理時に行われる可変
長ビット列挿入処理に要する実行時間は、本形態と同様
の手順で実行する場合、本発明の可変長ビット列処理装
置と従来の可変長ビット列処理装置とでほぼ同じであ
る。
The execution time required for the variable length bit string insertion processing performed at the time of the variable length coding processing is the same as that of the present embodiment when the variable length bit string processing device of the present invention and the conventional variable length bit string processing are executed. It is almost the same as the device.

【0143】次に、本発明の可変長ビット列処理装置の
効果を説明するために、MPUやDSP等のプロセッサ
のソフトウェア上で本発明の可変長ビット列処理装置を
用いることなく行われる可変長ビット列処理について説
明する。
Next, in order to explain the effect of the variable-length bit string processing apparatus of the present invention, variable-length bit string processing which is performed without using the variable-length bit string processing apparatus of the present invention on software of a processor such as MPU or DSP. Will be described.

【0144】図8は、図1に示した可変長ビット列処理
装置を用いることなくプロセッサのソフトウェア上で行
われる可変長ビット列処理を説明するための図である。
ここでは、レジスタ801の内容に、レジスタ804に
格納されたビットストリーム804aを挿入する場合の
処理について説明する。なお、図8に示す可変長ビット
列処理は、図6に示した可変長ビット列挿入処理に相当
するものである。
FIG. 8 is a diagram for explaining the variable length bit string processing performed on the software of the processor without using the variable length bit string processing device shown in FIG.
Here, a process of inserting the bitstream 804a stored in the register 804 into the content of the register 801 will be described. The variable-length bit string processing shown in FIG. 8 corresponds to the variable-length bit string insertion processing shown in FIG.

【0145】また、図8においては、プロセッサに搭載
されたバレルシフタ811、ORゲート812及びレジ
スタ801〜805を用いて可変長ビット列処理を行う
ものとする。
In FIG. 8, variable length bit string processing is performed using the barrel shifter 811, the OR gate 812 and the registers 801 to 805 mounted on the processor.

【0146】また、レジスタ801は、作成中のビット
ストリーム801aを格納しているものとする。なお、
レジスタ801にて作成中のビットストリーム801a
のうち、レジスタ801における下位16ビットに格納
されたビットストリームのビット列長は、LENビット
である。
The register 801 is assumed to store the bit stream 801a being created. In addition,
Bitstream 801a being created by register 801
Among these, the bit string length of the bit stream stored in the lower 16 bits in the register 801 is LEN bits.

【0147】また、レジスタ802は、上記LENビッ
トと同一のビット列長を具備するビット列802aを格
納しているものとする。
The register 802 is assumed to store a bit string 802a having the same bit string length as the LEN bit.

【0148】また、レジスタ804は、上位16ビット
が全てゼロであり、下位16ビットに、レジスタ801
上で作成中のビットストリーム801aに新たに挿入す
るビットストリーム804aを格納しているものとす
る。
In the register 804, the upper 16 bits are all zero, and the lower 16 bits are set in the register 801.
It is assumed that the bitstream 804a to be newly inserted is stored in the bitstream 801a being created above.

【0149】このような状態で、レジスタ801,80
2の内容をバレルシフタ811に入力し、バレルシフタ
811におけるシフト動作を実行する。
In this state, the registers 801 and 80
The contents of 2 are input to the barrel shifter 811, and the shift operation in the barrel shifter 811 is executed.

【0150】すると、バレルシフタ811において、レ
ジスタ801の内容がレジスタ802の内容に基づいて
ビット列802aのビット列長分だけ左にシフトされ、
このシフト結果が出力される。
Then, in the barrel shifter 811, the contents of the register 801 are shifted to the left by the bit string length of the bit string 802a based on the contents of the register 802,
The result of this shift is output.

【0151】次に、バレルシフタ811から出力された
シフト結果の内容をレジスタ803に格納する。このと
き、レジスタ803における下位16ビットは全てゼロ
になる。
Next, the contents of the shift result output from the barrel shifter 811 are stored in the register 803. At this time, the lower 16 bits in the register 803 are all zero.

【0152】次に、レジスタ803,804の内容をO
Rゲート812に入力し、ORゲート812における論
理和(OR)動作を実行する。
Next, the contents of the registers 803 and 804 are set to O.
It is input to the R gate 812, and the logical sum (OR) operation in the OR gate 812 is executed.

【0153】すると、ORゲート812において、レジ
スタ803の内容とレジスタ804の内容との論理和演
算が行われ、これにより、論理和演算結果が出力され
る。
Then, in the OR gate 812, the logical sum operation of the contents of the register 803 and the contents of the register 804 is performed, whereby the logical sum operation result is output.

【0154】次に、ORゲート812から出力された論
理和演算結果の内容をレジスタ806に格納する。
Next, the contents of the logical sum operation result output from the OR gate 812 are stored in the register 806.

【0155】その後、レジスタ801の内容をレジスタ
805の内容に更新して次回のビット列挿入処理に備え
る。
After that, the contents of the register 801 are updated to the contents of the register 805 to prepare for the next bit string insertion processing.

【0156】これにより、レジスタ801にて作成中の
ビットストリーム801aにレジスタ804に格納され
たビットストリーム804aが挿入されたことになる。
As a result, the bitstream 804a stored in the register 804 has been inserted into the bitstream 801a being created by the register 801.

【0157】上述したように本発明の可変長ビット列処
理装置を用いることなく可変長ビット列処理を行う場合
においては、可変長ビット列処理を実行するために、本
発明の可変長ビット列処理装置を用いて可変長ビット列
処理を行う場合と比較して1サイクル(1サイクル/命
令実行の場合)の命令実行が余分に必要となる。
As described above, when the variable length bit string processing is performed without using the variable length bit string processing device of the present invention, the variable length bit string processing device of the present invention is used to execute the variable length bit string processing. One cycle (one cycle / instruction execution) of instruction execution is additionally required as compared with the case of performing variable length bit string processing.

【0158】[0158]

【発明の効果】以上説明したように本発明においては、
プロセッサにおける処理内容に基づいて選択するビット
列が切り換わる選択手段と、選択手段にて選択されたビ
ット列と第1の入力ビット列のシフト結果の上位半分の
ビット列とを連接する連接手段とを設け、第1の入力ビ
ット列のシフト結果の下位半分のビット列と第2のビッ
ト列とのいずれかが選択手段にて選択される構成とした
ため、第1の入力ビット列がシフト量信号に基づいてシ
フトされた出力ビット列、或いは、第1の入力ビット列
がシフト量信号に基づいてシフトされたシフト結果の下
位半分のビット列が第2の入力ビット列で置換された出
力ビット列のいずれかが本可変長ビット列処理装置から
出力されることになる。
As described above, in the present invention,
A selection unit that switches a bit string to be selected based on the processing content of the processor, and a connection unit that connects the bit string selected by the selection unit and the upper half bit string of the shift result of the first input bit string are provided. Since the selection means selects either the lower half bit string of the shift result of the 1 input bit string or the second bit string, the output bit string in which the first input bit string is shifted based on the shift amount signal Alternatively, one of the output bit strings in which the lower half bit string of the shift result obtained by shifting the first input bit string based on the shift amount signal is replaced with the second input bit string is output from the variable length bit string processing device. Will be.

【0159】これにより、プロセッサのソフトウェア上
で第1の入力ビット列、第2の入力ビット列及びシフト
量信号を予め設定して本可変長ビット列処理装置に入力
することにより種々の可変長ビット列処理が可能とな
り、通常のシフト処理、可変長ビット列抽出処理及び可
変長ビット列挿入処理を効率良く実行することができ
る。
As a result, various variable length bit string processing can be performed by presetting the first input bit string, the second input bit string and the shift amount signal on the software of the processor and inputting them to the variable length bit string processing device. Therefore, the normal shift processing, variable-length bit string extraction processing, and variable-length bit string insertion processing can be efficiently executed.

【0160】また、プロセッサによって連接手段におけ
る処理を行う場合においては、シフト手段及び選択手段
のみで本可変長ビット列処理装置が構成されるため、ハ
ードウェア規模を削減することができる。
When the processor performs the processing in the connecting means, the variable length bit string processing device is constituted only by the shift means and the selecting means, so that the hardware scale can be reduced.

【0161】また、シフト手段がバレルシフタである場
合においては、バレルシフタが搭載されたプロセッサに
本可変長ビット列処理装置を実装した時に、プロセッサ
及び本可変長ビット列処理装置がバレルシフタを共有す
ることができる。
When the shift means is a barrel shifter, the processor and the variable length bit string processing device can share the barrel shifter when the variable length bit string processing device is mounted on the processor equipped with the barrel shifter.

【0162】これにより、バレルシフタが搭載されたプ
ロセッサに本可変長ビット列処理装置を実装する場合に
は、プロセッサに搭載されたバレルシフタに1個の選択
手段を接続することにより本可変長ビット列処理装置が
実現されるため、ハードウェア規模を大幅に削減するこ
とができる。
Accordingly, when the variable length bit string processing device is mounted on the processor equipped with the barrel shifter, the variable length bit string processing device is connected by connecting one selecting means to the barrel shifter mounted on the processor. Since this is realized, the hardware scale can be significantly reduced.

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

【図1】本発明の可変長ビット列処理装置の実施の一形
態を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a variable length bit string processing device of the present invention.

【図2】図1に示した可変長ビット列処理回路における
シフト動作を説明するための図である。
FIG. 2 is a diagram for explaining a shift operation in the variable length bit string processing circuit shown in FIG.

【図3】図1に示した可変長ビット列処理回路における
ビット列挿入動作を説明するための図である。
FIG. 3 is a diagram for explaining a bit string insertion operation in the variable length bit string processing circuit shown in FIG.

【図4】図1に示した可変長ビット列処理回路を用いた
可変長ビット列抽出処理を説明するための図である。
FIG. 4 is a diagram for explaining a variable length bit string extraction process using the variable length bit string processing circuit shown in FIG. 1.

【図5】図1に示した可変長ビット列処理回路を用いた
ビットストリーム補充を伴う可変長ビット列抽出処理を
説明するための図である。
5 is a diagram for explaining a variable length bit string extraction process involving bit stream supplementation using the variable length bit string processing circuit shown in FIG. 1;

【図6】図1に示した可変長ビット列処理回路を用いた
可変長ビット列挿入処理を説明するための図である。
FIG. 6 is a diagram for explaining variable-length bit string insertion processing using the variable-length bit string processing circuit shown in FIG. 1.

【図7】図1に示した可変長ビット列処理装置を用いた
ビットストリーム待避を伴う可変長ビット列挿入処理を
説明するための図である。
FIG. 7 is a diagram for explaining variable-length bit string insertion processing involving bitstream saving using the variable-length bit string processing device shown in FIG. 1;

【図8】図1に示した可変長ビット列処理装置を用いる
ことなくプロセッサのソフトウェア上で行われる可変長
ビット列処理を説明するための図である。
8 is a diagram for explaining variable length bit string processing performed on software of a processor without using the variable length bit string processing device shown in FIG. 1. FIG.

【図9】従来の可変長ビット列処理装置の一構成例を示
すブロック図である。
FIG. 9 is a block diagram showing a configuration example of a conventional variable length bit string processing device.

【図10】図9に示した従来の可変長ビット列処理装置
を用いた可変長ビット列抽出処理を説明するための図で
ある。
10 is a diagram for explaining a variable length bit string extraction process using the conventional variable length bit string processing device shown in FIG.

【符号の説明】 101 シフタ 102 分配手段 103 マルチプレクサ 104 連接手段 105 被シフト信号 106 シフト量信号 107 被挿入信号 108 シフト結果 109 上位16ビット信号 110 下位16ビット信号 111 選択結果 112 出力ビット列[Explanation of symbols] 101 shifter 102 distribution means 103 multiplexer 104 Connection means 105 Shifted signal 106 shift amount signal 107 Inserted signal 108 shift result 109 upper 16-bit signal 110 lower 16-bit signal 111 selection result 112 output bit string

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 プロセッサにおける可変長符号化或いは
可変長復号化処理時に、可変長符号語の挿入処理或いは
抽出処理を行うための可変長ビット列処理装置におい
て、 第1の入力ビット列及びシフト量信号が入力され、該第
1の入力ビット列を該シフト量信号に基づいてシフト
し、該シフト結果を出力するシフト手段と、 第2の入力ビット列が入力され、前記プロセッサにおけ
る処理内容に基づいて該第2の入力ビット列或いは前記
シフト手段から出力された前記シフト結果の下位半分の
ビット列のいずれかを選択し、該選択結果を出力する選
択手段と、 前記シフト手段から出力された前記シフト結果の上位半
分のビット列と前記選択手段から出力された選択結果と
を連接し、該連接結果を出力ビット列として出力する連
接手段とを有することを特徴とする可変長ビット列処理
装置。
1. A variable-length bit string processing device for performing variable-length codeword insertion processing or extraction processing during variable-length coding or variable-length decoding processing in a processor, wherein a first input bit string and shift amount signal are Shift means for inputting and shifting the first input bit string based on the shift amount signal and outputting the shift result; and a second input bit string for inputting to the processor.
That processing content selects one of the input bit string or the bit string of the lower half of the shift result output from said shift means the second on the basis of a selection means for outputting the selection result outputted from said shift means A variable length bit string processing device comprising: a concatenation unit that concatenates the upper half bit string of the shifted result and the selection result output from the selecting unit and outputs the concatenation result as an output bit string.
【請求項2】 請求項に記載の可変長ビット列処理装
置において、前記シフト手段は、バレルシフタであるこ
とを特徴とする可変長ビット列処理装置。
2. The variable length bit string processing device according to claim 1 , wherein the shift means is a barrel shifter.
【請求項3】 請求項1または請求項2に記載の可変長
ビット列処理装置において、 前記選択手段は、マルチプレクサであることを特徴とす
る可変長ビット列処理装置。
3. The variable length bit string processing device according to claim 1 , wherein the selection unit is a multiplexer.
【請求項4】 請求項1乃至のいずれか1項に記載の
可変長ビット列処理装置を用いた可変長ビット列処理方
法であって、 前記プロセッサによって、前記連接手段における処理を
行うことを特徴とする可変長ビット列処理方法。
4. A variable-length bit string processing method using a variable length bit string processing apparatus according to any one of claims 1 to 3, by the processor, and characterized by performing the process in the connecting means Variable length bit string processing method.
【請求項5】 請求項に記載の可変長ビット列処理方
法において、 前記プロセッサによって、前記第1の入力ビット列、前
記第2の入力ビット列及び前記シフト量信号を予め設定
して当該可変長ビット列処理装置に入力することを特徴
とする可変長ビット列処理方法。
5. The variable length bit string processing method according to claim 4 , wherein the processor presets the first input bit string, the second input bit string, and the shift amount signal. A variable-length bit string processing method characterized by inputting to a device.
JP33300899A 1999-11-24 1999-11-24 Variable length bit string processing apparatus and variable length bit string processing method using the same Expired - Fee Related JP3409845B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33300899A JP3409845B2 (en) 1999-11-24 1999-11-24 Variable length bit string processing apparatus and variable length bit string processing method using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33300899A JP3409845B2 (en) 1999-11-24 1999-11-24 Variable length bit string processing apparatus and variable length bit string processing method using the same

Publications (2)

Publication Number Publication Date
JP2001156645A JP2001156645A (en) 2001-06-08
JP3409845B2 true JP3409845B2 (en) 2003-05-26

Family

ID=18261265

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33300899A Expired - Fee Related JP3409845B2 (en) 1999-11-24 1999-11-24 Variable length bit string processing apparatus and variable length bit string processing method using the same

Country Status (1)

Country Link
JP (1) JP3409845B2 (en)

Also Published As

Publication number Publication date
JP2001156645A (en) 2001-06-08

Similar Documents

Publication Publication Date Title
JP2986076B2 (en) Method and apparatus for compressing and decompressing data
US5675332A (en) Plural-step chunk-at-a-time decoder for variable-length codes of Huffman type
JP2915568B2 (en) Adaptive data compression system for tape drive systems.
US6885319B2 (en) System and method for generating optimally compressed data from a plurality of data compression/decompression engines implementing different data compression algorithms
US6819271B2 (en) Parallel compression and decompression system and method having multiple parallel compression and decompression engines
JP3332619B2 (en) Decoding device and method thereof
JP3013381B2 (en) Variable length data decoding device
JP3341962B2 (en) Variable length decoder and method for decoding variable length code value
JPH0799812B2 (en) Signal coding apparatus, signal decoding apparatus, and signal coding / decoding apparatus
US6781529B1 (en) Methods and apparatuses for variable length encoding
US5751860A (en) Method for compressing and decompressing digital image data
JPH06104767A (en) Variable length code decoder
JP2007037115A (en) Method for encoding digital data, method for encoding stream of data segment, encoder, parallel encoder for encoding source of data, parallel decoder for decoding source of coded data, method for decoding coded data, magnetic tape drive, and method for encoding stream of data
US5404166A (en) Variable-length to fixed-length data word reformatting apparatus
JP4098187B2 (en) Variable length code decoding apparatus and method
US6094151A (en) Apparatus and method for finite state machine coding of information selecting most probable state subintervals
JP4065425B2 (en) Variable length coding packing architecture
KR100339772B1 (en) Method for compressing and decompressing data files
JPH08307280A (en) Method of compressing stream of raw data
JP3409845B2 (en) Variable length bit string processing apparatus and variable length bit string processing method using the same
JP2003526986A (en) Arithmetic decoding of arithmetically encoded information signals
US6781528B1 (en) Vector handling capable processor and run length encoding
US5682156A (en) Decoding circuit for variable length code in which positive/negative discrimination is independent of decoding
JP3748442B2 (en) Variable length encoded data processing apparatus
JP3054787B2 (en) Variable length code decoding device

Legal Events

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

Free format text: PAYMENT UNTIL: 20080320

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090320

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090320

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100320

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100320

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110320

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110320

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120320

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20120320

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20130320

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20130320

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20140320

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees