JP5742464B2 - Data processing apparatus and data processing method - Google Patents

Data processing apparatus and data processing method Download PDF

Info

Publication number
JP5742464B2
JP5742464B2 JP2011114413A JP2011114413A JP5742464B2 JP 5742464 B2 JP5742464 B2 JP 5742464B2 JP 2011114413 A JP2011114413 A JP 2011114413A JP 2011114413 A JP2011114413 A JP 2011114413A JP 5742464 B2 JP5742464 B2 JP 5742464B2
Authority
JP
Japan
Prior art keywords
encoded data
data
unit
distribution
code length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2011114413A
Other languages
Japanese (ja)
Other versions
JP2012244519A (en
Inventor
渡部 康弘
康弘 渡部
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2011114413A priority Critical patent/JP5742464B2/en
Publication of JP2012244519A publication Critical patent/JP2012244519A/en
Application granted granted Critical
Publication of JP5742464B2 publication Critical patent/JP5742464B2/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 Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

本発明は、データ処理装置、及びデータ処理方法に関する。   The present invention relates to a data processing apparatus and a data processing method.

可変長符号化は、固定符号長のデータをその発生頻度に応じた符号長の符号化データに変換し、平均符号長を短縮するデータ圧縮方法である。可変長符号化は、たとえば、画像データや音声データの圧縮に用いられる。たとえば、画像データを圧縮する場合、ラスタスキャン順に並んだ画素値データが、それぞれの発生頻度に応じた可変長の符号化データに変換される。そして、圧縮された画像データを展開するときには、個々の符号化データが順次復号される。復号処理では、符号化データが、もとの画素値データに変換される。   Variable-length coding is a data compression method that converts fixed-code-length data into coded data having a code length corresponding to the frequency of occurrence, and shortens the average code length. Variable length coding is used, for example, for compression of image data and audio data. For example, when compressing image data, pixel value data arranged in raster scan order is converted into encoded data of variable length according to the frequency of occurrence. When decompressing the compressed image data, the individual encoded data is sequentially decoded. In the decoding process, the encoded data is converted into the original pixel value data.

可変調符号化・復号を高速化するための方法の一つとして、復号処理の並列化が提案されている(たとえば、特許文献1〜3)。一例では、符号化時に符号化データを所定の単位で複数のに分割し、その分割単位ごとにユニークコードを挿入する。復号時には、ユニークコードを検出することにより、符号化時に分割されたデータを認識し、分割された単位で複数の復号回路に分配し、並列して復号処理が行われる。そして、系列ごとの復号データを連結することで、展開したデータが得られる。   As one of methods for speeding up the modulation / decoding, a parallel decoding process has been proposed (for example, Patent Documents 1 to 3). In one example, encoded data is divided into a plurality of predetermined units at the time of encoding, and a unique code is inserted for each divided unit. At the time of decoding, by detecting the unique code, the data divided at the time of encoding is recognized, distributed to a plurality of decoding circuits in divided units, and decoding processing is performed in parallel. Then, the expanded data is obtained by concatenating the decoded data for each series.

特開平01−209819号公報Japanese Unexamined Patent Publication No. 01-209819 特開平07−23397号公報Japanese Patent Laid-Open No. 07-23397 特開平11−341489号公報Japanese Patent Laid-Open No. 11-341489

可変長符号化における復号処理において、複数の復号回路に分配された系列毎の処理時間について考える。可変長符号化データの復号処理は、処理単位内に符号化されているデータ数や各符号化データの符号長によって、処理時間が異なる。処理単位内の符号化データ数や符号長が大きい系列ほど、処理時間が長くなり、その一方で、処理単位内の符号化データ数や符号長が小さい系列では、無駄な待ち時間が生じる。よって、復号処理全体としての処理時間は、合計の符号化データ数や符号長が大きい系列での処理時間に制約される。このように、復号処理を並列化したとしても、処理の高速化が制限されるという問題がある。   Consider processing time for each sequence distributed to a plurality of decoding circuits in decoding processing in variable length coding. The decoding process for variable-length encoded data differs in processing time depending on the number of data encoded in the processing unit and the code length of each encoded data. A sequence with a larger number of encoded data and code length within a processing unit has a longer processing time, while a sequence with a smaller number of encoded data and code length within a processing unit has a wasteful waiting time. Therefore, the processing time of the entire decoding process is limited to the processing time in a sequence having a large number of encoded data and a large code length. Thus, even if the decoding process is parallelized, there is a problem that the speeding up of the process is limited.

そこで、本発明の目的は、符号化データの並列化された復号処理をさらに高速化する、データ処理装置等を提供することにある。   SUMMARY OF THE INVENTION An object of the present invention is to provide a data processing apparatus and the like that further speeds up the parallel decoding processing of encoded data.

上記の目的を達成するための一態様におけるデータ処理装置は、符号化処理部においては、連続するN個(Nは複数)の可変長符号化された符号化データをそれぞれ累積するN個の累積部と、前記符号化データを前記N個の累積部のいずれかに、当該N個の累積部における前記符号化データの累積符号長の差が小さくなるように振り分ける振分部とを有する。   In the data processing device according to one aspect for achieving the above object, the encoding processing unit accumulates N (N is a plurality) continuous variable-length encoded data, each of which accumulates N pieces. And a distribution unit that distributes the encoded data to one of the N accumulation units so that a difference in the accumulated code length of the encoded data in the N accumulation units is small.

また、復号処理部においては、前記N個の累積部に累積された前記符号化データをそれぞれ並列して順次復号するN個の復号部と、前記N個の復号部によりそれぞれ復号されたN個の復号データを前記振分部による振分けに従ってもとの順序に並べ替える並替部とを有する。   In the decoding processing unit, N decoding units that sequentially decode the encoded data accumulated in the N accumulating units in parallel, and N decoding units respectively decoded by the N decoding units. A rearrangement unit that rearranges the decoded data in the original order according to the distribution by the distribution unit.

以下に説明する実施形態によれば、振り分けられた符号化データ系列の符号化データ数および符号長を略均等化でき、符号化データの並列化された復号処理をさらに高速化することができる。   According to the embodiment described below, the number of encoded data and the code length of the distributed encoded data series can be substantially equalized, and the parallelized decoding process of the encoded data can be further speeded up.

データ処理装置が適用される、画像処理装置の構成例を示す図である。It is a figure which shows the structural example of the image processing apparatus to which a data processing apparatus is applied. 画像圧縮展開部14の詳細な構成を示す図である。3 is a diagram illustrating a detailed configuration of an image compression / decompression unit 14. 可変長符号化部22の詳細な構成例を示す図である。3 is a diagram illustrating a detailed configuration example of a variable length encoding unit 22. FIG. 累積部VSFT_Aの詳細な構成例を示す図である。It is a figure which shows the detailed structural example of accumulation | storage part VSFT_A. 振分部30による振分けの具体例を示す図であるIt is a figure which shows the specific example of distribution by the distribution part 30. 可変長符号化部22の動作手順を説明するフローチャート図である。FIG. 6 is a flowchart for explaining an operation procedure of the variable length coding unit 22. 可変長復号部24の詳細な構成例を示す図である。3 is a diagram illustrating a detailed configuration example of a variable length decoding unit 24. FIG. 復号部VLD_Aの詳細な構成例を示す図である。It is a figure which shows the detailed structural example of the decoding part VLD_A. 並替部50による並べ替えを説明する図である。It is a figure explaining the rearrangement by the rearrangement part. 可変長復号部24の動作手順を説明するフローチャート図である。FIG. 10 is a flowchart illustrating an operation procedure of the variable length decoding unit 24. N=3の例における可変長符号化部22の構成を示す図である。It is a figure which shows the structure of the variable length encoding part 22 in the example of N = 3. 可変長符号化部22の動作手順を説明するフローチャート図である。FIG. 6 is a flowchart for explaining an operation procedure of the variable length coding unit 22. 可変長符号化部22の動作手順を説明するフローチャート図である。FIG. 6 is a flowchart for explaining an operation procedure of the variable length coding unit 22. N=3の例における可変長復号部24の構成を示す図である。It is a figure which shows the structure of the variable length decoding part 24 in the example of N = 3. 図14の可変長復号部24の動作手順を説明するフローチャート図であるIt is a flowchart figure explaining the operation | movement procedure of the variable-length decoding part 24 of FIG. 第2の実施形態における可変長符号化部22の構成例を示す図である。It is a figure which shows the structural example of the variable-length encoding part 22 in 2nd Embodiment. テーブル種別TBL0の例を示す図である。It is a figure which shows the example of table classification TBL0. 符号化データのビットパターンについて説明する図である。It is a figure explaining the bit pattern of coding data. 第2の実施形態における累積部VSFT_Aの詳細な構成例である。It is a detailed example of composition of accumulation part VSFT_A in a 2nd embodiment. 第2の実施形態における可変長符号化部22の動作手順を説明するフローチャート図である。It is a flowchart figure explaining the operation | movement procedure of the variable-length encoding part 22 in 2nd Embodiment. サブルーチンSR1のフローチャート図である。It is a flowchart figure of subroutine SR1. サブルーチンSR2のフローチャート図である。It is a flowchart figure of subroutine SR2. サブルーチンSR3のフローチャート図である。It is a flowchart figure of subroutine SR3. サブルーチンSR4のフローチャート図である。It is a flowchart figure of subroutine SR4. 第2の実施形態における可変長復号部24の構成例を示す図である。It is a figure which shows the structural example of the variable-length decoding part 24 in 2nd Embodiment. 第2の実施形態における復号部VLD_Aの詳細な構成例を示す図である。It is a figure which shows the detailed structural example of the decoding part VLD_A in 2nd Embodiment. 第2の実施形態における可変長復号24の動作手順を説明するフローチャート図である。It is a flowchart figure explaining the operation | movement procedure of the variable-length decoding 24 in 2nd Embodiment. サブルーチンSR11のフローチャート図である。It is a flowchart figure of subroutine SR11. サブルーチンSR12のフローチャート図である。It is a flowchart figure of subroutine SR12.

以下、図面にしたがって本発明の実施の形態について説明する。但し、適用される技術的範囲はこれらの実施の形態に限定されず、特許請求の範囲に記載された事項とその均等物まで及ぶものである。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the applied technical scope is not limited to these embodiments, but extends to the matters described in the claims and equivalents thereof.

図1は、データ処理装置が適用される、画像処理装置の構成例を示す。画像処理装置2は、画像入力、画像処理、及び画像出力の各処理を行う。画像処理装置2は、たとえば画像処理用のLSI(Large Scale Integration)である。入力される画像データは、たとえば、不図示の撮像装置から送られる、撮像画像の画素値データである。画像データは、たとえば、フレームや、フレームを分割した領域といった処理単位ごとに画像処理される。また、画像処理された画像データの出力先は、たとえば不図示の表示装置や記録装置などである。画像処理装置2は、画像処理の前後に、処理単位ごとの画像データを外部メモリ4に格納する。その際、画像圧縮展開部14が、画像データの圧縮・展開を行う。ここでは、画像圧縮展開部14に、データ処理装置が含まれる。なお、外部メモリ4は、たとえば、SDRAM(Synchronous Dynamic Random Access Memory)などの大容量のメモリである。   FIG. 1 shows a configuration example of an image processing apparatus to which a data processing apparatus is applied. The image processing apparatus 2 performs each process of image input, image processing, and image output. The image processing device 2 is, for example, an LSI (Large Scale Integration) for image processing. The input image data is, for example, pixel value data of a captured image sent from an imaging device (not shown). The image data is subjected to image processing for each processing unit such as a frame or an area obtained by dividing the frame. The output destination of the image data subjected to the image processing is, for example, a display device or a recording device (not shown). The image processing apparatus 2 stores image data for each processing unit in the external memory 4 before and after image processing. At that time, the image compression / decompression unit 14 compresses / decompresses the image data. Here, the image compression / decompression unit 14 includes a data processing device. The external memory 4 is a large-capacity memory such as an SDRAM (Synchronous Dynamic Random Access Memory).

画像処理装置2では、制御部6からの制御信号に応答して、画像入力部8、画像処理部10、画像出力部12、画像圧縮展開部14、及びメモリ制御部16が動作する。画像入力が行われるとき、画像入力部8は、外部から入力される画像データを画像圧縮展開部14に送る。画像圧縮展開部14は、画像データを圧縮してメモリ制御部16に送る。メモリ制御部16は、圧縮された画像データ(以下、圧縮画像データ)を外部メモリ4に格納する。次いで、画像処理が行われるとき、メモリ制御部16は、外部メモリ4から圧縮画像データを読み出し、画像圧縮展開部14に送る。画像圧縮展開部14は、圧縮画像データを展開し、画像処理部10に送る。画像処理部10は、展開された画像データに画像処理を行い、画像圧縮展開部14に送る。画像処理は、たとえば、輝度等の補正処理や色変換処理などである。画像圧縮展開部14は、画像処理された画像データを圧縮し、メモリ制御部16に送る。メモリ制御部16は、圧縮画像データを外部メモリ4に格納する。そして、画像出力が行われるとき、メモリ制御部16は、外部メモリ4から圧縮画像データを読み出し、画像圧縮展開部14に送る。画像圧縮展開部14は、圧縮画像データを展開し、画像出力部12に送る。画像出力部12は、展開された画像データを外部に出力する。   In the image processing apparatus 2, the image input unit 8, the image processing unit 10, the image output unit 12, the image compression / decompression unit 14, and the memory control unit 16 operate in response to a control signal from the control unit 6. When image input is performed, the image input unit 8 sends image data input from the outside to the image compression / decompression unit 14. The image compression / decompression unit 14 compresses the image data and sends it to the memory control unit 16. The memory control unit 16 stores the compressed image data (hereinafter, compressed image data) in the external memory 4. Next, when image processing is performed, the memory control unit 16 reads the compressed image data from the external memory 4 and sends it to the image compression / decompression unit 14. The image compression / decompression unit 14 decompresses the compressed image data and sends it to the image processing unit 10. The image processing unit 10 performs image processing on the developed image data and sends the processed image data to the image compression / decompression unit 14. The image processing is, for example, correction processing such as luminance or color conversion processing. The image compression / decompression unit 14 compresses the image data subjected to the image processing and sends the compressed image data to the memory control unit 16. The memory control unit 16 stores the compressed image data in the external memory 4. When image output is performed, the memory control unit 16 reads the compressed image data from the external memory 4 and sends the compressed image data to the image compression / decompression unit 14. The image compression / decompression unit 14 decompresses the compressed image data and sends it to the image output unit 12. The image output unit 12 outputs the developed image data to the outside.

図2は、画像圧縮展開部14の詳細な構成を示す。画像圧縮展開部14は、画像圧縮部18と、画像展開部19とを有する。   FIG. 2 shows a detailed configuration of the image compression / decompression unit 14. The image compression / decompression unit 14 includes an image compression unit 18 and an image expansion unit 19.

画像圧縮部18は、画素予測差分算出部20と可変長符号化部22を有する。画素予測差分算出部20は、入力される画像データから、連続する符号化対象データD_m(m=0、1、2、3、・・・)を生成する。入力される画像データは、ラスタスキャン順に連続した画素値データである。画素予測差分算出部20は、連続する画素における先行の画素の画素値から後続の画素の画素値を予測する。そして、画素予測差分算出部20は、後続の画素の予測値と実際の画素値との差分である画素予測差分を算出する。よって、ラスタスキャン順に連続した画素予測値差分が、連続する符号化対象データD_mとして生成される。なお、画素予測差分値に0が連続する場合には、連続する0値をまとめて符号化するランレングス符号化を用いて、符号化対象データ数を減らすことも可能である。例えば、画素予測差分として0が複数個続いていることを示すデータを一つの符号化対象データとすることで、画素予測差分(値は0)を複数個符号化するよりも、符号化データ数を削減することができる。次いで、可変長符号化部22は、連続する符号化対象データD_mを可変長符号化し、連続する符号化データE_mに変換する。個々の符号化対象データD_mは、その発生頻度に応じた符号長の符号化データE_mに変換される。連続する可変長符号化データE_mはビット列化され、圧縮画像データとしてメモリ制御部16に出力される。そして、圧縮画像データが、外部メモリ4に格納される。   The image compression unit 18 includes a pixel prediction difference calculation unit 20 and a variable length encoding unit 22. The pixel prediction difference calculation unit 20 generates continuous encoding target data D_m (m = 0, 1, 2, 3,...) From input image data. The input image data is pixel value data continuous in the raster scan order. The pixel prediction difference calculation unit 20 predicts the pixel value of the subsequent pixel from the pixel value of the previous pixel in consecutive pixels. Then, the pixel prediction difference calculation unit 20 calculates a pixel prediction difference that is a difference between the predicted value of the subsequent pixel and the actual pixel value. Therefore, pixel prediction value differences that are consecutive in the raster scan order are generated as continuous encoding target data D_m. In addition, when 0 continues to a pixel prediction difference value, it is also possible to reduce the number of encoding target data using run-length encoding that encodes consecutive 0 values together. For example, the number of encoded data is larger than encoding a plurality of pixel prediction differences (value is 0) by making data indicating that a plurality of pixel prediction differences are continued as one encoding target data. Can be reduced. Next, the variable length coding unit 22 performs variable length coding on the continuous encoding target data D_m and converts the data into continuous encoded data E_m. Individual encoding target data D_m is converted into encoded data E_m having a code length corresponding to the frequency of occurrence. The continuous variable length encoded data E_m is converted into a bit string and output to the memory control unit 16 as compressed image data. Then, the compressed image data is stored in the external memory 4.

画像展開部19は、可変長復号部24と画素予測補償部26を有する。可変長復号部24は、連続する符号化データE_mを取得して復号する。符号化データE_mは、ビット列化された状態で、メモリ制御部16により外部メモリ4から読み出される。可変長復号部24は、個々の符号化データE_mを、その符号長に応じた発生頻度を有する復号データF_mに復号する。ここで、復号される復号データF_mは、画素値予測差分データである。よって、ラスタスキャン順に連続する画素値予測差分データが、可変長復号部24から出力される。次いで、画素予測補償部26は、復号データF_mに基づき、画素ごとの画素値を算出する。ラスタスキャン順に連続する画素値データは、展開された画像データとして出力される。   The image development unit 19 includes a variable length decoding unit 24 and a pixel prediction compensation unit 26. The variable length decoding unit 24 acquires and decodes continuous encoded data E_m. The encoded data E_m is read from the external memory 4 by the memory control unit 16 in a state of being converted into a bit string. The variable length decoding unit 24 decodes each encoded data E_m into decoded data F_m having a frequency of occurrence according to the code length. Here, the decoded data F_m to be decoded is pixel value prediction difference data. Therefore, pixel value prediction difference data that is consecutive in the raster scan order is output from the variable length decoding unit 24. Next, the pixel prediction compensation unit 26 calculates a pixel value for each pixel based on the decoded data F_m. Pixel value data continuous in the raster scan order is output as expanded image data.

ここでは、可変長符号化部22と可変長復号部24が、データ処理装置に対応する例である。以下、可変長符号化部22と可変長復号部24の詳細について、第1、第2の実施形態に分けて説明する。   Here, the variable length coding unit 22 and the variable length decoding unit 24 are examples corresponding to the data processing device. Hereinafter, the details of the variable length encoding unit 22 and the variable length decoding unit 24 will be described separately for the first and second embodiments.

[第1の実施形態]
図3は、可変長符号化部22の詳細な構成例を示す。ここでは、可変長符号化部22は、2系列の復号処理用の符号化を行うための構成を有する。符号化テーブルTBL0_1、TBL0_2には、連続する符号化対象データD_nが、N個ずつ(図3では、N=2個ずつ)並列して入力される。たとえば、符号化対象データD_n(n=0、2、4、6、・・・)は符号化テーブルTBL0_1に、符号化対象データD_n+1は符号化テーブルTBL0_2に入力される。符号化テーブルTBL0_1、TBL0_2は、符号化対象データの値と、その発生頻度に応じた符号長の符号化データを対応付ける。ここでは、符号化テーブルTBL0_1、TBL0_2は、同じテーブルである。符号化テーブルTBL0_1、TBL0_2は、符号化対象データD_n、D_n+1がそれぞれ入力されると、対応する符号化データE_n、E_n+1をそれぞれ出力する。また、符号化テーブルTBL0_1、TBL0_2は、符号化データE_n、E_n+1の符号長L_n、L_n+1をそれぞれ出力する。符号長L_n、L_n+1は、比較部32に入力される。
[First Embodiment]
FIG. 3 shows a detailed configuration example of the variable length encoding unit 22. Here, the variable length coding unit 22 has a configuration for performing coding for two series of decoding processes. In the encoding tables TBL0_1 and TBL0_2, N pieces of continuous encoding target data D_n are input in parallel (N = 2 in FIG. 3) in parallel. For example, encoding target data D_n (n = 0, 2, 4, 6,...) Is input to the encoding table TBL0_1, and encoding target data D_n + 1 is input to the encoding table TBL0_2. The encoding tables TBL0_1 and TBL0_2 associate values of encoding target data with encoded data having a code length corresponding to the frequency of occurrence. Here, the encoding tables TBL0_1 and TBL0_2 are the same table. When the encoding target data D_n and D_n + 1 are input to the encoding tables TBL0_1 and TBL0_2, respectively, corresponding encoding data E_n and E_n + 1 are output. Also, the encoding tables TBL0_1 and TBL0_2 output the code lengths L_n and L_n + 1 of the encoded data E_n and E_n + 1, respectively. The code lengths L_n and L_n + 1 are input to the comparison unit 32.

振分部30は、符号化データE_n、E_n+1を、2個の累積部VSFT_A、VSFT_Bに、それぞれの累積符号長の差が小さくなるように振り分ける。振り分け部30の詳細については、後述する。累積部VSFT_A、VSFT_Bは、振分けられる符号化データE_n、またはE_n+1をそれぞれ累積する。累積部VSFT_A、VSFT_Bには、振分けられる符号化データE_n、またはE_n+1とともに、符号長L_n、またはL_n+1が入力される。累積部VSFT_A、VSFT_Bは、符号長L_n、またはL_n+1から、それぞれ累積する符号化データの累積符号長を算出する。符号化データE_n、またはE_n+1は、累積符号長が所定のビット長になるまで、各累積部に累積される。所定のビット長は、任意に設定されるビット長であり、たとえば32ビットである。累積された符号化データE_n、またはE_n+1からなる32ビット長の累積符号化データDt_A、Dt_Bは、それぞれ記憶部36a、36bに格納される。このとき、累積部VSFT_A、VSFT_Bは、記憶部36a、36bに、データ書込みを指示するライトイネーブル信号WEを出力する。記憶部36a、36bは、たとえば、フリップフロップ回路である。また、累積部VSFT_A、VSFT_Bは、算出した累積符号長Sum_A、Sum_Bを、比較部38に出力する。   The allocating unit 30 distributes the encoded data E_n and E_n + 1 to the two accumulating units VSFT_A and VSFT_B so that the difference between the accumulated code lengths becomes small. Details of the distribution unit 30 will be described later. Accumulating units VSFT_A and VSFT_B accumulate encoded data E_n or E_n + 1 to be distributed, respectively. The code length L_n or L_n + 1 is input to the accumulating units VSFT_A and VSFT_B together with the encoded data E_n or E_n + 1 to be distributed. The accumulating units VSFT_A and VSFT_B calculate the accumulated code length of the coded data accumulated from the code length L_n or L_n + 1, respectively. The encoded data E_n or E_n + 1 is accumulated in each accumulating unit until the accumulated code length reaches a predetermined bit length. The predetermined bit length is an arbitrarily set bit length, for example, 32 bits. Accumulated encoded data Dt_A and Dt_B of 32-bit length composed of accumulated encoded data E_n or E_n + 1 are stored in storage units 36a and 36b, respectively. At this time, the accumulation units VSFT_A and VSFT_B output the write enable signal WE instructing data writing to the storage units 36a and 36b. The storage units 36a and 36b are, for example, flip-flop circuits. Further, the accumulation units VSFT_A and VSFT_B output the calculated accumulation code lengths Sum_A and Sum_B to the comparison unit 38.

ここで、図4に、累積部VSFT_Aの詳細な構成例を示す。なお、累積部VSFT_Bも、同じ構成を有する。よって、次の説明は、累積部VSFT_Bにも適用される。   Here, FIG. 4 shows a detailed configuration example of the accumulating unit VSFT_A. Note that the accumulation unit VSFT_B also has the same configuration. Therefore, the following description is also applied to the accumulation unit VSFT_B.

各部の動作について、符号化データE_nとその符号長L_nが入力される場合を例として説明する。記憶部60は、図示しないクロックに同期して入力される符号化データE_nを一時的にラッチし、符号化データE_nを可変シフタ・連結部62に出力する。可変シフタ・連結部62は、記憶部64内のそれまでの累積符号化データDt_Aに、記憶部60内の符号化データE_nを、その時点での累積符号長Sum_1に応じてシフトして連結する。累積符号長Sum_1は、加算器68から入力される。こうして符号化データE_nが累積され、累積符号化データDt_Aが記憶部64に格納される。なお、記憶部60、64は、たとえばフリップフロップ回路である。   The operation of each unit will be described by taking as an example the case where encoded data E_n and its code length L_n are input. The storage unit 60 temporarily latches the encoded data E_n input in synchronization with a clock (not shown), and outputs the encoded data E_n to the variable shifter / connector 62. The variable shifter / concatenation unit 62 shifts the encoded data E_n in the storage unit 60 to the accumulated encoded data Dt_A so far in the storage unit 64 by shifting according to the accumulated code length Sum_1 at that time. . The accumulated code length Sum_1 is input from the adder 68. Thus, the encoded data E_n is accumulated, and the accumulated encoded data Dt_A is stored in the storage unit 64. Storage units 60 and 64 are, for example, flip-flop circuits.

一方、記憶部66は、記憶部60が符号化データE_nをラッチするタイミングと同期して、入力される符号長L_nをラッチし、加算器68に出力する。加算器68は、可変シフタ・連結部62におけるシフト量や記憶部36aに対する書込みイネーブル信号WEを生成するための回路である。加算器68は、記憶部70内のその時点での累積符号長Sum_1に、符号長L_nを加算する。こうして累計された累積符号長Sum_1は、可変シフタ・連結部62に入力され、また、記憶部70に格納される。累積符号長Sum_1は、32ビット長を示すたとえば5ビットのデータである。累積符号長Sum_1が32ビットを超えたことを示す繰り上げビットが、書込みイネーブル信号WEとして、記憶部36aに出力される。よって、累積符号長Sum_1が32ビットを超えたとき、書込みイネーブル信号WEは、書込みを許可する値「1」になる。これにより、記憶部64に格納される累積符号化データDt_Aは、累積符号長Sum_1が32ビットを超えたときに、記憶部36aに32ビット分格納される。なお、記憶部66、70は、たとえば、フリップフロップ回路である。   On the other hand, the storage unit 66 latches the input code length L_n in synchronization with the timing at which the storage unit 60 latches the encoded data E_n, and outputs it to the adder 68. The adder 68 is a circuit for generating a shift amount in the variable shifter / connector 62 and a write enable signal WE for the storage unit 36a. The adder 68 adds the code length L_n to the accumulated code length Sum_1 at that time in the storage unit 70. The accumulated code length Sum_1 thus accumulated is input to the variable shifter / concatenation unit 62 and stored in the storage unit 70. The accumulated code length Sum_1 is, for example, 5-bit data indicating a 32-bit length. A carry bit indicating that the accumulated code length Sum_1 exceeds 32 bits is output to the storage unit 36a as the write enable signal WE. Therefore, when the accumulated code length Sum_1 exceeds 32 bits, the write enable signal WE has a value “1” that permits writing. Thus, the cumulative encoded data Dt_A stored in the storage unit 64 is stored in the storage unit 36a for 32 bits when the cumulative code length Sum_1 exceeds 32 bits. Storage units 66 and 70 are, for example, flip-flop circuits.

また、加算器72は、記憶部74内のそれまでの累積符号長Sum_Aに、符号長L_nを加算する。記憶部74は、たとえば、フリップフロップ回路である。そして、累計された累積符号長Sum_Aは、比較部38に出力される。   The adder 72 adds the code length L_n to the accumulated code length Sum_A in the storage unit 74 so far. Storage unit 74 is, for example, a flip-flop circuit. The accumulated code length Sum_A is output to the comparison unit 38.

図3に戻る。振分部30は、符号化データE_n、E_n+1を2個の累積部VSFT_A、VSFT_Bのいずれかに、2個の累積部VSFT_A、VSFT_Bにおける符号化データE_n、E_n+1の累積符号長Sum_A、Sum_Bの差が小さくなるように振り分ける。具体的には、振分判定部31により、符号化データE_n、E_n+1のうち符号長が長い方が、累積部VSFT_A、VSFT_Bのうち累積符号長が短い方に振分けられる。また、符号化データE_n、E_n+1のうち符号長が短い方が、累積部VSFT_A、VSFT_Bのうち累積符号長が長い方に振り分けられる。ここにおいて実行される振り分けは、次の2通りである。なお、振り分け先は「→」で示される。
振分けA0:符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B
振分けA1:符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_A
比較部32は、2つの符号長L_n、L_n+1の大小を比較する。比較結果は、振分判定部31に入力される。また、比較部38は、累積符号長Sum_A、Sum_Bの大小を比較する。比較結果は、振分判定部31に入力される。一方で、セレクタ34a、34bの両方に、符号化データE_nとその符号長L_n、及び符号化データE_n+1とその符号長L_n+1が入力される。振分判定部31は、符号化データE_n、E_n+1の累積部VSFT_A、VSFT_Bへの振分けを示す振分けデータCSを生成する。振分けデータCSは、たとえば1ビットのデータである。振分けデータCSの値は、たとえば、振分けA0(符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B)のときには「0」である。また、振分けデータCSは、振分けA1(符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_A)のときには「1」である。振分けデータCSは、制御信号としてセレクタ34a、34bに入力される。
Returning to FIG. The allocating unit 30 converts the encoded data E_n and E_n + 1 into one of the two accumulating units VSFT_A and VSFT_B, and the difference between the accumulated code lengths Sum_A and Sum_B of the encoded data E_n and E_n + 1 in the two accumulating units VSFT_A and VSFT_B. Sort so that becomes smaller. Specifically, the distribution determination unit 31 distributes the longer code length of the encoded data E_n and E_n + 1 to the shorter one of the accumulation units VSFT_A and VSFT_B. In addition, the shorter code length of the encoded data E_n and E_n + 1 is assigned to the longer cumulative code length of the accumulating units VSFT_A and VSFT_B. The distribution executed here is the following two types. The distribution destination is indicated by “→”.
Distribution A0: encoded data E_n → accumulation unit VSFT_A, encoded data E_n + 1 → accumulation unit VSFT_B
Distribution A1: Encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_A
The comparison unit 32 compares the two code lengths L_n and L_n + 1. The comparison result is input to the distribution determination unit 31. The comparison unit 38 compares the accumulated code lengths Sum_A and Sum_B. The comparison result is input to the distribution determination unit 31. On the other hand, the encoded data E_n and its code length L_n, and the encoded data E_n + 1 and its code length L_n + 1 are input to both the selectors 34a and 34b. The distribution determination unit 31 generates distribution data CS indicating distribution of the encoded data E_n and E_n + 1 to the accumulation units VSFT_A and VSFT_B. The distribution data CS is, for example, 1-bit data. The value of the distribution data CS is “0” in the case of distribution A0 (encoded data E_n → accumulation unit VSFT_A, encoded data E_n + 1 → accumulation unit VSFT_B), for example. The distribution data CS is “1” in the case of distribution A1 (encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_A). The distribution data CS is input to the selectors 34a and 34b as a control signal.

振分けデータCSが「0」のとき、セレクタ34aは、符号化データE_nとその符号長L_nを累積部VSFT_Aに出力する。また、このとき、セレクタ34bは、符号化データE_n+1とその符号長L_n+1を累積部VSFT_Bに出力する。また、振分けデータCSが「1」のとき、セレクタ34aは、符号化データE_n+1とその符号長L_n+1を累積部VSFT_Aに出力する。また、このとき、セレクタ34bは、符号化データE_nとその符号長L_nを累積部VSFT_Bに出力する。   When the distribution data CS is “0”, the selector 34a outputs the encoded data E_n and its code length L_n to the accumulating unit VSFT_A. At this time, the selector 34b outputs the encoded data E_n + 1 and its code length L_n + 1 to the accumulating unit VSFT_B. When the distribution data CS is “1”, the selector 34a outputs the encoded data E_n + 1 and its code length L_n + 1 to the accumulating unit VSFT_A. At this time, the selector 34b outputs the encoded data E_n and its code length L_n to the accumulating unit VSFT_B.

ビット列生成部40は、2個の累積部VSFT_A、VSFT_Bに累積された符号化データE_n、E_n+1を、一定のビット数ずつ連結してビット列BSを生成する。具体的には、ビット列生成部40は、記憶部36aに格納された累積符号化データDt_Aと、記憶部36bに格納された累積符号化データDt_Bを、一定のビット数ずつ交互に連結する。ビット列生成部40は、たとえばマルチプレクサを有する。一定のビット数は、任意のビット数が可能であり、たとえば1ビットである。生成されたビット列BSは、たとえば、可変長符号化部22内のバッファメモリ42に格納される。バッファメモリ42は、たとえばSRAM(Static RAM)である。   The bit string generator 40 generates a bit string BS by connecting the encoded data E_n and E_n + 1 accumulated in the two accumulators VSFT_A and VSFT_B by a certain number of bits. Specifically, the bit string generation unit 40 alternately couples the cumulative encoded data Dt_A stored in the storage unit 36a and the cumulative encoded data Dt_B stored in the storage unit 36b by a certain number of bits. The bit string generation unit 40 has a multiplexer, for example. The fixed number of bits can be any number of bits, for example, 1 bit. The generated bit string BS is stored, for example, in the buffer memory 42 in the variable length coding unit 22. The buffer memory 42 is, for example, an SRAM (Static RAM).

また、バッファメモリ42には、振分判定部31が生成する振分けデータCSも格納される。振分けデータCSは、ビット列BSとは別に、あるいはビット列BSの一部として格納される。ビット列BSとは別に格納される場合、振分けデータCSは、たとえば、バッファメモリ42のビット列BSと異なる領域に格納される。その場合、たとえば、一対の累積符号化データDt_A、Dt_Bに対応する複数の振分けデータCSを、可変長符号化して圧縮してもよい。ビット列BSの一部として格納される場合、たとえば、一対の累積符号化データDt_A、Dt_Bがマルチプレクスされるごとに、振分けデータCSが連結される。   The buffer memory 42 also stores distribution data CS generated by the distribution determination unit 31. The distribution data CS is stored separately from the bit string BS or as a part of the bit string BS. When stored separately from the bit string BS, the distribution data CS is stored in an area different from the bit string BS of the buffer memory 42, for example. In this case, for example, a plurality of distribution data CS corresponding to a pair of cumulative encoded data Dt_A and Dt_B may be compressed by variable length encoding. When stored as a part of the bit string BS, for example, each time a pair of cumulative encoded data Dt_A and Dt_B is multiplexed, the distribution data CS is concatenated.

バッファメモリに格納されたビット列BSと振分けデータCSは、圧縮画像データとして、たとえば図1の外部メモリ4に格納される。このように、符号化データE_n、E_n+1をビット列化することで、単一のアクセスにより符号化データE_n、E_n+1をバッファメモリ42に格納できる。   The bit string BS and distribution data CS stored in the buffer memory are stored as compressed image data, for example, in the external memory 4 of FIG. In this way, by encoding the encoded data E_n and E_n + 1 into bit strings, the encoded data E_n and E_n + 1 can be stored in the buffer memory 42 by a single access.

図5は、振分部30による振分けの具体例を示す図である。図5(A)〜(C)には、n=0、2、4、6、・・・の場合における符号化データE_n、E_n+1と、振分けデータCSと、累積部VSFT_A、VSFT_Bで累積される累積符号化データDt_A、Dt_Bの例が、時系列で示される。図5(A)〜(C)では、矩形により符号化データE_n、E_n+1が示される。また、矩形の高さと矩形内の数字により、符号長(ビット数)が示される。   FIG. 5 is a diagram illustrating a specific example of distribution by the distribution unit 30. 5A to 5C, the encoded data E_n and E_n + 1 in the case of n = 0, 2, 4, 6,..., The distribution data CS, and the accumulation units VSFT_A and VSFT_B are accumulated. Examples of the accumulated encoded data Dt_A and Dt_B are shown in time series. 5A to 5C, encoded data E_n and E_n + 1 are indicated by rectangles. Also, the code length (number of bits) is indicated by the height of the rectangle and the number in the rectangle.

図5(A)には、符号化データE_2、E_3の振分けが行われるときの状態が示される。このとき、累積部VSFT_A、VSFT_Bに、符号化データE_0、E_1が累積符号化データDt_A、Dt_Bとしてそれぞれ累積されている。なお、初期状態では、累積符号長Sum_A、Sum_Bはともに「0」であるので、たとえば、符号化データE_0は累積部VSFT_Aに、符号化データE_1は累積部VSFT_Bに振り分けられたものとする。   FIG. 5A shows a state when the encoded data E_2 and E_3 are distributed. At this time, the encoded data E_0 and E_1 are accumulated as accumulated encoded data Dt_A and Dt_B in the accumulating units VSFT_A and VSFT_B, respectively. In the initial state, since the accumulated code lengths Sum_A and Sum_B are both “0”, for example, it is assumed that the encoded data E_0 is allocated to the accumulating unit VSFT_A and the encoded data E_1 is allocated to the accumulating unit VSFT_B.

符号化データE_0、E_1の符号長は、それぞれ「2」、「3」である。よって、累積符号長Sum_A、Sum_Bはそれぞれ「2」、「3」であり、累積符号長Sum_Aは、累積符号長Sum_Bより小さい。一方、あらたな符号化データE_2、E_3の符号長L_2、L_3はそれぞれ「5」、「3」であり、符号長L_2は符号長L_3より大きい。よって、このとき、符号化データE_2は累積部VSFT_Aに、符号化データE_3は累積部VSFT_Bに振分けられる。つまり、振分けA0が行われる。このとき、振分けデータCSは、「0」である。   The code lengths of the encoded data E_0 and E_1 are “2” and “3”, respectively. Therefore, the accumulated code lengths Sum_A and Sum_B are “2” and “3”, respectively, and the accumulated code length Sum_A is smaller than the accumulated code length Sum_B. On the other hand, the code lengths L_2 and L_3 of the new encoded data E_2 and E_3 are “5” and “3”, respectively, and the code length L_2 is larger than the code length L_3. Therefore, at this time, the encoded data E_2 is allocated to the accumulating unit VSFT_A, and the encoded data E_3 is allocated to the accumulating unit VSFT_B. That is, distribution A0 is performed. At this time, the distribution data CS is “0”.

上記の振分けが行われると、累積符号長Sum_A、Sum_Bは、それぞれ「5」、「3」が加算されて「7」、「6」になり、その差は「1」になる。これは、振分けA1が行われて符号化データE_2が累積部VSFT_Bに、符号化データE_3が累積部VSFT_Aに振分けられた場合の、累積符号長Sum_A、Sum_B「5」、「8」の差「3」より小さくなる。   When the above distribution is performed, the accumulated code lengths Sum_A and Sum_B are “7” and “6” by adding “5” and “3”, respectively, and the difference is “1”. This is because the difference between the accumulated code lengths Sum_A, Sum_B “5” and “8” when the allocation A1 is performed and the encoded data E_2 is allocated to the accumulation unit VSFT_B and the encoded data E_3 is allocated to the accumulation unit VSFT_A. 3 "or smaller.

次いで、図5(B)には、あらたな符号化データE_4、E_5の振分けが行われるときの状態が示される。このとき、図5(A)の振分けにより、累積符号長Sum_A、Sum_Bは「7」、「6」である。よって、累積符号長Sum_Aは、累積符号長Sum_Bより大きい。一方、符号化データE_4、E_5の符号長L_4、L_5はそれぞれ「4」、「2」であり、符号長L_4は符号長L_5より大きい。よって、符号化データE_4は累積部VSFT_Bに、符号化データE_5は累積部VSFT_Aに振分けられる。つまり、振分けA1が行われる。このとき、振分けデータCSは、「1」である。   Next, FIG. 5B shows a state in which new encoded data E_4 and E_5 are distributed. At this time, the accumulated code lengths Sum_A and Sum_B are “7” and “6” according to the distribution in FIG. Therefore, the cumulative code length Sum_A is larger than the cumulative code length Sum_B. On the other hand, the code lengths L_4 and L_5 of the encoded data E_4 and E_5 are “4” and “2”, respectively, and the code length L_4 is larger than the code length L_5. Therefore, the encoded data E_4 is allocated to the accumulation unit VSFT_B, and the encoded data E_5 is allocated to the accumulation unit VSFT_A. That is, distribution A1 is performed. At this time, the distribution data CS is “1”.

すると、累積符号化データDt_Aの累積符号長Sum_Aは、符号化データE_5の符号長「2」が加算されて「9」になる。一方、累積符号化データDt_Bの累積符号長Sum_Bは、符号化データE_4の符号長「4」が加算されて「10」になる。すると、累積符号長Sum_A、Sum_Bの差は、「1」である。これは、たとえば振分けA0が行われて累積符号長Sum_A、Sum_Bがそれぞれ「12」、「8」になる場合の差「4」より小さくなる。   Then, the accumulated code length Sum_A of the accumulated encoded data Dt_A becomes “9” by adding the code length “2” of the encoded data E_5. On the other hand, the accumulated code length Sum_B of the accumulated encoded data Dt_B becomes “10” by adding the code length “4” of the encoded data E_4. Then, the difference between the accumulated code lengths Sum_A and Sum_B is “1”. For example, this is smaller than the difference “4” when the allocation A0 is performed and the accumulated code lengths Sum_A and Sum_B are “12” and “8”, respectively.

次いで、図5(C)には、あらたな符号化データE_6、E_7の振分けが行われるときの状態が示される。このとき、図5(B)の振り分けにより、累積符号長Sum_A、Sum_Bは「9」、「10」であり、累積符号長Sum_Aは、累積符号長Sum_Bより小さい。一方、符号化データE_6、E_7の符号長L_6、L_7はそれぞれ「3」、「1」であり、符号長L_6は符号長L_7より大きい。よって、符号化データE_6は累積部VSFT_Aに、符号化データE_7は累積部VSFT_Bに振分けられる。つまり、振分けA0が行われる。このとき、振分けデータCSは、「0」である。   Next, FIG. 5C shows a state in which new encoded data E_6 and E_7 are distributed. At this time, according to the distribution of FIG. 5B, the accumulated code lengths Sum_A and Sum_B are “9” and “10”, and the accumulated code length Sum_A is smaller than the accumulated code length Sum_B. On the other hand, the code lengths L_6 and L_7 of the encoded data E_6 and E_7 are “3” and “1”, respectively, and the code length L_6 is larger than the code length L_7. Therefore, the encoded data E_6 is allocated to the accumulating unit VSFT_A, and the encoded data E_7 is allocated to the accumulating unit VSFT_B. That is, distribution A0 is performed. At this time, the distribution data CS is “0”.

すると、累積符号化データDt_Aの累積符号長Sum_Aは、符号化データE_6の符号長「3」が加算されて「12」になる。一方、累積符号化データDt_Bの累積符号長Sum_Bは、符号化データE_7の符号長「1」が加算されて「11」になる。すると、累積符号長Sum_A、Sum_Bの差は、「1」である。これは、たとえば振分けA1が行われて累積符号長Sum_A、Sum_Bは、それぞれ「10」、「13」になる場合の差「3」より小さくなる。   Then, the accumulated code length Sum_A of the accumulated encoded data Dt_A becomes “12” by adding the code length “3” of the encoded data E_6. On the other hand, the cumulative code length Sum_B of the cumulative encoded data Dt_B is “11” by adding the code length “1” of the encoded data E_7. Then, the difference between the accumulated code lengths Sum_A and Sum_B is “1”. For example, the distribution A1 is performed and the accumulated code lengths Sum_A and Sum_B are smaller than the difference “3” when the accumulated code lengths Sum_A and Sum_B become “10” and “13”, respectively.

図6は、可変長符号化部22の動作手順を説明するフローチャート図である。図6に示す手順は、可変長符号化部22の各部により実行される。可変長符号化部22の各部の動作は、図3では図示を省略した制御部により制御される。   FIG. 6 is a flowchart for explaining the operation procedure of the variable length coding unit 22. The procedure shown in FIG. 6 is executed by each unit of the variable length encoding unit 22. The operation of each unit of the variable length coding unit 22 is controlled by a control unit (not shown in FIG. 3).

まず、符号化データE_n、E_n+1のカウンタ変数nの値が「0」に初期設定される。また、累積符号長Sum_A、Sum_Bの値が「0」にそれぞれ初期設定される(S2)。たとえば、振分判定部31がカウンタ変数nを初期設定する。また、累積部VSFT_A、VSFT_Bが記憶部70の累積符号長Sum_A、Sum_Bを初期設定する。次いで、セレクタ34a、34bは、符号化テーブルTBL0_1、TBL0_2から、符号化データE_n、E_n+1を取得する(S4)。次いで、セレクタ34a、34b、及び比較部32は、符号化テーブルTBL0_1、TBL0_2から、符号化対象データE_n、E_n+1の符号長L_n、L_n+1を取得する(S6)。   First, the value of the counter variable n of the encoded data E_n and E_n + 1 is initialized to “0”. Also, the values of the accumulated code lengths Sum_A and Sum_B are initially set to “0”, respectively (S2). For example, the distribution determination unit 31 initializes the counter variable n. In addition, the accumulation units VSFT_A and VSFT_B initialize the accumulated code lengths Sum_A and Sum_B in the storage unit 70. Next, the selectors 34a and 34b obtain encoded data E_n and E_n + 1 from the encoding tables TBL0_1 and TBL0_2 (S4). Next, the selectors 34a and 34b and the comparison unit 32 acquire the code lengths L_n and L_n + 1 of the encoding target data E_n and E_n + 1 from the encoding tables TBL0_1 and TBL0_2 (S6).

次いで、振分判定部31は、比較部38による比較結果から、累積符号長Sum_Aが累積符号長Sum_Bより小さいかを判定する(S8)。累積符号長Sum_Aが累積符号長Sum_Bより小さいとき(S8のYes)、振分判定部31は、比較部32による比較結果から、符号長L_nが符号長L_n+1より大きいかを判定する(S10)。一方、累積符号長Sum_Aが累積符号長Sum_B以上のとき(S8のNo)、振分判定部31は、符号長L_nが符号長L_n+1より大きいかを判定する(S12)。   Next, the distribution determination unit 31 determines whether the accumulated code length Sum_A is smaller than the accumulated code length Sum_B from the comparison result by the comparison unit 38 (S8). When the accumulated code length Sum_A is smaller than the accumulated code length Sum_B (Yes in S8), the distribution determination unit 31 determines whether the code length L_n is larger than the code length L_n + 1 from the comparison result by the comparison unit 32 (S10). On the other hand, when the accumulated code length Sum_A is greater than or equal to the accumulated code length Sum_B (No in S8), the distribution determination unit 31 determines whether the code length L_n is greater than the code length L_n + 1 (S12).

累積符号長Sum_Aが累積符号長Sum_Bより小さく、かつ符号長L_nが符号長L_n+1より大きいとき、手順S10の判定結果はYesになる。また、累積符号長Sum_Aが累積符号長Sum_B以上であり、かつ符号長L_nが符号長L_n+1以下のとき、手順S12の判定結果はNoになる。この2つのケースでは、振分判定部31は、振分けA0(符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B)を行う(S14)。そして、累積部VSFT_Aは、累積符号長Sum_Aに符号長L_nを加算する。また、累積部VSFT_Bは、累積符号長Sum_Bに符号長L_n+1を加算する(S16)。そして、振分判定部31は、値「0」の振分けデータCSを、ビット列生成部40またはバッファメモリ42に出力する(S18)。   When the accumulated code length Sum_A is smaller than the accumulated code length Sum_B and the code length L_n is larger than the code length L_n + 1, the determination result in step S10 is Yes. When the accumulated code length Sum_A is equal to or greater than the accumulated code length Sum_B and the code length L_n is equal to or less than the code length L_n + 1, the determination result of step S12 is No. In these two cases, the distribution determination unit 31 performs distribution A0 (encoded data E_n → accumulation unit VSFT_A, encoded data E_n + 1 → accumulation unit VSFT_B) (S14). Then, the accumulation unit VSFT_A adds the code length L_n to the accumulated code length Sum_A. The accumulating unit VSFT_B adds the code length L_n + 1 to the accumulated code length Sum_B (S16). Then, the distribution determination unit 31 outputs the distribution data CS having the value “0” to the bit string generation unit 40 or the buffer memory 42 (S18).

累積符号長Sum_Aが累積符号長Sum_B以上、かつ符号長L_nが符号長L_n+1以下のとき、手順S10の判定結果はNoになる。また、累積符号長Sum_Aが累積符号長Sum_Bより小さく、かつ符号長L_nが符号長L_n+1より大きいとき、手順S12の判定結果はYesになる。この2つのケースでは、振分判定部31は、振分けA1(符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_A)を行う(S20)。そして、累積部VSFT_Aは、累積符号長Sum_Aに符号長L_n+1を加算する。また、累積部VSFT_Bは、累積符号長Sum_Bに符号長L_nを加算する(S22)。そして、振分判定部31は、値「1」の振分けデータCSを、ビット列生成部40またはバッファメモリ42に出力する(S24)。   When the accumulated code length Sum_A is greater than or equal to the accumulated code length Sum_B and the code length L_n is less than or equal to the code length L_n + 1, the determination result of step S10 is No. When the accumulated code length Sum_A is smaller than the accumulated code length Sum_B and the code length L_n is larger than the code length L_n + 1, the determination result in step S12 is Yes. In these two cases, the distribution determination unit 31 performs distribution A1 (encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_A) (S20). Then, the accumulation unit VSFT_A adds the code length L_n + 1 to the accumulated code length Sum_A. The accumulating unit VSFT_B adds the code length L_n to the accumulated code length Sum_B (S22). Then, the distribution determination unit 31 outputs the distribution data CS having the value “1” to the bit string generation unit 40 or the buffer memory 42 (S24).

そして、カウンタ変数nが「2」インクリメントされる(S26)。そして、処理単位の領域におけるすべての符号化対象データD_n、D_n+1の符号化と振分けが完了するまで、手順S4〜S26が繰り返される(S28のNo)。   Then, the counter variable n is incremented by “2” (S26). Then, steps S4 to S26 are repeated until encoding and distribution of all the encoding target data D_n and D_n + 1 in the processing unit area are completed (No in S28).

このように、第1の実施形態によれば、連続する2個の可変調符号化データE_n、E_n+1を2個の累積部VSFT_A、VSFT_Bのいずれかに、それらの累積符号長Sum_A、Sum_Bの差が小さくなるように振り分けるので、2個の系列に対して符号化データ数が均等に振り分けられるとともに、累積符号長Sum_A、Sum_Bが略均等化される。その結果、後述する2個の復号部での復号処理時間が均等化され、全体の処理時間を短くできる。   As described above, according to the first embodiment, two consecutive modulated encoded data E_n and E_n + 1 are transferred to one of the two accumulating parts VSFT_A and VSFT_B, and the difference between the accumulated code lengths Sum_A and Sum_B. Therefore, the number of encoded data is equally distributed to the two sequences, and the cumulative code lengths Sum_A and Sum_B are substantially equalized. As a result, the decoding processing time in two decoding units to be described later is equalized, and the entire processing time can be shortened.

図7は、可変長復号部24の詳細な構成例を示す。ここでは、可変長復号部24は、2系列の復号処理を並列して行うための構成を有する。可変長復号部24内のバッファメモリ44には、外部メモリ4からビット列BSが読み出される。これとともに、振分けデータCSが、ビット列BSとは別に、またはビット列BSの一部として、外部メモリ4から可変長復号部24内のバッファメモリ44に読み出される。符号化データE_n、E_n+1がビット列化されることで、単一のアクセスによりバッファメモリ44から符号化データE_n、E_n+1を読み出すことができる。   FIG. 7 shows a detailed configuration example of the variable length decoding unit 24. Here, the variable length decoding unit 24 has a configuration for performing two series of decoding processes in parallel. The bit string BS is read from the external memory 4 to the buffer memory 44 in the variable length decoding unit 24. At the same time, the distribution data CS is read from the external memory 4 to the buffer memory 44 in the variable length decoding unit 24 separately from the bit string BS or as a part of the bit string BS. By encoding the encoded data E_n and E_n + 1 into a bit string, the encoded data E_n and E_n + 1 can be read from the buffer memory 44 by a single access.

符号化データ復元部46は、ビット列BSを一定のビット数(たとえば1ビット)ずつ分割して、二つの系列の累積符号化データDt_A、Dt_Bを復元する。ビット列BSは、バッファメモリ44から読み出される。符号化データ復元部46は、たとえば、ビット列生成部40のマルチプレクサに対応するデマルチプレクサを有する。これにより、ビット列BSは、累積符号化データDt_A、Dt_Bに分割される。符号化データE_n、E_n+1は、累積符号化データDt_A、Dt_Bに含まれている。累積符号化データDt_A、Dt_Bは、それぞれ記憶部48a、48bに格納される。記憶部48a、48bは、次に説明する2個の復号部VLD_A、VLD_Bにそれぞれ対応するバッファであり、たとえばフリップフロップ回路である。また、バッファメモリ44のビット列BSとは別領域格納されている振分けデータCSは、並替部50に出力される。   The encoded data restoration unit 46 divides the bit string BS by a certain number of bits (for example, 1 bit) to restore the two series of accumulated encoded data Dt_A and Dt_B. The bit string BS is read from the buffer memory 44. The encoded data restoration unit 46 includes, for example, a demultiplexer corresponding to the multiplexer of the bit string generation unit 40. As a result, the bit string BS is divided into cumulative encoded data Dt_A and Dt_B. The encoded data E_n and E_n + 1 are included in the cumulative encoded data Dt_A and Dt_B. The cumulative encoded data Dt_A and Dt_B are stored in the storage units 48a and 48b, respectively. The storage units 48a and 48b are buffers respectively corresponding to two decoding units VLD_A and VLD_B described below, and are, for example, flip-flop circuits. Further, the distribution data CS stored in a different area from the bit string BS of the buffer memory 44 is output to the rearrangement unit 50.

2個の復号部VLD_A、VLD_Bは、2個の累積部VSFT_A、VSFT_Bに累積された符号化データE_n、E_n+1をそれぞれ並列して順次復号する。復号部VLD_Aは、記憶部48aに格納された累積符号化データDt_Aから順次符号化データE_n、またはE_n+1を読み出して,復号データF_Aに復号する。また、復号部VLD_Bは、記憶部48bに格納された累積符号化データDt_Bから順次符号化データE_n、またはE_n+1を読み出して、復号データF_Bに復号する。   The two decoding units VLD_A and VLD_B sequentially decode the encoded data E_n and E_n + 1 accumulated in the two accumulating units VSFT_A and VSFT_B, respectively, in parallel. The decoding unit VLD_A sequentially reads the encoded data E_n or E_n + 1 from the accumulated encoded data Dt_A stored in the storage unit 48a and decodes it into the decoded data F_A. In addition, the decoding unit VLD_B sequentially reads the encoded data E_n or E_n + 1 from the accumulated encoded data Dt_B stored in the storage unit 48b, and decodes the decoded data F_B.

ここで、図8に、復号部VLD_Aの詳細な構成例を示す。なお、復号部VLD_Bも、同じ構成を有する。よって、次の説明は、復号部VLD_Bにも適用される。セレクタ76には、累積符号化データDt_A(復号部VLD_Bの側では累積符号化データDt_B)が入力される。セレクタ76は、データ要求信号Reqに応答して、32ビット長の累積符号化データDt_Aを選択して記憶部78に格納する。記憶部78は、たとえばフリップフロップ回路である。記憶部78に格納された累積符号化データDt_Aは、セレクタ76に帰還入力され、一方で可変シフタ80に入力される。セレクタ76に帰還入力された累積符号化データDt_Aは、新たな累積符号化データDt_Aが要求されるまで、繰り返し記憶部78に格納される。可変シフタ80は、累積符号化データDt_Aにおける復号済みの符号長分ビットシフトした位置からビットデータを読み出し、記憶部82に格納する。記憶部82は、たとえばフリップフロップ回路である。復号済みの符号長SUM_1´は、後述するように加算器86から入力される。   Here, FIG. 8 illustrates a detailed configuration example of the decoding unit VLD_A. Note that the decoding unit VLD_B also has the same configuration. Therefore, the following description is also applied to the decoding unit VLD_B. The selector 76 receives the accumulated encoded data Dt_A (accumulated encoded data Dt_B on the decoding unit VLD_B side). In response to the data request signal Req, the selector 76 selects the accumulated encoded data Dt_A having a 32-bit length and stores it in the storage unit 78. Storage unit 78 is, for example, a flip-flop circuit. The accumulated encoded data Dt_A stored in the storage unit 78 is fed back to the selector 76 and input to the variable shifter 80. The accumulated encoded data Dt_A fed back to the selector 76 is repeatedly stored in the storage unit 78 until new accumulated encoded data Dt_A is requested. The variable shifter 80 reads the bit data from the position that is bit-shifted by the decoded code length in the accumulated encoded data Dt_A, and stores the bit data in the storage unit 82. Storage unit 82 is, for example, a flip-flop circuit. The decoded code length SUM_1 ′ is input from the adder 86 as described later.

記憶部82に格納されたビットデータは、順次復号テーブルTBL0_Aに入力される。復号テーブルTBL0_Aは、符号化データと、その符号長に応じた発生頻度の復号データとを対応付ける。復号テーブルTBL0_Aは、可変長符号化部22の符号化テーブルTBL0_1、TBL0_2に対応する。復号テーブルTBL0_Aは、入力されたビットデータとテーブル内の符号化データとを上位ビットから順に照合し、一致する符号化データを検索する。そして、検索された符号化データE_Aに対応する復号データF_A(復号部VLD_B側では、復号データF_B)が出力される。出力された復号データF_Aは、記憶部84に格納される。記憶部84は、たとえばフリップフロップ回路である。記憶部84に格納された復号データF_Aは、セレクタ50a、50bに出力される。また、復号テーブルTBL0_Aは、復号済みの符号長L_Aを出力する。復号済みの符号長L_Aは、加算器86に送られる。   The bit data stored in the storage unit 82 is sequentially input to the decoding table TBL0_A. The decoding table TBL0_A associates encoded data with decoded data having an occurrence frequency according to the code length. The decoding table TBL0_A corresponds to the coding tables TBL0_1 and TBL0_2 of the variable length coding unit 22. The decoding table TBL0_A collates the input bit data and the encoded data in the table in order from the upper bit, and searches for the encoded data that matches. Then, decoded data F_A (decoded data F_B on the decoding unit VLD_B side) corresponding to the searched encoded data E_A is output. The output decoded data F_A is stored in the storage unit 84. Storage unit 84 is, for example, a flip-flop circuit. The decoded data F_A stored in the storage unit 84 is output to the selectors 50a and 50b. Also, the decoding table TBL0_A outputs the decoded code length L_A. The decoded code length L_A is sent to the adder 86.

加算器86は、記憶部88に格納された復号済みの符号長SUM_1´に、あらたな復号済みの符号長L_Aを加算する。記憶部88は、たとえばフリップフロップ回路である。こうして累計された復号済みの符号長SUM_1´が、記憶部88に格納され、また、可変シフタ80に入力される。その一方で、復号済み符号長SUM_1´の繰り上げビットが、データ要求信号Reqとして、セレクタ76と図7の記憶部48aに入力される。復号済み符号長SUM_1´は、たとえば、累積符号化データDt_Aの上限の符号長32ビットを示す5ビットのデータである。復号済みの符号長SUM_1´の繰り上げビットが、データ要求信号Reqとしてセレクタ76や記憶部48aに送られる。よって、復号済みの符号長が32ビットを超えたとき、新たなデータ要求を示す値「1」のデータ要求信号Reqが送られる。これに応答して、記憶部48aからセレクタ76に、あらたな32ビット長の累積符号化データDt_Aが送られる。   The adder 86 adds the newly decoded code length L_A to the decoded code length SUM_1 ′ stored in the storage unit 88. Storage unit 88 is, for example, a flip-flop circuit. The decoded code length SUM_1 ′ thus accumulated is stored in the storage unit 88 and input to the variable shifter 80. On the other hand, the carry bit of the decoded code length SUM_1 ′ is input as the data request signal Req to the selector 76 and the storage unit 48a of FIG. The decoded code length SUM_1 ′ is, for example, 5-bit data indicating the upper limit code length of 32 bits of the cumulative encoded data Dt_A. The carry bit of the decoded code length SUM_1 ′ is sent to the selector 76 and the storage unit 48a as the data request signal Req. Therefore, when the decoded code length exceeds 32 bits, a data request signal Req having a value “1” indicating a new data request is sent. In response to this, new 32-bit long accumulated encoded data Dt_A is sent from the storage unit 48 a to the selector 76.

図7に戻る。並替部50は、2個の復号部VLD_A、VLD_Bによりそれぞれ復号された2個の復号データF_A、F_Bを、振分部30による振分けに従ってもとの順序に並べ替える。たとえば、図9(A)には、可変長符号化部22の振分部30において振分けA0(符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B)が行われた場合が示される。このことは、振分けデータCSの値「0」に示される。このとき、累積符号化データDt_A、Dt_Bからそれぞれ復号された復号データF_A、F_Bは、それぞれ、符号化データE_n、E_n+1から復号されたものである。よって、復号データF_Aは復号データF_nとして、復号データF_Bは復号データF_n+1として並べ替えられる。また、図9(B)には、振分けA1(符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_A)が行われた場合が示される。このことは、振分けデータCSの値「1」に示される。このとき復号データF_A、F_Bは、それぞれ、符号化データE_n+1、E_nから復号されたものである。よって、復号データF_Aは復号データF_n+1として、復号データF_Bは復号データF_nとして並べ替えられる。このようにして、復号データF_A、F_Bが、もとの順に並べ替えられる。   Returning to FIG. The rearrangement unit 50 rearranges the two pieces of decoded data F_A and F_B decoded by the two decoding units VLD_A and VLD_B in the original order according to the distribution by the distribution unit 30. For example, FIG. 9A shows a case where sorting A0 (encoded data E_n → accumulating unit VSFT_A, encoded data E_n + 1 → accumulating unit VSFT_B) is performed in the allocating unit 30 of the variable length encoding unit 22. It is. This is indicated by the value “0” of the distribution data CS. At this time, the decoded data F_A and F_B decoded from the accumulated encoded data Dt_A and Dt_B are respectively decoded from the encoded data E_n and E_n + 1. Therefore, the decoded data F_A is rearranged as decoded data F_n, and the decoded data F_B is rearranged as decoded data F_n + 1. FIG. 9B shows a case where distribution A1 (encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_A) is performed. This is indicated by the value “1” of the distribution data CS. At this time, the decoded data F_A and F_B are decoded from the encoded data E_n + 1 and E_n, respectively. Therefore, the decoded data F_A is rearranged as decoded data F_n + 1, and the decoded data F_B is rearranged as decoded data F_n. In this way, the decoded data F_A and F_B are rearranged in the original order.

並替部50では、復号データF_A、F_Bの両方がセレクタ50a、50bに入力される。そして、セレクタ50a、50bは、振分けデータCSに応じて、2つの入力のいずれかを選択して出力する。たとえば、振分けデータCSの値が「0」のとき、セレクタ50aは復号データF_Aを選択して出力し、セレクタ50bは復号データF_Bを選択して出力する。一方、振分けデータCSの値が「1」のとき、セレクタ50aは復号データF_Bを選択して出力し、セレクタ50bは復号データF_Aを選択して出力する。こうして、セレクタ50aは、復号データF_A、F_Bのうち、符号化データE_nから復号された復号データを選択して出力する。また、セレクタ50bは、復号データF_A、F_Bのうち、符号化データE_n+1から復号された復号データを選択して出力する。   In the rearrangement unit 50, both the decoded data F_A and F_B are input to the selectors 50a and 50b. Then, the selectors 50a and 50b select and output one of the two inputs according to the distribution data CS. For example, when the value of the distribution data CS is “0”, the selector 50a selects and outputs the decoded data F_A, and the selector 50b selects and outputs the decoded data F_B. On the other hand, when the value of the distribution data CS is “1”, the selector 50a selects and outputs the decoded data F_B, and the selector 50b selects and outputs the decoded data F_A. Thus, the selector 50a selects and outputs decoded data decoded from the encoded data E_n among the decoded data F_A and F_B. The selector 50b selects and outputs decoded data decoded from the encoded data E_n + 1 among the decoded data F_A and F_B.

セレクタ50aから出力される復号データF_AまたはF_Bは、記憶部52aに格納される。また、セレクタ50bから出力される復号データF_AまたはF_Bは、記憶部52bに格納される。こうして、2個の復号データF_A、F_Bが、符号化データE_n、E_n+1に対応するもとの順序で並べ替えられ、記憶部52a、52bに格納される。そして、記憶部52a、52bから、符号化データE_n、E_n+1からそれぞれ復号された復号データF_n、F_n+1が出力される。   The decoded data F_A or F_B output from the selector 50a is stored in the storage unit 52a. The decoded data F_A or F_B output from the selector 50b is stored in the storage unit 52b. In this manner, the two pieces of decoded data F_A and F_B are rearranged in the original order corresponding to the encoded data E_n and E_n + 1, and stored in the storage units 52a and 52b. Then, decoded data F_n and F_n + 1 decoded from the encoded data E_n and E_n + 1 are output from the storage units 52a and 52b, respectively.

図10は、可変長復号部24の動作手順を説明するフローチャート図である。図10に示す手順は、可変長復号部24の各部により実行される。可変長復号部24の各部の動作は、図7では図示を省略した制御部により制御される。   FIG. 10 is a flowchart for explaining the operation procedure of the variable length decoding unit 24. The procedure shown in FIG. 10 is executed by each unit of the variable length decoding unit 24. The operation of each unit of the variable length decoding unit 24 is controlled by a control unit not shown in FIG.

まず、符号化データ復元部46が、ビット列BSを分割して、累積符号化データDt_A、Dt_Bを復元する(S30)。次いで、復号データF_n、F_n+1をカウントするカウンタ変数nの値が「0」に初期化される(S30)。たとえば、記憶部52a、52bが復号データF_n、F_n+1のカウンタ変数nの値を「0」に設定する。次いで、復号部VDL_A、VDL_Bが、復号データF_A、F_Bを復号する(S32)。次いで、並替部50は、振分けデータCSを取得する(S34)。   First, the encoded data restoration unit 46 divides the bit string BS to restore the accumulated encoded data Dt_A and Dt_B (S30). Next, the value of the counter variable n that counts the decoded data F_n and F_n + 1 is initialized to “0” (S30). For example, the storage units 52a and 52b set the value of the counter variable n of the decoded data F_n and F_n + 1 to “0”. Next, the decoding units VDL_A and VDL_B decode the decoded data F_A and F_B (S32). Subsequently, the rearrangement part 50 acquires distribution data CS (S34).

振分けA0が行われたとき、振分けデータCSは「0」である(S36のYes)。よって、このとき、並替部50は、復号データF_Aが符号化データE_nに、復号データF_Bが符号化データE_n+1に対応するように並べ替える(S38)。一方、振分けA1が行われたとき、振分けデータCSは「0」でなく「1」である(S36のNo)。よって、このとき、並替部50は、復号データF_Aが符号化データE_n+1に、復号データF_Bが符号化データE_nに対応するように並べ替える(S40)。   When the distribution A0 is performed, the distribution data CS is “0” (Yes in S36). Therefore, at this time, the rearrangement unit 50 rearranges the decoded data F_A so that it corresponds to the encoded data E_n and the decoded data F_B corresponds to the encoded data E_n + 1 (S38). On the other hand, when the distribution A1 is performed, the distribution data CS is not “0” but “1” (No in S36). Therefore, at this time, the rearrangement unit 50 rearranges the decoded data F_A so that it corresponds to the encoded data E_n + 1 and the decoded data F_B corresponds to the encoded data E_n (S40).

そして、カウンタ変数nが「2」インクリメントされる(S42)。そして、処理単位の領域におけるすべての符号化データが復号されるまで、手順S31〜S42が繰り返される(S44のNo)。   Then, the counter variable n is incremented by “2” (S42). Then, steps S31 to S42 are repeated until all the encoded data in the processing unit area is decoded (No in S44).

このように、第1の実施形態によれば、2個の系列に振り分けられた符号化データ数が均等であり、かつ、2個の累積部VSFT_A、VSFT_Bでの累積符号長Sum_A、Sum_Bが略均等化されることで、2個の復号部VLD_A、VLD_Bによる累積符号化データDt_A、Dt_Bの復号処理速度が略均等化される。よって、復号対象データの符号化データ数、あるいは符号長が不均等であることにより、符号化データ数、あるいは符号長が大きい方の処理時間に全体の処理時間が制約されるといったことを回避できる。よって、並列化された復号処理がさらに高速化される。   Thus, according to the first embodiment, the number of encoded data distributed to two sequences is equal, and the accumulated code lengths Sum_A and Sum_B in the two accumulation units VSFT_A and VSFT_B are substantially equal. By equalization, the decoding processing speeds of the cumulative encoded data Dt_A and Dt_B by the two decoding units VLD_A and VLD_B are substantially equalized. Therefore, it is possible to avoid that the entire processing time is restricted by the processing time of the larger number of encoded data or the code length due to the unequal number of encoded data or the code length of the data to be decoded. . Therefore, the parallelized decoding process is further accelerated.

[N=3の例]
上述の説明では、N=2の場合の2系列の振分け、及び復号処理の例を示した。しかしながら、本実施形態は、Nが3以上の場合の3系列以上の振分け、及び復号処理を行う場合にも適用できる。次に、N=3の例について説明する。
[Example of N = 3]
In the above description, an example of the distribution of two sequences and the decoding process when N = 2 is shown. However, this embodiment can also be applied to the case of performing distribution and decoding processing of three or more sequences when N is 3 or more. Next, an example where N = 3 will be described.

図11は、N=3の例における可変長符号化部22の構成を示す。ここでは、可変長符号化部22は、図3の構成に加えて、符号化テーブルTBL0_3、累積部VSFT_C、及び記憶部36cを有する。また、振分部30は、セレクタ34cを有する。   FIG. 11 shows a configuration of the variable length coding unit 22 in an example where N = 3. Here, the variable length coding unit 22 includes a coding table TBL0_3, an accumulation unit VSFT_C, and a storage unit 36c in addition to the configuration of FIG. The distribution unit 30 includes a selector 34c.

符号化テーブルTBL0_3は、符号化テーブルTBL0_1、TBL0_2と同じ構成を有する。ここでは、符号化テーブルTBL0_1、TBL0_2、及びTBL0_3は、それぞれ、連続する符号化対象データD_n(n=0、3、6、9、・・・)、D_n+1、及びD_n+2を、符号化データE_n、En+1、及びE_n+2にそれぞれ符号化する。また、符号化テーブルTBL0_1、TBL0_2、及びTBL0_3は、対応する符号長L_n、L_n+1、及び符号長L_n+2をそれぞれ出力する。   The encoding table TBL0_3 has the same configuration as the encoding tables TBL0_1 and TBL0_2. Here, the encoding tables TBL0_1, TBL0_2, and TBL0_3 respectively include continuous encoding target data D_n (n = 0, 3, 6, 9,...), D_n + 1, and D_n + 2 are encoded data E_n, Encoding is performed on En + 1 and E_n + 2, respectively. Also, the encoding tables TBL0_1, TBL0_2, and TBL0_3 output the corresponding code lengths L_n, L_n + 1, and code length L_n + 2, respectively.

符号化テーブルTBL0_1〜TBL0_3からそれぞれ出力される符号化データE_nとその符号長L_n、符号化データE_n+1とその符号長L_n+1、及び符号化データE_n+2とその符号長L_n+2は、いずれもセレクタ34a〜34cに入力される。また、符号長Ln〜L_n+2は、比較部32に入力される。   The encoded data E_n and its code length L_n, the encoded data E_n + 1 and its code length L_n + 1, and the encoded data E_n + 2 and its code length L_n + 2 respectively output from the encoding tables TBL0_1 to TBL0_3 are all sent to the selectors 34a to 34c. Entered. The code lengths Ln to L_n + 2 are input to the comparison unit 32.

累積部VSFT_Cは、累積部VSFT_A、VSFT_Bと同じ構成を有する。累積部VSFT_A、VSFT_B、及びVSFT_Cは、符号化データE_n、E_n+1、及びE_n+2のいずれかをそれぞれ累積する。累積部VSFT_Cが累積した符号化データは、累積符号化データDt_Cとして記憶部36cに格納される。また、累積部VSFT_Cは、累積符号化データDt_Cの累積符号長Sum_Cを算出する。累積符号長Sum_Cは、累積符号長Sum_A、Sum_Bとともに比較部38に入力される。   Accumulation unit VSFT_C has the same configuration as accumulation units VSFT_A and VSFT_B. The accumulation units VSFT_A, VSFT_B, and VSFT_C accumulate any one of the encoded data E_n, E_n + 1, and E_n + 2, respectively. The encoded data accumulated by the accumulating unit VSFT_C is stored in the storage unit 36c as accumulated encoded data Dt_C. Further, the accumulation unit VSFT_C calculates the accumulated code length Sum_C of the accumulated encoded data Dt_C. The accumulated code length Sum_C is input to the comparison unit 38 together with the accumulated code lengths Sum_A and Sum_B.

振分部30は、累積部VSFT_A、VSFT_B、及びVSFT_Cにおける累積符号長Sum_A、Sum_B、及びSum_Cの差が小さくなるような振分けを行う。具体的には、符号化データE_n、E_n+1、E_n+2のうち最も符号長が長いものが、累積部VSFT_A、VSFT_B、VSFT_Cのうち最も累積符号長が短いものに振り分けられる。そして、最も符号長が長いもの以外の2個の符号化データは、一定のルールで、最も累積符号長が短いもの以外の2個の累積部に振り分けられる。そうすることで、累積符号長Sum_A、Sum_B、及びSum_Cの差をできるだけ小さくすることができる。たとえば、累積符号長Sum_A、Sum_B、及びSum_Cの差を、符号長L_n、L_n+1、及びL_n+2のうちの最大符号長以下にすることができる。また、振分判定部31は、振分けを示す振分けデータCSを生成する。振分けデータCSは、たとえば2ビットのデータである。上記の一定のルールに基づく振分けと振分けデータCSの値は、次の3通りである。
振分けB0:
振分けデータCS=0
符号化データE_n→累積部VSFT_A、
符号化データE_n+1→累積部VSFT_B、
符号化データE_n+2→累積部VSFT_C
振分けB1:
振分けデータCS=1
符号化データE_n+1→累積部VSFT_A、
符号化データE_n+2→累積部VSFT_B、
符号化データE_n→累積部VSFT_C
振分けB2:
振分けデータCS=2
符号化データE_n+2→累積部VSFT_A、
符号化データE_n→累積部VSFT_B、
符号化データE_n+1→累積部VSFT_C
振分けデータCSは、制御信号として、セレクタ34a、34b、及び34cに入力される。また、セレクタ34a、34b、及び34cは、振分けデータCSに応じていずれかの入力を選択して出力する。たとえば、振分けデータCSが「0」のとき、セレクタ34aは、符号化データE_nとその符号長L_nを累積部VSFT_Aに出力する。また、このとき、セレクタ34bは、符号化データE_n+1とその符号長L_n+1を累積部VSFT_Bに出力する。また、このとき、セレクタ34cは、符号化データE_n+2とその符号長L_n+2を累積部VSFT_Cに出力する。また、振分けデータCSが「1」のとき、セレクタ34aは、符号化データE_n+1とその符号長L_n+1を累積部VSFT_Aに出力する。また、このとき、セレクタ34bは、符号化データE_n+2とその符号長L_n+2を累積部VSFT_Bに出力する。また、このとき、セレクタ34cは、符号化データE_nとその符号長L_nを累積部VSFT_Cに出力する。そして、振分けデータCSが「2」のとき、セレクタ34aは、符号化データE_n+2とその符号長L_n+2を累積部VSFT_Aに出力する。また、このとき、セレクタ34bは、符号化データE_nとその符号長L_nを累積部VSFT_Bに出力する。また、このとき、セレクタ34cは、符号化データE_n+1とその符号長L_n+1を累積部VSFT_Cに出力する。
The allocating unit 30 performs distribution such that the difference between the accumulated code lengths Sum_A, Sum_B, and Sum_C in the accumulating units VSFT_A, VSFT_B, and VSFT_C is small. Specifically, the longest code length among the encoded data E_n, E_n + 1, and E_n + 2 is assigned to the shortest cumulative code length among the accumulating units VSFT_A, VSFT_B, and VSFT_C. Then, the two encoded data other than the one with the longest code length are distributed to the two accumulating units other than the one with the shortest cumulative code length according to a certain rule. By doing so, the difference between the accumulated code lengths Sum_A, Sum_B, and Sum_C can be made as small as possible. For example, the difference between the accumulated code lengths Sum_A, Sum_B, and Sum_C can be made equal to or less than the maximum code length among the code lengths L_n, L_n + 1, and L_n + 2. In addition, the distribution determination unit 31 generates distribution data CS indicating distribution. The distribution data CS is, for example, 2-bit data. The distribution based on the above-mentioned fixed rule and the distribution data CS have the following three values.
Sorting B0:
Distribution data CS = 0
Encoded data E_n → accumulation part VSFT_A,
Encoded data E_n + 1 → accumulation part VSFT_B,
Encoded data E_n + 2 → accumulation part VSFT_C
Distribution B1:
Distribution data CS = 1
Encoded data E_n + 1 → accumulation part VSFT_A,
Encoded data E_n + 2 → accumulation part VSFT_B,
Encoded data E_n → accumulation part VSFT_C
Distribution B2:
Distribution data CS = 2
Encoded data E_n + 2 → accumulation part VSFT_A,
Encoded data E_n → accumulation part VSFT_B,
Encoded data E_n + 1 → accumulation part VSFT_C
The distribution data CS is input to the selectors 34a, 34b, and 34c as a control signal. The selectors 34a, 34b, and 34c select and output one of the inputs according to the distribution data CS. For example, when the distribution data CS is “0”, the selector 34a outputs the encoded data E_n and its code length L_n to the accumulating unit VSFT_A. At this time, the selector 34b outputs the encoded data E_n + 1 and its code length L_n + 1 to the accumulating unit VSFT_B. At this time, the selector 34c outputs the encoded data E_n + 2 and its code length L_n + 2 to the accumulating unit VSFT_C. When the distribution data CS is “1”, the selector 34a outputs the encoded data E_n + 1 and its code length L_n + 1 to the accumulating unit VSFT_A. At this time, the selector 34b outputs the encoded data E_n + 2 and its code length L_n + 2 to the accumulating unit VSFT_B. At this time, the selector 34c outputs the encoded data E_n and its code length L_n to the accumulating unit VSFT_C. When the distribution data CS is “2”, the selector 34a outputs the encoded data E_n + 2 and its code length L_n + 2 to the accumulating unit VSFT_A. At this time, the selector 34b outputs the encoded data E_n and its code length L_n to the accumulating unit VSFT_B. At this time, the selector 34c outputs the encoded data E_n + 1 and its code length L_n + 1 to the accumulating unit VSFT_C.

ビット列生成部40は、記憶部36a、36b、及び36cにそれぞれ格納された累積符号化データDt_A、Dt_B、及びDt_Cを、たとえば1ビットずつ順番に連結して、ビット列BSを生成する。さらに、ビット列生成部40は、ビット列BSに振分けデータCSを連結してもよい。そして、ビット列BSと振分けデータCSは、バッファメモリ42に格納される。   The bit string generation unit 40 generates the bit string BS by concatenating the accumulated encoded data Dt_A, Dt_B, and Dt_C stored in the storage units 36a, 36b, and 36c, for example, one bit at a time. Further, the bit string generation unit 40 may link the distribution data CS to the bit string BS. The bit string BS and the distribution data CS are stored in the buffer memory 42.

図12、13は、図11の可変長符号化部22の動作手順を説明するフローチャート図である。図12では、まず、符号化データE_n、E_n+1、及びE_n+2のカウンタ変数nが「0」に初期設定される。また、累積符号長データSum_A、Sum_B、及びSum_Cが「0」に初期設定される(S102)。次いで、セレクタ34a、34b、及び34cは、符号化テーブルTBL0_1、TBL0_2、及びTBL0_3から符号化データE_n、E_n+1、及びE_n+2を取得する(S104)。次いで、比較部32、ならびにセレクタ34a、34b、及び34cは、符号化テーブルTBL0_1、TBL0_2、及びTBL3から符号化対象データE_n、E_n+1、及びE_n+2の符号長L_n、L_n+1、及びL_n+2を取得する(S106)。   12 and 13 are flowcharts for explaining the operation procedure of the variable length coding unit 22 of FIG. In FIG. 12, first, the counter variable n of the encoded data E_n, E_n + 1, and E_n + 2 is initialized to “0”. Further, the accumulated code length data Sum_A, Sum_B, and Sum_C are initialized to “0” (S102). Next, the selectors 34a, 34b, and 34c obtain encoded data E_n, E_n + 1, and E_n + 2 from the encoding tables TBL0_1, TBL0_2, and TBL0_3 (S104). Next, the comparison unit 32 and the selectors 34a, 34b, and 34c obtain the code lengths L_n, L_n + 1, and L_n + 2 of the encoding target data E_n, E_n + 1, and E_n + 2 from the encoding tables TBL0_1, TBL0_2, and TBL3 (S106). ).

次いで、振分判定部31は、比較部38による比較結果から、累積符号長Sum_A、Sum_B、Sum_Cのうちで、累積符号長Sum_Aが最小かを判定する(S108)。累積符号長Sum_Aが最小のとき(S108のYes)、振分判定部31は判定結果SUM_STATE=0を生成する(S114)。また、累積符号長Sum_Aが最小でないとき(S108のNo)、振分判定部31は、累積符号長Sum_Bが最小かを判定する(S110)。累積符号長Sum_Bが最小のとき(S110のYes)、振分判定部31は判定結果SUM_STATE=1を生成する(S116)。また、累積符号長Sum_Bが最小でないとき(S110のNo)、振分判定部31は、累積符号長Sum_Cが最小と判定し、振分判定部31は判定結果SUM_STATE=2を生成する(S118)。   Next, the allocation determination unit 31 determines whether the accumulated code length Sum_A is the minimum among the accumulated code lengths Sum_A, Sum_B, and Sum_C from the comparison result by the comparison unit 38 (S108). When the accumulated code length Sum_A is minimum (Yes in S108), the distribution determination unit 31 generates a determination result SUM_STATE = 0 (S114). When the accumulated code length Sum_A is not the minimum (No in S108), the distribution determination unit 31 determines whether the accumulated code length Sum_B is the minimum (S110). When the accumulated code length Sum_B is minimum (Yes in S110), the distribution determination unit 31 generates a determination result SUM_STATE = 1 (S116). When the accumulated code length Sum_B is not the minimum (No in S110), the distribution determination unit 31 determines that the accumulated code length Sum_C is the minimum, and the distribution determination unit 31 generates the determination result SUM_STATE = 2 (S118). .

次いで、振分判定部31は、比較部32による比較結果から、符号長L_n、L_n+1、及びL_n+2のうちで、符号長L_nが最大かを判定する(S120)。符号長L_nが最大のとき(S120のYes)、振分判定部31は、判定結果LN_STATE=0を生成する(S126)。符号長L_nが最大でないとき(S120のNo)、振分判定部31は、符号長L_n+1が最大かを判定する(S122)。符号長L_n+1が最大のとき(S122のYes)、振分判定部31は、判定結果LN_STATE=1を生成する(S128)。また、符号長L_n+1が最大でないとき(S122のNo)、振分判定部31は、符号長L_n+2が最大と判定し、振分判定部31は、判定結果LN_STATE=2を生成する(S130)。   Next, the distribution determination unit 31 determines whether the code length L_n is the maximum among the code lengths L_n, L_n + 1, and L_n + 2 from the comparison result by the comparison unit 32 (S120). When the code length L_n is the maximum (Yes in S120), the distribution determination unit 31 generates a determination result LN_STATE = 0 (S126). When the code length L_n is not the maximum (No in S120), the distribution determination unit 31 determines whether the code length L_n + 1 is the maximum (S122). When the code length L_n + 1 is the maximum (Yes in S122), the distribution determination unit 31 generates a determination result LN_STATE = 1 (S128). When the code length L_n + 1 is not the maximum (No in S122), the distribution determination unit 31 determines that the code length L_n + 2 is the maximum, and the distribution determination unit 31 generates a determination result LN_STATE = 2 (S130).

次いで、図13に進み、振分判定部31は、判定結果の組合せ(SUM_STATE、LN_STATE)が、(0、0)、(1、1)、または(2、2)であるかを判定する(S132)。ここで、次の3通りのいずれかの場合、判定結果がYesになる。
[1]累積符号長Sum_Aが最小、かつ符号長L_nが最大
[2]累積符号長Sum_Bが最小、かつ符号長L_n+1が最大
[3]累積符号長Sum_Cが最小、かつ符号長L_n+2が最大
判定結果がYesの場合、振分判定部31は、振分けB0(符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B、符号化データE_n+2→累積部VSFT_C)を行う(S138)。次いで、累積部VSFT_Aが、累積符号長Sum_Aに符号長L_nを加算する。また、累積部VSFT_Bが、累積符号長Sum_Bに符号長L_n+1を加算する。そして、累積部VSFT_Cが、累積符号長Sum_Cに符号長L_n+3を加算する(S144)。次いで、振分判定部31は、値「0」の振分けデータCSを、ビット列生成部40、あるいはバッファメモリ42に出力する(S150)。
Next, proceeding to FIG. 13, the distribution determination unit 31 determines whether the combination of determination results (SUM_STATE, LN_STATE) is (0, 0), (1, 1), or (2, 2) ( S132). Here, in any of the following three cases, the determination result is Yes.
[1] Cumulative code length Sum_A is minimum and code length L_n is maximum [2] Cumulative code length Sum_B is minimum and code length L_n + 1 is maximum [3] Cumulative code length Sum_C is minimum and code length L_n + 2 is maximum determination result Is Yes, the distribution determination unit 31 performs distribution B0 (encoded data E_n → accumulation unit VSFT_A, encoded data E_n + 1 → accumulation unit VSFT_B, encoded data E_n + 2 → accumulation unit VSFT_C) (S138). Next, the accumulation unit VSFT_A adds the code length L_n to the accumulated code length Sum_A. Further, the accumulation unit VSFT_B adds the code length L_n + 1 to the accumulated code length Sum_B. The accumulating unit VSFT_C adds the code length L_n + 3 to the accumulated code length Sum_C (S144). Next, the distribution determination unit 31 outputs the distribution data CS having the value “0” to the bit string generation unit 40 or the buffer memory 42 (S150).

手順S132の判定結果がNoの場合、振分判定部31は、データSUM_STATE、LN_STATEが、(0、1)、(1、2)、または(2、0)であるかを判定する(S134)。
ここで、次の3通りのいずれかの場合、判定結果がYesになる。
[4]累積符号長Sum_Aが最小、かつ符号長L_n+1が最大
[5]累積符号長Sum_Bが最小、かつ符号長L_n+2が最大
[6]累積符号長Sum_Cが最小、かつ符号長L_nが最大
判定結果がYesの場合、振分判定部31は、振分けB1(符号化データE_n+1→累積部VSFT_A、符号化データE_n+2→累積部VSFT_B、符号化データE_n→累積部VSFT_C)を行う(S140)。次いで、累積部VSFT_Aが、累積符号長Sum_Aに符号長L_n+1を加算する。また、累積部VSFT_Bが、累積符号長Sum_Bに符号長L_n+2を加算する。そして、累積部VSFT_Cが、累積符号長Sum_Cに符号長L_nを加算する(S146)。次いで、振分判定部31は、値「1」の振分けデータCSを、ビット列生成部40、あるいはバッファメモリ42に出力する(S152)。
When the determination result in step S132 is No, the distribution determination unit 31 determines whether the data SUM_STATE and LN_STATE are (0, 1), (1, 2), or (2, 0) (S134). .
Here, in any of the following three cases, the determination result is Yes.
[4] Cumulative code length Sum_A is minimum and code length L_n + 1 is maximum [5] Cumulative code length Sum_B is minimum and code length L_n + 2 is maximum [6] Cumulative code length Sum_C is minimum and code length L_n is maximum Is Yes, the distribution determination unit 31 performs distribution B1 (encoded data E_n + 1 → accumulation unit VSFT_A, encoded data E_n + 2 → accumulation unit VSFT_B, encoded data E_n → accumulation unit VSFT_C) (S140). Next, the accumulation unit VSFT_A adds the code length L_n + 1 to the accumulated code length Sum_A. Further, the accumulation unit VSFT_B adds the code length L_n + 2 to the accumulated code length Sum_B. Then, the accumulation unit VSFT_C adds the code length L_n to the accumulated code length Sum_C (S146). Next, the distribution determination unit 31 outputs the distribution data CS having the value “1” to the bit string generation unit 40 or the buffer memory 42 (S152).

手順S134の判定結果がNoの場合、振分判定部31は、データSUM_STATE、LN_STATEが、(0、2)、(1、0)、または(2、1)であると判定する。
この場合、次の3通りのいずれかに対応する。
[7]累積符号長Sum_Aが最小、かつ符号長L_n+2が最大
[8]累積符号長Sum_Bが最小、かつ符号長L_nが最大
[9]累積符号長Sum_Cが最小、かつ符号長L_n+1が最大
振分判定部31は、振分けB2(符号化データE_n+2→累積部VSFT_A、符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_C)を行う(S142)。次いで、累積部VSFT_Aが、累積符号長Sum_Aに符号長L_n+2を加算する。また、累積部VSFT_Bが、累積符号長Sum_Bに符号長L_nを加算する。そして、累積部VSFT_Cが、累積符号長Sum_Cに符号長L_n+1を加算する(S148)。次いで、振分判定部31は、値「2」の振分けデータCSを、ビット列生成部40、あるいはバッファメモリ42に出力する(S154)。
When the determination result of step S134 is No, the distribution determination unit 31 determines that the data SUM_STATE and LN_STATE are (0, 2), (1, 0), or (2, 1).
In this case, it corresponds to one of the following three types.
[7] Cumulative code length Sum_A is minimum and code length L_n + 2 is maximum [8] Cumulative code length Sum_B is minimum and code length L_n is maximum [9] Cumulative code length Sum_C is minimum and code length L_n + 1 is maximum allocation The determination unit 31 performs distribution B2 (encoded data E_n + 2 → accumulation unit VSFT_A, encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_C) (S142). Next, the accumulation unit VSFT_A adds the code length L_n + 2 to the accumulated code length Sum_A. Further, the accumulation unit VSFT_B adds the code length L_n to the accumulated code length Sum_B. Then, the accumulation unit VSFT_C adds the code length L_n + 1 to the accumulated code length Sum_C (S148). Next, the distribution determination unit 31 outputs the distribution data CS having the value “2” to the bit string generation unit 40 or the buffer memory 42 (S154).

そして、カウンタ変数nが「3」だけインクリメントされる(S156)。そして、処理対象の領域におけるすべての符号化対象データの符号化と振分け処理が完了するまで、手順S104〜S154が繰り返される(S158のNo)。   Then, the counter variable n is incremented by “3” (S156). Then, steps S104 to S154 are repeated until the encoding and distribution processing of all the encoding target data in the processing target region is completed (No in S158).

図14は、N=3の例における可変長復号部24の構成を示す。図14では、可変長復号部24は、図7の構成に加え、記憶部48c、復号部VLD_C、及び記憶部52Cを有する。また、並替部50は、セレクタ50Cを有する。   FIG. 14 shows the configuration of the variable length decoding unit 24 in the example of N = 3. In FIG. 14, the variable length decoding unit 24 includes a storage unit 48c, a decoding unit VLD_C, and a storage unit 52C in addition to the configuration of FIG. The rearrangement unit 50 includes a selector 50C.

符号化データ復元部46は、ビット列BSを一定のビット数(たとえば1ビット)ずつ分割して、累積符号化データDt_A、Dt_B、及びDt_Cを復元する。累積符号化データDt_A、Dt_B、及びDt_Cには、符号化データE_n、E_n+1、及びE_n+2が振分けB0〜B2に基づいて振り分けられている。復元された累積符号化データDt_A、Dt_B、及びDt_Cは、それぞれ、記憶部48a、48b、及び48cに格納される。   The encoded data restoration unit 46 divides the bit string BS by a certain number of bits (for example, 1 bit) to restore the accumulated encoded data Dt_A, Dt_B, and Dt_C. In the accumulated encoded data Dt_A, Dt_B, and Dt_C, encoded data E_n, E_n + 1, and E_n + 2 are distributed based on the distributions B0 to B2. The restored accumulated encoded data Dt_A, Dt_B, and Dt_C are stored in the storage units 48a, 48b, and 48c, respectively.

復号部VLD_Cは、復号部VLD_A、VLD_Bと同じ構成を有する。復号部VLD_A、VLD_B、及びVLD_Cは、記憶部48a、48b、及び48cに格納される累積符号化データDt_A、Dt_B、及びDt_Cを順次復号する。復号部VLD_A、VLD_B、及びVLD_Cで復号された復号データF_A、F_B、及びF_Cは、いずれも並替部50のセレクタ50a、50b、及び50cに入力される。   The decoding unit VLD_C has the same configuration as the decoding units VLD_A and VLD_B. The decoding units VLD_A, VLD_B, and VLD_C sequentially decode the accumulated encoded data Dt_A, Dt_B, and Dt_C stored in the storage units 48a, 48b, and 48c. The decoded data F_A, F_B, and F_C decoded by the decoding units VLD_A, VLD_B, and VLD_C are all input to the selectors 50a, 50b, and 50c of the rearrangement unit 50.

並替部50では、セレクタ50a、50b、及び50cが、振分けデータCSに基づいて、復号データF_A、F_B、及びF_Cのいずれかを選択して出力する。たとえば、振分けデータCSの値が「0」のとき、セレクタ50aは復号データF_Aを、セレクタ50bは復号データF_Bを、セレクタ50cは復号データF_Cをそれぞれ選択して出力する。また、振分けデータCSの値が「1」のとき、セレクタ50aは復号データF_Bを、セレクタ50bは復号データF_Cを、セレクタ50cは復号データF_Aをそれぞれ選択して出力する。また、振分けデータCSの値が「2」のとき、セレクタ50aは復号データF_Cを選択して出力する。このとき、セレクタ50bは復号データF_Aを選択して出力する。また、このとき、セレクタ50cは復号データF_Bを選択して出力する。   In the rearrangement unit 50, the selectors 50a, 50b, and 50c select and output one of the decoded data F_A, F_B, and F_C based on the distribution data CS. For example, when the value of the distribution data CS is “0”, the selector 50a selects and outputs the decoded data F_A, the selector 50b selects the decoded data F_B, and the selector 50c selects the decoded data F_C. When the value of the distribution data CS is “1”, the selector 50a selects the decoded data F_B, the selector 50b selects the decoded data F_C, and the selector 50c selects and outputs the decoded data F_A. When the value of the distribution data CS is “2”, the selector 50a selects and outputs the decoded data F_C. At this time, the selector 50b selects and outputs the decoded data F_A. At this time, the selector 50c selects and outputs the decoded data F_B.

こうして、セレクタ50aは、復号データF_A、F_B、及びF_Cのうち、符号化データE_nから復号された復号データを選択して出力する。また、セレクタ50bは、復号データF_A、F_B、及びF_Cのうち、符号化データE_n+1から復号された復号データを選択して出力する。そして、セレクタ50cは、復号データF_A、F_B、及びF_Cのうち、符号化データE_n+2から復号された復号データを選択して出力する。   Thus, the selector 50a selects and outputs the decoded data decoded from the encoded data E_n among the decoded data F_A, F_B, and F_C. The selector 50b selects and outputs decoded data decoded from the encoded data E_n + 1 among the decoded data F_A, F_B, and F_C. Then, the selector 50c selects and outputs decoded data decoded from the encoded data E_n + 2 among the decoded data F_A, F_B, and F_C.

こうして、符号化データE_n、E_n+1、及びE_n+2から復号された復号データが、それぞれ記憶部52a、52b、及び52cに格納される。そして、記憶部52a、52b、及び52cに格納された復号データが、それぞれ、復号データF_n、F_n+1、及びF_n+2として出力される。これら復号データF_n、F_n+1、及びF_n+2を順番に並べることで、もとのデータに戻すことができる。このようにして、復号データが、もとの順に並べ替えられる。   Thus, the decoded data decoded from the encoded data E_n, E_n + 1, and E_n + 2 are stored in the storage units 52a, 52b, and 52c, respectively. Then, the decoded data stored in the storage units 52a, 52b, and 52c are output as decoded data F_n, F_n + 1, and F_n + 2, respectively. These decoded data F_n, F_n + 1, and F_n + 2 can be restored to the original data by arranging them in order. In this way, the decoded data is rearranged in the original order.

図15は、図14の可変長復号部24の動作手順を説明するフローチャート図である。まず、符号化データ復元部46が、ビット列BSを分割して、累積符号化データDt_A、Dt_B、及びDt_Cを復元する(S160)。次いで、復号データF_n、F_n+1、及びF_n+2をカウントするカウンタ変数nが値「0」に初期化される(S162)。次いで、復号部VDL_A、VDL_B、及びVDL_Cは、復号データF_A、F_B、及びF_Cを復号する(S164)。次いで、並替部50は、振分けデータCSを取得する(S166)。   FIG. 15 is a flowchart for explaining the operation procedure of the variable length decoding unit 24 of FIG. First, the encoded data restoration unit 46 divides the bit string BS to restore the accumulated encoded data Dt_A, Dt_B, and Dt_C (S160). Next, a counter variable n that counts the decoded data F_n, F_n + 1, and F_n + 2 is initialized to a value “0” (S162). Next, the decoding units VDL_A, VDL_B, and VDL_C decode the decoded data F_A, F_B, and F_C (S164). Next, the rearrangement unit 50 acquires the distribution data CS (S166).

振分けデータCSが「0」のとき(S168のYes)、並替部50は、復号データF_Aが復号データF_n、復号データF_Bが復号データF_n+1、そして、復号データF_Cが復号データF_n+2に対応するように、並べ替える(S172)。また、振分けデータCSが「0」でなく「1」のとき(S168のNo、S170のYes)、並替部50は、復号データF_Aが復号データF_n+1、復号データF_Bが復号データF_n+2、そして、復号データF_Cが復号データF_nに対応するように並べ替える(S174)。そして、振分けデータCSが「1」でなく「2」のとき(S170のNo)、並替部50は、復号データF_Aが復号データF_n+2、復号データF_Bが復号データF_n、そして、復号データF_Cが復号データF_n+1に対応するように並べ替える(S174)。   When the distribution data CS is “0” (Yes in S168), the reordering unit 50 corresponds to the decoded data F_A corresponding to the decoded data F_n, the decoded data F_B corresponding to the decoded data F_n + 1, and the decoded data F_C corresponding to the decoded data F_n + 2. These are rearranged (S172). When the distribution data CS is not “0” but “1” (No in S168, Yes in S170), the rearrangement unit 50 determines that the decoded data F_A is the decoded data F_n + 1, the decoded data F_B is the decoded data F_n + 2, and Rearrangement is performed so that the decoded data F_C corresponds to the decoded data F_n (S174). When the distribution data CS is not “1” but “2” (No in S170), the rearrangement unit 50 determines that the decoded data F_A is decoded data F_n + 2, the decoded data F_B is decoded data F_n, and the decoded data F_C is decoded. Rearrangement is performed so as to correspond to the decoded data F_n + 1 (S174).

そして、カウンタ変数nが「3」インクリメントされる(S178)。そして、すべての符号化データが処理されるまで、手順S164〜S178が繰り返される(S180のNo)。   Then, the counter variable n is incremented by “3” (S178). Then, steps S164 to S178 are repeated until all encoded data is processed (No in S180).

上述の説明では、符号化データE_n、E_n+1、及びE_n+2のうち最も符号長が長いものが、累積部VSFT_A、VSFT_B、VSFT_Cのうち最も累積符号長が短いものに振り分けられる例が示された。この例は、累積符号部の数が4個以上の場合にも適用できる。あるいは、たとえば、符号長が長い符号化データから順に、累積符号長が短い累積部へ振り分けることも可能である。そうすることで、累積部における累積符号長の差が小さくなるような振分けが可能になる。   In the above description, the example in which the longest code length among the encoded data E_n, E_n + 1, and E_n + 2 is allocated to the shortest cumulative code length among the accumulation units VSFT_A, VSFT_B, and VSFT_C has been shown. This example can also be applied to the case where the number of cumulative code parts is four or more. Alternatively, for example, it is also possible to distribute to the accumulation unit with a short cumulative code length in order from encoded data with a long code length. By doing so, it is possible to distribute such that the difference in accumulated code length in the accumulating unit is reduced.

上述のように、第1の実施形態によれば、N個の符号化データをN個の累積部のいずれかに、N個の累積部における符号化データ数が均等で、かつ、累積符号長の差が小さくなるように振り分けることで、累積部ごとのN個の復号部が処理する符号化データの累積符号長の差が小さくなる。よって、N個の復号部の処理時間の差が小さくなるので、符号長が長い方の復号部の処理時間に全体としての処理時間が制約されるといったことを回避できる。よって、全体としての復号処理が高速化される。   As described above, according to the first embodiment, N encoded data is stored in any one of the N accumulating units, the number of encoded data in the N accumulating units is equal, and the accumulated code length is By allocating so that the difference between the two is reduced, the difference in the accumulated code length of the encoded data processed by the N decoding units for each accumulating unit is reduced. Therefore, since the difference in processing time between the N decoding units becomes small, it is possible to avoid that the processing time as a whole is limited to the processing time of the decoding unit with the longer code length. Therefore, the overall decoding process is accelerated.

また、たとえば、1フレーム分の圧縮画像データを画像の領域単位で分割して復号処理を並列化する場合と比較すると、第1の実施形態は次のような有利な効果を奏する。たとえば、1フレームを前半、後半に分割する場合、展開された画像データに対し、近傍の画素を用いた画像処理(たとえば、平滑化)を行おうとすると、前半の圧縮画像データがすべて展開されないと、後半における前半との境界付近の画素に対する画像処理が開始できない。この点、第1の実施形態では、符号化データごとに復号処理が並列化されるので、近傍の画素がある程度まとまった状態で順次展開される。よって、展開された画像データから順次画像処理を行うことができ、画像処理まで含めた全体としての処理が高速化される。   In addition, for example, the first embodiment has the following advantageous effects as compared with the case where one frame of compressed image data is divided in units of image regions and decoding processing is parallelized. For example, when one frame is divided into the first half and the second half, if image processing (for example, smoothing) using neighboring pixels is performed on the expanded image data, all the compressed image data in the first half are not expanded. In the second half, image processing cannot be started for pixels near the boundary with the first half. In this regard, in the first embodiment, since the decoding process is parallelized for each encoded data, neighboring pixels are sequentially developed in a state where they are grouped to some extent. Therefore, image processing can be performed sequentially from the developed image data, and the overall processing including the image processing is accelerated.

また、領域単位で復号処理を並列化する場合、領域ごとに画像データを格納するためのバッファ用メモリが必要になる。あるいは、単一のメモリに複数の領域の画像データを格納すると、複数の復号部からのアクセスを調停するための処理負荷が増大する。この点、第1の実施形態では、符号化データを一つのバッファ用メモリに格納すればよいので、バッファ用メモリの数、容量、あるいはアクセス調停回路を節約できる。さらに、符号化データを所定のビットずつマルチプレクスしてビット列化することで、単一のアクセスによりバッファ用メモリから符号化データを読み出すことができる。よって、全体としての処理負荷が軽減でき、復号処理がさらに高速化される。   Further, when parallel decoding processing is performed in units of regions, a buffer memory for storing image data for each region is required. Alternatively, when image data of a plurality of areas is stored in a single memory, a processing load for arbitrating accesses from a plurality of decoding units increases. In this regard, in the first embodiment, the encoded data only needs to be stored in one buffer memory, so that the number, capacity, or access arbitration circuit of the buffer memory can be saved. Furthermore, the encoded data can be read from the buffer memory by a single access by multiplexing the encoded data bit by bit to form a bit string. Therefore, the overall processing load can be reduced, and the decoding process can be further speeded up.

第1の実施形態では、並替部50が、振分けデータCSに基づいて、復号データの並べ替えを行う例を示した。次に、振分けデータCSを用いずに、復号データの並べ替えを行う第2の実施形態について説明する。   In 1st Embodiment, the rearrangement part 50 showed the example which rearranges decoding data based on distribution data CS. Next, a second embodiment in which the decoded data is rearranged without using the distribution data CS will be described.

[第2の実施形態]
第2の実施形態は、2個の符号化データの2個の累積部への振り分けに関する。2個の累積部の累積符号長の差が短くなるように振り分けるという点において、第2の実施形態は第1の実施形態と同じである。ただし、第2の実施形態では、振分けデータの代わりに、符号化データのビットパターンが振分けを示す情報を有する。
[Second Embodiment]
The second embodiment relates to distribution of two encoded data to two accumulation units. The second embodiment is the same as the first embodiment in that the difference is made so that the difference between the accumulated code lengths of the two accumulating parts becomes shorter. However, in the second embodiment, the bit pattern of the encoded data has information indicating the distribution instead of the distribution data.

図16は、第2の実施形態における可変長符号化部22の構成例を示す。第1の実施形態と重複する部分には、図4と同じ符号が付される。第2の実施形態では、累積部VSFT_A、VSFT_Bは、2個の符号化データE_n、E_n+1のうち符号長がたとえば短い方の符号化データ(以下、判定用符号化データという)を、その順序に応じた(判定用符号化データがE_nからE_n+1かに応じた)ビットパターンで累積する。符号化データE_nが短い方であり判定用符号化データなら、たとえば先頭ビット「0」を有するビットパターン(以下、ビットパターンBP0という)で累積される。また、符号化データE_n+1が短い方であり判定用符号化データなら、たとえば先頭ビット「1」を有するビットパターン(以下、ビットパターンBP1という)で累積される。このように、2個の符号化データE_n、E_n+1のうち短い方の判定用符号化データを、その短い方がE_nかE_n+1かに応じて先頭ビットが「0」または「1」のビットパターンにしておけば、後の並替えでもとの順序にもどすとき、符号長が短い方の先頭ビットが「0」ならその符号化データがE_n、「1」ならその符号化データがE_n+1と判定でき、振分け情報を符号化データE_n、E_n+1から抽出できる。   FIG. 16 shows a configuration example of the variable length coding unit 22 in the second embodiment. Parts that are the same as those in the first embodiment are denoted by the same reference numerals as in FIG. In the second embodiment, the accumulators VSFT_A and VSFT_B are configured to use, for example, encoded data having a shorter code length (hereinafter referred to as determination encoded data) of the two encoded data E_n and E_n + 1 in that order. It accumulates with the bit pattern according to (according to whether the coding data for determination is E_n to E_n + 1). If the encoded data E_n is shorter and is encoded data for determination, for example, it is accumulated in a bit pattern having the first bit “0” (hereinafter referred to as bit pattern BP0). If the encoded data E_n + 1 is shorter and is encoded data for determination, for example, it is accumulated in a bit pattern having the first bit “1” (hereinafter referred to as bit pattern BP1). As described above, the shorter determination encoded data of the two encoded data E_n and E_n + 1 is changed to a bit pattern having a leading bit of “0” or “1” depending on whether the shorter one is E_n or E_n + 1. Then, when returning to the original order in the rearrangement later, if the first bit with the shorter code length is “0”, the encoded data can be determined as E_n, and if “1”, the encoded data can be determined as E_n + 1. The distribution information can be extracted from the encoded data E_n and E_n + 1.

