JP2003174366A - Data decoding apparatus and method - Google Patents
Data decoding apparatus and methodInfo
- Publication number
- JP2003174366A JP2003174366A JP2001370406A JP2001370406A JP2003174366A JP 2003174366 A JP2003174366 A JP 2003174366A JP 2001370406 A JP2001370406 A JP 2001370406A JP 2001370406 A JP2001370406 A JP 2001370406A JP 2003174366 A JP2003174366 A JP 2003174366A
- Authority
- JP
- Japan
- Prior art keywords
- data
- length
- decoded
- decoding
- generated
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
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)
Abstract
(57)【要約】
【課題】JPEG符号化されたデータストリームを、簡
易な構成で高速に復号化できるデータ復号化装置および
その方法を提供する。
【解決手段】第1の復号部20は、データストリームD
inの先頭に含まれる全てのハフマン符号を復号化で
き、第2の復号部41〜44は5ビット長までのハフマ
ン符号が復号化できる復号テーブルをそれぞれ有してい
る。1つ目の符号化データのデータ長L1によって、復
号化するデータ位置が1ビットづつずれた複数の第2の
復号部の中から1つが選択され、その復号化データRS
2に応じて、2つ目の符号化データ長L2が算出され
る。データ長L2とデータ長L1との和に応じて、デー
タ抽出位置がシフトされる。1つ目の符号化データ長が
3〜6ビット以外の場合や、2つ目のハフマン符号が5
ビット以上の場合には、2つ目の復号化データRS2が
無効であることを示す信号Sivが生成される。
(57) Abstract: Provided is a data decoding device and method capable of decoding a JPEG-encoded data stream at a high speed with a simple configuration. A first decoding unit (20) includes a data stream (D).
All the Huffman codes included at the beginning of “in” can be decoded, and the second decoding units 41 to 44 have decoding tables that can decode Huffman codes up to 5 bits in length. According to the data length L1 of the first encoded data, one of a plurality of second decoding units whose data position to be decoded is shifted by one bit is selected, and the decoded data RS
In accordance with 2, the second encoded data length L2 is calculated. The data extraction position is shifted according to the sum of the data length L2 and the data length L1. When the first encoded data length is other than 3 to 6 bits, or when the second Huffman code is 5
If the number of bits is greater than or equal to the number of bits, a signal Siv indicating that the second decoded data RS2 is invalid is generated.
Description
【発明の詳細な説明】Detailed Description of the Invention
【0001】[0001]
【発明の属する技術分野】本発明は、ハフマン符号など
の可変長符号によって符号化されたデータストリームを
復号化するデータ復号化装置とその方法に係り、例え
ば、JPEG(joint photographic experts group)方
式によって符号化されたデータストリームを復号化する
データ復号化装置とその方法に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data decoding apparatus and method for decoding a data stream coded by a variable length code such as Huffman code, for example, by a JPEG (joint photographic experts group) method. The present invention relates to a data decoding device and a method for decoding an encoded data stream.
【0002】[0002]
【従来の技術】図17は、ハフマン符号によって符号化
されたデータストリームを復号化する従来のデータ復号
化装置の構成例を示すブロック図である。図17に示す
データ復号化装置は、データシフト部1、復号部2a〜
復号部2r、およびセレクタ3を有する。2. Description of the Related Art FIG. 17 is a block diagram showing a configuration example of a conventional data decoding apparatus for decoding a data stream coded by Huffman code. The data decoding device shown in FIG. 17 includes a data shift unit 1, a decoding unit 2a ...
It has a decoding unit 2r and a selector 3.
【0003】データシフト部1は、ハフマン符号化され
たデータストリームDinの先頭ビットから16ビット
分のデータ列S1を抽出して、復号部2a〜復号部2r
に入力する。また、シフト信号S3に応じて、データ列
の抽出位置をデータストリームDinの先頭から末尾方
向へシフトさせる。The data shift unit 1 extracts a 16-bit data string S1 from the first bit of the Huffman-encoded data stream Din, and decodes the decoding units 2a to 2r.
To enter. In addition, the extraction position of the data string is shifted from the beginning to the end of the data stream Din according to the shift signal S3.
【0004】復号部2aは、ハフマン符号とそのデータ
長および復号語が互いに関連付けられたデータテーブル
を有しており、このデータテーブルを参照して、抽出デ
ータ列S1の先頭ビットから16ビット分のデータ列に
含まれるハフマン符号を検索し、ハフマン符号のデータ
長L1と復号語Dout1を出力する。ただし、この例
においてハフマン符号は最長16ビットである。The decoding unit 2a has a data table in which the Huffman code, its data length, and the decoded word are associated with each other. With reference to this data table, 16 bits from the first bit of the extracted data sequence S1 The Huffman code included in the data string is searched, and the data length L1 of the Huffman code and the decoded word Dout1 are output. However, in this example, the Huffman code has a maximum length of 16 bits.
【0005】復号部2b〜復号部2rも、復号部2aと
同様なデータテーブルを有しており、抽出データ列S1
の先頭ビットからそれぞれ1〜16ビットだけずれたビ
ット位置から16ビット分のデータ列に含まれるハフマ
ン符号を検索する。そして、検索されたハフマン符号の
復号語とデータ長をセレクタ3に出力する。ただし、復
号部2b〜復号部2rが出力するデータ長は、検索され
たハフマン符号のデータ長と、それぞれの復号部がセレ
クタ3で選択される場合のデータ長L1とを加算した値
を有している。例えば、復号部2gにおいてデータ長p
のハフマン符号が検索された場合、この復号部2gから
出力されるデータ長は(p+6)である。The decoding units 2b to 2r also have the same data table as the decoding unit 2a, and the extracted data string S1.
The Huffman code included in the 16-bit data string is searched from the bit positions deviated from the first bit by 1 to 16 bits. Then, the decoded word and the data length of the retrieved Huffman code are output to the selector 3. However, the data lengths output from the decoding units 2b to 2r have a value obtained by adding the data length of the searched Huffman code and the data length L1 when each of the decoding units is selected by the selector 3. ing. For example, in the decoding unit 2g, the data length p
When the Huffman code is searched for, the data length output from the decoding unit 2g is (p + 6).
【0006】セレクタ3は、復号部2aにおいて検索さ
れたハフマン符号のデータ長L1に応じて、復号部2b
〜復号部2rのうちの何れか1つを選択し、その復号語
Dout2を出力する。また、そのデータ長をシフト信
号S3としてデータシフト部1に出力する。The selector 3 decodes the decoding unit 2b according to the data length L1 of the Huffman code retrieved by the decoding unit 2a.
~ Select any one of the decoding units 2r and output the decoded word Dout2. The data length is output to the data shift unit 1 as the shift signal S3.
【0007】上述した構成を有する図17のデータ復号
化装置によれば、まず、データシフト部1においてデー
タストリームDinの先頭ビットから32ビット分のデ
ータ列S1が抽出され、そのさらに先頭ビットから16
ビット分のデータ列に含まれるハフマン符号が復号部2
aによって検索される。これにより、抽出データ列S1
の先頭から1つ目のハフマン符号が見つけ出され、その
復号語Dout1とデータ長L1が復号部2aから出力
される。According to the data decoding apparatus of FIG. 17 having the above-described configuration, first, the data shift unit 1 extracts the data sequence S1 of 32 bits from the first bit of the data stream Din, and further extracts 16 bits from the first bit.
The Huffman code included in the data string of bits is the decoding unit 2
Searched by a. As a result, the extracted data string S1
The first Huffman code is found from the beginning, and the decoded word Dout1 and the data length L1 thereof are output from the decoding unit 2a.
【0008】データ長L1によって2つ目のハフマン符
号の先頭ビットの位置がわかるので、次に、このビット
位置を先頭にしてハフマン符号の検索を行なっている復
号部がセレクタ3により選択される。例えばデータ長L
1が7ビットの場合、抽出データ列S1の8ビット目を
先頭にしてハフマン符号の検索を行っている復号部2h
が選択される。このようにして2つ目のハフマン符号が
検索され、その復号語Dout2がセレクタ3より出力
される。Since the position of the head bit of the second Huffman code can be known from the data length L1, the selector 3 selects the decoding unit which searches for the Huffman code with this bit position as the head. For example, data length L
When 1 is 7 bits, the decoding unit 2h that searches for a Huffman code by starting the 8th bit of the extracted data sequence S1
Is selected. In this way, the second Huffman code is searched, and the decoded word Dout2 is output from the selector 3.
【0009】セレクタ3から出力されるシフト信号S3
は、1つ目のハフマン符号と2つ目のハフマン符号のデ
ータ長の和を示す信号であり、このシフト信号S3によ
って、2つ目に復号されたハフマン符号に続く次のハフ
マン符号の先頭ビット位置が特定される。データシフト
部1のデータ抽出位置は、この特定された先頭ビット位
置と一致するようにシフト信号S3によってシフトされ
るので、上述と同様に、この先頭ビットから2つのハフ
マン符号が復号される。こうした動作を繰り返しなが
ら、1回のデータ抽出位置のシフトに対して2つのハフ
マン符号が同時に復号される。The shift signal S3 output from the selector 3
Is a signal indicating the sum of the data lengths of the first Huffman code and the second Huffman code, and the first bit of the next Huffman code following the Huffman code decoded second by this shift signal S3. The position is specified. Since the data extraction position of the data shift unit 1 is shifted by the shift signal S3 so as to coincide with the specified head bit position, two Huffman codes are decoded from the head bit in the same manner as described above. By repeating such operations, two Huffman codes are simultaneously decoded for one shift of the data extraction position.
【0010】[0010]
【発明が解決しようとする課題】しかしながら、図17
に示すデータ復号化装置では、復号部2a〜復号部2r
においてハフマン符号を復号化するためのデータテーブ
ルが個別に設けられるため、全部で17個ものデータテ
ーブルが必要となる。したがって、このデータテーブル
のための記憶容量が非常に大きくなり、回路規模が増大
してしまう問題がある。また、JPEG方式で圧縮符号
化されたデータストリームには、ハフマン符号の他に付
加ビットと呼ばれるDCT(discrete cosine transfor
m)係数の具体的な値を指定するためのデータが含まれ
ているので、ハフマン符号の復号化しか考慮されていな
い図17のデータ復号化装置をJPEG復号化装置に適
用することはできない。However, as shown in FIG.
In the data decoding device shown in FIG. 1, the decoding unit 2a to the decoding unit 2r are included.
In, since a data table for decoding the Huffman code is individually provided, a total of 17 data tables are required. Therefore, there is a problem that the storage capacity for this data table becomes very large and the circuit scale increases. In addition to the Huffman code, a DCT (discrete cosine transfor) called additional bit is added to the data stream compressed and encoded by the JPEG method.
m) Since the data for designating the concrete value of the coefficient is included, the data decoding apparatus of FIG. 17 which considers only the decoding of the Huffman code cannot be applied to the JPEG decoding apparatus.
【0011】本発明はかかる事情に鑑みてなされたもの
であり、その目的は、可変長符号化されたデータストリ
ームを簡易な構成で高速に復号化できるデータ復号化装
置およびその方法を提供することにある。The present invention has been made in view of the above circumstances, and an object thereof is to provide a data decoding apparatus and method capable of decoding a variable-length coded data stream at high speed with a simple structure. It is in.
【0012】[0012]
【課題を解決するための手段】上記の目的を達成するた
め、本発明の第1の観点に係るデータ復号化装置は、供
給される符号化データストリームを復号化するデータ復
号化装置であって、上記符号化データストリームの先頭
から所定データ長のデータ列を抽出するデータ抽出手段
と、上記データ抽出手段において抽出されたデータ列の
先頭から、所定の可変長符号テーブルに含まれる可変長
符号を検索し、当該検索した可変長符号に対応する復号
化データを出力する第1の復号手段と、上記第1の復号
手段の復号化データと、当該復号化データに対応する上
記可変長符号のデータ長とに基づいて、当該復号化デー
タに対応する符号化データのデータ長を算出し、第1の
データ長として出力する第1のデータ長算出手段と、上
記データ抽出手段において抽出されたデータ列の先頭に
対して複数の異なるデータ数だけ末尾側にずれたデータ
位置から、上記可変長符号テーブルの一部の可変長符号
をそれぞれ検索し、当該検索した可変長符号に対応する
復号化データを出力し、当該検索において該当する可変
長符号が見つからない場合には検索エラー信号を出力す
る複数の第2の復号手段と、上記複数の第2の復号化手
段の中から、上記第1のデータ長に応じて選択した第2
復号手段の復号化データまたは上記検索エラー信号を出
力し、該当する第2の復号手段が無い場合には選択エラ
ー信号を出力する選択手段と、上記選択手段において選
択された第2の復号手段の復号化データと、当該復号化
データに対応する上記可変長符号のデータ長とに基づい
て、当該復号化データに対応する符号化データのデータ
長を算出し、第2のデータ長として出力する第2のデー
タ長算出手段と、上記選択手段において選択された第2
の復号手段から上記検索エラー信号が出力される場合、
または上記選択手段から上記選択エラー信号が出力され
る場合に、上記第2の復号手段の復号化データが無効で
あることを知らせる無効信号を生成する無効信号生成手
段と、上記第1のデータ長と上記第2のデータ長との和
に応じたデータ数だけ、上記データ抽出手段のデータ列
抽出位置を上記符号化データストリームの末尾側にシフ
トさせ、上記無効信号が生成される場合には、上記第1
のデータ長に応じたデータ数だけ上記抽出位置を上記末
尾側へシフトさせるデータ抽出位置シフト手段とを有す
る。In order to achieve the above object, a data decoding device according to a first aspect of the present invention is a data decoding device for decoding a supplied encoded data stream. , A data extracting means for extracting a data string of a predetermined data length from the head of the encoded data stream, and a variable length code included in a predetermined variable length code table from the head of the data string extracted by the data extracting means. First decoding means for searching and outputting decoded data corresponding to the searched variable length code, decoded data of the first decoding means, and data of the variable length code corresponding to the decoded data A first data length calculating means for calculating the data length of the encoded data corresponding to the decoded data based on the length and outputting it as the first data length; and the data extracting means. A part of the variable-length code in the variable-length code table is searched from the data positions shifted toward the end by a plurality of different data numbers with respect to the head of the extracted data string, and the searched variable-length code is searched. Of the plurality of second decoding means for outputting the decoded data corresponding to the plurality of second decoding means for outputting the search error signal when the corresponding variable length code is not found in the search. From the second selected according to the first data length
The selecting means outputs the decoded data of the decoding means or the search error signal, and outputs the selection error signal when there is no corresponding second decoding means, and the second decoding means selected by the selecting means. A data length of the encoded data corresponding to the decoded data is calculated based on the decoded data and a data length of the variable length code corresponding to the decoded data, and is output as a second data length. 2 data length calculating means and the second data selected by the selecting means.
When the search error signal is output from the decoding means of
Alternatively, when the selection error signal is output from the selection means, an invalid signal generation means for generating an invalid signal for notifying that the decoded data of the second decoding means is invalid, and the first data length. And the second data length, the data string extraction position of the data extraction means is shifted to the end side of the encoded data stream by the number of data, and the invalid signal is generated, First above
Data extraction position shift means for shifting the extraction position to the end side by the number of data corresponding to the data length of.
【0013】本発明の第1の観点に係るデータ復号化装
置によれば、上記データ抽出手段において、上記符号化
データストリームの先頭から所定データ長のデータ列が
抽出され、この抽出されたデータ列の先頭から、所定の
可変長符号テーブルに含まれる可変長符号が第1の復号
手段において検索される。そして、この検索された可変
長符号に対応する復号化データが出力される。出力され
た上記第1の復号手段の復号化データと、当該復号化デ
ータに対応する上記可変長符号のデータ長とに基づい
て、当該復号化データに対応する符号化データのデータ
長が第1のデータ長算出手段において算出され、第1の
データ長として出力される。また、上記データ抽出手段
において抽出されたデータ列の先頭に対して複数の異な
るデータ数だけ末尾側にずれたデータ位置から、上記可
変長符号テーブルの一部の可変長符号が第2の復号手段
においてそれぞれ検索され、当該検索された可変長符号
に対応する復号化データが出力される。当該検索におい
て該当する可変長符号が見つからない場合には、検索エ
ラー信号が出力される。上記複数の第2の復号化手段の
中から、上記第1のデータ長に応じて選択された第2復
号手段の復号化データまたは上記検索エラー信号が上記
選択手段から出力される。該当する第2の復号手段が無
い場合には選択エラー信号が出力される。上記選択手段
において選択された第2の復号手段の復号化データと、
当該復号化データに対応する上記可変長符号のデータ長
とに基づいて、当該復号化データに対応する符号化デー
タのデータ長が第2のデータ長算出手段において算出さ
れ、第2のデータ長として出力される。上記選択手段に
おいて選択された第2の復号手段から上記検索エラー信
号が出力される場合、または上記選択手段から上記選択
エラー信号が出力される場合には、上記第2の復号手段
の復号化データが無効であることを知らせる無効信号が
上記無効信号生成手段において生成される。上記データ
抽出手段のデータ列抽出位置は、上記データ抽出位置シ
フト手段によって、上記第1のデータ長と上記第2のデ
ータ長との和に応じたデータ数だけ上記符号化データス
トリームの末尾側にシフトされる。上記無効信号が生成
される場合には、上記第1のデータ長に応じたデータ数
だけ上記抽出位置を上記末尾側へシフトされる。According to the data decoding apparatus of the first aspect of the present invention, the data extracting means extracts a data string of a predetermined data length from the beginning of the encoded data stream, and the extracted data string is extracted. The variable length code included in the predetermined variable length code table is searched by the first decoding means from the beginning. Then, the decoded data corresponding to the retrieved variable length code is output. Based on the output decoded data of the first decoding means and the data length of the variable length code corresponding to the decoded data, the data length of the encoded data corresponding to the decoded data is the first Is calculated by the data length calculation means and is output as the first data length. Further, a part of the variable length code in the variable length code table is converted into a second decoding means from the data position shifted toward the end side by a plurality of different data numbers with respect to the head of the data string extracted by the data extracting means. And the decoded data corresponding to the searched variable length code is output. When the corresponding variable length code is not found in the search, a search error signal is output. From the plurality of second decoding means, the decoded data of the second decoding means selected according to the first data length or the search error signal is output from the selection means. If there is no corresponding second decoding means, a selection error signal is output. The decrypted data of the second decrypting means selected by the selecting means,
The data length of the encoded data corresponding to the decoded data is calculated by the second data length calculating means based on the data length of the variable length code corresponding to the decoded data, and is calculated as the second data length. Is output. When the search error signal is output from the second decoding means selected by the selecting means, or when the selection error signal is output from the selecting means, the decoded data of the second decoding means Is generated by the invalid signal generating means for notifying that the is invalid. The data string extraction position of the data extraction means is moved to the end side of the encoded data stream by the data extraction position shift means by the number of data corresponding to the sum of the first data length and the second data length. Be shifted. When the invalid signal is generated, the extraction position is shifted to the end side by the number of data corresponding to the first data length.
【0014】また、上記符号化データストリームは、上
記可変長符号と付加データとで構成された符号化データ
を含み、上記第1の復号手段の復号化データに含まれた
上記付加データのデータ長の情報に基づいて、上記デー
タ抽出手段の抽出データ列から上記付加データを更に抽
出する第1の付加データ抽出手段と、上記選択手段から
出力される復号化データに含まれた上記付加データのデ
ータ長の情報に基づいて、上記データ抽出手段の抽出デ
ータ列から上記付加データを更に抽出する第2の付加デ
ータ抽出手段とを有しても良い。Further, the encoded data stream includes encoded data composed of the variable length code and additional data, and the data length of the additional data included in the decoded data of the first decoding means. First additional data extracting means for further extracting the additional data from the extracted data string of the data extracting means based on the information of 1. and data of the additional data included in the decoded data output from the selecting means. It may have a second additional data extracting means for further extracting the additional data from the extracted data string of the data extracting means based on the length information.
【0015】また、上記第1の復号手段の復号化データ
と上記選択手段に選択された第2の復号手段の復号化デ
ータとに含まれる上記連続数の情報に応じて、上記単位
ブロック内で復号化されたデータの数を計数し、上記無
効信号が生成される場合に、上記選択された第2の復号
手段の復号化データに含まれる上記連続数の情報を無効
にして上記計数を行ない、当該計数値が上記所定データ
数に達した場合には、当該計数値を初期化する計数手段
を有しても良い。また、上記計数手段は、計数値が上記
所定データ数より大きくなる場合に計数エラー信号を出
力し、上記無効信号生成手段は、上記第1の復号手段の
復号化データに上記単位ブロックの末尾を示す所定の情
報が含まれる場合、または上記計数手段において計数エ
ラー信号が出力される場合に上記無効信号を生成しても
良い。Further, according to the information of the continuous number contained in the decoded data of the first decoding means and the decoded data of the second decoding means selected by the selecting means, within the unit block. The number of the decoded data is counted, and when the invalid signal is generated, the information of the continuous number included in the decoded data of the selected second decoding means is invalidated and the counting is performed. If the count value reaches the predetermined number of data, a counting means for initializing the count value may be provided. The counting means outputs a counting error signal when the count value is larger than the predetermined number of data, and the invalid signal generating means adds the end of the unit block to the decoded data of the first decoding means. The invalid signal may be generated when the predetermined information shown is included, or when the counting error signal is output from the counting means.
【0016】また、上記複数の第2の復号化手段の少な
くとも一部から、上記第1のデータ長ないし第nのデー
タ長(符号nは、所定の自然数Nに対して1≦n≦Nを
満たす任意の自然数を示す)の総和に応じて選択した第
2の復号手段の復号化データおよび上記検索エラー信号
を出力し、該当する第2の復号手段が無い場合には第n
の選択エラー信号を出力する複数の選択手段と、上記選
択手段において上記第1のデータ長ないし第nのデータ
長の総和に応じて選択された第2の復号部の復号化デー
タと、当該復号化データに対応する上記可変長符号のデ
ータ長とに基づいて、当該復号化データに対応する符号
化データのデータ長を算出し、第(n+1)のデータ長
として出力する複数の第2のデータ長算出手段と、上記
選択手段において上記第1のデータ長ないし第nのデー
タ長の総和に応じて選択された第2の復号手段から上記
検索エラー信号が出力される場合、または上記選択手段
から上記第nの選択エラー信号が出力される場合に、上
記第1のデータ長ないし第mのデータ長(符号mは、所
定の自然数Nに対してn≦m≦Nを満たす任意の自然数
を示す)の総和に応じて選択された第2の復号手段の復
号化データが全て無効であることを知らせる第nの無効
信号を生成する複数の無効信号生成手段とを有し、上記
データ抽出位置シフト手段は、上記第1のデータ長ない
し第Nのデータ長の総和に応じたデータ数だけ、上記デ
ータ抽出手段のデータ列抽出位置を上記符号化データス
トリームの末尾側にシフトさせ、上記第nの無効信号が
生成される場合には、上記第1のデータ長ないし第nの
データ長の総和に応じたデータ数だけ上記抽出位置を上
記末尾側へシフトさせても良い。この場合、さらに、上
記第1の復号手段の復号化データと上記複数の選択手段
において選択された第2の復号手段の復号化データとに
含まれる上記連続数の情報に応じて、上記単位ブロック
内で復号化されたデータの数を計数し、上記第nの無効
信号が生成される場合は、上記第1のデータ長ないし第
mのデータ長の総和に応じて選択された第2の復号手段
の復号化データに含まれる上記連続数の情報を全て無効
にして上記計数を行ない、当該計数値が上記所定データ
数に達した場合には、当該計数値を初期化する計数手段
を有しても良い。また、上記計数手段は、計数値が上記
所定データ数より大きくなる場合に、上記第1のデータ
長ないし第mのデータ長の総和に応じて選択された第2
の復号手段の復号化データに含まれる上記連続数の情報
を全て無効にした計数値が上記所定データ数より大きく
なる最小の自然数nにおいて、第nの計数エラー信号を
出力し、上記無効信号生成手段は、上記第1の復号手段
の復号化データに上記単位ブロックの末尾を示す所定の
情報が含まれる場合に第1の無効信号を生成し、第1の
データ長ないし第nのデータ長の総和に応じて選択され
た第2の復号手段の復号化データに当該所定の情報が含
まれる場合に第(n+1)の無効信号を生成し、上記計
数手段において第nの計数エラー信号が出力される場合
に第nの無効信号を生成しても良い。Further, from at least a part of the plurality of second decoding means, the first data length to the nth data length (the code n is 1≤n≤N with respect to a predetermined natural number N). The decoded data of the second decoding means selected according to the sum of (which represents an arbitrary natural number to be satisfied) and the search error signal are output, and if there is no corresponding second decoding means, the nth
A plurality of selecting means for outputting the selection error signals, the decoded data of the second decoding section selected by the selecting means according to the sum of the first data length to the nth data length, and the decoding data. A plurality of second data that calculates the data length of the encoded data corresponding to the decoded data based on the data length of the variable length code corresponding to the encoded data and outputs the data length as the (n + 1) th data length. When the search error signal is output from the length calculating means and the second decoding means selected by the selecting means according to the sum of the first data length to the n-th data length, or from the selecting means. When the n-th selection error signal is output, the first data length to the m-th data length (the symbol m represents an arbitrary natural number satisfying n ≦ m ≦ N with respect to a predetermined natural number N). ) To the sum of A plurality of invalid signal generating means for generating an n-th invalid signal informing that all the decoded data of the second decoding means selected by the second decoding means are invalid. The data string extraction position of the data extraction means is shifted to the end side of the encoded data stream by the number of data corresponding to the sum of the first data length to the Nth data length, and the nth invalid signal is generated. In this case, the extraction position may be shifted to the end side by the number of data corresponding to the sum of the first data length to the nth data length. In this case, further, in accordance with the information of the continuous number included in the decoded data of the first decoding means and the decoded data of the second decoding means selected by the plurality of selecting means, the unit block If the number n of the decoded data is counted and the nth invalid signal is generated, the second decoding selected according to the sum of the first data length to the mth data length. It has a counting means for invalidating all the information of the continuous number contained in the decrypted data of the means to perform the counting, and when the counted value reaches the predetermined number of data, initialize the counted value. May be. In addition, the counting means selects the second data length selected according to the sum of the first data length to the m-th data length when the count value is larger than the predetermined data number.
In the minimum natural number n in which the count value obtained by invalidating all the information of the continuous number included in the decoded data of the decoding means is larger than the predetermined data number, the nth counting error signal is output and the invalid signal is generated. The means generates a first invalid signal when the decoded data of the first decoding means includes predetermined information indicating the end of the unit block, and outputs a first data length to an nth data length. When the decoded data of the second decoding means selected according to the total includes the predetermined information, the (n + 1) th invalid signal is generated, and the counting means outputs the nth counting error signal. In this case, the nth invalid signal may be generated.
【0017】本発明の第2の観点に係るデータ復号化方
法は、供給される符号化データストリームを復号化する
データ復号化方法であって、上記符号化データストリー
ムの先頭から所定データ長のデータ列を抽出するステッ
プと、上記抽出したデータ列の先頭から、所定の可変長
符号テーブルに含まれる可変長符号を検索し、当該検索
した可変長符号に対応する第1の復号化データを生成す
るステップと、上記生成された第1の復号化データと、
当該第1の復号化データに対応する上記可変長符号のデ
ータ長とに基づいて、当該第1の復号化データに対応す
る符号化データのデータ長を第1のデータ長として算出
するステップと、上記データ抽出ステップにおいて抽出
されたデータ列の先頭に対して複数の異なるデータ数だ
け末尾側にずれたデータ位置から、上記第1の可変長符
号テーブルの一部の可変長符号をそれぞれ検索し、当該
検索した可変長符号に対応する第2の復号化データを生
成し、当該検索において該当する可変長符号が見つから
ない場合には検索エラー信号を生成する第2の復号ステ
ップと、上記生成された複数の第2の復号化データまた
は検索エラー信号の中から、上記第1のデータ長に応じ
たデータ位置における上記可変長符号の検索によって生
成された第2の復号化データまたは検索エラー信号を選
択し、該当する第2の復号化データまたは検索エラー信
号が無い場合には選択エラー信号を生成するステップ
と、上記選択された第2の復号化データと、当該第2の
復号化データに対応する上記可変長符号のデータ長とに
基づいて、当該第2の復号化データに対応する符号化デ
ータのデータ長を第2のデータ長として算出するステッ
プと、上記選択ステップにおいて上記検索エラー信号が
選択される場合、または上記選択エラー信号が生成され
る場合に、上記第2の復号化データが無効であることを
知らせる無効信号を生成するステップと、上記第1のデ
ータ長と上記第2のデータ長との和に応じたデータ数だ
け、上記データ抽出ステップのデータ列抽出位置を上記
符号化データストリームの末尾側にシフトさせ、上記無
効信号が生成される場合には、上記第1のデータ長に応
じたデータ数だけ上記抽出位置を上記末尾側へシフトさ
せるステップとを有する。A data decoding method according to a second aspect of the present invention is a data decoding method for decoding a coded data stream supplied, wherein the data having a predetermined data length from the beginning of the coded data stream. A step of extracting a column, and a variable length code included in a predetermined variable length code table is searched from the beginning of the extracted data string, and first decoded data corresponding to the searched variable length code is generated. A step, and the first decrypted data generated above,
Calculating the data length of the encoded data corresponding to the first decoded data as the first data length based on the data length of the variable length code corresponding to the first decoded data, Retrieving a part of the variable-length codes of the first variable-length code table from the data positions shifted toward the end by a plurality of different numbers of data with respect to the beginning of the data string extracted in the data extraction step, A second decoding step of generating second decoded data corresponding to the searched variable length code, and generating a search error signal when the corresponding variable length code is not found in the search; A second recovery code generated by searching the variable length code at a data position corresponding to the first data length from a plurality of second decoded data or search error signals. The selected decoded data or the search error signal, and generating the selected error signal when there is no corresponding second decoded data or the search error signal, the selected second decoded data, and the selected second decoded data. Calculating the data length of the encoded data corresponding to the second decoded data as the second data length based on the data length of the variable length code corresponding to the second decoded data; Generating an invalid signal for notifying that the second decoded data is invalid when the search error signal is selected in the step or when the selection error signal is generated; The data string extraction position of the data extraction step is shifted to the end side of the encoded data stream by the number of data corresponding to the sum of the data length and the second data length. Is bets, when the disable signal is generated, and a step of shifting only the extraction position number data corresponding to the first data length to said trailing side.
【0018】また、上記生成された複数の第2の復号化
データまたは検索エラー信号の少なくとも一部から、上
記第1のデータ長ないし第nのデータ長の総和に応じた
データ位置における可変長符号の検索によって生成され
た第2の復号化データまたは検索エラー信号を選択し、
該当する第2の復号化データまたは検索エラー信号が無
い場合には第nの選択エラー信号を生成するステップ
と、上記選択ステップにおいて上記第1のデータ長ない
し第nのデータ長の総和に応じて上記検索エラー信号が
選択される場合、上記第1のデータ長ないし第mのデー
タ長(符号mは、所定の自然数Nに対してn≦m≦Nを
満たす任意の自然数を示す)の総和に応じて選択された
第2の復号化データが全て無効であることを知らせる第
nの無効信号を生成するステップと、上記第1のデータ
長ないし第nのデータ長の総和に応じて選択された第2
の復号化データと、当該第2の復号化データに対応する
上記可変長符号のデータ長とに基づいて、当該第2の復
号化データに対応する符号化データのデータ長を第(n
+1)のデータ長として算出するステップとを、所定の
自然数Nに対して1≦n≦Nを満たす範囲で反復し、上
記データの抽出位置をシフトするステップにおいて、上
記第1のデータ長ないし第Nのデータ長の総和に応じた
データ数だけ、上記抽出位置を上記符号化データストリ
ームの末尾側にシフトさせ、上記第nの無効信号が生成
される場合には、上記第1のデータ長ないし第nのデー
タ長の総和に応じたデータ数だけ上記抽出位置を上記末
尾側へシフトさせても良い。A variable length code at a data position corresponding to the sum of the first data length to the nth data length from at least a part of the plurality of generated second decoded data or search error signals. Select the second decoded data or search error signal generated by the search of
If there is no corresponding second decoded data or search error signal, a step of generating an nth selection error signal and a sum of the first data length to the nth data length in the selecting step are performed. When the search error signal is selected, the sum of the first data length to the m-th data length (the code m represents an arbitrary natural number satisfying n ≦ m ≦ N with respect to a predetermined natural number N) is added. A step of generating an n-th invalid signal for notifying that all of the second decoded data selected accordingly are invalid, and selected according to the sum of the first data length to the n-th data length. Second
Of the decoded data and the data length of the variable length code corresponding to the second decoded data, the data length of the coded data corresponding to the second decoded data is set to (n
+1) as a data length, and the step of shifting the extraction position of the data is repeated for a predetermined natural number N within a range satisfying 1 ≦ n ≦ N. When the n-th invalid signal is generated by shifting the extraction position to the end side of the encoded data stream by the number of data corresponding to the sum of the N data lengths, the first data length or The extraction position may be shifted to the end side by the number of data corresponding to the sum of the nth data lengths.
【0019】[0019]
【発明の実施の形態】以下、本発明の2つの実施形態に
ついて、JPEG符号化データストリームを復号化する
JPEG復号化装置に本発明を適用した場合を例として
説明するが、その前に、以降の説明を理解し易くするた
め、JPEG符号化方式の概要についてまず簡単に説明
する。BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, two embodiments of the present invention will be described by taking as an example the case where the present invention is applied to a JPEG decoding device for decoding a JPEG encoded data stream. In order to facilitate understanding of the above description, an outline of the JPEG encoding method will be briefly described first.
【0020】自然画像は隣接する画素値が相関性を有し
ている場合が多く、ある微小な領域内で見た場合におけ
る画素値の空間的な変動(空間周波数)が小さくなる性
質がある。このような自然画像を直交変換により空間周
波数領域のデータへ変換すると、変換されたデータは低
周波成分が高周波成分より大きくなる傾向がある。そこ
で、空間周波数領域のデータを符号化する場合に、高周
波側のデータに割り当てる符号長を低周波側のデータに
比べて短くすると、データ全体の平均符号長が短くなる
ので、情報量を圧縮することができる。In a natural image, adjacent pixel values often have a correlation, and there is a property that the spatial variation (spatial frequency) of the pixel value when viewed in a certain minute area becomes small. When such a natural image is transformed into data in the spatial frequency domain by orthogonal transformation, the transformed data tends to have a low frequency component larger than a high frequency component. Therefore, when encoding data in the spatial frequency domain, if the code length assigned to the data on the high frequency side is made shorter than the data on the low frequency side, the average code length of the entire data becomes shorter, so the amount of information is compressed. be able to.
【0021】JPEGのDCT利用型符号化方式では、
入力の画像データが8×8画素ごとのブロックに分割さ
れ、この各ブロックに対して直交変換の1つであるDC
T(Discrete Cosine Transform :離散コサイン変換)
が実行される。これにより、1ブロックの64個の画像
データは64個のDCT係数に変換される。このDCT
係数は、係数ごとに定められた量子化ステップで量子化
された後、1個のDC成分とそれ以外の63個のAC成
分とがそれぞれ異なる方法でハフマン符号に符号化され
る。In the JPEG DCT-based coding system,
The input image data is divided into blocks of 8 × 8 pixels, and DC which is one of orthogonal transforms is applied to each block.
T (Discrete Cosine Transform)
Is executed. As a result, one block of 64 image data is converted into 64 DCT coefficients. This DCT
The coefficient is quantized by a quantization step determined for each coefficient, and then one DC component and the other 63 AC components are encoded into Huffman codes by different methods.
【0022】DCT係数がDC成分の場合は、連続した
ブロック間におけるDCT係数の差分値に対して、その
大きさに応じて定められたハフマン符号が生成される。
これは、自然画像においては、隣接するブロック間のD
C成分が相関性を有している場合が多く、差分値の分散
が小さくなるためである。また、DC成分のハフマン符
号には4ビットのカテゴリSSSSと呼ばれるデータが
それぞれ対応しており、カテゴリSSSSによって指定
されるデータ長を有した付加ビットがハフマン符号に続
いて付加され、1つの符号化データが構成される。この
付加ビットによって、差分値の具体的な大きさが指定さ
れる。When the DCT coefficient is the DC component, a Huffman code determined according to the magnitude of the DCT coefficient difference between consecutive blocks is generated.
This is the D between adjacent blocks in a natural image.
This is because the C component is often correlated and the variance of the difference value is small. The DC component Huffman code corresponds to 4-bit data called a category SSSS, and additional bits having a data length designated by the category SSSS are added subsequent to the Huffman code to form one encoding. The data is composed. A specific magnitude of the difference value is designated by the additional bit.
【0023】DCT係数がAC成分の場合は、空間周波
数の大きさに応じた順序に並び替えられたDCT係数の
データ列を作り、このデータ列においてゼロ値のDCT
係数が連続する個数(ゼロランレングスRRRR)と、
このゼロ値のDCT係数に続く非ゼロのDCT係数の大
きさに応じて定められたカテゴリSSSSとの組み合わ
せに応じて、1つのハフマン符号が生成される。これ
は、量子化後のDCT変換係数が高周波側でゼロになり
易い性質を利用して圧縮効率を高めるためである。When the DCT coefficient is an AC component, a data string of DCT coefficients rearranged in an order corresponding to the magnitude of the spatial frequency is created, and a zero-value DCT is generated in this data string.
The number of consecutive coefficients (zero run length RRRR),
One Huffman code is generated according to the combination with the category SSSS determined according to the magnitude of the non-zero DCT coefficient following the zero-value DCT coefficient. This is to improve the compression efficiency by utilizing the property that the quantized DCT transform coefficient tends to be zero on the high frequency side.
【0024】なお、上述のデータ列においてゼロ値のA
C成分が16個以上連続する場合には、この16個の連
続するゼロ値のAC成分に対して1つの符号ZRL(ze
ro run length)が生成される。また、1ブロックの最
後までゼロ値のAC成分が続く場合には、その個数に係
わらず1つの符号EOB(end of block)が生成され
る。いずれの場合にも、複数のゼロ値のAC成分に対し
て1つの符号が一括して与えられることにより圧縮効率
が高められる。It should be noted that in the above data string, a zero value A
When 16 or more C components continue, one code ZRL (ze
ro run length) is generated. When a zero-value AC component continues to the end of one block, one code EOB (end of block) is generated regardless of the number of AC components. In either case, compression efficiency is improved by collectively giving one code to a plurality of zero-valued AC components.
【0025】<第1の実施形態>図1は、本発明に係る
JPEG復号化装置の概略的な構成例を示すブロック図
である。図1に示すJPEG復号化装置は、バッファ1
001、ハフマン復号化器1002、逆量子化器100
3および逆DCT器1004を有する。<First Embodiment> FIG. 1 is a block diagram showing a schematic configuration example of a JPEG decoding apparatus according to the present invention. The JPEG decoding device shown in FIG.
001, Huffman decoder 1002, inverse quantizer 100
3 and an inverse DCT device 1004.
【0026】バッファ1001は、入力されるJPEG
符号化データを一時的に蓄積し、要求に応じて順次ハフ
マン復号化装置1002に出力する。ハフマン復号化器
1002は、バッファ1001に蓄積されたJPEG符
号化データを順次読み出し、そのハフマン符号を復号化
してDCT係数を再生する。逆量子化器1003は、ハ
フマン復号化器1002において再生されたDCT係数
に対して所定の逆量子化係数を乗ずる逆量子化処理を行
う。逆DCT器1004は、逆量子化器1003におい
て逆量子化されたDCT係数に対して8×8画素ブロッ
クごとに逆DCTを行ない、元画像の各画素データを再
生する。The buffer 1001 is a JPEG input.
The encoded data is temporarily stored and sequentially output to the Huffman decoding device 1002 in response to a request. The Huffman decoder 1002 sequentially reads the JPEG encoded data accumulated in the buffer 1001, decodes the Huffman code, and reproduces the DCT coefficient. The inverse quantizer 1003 performs an inverse quantization process of multiplying the DCT coefficient reproduced by the Huffman decoder 1002 by a predetermined inverse quantization coefficient. The inverse DCT unit 1004 performs inverse DCT on the DCT coefficient inversely quantized by the inverse quantizer 1003 for each 8 × 8 pixel block, and reproduces each pixel data of the original image.
【0027】上述したハフマン復号化器1002の更に
詳細な構成例について説明する。図2は、本発明の第1
の実施形態に係る、図1のハフマン復号化器1002の
構成例を示す概略的なブロック図である。図2に示すハ
フマン復号化器は、データ抽出部10、第1の復号部2
0、第1のデータ長算出部30、第2の復号部41〜第
2の復号部44、選択部50、第2のデータ長算出部6
0、無効信号生成部70、データ抽出位置シフト部8
0、計数部90、DCT係数出力部101およびDCT
係数出力部102を有する。A more detailed configuration example of the Huffman decoder 1002 described above will be described. FIG. 2 shows the first of the present invention.
2 is a schematic block diagram showing a configuration example of a Huffman decoder 1002 of FIG. 1 according to the embodiment of FIG. The Huffman decoder shown in FIG. 2 includes a data extraction unit 10 and a first decoding unit 2.
0, the first data length calculation unit 30, the second decoding unit 41 to the second decoding unit 44, the selection unit 50, the second data length calculation unit 6
0, invalid signal generator 70, data extraction position shifter 8
0, counting unit 90, DCT coefficient output unit 101 and DCT
It has a coefficient output unit 102.
【0028】データ抽出部10は、バッファ1001に
蓄積されたJPEG符号化データストリームDinの先
頭から、27ビットのデータ列を抽出する。ハフマン符
号は最長で16ビットであり、付加ビットは最長で11
ビットであるので、ハフマン符号と付加ビットとで構成
される1つのJPEG符号化データのデータ長は最長で
16+11=27ビットとなる。したがって、データ抽
出部10により1つ分のJPEG符号化データが確実に
抽出される。また、データ抽出部10は、そのデータ抽
出位置をJPEG符号化データストリームDinの先頭
から末尾に向かってシフト信号Sftに応じてシフトさ
せる。The data extraction unit 10 extracts a 27-bit data string from the beginning of the JPEG encoded data stream Din accumulated in the buffer 1001. The maximum length of Huffman code is 16 bits, and the maximum number of additional bits is 11
Since the number of bits is one, the maximum data length of one piece of JPEG encoded data composed of Huffman code and additional bits is 16 + 11 = 27 bits. Therefore, the data extraction unit 10 surely extracts one JPEG encoded data. The data extraction unit 10 also shifts the data extraction position from the beginning to the end of the JPEG encoded data stream Din according to the shift signal Sft.
【0029】第1の復号部20は、データ抽出部10に
おいて抽出されたデータ列Dsの先頭ビットから、ハフ
マン符号の最長データに相当する16ビット分のデータ
列を入力し、この入力したデータ列の中から所定のハフ
マン符号テーブルに含まれるハフマン符号を検索して、
対応する復号化データRS1を出力する。入力される符
号化データがDCT係数のDC成分の場合には、このD
C成分の具体的な値を指定する付加ビットのカテゴリS
SSSが復号化データRS1として出力される。また、
入力される符号化データがDCT係数のAC成分の場合
には、値ゼロのAC成分が連続する数を指定するゼロラ
ンレングスRRRRと、このゼロ値のAC成分に続く非
ゼロのAC成分の具体的な値を指定する付加ビットのカ
テゴリSSSSとが復号化データRS1として出力され
る。このように、第1の符号部20は、DCT係数のD
C成分およびAC成分を共に復号化することができる。The first decoding unit 20 inputs a 16-bit data string corresponding to the longest data of the Huffman code from the first bit of the data string Ds extracted by the data extraction unit 10, and the input data string. Search the Huffman code included in the given Huffman code table from
The corresponding decoded data RS1 is output. If the input encoded data is the DC component of the DCT coefficient, this D
Category S of additional bits that specify a specific value of the C component
The SSS is output as the decrypted data RS1. Also,
When the input encoded data is the AC component of the DCT coefficient, a zero run length RRRR that specifies the number of consecutive AC components with a value of zero, and the non-zero AC component that follows the zero-value AC component The category SSSS of the additional bit that specifies a specific value is output as the decoded data RS1. In this way, the first encoding unit 20 determines the DCT coefficient D
Both the C and AC components can be decoded.
【0030】この第1の復号部20は、例えば図2に示
すように、入力される16ビットのデータ列から所定の
ハフマン符号を検索して、それに対応する復号テーブル
のアドレスを生成するアドレス算出部201と、この生
成されたアドレスに格納されたDC成分のカテゴリSS
SS、またはAC成分のゼロランレングスRRRRおよ
びカテゴリSSSSを復号化データRS1として出力す
る復号テーブル202とによって構成することができ
る。The first decoding unit 20 retrieves a predetermined Huffman code from an input 16-bit data string and generates an address of a decoding table corresponding to the Huffman code, as shown in FIG. 2, for example. The section 201 and the category SS of the DC component stored at this generated address
It can be configured by the decoding table 202 that outputs the SS or the zero run length RRRR of the AC component and the category SSSS as the decoded data RS1.
【0031】第1のデータ長算出部30は、第1の復号
部20の復号化データRS1と、この復号化データRS
1に対応するハフマン符号のデータ長とに基づいて、復
号化データRS1に対応する符号化データ(ハフマン符
号+付加ビット)のデータ長を算出し、データ長L1と
して出力する。The first data length calculation section 30 includes the decoded data RS1 of the first decoding section 20 and the decoded data RS.
Based on the data length of the Huffman code corresponding to 1, the data length of the encoded data (Huffman code + additional bits) corresponding to the decoded data RS1 is calculated and output as the data length L1.
【0032】第2の復号部41〜第2の復号部44は、
データ抽出部10において抽出されたデータ列Dsの先
頭ビットに対してそれぞれ3ビット〜6ビットだけデー
タストリームの末尾側にずれたデータ位置から5ビット
分のデータ列を入力し、この入力したデータ列に含まれ
る所定のハフマン符号をそれぞれ検索する。そして、検
索したハフマン符号に対応する復号化データRS21〜
復号化データRS24をそれぞれ出力する。なお、上述
したように、ハフマン符号のデータ長は最長で16ビッ
トだが、この第2の復号部において復号できるハフマン
符号のデータ長は最長で5ビットまでなので、第2の復
号部が持つハフマン符号のデータテーブルは、全てのハ
フマン符号を復号できる第1の復号部20のデータテー
ブルの一部分だけで良い。The second decoding section 41 to the second decoding section 44 are
A data string of 5 bits is input from a data position shifted to the end side of the data stream by 3 to 6 bits with respect to the first bit of the data string Ds extracted by the data extraction unit 10, and the input data string is input. Each of the predetermined Huffman codes included in is searched. Then, the decoded data RS21-corresponding to the retrieved Huffman code
The decoded data RS24 is output. As described above, the Huffman code has a maximum data length of 16 bits, but the Huffman code that can be decoded by the second decoding unit has a maximum data length of 5 bits. The data table of 1 need only be a part of the data table of the first decoding unit 20 capable of decoding all Huffman codes.
【0033】また、第2の復号部41〜第2の復号部4
4は、入力したデータ列に含まれるハフマン符号のデー
タ長が5ビットよりも長く、該当するハフマン符号をデ
ータテーブルから見つけることができない場合に、それ
ぞれ検索エラー信号Esr1〜検索エラー信号Esr4
を出力する。Further, the second decoding unit 41 to the second decoding unit 4
4 is a search error signal Esr1 to a search error signal Esr4 when the data length of the Huffman code included in the input data string is longer than 5 bits and the corresponding Huffman code cannot be found from the data table.
Is output.
【0034】選択部50は、第2の復号部41〜第2の
復号部44の中から、データ長L1に応じて1つの第2
の復号部を選択し、その復号化データRs2または検索
エラー信号Esrを出力する。図2の例では、データ長
L1が3ビットの場合に第2の復号部41を、4ビット
の場合に第2の復号部42を、5ビットの場合に第2の
復号部43を、6ビットの場合に第2の復号部44を選
択する。また、これに該当する第2の復号部が無い場
合、すなわちデータ長L1が3ビット〜6ビットの範囲
に含まれない場合には、選択エラー信号Eselを出力
する。The selecting unit 50 selects one of the second decoding unit 41 to the second decoding unit 44 according to the data length L1.
, And outputs the decoded data Rs2 or the search error signal Esr. In the example of FIG. 2, the second decoding unit 41 is used when the data length L1 is 3 bits, the second decoding unit 42 is used when the data length L1 is 4 bits, and the second decoding unit 43 is used when the data length L1 is 5 bits. In the case of bits, the second decoding unit 44 is selected. If there is no corresponding second decoding unit, that is, if the data length L1 is not included in the range of 3 bits to 6 bits, the selection error signal Esel is output.
【0035】第2のデータ長算出部60は、選択部50
において選択された第2の復号部の復号化データRS2
と、この復号化データRS2に対応するハフマン符号の
データ長とに基づいて、復号化データRS2に対応する
符号化データのデータ長を算出し、データ長L2として
出力する。The second data length calculation unit 60 includes a selection unit 50.
The decoded data RS2 of the second decoding unit selected in
And the data length of the Huffman code corresponding to the decoded data RS2, the data length of the coded data corresponding to the decoded data RS2 is calculated and output as the data length L2.
【0036】無効信号生成部70は、選択部50におい
て選択された第2の復号部から検索エラー信号Esrが
出力される場合、または選択部50から選択エラー信号
Eselが出力される場合に、復号化データRS2が無
効であることを知らせる無効信号Sivを生成する。ま
た、第1の復号部20の復号化データRS1として、符
号化の単位ブロックの末尾を示す符号EOBが含まれる
場合や、後述する計数部90において計数エラー信号E
cntが出力される場合にも、無効信号Sivを生成す
る。The invalid signal generating section 70 decodes when the second decoding section selected by the selecting section 50 outputs the search error signal Esr or when the selecting section 50 outputs the selection error signal Esel. An invalidation signal Siv is generated to notify that the encoded data RS2 is invalid. Further, when the decoded data RS1 of the first decoding unit 20 includes the code EOB indicating the end of the unit block for encoding, or when the counting error signal E in the counting unit 90 described later is included.
Even when cnt is output, the invalid signal Siv is generated.
【0037】データ抽出位置シフト部80は、データ長
L1とデータ長L2との和に応じたデータ数だけ、デー
タ抽出部10のデータ列抽出位置をデータストリームの
末尾側にシフトさせるシフト信号Sftを生成する。ま
た、無効信号Sivが生成される場合には、データ長L
1に応じたデータ数だけデータ抽出手段10の抽出位置
を末尾側へシフトさせるシフト信号Sftを生成する。The data extraction position shift unit 80 shifts the shift signal Sft for shifting the data string extraction position of the data extraction unit 10 to the end side of the data stream by the number of data corresponding to the sum of the data length L1 and the data length L2. To generate. When the invalid signal Siv is generated, the data length L
The shift signal Sft for shifting the extraction position of the data extraction means 10 to the end side by the number of data corresponding to 1 is generated.
【0038】計数部90は、復号化データRS1と復号
化データRS2とに含まれるゼロランレングスRRRR
に応じて、64個のDCT係数からなる単位ブロック内
で復号化されたAC成分のDCT係数を計数する。な
お、無効信号生成部70において無効信号Sivが生成
される場合には、復号化データRS2に含まれるゼロラ
ンレングスRRRRを無効にしてAC成分のDCT係数
を計数する。すなわち、復号化データRS2のゼロラン
レングスRRRRは計数値に含めない。AC成分の計数
値が63個(単位ブロック全体のDCT係数64個−D
C成分のDCT係数1個)に達した場合には、この計数
値Scntをゼロに初期化して、再びAC成分の計数を
行う。The counting section 90 includes a zero run length RRRR included in the decoded data RS1 and the decoded data RS2.
According to, the DCT coefficient of the decoded AC component in the unit block consisting of 64 DCT coefficients is counted. When the invalid signal Siv is generated in the invalid signal generator 70, the zero run length RRRR included in the decoded data RS2 is invalidated and the DCT coefficient of the AC component is counted. That is, the zero run length RRRR of the decoded data RS2 is not included in the count value. The count value of the AC component is 63 (64 DCT coefficients of the whole unit block-D
When the DC component of the C component reaches 1), the count value Scnt is initialized to zero and the AC component is counted again.
【0039】また、AC成分の計数値が63個より大き
くなる場合には、計数エラー信号Ecntを出力し、復
号化データRS2を無効にする。AC成分の計数値が6
3個より大きくなる場合、第1の復号部20において復
号化されたDCT係数で単位ブロックの末尾に到達する
ので、復号化データRS2によって復号されるDCT係
数は、次の単位ブロックの先頭データとなる。ところ
が、単位ブロックの先頭データはDC成分なので、第2
の復号部41〜第2の復号部44においては復号するこ
とができない。したがって、この場合には復号化データ
RS2が無効となるように計数エラー信号Ecntを出
力する。When the AC component count value exceeds 63, the count error signal Ecnt is output and the decoded data RS2 is invalidated. AC component count value is 6
When the number is larger than 3, the end of the unit block is reached by the DCT coefficient decoded by the first decoding unit 20, so the DCT coefficient decoded by the decoded data RS2 is the same as the head data of the next unit block. Become. However, since the head data of the unit block is the DC component, the second
The decoding units 41 to 44 cannot perform decoding. Therefore, in this case, the counting error signal Ecnt is output so that the decoded data RS2 becomes invalid.
【0040】DCT係数出力部101は、復号化データ
RS1に基づいて抽出データ列Dsから付加データを抽
出し、この抽出した付加データからDC成分またはAC
成分のDCT係数D1を算出して出力する。DCT係数
出力部102は、復号化データRS2に基づいて抽出デ
ータ列Dsから付加データを抽出し、この抽出した付加
データからAC成分のDCT係数D2を算出して出力す
る。The DCT coefficient output unit 101 extracts additional data from the extracted data string Ds based on the decoded data RS1, and extracts the DC component or AC from the extracted additional data.
The DCT coefficient D1 of the component is calculated and output. The DCT coefficient output unit 102 extracts additional data from the extracted data string Ds based on the decoded data RS2, calculates the DCT coefficient D2 of the AC component from the extracted additional data, and outputs it.
【0041】ここで、図2に示すハフマン復号化器にお
いて、2つの復号化データ(復号化データRS1および
復号化データRS2)に基づいて2つのDCT係数を出
力するDCT係数出力部の具体的な構成例について、図
3を参照して説明する。図3において、符号1011お
よび符号1021は付加データ抽出部を、符号1012
および符号1022はDCT係数算出部をそれぞれ示
す。Here, in the Huffman decoder shown in FIG. 2, a concrete example of a DCT coefficient output section for outputting two DCT coefficients based on two pieces of decoded data (decoded data RS1 and decoded data RS2). A configuration example will be described with reference to FIG. In FIG. 3, reference numerals 1011 and 1021 denote additional data extraction units, reference numeral 1012.
Reference numeral 1022 denotes a DCT coefficient calculation unit, respectively.
【0042】付加データ抽出部1011は、データ抽出
部10の抽出データ列Dsから27ビット全てのデータ
列を入力し、この入力したデータ列から、復号化データ
RS1に含まれるカテゴリSSSSに基づいて付加デー
タAD1を抽出する。The additional data extraction unit 1011 inputs all 27-bit data strings from the extracted data string Ds of the data extraction unit 10, and adds from this input data string based on the category SSSS included in the decoded data RS1. The data AD1 is extracted.
【0043】付加データ抽出部1021は、データ抽出
部10の抽出データ列Dsの先頭ビットに対して3ビッ
トだけシフトしたビット位置から13ビット分のデータ
列を入力し、この入力したデータ列から、復号化データ
RS2に含まれるカテゴリSSSSに基づいて付加デー
タAD2を抽出する。第2の復号部において復号される
ハフマン符号の最長データは5ビットであり、この場合
の付加ビットの最長データは5ビットなので、付加ビッ
トの抽出範囲は、第2の復号部に入力されるデータ列の
先頭ビットから10ビットの範囲となる。したがって、
付加データAD2の抽出範囲は、第2の復号部41に入
力されるデータ列の先頭ビットから、第2の復号部44
に入力される10ビットのデータ列の末尾までの13ビ
ットの範囲となる。The additional data extraction unit 1021 inputs a data sequence of 13 bits from a bit position shifted by 3 bits with respect to the leading bit of the extraction data sequence Ds of the data extraction unit 10, and from this input data sequence, The additional data AD2 is extracted based on the category SSSS included in the decrypted data RS2. The longest data of the Huffman code decoded by the second decoding unit is 5 bits, and the longest data of the additional bits in this case is 5 bits. Therefore, the extraction range of the additional bits is the data input to the second decoding unit. The range is from the first bit of the column to 10 bits. Therefore,
The extraction range of the additional data AD2 is from the first bit of the data string input to the second decoding unit 41 to the second decoding unit 44.
The range of 13 bits to the end of the 10-bit data string input to is.
【0044】DCT係数算出部1012は、付加データ
抽出部1011において抽出された付加データAD1と
復号化データRS1とに基づいて、DC成分またはAC
成分のDCT係数を算出する。DC成分は、前の単位ブ
ロックにおいて算出されたDC成分に、付加データAD
1とカテゴリSSSSとから求められる正または負の差
分値を加算することによって算出する。また、ゼロ値の
AC成分はゼロランレングスRRRRに応じて算出し、
非ゼロ値のAC成分は付加データAD2とカテゴリSS
SSとに応じて算出する。DCT係数算出部1022
は、付加データ抽出部1021において抽出された付加
データAD2と復号化データRS2とに基づいて、AC
成分のDCT係数を算出する。The DCT coefficient calculation unit 1012 calculates the DC component or AC based on the additional data AD1 and the decoded data RS1 extracted by the additional data extraction unit 1011.
Calculate the DCT coefficient of the component. The DC component is the additional data AD added to the DC component calculated in the previous unit block.
It is calculated by adding a positive or negative difference value obtained from 1 and the category SSSS. Also, the AC component of zero value is calculated according to the zero run length RRRR,
AC component of non-zero value is additional data AD2 and category SS
Calculate according to SS. DCT coefficient calculation unit 1022
Is AC based on the additional data AD2 and the decoded data RS2 extracted by the additional data extraction unit 1021.
Calculate the DCT coefficient of the component.
【0045】次に、上述した図1〜図3に示すJPEG
復号化装置の動作について、ハフマン復号化器1002
を中心に説明する。Next, the JPEG shown in FIGS. 1 to 3 described above.
Regarding the operation of the decoding device, the Huffman decoder 1002
I will explain mainly.
【0046】図4は、データ抽出部10で抽出される2
7ビットのデータ列中において、復号部20および復号
部41〜復号部44が復号化可能な符号化データの範囲
を示す図である。図4に示すように、第1の復号部20
は、抽出データ列Dsの先頭ビット‘0’から末尾ビッ
ト‘26’までの符号化データを復号化することができ
る。これに対し、第2の復号部41は抽出データ列Ds
のビット‘3’からビット‘12’まで、第2の復号部
42はビット‘4’からビット‘13’まで、第2の復
号部43はビット‘5’からビット‘14’まで、第2
の復号部44はビット‘6’からビット‘15’までの
範囲の符号化データをそれぞれ復号化することができ
る。何れの第2の復号部からの出力を選択するかは、第
1のデータ長算出部30において算出された、1つ目の
符号化データのデータ長L1に応じて決定される。In FIG. 4, 2 extracted by the data extraction unit 10
It is a figure which shows the range of the coded data which can be decoded by the decoding part 20 and the decoding parts 41-44 in a 7-bit data string. As shown in FIG. 4, the first decoding unit 20
Can decode the encoded data from the first bit "0" to the last bit "26" of the extracted data string Ds. On the other hand, the second decoding unit 41 uses the extracted data string Ds
From bit '3' to bit '12', the second decoding unit 42 from bit '4' to bit '13', and the second decoding unit 43 from bit '5' to bit '14'.
The decoding unit 44 can decode the encoded data in the range from bit '6' to bit '15'. Which of the second decoding units the output is selected is determined according to the data length L1 of the first encoded data calculated by the first data length calculation unit 30.
【0047】図5は、抽出データ列Dsに含まれる2つ
の符号化データの一例を示す図である。図5において、
抽出データ列Dsの先頭ビット‘0’からビット‘4’
までの5ビット分が1つ目の符号化データ1、ビット
‘5’からビット‘10’までの6ビット分が2つ目の
符号化データ2となっている。また符号化データ1の前
半2ビットはハフマン符号、後半3ビットは付加ビット
となっており、符号化データ2の前半3ビットはハフマ
ン符号、後半3ビットは付加ビットとなっている。FIG. 5 is a diagram showing an example of two pieces of encoded data included in the extracted data string Ds. In FIG.
From the first bit "0" to the bit "4" of the extracted data string Ds
Up to 5 bits are the first coded data 1, and 6 bits from bit "5" to bit "10" are the second coded data 2. Further, the first two bits of the encoded data 1 are Huffman codes and the latter three bits are additional bits, and the first three bits of the encoded data 2 are Huffman codes and the latter three bits are additional bits.
【0048】この場合、バッファ1001からデータ抽
出部10により抽出された27ビット抽出データDs
は、先頭ビット‘0’から16ビット分のデータ列が第
1の復号部20に入力され、その入力されたデータ列の
先頭2ビットからハフマン符号が検索される。そして、
検索されたハフマン符号に対応したゼロランレングスR
RRRおよびカテゴリSSSSが復号化データRS1と
して出力される。In this case, the 27-bit extraction data Ds extracted from the buffer 1001 by the data extraction unit 10
, A data string for 16 bits from the leading bit “0” is input to the first decoding unit 20, and the Huffman code is searched from the leading 2 bits of the input data string. And
Zero run length R corresponding to the retrieved Huffman code
The RRR and the category SSSS are output as the decoded data RS1.
【0049】第1の復号部20の復号化データRS1
は、DCT係数出力部101に入力され、この復号化デ
ータRS1と抽出データ列Dsとに基づいて、符号化デ
ータ1のDCT係数D1が算出される。Decoded data RS1 of the first decoding section 20
Is input to the DCT coefficient output unit 101, and the DCT coefficient D1 of the encoded data 1 is calculated based on the decoded data RS1 and the extracted data string Ds.
【0050】第1のデータ長算出部30では、この復号
化データRS1のカテゴリSSSSで指定される付加ビ
ットのデータ長と、復号化データRS1に対応するハフ
マン符号のデータ長との和に応じて、符号化データ1の
データ長L1が算出される。図5の例では、ハフマン符
号の2ビットと付加ビットの3ビットとの和から、デー
タ長L1として5ビットが算出される。In the first data length calculation unit 30, the data length of the additional bit designated by the category SSSS of the decoded data RS1 and the data length of the Huffman code corresponding to the decoded data RS1 are summed up. , The data length L1 of the encoded data 1 is calculated. In the example of FIG. 5, 5 bits are calculated as the data length L1 from the sum of 2 bits of the Huffman code and 3 bits of the additional bits.
【0051】算出されたデータ長L1は選択部50に入
力され、このデータ長L1に応じて第2の復号部が選択
される。図5の例では、抽出データ列Dsの先頭ビット
‘0’に対して6ビット目のビット‘5’からハフマン
符号の検索を行う第2の復号部43が選択される。そし
て、その復号化データRS23および検索エラー信号E
sr3が、それぞれ復号化データRS2および検索エラ
ー信号Esrとして選択部50から出力される。The calculated data length L1 is input to the selection unit 50, and the second decoding unit is selected according to the data length L1. In the example of FIG. 5, the second decoding unit 43 that searches for the Huffman code from the sixth bit “5” for the first bit “0” of the extracted data string Ds is selected. Then, the decoded data RS23 and the search error signal E
sr3 is output from the selection unit 50 as the decoded data RS2 and the search error signal Esr, respectively.
【0052】ただし、図5の例では、符号化データ1の
データ長L1は5ビットであり、3ビット〜6ビットの
範囲に含まれているので、この場合、選択エラー信号E
selは出力されない。また、符号化データ2のハフマ
ン符号は3ビットであり、5ビットを越えていないの
で、第2の復号部43から検索エラー信号Esr3は出
力されない。したがって、選択部50から検索エラー信
号Esrは出力されない。However, in the example of FIG. 5, since the data length L1 of the encoded data 1 is 5 bits and is included in the range of 3 bits to 6 bits, in this case, the selection error signal E
sel is not output. Further, since the Huffman code of the encoded data 2 has 3 bits and does not exceed 5 bits, the search error signal Esr3 is not output from the second decoding unit 43. Therefore, the search error signal Esr is not output from the selection unit 50.
【0053】選択部50において選択された復号化デー
タRS2は、DCT係数出力部102に入力され、この
復号化データRS2と抽出データ列Dsとに基づいて、
符号化データ2のDCT係数D2が算出される。The decoded data RS2 selected by the selection unit 50 is input to the DCT coefficient output unit 102, and based on this decoded data RS2 and the extracted data string Ds,
The DCT coefficient D2 of the encoded data 2 is calculated.
【0054】第2のデータ長算出部60では、この復号
化データRS2のカテゴリSSSSで指定される付加ビ
ットのデータ長と、復号化データRS2に対応するハフ
マン符号のデータ長との和に応じて、符号化データ2の
データ長L2が算出される。図5の例では、ハフマン符
号の3ビットと付加ビットの3ビットとの和から、デー
タ長L2として6ビットが算出される。In the second data length calculation unit 60, according to the sum of the data length of the additional bit designated by the category SSSS of the decoded data RS2 and the data length of the Huffman code corresponding to the decoded data RS2. , The data length L2 of the encoded data 2 is calculated. In the example of FIG. 5, 6 bits are calculated as the data length L2 from the sum of 3 bits of the Huffman code and 3 bits of the additional bits.
【0055】算出されたデータ長L1およびデータ長L
2は、ともにデータ抽出位置シフト部80に入力され、
無効信号Sivが生成されていない場合、これらのデー
タ長の和に応じたシフト信号Sftが生成される。これ
により、図5の例では、抽出データ列Dsのビット‘1
1’にデータ抽出位置がシフトされ、次の2つの符号化
データはこの位置から復号される。無効信号Sivが生
成されている場合には、符号化データ2の復号化データ
RS2が無効であるので、データ長L2によるシフト分
は無視され、データ長L1のみに応じたシフト信号Sf
tが生成される。これにより、図5の例では、抽出デー
タ列Dsのビット‘5’にデータ抽出位置がシフトされ
る。Calculated data length L1 and data length L
2 are both input to the data extraction position shift unit 80,
When the invalid signal Siv is not generated, the shift signal Sft corresponding to the sum of these data lengths is generated. As a result, in the example of FIG. 5, bit “1” of the extracted data string Ds
The data extraction position is shifted to 1 ', and the next two pieces of encoded data are decoded from this position. When the invalid signal Siv is generated, since the decoded data RS2 of the encoded data 2 is invalid, the shift amount due to the data length L2 is ignored and the shift signal Sf corresponding to only the data length L1.
t is generated. As a result, in the example of FIG. 5, the data extraction position is shifted to bit “5” of the extraction data string Ds.
【0056】また、復号部20から出力される復号化デ
ータRS1と、選択部50から出力される復号化データ
RS2は共に計数部90に入力され、これらの復号化デ
ータに含まれるゼロランレングスRRRRから、単位ブ
ロック内で復号化されたAC成分の数が計数される。例
えばゼロランレングスRRRRが7の場合、7つのゼロ
値と1つの非ゼロ値のAC成分が復号化されるので、こ
れにより復号化数8が計数値Ecntに加算される。こ
うした復号化数が、復号化データRS1および復号化デ
ータRS2の各々のゼロランレングスRRRRに対して
算出され、計数値Ecntに加算される。計数値Scn
tが63を越える場合は、符号化データ2が単位ブロッ
クの先頭データであるので、この復号化データRS2を
無効にするための計数エラー信号Ecntが出力され
る。The decoded data RS1 output from the decoding unit 20 and the decoded data RS2 output from the selecting unit 50 are both input to the counting unit 90, and the zero run length RRRR included in these decoded data is included. From, the number of decoded AC components in the unit block is counted. For example, when the zero run length RRRR is 7, since seven zero value and one non-zero value AC components are decoded, the decoding number 8 is added to the count value Ecnt. Such a decoding number is calculated for each zero run length RRRR of the decoded data RS1 and the decoded data RS2, and added to the count value Ecnt. Count value Scn
When t exceeds 63, the encoded data 2 is the head data of the unit block, and therefore the counting error signal Ecnt for invalidating the decoded data RS2 is output.
【0057】図5の例では、選択エラー信号Eselお
よび検索エラー信号Esrは何れも出力されていないの
で、これによる無効信号Sivは生成されない。復号化
データRS1に単位ブロックの末尾を示す符号EOBが
含まれる場合や、計数部90において計数エラー信号E
cntが出力される場合において、無効信号Sivが生
成される。無効信号Sivが生成されると、復号化デー
タRS2に基づいて復号されるAC成分のDCT係数D
2や、データ長L2、計数部90における計数値Scn
tなどが無効なデータとして処理される。In the example of FIG. 5, neither the selection error signal Esel nor the search error signal Esr is output, so that the invalid signal Siv is not generated. When the decoded data RS1 includes the code EOB indicating the end of the unit block, or when the counting unit 90 causes the counting error signal E
When cnt is output, the invalid signal Siv is generated. When the invalid signal Siv is generated, the DCT coefficient D of the AC component decoded based on the decoded data RS2
2, the data length L2, the count value Scn in the counting unit 90
t and the like are processed as invalid data.
【0058】図6は、符号化データ2に含まれるハフマ
ン符号長が5ビットを越えるために検索エラー信号Es
rが出力される例を示す。図6において、抽出データ列
Dsの先頭ビット‘0’からビット‘4’までの5ビッ
ト分が1つ目の符号化データ1、ビット‘5’からビッ
ト‘18’までの14ビット分が2つ目の符号化データ
2となっている。また符号化データ1の前半2ビットは
ハフマン符号、後半3ビットは付加ビットとなってお
り、符号化データ2の前半7ビットはハフマン符号、後
半7ビットは付加ビットとなっている。In FIG. 6, since the Huffman code length included in the encoded data 2 exceeds 5 bits, the search error signal Es
An example in which r is output is shown. In FIG. 6, five bits from the first bit “0” to the bit “4” of the extracted data string Ds is the first encoded data 1, and 14 bits from the bit “5” to the bit “18” are two. It is the second encoded data 2. The first half 2 bits of the encoded data 1 are Huffman codes and the latter half 3 bits are additional bits. The first half 7 bits of the encoded data 2 are Huffman codes and the latter half 7 bits are additional bits.
【0059】図6の例でも、符号化データ1のデータ長
L1が5ビットなので、選択部50において第2の復号
部43が選択されるが、符号化データ2のハフマン符号
長は7ビットであるため、第2の復号部43ではこのハ
フマン符号を検索することができず、第2の復号部43
から検索エラー信号Esr3が出力されている。この検
索エラー信号が選択されるため、選択部50からは検索
エラー信号Esrが無効信号生成部70に出力され、無
効信号Sivが生成される。Also in the example of FIG. 6, since the data length L1 of the encoded data 1 is 5 bits, the second decoding unit 43 is selected by the selection unit 50, but the Huffman code length of the encoded data 2 is 7 bits. Therefore, the second decoding unit 43 cannot search for this Huffman code, and the second decoding unit 43
The search error signal Esr3 is output from. Since this search error signal is selected, the search error signal Esr is output from the selection unit 50 to the invalid signal generation unit 70, and the invalid signal Siv is generated.
【0060】したがって、図6の例では、データ抽出位
置シフト部80においてデータ長L2が無効にされ、デ
ータ抽出位置はデータ長L1のみに応じてシフトされ
る。すなわち、次の符号化データを復号化する先頭ビッ
トは抽出データ列Dsのビット‘5’に設定される。ま
た、無効信号Sivが生成されるため、DCT係数出力
部102から出力されるDCT係数D2は、逆量子化器
1003および逆DCT器1004において無効なデー
タとして処理される。さらに、復号化データRS2のゼ
ロランレングスRRRRに対応する復号化数は計数部9
0において無効とされ、この分の復号化数は計数値Sc
ntに加算されない。Therefore, in the example of FIG. 6, the data extraction position shift unit 80 invalidates the data length L2, and the data extraction position is shifted according to only the data length L1. That is, the leading bit for decoding the next encoded data is set to bit '5' of the extracted data string Ds. Further, since the invalid signal Siv is generated, the DCT coefficient D2 output from the DCT coefficient output unit 102 is processed as invalid data in the dequantizer 1003 and the inverse DCT device 1004. Further, the decoding number corresponding to the zero run length RRRR of the decoded data RS2 is the counting unit 9
It is invalidated at 0, and the number of decodings for this is the count value Sc.
Not added to nt.
【0061】図7は、符号化データ1のデータ長が3ビ
ット〜6ビットの範囲に含まれないために選択エラー信
号Eselが出力される例を示す。図7において、抽出
データ列Dsの先頭ビット‘0’からビット‘6’まで
の7ビット分が1つ目の符号化データ1、ビット‘7’
からビット‘11’までの5ビット分が2つ目の符号化
データ2となっている。また符号化データ1の前半4ビ
ットはハフマン符号、後半3ビットは付加ビットとなっ
ており、符号化データ2の前半2ビットはハフマン符
号、後半3ビットは付加ビットとなっている。FIG. 7 shows an example in which the selection error signal Esel is output because the data length of the encoded data 1 is not included in the range of 3 bits to 6 bits. In FIG. 7, 7 bits from the first bit “0” to the bit “6” of the extracted data string Ds is the first encoded data 1, bit “7”.
5 bits from to 11 are the second encoded data 2. The first 4 bits of the encoded data 1 are Huffman codes and the latter 3 bits are additional bits. The first 2 bits of the encoded data 2 are Huffman codes and the latter 3 bits are additional bits.
【0062】図7の例では、符号化データ1のデータ長
L1が7ビットであり、3ビット〜6ビットの範囲を越
えているので、これに対応する第2の復号部を選択部5
0において選択することができず、選択部50から選択
エラー信号Eselが出力される。これにより、無効信
号生成部70において無効信号Sivが生成される。In the example of FIG. 7, the data length L1 of the encoded data 1 is 7 bits, which exceeds the range of 3 bits to 6 bits. Therefore, the second decoding unit corresponding to this is selected by the selection unit 5.
No selection can be made at 0, and the selection error signal Esel is output from the selection unit 50. As a result, the invalid signal Siv is generated in the invalid signal generator 70.
【0063】したがって、図7の例においても、データ
抽出位置シフト部80においてデータ長L2が無効にさ
れ、データ抽出位置はデータ長L1のみに応じてシフト
される。すなわち、次の符号化データを復号化する先頭
ビットは抽出データ列Dsのビット‘7’に設定され
る。また、DCT係数出力部102から出力されるDC
T係数D2は、逆量子化器1003および逆DCT器に
おいて無効なデータとして処理される。さらに、復号化
データRS2のゼロランレングスRRRRに対応する復
号化数は計数部90において無効とされ、この分の復号
化数は計数値Scntに加算されない。Therefore, also in the example of FIG. 7, the data extraction position shift unit 80 invalidates the data length L2, and the data extraction position is shifted according to only the data length L1. That is, the leading bit for decoding the next encoded data is set to bit '7' of the extracted data string Ds. The DC output from the DCT coefficient output unit 102
The T coefficient D2 is processed as invalid data in the inverse quantizer 1003 and the inverse DCT device. Furthermore, the decoding number corresponding to the zero run length RRRR of the decoding data RS2 is invalidated in the counting unit 90, and the decoding number for this is not added to the count value Scnt.
【0064】図8は、一般的な20枚の画像をJPEG
符号化した場合において、ハフマン符号のデータ長ごと
の出現数を調べた結果の一例を示す図である。画像sa
mple1〜画像sample20のそれぞれについ
て、2ビットから6ビットまでのハフマン符号の出現数
および出現率(%)が示されている。一番右の列は、各
画像におけるハフマン符号の総数を示す。また図9は、
一般的な20枚の画像をJPEG符号化した場合におい
て、ハフマン符号と付加ビットとの和のデータ長につい
て、図8と同様に出現数を調べた結果の一例を示す図で
ある。FIG. 8 shows a typical 20 images in JPEG.
It is a figure which shows an example of the result of having investigated the number of appearances for every data length of Huffman code, when encoding. Image sa
The number of appearances and the appearance rate (%) of the Huffman code from 2 bits to 6 bits are shown for each of the mpl1 to the image sample20. The rightmost column shows the total number of Huffman codes in each image. In addition, FIG.
FIG. 9 is a diagram showing an example of the result of checking the number of appearances in the same manner as in FIG. 8 for the data length of the sum of Huffman code and additional bits when JPEG-encoding 20 general images.
【0065】図8から分かるように、一般的な画像をJ
PEG符号化した場合におけるハフマン符号のデータ長
は、全体の約75%以上が2ビット〜4ビットの範囲に
含まれ、約85%以上が2ビット〜5ビットの範囲に含
まれる。また図9から分かるように、ハフマン符号と付
加ビットとを合わせたデータ長は、全体の55%程度が
3ビット〜5ビットの範囲に含まれ、70%程度が3ビ
ット〜6ビットの範囲に含まれる。As can be seen from FIG.
Regarding the data length of the Huffman code in the case of PEG coding, about 75% or more of the whole is included in the range of 2 bits to 4 bits, and about 85% or more is included in the range of 2 bits to 5 bits. As can be seen from FIG. 9, about 55% of the total data length of the Huffman code and the additional bits is included in the range of 3 bits to 5 bits, and about 70% is included in the range of 3 bits to 6 bits. included.
【0066】図2のハフマン復号化器は、このようなハ
フマン符号長の出現率の偏りを利用して、必要なハフマ
ン符号のデータテーブルの記憶容量を削減するものであ
る。すなわち、第1の復号部20には、DC成分および
AC成分の全ハフマン符号が復号可能なデータテーブル
を持たせている一方で、第2の復号部41〜第2の復号
部44には、1つ目の符号化データ1のデータ長(ハフ
マン符号長+付加ビット長)が3ビット〜6ビットまで
の場合(出現率70%程度)で、かつ、2つ目の符号化
データ2が2ビット〜5ビットまでのハフマン符号を含
む場合(出現率85%程度)において、この符号化デー
タを復号化できる最小限のデータテーブルを持たせてい
る。The Huffman decoder shown in FIG. 2 reduces the required storage capacity of the Huffman code data table by utilizing such a bias in the appearance rate of the Huffman code length. That is, the first decoding unit 20 has a data table capable of decoding all Huffman codes of the DC component and the AC component, while the second decoding unit 41 to the second decoding unit 44 When the data length (Huffman code length + additional bit length) of the first encoded data 1 is from 3 bits to 6 bits (appearance rate is about 70%), and the second encoded data 2 is 2 When a Huffman code of 5 bits to 5 bits is included (appearance rate is about 85%), a minimum data table capable of decoding this coded data is provided.
【0067】したがって、図17の従来例に比べてデー
タテーブルに必要な記憶容量を大幅に削減することがで
き、回路構成を簡易化することができる。また、図17
の従来例のように、2つの符号化データを100%復号
化することはできないが、比較的高い頻度(70%×8
5%=約60%)で2つの符号化データを同時に復号化
することができ、JPEG符号化データストリームの高
速な復号化を実現できる。Therefore, as compared with the conventional example of FIG. 17, the storage capacity required for the data table can be greatly reduced and the circuit structure can be simplified. In addition, FIG.
Although it is not possible to decode two pieces of encoded data 100% as in the conventional example, the frequency is relatively high (70% × 8).
5% = about 60%), two pieces of encoded data can be simultaneously decoded, and high-speed decoding of a JPEG encoded data stream can be realized.
【0068】<第2の実施形態>次に、本発明の第2の
実施形態について説明する。第1の実施形態において
は、同時に2つまでの符号化データを復号化することが
できたが、第2の実施形態においては、同時にそれ以上
の符号化データを復号化することができる。<Second Embodiment> Next, a second embodiment of the present invention will be described. In the first embodiment, up to two pieces of encoded data can be simultaneously decoded, but in the second embodiment, more encoded data can be simultaneously decoded.
【0069】図10は、本発明の第2の実施形態に係
る、図1のハフマン復号化器1002の構成例を示す概
略的なブロック図である。図2と図10の同一符号は同
一の構成要素を示す。その他、図10に示すハフマン復
号化器は、第2の復号部45〜第2の復号部410、選
択部51および選択部52、第2のデータ長算出部61
および第2のデータ長算出部62、無効信号生成部71
および無効信号生成部72、データ抽出位置シフト部8
0’、計数部90’およびDCT係数出力部103を有
する。FIG. 10 is a schematic block diagram showing a configuration example of the Huffman decoder 1002 of FIG. 1 according to the second embodiment of the present invention. The same reference numerals in FIGS. 2 and 10 denote the same components. In addition, the Huffman decoder shown in FIG. 10 includes a second decoding unit 45 to a second decoding unit 410, a selection unit 51 and a selection unit 52, and a second data length calculation unit 61.
And the second data length calculation unit 62, the invalid signal generation unit 71
And the invalid signal generation unit 72, the data extraction position shift unit 8
It has 0 ', a counting unit 90', and a DCT coefficient output unit 103.
【0070】第2の復号部45〜第2の復号部410
は、データ抽出部10において抽出されたデータ列Ds
の先頭ビットに対してそれぞれ7ビット〜12ビットだ
けデータストリームの末尾側にずれたデータ位置から5
ビット分のデータ列を入力し、この入力したデータ列に
含まれる所定のハフマン符号をそれぞれ検索する。そし
て、検索したハフマン符号に対応する復号化データRS
25〜復号化データRS210をそれぞれ出力する。ま
た、入力したデータ列に含まれるハフマン符号のデータ
長が5ビットよりも長く、該当するハフマン符号をデー
タテーブルから見つけることができない場合に、それぞ
れ検索エラー信号Esr5〜検索エラー信号Esr10
を出力する。Second decoding section 45 to second decoding section 410
Is the data string Ds extracted by the data extraction unit 10.
5 bits from the data position shifted toward the end of the data stream by 7 to 12 bits with respect to the first bit of
A data string for bits is input, and a predetermined Huffman code included in the input data string is searched for. Then, the decoded data RS corresponding to the retrieved Huffman code
25 to decrypted data RS210 are output. Further, when the data length of the Huffman code included in the input data string is longer than 5 bits and the corresponding Huffman code cannot be found from the data table, the search error signal Esr5 to the search error signal Esr10, respectively.
Is output.
【0071】選択部51は、図2の選択部50と同等な
ブロックであり、第2の復号部41〜第2の復号部44
の中から、データ長L1に応じて1つの第2の復号部を
選択し、その復号化データRs2または検索エラー信号
Esr_1を出力するとともに、該当する第2の復号部
が無い場合には、第1の選択エラー信号Esel_1を
出力する。The selection unit 51 is a block equivalent to the selection unit 50 of FIG. 2, and has a second decoding unit 41 to a second decoding unit 44.
One of the second decoding units is selected according to the data length L1, the decoded data Rs2 or the search error signal Esr_1 is output, and if there is no corresponding second decoding unit, The selection error signal Esel_1 of 1 is output.
【0072】選択部52は、第2の復号部44〜第2の
復号部410の中から、データ長L1とデータ長L2と
の和に応じて1つの第2の復号部を選択し、その復号化
データRs2_2または検索エラー信号Esr_2を出
力する。図12の例では、データ長L1とデータ長L2
との和が6ビットの場合に第2の復号部44を、7ビッ
トの場合に第2の復号部45を、8ビットの場合に第2
の復号部46を、9ビットの場合に第2の復号部47
を、10ビットの場合に第2の復号部48を、11ビッ
トの場合に第2の復号部49を、12ビットの場合に第
2の復号部410を選択する。また、これに該当する第
2の復号部が無い場合、すなわちデータ長L1とデータ
長L2との和が6ビット〜12ビットの範囲に含まれな
い場合には、第2の選択エラー信号Esel_2を出力
する。The selecting section 52 selects one second decoding section from the second decoding section 44 to the second decoding section 410 in accordance with the sum of the data length L1 and the data length L2. The decoded data Rs2_2 or the search error signal Esr_2 is output. In the example of FIG. 12, the data length L1 and the data length L2
And the second decoding unit 44 when the sum is 6 bits, the second decoding unit 45 when the sum is 7 bits, and the second decoding unit 45 when the sum is 8 bits.
Of the second decoding unit 47 for 9 bits.
The second decoding unit 48 is selected for 10 bits, the second decoding unit 49 is selected for 11 bits, and the second decoding unit 410 is selected for 12 bits. If there is no second decoding unit corresponding to this, that is, if the sum of the data length L1 and the data length L2 is not included in the range of 6 bits to 12 bits, the second selection error signal Esel_2 is set. Output.
【0073】第2のデータ長算出部61は、図2の第2
のデータ長算出部60と同等のブロックであり、復号化
データRs2_1とこれに対応するハフマン符号のデー
タ長とに基づいて、復号化データRS2_1に対応する
符号化データのデータ長L2を算出する。The second data length calculation unit 61 uses the second data length calculation unit 61 shown in FIG.
The data length calculation unit 60 calculates the data length L2 of the encoded data corresponding to the decoded data RS2_1 based on the decoded data Rs2_1 and the corresponding data length of the Huffman code.
【0074】第2のデータ長算出部62は、選択部52
において選択された第2の復号部の復号化データRs2
_2と、この復号化データRS2に対応するハフマン符
号のデータ長とに基づいて、復号化データRS2_2に
対応する符号化データのデータ長を算出し、データ長L
3として出力する。The second data length calculation section 62 includes a selection section 52.
The decrypted data Rs2 of the second decryption unit selected in
_2 and the data length of the Huffman code corresponding to the decoded data RS2, the data length of the encoded data corresponding to the decoded data RS2_2 is calculated, and the data length L
Output as 3.
【0075】無効信号生成部71は、図2の無効信号生
成部70と同等のブロックであり、検索エラー信号Es
r_1または第1の選択エラー信号Esel_1が出力
される場合に、復号化データRS2_1および復号化デ
ータRS2_2が無効であることを知らせる第1の無効
信号Siv_1を生成する。また、復号化データRS1
に符号EOBが含まれる場合や、計数部90’において
第1の計数エラー信号Ecnt_1が出力される場合に
も、この第1の無効信号Siv_1を生成する。The invalid signal generator 71 is a block equivalent to the invalid signal generator 70 of FIG.
When the r_1 or the first selection error signal Esel_1 is output, the first invalidation signal Siv_1 that informs that the decoded data RS2_1 and the decoded data RS2_2 are invalid is generated. Also, the decrypted data RS1
Also includes the code EOB, or when the counting unit 90 ′ outputs the first counting error signal Ecnt_1, the first invalid signal Siv_1 is generated.
【0076】無効信号生成部72は、選択部52におい
て選択された第2の復号部から検索エラー信号Esr_
2が出力される場合、または選択部52から第2の選択
エラー信号Esel_2が出力される場合に、復号化デ
ータRS2_2が無効であることを知らせる無効信号S
iv_2を生成する。また、復号化データRS2_1に
符号EOBが含まれる場合や、計数部90’において第
2の計数エラー信号Ecnt_2が出力される場合に
も、この第2の無効信号Siv_2を生成する。The invalid signal generator 72 receives the search error signal Esr_ from the second decoder selected by the selector 52.
2 is output, or the selection unit 52 outputs the second selection error signal Esel_2, the invalid signal S indicating that the decoded data RS2_2 is invalid.
iv_2 is generated. The second invalid signal Siv_2 is also generated when the decoded data RS2_1 includes the code EOB or when the counting unit 90 ′ outputs the second counting error signal Ecnt_2.
【0077】データ抽出位置シフト部80’は、データ
長L1〜データ長L3の総和に応じたデータ数だけ、デ
ータ抽出部10のデータ列抽出位置をデータストリーム
の末尾側にシフトさせるシフト信号Sftを生成する。
また、第1の無効信号Siv_1が生成される場合に
は、データ長L1に応じたデータ数だけデータ抽出手段
10の抽出位置を末尾側へシフトさせるシフト信号Sf
tを生成する。第2の無効信号Siv_2が生成される
場合には、データ長L1とデータ長L2との和に応じた
データ数だけデータ抽出手段10の抽出位置を末尾側へ
シフトさせるシフト信号Sftを生成する。The data extraction position shift unit 80 'shifts the shift signal Sft for shifting the data string extraction position of the data extraction unit 10 to the end side of the data stream by the number of data corresponding to the sum of the data lengths L1 to L3. To generate.
Further, when the first invalid signal Siv_1 is generated, the shift signal Sf that shifts the extraction position of the data extraction unit 10 toward the tail side by the number of data corresponding to the data length L1.
generate t. When the second invalid signal Siv_2 is generated, the shift signal Sft that shifts the extraction position of the data extraction unit 10 toward the tail side by the number of data corresponding to the sum of the data length L1 and the data length L2 is generated.
【0078】計数部90’は、復号化データRS1、復
号化データRS2_1および復号化データRS2_2に
含まれるゼロランレングスRRRRに応じて、単位ブロ
ック内で復号化されたAC成分のDCT係数を計数す
る。The counter 90 'counts the DCT coefficient of the AC component decoded in the unit block according to the decoded data RS1, the decoded data RS2_1 and the zero run length RRRR contained in the decoded data RS2_2. .
【0079】なお、無効信号生成部71において第1の
無効信号Siv_1が生成される場合には、復号化デー
タRS2_1および復号化データRS2_2に含まれる
ゼロランレングスRRRRを両方とも無効にしてAC成
分のDCT係数を計数する。すなわち、復号化データR
S2_1および復号化データRS2_2のゼロランレン
グスRRRRは計数値に含めない。これに対し、無効信
号生成部72において第1の無効信号Siv_2が生成
される場合には、復号化データRS2_2に含まれるゼ
ロランレングスRRRRのみを無効にしてAC成分のD
CT係数を計数する。この場合、復号化データRS2_
1に含まれるゼロランレングスRRRRは計数値Scn
tに含まれる。When the invalid signal generator 71 generates the first invalid signal Siv_1, both the zero run length RRRR contained in the decoded data RS2_1 and the decoded data RS2_2 are invalidated and the AC component of the AC component is deleted. Count the DCT coefficients. That is, the decrypted data R
The zero run length RRRR of S2_1 and the decoded data RS2_2 is not included in the count value. On the other hand, when the invalid signal generator 72 generates the first invalid signal Siv_2, only the zero run length RRRR included in the decoded data RS2_2 is invalidated, and the AC component D
Count the CT coefficients. In this case, the decrypted data RS2_
The zero run length RRRR included in 1 is the count value Scn.
included in t.
【0080】AC成分の計数値Scntが63個(単位
ブロック全体のDCT係数64個−DC成分のDCT係
数1個)に達した場合には、この計数値Scntをゼロ
に初期化して、再びAC成分の計数を行う。When the count value Scnt of the AC component reaches 63 (64 DCT coefficients of the entire unit block-1 DCT coefficient of the DC component), the count value Scnt is initialized to zero and the AC value is returned to the AC value again. Count the components.
【0081】また、AC成分の計数値Scntが63個
より大きくなる場合において、復号化データRS2_1
および復号化RS2_2のゼロランレングスRRRRを
共に無効にしても計数値Scntが63個より大きくな
る場合は、第1の計数エラー信号Ecnt_1を生成す
る。この場合、抽出データ列Dsの2つ目の符号化デー
タが単位ブロックの先頭データになっている。また、復
号化RS2_2のゼロランレングスRRRRを無効にし
たときに計数値Scntが63個より大きくなり、復号
化データRS2_1および復号化RS2_2のゼロラン
レングスRRRRを無効にしたときに計数値Scntが
63個以下となる場合は、第2の計数エラー信号Ecn
t_2を生成する。この場合、3つ目の符号化データが
単位ブロックの先頭データになっている。When the AC component count value Scnt exceeds 63, the decoded data RS2_1
Even if the zero run length RRRR of the decoded RS2_2 is both disabled, if the count value Scnt is larger than 63, the first count error signal Ecnt_1 is generated. In this case, the second encoded data of the extracted data string Ds is the head data of the unit block. Further, the count value Scnt becomes larger than 63 when the zero run length RRRR of the decoded RS2_2 is invalidated, and the count value Scnt becomes 63 when the zero run length RRRR of the decoded data RS2_1 and the decoded RS2_2 is invalidated. If the number is equal to or less than the second count error signal Ecn
Generate t_2. In this case, the third coded data is the head data of the unit block.
【0082】DCT係数出力部103は、復号化データ
RS3に基づいて抽出データ列Dsから付加データを抽
出し、この抽出した付加データからAC成分のDCT係
数D3を算出して出力する。The DCT coefficient output unit 103 extracts additional data from the extracted data string Ds based on the decoded data RS3, calculates the DCT coefficient D3 of the AC component from the extracted additional data, and outputs it.
【0083】ここで、図10に示すハフマン復号化器に
おいて、3つの復号化データ(復号化データRS1、復
号化データRS2_1および復号化データRS2_2)
に基づいて3つのDCT係数を出力するDCT係数出力
部の具体的な構成例について、図11を参照して説明す
る。図3と図11の同一符号は同一の構成要素を示す。
また図11において、符号1031は付加データ抽出部
を、符号1032はDCT係数算出部をそれぞれ示す。Here, in the Huffman decoder shown in FIG. 10, three pieces of decoded data (decoded data RS1, decoded data RS2_1 and decoded data RS2_2) are included.
A specific configuration example of the DCT coefficient output unit that outputs three DCT coefficients based on the above will be described with reference to FIG. The same reference numerals in FIG. 3 and FIG. 11 indicate the same components.
Further, in FIG. 11, reference numeral 1031 indicates an additional data extraction unit, and reference numeral 1032 indicates a DCT coefficient calculation unit.
【0084】付加データ抽出部1021は、データ抽出
部10の抽出データ列Dsの先頭ビットに対して3ビッ
トだけシフトしたビット位置から13ビット分のデータ
列を入力し、この入力したデータ列から、復号化データ
RS2_1に含まれるカテゴリSSSSに基づいて付加
データAD2を抽出する。付加データ抽出部1031
は、データ抽出部10の抽出データ列Dsの先頭ビット
に対して6ビットだけシフトしたビット位置から16ビ
ット分のデータ列を入力し、この入力したデータ列か
ら、復号化データRS2_2に含まれるカテゴリSSS
Sに基づいて付加データAD3を抽出する。The additional data extraction unit 1021 inputs a data string of 13 bits from a bit position shifted by 3 bits with respect to the leading bit of the extracted data string Ds of the data extraction unit 10, and from the input data string, The additional data AD2 is extracted based on the category SSSS included in the decrypted data RS2_1. Additional data extraction unit 1031
Is a 16-bit data string from the bit position shifted by 6 bits with respect to the first bit of the extracted data string Ds of the data extraction unit 10, and the category included in the decoded data RS2_2 from this input data string. SSS
The additional data AD3 is extracted based on S.
【0085】DCT係数算出部1022は、付加データ
抽出部1021において抽出された付加データAD2と
復号化データRS2_1とに基づいて、AC成分のDC
T係数D2を算出する。DCT係数算出部1032は、
付加データ抽出部1031において抽出された付加デー
タAD3と復号化データRS2_2とに基づいて、AC
成分のDCT係数D3を算出する。The DCT coefficient calculator 1022 calculates the DC of the AC component based on the additional data AD2 and the decoded data RS2_1 extracted by the additional data extractor 1021.
The T coefficient D2 is calculated. The DCT coefficient calculation unit 1032
AC based on the additional data AD3 and the decoded data RS2_2 extracted by the additional data extraction unit 1031.
The DCT coefficient D3 of the component is calculated.
【0086】次に、上述した図10および図11に示す
ハフマン復号化器の動作について説明する。Next, the operation of the Huffman decoder shown in FIGS. 10 and 11 will be described.
【0087】図12は、データ抽出部10で抽出される
27ビットのデータ列中において、図10の復号部20
および復号部41〜復号部410が復号化可能な符号化
データの範囲を示す図である。図12に示すように、第
1の復号部20は、抽出データ列Dsの先頭ビット
‘0’から末尾ビット‘26’までの符号化データを復
号化することができる。これに対し、第2の復号部41
は抽出データ列Dsのビット‘3’からビット‘12’
まで、第2の復号部42はビット‘4’からビット‘1
3’まで、第2の復号部43はビット‘5’からビット
‘14’まで、第2の復号部44はビット‘6’からビ
ット‘15’まで、第2の復号部45はビット‘7’か
らビット‘16’まで、第2の復号部46はビット
‘8’からビット‘17’まで、第2の復号部47はビ
ット‘9’からビット‘18’まで、第2の復号部48
はビット‘10’からビット‘19’まで、第2の復号
部49はビット‘11’からビット‘20’まで、第2
の復号部410はビット‘12’からビット‘21’ま
での範囲の符号化データをそれぞれ復号化することがで
きる。FIG. 12 shows that in the 27-bit data string extracted by the data extracting unit 10, the decoding unit 20 of FIG.
FIG. 11 is a diagram showing a range of encoded data that can be decoded by the decoding units 41 to 410. As illustrated in FIG. 12, the first decoding unit 20 can decode the encoded data from the first bit “0” to the last bit “26” of the extracted data string Ds. On the other hand, the second decoding unit 41
Is the bit "3" to the bit "12" of the extracted data string Ds
Up to bit “4” to bit “1”
Up to 3 ', the second decoding unit 43 from bit "5" to bit "14", the second decoding unit 44 from bit "6" to bit "15", and the second decoding unit 45 from bit "7". 'From bit' 16 ', second decoding unit 46 from bit' 8 'to bit' 17 ', second decoding unit 47 from bit' 9 'to bit' 18 ', second decoding unit 48.
Is from bit '10' to bit '19', the second decoding unit 49 is from bit '11' to bit '20', second
The decoding unit 410 can decode the encoded data in the range from bit '12' to bit '21'.
【0088】また、抽出データ列Dsの1つ目の符号化
データの復号化に用いる復号化データRS1は、第1の
復号部20によって生成される。2つ目の符号化データ
の復号化に用いる復号化データRS2_1は、1つ目の
符号化データのデータ長L1に応じて、第2の復号部4
1〜第2の復号部44のうちの何れかの復号化データか
ら選択される。3つ目の符号化データの復号化に用いる
復号化データRS2_2は、1つ目の符号化データのデ
ータ長L1と2つ目の符号化データのデータ長L2との
和に応じて、第2の復号部44〜第2の復号部410の
うちの何れかの復号化データから選択される。Decoded data RS1 used for decoding the first encoded data of the extracted data sequence Ds is generated by the first decoding section 20. The decoded data RS2_1 used for decoding the second encoded data is the second decoding unit 4 according to the data length L1 of the first encoded data.
It is selected from the decoded data in any of the first to second decoding units 44. The decoded data RS2_2 used for decoding the third coded data is the second data depending on the sum of the data length L1 of the first coded data and the data length L2 of the second coded data. Selected from the decoded data of any of the decoding unit 44 to the second decoding unit 410.
【0089】図13は、抽出データ列Dsに含まれる3
つの符号化データの一例を示す図である。図13におい
て、抽出データ列Dsの先頭ビット‘0’からビット
‘5’までの6ビット分が1つ目の符号化データ1、ビ
ット‘6’からビット‘10’までの5ビット分が2つ
目の符号化データ2、ビット‘11’からビット‘2
0’までの10ビット分が3つ目の符号化データ3とな
っている。また符号化データ1の前半3ビットはハフマ
ン符号、後半3ビットは付加ビットとなっている。符号
化データ2の前半2ビットはハフマン符号、後半3ビッ
トは付加ビットとなっている。符号化データ3の前半5
ビットはハフマン符号、後半5ビットは付加ビットとな
っている。FIG. 13 shows 3 included in the extracted data string Ds.
It is a figure which shows an example of one encoded data. In FIG. 13, 6 bits from the first bit “0” to bit “5” of the extracted data string Ds is the first encoded data 1, and 5 bits from bit “6” to bit “10” is 2. Second encoded data 2, bit '11' to bit '2
The 10 bits up to 0'are the third encoded data 3. The first 3 bits of the encoded data 1 are Huffman codes, and the latter 3 bits are additional bits. The first 2 bits of the encoded data 2 are Huffman codes, and the latter 3 bits are additional bits. First half 5 of encoded data 3
The bits are Huffman codes, and the latter 5 bits are additional bits.
【0090】この場合、抽出データDsの先頭ビット
‘0’から16ビット分のデータ列が第1の復号部20
に入力され、その入力されたデータ列の先頭3ビットか
らハフマン符号が検索される。そして、検索されたハフ
マン符号に対応したゼロランレングスRRRRおよびカ
テゴリSSSSが復号化データRS1として出力され
る。In this case, the 16-bit data string from the first bit "0" of the extracted data Ds is the first decoding unit 20.
The Huffman code is searched from the leading 3 bits of the input data string. Then, the zero run length RRRR and the category SSSS corresponding to the retrieved Huffman code are output as the decoded data RS1.
【0091】第1の復号部20の復号化データRS1
は、DCT係数出力部101に入力され、この復号化デ
ータRS1と抽出データ列Dsとに基づいて、符号化デ
ータ1のDCT係数D1が算出される。Decoded data RS1 of the first decoding unit 20
Is input to the DCT coefficient output unit 101, and the DCT coefficient D1 of the encoded data 1 is calculated based on the decoded data RS1 and the extracted data string Ds.
【0092】第1のデータ長算出部30のおいては、こ
の復号化データRS1のカテゴリSSSSで指定される
付加ビットのデータ長と、復号化データRS1に対応す
るハフマン符号のデータ長との和に応じて、符号化デー
タ1のデータ長L1が算出される。図13の例では、ハ
フマン符号の3ビットと付加ビットの3ビットとの和か
ら、データ長L1として6ビットが算出される。In the first data length calculating section 30, the sum of the data length of the additional bit designated by the category SSSS of the decoded data RS1 and the data length of the Huffman code corresponding to the decoded data RS1. Accordingly, the data length L1 of the encoded data 1 is calculated. In the example of FIG. 13, 6 bits are calculated as the data length L1 from the sum of 3 bits of the Huffman code and 3 bits of the additional bits.
【0093】算出されたデータ長L1は選択部51に入
力され、このデータ長L1に応じて第2の復号部が選択
される。図13の例では、抽出データ列Dsの先頭ビッ
ト‘0’に対して7ビット目のビット‘6’からハフマ
ン符号の検索を行う第2の復号部44が選択される。そ
して、その復号化データRS24および検索エラー信号
Esr4が、それぞれ復号化データRS2_1および検
索エラー信号Esr_1として選択部51から出力され
る。The calculated data length L1 is input to the selection unit 51, and the second decoding unit is selected according to the data length L1. In the example of FIG. 13, the second decoding unit 44 that searches for the Huffman code from the 7th bit “6” for the first bit “0” of the extracted data string Ds is selected. Then, the decoded data RS24 and the search error signal Esr4 are output from the selection unit 51 as the decoded data RS2_1 and the search error signal Esr_1, respectively.
【0094】ただし、図13の例では、符号化データ1
のデータ長は6ビットであり、3ビット〜6ビットの範
囲に含まれているので、この場合、選択エラー信号Es
el_1は出力されない。また、符号化データ2のハフ
マン符号は2ビットであり、5ビットを越えていないの
で、第2の復号部44から検索エラー信号Esr4は出
力されない。したがって、選択部51から検索エラー信
号Esr_1は出力されない。However, in the example of FIG. 13, the encoded data 1
Has a data length of 6 bits and is included in the range of 3 bits to 6 bits. In this case, therefore, the selection error signal Es
el_1 is not output. Further, since the Huffman code of the encoded data 2 has 2 bits and does not exceed 5 bits, the search error signal Esr4 is not output from the second decoding unit 44. Therefore, the search error signal Esr_1 is not output from the selection unit 51.
【0095】選択部51において選択された復号化デー
タRS2_1は、DCT係数出力部102に入力され、
この復号化データRS2_1と抽出データ列Dsとに基
づいて、符号化データ2のDCT係数D2が算出され
る。The decoded data RS2_1 selected by the selection unit 51 is input to the DCT coefficient output unit 102,
The DCT coefficient D2 of the encoded data 2 is calculated based on the decoded data RS2_1 and the extracted data string Ds.
【0096】第2のデータ長算出部61においては、こ
の復号化データRS2_1のカテゴリSSSSで指定さ
れる付加ビットのデータ長と、復号化データRS2_1
に対応するハフマン符号のデータ長との和に応じて、符
号化データ2のデータ長L2が算出される。図13の例
では、ハフマン符号の2ビットと付加ビットの3ビット
との和から、データ長L2として5ビットが算出され
る。In the second data length calculation unit 61, the data length of the additional bit designated by the category SSSS of this decoded data RS2_1 and the decoded data RS2_1
The data length L2 of the encoded data 2 is calculated according to the sum with the data length of the Huffman code corresponding to. In the example of FIG. 13, 5 bits are calculated as the data length L2 from the sum of 2 bits of the Huffman code and 3 bits of the additional bits.
【0097】算出されたデータ長L1とデータ長L2
は、ともに選択部52に入力され、データ長L1とデー
タ長L2との和に応じて第2の復号部が選択される。図
13の例では、抽出データ列Dsのビット‘11’から
ハフマン符号の検索を行う第2の復号部49が選択され
る。そして、その復号化データRS29および検索エラ
ー信号Esr9が、それぞれ復号化データRS2_2お
よび検索エラー信号Esr_2として選択部52から出
力される。Calculated data length L1 and data length L2
Are both input to the selection unit 52, and the second decoding unit is selected according to the sum of the data length L1 and the data length L2. In the example of FIG. 13, the second decoding unit 49 that searches for the Huffman code from the bit “11” of the extracted data string Ds is selected. Then, the decoded data RS29 and the search error signal Esr9 are output from the selection unit 52 as the decoded data RS2_2 and the search error signal Esr_2, respectively.
【0098】選択部52において選択された復号化デー
タRS2_2は、DCT係数出力部103に入力され、
この復号化データRS2_2と抽出データ列Dsとに基
づいて、符号化データ3のDCT係数D3が算出され
る。The decoded data RS2_2 selected by the selection unit 52 is input to the DCT coefficient output unit 103,
The DCT coefficient D3 of the encoded data 3 is calculated based on the decoded data RS2_2 and the extracted data string Ds.
【0099】ただし、図13の例において、符号化デー
タ1と符号化データ2のデータ長の和は11ビットであ
り、6ビット〜12ビットの範囲に含まれているので、
この場合、選択エラー信号Esel_1は出力されな
い。また、符号化データ3のハフマン符号は5ビットで
あり、5ビットを越えていないので、第2の復号部49
から検索エラー信号Esr9は出力されない。したがっ
て、選択部52から検索エラー信号Esr_2は出力さ
れない。However, in the example of FIG. 13, the sum of the data lengths of the coded data 1 and the coded data 2 is 11 bits, which is included in the range of 6 bits to 12 bits.
In this case, the selection error signal Esel_1 is not output. The Huffman code of the encoded data 3 has 5 bits and does not exceed 5 bits. Therefore, the second decoding unit 49
Therefore, the search error signal Esr9 is not output. Therefore, the search error signal Esr_2 is not output from the selection unit 52.
【0100】算出されたデータ長L1〜データ長L3
は、ともにデータ抽出位置シフト部80’に入力され、
第1の無効信号Siv_1および第2の無効信号Siv
_2が何れも生成されていない場合に、これらのデータ
長の総和に応じたシフト信号Sftが生成される。この
場合、図13の例では、抽出データ列Dsのビット‘2
1’にデータ抽出位置がシフトされ、次の3つの符号化
データはこの位置から復号化される。第1の無効信号S
iv_1が生成されている場合には、復号化データRS
2_1および復号化データRS2_2が共に無効である
ので、データ長L2およびデータ長L3によるシフト分
は無視され、データ長L1のみに応じたシフト信号Sf
tが生成される、この場合、図13の例では、抽出デー
タ列Dsのビット‘6’にデータ抽出位置がシフトされ
る。第2の無効信号Siv_2が生成されている場合に
は、復号化データRS2_2が無効であるので、データ
長L3によるシフト分は無視され、データ長L1とデー
タ長L2との和に応じたシフト信号Sftが生成され
る、この場合、図13の例では、抽出データ列Dsのビ
ット‘11’にデータ抽出位置がシフトされる。Calculated data length L1 to data length L3
Are both input to the data extraction position shift unit 80 ′,
The first invalid signal Siv_1 and the second invalid signal Siv
When neither _2 is generated, the shift signal Sft is generated according to the total sum of these data lengths. In this case, in the example of FIG. 13, bit “2” of the extracted data string Ds
The data extraction position is shifted to 1 ', and the next three pieces of encoded data are decoded from this position. First invalid signal S
If iv_1 has been generated, the decrypted data RS
Since 2_1 and the decoded data RS2_2 are both invalid, the shift amount due to the data length L2 and the data length L3 is ignored, and the shift signal Sf corresponding to only the data length L1 is ignored.
t is generated. In this case, in the example of FIG. 13, the data extraction position is shifted to bit “6” of the extraction data string Ds. When the second invalid signal Siv_2 is generated, since the decoded data RS2_2 is invalid, the shift amount due to the data length L3 is ignored, and the shift signal according to the sum of the data length L1 and the data length L2. Sft is generated. In this case, in the example of FIG. 13, the data extraction position is shifted to bit “11” of the extraction data string Ds.
【0101】また、復号部20から出力される復号化デ
ータRS1、選択部51から出力される復号化データR
S2_1、および選択部52から出力される復号化デー
タRS2_2は共に計数部90’に入力され、これらの
復号化データに含まれるゼロランレングスRRRRか
ら、単位ブロック内で復号化されたAC成分の数が計数
される。計数値Scntが63個を越える場合におい
て、64個のDCT計数からなる単位ブロックの末尾の
データが符号化データ1に含まれる場合には第1の計数
エラー信号Ecnt_1が生成され、符号化データ2に
含まれる場合には第2の計数エラー信号Ecnt_2が
生成される。この末尾のデータが符号化データ3に含ま
れる場合は、計数値Scntが63個を越えないので、
計数エラー信号は生成されない。Further, the decoded data RS1 output from the decoding section 20 and the decoded data R output from the selection section 51
S2_1 and the decoded data RS2_2 output from the selection unit 52 are both input to the counting unit 90 ′, and from the zero run length RRRR included in these decoded data, the number of AC components decoded in the unit block. Are counted. When the count value Scnt exceeds 63 and the end data of the unit block consisting of 64 DCT counts is included in the encoded data 1, the first counting error signal Ecnt_1 is generated and the encoded data 2 is generated. , The second counting error signal Ecnt_2 is generated. If this end data is included in the encoded data 3, the count value Scnt does not exceed 63, so
No counting error signal is generated.
【0102】図13の例では、第1の選択エラー信号E
sel_1、第2の選択エラー信号Ssel_2、検索
エラー信号Esr_1および検索エラー信号Esr_2
は何れも出力されていないので、これによる無効信号は
生成されない。復号化データRS1に単位ブロックの末
尾を示す符号EOBが含まれる場合や、計数部90’に
おいて第1の計数エラー信号Ecnt_1が出力される
場合に、第1の無効信号Siv_1が生成される。ま
た、復号化データRS2_1に単位ブロックの末尾を示
す符号EOBが含まれる場合や、計数部90’において
第2の計数エラー信号Ecnt_2が出力される場合
に、第2の無効信号Siv_2が生成される。In the example of FIG. 13, the first selection error signal E
sel_1, second selection error signal Ssel_2, search error signal Esr_1 and search error signal Esr_2
Is not output, no invalid signal is generated. The first invalid signal Siv_1 is generated when the decoded data RS1 includes the code EOB indicating the end of the unit block or when the counting unit 90 ′ outputs the first counting error signal Ecnt_1. The second invalid signal Siv_2 is generated when the decoded data RS2_1 includes the code EOB indicating the end of the unit block or when the counting unit 90 ′ outputs the second counting error signal Ecnt_2. .
【0103】図14は、符号化データ3のハフマン符号
長が5ビットを越えるために検索エラー信号Esrが出
力される例を示す。図14において、抽出データ列Ds
の先頭ビット‘0’からビット‘4’までの5ビット分
が1つ目の符号化データ1、ビット‘5’からビット
‘8’までの4ビット分が2つ目の符号化データ2、ビ
ット‘9’からビット‘20’までの12ビットが3つ
目の符号化データとなっている。また符号化データ1の
前半2ビットはハフマン符号、後半3ビットは付加ビッ
トとなっている。符号化データ2の前半2ビットはハフ
マン符号、後半2ビットは付加ビットとなっている。符
号化データ3の前半6ビットはハフマン符号、後半6ビ
ットは付加ビットとなっている。FIG. 14 shows an example in which the search error signal Esr is output because the Huffman code length of the encoded data 3 exceeds 5 bits. In FIG. 14, the extracted data string Ds
5 bits from the first bit "0" to bit "4" of the first encoded data 1 and 4 bits from bit "5" to bit "8" of the second encoded data 2 Twelve bits from bit "9" to bit "20" are the third encoded data. The first 2 bits of the encoded data 1 are Huffman codes, and the latter 3 bits are additional bits. The first two bits of the encoded data 2 are Huffman codes and the second two bits are additional bits. The first 6 bits of the encoded data 3 are Huffman codes, and the latter 6 bits are additional bits.
【0104】図14の例では、符号化データ1のデータ
長L1が5ビットなので、選択部51において第2の復
号部43が選択される。また、符号化データ1と符号化
データ2のデータ長の和は9ビットであるので、選択部
52において第2の復号部47が選択される。この第2
の復号部47に入力される符号化データ3のハフマン符
号長は、図14に示すように6ビットであるため、第2
の復号部47ではこのハフマン符号を検索することがで
きず、第2の復号部47から検索エラー信号Esr7が
出力される。この検索エラー信号が選択部52において
選択されるため、選択部52からは検索エラー信号Es
r_2が出力され、第2の無効信号Siv_2が生成さ
れる。In the example of FIG. 14, since the data length L1 of the encoded data 1 is 5 bits, the selection unit 51 selects the second decoding unit 43. Since the sum of the data lengths of the encoded data 1 and the encoded data 2 is 9 bits, the selection unit 52 selects the second decoding unit 47. This second
Since the Huffman code length of the encoded data 3 input to the decoding unit 47 of 6 is 6 bits as shown in FIG.
The Huffman code cannot be searched for in the decoding unit 47, and the search error signal Esr7 is output from the second decoding unit 47. Since this search error signal is selected by the selection unit 52, the search error signal Es is output from the selection unit 52.
r_2 is output and the second invalid signal Siv_2 is generated.
【0105】したがって、図14の例では、データ抽出
位置シフト部80’においてデータ長L3が無効にさ
れ、データ抽出位置はデータ長L1とデータ長L2との
和に応じてシフトされる。すなわち、次の3つの符号化
データを復号化する先頭ビットは抽出データ列Dsのビ
ット‘9’に設定される。また、第2の無効信号Siv
_2が生成されるため、DCT係数出力部103から出
力されるDCT係数D3は、逆量子化器1003および
逆DCT器1004において無効なデータとして処理さ
れる。さらに、復号化データRS2_2のゼロランレン
グスRRRRに対応する復号化数は計数部90’におい
て無効とされ、この分の復号化数は計数値Scntに加
算されない。Therefore, in the example of FIG. 14, the data extraction position shift unit 80 'invalidates the data length L3, and the data extraction position is shifted according to the sum of the data length L1 and the data length L2. That is, the first bit for decoding the next three pieces of encoded data is set to bit '9' of the extracted data string Ds. In addition, the second invalid signal Siv
Since _2 is generated, the DCT coefficient D3 output from the DCT coefficient output unit 103 is processed as invalid data in the inverse quantizer 1003 and the inverse DCT unit 1004. Further, the decoding number corresponding to the zero run length RRRR of the decoding data RS2_2 is invalidated in the counting unit 90 ′, and the decoding number for this is not added to the count value Scnt.
【0106】図15は、符号化データ1のデータ長と符
号化データ2のデータ長との和が6ビット〜12ビット
の範囲に含まれないために、第2の選択エラー信号Es
el_2が出力される例を示す。図15において、抽出
データ列Dsの先頭ビット‘0’からビット‘5’まで
の6ビット分が1つ目の符号化データ1、ビット‘6’
からビット‘15’までの10ビット分が2つ目の符号
化データ2、ビット‘16’からビット‘20’までの
5ビット分が3つ目の符号化データ3となっている。ま
た符号化データ1の前半3ビットはハフマン符号、後半
3ビットは付加ビットとなっている。符号化データ2の
前半5ビットはハフマン符号、後半5ビットは付加ビッ
トとなっている。符号化データ3の前半2ビットはハフ
マン符号、後半3ビットは付加ビットとなっている。In FIG. 15, since the sum of the data length of the encoded data 1 and the data length of the encoded data 2 is not included in the range of 6 bits to 12 bits, the second selection error signal Es
An example in which el_2 is output is shown. In FIG. 15, 6 bits from the first bit “0” to the bit “5” of the extracted data string Ds is the first encoded data 1, bit “6”.
To bit '15' are the second coded data 2, and 5 bits from bit '16' to bit '20' are the third coded data 3. The first 3 bits of the encoded data 1 are Huffman codes, and the latter 3 bits are additional bits. The first 5 bits of the encoded data 2 are Huffman codes, and the latter 5 bits are additional bits. The first 2 bits of the encoded data 3 are Huffman codes, and the latter 3 bits are additional bits.
【0107】図15の例では、符号化データ1のデータ
長L1が6ビットであるので、選択部51においては第
2の復号部44が選択される。一方、符号化データ1の
データ長L1と符号化データ長L2との和は16ビット
であり、6ビット〜12ビットの範囲を越えているの
で、選択部52においては第2の復号部を選択すること
ができず、第2の選択エラー信号Esel_2が出力さ
れる。これにより、無効信号生成部72において第2の
無効信号Siv_2が生成される。In the example of FIG. 15, since the data length L1 of the encoded data 1 is 6 bits, the selection unit 51 selects the second decoding unit 44. On the other hand, since the sum of the data length L1 of the encoded data 1 and the encoded data length L2 is 16 bits, which exceeds the range of 6 bits to 12 bits, the selection unit 52 selects the second decoding unit. However, the second selection error signal Esel_2 is output. As a result, the invalid signal generator 72 generates the second invalid signal Siv_2.
【0108】したがって、図15の例においても図14
と同様に、データ抽出位置シフト部80’においてデー
タ長L3が無効にされ、データ抽出位置はデータ長L1
とデータ長L2との和に応じてシフトされる。この例に
おいて、次に抽出される符号化データの先頭ビットは、
抽出データ列Dsのビット‘16’に設定される。ま
た、第2の無効信号Siv_2が生成されるため、DC
T係数出力部103から出力されるDCT係数D3は、
逆量子化器1003および逆DCT器1004において
無効なデータとして処理される。さらに、復号化データ
RS2_2のゼロランレングスRRRRに対応する復号
化数は計数部90’において無効とされ、この分の復号
化数は計数値Scntに加算されない。Therefore, even in the example of FIG.
Similarly, the data length L3 is invalidated in the data extraction position shift unit 80 ′, and the data extraction position is set to the data length L1.
And the data length L2. In this example, the first bit of the encoded data extracted next is
It is set to bit '16' of the extracted data string Ds. In addition, since the second invalid signal Siv_2 is generated, DC
The DCT coefficient D3 output from the T coefficient output unit 103 is
Inverse quantizer 1003 and inverse DCT device 1004 process as invalid data. Further, the decoding number corresponding to the zero run length RRRR of the decoding data RS2_2 is invalidated in the counting unit 90 ′, and the decoding number for this is not added to the count value Scnt.
【0109】図16は、符号化データ1のデータ長が3
ビット〜6ビットの範囲に含まれないために、第1の選
択エラー信号Esel_1が出力される例を示す。図1
6において、抽出データ列Dsの先頭ビット‘0’から
ビット‘6’までの7ビット分が1つ目の符号化データ
1、ビット‘7’からビット‘11’までの5ビット分
が2つ目の符号化データ2、ビット‘12’からビット
‘21’までの10ビット分が3つ目の符号化データ3
となっている。また符号化データ1の前半4ビットはハ
フマン符号、後半3ビットは付加ビットとなっている。
符号化データ2の前半2ビットはハフマン符号、後半3
ビットは付加ビットとなっている。符号化データ3の前
半5ビットはハフマン符号、後半5ビットは付加ビット
となっている。In FIG. 16, the data length of the encoded data 1 is 3
An example in which the first selection error signal Esel_1 is output because it is not included in the range of bits to 6 bits is shown. Figure 1
In FIG. 6, 7 bits from the first bit “0” to bit “6” of the extracted data string Ds is the first encoded data 1, and 5 bits from bit “7” to bit “11” are two. 10th bit of coded data 2 from bit '12' to bit '21' is the third coded data 3
Has become. The first half 4 bits of the encoded data 1 are Huffman codes, and the latter half 3 bits are additional bits.
The first two bits of encoded data 2 are Huffman codes, the second half 3
Bits are additional bits. The first half 5 bits of the encoded data 3 are Huffman codes, and the latter half 5 bits are additional bits.
【0110】図16の例では、符号化データ1のデータ
長L1が7ビットであり、3ビット〜6ビットの範囲を
越えているので、選択部51においては第2の復号部を
選択することができず、第1の選択エラー信号Esel
_1が出力される。これにより、無効信号生成部71に
おいて第1の無効信号Siv_1が生成される。In the example of FIG. 16, since the data length L1 of the encoded data 1 is 7 bits, which exceeds the range of 3 bits to 6 bits, the selecting unit 51 should select the second decoding unit. The first selection error signal Esel
_1 is output. As a result, the invalid signal generation unit 71 generates the first invalid signal Siv_1.
【0111】第1の無効信号Siv_1が生成される
と、第2の無効信号Sivが出力されているか否かに関
わらず、復号化データRS2_1および復号化データR
S2_2が何れも無効になる。したがって、図16の例
では、データ抽出位置シフト部80’においてデータ長
L2およびデータ長L3が共に無効にされ、データ抽出
位置はデータ長L1のみに応じてシフトされる。この例
において、次に抽出される符号化データの先頭ビット
は、抽出データ列Dsのビット‘7’に設定される。ま
た、第1の無効信号Siv_1が生成されるため、DC
T係数出力部102から出力されるDCT係数D2およ
びDCT係数出力部103から出力されるDCT係数D
3は、逆量子化器1003および逆DCT器1004に
おいて何れも無効なデータとして処理される。さらに、
復号化データRS2_1および復号化データRS2_2
のゼロランレングスRRRRに対応する復号化数は、計
数部90’において何れも無効とされ、この分の復号化
数は計数値Scntに加算されない。When the first invalid signal Siv_1 is generated, the decoded data RS2_1 and the decoded data R are generated regardless of whether or not the second invalid signal Siv is output.
Both S2_2 are invalid. Therefore, in the example of FIG. 16, the data length L2 and the data length L3 are both invalidated in the data extraction position shift unit 80 ', and the data extraction position is shifted according to only the data length L1. In this example, the leading bit of the encoded data to be extracted next is set to bit '7' of the extracted data string Ds. In addition, since the first invalid signal Siv_1 is generated, DC
DCT coefficient D2 output from T coefficient output section 102 and DCT coefficient D output from DCT coefficient output section 103
3 is processed as invalid data in the inverse quantizer 1003 and the inverse DCT device 1004. further,
Decoded data RS2_1 and decrypted data RS2_2
Any of the decoding numbers corresponding to the zero run length RRRR of is invalidated in the counting unit 90 ′, and the decoding number of this is not added to the count value Scnt.
【0112】ところで、図10のハフマン復号化器にお
いて3つの符号化データが同時に復号化できるのは、1
つ目の符号化データのデータ長が3ビット〜6ビットと
なり、2つ目の符号化データのデータ長も3〜6ビット
となり、かつ、3つ目の符号化データのハフマン符号長
が5ビット以内の場合である。図8および図9の例を参
照して、それぞれのハフマン符号が出現する頻度を掛け
合わせると、3つの符号化データを同時に復号化できる
頻度は、
70%×70%×85%=約42%
となる。また、図10のハフマン復号化器において1つ
の符号化データしか復号化できないのは、1つ目の符号
化データのデータ長が3ビット〜6ビットの範囲に含ま
れない場合であり、その頻度は約30%である。したが
って、図10のハフマン復号化器において同時に復号化
できる符号化データの平均数は、
1×30%+2×(100%−42%−30%)+3×
42%=約2.1個
となる。このように、図10のハフマン符号器では、図
17に示す従来例と同等以上の速さでハフマン符号化さ
れたデータストリームを復号化できる。また、図17に
示す従来例と比較して、必要なハフマン復号化用データ
テーブルの記憶容量を小さくすることができるので、回
路構成を簡略化できる。By the way, in the Huffman decoder of FIG. 10, three encoded data can be simultaneously decoded by 1
The data length of the third encoded data is 3 to 6 bits, the data length of the second encoded data is 3 to 6 bits, and the Huffman code length of the third encoded data is 5 bits. Within the case. By multiplying the frequencies of appearance of the respective Huffman codes with reference to the examples of FIGS. 8 and 9, the frequency with which three pieces of encoded data can be simultaneously decoded is 70% × 70% × 85% = about 42% Becomes Further, the Huffman decoder of FIG. 10 can only decode one piece of encoded data when the data length of the first encoded data is not included in the range of 3 bits to 6 bits, and its frequency Is about 30%. Therefore, the average number of coded data that can be simultaneously decoded by the Huffman decoder of FIG. 10 is 1 × 30% + 2 × (100% −42% −30%) + 3 ×
42% = about 2.1 pieces. Thus, the Huffman encoder of FIG. 10 can decode the Huffman-encoded data stream at a speed equal to or higher than that of the conventional example shown in FIG. Further, as compared with the conventional example shown in FIG. 17, the required storage capacity of the Huffman decoding data table can be reduced, so that the circuit configuration can be simplified.
【0113】なお、本発明は上述した実施形態に限定さ
れず、当業者に自明な種々の改変が可能である。例え
ば、本発明の実施形態を説明するための例としてJPE
G復号化装置を示しているが、本発明はこの例に限定さ
れない。同様な他の方式で符号化されたデータストリー
ムのデータ復号化装置にも、本発明は適用可能である。The present invention is not limited to the above-described embodiments, and various modifications obvious to those skilled in the art can be made. For example, JPE is used as an example for explaining the embodiment of the present invention.
Although a G decoding device is shown, the invention is not limited to this example. The present invention is also applicable to a data decoding device for a data stream encoded by another similar method.
【0114】本発明の実施形態を説明するための例にお
いて処理されるデータのデータ長やビット位置、第2の
復号部などのブロックの数は、本発明を何ら限定するも
のではなく、何れも任意に改変可能である。The data length and bit position of the data to be processed and the number of blocks such as the second decoding unit in the examples for explaining the embodiments of the present invention do not limit the present invention at all. It can be modified arbitrarily.
【0115】図10の例では、選択部51において4つ
の復号部(第2の復号部41〜第2の復号部44)から
1つを選択させているが、この選択する復号部を更に増
やすこともできる。例えば、10個全ての復号部(第2
の復号部41〜第2の復号部410)から1つを選択さ
せても良い。これにより、2つ目の符号化データを復号
化できる確率が高くなるので、復号化の効率を更に高め
ることができる。In the example of FIG. 10, the selecting unit 51 selects one from the four decoding units (second decoding unit 41 to second decoding unit 44), but the number of decoding units to be selected is further increased. You can also For example, all 10 decoding units (second
One of the decoding units 41 to 410) may be selected. This increases the probability that the second coded data can be decoded, and thus the decoding efficiency can be further improved.
【0116】上述した第2の実施形態においては3つの
符号化データを同時に復号化可能なハフマン復号化器の
例が示されているが、本発明によれば、4つ以上の符号
化データを同時に復号化できるデータ復号化装置も実現
可能である。The second embodiment described above shows an example of a Huffman decoder capable of simultaneously decoding three pieces of coded data. However, according to the present invention, four or more pieces of coded data are decoded. A data decoding device capable of decoding at the same time can also be realized.
【0117】[0117]
【発明の効果】本発明によれば、可変長符号化されたデ
ータストリームを、簡易な構成で高速に復号化できる。According to the present invention, a variable length coded data stream can be decoded at high speed with a simple structure.
【図1】本発明に係るJPEG復号化装置の概略的な構
成例を示すブロック図である。FIG. 1 is a block diagram showing a schematic configuration example of a JPEG decoding device according to the present invention.
【図2】本発明の第1の実施形態に係る、図1のハフマ
ン復号化器の構成例を示す概略的なブロック図である。FIG. 2 is a schematic block diagram showing a configuration example of the Huffman decoder of FIG. 1 according to the first embodiment of the present invention.
【図3】図2に示すハフマン復号化器におけるDCT係
数出力部の構成例を示す概略的なブロック図である。3 is a schematic block diagram showing a configuration example of a DCT coefficient output unit in the Huffman decoder shown in FIG.
【図4】データ抽出部で抽出される27ビットのデータ
列中において、図2の各復号部が復号化できる符号化デ
ータの範囲を示す図である。FIG. 4 is a diagram showing a range of encoded data that can be decoded by each decoding unit in FIG. 2 in a 27-bit data string extracted by a data extraction unit.
【図5】データ抽出部において抽出されるデータ列に含
まれた2つの符号化データの一例を示す図である。FIG. 5 is a diagram showing an example of two pieces of encoded data included in a data string extracted by a data extraction unit.
【図6】2つ目の符号化データのハフマン符号長が5ビ
ットを越えるために検索エラー信号が出力される例を示
す。FIG. 6 shows an example in which a search error signal is output because the Huffman code length of the second encoded data exceeds 5 bits.
【図7】1つ目の符号化データのデータ長が3ビット〜
6ビットの範囲に含まれないために選択エラー信号が出
力される例を示す。FIG. 7 is a data length of the first encoded data is 3 bits to
An example in which the selection error signal is output because it is not included in the 6-bit range is shown.
【図8】一般的な20枚の画像をJPEG符号化した場
合において、ハフマン符号のデータ長ごとの出現数を調
べた結果の一例を示す図である。FIG. 8 is a diagram showing an example of a result of examining the number of appearances of each Huffman code for each data length when 20 general images are JPEG encoded.
【図9】一般的な20枚の画像をJPEG符号化した場
合において、ハフマン符号と付加ビットとの和のデータ
長について、図8と同様に出現数を調べた結果の一例を
示す図である。FIG. 9 is a diagram showing an example of the result of examining the number of appearances in the same manner as in FIG. 8 for the data length of the sum of the Huffman code and additional bits when JPEG encoding 20 general images. .
【図10】本発明の第2の実施形態に係る、図1のハフ
マン復号化器の構成例を示す概略的なブロック図であ
る。FIG. 10 is a schematic block diagram showing a configuration example of the Huffman decoder of FIG. 1 according to the second embodiment of the present invention.
【図11】図10に示すハフマン復号化器におけるDC
T係数出力部の構成例を示す概略的なブロック図であ
る。11 is a DC in the Huffman decoder shown in FIG.
It is a schematic block diagram which shows the structural example of a T coefficient output part.
【図12】データ抽出部10で抽出される27ビットの
データ列中において、図10の各復号部が復号化可能な
符号化データの範囲を示す図である。12 is a diagram showing a range of coded data that can be decoded by each decoding unit in FIG. 10 in a 27-bit data string extracted by the data extraction unit.
【図13】データ抽出部において抽出されたデータ列に
含まれる3つの符号化データの一例を示す図である。FIG. 13 is a diagram showing an example of three pieces of encoded data included in a data string extracted by a data extraction unit.
【図14】符号化データ3のハフマン符号長が5ビット
を越えるために検索エラー信号が出力される例を示す。FIG. 14 shows an example in which a search error signal is output because the Huffman code length of encoded data 3 exceeds 5 bits.
【図15】1つ目の符号化データのデータ長と2つ目の
符号化データのデータ長との和が6ビット〜12ビット
の範囲に含まれないために、第2の選択エラー信号が出
力される例を示す。FIG. 15 shows that the sum of the data length of the first encoded data and the data length of the second encoded data is not included in the range of 6 bits to 12 bits, so that the second selection error signal is An example of output is shown below.
【図16】1つ目の符号化データのデータ長が3ビット
〜6ビットの範囲に含まれないために、第1の選択エラ
ー信号が出力される例を示す。FIG. 16 shows an example in which the first selection error signal is output because the data length of the first encoded data is not included in the range of 3 bits to 6 bits.
【図17】ハフマン符号によって符号化されたデータス
トリームを復号化する従来のデータ復号化装置の構成例
を示すブロック図である。FIG. 17 is a block diagram showing a configuration example of a conventional data decoding device that decodes a data stream encoded by a Huffman code.
1…データシフト部、2a〜2r…復号部、3…セレク
タ、10…データ抽出部、20…第1の復号部、30…
第1のデータ長算出部、41〜49,410…第2の復
号部、50,51,52…選択部、60,61,62…
第2のデータ長算出部、70,71,72…無効信号生
成部、80,80’…データ抽出位置シフト部、90,
90’…計数部、101〜103…DCT係数出力部、
1011,1021,1031…付加データ抽出部、1
012,1022,1032…DCT係数算出部、10
01…バッファ、1002…ハフマン復号化器、100
3…逆量子化器、1004…逆DCT器。DESCRIPTION OF SYMBOLS 1 ... Data shift part, 2a-2r ... Decoding part, 3 ... Selector, 10 ... Data extraction part, 20 ... 1st decoding part, 30 ...
1st data length calculation part, 41-49,410 ... 2nd decoding part, 50, 51, 52 ... Selection part, 60, 61, 62 ...
Second data length calculation unit, 70, 71, 72 ... Invalid signal generation unit, 80, 80 '... Data extraction position shift unit, 90,
90 '... Counting unit, 101-103 ... DCT coefficient output unit,
1011, 1021, 1031 ... Additional data extraction unit, 1
012, 1022, 1032 ... DCT coefficient calculation unit, 10
01 ... buffer, 1002 ... Huffman decoder, 100
3 ... Inverse quantizer, 1004 ... Inverse DCT device.
───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5C059 KK09 KK11 MA00 MA23 MC11 MC24 MC33 MC34 MC38 ME02 ME08 PP01 RC40 TA58 TB08 TC00 UA05 UA32 5C078 AA04 BA57 CA31 DA02 DA06 5J064 AA03 AA04 BA09 BA16 BB05 BC01 BC16 BC25 BC28 ─────────────────────────────────────────────────── ─── Continued front page F term (reference) 5C059 KK09 KK11 MA00 MA23 MC11 MC24 MC33 MC34 MC38 ME02 ME08 PP01 RC40 TA58 TB08 TC00 UA05 UA32 5C078 AA04 BA57 CA31 DA02 DA06 5J064 AA03 AA04 BA09 BA16 BB05 BC01 BC16 BC25 BC28
Claims (16)
号化するデータ復号化装置であって、 上記符号化データストリームの先頭から所定データ長の
データ列を抽出するデータ抽出手段と、 上記データ抽出手段において抽出されたデータ列の先頭
から、所定の可変長符号テーブルに含まれる可変長符号
を検索し、当該検索した可変長符号に対応する復号化デ
ータを出力する第1の復号手段と、 上記第1の復号手段の復号化データと、当該復号化デー
タに対応する上記可変長符号のデータ長とに基づいて、
当該復号化データに対応する符号化データのデータ長を
算出し、第1のデータ長として出力する第1のデータ長
算出手段と、 上記データ抽出手段において抽出されたデータ列の先頭
に対して複数の異なるデータ数だけ末尾側にずれたデー
タ位置から、上記可変長符号テーブルの一部の可変長符
号をそれぞれ検索し、当該検索した可変長符号に対応す
る復号化データを出力し、当該検索において該当する可
変長符号が見つからない場合には検索エラー信号を出力
する複数の第2の復号手段と、 上記複数の第2の復号化手段の中から、上記第1のデー
タ長に応じて選択した第2復号手段の復号化データまた
は上記検索エラー信号を出力し、該当する第2の復号手
段が無い場合には選択エラー信号を出力する選択手段
と、 上記選択手段において選択された第2の復号手段の復号
化データと、当該復号化データに対応する上記可変長符
号のデータ長とに基づいて、当該復号化データに対応す
る符号化データのデータ長を算出し、第2のデータ長と
して出力する第2のデータ長算出手段と、 上記選択手段において選択された第2の復号手段から上
記検索エラー信号が出力される場合、または上記選択手
段から上記選択エラー信号が出力される場合に、上記第
2の復号手段の復号化データが無効であることを知らせ
る無効信号を生成する無効信号生成手段と、 上記第1のデータ長と上記第2のデータ長との和に応じ
たデータ数だけ、上記データ抽出手段のデータ列抽出位
置を上記符号化データストリームの末尾側にシフトさ
せ、上記無効信号が生成される場合には、上記第1のデ
ータ長に応じたデータ数だけ上記抽出位置を上記末尾側
へシフトさせるデータ抽出位置シフト手段と を有するデータ復号化装置。1. A data decoding device for decoding a supplied encoded data stream, comprising: data extracting means for extracting a data string of a predetermined data length from the beginning of the encoded data stream; and the data extracting means. First decoding means for searching a variable-length code included in a predetermined variable-length code table from the head of the data string extracted in, and outputting decoded data corresponding to the searched variable-length code; Based on the decoded data of the first decoding means and the data length of the variable length code corresponding to the decoded data,
A first data length calculating means for calculating the data length of the encoded data corresponding to the decoded data and outputting it as the first data length, and a plurality of data lengths for the head of the data string extracted by the data extracting means. From the data position deviated to the end side by the different number of data, each of the variable-length codes in the variable-length code table is searched, decoded data corresponding to the searched variable-length code is output, and in the search, When a corresponding variable length code is not found, a plurality of second decoding means for outputting a search error signal and a plurality of second decoding means are selected according to the first data length. Selecting means for outputting the decoded data of the second decoding means or the search error signal, and for outputting the selection error signal when there is no corresponding second decoding means, and the selecting means. Calculating the data length of the encoded data corresponding to the decoded data based on the decoded data of the second decoding means and the data length of the variable length code corresponding to the decoded data, When the search error signal is output from the second data length calculating unit that outputs the second data length and the second decoding unit selected by the selecting unit, or the selection error signal is output from the selecting unit. In this case, an invalid signal generating means for generating an invalid signal notifying that the decoded data of the second decoding means is invalid, and a sum of the first data length and the second data length. When the invalid signal is generated by shifting the data string extraction position of the data extraction means to the end side of the encoded data stream by the corresponding number of data, depending on the first data length. And a data extraction position shift means for shifting the extraction position to the end side by the number of data.
変長符号と付加データとで構成された符号化データを含
み、 上記第1の復号手段の復号化データに含まれた上記付加
データのデータ長の情報に基づいて、上記データ抽出手
段の抽出データ列から上記付加データを更に抽出する第
1の付加データ抽出手段と、 上記選択手段から出力される復号化データに含まれた上
記付加データのデータ長の情報に基づいて、上記データ
抽出手段の抽出データ列から上記付加データを更に抽出
する第2の付加データ抽出手段とを有する、 請求項1に記載のデータ復号化装置。2. The encoded data stream includes encoded data composed of the variable length code and additional data, and the data length of the additional data included in the decoded data of the first decoding means. First additional data extracting means for further extracting the additional data from the extracted data string of the data extracting means based on the information of 1., and the data of the additional data included in the decoded data output from the selecting means. The data decoding device according to claim 1, further comprising a second additional data extraction unit that further extracts the additional data from the extracted data string of the data extraction unit based on the length information.
のデータが連続する数と、当該所定値のデータに続く他
の値のデータとに応じて、所望のデータストリームを所
定データ数の単位ブロックごとに符号化して生成された
データストリームを含み、 上記第1の復号手段の復号化データと上記選択手段に選
択された第2の復号手段の復号化データとに含まれる上
記連続数の情報に応じて、上記単位ブロック内で復号化
されたデータの数を計数し、上記無効信号が生成される
場合に、上記選択された第2の復号手段の復号化データ
に含まれる上記連続数の情報を無効にして上記計数を行
ない、当該計数値が上記所定データ数に達した場合に
は、当該計数値を初期化する計数手段を有する、 請求項1に記載のデータ復号化装置。3. The encoded data stream is a unit block of a predetermined number of data of a desired data stream according to the number of consecutive data of a predetermined value and data of another value following the data of the predetermined value. The data of the continuous number included in the decoded data of the first decoding means and the decoded data of the second decoding means selected by the selecting means. Accordingly, the number of the decoded data in the unit block is counted, and when the invalid signal is generated, the information of the continuous number included in the decoded data of the selected second decoding means. The data decoding apparatus according to claim 1, further comprising: a counting unit that invalidates the number, performs the counting, and initializes the count value when the count value reaches the predetermined number of data.
タ数より大きくなる場合に計数エラー信号を出力し、 上記無効信号生成手段は、上記第1の復号手段の復号化
データに上記単位ブロックの末尾を示す所定の情報が含
まれる場合、または上記計数手段において計数エラー信
号が出力される場合に上記無効信号を生成する、 請求項3に記載のデータ復号化装置。4. The counting means outputs a counting error signal when the count value is larger than the predetermined number of data, and the invalid signal generating means adds the unit block to the decoded data of the first decoding means. 4. The data decoding device according to claim 3, wherein the invalid signal is generated when predetermined information indicating the end of is included, or when the counting means outputs a counting error signal.
も一部から、上記第1のデータ長ないし第nのデータ長
(符号nは、所定の自然数Nに対して1≦n≦Nを満た
す任意の自然数を示す)の総和に応じて選択した第2の
復号手段の復号化データおよび上記検索エラー信号を出
力し、該当する第2の復号手段が無い場合には第nの選
択エラー信号を出力する複数の選択手段と、 上記選択手段において上記第1のデータ長ないし第nの
データ長の総和に応じて選択された第2の復号部の復号
化データと、当該復号化データに対応する上記可変長符
号のデータ長とに基づいて、当該復号化データに対応す
る符号化データのデータ長を算出し、第(n+1)のデ
ータ長として出力する複数の第2のデータ長算出手段
と、 上記選択手段において上記第1のデータ長ないし第nの
データ長の総和に応じて選択された第2の復号手段から
上記検索エラー信号が出力される場合、または上記選択
手段から上記第nの選択エラー信号が出力される場合
に、上記第1のデータ長ないし第mのデータ長(符号m
は、所定の自然数Nに対してn≦m≦Nを満たす任意の
自然数を示す)の総和に応じて選択された第2の復号手
段の復号化データが全て無効であることを知らせる第n
の無効信号を生成する複数の無効信号生成手段とを有
し、 上記データ抽出位置シフト手段は、上記第1のデータ長
ないし第Nのデータ長の総和に応じたデータ数だけ、上
記データ抽出手段のデータ列抽出位置を上記符号化デー
タストリームの末尾側にシフトさせ、上記第nの無効信
号が生成される場合には、上記第1のデータ長ないし第
nのデータ長の総和に応じたデータ数だけ上記抽出位置
を上記末尾側へシフトさせる、 請求項1に記載のデータ復号化装置。5. The first data length to the nth data length (the code n is 1 ≦ n ≦ N with respect to a predetermined natural number N) from at least a part of the plurality of second decoding means. The decoded data of the second decoding means and the search error signal selected according to the total sum of (which represents an arbitrary natural number to be satisfied) are output, and the nth selection error signal is output when there is no corresponding second decoding means. Corresponding to a plurality of selection means for outputting the decoded data of the second decoding unit selected according to the sum of the first data length to the n-th data length in the selection means, and the decoded data. A plurality of second data length calculating means for calculating the data length of the encoded data corresponding to the decoded data based on the data length of the variable length code, and outputting the data length as the (n + 1) th data length. , In the selecting means When the search error signal is output from the second decoding means selected according to the sum of the first data length to the nth data length, or the nth selection error signal is output from the selection means. In this case, the first data length to the m-th data length (code m
Is an arbitrary natural number satisfying n ≦ m ≦ N with respect to a predetermined natural number N). The n-th signal notifying that all the decoded data of the second decoding means selected according to the total sum are invalid.
A plurality of invalid signal generation means for generating the invalid signal, and the data extraction position shift means is the data extraction means for the number of data corresponding to the sum of the first data length to the Nth data length. When the n-th invalid signal is generated by shifting the data string extraction position of the above to the end side of the encoded data stream, the data corresponding to the sum of the first data length to the n-th data length. The data decoding device according to claim 1, wherein the extraction position is shifted to the end side by a number.
変長符号と付加データとで構成された符号化データを含
み、 上記第1の復号手段の復号化データに含まれた上記付加
データのデータ長の情報に基づいて、上記データ抽出手
段の抽出データ列から上記付加データを更に抽出する第
1の付加データ抽出手段と、 上記複数の選択手段において選択された第2の復号手段
の復号化データに含まれる上記付加データのデータ長の
情報に基づいて、上記データ抽出手段の抽出データ列か
ら上記付加データを更に抽出する複数の第2の付加デー
タ抽出手段とを有する、 請求項5に記載のデータ復号化装置。6. The encoded data stream includes encoded data composed of the variable length code and additional data, and the data length of the additional data included in the decoded data of the first decoding means. The first additional data extracting means for further extracting the additional data from the extracted data string of the data extracting means, and the decoded data of the second decoding means selected by the plurality of selecting means based on the information of The data according to claim 5, further comprising a plurality of second additional data extracting means for further extracting the additional data from the extracted data string of the data extracting means based on the information of the data length of the additional data included. Decoding device.
のデータが連続する数と、当該所定値のデータに続く他
の値のデータとに応じて、所望のデータストリームを所
定データ数の単位ブロックごとに符号化して生成された
データストリームを含み、 上記第1の復号手段の復号化データと上記複数の選択手
段において選択された第2の復号手段の復号化データと
に含まれる上記連続数の情報に応じて、上記単位ブロッ
ク内で復号化されたデータの数を計数し、上記第nの無
効信号が生成される場合は、上記第1のデータ長ないし
第mのデータ長の総和に応じて選択された第2の復号手
段の復号化データに含まれる上記連続数の情報を全て無
効にして上記計数を行ない、当該計数値が上記所定デー
タ数に達した場合には、当該計数値を初期化する計数手
段を有する、 請求項5に記載のデータ復号化装置。7. The encoded data stream is a unit block of a predetermined number of data of a desired data stream according to the number of consecutive data of a predetermined value and data of another value following the data of the predetermined value. Data stream generated by encoding for each of the above, the number of consecutive numbers included in the decoded data of the first decoding means and the decoded data of the second decoding means selected by the plurality of selecting means. According to the information, the number of decoded data in the unit block is counted, and when the nth invalid signal is generated, the number of the decoded data is determined according to the sum of the first data length to the mth data length. When the count value reaches the predetermined number of data, all the information of the continuous number contained in the decoded data of the selected second decoding means is invalidated, and when the count value reaches the predetermined number of data, the count value is changed. Initialize Having a counting means, a data decoding apparatus according to claim 5.
タ数より大きくなる場合に、上記第1のデータ長ないし
第mのデータ長の総和に応じて選択された第2の復号手
段の復号化データに含まれる上記連続数の情報を全て無
効にした計数値が上記所定データ数より大きくなる最小
の自然数nにおいて、第nの計数エラー信号を出力し、 上記無効信号生成手段は、上記第1の復号手段の復号化
データに上記単位ブロックの末尾を示す所定の情報が含
まれる場合に第1の無効信号を生成し、第1のデータ長
ないし第nのデータ長の総和に応じて選択された第2の
復号手段の復号化データに当該所定の情報が含まれる場
合に第(n+1)の無効信号を生成し、上記計数手段に
おいて第nの計数エラー信号が出力される場合に第nの
無効信号を生成する、請求項7に記載のデータ復号化装
置。8. The decoding means of the second decoding means selected according to the sum of the first data length to the m-th data length when the count value is larger than the predetermined data number. When the count value obtained by invalidating all the information of the continuous number included in the encoded data is larger than the predetermined number of data n, the n-th counting error signal is output, and the invalid signal generating means is A first invalid signal is generated when the decoded data of the first decoding means includes predetermined information indicating the end of the unit block, and selected according to the sum of the first data length to the nth data length. If the predetermined data is included in the decoded data of the second decoding means, the (n + 1) th invalid signal is generated, and if the counting means outputs the nth counting error signal, the nth counting error signal is output. Generates an invalid signal for The data decoding apparatus according to claim 7.
号化するデータ復号化方法であって、 上記符号化データストリームの先頭から所定データ長の
データ列を抽出するステップと、 上記抽出したデータ列の先頭から、所定の可変長符号テ
ーブルに含まれる可変長符号を検索し、当該検索した可
変長符号に対応する第1の復号化データを生成するステ
ップと、 上記生成された第1の復号化データと、当該第1の復号
化データに対応する上記可変長符号のデータ長とに基づ
いて、当該第1の復号化データに対応する符号化データ
のデータ長を第1のデータ長として算出するステップ
と、 上記データ抽出ステップにおいて抽出されたデータ列の
先頭に対して複数の異なるデータ数だけ末尾側にずれた
データ位置から、上記第1の可変長符号テーブルの一部
の可変長符号をそれぞれ検索し、当該検索した可変長符
号に対応する第2の復号化データを生成し、当該検索に
おいて該当する可変長符号が見つからない場合には検索
エラー信号を生成する第2の復号ステップと、 上記生成された複数の第2の復号化データまたは検索エ
ラー信号の中から、上記第1のデータ長に応じたデータ
位置における上記可変長符号の検索によって生成された
第2の復号化データまたは検索エラー信号を選択し、該
当する第2の復号化データまたは検索エラー信号が無い
場合には選択エラー信号を生成するステップと、 上記選択された第2の復号化データと、当該第2の復号
化データに対応する上記可変長符号のデータ長とに基づ
いて、当該第2の復号化データに対応する符号化データ
のデータ長を第2のデータ長として算出するステップ
と、 上記選択ステップにおいて上記検索エラー信号が選択さ
れる場合、または上記選択エラー信号が生成される場合
に、上記第2の復号化データが無効であることを知らせ
る無効信号を生成するステップと、 上記第1のデータ長と上記第2のデータ長との和に応じ
たデータ数だけ、上記データ抽出ステップのデータ列抽
出位置を上記符号化データストリームの末尾側にシフト
させ、上記無効信号が生成される場合には、上記第1の
データ長に応じたデータ数だけ上記抽出位置を上記末尾
側へシフトさせるステップとを有するデータ復号化方
法。9. A data decoding method for decoding a supplied encoded data stream, comprising: extracting a data string of a predetermined data length from the beginning of the encoded data stream; A step of searching a variable-length code included in a predetermined variable-length code table from the beginning and generating first decoded data corresponding to the searched variable-length code; and the generated first decoded data And a step of calculating the data length of the encoded data corresponding to the first decoded data as the first data length based on the data length of the variable length code corresponding to the first decoded data. And the first variable length code table from the data position shifted toward the end side by a plurality of different data numbers with respect to the head of the data string extracted in the data extraction step. Each part of the variable length code is searched, second decoded data corresponding to the searched variable length code is generated, and if a corresponding variable length code is not found in the search, a search error signal is generated. A second decoding step of generating, and a variable length code generated at a data position corresponding to the first data length from the plurality of generated second decoded data or search error signals are generated. Selecting the second decoded data or search error signal, and generating a selection error signal if there is no corresponding second decoded data or search error signal; and the selected second decoding Based on the data and the data length of the variable length code corresponding to the second decoded data, the data length of the encoded data corresponding to the second decoded data is set to the second data. A step of calculating the data length, and an invalid signal for notifying that the second decoded data is invalid when the search error signal is selected in the selection step or when the selection error signal is generated. And the data string extraction position of the data extraction step is shifted to the end side of the encoded data stream by the number of data corresponding to the sum of the first data length and the second data length. If the invalid signal is generated, a step of shifting the extraction position to the end side by the number of data corresponding to the first data length, the data decoding method.
可変長符号と付加データとで構成された符号化データを
含み、 上記第1の復号化データに含まれる上記付加データのデ
ータ長の情報に基づいて、上記データ抽出ステップの抽
出データ列から上記付加データを更に抽出するステップ
と、 上記選択された第2の復号化データに含まれる上記付加
データのデータ長の情報に基づいて、上記データ抽出ス
テップの抽出データ列から上記付加データを更に抽出す
るステップとを有する、 請求項9に記載のデータ復号化方法。10. The encoded data stream includes encoded data composed of the variable length code and additional data, and is based on data length information of the additional data included in the first decoded data. The step of further extracting the additional data from the extracted data string in the data extracting step, and the data extracting step based on the data length information of the additional data included in the selected second decoded data. 10. The data decoding method according to claim 9, further comprising the step of further extracting the additional data from the extracted data string.
値のデータが連続する数と、当該所定値のデータに続く
他の値のデータとに応じて、所望のデータストリームを
所定データ数の単位ブロックごとに符号化して生成され
たデータストリームを含み、 上記第1の復号化データと上記選択された第2の復号化
データとに含まれる上記連続数の情報に応じて、上記単
位ブロック内で復号化されたデータの数を計数し、上記
無効信号が生成される場合に、上記選択された第2の復
号化データに含まれる上記連続数の情報を無効にして上
記計数を行ない、当該計数値が上記所定データ数に達し
た場合には、当該計数値を初期化するステップを有す
る、 請求項9に記載のデータ復号化方法。11. The encoded data stream is a unit block of a predetermined number of data of a desired data stream according to the number of consecutive predetermined value data and data of another value following the predetermined value data. Decoding in the unit block according to the information of the continuous number included in the first decoded data and the selected second decoded data. The number of the converted data is counted, and when the invalid signal is generated, the information of the continuous number included in the selected second decoded data is invalidated to perform the counting, and the count value 10. The data decoding method according to claim 9, further comprising the step of initializing the count value when the predetermined number of data has been reached.
値が上記所定データ数より大きくなる場合に計数エラー
信号を生成し、 上記無効信号を生成するステップにおいて、上記第1の
復号化データに上記単位ブロックの末尾を示す所定の情
報が含まれる場合、または上記計数エラー信号が生成さ
れる場合に上記無効信号を生成する、 請求項11に記載のデータ復号化方法。12. In the counting step, a counting error signal is generated when the counted value is larger than the predetermined number of data, and in the step of generating the invalid signal, the unit block is added to the first decoded data. 12. The data decoding method according to claim 11, wherein the invalid signal is generated when predetermined information indicating the end of is included or when the counting error signal is generated.
ータまたは検索エラー信号の少なくとも一部から、上記
第1のデータ長ないし第nのデータ長の総和に応じたデ
ータ位置における可変長符号の検索によって生成された
第2の復号化データまたは検索エラー信号を選択し、該
当する第2の復号化データまたは検索エラー信号が無い
場合には第nの選択エラー信号を生成するステップと、 上記選択ステップにおいて上記第1のデータ長ないし第
nのデータ長の総和に応じて上記検索エラー信号が選択
される場合、上記第1のデータ長ないし第mのデータ長
(符号mは、所定の自然数Nに対してn≦m≦Nを満た
す任意の自然数を示す)の総和に応じて選択された第2
の復号化データが全て無効であることを知らせる第nの
無効信号を生成するステップと、 上記第1のデータ長ないし第nのデータ長の総和に応じ
て選択された第2の復号化データと、当該第2の復号化
データに対応する上記可変長符号のデータ長とに基づい
て、当該第2の復号化データに対応する符号化データの
データ長を第(n+1)のデータ長として算出するステ
ップとを、所定の自然数Nに対して1≦n≦Nを満たす
範囲で反復し、 上記データの抽出位置をシフトするステップにおいて、
上記第1のデータ長ないし第Nのデータ長の総和に応じ
たデータ数だけ、上記抽出位置を上記符号化データスト
リームの末尾側にシフトさせ、上記第nの無効信号が生
成される場合には、上記第1のデータ長ないし第nのデ
ータ長の総和に応じたデータ数だけ上記抽出位置を上記
末尾側へシフトさせる、 請求項9に記載のデータ復号化方法。13. A variable length code at a data position corresponding to the sum of the first data length to the nth data length from at least a part of the plurality of generated second decoded data or search error signals. Selecting the second decoded data or search error signal generated by the search, and generating the n-th selection error signal if there is no corresponding second decoded data or search error signal, When the search error signal is selected according to the sum of the first data length to the nth data length in the selection step, the first data length to the mth data length (symbol m is a predetermined natural number). The second selected according to the sum of N), which represents an arbitrary natural number that satisfies n ≦ m ≦ N
Generating an n-th invalid signal notifying that all of the decoded data are invalid, and second decoded data selected according to the sum of the first data length to the n-th data length. , The data length of the encoded data corresponding to the second decoded data is calculated as the (n + 1) th data length based on the data length of the variable length code corresponding to the second decoded data. In a range satisfying 1 ≦ n ≦ N for a predetermined natural number N, and shifting the extraction position of the data,
When the extraction position is shifted toward the end of the encoded data stream by the number of data corresponding to the sum of the first data length to the Nth data length, and the nth invalid signal is generated, 10. The data decoding method according to claim 9, wherein the extraction position is shifted to the end side by the number of data corresponding to the sum of the first data length to the nth data length.
可変長符号と付加データとで構成された符号化データを
含み、 上記第1の復号化データに含まれた上記付加データのデ
ータ長の情報に基づいて、上記データ抽出ステップの抽
出データ列から上記付加データを更に抽出するステップ
と、 上記選択された第2の復号化データに含まれる上記付加
データのデータ長の情報に基づいて、上記データ抽出ス
テップの抽出データ列から上記付加データを更に抽出す
るステップとを有する、 請求項13に記載のデータ復号化方法。14. The coded data stream includes coded data composed of the variable length code and additional data, and has information of data length of the additional data included in the first decoded data. Based on the step of further extracting the additional data from the extracted data string in the data extracting step, and the data extraction based on the information of the data length of the additional data included in the selected second decoded data. The data decoding method according to claim 13, further comprising: extracting the additional data from the extracted data string of the step.
値のデータが連続する数と、当該所定値のデータに続く
他の値のデータとに応じて、所望のデータストリームを
所定データ数の単位ブロックごとに符号化して生成され
たデータストリームを含み、 上記第1の復号化データと上記選択された複数の第2の
復号化データとに含まれる上記連続数の情報に応じて、
上記単位ブロック内で復号化されたデータの数を計数
し、上記第nの無効信号が生成される場合は、上記第1
のデータ長ないし第mのデータ長の総和に応じて選択さ
れた第2の復号化データに含まれる上記連続数の情報を
全て無効にして上記計数を行ない、当該計数値が上記所
定データ数に達した場合には、当該計数値を初期化する
ステップを有する、 請求項13に記載のデータ復号化方法。15. The encoded data stream is a unit block of a predetermined number of data of a desired data stream according to the number of consecutive data of a predetermined value and data of another value following the data of the predetermined value. Each of which includes a data stream generated by encoding for each of the first and second decoded data and the selected plurality of second decoded data.
When the number of decoded data in the unit block is counted and the nth invalid signal is generated, the first
Data length to the sum of the m-th data length, all the information of the continuous number contained in the second decoded data is invalidated and the counting is performed, and the count value becomes the predetermined data number. The data decoding method according to claim 13, further comprising the step of initializing the count value when the count is reached.
値が上記所定データ数より大きくなる場合において、上
記第1のデータ長ないし第mのデータ長の総和に応じて
選択された第2の復号化データに含まれる上記連続数の
情報を全て無効にした計数値が上記所定データ数より大
きくなる最小の自然数nにおいて、第nの計数エラー信
号を生成し、 上記無効信号を生成するステップにおいて、上記第1の
復号化データに上記単位ブロックの末尾を示す所定の情
報が含まれる場合に第1の無効信号を生成し、上記第1
のデータ長ないし第mのデータ長の総和に応じて選択さ
れた第2の復号化データに当該所定の情報が含まれる場
合に第(n+1)の無効信号を生成し、上記第nの計数
エラー信号が出力される場合に第nの無効信号を生成す
る、請求項15に記載のデータ復号化方法。16. The second decoded data selected according to the sum of the first data length to the m-th data length when the count value is larger than the predetermined data number in the counting step. In the step of generating the nth counting error signal and generating the invalid signal in the smallest natural number n in which the count value obtained by invalidating all the information of the continuous number included in is larger than the predetermined data number, When the first decoded data includes predetermined information indicating the end of the unit block, the first invalid signal is generated, and the first invalid signal is generated.
(N + 1) th invalid signal is generated when the predetermined information is included in the second decoded data selected in accordance with the sum of the data length of the first to the mth data length, and the nth counting error is generated. The data decoding method according to claim 15, wherein the nth invalid signal is generated when the signal is output.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001370406A JP2003174366A (en) | 2001-12-04 | 2001-12-04 | Data decoding apparatus and method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001370406A JP2003174366A (en) | 2001-12-04 | 2001-12-04 | Data decoding apparatus and method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2003174366A true JP2003174366A (en) | 2003-06-20 |
Family
ID=19179637
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2001370406A Pending JP2003174366A (en) | 2001-12-04 | 2001-12-04 | Data decoding apparatus and method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2003174366A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010130213A (en) * | 2008-11-26 | 2010-06-10 | Samsung Digital Imaging Co Ltd | Image coding device and image coding method |
| JP2014078994A (en) * | 2013-12-13 | 2014-05-01 | Dainippon Printing Co Ltd | Method and device for encoding/decoding numerical data string |
-
2001
- 2001-12-04 JP JP2001370406A patent/JP2003174366A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010130213A (en) * | 2008-11-26 | 2010-06-10 | Samsung Digital Imaging Co Ltd | Image coding device and image coding method |
| JP2014078994A (en) * | 2013-12-13 | 2014-05-01 | Dainippon Printing Co Ltd | Method and device for encoding/decoding numerical data string |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4286322B2 (en) | Transmission and reception of encoded video images | |
| JPH0818460A (en) | Huffman decoder | |
| EP0683568A1 (en) | Variable length code look-up table having separate code length determination | |
| CN102196265A (en) | Image encoding apparatus and method, image decoding apparatus and method, and program | |
| JP4098187B2 (en) | Variable length code decoding apparatus and method | |
| JP4181887B2 (en) | Variable length coding apparatus and method | |
| CN100546200C (en) | Method, decoder, system and apparatus for decoding variable length codewords from a bit stream | |
| JP2003174366A (en) | Data decoding apparatus and method | |
| JP3562661B2 (en) | Image signal encoding method and image signal decoding method | |
| JP2002026737A (en) | Data decoding apparatus and method | |
| JP2025145993A (en) | Decoding device and decoding method | |
| JP4763853B2 (en) | Variable length code decoding apparatus and method | |
| CN112449191A (en) | Method for compressing a plurality of images, method and apparatus for decompressing an image | |
| US20030191914A1 (en) | Bit plane coding apparatus | |
| JP4013680B2 (en) | Decoding device and decoding method | |
| JP3417684B2 (en) | Image processing device | |
| JP2002016501A (en) | Variable length decoding device | |
| JP2003174365A (en) | Decoding device and method | |
| JP2001007706A (en) | Variable length code decoding device | |
| JP3796354B2 (en) | Image coding method | |
| JP2934603B2 (en) | Method and apparatus for decoding variable length code | |
| JP2003333339A (en) | Image encoding apparatus and image encoding method | |
| KR100195715B1 (en) | Variable length decoder | |
| KR100195717B1 (en) | A variable length decoder | |
| JP4095454B2 (en) | Data decoding apparatus and data decoding method |