JP5855777B2 - Data compression apparatus, data decoding apparatus, data compression method, data decoding method, and data compression and decoding system - Google Patents

Data compression apparatus, data decoding apparatus, data compression method, data decoding method, and data compression and decoding system Download PDF

Info

Publication number
JP5855777B2
JP5855777B2 JP2015014581A JP2015014581A JP5855777B2 JP 5855777 B2 JP5855777 B2 JP 5855777B2 JP 2015014581 A JP2015014581 A JP 2015014581A JP 2015014581 A JP2015014581 A JP 2015014581A JP 5855777 B2 JP5855777 B2 JP 5855777B2
Authority
JP
Japan
Prior art keywords
data
value
unit
encoding
runz
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2015014581A
Other languages
Japanese (ja)
Other versions
JP2015080276A (en
Inventor
和江 千田
和江 千田
道正 佳月
佳月 道正
Original Assignee
株式会社情報システム総合研究所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社情報システム総合研究所 filed Critical 株式会社情報システム総合研究所
Priority to JP2015014581A priority Critical patent/JP5855777B2/en
Publication of JP2015080276A publication Critical patent/JP2015080276A/en
Application granted granted Critical
Publication of JP5855777B2 publication Critical patent/JP5855777B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、データ圧縮装置、データ復号装置、データ圧縮方法、データ復号方法およびデータ圧縮および復号システムに関する。   The present invention relates to a data compression device, a data decoding device, a data compression method, a data decoding method, and a data compression and decoding system.

JPEGで用いられるハフマン符号化のAC成分処理では、「0」係数の長さ(ゼロランレングス)を求め、「0」以外の係数(有効係数)のときに、ゼロランレングスと有効係数のグループでハフマン符号を割り当てる手法が知られている(例えば、特許文献1参照)。   In the AC component processing of Huffman coding used in JPEG, the length of the “0” coefficient (zero run length) is obtained, and when the coefficient is other than “0” (effective coefficient), the group of zero run length and effective coefficient A method for assigning a Huffman code is known (for example, see Patent Document 1).

特開平6−139346号公報JP-A-6-139346

しかしながら、上述した手法では、量子化後のビット長が増えるほどAC係数の最大値が大きくなるので、AC係数を特定するためのグループ数が増加する。そのため、グループを符号化するための符号種類も増加する。符号種類が増加すると、データ長の変動が激しくなり、データ量のとり得る範囲が広がってしまう。また、固定長データを送受信するシステムでは、データ圧縮を固定長に変換して送信する必要がある。従って、固定長データを送受信するシステムにおいて、上述した手法でハフマン符号化したデータの送受信を行う際には、ハフマン符号化後のデータの最大ビット長を固定長と定める必要があり、量子化後のビット長が短い場合であっても無駄なデータを送信しなければならず、通信効率を向上することができないという問題がある。   However, in the above-described method, the maximum value of the AC coefficient increases as the bit length after quantization increases, so the number of groups for specifying the AC coefficient increases. Therefore, the code types for encoding groups also increase. As the code type increases, the data length fluctuates more and the range that the data amount can take is expanded. Further, in a system that transmits and receives fixed length data, it is necessary to convert the data compression to a fixed length and transmit it. Therefore, in a system that transmits and receives fixed-length data, when transmitting and receiving Huffman-encoded data using the above-described method, it is necessary to determine the maximum bit length of data after Huffman encoding as a fixed length. Even when the bit length is short, useless data must be transmitted, and communication efficiency cannot be improved.

本発明は、上記事情に鑑みてなされたものであり、通信効率を向上することができるデータ圧縮装置、データ復号装置、データ圧縮方法、データ復号方法およびデータ圧縮および復号システムを提供することを目的とする。   The present invention has been made in view of the above circumstances, and an object thereof is to provide a data compression device, a data decoding device, a data compression method, a data decoding method, and a data compression and decoding system capable of improving communication efficiency. And

本発明の一態様は、複数の値が含まれる数値列を構成する符号化対象データを入力する入力部と、前記符号化対象データのゼロランレングス符号化を行い、前記数値列において0である前記値が連続している個数をrunzデータとし、0ではない前記値をvalueデータとし、さらに、前記valueデータの絶対値を表現できる最小のビット長を示す数値をgroupデータとする判定部と、前記runzデータを1次元の第1のハフマンテーブルを用いてハフマン符号化し、前記groupデータを前記第1のハフマンテーブルとは異なる1次元の第2のハフマンテーブルを用いてハフマン符号化し、さらに、前記groupデータから前記valueデータを特定するための付加ビットを算出する符号化部と、前記符号化部がハフマン符号化した前記runzデータと、前記符号化部がハフマン符号化した前記groupデータと、前記符号化部が算出した前記付加ビットとを、前記符号化対象データの符号化データとして、固定長データを送受信する通信方式で送信する送信部と、を有し、前記判定部は、前記数値列において0である前記値が連続している個数が0個の場合、当該個数を前記runzデータとせず、前記判定部は、連続する、0ではない前記値の組を、前記valueデータとすることを特徴とするデータ圧縮装置である。 According to one aspect of the present invention, an input unit that inputs encoding target data constituting a numerical sequence including a plurality of values, and zero run length encoding of the encoding target data are performed, and the numerical sequence is 0. A determination unit in which the number of consecutive values is runz data, the non-zero value is value data, and a numerical value indicating a minimum bit length that can represent the absolute value of the value data is group data; The runz data is Huffman encoded using a one-dimensional first Huffman table, the group data is Huffman encoded using a one-dimensional second Huffman table different from the first Huffman table, and an encoding unit for calculating additional bits for specifying the value data from the group data; and Encoding the runz data, the group data Huffman-encoded by the encoding unit, and the additional bits calculated by the encoding unit as encoded data of the encoding target data. A transmitting unit that transmits in a communication method for transmitting and receiving the data, and when the number of consecutive values that are 0 in the numerical sequence is 0, the determination unit does not use the number as the runz data. The determination unit is a data compression apparatus characterized in that the set of values that are not 0 is continuous as the value data .

また、本発明の他の態様のデータ圧縮装置において、前記判定部は、前記数値列において連続する0である値の個数が1個の場合のみ、0である当該値を0ではない前記値とみなして、当該値を前記valueデータとすることを特徴とする。   Further, in the data compression device according to another aspect of the present invention, the determination unit sets the value that is 0 to the value that is not 0 only when the number of consecutive values that are 0 in the numerical sequence is 1. The value is regarded as the value data.

また、本発明の他の態様は、データ圧縮装置から送信される前記符号化データを、固定長データを送受信する通信方式で受信する受信部と、前記第1のハフマンテーブルを用いてハフマン符号化された前記runzデータを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記groupデータを、前記第2のハフマンテーブルを用いて復号化し、前記groupデータと前記付加ビットとに基づいて前記valueデータを算出する復号化部と、復号化された前記runzデータと、算出された前記valueデータとに基づいて、前記符号化対象データを算出する算出部と、を有することを特徴とするデータ復号装置である。   In another aspect of the present invention, the encoded data transmitted from the data compression apparatus is received using a communication unit that transmits and receives fixed-length data, and a Huffman encoding is performed using the first Huffman table. And decoding the runz data using the first Huffman table, decoding the group data encoded using the second Huffman table, using the second Huffman table, and a decoding unit for calculating the value data based on the group data and the additional bits, a calculation for calculating the encoding target data based on the decoded runz data, and the calculated value data And a data decoding device characterized by comprising:

また、本発明の他の態様は、複数の値が含まれる数値列を構成する符号化対象データを入力する入力ステップと、前記符号化対象データのゼロランレングス符号化を行い、前記数値列において0である前記値が連続している個数をrunzデータとし、0ではない前記値をvalueデータとし、さらに、前記valueデータの絶対値を表現できる最小のビット長を示す数値をgroupデータとする判定ステップと、前記runzデータを1次元の第1のハフマンテーブルを用いてハフマン符号化し、前記groupデータを前記第1のハフマンテーブルとは異なる1次元の第2のハフマンテーブルを用いてハフマン符号化し、さらに、前記groupデータから前記valueデータを特定するための付加ビットを算出する符号化ステップと、前記符号化ステップでハフマン符号化した前記runzデータと、前記符号化ステップでハフマン符号化した前記groupデータと、前記符号化ステップで算出した前記付加ビットとを、前記符号化対象データの符号化データとして、固定長データを送受信する通信方式で送信する送信ステップと、を含み、前記判定ステップでは、前記数値列において0である前記値が連続している個数が0個の場合、当該個数を前記runzデータとせず、前記判定ステップでは、連続する、0ではない前記値の組を、前記valueデータとすることを特徴とするデータ圧縮方法である。 According to another aspect of the present invention, an input step for inputting encoding target data constituting a numerical sequence including a plurality of values, and zero-run length encoding of the encoding target data are performed. Determination that the number of consecutive 0 values is runz data, the non-zero value is value data, and a numerical value indicating the minimum bit length that can represent the absolute value of the value data is group data And Huffman encoding the runz data using a one-dimensional first Huffman table, and encoding the group data using a one-dimensional second Huffman table different from the first Huffman table, Further, an encoding step for calculating additional bits for specifying the value data from the group data. , The runz data Huffman encoded in the encoding step, the group data Huffman encoded in the encoding step, and the additional bits calculated in the encoding step. A transmission step of transmitting in a communication scheme for transmitting and receiving fixed-length data as encoded data, and in the determination step, when the number of consecutive values that are 0 in the numerical sequence is 0, The data compression method is characterized in that the number is not the runz data, and in the determination step, the continuous non-zero set of values is the value data .

また、本発明の他の態様は、データ圧縮方法で符号化された前記符号化データを、固定長データを送受信する通信方式で受信する受信ステップと、前記第1のハフマンテーブルを用いてハフマン符号化された前記runzデータを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記groupデータを、前記第2のハフマンテーブルを用いて復号化し、前記groupデータと前記付加ビットとに基づいて前記valueデータを算出する復号化ステップと、復号化された前記runzデータと、算出された前記valueデータとに基づいて、前記符号化対象データを算出する算出ステップと、を含むことを特徴とするデータ復号方法である。   According to another aspect of the present invention, there is provided a reception step of receiving the encoded data encoded by the data compression method by a communication method for transmitting and receiving fixed-length data, and a Huffman code using the first Huffman table. Decoding the runz data using the first Huffman table, decoding the group data encoded using the second Huffman table, using the second Huffman table, Decoding step of calculating the value data based on the group data and the additional bits, calculating the encoding target data based on the decoded runz data, and the calculated value data And a calculation step.

また、本発明の他の態様は、複数の値が含まれる数値列を構成する符号化対象データを入力する入力部と、前記符号化対象データのゼロランレングス符号化を行い、前記数値列において0である前記値が連続している個数をrunzデータとし、0ではない前記値をvalueデータとし、さらに、前記valueデータの絶対値を表現できる最小のビット長を示す数値をgroupデータとする判定部と、前記runzデータを1次元の第1のハフマンテーブルを用いてハフマン符号化し、前記groupデータを前記第1のハフマンテーブルとは異なる1次元の第2のハフマンテーブルを用いてハフマン符号化し、さらに、前記groupデータから前記valueデータを特定するための付加ビットを算出する符号化部と、前記符号化部がハフマン符号化した前記runzデータと、前記符号化部がハフマン符号化した前記groupデータと、前記符号化部が算出した前記付加ビットとを、前記符号化対象データの符号化データとして、固定長データを送受信する通信方式で送信する送信部と、を有するデータ圧縮装置と、前記送信部から送信される前記符号化データを、固定長データを送受信する通信方式で受信する受信部と、前記第1のハフマンテーブルを用いてハフマン符号化された前記runzデータを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記groupデータを、前記第2のハフマンテーブルを用いて復号化し、前記groupデータと前記付加ビットとに基づいて前記valueデータを算出する復号化部と、復号化された前記runzデータと、算出された前記valueデータとに基づいて、前記符号化対象データを算出する算出部と、を有するデータ復号装置と、を含み、前記判定部は、前記数値列において0である前記値が連続している個数が0個の場合、当該個数を前記runzデータとせず、前記判定部は、連続する、0ではない前記値の組を、前記valueデータとすることを特徴とするデータ圧縮および復号システムである。 According to another aspect of the present invention, an input unit that inputs encoding target data constituting a numerical sequence including a plurality of values, and zero-run length encoding of the encoding target data are performed. Determination that the number of consecutive 0 values is runz data, the non-zero value is value data, and a numerical value indicating the minimum bit length that can represent the absolute value of the value data is group data And Huffman encoding the runz data using a one-dimensional first Huffman table, and encoding the group data using a one-dimensional second Huffman table different from the first Huffman table, A coding unit for calculating additional bits for identifying the value data from the group data; The runz data encoded by Huffman, the group data Huffman encoded by the encoding unit, and the additional bits calculated by the encoding unit are used as encoded data of the encoding target data, and are fixed length. A data compression apparatus having a transmission unit that transmits data in a communication scheme; a reception unit that receives the encoded data transmitted from the transmission unit in a communication scheme that transmits and receives fixed-length data; and The runz data encoded using the first Huffman table is decoded using the first Huffman table, and the group data encoded using the second Huffman table is converted into the second data. And the value data is calculated based on the group data and the additional bits. It includes a decoding unit that, said runz data decoded, the calculated on the basis of the value data, and a data decoding apparatus having: a calculation unit for calculating the encoding object data, the determination When the number of consecutive 0 values in the numerical sequence is 0, the number is not used as the runz data, and the determination unit determines the set of consecutive non-zero values as follows: The data compression and decoding system is characterized by using the value data .

また、本発明の他の態様は、複数の値が含まれる数値列を構成する符号化対象データを入力する入力部と、前記符号化対象データのうち、0ではない前記値をvalue符号化対象データとして記憶するvalue記憶部と、0ではない前記値と、他の0ではない前記値との間に、0である前記値が連続している個数をrunz符号化対象データとして記憶するrunz記憶部と、前記runz符号化対象データを第1のハフマンテーブルを用いて符号化するとともに、前記value符号化対象データを前記第1のハフマンテーブルとは異なる第2のハフマンテーブルを用いて符号化する符号化部と、前記符号化部が符号化した符号化データを、固定長データを送受信する通信方式で送信する送信部と、を有し、前記固定長は、前記符号化対象データのビット幅に基づいた長さであることを特徴とするデータ圧縮装置である。   According to another aspect of the present invention, an input unit that inputs encoding target data constituting a numerical sequence including a plurality of values, and the value that is not 0 among the encoding target data are value encoding targets. A value storage unit that stores data, and a runz storage that stores, as runz encoding target data, the number of consecutive values that are 0 between the non-zero value and the other non-zero values. And the runz encoding target data are encoded using a first Huffman table, and the value encoding target data is encoded using a second Huffman table different from the first Huffman table. An encoding unit; and a transmission unit that transmits the encoded data encoded by the encoding unit by a communication method for transmitting and receiving fixed-length data. Is a data compression system, characterized in that the length based on the bit width of the elephants data.

また、本発明の他の態様のデータ圧縮装置において、前記runz記憶部は、0である前記値が連続している個数が0個の場合、当該個数を前記runz符号化対象データとして記憶せず、前記value記憶部は、連続する、0ではない前記値の組を、前記value符号化対象データとして記憶することを特徴とする。   In the data compression apparatus according to another aspect of the present invention, the runz storage unit does not store the number as the runz encoding target data when the number of consecutive zero values is zero. The value storage unit stores consecutive sets of values other than 0 as the value encoding target data.

また、本発明の他の態様のデータ圧縮装置において、前記value記憶部と、前記runz記憶部とは、連続する0である値の個数が1個の場合のみ、0である当該値を0ではない前記値とみなして、当該値を前記value符号化対象データとして記憶することを特徴とする。   Further, in the data compression apparatus according to another aspect of the present invention, the value storage unit and the runz storage unit may reduce the value of 0 to 0 only when the number of consecutive values of 0 is 1. It is considered that there is no value, and the value is stored as the value encoding target data.

また、本発明の他の態様は、データ圧縮装置から送信される前記符号化データを、固定長データを送受信する通信方式で受信する受信部と、前記第1のハフマンテーブルを用いて符号化された前記runz符号化対象データを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記value符号化対象データを、前記第2のハフマンテーブルを用いて復号化する復号化部と、復号化された前記runz符号化対象データと、復号化された前記value符号化対象データとに基づいて、前記符号化対象データを算出する算出部と、を有することを特徴とするデータ復号装置である。   According to another aspect of the present invention, the encoded data transmitted from the data compression apparatus is encoded using a receiving unit that receives a communication method for transmitting and receiving fixed-length data and the first Huffman table. The runz encoding target data is decoded using the first Huffman table, and the value encoding target data encoded using the second Huffman table is used using the second Huffman table. And a decoding unit that calculates the encoding target data based on the decoded runz encoding target data and the decoded value encoding target data. A data decoding apparatus characterized by the above.

また、本発明の他の態様は、データ圧縮装置から送信される前記符号化データを、固定長データを送受信する通信方式で受信する受信部と、前記第1のハフマンテーブルを用いて符号化された前記runz符号化対象データを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記value符号化対象データを、前記第2のハフマンテーブルを用いて復号化する復号化部と、復号化された前記runz符号化対象データと、復号化された前記value符号化対象データとに基づいて、前記符号化対象データを算出する算出部と、を有することを特徴とするデータ復号装置である。   According to another aspect of the present invention, the encoded data transmitted from the data compression apparatus is encoded using a receiving unit that receives a communication method for transmitting and receiving fixed-length data and the first Huffman table. The runz encoding target data is decoded using the first Huffman table, and the value encoding target data encoded using the second Huffman table is used using the second Huffman table. And a decoding unit that calculates the encoding target data based on the decoded runz encoding target data and the decoded value encoding target data. A data decoding apparatus characterized by the above.

また、本発明の他の態様は、データ圧縮装置から送信される前記符号化データを、固定長データを送受信する通信方式で受信する受信部と、前記第1のハフマンテーブルを用いて符号化された前記runz符号化対象データを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記value符号化対象データを、前記第2のハフマンテーブルを用いて復号化する復号化部と、復号化された前記runz符号化対象データと、復号化された前記value符号化対象データとに基づいて、前記符号化対象データを算出する算出部と、を有することを特徴とするデータ復号装置である。   According to another aspect of the present invention, the encoded data transmitted from the data compression apparatus is encoded using a receiving unit that receives a communication method for transmitting and receiving fixed-length data and the first Huffman table. The runz encoding target data is decoded using the first Huffman table, and the value encoding target data encoded using the second Huffman table is used using the second Huffman table. And a decoding unit that calculates the encoding target data based on the decoded runz encoding target data and the decoded value encoding target data. A data decoding apparatus characterized by the above.

また、本発明の他の態様は、複数の値が含まれる数値列を構成する符号化対象データを入力するステップと、前記符号化対象データのうち、0ではない前記値をvalue符号化対象データとして記憶するステップと、0ではない前記値と、他の0ではない前記値との間に、0である前記値が連続している個数をrunz符号化対象データとして記憶するステップと、前記runz符号化対象データを第1のハフマンテーブルを用いて符号化するとともに、前記value符号化対象データを前記第1のハフマンテーブルとは異なる第2のハフマンテーブルを用いて符号化する符号化ステップと、前記符号化ステップで符号化した符号化データを、固定長データを送受信する通信方式で送信するステップと、を含み、前記固定長は、前記符号化対象データのビット幅に基づいた長さであることを特徴とするデータ圧縮方法である。   According to another aspect of the present invention, a step of inputting encoding target data constituting a numerical sequence including a plurality of values, and the value that is not 0 among the encoding target data are set to value encoding target data. Storing as a runz encoding target data the number of consecutive values that are 0 between the non-zero value and the other non-zero value, and the runz An encoding step of encoding the encoding target data using a first Huffman table and encoding the value encoding target data using a second Huffman table different from the first Huffman table; Transmitting the encoded data encoded in the encoding step by a communication method for transmitting and receiving fixed length data, wherein the fixed length is the code It is a data compression method which is a length based on the bit width of the target data.

また、本発明の他の態様は、データ圧縮方法で符号化されたデータを、固定長データを送受信する通信方式で受信するステップと、前記第1のハフマンテーブルを用いて符号化された前記runz符号化対象データを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記value符号化対象データを、前記第2のハフマンテーブルを用いて復号化するステップと、復号化された前記runz符号化対象データと、復号化された前記value符号化対象データとに基づいて、前記符号化対象データを算出するステップと、を含むことを特徴とするデータ復号方法である。   According to another aspect of the present invention, there is provided a step of receiving data encoded by a data compression method using a communication method for transmitting and receiving fixed-length data, and the runz encoded using the first Huffman table. The data to be encoded is decoded using the first Huffman table, and the value encoding target data encoded using the second Huffman table is decoded using the second Huffman table. And a step of calculating the encoding target data based on the decoded runz encoding target data and the decoded value encoding target data. Decoding method.

また、本発明の他の態様は、複数の値が含まれる数値列を構成する符号化対象データを入力する入力部と、前記符号化対象データのうち、0ではない前記値をvalue符号化対象データとして記憶するvalue記憶部と、0ではない前記値と、他の0ではない前記値との間に、0である前記値が連続している個数をrunz符号化対象データとして記憶するrunz記憶部と、前記runz符号化対象データを第1のハフマンテーブルを用いて符号化するとともに、前記value符号化対象データを前記第1のハフマンテーブルとは異なる第2のハフマンテーブルを用いて符号化する符号化部と、前記符号化部が符号化した符号化データを、固定長データを送受信する通信方式で送信する送信部と、を有するデータ圧縮装置と、前記送信部から送信される前記符号化データを、固定長データを送受信する通信方式で受信する受信部と、前記第1のハフマンテーブルを用いて符号化された前記runz符号化対象データを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記value符号化対象データを、前記第2のハフマンテーブルを用いて復号化する復号化部と、復号化された前記runz符号化対象データと、復号化された前記value符号化対象データとに基づいて、前記符号化対象データを算出する算出部と、を有するデータ復号装置と、を有し、前記固定長は、前記符号化対象データのビット幅に基づいた長さであることを特徴とするデータ圧縮および復号システムである。   According to another aspect of the present invention, an input unit that inputs encoding target data constituting a numerical sequence including a plurality of values, and the value that is not 0 among the encoding target data are value encoding targets. A value storage unit that stores data, and a runz storage that stores, as runz encoding target data, the number of consecutive values that are 0 between the non-zero value and the other non-zero values. And the runz encoding target data are encoded using a first Huffman table, and the value encoding target data is encoded using a second Huffman table different from the first Huffman table. A data compression apparatus comprising: an encoding unit; and a transmission unit that transmits the encoded data encoded by the encoding unit using a communication method for transmitting and receiving fixed-length data. A reception unit that receives the encoded data transmitted from a unit by a communication method that transmits and receives fixed-length data; and the runz encoding target data that is encoded using the first Huffman table. And a decoding unit that decodes the value encoding target data encoded using the second Huffman table using the second Huffman table and the second Huffman table. A data decoding device comprising: a calculation unit that calculates the encoding target data based on the runz encoding target data and the decoded value encoding target data; and the fixed length Is a data compression and decoding system characterized in that the length is based on the bit width of the data to be encoded.

本発明のデータ圧縮装置またはデータ圧縮方法によれば、入力部は、複数の値が含まれる数値列を構成する符号化対象データを入力する。また、判定部は、符号化対象データのゼロランレングス符号化を行い、数値列において0である値が連続している個数をrunzデータとし、0ではない値をvalueデータとし、さらに、valueデータの絶対値を表現できる最小のビット長を示す数値をgroupデータとする。また、符号化部は、runzデータを1次元の第1のハフマンテーブルを用いてハフマン符号化し、groupデータを第1のハフマンテーブルとは異なる1次元の第2のハフマンテーブルを用いてハフマン符号化し、さらに、groupデータからvalueデータを特定するための付加ビットを算出する。また、送信部は、符号化部がハフマン符号化したrunzデータと、符号化部がハフマン符号化したgroupデータと、符号化部が算出した付加ビットとを、符号化対象データの符号化データとして、固定長データを送受信する通信方式で送信する。また、固定長は送信するデータの最大長であり、符号化対象データの符号化後の最大ビット長に基づいて固定長を短くすることができる。   According to the data compression device or data compression method of the present invention, the input unit inputs data to be encoded that constitutes a numerical sequence including a plurality of values. In addition, the determination unit performs zero-run length encoding of the encoding target data, sets the number of consecutive zero values in the numerical sequence as runz data, sets non-zero values as value data, and further sets the value data. A numerical value indicating the minimum bit length that can express the absolute value of is defined as group data. The encoding unit also encodes the runz data using a one-dimensional first Huffman table and the group data using a one-dimensional second Huffman table different from the first Huffman table. Further, an additional bit for specifying value data is calculated from the group data. Further, the transmission unit uses the runz data encoded by the encoding unit as Huffman, the group data encoded by the encoding unit as Huffman, and the additional bits calculated by the encoding unit as encoded data of the encoding target data. , And transmit using a communication method for transmitting and receiving fixed-length data. The fixed length is the maximum length of data to be transmitted, and the fixed length can be shortened based on the maximum bit length after encoding of the encoding target data.

このように、1次元のハフマンテーブルを用いて符号化を行うため、符号種類が少なくなる。符号種類が少なくなると、ハフマン符号化後の最大ビット長も短くなる。よって、固定長データを送受信する通信方式でデータを送信する際に、固定長を短くすることができ、通信効率を向上することができる。   In this way, since encoding is performed using a one-dimensional Huffman table, the number of code types is reduced. As the number of code types decreases, the maximum bit length after Huffman encoding also decreases. Therefore, when data is transmitted by a communication method for transmitting and receiving fixed-length data, the fixed length can be shortened and communication efficiency can be improved.

また、本発明のデータ復号装置またはデータ復号方法によれば、受信部は、データ圧縮装置から送信される符号化データを、固定長データを送受信する通信方式で受信する。また、復号化部は、第1のハフマンテーブルを用いてハフマン符号化されたrunzデータを、第1のハフマンテーブルを用いて復号化し、第2のハフマンテーブルを用いて符号化されたgroupデータを、第2のハフマンテーブルを用いて復号化し、groupデータと付加ビットとに基づいてvalueデータを算出する。また、算出部は、復号化されたrunzデータと、算出されたvalueデータとに基づいて、符号化対象データを算出する。   Further, according to the data decoding device or the data decoding method of the present invention, the receiving unit receives the encoded data transmitted from the data compression device by a communication method for transmitting and receiving fixed length data. The decoding unit also decodes the runz data encoded using the first Huffman table using the first Huffman table and the group data encoded using the second Huffman table. Then, decoding is performed using the second Huffman table, and value data is calculated based on the group data and the additional bits. Further, the calculation unit calculates encoding target data based on the decoded runz data and the calculated value data.

このように、1次元のハフマンテーブルを用いて復号化を行うため、符号種類が少なくなる。符号種類が少なくなると、ハフマン符号化後の最大ビット長も短くなる。よって、固定長データを送受信する通信方式でデータを受信する際に、固定長を短くすることができ、通信効率を向上することができる。   Thus, since decoding is performed using a one-dimensional Huffman table, the number of code types is reduced. As the number of code types decreases, the maximum bit length after Huffman encoding also decreases. Therefore, the fixed length can be shortened and the communication efficiency can be improved when data is received by a communication method for transmitting and receiving fixed length data.

また、本発明のデータ圧縮および復号システムによれば、入力部は、複数の値が含まれる数値列を構成する符号化対象データを入力する。また、判定部は、符号化対象データのゼロランレングス符号化を行い、数値列において0である値が連続している個数をrunzデータとし、0ではない値をvalueデータとし、さらに、valueデータの絶対値を表現できる最小のビット長を示す数値をgroupデータとする。また、符号化部は、runzデータを1次元の第1のハフマンテーブルを用いてハフマン符号化し、groupデータを第1のハフマンテーブルとは異なる1次元の第2のハフマンテーブルを用いてハフマン符号化し、さらに、groupデータからvalueデータを特定するための付加ビットを算出する。また、送信部は、符号化部がハフマン符号化したrunzデータと、符号化部がハフマン符号化したgroupデータと、符号化部が算出した付加ビットとを、符号化対象データの符号化データとして、固定長データを送受信する通信方式で送信する。また、受信部は、データ圧縮装置から送信される符号化データを、固定長データを送受信する通信方式で受信する。また、復号化部は、第1のハフマンテーブルを用いてハフマン符号化されたrunzデータを、第1のハフマンテーブルを用いて復号化し、第2のハフマンテーブルを用いて符号化されたgroupデータを、第2のハフマンテーブルを用いて復号化し、groupデータと付加ビットとに基づいてvalueデータを算出する。また、算出部は、復号化されたrunzデータと、算出されたvalueデータとに基づいて、符号化対象データを算出する。また、固定長は送信するデータの最大長であり、符号化対象データの符号化後の最大ビット長に基づいて固定長を短くすることができる。   Further, according to the data compression and decoding system of the present invention, the input unit inputs the encoding target data constituting a numerical sequence including a plurality of values. In addition, the determination unit performs zero-run length encoding of the encoding target data, sets the number of consecutive zero values in the numerical sequence as runz data, sets non-zero values as value data, and further sets the value data. A numerical value indicating the minimum bit length that can express the absolute value of is defined as group data. The encoding unit also encodes the runz data using a one-dimensional first Huffman table and the group data using a one-dimensional second Huffman table different from the first Huffman table. Further, an additional bit for specifying value data is calculated from the group data. Further, the transmission unit uses the runz data encoded by the encoding unit as Huffman, the group data encoded by the encoding unit as Huffman, and the additional bits calculated by the encoding unit as encoded data of the encoding target data. , And transmit using a communication method for transmitting and receiving fixed-length data. The receiving unit receives the encoded data transmitted from the data compression apparatus by a communication method for transmitting and receiving fixed length data. The decoding unit also decodes the runz data encoded using the first Huffman table using the first Huffman table and the group data encoded using the second Huffman table. Then, decoding is performed using the second Huffman table, and value data is calculated based on the group data and the additional bits. Further, the calculation unit calculates encoding target data based on the decoded runz data and the calculated value data. The fixed length is the maximum length of data to be transmitted, and the fixed length can be shortened based on the maximum bit length after encoding of the encoding target data.

このように、1次元のハフマンテーブルを用いて符号化および復号化を行うため、符号種類が少なくなる。符号種類が少なくなると、ハフマン符号化後の最大ビット長も短くなる。よって、固定長データを送受信する通信方式でデータを送受信する際に、固定長を短くすることができ、通信効率を向上することができる。   Thus, since encoding and decoding are performed using a one-dimensional Huffman table, the number of code types is reduced. As the number of code types decreases, the maximum bit length after Huffman encoding also decreases. Therefore, when data is transmitted / received by a communication method for transmitting / receiving fixed length data, the fixed length can be shortened, and communication efficiency can be improved.

本発明の第1の実施形態におけるデータ圧縮および復号システムの構成を示したブロック図である。It is the block diagram which showed the structure of the data compression and decoding system in the 1st Embodiment of this invention. 本発明の第1の実施形態における圧縮部の構成を示したブロック図である。It is the block diagram which showed the structure of the compression part in the 1st Embodiment of this invention. 本発明の第1の実施形態における伸張部の構成を示したブロック図である。It is the block diagram which showed the structure of the expansion | extension part in the 1st Embodiment of this invention. 本発明の第1の実施形態におけるゼロランレングス符号化の具体例を示した説明図である。It is explanatory drawing which showed the specific example of the zero run length encoding in the 1st Embodiment of this invention. 本発明の第1の実施形態における本実施形態における記憶部が記憶する量子化スケールとハフマンテーブルの種類との関連を一意に特定する関連テーブルを示した概略図である。It is the schematic which showed the related table which specifies uniquely the relationship between the quantization scale which the memory | storage part in the 1st Embodiment of this invention memorize | stores, and the kind of Huffman table. 本発明の第1の実施形態におけるrunzと、valueと、groupとの値を纏めた概略図である。It is the schematic which put together the value of runz in the 1st Embodiment of this invention, value, and group. 本発明の第1の実施形態におけるハフマン符号化部の構成を示したブロック図である。It is the block diagram which showed the structure of the Huffman encoding part in the 1st Embodiment of this invention. 本発明の第1の実施形態における判定部の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the determination part in the 1st Embodiment of this invention. 本発明の第1の実施形態における符号化部の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the encoding part in the 1st Embodiment of this invention. 本発明の第1の実施形態におけるハフマン伸張化部の構成を示したブロック図である。It is the block diagram which showed the structure of the Huffman expansion part in the 1st Embodiment of this invention. 本発明の第1の実施形態における復号化部の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the decoding part in the 1st Embodiment of this invention. 本発明の第1の実施形態における出力部の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the output part in the 1st Embodiment of this invention. 本発明の第2の実施形態におけるゼロランレングス符号化の具体例を示した説明図である。It is explanatory drawing which showed the specific example of the zero run length encoding in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるバリューランレングス符号化の具体例を示した説明図である。It is explanatory drawing which showed the specific example of the value run length encoding in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるrunzと、runvと、valueと、groupとの値を纏めた概略図である。It is the schematic which put together the value of runz, runv, value, and group in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるハフマン符号化部の構成を示したブロック図である。It is the block diagram which showed the structure of the Huffman encoding part in the 2nd Embodiment of this invention. 本発明の第2の実施形態における判定部の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the determination part in the 2nd Embodiment of this invention. 本発明の第2の実施形態における符号化部の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the encoding part in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるハフマン伸張化部の構成を示したブロック図である。It is the block diagram which showed the structure of the Huffman expansion part in the 2nd Embodiment of this invention. 本発明の第2の実施形態における復号化部の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the decoding part in the 2nd Embodiment of this invention. 本発明の第2の実施形態における出力部の処理手順を示したフローチャートである。It is the flowchart which showed the process sequence of the output part in the 2nd Embodiment of this invention. 本発明の第3の実施形態におけるゼロランレングス符号化の具体例を示した説明図である。It is explanatory drawing which showed the specific example of the zero run length encoding in the 3rd Embodiment of this invention. 本発明の第3の実施形態におけるバリューランレングス符号化の具体例を示した説明図である。It is explanatory drawing which showed the specific example of the value run length encoding in the 3rd Embodiment of this invention. 本発明の第3の実施形態におけるrunzと、runvと、valueと、groupとの値を纏めた概略図である。It is the schematic which put together the value of runz, runv, value, and group in the 3rd Embodiment of this invention.

(第1の実施形態)
以下、本発明の第1の実施形態について図面を参照して説明する。図1は、本実施形態におけるデータ圧縮および復号システム1の構成を示したブロック図である。図示する例では、データ圧縮および復号システム1は、データ圧縮装置2とデータ復号装置3とを備える。データ圧縮装置2は、圧縮部20と送信部30とを備える。データ復号装置3は、受信部40と伸張部50とを備える。
(First embodiment)
Hereinafter, a first embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a data compression and decoding system 1 in the present embodiment. In the illustrated example, the data compression and decoding system 1 includes a data compression device 2 and a data decoding device 3. The data compression device 2 includes a compression unit 20 and a transmission unit 30. The data decoding device 3 includes a reception unit 40 and an expansion unit 50.

圧縮部20は画像データを圧縮し、圧縮したデータを送信部に入力する。圧縮部20の構成および圧縮部20が用いる圧縮方法については後述する。送信部30は、固定長のデータを送受信する規格を用いて、圧縮部20が圧縮した圧縮データをデータ復号装置3に送信する。受信部40は、送信部30から送信される圧縮データを受信し、受信した圧縮データを伸張部50に入力する。伸張部50は、受信部40から入力された圧縮データを伸張(復号)し、出力する。   The compression unit 20 compresses the image data and inputs the compressed data to the transmission unit. The configuration of the compression unit 20 and the compression method used by the compression unit 20 will be described later. The transmission unit 30 transmits the compressed data compressed by the compression unit 20 to the data decoding device 3 using a standard for transmitting and receiving fixed-length data. The receiving unit 40 receives the compressed data transmitted from the transmitting unit 30 and inputs the received compressed data to the decompressing unit 50. The decompressing unit 50 decompresses (decodes) the compressed data input from the receiving unit 40 and outputs the decompressed data.

次に、圧縮部20について説明する。図2は、本実施形態における圧縮部20の構成を示したブロック図である。図示する例では、圧縮部20は、周波数変換部21と、量子化部22と、記憶部23(圧縮装置記憶部)と、ハフマン符号化部24(符号化部)とを備える。   Next, the compression unit 20 will be described. FIG. 2 is a block diagram showing the configuration of the compression unit 20 in the present embodiment. In the example illustrated, the compression unit 20 includes a frequency conversion unit 21, a quantization unit 22, a storage unit 23 (compression device storage unit), and a Huffman encoding unit 24 (encoding unit).

周波数変換部21は、空間周波数変換(フーリエ変換)を行い、圧縮部20に入力された画像データを周波数成分に分ける。量子化部22は、周波数変換部21が変換した周波数成分を量子化して各周波数成分の分解能を変更する。記憶部23は、1次元のハフマンテーブルを記憶する。ハフマン符号化部24は、記憶部23が記憶しているハフマンテーブルを用いて、量子化部22が量子化した周波数成分(符号化対象データ)の符号化を行い、圧縮データを出力する。   The frequency conversion unit 21 performs spatial frequency conversion (Fourier transform), and divides the image data input to the compression unit 20 into frequency components. The quantization unit 22 quantizes the frequency component converted by the frequency conversion unit 21 and changes the resolution of each frequency component. The storage unit 23 stores a one-dimensional Huffman table. The Huffman encoding unit 24 encodes the frequency component (encoding target data) quantized by the quantization unit 22 using the Huffman table stored in the storage unit 23, and outputs compressed data.

次に、伸張部50について説明する。図3は、本実施形態における伸張部50の構成を示したブロック図である。図示する例では、伸張部50は、記憶部51(復号装置記憶部)と、ハフマン伸張化部52(復号部)と、逆量子化部53と、逆周波数変換部54とを備える。   Next, the extension unit 50 will be described. FIG. 3 is a block diagram showing the configuration of the decompression unit 50 in the present embodiment. In the illustrated example, the expansion unit 50 includes a storage unit 51 (decoding device storage unit), a Huffman expansion unit 52 (decoding unit), an inverse quantization unit 53, and an inverse frequency conversion unit 54.

記憶部51は、1次元のハフマンテーブルを記憶する。ハフマン伸張化部52は、記憶部51が記憶するハフマンテーブルを用いて、受信部40から入力される圧縮データを伸張(復号)し、量子化された周波数成分を復元する。逆量子化部53は、量子化された周波数成分から画像データの周波数成分を復元する。逆周波数変換部54は、逆空間周波数変換(逆フーリエ変換)を行い、周波数成分から画像データを復元する。   The storage unit 51 stores a one-dimensional Huffman table. The Huffman decompression unit 52 decompresses (decodes) the compressed data input from the reception unit 40 using the Huffman table stored in the storage unit 51, and restores the quantized frequency component. The inverse quantization unit 53 restores the frequency component of the image data from the quantized frequency component. The inverse frequency transform unit 54 performs inverse spatial frequency transform (inverse Fourier transform) to restore image data from the frequency components.

次に、本実施形態のハフマン符号化部24における符号化方法について説明する。以下、ハフマン符号化部24に入力される周波数成分のうち、AC成分(符号化対象データ)「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」を符号化する例を用いて説明する。   Next, the encoding method in the Huffman encoder 24 of this embodiment will be described. Hereinafter, among the frequency components input to the Huffman encoding unit 24, the AC component (encoding target data) “5,0,0,0,3,0,0,1,2,0,0,4,0 , 6,... "Will be described using an example of encoding.

初めに、ハフマン符号化部24は、ゼロランレングス符号化を行う。具体的には、符号化対象データにおいて「0」が連続する数を算出し、「0」が連続する数と、「0」以外の値とで符号化対象データを表す。以下、「0」が連続する数を示すデータをrunzとする。また「0」以外の値を示すデータをvalueとする。   First, the Huffman encoding unit 24 performs zero run length encoding. Specifically, the number of consecutive “0” s in the encoding target data is calculated, and the encoding target data is represented by the number of consecutive “0” s and a value other than “0”. Hereinafter, data indicating the number of consecutive “0” s is referred to as runz. Data indicating a value other than “0” is set to value.

図4は、ゼロランレングス符号化の具体例を示した説明図である。図示する例では、符号化対象データは「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」である。図示する符号化対象データの先頭の値は「5」であるため、「0」が連続する数は「0」個である。また、符号化対象データ「5」の後の値は「0,0,0,3」であるため、「0」が連続する数は「3」個である。また、符号化対象データ「3」の後の値は「0,0,1」であるため、「0」が連続する数は「2」個である。また、符号化対象データ「1」の後の値は「2」であるため、「0」が連続する数は「0」個である。また、符号化対象データ「2」の後の値は「0,0,4」であるため、「0」が連続する数は「2」個である。以下、同様に「0」が連続する数を算出すると、runzは「0」「3」「2」「0」「2」「1」・・・となる。また、「0」以外の値(value)は、「5」「3」「1」「2」「4」「6」・・・となる。   FIG. 4 is an explanatory diagram showing a specific example of zero-run length encoding. In the illustrated example, the data to be encoded is “5, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 4, 0, 6,. Since the leading value of the encoding target data shown in the figure is “5”, the number of consecutive “0” s is “0”. Since the value after the encoding target data “5” is “0, 0, 0, 3”, the number of consecutive “0” s is “3”. Further, since the value after the encoding target data “3” is “0, 0, 1”, the number of consecutive “0” is “2”. Since the value after the encoding target data “1” is “2”, the number of consecutive “0” s is “0”. Since the value after the encoding target data “2” is “0, 0, 4”, the number of consecutive “0” s is “2”. Similarly, when the number of consecutive “0” s is calculated, runz becomes “0” “3” “2” “0” “2” “1”. Further, values (values) other than “0” are “5”, “3”, “1”, “2”, “4”, “6”,.

次に、ハフマン符号化部24は、valueを特定するgroupと付加ビットとを算出する。なお、groupは、Valueの絶対値を表現できる最小のビット長(付加ビットの長さ)と同じ値である。なお、groupと付加ビットとでvalueを特定することができる。図5は、groupとvalueと付加ビット長との対応を示した概略図である。図示する例では、value「−1、1」に対応するgroupは「1」であり、付加ビット長は「1」である。また、value「−3、−2、2、3」に対応するgroupは「2」であり、付加ビット長は「2」である。また、value「−7・・・−4、4・・・7」に対応するgroupは「3」であり、付加ビット長は「3」である。他のvalueに対応するgroupと付加ビット長とは図示するとおりである。この対応関係により、valueが「5」「3」「1」「2」「4」「6」・・・である場合、groupは「3」「2」「1」「2」「3」「3」・・・となる。また、このときの付加ビット長は「3」「2」「1」「2」「3」「3」・・・となる。   Next, the Huffman encoding unit 24 calculates a group specifying the value and an additional bit. The group is the same value as the minimum bit length (length of additional bits) that can express the absolute value of Value. The value can be specified by the group and the additional bit. FIG. 5 is a schematic diagram showing the correspondence between groups, values, and additional bit lengths. In the illustrated example, the group corresponding to the value “−1, 1” is “1”, and the additional bit length is “1”. The group corresponding to the value “−3, −2, 2, 3” is “2”, and the additional bit length is “2”. Further, the group corresponding to the value “−7... -4, 4... 7” is “3”, and the additional bit length is “3”. The groups corresponding to other values and the additional bit length are as shown in the figure. With this correspondence, when the value is “5” “3” “1” “2” “4” “6”..., The group is “3” “2” “1” “2” “3” “ 3 "... Further, the additional bit length at this time is “3” “2” “1” “2” “3” “3”.

図6は、符号化対象データ「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」のrunzと、valueと、groupとの値を纏めた概略図である。図示する例では、runzと、valueと、groupとの値が、行の上から順に記載されている。例えば、行101には、runz「0」と、value「5」と、group「3」とが記載されている。また、行102には、runz「3」と、value「3」と、group「2」とが記載されている。他の行については図示するとおりである。なお、各行のデータを1つの符号セットとする。   FIG. 6 shows the runz, value, and group of the encoding target data “5,0,0,0,3,0,0,1,2,0,0,4,0,6,. It is the schematic which summarized the value of. In the illustrated example, values of runz, value, and group are described in order from the top of the line. For example, in row 101, runz “0”, value “5”, and group “3” are described. In line 102, runz “3”, value “3”, and group “2” are described. The other rows are as illustrated. Note that the data of each row is one code set.

次に、ハフマン符号化部24は、1つの符号セット毎に、runzと、groupと、valueとを、それぞれ1次元の符号化テーブルを用いて符号化する。なお、runzの符号化に用いるハフマンテーブル(第1のハフマンテーブル)をHzとする。また、groupの符号化に用いるハフマンテーブル(第2のハフマンテーブル)をHgとする。これにより、1つの符号セットをハフマン符号化したデータは、Hz[runz]+Hg[group]+value.encとなる。value.encは付加ビットである。なお、符号化されたものに対して、接尾に.encを付加している。   Next, the Huffman encoding unit 24 encodes runz, group, and value for each code set using a one-dimensional encoding table. It is assumed that the Huffman table (first Huffman table) used for the runz encoding is Hz. Also, the Huffman table (second Huffman table) used for group encoding is Hg. As a result, data obtained by Huffman encoding one code set is Hz [runz] + Hg [group] + value. enc. value. enc is an additional bit. In addition, it is suffixed to the encoded one. enc is added.

次に、本実施形態のハフマン符号化部24の構成について説明する。図7は、本実施形態のハフマン符号化部24の構成を示したブロック図である。図示する例では、ハフマン符号化部24は、入力部240と、判定部241と、符号化部242とを備えている。また、判定部241は、記憶部2410(value記憶部、runz記憶部)を備えている。判定部241は、入力された符号化対象データを判定し、trigと、1セットのrunzと、groupと、valueとを記憶部2410に記憶させる。また、判定部241は、記憶部2410に記憶させたtrigと、1セットのrunzと、groupと、valueとを符号化部242に入力する。符号化部242は、trigが入力されると、trigとともに入力された、1セットのrunzと、groupと、valueとを1次元ハフマンテーブルを用いて符号化する。そして、符号化部242は、符号化した1セットのデータ、Hz[runz]+Hg[group]+value.encを出力する。符号化部242はtrigが入力される毎にこの処理を行う。このような手順により、ハフマン符号化部24は、符号化対象データの符号化を行う。   Next, the configuration of the Huffman encoding unit 24 of this embodiment will be described. FIG. 7 is a block diagram showing the configuration of the Huffman encoder 24 of this embodiment. In the illustrated example, the Huffman encoding unit 24 includes an input unit 240, a determination unit 241, and an encoding unit 242. The determination unit 241 includes a storage unit 2410 (value storage unit, runz storage unit). The determination unit 241 determines input data to be encoded, and causes the storage unit 2410 to store trig, one set of runz, group, and value. Also, the determination unit 241 inputs the trig, one set of runz, group, and value stored in the storage unit 2410 to the encoding unit 242. When trig is input, the encoding unit 242 encodes a set of runz, group, and value input together with the trig using a one-dimensional Huffman table. The encoding unit 242 then encodes one set of encoded data, Hz [runz] + Hg [group] + value. output enc. The encoding unit 242 performs this process each time trig is input. By such a procedure, the Huffman encoder 24 encodes the encoding target data.

次に、判定部241の詳細な処理手順について説明する。図8は、本実施形態における判定部241の処理手順を示したフローチャートである。
(ステップS101)判定部241は、各変数の値を「0」に初期化する。その後、ステップS102の処理に進む。
Next, a detailed processing procedure of the determination unit 241 will be described. FIG. 8 is a flowchart illustrating a processing procedure of the determination unit 241 in the present embodiment.
(Step S <b> 101) The determination unit 241 initializes the value of each variable to “0”. Thereafter, the process proceeds to step S102.

(ステップS102)判定部241は、i<63であれば、i++とした後にステップS103〜ステップS111の処理を実行する。また、判定部241は、i<63でなければ処理を終了する。なお、符号化対象データであるAC成分は63個であるため、判定部241は、ステップS103〜ステップS111の処理を63回繰り返す。すなわち、ステップS103〜ステップS111の処理の実行回数が63回未満である場合にはステップS103の処理に進み、それ以外の場合には処理を終了する。   (Step S102) If it is i <63, the determination part 241 will perform the process of step S103-step S111 after setting it as i ++. Further, the determination unit 241 ends the process unless i <63. Note that since there are 63 AC components that are data to be encoded, the determination unit 241 repeats the processing from step S103 to step S111 63 times. That is, if the number of executions of the processes in steps S103 to S111 is less than 63, the process proceeds to step S103, and otherwise the process ends.

(ステップS103)判定部241は、trig=0とする。その後、ステップS104の処理に進む。
(ステップS104)判定部241は、din(i)が「0」であるか否かを判定する。din(i)が「0」であると判定部241が判定した場合にはステップS105の処理に進み、それ以外の場合にはステップS108の処理に進む。
(Step S103) The determination unit 241 sets trig = 0. Thereafter, the process proceeds to step S104.
(Step S104) The determination unit 241 determines whether or not din (i) is “0”. If the determination unit 241 determines that din (i) is “0”, the process proceeds to step S105. Otherwise, the process proceeds to step S108.

(ステップS105)判定部241は、runz_cnt++とする。その後、ステップS106の処理に進む。
(ステップS106)判定部241は、iが「62」であるか否かを判定する。iが「62」であると判定部241が判定した場合にはステップS107の処理に進み、それ以外の場合にはステップS111の処理に進む。
(Step S105) The determination unit 241 sets runz_cnt ++. Thereafter, the process proceeds to step S106.
(Step S <b> 106) The determination unit 241 determines whether i is “62”. If the determination unit 241 determines that i is “62”, the process proceeds to step S107, and otherwise, the process proceeds to step S111.

(ステップS107)判定部241は、runz=EOBとする。また、判定部241は、runz_cnt=0とする。また、判定部241はtrig=1とする。これにより、trigが「1」となったため、判定部241は、runzと、groupと、valueと、trigとを符号化部242に出力する。その後、ステップS111の処理に進む。   (Step S107) The determination unit 241 sets runz = EOB. The determination unit 241 sets runz_cnt = 0. The determination unit 241 sets trig = 1. As a result, trig becomes “1”, so the determination unit 241 outputs runz, group, value, and trig to the encoding unit 242. Thereafter, the process proceeds to step S111.

(ステップS108)判定部241は、runz=runz_cntとする。その後、判定部241は、runz_cnt=0とする。その後、ステップS109の処理に進む。
(ステップS109)判定部241は、groupを、din(i)で一意に特定されるgroupとする。また、判定部241は、value=din(i)とする。その後、ステップS110の処理に進む。
(Step S108) The determination unit 241 sets runz = runz_cnt. Thereafter, the determination unit 241 sets runz_cnt = 0. Thereafter, the process proceeds to step S109.
(Step S109) The determination unit 241 sets the group to a group uniquely specified by din (i). Further, the determination unit 241 sets value = din (i). Thereafter, the process proceeds to step S110.

(ステップS110)判定部241は、trig=1とする。これにより、trigが「1」となったため、判定部241は、runzと、groupと、valueと、trigとを符号化部242に出力する。その後、ステップS111の処理に進む。
(ステップS111)判定部241は、ステップS102の処理に戻る。
(Step S110) The determination unit 241 sets trig = 1. As a result, trig becomes “1”, so the determination unit 241 outputs runz, group, value, and trig to the encoding unit 242. Thereafter, the process proceeds to step S111.
(Step S111) The determination unit 241 returns to the process of Step S102.

上述したステップS101〜ステップS111の処理により、判定部241は、1つの符号セット毎に、runzと、groupと、valueと、trigとを符号化部242に入力する。   Through the processing in steps S101 to S111 described above, the determination unit 241 inputs the runz, group, value, and trig to the encoding unit 242 for each code set.

次に、符号化部242の詳細な処理手順について説明する。図9は、本実施形態における符号化部242の処理手順を示したフローチャートである。符号化部242は、判定部241からtrigが入力される毎に、以下のステップS201〜204の処理を実行する。
(ステップS201)符号化部242は、入力されたtrigが「1」であるか否かを判定する。入力されたtrigが「1」であると符号化部242が判定した場合にはステップS202の処理に進み、それ以外の場合には処理を終了する。
Next, a detailed processing procedure of the encoding unit 242 will be described. FIG. 9 is a flowchart showing a processing procedure of the encoding unit 242 in the present embodiment. The encoding unit 242 performs the following processes of steps S201 to S204 every time a trigger is input from the determination unit 241.
(Step S201) The encoding unit 242 determines whether or not the input trig is “1”. If the encoding unit 242 determines that the input trig is “1”, the process proceeds to step S202. Otherwise, the process ends.

(ステップS202)符号化部242は、入力されたrunzを、記憶部23が記憶する一次元のハフマンテーブルHzを用いてハフマン符号化し、Hz[runz]を出力する。その後、ステップS203の処理に進む。
(ステップS203)符号化部242は、入力されたrunzが「EOB」では無いか否かを判定する。入力されたrunzが「EOB」では無いと符号化部242が判定した場合にはステップS204の処理に進み、それ以外の場合には処理を終了する。
(Step S202) The encoding unit 242 performs Huffman encoding on the input runz using the one-dimensional Huffman table Hz stored in the storage unit 23, and outputs Hz [runz]. Thereafter, the process proceeds to step S203.
(Step S203) The encoding unit 242 determines whether or not the input runz is “EOB”. If the encoding unit 242 determines that the input runz is not “EOB”, the process proceeds to step S204. Otherwise, the process ends.

(ステップS204)符号化部242は、入力されたgroupを、記憶部23が記憶する一次元のハフマンテーブルHgを用いてハフマン符号化し、Hg[group]を出力する。また、符号化部242は、入力されたgroupとvalueとに対応する付加ビットを算出して、value.encを出力する。その後、処理を終了する。   (Step S204) The encoding unit 242 performs Huffman coding on the input group using the one-dimensional Huffman table Hg stored in the storage unit 23, and outputs Hg [group]. Also, the encoding unit 242 calculates additional bits corresponding to the input group and value, and sets value. output enc. Thereafter, the process ends.

上述したステップS201〜ステップS204の処理により、符号化部242は、1つの符号セット毎に、runzと、groupと、valueとを、それぞれ一次元のハフマンテーブルを用いて符号化し、runzを符号化したHz[runz]と、groupを符号化したHg[group]と、付加ビットvalue.encとを出力する。   Through the processing in steps S201 to S204 described above, the encoding unit 242 encodes runz, group, and value using a one-dimensional Huffman table for each code set, and encodes runz. Hz [runz], Hg [group] encoding group, and additional bit value. enc is output.

次に、本実施形態におけるハフマン伸張化部52の構成について説明する。図10は、本実施形態におけるハフマン伸張化部52の構成を示したブロック図である。図示する例では、ハフマン伸張化部52は、復号化部521と出力部522(算出部)とを備えている。復号化部521は、入力された符号化データを復号化して、1つの符号セット毎に、runzとvalueを取得する。また、符号化部521は、取得した1セットのrunzとvalueとを出力部522に入力する。出力部522は、入力された1セットのrunzとvalueとに基づいて、1セット分の符号化対象データを算出して出力する。また、出力部522は、1セット分の符号化対象データを出力した後、trigを復号化部521に入力する。復号化部521は、trigが入力されると、次の符号セットのrunzとvalueを取得し、出力部522に入力する。復号化部521と出力部522とが上記の処理を繰り返すことで、ハフマン伸張化部52は、符号化された符号化対象データを復号化する。   Next, the configuration of the Huffman decompression unit 52 in this embodiment will be described. FIG. 10 is a block diagram showing a configuration of the Huffman decompression unit 52 in the present embodiment. In the illustrated example, the Huffman decompression unit 52 includes a decoding unit 521 and an output unit 522 (calculation unit). The decoding unit 521 decodes the input encoded data, and obtains runz and value for each code set. Also, the encoding unit 521 inputs the acquired one set of runz and value to the output unit 522. The output unit 522 calculates and outputs one set of encoding target data based on the input set of runz and value. Also, the output unit 522 outputs trig to the decoding unit 521 after outputting the encoding target data for one set. When the trig is input, the decoding unit 521 acquires the runz and value of the next code set and inputs them to the output unit 522. When the decoding unit 521 and the output unit 522 repeat the above processing, the Huffman decompression unit 52 decodes the encoded data to be encoded.

次に、復号化部521の詳細な処理手順について説明する。図11は、本実施形態における復号化部521の処理手順を示したフローチャートである。   Next, a detailed processing procedure of the decoding unit 521 will be described. FIG. 11 is a flowchart showing a processing procedure of the decoding unit 521 in the present embodiment.

(ステップS301)復号化部521は、num<63であればステップS302〜ステップS306の処理を実行し、それ以外の場合には処理を終了する。なお、numの初期値は0である。また、2回目以降のステップS301の処理は、出力部522からtrigが入力された場合に実行する。   (Step S301) If num <63, the decoding unit 521 executes the processing of steps S302 to S306, and otherwise ends the processing. Note that the initial value of num is 0. Further, the process of step S301 after the second time is executed when a trigger is input from the output unit 522.

(ステップS302)復号化部521は、Hz[runz]を、記憶部51が記憶する一次元のハフマンテーブルHzを用いて復号化する。また復号化部521は、runzを、復号化したHz[runz]の値とする。そして、復号化部521は、runzを出力部522に入力する。その後、ステップS303の処理に進む。
(ステップS303)復号化部521は、runzが「EOB」では無いか否かを判定する。runzが「EOB」では無いと符号化部521が判定した場合にはステップS304の処理に進み、それ以外の場合にはステップS305の処理に進む。
(Step S302) The decoding unit 521 decodes Hz [runz] using the one-dimensional Huffman table Hz stored in the storage unit 51. Also, the decoding unit 521 sets runz as the decoded value of Hz [runz]. Then, the decoding unit 521 inputs runz to the output unit 522. Thereafter, the process proceeds to step S303.
(Step S303) The decryption unit 521 determines whether or not the runz is “EOB”. If the encoding unit 521 determines that the runz is not “EOB”, the process proceeds to step S304. Otherwise, the process proceeds to step S305.

(ステップS304)復号化部521は、num=runz+1とする。また、復号化部521は、Hg[group]を、記憶部51が記憶する一次元のハフマンテーブルHgを用いて復号化する。また、復号化部521は、groupを、復号化したHg[group]の値とする。また、復号化部521は、groupと付加ビットvalue.encとに基づいて、valueを算出する。また、復号化部521は、value[j]を、算出したvalueの値とする。そして、復号化部521は、value[j]を出力部522に入力する。その後、ステップS306の処理に進む。   (Step S304) The decoding unit 521 sets num = runz + 1. Also, the decoding unit 521 decodes Hg [group] using the one-dimensional Huffman table Hg stored in the storage unit 51. Also, the decryption unit 521 sets the group to the decrypted value of Hg [group]. The decoding unit 521 also includes a group and an additional bit value. Based on enc, value is calculated. In addition, the decoding unit 521 sets value [j] as the calculated value value. Then, the decoding unit 521 inputs value [j] to the output unit 522. Thereafter, the process proceeds to step S306.

(ステップS305)復号化部521は、num=63とする。その後、ステップS306の処理に進む。
(ステップS306)復号化部521は、ステップS301の処理に戻る。
(Step S305) The decoding unit 521 sets num = 63. Thereafter, the process proceeds to step S306.
(Step S306) The decoding unit 521 returns to the process of Step S301.

上述したステップS301〜ステップS306の処理により、復号化部521は、1つの符号セット毎に、Hz[runz]と、Hg[group]と、value.encとを、それぞれ一次元のハフマンテーブルを用いて復号化し、runzとvalue[j]とを出力部522に入力する。   Through the processing in steps S301 to S306 described above, the decoding unit 521 performs Hz [runz], Hg [group], value. enc is decoded using a one-dimensional Huffman table, and runz and value [j] are input to the output unit 522.

次に、出力部522の詳細な処理手順について説明する。図12は、本実施形態における出力部522の処理手順を示したフローチャートである。
(ステップS401)出力部522は、各変数の値を「0」に初期化する。その後、ステップS402の処理に進む。
(ステップS402)出力部522は、i<63であればステップS403〜ステップS411の処理を実行し、それ以外の場合にはステップS412の処理に進む。
Next, a detailed processing procedure of the output unit 522 will be described. FIG. 12 is a flowchart illustrating a processing procedure of the output unit 522 in the present embodiment.
(Step S401) The output unit 522 initializes the value of each variable to “0”. Thereafter, the process proceeds to step S402.
(Step S402) If i <63, the output unit 522 executes the processing of steps S403 to S411, and otherwise proceeds to the processing of step S412.

(ステップS403)出力部522は、z_num=runz[k]とする。また、出力部522は、k++とする。その後、ステップS404の処理に進む。
(ステップS404)出力部522は、z_numが「EOB」では無いか否かを判定する。z_numが「EOB」では無いと出力部522が判定した場合にはステップS405の処理に進み、それ以外の場合にはステップS406の処理に進む。
(Step S403) The output unit 522 sets z_num = runz [k]. Further, the output unit 522 is assumed to be k ++. Thereafter, the process proceeds to step S404.
(Step S <b> 404) The output unit 522 determines whether z_num is not “EOB”. If the output unit 522 determines that z_num is not “EOB”, the process proceeds to step S405. Otherwise, the process proceeds to step S406.

(ステップS405)出力部522は、j=0とする。また、出力部522は、n=z_numとする。また、出力部522は、i=i+nとする。その後、ステップS407の処理に進む。
(ステップS406)出力部522は、j=iとする。また、出力部522は、n=63とする。また、出力部522は、i=63とする。その後、ステップS407の処理に進む。
(Step S405) The output unit 522 sets j = 0. The output unit 522 sets n = z_num. Further, the output unit 522 sets i = i + n. Thereafter, the process proceeds to step S407.
(Step S406) The output unit 522 sets j = i. The output unit 522 sets n = 63. Further, the output unit 522 sets i = 63. Thereafter, the process proceeds to step S407.

(ステップS407)出力部522は、j<nであれば、「0」を出力してステップS408の処理に進み、それ以外の場合にはステップS409の処理に進む。
(ステップS408)出力部522は、j++とした後、ステップS407の処理に戻る。
(Step S407) If j <n, the output unit 522 outputs “0” and proceeds to the process of step S408, and otherwise proceeds to the process of step S409.
(Step S408) The output unit 522 returns to the process of step S407 after setting j ++.

(ステップS409)出力部522は、i<63であるか否かを判定する。i<63であると出力部522が判定した場合にはステップS410の処理に進み、それ以外の場合にはステップS411の処理に進む。
(ステップS410)出力部522は、i++とする。また、出力部522は、value[m]を出力する。また、出力部522は、m++とする。その後、ステップS411の処理に進む。
(ステップS411)出力部522は、ステップS402の処理に戻る。
(Step S409) The output unit 522 determines whether i <63. If the output unit 522 determines that i <63, the process proceeds to step S410; otherwise, the process proceeds to step S411.
(Step S410) The output unit 522 sets i ++. The output unit 522 outputs value [m]. The output unit 522 is m ++. Thereafter, the process proceeds to step S411.
(Step S411) The output unit 522 returns to the process of step S402.

(ステップS412)出力部522は、trig=1とする。これにより、出力部522は、trigを復号化部521に入力する。その後、処理を終了する。   (Step S412) The output unit 522 sets trig = 1. As a result, the output unit 522 inputs trig to the decoding unit 521. Thereafter, the process ends.

上述したステップS401〜ステップS409の処理により、出力部522は、1つの符号セット毎に、符号化対象データを出力する。   Through the processing in steps S401 to S409 described above, the output unit 522 outputs the encoding target data for each code set.

上述したとおり、本実施形態によれば、1次元のハフマンテーブルを用いて符号化および復号化を行うため、2次元のハフマンテーブルを用いて符号化および復号化を行うよりも符号種類が少なくなる。例えば、ハフマン木はデータの出現確率に依存しているため、最大ビット長の計算は行えないが、JPEG画像では、データの出現確率が16bitにおさまるような確率分布に決めたと考えられる。これを前提とすると、JPEG画像の量子化後のデータが12bitの場合の符号種類(テーブル数)は次のようになる。
JPEG画像 : 16×12=196
本実施形態 : 64+12=76
(runz:64 group:12)
このように、JPEGでは入力データのビット幅が増えることで出現確率が高いものでも短い符号が割り当てられなくなる。しかし、本実施形態では1次元テーブルを用いた符号化の結果を連結しているため、各符号種類の数が最大ビットに影響する。
このように、符号種類が少なくなると、ハフマン符号化後の最大ビット長も短くなる。また、本実施形態のデータ圧縮および復号システム1は、固定長データを送受信する通信方式でデータの送受信を行うため、送信するデータの最大長を固定長と定め、送信するデータ長が長くても短くても、毎回固定長のデータを送受信する。しかしながら、本実施形態では、ハフマン符号化後の最大ビット長が短くなるため、固定長を短くすることができ、通信効率を向上することができる。
As described above, according to the present embodiment, since encoding and decoding are performed using a one-dimensional Huffman table, there are fewer types of codes than when encoding and decoding are performed using a two-dimensional Huffman table. . For example, since the Huffman tree depends on the appearance probability of data, the maximum bit length cannot be calculated. However, in a JPEG image, it is considered that the probability distribution is such that the appearance probability of data falls within 16 bits. Assuming this, the code type (number of tables) when the data after quantization of the JPEG image is 12 bits is as follows.
JPEG image: 16 × 12 = 196
This embodiment: 64 + 12 = 76
(Runz: 64 group: 12)
Thus, in JPEG, a short code cannot be assigned even if the appearance probability is high due to an increase in the bit width of input data. However, in this embodiment, the result of encoding using a one-dimensional table is connected, so the number of each code type affects the maximum bit.
Thus, when the code type decreases, the maximum bit length after Huffman encoding also decreases. In addition, since the data compression and decoding system 1 according to the present embodiment transmits and receives data using a communication method for transmitting and receiving fixed-length data, the maximum length of data to be transmitted is determined as a fixed length, and even if the data length to be transmitted is long Send and receive fixed-length data every time, even if it is short. However, in this embodiment, since the maximum bit length after Huffman coding is shortened, the fixed length can be shortened, and communication efficiency can be improved.

(第2の実施形態)
以下、本発明の第2の実施形態について図面を参照して説明する。本実施形態と第1の実施形態と異なる点は、本実施形態では、ゼロランレングスだけではなくバリューランレングスも用いる点である。なお、本実施形態におけるデータ圧縮および復号システム1の構成は、第1の実施形態における各構成と同様の構成である。
(Second Embodiment)
Hereinafter, a second embodiment of the present invention will be described with reference to the drawings. The difference between this embodiment and the first embodiment is that not only zero run length but also value run length is used in this embodiment. Note that the configuration of the data compression and decoding system 1 in the present embodiment is the same as each configuration in the first embodiment.

次に、本実施形態のハフマン符号化部24における符号化方法について説明する。以下、ハフマン符号化部24に入力される周波数成分のうち、AC成分(符号化対象データ)「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」を符号化する例を用いて説明する。   Next, the encoding method in the Huffman encoder 24 of this embodiment will be described. Hereinafter, among the frequency components input to the Huffman encoding unit 24, the AC component (encoding target data) “5,0,0,0,3,0,0,1,2,0,0,4,0 , 6,... "Will be described using an example of encoding.

初めに、ハフマン符号化部24は、ゼロランレングス符号化を行う。具体的には、符号化対象データにおいて「0」が連続する数を算出し、「0」が連続する数と、「0」以外の値とで符号化対象データを表す。以下、「0」が連続する数を示すデータをrunzとする。また「0」以外の値を示すデータをvalueとする。なお、本実施形態では第1の実施形態とは異なり、「0」以外の値が連続する場合、この間の「0」が連続する数については考慮しない。   First, the Huffman encoding unit 24 performs zero run length encoding. Specifically, the number of consecutive “0” s in the encoding target data is calculated, and the encoding target data is represented by the number of consecutive “0” s and a value other than “0”. Hereinafter, data indicating the number of consecutive “0” s is referred to as runz. Data indicating a value other than “0” is set to value. In this embodiment, unlike the first embodiment, when values other than “0” are consecutive, the number of consecutive “0” s is not considered.

図13は、ゼロランレングス符号化の具体例を示した説明図である。図示する例では、符号化対象データは「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」である。図示する符号化対象データの先頭の値は「5」であるため、「0」が連続する数は「0」個である。また、符号化対象データ「5」の後の値は「0,0,0,3」であるため、「0」が連続する数は「3」個である。また、符号化対象データ「3」の後の値は「0,0,1」であるため、「0」が連続する数は「2」個である。また、符号化対象データ「1」の後の値は「2」であるが、本実施形態では「0」以外の値が連続する場合、この間の「0」が連続する数については考慮しない。また、符号化対象データ「2」の後の値は「0,0,4」であるため、「0」が連続する数は「2」個である。以下、同様に「0」が連続する数を算出すると、runzは「0」「3」「2」「2」「1」・・・となる。また、「0」以外の値(value)は、「5」「3」「1,2」「4」「6」・・・となる。   FIG. 13 is an explanatory diagram showing a specific example of zero-run length encoding. In the illustrated example, the data to be encoded is “5, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 4, 0, 6,. Since the leading value of the encoding target data shown in the figure is “5”, the number of consecutive “0” s is “0”. Since the value after the encoding target data “5” is “0, 0, 0, 3”, the number of consecutive “0” s is “3”. Further, since the value after the encoding target data “3” is “0, 0, 1”, the number of consecutive “0” is “2”. Further, the value after the encoding target data “1” is “2”. However, in this embodiment, when values other than “0” continue, the number of consecutive “0” s between them is not considered. Since the value after the encoding target data “2” is “0, 0, 4”, the number of consecutive “0” s is “2”. Hereinafter, similarly, when the number of consecutive “0” s is calculated, runz becomes “0” “3” “2” “2” “1”. Further, values (values) other than “0” are “5”, “3”, “1, 2”, “4”, “6”,.

次に、ハフマン符号化部24は、バリューランレングス符号化を行う。具体的には、符号化対象データにおいて、「0」以外の値が連続する数を算出する。以下、「0」以外の値が連続する数を示すデータをrunvとする。   Next, the Huffman encoder 24 performs value run length encoding. Specifically, the number of consecutive values other than “0” in the encoding target data is calculated. Hereinafter, data indicating the number of consecutive values other than “0” is referred to as runv.

図14は、バリューランレングス符号化の具体例を示した説明図である。図示する例では、符号化対象データは「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」である。図示する符号化対象データの先頭の値は「5」であり、その後の値が「0」であるため、「0」以外の値が連続する数は「1」個である。また、符号化対象データ「5」の後の値は「0,0,0,3,0」であるため、「0」以外の値が連続する数は「1」個である。また、符号化対象データ「3」の後の値は「0,0,1,2,0」であるため、「0」以外の値が連続する数は「2」個である。また、符号化対象データ「2」の後の値は「0,0,4,0」であるため、「0」以外の値が連続する数は「1」個である。また、符号化対象データ「4」の後の値は「0,6,・・・」であるため、「0」以外の値が連続する数は「1」個である。以下、同様に「0」以外の数が連続する数を算出すると、runvは「1」「1」「2」「1」「1」・・・となる。   FIG. 14 is an explanatory diagram showing a specific example of value run length encoding. In the illustrated example, the data to be encoded is “5, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 4, 0, 6,. Since the leading value of the encoding target data shown in the figure is “5” and the subsequent value is “0”, the number of consecutive values other than “0” is “1”. Further, since the value after the encoding target data “5” is “0, 0, 0, 3, 0”, the number of consecutive values other than “0” is “1”. Further, since the value after the encoding target data “3” is “0, 0, 1, 2, 0”, the number of consecutive values other than “0” is “2”. Also, since the value after the encoding target data “2” is “0, 0, 4, 0”, the number of consecutive values other than “0” is “1”. Since the value after the encoding target data “4” is “0, 6,...”, The number of consecutive values other than “0” is “1”. Similarly, when the number of consecutive numbers other than “0” is calculated similarly, runv becomes “1” “1” “2” “1” “1”.

次に、ハフマン符号化部24は、valueを特定するgroupと付加ビットとを算出する。valueが「5」「3」「1,2」「4」「6」・・・である場合、groupは「3」「2」「1,2」「3」「3」・・・となる。また、このときの付加ビット長は「3」「2」「1,2」「3」「3」・・・となる。   Next, the Huffman encoding unit 24 calculates a group specifying the value and an additional bit. When the value is “5” “3” “1, 2” “4” “6”..., the group becomes “3” “2” “1, 2” “3” “3”. . Further, the additional bit length at this time is “3” “2” “1, 2” “3” “3”.

図15は、符号化対象データ「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」のrunzと、runvと、valueと、groupとの値を纏めた概略図である。図示する例では、runzと、runvと、valueと、groupとの値が、行の上から順に記載されている。例えば、行201には、runz「0」と、runv「1」と、value「5」と、group「3」とが記載されている。また、行202には、runz「3」と、runv「1」と、value「3」と、group「2」とが記載されている。また、行203には、runz「2」と、runv「2」と、value「1,2」と、group「1,2」とが記載されている。他の行については図示するとおりである。なお、各行のデータを1つの符号セットとする。   FIG. 15 shows the runz, runv, and value of the encoding target data “5,0,0,0,3,0,0,1,2,0,0,4,0,6,. It is the schematic which summarized the value with, group. In the illustrated example, values of runz, runv, value, and group are described in order from the top of the line. For example, in the row 201, runz “0”, runv “1”, value “5”, and group “3” are described. In line 202, runz “3”, runv “1”, value “3”, and group “2” are described. In line 203, runz “2”, runv “2”, value “1,2”, and group “1,2” are described. The other rows are as illustrated. Note that the data of each row is one code set.

次に、ハフマン符号化部24は、1つの符号セット毎に、runzと、runvと、groupと、valueとを、それぞれ1次元の符号化テーブルを用いて符号化する。なお、runzの符号化に用いるハフマンテーブル(第1のハフマンテーブル)をHzとする。また、runvの符号化に用いるハフマンテーブル(第3のハフマンテーブルをHvとする。また、groupの符号化に用いるハフマンテーブル(第2のハフマンテーブルをHgとする。これにより、1つの符号セットをハフマン符号化したデータは、Hz[runz]+Hv[runv]+Hg[group]+value.encとなる。value.encは付加ビットである。なお、符号化されたものに対して、接尾に.encを付加している。   Next, the Huffman encoder 24 encodes runz, runv, group, and value for each code set using a one-dimensional encoding table. It is assumed that the Huffman table (first Huffman table) used for the runz encoding is Hz. Also, a Huffman table used for coding the runv (the third Huffman table is Hv. Also, a Huffman table used for the group coding (the second Huffman table is Hg. This makes one code set. The Huffman encoded data is Hz [runz] + Hv [runv] + Hg [group] + value.enc, where value.enc is an additional bit, where .enc is the suffix for the encoded data. It is added.

次に、本実施形態のハフマン符号化部24の構成について説明する。図16は、本実施形態のハフマン符号化部24の構成を示したブロック図である。図示する例では、ハフマン符号化部24は、入力部240と、判定部241と、符号化部242とを備えている。また、判定部241は、記憶部2410(value記憶部、runz記憶部、runv記憶部)を備えている。判定部241は、入力された符号化対象データを判定し、trigと、1セットのrunzと、runvと、groupと、valueとを記憶部2410に記憶させる。また、判定部241は、記憶部2410に記憶させたtrigと、1セットのrunzと、runvと、groupと、valueとを符号化部242に入力する。符号化部242は、trigが入力されると、trigとともに入力された、1セットのrunzと、runvと、groupと、valueとを1次元ハフマンテーブルを用いて符号化する。そして、符号化部242は、符号化した1セットのデータを出力する。符号化部242はtrigが入力される毎にこの処理を行う。このような手順により、ハフマン符号化部24は、符号化対象データの符号化を行う。   Next, the configuration of the Huffman encoding unit 24 of this embodiment will be described. FIG. 16 is a block diagram showing a configuration of the Huffman encoder 24 of the present embodiment. In the illustrated example, the Huffman encoding unit 24 includes an input unit 240, a determination unit 241, and an encoding unit 242. The determination unit 241 includes a storage unit 2410 (value storage unit, runz storage unit, runv storage unit). The determination unit 241 determines the input encoding target data, and causes the storage unit 2410 to store trig, one set of runz, runv, group, and value. Also, the determination unit 241 inputs the trig stored in the storage unit 2410, one set of runz, runv, group, and value to the encoding unit 242. When trig is input, the encoding unit 242 encodes a set of runz, runv, group, and value input together with the trig using a one-dimensional Huffman table. Then, the encoding unit 242 outputs one set of encoded data. The encoding unit 242 performs this process each time trig is input. By such a procedure, the Huffman encoder 24 encodes the encoding target data.

次に、判定部241の詳細な処理手順について説明する。図17は、本実施形態における判定部241の処理手順を示したフローチャートである。
(ステップS501)判定部241は、trig_tmp以外の変数の値を「0」に初期化する。その後、ステップS502の処理に進む。
Next, a detailed processing procedure of the determination unit 241 will be described. FIG. 17 is a flowchart illustrating a processing procedure of the determination unit 241 in the present embodiment.
(Step S501) The determination unit 241 initializes the values of variables other than trig_tmp to “0”. Thereafter, the process proceeds to step S502.

(ステップS502)判定部241は、i<63であれば、i++とした後にステップS503〜ステップS520の処理を実行する。また、判定部241は、i<63でなければ処理を終了する。なお、符号化対象データであるAC成分は63個であるため、判定部241は、ステップS503〜ステップS520の処理を63回繰り返す。すなわち、ステップS503〜ステップS520の処理の実行回数が63回未満である場合にはステップS503の処理に進み、それ以外の場合には処理を終了する。   (Step S502) If it is i <63, the determination part 241 will perform the process of step S503-step S520 after setting it as i ++. Further, the determination unit 241 ends the process unless i <63. Since there are 63 AC components that are data to be encoded, the determination unit 241 repeats the processing from step S503 to step S520 63 times. That is, if the number of executions of steps S503 to S520 is less than 63, the process proceeds to step S503, and otherwise the process ends.

(ステップS503)判定部241は、trig=0とする。その後、ステップS504の処理に進む。
(ステップS504)判定部241は、trig_tmpが「1」であるか否かを判定する。trig_tmpが「1」であると判定部241が判定した場合にはステップS505の処理に進み、それ以外の場合にはステップS506の処理に進む。
(Step S503) The determination unit 241 sets trig = 0. Thereafter, the process proceeds to step S504.
(Step S504) The determination unit 241 determines whether or not trig_tmp is “1”. If the determination unit 241 determines that trig_tmp is “1”, the process proceeds to step S505; otherwise, the process proceeds to step S506.

(ステップS505)判定部241は、runz=EOBとする。また、判定部241は、runz_cnt=0とする。また、判定部241は、trig_tmp=0とする。また、判定部241はtrig=1とする。これにより、trigが「1」となったため、判定部241は、runzと、runvと、groupと、valueと、trigとを符号化部242に出力する。その後、ステップS506の処理に進む。
(ステップS506)判定部241は、din(i)が「0」であるか否かを判定する。din(i)が「0」であると判定部241が判定した場合にはステップS507の処理に進み、それ以外の場合にはステップS514の処理に進む。
(Step S505) The determination unit 241 sets runz = EOB. The determination unit 241 sets runz_cnt = 0. The determination unit 241 sets trig_tmp = 0. The determination unit 241 sets trig = 1. As a result, trig becomes “1”, so the determination unit 241 outputs runz, runv, group, value, and trig to the encoding unit 242. Thereafter, the process proceeds to step S506.
(Step S506) The determination unit 241 determines whether or not din (i) is “0”. If the determining unit 241 determines that din (i) is “0”, the process proceeds to step S507. Otherwise, the process proceeds to step S514.

(ステップS507)判定部241は、iが「0」ではなく、かつ、runv_cntが「0」ではないか否かを判定する。iが「0」ではなく、かつ、runv_cntが「0」ではないと判定部241が判定した場合にはステップS508の処理に進み、それ以外の場合にはステップS509の処理に進む。
(ステップS508)判定部241は、runv=runv_cntとする。また、判定部241は、runv_cnt=0とする。また、判定部241はtrig=1とする。これにより、trigが「1」となったため、判定部241は、runzと、runvと、groupと、valueと、trigとを符号化部242に出力する。その後、ステップS509の処理に進む。
(Step S507) The determination unit 241 determines whether i is not “0” and the runv_cnt is not “0”. If i is not “0” and the determination unit 241 determines that runv_cnt is not “0”, the process proceeds to step S508. Otherwise, the process proceeds to step S509.
(Step S508) The determination unit 241 sets runv = runv_cnt. The determination unit 241 sets runv_cnt = 0. The determination unit 241 sets trig = 1. As a result, trig becomes “1”, so the determination unit 241 outputs runz, runv, group, value, and trig to the encoding unit 242. Thereafter, the process proceeds to step S509.

(ステップS509)判定部241は、Runz_cnt++とする。その後、ステップS510の処理に進む。
(ステップS510)判定部241は、iが「62」であるか否かを判定する。iが「62」であると判定部241が判定した場合にはステップS511の処理に進み、それ以外の場合にはステップS520の処理に進む。すなわち、判定部241は、din(i)が最終データであるか否かを判定し、din(i)が最終データであると判定した場合にはステップS511の処理に進み、それ以外の場合にはステップS520の処理に進む。
(Step S509) The determination unit 241 sets Runz_cnt ++. Thereafter, the process proceeds to step S510.
(Step S <b> 510) The determination unit 241 determines whether i is “62”. If the determination unit 241 determines that i is “62”, the process proceeds to step S511. Otherwise, the process proceeds to step S520. That is, the determination unit 241 determines whether or not din (i) is the final data. If it is determined that din (i) is the final data, the process proceeds to step S511. Advances to the process of step S520.

(ステップS511)判定部241は、trigが「0」であるか否かを判定する。trigが「0」であると判定部241が判定した場合にはステップS512の処理に進み、それ以外の場合にはステップS513の処理に進む。
(ステップS512)判定部241は、runz=EOBとする。また、判定部241は、runz_cnt=0とする。また、判定部241は、trig=1とする。これにより、trigが「1」となったため、判定部241は、runzと、runvと、groupと、valueと、trigとを符号化部242に出力する。その後、ステップS520の処理に進む。
(ステップS513)判定部241は、runz_cnt=0とする。また、判定部241は、trig_tmp=1とする。その後、ステップS520の処理に進む。
(Step S511) The determination unit 241 determines whether or not trig is “0”. If the determination unit 241 determines that trig is “0”, the process proceeds to step S512. Otherwise, the process proceeds to step S513.
(Step S512) The determination unit 241 sets runz = EOB. The determination unit 241 sets runz_cnt = 0. The determination unit 241 sets trig = 1. As a result, trig becomes “1”, so the determination unit 241 outputs runz, runv, group, value, and trig to the encoding unit 242. Thereafter, the process proceeds to step S520.
(Step S513) The determination unit 241 sets runz_cnt = 0. The determination unit 241 sets trig_tmp = 1. Thereafter, the process proceeds to step S520.

(ステップS514)判定部241は、runv_cntが「0」であるか否かを判定する。runv_cntが「0」であると判定部241が判定した場合にはステップS515の処理に進み、それ以外の場合にはステップS516の処理に進む。
(ステップS515)判定部241は、runz=runz_cntとする。また、判定部241は、runz_cnt=0とする。その後、ステップS516の処理に進む。
(Step S514) The determination unit 241 determines whether or not runv_cnt is “0”. If the determination unit 241 determines that runv_cnt is “0”, the process proceeds to step S515; otherwise, the process proceeds to step S516.
(Step S515) The determination unit 241 sets runz = runz_cnt. The determination unit 241 sets runz_cnt = 0. Thereafter, the process proceeds to step S516.

(ステップS516)判定部241は、group[runv_cnt]を、din(i)で一意に特定されるgroupとする。また、判定部241は、value[runv_cnt]=din(i)とする。その後、ステップS517の処理に進む。
(ステップS517)判定部241は、runv_cnt++とする。その後、ステップS518の処理に進む。
(ステップS518)判定部241は、iが「62」であるか否かを判定する。iが「62」であると判定部241が判定した場合にはステップS519の処理に進み、それ以外の場合にはステップS520の処理に進む。すなわち、判定部241は、din(i)が最終データであるか否かを判定し、din(i)が最終データであると判定した場合にはステップS519の処理に進み、それ以外の場合にはステップS520の処理に進む。
(Step S516) The determination unit 241 sets group [runv_cnt] as a group uniquely specified by din (i). Further, the determination unit 241 sets value [runv_cnt] = din (i). Thereafter, the process proceeds to step S517.
(Step S517) The determination unit 241 sets runv_cnt ++. Thereafter, the process proceeds to step S518.
(Step S518) The determination unit 241 determines whether i is “62”. If the determination unit 241 determines that i is “62”, the process proceeds to step S519. Otherwise, the process proceeds to step S520. That is, the determination unit 241 determines whether or not din (i) is final data. If it is determined that din (i) is final data, the process proceeds to step S519; Advances to the process of step S520.

(ステップS519)判定部241は、runv=runv_cntとする。また、判定部241は、runv_cnt=0とする。また、判定部241は、trig=1とする。これにより、trigが「1」となったため、判定部241は、runzと、runvと、groupと、valueと、trigとを符号化部242に出力する。その後、ステップS520の処理に進む。
(ステップS520)判定部241は、ステップS502の処理に戻る。
(Step S519) The determination unit 241 sets runv = runv_cnt. The determination unit 241 sets runv_cnt = 0. The determination unit 241 sets trig = 1. As a result, trig becomes “1”, so the determination unit 241 outputs runz, runv, group, value, and trig to the encoding unit 242. Thereafter, the process proceeds to step S520.
(Step S520) The determination unit 241 returns to the process of Step S502.

上述したステップS501〜ステップS520の処理により、判定部241は、1つの符号セット毎に、runzと、runvと、groupと、valueと、trigとを符号化部242に入力する。   Through the processing in steps S501 to S520 described above, the determination unit 241 inputs runz, runv, group, value, and trig to the encoding unit 242 for each code set.

次に、符号化部242の詳細な処理手順について説明する。図18は、本実施形態における符号化部242の処理手順を示したフローチャートである。符号化部242は、判定部241からtrigが入力される毎に、以下のステップS601〜607の処理を実行する。
(ステップS601)符号化部242は、入力されたtrigが「1」であるか否かを判定する。入力されたtrigが「1」であると符号化部242が判定した場合にはステップS602の処理に進み、それ以外の場合には処理を終了する。
Next, a detailed processing procedure of the encoding unit 242 will be described. FIG. 18 is a flowchart illustrating a processing procedure of the encoding unit 242 in the present embodiment. The encoding unit 242 executes the processes of the following steps S601 to 607 each time a trigger is input from the determination unit 241.
(Step S601) The encoding unit 242 determines whether or not the input trig is “1”. If the encoding unit 242 determines that the input trig is “1”, the process proceeds to step S602; otherwise, the process ends.

(ステップS602)符号化部242は、入力されたrunzを、記憶部23が記憶する一次元のハフマンテーブルHzを用いてハフマン符号化し、Hz[runz]を出力する。その後、ステップS603の処理に進む。
(ステップS603)符号化部242は、入力されたrunzが「EOB」では無いか否かを判定する。入力されたrunzが「EOB」では無いと符号化部242が判定した場合にはステップS604の処理に進み、それ以外の場合には処理を終了する。
(ステップS604)符号化部242は、入力されたrunvを、記憶部23が記憶する一次元のハフマンテーブルHvを用いてハフマン符号化し、Hv[runv]を出力する。その後、ステップS605の処理に進む。
(Step S602) The encoding unit 242 performs Huffman coding on the input runz using the one-dimensional Huffman table Hz stored in the storage unit 23, and outputs Hz [runz]. Thereafter, the process proceeds to step S603.
(Step S603) The encoding unit 242 determines whether or not the input runz is not “EOB”. If the encoding unit 242 determines that the input runz is not “EOB”, the process proceeds to step S604; otherwise, the process ends.
(Step S604) The encoding unit 242 performs Huffman coding on the input runv using the one-dimensional Huffman table Hv stored in the storage unit 23, and outputs Hv [runv]. Thereafter, the process proceeds to step S605.

(ステップS605)符号化部242は、j<runvであれば、j++とした後にステップS606の処理を実行する。また、符号化部242は、i<runvでなければ処理を終了する。なおjの初期値は0である。   (Step S605) If j <runv, the encoding unit 242 executes the process of step S606 after setting j ++. In addition, the encoding unit 242 ends the process unless i <runv. The initial value of j is 0.

(ステップS606)符号化部242は、入力されたgroup[j]を、記憶部23が記憶する一次元のハフマンテーブルHgを用いてハフマン符号化し、Hg[group[j]]を出力する。また、符号化部242は、入力されたgroup[j]とvalue[j]とに対応する付加ビットを算出して、value[j].encを出力する。その後、ステップS605の処理に戻る。   (Step S606) The encoding unit 242 performs Huffman coding on the input group [j] using the one-dimensional Huffman table Hg stored in the storage unit 23, and outputs Hg [group [j]]. Also, the encoding unit 242 calculates additional bits corresponding to the input group [j] and value [j], and sets value [j]. output enc. Thereafter, the process returns to step S605.

上述したステップS601〜ステップS606の処理により、符号化部242は、1つの符号セット毎に、runzと、group[j]と、value[j]とを、それぞれ一次元のハフマンテーブルを用いて符号化し、runzを符号化したHz[runz]と、groupを符号化したHg[group[j]]と、付加ビットvalue[j].encとを出力する。   Through the processing in steps S601 to S606 described above, the encoding unit 242 encodes runz, group [j], and value [j] using a one-dimensional Huffman table for each code set. Hz [runz] in which runz is encoded, Hg [group [j]] in which group is encoded, and additional bits value [j]. enc is output.

次に、本実施形態におけるハフマン伸張化部52の構成について説明する。図19は、本実施形態におけるハフマン伸張化部52の構成を示したブロック図である。図示する例では、ハフマン伸張化部52は、復号化部521と出力部522(算出部)とを備えている。復号化部521は、入力された符号化データを復号化して、1つの符号セット毎に、runzと、runvと、valueとを取得する。また、符号化部521は、取得した1セットのrunzと、runvと、valueとを出力部522に入力する。出力部522は、入力された1セットのrunzと、runvと、valueとに基づいて、1セット分の符号化対象データを算出して出力する。また、出力部522は、1セット分の符号化対象データを出力した後、trigを復号化部521に入力する。復号化部521は、trigが入力されると、次の符号セットのrunzと、runvと、valueを取得し、出力部522に入力する。復号化部521と出力部522とが上記の処理を繰り返すことで、ハフマン伸張化部52は、符号化された符号化対象データを復号化する。   Next, the configuration of the Huffman decompression unit 52 in this embodiment will be described. FIG. 19 is a block diagram showing a configuration of the Huffman decompression unit 52 in the present embodiment. In the illustrated example, the Huffman decompression unit 52 includes a decoding unit 521 and an output unit 522 (calculation unit). The decoding unit 521 decodes the input encoded data, and obtains runz, runv, and value for each code set. Also, the encoding unit 521 inputs the acquired set of runz, runv, and value to the output unit 522. The output unit 522 calculates and outputs one set of encoding target data based on the input set of runz, runv, and value. Also, the output unit 522 outputs trig to the decoding unit 521 after outputting the encoding target data for one set. When trig is input, the decoding unit 521 acquires runz, runv, and value of the next code set and inputs them to the output unit 522. When the decoding unit 521 and the output unit 522 repeat the above processing, the Huffman decompression unit 52 decodes the encoded data to be encoded.

次に、復号化部521の詳細な処理手順について説明する。図20は、本実施形態における復号化部521の処理手順を示したフローチャートである。   Next, a detailed processing procedure of the decoding unit 521 will be described. FIG. 20 is a flowchart showing a processing procedure of the decoding unit 521 in the present embodiment.

(ステップS701)復号化部521は、num<63であればステップS702〜ステップS708の処理を実行し、それ以外の場合には処理を終了する。なお、numの初期値は0である。また、2回目以降のステップS701の処理は、出力部522からtrigが入力された場合に実行する。   (Step S701) If num <63, the decoding unit 521 executes the processes of steps S702 to S708, and otherwise ends the process. Note that the initial value of num is 0. Further, the process of step S701 after the second time is executed when a trigger is input from the output unit 522.

(ステップS702)復号化部521は、Hz[runz]を、記憶部51が記憶する一次元のハフマンテーブルHzを用いて復号化する。また復号化部521は、runzを、復号化したHz[runz]の値とする。そして、復号化部521は、runzを出力部522に入力する。その後、ステップS703の処理に進む。
(ステップS703)復号化部521は、runzが「EOB」では無いか否かを判定する。runzが「EOB」では無いと符号化部521が判定した場合にはステップS704の処理に進み、それ以外の場合にはステップS707の処理に進む。
(Step S <b> 702) The decoding unit 521 decodes Hz [runz] using the one-dimensional Huffman table Hz stored in the storage unit 51. Also, the decoding unit 521 sets runz as the decoded value of Hz [runz]. Then, the decoding unit 521 inputs runz to the output unit 522. Thereafter, the process proceeds to step S703.
(Step S703) The decryption unit 521 determines whether or not the runz is “EOB”. If the encoding unit 521 determines that the runz is not “EOB”, the process proceeds to step S704. Otherwise, the process proceeds to step S707.

(ステップS704)復号化部521は、Hv[runv]を、記憶部51が記憶する一次元のハフマンテーブルHvを用いて復号化する。また復号化部521は、runvを、復号化したHv[runv]の値とする。そして、復号化部521は、runvを出力部522に入力する。また、復号化部521は、num=runz+runvとする。その後、ステップS705の処理に進む。   (Step S704) The decoding unit 521 decodes Hv [runv] using the one-dimensional Huffman table Hv stored in the storage unit 51. Also, the decoding unit 521 sets the runv as the value of the decoded Hv [runv]. Then, the decoding unit 521 inputs runv to the output unit 522. The decoding unit 521 sets num = runz + runv. Thereafter, the process proceeds to step S705.

(ステップS705)復号化部521は、j<runvであれば、j++とした後にステップS706の処理を実行する。また、復号化部521は、i<runvでなければステップS708の処理に進む。なおjの初期値は0である。   (Step S705) If j <runv, the decoding unit 521 performs the process of step S706 after setting j ++. If i <runv is not the case, the decoding unit 521 proceeds to the process of step S708. The initial value of j is 0.

(ステップS706)復号化部521は、Hg[group[j]]を、記憶部51が記憶する一次元のハフマンテーブルHgを用いて復号化する。また、復号化部521は、group[j]を、復号化したHg[group[j]]の値とする。また、復号化部521は、group[j]と付加ビットvalue[j].encとに基づいて、value[j]を算出する。そして、復号化部521は、value[j]を出力部522に入力する。その後、ステップS705の処理に戻る。
(ステップS707)復号化部521は、num=63とする。その後、ステップS708の処理に進む。
(ステップS708)復号化部521は、ステップS701の処理に戻る。
(Step S706) The decoding unit 521 decodes Hg [group [j]] using the one-dimensional Huffman table Hg stored in the storage unit 51. Also, the decoding unit 521 sets group [j] as the value of the decoded Hg [group [j]]. In addition, the decoding unit 521 uses group [j] and additional bits value [j]. Based on enc, value [j] is calculated. Then, the decoding unit 521 inputs value [j] to the output unit 522. Thereafter, the process returns to step S705.
(Step S707) The decoding unit 521 sets num = 63. Thereafter, the process proceeds to step S708.
(Step S708) The decoding unit 521 returns to the process of Step S701.

上述したステップS701〜ステップS708の処理により、復号化部521は、1つの符号セット毎に、Hz[runz]と、Hg[group[j]]と、value[j].encとを、それぞれ一次元のハフマンテーブルを用いて復号化し、runzとvalue[j]とを出力部522に入力する。   Through the processing in steps S701 to S708 described above, the decoding unit 521 performs Hz [runz], Hg [group [j]], value [j]. enc is decoded using a one-dimensional Huffman table, and runz and value [j] are input to the output unit 522.

次に、出力部522の詳細な処理手順について説明する。図21は、本実施形態における出力部522の処理手順を示したフローチャートである。
(ステップS801)出力部522は、各変数の値を「0」に初期化する。その後、ステップS802の処理に進む。
(ステップS802)出力部522は、i<63であればステップS803〜ステップS813の処理を実行し、それ以外の場合にはステップS815の処理に進む。
Next, a detailed processing procedure of the output unit 522 will be described. FIG. 21 is a flowchart showing the processing procedure of the output unit 522 in the present embodiment.
(Step S801) The output unit 522 initializes the value of each variable to “0”. Thereafter, the process proceeds to step S802.
(Step S802) If i <63, the output unit 522 executes the processing of step S803 to step S813, and otherwise proceeds to the processing of step S815.

(ステップS803)出力部522は、z_num=runz[k]とする。また、出力部522は、k++とする。その後、ステップS804の処理に進む。
(ステップS804)出力部522は、z_numが「EOB」では無いか否かを判定する。z_numが「EOB」では無いと出力部522が判定した場合にはステップS805の処理に進み、それ以外の場合にはステップS806の処理に進む。
(Step S803) The output unit 522 sets z_num = runz [k]. Further, the output unit 522 is assumed to be k ++. Thereafter, the process proceeds to step S804.
(Step S804) The output unit 522 determines whether z_num is not “EOB”. If the output unit 522 determines that z_num is not “EOB”, the process proceeds to step S805; otherwise, the process proceeds to step S806.

(ステップS805)出力部522は、j=0とする。また、出力部522は、n=z_numとする。また、出力部522は、i=i+nとする。その後、ステップS807の処理に進む。
(ステップS806)出力部522は、j=iとする。また、出力部522は、n=63とする。また、出力部522は、i=63とする。その後、ステップS807の処理に進む。
(Step S805) The output unit 522 sets j = 0. The output unit 522 sets n = z_num. Further, the output unit 522 sets i = i + n. Thereafter, the process proceeds to step S807.
(Step S806) The output unit 522 sets j = i. The output unit 522 sets n = 63. Further, the output unit 522 sets i = 63. Thereafter, the process proceeds to step S807.

(ステップS807)出力部522は、j<nであれば、「0」を出力してステップS808の処理に進み、それ以外の場合にはステップS809の処理に進む。
(ステップS808)出力部522は、j++とした後、ステップS807の処理に戻る。
(Step S807) If j <n, the output unit 522 outputs “0” and proceeds to the process of step S808, and otherwise proceeds to the process of step S809.
(Step S808) After setting j ++, the output part 522 returns to the process of step S807.

(ステップS809)出力部522は、i<63であるか否かを判定する。i<63であると出力部522が判定した場合にはステップS810の処理に進み、それ以外の場合にはステップS814の処理に進む。
(ステップS810)出力部522は、v_num=runv[l]とする。また、出力部522は、l++とする。また、出力部522は、i=i+v_numとする。その後、ステップS811の処理に進む。
(Step S809) The output unit 522 determines whether i <63. If the output unit 522 determines that i <63, the process proceeds to step S810; otherwise, the process proceeds to step S814.
(Step S810) The output unit 522 sets v_num = runv [l]. The output unit 522 is assumed to be l ++. The output unit 522 sets i = i + v_num. Thereafter, the process proceeds to step S811.

(ステップS811)出力部522は、j<v_numであれば、j++とした後にステップS812の処理を実行する。また、出力部522は、j<v_numでなければステップS814の処理に進む。なおjの初期値は0である。   (Step S811) If j <v_num, the output unit 522 executes step S812 after setting j ++. Further, if j <v_num is not satisfied, the output unit 522 proceeds to the process of step S814. The initial value of j is 0.

(ステップS812)出力部522は、value[m]を出力する。また、出力部522は、m++とする。その後、ステップS811の処理に戻る。
(ステップS813)出力部522は、ステップS802の処理に戻る。
(ステップS814)出力部522は、trig=1とする。これにより、出力部522は、trigを復号化部521に入力する。その後、処理を終了する。
(Step S812) The output unit 522 outputs value [m]. The output unit 522 is m ++. Thereafter, the process returns to step S811.
(Step S813) The output unit 522 returns to the process of step S802.
(Step S814) The output unit 522 sets trig = 1. As a result, the output unit 522 inputs trig to the decoding unit 521. Thereafter, the process ends.

上述したステップS801〜ステップS814の処理により、出力部522は、1つの符号セット毎に、符号化対象データを出力する。   Through the processing in steps S801 to S814 described above, the output unit 522 outputs the encoding target data for each code set.

上述したとおり、本実施形態によれば、1次元のハフマンテーブルを用いて符号化および復号化を行うため、2次元のハフマンテーブルを用いて符号化および復号化を行うよりも符号種類が少なくなる。そのため、ハフマン符号化後の最大ビット長も短くなる。また、本実施形態のデータ圧縮および復号システム1は、固定長データを送受信する通信方式でデータの送受信を行うため、送信するデータの最大長を固定長と定め、送信するデータ長が長くても短くても、毎回固定長のデータを送受信する。しかしながら、本実施形態では、ハフマン符号化後の最大ビット長が短くなるため、固定長を短くすることができ、通信効率を向上することができる。また、本実施形態では、ゼロランレングスだけではなくバリューランレングスも用いて符号化を行う。これにより、更に符号化対象データを効率良く符号化することができる。   As described above, according to the present embodiment, since encoding and decoding are performed using a one-dimensional Huffman table, there are fewer types of codes than when encoding and decoding are performed using a two-dimensional Huffman table. . Therefore, the maximum bit length after Huffman coding is also shortened. In addition, since the data compression and decoding system 1 according to the present embodiment transmits and receives data using a communication method for transmitting and receiving fixed-length data, the maximum length of data to be transmitted is determined as a fixed length, and even if the data length to be transmitted is long Send and receive fixed-length data every time, even if it is short. However, in this embodiment, since the maximum bit length after Huffman coding is shortened, the fixed length can be shortened, and communication efficiency can be improved. In this embodiment, encoding is performed using not only the zero run length but also the value run length. As a result, the data to be encoded can be encoded more efficiently.

なお、本実施形態において、JPEG画像の量子化後のデータが12bitの場合の符号種類(テーブル数)は次のようになる。
JPEG画像 : 16×12=196
本実施形態 : 64+64+12=140
(runz:64 runv:64 group:12)
In the present embodiment, the code type (number of tables) when the data after quantization of the JPEG image is 12 bits is as follows.
JPEG image: 16 × 12 = 196
This embodiment: 64 + 64 + 12 = 140
(Runz: 64 runv: 64 group: 12)

(第3の実施形態)
以下、本発明の第3の実施形態について図面を参照して説明する。本実施形態と第2の実施形態と異なる点は、本実施形態では、連続していない「0」を「0以外の数(バリュー)」として扱う点である。なお、本実施形態におけるデータ圧縮および復号システム1の構成は、第2の実施形態における各構成と同様の構成である。
(Third embodiment)
Hereinafter, a third embodiment of the present invention will be described with reference to the drawings. The difference between this embodiment and the second embodiment is that in this embodiment, “0” that is not continuous is treated as “a number other than 0 (value)”. Note that the configuration of the data compression and decoding system 1 in the present embodiment is the same as each configuration in the second embodiment.

次に、本実施形態のハフマン符号化部24における符号化方法について説明する。以下、ハフマン符号化部24に入力される周波数成分のうち、AC成分(符号化対象データ)「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」を符号化する例を用いて説明する。   Next, the encoding method in the Huffman encoder 24 of this embodiment will be described. Hereinafter, among the frequency components input to the Huffman encoding unit 24, the AC component (encoding target data) “5,0,0,0,3,0,0,1,2,0,0,4,0 , 6,... "Will be described using an example of encoding.

初めに、ハフマン符号化部24は、ゼロランレングス符号化を行う。具体的には、符号化対象データにおいて「0」が連続する数を算出し、「0」が連続する数と、「0」以外の値とで符号化対象データを表す。以下、「0」が連続する数を示すデータをrunzとする。また「0」以外の値を示すデータをvalueとする。なお、本実施形態では第2の実施形態とは異なり、連続していない「0」を「0以外の数」として扱う。   First, the Huffman encoding unit 24 performs zero run length encoding. Specifically, the number of consecutive “0” s in the encoding target data is calculated, and the encoding target data is represented by the number of consecutive “0” s and a value other than “0”. Hereinafter, data indicating the number of consecutive “0” s is referred to as runz. Data indicating a value other than “0” is set to value. In this embodiment, unlike the second embodiment, non-sequential “0” is treated as “a number other than 0”.

図22は、ゼロランレングス符号化の具体例を示した説明図である。図示する例では、符号化対象データは「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」である。図示する符号化対象データの先頭の値は「5」であるため、「0」が連続する数は「0」個である。また、符号化対象データ「5」の後の値は「0,0,0,3」であるため、「0」が連続する数は「3」個である。また、符号化対象データ「3」の後の値は「0,0,1」であるため、「0」が連続する数は「2」個である。また、符号化対象データ「1」の後の値は「2」であるが、本実施形態では「0」以外の値が連続する場合、この間の「0」が連続する数については考慮しない。また、符号化対象データ「2」の後の値は「0,0,4」であるため、「0」が連続する数は「2」個である。また、符号化対象データ「4」の後の値は「0,6」であるが、この「0」は連続していない「0」であるため、「0以外の数」として扱う。よって、runzは「0」「3」「2」「2」・・・となる。また、「0」以外の値(value)は、「5」「3」「1,2」「4,0,6」・・・となる。   FIG. 22 is an explanatory diagram showing a specific example of zero-run length encoding. In the illustrated example, the data to be encoded is “5, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 4, 0, 6,. Since the leading value of the encoding target data shown in the figure is “5”, the number of consecutive “0” s is “0”. Since the value after the encoding target data “5” is “0, 0, 0, 3”, the number of consecutive “0” s is “3”. Further, since the value after the encoding target data “3” is “0, 0, 1”, the number of consecutive “0” is “2”. Further, the value after the encoding target data “1” is “2”. However, in this embodiment, when values other than “0” continue, the number of consecutive “0” s between them is not considered. Since the value after the encoding target data “2” is “0, 0, 4”, the number of consecutive “0” s is “2”. The value after the encoding target data “4” is “0, 6”. However, since “0” is “0” which is not continuous, it is treated as “a number other than 0”. Therefore, runz is “0” “3” “2” “2”. Further, values (values) other than “0” are “5”, “3”, “1, 2”, “4, 0, 6”,.

次に、ハフマン符号化部24は、バリューランレングス符号化を行う。具体的には、符号化対象データにおいて、「0」以外の値が連続する数を算出する。以下、「0」以外の値が連続する数を示すデータをrunvとする。   Next, the Huffman encoder 24 performs value run length encoding. Specifically, the number of consecutive values other than “0” in the encoding target data is calculated. Hereinafter, data indicating the number of consecutive values other than “0” is referred to as runv.

図23は、バリューランレングス符号化の具体例を示した説明図である。図示する例では、符号化対象データは「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」である。図示する符号化対象データの先頭の値は「5」であり、その後の値が「0」であるため、「0」以外の値が連続する数は「1」個である。また、符号化対象データ「5」の後の値は「0,0,0,3,0」であるため、「0」以外の値が連続する数は「1」個である。また、符号化対象データ「3」の後の値は「0,0,1,2,0」であるため、「0」以外の値が連続する数は「2」個である。また、符号化対象データ「2」の後の値は「0,0,4,0,6」であり、「4」と「6」との間に連続していない「0」が存在するため、「0」以外の値が連続する数は「3」個である。よって、runvは「1」「1」「2」「3」・・・となる。   FIG. 23 is an explanatory diagram showing a specific example of value run length encoding. In the illustrated example, the data to be encoded is “5, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 4, 0, 6,. Since the leading value of the encoding target data shown in the figure is “5” and the subsequent value is “0”, the number of consecutive values other than “0” is “1”. Further, since the value after the encoding target data “5” is “0, 0, 0, 3, 0”, the number of consecutive values other than “0” is “1”. Further, since the value after the encoding target data “3” is “0, 0, 1, 2, 0”, the number of consecutive values other than “0” is “2”. The value after the encoding target data “2” is “0, 0, 4, 0, 6”, and there is a non-continuous “0” between “4” and “6”. , The number of consecutive values other than “0” is “3”. Therefore, runv is “1” “1” “2” “3”.

次に、ハフマン符号化部24は、valueを特定するgroupと付加ビットとを算出する。valueが「5」「3」「1,2」「4,0,6」・・・である場合、groupは「3」「2」「1,2」「3,1,1」・・・となる。また、このときの付加ビット長は「3」「2」「1,2」「3,1,1」・・・となる。   Next, the Huffman encoding unit 24 calculates a group specifying the value and an additional bit. When the value is “5” “3” “1, 2” “4, 0, 6”..., the group is “3” “2” “1, 2” “3, 1, 1”. It becomes. Further, the additional bit length at this time is “3”, “2”, “1, 2”, “3, 1, 1”,.

図24は、符号化対象データ「5,0,0,0,3,0,0,1,2,0,0,4,0,6,・・・」のrunzと、runvと、valueと、groupとの値を纏めた概略図である。図示する例では、runzと、runvと、valueと、groupとの値が、行の上から順に記載されている。例えば、行301には、runz「0」と、runv「1」と、value「5」と、group「3」とが記載されている。また、行302には、runz「3」と、runv「1」と、value「3」と、group「2」とが記載されている。また、行303には、runz「2」と、runv「2」と、value「1,2」と、group「1,2」とが記載されている。また、行304には、runz「2」と、runv「3」と、value「4,0,6」と、group「3,1,1」とが記載されている。なお、各行のデータを1つの符号セットとする。   FIG. 24 shows the runz, runv, and value of the encoding target data “5, 0, 0, 0, 3, 0, 0, 1, 2, 0, 0, 4, 0, 6,. It is the schematic which summarized the value with, group. In the illustrated example, values of runz, runv, value, and group are described in order from the top of the line. For example, the row 301 describes runz “0”, runv “1”, value “5”, and group “3”. In line 302, runz “3”, runv “1”, value “3”, and group “2” are described. In line 303, runz “2”, runv “2”, value “1,2”, and group “1,2” are described. In line 304, runz “2”, runv “3”, value “4, 0, 6”, and group “3, 1, 1” are described. Note that the data of each row is one code set.

次に、ハフマン符号化部24は、1つの符号セット毎に、runzと、runvと、groupと、valueとを、それぞれ1次元の符号化テーブルを用いて符号化する。なお、runzの符号化に用いるハフマンテーブル(第1のハフマンテーブル)をHzとする。また、runvの符号化に用いるハフマンテーブル(第3のハフマンテーブル)をHvとする。また、groupの符号化に用いるハフマンテーブル(第2のハフマンテーブル)をHgとする。これにより、1つの符号セットをハフマン符号化したデータは、Hz[runz]+Hv[runv]+(Hg[group]+value.enc+・・・)となる。value.encは付加ビットである。なお、符号化されたものに対して、接尾に.encを付加している。   Next, the Huffman encoder 24 encodes runz, runv, group, and value for each code set using a one-dimensional encoding table. It is assumed that the Huffman table (first Huffman table) used for the runz encoding is Hz. Also, a Huffman table (third Huffman table) used for runv encoding is Hv. Also, the Huffman table (second Huffman table) used for group encoding is Hg. As a result, Huffman-encoded data of one code set is Hz [runz] + Hv [runv] + (Hg [group] + value.enc +...). value. enc is an additional bit. In addition, it is suffixed to the encoded one. enc is added.

次に、本実施形態のハフマン符号化部24の構成について説明する。本実施形態のハフマン符号化部24の構成は、第2の実施形態のハフマン符号化部24の構成と同様である。   Next, the configuration of the Huffman encoding unit 24 of this embodiment will be described. The configuration of the Huffman encoding unit 24 of the present embodiment is the same as the configuration of the Huffman encoding unit 24 of the second embodiment.

次に、判定部241の詳細な処理手順について説明する。本実施形態の判定部241の処理手順は、第2の実施形態の判定部241と同様の処理手順である。但し、本実施形態では、AC成分(符号化対象データ)に対して、連続していない「0」をvalue(0以外の数)として扱う。よって、本実施形態の判定部241は、第2の実施形態の判定部241と同様に、1つの符号セット毎に、runzと、runvと、groupと、valueと、trigとを符号化部242に入力する。   Next, a detailed processing procedure of the determination unit 241 will be described. The processing procedure of the determination unit 241 of this embodiment is the same processing procedure as that of the determination unit 241 of the second embodiment. However, in the present embodiment, non-continuous “0” is treated as value (number other than 0) for the AC component (data to be encoded). Therefore, the determination unit 241 according to the present embodiment encodes the runz, runv, group, value, and trig for each code set, similarly to the determination unit 241 according to the second embodiment. To enter.

次に、符号化部242の詳細な処理手順について説明する。本実施形態の符号化部242の処理手順は、第2の実施形態の符号化部242と同様の処理手順である。よって、本実施形態の符号化部242は、第2の実施形態の符号化部242と同様に、1つの符号セット毎に、runzと、group[j]と、value[j]とを、それぞれ一次元のハフマンテーブルを用いて符号化し、runzを符号化したHz[runz]と、groupを符号化したHg[group[j]]と、付加ビットvalue[j].encとを出力する。   Next, a detailed processing procedure of the encoding unit 242 will be described. The processing procedure of the encoding unit 242 of the present embodiment is the same processing procedure as that of the encoding unit 242 of the second embodiment. Therefore, the encoding unit 242 according to the present embodiment, like the encoding unit 242 according to the second embodiment, performs runz, group [j], and value [j] for each code set, respectively. Encoded using a one-dimensional Huffman table, Hz [runz] in which runz is encoded, Hg [group [j]] in which group is encoded, and additional bits value [j]. enc is output.

次に、本実施形態におけるハフマン伸張化部52の構成について説明する。本実施形態のハフマン伸張化部52の構成は、第2の実施形態のハフマン伸張化部52の構成と同様である。   Next, the configuration of the Huffman decompression unit 52 in this embodiment will be described. The configuration of the Huffman decompression unit 52 of the present embodiment is the same as the configuration of the Huffman decompression unit 52 of the second embodiment.

次に、復号化部521の詳細な処理手順について説明する。本実施形態の復号化部521の処理手順は、第2の実施形態の復号化部521と同様の処理手順である。よって、本実施形態の復号化部521は、第2の実施形態の復号化部521と同様に、1つの符号セット毎に、Hz[runz]と、Hg[group[j]]と、value[j].encとを、それぞれ一次元のハフマンテーブルを用いて復号化し、runzとvalue[j]とを出力部522に入力する。   Next, a detailed processing procedure of the decoding unit 521 will be described. The processing procedure of the decoding unit 521 of the present embodiment is the same processing procedure as that of the decoding unit 521 of the second embodiment. Therefore, the decoding unit 521 of the present embodiment, like the decoding unit 521 of the second embodiment, for each code set, Hz [runz], Hg [group [j]], and value [ j]. enc is decoded using a one-dimensional Huffman table, and runz and value [j] are input to the output unit 522.

次に、出力部522の詳細な処理手順について説明する。本実施形態の出力部522の処理手順は、第2の実施形態の出力部522と同様の処理手順である。よって、本実施形態の出力部522は、第2の実施形態の出力部522と同様に、1つの符号セット毎に、符号化対象データを出力する。   Next, a detailed processing procedure of the output unit 522 will be described. The processing procedure of the output unit 522 of the present embodiment is the same processing procedure as that of the output unit 522 of the second embodiment. Therefore, the output unit 522 of the present embodiment outputs data to be encoded for each code set, similarly to the output unit 522 of the second embodiment.

上述したとおり、本実施形態によれば、1次元のハフマンテーブルを用いて符号化および復号化を行うため、2次元のハフマンテーブルを用いて符号化および復号化を行うよりも符号種類が少なくなる。そのため、ハフマン符号化後の最大ビット長も短くなる。また、本実施形態のデータ圧縮および復号システム1は、固定長データを送受信する通信方式でデータの送受信を行うため、送信するデータの最大長を固定長と定め、送信するデータ長が長くても短くても、毎回固定長のデータを送受信する。しかしながら、本実施形態では、ハフマン符号化後の最大ビット長が短くなるため、固定長を短くすることができ、通信効率を向上することができる。また、本実施形態では、ゼロランレングスだけではなくバリューランレングスも用いて符号化を行う。また、本実施形態では、連続していない「0」を「0以外の数(バリュー)」として扱う。これにより、更に符号化対象データを効率良く符号化することができる。   As described above, according to the present embodiment, since encoding and decoding are performed using a one-dimensional Huffman table, there are fewer types of codes than when encoding and decoding are performed using a two-dimensional Huffman table. . Therefore, the maximum bit length after Huffman coding is also shortened. In addition, since the data compression and decoding system 1 according to the present embodiment transmits and receives data using a communication method for transmitting and receiving fixed-length data, the maximum length of data to be transmitted is determined as a fixed length, and even if the data length to be transmitted is long Send and receive fixed-length data every time, even if it is short. However, in this embodiment, since the maximum bit length after Huffman coding is shortened, the fixed length can be shortened, and communication efficiency can be improved. In this embodiment, encoding is performed using not only the zero run length but also the value run length. In the present embodiment, non-continuous “0” is treated as “a number other than 0 (value)”. As a result, the data to be encoded can be encoded more efficiently.

以上、この発明の第1〜第3の実施形態について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。   The first to third embodiments of the present invention have been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and the design does not depart from the gist of the present invention. Etc. are also included.

1・・・データ圧縮および復号システム、2・・・データ圧縮装置、3・・・データ復号装置、20・・・圧縮部、21・・・周波数変換部、22・・・量子化部、23,51,2410・・・記憶部、24・・・ハフマン符号化部、30・・・送信部、40・・・受信部、50・・・伸張部、52・・・ハフマン伸張化部、53・・・逆量子化部、54・・・逆周波数変換部、240・・・入力部、241・・・判定部、242・・・符号化部、521・・・復号化部、522・・・出力部   DESCRIPTION OF SYMBOLS 1 ... Data compression and decoding system, 2 ... Data compression apparatus, 3 ... Data decoding apparatus, 20 ... Compression part, 21 ... Frequency conversion part, 22 ... Quantization part, 23 51, 210... Storage unit, 24... Huffman encoding unit, 30... Transmitting unit, 40... Receiving unit, 50. ... Inverse quantization unit, 54 ... Inverse frequency conversion unit, 240 ... Input unit, 241 ... Determining unit, 242 ... Encoding unit, 521 ... Decoding unit, 522 ...・ Output section

Claims (6)

複数の値が含まれる数値列を構成する符号化対象データを入力する入力部と、
前記符号化対象データのゼロランレングス符号化を行い、前記数値列において0である前記値が連続している個数をrunzデータとし、0ではない前記値をvalueデータとし、さらに、前記valueデータの絶対値を表現できる最小のビット長を示す数値をgroupデータとする判定部と、
前記runzデータを1次元の第1のハフマンテーブルを用いてハフマン符号化し、前記groupデータを前記第1のハフマンテーブルとは異なる1次元の第2のハフマンテーブルを用いてハフマン符号化し、さらに、前記groupデータから前記valueデータを特定するための付加ビットを算出する符号化部と、
前記符号化部がハフマン符号化した前記runzデータと、前記符号化部がハフマン符号化した前記groupデータと、前記符号化部が算出した前記付加ビットとを、前記符号化対象データの符号化データとして、固定長データを送受信する通信方式で送信する送信部と、
を有し、
前記判定部は、前記数値列において0である前記値が連続している個数が0個の場合、当該個数を前記runzデータとせず、
前記判定部は、連続する、0ではない前記値の組を、前記valueデータとする
ことを特徴とするデータ圧縮装置。
An input unit for inputting encoding target data constituting a numeric string including a plurality of values;
The encoding target data is subjected to zero-run length encoding, the number of consecutive values that are 0 in the numerical sequence is runz data, the non-zero value is value data, and the value data A determination unit that uses a numerical value indicating the minimum bit length capable of expressing an absolute value as group data;
The runz data is Huffman encoded using a one-dimensional first Huffman table, the group data is Huffman encoded using a one-dimensional second Huffman table different from the first Huffman table, and an encoding unit for calculating additional bits for specifying the value data from the group data;
The encoded data of the encoding target data includes the runz data encoded by the encoding unit, the group data encoded by the encoding unit, and the additional bits calculated by the encoding unit. As a transmission unit that transmits by a communication method for transmitting and receiving fixed-length data,
Have
When the number of consecutive 0 values in the numerical sequence is 0, the determination unit does not use the number as the runz data.
The determination unit uses the value data as a set of consecutive non-zero values .
前記判定部は、前記数値列において連続する0である値の個数が1個の場合のみ、0である当該値を0ではない前記値とみなして、当該値を前記valueデータとする
ことを特徴とする請求項に記載のデータ圧縮装置。
The determination unit regards the value that is 0 as the value that is not 0 only when the number of consecutive values that are 0 in the numerical sequence is 1, and sets the value as the value data. The data compression apparatus according to claim 1 .
請求項1に記載のデータ圧縮装置から送信される前記符号化データを、固定長データを送受信する通信方式で受信する受信部と、
前記第1のハフマンテーブルを用いてハフマン符号化された前記runzデータを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記groupデータを、前記第2のハフマンテーブルを用いて復号化し、前記groupデータと前記付加ビットとに基づいて前記valueデータを算出する復号化部と、
復号化された前記runzデータと、算出された前記valueデータとに基づいて、前記符号化対象データを算出する算出部と、
を有することを特徴とするデータ復号装置。
A receiving unit that receives the encoded data transmitted from the data compression device according to claim 1 in a communication scheme for transmitting and receiving fixed-length data;
The runz data encoded using the first Huffman table is decoded using the first Huffman table, and the group data encoded using the second Huffman table is Decoding using a second Huffman table and calculating the value data based on the group data and the additional bits;
A calculation unit that calculates the encoding target data based on the decoded runz data and the calculated value data;
A data decoding apparatus comprising:
複数の値が含まれる数値列を構成する符号化対象データを入力する入力ステップと、
前記符号化対象データのゼロランレングス符号化を行い、前記数値列において0である前記値が連続している個数をrunzデータとし、0ではない前記値をvalueデータとし、さらに、前記valueデータの絶対値を表現できる最小のビット長を示す数値をgroupデータとする判定ステップと、
前記runzデータを1次元の第1のハフマンテーブルを用いてハフマン符号化し、前記groupデータを前記第1のハフマンテーブルとは異なる1次元の第2のハフマンテーブルを用いてハフマン符号化し、さらに、前記groupデータから前記valueデータを特定するための付加ビットを算出する符号化ステップと、
前記符号化ステップでハフマン符号化した前記runzデータと、前記符号化ステップでハフマン符号化した前記groupデータと、前記符号化ステップで算出した前記付加ビットとを、前記符号化対象データの符号化データとして、固定長データを送受信する通信方式で送信する送信ステップと、
を含み、
前記判定ステップでは、前記数値列において0である前記値が連続している個数が0個の場合、当該個数を前記runzデータとせず、
前記判定ステップでは、連続する、0ではない前記値の組を、前記valueデータとする
ことを特徴とするデータ圧縮方法。
An input step for inputting data to be encoded that constitutes a numeric string including a plurality of values;
The encoding target data is subjected to zero-run length encoding, the number of consecutive values that are 0 in the numerical sequence is runz data, the non-zero value is value data, and the value data A determination step in which a numerical value indicating the minimum bit length capable of expressing an absolute value is set as group data;
The runz data is Huffman encoded using a one-dimensional first Huffman table, the group data is Huffman encoded using a one-dimensional second Huffman table different from the first Huffman table, and an encoding step for calculating additional bits for identifying the value data from the group data;
The runz data encoded in the encoding step, the group data encoded in the Huffman encoding in the encoding step, and the additional bits calculated in the encoding step are encoded data of the encoding target data. As a transmission step for transmitting in a communication method for transmitting and receiving fixed-length data,
Including
In the determination step, when the number of consecutive values that are 0 in the numerical sequence is 0, the number is not used as the runz data,
In the determination step, a set of values that are consecutive and not 0 is used as the value data .
請求項に記載のデータ圧縮方法で符号化された前記符号化データを、固定長データを送受信する通信方式で受信する受信ステップと、
前記第1のハフマンテーブルを用いてハフマン符号化された前記runzデータを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記groupデータを、前記第2のハフマンテーブルを用いて復号化し、前記groupデータと前記付加ビットとに基づいて前記valueデータを算出する復号化ステップと、
復号化された前記runzデータと、算出された前記valueデータとに基づいて、前記符号化対象データを算出する算出ステップと、
を含むことを特徴とするデータ復号方法。
A reception step of receiving the encoded data encoded by the data compression method according to claim 4 in a communication method for transmitting and receiving fixed-length data;
The runz data encoded using the first Huffman table is decoded using the first Huffman table, and the group data encoded using the second Huffman table is Decoding using a second Huffman table and calculating the value data based on the group data and the additional bits;
A calculation step of calculating the encoding target data based on the decoded runz data and the calculated value data;
A data decoding method comprising:
複数の値が含まれる数値列を構成する符号化対象データを入力する入力部と、
前記符号化対象データのゼロランレングス符号化を行い、前記数値列において0である前記値が連続している個数をrunzデータとし、0ではない前記値をvalueデータとし、さらに、前記valueデータの絶対値を表現できる最小のビット長を示す数値をgroupデータとする判定部と、
前記runzデータを1次元の第1のハフマンテーブルを用いてハフマン符号化し、前記groupデータを前記第1のハフマンテーブルとは異なる1次元の第2のハフマンテーブルを用いてハフマン符号化し、さらに、前記groupデータから前記valueデータを特定するための付加ビットを算出する符号化部と、
前記符号化部がハフマン符号化した前記runzデータと、前記符号化部がハフマン符号化した前記groupデータと、前記符号化部が算出した前記付加ビットとを、前記符号化対象データの符号化データとして、固定長データを送受信する通信方式で送信する送信部と、
を有するデータ圧縮装置と、
前記送信部から送信される前記符号化データを、固定長データを送受信する通信方式で受信する受信部と、
前記第1のハフマンテーブルを用いてハフマン符号化された前記runzデータを、前記第1のハフマンテーブルを用いて復号化し、前記第2のハフマンテーブルを用いて符号化された前記groupデータを、前記第2のハフマンテーブルを用いて復号化し、前記groupデータと前記付加ビットとに基づいて前記valueデータを算出する復号化部と、
復号化された前記runzデータと、算出された前記valueデータとに基づいて、前記符号化対象データを算出する算出部と、
を有するデータ復号装置と、
を含み、
前記判定部は、前記数値列において0である前記値が連続している個数が0個の場合、当該個数を前記runzデータとせず、
前記判定部は、連続する、0ではない前記値の組を、前記valueデータとする
ことを特徴とするデータ圧縮および復号システム。
An input unit for inputting encoding target data constituting a numeric string including a plurality of values;
The encoding target data is subjected to zero-run length encoding, the number of consecutive values that are 0 in the numerical sequence is runz data, the non-zero value is value data, and the value data A determination unit that uses a numerical value indicating the minimum bit length capable of expressing an absolute value as group data;
The runz data is Huffman encoded using a one-dimensional first Huffman table, the group data is Huffman encoded using a one-dimensional second Huffman table different from the first Huffman table, and an encoding unit for calculating additional bits for specifying the value data from the group data;
The encoded data of the encoding target data includes the runz data encoded by the encoding unit, the group data encoded by the encoding unit, and the additional bits calculated by the encoding unit. As a transmission unit that transmits by a communication method for transmitting and receiving fixed-length data,
A data compression device comprising:
A receiver that receives the encoded data transmitted from the transmitter by a communication method for transmitting and receiving fixed-length data;
The runz data encoded using the first Huffman table is decoded using the first Huffman table, and the group data encoded using the second Huffman table is Decoding using a second Huffman table and calculating the value data based on the group data and the additional bits;
A calculation unit that calculates the encoding target data based on the decoded runz data and the calculated value data;
A data decoding device comprising:
Including
When the number of consecutive 0 values in the numerical sequence is 0, the determination unit does not use the number as the runz data.
The data decision and decoding system is characterized in that the determination unit uses the value data as a set of consecutive non-zero values .
JP2015014581A 2015-01-28 2015-01-28 Data compression apparatus, data decoding apparatus, data compression method, data decoding method, and data compression and decoding system Expired - Fee Related JP5855777B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015014581A JP5855777B2 (en) 2015-01-28 2015-01-28 Data compression apparatus, data decoding apparatus, data compression method, data decoding method, and data compression and decoding system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015014581A JP5855777B2 (en) 2015-01-28 2015-01-28 Data compression apparatus, data decoding apparatus, data compression method, data decoding method, and data compression and decoding system

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2010201031A Division JP2012060376A (en) 2010-09-08 2010-09-08 Data compression device, data decoding device, data compression method, data decoding method, and data compression and decoding system

Publications (2)

Publication Number Publication Date
JP2015080276A JP2015080276A (en) 2015-04-23
JP5855777B2 true JP5855777B2 (en) 2016-02-09

Family

ID=53011278

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015014581A Expired - Fee Related JP5855777B2 (en) 2015-01-28 2015-01-28 Data compression apparatus, data decoding apparatus, data compression method, data decoding method, and data compression and decoding system

Country Status (1)

Country Link
JP (1) JP5855777B2 (en)

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3217507B2 (en) * 1992-12-22 2001-10-09 株式会社東芝 Image compression device
JP3075008B2 (en) * 1993-04-15 2000-08-07 松下電器産業株式会社 Recording and playback device
KR0124191B1 (en) * 1994-01-18 1998-10-01 배순훈 Vld
JP2905133B2 (en) * 1995-01-09 1999-06-14 松下電器産業株式会社 Digital encoding device
JP3624450B2 (en) * 1995-02-06 2005-03-02 ソニー株式会社 Image data encoding method and image data encoding apparatus
JPH10276009A (en) * 1997-03-28 1998-10-13 Taiyo Yuden Co Ltd Dielectric filter
JP3952116B2 (en) * 1999-11-12 2007-08-01 セイコーエプソン株式会社 Image compression apparatus and method
JP2003152549A (en) * 2001-11-12 2003-05-23 Sharp Corp Decoding method, decoder, computer program and recording medium
JP2006157944A (en) * 2006-01-04 2006-06-15 Texas Instr Inc <Ti> Variable-length code formation method, encoding apparatus, and decoding apparatus

Also Published As

Publication number Publication date
JP2015080276A (en) 2015-04-23

Similar Documents

Publication Publication Date Title
US10045034B2 (en) System and method for using pattern vectors for video and image coding and decoding
JP2010178339A (en) Method and device for encoding bit sequence
KR101782278B1 (en) Coding and decoding of spectral peak positions
KR20160123302A (en) Devices and methods of source-encoding and decoding of data
US20100208825A1 (en) Reduced bandwidth off-loading of entropy coding/decoding
KR102068383B1 (en) Entropy modifier and method
US20220005233A1 (en) Encoding apparatus, decoding apparatus, encoding system, learning method and program
JP5855777B2 (en) Data compression apparatus, data decoding apparatus, data compression method, data decoding method, and data compression and decoding system
Djusdek et al. Adaptive image compression using adaptive Huffman and LZW
JP2012060376A (en) Data compression device, data decoding device, data compression method, data decoding method, and data compression and decoding system
KR101549740B1 (en) Binary data compression and decompression method and apparatus
JP5570437B2 (en) Entropy encoding device, entropy decoding device, entropy encoding method, and entropy decoding method
JP5642651B2 (en) Decoding device, encoding / decoding system, encoding / decoding method, and decoding program
KR101760070B1 (en) Data encoding and decoding method and apparatus
US11368559B2 (en) Methods and apparatus for compression data streams
KR101632116B1 (en) Binary data compression and restoration method and apparatus
WO2024045216A1 (en) Train-linking lossless compressor of numeric values
JP6821184B2 (en) Image decoder
Rawat et al. Evaluation of Burrows Wheeler Transform based image compression algorithm for multimedia applications
KR101578608B1 (en) Apparatus for data encoding for generating universal code and apparatus for data decoding
KR101734515B1 (en) Data encoding and decoding method and apparatus
KR101603866B1 (en) Method of data compressing, method of data recovering, and the apparatuses thereof
Beirami et al. A novel correlation model for universal compression of parametric sources
Bae et al. Two dimensional incremental parsing for image compression
Reddy et al. LosslessGrayscaleImage Compression Using Intra Pixel Redundancy

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20150129

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150128

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150216

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150821

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150901

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151022

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20151023

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20151117

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151209

R150 Certificate of patent or registration of utility model

Ref document number: 5855777

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: R3D04

LAPS Cancellation because of no payment of annual fees
R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R370 Written measure of declining of transfer procedure

Free format text: JAPANESE INTERMEDIATE CODE: R370