具体例を示す前に、符号化テーブルのテーブル種別について説明する。図17には、符号化テーブルTBL0_1、TBL0_2内のテーブル種別TBL0の例が示される。テーブル種別TBL0では、符号化対象データの発生頻度が高い方から順に、符号長が短い符号化データが対応づけられる。たとえば、符号化対象データ「0」〜「2」には符号長が2〜3ビットの符号化データ「10」〜「111」が、符号化対象データ「3」〜「14」には、符号長が4〜5ビットの符号化データ「0000」〜「01111」が対応付けられる。また、テーブル種別TBL0は、一の符号化データが他の符号化データと先頭部で一致しないように構成される。符号化データ「10」を例とすると、テーブル種別TBL0には、先頭部に「10」を有する他の符号化データは含まれない。かかるテーブル種別TBL0において、符号長が2〜3ビットの符号化データ「10」〜「111」は、先頭ビットが「1」のビットパターンBP1に対応する。また、符号長が4〜5ビットの符号化データ「0000」〜「01111」は、先頭ビットが「0」のビットパターンBP0に対応する。   Before showing a specific example, the table type of the encoding table will be described. FIG. 17 shows an example of the table type TBL0 in the encoding tables TBL0_1 and TBL0_2. In the table type TBL0, encoded data with a short code length are associated in descending order of occurrence frequency of encoding target data. For example, the encoding target data “0” to “2” includes encoded data “10” to “111” having a code length of 2 to 3 bits, and the encoding target data “3” to “14” includes Encoded data “0000” to “01111” having a length of 4 to 5 bits are associated with each other. The table type TBL0 is configured such that one encoded data does not coincide with the other encoded data at the head. Taking the encoded data “10” as an example, the table type TBL0 does not include other encoded data having “10” at the head. In the table type TBL0, encoded data “10” to “111” having a code length of 2 to 3 bits corresponds to the bit pattern BP1 having a leading bit of “1”. Also, encoded data “0000” to “01111” having a code length of 4 to 5 bits corresponds to the bit pattern BP0 having a leading bit of “0”.

なお、テーブル種別TBL1は、テーブル種別TBL0の反転を示す。たとえば、テーブル種別TBL1では、符号長が2〜3ビットの符号化データ「01」〜「000」はビットパターン/BP1であり、符号長が4〜5ビットの符号化データ「1111」〜「10000」はビットパターン/BP0である。ただし、実際の符号化テーブルTBL0_1、TBL0_2内の種別は、テーブル種別TBL0である。   The table type TBL1 indicates inversion of the table type TBL0. For example, in the table type TBL1, encoded data “01” to “000” having a code length of 2 to 3 bits is a bit pattern / BP1, and encoded data “1111” to “10000” having a code length of 4 to 5 bits. "Is the bit pattern / BP0. However, the type in the actual coding tables TBL0_1 and TBL0_2 is the table type TBL0.

符号化データE_n、E_n+1は、テーブル種別TBL0の符号化テーブルTBL0_1、またはTBL0_2で符号化される。よって、符号化データE_n、E_n+1は、符号長L_n、L_n+1が4ビット未満の場合はビットパターンBP1内のいずれかである。一方、符号化データE_n、E_n+1は、符号長L_n、L_n+1が4ビット以上の場合はビットパターンBP0内のいずれかである。   The encoded data E_n and E_n + 1 are encoded by the encoding table TBL0_1 or TBL0_2 of the table type TBL0. Therefore, the encoded data E_n and E_n + 1 are any of the bit patterns BP1 when the code lengths L_n and L_n + 1 are less than 4 bits. On the other hand, the encoded data E_n and E_n + 1 are either in the bit pattern BP0 when the code lengths L_n and L_n + 1 are 4 bits or more.

図18は、符号化データE_n、E_n+1の、符号化時と累積時のビットパターンの具体例を示す。図18(A)、(B)は、符号化データE_nが短い方の判定用符号化データである場合を示す。たとえば、図18(A)では、符号化データE_nは2ビット長の「10」、符号化データE_n+1は3ビット長の「110」である。このとき、短い方の判定用符号化データE_nは、先頭ビット「1」のビットパターンBP1である。よって、判定用符号化データE_nは、ビットパターン/BP1の「01」に反転されて累積される。一方、長い方の符号化データE_n+1は、先頭ビット「1」のビットパターンBP1のまま累積される。図18(B)では、符号化データE_nは4ビット長の「0011」、符号化データE_n+1は5ビット長の「01000」である。このとき、短い方の判定用符号化データE_nは、先頭ビット「0」のビットパターンBP0である。よって、判定用符号化データE_nは、そのままのビットパターンで累積される。長い方の符号化データE_n+1も、先頭ビット「0」のビットパターンBP0のまま累積される。   FIG. 18 shows a specific example of bit patterns at the time of encoding and accumulation of the encoded data E_n and E_n + 1. FIGS. 18A and 18B show the case where the encoded data E_n is the shorter encoded data for determination. For example, in FIG. 18A, the encoded data E_n is “10” having a 2-bit length, and the encoded data E_n + 1 is “110” having a 3-bit length. At this time, the shorter determination encoded data E_n is the bit pattern BP1 of the first bit “1”. Therefore, the determination encoded data E_n is inverted and accumulated to “01” of the bit pattern / BP1. On the other hand, the longer encoded data E_n + 1 is accumulated in the bit pattern BP1 of the first bit “1”. In FIG. 18B, the encoded data E_n is “0011” having a 4-bit length, and the encoded data E_n + 1 is “01000” having a 5-bit length. At this time, the shorter determination encoded data E_n is the bit pattern BP0 of the first bit “0”. Therefore, the determination encoded data E_n is accumulated with the bit pattern as it is. The longer encoded data E_n + 1 is also accumulated with the bit pattern BP0 of the first bit “0”.

図18(C)、(D)は、符号化データE_n+1が短い方の判定用符号化データである場合を示す。たとえば、図18(C)では、符号化データE_nは3ビット長の「110」、符号化データE_n+1は2ビット長の「10」である。このとき、短い方の判定用符号化データE_n+1は、先頭ビット「1」のビットパターンBP1である。よって、判定用符号化データE_nは、ビットパターンBP1のまま累積される。長い方の符号化データE_nも、先頭ビットが「1」のビットパターンBP1のまま累積される。図18(D)では、符号化データE_nは5ビット長の「01000」、符号化データE_n+1は4ビット長の「0011」である。このとき、短い方の判定用符号化データE_n+1は、先頭ビット「0」のビットパターンBP0である。よって、判定用符号化データE_n+1は、ビットパターン/BP0の「1100」に反転されて累積される。一方、長い方の符号化データE_nは、先頭ビット「0」のビットパターンBP0のまま累積される。   FIGS. 18C and 18D show a case where the encoded data E_n + 1 is the shorter encoded data for determination. For example, in FIG. 18C, the encoded data E_n is “110” having a 3-bit length, and the encoded data E_n + 1 is “10” having a 2-bit length. At this time, the shorter encoded data for determination E_n + 1 is the bit pattern BP1 of the first bit “1”. Therefore, the determination encoded data E_n is accumulated in the bit pattern BP1. The longer encoded data E_n is also accumulated with the bit pattern BP1 having the first bit “1”. In FIG. 18D, the encoded data E_n is “01000” having a 5-bit length, and the encoded data E_n + 1 is “0011” having a 4-bit length. At this time, the shorter determination encoded data E_n + 1 is the bit pattern BP0 of the first bit “0”. Therefore, the determination encoded data E_n + 1 is inverted and accumulated to “1100” of the bit pattern / BP0. On the other hand, the longer encoded data E_n is accumulated in the bit pattern BP0 of the first bit “0”.

図18(A)〜(D)をまとめると、図18(E)、(F)に示すようになる。図18(E)に示すように、符号化データE_nの方が符号長が短く、符号化データE_nが判定用符号化データである場合、符号長L_nが4ビット未満であればそのビットパターンはBP1であり、ビットパターン/BP1に反転され累積される。一方、符号長L_nが4ビット以上であれば、判定用符号化データE_nはビットパターンBP0のまま累積される。また、図18(F)に示すように、符号化データE_n+1の方が符号長が短く、符号化データE_n+1が判定用符号化データである場合、符号長L_n+1が4ビット未満であればそのビットパターンはBP1であり、そのまま累積される。一方、符号長L_nが4ビット以上であれば、判定用符号化データE_nはビットパターンBP0であり、ビットパターン/BP0に反転されて累積される。   18A to 18D are summarized as shown in FIGS. 18E and 18F. As shown in FIG. 18E, when the encoded data E_n is shorter in code length and the encoded data E_n is encoded data for determination, if the code length L_n is less than 4 bits, the bit pattern is BP1 is inverted and accumulated into the bit pattern / BP1. On the other hand, if the code length L_n is 4 bits or more, the determination encoded data E_n is accumulated in the bit pattern BP0. As shown in FIG. 18F, when the encoded data E_n + 1 has a shorter code length and the encoded data E_n + 1 is the determination encoded data, if the code length L_n + 1 is less than 4 bits, the bit The pattern is BP1 and is accumulated as it is. On the other hand, if the code length L_n is 4 bits or more, the determination encoded data E_n is the bit pattern BP0, and is inverted and accumulated in the bit pattern / BP0.

図16に戻る。振分判定部31は、第1の実施形態と同様にして、セレクタ34a、34bに制御信号を送り、符号化データE_n、E_n+1を累積部VSFT_A、VSFT_Bに振り分ける。また、振分判定部31は、比較部32による符号長L_n、L_n+1の比較結果により、どちらの符号長が長いかを判定する。そして、振分判定部31は、累積部VSFT_A、VSFT_Bに対し、IsEn信号と、IsLng信号を出力する。IsEn信号は、振り分けた符号化データが符号化データのうちどちらか、つまり符号化データE_nか否かを示す。また、IsLng信号は、振り分けた符号化データが長い方か否かを示す。   Returning to FIG. As in the first embodiment, the distribution determination unit 31 sends control signals to the selectors 34a and 34b, and distributes the encoded data E_n and E_n + 1 to the accumulation units VSFT_A and VSFT_B. Further, the distribution determination unit 31 determines which code length is longer based on the comparison result of the code lengths L_n and L_n + 1 by the comparison unit 32. Then, the distribution determining unit 31 outputs the IsEn signal and the IsLng signal to the accumulating units VSFT_A and VSFT_B. The IsEn signal indicates whether the allocated encoded data is one of the encoded data, that is, whether the encoded data E_n. Further, the IsLng signal indicates whether the distributed encoded data is longer.

累積部VSFT_A、VSFT_Bは、IsLng信号に基づいて、それぞれに振分けられた符号化データが短い方の判定用符号化データであるか否かを判定する。たとえば、また、累積部VSFT_A、VSFT_Bは、IsEn信号に基づいて、判定用符号化データが符号化データE_nであるか、または符号化データE_n+1であるかを判定する。そして、累積部VSFT_A、VSFT_Bは、図18に示した場合分けに応じて、符号化データE_n、またはE_n+1を、そのままのビットパターン、または反転したビットパターンで累積する。さらに、累積部VSFT_A、VSFT_Bは、判定用符号化データを復号するためのテーブル種別の情報を、必要に応じて生成する。   The accumulating units VSFT_A and VSFT_B determine, based on the IsLng signal, whether the encoded data allocated to each is the shorter determination encoded data. For example, the accumulating units VSFT_A and VSFT_B determine whether the encoded data for determination is the encoded data E_n or the encoded data E_n + 1 based on the IsEn signal. Then, the accumulation units VSFT_A and VSFT_B accumulate the encoded data E_n or E_n + 1 in the same bit pattern or the inverted bit pattern according to the case classification shown in FIG. Further, the accumulation units VSFT_A and VSFT_B generate table type information for decoding the encoded data for determination as necessary.

図19は、第2の実施形態における累積部VSFT_Aの詳細な構成例である。第2の実施形態では、累積部VSFT_Aは、図4で示した構成に加え、一点鎖線で囲った、テーブル種別判定部102、ビット反転部104、セレクタ106、テーブル種別ビット埋込制御部108、及び、加算器110を有する。累積部VSFT_Bも、ここに示す構成を有する。よって、次の説明は、累積部VSFT_Bにも適用される。   FIG. 19 is a detailed configuration example of the accumulation unit VSFT_A according to the second embodiment. In the second embodiment, the accumulating unit VSFT_A includes a table type determination unit 102, a bit inversion unit 104, a selector 106, a table type bit embedding control unit 108, which are surrounded by a dashed line in addition to the configuration shown in FIG. And an adder 110. The accumulating unit VSFT_B also has the configuration shown here. Therefore, the following description is also applied to the accumulation unit VSFT_B.

テーブル種別判定部102は、入力されるIsLng信号から、振分けられた符号化データE_A(累積部VSFT_B側では符号化データE_B)が短い符号長で振分け判定に用いられる判定用符号化データであるかを判定する。また、テーブル種別判定部102は、入力されるIsEn信号から、符号化データE_Aが符号化データE_nか、またはE_n+1かを判定する。   Whether the table type determination unit 102 is the encoded data for determination used for the allocation determination with the short code length of the encoded data E_A distributed from the input IsLng signal (encoded data E_B on the accumulation unit VSFT_B side). Determine. Further, the table type determination unit 102 determines whether the encoded data E_A is the encoded data E_n or E_n + 1 from the input IsEn signal.

たとえば、符号化データE_Aが判定用符号化データでない場合、テーブル種別TBL0により符号化された符号化データE_Aは、そのままのビットパターンで累積される。よって、テーブル種別判定部102は、テーブル種別TBL0を示すテーブル種別信号TSを生成する。テーブル種別信号TSは、制御信号としてセレクタ106に送られる。セレクタ106は、テーブル種別TBL0を示すテーブル種別信号TS_Aに応じて、符号化データE_Aを反転せずに記憶部60に格納する。   For example, when the encoded data E_A is not determination encoded data, the encoded data E_A encoded by the table type TBL0 is accumulated with the bit pattern as it is. Therefore, the table type determination unit 102 generates a table type signal TS indicating the table type TBL0. The table type signal TS is sent to the selector 106 as a control signal. The selector 106 stores the encoded data E_A in the storage unit 60 without inverting it in accordance with the table type signal TS_A indicating the table type TBL0.

一方、符号化データE_Aが判定用符号化データである場合、テーブル種別判定部102は、判定用符号化データE_Aの先頭ビットHB_Aから、判定用符号化データE_Aのビットパターンを判定する。たとえば、先頭ビットHB_Aが「0」であれば、ビットパターンBP0である。また、先頭ビットHB_Aが「1」であれば、ビットパターンBP1である。   On the other hand, when the encoded data E_A is the determination encoded data, the table type determination unit 102 determines the bit pattern of the determination encoded data E_A from the first bit HB_A of the determination encoded data E_A. For example, if the first bit HB_A is “0”, the bit pattern BP0. If the first bit HB_A is “1”, the bit pattern BP1.

第1に、判定用符号化データE_AがビットパターンBP0の符号化データE_nであるとき、または、ビットパターンBP1の符号化データE_n+1であるときは、図18に示されるように、判定用符号化データE_Aは、そのままのビットパターンで累積される。よって、このとき、テーブル種別判定部102は、テーブル種別TBL0を示すテーブル種別信号TSをセレクタ106に入力する。すると、セレクタ106は、符号化データE_Aをそのままのビットパターンで記憶部60に格納する。一方、第2に、判定用符号化データE_Aが、ビットパターンBP1の符号化データE_nであるとき、または、ビットパターンBP0の符号化データE_n+1であるときは、図18に示されるように、判定用符号化データE_Aは、反転したビットパターンで累積される。よって、このとき、テーブル種別判定部102は、テーブル種別TBL1を示すテーブル種別信号TSをセレクタ106に入力する。すると、セレクタ106は、反転部104によりビットが反転された符号化データE_Aを、記憶部60に格納する。   First, when the determination encoded data E_A is the encoded data E_n of the bit pattern BP0 or the encoded data E_n + 1 of the bit pattern BP1, as shown in FIG. The data E_A is accumulated with the bit pattern as it is. Therefore, at this time, the table type determination unit 102 inputs a table type signal TS indicating the table type TBL0 to the selector 106. Then, the selector 106 stores the encoded data E_A in the storage unit 60 with the bit pattern as it is. On the other hand, secondly, when the encoded data for determination E_A is the encoded data E_n of the bit pattern BP1 or the encoded data E_n + 1 of the bit pattern BP0, as shown in FIG. The encoded data E_A is accumulated with an inverted bit pattern. Therefore, at this time, the table type determination unit 102 inputs a table type signal TS indicating the table type TBL1 to the selector 106. Then, the selector 106 stores the encoded data E_A whose bits are inverted by the inversion unit 104 in the storage unit 60.

ここで、図17を参照する。図18において示したとおり、符号長が長い方の符号化データはテーブル種別TBL0で符号化されたまま反転されずに累積される。一方で、符号長が短い方の判定用符号化データのビットが反転されると、符号化データE_nはビットパターン/BP1に反転され、符号化データE_n+1はビットパターン/BP0に反転されるので、テーブル種別TBL1で符号化されたことと等価になる。よって、詳しくは後述するように、符号化データの復号時には、テーブル種別TBL0、TBL1のどちらを用いるかが判定される。まず、テーブル種別TBL0、TBL1では、4ビット未満の符号化データはそれぞれ一意に特定できる。よって符号化データE_n、E_n+1の符号長L_n、L_n+1が両方とも4ビット未満のときには、判定用符号化データE_n、またはE_n+1の先頭ビットが「0」か「1」かにより、テーブル種別TBL0、TBL1のどちらで符号化されたか判定される。つまり、テーブル種別TBL0、TBL1のどちらで復号すべきか判定される。しかしながら、4ビット以上の符号化データを含めると、一の符号化データが他の符号化データの先頭部と一致して、一意に特定できない場合がある。よって、判定用符号化データE_n、またはE_n+1のビットパターンは、先頭ビットにより判定できない。かかる場合、次のようにして、判定用符号化データを復号するためのテーブル種別を示す情報が付加される。   Reference is now made to FIG. As shown in FIG. 18, the encoded data having the longer code length is accumulated without being inverted while being encoded with the table type TBL0. On the other hand, when the bit of the encoded data for determination having the shorter code length is inverted, the encoded data E_n is inverted to the bit pattern / BP1, and the encoded data E_n + 1 is inverted to the bit pattern / BP0. This is equivalent to encoding with the table type TBL1. Therefore, as will be described in detail later, it is determined which table type TBL0 or TBL1 is used when decoding the encoded data. First, in the table types TBL0 and TBL1, encoded data of less than 4 bits can be uniquely specified. Therefore, when the code lengths L_n and L_n + 1 of the encoded data E_n and E_n + 1 are both less than 4 bits, the table types TBL0 and TBL1 depend on whether the first bit of the determination encoded data E_n or E_n + 1 is “0” or “1”. It is determined whether the data is encoded. That is, it is determined which of table types TBL0 and TBL1 should be decrypted. However, when encoded data of 4 bits or more is included, there is a case where one encoded data coincides with the head part of other encoded data and cannot be uniquely identified. Therefore, the bit pattern of the determination encoded data E_n or E_n + 1 cannot be determined by the first bit. In this case, information indicating the table type for decoding the encoded data for determination is added as follows.

まず、テーブル種別判定部102は、符号化データE_n、E_n+1の符号長L_n、L_n+1のうち長い方が4ビット未満であるかを判定する。たとえば、符号長が長い方の符号化データはテーブル種別TBL0で符号化されているので、先頭ビットが「1」であれば符号長は4ビット未満であると判定される。長い方が4ビット未満である場合、短い方も当然4ビット未満である。よって、この場合、判定用符号化データE_n、またはE_n+1がBP1、/BP1内のどのビットパターンであるかは、先頭ビットにより判定できる。よって、復号のための追加的なテーブル種別情報は付加されない。一方、符号長L_n、L_n+1のうち長い方が4ビット以上の場合、テーブル種別判定部102は、累積部VSFT_B側のテーブル種別ビット埋込制御部108にテーブル種別信号TS_Aを送る。また、累積部VSFT_B側でも、符号化データE_Bの符号長L_Bに基づいて同じ処理が行われる。テーブル種別ビット埋込制御部108は、符号化データE_Aの符号長が長い方である場合、累積部VSFT_B側から送られるテーブル種別信号TS_Bに応じて、テーブル種別ビットTBを符号化データE_Aの後に付加する。テーブル種別ビットTBは、判定用符号化データを復号するためのテーブル種別を示す。テーブル種別ビットTBの値は、たとえば、テーブル種別TBL0を示す「0」、またはTBL1を示す「1」である。   First, the table type determination unit 102 determines whether the longer one of the code lengths L_n and L_n + 1 of the encoded data E_n and E_n + 1 is less than 4 bits. For example, since the encoded data with the longer code length is encoded with the table type TBL0, if the first bit is “1”, it is determined that the code length is less than 4 bits. If the longer is less than 4 bits, the shorter is naturally less than 4 bits. Therefore, in this case, it is possible to determine which bit pattern in the determination data E_n or E_n + 1 is in BP1 or / BP1 by the first bit. Therefore, additional table type information for decoding is not added. On the other hand, when the longer one of the code lengths L_n and L_n + 1 is 4 bits or more, the table type determination unit 102 sends a table type signal TS_A to the table type bit embedding control unit 108 on the accumulation unit VSFT_B side. Further, the same processing is performed also on the accumulation unit VSFT_B side based on the code length L_B of the encoded data E_B. When the code length of the encoded data E_A is longer, the table type bit embedding control unit 108 sets the table type bit TB after the encoded data E_A according to the table type signal TS_B sent from the accumulation unit VSFT_B side. Append. The table type bit TB indicates the table type for decoding the encoded data for determination. The value of the table type bit TB is, for example, “0” indicating the table type TBL0 or “1” indicating TBL1.

また、このとき、加算器110は、テーブル種別ビットTB分の1ビットを符号長L_Aに加算し、テーブル種別ビットTBが付加されることで、符号長L_Aは1ビット分長くなる。   At this time, the adder 110 adds 1 bit of the table type bit TB to the code length L_A, and the code length L_A is increased by 1 bit by adding the table type bit TB.

以降、図4で説明したようにして、符号化データE_n、またはE_n+1が累積される。このようにして、累積部VSFT_A、VSFT_Bは、判定用符号化データをその順序(つまり、それがE_nかE_n+1か)に応じたビットパターンで累積する。   Thereafter, the encoded data E_n or E_n + 1 is accumulated as described in FIG. In this way, the accumulating units VSFT_A and VSFT_B accumulate the determination encoded data in a bit pattern corresponding to the order (that is, whether it is E_n or E_n + 1).

図20〜24は、第2の実施形態における可変長符号化部22の動作手順を説明するフローチャート図である。図20がメインルーチンを示し、図21〜24は、それぞれサブルーチンを示す。図20〜24は、符号長が短い方の符号化データを判定用符号化データとしたときの手順例である。図20のメインルーチンでは、まず、符号化データE_n、E_n+1のカウンタ変数nの値が「0」に初期設定される。また、累積符号長Sum_A、Sum_Bの値が「0」にそれぞれ初期設定される(S202)。次いで、セレクタ34a、34bは、符号化テーブルTBL0_1、TBL0_2から、符号化データE_n、E_n+1を取得する(S204)。次いで、セレクタ34a、34b、及び比較部32は、符号化テーブルTBL0_1、TBL0_2から符号化対象データE_n、E_n+1の符号長L_n、L_n+1を取得する(S206)。   20 to 24 are flowcharts for explaining the operation procedure of the variable length coding unit 22 in the second embodiment. FIG. 20 shows a main routine, and FIGS. 21 to 24 show subroutines. 20 to 24 are examples of procedures when the encoded data with the shorter code length is used as the encoded data for determination. In the main routine of FIG. 20, first, the value of the counter variable n of the encoded data E_n, E_n + 1 is initialized to “0”. Further, the values of the cumulative code lengths Sum_A and Sum_B are respectively initialized to “0” (S202). Next, the selectors 34a and 34b obtain encoded data E_n and E_n + 1 from the encoding tables TBL0_1 and TBL0_2 (S204). Next, the selectors 34a and 34b and the comparison unit 32 obtain the code lengths L_n and L_n + 1 of the encoding target data E_n and E_n + 1 from the encoding tables TBL0_1 and TBL0_2 (S206).

次いで、振分判定部31は、累積符号長Sum_Aが累積符号長Sum_Bより小さいかを判定する(S208)。累積符号長Sum_Aが累積符号長Sum_Bより小さいとき(S208のYes)、振分判定部31は、符号長L_nが符号長L_n+1より大きいかを判定する(S210)。一方、累積符号長Sum_Aが累積符号長Sum_B以上のとき(S208のNo)、振分判定部31は、符号長L_nが符号長L_n+1より大きいかを判定する(S212)。   Next, the distribution determination unit 31 determines whether the accumulated code length Sum_A is smaller than the accumulated code length Sum_B (S208). When the accumulated code length Sum_A is smaller than the accumulated code length Sum_B (Yes in S208), the distribution determination unit 31 determines whether the code length L_n is larger than the code length L_n + 1 (S210). On the other hand, when the accumulated code length Sum_A is equal to or greater than the accumulated code length Sum_B (No in S208), the distribution determination unit 31 determines whether the code length L_n is greater than the code length L_n + 1 (S212).

累積符号長Sum_Aが累積符号長Sum_Bより短く、かつ符号長L_nが符号長L_n+1より長いとき、手順S210の判定結果はYesである。このとき、サブルーチンSR1が実行される。また、累積符号長Sum_Aが累積符号長Sum_Bより短く、かつ符号長L_nが符号長L_n+1以下のとき、手順S210の判定結果はNoである。このとき、サブルーチンSR2が実行される。また、累積符号長Sum_Aが累積符号長Sum_B以下であり、かつ符号長L_nが符号長L_n+1より長いとき、手順S212の判定結果はYesである。このとき、サブルーチンSR3が実行される。そして、累積符号長Sum_Aが累積符号長Sum_B以下であり、かつ符号長L_nが符号長L_n+1以下のとき、手順S212の判定結果はNoである。このとき、サブルーチンSR4が実行される。サブルーチンSR1〜SR4は、累積部VSFT_A、VSFT_Bで、符号化データE_n、E_n+1が累積されるときの手順である。サブルーチンSR1〜SR4の手順は、後に、図21〜24において示される。   When the accumulated code length Sum_A is shorter than the accumulated code length Sum_B and the code length L_n is longer than the code length L_n + 1, the determination result in step S210 is Yes. At this time, the subroutine SR1 is executed. When the accumulated code length Sum_A is shorter than the accumulated code length Sum_B and the code length L_n is equal to or less than the code length L_n + 1, the determination result in step S210 is No. At this time, the subroutine SR2 is executed. When the accumulated code length Sum_A is equal to or less than the accumulated code length Sum_B and the code length L_n is longer than the code length L_n + 1, the determination result in step S212 is Yes. At this time, the subroutine SR3 is executed. When the accumulated code length Sum_A is equal to or less than the accumulated code length Sum_B and the code length L_n is equal to or less than the code length L_n + 1, the determination result in step S212 is No. At this time, the subroutine SR4 is executed. Subroutines SR1 to SR4 are procedures when the encoded data E_n and E_n + 1 are accumulated in the accumulating units VSFT_A and VSFT_B. The procedure of subroutines SR1 to SR4 will be shown later in FIGS.

サブルーチンSR1〜SR4のいずれかが終了すると、カウンタ変数nが「2」インクリメントされる(S214)。そして、処理単位の領域におけるすべての符号化対象データD_n、D_n+1の符号化と振分けが完了するまで、手順S204〜S214が繰り返される(S216のNo)。   When one of the subroutines SR1 to SR4 ends, the counter variable n is incremented by “2” (S214). Then, steps S204 to S214 are repeated until encoding and distribution of all the encoding target data D_n and D_n + 1 in the processing unit area are completed (No in S216).

図21は、サブルーチンSR1の手順を示す。サブルーチンSR1は、上述したように、累積符号長Sum_Aが累積符号長Sum_Bより短く、かつ符号長L_nが符号長L_n+1より長い場合に実行される。つまり、サブルーチンSR1は、振分けA0(符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B)が行われ、符号化データE_n+1が判定用符号化データである場合に実行される。   FIG. 21 shows the procedure of the subroutine SR1. As described above, the subroutine SR1 is executed when the accumulated code length Sum_A is shorter than the accumulated code length Sum_B and the code length L_n is longer than the code length L_n + 1. That is, the subroutine SR1 is executed when distribution A0 (encoded data E_n → accumulation unit VSFT_A, encoded data E_n + 1 → accumulation unit VSFT_B) is performed, and the encoded data E_n + 1 is determination encoded data.

短い方の符号長Ln+1が閾値Th(たとえば、4ビット)以上のとき(S220のYes)、累積部VSFT_B側では、判定用符号化データE_n+1はビットが反転して累積される(S222)。このことは、判定用符号化データE_n+1をテーブル種別TBL1で符号化したことと等価である。そして、この場合、長い方の符号長L_nは当然に閾値Th以上である。このとき、判定用符号化データE_n+1はテーブル種別TBL1で符号化されているので、テーブル種別ビットTBの値が「1」に設定される(S228)。   When the shorter code length Ln + 1 is equal to or greater than a threshold Th (for example, 4 bits) (Yes in S220), on the accumulating unit VSFT_B side, the coded data for determination E_n + 1 is accumulated with the bits inverted (S222). This is equivalent to encoding the encoded data for determination E_n + 1 with the table type TBL1. In this case, the longer code length L_n is naturally greater than or equal to the threshold Th. At this time, since the determination encoded data E_n + 1 is encoded with the table type TBL1, the value of the table type bit TB is set to “1” (S228).

一方、短い方の符号長Ln+1が閾値Th未満のとき(S220のNo)、累積部VSFT_B側では、判定用符号化データE_n+1は、そのままのビットパターンで累積される。このとき、判定用符号化データE_n+1はテーブル種別TBL0で符号化された状態である。そして、長い方の符号長L_nが閾値Th以上のとき(S226のYes)、判定用符号化データE_n+1はテーブル種別TBL0で符号化されているので、累積部VSFT_A側では、テーブル種別ビットTBの値が「0」に設定される(S230)。一方、長い方の符号長L_nが閾値Th未満のとき(S226のNo)、サブルーチンSR1が終了する。この場合、符号長Ln、L_n+1は両方とも閾値Th未満である。よって、判定用符号化データの先頭ビットにより復号処理のためのテーブル種別が判定できる。よって、テーブルビットTBは付加されない。   On the other hand, when the shorter code length Ln + 1 is less than the threshold Th (No in S220), on the accumulating unit VSFT_B side, the determination encoded data E_n + 1 is accumulated with the bit pattern as it is. At this time, the encoded data for determination E_n + 1 is in a state encoded with the table type TBL0. When the longer code length L_n is greater than or equal to the threshold Th (Yes in S226), the determination encoded data E_n + 1 is encoded with the table type TBL0. Therefore, on the accumulation unit VSFT_A side, the value of the table type bit TB Is set to “0” (S230). On the other hand, when the longer code length L_n is less than the threshold Th (No in S226), the subroutine SR1 ends. In this case, both the code lengths Ln and L_n + 1 are less than the threshold value Th. Therefore, the table type for the decoding process can be determined based on the first bit of the encoded data for determination. Therefore, the table bit TB is not added.

手順S228、またはS230に次いで、テーブル種別ビット埋込制御部108は、符号長が長い方の符号化データE_nに、テーブル種別ビットTBを付加する(S232)。そして、累積部VSFT_A側では、累積符号長Sum_Aにテーブル種別ビットTBのビット長「1」が加算される(S234)。そして、累積符号長Sum_Aに符号長L_nが加算される。また、累積部VSFT_B側では、累積符号長Sum_Bに符号長L_n+1が加算される(S236)。そして、サブルーチンSR1が終了すると、図20の手順S214に移行する。   Subsequent to step S228 or S230, the table type bit embedding control unit 108 adds the table type bit TB to the encoded data E_n having the longer code length (S232). Then, on the accumulating unit VSFT_A side, the bit length “1” of the table type bit TB is added to the accumulated code length Sum_A (S234). Then, the code length L_n is added to the accumulated code length Sum_A. On the accumulation unit VSFT_B side, the code length L_n + 1 is added to the accumulated code length Sum_B (S236). When the subroutine SR1 ends, the process proceeds to step S214 in FIG.

図22は、サブルーチンSR2の手順を示す。サブルーチンSR2は、累積符号長Sum_Aが累積符号長Sum_Bより小さく、かつ符号長L_nが符号長L_n+1以下である場合に実行される。つまり、サブルーチンSR1は、振分けA1(符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_A)が行われ、符号化データE_nが判定用符号化データである場合に実行される。   FIG. 22 shows the procedure of the subroutine SR2. The subroutine SR2 is executed when the accumulated code length Sum_A is smaller than the accumulated code length Sum_B and the code length L_n is equal to or less than the code length L_n + 1. That is, the subroutine SR1 is executed when distribution A1 (encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_A) is performed, and the encoded data E_n is determination encoded data.

短い方の符号長Lnが閾値Th未満のとき(S240のYes)、累積部VSFT_B側では、判定用符号化データE_nはビットが反転して累積される(S242)。このことは、判定用符号化データE_nをテーブル種別TBL1で符号化したことと等価である。そして、長い方の符号長L_n+1は当然に閾値Th以上であるとき(S244のYes)、テーブル種別ビットTBの値が「1」に設定される(S248)。一方、長い方の符号長L_n+1が閾値Th未満のとき(S244のNo)、サブルーチンSR2が終了する。このとき、短い方の符号長L_nも当然に閾値Th未満なので、テーブルビットTBは付加されない。   When the shorter code length Ln is less than the threshold Th (Yes in S240), on the accumulating unit VSFT_B side, the determination encoded data E_n is accumulated with the bits inverted (S242). This is equivalent to encoding the encoded data for determination E_n with the table type TBL1. When the longer code length L_n + 1 is naturally greater than or equal to the threshold Th (Yes in S244), the value of the table type bit TB is set to “1” (S248). On the other hand, when the longer code length L_n + 1 is less than the threshold Th (No in S244), the subroutine SR2 ends. At this time, since the shorter code length L_n is naturally less than the threshold Th, the table bit TB is not added.

一方、短い方の符号長Lnが閾値Th以上のとき(S240のNo)、累積部VSFT_B側では、判定用符号化データE_nは、そのままのビットパターンで累積される。このとき、判定用符号化データE_nはテーブル種別TBL0で符号化された状態である。よって、テーブル種別ビットTBの値が「0」に設定される(S250)。そして、この場合、長い方の符号長L_n+1は当然に閾値Th以上である。   On the other hand, when the shorter code length Ln is equal to or greater than the threshold Th (No in S240), the determination encoded data E_n is accumulated in the bit pattern as it is on the accumulating unit VSFT_B side. At this time, the determination encoded data E_n is in a state encoded with the table type TBL0. Therefore, the value of the table type bit TB is set to “0” (S250). In this case, the longer code length L_n + 1 is naturally greater than or equal to the threshold Th.

手順S248、またはS250に次いで、累積部VSFT_A側では、テーブル種別ビット埋込制御部108が、符号長が長い方の符号化データE_n+1に、テーブル種別ビットTBを付加する(S252)。そして、累積符号長Sum_Aにテーブル種別ビットTBのビット長「1」が加算される(S254)。そして、累積符号長Sum_Aに符号長L_n+1が加算される。また、累積部VSFT_B側では、累積符号長Sum_Bに符号長L_nが加算される(S256)。そして、サブルーチンSR2が終了すると、図20の手順S214に移行する。   Subsequent to step S248 or S250, on the accumulating unit VSFT_A side, the table type bit embedding control unit 108 adds the table type bit TB to the encoded data E_n + 1 having the longer code length (S252). Then, the bit length “1” of the table type bit TB is added to the accumulated code length Sum_A (S254). Then, the code length L_n + 1 is added to the accumulated code length Sum_A. On the accumulating unit VSFT_B side, the code length L_n is added to the accumulated code length Sum_B (S256). When the subroutine SR2 ends, the process proceeds to step S214 in FIG.

図23は、サブルーチンSR3の手順を示す。サブルーチンSR3は、累積符号長Sum_Bが累積符号長Sum_A以下であり、かつ符号長L_nが符号長L_n+1より長い場合に実行される。つまり、サブルーチンSR3は、振分けA1(符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_A)が行われ、符号化データE_n+1が判定用符号化データである場合に実行される。   FIG. 23 shows the procedure of the subroutine SR3. The subroutine SR3 is executed when the accumulated code length Sum_B is equal to or less than the accumulated code length Sum_A and the code length L_n is longer than the code length L_n + 1. That is, the subroutine SR3 is executed when distribution A1 (encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_A) is performed and the encoded data E_n + 1 is determination encoded data.

短い方の符号長Ln+1が閾値Th以上のとき(S260のYes)、累積部VSFT_A側では、判定用符号化データE_n+1はビットが反転して累積される(S262)。このことは、判定用符号化データE_nをテーブル種別TBL1で符号化したことと等価である。そして、この場合、長い方の符号長L_nは当然に閾値Th以上である。このとき、判定用符号化データE_n+1はテーブル種別TBL1で符号化されているので、テーブル種別ビットTBの値が「1」に設定される(S268)。   When the shorter code length Ln + 1 is equal to or greater than the threshold Th (Yes in S260), on the accumulating unit VSFT_A side, the determination encoded data E_n + 1 is accumulated with the bits inverted (S262). This is equivalent to encoding the encoded data for determination E_n with the table type TBL1. In this case, the longer code length L_n is naturally greater than or equal to the threshold Th. At this time, since the determination encoded data E_n + 1 is encoded with the table type TBL1, the value of the table type bit TB is set to “1” (S268).

一方、短い方の符号長Ln+1が閾値Th未満のとき(S260のNo)、累積部VSFT_A側では、判定用符号化データE_n+1は、そのままのビットパターンで累積される。このとき、判定用符号化データE_n+1はテーブル種別TBL0で符号化された状態である。そして、長い方の符号長L_nが閾値Th以上のとき(S266のYes)、判定用符号化データE_n+1はテーブル種別TBL0で符号化されているので、テーブル種別ビットTBの値が「0」に設定される(S270)。一方、長い方の符号長L_nが閾値Th未満のとき(S266のNo)、サブルーチンSR3が終了する。このとき、短い方の符号長L_n+1も当然に閾値Th未満なので、テーブルビットTBは付加されない。   On the other hand, when the shorter code length Ln + 1 is less than the threshold Th (No in S260), on the accumulating unit VSFT_A side, the determination encoded data E_n + 1 is accumulated with the bit pattern as it is. At this time, the encoded data for determination E_n + 1 is in a state encoded with the table type TBL0. When the longer code length L_n is greater than or equal to the threshold Th (Yes in S266), the determination encoded data E_n + 1 is encoded with the table type TBL0, and therefore the value of the table type bit TB is set to “0”. (S270). On the other hand, when the longer code length L_n is less than the threshold Th (No in S266), the subroutine SR3 ends. At this time, since the shorter code length L_n + 1 is naturally less than the threshold Th, the table bit TB is not added.

手順S268、またはS270に次いで、累積部VSFT_B側では、テーブル種別ビット埋込制御部108が、符号長が長い方の符号化データE_nに、テーブル種別ビットTBを付加する(S272)。そして、累積符号長Sum_Bにテーブル種別ビットTBのビット長「1」が加算される(S274)。そして、累積部VSFT_A側では、累積符号長Sum_Aに符号長L_n+1が加算される。また、累積部VSFT_B側では、累積符号長Sum_Bに符号長L_nが加算される(S276)。そして、サブルーチンSR3が終了すると、図20の手順S214に移行する。   Subsequent to step S268 or S270, on the accumulating unit VSFT_B side, the table type bit embedding control unit 108 adds the table type bit TB to the encoded data E_n having the longer code length (S272). Then, the bit length “1” of the table type bit TB is added to the accumulated code length Sum_B (S274). Then, on the accumulating unit VSFT_A side, the code length L_n + 1 is added to the accumulated code length Sum_A. On the accumulating unit VSFT_B side, the code length L_n is added to the accumulated code length Sum_B (S276). When the subroutine SR3 ends, the process proceeds to step S214 in FIG.

図24は、サブルーチンSR4の手順を示す。サブルーチンSR4は、累積符号長Sum_Bが累積符号長Sum_A以下であり、かつ符号長L_nが符号長L_n+1以下である場合に実行される。つまり、サブルーチンSR4は、振分けA0(符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B)が行われ、符号化データE_nが判定用符号化データである場合に実行される。   FIG. 24 shows the procedure of the subroutine SR4. The subroutine SR4 is executed when the accumulated code length Sum_B is equal to or less than the accumulated code length Sum_A and the code length L_n is equal to or less than the code length L_n + 1. That is, the subroutine SR4 is executed when distribution A0 (encoded data E_n → accumulation unit VSFT_A, encoded data E_n + 1 → accumulation unit VSFT_B) is performed, and the encoded data E_n is determination encoded data.

短い方の符号長Lnが閾値Th未満のとき(S280のYes)、累積部VSFT_A側では、判定用符号化データE_nはビットが反転して累積される(S282)。このことは、判定用符号化データE_nをテーブル種別TBL1で符号化したことと等価である。そして、長い方の符号長L_n+1は当然に閾値Th以上であるとき(S284のYes)、テーブル種別ビットTBの値が「1」に設定される(S288)。一方、長い方の符号長L_n+1が閾値Th未満のとき(S284のNo)、サブルーチンSR4が終了する。このとき、短い方の符号長L_nも当然に閾値未満なので、テーブルビットTBは付加されない。   When the shorter code length Ln is less than the threshold Th (Yes in S280), on the accumulating unit VSFT_A side, the determination encoded data E_n is accumulated with the bits inverted (S282). This is equivalent to encoding the encoded data for determination E_n with the table type TBL1. When the longer code length L_n + 1 is naturally greater than or equal to the threshold Th (Yes in S284), the value of the table type bit TB is set to “1” (S288). On the other hand, when the longer code length L_n + 1 is less than the threshold Th (No in S284), the subroutine SR4 ends. At this time, since the shorter code length L_n is naturally less than the threshold value, the table bit TB is not added.

一方、短い方の符号長Lnが閾値Th以上のとき(S280のNo)、累積部VSFT_A側では、判定用符号化データE_nは、そのままのビットパターンで累積される。このとき、判定用符号化データE_nはテーブル種別TBL0で符号化された状態である。よって、テーブル種別ビットTBの値が「0」に設定される(S290)。そして、この場合、長い方の符号長L_n+1は当然に閾値Th以上である。   On the other hand, when the shorter code length Ln is equal to or greater than the threshold Th (No in S280), the determination encoded data E_n is accumulated in the bit pattern as it is on the accumulating unit VSFT_A side. At this time, the determination encoded data E_n is in a state encoded with the table type TBL0. Therefore, the value of the table type bit TB is set to “0” (S290). In this case, the longer code length L_n + 1 is naturally greater than or equal to the threshold Th.

手順S288、またはS290に次いで、累積部VSFT_B側では、テーブル種別ビット埋込制御部108が、符号長が長い方の符号化データE_n+1に、テーブル種別ビットTBを付加する(S292)。そして、累積符号長Sum_Bにテーブル種別ビットTBのビット長「1」が加算される(S294)。そして、累積符号長Sum_Aに符号長L_nが加算され、また、累積符号長Sum_Bに符号長L_n+1が加算される(S296)。そして、サブルーチンSR4が終了すると、図20の手順S214に移行する。   Subsequent to step S288 or S290, on the accumulating unit VSFT_B side, the table type bit embedding control unit 108 adds the table type bit TB to the encoded data E_n + 1 having the longer code length (S292). Then, the bit length “1” of the table type bit TB is added to the accumulated code length Sum_B (S294). Then, the code length L_n is added to the accumulated code length Sum_A, and the code length L_n + 1 is added to the accumulated code length Sum_B (S296). When the subroutine SR4 ends, the process proceeds to step S214 in FIG.

このような手順で、累積部VSFT_A、VSFT_Bでは、図18に示したように、判定用符号化データがその順序(それがE_nかE_n+1か)に応じたビットパターンで累積される。   In such a procedure, in the accumulating units VSFT_A and VSFT_B, as shown in FIG. 18, the coded data for determination is accumulated in a bit pattern according to the order (whether it is E_n or E_n + 1).

図25は、第2の実施形態における可変長復号部24の構成例を示す。図25では、可変長復号部24は、図7で示した構成に加え、一点鎖線で囲まれた、比較部54と、選択判定部56を有する。比較部54には、復号部VLD_A、VLD_Bから、復号済みの符号化データの累積符号長Sum_A´、Sum_B´が入力される。比較部54は、復号済みの累積符号長Sum_A´、Sum_B´の大きさを比較して、比較結果を選択判定部56に入力する。選択判定部56には、復号部VLD_A、VLD_Bから、判定用符号化データの先頭ビットHB_A、HB_Bと、テーブル種別ビットTBが入力される。   FIG. 25 shows a configuration example of the variable length decoding unit 24 in the second embodiment. In FIG. 25, the variable length decoding unit 24 includes a comparison unit 54 and a selection determination unit 56 that are surrounded by an alternate long and short dash line in addition to the configuration illustrated in FIG. 7. The comparison unit 54 receives the accumulated code lengths Sum_A ′ and Sum_B ′ of the decoded encoded data from the decoding units VLD_A and VLD_B. The comparison unit 54 compares the sizes of the accumulated code lengths Sum_A ′ and Sum_B ′ that have been decoded, and inputs the comparison result to the selection determination unit 56. The selection determination unit 56 receives the first bits HB_A and HB_B of the encoded data for determination and the table type bit TB from the decoding units VLD_A and VLD_B.

選択判定部56は、復号済みの累積符号長Sum_A´、Sum_B´から、復号部VLD_A、VLD_Bのうち、判定用符号化データを含む方を判定する。復号時の復号済みの累積符号長Sum_A´、Sum_B´は、振分け時の累積符号長Sum_A、Sum_Bに対応する。符号化後の振分けでは、この累積符号長Sum_A、Sum_Bに基づき、符号長が短い方が累積符号長が長い方に振り分けられた。よって、復号部VLD_A、VLD_Bのうち、復号済みの累積符号長が長い方に、符号化データE_n、E_n+1のうち符号長が短い方が含まれる。一方、復号済みの累積符号長が短い方に、符号化データE_n、E_n+1のうち符号長が長い方が含まれる。   The selection determination unit 56 determines, from the decoded cumulative code lengths Sum_A ′ and Sum_B ′, which of the decoding units VLD_A and VLD_B includes the encoded data for determination. The cumulative code lengths Sum_A ′ and Sum_B ′ that have been decoded at the time of decoding correspond to the cumulative code lengths Sum_A and Sum_B at the time of distribution. In the distribution after encoding, the shorter code length is allocated to the longer accumulated code length based on the accumulated code lengths Sum_A and Sum_B. Therefore, the decoding unit VLD_A, VLD_B includes the longer decoded code length and the shorter code length of the encoded data E_n, E_n + 1. On the other hand, the shorter decoded code length includes the longer code length of encoded data E_n and E_n + 1.

また、選択判定部56は、先頭ビットHB_A、またはHB_Bから、短い方の判定用符号化データのビットパターンを判定する。たとえば、先頭ビットが「0」であれば、ビットパターンBP0であり、先頭ビットが「1」であれば、ビットパターンBP1である。すなわち、判定用符号化データの先頭ビットが「0」なら符号化データE_nであることが判明し、「1」なら符号化データE_n+1であることが判明する。よって、振分け情報を抽出することができる。選択判定部56は、判定用符号化データのビットパターンから、復号データF_A、F_Bを並べ替えるための振分けデータCSを生成する。この振分けデータCSは、並替部50に送られる。   Further, the selection determining unit 56 determines the bit pattern of the shorter determination encoded data from the first bit HB_A or HB_B. For example, if the first bit is “0”, it is the bit pattern BP0, and if the first bit is “1”, the bit pattern BP1. That is, if the first bit of the determination encoded data is “0”, it is determined that the encoded data E_n is obtained, and if “1”, the encoded data E_n + 1 is determined. Therefore, distribution information can be extracted. The selection determination unit 56 generates distribution data CS for rearranging the decoded data F_A and F_B from the bit pattern of the determination encoded data. The distribution data CS is sent to the rearrangement unit 50.

また、選択判定部56は、テーブル種別ビットTBの有無、あるいは先頭ビットHB_A、またはHB_Bにより、判定用符号化データを復号するためのテーブル種別を判定する。たとえば、テーブル種別ビットTBがある場合、選択判定部56は、テーブル種別ビットの値に応じてテーブル種別TBL0、またはTBL1を判定する。一方、テーブル種別ビットTBがない場合、つまり、符号化データE_n、E_n+1の符号長が両方とも閾値(4ビット)未満の場合、選択判定部56は、判定用符号化データの先頭ビットHB_A、またはHB_Bから、判定用符号化データを復号するためのテーブル種別を判定する。たとえば、先頭ビットが「1」の場合、テーブル種別TBL0と判定され、先頭ビットが「0」の場合、テーブル種別TBL1と判定される。そして、選択判定部56は、判定したテーブル種別を示すテーブル選択信号TS1を、復号部VLD_A、VLD_Bに送る。   The selection determination unit 56 determines the table type for decoding the encoded data for determination based on the presence / absence of the table type bit TB or the head bit HB_A or HB_B. For example, when there is a table type bit TB, the selection determining unit 56 determines the table type TBL0 or TBL1 according to the value of the table type bit. On the other hand, when there is no table type bit TB, that is, when the code lengths of the encoded data E_n and E_n + 1 are both less than the threshold (4 bits), the selection determination unit 56 selects the first bit HB_A of the determination encoded data The table type for decoding the encoded data for determination is determined from HB_B. For example, when the first bit is “1”, it is determined that the table type is TBL0. When the first bit is “0”, it is determined that the table type is TBL1. Then, the selection determining unit 56 sends a table selection signal TS1 indicating the determined table type to the decoding units VLD_A and VLD_B.

並替部50は、たとえば、振分けデータCSが「0」のときには、復号データF_A、F_BをそれぞれF_n、F_n+1として並べ替える。あるいは、並替部50は、振分けデータCSが「1」のときには、復号データF_A、F_BをそれぞれF_n+1、F_nとして並べ替える。   For example, when the sorting data CS is “0”, the rearrangement unit 50 rearranges the decoded data F_A and F_B as F_n and F_n + 1, respectively. Alternatively, the rearrangement unit 50 rearranges the decoded data F_A and F_B as F_n + 1 and F_n, respectively, when the distribution data CS is “1”.

図26は、第2の実施形態における復号部VLD_Aの詳細な構成例である。第2の実施形態では、累積部VLD_Aは、図8で示した構成に加え、一点鎖線で囲った、反転部120、セレクタ122、加算器124、及び記憶部126を有する。なお、復号部VLD_Bも、ここに示す構成を有する。よって、次の説明は、復号部VLD_Bにも適用される。   FIG. 26 is a detailed configuration example of the decoding unit VLD_A in the second embodiment. In the second embodiment, the accumulating unit VLD_A includes an inversion unit 120, a selector 122, an adder 124, and a storage unit 126, which are enclosed by a one-dot chain line, in addition to the configuration shown in FIG. Note that the decoding unit VLD_B also has the configuration shown here. Therefore, the following description is also applied to the decoding unit VLD_B.

図8で説明したように、記憶部82には、累積符号化データDt_Aから取り出される符号化データが格納される。かかる符号化データE_A(復号部VLD_B側では符号化データE_B)は、反転部120とセレクタ122に送られる。反転部120は、符号化データE_Aを反転してセレクタ122に送る。セレクタ122は、記憶部82から送られる符号化データE_Aと、反転された符号化データE_Aのいずれかを、テーブル選択信号TS1に応じて選択し、復号テーブルTBL0_Aに入力する。テーブルTBL0_Aは、符号化テーブルTBL0_1、TBL0_2内の、テーブル種別TBL0に対応する復号テーブルである。テーブル選択信号TS1がテーブル種別TBL0を示す「0」の場合、セレクタ122は記憶部82から送られる符号化データE_Aを出力する。あるいは、テーブル選択信号TS1がテーブル種別TBL1を示す「1」の場合、セレクタ122は符号化データE_Aを反転したビットデータを出力する。この場合、符号化データE_Aをビット反転したデータが復号テーブルTBL0_Aで復号されると、符号化データE_Aがテーブル種別TBL1で復号されたことになる。このようにして、復号テーブルのテーブル種別TBL0、またはTBL1が選択的に切り替えられる。   As described with reference to FIG. 8, the storage unit 82 stores encoded data extracted from the accumulated encoded data Dt_A. The encoded data E_A (encoded data E_B on the decoding unit VLD_B side) is sent to the inverting unit 120 and the selector 122. The inversion unit 120 inverts the encoded data E_A and sends it to the selector 122. The selector 122 selects either the encoded data E_A sent from the storage unit 82 or the inverted encoded data E_A according to the table selection signal TS1, and inputs it to the decoding table TBL0_A. The table TBL0_A is a decoding table corresponding to the table type TBL0 in the encoding tables TBL0_1 and TBL0_2. When the table selection signal TS1 is “0” indicating the table type TBL0, the selector 122 outputs the encoded data E_A sent from the storage unit 82. Alternatively, when the table selection signal TS1 is “1” indicating the table type TBL1, the selector 122 outputs bit data obtained by inverting the encoded data E_A. In this case, when the bit-inverted data of the encoded data E_A is decoded by the decoding table TBL0_A, the encoded data E_A is decoded by the table type TBL1. In this way, the table type TBL0 or TBL1 of the decoding table is selectively switched.

復号テーブルTBL0_Aは、累積符号化データDt_Aから取り出される符号化データE_Aまたは符号化データE_Aをビット反転したデータを復号し、復号データF_Aを出力する。復号データF_Aは、記憶部84に格納される。また、復号テーブルTBL0_Aは、テーブル種別ビットTBが付加いるた判断されたとき、符号長が長い方の符号化データを復号する場合に、後に付加されたテーブル種別ビットTBを抽出して出力する。テーブル種別ビットTBは、選択判定部56に送られる。   The decoding table TBL0_A decodes the encoded data E_A extracted from the accumulated encoded data Dt_A or data obtained by bit-inversion of the encoded data E_A, and outputs decoded data F_A. The decoded data F_A is stored in the storage unit 84. Also, when it is determined that the table type bit TB is added, the decoding table TBL0_A extracts and outputs the table type bit TB added later when decoding the encoded data having the longer code length. The table type bit TB is sent to the selection determination unit 56.

このようにして、復号部VLD_A、VLD_Bは、符号化データE_n、E_n+1のビットパターンに応じたテーブル種別により、復号処理を行うことができる。   In this way, the decoding units VLD_A and VLD_B can perform the decoding process according to the table type corresponding to the bit pattern of the encoded data E_n and E_n + 1.

図27〜29は、第2の実施形態における可変長復号24の動作手順を説明するフローチャート図である。図27はメインルーチンを示し、図28、29はそれぞれサブルーチンを示す。図27のメインルーチンにおいて、まず、符号化データE_n、E_n+1のカウンタ変数nの値が「0」に初期設定される(S302)。次いで、復号済みの累積符号長Sum_A´が復号済みの累積符号長Sum_B´より短いとき、サブルーチンSR11が実行される。一方、復号済みの累積符号長Sum_A´が復号済みの累積符号長Sum_B´以上であるとき、サブルーチンSR12が実行される。サブルーチンSR11、SR12では、振分けデータCSが決定される。サブルーチンSR11、SR12は、それぞれ図28、29に示される。   FIGS. 27 to 29 are flowcharts for explaining the operation procedure of the variable length decoding 24 in the second embodiment. FIG. 27 shows a main routine, and FIGS. 28 and 29 show subroutines. In the main routine of FIG. 27, first, the value of the counter variable n of the encoded data E_n and E_n + 1 is initialized to “0” (S302). Next, when the decoded cumulative code length Sum_A ′ is shorter than the decoded cumulative code length Sum_B ′, the subroutine SR11 is executed. On the other hand, when the decoded cumulative code length Sum_A ′ is equal to or larger than the decoded cumulative code length Sum_B ′, the subroutine SR12 is executed. In subroutines SR11 and SR12, distribution data CS is determined. Subroutines SR11 and SR12 are shown in FIGS. 28 and 29, respectively.

サブルーチンSR11、SR12が終了し、振分けデータCSが「0」のとき(S306のYes)、復号データF_Aが復号データF_n、復号データF_Bが復号データF_n+1に対応するように並べ替えられる(S308)。一方、振分けデータCSが「1」のとき(S306のNo)、復号データF_Aが符号化データF_n+1、復号データF_Bが復号データF_nに対応するように並べ替えられる(S310)。そして、カウンタ変数nが「2」インクリメントされる(S312)。そして、処理単位の領域におけるすべての符号化データが復号されるまで、手順S304〜S312が繰り返される(S314のNo)。   When the subroutines SR11 and SR12 are completed and the distribution data CS is “0” (Yes in S306), the decoded data F_A is rearranged so as to correspond to the decoded data F_n and the decoded data F_B corresponds to the decoded data F_n + 1 (S308). On the other hand, when the distribution data CS is “1” (No in S306), rearrangement is performed so that the decoded data F_A corresponds to the encoded data F_n + 1 and the decoded data F_B corresponds to the decoded data F_n (S310). Then, the counter variable n is incremented by “2” (S312). Then, steps S304 to S312 are repeated until all the encoded data in the processing unit area is decoded (No in S314).

図28は、サブルーチンSR11の手順を示す。サブルーチンSR11は、復号済みの累積符号長Sum_A´が復号済みの累積符号長Sum_B´未満であるとき実行される。このとき、復号部VLD_A側で復号される符号化データE_Aの方が、復号部VLD_B側で復号される符号化データE_Bより符号長が長い。一方、符号長が短い方の符号化データE_Bが判定用符号化データである。また、符号化データE_Aは、テーブル種別TBL0で符号化されたものである。そして、その先頭ビットHB_Aにより、符号長が閾値(4ビット)以上か、閾値未満かが判定される。   FIG. 28 shows the procedure of the subroutine SR11. The subroutine SR11 is executed when the decoded cumulative code length Sum_A ′ is less than the decoded cumulative code length Sum_B ′. At this time, the encoded data E_A decoded on the decoding unit VLD_A side has a longer code length than the encoded data E_B decoded on the decoding unit VLD_B side. On the other hand, encoded data E_B having a shorter code length is the encoded data for determination. The encoded data E_A is encoded with the table type TBL0. Then, whether the code length is greater than or equal to a threshold (4 bits) or less than the threshold is determined based on the first bit HB_A.

符号化データE_Aの先頭ビットHB_Aが「1」のとき、符号化データE_Aの符号長は閾値未満である。よって、符号化データE_Bの符号長も閾値未満である。このとき、手順S320の判定結果はYesになる。すると、符号化データE_Aは、テーブル種別TBL0で復号される(S322)。次いで、復号済みの符号長SUM_A´に、符号化データE_Aの符号長L_Aが加算される(S324)。   When the first bit HB_A of the encoded data E_A is “1”, the code length of the encoded data E_A is less than the threshold value. Therefore, the code length of the encoded data E_B is also less than the threshold value. At this time, the determination result of step S320 is Yes. Then, the encoded data E_A is decoded with the table type TBL0 (S322). Next, the code length L_A of the encoded data E_A is added to the decoded code length SUM_A ′ (S324).

そして、符号長が短い方の、つまり判定用符号化データE_Bの先頭ビットHB_Bに基づいて、振分けが判定される。また、符号化データE_Bの符号長も閾値未満であるので、先頭ビットH_Bにより、復号するためのテーブル種別が判定される。判定用符号化データE_Bの先頭ビットHB_Bが「0」のとき(S326のYes)、判定用符号化データE_Bは符号化データE_nである。このことは、振分けA1(符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_A)が実行されたことを示す。よって、振分けデータCSが「1」に設定される(S328)。また、このことは、判定用符号化データE_Bがテーブル種別TBL1で符号化されたことを示す。よって、値「1」のテーブル種別ビットTBが生成される(S330)。なお、ここでは、符号化データE_A、E_Bの符号長がいずれも閾値未満であるので、符号化時にはテーブル種別ビットTBは付加されていない。よって、後の処理のために、テーブル種別ビットTBが生成される。   Then, the allocation is determined based on the shorter code length, that is, based on the first bit HB_B of the encoded data for determination E_B. Further, since the code length of the encoded data E_B is also less than the threshold value, the table type for decoding is determined by the head bit H_B. When the first bit HB_B of the determination encoded data E_B is “0” (Yes in S326), the determination encoded data E_B is the encoded data E_n. This indicates that the distribution A1 (encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_A) is executed. Therefore, the distribution data CS is set to “1” (S328). This also indicates that the determination encoded data E_B is encoded with the table type TBL1. Therefore, the table type bit TB having the value “1” is generated (S330). Here, since the code lengths of the encoded data E_A and E_B are both less than the threshold value, the table type bit TB is not added at the time of encoding. Therefore, the table type bit TB is generated for later processing.

一方、判定用符号化データE_Bの先頭ビットHB_Bが「1」のとき(S326のNo)、判定用符号化データE_Bは符号化データE_n+1である。このことは、振分けA0(符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B)が実行されたことを示す。よって、振分けデータCSが「0」に設定される(S332)。また、このことは、判定用符号化データE_Bがテーブル種別TBL0で符号化されたことを示す。よって、値「0」のテーブル種別ビットTBが生成される(S334)。   On the other hand, when the first bit HB_B of the determination encoded data E_B is “1” (No in S326), the determination encoded data E_B is the encoded data E_n + 1. This indicates that distribution A0 (encoded data E_n → accumulation unit VSFT_A, encoded data E_n + 1 → accumulation unit VSFT_B) has been executed. Therefore, the distribution data CS is set to “0” (S332). This also indicates that the determination encoded data E_B is encoded with the table type TBL0. Therefore, the table type bit TB having the value “0” is generated (S334).

また、手順S320で、符号化データE_Aの先頭ビットHB_Aが「0」のとき、符号化データE_Aの符号長は閾値以上である。このとき、手順S320の判定結果はNoになる。すると、符号化データE_Aがテーブル種別TBL0で復号される(S336)。そして、復号済みの符号長SUM_A´に、符号化データE_Aの符号長L_Aが加算される(S338)。そして、このとき、符号化時にテーブル種別ビットTBが付加されているので、符号化データE_Aからテーブル種別ビットTBが取得され(S340)、復号済みの符号長SUM_A´に1ビット分加算される(S342)。   In step S320, when the first bit HB_A of the encoded data E_A is “0”, the code length of the encoded data E_A is equal to or greater than the threshold value. At this time, the determination result of step S320 is No. Then, the encoded data E_A is decoded with the table type TBL0 (S336). Then, the code length L_A of the encoded data E_A is added to the decoded code length SUM_A ′ (S338). At this time, since the table type bit TB is added at the time of encoding, the table type bit TB is acquired from the encoded data E_A (S340), and one bit is added to the decoded code length SUM_A ′ ( S342).

次いで、判定用符号化データE_Bの先頭ビットHB_Bが「0」のとき(S344のYes)、振分けビットCSが「1」に設定される(S346)。このことは、振分けA1が実行されたことに対応する。一方、判定用符号化データE_Bの先頭ビットHB_Bが「1」のとき(S344のNo)、振分けビットCSが「0」に設定される(S348)。このことは、振分けA0が実行されたことに対応する。   Next, when the first bit HB_B of the determination encoded data E_B is “0” (Yes in S344), the distribution bit CS is set to “1” (S346). This corresponds to the execution of the distribution A1. On the other hand, when the first bit HB_B of the determination encoded data E_B is “1” (No in S344), the distribution bit CS is set to “0” (S348). This corresponds to the execution of distribution A0.

次いで、手順S350で、テーブル種別ビットTBの値が判定される。テーブル種別ビットTBが「0」のとき(S350のYes)、判定用符号化データE_Bは、テーブル種別TBL0で復号される(S352)。あるいは、テーブル種別ビットTBが「1」のとき(S350のNo)、判定用符号化データE_Bは、テーブル種別TBL1で復号される(S354)。そして、復号部VLD_B側の復号済み累積符号長Sum_B´に、符号化データE_Bの符号長L_Bが加算される(S356)。   Next, in step S350, the value of the table type bit TB is determined. When the table type bit TB is “0” (Yes in S350), the determination encoded data E_B is decoded with the table type TBL0 (S352). Alternatively, when the table type bit TB is “1” (No in S350), the determination encoded data E_B is decoded with the table type TBL1 (S354). Then, the code length L_B of the encoded data E_B is added to the decoded cumulative code length Sum_B ′ on the decoding unit VLD_B side (S356).

このようなサブルーチンSR11により、判定用符号化データE_Bの先頭ビットに基づいて、振分けデータCSが設定される。それとともに、判定用符号化データE_Bは、そのビットパターンに応じたテーブル種別で復号される。そして、図27の手順S306に移行する。   By such a subroutine SR11, the distribution data CS is set based on the first bit of the determination encoded data E_B. At the same time, the encoded determination data E_B is decoded with a table type corresponding to the bit pattern. Then, the process proceeds to step S306 in FIG.

図29は、サブルーチンSR12の手順を示す。サブルーチンSR12は、復号済みの累積符号長Sum_A´が復号済みの累積符号長Sum_B´以上であるとき実行される。このとき、符号化データE_Bの方が符号化データE_Aより符号長が長い。よって、符号化データE_Bは、テーブル種別TBL0で符号化されたものである。そして、その先頭ビットHB_Bより、符号長が閾値以上か、閾値未満かが判定される。また、符号化データE_Aが判定用符号化データである。   FIG. 29 shows the procedure of the subroutine SR12. The subroutine SR12 is executed when the decoded cumulative code length Sum_A ′ is equal to or larger than the decoded cumulative code length Sum_B ′. At this time, the encoded data E_B has a longer code length than the encoded data E_A. Therefore, the encoded data E_B is encoded with the table type TBL0. Then, from the head bit HB_B, it is determined whether the code length is equal to or larger than the threshold or less than the threshold. Also, the encoded data E_A is the determination encoded data.

符号化データE_Bの先頭ビットHB_Bが「1」のとき、符号化データE_Bの符号長は閾値未満である。よって、符号化データE_Aの符号長も閾値未満である。このとき、手順S360の判定結果はYesになる。すると、符号化データE_Bは、テーブル種別TBL0で復号される(S362)。次いで、復号済みの符号長SUM_B´に、符号化データE_Bの符号長L_Bが加算される(S364)。   When the first bit HB_B of the encoded data E_B is “1”, the code length of the encoded data E_B is less than the threshold value. Therefore, the code length of the encoded data E_A is also less than the threshold value. At this time, the determination result of step S360 is Yes. Then, the encoded data E_B is decoded with the table type TBL0 (S362). Next, the code length L_B of the encoded data E_B is added to the decoded code length SUM_B ′ (S364).

そして、符号長が短い方の、つまり判定用符号化データE_Aの先頭ビットHB_Aに基づいて、振分けが判定される。また、符号化データE_Aの符号長も閾値未満であるので、先頭ビットH_Aにより、復号するためのテーブル種別が判定される。判定用符号化データE_Aの先頭ビットHB_Aが「0」のとき(S366のYes)、判定用符号化データE_Aは符号化データE_nである。このことは、振分けA0(符号化データE_n→累積部VSFT_A、符号化データE_n+1→累積部VSFT_B)が実行されたことを示す。よって、振分けデータCSが「0」に設定される(S368)。また、このことは、判定用符号化データE_Aがテーブル種別TBL1で符号化されたことを示す。よって、値「1」のテーブル種別ビットTBが生成される(S370)。   Then, the allocation is determined based on the shorter code length, that is, based on the first bit HB_A of the determination encoded data E_A. Further, since the code length of the encoded data E_A is also less than the threshold value, the table type for decoding is determined by the head bit H_A. When the first bit HB_A of the determination encoded data E_A is “0” (Yes in S366), the determination encoded data E_A is the encoded data E_n. This indicates that distribution A0 (encoded data E_n → accumulation unit VSFT_A, encoded data E_n + 1 → accumulation unit VSFT_B) has been executed. Therefore, the distribution data CS is set to “0” (S368). This also indicates that the determination encoded data E_A is encoded with the table type TBL1. Therefore, the table type bit TB having the value “1” is generated (S370).

一方、判定用符号化データE_Aの先頭ビットHB_Aが「1」のとき(S366のNo)、判定用符号化データE_Aは符号化データE_n+1である。このことは、振分けA1(符号化データE_n→累積部VSFT_B、符号化データE_n+1→累積部VSFT_A)が実行されたことを示す。よって、振分けデータCSが「1」に設定される(S372)。また、このことは、判定用符号化データE_Aがテーブル種別TBL0で符号化されたことを示す。よって、値「0」のテーブル種別ビットTBが生成される(S374)。   On the other hand, when the first bit HB_A of the determination encoded data E_A is “1” (No in S366), the determination encoded data E_A is the encoded data E_n + 1. This indicates that the distribution A1 (encoded data E_n → accumulation unit VSFT_B, encoded data E_n + 1 → accumulation unit VSFT_A) is executed. Therefore, the distribution data CS is set to “1” (S372). This also indicates that the determination encoded data E_A is encoded with the table type TBL0. Therefore, the table type bit TB having the value “0” is generated (S374).

また、手順S360で、符号化データE_Bの先頭ビットHB_Bが「0」のとき、符号化データE_Bの符号長は閾値以上である。このとき、手順S360の判定結果はNoになる。すると、符号化データE_Bがテーブル種別TBL0で復号される(S376)。そして、復号済みの符号長SUM_B´に、符号化データE_Bの符号長L_Bが加算される(S378)。そして、このとき、符号化時にテーブル種別ビットTBが付加されているので、符号化データE_Bからテーブル種別ビットTBが取得され(S380)、復号済みの符号長SUM_B´に1ビット分加算される(S382)。   In step S360, when the first bit HB_B of the encoded data E_B is “0”, the code length of the encoded data E_B is equal to or greater than the threshold value. At this time, the determination result of step S360 is No. Then, the encoded data E_B is decoded with the table type TBL0 (S376). Then, the code length L_B of the encoded data E_B is added to the decoded code length SUM_B ′ (S378). At this time, since the table type bit TB is added at the time of encoding, the table type bit TB is acquired from the encoded data E_B (S380), and one bit is added to the decoded code length SUM_B ′ ( S382).

次いで、判定用符号化データE_Aの先頭ビットHB_Bが「0」のとき(S384のYes)、振分けビットCSが「0」に設定される(S386)。このことは、振分けA0が実行されたことに対応する。一方、判定用符号化データE_Aの先頭ビットHB_Bが「1」のとき(S384のNo)、振分けビットCSが「1」に設定される(S388)。このことは、振分けA1が実行されたことに対応する。   Next, when the first bit HB_B of the determination encoded data E_A is “0” (Yes in S384), the distribution bit CS is set to “0” (S386). This corresponds to the execution of distribution A0. On the other hand, when the first bit HB_B of the determination encoded data E_A is “1” (No in S384), the distribution bit CS is set to “1” (S388). This corresponds to the execution of the distribution A1.

次いで、手順S390で、テーブル種別ビットTBの値が判定される。テーブル種別ビットTBが「0」のとき(S390のYes)、判定用符号化データE_Aは、テーブル種別TBL0で復号される(S392)。あるいは、テーブル種別ビットTBが「1」のとき(S390のNo)、判定用符号化データE_Aは、テーブル種別TBL1で復号される(S394)。そして、復号部VLD_A側の復号済み累積符号長Sum_A´に、符号化データE_Aの符号長L_Aが加算される(S396)。   Next, in step S390, the value of the table type bit TB is determined. When the table type bit TB is “0” (Yes in S390), the determination encoded data E_A is decoded with the table type TBL0 (S392). Alternatively, when the table type bit TB is “1” (No in S390), the determination encoded data E_A is decoded with the table type TBL1 (S394). Then, the code length L_A of the encoded data E_A is added to the decoded cumulative code length Sum_A ′ on the decoding unit VLD_A side (S396).

このようなサブルーチンSR12により、判定用符号化データE_Aの先頭ビットに基づいて、振分けデータCSが設定される。それとともに、判定用符号化データE_Aは、そのビットパターンに応じたテーブル種別で復号される。そして、図27の手順S306に移行する。   By such a subroutine SR12, the distribution data CS is set based on the first bit of the determination encoded data E_A. At the same time, the encoded determination data E_A is decoded with a table type corresponding to the bit pattern. Then, the process proceeds to step S306 in FIG.

このような手順によれば、符号化データのビットパターンに基づいて並べ替えを行うことができる。それとともに、符号化データのビットパターンに応じたテーブル種別で復号を行うことができる。   According to such a procedure, rearrangement can be performed based on the bit pattern of the encoded data. At the same time, decoding can be performed with a table type corresponding to the bit pattern of the encoded data.

上述の説明では、符号長が短い方の符号化データを判定用符号化データとする例を示した。しかしながら、符号長が長い方の符号化データを判定用符号化データとする場合にも、第2の実施形態は適用される。   In the above description, an example in which encoded data having a shorter code length is used as determination encoded data has been described. However, the second embodiment is also applied to the case where the encoded data with the longer code length is used as the determination encoded data.

上述したように、第2の実施形態によれば、振分けデータの代わりに符号化データのビットパターンが振分けを示す情報を有するため、符号化データに振分けデータを付加する必要がない。一方、テーブル種別ビットは特定のパターンでのみ付加すれば良いので、実施例1と比べて符号長をより短くすることができる。よって、圧縮効率がさらに向上する。   As described above, according to the second embodiment, since the bit pattern of the encoded data has information indicating the distribution instead of the distribution data, it is not necessary to add the distribution data to the encoded data. On the other hand, since the table type bits need only be added in a specific pattern, the code length can be made shorter than in the first embodiment. Therefore, the compression efficiency is further improved.

なお、上述の説明では、可変長符号化部22と可変長復号部24が、単一のデータ処理装置に設けられる場合を示した。しかしながら、可変長復号部と可変長復号部は、それぞれ別個のデータ処理装置に設けることが可能である。たとえば、動画データを圧縮して送信する放送局側に可変長復号部を設け、受信局側に可変長復号部を設けてもよい。   In the above description, the variable length encoding unit 22 and the variable length decoding unit 24 are provided in a single data processing apparatus. However, the variable length decoding unit and the variable length decoding unit can be provided in separate data processing devices. For example, a variable length decoding unit may be provided on the broadcasting station side that compresses and transmits moving image data, and a variable length decoding unit may be provided on the receiving station side.

以上の実施の形態をまとめると、次の付記のとおりである。   The above embodiment is summarized as follows.

(付記1)
連続するN個(Nは複数)の可変長符号化された符号化データをそれぞれ累積するN個の累積部と、
前記符号化データを前記N個の累積部のいずれかに、当該N個の累積部における前記符号化データの累積符号長の差が小さくなるように振り分ける振分部を有し、
前記振分部は、前記N個の符号化データの前記N個の累積部への振分けを示す振分けデータを生成することを特徴としたデータ処理装置。
(Appendix 1)
N accumulation units each accumulating N (N is a plurality) continuous variable-length encoded data,
A distribution unit that distributes the encoded data to any of the N accumulation units so that a difference in accumulated code lengths of the encoded data in the N accumulation units is small;
The data processing apparatus, wherein the distribution unit generates distribution data indicating distribution of the N encoded data to the N accumulation units.

(付記2)
付記1において、
前記N個の累積部に累積された符号化データを所定のビット数ずつ連結してビット列を生成する生成部を有するデータ処理装置。
(Appendix 2)
In Appendix 1,
A data processing apparatus having a generating unit that generates a bit string by connecting encoded data accumulated in the N accumulating units by a predetermined number of bits.

(付記3)
連続する2個の可変長符号化された符号化データをそれぞれ累積する2個の累積部と、
前記符号化データを前記2個の累積部のいずれかに、当該2個の累積部における前記符号化データの累積符号長の差が小さくなるように振り分ける振分部を有し、
前記累積部は、2個の前記符号化データのうち符号長が長い方または短い方の第1の符号化データを、当該2個の符号化データにおける順序に応じて第1のビットパターンまたはそれが反転した第2のビットパターンで累積することを特徴としたデータ処理装置。
(Appendix 3)
Two accumulating units for accumulating two consecutive variable-length encoded data,
A distribution unit that distributes the encoded data to one of the two accumulation units so that the difference in the accumulated code length of the encoded data in the two accumulation units is small;
The accumulating unit selects the first encoded data having the longer or shorter code length of the two encoded data, the first bit pattern or the first encoded data according to the order of the two encoded data. A data processing apparatus characterized by accumulating with the inverted second bit pattern.

(付記4)
付記3において、
前記2個の累積部に累積された符号化データを所定のビット数ずつ連結してビット列を生成する生成部を有するデータ処理装置。
(Appendix 4)
In Appendix 3,
A data processing apparatus having a generating unit that generates a bit string by connecting encoded data accumulated in the two accumulating units by a predetermined number of bits.

(付記5)
付記1乃至2のいずれかのデータ処理装置が生成した符号化データを処理するデータ処理装置であって、
前記符号化データをそれぞれ並列して復号するN個の復号部と、
前記N個の復号部によりそれぞれ復号されたN個の復号データを前記N個の符号化データの前記N個の累積部への振分けを示す振分けデータに従ってもとの順序に並べ替える並替部とを有するデータ処理装置。
(Appendix 5)
A data processing device that processes encoded data generated by any one of the data processing devices according to appendixes 1 and 2,
N decoding units that respectively decode the encoded data in parallel;
A rearrangement unit that rearranges the N decoded data respectively decoded by the N decoding units in an original order according to distribution data indicating distribution of the N encoded data to the N accumulation units; A data processing apparatus.

(付記6)
付記3乃至4のいずれかのデータ処理装置が生成した符号化データを処理するデータ処理装置であって、
前記符号化データをそれぞれ並列して復号する2個の復号部と、
前記2個の復号部によりそれぞれ復号された2個の復号データをもとの順序に並べ替える並替部とを有し、
前記並替部は、前記第1の符号化データのビットパターンに基づいて、前記2つの符号化データから復号される2個の前記復号データをもとの順序に並べ替えるデータ処理装置。
(Appendix 6)
A data processing device that processes encoded data generated by any of the data processing devices according to attachments 3 to 4,
Two decoding units that respectively decode the encoded data in parallel;
A rearrangement unit that rearranges the two decoded data respectively decoded by the two decoding units in the original order;
The rearranger rearranges the two decoded data decoded from the two encoded data in the original order based on the bit pattern of the first encoded data.

(付記7)
連続するN個(Nは複数)の可変長符号化された符号化データをそれぞれ累積するN個の累積部と、
前記N個の累積部に累積された符号化データを所定のビット数ずつ連結し、さらに前記振分けデータを連結してビット列を生成する生成部と、
前記ビット列に含まれる前記符号化データをそれぞれ並列して復号するN個の復号部と、
前記N個の復号部によりそれぞれ復号されたN個の復号データを前記振分部による振分けに従ってもとの順序に並べ替える並替部とを有するデータ処理装置。
(Appendix 7)
N accumulation units each accumulating N (N is a plurality) continuous variable-length encoded data,
A generating unit that concatenates encoded data accumulated in the N accumulating units by a predetermined number of bits, and further concatenates the distribution data to generate a bit string;
N decoding units that respectively decode the encoded data included in the bit string in parallel;
A data processing apparatus comprising: a rearrangement unit that rearranges the N decoded data decoded by the N decoding units in an original order according to the distribution by the distribution unit.

(付記8)
付記7において、
前記符号化データを前記N個の累積部のいずれかに、当該N個の累積部における前記符号化データの累積符号長の差が小さくなるように振り分ける振分部を含むデータ処理装置。
(Appendix 8)
In Appendix 7,
A data processing apparatus including a distribution unit that distributes the encoded data to any one of the N accumulation units so that a difference in accumulated code length of the encoded data in the N accumulation units is small.

(付記9)
付記7または8において、
前記振分部は、前記N個の符号化データの前記N個の累積部への振分けを示す振分けデータを生成し、
前記並替部は、前記N個の復号データを前記振分けデータに基づいてもとの順序に並べ替えるデータ処理装置。
(Appendix 9)
In Appendix 7 or 8,
The distribution unit generates distribution data indicating distribution of the N encoded data to the N accumulation units;
The rearranger rearranges the N pieces of decoded data in an original order based on the distribution data.

(付記10)
付記7または8において、
N=2であり、
前記累積部は、2個の前記符号化データのうち符号長が長い方または短い方の第1の符号化データを、当該2個の符号化データにおける順序に応じて第1のビットパターンまたはそれが反転した第2のビットパターンで累積し、
前記並替部は、前記第1の符号化データのビットパターンに基づいて、前記2つの符号化データから復号される2個の前記復号データをもとの順序に並べ替えるデータ処理装置。
(Appendix 10)
In Appendix 7 or 8,
N = 2,
The accumulating unit selects the first encoded data having the longer or shorter code length of the two encoded data, the first bit pattern or the first encoded data according to the order of the two encoded data. Is accumulated in the inverted second bit pattern,
The rearranger rearranges the two decoded data decoded from the two encoded data in the original order based on the bit pattern of the first encoded data.

(付記11)
付記7乃至10のいずれかにおいて、
前記ビット列を前記所定のビット数ずつ分割して、前記N個の復号部が復号するためのN個の前記符号化データを復元する復元部とを有するデータ処理装置。
(Appendix 11)
In any one of appendixes 7 to 10,
A data processing apparatus comprising: a restoration unit that divides the bit sequence by the predetermined number of bits and restores the N pieces of encoded data for the N decoding units to decode.

(付記12)
付記9において、
前記ビット列を前記所定のビット数ずつ分割して、前記N個の復号部が復号するためのN個の前記符号化データと、前記並替部が前記N個の復号データを並べ替えるための前記振分けデータとを復元する復元部とを有するデータ処理装置。
(Appendix 12)
In Appendix 9,
The bit sequence is divided by the predetermined number of bits, and the N pieces of encoded data for the N decoding units to decode and the rearrangement unit for rearranging the N pieces of decoded data A data processing apparatus having a restoration unit for restoring distribution data.

(付記13)
付記11または12において、
前記生成部により生成される前記ビット列は外部に出力された後、当該外部から取り込まれて前記復元部に入力されるデータ処理装置。
(Appendix 13)
In Appendix 11 or 12,
The data processing apparatus in which the bit string generated by the generation unit is output to the outside, and is then taken in from the outside and input to the restoration unit.

(付記14)
連続するN個(Nは複数)の可変長符号化された符号化データをそれぞれ累積するN個の累積部のいずれかに、当該N個の累積部における前記符号化データの累積符号長の差が小さくなるように前記符号化データが振り分けられ、前記N個の累積部に累積された前記符号化データをそれぞれ並列して復号するN個の復号部と、
前記N個の復号部によりそれぞれ復号されたN個の復号データを前記振分部による振分けに従ってもとの順序に並べ替える並替部とを有するデータ処理装置。
(Appendix 14)
The accumulated code length difference of the encoded data in the N accumulating units is added to any one of the N accumulating units that accumulate N consecutive (N is plural) variable-length encoded data. The encoded data is distributed so as to be smaller, and the N decoding units that decode the encoded data accumulated in the N accumulating units in parallel, and
A data processing apparatus comprising: a rearrangement unit that rearranges the N decoded data decoded by the N decoding units in an original order according to the distribution by the distribution unit.

(付記15)
付記14において、
前記並替部は、前記N個の符号化データの前記N個の累積部への振分けを示す振分けデータに基づいて、前記N個の復号データをもとの順序に並べ替えるデータ処理装置。
(Appendix 15)
In Appendix 14,
The rearranger rearranges the N decoded data in the original order based on distribution data indicating distribution of the N encoded data to the N accumulation units.

(付記16)
付記14において、
N=2であり、
前記累積部では、2個の前記符号化データのうち符号長が長い方または短い方の第1の符号化データが、当該2個の符号化データにおける順序に応じて第1のビットパターンまたはそれが反転した第2のビットパターンで累積され、
前記並替部は、前記第1の符号化データのビットパターンに基づいて、前記2つの符号化データから復号される2個の前記復号データをもとの順序に並べ替えるデータ処理装置。
(Appendix 16)
In Appendix 14,
N = 2,
In the accumulating unit, the first encoded data having the longer or shorter code length of the two encoded data is the first bit pattern or the first bit pattern according to the order of the two encoded data. Are accumulated in the inverted second bit pattern,
The rearranger rearranges the two decoded data decoded from the two encoded data in the original order based on the bit pattern of the first encoded data.

(付記17)
付記14乃至16のいずれかにおいて、
前記N個の累積部に累積された符号化データが所定のビット数ずつ連結されたビット列を前記所定のビット数ずつ分割して、前記N個の復号部が復号するためのN個の前記符号化データを復元する復元部を有するデータ処理装置。
(Appendix 17)
In any one of appendixes 14 to 16,
The N number of codes to be decoded by the N decoding units by dividing the bit string in which the encoded data accumulated in the N accumulating units are connected by a predetermined number of bits by the predetermined number of bits. Data processing apparatus having a restoration unit for restoring digitized data.

(付記18)
付記15において、
前記N個の累積部に累積された符号化データが所定のビット数ずつ連結され、さらに前記振分けデータが連結されたビット列を前記所定のビット数ずつ分割して、前記N個の復号部が復号するためのN個の前記符号化データと、前記並替部が前記N個の復号データを並べ替えるための前記振分けデータとを復元する復元部を有するデータ処理装置。
(Appendix 18)
In Appendix 15,
The encoded data accumulated in the N accumulating units is connected by a predetermined number of bits, and the bit string to which the distribution data is concatenated is divided by the predetermined number of bits, and the N decoding units decode A data processing apparatus comprising: a restoration unit that restores the N encoded data to be performed and the distribution data for the rearrangement unit to rearrange the N decoded data.

(付記19)
連続するN個(Nは複数)の可変長符号化された符号化データをそれぞれ累積するN個の累積部と、
前記符号化データを前記N個の累積部のいずれかに、当該N個の累積部における前記符号化データの累積符号長の差が小さくなるように振り分ける振分部とを有し、
前記N個の累積部に累積された前記符号化データが、N個の復号部によりそれぞれ並列して復号され、前記N個の復号部によりそれぞれ復号されたN個の復号データが、前記振分部による振分けに従ってもとの順序に並べ替えられるデータ処理装置。
(Appendix 19)
N accumulation units each accumulating N (N is a plurality) continuous variable-length encoded data,
A distribution unit that distributes the encoded data to any of the N accumulation units so that a difference in accumulated code lengths of the encoded data in the N accumulation units is small;
The encoded data accumulated in the N accumulators is decoded in parallel by N decoders, and the N decoded data respectively decoded by the N decoders are allocated to the distribution unit. A data processing device that can be rearranged in the original order according to the distribution by the section.

(付記20)
付記19において、
前記振分部は、前記N個の符号化データの前記N個の累積部への振分けを示す振分けデータを生成し、
前記N個の復号データが前記振分けデータに基づいてもとの順序に並べ替えられるデータ処理装置。
(Appendix 20)
In Appendix 19,
The distribution unit generates distribution data indicating distribution of the N encoded data to the N accumulation units;
A data processing device in which the N pieces of decoded data are rearranged in an original order based on the distribution data.

(付記21)
付記19において、
N=2であり、
前記累積部は、2個の前記符号化データのうち符号長が長い方または短い方の第1の符号化データを、当該2個の符号化データにおける順序に応じて第1のビットパターンまたはそれが反転した第2のビットパターンで累積し、
前記第1の符号化データのビットパターンに基づいて、前記2つの符号化データから復号される2個の前記復号データがもとの順序に並べ替えられるデータ処理装置。
(Appendix 21)
In Appendix 19,
N = 2,
The accumulating unit selects the first encoded data having the longer or shorter code length of the two encoded data, the first bit pattern or the first encoded data according to the order of the two encoded data. Is accumulated in the inverted second bit pattern,
A data processing device in which two pieces of the decoded data decoded from the two encoded data are rearranged in an original order based on a bit pattern of the first encoded data.

(付記22)
付記19乃至21のいずれかにおいて、
前記N個の累積部に累積された符号化データを所定のビット数ずつ連結してビット列を生成する生成部をさらに有し、
前記ビット列が前記所定のビット数ずつ分割され、前記N個の復号部が復号するためのN個の前記符号化データが復元されるデータ処理装置。
(Appendix 22)
In any one of supplementary notes 19 to 21,
A generating unit that generates a bit string by connecting the encoded data accumulated in the N accumulating units by a predetermined number of bits;
A data processing device in which the bit string is divided by the predetermined number of bits, and the N pieces of encoded data to be decoded by the N decoding units are restored.

(付記23)
付記20において、
前記N個の累積部に累積された符号化データを所定のビット数ずつ連結し、さらに前記振分けデータを連結してビット列を生成する生成部をさらに有し、
前記ビット列が前記所定のビット数ずつ分割され、前記N個の復号部が復号するためのN個の前記符号化データと、前記並替部が前記N個の復号データを並べ替えるための前記振分けデータとが復元されるデータ処理装置。
(Appendix 23)
In Appendix 20,
The encoded data accumulated in the N accumulating units is connected by a predetermined number of bits, and further includes a generating unit that generates a bit string by connecting the distribution data.
The bit string is divided by the predetermined number of bits, and the N pieces of encoded data for the N decoding units to decode and the sorting for the rearrangement unit to rearrange the N decoded data. Data processing device that restores data.

(付記24)
連続するN個(Nは複数)の可変長符号化された符号化データをそれぞれ累積するN個の累積部のいずれかに、前記符号化データを、当該N個の累積部における前記符号化データの累積符号長の差が小さくなるような振分けで振り分け、
前記N個の累積部に累積された前記符号化データをそれぞれ並列して復号し、
前記復号されたN個の復号データを前記振分けに従ってもとの順序に並べ替える、
データ処理方法。
(Appendix 24)
The encoded data is transferred to any one of N accumulation units that accumulate N (N is a plurality) continuous variable-length encoded data, and the encoded data in the N accumulation units. Sorting by sorting so that the difference in the accumulated code length of
Decoding the encoded data accumulated in the N accumulation units in parallel;
Reordering the decoded N pieces of decoded data in the original order according to the distribution;
Data processing method.

(付記25)
付記24において、
前記振分けでは、前記N個の符号化データの前記N個の累積部への振分けを示す振分けデータを生成し、
前記N個の復号データを前記振分けデータに基づいてもとの順序に並べ替える、
データ処理方法。
(Appendix 25)
In Appendix 24,
In the distribution, generating distribution data indicating distribution of the N encoded data to the N accumulation units;
Reordering the N pieces of decoded data in the original order based on the distribution data;
Data processing method.

(付記26)
付記24において、
N=2であり、
前記累積部に、2個の前記符号化データのうち符号長が長い方または短い方の第1の符号化データを、当該2個の符号化データにおける順序に応じて第1のビットパターンまたはそれが反転した第2のビットパターンで累積し、
前記第1の符号化データのビットパターンに基づいて、前記2つの符号化データから復号される2個の前記復号データをもとの順序に並べ替える、
データ処理方法。
(Appendix 26)
In Appendix 24,
N = 2,
In the accumulating unit, the first encoded data having the longer or shorter code length of the two encoded data, the first bit pattern or the first encoded data depending on the order of the two encoded data. Is accumulated in the inverted second bit pattern,
Based on the bit pattern of the first encoded data, rearrange the two decoded data decoded from the two encoded data in the original order,
Data processing method.

(付記27)
付記24乃至26のいずれかにおいて、
前記N個の累積部に累積された符号化データを所定のビット数ずつ連結してビット列を生成し、
前記ビット列を前記所定のビット数ずつ分割して、前記N個の復号部が復号するためのN個の前記符号化データを復元する、
データ処理方法。
(Appendix 27)
In any one of appendices 24 to 26,
A bit string is generated by concatenating the encoded data accumulated in the N accumulation units by a predetermined number of bits,
Dividing the bit string by the predetermined number of bits to restore the N encoded data for the N decoding units to decode;
Data processing method.

(付記28)
付記25において、
前記N個の累積部に累積された符号化データを所定のビット数ずつ連結し、さらに前記振分けデータを連結してビット列を生成し、
前記ビット列を前記所定のビット数ずつ分割して、N個の復号データに復号するためのN個の前記符号化データと、前記N個の復号データを並べ替えるための前記振分けデータとを復元する、
データ処理方法。
(Appendix 28)
In Appendix 25,
The encoded data accumulated in the N accumulating units is connected by a predetermined number of bits, and further, the distribution data is connected to generate a bit string,
Dividing the bit string by the predetermined number of bits to restore N encoded data for decoding into N decoded data and the distribution data for rearranging the N decoded data ,
Data processing method.

14:画像圧縮展開部、 22:可変長符号化部、 24:可変長復号部、 30:振分部、40:ビット列生成部、 50:並替部、 46:符号化データ復元部、
E_n:符号化データ、 F_n:復号データ、 VSFT_A、VSFT_B:累積部、
VLD_A、VLD_B:復号部
14: Image compression / decompression unit, 22: Variable length coding unit, 24: Variable length decoding unit, 30: Distribution unit, 40: Bit string generation unit, 50: Rearrangement unit, 46: Encoded data restoration unit,
E_n: encoded data, F_n: decoded data, VSFT_A, VSFT_B: accumulating unit,
VLD_A, VLD_B: decoding unit

Claims (10)

続して入力される可変長符号化された符号化データの各々単位として累積するN個(Nは2以上の整数)の累積部
入力される前記符号化データを、前記N個の累積部のうちで、各累積部がすでに累積した符号化データの累積符号長が短い累積部に振り分け、前記符号化データの振分けを示す振分けデータを生成する振分部
前記N個の累積部に振り分けられた符号化データと前記振り分けデータとを含む信号列を生成する生成部とを有することを特徴としたデータ処理装置。
And accumulation of N number of accumulating (N is an integer of 2 or more) each of the coded data variable-length encoded consecutive to the input units,
The input encoded data is distributed among the N accumulating units to an accumulating unit with a short accumulated code length of the encoded data already accumulated by each accumulating unit, and distribution data indicating the distribution of the encoded data and a distribution unit to generate,
A data processing apparatus comprising: a generation unit that generates a signal sequence including the encoded data distributed to the N accumulation units and the distribution data.
続して入力される可変長符号化された符号化データの各々単位として累積する2個の累積部と、
入力される前記符号化データを、前記2個の累積部のうちで、各累積部がすでに累積した符号化データの累積符号長が短い累積部に振り分ける振分部
前記N個の累積部に累積された符号化データを所定のビット数ずつ連結してビット列を生成する生成部とを有し、
前記累積部は、2個の前記符号化データのうち符号長が長い方または短い方の符号化データを、前記2個の累積部への振分けを示す、第1のビットパターンまたは当該第1のビットパターンが反転した第2のビットパターンで累積し、
前記生成部は、前記2個の累積部への振分けを示す第1のビットパターン、前記2個の累積部への振分けを示す第2のビットパターンを連結してビット列を生成する
することを特徴としたデータ処理装置。
And two accumulator for accumulating each of the coded data variable-length encoded consecutive to the input units,
The coded data input, among the two accumulator, and a distribution unit for distributing the accumulator accumulated code length shorter coded data each accumulator has already accumulated,
Generating a bit string by concatenating the encoded data accumulated in the N accumulation units by a predetermined number of bits ;
The accumulation unit, two of the encoded sign-coded data having a code length of the longer or shorter of the data, said indicating the distribution of the two accumulator, a first bit pattern or the first Are accumulated in a second bit pattern that is inverted ,
The generating unit generates a bit string by connecting a first bit pattern indicating distribution to the two accumulating units and a second bit pattern indicating distribution to the two accumulating units. Data processing device.
続して入力される可変長符号化された符号化データの各々単位として累積するN個(Nは2以上の整数)の累積部と、
入力される前記符号化データを、前記N個の累積部のうちで、各累積部がすでに累積した符号化データの累積符号長が短い累積部に振り分け、前記符号化データの振分けを示す振分けデータを生成する振分部と、
前記N個の累積部に振り分けられた符号化データと前記振り分けデータとを含む信号列を生成する生成部と、
前記信号列に含まれる前記符号化データをそれぞれ並列して復号するN個の復号部と、
前記N個の復号部によりそれぞれ復号されたN個の復号データを、前記振り分けデータに基づいて、もとの順序に並べ替える並替部とを有することを特徴としたデータ処理装置。
And accumulation of N number of accumulating (N is an integer of 2 or more) each of the coded data variable-length encoded consecutive to the input units,
The input encoded data is distributed among the N accumulating units to an accumulating unit with a short accumulated code length of the encoded data already accumulated by each accumulating unit, and distribution data indicating the distribution of the encoded data A distribution unit for generating
A generation unit that generates a signal sequence including the encoded data distributed to the N accumulation units and the distribution data ;
N decoding units that respectively decode the encoded data included in the signal sequence in parallel;
A data processing apparatus comprising: a rearranging unit that rearranges the N decoded data respectively decoded by the N decoding units in an original order based on the distribution data .
連続して入力される可変長符号化された符号化データの各々を単位として累積する2個の累積部と、  Two accumulating units for accumulating each piece of variable length encoded encoded data that is continuously input as a unit;
入力される前記符号化データを、前記2個の累積部のうちで、各累積部がすでに累積した符号化データの累積符号長が短い累積部に振り分ける振分部と、  A distribution unit that distributes the input encoded data to an accumulation unit having a short accumulation code length of the encoded data that each accumulation unit has already accumulated among the two accumulation units;
前記2個の累積部に累積された符号化データを所定のビット数ずつ連結してビット列を生成する生成部と、  A generating unit that generates a bit string by connecting the encoded data accumulated in the two accumulating units by a predetermined number of bits;
前記ビット列に含まれる前記符号化データをそれぞれ並列して復号する2個の復号部と、  Two decoding units that respectively decode the encoded data included in the bit string in parallel;
前記2個の復号部によりそれぞれ復号された2個の復号データを前記振分部による振分けに従ってもとの順序に並べ替える並替部とを有し、  A rearrangement unit that rearranges the two decoded data respectively decoded by the two decoding units in the original order according to the distribution by the distribution unit;
前記累積部は、2個の前記符号化データのうち符号長が長い方または短い方の符号化データを、前記2個の累積部への振分けを示す、第1のビットパターンまたは当該第1のビットパターンが反転した第2のビットパターンで累積し、  The accumulating unit includes a first bit pattern or the first bit indicating the distribution of the encoded data having the longer or shorter code length of the two encoded data to the two accumulating units. Accumulate in the second bit pattern that the bit pattern is inverted,
前記生成部は、前記2個の累積部への振分けを示す第1のビットパターン、前記2個の累積部への振分けを示す第2のビットパターンを連結してビット列を生成し、The generation unit generates a bit string by concatenating a first bit pattern indicating distribution to the two accumulation units and a second bit pattern indicating distribution to the two accumulation units,
前記並替部は、前記ビットパターンに基づいて、前記2個の符号化データから復号される2個の前記復号データをもとの順序に並べ替えることを特徴としたデータ処理装置。The rearranger rearranges the two decoded data decoded from the two encoded data in the original order based on the bit pattern.
請求項3において、
前記ビット列を前記所定のビット数ずつ分割して、前記N個の復号部が復号するためのN個の前記符号化データと、前記並替部が前記N個の復号データを並べ替えるための前記振分けデータとを復元する復元部を有するデータ処理装置。
Oite to claim 3,
The bit sequence is divided by the predetermined number of bits, and the N pieces of encoded data for the N decoding units to decode and the rearrangement unit for rearranging the N pieces of decoded data A data processing apparatus having a restoration unit for restoring distribution data .
請求項において、
前記ビット列を前記所定のビット数ずつ分割して、前記N個の復号部が復号するためのN個の前記符号化データを復元する復元部とを有するデータ処理装置。
In claim 4 ,
Wherein the bit sequence is divided by said number of predetermined bits, the data processing device and a restoring unit for restoring the N pieces of the encoded data for the N decoder decodes.
請求項またはにおいて、
前記生成部により生成される前記ビット列は外部に出力された後、当該外部から取り込まれて前記復元部に入力されるデータ処理装置。
In claim 5 or 6 ,
The data processing apparatus in which the bit string generated by the generation unit is output to the outside, and is then taken in from the outside and input to the restoration unit.
連続して入力される可変長符号化された符号化データの各々を単位として累積するN個(Nは2以上の整数)の累積部と、入力される前記符号化データを、前記N個の累積部のうちで、各累積部がすでに累積した符号化データの累積符号長が短い累積部に振り分け、前記符号化データの振分けを示す振分けデータを生成する振分部と、前記N個の累積部に振り分けられた符号化データと前記振り分けデータとを含む信号列を生成する生成部とを有する装置から入力された前記信号列に含まれる前記符号化データをそれぞれ並列して復号するN個の復号部と、
前記N個の復号部によりそれぞれ復号されたN個の復号データを、前記振り分けデータに基づいて、もとの順序に並べ替える並替部とを有することを特徴としたデータ処理装置。
N pieces (N is an integer of 2 or more) of accumulation units that accumulate each unit of variable length encoded encoded data that is continuously input, and the encoded data that is input are the N pieces of encoded data. Of the accumulating units, the accumulating unit allocates the accumulated data already accumulated to the accumulating unit having a short accumulated code length, generates a distribution data indicating the distribution of the encoded data, and the N accumulations N pieces of decoded data included in the signal sequence input from an apparatus having a generation unit that generates encoded data distributed to each unit and a signal sequence including the distributed data A decryption unit;
A data processing apparatus comprising: a rearranging unit that rearranges the N decoded data respectively decoded by the N decoding units in an original order based on the distribution data .
可変長符号化された符号化データを連続して入力し、  Continuously input variable length encoded data,
入力される前記符号化データを、連続して入力される前記符号化データの各々を単位として累積するN個(Nは2以上の整数)の累積部のうちで、各累積部がすでに累積した符号化データの累積符号長が短い累積部に振り分け、前記符号化データの振分けを示す振分けデータを生成し、  Of the N accumulation units (N is an integer equal to or greater than 2) accumulation units, each accumulation unit has already accumulated, with the encoded data input being accumulated in units of each of the encoded data input continuously. Distributing the accumulated code length of the encoded data to a short accumulating part, generating distribution data indicating the distribution of the encoded data,
前記N個の累積部に振り分けられた符号化データと前記振り分けデータとを含む信号列を生成する、  Generating a signal sequence including the encoded data distributed to the N accumulation units and the distributed data;
ことを特徴としたデータ処理方法。  A data processing method characterized by that.
可変長符号化された符号化データを連続して入力し、  Continuously input variable length encoded data,
入力される前記符号化データを、連続して入力される前記符号化データの各々を単位として累積する2個の累積部のうちで、各累積部がすでに累積した符号化データの累積符号長が短い累積部に振り分けて累積し、  Of the two accumulating units that accumulate the inputted encoded data in units of each of the continuously inputted encoded data, the accumulated code length of the encoded data already accumulated by each accumulating unit is It sorts and accumulates in a short accumulation part,
前記2個の累積部に累積された符号化データを所定のビット数ずつ連結してビット列を生成し、  A bit string is generated by concatenating the encoded data accumulated in the two accumulating units by a predetermined number of bits,
前記累積において、2個の前記符号化データのうち符号長が長い方または短い方の符号化データを、前記2個の累積部への振分けを示す、第1のビットパターンまたは当該第1のビットパターンが反転した第2のビットパターンで累積し、  In the accumulation, the first bit pattern or the first bit indicating the distribution of the encoded data having the longer or shorter code length of the two encoded data to the two accumulating units Accumulate in the second bit pattern with inverted pattern,
前記ビット列の生成において、前記2個の累積部への振分けを示す第1のビットパターン、前記2個の累積部への振分けを示す第2のビットパターンを連結してビット列を生成  In the generation of the bit string, a bit string is generated by concatenating a first bit pattern indicating distribution to the two accumulation units and a second bit pattern indicating distribution to the two accumulation units.
することを特徴としたデータ処理方法。  A data processing method characterized by:
JP2011114413A 2011-05-23 2011-05-23 Data processing apparatus and data processing method Expired - Fee Related JP5742464B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011114413A JP5742464B2 (en) 2011-05-23 2011-05-23 Data processing apparatus and data processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011114413A JP5742464B2 (en) 2011-05-23 2011-05-23 Data processing apparatus and data processing method

Publications (2)

Publication Number Publication Date
JP2012244519A JP2012244519A (en) 2012-12-10
JP5742464B2 true JP5742464B2 (en) 2015-07-01

Family

ID=47465721

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011114413A Expired - Fee Related JP5742464B2 (en) 2011-05-23 2011-05-23 Data processing apparatus and data processing method

Country Status (1)

Country Link
JP (1) JP5742464B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11381250B2 (en) 2020-02-10 2022-07-05 Kioxia Corporation Decode device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6445796B2 (en) * 2014-06-27 2018-12-26 シャープ株式会社 Image obfuscation apparatus, image obfuscation method, program, and recording medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2685283B2 (en) * 1989-04-17 1997-12-03 富士通株式会社 Communication method, parallel variable-length coding circuit, and parallel variable-length decoding circuit
EP0631440A3 (en) * 1993-06-23 1995-02-22 Daewoo Electronics Co Ltd Apparatus for parallel decoding of variable length encoded image signals.
JP3193288B2 (en) * 1995-08-03 2001-07-30 株式会社エヌ・ティ・ティ・ドコモ Variable length code data transmission device
JPH11215009A (en) * 1998-01-22 1999-08-06 Sony Corp Code decoding device
JP4087615B2 (en) * 2002-02-12 2008-05-21 株式会社フォトロン High-speed imaging device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11381250B2 (en) 2020-02-10 2022-07-05 Kioxia Corporation Decode device

Also Published As

Publication number Publication date
JP2012244519A (en) 2012-12-10

Similar Documents

Publication Publication Date Title
EA024522B1 (en) Video encoding device and video decoding device
US20090310678A1 (en) Image encoding apparatus, method of controlling the same and computer program
JP2006197610A (en) Context-adaptive variable length coding apparatus and methods
JP5742464B2 (en) Data processing apparatus and data processing method
JP2019525583A (en) Bit packing for delta color compression
US6020923A (en) Method and apparatus for coding and recording an image signal and recording medium for storing an image signal
JP5067361B2 (en) Encoder and decoder, encoding method and decoding method, and recording medium
JP5903597B2 (en) Image compression apparatus, image expansion apparatus, and image processing apparatus
JP2011049764A (en) Data compression and decompression device
JP2001515687A (en) Encoding device for converting an n-bit source word to a corresponding m-bit channel word, and an inverse decoding device
JP2015012483A (en) Image encoding apparatus, image encoding method, image encoding program, image decoding apparatus, image decoding method, and image decoding program
JP6551073B2 (en) Image coding apparatus and method, and image decoding apparatus and method
JP5845202B2 (en) Image compression apparatus and image processing system
CN103034455B (en) Based on data message buffer memory management method and the system of Decoding Analysis in advance
JP5070086B2 (en) Data compression apparatus and image reading apparatus
JP5504885B2 (en) Image processing apparatus and image processing method
KR100916535B1 (en) Recorded medium having program for coding and decoding using Bit Precision, and Apparatus and Method there of
JP2012244235A (en) Data compression method, apparatus, and program
JP2013074315A (en) Image processor and image processing system
JP6405667B2 (en) Data restoration apparatus and data generation method
JP4133357B2 (en) Image coding apparatus and image coding method
JP2010276686A (en) Image control apparatus
JP4945321B2 (en) Image decoding apparatus, image decoding method, and image decoding program
JP2020061622A (en) Image compression circuit and image compression method
JP5158019B2 (en) Decoding device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141209

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150209

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: 20150407

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150420

R150 Certificate of patent or registration of utility model

Ref document number: 5742464

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees