JP2013098780A - Variable length encoding device and variable length decoding device - Google Patents

Variable length encoding device and variable length decoding device Download PDF

Info

Publication number
JP2013098780A
JP2013098780A JP2011240345A JP2011240345A JP2013098780A JP 2013098780 A JP2013098780 A JP 2013098780A JP 2011240345 A JP2011240345 A JP 2011240345A JP 2011240345 A JP2011240345 A JP 2011240345A JP 2013098780 A JP2013098780 A JP 2013098780A
Authority
JP
Japan
Prior art keywords
code
sub
length
buffer
string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2011240345A
Other languages
Japanese (ja)
Other versions
JP5811775B2 (en
Inventor
Takeshi Jo
武史 城
Hidetoshi Matsumura
秀敏 松村
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2011240345A priority Critical patent/JP5811775B2/en
Publication of JP2013098780A publication Critical patent/JP2013098780A/en
Application granted granted Critical
Publication of JP5811775B2 publication Critical patent/JP5811775B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a variable length encoding device and a variable length decoding device that implement high speed processing in a small area.SOLUTION: The variable length encoding device includes: a plurality of encoding circuits (703a, 703b) for encoding a plurality of data strings, respectively; a plurality of code buffers (705a, 705b) for buffering codes encoded by the plurality of encoding circuits, respectively; a plurality of segmentation sections (708a, 708b) for segmenting out code strings in the plurality of code buffers by code lengths of the preceding codes encoded by the plurality of encoding circuits, respectively; and a coupler (709) for coupling the plurality of code strings segmented out by the plurality of segmentation sections in an interleaved sequence.

Description

本発明は、可変長符号化装置及び可変長復号装置に関する。   The present invention relates to a variable length coding device and a variable length decoding device.

無線通信における伝送路の輻輳やシステムLSI(大規模集積回路:Large Scale Integration)における外部メモリの圧迫を解消するために、転送データを可変長符号化アルゴリズムによって圧縮することが一般的である。可変長符号化処理では、各符号化対象シンボル群の出現確率を基に各シンボルに可変長の符号を割り当てることを特徴としている。ハフマン符号化では1つのシンボルに少なくとも1ビットの符号が割り当てられる。また、算術符号化やレンジコーダのようにデータ列そのものを符号化対象シンボルとみなし、個々のシンボルに疑似的に1ビット未満の符号を割り当てることで理論的な限界までシンボル列を圧縮する手法も使用されている。   In order to eliminate congestion of a transmission path in wireless communication and compression of an external memory in a system LSI (Large Scale Integration), it is common to compress transfer data by a variable-length encoding algorithm. The variable length encoding process is characterized in that a variable length code is assigned to each symbol based on the appearance probability of each encoding target symbol group. In Huffman coding, a code of at least 1 bit is assigned to one symbol. There is also a method of compressing a symbol string to the theoretical limit by regarding the data string itself as an encoding target symbol, such as arithmetic coding and range coder, and assigning a code of less than 1 bit to each symbol in a pseudo manner. It is used.

ところで、可変長復号処理では、1シンボルの符号長が可変であるため、個々の符号へのランダムアクセスが困難であるという問題がある。特定のシンボルのみを復号したい場合は、符号列から所望の符号の先頭位置を決定する必要があるが、所望のシンボルより前のシンボル列が可変長であるため、実際に前のシンボル全てを復号処理しなければ所望の符号の復号処理を実施することができず、符号の復号処理は必ず先頭から逐次的に実施しなければならない。算術符号化でも同様であり、過去の復号過程が現在の復号処理に影響する算術復号処理では必然的に先頭からの逐次処理となってしまう。そのため、従来より可変長符号を高速に復号するための解決手段として、直列復号器や並列復号器など複数の回路構成が提案されている。   By the way, in the variable length decoding process, since the code length of one symbol is variable, there is a problem that random access to each code is difficult. To decode only a specific symbol, it is necessary to determine the start position of the desired code from the code string. However, since the symbol string before the desired symbol has a variable length, all the previous symbols are actually decoded. If it is not processed, the decoding process of a desired code cannot be performed, and the decoding process of the code must always be performed sequentially from the beginning. The same applies to arithmetic coding. In arithmetic decoding processing in which a past decoding process affects the current decoding processing, the processing is necessarily sequential from the beginning. Therefore, conventionally, a plurality of circuit configurations such as a serial decoder and a parallel decoder have been proposed as a solution for decoding a variable length code at high speed.

図1は、下記の特許文献1に開示されている直列復号器を有する可変長復号装置の構成を示す図である。この可変長復号装置は、1つの復号表を2つに分割し、それを復号表A及び復号表Bとしている。これらの復号表A及び復号表Bを用いて復号装置を構築する。可変長復号装置は、復号表Aを内部に有する第1の復号器101、復号表Bを内部に有する第2の復号器102、及び復号表Bを内部に有する第3の復号器104を有する。第2の復号器102及び第3の復号器104は、直列に接続されている。入力された符号はそれぞれ復号器101及び102に並列に入力される。このとき、入力された符号は必ず復号表A又は復号表Bによって復号可能である。シフタ103は、入力された符号の中で第2の復号器102で復号された符号の符号長だけシフトすることにより、第2の復号器102で消費されたビット数だけ破棄し、第3の復号器104に入力する。第2の復号器102に入力された符号列は、第2の復号器102の消費ビットを除いて第3の復号器104に入力される。この場合、符号列の中の連続する2つの符号が共に復号表Bに含まれる場合、1クロックサイクルで2つの復号処理が実行されることになる。セレクタ105は、3個の復号器101、102及び103により出力される復号結果の中で正常に復号できたものから選択することによって、1サイクルで複数符号の復号処理が実行可能となる。この際、第2の復号器102と第3の復号器104は直列接続されているが、復号表A及び復号表Bは元の復号表を分割したものであり、復号表A及び復号表Bの探索は元の復号表よりも低遅延で実施できるため、遅延時間の増大を抑制している。   FIG. 1 is a diagram showing a configuration of a variable length decoding device having a serial decoder disclosed in Patent Document 1 below. In this variable length decoding device, one decoding table is divided into two, which are called decoding table A and decoding table B. A decoding apparatus is constructed using these decoding table A and decoding table B. The variable-length decoding apparatus includes a first decoder 101 having a decoding table A therein, a second decoder 102 having a decoding table B inside, and a third decoder 104 having a decoding table B inside. . The second decoder 102 and the third decoder 104 are connected in series. The inputted codes are inputted in parallel to the decoders 101 and 102, respectively. At this time, the input code can always be decoded by the decoding table A or the decoding table B. The shifter 103 discards the number of bits consumed by the second decoder 102 by shifting by the code length of the code decoded by the second decoder 102 among the input codes, Input to the decoder 104. The code string input to the second decoder 102 is input to the third decoder 104 except for the consumption bits of the second decoder 102. In this case, when two consecutive codes in the code string are both included in the decoding table B, two decoding processes are executed in one clock cycle. The selector 105 can perform decoding processing of a plurality of codes in one cycle by selecting from among decoding results output from the three decoders 101, 102, and 103 that have been normally decoded. At this time, the second decoder 102 and the third decoder 104 are connected in series, but the decoding table A and the decoding table B are obtained by dividing the original decoding table, and the decoding table A and the decoding table B Since the search can be performed with a lower delay than the original decoding table, an increase in delay time is suppressed.

図2は、下記の特許文献2に開示されている並列復号器を有する可変長復号装置の構成を示す図である。この可変長復号装置は、1クロックサイクル内で複数の符号の先頭位置を決定することを目的としており、入力符号は第1の復号器201及び第2の復号器203に並列に入力される。第2の復号器203は、第1の復号器201で消費され得るビット数分だけ存在する。複数の第2の復号器203の入力符号は、それぞれ、複数のシフタ202により、第1の復号器201による消費され得るビット数の分だけ上位ビットが破棄される。この構成によって、入力符号は、第1の復号器201で先頭ビットから復号処理が実施され、それと並行して複数の第2の復号器203が符号を復号する。セレクタ204は、複数の第2の復号器203の中から第1の復号器201の消費ビット数だけ上位ビットが破棄された符号を復号した第2の復号器203の出力を選択する。これによって、第1の復号器201及び第2の復号器203で並列に第1及び第2の復号シンボルが出力される。この構成によれば、遅延時間が支配的な復号器を複数段通らずに、所望の2シンボルが同時に取得可能であるため、高速な復号が可能となる。   FIG. 2 is a diagram illustrating a configuration of a variable length decoding device having a parallel decoder disclosed in Patent Document 2 below. This variable-length decoding device is intended to determine the head positions of a plurality of codes within one clock cycle, and the input codes are input in parallel to the first decoder 201 and the second decoder 203. There are as many second decoders 203 as the number of bits that can be consumed by the first decoder 201. As for the input codes of the plurality of second decoders 203, the upper bits are discarded by the plurality of shifters 202 for the number of bits that can be consumed by the first decoder 201, respectively. With this configuration, the input code is decoded from the first bit by the first decoder 201, and in parallel therewith, the plurality of second decoders 203 decode the code. The selector 204 selects the output of the second decoder 203 that has decoded a code in which the upper bits are discarded by the number of bits consumed by the first decoder 201 from among the plurality of second decoders 203. As a result, the first decoder 201 and the second decoder 203 output the first and second decoded symbols in parallel. According to this configuration, since two desired symbols can be acquired simultaneously without passing through a plurality of decoders whose delay time is dominant, high-speed decoding is possible.

特開2007−158698号公報JP 2007-158698 A 特開2006−42336号公報JP 2006-42336 A

特許文献1及び特許文献2は、共に1クロックサイクル内での復号シンボル数を増加させていることが特徴であり、そのために低遅延な回路を構築することに主眼を置いている。ところで並列度を増加させた場合の回路規模の増大は回路の消費電力やチップ単価に直接的に影響するため、並列度の増加に対して回路規模が比例するなど、妥当なレベルでの回路規模増加に収めることが要求される。また、並列復号器は主にリアルタイム性が必要な状況において用いられるため、その復号器は入力符号列の特性に依存せず必ず毎サイクル並列度分の復号処理を行うことが要求される。   Both Patent Document 1 and Patent Document 2 are characterized in that the number of decoded symbols is increased within one clock cycle. For this reason, the main object is to construct a low-delay circuit. By the way, when the degree of parallelism is increased, the increase in circuit scale directly affects the power consumption of the circuit and the unit price of the chip, so the circuit scale is proportional to the increase in parallelism, and the circuit scale at a reasonable level. It is required to keep up. Further, since the parallel decoder is mainly used in a situation where real-time property is necessary, the decoder is required to always perform the decoding process for the degree of parallelism every cycle without depending on the characteristics of the input code string.

上記要求を鑑みるに、特許文献1では復号過程が第2の復号器102と第3の復号器104の直列構成になった場合のみ1サイクルで複数シンボルの復号が可能となる。符号がこのパスを通るか否かは入力符号に依存してしまうため、並列度は確率的にしか議論できない。すなわち、可変長復号装置の処理速度をワーストケースの1クロックサイクル1復号を想定してシステムを構築しなければ復号処理が間に合わず、処理が破綻してしまう可能性が否めず、リアルタイム性を要求するシステムでは適用困難である。また、3並列又は4並列など並列度を上げた場合、復号器が直列接続されている構成のため、遅延時間の増大によって動作周波数が上げられず、結果として単位時間当たりの復号シンボル数はある一定の値に収束してしまうことが予想される。さらには、複数並列にした場合は並列化できる確率が低下してしまうため、並列度の増加は困難である。   In view of the above requirements, in Patent Document 1, only when the decoding process has a serial configuration of the second decoder 102 and the third decoder 104, decoding of a plurality of symbols is possible in one cycle. Whether the code passes through this path depends on the input code, so the parallelism can only be discussed probabilistically. In other words, if the system is not constructed assuming that the processing speed of the variable-length decoding device is the worst-case one-clock cycle one-decoding, the decoding process will not be in time, and there is a possibility that the process will fail, requiring real-time performance. It is difficult to apply in a system that does. Also, when the degree of parallelism is increased, such as 3 parallel or 4 parallel, because the decoder is connected in series, the operating frequency cannot be increased due to an increase in delay time, and as a result, there are the number of decoded symbols per unit time. It is expected to converge to a certain value. Furthermore, since the probability of parallelization decreases when a plurality of parallels are used, it is difficult to increase the degree of parallelism.

特許文献2では、第1の復号器201の消費ビット数分の第2の復号器203が並列に構成されているため、必ず1サイクル2復号処理が可能である。しかし、この構成において並列度を増加させた場合、複数の第2の復号器203が第1の復号器201の消費し得るビット数分だけ並列に接続されてしまうため、回路規模が多項式的に増大してしまい、現実的な回路規模での実装が困難である。   In Patent Document 2, the second decoder 203 corresponding to the number of consumed bits of the first decoder 201 is configured in parallel, so that one cycle and two decoding processes are always possible. However, when the degree of parallelism is increased in this configuration, a plurality of second decoders 203 are connected in parallel by the number of bits that can be consumed by the first decoder 201, so that the circuit scale is polynomially It will increase and it will be difficult to mount on a practical circuit scale.

本発明の目的は、小面積で高速な処理を行うことができる可変長符号化装置及び可変長復号装置を提供することである。   An object of the present invention is to provide a variable-length encoding device and a variable-length decoding device that can perform high-speed processing in a small area.

可変長符号化装置は、複数のデータ列をそれぞれ符号化する複数の符号化回路と、前記複数の符号化回路により符号化された符号をそれぞれバッファリングする複数の符号バッファと、前記複数の符号化回路により符号化された前回の符号のそれぞれの符号長で、前記複数の符号バッファ内の符号列をそれぞれ切り出す複数の切り出し部と、前記複数の切り出し部により切り出された複数の符号列をインターリーブさせながら結合する結合器とを有する。   The variable length encoding device includes: a plurality of encoding circuits that respectively encode a plurality of data strings; a plurality of code buffers that respectively buffer codes encoded by the plurality of encoding circuits; and the plurality of codes A plurality of cutout units that respectively cut out the code strings in the plurality of code buffers at the code lengths of the previous codes encoded by the encoding circuit, and a plurality of code strings cut out by the plurality of cutout units. And a coupler that couples with each other.

可変長復号装置は、複数の符号列がインターリーブされた符号列をバッファリングするメインバッファと、前記メインバッファ内の符号列と所定の符号列とを連接するサブビット連接部と、前記サブビット連接部により連接された符号列を所定の符号長だけシフトするサブシフタと、前記サブシフタによりシフトされた符号列を複数の符号列に分割してバッファリングする複数のサブバッファと、前記複数のサブバッファによりバッファリングされた複数の符号を復号する復号器とを有し、前記サブビット連接部は、前記メインバッファ内の符号列と、前記複数のサブバッファ内の符号列の中で前記復号器により復号されなかった残りの符号とを連接し、前記サブシフタは、前記復号器により復号された前回の符号の符号長だけシフトする。   The variable length decoding device includes a main buffer for buffering a code sequence in which a plurality of code sequences are interleaved, a sub-bit concatenation unit that concatenates the code sequence in the main buffer and a predetermined code sequence, and the sub-bit concatenation unit. A sub-shifter that shifts the concatenated code string by a predetermined code length, a plurality of sub-buffers that buffer the code string shifted by the sub-shifter into a plurality of code strings, and buffering by the plurality of sub-buffers A decoder that decodes the plurality of codes, wherein the sub-bit concatenation unit is not decoded by the decoder among the code string in the main buffer and the code string in the plurality of sub-buffers Concatenating the remaining codes, the sub-shifter shifts by the code length of the previous code decoded by the decoder.

小面積で高速な処理を行うことができる。   A small area and high-speed processing can be performed.

特許文献1に開示されている直列復号器を有する可変長復号装置の構成を示す図である。It is a figure which shows the structure of the variable length decoding apparatus which has a serial decoder currently disclosed by patent document 1. FIG. 特許文献2に開示されている並列復号器を有する可変長復号装置の構成を示す図である。It is a figure which shows the structure of the variable length decoding apparatus which has the parallel decoder currently disclosed by patent document 2. FIG. 図3(A)は第1の実施形態による可変長符号化装置の構成例を示す図であり、図3(B)は第1の実施形態による可変長復号装置の構成例を示す図である。FIG. 3A is a diagram illustrating a configuration example of the variable length coding device according to the first embodiment, and FIG. 3B is a diagram illustrating a configuration example of the variable length decoding device according to the first embodiment. . ハフマン符号の符号表の例を示す図である。It is a figure which shows the example of the code table of a Huffman code. 図3(A)の可変長符号化装置の処理を説明するための符号列を示す図である。It is a figure which shows the code string for demonstrating the process of the variable length coding apparatus of FIG. 3 (A). 第2の実施形態による可変長符号化装置の構成例を示す図である。It is a figure which shows the structural example of the variable-length-coding apparatus by 2nd Embodiment. 第2の実施形態による可変長符号化装置の具体的な構成例を示す図である。It is a figure which shows the specific structural example of the variable-length-coding apparatus by 2nd Embodiment. 図7の可変長符号化装置の符号化方法の例を示すフローチャートである。It is a flowchart which shows the example of the encoding method of the variable length encoding apparatus of FIG. 第2の実施形態による可変長復号装置の構成例を示す図である。It is a figure which shows the structural example of the variable-length decoding apparatus by 2nd Embodiment. 図9の可変長復号装置の復号方法の例を示すフローチャートである。It is a flowchart which shows the example of the decoding method of the variable length decoding apparatus of FIG. 第3の実施形態による可変長復号装置の構成例を示す図である。It is a figure which shows the structural example of the variable-length decoding apparatus by 3rd Embodiment. 第4の実施形態による可変長符号化装置の構成例を示す図である。It is a figure which shows the structural example of the variable-length-coding apparatus by 4th Embodiment. 第4の実施形態による可変長復号装置の構成例を示す図である。It is a figure which shows the structural example of the variable-length decoding apparatus by 4th Embodiment. 第5の実施形態による可変長復号装置の構成例を示す図である。It is a figure which shows the structural example of the variable-length decoding apparatus by 5th Embodiment. 図15(A)及び(B)は図7の可変長符号化装置の符号化回路(レンジエンコーダ)の符号化(エンコード)処理例を示すフローチャートである。FIGS. 15A and 15B are flowcharts showing an example of encoding processing of the encoding circuit (range encoder) of the variable length encoding device of FIG. 図16(A)及び(B)は図14の可変長復号装置のレンジデコーダの復号(デコード)処理例を示すフローチャートである。FIGS. 16A and 16B are flowcharts showing an example of the decoding process of the range decoder of the variable length decoding device of FIG. 可変長符号化装置及び可変長復号装置を用いた動画像符号化装置の構成例を示す図である。It is a figure which shows the structural example of the moving image encoding apparatus using a variable length coding apparatus and a variable length decoding apparatus.

(第1の実施形態)
図3(A)は第1の実施形態による可変長符号化装置の構成例を示す図であり、図3(B)は第1の実施形態による可変長復号装置の構成例を示す図であり、図4はハフマン符号の符号表の例を示す図であり、図5は図3(A)の可変長符号化装置の処理を説明するための符号列を示す図である。図4のハフマン符号は、可変長符号である。
(First embodiment)
FIG. 3A is a diagram illustrating a configuration example of the variable length coding device according to the first embodiment, and FIG. 3B is a diagram illustrating a configuration example of the variable length decoding device according to the first embodiment. 4 is a diagram showing an example of a code table of Huffman codes, and FIG. 5 is a diagram showing a code string for explaining the processing of the variable length coding apparatus of FIG. The Huffman code in FIG. 4 is a variable length code.

まず、図3(A)を参照しながら、可変長符号化装置を説明する。可変長符号化装置は、A系統の符号化器302a及びB系統の符号化器302bを有する。符号化器302a及び302bは、並列に符号化を行う。符号化器302a及び302bは、同じ符号表を基に符号化を行ってもよいし、異なる符号表を基に符号化を行ってもよい。   First, a variable length coding apparatus will be described with reference to FIG. The variable-length encoding apparatus includes an A-system encoder 302a and a B-system encoder 302b. The encoders 302a and 302b perform encoding in parallel. The encoders 302a and 302b may perform encoding based on the same code table, or may perform encoding based on different code tables.

A系統の符号化器302aは、A系統のシンボル列(データ列)301aを例えば図4の符号表を基に可変長符号に符号化し、その符号化した符号を切り出し部304aに出力し、その符号の符号長を符号長バッファ303aに出力する。符号長バッファ303aは、FIFO(ファーストインファーストアウト)であり、上記の符号長をバッファリングする。切り出し部304aは、符号バッファを有し、符号化器302aにより符号化された符号をバッファリングする。   The A-system encoder 302a encodes the A-system symbol string (data string) 301a into a variable-length code based on the code table of FIG. 4, for example, and outputs the encoded code to the clipping unit 304a. The code length of the code is output to the code length buffer 303a. The code length buffer 303a is a FIFO (First In First Out), and buffers the above code length. The cutout unit 304a has a code buffer, and buffers the code encoded by the encoder 302a.

例えば、切り出し部304aは、図5の符号列DT1をバッファリングする。符号化器302aは、まず符号長a0の符号を出力し、次に符号長a1の符号を出力し、次に符号長a2の符号を出力し、その後も符号の出力を繰り返す。その結果、切り出し部304aは、符号列DT1として、符号長a0の符号、符号長a1の符号及び符号長a2の符号を順次、バッファリングする。次に、切り出し部304aは、最初、符号化器302aにより符号化される図4の符号表の符号の中の最大の符号長の12ビットで、符号バッファ内の符号列DT1を切り出し、その切り出した符号列305aをマルチプレクサ306に出力する。この切り出しにより、符号長a2の符号は、符号長a2αの符号及び符号長a2βの符号に分割される。切り出された12ビットの符号列305aは、符号長a0の符号、符号長a1の符号及び符号長a2αの符号により構成される。切り出し部304a内の符号バッファには、符号長a2βの符号が残される。切り出し部304aは、2回目以降では、符号化器302aにより符号化された前回の符号の符号長を符号長バッファ303aから入力し、その符号長で、符号バッファ内の符号列DT1を切り出す。   For example, the cutout unit 304a buffers the code string DT1 in FIG. The encoder 302a first outputs a code having a code length a0, then outputs a code having a code length a1, then outputs a code having a code length a2, and thereafter repeats the output of the code. As a result, the cutout unit 304a sequentially buffers the code having the code length a0, the code having the code length a1, and the code having the code length a2 as the code string DT1. Next, the cutout unit 304a first cuts out the code string DT1 in the code buffer with the maximum code length of 12 bits in the code of the code table of FIG. The code string 305 a is output to the multiplexer 306. By this cutout, the code having the code length a2 is divided into a code having the code length a2α and a code having the code length a2β. The cut out 12-bit code string 305a includes a code having a code length a0, a code having a code length a1, and a code having a code length a2α. The code having the code length a2β is left in the code buffer in the cutout unit 304a. In the second and subsequent times, the cutout unit 304a inputs the code length of the previous code encoded by the encoder 302a from the code length buffer 303a, and cuts out the code string DT1 in the code buffer with the code length.

同様に、B系統の符号化器302bは、B系統のシンボル列(データ列)301bを例えば図4の符号表を基に可変長符号に符号化し、その符号化した符号を切り出し部304bに出力し、その符号の符号長を符号長バッファ303bに出力する。符号長バッファ303bは、FIFOであり、上記の符号長をバッファリングする。切り出し部304bは、符号バッファを有し、符号化器302bにより符号化された符号をバッファリングする。   Similarly, the B system encoder 302b encodes the B system symbol string (data string) 301b into a variable length code based on the code table of FIG. 4, for example, and outputs the encoded code to the cutout unit 304b. The code length of the code is output to the code length buffer 303b. The code length buffer 303b is a FIFO and buffers the above code length. The cutout unit 304b has a code buffer, and buffers the code encoded by the encoder 302b.

例えば、切り出し部304bは、図5の符号列DT2をバッファリングする。符号化器302bは、まず符号長b0の符号を出力し、次に符号長b1の符号を出力し、その後も符号化を繰り返す。その結果、切り出し部304bは、符号列DT2として、符号長b0の符号及び符号長b1の符号を順次、バッファリングする。次に、切り出し部304bは、最初、符号化器302bにより符号化される図4の符号表の符号の中の最大の符号長の12ビットで、符号バッファ内の符号列DT2を切り出し、その切り出した符号列305bをマルチプレクサ306に出力する。この切り出しにより、符号長b1の符号は、符号長b1αの符号及び符号長b1βの符号に分割される。切り出された12ビットの符号列305bは、符号長b0の符号及び符号長b1αの符号により構成される。切り出し部304b内の符号バッファには、符号長b1βの符号が残される。切り出し部304bは、2回目以降では、符号化器302bにより符号化された前回の符号の符号長を符号長バッファ303bから入力し、その符号長で、符号バッファ内の符号列DT2を切り出す。   For example, the cutout unit 304b buffers the code string DT2 in FIG. The encoder 302b first outputs a code having a code length b0, then outputs a code having a code length b1, and thereafter repeats the encoding. As a result, the cutout unit 304b sequentially buffers the code having the code length b0 and the code having the code length b1 as the code string DT2. Next, the cutout unit 304b first cuts out the code string DT2 in the code buffer with 12 bits of the maximum code length in the code of the code table of FIG. 4 encoded by the encoder 302b, and cuts out the code string DT2. The code string 305 b is output to the multiplexer 306. By this cutout, the code having the code length b1 is divided into a code having the code length b1α and a code having the code length b1β. The cut out 12-bit code string 305b includes a code having a code length b0 and a code having a code length b1α. The code having the code length b1β is left in the code buffer in the cutout unit 304b. From the second time on, the cutout unit 304b inputs the code length of the previous code encoded by the encoder 302b from the code length buffer 303b, and cuts out the code string DT2 in the code buffer with the code length.

マルチプレクサ306は、切り出し部304aにより切り出された符号列305a及び切り出し部304bにより切り出された符号列305bを交互に多重化し、符号列DT3を出力する。図5に示すように、データ列DT3において、前半の12ビットは、切り出し部304aにより切り出された12ビットの符号列305aであり、後半の12ビットは、切り出し部304bにより切り出された12ビットの符号列305bである。   The multiplexer 306 alternately multiplexes the code string 305a cut out by the cutout unit 304a and the code string 305b cut out by the cutout unit 304b, and outputs a code string DT3. As shown in FIG. 5, in the data string DT3, the first 12 bits are a 12-bit code string 305a cut out by the cutout unit 304a, and the latter 12 bits are a 12-bit code cut out by the cutout unit 304b. This is a code string 305b.

次に、図3(B)を参照しながら、可変長復号装置を説明する。可変長復号装置は、A系統の復号器317a及びB系統の復号器317bを有する。復号器317a及び317bは、並列に復号を行う。復号器317a及び317bは、同じ復号表を基に復号を行ってもよいし、異なる復号表を基に復号を行ってもよい。   Next, the variable length decoding device will be described with reference to FIG. The variable length decoding device includes an A-system decoder 317a and a B-system decoder 317b. Decoders 317a and 317b perform decoding in parallel. The decoders 317a and 317b may perform decoding based on the same decoding table or may perform decoding based on different decoding tables.

符号列DT3は、図3(A)の可変長符号化装置により符号化された符号列である。読み出し部312は、所定の符号長の符号列DT3を読み出し、符号列313をデマルチプレクサ314に出力する。符号列313は、A系統の符号列とB系統の符号列を有する。デマルチプレクサ314は、逆多重化により、符号列313のうちの前部のA系統の符号を復号用バッファ315内のA系統符号列316aの残部に連接(結合)し、符号列313のうちの後部のB系統の符号を復号用バッファ315内のB系統符号列316bの残部に連接(結合)する。   The code string DT3 is a code string encoded by the variable length encoding device in FIG. The reading unit 312 reads a code string DT3 having a predetermined code length, and outputs the code string 313 to the demultiplexer 314. The code string 313 includes an A-system code string and a B-system code string. The demultiplexer 314 concatenates (combines) the front A-system code in the code string 313 to the rest of the A-system code string 316a in the decoding buffer 315 by demultiplexing, The rear B system code is connected (coupled) to the remaining part of the B system code string 316b in the decoding buffer 315.

復号器317aは、図3(A)の符号化器302aの符号表に対応する復号表を用いて、符号列316aの先頭の符号を復号し、復号シンボルを出力すると共に、復号した符号の符号長をデマルチプレクサ314に出力する。A系統符号列316aは、復号器317aで復号された符号の符号長だけ減り、その減った符号長だけデマルチプレクサ314によりA系統の符号列313が追加される。その結果、A系統符号列316aの長さは、最大符号長Nになる。最大符号長Nは、図4の場合には12ビットである。   The decoder 317a uses the decoding table corresponding to the code table of the encoder 302a in FIG. 3A to decode the head code of the code string 316a, output a decoded symbol, and the code of the decoded code The length is output to the demultiplexer 314. The A system code string 316a is reduced by the code length of the code decoded by the decoder 317a, and the A system code string 313 is added by the demultiplexer 314 by the reduced code length. As a result, the length of the A system code string 316a becomes the maximum code length N. The maximum code length N is 12 bits in the case of FIG.

復号器317bは、図3(A)の符号化器302bの符号表に対応する復号表を用いて、符号列316bの先頭の符号を復号し、復号シンボルを出力すると共に、復号した符号の符号長をデマルチプレクサ314に出力する。B系統符号列316bは、復号器317bで復号された符号の符号長だけ減り、その減った符号長だけデマルチプレクサ314によりB系統の符号列313が追加される。その結果、B系統符号列316bの長さは、最大符号長Nになる。   The decoder 317b decodes the head code of the code string 316b using the decoding table corresponding to the code table of the encoder 302b in FIG. 3A, outputs a decoded symbol, and the code of the decoded code The length is output to the demultiplexer 314. The B system code string 316b is reduced by the code length of the code decoded by the decoder 317b, and the B system code string 313 is added by the demultiplexer 314 by the reduced code length. As a result, the length of the B system code string 316b becomes the maximum code length N.

以上のように、図3(A)の可変長符号化装置では、シンボル列301a及び301bの符号を逐次的に結合するのではなく、切り出し部304a及び304bで切り出された符号列305a及び305bを順次結合することにより、新たな符号列DT3を構築する。符号列DT3のフォーマットは、A系統のシンボル列301a及びB系統のシンボル列301bから生成されたビットストリームが交互に再配置されている形式となり、特に各ビットストリームからそれぞれ何ビットを取り出して配置するかの単位を、過去に各系統で符号化された符号の符号長を基に決定する。具体的な取り出し単位決定方法としては、各系統毎に符号化した符号の符号長を格納する符号長バッファ(FIFO)303a及び303bを設け、切り出し部304a及び304bは、各系統で過去に符号化した符号の符号長の中から、最も過去に格納された符号長を使用し、符号列の切り出しを行う。ここで、各系統で最初に符号化される際には過去に符号化した符号が存在しないが、この際は、切り出し部304a及び304bは、最大符号長N(例えば12ビット)の符号列を切り出す。また、符号化器302a及び302bは、符号化処理が終了した系統の符号列の末尾に符号の終了を示すEOS(End Of Sequence)を挿入する。EOSに割り当てる符号は任意であるが、符号化対象シンボルに対する符号群の一部とみなし、復号過程で符号列から取り出され得る最大のビット幅を超えてはならない。   As described above, in the variable-length coding apparatus in FIG. 3A, the code sequences 305a and 305b extracted by the clipping units 304a and 304b are used instead of sequentially combining the codes of the symbol sequences 301a and 301b. A new code string DT3 is constructed by sequentially combining them. The format of the code sequence DT3 is a format in which bit streams generated from the A system symbol sequence 301a and the B system symbol sequence 301b are alternately rearranged, and in particular, how many bits are extracted from each bit stream and arranged. Such a unit is determined based on the code length of the code previously encoded in each system. As a specific extraction unit determination method, code length buffers (FIFO) 303a and 303b for storing code lengths of codes encoded for each system are provided, and the cutout units 304a and 304b are encoded in the past in each system. The code string is cut out using the code length stored in the past among the code lengths of the codes. Here, when encoding is first performed in each system, there is no code encoded in the past, but in this case, the clipping units 304a and 304b generate a code string having a maximum code length N (for example, 12 bits). cut. Further, the encoders 302a and 302b insert an EOS (End Of Sequence) indicating the end of the code at the end of the code string of the system for which the encoding process has been completed. The code assigned to EOS is arbitrary, but it is regarded as part of the code group for the encoding target symbol, and must not exceed the maximum bit width that can be extracted from the code string in the decoding process.

図3(A)の可変長符号化装置は、2個の符号化器302a及び302bが並列に符号化処理を行うので、小面積で高速に符号化処理を行うことができる。また、図3(B)の可変長復号装置は、2個の復号器317a及び317bが並列に復号処理を行うので、小面積で高速に復号処理を行うことができる。   In the variable-length encoding apparatus in FIG. 3A, the two encoders 302a and 302b perform the encoding process in parallel, so that the encoding process can be performed at high speed with a small area. Further, since the two decoders 317a and 317b perform the decoding process in parallel in the variable length decoding device in FIG. 3B, the decoding process can be performed at high speed with a small area.

(第2の実施形態)
図6は、第2の実施形態による可変長符号化装置の構成例を示す図である。A系統のシンボルバッファ601aは、A系統のシンボル列(データ列)を記憶する。A系統の符号化回路602aは、例えば図4の符号表を用いて、シンボルバッファ601a内のシンボル列を先頭から順次、符号に符号化し、その符号をストリームバッファ603aに出力し、その符号の符号長を符号長バッファ604aに出力する。ストリームバッファ603aは、符号化回路602aにより符号化された符号を順次バッファリングする。符号長バッファ604aは、FIFOであり、符号化回路602aにより符号化された符号の符号長を順次バッファリングする。なお、符号長バッファ604aは、最初、最大符号長N(例えば12ビット)を記憶する。例えば、ストリームバッファ603aは、図5の符号列DT1をバッファリングする。
(Second Embodiment)
FIG. 6 is a diagram illustrating a configuration example of a variable length coding apparatus according to the second embodiment. The A system symbol buffer 601a stores an A system symbol string (data string). The A-system encoding circuit 602a encodes the symbol sequence in the symbol buffer 601a sequentially from the top into a code using the code table of FIG. 4, for example, and outputs the code to the stream buffer 603a. The length is output to the code length buffer 604a. The stream buffer 603a sequentially buffers the codes encoded by the encoding circuit 602a. The code length buffer 604a is a FIFO, and sequentially buffers the code length of the code encoded by the encoding circuit 602a. Note that the code length buffer 604a initially stores the maximum code length N (for example, 12 bits). For example, the stream buffer 603a buffers the code string DT1 in FIG.

まず、符号化回路602aが符号長a0の符号を出力すると、ストリームバッファ603aには符号長a0の符号が記憶され、符号長バッファ604aには符号長a0が記憶される。次に、符号化回路602aが符号長a1の符号を出力すると、ストリームバッファ603aには符号長a1の符号が記憶され、符号長バッファ604aには符号長a1が記憶される。次に、符号化回路602aが符号長a2の符号を出力すると、ストリームバッファ603aには符号長a2の符号が記憶され、符号長バッファ604aには符号長a2が記憶される。以下、同様に、符号化回路603aは、符号長a3及びa4の符号等の出力を繰り返す。   First, when the encoding circuit 602a outputs a code having the code length a0, the code having the code length a0 is stored in the stream buffer 603a, and the code length a0 is stored in the code length buffer 604a. Next, when the encoding circuit 602a outputs a code having the code length a1, the code having the code length a1 is stored in the stream buffer 603a, and the code length a1 is stored in the code length buffer 604a. Next, when the encoding circuit 602a outputs the code having the code length a2, the code having the code length a2 is stored in the stream buffer 603a, and the code length a2 is stored in the code length buffer 604a. Hereinafter, similarly, the encoding circuit 603a repeats output of codes and the like having code lengths a3 and a4.

切り出し部605aは、符号長バッファ604a内の先頭に記憶されている最大符号長N(12ビット)を取り出し、最大符号長Nで、ストリームバッファ603a内の符号列DT1を切り出し、その切り出した符号列をマルチプレクサ606に出力する。切り出された12ビットの符号列は、図5に示すように、符号長a0の符号、符号長a1の符号及び符号長a2αの符号により構成される。符号長バッファ604aは、最大符号長Nが取り出されると、最大符号長Nを破棄する。ストリームバッファ603aには、符号長a2βの符号が残される。次に、切り出し部605aは、符号長バッファ604aから符号長a0を取り出し、符号長a0で、ストリームバッファ603a内の符号列を切り出し、マルチプレクサ606に出力する。符号長バッファ604aは、符号長a0が取り出されると、符号長a0を破棄する。次に、切り出し部605aは、符号長バッファ604aから符号長a1を取り出し、符号長a1で、ストリームバッファ603a内の符号列を切り出し、マルチプレクサ606に出力する。符号長バッファ604aは、符号長a1が取り出されると、符号長a1を破棄する。以下、同様に、切り出し部605aは、符号化回路602aにより符号化された前回の符号の符号長を符号長バッファ604aから入力し、その符号長で、ストリームバッファ603a内の符号列を切り出し、マルチプレクサ606に出力する。   The cutout unit 605a takes out the maximum code length N (12 bits) stored at the head in the code length buffer 604a, cuts out the code string DT1 in the stream buffer 603a with the maximum code length N, and the cut out code string Is output to the multiplexer 606. The cut out 12-bit code string is composed of a code having a code length a0, a code having a code length a1, and a code having a code length a2α as shown in FIG. When the maximum code length N is extracted, the code length buffer 604a discards the maximum code length N. A code having a code length of a2β is left in the stream buffer 603a. Next, the cutout unit 605a extracts the code length a0 from the code length buffer 604a, cuts out the code string in the stream buffer 603a with the code length a0, and outputs the code string to the multiplexer 606. When the code length a0 is extracted, the code length buffer 604a discards the code length a0. Next, the cutout unit 605a extracts the code length a1 from the code length buffer 604a, cuts out the code string in the stream buffer 603a with the code length a1, and outputs the code string to the multiplexer 606. When the code length a1 is extracted, the code length buffer 604a discards the code length a1. Similarly, the cutout unit 605a inputs the code length of the previous code encoded by the encoding circuit 602a from the code length buffer 604a, cuts out the code string in the stream buffer 603a with the code length, and performs the multiplexer To 606.

同様に、B系統のシンボルバッファ601bは、B系統のシンボル列(データ列)を記憶する。B系統の符号化回路602bは、例えば図4の符号表を用いて、シンボルバッファ601b内のシンボル列を先頭から順次、符号に符号化し、その符号をストリームバッファ603bに出力し、その符号の符号長を符号長バッファ604bに出力する。ストリームバッファ603bは、符号化回路602bにより符号化された符号を順次バッファリングする。符号長バッファ604bは、FIFOであり、符号化回路602bにより符号化された符号の符号長を順次バッファリングする。なお、符号長バッファ604bは、最初、最大符号長N(例えば12ビット)を記憶する。例えば、ストリームバッファ603bは、図5の符号列DT2をバッファリングする。   Similarly, the B system symbol buffer 601b stores a B system symbol string (data string). The B-system encoding circuit 602b uses the code table of FIG. 4, for example, to sequentially encode the symbol string in the symbol buffer 601b from the top into a code, and outputs the code to the stream buffer 603b. The length is output to the code length buffer 604b. The stream buffer 603b sequentially buffers the codes encoded by the encoding circuit 602b. The code length buffer 604b is a FIFO, and sequentially buffers the code length of the code encoded by the encoding circuit 602b. Note that the code length buffer 604b initially stores the maximum code length N (for example, 12 bits). For example, the stream buffer 603b buffers the code string DT2 in FIG.

まず、符号化回路602bが符号長b0の符号を出力すると、ストリームバッファ603bには符号長b0の符号が記憶され、符号長バッファ604bには符号長b0が記憶される。次に、符号化回路602bが符号長b1の符号を出力すると、ストリームバッファ603bには符号長b1の符号が記憶され、符号長バッファ604bには符号長b1が記憶される。次に、符号化回路602bが符号長b2の符号を出力すると、ストリームバッファ603bには符号長b2の符号が記憶され、符号長バッファ604bには符号長b2が記憶される。以下、同様に、符号化回路603bは、符号長b3及びb4の符号等の出力を繰り返す。   First, when the encoding circuit 602b outputs a code having the code length b0, the code having the code length b0 is stored in the stream buffer 603b, and the code length b0 is stored in the code length buffer 604b. Next, when the encoding circuit 602b outputs a code having the code length b1, the code having the code length b1 is stored in the stream buffer 603b, and the code length b1 is stored in the code length buffer 604b. Next, when the encoding circuit 602b outputs a code having the code length b2, the code having the code length b2 is stored in the stream buffer 603b, and the code length b2 is stored in the code length buffer 604b. Hereinafter, similarly, the encoding circuit 603b repeats output of codes of code lengths b3 and b4.

切り出し部605bは、符号長バッファ604b内の先頭に記憶されている最大符号長N(12ビット)を取り出し、最大符号長Nで、ストリームバッファ603b内の符号列DT2を切り出し、その切り出した符号列をマルチプレクサ606に出力する。切り出された12ビットの符号列は、図5に示すように、符号長b0の符号及び符号長b1αの符号により構成される。符号長バッファ604bは、最大符号長Nが取り出されると、最大符号長Nを破棄する。ストリームバッファ603bには、符号長b1βの符号が残される。次に、切り出し部605bは、符号長バッファ604bから符号長b0を取り出し、符号長b0で、ストリームバッファ603b内の符号列を切り出し、マルチプレクサ606に出力する。符号長バッファ604bは、符号長b0が取り出されると、符号長b0を破棄する。次に、切り出し部605bは、符号長バッファ604bから符号長b1を取り出し、符号長b1で、ストリームバッファ603b内の符号列を切り出し、マルチプレクサ606に出力する。符号長バッファ604bは、符号長b1が取り出されると、符号長b1を破棄する。以下、同様に、切り出し部605bは、符号化回路602bにより符号化された前回の符号の符号長を符号長バッファ604bから入力し、その符号長で、ストリームバッファ603b内の符号列を切り出し、マルチプレクサ606に出力する。   The cutout unit 605b takes out the maximum code length N (12 bits) stored at the head in the code length buffer 604b, cuts out the code string DT2 in the stream buffer 603b with the maximum code length N, and cuts out the code string Is output to the multiplexer 606. The cut out 12-bit code string is composed of a code having a code length b0 and a code having a code length b1α as shown in FIG. When the maximum code length N is extracted, the code length buffer 604b discards the maximum code length N. A code having a code length b1β is left in the stream buffer 603b. Next, the cutout unit 605b extracts the code length b0 from the code length buffer 604b, cuts out the code string in the stream buffer 603b with the code length b0, and outputs the code string to the multiplexer 606. When the code length b0 is extracted, the code length buffer 604b discards the code length b0. Next, the cutout unit 605b extracts the code length b1 from the code length buffer 604b, cuts out the code string in the stream buffer 603b with the code length b1, and outputs the code string to the multiplexer 606. When the code length b1 is extracted, the code length buffer 604b discards the code length b1. Similarly, the cutout unit 605b inputs the code length of the previous code encoded by the encoding circuit 602b from the code length buffer 604b, cuts out the code string in the stream buffer 603b with the code length, and outputs a multiplexer To 606.

マルチプレクサ606は、切り出し部605aにより切り出された符号列及び切り出し部605bにより切り出された符号列を交互に多重化し、符号列DT3を結合済符号バッファ607に出力する。結合済符号バッファ607は、符号列DT3を記憶する。例えば、図5に示すように、データ列DT3において、前半の12ビットは、切り出し部605aにより切り出された12ビットの符号列であり、後半の12ビットは、切り出し部605bにより切り出された12ビットの符号列である。   The multiplexer 606 alternately multiplexes the code string cut out by the cutout unit 605a and the code string cut out by the cutout unit 605b, and outputs the code string DT3 to the combined code buffer 607. The combined code buffer 607 stores the code string DT3. For example, as shown in FIG. 5, in the data string DT3, the first 12 bits are a 12-bit code string cut out by the cutout unit 605a, and the latter 12 bits are 12 bits cut out by the cutout unit 605b. Is a code string.

図7は、本実施形態による可変長符号化装置の具体的な構成例を示す図である。可変長符号化装置は、2個の符号化回路703a及び703bにより2並列の符号化を行う。シンボルバッファ701は、例えばSRAM(スタティックランダムアクセスメモリ:Static Random Access Memory)であり、シンボル列(データ列)を記憶する。分配器(セレクタ)702は、シンボルバッファ701内のシンボル列をシンボル単位で交互にA系統の符号化回路703a及びB系統の符号化回路703bに出力する。   FIG. 7 is a diagram illustrating a specific configuration example of the variable length coding device according to the present embodiment. The variable-length encoding apparatus performs two parallel encodings using two encoding circuits 703a and 703b. The symbol buffer 701 is, for example, an SRAM (Static Random Access Memory), and stores a symbol string (data string). The distributor (selector) 702 outputs the symbol strings in the symbol buffer 701 alternately to the A system encoding circuit 703a and the B system encoding circuit 703b in units of symbols.

符号化回路703aは、分配器702により出力されたA系統のシンボル列を可変長符号に符号化し、その符号化した符号をセレクタ704aに出力し、その符号の符号長をセレクタ706aに出力する。符号長は、例えば5ビットデータとして表現される。セレクタ704aは、符号化回路703aが符号を出力している間は符号化回路703aが出力する符号を選択し、シンボルバッファ701内のA系統のシンボル列が空になり、符号化回路703aの符号化が終了するとEOSコード(符号化終了コード)を選択し、符号バッファ705aに出力する。符号バッファ705aは、例えば144ビットレジスタであり、セレクタ704aにより出力される符号又はEOSコードを順次バッファリングし、図6のストリームバッファ603aと同様に、例えば図5の符号列DT1を記憶する。セレクタ706aは、符号化回路703aの符号化開始前に最大符号長Nの12ビットを選択し、符号化回路703aの符号化が開始すると符号化回路703aにより出力される符号長を選択し、符号長FIFO707aに出力する。符号長FIFO707aは、例えば5ビット×16ワードの記憶容量を有し、図6の符号長バッファ604aと同様に、最大符号長N(12ビット)、符号長a0〜a4等を順次バッファリングする。切り出し部708aは、図6の切り出し部605aと同様に、符号長FIFO707aに記憶されている符号長を順次取り出し、取り出した符号長で、符号バッファ705a内の符号列を順次切り出し、その切り出した符号列を結合器709に出力する。すなわち、切り出し部708aは、最初、符号化回路703aにより符号化される符号の中の最大符号長Nで、符号バッファ705a内の符号列を切り出し、その後、符号化回路703aにより符号化された前回の符号の符号長で、符号バッファ705a内の符号列を切り出す。   The encoding circuit 703a encodes the A-system symbol string output from the distributor 702 into a variable-length code, outputs the encoded code to the selector 704a, and outputs the code length of the code to the selector 706a. The code length is expressed as, for example, 5-bit data. The selector 704a selects the code output from the encoding circuit 703a while the encoding circuit 703a outputs the code, and the A system symbol string in the symbol buffer 701 becomes empty, and the code of the encoding circuit 703a is selected. When encoding is completed, an EOS code (encoding end code) is selected and output to the code buffer 705a. The code buffer 705a is, for example, a 144-bit register, sequentially buffers the code or EOS code output from the selector 704a, and stores, for example, the code string DT1 in FIG. 5 in the same manner as the stream buffer 603a in FIG. The selector 706a selects 12 bits of the maximum code length N before starting the encoding of the encoding circuit 703a, selects the code length output by the encoding circuit 703a when the encoding circuit 703a starts encoding, Output to the long FIFO 707a. The code length FIFO 707a has a storage capacity of, for example, 5 bits × 16 words, and sequentially buffers the maximum code length N (12 bits), the code lengths a0 to a4, and the like, similar to the code length buffer 604a of FIG. The cutout unit 708a sequentially takes out the code length stored in the code length FIFO 707a in the same manner as the cutout unit 605a in FIG. The column is output to the combiner 709. That is, the cutout unit 708a first cuts out the code string in the code buffer 705a with the maximum code length N in the code encoded by the encoding circuit 703a, and then the previous code encoded by the encoding circuit 703a. The code string in the code buffer 705a is cut out with the code length of the code.

同様に、符号化回路703bは、分配器702により出力されたB系統のシンボル列を可変長符号に符号化し、その符号化した符号をセレクタ704bに出力し、その符号の符号長をセレクタ706bに出力する。符号長は、例えば5ビットデータとして表現される。セレクタ704bは、符号化回路703bが符号を出力している間は符号化回路703bが出力する符号を選択し、シンボルバッファ701内のB系統のシンボル列が空になり、符号化回路703bの符号化が終了するとEOSコード(符号化終了コード)を選択し、符号バッファ705bに出力する。符号バッファ705bは、例えば144ビットレジスタであり、セレクタ704bにより出力される符号又はEOSコードを順次バッファリングし、図6のストリームバッファ603bと同様に、例えば図5の符号列DT2を記憶する。セレクタ706bは、符号化回路703bの符号化開始前に最大符号長Nの12ビットを選択し、符号化回路703bの符号化が開始すると符号化回路703bにより出力される符号長を選択し、符号長FIFO707bに出力する。符号長FIFO707bは、例えば5ビット×16ワードの記憶容量を有し、図6の符号長バッファ604bと同様に、最大符号長N(12ビット)、符号長b0〜b4等を順次バッファリングする。切り出し部708bは、図6の切り出し部605bと同様に、符号長FIFO707bに記憶されている符号長を順次取り出し、取り出した符号長で、符号バッファ705b内の符号列を順次切り出し、その切り出した符号列を結合器709に出力する。すなわち、切り出し部708bは、最初、符号化回路703bにより符号化される符号の中の最大符号長Nで、符号バッファ705b内の符号列を切り出し、その後、符号化回路703bにより符号化された前回の符号の符号長で、符号バッファ705b内の符号列を切り出す。   Similarly, the encoding circuit 703b encodes the B system symbol string output from the distributor 702 into a variable length code, outputs the encoded code to the selector 704b, and sets the code length of the code to the selector 706b. Output. The code length is expressed as, for example, 5-bit data. The selector 704b selects a code output from the encoding circuit 703b while the encoding circuit 703b outputs a code, and the B system symbol string in the symbol buffer 701 becomes empty, and the code of the encoding circuit 703b is selected. When encoding is completed, an EOS code (encoding end code) is selected and output to the code buffer 705b. The code buffer 705b is, for example, a 144-bit register, sequentially buffers the code or EOS code output from the selector 704b, and stores, for example, the code string DT2 in FIG. 5 in the same manner as the stream buffer 603b in FIG. The selector 706b selects 12 bits of the maximum code length N before the encoding circuit 703b starts encoding, selects the code length output by the encoding circuit 703b when the encoding circuit 703b starts encoding, Output to the long FIFO 707b. The code length FIFO 707b has a storage capacity of, for example, 5 bits × 16 words, and sequentially buffers the maximum code length N (12 bits), the code lengths b0 to b4, and the like, similar to the code length buffer 604b of FIG. The cutout unit 708b sequentially takes out the code length stored in the code length FIFO 707b in the same manner as the cutout unit 605b in FIG. 6, sequentially cuts out the code string in the code buffer 705b with the extracted code length, and the cut out code The column is output to the combiner 709. That is, the cutout unit 708b first cuts out the code string in the code buffer 705b with the maximum code length N in the code encoded by the encoding circuit 703b, and then the previous time encoded by the encoding circuit 703b. The code string in the code buffer 705b is cut out with the code length of the code.

結合器709は、切り出し部708aにより切り出されたA系統の符号列及び切り出し部708bにより切り出されたB系統の符号列を交互に結合する。すなわち、結合器709は、切り出し部708a及び708bにより切り出された符号列をインターリーブさせながら結合する。セレクタ710は、切り出し部708a及び708bの切り出しが終了すると、結合器709により結合された符号列を結合済符号バッファ711に出力する。結合済符号バッファ711は、セレクタ710により出力された符号列を記憶する。セレクタ710により出力される符号列は、結合済符号バッファ711に格納された符号列の末尾に結合される。   The combiner 709 alternately couples the A system code string cut out by the cutout unit 708a and the B system code string cut out by the cutout unit 708b. That is, the combiner 709 combines the code strings cut out by the cutout units 708a and 708b while interleaving them. The selector 710 outputs the code string combined by the combiner 709 to the combined code buffer 711 when the extraction of the extraction units 708a and 708b is completed. The combined code buffer 711 stores the code string output by the selector 710. The code string output by the selector 710 is combined with the end of the code string stored in the combined code buffer 711.

図8は、図7の可変長符号化装置の符号化方法の例を示すフローチャートである。ステップS801では、初期化時に、セレクタ706a及び706bは最大符号長N(12ビット)を選択し、符号長FIFO707a及び707bに最大符号長Nをプッシュする(記憶させる)。次に、ステップS802では、符号長FIFO707a及び707bの両方が空か否かをチェックする。空であれば符号化処理を終了し、空でなければステップS803及びS807の並列処理に進む。   FIG. 8 is a flowchart showing an example of the encoding method of the variable length encoding apparatus of FIG. In step S801, during initialization, the selectors 706a and 706b select the maximum code length N (12 bits), and push (store) the maximum code length N to the code length FIFOs 707a and 707b. In step S802, it is checked whether both code length FIFOs 707a and 707b are empty. If it is empty, the encoding process is terminated. If it is not empty, the process proceeds to parallel processing in steps S803 and S807.

ステップS803では、符号長FIFO707aが空か否かをチェックする。空であればステップS806へ進み、空でなければステップS804に進む。ステップS806では、符号長lenAに0を設定し、ステップS811に進む。ステップS804では、符号化回路703aは、符号化を行い、その符号を符号バッファ705aにプッシュし、符号長を符号長バッファ707aにプッシュする。次に、ステップS805では、切り出し部708aは、符号長FIFO707a内の符号長を読み出し、その符号長を符号長lenAに設定し、ステップS811に進む。   In step S803, it is checked whether or not the code length FIFO 707a is empty. If it is empty, the process proceeds to step S806, and if it is not empty, the process proceeds to step S804. In step S806, 0 is set to the code length lenA, and the process proceeds to step S811. In step S804, the encoding circuit 703a performs encoding, pushes the code to the code buffer 705a, and pushes the code length to the code length buffer 707a. Next, in step S805, the cutout unit 708a reads the code length in the code length FIFO 707a, sets the code length to the code length lenA, and proceeds to step S811.

ステップS807では、符号長FIFO707bが空か否かをチェックする。空であればステップS810へ進み、空でなければステップS808に進む。ステップS810では、符号長lenBに0を設定し、ステップS811に進む。ステップS808では、符号化回路703bは、符号化を行い、その符号を符号バッファ705bにプッシュし、符号長を符号長バッファ707bにプッシュする。次に、ステップS809では、切り出し部708bは、符号長FIFO707b内の符号長を読み出し、その符号長を符号長lenBに設定し、ステップS811に進む。   In step S807, it is checked whether the code length FIFO 707b is empty. If it is empty, the process proceeds to step S810. If it is not empty, the process proceeds to step S808. In step S810, 0 is set to the code length lenB, and the process proceeds to step S811. In step S808, the encoding circuit 703b performs encoding, pushes the code to the code buffer 705b, and pushes the code length to the code length buffer 707b. Next, in step S809, the cutout unit 708b reads the code length in the code length FIFO 707b, sets the code length to the code length lenB, and proceeds to step S811.

分配器702は、シンボルバッファ701から毎サイクル1シンボルずつ読み出し、符号化回路703a及び703bに交互に出力する。符号化回路703a及び703bは、幅広い可変長符号化処理を対象としているが、その一例としてハフマン符号化を例とする。ハフマン符号は、入力シンボル群の確率分布に基づいた符号表を用いて符号化する方式であり、1シンボルに整数ビットを割り当てる符号化方式でも特に高い符号化効率を示す。図4のハフマン符号では、最小符号長が1ビット、最大符号長が12ビットの符号表を用いて対象シンボルを符号化していく。   The distributor 702 reads one symbol from the symbol buffer 701 for each cycle, and outputs it alternately to the encoding circuits 703a and 703b. The encoding circuits 703a and 703b are intended for a wide range of variable-length encoding processing, and Huffman encoding is taken as an example. The Huffman code is a method of encoding using a code table based on the probability distribution of the input symbol group, and shows a particularly high encoding efficiency even in an encoding method in which integer bits are assigned to one symbol. In the Huffman code of FIG. 4, the target symbol is encoded using a code table having a minimum code length of 1 bit and a maximum code length of 12 bits.

ステップS811では、切り出し部708aは、符号バッファ705aに格納されている符号列の長さが符号長lenA以上であるか否かをチェックする。符号長lenA以上であればステップS812に進み、符号長lenA未満であればステップS802に戻る。ステップS812では、切り出し部708bは、符号バッファ705bに格納されている符号列の長さが符号長lenB以上であるか否かをチェックする。符号長lenB以上であればステップS813及びS817の並列処理に進み、符号長lenB未満であればステップS802に戻る。   In step S811, the cutout unit 708a checks whether the length of the code string stored in the code buffer 705a is equal to or longer than the code length lenA. If it is longer than the code length lenA, the process proceeds to step S812, and if it is less than the code length lenA, the process returns to step S802. In step S812, the cutout unit 708b checks whether the length of the code string stored in the code buffer 705b is equal to or longer than the code length lenB. If it is longer than the code length lenB, the process proceeds to the parallel processing of steps S813 and S817, and if it is less than the code length lenB, the process returns to step S802.

ステップS813では、切り出し部708aは、符号バッファ705a内の符号列を符号長lenAで切り出し、結合器709及びセレクタ710を介して、結合済符号バッファ711に格納する。次に、ステップS814では、切り出し部708aは、符号長バッファ707aから符号長をポップする(取り出す)。次に、ステップS815では、分配器702は、シンボルバッファ701に符号化対象シンボルがあるか否かをチェックする。符号化対象シンボルがあればステップS802に戻り、符号化対象シンボルがなければステップS816へ進む。ステップS816では、セレクタ704aは、EOSコードを選択し、符号バッファ705aに書き込む。その後、ステップS802の処理に戻る。   In step S813, the cutout unit 708a cuts out the code string in the code buffer 705a with the code length lenA and stores it in the combined code buffer 711 via the combiner 709 and the selector 710. Next, in step S814, the cutout unit 708a pops (takes out) the code length from the code length buffer 707a. Next, in step S815, the distributor 702 checks whether or not there is an encoding target symbol in the symbol buffer 701. If there is an encoding target symbol, the process returns to step S802, and if there is no encoding target symbol, the process proceeds to step S816. In step S816, the selector 704a selects the EOS code and writes it to the code buffer 705a. Thereafter, the process returns to step S802.

ステップS817では、切り出し部708bは、符号バッファ705b内の符号列を符号長lenBで切り出し、結合器709及びセレクタ710を介して、結合済符号バッファ711に格納する。次に、ステップS818では、切り出し部708bは、符号長バッファ707bから符号長をポップする。次に、ステップS819では、分配器702は、シンボルバッファ701に符号化対象シンボルがあるか否かをチェックする。符号化対象シンボルがあればステップS802に戻り、符号化対象シンボルがなければステップS820へ進む。ステップS820では、セレクタ704bは、EOSコードを選択し、符号バッファ705bに書き込む。その後、ステップS802の処理に戻る。   In step S817, the cutout unit 708b cuts out the code string in the code buffer 705b with the code length lenB, and stores it in the combined code buffer 711 via the combiner 709 and the selector 710. Next, in step S818, the cutout unit 708b pops the code length from the code length buffer 707b. Next, in step S819, the distributor 702 checks whether or not there is an encoding target symbol in the symbol buffer 701. If there is an encoding target symbol, the process returns to step S802, and if there is no encoding target symbol, the process proceeds to step S820. In step S820, the selector 704b selects the EOS code and writes it to the code buffer 705b. Thereafter, the process returns to step S802.

以上のように、切り出し部708a及び708bは、それぞれ、符号バッファ705a及び705bに格納された符号列が符号長lenA及びlenB以上になった場合のみ、符号バッファ705a及び705b内の符号列を切り出し、結合器709へ出力する。符号バッファ705a及び705bのいずれかが符号長lenA及びlenBに満たない場合は、切り出し部708a及び708bは結合器709に符号列を出力せず、符号化回路703a及び703bは、シンボルの符号化処理を継続する。符号バッファ705a及び705bのサイズは、符号バッファ705a及び705bの格納容量の偏りがワーストケースの場合から計算可能である。ワーストケースの場合は、符号バッファ705aに毎サイクル1ビットの符号が書き込まれ、符号バッファ705bには毎サイクル12ビットの符号が書き込まれる場合であり、切り出し部708a及び708bから結合済符号バッファ711に符号列が書き込まれるのは符号バッファ705aに12ビットの符号が格納された場合である。この時、符号バッファ705bには12×12ビットの符号が格納されていることとなり、これが符号バッファ705a及び705bに必要なメモリ容量となる。シンボルバッファ701及び結合済符号バッファ711は、入力するシンボル列に依存するため、その最低/最大容量はシステムに依存し、SRAM又はDRAM(ダイナミックランダムアクセスメモリ:Dynamic Random Access Memory)で実装することが望ましい。符号化の終了条件は、符号長FIFO707a及び707bが空になった場合である。A系統の符号化対象シンボル数とB系統の符号化対象シンボル数が異なる場合は、一方が先に符号化処理を終了するが、その場合は終了した系統を停止させ、他方の系統の符号化回路が全シンボルを符号化するまで継続する。   As described above, the cutout units 708a and 708b cut out the code strings in the code buffers 705a and 705b only when the code strings stored in the code buffers 705a and 705b are longer than the code lengths lenA and lenB, respectively. Output to the combiner 709. When any of the code buffers 705a and 705b is less than the code lengths lenA and lenB, the clipping units 708a and 708b do not output a code string to the combiner 709, and the encoding circuits 703a and 703b perform symbol encoding processing. Continue. The sizes of the code buffers 705a and 705b can be calculated from the case where the storage capacity bias of the code buffers 705a and 705b is the worst case. In the worst case, a 1-bit code is written to the code buffer 705a and a 12-bit code is written to the code buffer 705b. The cut-out units 708a and 708b store the combined code buffer 711. The code string is written when a 12-bit code is stored in the code buffer 705a. At this time, a code of 12 × 12 bits is stored in the code buffer 705b, and this becomes a memory capacity necessary for the code buffers 705a and 705b. Since the symbol buffer 701 and the combined code buffer 711 depend on the input symbol string, the minimum / maximum capacity depends on the system and can be implemented by SRAM or DRAM (Dynamic Random Access Memory). desirable. The encoding end condition is when the code length FIFOs 707a and 707b become empty. If the number of encoding target symbols in the A system and the number of encoding target symbols in the B system are different, one ends the encoding process first. In this case, the completed system is stopped and the encoding of the other system is performed. Continue until the circuit encodes all symbols.

図9は、第2の実施形態による可変長復号装置の構成例を示す図である。可変長復号装置は、A系統の復号部911a及びB系統の復号部911bが2並列に復号処理を行う。結合済符号バッファ901は、例えばSRAMであり、図7の可変長符号化装置により生成された符号列を記憶する。結合済符号バッファ901は、A系統の符号列及びB系統の符号列がインターリーブされた符号列をメインビット連接部902に出力する。   FIG. 9 is a diagram illustrating a configuration example of the variable length decoding device according to the second embodiment. In the variable length decoding device, the A-system decoding unit 911a and the B-system decoding unit 911b perform decoding processing in parallel. The combined code buffer 901 is, for example, an SRAM, and stores a code string generated by the variable length encoding device of FIG. The combined code buffer 901 outputs a code string in which the A system code string and the B system code string are interleaved to the main bit concatenation unit 902.

メインビット連接部902は、結合済符号バッファ901により出力される符号列とメインバッファ904により出力される所定の符号列とを連接する。メインシフタ903は、メインビット連接部902により連接された符号列を所定の符号長lenA+lenBだけシフトし、2系統×N=24ビットの符号列をメインバッファ904に出力する。メインバッファ904は、24ビットの符号列をバッファリングする。24ビットの符号列は、図5の符号列DT3のように、A系統の符号列及びB系統の符号列を有する。   The main bit connection unit 902 connects the code string output from the combined code buffer 901 and the predetermined code string output from the main buffer 904. The main shifter 903 shifts the code string connected by the main bit connecting part 902 by a predetermined code length lenA + lenB, and outputs a code string of 2 systems × N = 24 bits to the main buffer 904. The main buffer 904 buffers a 24-bit code string. The 24-bit code string has an A-system code string and a B-system code string as in the code string DT3 of FIG.

第1のサブビット連接部905aは、メインバッファ904内の符号列と第1のサブバッファにより出力される所定の符号列とを連接する。第1のサブシフタ906aは、第1のサブビット連接部905aにより連接された符号列を所定の符号長lenAだけシフトし、24ビットの符号列を出力する。具体的には、第1のサブシフタ906aは、24ビットの符号列のうちの前半の12ビットのA系統の符号列を第1のサブバッファ907aに出力し、後半の12ビットのB系統の符号列を第2のサブビット連接部905bに出力する。第1のサブバッファ907aは、第1のサブシフタ906aによりシフトされた24ビットの符号列が分割された一部の前半の12ビットのA系統の符号列をバッファリングする。第1の復号器908aは、第1のサブバッファ907aによりバッファリングされた符号列の先頭の符号をシンボル(データ)に復号し、その復号したシンボルdecAをシンボルバッファ910に出力し、その復号した符号の符号長lenAを第1のサブシフタ906a及び加算器909に出力する。   The first sub bit concatenation unit 905a concatenates the code string in the main buffer 904 and the predetermined code string output from the first sub buffer. The first sub-shifter 906a shifts the code string connected by the first sub-bit connecting part 905a by a predetermined code length lenA, and outputs a 24-bit code string. Specifically, the first sub-shifter 906a outputs the first 12-bit A-system code string of the 24-bit code string to the first sub-buffer 907a, and the latter 12-bit B-system code. The column is output to the second sub-bit connection 905b. The first sub-buffer 907a buffers a part of the first 12-bit A-system code string obtained by dividing the 24-bit code string shifted by the first sub-shifter 906a. The first decoder 908a decodes the head code of the code string buffered by the first sub-buffer 907a into a symbol (data), outputs the decoded symbol decA to the symbol buffer 910, and decodes it The code length lenA of the code is output to the first sub-shifter 906a and the adder 909.

第1のサブビット連接部905aは、メインバッファ904内の符号列と、第1のサブバッファ907a内の符号列の中で第1の復号器908aにより復号されなかった残りの符号とを連接する。第1のサブシフタ906aは、第1のサブビット連接部905aにより連接された符号列を、第1の復号器908aにより復号された前回の符号の符号長lenAだけシフトする。   The first sub-bit concatenation unit 905a concatenates the code string in the main buffer 904 and the remaining codes that have not been decoded by the first decoder 908a in the code string in the first sub-buffer 907a. The first sub-shifter 906a shifts the code string concatenated by the first sub-bit concatenation unit 905a by the code length lenA of the previous code decoded by the first decoder 908a.

第2のサブビット連接部905bは、第1のサブシフタ906aによりシフトされた符号列が分割された他の符号列(後半12ビットのB系統の符号列)と、第2のサブバッファ907bの所定の符号列とを連接する。第2のサブシフタ906bは、第2のサブビット連接部905bにより連接された符号列を所定の符号長lenBだけシフトする。第2のサブバッファ907bは、第2のサブシフタ906bによりシフトされた12ビット符号列をバッファリングする。第2の復号器908bは、第2のサブバッファ907bによりバッファリングされた先頭の符号をシンボル(データ)に復号し、その復号したシンボルdecBをシンボルバッファ910に出力し、その復号した符号の符号長lenBを第2のサブシフタ906b及び加算器909に出力する。   The second sub-bit concatenating unit 905b includes another code string obtained by dividing the code string shifted by the first sub-shifter 906a (the latter 12-bit B-system code string), and a predetermined number of second sub-buffers 907b. Concatenates the code string. The second sub-shifter 906b shifts the code string connected by the second sub-bit connecting unit 905b by a predetermined code length lenB. The second sub-buffer 907b buffers the 12-bit code string shifted by the second sub-shifter 906b. The second decoder 908b decodes the head code buffered by the second sub-buffer 907b into a symbol (data), outputs the decoded symbol decB to the symbol buffer 910, and the code of the decoded code The length lenB is output to the second sub-shifter 906b and the adder 909.

第2のサブビット連接部905bは、第1のサブシフタ906aによりシフトされた符号列が分割された他の符号列(後半12ビットのB系統の符号列)と、第2のサブバッファ907b内の符号列の中で第2の復号器908bにより復号されなかった残りの符号とを連接する。第2のサブシフタ906bは、第2のサブビット連接部905bにより連接された符号列を、第2の復号器908bにより復号された前回の符号の符号長lenBだけシフトする。   The second sub-bit concatenation unit 905b includes another code string (the latter 12-bit B-system code string) obtained by dividing the code string shifted by the first sub-shifter 906a, and the code in the second sub-buffer 907b. The remaining codes not decoded by the second decoder 908b in the sequence are concatenated. The second sub-shifter 906b shifts the code string concatenated by the second sub-bit concatenation unit 905b by the code length lenB of the previous code decoded by the second decoder 908b.

加算器909は、第1の復号器908aにより復号された符号の符号長lenAと第2の復号器908bにより復号された符号の符号長lenBとを加算し、符号長lenA+lenBをメインシフタ903に出力する。   The adder 909 adds the code length lenA of the code decoded by the first decoder 908a and the code length lenB of the code decoded by the second decoder 908b, and outputs the code length lenA + lenB to the main shifter 903 To do.

メインビット連接部902は、結合済符号バッファ901内の符号列と、メインバッファ904内の符号列の中で第1のサブビット連接部905aに出力されなかった残りの符号列とを連接する。メインシフタ903は、メインビット連接部902により連接された符号列を、第1の復号器908a及び第2の復号器908bにより復号された前回の符号の合計の符号長lenA+lenBだけシフトする。   The main bit concatenation unit 902 concatenates the code string in the combined code buffer 901 and the remaining code string that is not output to the first sub-bit concatenation unit 905a in the code string in the main buffer 904. The main shifter 903 shifts the code string concatenated by the main bit concatenation unit 902 by the total code length lenA + lenB of the previous codes decoded by the first decoder 908a and the second decoder 908b.

以上のように、可変長復号装置は、複数系統の符号列がインターリーブされた符号を復号することができる。メインシフタ903は、系統数×最大符号長=2×12=24ビット分のシフト処理が可能である。メインバッファ904は、系統数×最大符号長=2×12=24ビット分のバッファリングを行う。第1のサブシフタ906a及び第2のサブシフタ906bは、それぞれ、最大符号長=12ビット分のシフトが可能である。第1のサブバッファ907a及び第2のサブバッファ907bは、それぞれ、各系統に対して最大符号長=12ビット分の符号を格納可能である。   As described above, the variable length decoding device can decode a code in which a plurality of code strings are interleaved. The main shifter 903 can perform shift processing for the number of systems × maximum code length = 2 × 12 = 24 bits. The main buffer 904 performs buffering for the number of systems × maximum code length = 2 × 12 = 24 bits. Each of the first sub-shifter 906a and the second sub-shifter 906b can be shifted by a maximum code length = 12 bits. Each of the first sub-buffer 907a and the second sub-buffer 907b can store a code for the maximum code length = 12 bits for each system.

図10は、図9の可変長復号装置の復号方法の例を示すフローチャートである。ステップS1001では、初期化時にはメインバッファ904及びサブバッファ907a,907b共に符号が格納されていないため、メインバッファ904は、初期化直後に結合済符号バッファ901からデータを読み出し、24ビットのデータを書き込む。24ビット容量のメインバッファ904は、毎サイクル符号列を第1のサブビット連接部905aに供給し、復号器908a及び908bで消費された符号の符号長lenA及びlenBの合計符号長lenA+lenB分を、結合済符号バッファ901から補充する。初期化直後は、サブバッファ907a及び907bに符号が格納されていないが、最初の読み出し長は最大符号長の12ビットであることが符号化装置の符号化時に約束されているため、サブシフタ906a及び906bのシフト量を0ビットとしてサブバッファ907a及び907bにデータを供給する。第1のサブバッファ907aにはメインバッファ904内の24ビットの符号列のうちの前半の12ビットが格納され、第2のサブバッファ907bにはメインバッファ904内の24ビットの符号列のうちの後半の12ビットが格納される。初期化終了後に、ステップS1002及びS1007の並列処理に進む。   FIG. 10 is a flowchart showing an example of a decoding method of the variable length decoding device of FIG. In step S1001, since the codes are not stored in the main buffer 904 and the sub-buffers 907a and 907b at the time of initialization, the main buffer 904 reads data from the combined code buffer 901 and writes 24-bit data immediately after initialization. . The main buffer 904 having a 24-bit capacity supplies the code sequence for each cycle to the first sub-bit concatenation unit 905a, and combines the code lengths lenA and lenB of the code lengths lenA and lenB consumed by the decoders 908a and 908b. Replenish from the completed code buffer 901. Immediately after initialization, no code is stored in the sub-buffers 907a and 907b, but since the initial read length is promised at the time of encoding by the encoding device, the maximum code length is 12 bits. Data is supplied to the sub-buffers 907a and 907b with the shift amount of 906b as 0 bits. The first 12 bits of the 24-bit code string in the main buffer 904 are stored in the first sub-buffer 907a, and the first 12 bits of the 24-bit code string in the main buffer 904 are stored in the second sub-buffer 907b. The latter 12 bits are stored. After completion of initialization, the process proceeds to parallel processing in steps S1002 and S1007.

ステップS1002では、可変長復号装置は、A系統のEOS復号終了フラグがアサートされていればA系統の復号処理の終了を意味するのでステップS1006に進み、A系統のEOS復号終了フラグがアサートされていなければA系統の復号処理の未終了を意味するのでステップS1003に進む。ステップS1003では、第1の復号器908aは、第1のサブバッファ907a内の先頭の符号をシンボル(復号データ)decAに復号し、その符号の符号長(消費ビット長)lenAを出力する。次に、ステップS1004では、可変長復号装置は、シンボルdecAがEOSコードであるか否かをチェックし、EOSコードであれば終了を意味するのでステップS1005へ進み、EOSコードでなければステップS1012及びS1014の並列処理に進む。ステップS1005では、可変長復号装置は、A系統のEOS復号終了フラグをアサートし、ステップS1012及びS1014の並列処理に進む。ステップS1006では、第1の復号器908aは、シンボルdecAとして終了コードNONEを出力し、符号長lenAとして「0」を出力し、ステップS1012及びS1014の並列処理に進む。   In step S1002, if the A system EOS decoding end flag is asserted, the variable length decoding device means the end of the A system decoding process, so the process proceeds to step S1006, and the A system EOS decoding end flag is asserted. If not, it means that the decoding process of the A system has not been completed, and the process proceeds to step S1003. In step S1003, the first decoder 908a decodes the head code in the first subbuffer 907a into a symbol (decoded data) decA, and outputs the code length (consumed bit length) lenA of the code. Next, in step S1004, the variable length decoding device checks whether or not the symbol decA is an EOS code. If the symbol decA is an EOS code, it means that the process ends, and thus proceeds to step S1005. Proceed to parallel processing in S1014. In step S1005, the variable-length decoding apparatus asserts an AOS EOS decoding end flag, and proceeds to parallel processing in steps S1012 and S1014. In step S1006, the first decoder 908a outputs the end code NONE as the symbol decA, outputs “0” as the code length lenA, and proceeds to parallel processing in steps S1012 and S1014.

ステップS1007では、可変長復号装置は、B系統のEOS復号終了フラグがアサートされていればB系統の復号処理の終了を意味するのでステップS1011に進み、B系統のEOS復号終了フラグがアサートされていなければB系統の復号処理の未終了を意味するのでステップS1008に進む。ステップS1008では、第2の復号器908bは、第2のサブバッファ907b内の先頭の符号をシンボル(復号データ)decBに復号し、その符号の符号長(消費ビット長)lenBを出力する。次に、ステップS1009では、可変長復号装置は、シンボルdecBがEOSコードであるか否かをチェックし、EOSコードであれば終了を意味するのでステップS1010へ進み、EOSコードでなければステップS1012及びS1014の並列処理に進む。ステップS1010では、可変長復号装置は、B系統のEOS復号終了フラグをアサートし、ステップS1012及びS1014の並列処理に進む。ステップS1011では、第2の復号器908bは、シンボルdecBとして終了コードNONEを出力し、符号長lenBとして「0」を出力し、ステップS1012及びS1014の並列処理に進む。   In step S1007, if the B-system EOS decoding end flag is asserted, the variable-length decoding apparatus means the end of the B-system decoding process. Therefore, the process proceeds to step S1011 and the B-system EOS decoding end flag is asserted. If not, it means that the decoding process of the B system has not been completed, and the process proceeds to step S1008. In step S1008, the second decoder 908b decodes the leading code in the second subbuffer 907b into a symbol (decoded data) decB, and outputs the code length (consumed bit length) lenB of the code. In step S1009, the variable-length decoding apparatus checks whether the symbol decB is an EOS code. If the symbol decB is an EOS code, it means that the process ends, and the process proceeds to step S1010. Proceed to parallel processing in S1014. In step S1010, the variable-length decoding apparatus asserts the B system EOS decoding end flag, and proceeds to parallel processing in steps S1012 and S1014. In step S1011, the second decoder 908b outputs the end code NONE as the symbol decB, outputs “0” as the code length lenB, and proceeds to the parallel processing of steps S1012 and S1014.

ステップS1012では、加算器909は、符号長lenA及び符号長lenBを加算し、その加算値lenA+lenBを符号長lenMainとして出力する。次に、ステップS1013では、メインシフタ903は、ビット連接部902により出力される符号列を符号長lenMainだけシフトする。その後、ステップS1016へ進む。   In step S1012, the adder 909 adds the code length lenA and the code length lenB, and outputs the added value lenA + lenB as the code length lenMain. Next, in step S1013, the main shifter 903 shifts the code string output by the bit concatenation unit 902 by the code length lenMain. Thereafter, the process proceeds to step S1016.

ステップS1014では、第1のサブシフタ906aは、第1のサブビット連接部905aにより連接された符号列を符号長lenAだけシフトする。次に、ステップS1015では、第2のサブシフタ906bは、第2のサブビット連接部905bにより連接された符号列を符号長lenBだけシフトする。その後、ステップS1016へ進む。   In step S1014, the first sub-shifter 906a shifts the code string concatenated by the first sub-bit concatenating unit 905a by the code length lenA. Next, in step S1015, the second sub-shifter 906b shifts the code string concatenated by the second sub-bit concatenating unit 905b by the code length lenB. Thereafter, the process proceeds to step S1016.

ステップS1016では、可変長復号装置は、A系統のEOS復号終了フラグがアサートであり、かつB系統のEOS復号終了フラグがアサートであれば、処理を終了し、それ以外の場合にはステップS1002及びS1007の並列処理に戻る。   In step S1016, the variable-length decoding apparatus ends the process if the A system EOS decoding end flag is asserted and the B system EOS decoding end flag is asserted; otherwise, the variable length decoding apparatus performs steps S1002 and S1002. Returning to the parallel processing of S1007.

以上のように、メインバッファ904に格納された符号列はA系統の符号列とB系統の符号列とが交互に並んでいるため、まず第1のサブバッファ907aは符号列のシフト処理によって第1の復号器908aで消費した符号を破棄し、第1のサブビット連接部905aは第1のサブバッファ907aの残余符号列とメインバッファ904の符号列とを結合する。結合されたデータの上位12ビットは再度、第1のサブバッファ907aに格納され、その次の12ビットは、第2のサブバッファ906bに格納される。加算器909は、第1の復号器908a及び第2の復号器908bで復号された符号の符号長lenA及びlenBを加算し、合計の符号長lenA+lenBを出力する。メインシフタ903は、メインバッファ904の符号列から現復号処理によってA系統の復号部911a及びB系統の復号部911bに補充された符号列を破棄するため、メインバッファ904の出力を符号長lenA+lenBだけシフトし、補充ビット分を破棄する。シフトされた符号列は、結合済符号バッファ901の符号列と連結され、その上位24ビットは再度メインバッファ904に格納される。   As described above, since the code strings stored in the main buffer 904 are alternately arranged with the A-system code strings and the B-system code strings, the first sub-buffer 907a first performs the code string shift process. The code consumed by the first decoder 908a is discarded, and the first sub-bit concatenation unit 905a combines the remaining code string of the first sub-buffer 907a and the code string of the main buffer 904. The upper 12 bits of the combined data are stored again in the first sub-buffer 907a, and the next 12 bits are stored in the second sub-buffer 906b. The adder 909 adds the code lengths lenA and lenB of the codes decoded by the first decoder 908a and the second decoder 908b, and outputs a total code length lenA + lenB. The main shifter 903 discards the code strings supplemented to the A-system decoding unit 911a and the B-system decoding unit 911b by the current decoding process from the code string of the main buffer 904, and outputs the output of the main buffer 904 by the code length lenA + lenB. Shift and discard supplementary bits. The shifted code string is concatenated with the code string of the combined code buffer 901, and the upper 24 bits are stored again in the main buffer 904.

図7の可変長符号化装置によれば、必ず1サイクルで並列度分の復号処理が可能な符号を生成することができる。結合済符号列は、各系統の符号がインターリーブ(マージ)された構成となっており、それぞれの符号列から何ビットを切り出して結合済符号列を構築するかを各系統で過去に符号化された符号の符号長から決定する。そのため、復号処理で置き換えると、各系統の符号の先頭位置が前のサイクルで各系統で復号した符号の符号長からわかることを意味する。   According to the variable length coding apparatus of FIG. 7, it is possible to always generate a code that can be decoded for the degree of parallelism in one cycle. The combined code string has a configuration in which codes of each system are interleaved (merged), and how many bits are cut out from each code string to construct a combined code string is encoded in the past in each system. It is determined from the code length of the code. Therefore, when replaced by decoding processing, it means that the head position of the code of each system can be found from the code length of the code decoded by each system in the previous cycle.

特に、前のサイクルの符号の符号長の結合済符号列を連結することで、並列復号時の各系統では常に復号処理で復号した符号の符号長と、各系統へ補充するビット長が一致するため、復号時における各系統では常に最大符号長分の符号が保持され、各系統の復号処理が停止することは無い。   In particular, by concatenating the combined code strings of the code lengths of the codes of the previous cycle, the code length of the code decoded by the decoding process always matches the bit length supplemented to each system at the time of parallel decoding. Therefore, the codes for the maximum code length are always held in each system at the time of decoding, and the decoding process of each system never stops.

ここで、復号開始時に各系統の復号部911a及び911bに何ビットを供給するかが不明のため、最初の供給量を符号列から取り出され得る最大符号長Nに一致させることで、必ず1サイクルで並列度分の符号が復号可能になることを保障する。   Here, since it is unclear how many bits are supplied to the decoding units 911a and 911b of each system at the start of decoding, by making the initial supply amount coincide with the maximum code length N that can be extracted from the code string, one cycle is always obtained. This ensures that the codes for the degree of parallelism can be decoded.

符号化対象シンボルを複数の系統に分割して符号化するため、各系統の符号化対象シンボル数が一致しない場合が発生する。これが発生した場合、各系統の復号器908a及び908bをどのタイミングで停止させるかが不明となるため、復号処理がオーバーランしてしまう問題が発生する。そのため、符号化回路703a及び703bの各符号列の末尾にEOSコードを付加することで、復号終了時には各系統にEOSコードが復号されることになる。このため、EOSコードを復号した系統を停止させることで、処理のオーバーランを防止することが可能である。   Since the encoding target symbol is divided into a plurality of systems and encoded, the number of encoding target symbols in each system may not match. When this occurs, it is unclear at which timing the decoders 908a and 908b of each system are to be stopped, so that there is a problem that the decoding process is overrun. Therefore, by adding an EOS code to the end of each code string of the encoding circuits 703a and 703b, the EOS code is decoded in each system at the end of decoding. For this reason, it is possible to prevent processing overrun by stopping the system that has decoded the EOS code.

復号装置においては、各系統の復号部911a及び911bが並列に接続されている構成となり、各系統で少なくとも最大符号長Nと一致する容量のサブバッファ907a及び907bを有する。1クロックサイクルで並列度分の符号を復号するためには、必ずサブバッファ907a及び907bには最大符号長N分の符号が充填されていなければならない。本実施形態では、常に復号器908a及び908bで復号した符号の符号長の符号列が、結合済符号バッファ901からサブバッファ907a及び907bに補充するビット長と一致しているため、必ず最大符号長N分の符号がサブバッファ907a及び907bに格納されていることとなる。これは各系統で毎サイクル1シンボルが復号可能であるということを意味する。また、復号装置内で最も遅延時間が支配的な復号器908a及び908bが並列接続されているため、並列度を増加させても最大遅延時間を決定する各系統のパス(クリティカルパス)には常に1つずつの復号器908a及び908bしか存在していないため、並列度向上による遅延時間増大を抑制することができる。また、並列度と復号器908a,908bの個数が比例関係となるため、並列度に対する回路規模も線形的増加で済む。本実施形態では、符号化装置における各系統のシンボルの符号化と、復号装置における各系列からのシンボル取得の順序が同一であればよく、各サイクルで必ず並列度分のシンボルを取得する構成でなくても良い。復号装置の構成によっては複数サイクルが必要な復号器908a,908bを用いることも可能であり、レンジコーダのように特定のサイクルでのみビットを消費するような符号化復号アルゴリズムにも適用可能である。   In the decoding device, the decoding units 911a and 911b of each system are connected in parallel, and each system has sub-buffers 907a and 907b having a capacity that matches at least the maximum code length N. In order to decode codes for the degree of parallelism in one clock cycle, the sub-buffers 907a and 907b must always be filled with codes for the maximum code length N. In the present embodiment, since the code string of the code length of the code always decoded by the decoders 908a and 908b matches the bit length supplemented from the combined code buffer 901 to the sub-buffers 907a and 907b, the maximum code length is always set. The codes for N are stored in the sub-buffers 907a and 907b. This means that one symbol can be decoded every cycle in each system. In addition, since the decoders 908a and 908b having the dominant delay time in the decoding device are connected in parallel, the path of each system (critical path) that determines the maximum delay time is always included even if the degree of parallelism is increased. Since there is only one decoder 908a and 908b one by one, it is possible to suppress an increase in delay time due to an improvement in parallelism. In addition, since the degree of parallelism and the number of decoders 908a and 908b are in a proportional relationship, the circuit scale with respect to the degree of parallelism can be increased linearly. In the present embodiment, it is only necessary that the encoding order of symbols of each system in the encoding device and the order of symbol acquisition from each series in the decoding device are the same, and a symbol corresponding to the degree of parallelism is always acquired in each cycle. It is not necessary. Depending on the configuration of the decoding apparatus, it is possible to use decoders 908a and 908b that require a plurality of cycles, and the present invention can also be applied to an encoding / decoding algorithm that consumes bits only in a specific cycle such as a range coder. .

(第3の実施形態)
図11は、第3の実施形態による可変長復号装置の構成例を示す図である。以下、図11が図9と異なる点を説明する。サブビット連接部905は、図9の第1のサブビット連接部905a及び第2のサブビット連接部905bに対応する。サブシフタ906は、図9の第1のサブシフタ906a及び第2のサブシフタ906bに対応する。復号器908は、図9の第1の復号器908a及び第2の復号器908bに対応する。
(Third embodiment)
FIG. 11 is a diagram illustrating a configuration example of a variable length decoding device according to the third embodiment. Hereinafter, the points of FIG. 11 different from FIG. 9 will be described. The sub-bit connection part 905 corresponds to the first sub-bit connection part 905a and the second sub-bit connection part 905b in FIG. The sub-shifter 906 corresponds to the first sub-shifter 906a and the second sub-shifter 906b in FIG. The decoder 908 corresponds to the first decoder 908a and the second decoder 908b in FIG.

サブビット連接部905は、メインバッファ904内の符号列とセレクタ1102により出力される所定の符号列とを連接する。サブシフタ906は、サブビット連接部905により連接された符号列を所定の符号長lenだけシフトする。第1のサブバッファ907aは、サブシフタ906によりシフトされた24ビットの符号列を2系統の符号列に分割し、前半12ビットのA系統の符号列をバッファリングする。第2のサブバッファ907bは、サブシフタ906によりシフトされた24ビットの符号列を2系統の符号列に分割し、後半12ビットのB系統の符号列をバッファリングする。セレクタ1101は、第1のサブバッファ907aの符号列と第2のサブバッファ907bの符号列を交互に選択し、復号器908に出力する。復号器908は、セレクタ1101により出力される符号列を入力し、第1のサブバッファ907aの符号と第2のサブバッファ907bの符号とを交互に復号し、復号したシンボルをシンボルバッファ910に出力し、復号した符号の符号長lenをサブシフタ906及びメインシフタ903に出力する。   The sub-bit connection unit 905 connects the code string in the main buffer 904 and the predetermined code string output from the selector 1102. The sub shifter 906 shifts the code string concatenated by the sub bit concatenation unit 905 by a predetermined code length len. The first sub-buffer 907a divides the 24-bit code string shifted by the sub-shifter 906 into two code strings, and buffers the first-half 12-bit A-system code string. The second sub-buffer 907b divides the 24-bit code string shifted by the sub-shifter 906 into two code strings, and buffers the latter 12-bit B code string. The selector 1101 alternately selects the code string of the first sub-buffer 907a and the code string of the second sub-buffer 907b and outputs the selected code string to the decoder 908. Decoder 908 receives the code string output from selector 1101, decodes the code of first subbuffer 907 a and the code of second subbuffer 907 b alternately, and outputs the decoded symbol to symbol buffer 910. Then, the code length len of the decoded code is output to the sub-shifter 906 and the main shifter 903.

セレクタ1102は、第1のサブバッファ907a内の符号列の中で復号器908により復号されなかった残りの符号列と、第2のサブバッファ907b内の符号列の中で復号器908により復号されなかった残りの符号列とを交互に選択し、サブビット連接部905に出力する。サブビット連接部905は、メインバッファ904内の符号列と、セレクタ1102により出力されるサブバッファ907a及び907b内の符号列の中で復号器908により復号されなかった残りの符号列とを連接する。メインシフタ903は、メインビット連接部902により連接された符号列を、復号器908により復号された前回の符号の符号長lenだけシフトする。サブシフタ906は、サブビット連接部905により連接された符号列を、復号器908により復号された前回の符号の符号長lenだけシフトする。   The selector 1102 is decoded by the decoder 908 among the remaining code strings that have not been decoded by the decoder 908 in the code string in the first sub-buffer 907a and the code string in the second sub-buffer 907b. The remaining code strings that have not been selected are alternately selected and output to the sub-bit connection unit 905. The sub-bit concatenation unit 905 concatenates the code string in the main buffer 904 and the remaining code string that has not been decoded by the decoder 908 among the code strings in the sub-buffers 907 a and 907 b output from the selector 1102. The main shifter 903 shifts the code string concatenated by the main bit concatenation unit 902 by the code length len of the previous code decoded by the decoder 908. The sub shifter 906 shifts the code string concatenated by the sub bit concatenation unit 905 by the code length len of the previous code decoded by the decoder 908.

本実施形態の可変長復号装置は、2系統の結合済符号列を単体の復号器908で復号する例を示す。本実施形態は、サブバッファ907a及び907bの出力端子に接続されるセレクタ1101及び1102の選択を毎サイクル交互に切り替える。回路規模が大きい復号器908及びサブシフタ906がそれぞれ1個ずつに統合されたことによって、回路規模削減に繋がる。本実施形態では、任意の並列度による並列復号化が可能であり、さらには同じ結合済符号列を最大並列度以下で任意の復号並列度に変更することが可能である。   The variable length decoding apparatus of this embodiment shows an example in which two combined code strings are decoded by a single decoder 908. In the present embodiment, selection of the selectors 1101 and 1102 connected to the output terminals of the sub-buffers 907a and 907b is alternately switched every cycle. Integration of one decoder 908 and one sub-shifter 906 having a large circuit scale leads to a reduction in circuit scale. In the present embodiment, parallel decoding with an arbitrary degree of parallelism is possible, and the same combined code string can be changed to an arbitrary degree of decoding parallelism with a maximum parallelism or less.

(第4の実施形態)
図12は、第4の実施形態による可変長符号化装置の構成例を示す図であり、図7に対して、C系統の符号化部及びD系統の符号化部を追加したものである。可変長符号化装置は、A系統の符号化部、B系統の符号化部、C系統の符号化部及びD系統の符号化部が並列に接続される。以下、図12が図7と異なる点を説明する。
(Fourth embodiment)
FIG. 12 is a diagram illustrating a configuration example of a variable-length encoding apparatus according to the fourth embodiment, in which a C system encoding unit and a D system encoding unit are added to FIG. 7. In the variable-length encoding apparatus, an A system encoding unit, a B system encoding unit, a C system encoding unit, and a D system encoding unit are connected in parallel. Hereinafter, the points of FIG. 12 different from FIG. 7 will be described.

C系統の符号化部は、図7と同様に、第3の符号化回路703c、セレクタ704c、第3の符号バッファ705c、セレクタ706c、第3の符号長FIFO707c及び第3の切り出し部708cを有する。D系統の符号化部は、図7と同様に、第4の符号化回路703d、セレクタ704d、第4の符号バッファ705d、セレクタ706d、第4の符号長FIFO707d及び第4の切り出し部708dを有する。分配器702は、シンボルバッファ701内のシンボルを4系統の符号化回路703a,703b,703c,703dに交互に分配する。第3の切り出し部708cは、切り出した符号列を結合器709に出力する。第4の切り出し部708dは、切り出した符号列を結合器709に出力する。結合器709は、4系統の切り出し部708a,708b,708c,708dの符号列を結合し、結合済符号バッファ711に出力する。結合済符号バッファ711には、4系統の符号列がインターリーブされた符号列が格納される。インターリーブは、複数系統(例えば4系統)の符号列を順番に交互に結合することを意味する。本実施形態によれば、2並列より高い並列度の符号化装置を構成することができる。   Similarly to FIG. 7, the C system encoding unit includes a third encoding circuit 703c, a selector 704c, a third code buffer 705c, a selector 706c, a third code length FIFO 707c, and a third cutout unit 708c. . Similarly to FIG. 7, the D-system encoding unit includes a fourth encoding circuit 703d, a selector 704d, a fourth code buffer 705d, a selector 706d, a fourth code length FIFO 707d, and a fourth clipping unit 708d. . The distributor 702 distributes the symbols in the symbol buffer 701 alternately to the four systems of encoding circuits 703a, 703b, 703c, and 703d. The third cutout unit 708c outputs the cutout code string to the combiner 709. The fourth cutout unit 708d outputs the cutout code string to the combiner 709. The combiner 709 combines the code strings of the four systems of the cutout units 708 a, 708 b, 708 c, and 708 d, and outputs them to the combined code buffer 711. The combined code buffer 711 stores a code string in which four systems of code strings are interleaved. Interleaving means that code strings of a plurality of systems (for example, 4 systems) are alternately coupled in order. According to the present embodiment, it is possible to configure an encoding device having a parallel degree higher than two parallels.

図13は、第4の実施形態による可変長復号装置の構成例を示す図であり、図9に対して、C系統の復号部911c及びD系統の復号部911dを追加したものである。可変長復号装置は、A系統の復号部911a、B系統の復号部911b、C系統の復号部911c及びD系統の復号部911dが並列に接続される。以下、図13が図9と異なる点を説明する。   FIG. 13 is a diagram illustrating a configuration example of a variable-length decoding device according to the fourth embodiment, in which a C-system decoding unit 911c and a D-system decoding unit 911d are added to FIG. In the variable length decoding device, a system A decoding unit 911a, a system B decoding unit 911b, a system C decoding unit 911c, and a system D decoding unit 911d are connected in parallel. Hereinafter, the points of FIG. 13 different from FIG. 9 will be described.

C系統の復号部911cは、復号部911a及び911bと同様に、第3のサブビット連接部905c、第3のサブシフタ906c、第3のサブバッファ907c及び第3の復号器908cを有する。D系統の復号部911dも、復号部911a及び911bと同様に、第4のサブビット連接部905d、第4のサブシフタ906d、第4のサブバッファ907d及び第4の復号器908dを有する。   Similarly to the decoding units 911a and 911b, the C-system decoding unit 911c includes a third sub-bit concatenation unit 905c, a third sub-shifter 906c, a third sub-buffer 907c, and a third decoder 908c. Similarly to the decoding units 911a and 911b, the D-system decoding unit 911d also includes a fourth sub-bit concatenating unit 905d, a fourth sub-shifter 906d, a fourth sub-buffer 907d, and a fourth decoder 908d.

メインシフタ903及びメインバッファ904は、系統数×最大符号長=4×12=48ビットの符号列を出力する。第1のサブシフタ906aは、48ビットの符号列のうちの先頭の最大符号長Nである12ビットを第1のサブバッファ907aに出力し、残りの3×N=3×12=36ビットの符号列を第2のサブビット連接部905bに出力する。第2のサブシフタ906bは、36ビットの符号列のうちの先頭の最大符号長Nである12ビットを第2のサブバッファ907bに出力し、残りの2×N=2×12=24ビットの符号列を第3のサブビット連接部905cに出力する。第3のサブシフタ906cは、24ビットの符号列のうちの先頭の最大符号長Nである12ビットを第3のサブバッファ907cに出力し、残りの1×N=1×12=12ビットの符号列を第4のサブビット連接部905dに出力する。   The main shifter 903 and the main buffer 904 output a code string of the number of systems × maximum code length = 4 × 12 = 48 bits. The first sub-shifter 906a outputs 12 bits, which is the maximum code length N at the beginning of the 48-bit code string, to the first sub-buffer 907a, and the remaining 3 × N = 3 × 12 = 36-bit code. The column is output to the second sub-bit connection 905b. The second sub-shifter 906b outputs 12 bits, which is the maximum code length N at the beginning of the 36-bit code string, to the second sub-buffer 907b, and the remaining 2 × N = 2 × 12 = 24-bit code. The column is output to the third sub-bit connection 905c. The third sub-shifter 906c outputs the 12 bits having the maximum code length N at the beginning of the 24-bit code string to the third sub-buffer 907c, and the remaining 1 × N = 1 × 12 = 12-bit code. The column is output to the fourth sub-bit connection 905d.

第3の復号器908cは、復号したシンボルdecCをシンボルバッファ911に出力し、復号した符号の符号長lenCを第3のサブシフタ906c及び加算器909に出力する。第4の復号器908dは、復号したシンボルdecDをシンボルバッファ911に出力し、復号した符号の符号長lenDを第4のサブシフタ906d及び加算器909に出力する。加算器909は、符号長lenA、lenB、lenC及びlenDを加算し、加算値lenA+lenB+lenC+lenDをメインシフタ903に出力する。メインシフタ903は、メインビット連接部902により連接された符号列を符号長lenA+lenB+lenC+lenDだけシフトする。シンボルバッファ911には、4系統のシンボルが格納される。   The third decoder 908c outputs the decoded symbol decC to the symbol buffer 911, and outputs the code length lenC of the decoded code to the third sub-shifter 906c and the adder 909. The fourth decoder 908d outputs the decoded symbol decD to the symbol buffer 911, and outputs the code length lenD of the decoded code to the fourth sub-shifter 906d and the adder 909. The adder 909 adds the code lengths lenA, lenB, lenC, and lenD, and outputs the added value lenA + lenB + lenC + lenD to the main shifter 903. The main shifter 903 shifts the code string connected by the main bit connecting unit 902 by the code length lenA + lenB + lenC + lenD. The symbol buffer 911 stores four types of symbols.

復号装置では、4系統のサブシフタ906a〜906dをカスケード接続するため遅延時間の若干の増加は発生するが、遅延時間が支配的な4系統の復号器908a〜908dは全て並列に接続されているため、遅延時間の大幅な増加は発生せず、高い並列度で低遅延な復号装置が構築可能である。   In the decoding device, the four sub-shifters 906a to 906d are cascade-connected, so that the delay time slightly increases. However, the four systems of decoders 908a to 908d whose delay time is dominant are all connected in parallel. Therefore, a significant increase in delay time does not occur, and a decoding device with high parallelism and low delay can be constructed.

(第5の実施形態)
図14は、第5の実施形態による可変長復号装置の構成例を示す図である。図14は、図9に対して、復号器908a及び908bの代わりにレンジデコーダ1401及び1401bを設け、逆二値化部1402を追加したものである。以下、図14が図9と異なる点を説明する。
(Fifth embodiment)
FIG. 14 is a diagram illustrating a configuration example of a variable length decoding device according to the fifth embodiment. FIG. 14 is different from FIG. 9 in that range decoders 1401 and 1401b are provided instead of the decoders 908a and 908b, and an inverse binarization unit 1402 is added. Hereinafter, the points of FIG. 14 different from FIG. 9 will be described.

本実施形態は、ハフマン符号化に限らず、幅広い可変長符号化に適用可能であり、その一例として並列度を2とし、各系統の符号化方法として算術符号の一種であるレンジコーダ(レンジ幅16ビット)を用いた場合の可変長復号装置の構成例を示す。可変長符号化装置の構成は図7と同様である。レンジデコーダ1401a及び1401bは、それぞれ、復号したデータを逆二値化部1402に出力する。逆二値化部1402は、二値化データを逆二値化することによりシンボルを生成し、シンタックスエレメントバッファ910に出力する。   This embodiment is applicable not only to Huffman coding but also to a wide range of variable length coding. As an example, the parallelism is set to 2, and a range coder (range width) which is a kind of arithmetic code is used as a coding method for each system. 16 shows an example of the configuration of a variable length decoding device using 16 bits). The configuration of the variable length coding apparatus is the same as that in FIG. Range decoders 1401a and 1401b output the decoded data to inverse binarization section 1402, respectively. The inverse binarization unit 1402 generates a symbol by inverse binarizing the binarized data and outputs the symbol to the syntax element buffer 910.

図15(A)は、図7の可変長符号化装置の符号化回路(レンジエンコーダ)703a,703bの符号化(エンコード)処理例を示すフローチャートである。ステップS1501では、レンジエンコーダ703a,703bは、初期化処理を行う。次に、ステップS1502では、レンジエンコーダ703a,703bは、1ビット処理を行う。その詳細は、後に図15(B)を参照しながら説明する。次に、ステップS1503では、レンジエンコーダ703a,703bは、全ビットの処理が完了したか否かをチェックする。完了していなければステップS1502に戻り、完了していればステップS1504へ進む。ステップS1504では、レンジエンコーダ703a,703bは、最終処理として、残余ビットを出力する。   FIG. 15A is a flowchart showing an example of encoding processing of the encoding circuits (range encoders) 703a and 703b of the variable length encoding device of FIG. In step S1501, the range encoders 703a and 703b perform initialization processing. Next, in step S1502, the range encoders 703a and 703b perform 1-bit processing. Details thereof will be described later with reference to FIG. In step S1503, the range encoders 703a and 703b check whether all bits have been processed. If not completed, the process returns to step S1502, and if completed, the process proceeds to step S1504. In step S1504, range encoders 703a and 703b output residual bits as final processing.

図15(B)は、図15(A)のステップS1502の1ビット処理の処理例を示すフローチャートである。ステップS1511では、レンジエンコーダ703a,703bは、レンジ(Range)及びロー(Low)の更新処理を行う。次に、ステップS1512では、レンジエンコーダ703a,703bは、引き伸ばしの必要があるか否かをチェックする。必要がある場合にはステップS1513に進み、必要がない場合には処理を終了する。ステップS1513では、レンジエンコーダ703a,703bは、引き伸ばし処理を行い、ビット出力を行う。   FIG. 15B is a flowchart illustrating a processing example of the 1-bit processing in step S1502 of FIG. In step S1511, the range encoders 703a and 703b perform a range update process and a low update process. Next, in step S1512, the range encoders 703a and 703b check whether enlargement is necessary. If necessary, the process proceeds to step S1513. If not necessary, the process ends. In step S1513, the range encoders 703a and 703b perform enlargement processing and perform bit output.

図16(A)は、図14の可変長復号装置のレンジデコーダ1401a,1401bの復号(デコード)処理例を示すフローチャートである。ステップS1601では、レンジデコーダ1401a,1401bは、初期化処理を行い、ビット取り込みを行う。次に、ステップS1602では、レンジデコーダ1401a,1401bは、1ビット処理を行う。その詳細は、後に図16(B)を参照しながら説明する。次に、ステップS1603では、レンジデコーダ1401a,1401bは、全ビットの処理が完了したか否かをチェックする。完了していなければステップS1602に戻り、完了していれば処理を終了する。   FIG. 16A is a flowchart showing an example of the decoding process of the range decoders 1401a and 1401b of the variable length decoding device of FIG. In step S1601, the range decoders 1401a and 1401b perform initialization processing and take in bits. Next, in step S1602, the range decoders 1401a and 1401b perform 1-bit processing. Details thereof will be described later with reference to FIG. In step S1603, the range decoders 1401a and 1401b check whether all bits have been processed. If not completed, the process returns to step S1602, and if completed, the process ends.

図16(B)は、図16(A)のステップS1602の1ビット処理の処理例を示すフローチャートである。ステップS1611では、レンジデコーダ1401a,1401bは、レンジ(Range)及びロー(Low)の更新処理を行う。次に、ステップS1612では、レンジデコーダ1401a,1401bは、引き伸ばしの必要があるか否かをチェックする。必要がある場合にはステップS1613に進み、必要がない場合には処理を終了する。ステップS1613では、レンジデコーダ1401a,1401bは、引き伸ばし処理を行い、ビット取り込みを行う。   FIG. 16B is a flowchart illustrating a processing example of 1-bit processing in step S1602 of FIG. In step S1611, the range decoders 1401a and 1401b perform a range update process and a low update process. In step S1612, the range decoders 1401a and 1401b check whether enlargement is necessary. If necessary, the process proceeds to step S1613. If not necessary, the process ends. In step S <b> 1613, the range decoders 1401 a and 1401 b perform enlargement processing and take in bits.

ここで、2つのレンジエンコーダ703a及び703bにおける引き伸ばし処理のタイミングは、レンジエンコーダ703a及び703bでの符号化対象となるシンボル列によって規定されているものとする。例えば、動画圧縮規格H.264におけるCABAC(Context-based Adaptive Binary Arithmetic Coding)に類似した動画像符号化の例を考える。H.264における符号化では符号化処理前のデータは「シンタックスエレメント列」であるが、まずこれに二値化を施し、二値化の結果であるビット列に対してレンジエンコーダ703a,703bを適用する。この例におけるH.264に類似した符号化においては、シンタックスエレメント列を二値化した後のビットを交互に振り分けることで2系統のシンボル列を形成する。符号化処理においてビットをレンジエンコーダ703a,703bで符号化する順序と、デコード処理においてレンジデコーダ1401a,1401bからビットを取り出す順序は動画像符号化方式の文法と各シンタックスエレメントの二値化処理によってのみ規定され、符号化と復号における引き伸ばし処理のタイミングは同じビットにおいて発生する。よって、符号化処理中の引き伸ばし処理における出力ビットをハフマン符号における出力ビット、復号処理中の引き伸ばし処理における取り込みビットをハフマン符号における消費ビットとすれば、レンジエンコーダ703a,703b及びレンジデコーダ1401a,1401b以外の処理はハフマン符号における実施形態と等しくなる。   Here, it is assumed that the timing of the stretching process in the two range encoders 703a and 703b is defined by the symbol sequence to be encoded in the range encoders 703a and 703b. For example, consider an example of video encoding similar to CABAC (Context-based Adaptive Binary Arithmetic Coding) in the video compression standard H.264. In the encoding in H.264, the data before the encoding process is a “syntax element string”. First, binarization is performed on the data, and the range encoders 703a and 703b are applied to the bit string that is the result of the binarization. Apply. In encoding similar to H.264 in this example, two symbol strings are formed by alternately distributing the bits after binarizing the syntax element string. The order in which the bits are encoded by the range encoders 703a and 703b in the encoding process and the order in which the bits are extracted from the range decoders 1401a and 1401b in the decoding process are determined by the grammar of the moving image encoding method and the binarization process of each syntax element. Only the timing of the stretching process in encoding and decoding occurs in the same bit. Therefore, if the output bits in the expansion process during the encoding process are the output bits in the Huffman code and the fetch bits in the expansion process during the decoding process are the consumption bits in the Huffman code, other than the range encoders 703a and 703b and the range decoders 1401a and 1401b This processing is equivalent to the embodiment in the Huffman code.

図17は、可変長符号化装置1701及び可変長復号装置1702を用いた動画像符号化装置1705の構成例を示す図である。可変長符号化装置1701は第1〜第5の実施形態の可変長符号化装置であり、可変長復号装置1702は第1〜第5の実施形態の可変長復号装置である。   FIG. 17 is a diagram illustrating a configuration example of a moving image encoding device 1705 using the variable length encoding device 1701 and the variable length decoding device 1702. A variable length encoding device 1701 is the variable length encoding device of the first to fifth embodiments, and a variable length decoding device 1702 is the variable length decoding device of the first to fifth embodiments.

第1〜第5の実施形態の可変長符号化装置及び可変長復号装置の適用範囲は特に限定されず、画像の符号化から無線パケット伝送など幅広い形態が考えられるが、特にリアルタイムの復号処理が要求されるシステムに適用することが望ましい。図17には、動画像可変長符号化装置1705におけるバッファ1704のメモリ帯域削減を想定したシステム図である。撮像装置1703は、撮像した動画像をローカルデコード画像格納バッファ(DRAM)1704を介して動画像符号化装置1705に出力する。H.264やMPEG−2に代表される動画像可変長符号化装置1705は、時間的に近接する画像同士の相関性を利用したフレーム間予測(画面間予測)を行う画面間予測部1707と、隣接する画素同士の相関性を利用したフレーム内予測(画面内予測、イントラ予測)を行う画面内予測部1707とをスイッチ1712の選択によって動画像を圧縮している。画面内予測では、時間的に近い位置にあるフレームから、圧縮対象ブロック(マクロブロック)の動き情報を予測して圧縮し、符号の復号の際には動き情報を基に、予測元の参照領域を読み出して復号に使用する。既に符号化されたピクチャとの相関性を利用する画面間予測を行うためには、一度符号化した過去の画像を内部で複号する必要がある。ローカルデコード画像生成部1710でローカルデコードされた画像は非圧縮の状態であり、その状態を保ったままバッファ1704へアクセスすると、帯域圧迫の原因となってしまう。そのため、バッファ1704へ書き込む際に符号化装置1701がローカルデコード画像を符号化してバッファ1704に書き込み、復号装置1702がバッファ1704から符号を読み出して復号することによってバッファ1704のメモリ帯域を削減することができる。ここで、符号化装置1701及び復号装置1702の処理速度が遅いと、バッファ1704から読み出すレイテンシが増加してしまうため、フレームレートに対して処理時間が超過してしまい、処理が破綻する可能性が存在するため、符号化装置1701及び復号装置1702の処理には高いリアルタイム性と並列度の保障が要求される。第1〜第5の実施形態は並列度を任意に設定でき、かつ必ず並列度を保った復号処理が実現できるため、システムの要求性能に対して柔軟に並列度を設定でき、このような構成においても適用可能である。例えば、バッファ1704のデータビット幅を64ビットとし、1画素のビット深度を8ビットとすると、符号化装置1701及び復号装置1702を8並列構成にすることによって、バッファ1704のアクセスのレイテンシは可変長復号装置1702のサブバッファ及びメインバッファへの格納に必要な数サイクル程度となり、実質的に符号化及び復号処理による処理時間の増大を抑制することが可能である。   The range of application of the variable-length encoding devices and variable-length decoding devices of the first to fifth embodiments is not particularly limited, and a wide variety of modes such as image encoding to wireless packet transmission can be considered. It should be applied to the required system. FIG. 17 is a system diagram assuming reduction of the memory bandwidth of the buffer 1704 in the moving image variable length encoding device 1705. The imaging device 1703 outputs the captured moving image to the moving image encoding device 1705 via the local decoded image storage buffer (DRAM) 1704. A moving image variable length encoding device 1705 typified by H.264 and MPEG-2 includes an inter-screen prediction unit 1707 that performs inter-frame prediction (inter-screen prediction) using the correlation between temporally adjacent images. The video image is compressed by selecting the switch 1712 with the intra-frame prediction unit 1707 that performs intra-frame prediction (intra-screen prediction, intra prediction) using the correlation between adjacent pixels. In intra-screen prediction, motion information of a compression target block (macroblock) is predicted and compressed from a frame that is close in time, and the reference area of the prediction source is based on the motion information when decoding a code. Is used for decoding. In order to perform inter-screen prediction using the correlation with an already encoded picture, it is necessary to internally decode a past image once encoded. An image locally decoded by the local decoded image generation unit 1710 is in an uncompressed state, and if the buffer 1704 is accessed while the state is maintained, band compression will be caused. Therefore, when writing to the buffer 1704, the encoding device 1701 encodes the local decoded image and writes it to the buffer 1704, and the decoding device 1702 reads and decodes the code from the buffer 1704, thereby reducing the memory bandwidth of the buffer 1704. it can. Here, if the processing speeds of the encoding device 1701 and the decoding device 1702 are slow, the latency read from the buffer 1704 increases, so that the processing time may exceed the frame rate and the processing may fail. Therefore, the processing of the encoding device 1701 and the decoding device 1702 requires high real-time property and guarantee of parallelism. In the first to fifth embodiments, the degree of parallelism can be arbitrarily set, and a decoding process that always maintains the degree of parallelism can be realized, so the degree of parallelism can be set flexibly with respect to the required performance of the system. It is also applicable to. For example, when the data bit width of the buffer 1704 is 64 bits and the bit depth of one pixel is 8 bits, the access latency of the buffer 1704 is variable length by configuring the encoding device 1701 and the decoding device 1702 in 8 parallel configurations. The number of cycles required for storage in the sub-buffer and main buffer of the decoding device 1702 is about several cycles, and it is possible to substantially suppress an increase in processing time due to encoding and decoding processing.

復号装置1702は、参照領域格納バッファ1708を介して、復号した画像を画面間予測部1707に出力する。DCT量子化部1709は、画面内予測部1706又は画面間予測部1707により圧縮されたデータに対して、DCT(離散コサイン変換:Discrete Cosine Transform)及び量子化を行い、符号化部1711に出力する。符号化部1711は、符号化により符号を生成してバッファ1704に書き込む。   The decoding device 1702 outputs the decoded image to the inter-screen prediction unit 1707 via the reference area storage buffer 1708. The DCT quantization unit 1709 performs DCT (Discrete Cosine Transform) and quantization on the data compressed by the intra-screen prediction unit 1706 or the inter-screen prediction unit 1707, and outputs the result to the encoding unit 1711. . The encoding unit 1711 generates a code by encoding and writes the code in the buffer 1704.

第1〜第5の実施形態によれば、2以上の並列度に対して回路規模の増大は並列度に対して比例関係で収まり、かつ並列度を上げても必ず1サイクルで並列度分の復号が保障されるので、小面積、低遅延かつ高速な符号化装置及び復号装置を提供することができる。また、符号化装置及び復号装置は、SoC(システムオンチップ:System On Chip)におけるメモリ帯域削減や、無線通信における伝送路のトラフィック削減のために、符号化及び復号することが有用であり、特に復号処理を高速化することができる。   According to the first to fifth embodiments, the increase in circuit scale is proportional to the degree of parallelism for two or more degrees of parallelism, and even if the degree of parallelism is increased, the degree of parallelism is always increased in one cycle. Since decoding is ensured, a small area, low delay and high-speed encoding device and decoding device can be provided. In addition, the encoding device and the decoding device are useful for encoding and decoding in order to reduce the memory bandwidth in SoC (System On Chip) and the traffic in the transmission path in wireless communication. The decoding process can be speeded up.

なお、上記実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。   The above-described embodiments are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed in a limited manner. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.

701 シンボルバッファ
702 分配器
703a,703b 符号化回路
704a,704b セレクタ
705a,705b セレクタ
706a,706b セレクタ
707a,707b 符号長FIFO
708a,708b 切り出し部
709 結合器
710 セレクタ
711 結合済符号バッファ
901 結合済符号バッファ
902 メインビット連接部
903 メインシフタ
904 メインバッファ
905a,905b サブビット連接部
906a,906b サブシフタ
907a,907b サブバッファ
908a,908b 復号器
909 加算器
910 シンボルバッファ
701 Symbol buffer 702 Distributor 703a, 703b Encoding circuit 704a, 704b Selector 705a, 705b Selector 706a, 706b Selector 707a, 707b Code length FIFO
708a, 708b Cutout unit 709 Combiner 710 Selector 711 Combined code buffer 901 Combined code buffer 902 Main bit concatenation unit 903 Main shifter 904 Main buffer 905a, 905b Subbit concatenation unit 906a, 906b Sub shifter 907a, 907b Subbuffer 908a, 908b Decoding 909 Adder 910 Symbol buffer

Claims (5)

複数のデータ列をそれぞれ符号化する複数の符号化回路と、
前記複数の符号化回路により符号化された符号をそれぞれバッファリングする複数の符号バッファと、
前記複数の符号化回路により符号化された前回の符号のそれぞれの符号長で、前記複数の符号バッファ内の符号列をそれぞれ切り出す複数の切り出し部と、
前記複数の切り出し部により切り出された複数の符号列をインターリーブさせながら結合する結合器と
を有することを特徴とする可変長符号化装置。
A plurality of encoding circuits that respectively encode a plurality of data strings;
A plurality of code buffers respectively buffering codes encoded by the plurality of encoding circuits;
A plurality of cut-out units that respectively cut out code strings in the plurality of code buffers at respective code lengths of the previous code encoded by the plurality of encoding circuits;
A variable-length coding apparatus comprising: a combiner that combines a plurality of code strings cut out by the plurality of cut-out units while interleaving them.
前記複数の切り出し部は、最初、前記複数の符号化回路により符号化される符号の中のそれぞれの最大の符号長で、前記複数の符号バッファ内の符号列をそれぞれ切り出すことを特徴とする請求項1記載の可変長符号化装置。   The plurality of cut-out units initially cut out code strings in the plurality of code buffers, respectively, with a maximum code length of codes encoded by the plurality of encoding circuits. Item 2. The variable length encoding device according to Item 1. 複数の符号列がインターリーブされた符号列をバッファリングするメインバッファと、
前記メインバッファ内の符号列と所定の符号列とを連接するサブビット連接部と、
前記サブビット連接部により連接された符号列を所定の符号長だけシフトするサブシフタと、
前記サブシフタによりシフトされた符号列を複数の符号列に分割してバッファリングする複数のサブバッファと、
前記複数のサブバッファによりバッファリングされた複数の符号を復号する復号器とを有し、
前記サブビット連接部は、前記メインバッファ内の符号列と、前記複数のサブバッファ内の符号列の中で前記復号器により復号されなかった残りの符号列とを連接し、
前記サブシフタは、前記復号器により復号された前回の符号の符号長だけシフトすることを特徴とする可変長復号装置。
A main buffer for buffering a code string in which a plurality of code strings are interleaved;
A sub-bit concatenation unit that concatenates a code string in the main buffer and a predetermined code string;
A sub-shifter that shifts a code string concatenated by the sub-bit concatenation unit by a predetermined code length;
A plurality of sub-buffers for dividing and buffering the code string shifted by the sub-shifter into a plurality of code strings;
A decoder for decoding a plurality of codes buffered by the plurality of sub-buffers,
The sub-bit concatenation unit concatenates the code string in the main buffer and the remaining code strings that have not been decoded by the decoder in the code strings in the plurality of sub-buffers,
The variable length decoding device, wherein the sub-shifter shifts by a code length of a previous code decoded by the decoder.
さらに、複数の符号列がインターリーブされた符号列と所定の符号列とを連接するメインビット連接部と、
前記メインビット連接部により連接された符号列を所定の符号長だけシフトするメインシフタとを有し、
前記メインビット連接部は、複数の符号列がインターリーブされた符号列と、前記複数のメインバッファ内の符号列の中で前記サブビット連接部に出力されなかった残りの符号列とを連接し、
前記メインシフタは、前記復号器により復号された前回の符号の符号長だけシフトすることを特徴とする請求項3記載の可変長復号装置。
Furthermore, a main bit concatenation unit that concatenates a predetermined code string and a code string interleaved with a plurality of code strings,
A main shifter that shifts a code string connected by the main bit connecting portion by a predetermined code length;
The main bit concatenation unit concatenates a code string in which a plurality of code strings are interleaved and a remaining code string that is not output to the sub-bit concatenation part among the code strings in the plurality of main buffers,
4. The variable length decoding apparatus according to claim 3, wherein the main shifter shifts by a code length of a previous code decoded by the decoder.
前記サブビット連接部は、第1のサブビット連接部及び第2のサブビット連接部を有し、
前記サブシフタは、第1のサブシフタ及び第2のサブシフタを有し、
前記複数のサブバッファは、第1のサブバッファ及び第2のサブバッファを有し、
前記復号器は、第1の復号器及び第2の復号器を有し、
前記第1のサブビット連接部は、前記メインバッファ内の符号列と所定の符号列とを連接し、
前記第1のサブシフタは、前記第1のサブビット連接部により連接された符号列を所定の符号長だけシフトし、
前記第1のサブバッファは、前記第1のサブシフタによりシフトされた符号列が分割された一部の符号列をバッファリングし、
前記第1の復号器は、前記第1のサブバッファによりバッファリングされた符号を復号し、
前記第1のサブビット連接部は、前記メインバッファ内の符号列と、前記第1のサブバッファ内の符号列の中で前記第1の復号器により復号されなかった残りの符号列とを連接し、
前記第1のサブシフタは、前記第1の復号器により復号された前回の符号の符号長だけシフトし、
前記第2のサブビット連接部は、前記第1のサブシフタによりシフトされた符号列が分割された他の符号列と、所定の符号列とを連接し、
前記第2のサブシフタは、前記第2のサブビット連接部により連接された符号列を所定の符号長だけシフトし、
前記第2のサブバッファは、前記第2のサブシフタによりシフトされた符号列をバッファリングし、
前記第2の復号器は、前記第2のサブバッファによりバッファリングされた符号を復号し、
前記第2のサブビット連接部は、前記第1のサブシフタによりシフトされた符号列が分割された他の符号列と、前記第2のサブバッファ内の符号列の中で前記第2の復号器により復号されなかった残りの符号列とを連接し、
前記第2のサブシフタは、前記第2の復号器により復号された前回の符号の符号長だけシフトすることを特徴とする請求項3又は4記載の可変長復号装置。
The sub-bit connection part has a first sub-bit connection part and a second sub-bit connection part,
The sub-shifter includes a first sub-shifter and a second sub-shifter,
The plurality of sub-buffers include a first sub-buffer and a second sub-buffer,
The decoder comprises a first decoder and a second decoder;
The first sub-bit concatenation unit concatenates a code string in the main buffer and a predetermined code string,
The first sub-shifter shifts a code string concatenated by the first sub-bit concatenation unit by a predetermined code length,
The first sub-buffer buffers a partial code string obtained by dividing the code string shifted by the first sub-shifter,
The first decoder decodes the code buffered by the first sub-buffer;
The first sub-bit concatenation unit concatenates the code string in the main buffer and the remaining code string not decoded by the first decoder in the code string in the first sub-buffer. ,
The first sub-shifter shifts by the code length of the previous code decoded by the first decoder;
The second sub-bit concatenation unit concatenates a predetermined code string and another code string obtained by dividing the code string shifted by the first sub-shifter,
The second sub-shifter shifts a code string concatenated by the second sub-bit concatenation unit by a predetermined code length,
The second sub-buffer buffers the code string shifted by the second sub-shifter;
The second decoder decodes the code buffered by the second sub-buffer;
The second sub-bit concatenation unit includes another code string obtained by dividing the code string shifted by the first sub-shifter, and the second decoder in the code string in the second sub-buffer. Concatenating the remaining code sequences that were not decoded,
5. The variable length decoding device according to claim 3, wherein the second sub-shifter shifts by a code length of a previous code decoded by the second decoder.
JP2011240345A 2011-11-01 2011-11-01 Variable length coding apparatus and variable length decoding apparatus Expired - Fee Related JP5811775B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011240345A JP5811775B2 (en) 2011-11-01 2011-11-01 Variable length coding apparatus and variable length decoding apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011240345A JP5811775B2 (en) 2011-11-01 2011-11-01 Variable length coding apparatus and variable length decoding apparatus

Publications (2)

Publication Number Publication Date
JP2013098780A true JP2013098780A (en) 2013-05-20
JP5811775B2 JP5811775B2 (en) 2015-11-11

Family

ID=48620287

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011240345A Expired - Fee Related JP5811775B2 (en) 2011-11-01 2011-11-01 Variable length coding apparatus and variable length decoding apparatus

Country Status (1)

Country Link
JP (1) JP5811775B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109937537A (en) * 2016-11-18 2019-06-25 国际商业机器公司 Coding Variable length symbol is to realize parallel decoding

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0514212A (en) * 1991-06-28 1993-01-22 Nec Corp Variable length encoding circuit
JPH05300486A (en) * 1992-04-20 1993-11-12 Nec Corp Variable length encoding and decoding circuit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0514212A (en) * 1991-06-28 1993-01-22 Nec Corp Variable length encoding circuit
JPH05300486A (en) * 1992-04-20 1993-11-12 Nec Corp Variable length encoding and decoding circuit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109937537A (en) * 2016-11-18 2019-06-25 国际商业机器公司 Coding Variable length symbol is to realize parallel decoding
CN109937537B (en) * 2016-11-18 2023-05-30 国际商业机器公司 Encoding variable length symbols to enable parallel decoding

Also Published As

Publication number Publication date
JP5811775B2 (en) 2015-11-11

Similar Documents

Publication Publication Date Title
CN101924945B (en) Video decoder with scalable compression and buffer for storing and retrieving reference frame data
TWI753214B (en) Encoder/decoder allowing parallel processing, transport demultiplexer, system, storage medium, method and computer program
KR0180169B1 (en) A variable length coder
KR970002483B1 (en) A high speed variable length decoder
JP4825644B2 (en) Image decoding apparatus, image encoding apparatus, and system LSI
JP2016187194A (en) Sample array coding for low delay
US9020284B2 (en) Image encoding apparatus
KR0154010B1 (en) Variable length decoder
JP5811775B2 (en) Variable length coding apparatus and variable length decoding apparatus
US8767838B1 (en) Cascading multiple video transcoders in a video processing system
JP3238571B2 (en) Variable length decoding device
US7439886B2 (en) Variable-length decoder, video decoder and image display system having the same, and variable-length decoding method
JP6614935B2 (en) Video encoding apparatus and program
WO2011148887A1 (en) Video image delivery system, video image transmission device, video image delivery method, and video image delivery program
US9591319B2 (en) Video encoder
KR0180164B1 (en) A variable length decoder
JP2007259323A (en) Image decoding apparatus
KR20030089222A (en) Programmable variable length decoder including interface of CPU processor
CN114073009A (en) Features of range asymmetric digital system encoding and decoding
US8421655B2 (en) Apparatus for parallel entropy encoding and decoding
TWI652933B (en) Video processing system using low cost video encoding/decoding architecture
WO2013114826A1 (en) Image decoding device
WO2023174407A1 (en) Encoding and decoding methods and apparatuses, and devices therefor
JPH1127662A (en) Image coder
CN111614963A (en) Visual lossless ultralow-delay video compression system based on FPGA

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140704

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150617

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150623

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150806

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150825

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150907

R150 Certificate of patent or registration of utility model

Ref document number: 5811775

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees