JP2011035682A - Method and device for coding/decoding data - Google Patents

Method and device for coding/decoding data Download PDF

Info

Publication number
JP2011035682A
JP2011035682A JP2009180294A JP2009180294A JP2011035682A JP 2011035682 A JP2011035682 A JP 2011035682A JP 2009180294 A JP2009180294 A JP 2009180294A JP 2009180294 A JP2009180294 A JP 2009180294A JP 2011035682 A JP2011035682 A JP 2011035682A
Authority
JP
Japan
Prior art keywords
code
data
encoding
value
encoded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2009180294A
Other languages
Japanese (ja)
Other versions
JP5369973B2 (en
Inventor
Meguri Takada
巡 高田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2009180294A priority Critical patent/JP5369973B2/en
Publication of JP2011035682A publication Critical patent/JP2011035682A/en
Application granted granted Critical
Publication of JP5369973B2 publication Critical patent/JP5369973B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that decoding becomes difficult since even a code of what data for coding is lost is not clear anymore on the decoding side resulting from buffer overflow. <P>SOLUTION: In this data coding device, a Golomb-Rice coding means 134 performs variable length coding of a conversion coefficient which is the data for coding, and stores generated codes in a coding FIFO memory 123. A code output abbreviation means 136 counts one or more numbers of continuation of codes which can not be stored in the coding FIFO memory 123 due to a lack of free space among the generated codes as a skip number. A coefficient skip number coding means 137 codes the skip number counted by the coding output abbreviation means 136 to be stored in the coding FIFO memory 123 when vacancy is generated in the coding FIFO memory 123. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、データを符号化する方法と装置に関し、特にデータを可変長符号化する方法と装置に関する。   The present invention relates to a method and apparatus for encoding data, and more particularly to a method and apparatus for variable-length encoding data.

固定長の符号化対象データを可変長符号化する方式の一つに、ゴロムライス符号化がある。ゴロムライス符号は、符号化対象データを「単進符号」+「kビットの固定長符号(kは有効桁数の推定値)」として出力するもので、0に近い値ほど短い符号長となることから、予測残差などの簡易符号化として利用されている。   One of the methods for variable-length encoding fixed-length encoding target data is Golomb-Rice coding. The Golomb-Rice code outputs the data to be encoded as a “single decimal code” + “k-bit fixed length code (k is an estimated value of the effective number of digits)”. The closer the value is to 0, the shorter the code length. Therefore, it is used as simple encoding such as prediction residual.

ゴロムライス符号化は、符号化対象となる2進数を下位kビットと上位の残りビットとに分割し、上位の残りビットを単進符号に置き換える。たとえば、信号00010011(2値表現)をk=3で符号化する場合、下位3ビットを除く上位5ビット(00010)が単進符号化された後、下位3ビットがそのまま出力される。単進符号として、ビット列で表現される数だけの"0"のビットに"1"のビットを付加した符号を用いる場合、上記の例では上位5ビットの数値が2であるため、2ビットの"0"が出力され、"1"で終端される。下位3ビットとあわせて最終的に"001011"が符号として出力される。   In Golombrice coding, a binary number to be encoded is divided into lower k bits and upper remaining bits, and the upper remaining bits are replaced with a hexadecimal code. For example, when the signal 00010011 (binary representation) is encoded with k = 3, the lower 5 bits are output as they are after the upper 5 bits (00010) excluding the lower 3 bits are unicode encoded. When using a code in which "1" bits are added to the number of "0" bits as many as the number represented by the bit string as the unicode code, the upper 5 bits in the above example are 2. "0" is output and terminated with "1". Together with the lower 3 bits, “001011” is finally output as a code.

復号側では、符号化に使われたものと同じkの値を用いて、復号対象となる2進数を下位kビットと上位の残りビットとに分割し、上位の残りビットを単進符号前の状態に復号する。たとえば、k=3として符号化された上述の例の符号"001011"の復号では、まず、単進符号"001"から2という数値が復号されて上位5ビット"00010"として出力され、さらに、後続する"011"が下位3ビットとして出力される。この結果、元の信号と完全に一致する信号00010011が得られる。このようにゴロムライス符号は可逆圧縮符号の一種である。   On the decoding side, using the same k value as that used for encoding, the binary number to be decoded is divided into lower k bits and upper remaining bits, and the upper remaining bits are divided into those before the unicode code. Decrypt into state. For example, in the decoding of the code “001011” in the above example encoded as k = 3, first, the numerical value of 2 from the unicode code “001” is decoded and output as the upper 5 bits “00010”. Subsequent “011” is output as the lower 3 bits. As a result, a signal 00010011 that completely matches the original signal is obtained. As described above, the Golomb-Rice code is a kind of lossless compression code.

ゴロムライス符号は、符号化すべき信号値の有効桁とk値が一致する場合に、最も符号長が短くなる。上述の信号00010011の例では、有効桁は5桁なので、k=5の時、出力される符号が110011となって符号長が最短となる。そのため、最適なk値を予測する適応型ゴロムライス符号が考案されている。   The Golomb-Rice code has the shortest code length when the significant digit of the signal value to be encoded matches the k value. In the example of the signal 00010011 described above, the number of significant digits is 5. Therefore, when k = 5, the output code is 110011 and the code length is the shortest. Therefore, an adaptive Golomb-Rice code that predicts an optimal k value has been devised.

適応型ゴロムライス符号の一例が特許文献1に記載されている。特許文献1に記載された適応型ゴロムライス符号化方式は、ゴロムライス符号化の対象とする信号値d(特許文献1では予測残差をゴロムライス符号化の対象としている)の統計から、最適なk値を予測するものである。具体的には、それまでに出現した信号値dの絶対値を累積し、その総和aと累積回数nから平均的な有効桁数kが推定される。また、累積回数があらかじめ決められた上限値(Reset)に達すると、累積値と累積回数をそれぞれ半分にする再スケール処理が行われる。他方、ゴロムライス復号では、符号化側と同じk値を得るために、それまでにゴロムライス復号した信号値dの絶対値を累積し、その総和aと累積回数nから、ゴロムライス符号化で使用されたものと同一の有効桁数kが推定される。さらに、累積回数があらかじめ決められた上限値(Reset)に達すると、累積値と累積回数をそれぞれ半分にする再スケール処理が行われる。   An example of the adaptive Golombrice code is described in Patent Document 1. The adaptive Golomb-Rice coding method described in Patent Document 1 is based on the statistics of the signal value d (the prediction residual is the target of Golomb-Rice coding in Patent Document 1), which is the target of Golomb-Rice coding. Is to predict. Specifically, the absolute value of the signal value d that has appeared so far is accumulated, and the average number of significant digits k is estimated from the sum a and the accumulated number n. When the cumulative number reaches a predetermined upper limit value (Reset), a rescale process is performed to halve the cumulative value and the cumulative number. On the other hand, in Golomurice decoding, in order to obtain the same k value as that on the encoding side, the absolute value of the signal value d that has been Golomurice decoded so far is accumulated, and from the sum a and the accumulated number n, it was used in Golomurice coding. The same number of significant digits k is estimated. Furthermore, when the cumulative number reaches a predetermined upper limit (Reset), a rescale process is performed to halve the cumulative value and the cumulative number.

ゴロムライス符号では、符号化すべき信号値の有効桁数kの推定を誤った場合に、符号化すべき信号値のビット数よりも符号長の方が遥かに長くなる場合がある。例えば、0001011001101101という16ビットの信号値をk=5で符号化すると、下位5ビットを除く上位11ビットの数値が179であるため、179ビットの"0"が出力された後に"1"で終端される。従って、下位5ビットを合わせると、符号長が185ビットになる。   In the Golomb-Rice code, when the number of significant digits k of the signal value to be encoded is erroneously estimated, the code length may be much longer than the number of bits of the signal value to be encoded. For example, if a 16-bit signal value of 001011001101101 is encoded with k = 5, the upper 11 bits excluding the lower 5 bits are 179, so 179-bit “0” is output and then terminated with “1”. Is done. Therefore, when the lower 5 bits are combined, the code length is 185 bits.

このような符号長の長いゴロムライス符号が生成されないようにするために、単進符号の符号長が予め設定した上限長maxを超える場合には、上限長maxに等しいビット"0"の連続を符号化対象データに付加するという別の方法で符号化することが行われている。例えば、上限長maxを32とした場合、上述の0001011001101101をk=5で符号化すると、下位5ビットを除く上位11ビットの数値は32を超える179になるため、32ビットの"0"の連続を0001011001101101の先頭に付加する方法で符号化する。これにより、符号量は32+16=48ビットになり、元の符号化対象データの16ビット長よりは長いが、ゴロムライス符号化した場合の185ビットよりは短くなる。このような符号化方法は、ロウモード(Raw-mode)による符号化方法と呼ばれている。   In order to prevent such a long Golomb-Rice code from being generated, when the code length of a unicode code exceeds the preset upper limit length max, a sequence of bits "0" equal to the upper limit length max is encoded. Encoding is performed by another method of adding to the data to be encoded. For example, when the upper limit length max is 32, if the above-mentioned 001011001101101 is encoded with k = 5, the upper 11 bits excluding the lower 5 bits will be more than 32 and 179, so 32-bit "0" will be consecutive Is encoded by a method of adding to the head of 0001011001101101. As a result, the code amount is 32 + 16 = 48 bits, which is longer than the 16-bit length of the original data to be encoded, but shorter than 185 bits in the case of Golombrice encoding. Such an encoding method is called an encoding method in a raw mode.

米国特許第5764374号明細書US Pat. No. 5,763,474 WO2005/081539WO2005 / 081539

上述したようにゴロムライス符号化では、一時的に符号化対象データよりも符号長の長い符号が生成される場合がある。このため、連続して入力される符号化対象データをリアルタイムに符号化して出力する符号化装置においては、生成した符号を出力するまで一旦蓄積するバッファの容量が小さいと、出力を待つ符号でバッファが満杯になり、一部の符号化対象データの符号がバッファ溢れによって消失してしまう事態が発生する。バッファ溢れによって消失した符号に対応する符号化対象データは、復号側で復号できないことは勿論のこと、以後の復号において使用する復号パラメータkの推定のためにも参照できなくなる。更に悪いことには、どの符号化対象データの符号が消失したかすら分からないため、それ以降の復号が困難になることである。十分な容量のバッファを確保しておけば、バッファ溢れによる符号の消失は防げるが、稀にしか起きないバッファ溢れのために、大容量のバッファを確保しておくのはコスト的に無駄が多い。   As described above, in Golombrice coding, a code having a code length longer than the data to be encoded may be temporarily generated. For this reason, in an encoding device that encodes and outputs continuously encoded data to be encoded in real time, if the capacity of the buffer that temporarily accumulates until the generated code is output is small, it is buffered with a code that waits for output. Becomes full and a part of codes of data to be encoded is lost due to overflow of the buffer. The data to be encoded corresponding to the code lost due to the buffer overflow cannot be decoded on the decoding side, and cannot be referred to for estimation of the decoding parameter k used in the subsequent decoding. To make matters worse, since it is not known which encoding target data has lost its code, subsequent decoding becomes difficult. Ensuring a buffer with sufficient capacity prevents loss of code due to buffer overflow, but it is wasteful in terms of cost to secure a large capacity buffer due to buffer overflow that rarely occurs. .

そこで本発明の目的は、バッファ溢れが原因でどの符号化対象データの符号が消失したかすら復号側で分からなくなって復号が困難になるという、上述した課題を解決したデータ符号化/復号方法および装置を提供することにある。   Accordingly, an object of the present invention is to provide a data encoding / decoding method and a data encoding / decoding method that solves the above-described problem that even the code of which encoding target data is lost due to buffer overflow is not understood on the decoding side and decoding becomes difficult. To provide an apparatus.

本発明のデータ符号化装置は、生成された符号を一時的に蓄積するバッファと、符号化対象データを可変長符号化する可変長符号化手段と、前記可変長符号化手段で生成された符号のうち、前記バッファの空き容量不足により前記バッファに格納できなかった符号の1以上の連続数をスキップ数として計数する符号出力省略手段と、前記バッファに空きが生じたときに前記符号出力省略手段で計数された前記スキップ数を符号化して前記バッファに格納するスキップ数符号化手段とを備えている。   The data encoding apparatus according to the present invention includes a buffer for temporarily storing generated codes, variable length encoding means for variable length encoding of encoding target data, and codes generated by the variable length encoding means. Code output omitting means for counting, as a skip number, one or more consecutive codes that could not be stored in the buffer due to a lack of free space in the buffer, and code output omitting means when the buffer is empty And a skip number encoding means for encoding the skip number counted in step (b) and storing it in the buffer.

また本発明のデータ復号装置は、符号化対象データを可変長符号化した符号と、幾つの連続する符号化対象データが符号化されていないかを示すスキップ数を符号化した符号とを含む符号列を入力とする復号装置であって、前記符号列から前記符号化対象データと前記スキップ数とを復号する復号手段と、前記復号手段で復号されたスキップ数分だけ、符号化対象データが予め定められた値で符号化されているものとして扱うスキップ手段とを備えている。   The data decoding apparatus of the present invention also includes a code including a code obtained by variable-length coding the data to be coded and a code obtained by coding the number of skips indicating how many continuous data to be coded are not coded. A decoding device having a sequence as input, decoding means for decoding the encoding target data and the skip number from the code string, and encoding target data in advance for the number of skips decoded by the decoding means Skip means for handling the data encoded as a predetermined value.

また本発明のデータ符号化方法は、符号化対象データを可変長符号化して生成した符号をバッファに格納し、前記バッファの空き容量不足により前記バッファに格納できなかった符号の1以上の連続数をスキップ数として計数し、前記バッファに空きが生じたときに前記計数した前記スキップ数を符号化して前記バッファに格納する。   In the data encoding method of the present invention, a code generated by variable-length encoding the encoding target data is stored in a buffer, and one or more consecutive numbers of codes that could not be stored in the buffer due to insufficient free space in the buffer Is counted as a skip number, and when the buffer is empty, the counted skip number is encoded and stored in the buffer.

また本発明のデータ復号方法は、符号化対象データを可変長符号化した符号と、幾つの連続する符号化対象データが符号化されていないかを示すスキップ数を符号化した符号とを含む符号列を入力とし、前記符号列から前記符号化対象データと前記スキップ数とを復号し、前記復号されたスキップ数分だけ、符号化対象データが予め定められた値で符号化されているものとして以後の復号を継続する。   Also, the data decoding method of the present invention is a code including a code obtained by variable-length coding the data to be coded and a code obtained by coding the number of skips indicating how many continuous data to be coded are not coded. A sequence is input, the encoding target data and the skip count are decoded from the code sequence, and the encoding target data is encoded with a predetermined value by the decoded skip count. The subsequent decoding is continued.

本発明によれば、バッファ溢れが原因でどの符号化対象データの符号が消失したかすら復号側で分からなくなって復号が困難になるという事態が解消される。   According to the present invention, it is possible to eliminate a situation in which decoding becomes difficult because the decoding side does not even know which encoding target data code has been lost due to buffer overflow.

本発明の第1の実施の形態に係るデータ符号化装置のブロック図である。1 is a block diagram of a data encoding apparatus according to a first embodiment of the present invention. 3階層のウェーブレット変換の説明図である。It is explanatory drawing of wavelet transformation of 3 layers. 本発明の第1の実施の形態に係るデータ符号化装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the data coding apparatus which concerns on the 1st Embodiment of this invention. 本発明の第1の実施の形態に係るデータ符号化装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the data coding apparatus which concerns on the 1st Embodiment of this invention. 本発明の第2の実施の形態に係るデータ復号装置のブロック図である。It is a block diagram of the data decoding apparatus which concerns on the 2nd Embodiment of this invention. 本発明の第2の実施の形態に係るデータ復号装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the data decoding apparatus which concerns on the 2nd Embodiment of this invention. 本発明の第3の実施の形態に係るデータ符号化装置のブロック図である。It is a block diagram of the data coding apparatus which concerns on the 3rd Embodiment of this invention. 本発明の第3の実施の形態に係るデータ符号化装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the data coding apparatus based on the 3rd Embodiment of this invention. 本発明の第3の実施の形態に係るデータ符号化装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the data coding apparatus based on the 3rd Embodiment of this invention. 本発明の第4の実施の形態に係るデータ復号装置のブロック図である。It is a block diagram of the data decoding apparatus which concerns on the 4th Embodiment of this invention. 本発明の第4の実施の形態に係るデータ復号装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the data decoding apparatus which concerns on the 4th Embodiment of this invention.

次に、本発明の実施の形態について図面を参照して詳細に説明する。   Next, embodiments of the present invention will be described in detail with reference to the drawings.

[第1の実施の形態]
図1を参照すると、本発明の第1の実施の形態は、本発明をウェーブレット変換符号化装置に適用したものであり、画像入力装置11と、データ記憶装置12と、プログラム制御により動作するデータ処理装置13と、符号出力装置14とから構成されている。
[First embodiment]
Referring to FIG. 1, in the first embodiment of the present invention, the present invention is applied to a wavelet transform coding device, and an image input device 11, a data storage device 12, and data operated by program control. It comprises a processing device 13 and a code output device 14.

画像入力装置11は、2次元信号としての画像を入力するための装置であり、例えばカメラや通信装置などで構成される。   The image input device 11 is a device for inputting an image as a two-dimensional signal, and is composed of, for example, a camera or a communication device.

データ記憶装置12は、画像メモリ121と、変換係数メモリ122と、符号FIFOメモリ123と、符号FIFO空き容量メモリ124と、係数スキップ数メモリ125とを含む。   The data storage device 12 includes an image memory 121, a conversion coefficient memory 122, a code FIFO memory 123, a code FIFO free capacity memory 124, and a coefficient skip number memory 125.

画像メモリ121は、画像入力装置11から入力された画像を記憶する。   The image memory 121 stores an image input from the image input device 11.

変換係数メモリ122は、画像メモリ121に記憶された入力画像に対してウェーブレット変換を施すことにより得られたウェーブレット変換係数を記憶する。   The transform coefficient memory 122 stores wavelet transform coefficients obtained by performing wavelet transform on the input image stored in the image memory 121.

符号FIFOメモリ123は、変換係数メモリ122に記憶されたウェーブレット変換係数をゴロムライス符号化した符号を先入れ先出し方式で記憶するバッファである。   The code FIFO memory 123 is a buffer that stores, in a first-in first-out manner, a code obtained by performing Golomb-Rice coding on the wavelet transform coefficient stored in the transform coefficient memory 122.

符号FIFO空き容量メモリ124は、符号FIFOメモリ123の空き容量を記憶する。   The code FIFO free capacity memory 124 stores the free capacity of the code FIFO memory 123.

係数スキップ数メモリ125は、符号が符号FIFOメモリ123に出力されなかったウェーブレット変換係数の数を記憶する。   The coefficient skip number memory 125 stores the number of wavelet transform coefficients whose code has not been output to the code FIFO memory 123.

データ処理装置13は、画像変換手段131と、係数参照値変更手段132と、符号化パラメータ決定手段133と、ゴロムライス符号化手段134と、符号出力判定手段135と、符号出力省略手段136と、係数スキップ数符号化手段137と、符号出力手段138とを備えている。   The data processing device 13 includes an image converting unit 131, a coefficient reference value changing unit 132, an encoding parameter determining unit 133, a Golomb-Rice encoding unit 134, a code output determining unit 135, a code output omitting unit 136, a coefficient Skip number encoding means 137 and code output means 138 are provided.

画像変換手段131は、画像メモリ121に記憶された入力画像に対してウェーブレット変換を施すことにより、ウェーブレット変換係数を生成し、変換係数メモリ122に記憶する。ウェーブレット変換は、一種のサブバンド符号化であり、水平および垂直方向にそれぞれ帯域分割するサブバンド分割を、低域側について繰り返し行うことでN階層(Nは1以上の整数)の帯域分割を行う。このような帯域分割はオクターブ分割と呼ばれる。3階層まで分割した場合は、図2に示すような10個のサブバンドが得られる。   The image conversion unit 131 generates wavelet transform coefficients by performing wavelet transform on the input image stored in the image memory 121, and stores the wavelet transform coefficients in the transform coefficient memory 122. The wavelet transform is a kind of subband coding, and performs band division of N layers (N is an integer of 1 or more) by repeatedly performing subband division for dividing the band in the horizontal and vertical directions on the low frequency side. . Such band division is called octave division. When dividing up to three layers, ten subbands as shown in FIG. 2 are obtained.

図2において、F0〜F3は最下位層のサブバンド、F4〜F6はその上の階層のサブバンド、F7〜F9は最上位層のサブバンドである。また、F1、F4、F7は、水平方向にローパスフィルタ、垂直方向にハイパスフィルタをかけたサブバンド、F2、F5、F8は、水平方向にハイパスフィルタ、垂直方向にローパスフィルタをかけたサブバンド、F3、F6、F9は、水平方向および垂直方向ともハイパスフィルタをかけたサブバンドである。また、F0を最低域サブバンドと呼び、F0以外のF1〜F9を高域サブバンドと呼ぶ。   In FIG. 2, F0 to F3 are subbands in the lowest layer, F4 to F6 are subbands in the upper layer, and F7 to F9 are subbands in the highest layer. F1, F4, and F7 are subbands that have a low-pass filter in the horizontal direction and a high-pass filter in the vertical direction. F2, F5, and F8 are subbands that have a high-pass filter in the horizontal direction and a low-pass filter in the vertical direction. F3, F6, and F9 are subbands to which a high-pass filter is applied in both the horizontal and vertical directions. Further, F0 is referred to as the lowest frequency subband, and F1 to F9 other than F0 are referred to as the high frequency subband.

各サブバンドF0〜F9には、ウェーブレット変換係数が含まれる。本明細書では、F1、F4、F7のように水平方向にローパスフィルタ、垂直方向にハイパスフィルタをかけたサブバンドに含まれるウェーブレット変換係数をLHと呼ぶ。また、F2、F5、F8のように水平方向にハイパスフィルタ、垂直方向にローパスフィルタをかけたサブバンドに含まれるウェーブレット変換係数をHLと呼ぶ。また、F3、F6、F9のように水平方向および垂直方向ともハイパスフィルタをかけたサブバンドに含まれるウェーブレット変換係数をHHと呼ぶ。また、最低域サブバンドF0に含まれるウェーブレット変換係数をLLと呼ぶ。さらに、同一階層の複数の高域サブバンドにおける同一空間座標のウェーブレット変換係数LH、HL、HHには、例えば、LH(i,j)、HL(i,j)、HH(i,j)のように、それらの後ろに同じ座標を付記して表現する。なお、水平方向をx、垂直方向をyとし、座標は(x,y)で表現するものとする。   Each subband F0 to F9 includes a wavelet transform coefficient. In this specification, wavelet transform coefficients included in subbands such as F1, F4, and F7 that have been subjected to a low-pass filter in the horizontal direction and a high-pass filter in the vertical direction are referred to as LH. Further, wavelet transform coefficients included in subbands such as F2, F5, and F8 that have been subjected to a high-pass filter in the horizontal direction and a low-pass filter in the vertical direction are referred to as HL. A wavelet transform coefficient included in a subband to which a high-pass filter is applied in both the horizontal direction and the vertical direction, such as F3, F6, and F9, is referred to as HH. The wavelet transform coefficient included in the lowest band subband F0 is referred to as LL. Furthermore, for example, LH (i, j), HL (i, j), and HH (i, j) are included in the wavelet transform coefficients LH, HL, and HH of the same spatial coordinates in a plurality of high frequency subbands in the same layer. In this way, the same coordinates are added after them. It is assumed that the horizontal direction is x, the vertical direction is y, and the coordinates are represented by (x, y).

上記のようなウェーブレット変換を行うと、電力は最低域サブバンドに含まれるウェーブレット変換係数LLに偏り、高域サブバンドに含まれるウェーブレット変換係数LH、HL、HHは、0に近い値になる。このため、0に近い値ほど符号長が短くなる可変長符号を用いて、高域サブバンドに含まれるウェーブレット変換係数LH、HL、HHを符号化することにより、情報量を圧縮することが可能になる。また、ウェーブレット変換係数LH、HL、HHを量子化すれば、0に近いウェーブレット変換係数の数が増えるため、情報量の更なる高圧縮が可能になる。   When the wavelet transform as described above is performed, the power is biased toward the wavelet transform coefficient LL included in the lowest band subband, and the wavelet transform coefficients LH, HL, and HH included in the high band subband become values close to zero. For this reason, it is possible to compress the amount of information by encoding the wavelet transform coefficients LH, HL, and HH included in the high frequency sub-band using a variable length code in which the code length is shorter as the value is closer to 0. become. Further, if the wavelet transform coefficients LH, HL, and HH are quantized, the number of wavelet transform coefficients close to 0 increases, so that the information amount can be further compressed.

ここで、高域サブバンドに含まれるウェーブレット変換係数を符号化する方式としては、JPEG2000のようにLH、HL、HHをそれぞれ別々に符号化する方式と、例えば特許文献2に示すように、同一階層に属する複数のサブバンド内の空間的に同一位置にあるLH、HL、HHをまとめて符号化する方式とがある。本発明はそのどちらの方式を使用しても良い。   Here, as a method for encoding the wavelet transform coefficient included in the high frequency sub-band, a method for encoding LH, HL, and HH separately as in JPEG2000, for example, the same as shown in Patent Document 2, for example. There is a method in which LH, HL, and HH at the same spatial position in a plurality of subbands belonging to a hierarchy are encoded together. The present invention may use either method.

符号化パラメータ決定手段133は、符号化対象となるウェーブレット変換係数の符号化パラメータkを、変換係数メモリ122に記憶されたウェーブレット変換係数のうち、既に符号化された1以上のウェーブレット変換係数に基づいて算出する。符号化パラメータkを算出するために参照するウェーブレット変換係数は、種々考えられる。例えば、サブバンド別にウェーブレット変換係数を符号化する場合、符号化パラメータ決定手段133は、符号化対象のウェーブレット変換係数と同じ種類の既に符号化された1以上のウェーブレット変換に基づいて符号化パラメータkを算出する。つまり、LHなら既に符号化されたLHに基づいてkを算出する。また、同一階層に属する高域サブバンド内の空間的に同一位置にあるLH、HL、HHをまとめて符号化する場合、符号化パラメータ決定手段133は、例えば、符号化対象となるウェーブレット変換係数の符号化パラメータkを同一階層に属する複数の高域サブバンド内の既に符号化された近傍の複数のウェーブレット変換係数に基づいて算出する。以上のようにして算出された符号化パラメータkは、符号化パラメータ決定手段133からゴロムライス符号化手段134に伝達される。   The encoding parameter determination unit 133 sets the encoding parameter k of the wavelet transform coefficient to be encoded based on one or more wavelet transform coefficients already encoded among the wavelet transform coefficients stored in the transform coefficient memory 122. To calculate. Various wavelet transform coefficients to be referred to for calculating the encoding parameter k can be considered. For example, when the wavelet transform coefficient is encoded for each subband, the encoding parameter determination unit 133 uses the encoding parameter k based on one or more already encoded wavelet transforms of the same type as the wavelet transform coefficient to be encoded. Is calculated. That is, for LH, k is calculated based on the already encoded LH. Also, when LH, HL, and HH that are spatially at the same position in the high frequency subband belonging to the same layer are encoded together, the encoding parameter determination unit 133, for example, uses the wavelet transform coefficient to be encoded. Is calculated based on a plurality of already encoded nearby wavelet transform coefficients in a plurality of high frequency subbands belonging to the same layer. The encoding parameter k calculated as described above is transmitted from the encoding parameter determination unit 133 to the Golomb-Rice encoding unit 134.

ゴロムライス符号化手段134は、符号化対象となるウェーブレット変換係数を変換係数メモリ122から読み出し、符号化する。符号化は、単進符号の符号長が予め設定した上限長maxを超えない場合には、下記の第1の符号化方法で行い、超える場合には、下記の第2の符号化方法で行う。上限長maxとしては、例えば符号化対象データを32ビットとすると、例えば32とすることができる。
(1)第1の符号化方法:
符号化対象データを「単進符号」+「kビットの固定長符号(kは符号化パラメータ)」として符号化する。これは、ゴロムライス符号化そのものである。
(2)第2の符号化方法:
予め定めた上限長maxに等しいビット"0"の連続を符号化対象データに付加して符号化する。これは、上述したロウモード(Raw-mode)による符号化である。
The Golomb-Rice encoding means 134 reads out the wavelet transform coefficient to be encoded from the transform coefficient memory 122 and encodes it. Encoding is performed by the following first encoding method when the code length of the unicode code does not exceed the preset upper limit length max, and is encoded by the following second encoding method when exceeding the preset upper limit length max. . The upper limit length max can be set to 32, for example, when the encoding target data is 32 bits.
(1) First encoding method:
The data to be encoded is encoded as “uniary code” + “k-bit fixed length code (k is an encoding parameter)”. This is Golombrice coding itself.
(2) Second encoding method:
Encoding is performed by adding a series of bits “0” equal to a predetermined upper limit length max to the data to be encoded. This is encoding in the above-described raw mode.

ゴロムライス符号化手段134は、生成した符号の符号長を符号出力判定手段135に伝達し、符号を出力して良いか否かの判定結果を符号出力判定手段135から受け取る。符号出力可の判定結果を受け取った場合、ゴロムライス符号化手段134は、上記生成した符号を符号FIFO123に格納し、符号FIFO空き容量メモリ124に記憶されている空き容量を、今回出力した符号の符号量だけ減算する。他方、ゴロムライス符号化手段134は、符号出力不可の判定結果を受け取った場合、上記生成した符号は符号FIFO123へ格納せずに破棄する。   The Golomb-Rice encoding unit 134 transmits the code length of the generated code to the code output determination unit 135 and receives from the code output determination unit 135 the determination result as to whether the code can be output. When the determination result indicating that the code can be output is received, the Golomb-Rice encoding means 134 stores the generated code in the code FIFO 123 and uses the free capacity stored in the code FIFO free capacity memory 124 as the code of the code output this time. Subtract by amount. On the other hand, when the Golomb-Rice encoding unit 134 receives the determination result indicating that the code cannot be output, the generated code is discarded without being stored in the code FIFO 123.

符号出力判定手段135は、ゴロムライス符号化手段134で生成された符号の符号長、符号FIFO空き容量メモリ124に記憶されている符号FIFOメモリ123の空き容量、係数スキップ数メモリ125に記憶されている係数スキップ数、係数スキップ数符号化手段137で生成された係数スキップ数を符号化した符号の符号長に基づいて、それら各符号の符号FIFOメモリ123への出力の可否判定を実施し、各部を制御する。   The code output determination means 135 is stored in the code length of the code generated by the Golomb-Rice encoding means 134, the free capacity of the code FIFO memory 123 stored in the code FIFO free capacity memory 124, and the coefficient skip number memory 125. Based on the code length of the code obtained by encoding the coefficient skip number and the coefficient skip number generated by the coefficient skip number encoding unit 137, whether or not each code is output to the code FIFO memory 123 is determined. Control.

符号出力省略手段136は、符号化対象となるウェーブレット変換係数についてゴロムライス符号化手段134で生成された符号が符号FIFO123に格納されなかった場合、符号出力判定手段135からの指示に従い、係数スキップ数メモリ125に記憶されている係数スキップ数を1加算する。また、符号出力省略手段136は、符号化されなかった当該符号化対象のウェーブレット変換係数の値を変更するように係数参照値変更手段132に通知する。   When the code generated by the Golomb-Rice encoding unit 134 is not stored in the code FIFO 123 for the wavelet transform coefficient to be encoded, the code output omitting unit 136 follows the instruction from the code output determining unit 135 and stores the coefficient skip count memory. The number of coefficient skips stored in 125 is incremented by one. The code output omitting unit 136 notifies the coefficient reference value changing unit 132 to change the value of the wavelet transform coefficient to be encoded that has not been encoded.

係数参照値変更手段132は、符号出力省略手段136からの指示に従い、変換係数メモリ122に記憶されたウェーブレット変換係数のうち、符号化されなかったウェーブレット変換係数の値を予め定められた値に変更する。本実施の形態は、予め定められた値として、0を使用する。勿論、0以外の値を使用しても良い。   The coefficient reference value changing unit 132 changes the value of the wavelet transform coefficient that has not been encoded among the wavelet transform coefficients stored in the transform coefficient memory 122 to a predetermined value in accordance with the instruction from the code output omitting unit 136. To do. In the present embodiment, 0 is used as a predetermined value. Of course, values other than 0 may be used.

係数スキップ数符号化手段137は、符号出力判定手段135の指示に従って、係数スキップ数メモリ125に記憶された係数スキップ数を所定の方法で符号化して符号FIFOメモリ123に記憶し、符号FIFO空き容量メモリ124に記憶されている空き容量を、今回出力した符号の符号量だけ減算する。以下、係数スキップ数を符号化する方法について説明する。   The coefficient skip number encoding unit 137 encodes the coefficient skip number stored in the coefficient skip number memory 125 by a predetermined method in accordance with an instruction from the code output determination unit 135 and stores the coefficient skip number in the code FIFO memory 123, and the code FIFO free space The free space stored in the memory 124 is subtracted by the code amount of the code output this time. Hereinafter, a method of encoding the coefficient skip number will be described.

ゴロムライス符号化手段134が、上述した第1および第2の符号化方法により符号化を行う場合、ビット"0"が32個連続した直後に0から31の値を示す2進表記が続くという符号パターンは発生しない。その理由は、ビット"0"が32個連続するという符号パターンは第2の符号化方法による符号化が行われた場合にのみ現れるが、第2の符号化方法による符号化では、ビット"0"が32個連続した直後の2進表記は32未満になることはないためである(32未満なら、k=0でもロウモード(Raw-mode)に入らないため)。そこで、本実施の形態では、ビット"0"が32個連続した直後に0から31の2進表記が続くという符号パターン中の、0から31の2進表記の部分に、係数スキップ数の2進表記を置くことにより、係数スキップ数の符号化を行う。具体的には、符号化対象データがmビットの固定長であれば、ビット"0"が32個連続した直後のmビットで、1から32までのスキップ数を表現する。より詳細には、例えば、mビットの2進表記の0をスキップ数1の符号とし、mビットの2進表記の1をスキップ数2の符号とし、…、mビットの2進表記の31をスキップ数32の符号とする。   A code in which when the Golomb-Rice encoding means 134 performs encoding by the first and second encoding methods described above, binary notation indicating a value from 0 to 31 immediately follows 32 consecutive bits “0”. No pattern is generated. The reason is that a code pattern of 32 consecutive bits “0” appears only when encoding by the second encoding method is performed, but bit “0” is encoded by encoding by the second encoding method. This is because the binary representation immediately after “32” is never less than 32 (if it is less than 32, even if k = 0, it does not enter the raw mode). Therefore, in the present embodiment, the coefficient skip count 2 is added to the binary notation from 0 to 31 in the code pattern in which the binary notation from 0 to 31 immediately follows 32 consecutive bits “0”. Coding of the number of coefficient skips is performed by putting a hexadecimal notation. Specifically, if the data to be encoded is a fixed length of m bits, the number of skips from 1 to 32 is expressed by m bits immediately after 32 consecutive bits “0”. More specifically, for example, m-bit binary notation 0 is a code with a skip number 1, m-bit binary notation 1 is a skip-number 2 code,..., M-bit binary notation 31 is The number of skips is 32.

例えば、16ビットの係数値を符号化する際、32個の係数の符号化をスキップすると、計512ビット分の係数がスキップされることになる。この係数スキップ数はロウモードにて符号化されるため、この間の出力符号量は48ビットとなる。また、係数を32個スキップしてもなお係数の符号を出力できない場合には再びロウモードで計数スキップ数を続けて出力するようにすれば、33個以上の係数スキップを実現することができる。いずれにせよ、上記の符号化方法によれば、係数の帯域に対して出力信号の帯域を48/512=約9.4%以下に抑えることが可能となる。一般に、ウェーブレット変換係数は画素値よりもダイナミックレンジが大きくなるが(8ビットから16ビット等)、上記方式ではこうした帯域増大幅(2倍)よりも大きな帯域縮小幅(約10分の1)が得られるため、符号FIFOメモリの帯域が画像信号のメモリ帯域以下であっても十分に符号出力が可能となる。   For example, when encoding a 16-bit coefficient value, if encoding of 32 coefficients is skipped, a total of 512-bit coefficients are skipped. Since the coefficient skip number is encoded in the low mode, the output code amount during this period is 48 bits. Further, if the coefficient code cannot be output even after skipping 32 coefficients, if the count skip number is continuously output again in the low mode, 33 or more coefficient skips can be realized. In any case, according to the above encoding method, the band of the output signal can be suppressed to 48/512 = about 9.4% or less with respect to the coefficient band. In general, the wavelet transform coefficient has a larger dynamic range than the pixel value (8 bits to 16 bits, etc.), but the above method has a bandwidth reduction width (about 1/10) larger than such a bandwidth increase width (twice). Therefore, even if the band of the code FIFO memory is equal to or less than the memory band of the image signal, the code can be sufficiently output.

符号出力手段138は、符号FIFOメモリ123に記憶された符号を読み出して、符号出力装置14へ出力する。また、符号出力手段138は、符号FIFOメモリ123から読み出した符号の符号量に応じて、符号FIFO空き容量メモリ124に記憶された空き容量を増大する。   The code output means 138 reads the code stored in the code FIFO memory 123 and outputs it to the code output device 14. Further, the code output unit 138 increases the free capacity stored in the code FIFO free capacity memory 124 in accordance with the code amount of the code read from the code FIFO memory 123.

次に図3および図4のフローチャートを参照して、本実施の形態の全体の動作を説明する。   Next, the overall operation of the present embodiment will be described with reference to the flowcharts of FIGS.

データ処理装置13は、図3に示す動作と図4に示す動作とを並行して実行する。図3に示す動作では、まず、符号FIFOメモリ123の記憶内容をクリアする(S101)。その後、符号出力手段138は、符号出力装置14への信号送信タイミング毎に、符号FIFOメモリ123に未送信データがあるかどうかを調べ、あれば未送信データを符号出力装置14へ送信して、符号FIFO空き容量メモリ124に記憶された空き容量を更新する操作を繰り返す(S102〜S106)。   The data processing device 13 executes the operation shown in FIG. 3 and the operation shown in FIG. 4 in parallel. In the operation shown in FIG. 3, first, the stored contents of the code FIFO memory 123 are cleared (S101). Thereafter, the code output unit 138 checks whether there is untransmitted data in the code FIFO memory 123 at every signal transmission timing to the code output device 14, and if there is, transmits the untransmitted data to the code output device 14, The operation of updating the free space stored in the code FIFO free space memory 124 is repeated (S102 to S106).

他方、図4に示す動作では、画像入力装置11から入力された画像に対するウェーブレット変換符号化が行われて、符号FIFOメモリ123に蓄積される動作が行われる。具体的には、以下のような動作が行われる。   On the other hand, in the operation shown in FIG. 4, the wavelet transform encoding is performed on the image input from the image input device 11 and the operation stored in the code FIFO memory 123 is performed. Specifically, the following operations are performed.

まず、画像変換手段131は、画像入力装置11から画像メモリ121に入力された画像に対してN階層(Nは1以上の整数)のウェーブレット変換を行い、得られた各サブバンドのウェーブレット変換係数を変換係数メモリ122に記憶する(S111)。   First, the image conversion means 131 performs wavelet transform of N layers (N is an integer of 1 or more) on the image input from the image input device 11 to the image memory 121, and the obtained wavelet transform coefficients of each subband. Is stored in the conversion coefficient memory 122 (S111).

次に、係数抽出座標が初期化される(S112)。次に、符号出力省略手段136は、係数スキップ数メモリ125に記憶されている係数スキップ数を0にクリアする(S113)。   Next, the coefficient extraction coordinates are initialized (S112). Next, the code output omission unit 136 clears the coefficient skip count stored in the coefficient skip count memory 125 to 0 (S113).

次に、符号化パラメータ決定手段133は、係数抽出座標のウェーブレット変換係数をゴロムライス符号化するための符号化パラメータkを決定するために参照する符号化済の1以上のウェーブレット変換係数を変換係数メモリ122から読み出す(S114)。参照する符号化済の1以上のウェーブレット変換係数は、符号化装置側と復号装置側とで同じであれば任意で良い。符号化パラメータ決定手段133は、読み出した1以上の符号化済のウェーブレット変換係数の値から、係数抽出座標のウェーブレット変換係数の有効桁数を推測し、符号化パラメータkを決定する(S115)。   Next, the encoding parameter determining unit 133 converts one or more encoded wavelet transform coefficients to be referred to in order to determine the encoding parameter k for performing Golomb-Rice encoding of the wavelet transform coefficients of the coefficient extraction coordinates to the transform coefficient memory. Read from 122 (S114). The encoded one or more wavelet transform coefficients to be referred to may be arbitrary as long as they are the same on the encoding device side and the decoding device side. The encoding parameter determining unit 133 estimates the number of significant digits of the wavelet transform coefficient of the coefficient extraction coordinates from the read one or more encoded wavelet transform coefficient values, and determines the encoding parameter k (S115).

次に、ゴロムライス符号化手段134は、係数抽出座標のウェーブレット変換係数の符号化を行い、その符号長を符号出力判定手段135に伝達する(S116)。上述したように、ゴロムライス符号化手段134は、単進符号の符号長が上限長maxを超えない場合、符号化パラメータ決定手段133で決定された符号化パラメータkを用いて、第1の符号化方法(ゴロムライス符号化)で符号化する。また、ゴロムライス符号化手段134は、単進符号の符号長が上限長maxを超える場合、第2の符号化方法(ロウモードによる符号化)で符号化する。   Next, the Golomb-Rice encoding unit 134 encodes the wavelet transform coefficient of the coefficient extraction coordinates and transmits the code length to the code output determination unit 135 (S116). As described above, when the code length of the unicode code does not exceed the upper limit length max, the Golomb-Rice encoding unit 134 uses the encoding parameter k determined by the encoding parameter determination unit 133 to perform the first encoding. Encoding is performed by the method (Golomrice encoding). Further, when the code length of the unicode code exceeds the upper limit length max, the Golomb-Rice encoding means 134 performs encoding by the second encoding method (encoding in the low mode).

符号出力判定手段135は、符号FIFO空き容量メモリ124から符号FIFOメモリ123の空き容量を読み出す(S117)。また符号出力判定手段135は、係数スキップ数メモリ125から係数スキップ数を読み出し、係数スキップ数が0か、1以上かを判定する(S118)。係数スキップ数が0であれば、符号出力判定手段135は、ゴロムライス符号化手段134で生成された符号の符号長と符号FIFOメモリ123の空き容量とを比較して、今回生成された符号を符号FIFOメモリ123に出力できるかどうかを判定する(S123)。若し、出力可能であれば、符号出力判定手段135は、ゴロムライス符号化手段134に対して符号出力可を通知する。ゴロムライス符号化手段134は、符号FIFOメモリ123に今回生成した符号を出力し、符号FIFO空き容量メモリ124に記憶された空き容量をその符号長だけ減算する(S124)。そして、ステップS127の処理へと進む。   The code output determination unit 135 reads the free capacity of the code FIFO memory 123 from the code FIFO free capacity memory 124 (S117). Further, the code output determination unit 135 reads the coefficient skip number from the coefficient skip number memory 125 and determines whether the coefficient skip number is 0 or 1 or more (S118). If the number of coefficient skips is 0, the code output determination unit 135 compares the code length of the code generated by the Golomb-Rice encoding unit 134 with the free capacity of the code FIFO memory 123 and encodes the code generated this time. It is determined whether or not the data can be output to the FIFO memory 123 (S123). If output is possible, the code output determination unit 135 notifies the Golomb-Rice encoding unit 134 that code output is possible. The Golomb-Rice encoding means 134 outputs the code generated this time to the code FIFO memory 123, and subtracts the free capacity stored in the code FIFO free capacity memory 124 by the code length (S124). Then, the process proceeds to step S127.

他方、符号出力判定手段135は、ゴロムライス符号化手段134で生成された符号の符号長よりも符号FIFOメモリ123の空き容量の方が少ないときは、ゴロムライス符号化手段134に対して符号出力不可を通知する。さらに符号出力判定手段135は、符号出力省略手段136を動作させる。符号出力省略手段136は、係数スキップ数メモリ125に記憶された係数スキップ数を1だけ加算する(S125)。さらに符号出力省略手段136は、係数参照値変更手段132を動作させる。係数参照値変更手段132は、変換係数メモリ122における係数抽出座標のウェーブレット変換係数の値を0に書き換える(S126)。そして、ステップS127の処理へと進む。   On the other hand, when the code FIFO memory 123 has less free space than the code length of the code generated by the Golomb-Rice encoding unit 134, the code output determination unit 135 prohibits the code output from the Golomb-Rice encoding unit 134. Notice. Further, the code output determination unit 135 operates the code output omitting unit 136. The code output omitting unit 136 adds 1 to the coefficient skip count stored in the coefficient skip count memory 125 (S125). Further, the code output omitting unit 136 operates the coefficient reference value changing unit 132. The coefficient reference value changing unit 132 rewrites the value of the wavelet transform coefficient of the coefficient extraction coordinate in the transform coefficient memory 122 to 0 (S126). Then, the process proceeds to step S127.

また符号出力判定手段135は、ステップS118において、係数スキップ数メモリ125に記憶されている係数スキップ数が1以上であると判定した場合、ステップS117で読み出した符号FIFO123の空き容量と係数スキップ数の符号の符号長とを比較して、係数スキップ数の符号を符号FIFOメモリ123に出力できるかどうかを判定する(S119)。若し、出力不可能であれば、符号の出力順序の逆転が生じるのを防ぐために、符号出力判定手段135は、ゴロムライス符号化手段134に対して符号出力不可を通知する。そして、符号出力判定手段135は、符号出力省略手段136を動作させる。符号出力省略手段136は、係数スキップ数メモリ125に記憶された係数スキップ数を1だけ加算する(S125)。さらに符号出力省略手段136は、係数参照値変更手段132を動作させる。係数参照値変更手段132は、変換係数メモリ122における係数抽出座標のウェーブレット変換係数の値を0に書き換える(S126)。そして、ステップS127の処理へと進む。   If the code output determination unit 135 determines in step S118 that the coefficient skip number stored in the coefficient skip number memory 125 is 1 or more, the code output determination unit 135 sets the free space and the coefficient skip number of the code FIFO 123 read in step S117. The code length of the code is compared, and it is determined whether or not the code of the coefficient skip count can be output to the code FIFO memory 123 (S119). If the output is impossible, the code output determination unit 135 notifies the Golomb-Rice encoding unit 134 that the code output is impossible in order to prevent the reverse of the code output order. Then, the code output determination unit 135 operates the code output omitting unit 136. The code output omitting unit 136 adds 1 to the coefficient skip count stored in the coefficient skip count memory 125 (S125). Further, the code output omitting unit 136 operates the coefficient reference value changing unit 132. The coefficient reference value changing unit 132 rewrites the value of the wavelet transform coefficient of the coefficient extraction coordinate in the transform coefficient memory 122 to 0 (S126). Then, the process proceeds to step S127.

他方、符号出力判定手段135は、符号FIFOメモリ123の空き容量が係数スキップ数の符号の符号長以上あれば、係数スキップ数符号化手段137を動作させる。係数スキップ数符号化手段137は、係数スキップ数メモリ125から係数スキップ数を読み出して符号化し、符号FIFOメモリ123に出力し、符号FIFO空き容量メモリ124に記憶されている空き容量を係数スキップ数の符号長だけ減算する(S120)。さらに係数スキップ数符号化手段137は、符号出力省略手段136を動作させる。符号出力省略手段136は、係数スキップ数メモリ125に記憶されている係数スキップ数をクリアして0にする(S121)。続いて、符号出力判定手段135は、符号FIFO空き容量メモリ124から再び空き容量を読み出し(S122)、ゴロムライス符号化手段134で生成された符号の符号長と符号FIFOメモリ123の空き容量とを比較して、今回生成された符号を符号FIFOメモリ123に出力できるかどうかを判定する(S123)。若し、出力可能であれば、符号出力判定手段135は、ゴロムライス符号化手段134に対して符号出力可を通知する。ゴロムライス符号化手段134は、符号FIFOメモリ123に今回生成した符号を出力し、符号FIFO空き容量メモリ124に記憶された空き容量をその符号長だけ減算する(S124)。そして、ステップS127の処理へと進む。他方、符号出力判定手段135は、ゴロムライス符号化手段134で生成された符号の符号長よりも符号FIFOメモリ123の空き容量の方が少ないときは、ゴロムライス符号化手段134に対して符号出力不可を通知する。さらに符号出力判定手段135は、符号出力省略手段136を動作させる。符号出力省略手段136は、係数スキップ数メモリ125に記憶された係数スキップ数を1だけ加算する(S125)。さらに符号出力省略手段136は、係数参照値変更手段132を動作させる。係数参照値変更手段132は、変換係数メモリ122における係数抽出座標のウェーブレット変換係数の値を0に書き換える(S126)。そして、ステップS127の処理へと進む。   On the other hand, the code output determination unit 135 operates the coefficient skip number encoding unit 137 if the free capacity of the code FIFO memory 123 is equal to or larger than the code length of the code of the coefficient skip number. The coefficient skip number encoding means 137 reads the coefficient skip number from the coefficient skip number memory 125, encodes it, outputs it to the code FIFO memory 123, and converts the free capacity stored in the code FIFO free capacity memory 124 to the coefficient skip number. Only the code length is subtracted (S120). Further, the coefficient skip number encoding unit 137 operates the code output omitting unit 136. The code output omitting means 136 clears the coefficient skip count stored in the coefficient skip count memory 125 to 0 (S121). Subsequently, the code output determination means 135 reads the free capacity from the code FIFO free capacity memory 124 again (S122), and compares the code length of the code generated by the Golomb-rice coding means 134 with the free capacity of the code FIFO memory 123. Then, it is determined whether or not the code generated this time can be output to the code FIFO memory 123 (S123). If output is possible, the code output determination unit 135 notifies the Golomb-Rice encoding unit 134 that code output is possible. The Golomb-Rice encoding means 134 outputs the code generated this time to the code FIFO memory 123, and subtracts the free capacity stored in the code FIFO free capacity memory 124 by the code length (S124). Then, the process proceeds to step S127. On the other hand, when the code FIFO memory 123 has less free space than the code length of the code generated by the Golomb-Rice encoding unit 134, the code output determination unit 135 prohibits the code output from the Golomb-Rice encoding unit 134. Notice. Further, the code output determination unit 135 operates the code output omitting unit 136. The code output omitting unit 136 adds 1 to the coefficient skip count stored in the coefficient skip count memory 125 (S125). Further, the code output omitting unit 136 operates the coefficient reference value changing unit 132. The coefficient reference value changing unit 132 rewrites the value of the wavelet transform coefficient of the coefficient extraction coordinate in the transform coefficient memory 122 to 0 (S126). Then, the process proceeds to step S127.

ステップS127においては、全てのウェーブレット変換係数についての処理が終了したかどうかが判定される。未処理のウェーブレット変換係数が残っていれば、係数抽出座標をシフトし(S128)、ステップS114に戻って、上述した処理と同様の処理を繰り返す。   In step S127, it is determined whether or not the processing for all wavelet transform coefficients has been completed. If unprocessed wavelet transform coefficients remain, the coefficient extraction coordinates are shifted (S128), the process returns to step S114, and the same process as described above is repeated.

全てのウェーブレット変換係数についての処理を終えていれば、符号出力判定手段135は、係数スキップ数メモリ125に記憶されている係数スキップ数が0か、1以上かを判定する(S129)。係数スキップ数が0であれば、図4の処理を終える。係数スキップ数が1以上であれば、符号出力判定手段135は、係数スキップ数の符号を格納できるだけの空き容量が符号FIFOメモリ123に有れば直ちに、無ければ、空きができるのを待って(S130)、係数スキップ数符号化手段137を動作させる。係数スキップ数符号化手段137は、係数スキップ数メモリ125から係数スキップ数を読み出して符号化し、符号FIFOメモリ123に出力する(S131)。そして、図4の処理を終える。   If the processing for all the wavelet transform coefficients has been completed, the code output determination unit 135 determines whether the coefficient skip count stored in the coefficient skip count memory 125 is 0, 1 or more (S129). If the number of coefficient skips is 0, the process of FIG. If the number of coefficient skips is 1 or more, the code output determination unit 135 immediately waits for a free space if there is enough free space in the code FIFO memory 123 to store the code for the number of coefficient skips ( S130), the coefficient skip number encoding means 137 is operated. The coefficient skip number encoding means 137 reads the coefficient skip number from the coefficient skip number memory 125, encodes it, and outputs it to the code FIFO memory 123 (S131). Then, the process of FIG. 4 is finished.

このように本実施の形態によれば、符号FIFOメモリ123の空き容量不足により、ゴロムライス符号化手段134で生成された符号を符号FIFOメモリ123に格納できなくなった場合、符号FIFOメモリ123に十分な空きができるまで、ゴロムライス符号化手段134で生成された符号を符号FIFOメモリ123へ出力する動作を停止する。その代わりに、符号を出力できなかったウェーブレット変換係数の個数を係数スキップ数として計数し、符号FIFOメモリ123に空きができた時点で、この係数スキップ数を符号化して符号FIFOメモリ123を通じて符号出力装置14に出力する。これにより、復号側では、係数スキップ数符号を復号することにより、幾つのウェーブレット変換係数が符号化されなかったかを識別できる。このため、どのウェーブレット変換係数の符号が消失したかすら復号側で分からなくなって復号が困難になるという事態を回避することができる。   As described above, according to the present embodiment, when the code generated by the Golomb-Rice encoding means 134 cannot be stored in the code FIFO memory 123 due to a lack of free space in the code FIFO memory 123, the code FIFO memory 123 has sufficient capacity. The operation of outputting the code generated by the Golomb-Rice encoding means 134 to the code FIFO memory 123 is stopped until a space is available. Instead, the number of wavelet transform coefficients that could not be output as a code is counted as the number of coefficient skips, and when the code FIFO memory 123 is empty, the coefficient skip number is encoded and output through the code FIFO memory 123. Output to the device 14. Thereby, the decoding side can identify how many wavelet transform coefficients have not been encoded by decoding the coefficient skip number code. For this reason, it is possible to avoid a situation in which even the code of which wavelet transform coefficient has disappeared is not known on the decoding side and decoding becomes difficult.

また、本実施の形態によれば、符号を出力できなかったウェーブレット変換係数については、係数参照値変更手段132によって、所定の値(本実施の形態では0)に変更する。これにより、既に符号化済の他のウェーブレット係数を参照して符号化パラメータkを決定する場合に、符号化側も、復号側も、同じ値のウェーブレット変換係数を参照することができ、パラメータkを用いたゴロムライス符号による符号化、復号を継続することができる。   Further, according to the present embodiment, the wavelet transform coefficient for which the code could not be output is changed to a predetermined value (0 in the present embodiment) by the coefficient reference value changing unit 132. Thereby, when the encoding parameter k is determined by referring to another wavelet coefficient that has already been encoded, the encoding side and the decoding side can refer to the wavelet transform coefficient having the same value, and the parameter k It is possible to continue encoding and decoding using the Golomb-Rice code using.

なお、本実施の形態では、変換処理としてウェーブレット変換を取り上げたが、本発明のデータ符号化装置はDCT(離散コサイン変換)など、他の種類の変換処理を行う符号化装置に対しても適用可能である。   In this embodiment, the wavelet transform is taken up as the conversion process, but the data encoding apparatus of the present invention is also applicable to an encoding apparatus that performs other types of conversion processes such as DCT (discrete cosine transform). Is possible.

[第2の実施の形態]
次に、本発明の第2の実施の形態について図面を参照して説明する。
[Second Embodiment]
Next, a second embodiment of the present invention will be described with reference to the drawings.

図5を参照すると、本発明の第2の実施の形態は、本発明をウェーブレット変換復号装置に適用したものであり、符号入力装置21と、プログラム制御により動作するデータ処理装置22と、データ記憶装置23と、画像出力装置24とから構成されている。   Referring to FIG. 5, in the second embodiment of the present invention, the present invention is applied to a wavelet transform decoding device, which includes a code input device 21, a data processing device 22 operated by program control, and a data storage. The apparatus 23 and the image output apparatus 24 are comprised.

符号入力装置21は、復号対象となる符号を入力する装置であり、例えば磁気ディスク装置や通信装置などで構成される。   The code input device 21 is a device for inputting a code to be decoded, and is configured by, for example, a magnetic disk device or a communication device.

データ記憶装置23は、変換係数メモリ231と、画像メモリ232とを備えている。   The data storage device 23 includes a conversion coefficient memory 231 and an image memory 232.

変換係数メモリ231は、データ処理装置22により復号されたウェーブレット変換係数を格納する。   The transform coefficient memory 231 stores the wavelet transform coefficients decoded by the data processing device 22.

画像メモリ232は、データ処理装置22により復号された画像を格納する。   The image memory 232 stores the image decoded by the data processing device 22.

データ処理装置22は、復号パラメータ決定手段221と、ゴロムライス復号手段222と、係数スキップ手段223と、画像逆変換手段224とを備えている。   The data processing device 22 includes a decoding parameter determination unit 221, a Golomurice decoding unit 222, a coefficient skip unit 223, and an image inverse conversion unit 224.

復号パラメータ決定手段221は、復号対象となるウェーブレット変換係数毎に、変換係数メモリ231に記憶された1以上の既に復号済の他のウェーブレット変換係数に基づいて、符号化に使われた符号化パラメータkと同じ値の復号パラメータを算出する。   The decoding parameter determination unit 221 uses, for each wavelet transform coefficient to be decoded, a coding parameter used for encoding based on one or more already decoded other wavelet transform coefficients stored in the transform coefficient memory 231. A decoding parameter having the same value as k is calculated.

ゴロムライス復号手段222は、復号対象のウェーブレット変換係数を、符号入力装置21から入力された符号から復号する。具体的には、ゴロムライス復号手段222は、入力された符号が予め定められた上限長maxに等しいビット"0"の連続を含むか否かによって、上述した第1の符号化方法(ゴロムライス符号化)による符号か、上述した第2の符号化方法(ロウモードによる符号化)による符号かを判別する。第1の符号化方法による符号であれば、ゴロムライス復号手段222は、復号パラメータ決定手段221で決定された復号パラメータkを用いて当該符号であるゴロムライス符号を復号し、得られたウェーブレット変換係数を変換係数メモリ231に記憶する。   The Golomb-rice decoding means 222 decodes the wavelet transform coefficient to be decoded from the code input from the code input device 21. Specifically, the Golomb-Rice decoding means 222 determines whether the input code includes the continuation of the bit “0” equal to the predetermined upper limit length max. ) Or the code according to the above-described second encoding method (encoding in the low mode). If the code is based on the first encoding method, the Golomb-Rice decoding unit 222 uses the decoding parameter k determined by the decoding parameter determination unit 221 to decode the Golom-Rice code, which is the code, and obtains the obtained wavelet transform coefficient. Stored in the conversion coefficient memory 231.

また、第2の符号化方法による符号であれば、ゴロムライス復号手段222は、上限長maxに等しいビット"0"の連続の直後における所定ビット長の2進表記を復号結果とする。そして、復号結果の値が32以上であれば、ウェーブレット変換係数の復号は成功したものとして、その復号結果をウェーブレット変換係数の復号値として変換係数メモリ231に記憶する。他方、復号値が32未満であれば、ウェーブレット変換係数の復号は失敗したものとして、その復号結果から係数スキップ数の復号値を得て係数スキップ手段223に伝達する。例えば、上述したようにmビットの2進表記の0をスキップ数1の符号とし、mビットの2進表記の1をスキップ数2の符号とし、…、mビットの2進表記の31をスキップ数32の符号とする場合、復号結果に1を加えた値を係数スキップ数の復号値とする。   If the code is based on the second encoding method, the Golomb-Rice decoding means 222 uses the binary representation of a predetermined bit length immediately after the continuation of the bit “0” equal to the upper limit length max as the decoding result. If the value of the decoding result is 32 or more, it is determined that the wavelet transform coefficient has been successfully decoded, and the decoding result is stored in the transform coefficient memory 231 as a decoded value of the wavelet transform coefficient. On the other hand, if the decoded value is less than 32, it is assumed that the decoding of the wavelet transform coefficient has failed, and the decoded value of the coefficient skip count is obtained from the decoding result and transmitted to the coefficient skip means 223. For example, as described above, m-bit binary notation 0 is used as a skip number 1 code, m-bit binary notation 1 is used as a skip number 2 code,..., M-bit binary notation 31 is skipped. When the code of Equation 32 is used, a value obtained by adding 1 to the decoding result is set as a decoded value of the coefficient skip number.

係数スキップ手段223は、ゴロムライス復号手段222から受け取った係数スキップ数だけ、値0のウェーブレット変換係数を生成して変換係数メモリ231に記憶する。   The coefficient skip means 223 generates wavelet transform coefficients having a value of 0 for the number of coefficient skips received from the Golomb-rice decoding means 222 and stores it in the transform coefficient memory 231.

画像逆変換手段224は、変換係数メモリ231に記憶されたウェーブレット変換係数を読み出して、ウェーブレット逆変換を施し、得られた画素データを画像メモリ232に記憶する。   The image inverse transform unit 224 reads the wavelet transform coefficient stored in the transform coefficient memory 231, performs wavelet inverse transform, and stores the obtained pixel data in the image memory 232.

画像出力装置24は、例えばディスプレイ装置で構成され、画像メモリ232に記憶された画素データを読み出し、出力する。   The image output device 24 is configured by a display device, for example, and reads and outputs pixel data stored in the image memory 232.

次に図6のフローチャートを参照して、本実施の形態の全体の動作を説明する。   Next, the overall operation of the present embodiment will be described with reference to the flowchart of FIG.

まず、係数抽出座標が初期化される(S201)。   First, the coefficient extraction coordinates are initialized (S201).

次に、復号パラメータ決定手段221は、係数抽出座標のウェーブレット変換係数の復号に使用する既に復号済の他のウェーブレット変換係数を参照係数として変換係数メモリ231から読み出す(S202)。なお、該当する他のウェーブレット変換系数が存在しない場合には、存在しない他のウェーブレット変換係数の値として、所定値(例えば0)を用いる。   Next, the decoding parameter determination means 221 reads out from the transform coefficient memory 231 as another reference wavelet the already decoded wavelet transform coefficient used for decoding the wavelet transform coefficient of the coefficient extraction coordinates (S202). When there is no other applicable wavelet transform coefficient, a predetermined value (for example, 0) is used as the value of the other wavelet transform coefficient that does not exist.

次に、ゴロムライス復号手段222は、符号入力装置21から入力された符号から係数抽出座標のウェーブレット変換係数を復号する(S204)。ゴロムライス復号手段222は、ウェーブレット変換係数の復号に成功したときは、その復号値を係数抽出座標のウェーブレット変換係数として変換係数メモリ231に記憶する(S205、S206)。他方、ウェーブレット変換係数の復号に失敗したときは、得られた復号値から係数スキップ数を得て、係数スキップ手段223へ出力する。係数スキップ手段223は、係数抽出座標から係数スキップ数分の各座標のウェーブレット変換係数として、値0のウェーブレット変換係数を生成して変換係数メモリ231に記憶する(S207)。   Next, the Golombrice decoding means 222 decodes the wavelet transform coefficient of the coefficient extraction coordinates from the code input from the code input device 21 (S204). When the Golombrice decoding means 222 succeeds in decoding the wavelet transform coefficient, the Golombrice decoding means 222 stores the decoded value in the transform coefficient memory 231 as the wavelet transform coefficient of the coefficient extraction coordinates (S205, S206). On the other hand, when the decoding of the wavelet transform coefficient fails, the coefficient skip number is obtained from the obtained decoded value and output to the coefficient skip means 223. The coefficient skip means 223 generates a wavelet transform coefficient of value 0 as the wavelet transform coefficient of each coordinate corresponding to the number of coefficient skips from the coefficient extraction coordinates, and stores it in the transform coefficient memory 231 (S207).

次に、全係数の復号が終了したかどうかを判別し(S208)、終了していなければ、係数抽出座標を次の座標にシフトし(S209)、ステップS202に戻って上述と同様の処理を繰り返す。   Next, it is determined whether or not the decoding of all coefficients has been completed (S208). If not completed, the coefficient extraction coordinates are shifted to the next coordinates (S209), and the process returns to step S202 to perform the same processing as described above. repeat.

全係数の復号が終了していれば、画像逆変換手段224は、変換係数メモリ231に記憶されたウェーブレット変換係数に対してウェーブレット逆変換を行い、得られた画素データを画像メモリ232に記憶する(S210)。   If the decoding of all the coefficients has been completed, the image inverse transform unit 224 performs wavelet inverse transform on the wavelet transform coefficients stored in the transform coefficient memory 231 and stores the obtained pixel data in the image memory 232. (S210).

画像メモリ232に記憶された画像は、画像出力装置24に出力される。   The image stored in the image memory 232 is output to the image output device 24.

本実施の形態は、第1の実施の形態で符号化されたデータの復号装置に相当する。係数スキップ数を復号し、この復号された係数スキップ数だけ値0のウェーブレット変換係数を生成することにより、復号を破たんなく継続することができる利点がある。   This embodiment corresponds to a data decoding apparatus encoded in the first embodiment. By decoding the number of coefficient skips and generating wavelet transform coefficients having a value of 0 by the number of decoded coefficient skips, there is an advantage that decoding can be continued without failure.

また、係数スキップ数の復号によって、幾つのウェーブレット変換係数が符号化されずに送信されたかを復号側で検知することができる。このため、必要ならば符号側に対して改めて再送要求を行うなどの対処をとることもできる。   Further, by decoding the number of coefficient skips, the decoding side can detect how many wavelet transform coefficients have been transmitted without being encoded. For this reason, if necessary, it is possible to take measures such as making a retransmission request to the code side again.

なお、本実施の形態では、変換処理としてウェーブレット変換を取り上げたが、本発明のデータ復号装置はDCT(離散コサイン変換)など、他の種類の変換処理に対しても適用可能である。   In this embodiment, the wavelet transform is taken up as the conversion process, but the data decoding apparatus of the present invention can be applied to other types of conversion processes such as DCT (discrete cosine transform).

[第3の実施の形態]
図7を参照すると、本発明の第3の実施の形態は、本発明を予測符号化装置に適用したものであり、画像入力装置31と、データ記憶装置32と、プログラム制御により動作するデータ処理装置33と、符号出力装置34とから構成されている。
[Third embodiment]
Referring to FIG. 7, in the third embodiment of the present invention, the present invention is applied to a predictive encoding device, and an image input device 31, a data storage device 32, and data processing that operates by program control. The apparatus 33 and the code output apparatus 34 are comprised.

画像入力装置31は、第1の実施の形態における図1の画像入力装置11と同じものである。   The image input device 31 is the same as the image input device 11 of FIG. 1 in the first embodiment.

データ記憶装置32は、画像メモリ321と、画素予測値メモリ322と、予測誤差メモリ323と、予測誤差統計メモリ324と、符号FIFOメモリ325と、符号FIFO空き容量メモリ326と、画素スキップ数メモリ327とを含む。   The data storage device 32 includes an image memory 321, a pixel prediction value memory 322, a prediction error memory 323, a prediction error statistical memory 324, a code FIFO memory 325, a code FIFO free capacity memory 326, and a pixel skip count memory 327. Including.

画像メモリ321は、画像入力装置31から入力された画像を記憶する。   The image memory 321 stores an image input from the image input device 31.

画素予測値メモリ322は、データ処理装置33で生成された画素予測値を記憶する。   The predicted pixel value memory 322 stores the predicted pixel value generated by the data processing device 33.

予測誤差メモリ323は、データ処理装置33で生成された予測誤差を記憶する。   The prediction error memory 323 stores the prediction error generated by the data processing device 33.

予測誤差統計メモリ324は、予測誤差の統計値を記憶する。   The prediction error statistical memory 324 stores statistical values of prediction errors.

符号FIFOメモリ325は、予測誤差メモリ323に記憶された予測誤差をゴロムライス符号化した符号を先入れ先出し方式で記憶するバッファである。   The code FIFO memory 325 is a buffer that stores, in a first-in first-out manner, a code obtained by Golomu-Rice encoding the prediction error stored in the prediction error memory 323.

符号FIFO空き容量メモリ326は、符号FIFOメモリ325の空き容量を記憶する。   The code FIFO free capacity memory 326 stores the free capacity of the code FIFO memory 325.

画素スキップ数メモリ327は、予測誤差の符号が符号FIFOメモリ325に出力されなかった画素の数を記憶する。   The pixel skip number memory 327 stores the number of pixels for which the sign of the prediction error has not been output to the code FIFO memory 325.

データ処理装置33は、画素参照値変更手段331と、画素予測手段332と、予測誤差算出手段333と、符号化パラメータ決定手段334と、ゴロムライス符号化手段335と、符号出力判定手段336と、符号出力省略手段337と、画素スキップ数符号化手段338と、符号出力手段339とを備えている。   The data processing device 33 includes a pixel reference value changing unit 331, a pixel predicting unit 332, a prediction error calculating unit 333, an encoding parameter determining unit 334, a Golomurice encoding unit 335, a code output determining unit 336, a code An output omission unit 337, a pixel skip number encoding unit 338, and a code output unit 339 are provided.

画素予測手段332は、画像メモリ321に記憶された画素毎に、その画素の値を既に符号化済の他の画素の値から予め決められた方法で予測し、その予測値を画素予測値メモリ322に記憶する。予測方法は任意である。例えば、水平方向をx、垂直方向をyとし、画素の座標を(x,y)で表現するものとして、座標(i,j)の画素の値を、座標(i―1,j−1)の画素の値、座標(i,j−1)の画素の値と、座標(i―1,j)の画素の値とから予測するようにしても良い。   For each pixel stored in the image memory 321, the pixel prediction unit 332 predicts the value of the pixel from a value of another pixel that has already been encoded, and the predicted value is stored in the pixel predicted value memory. Store at 322. The prediction method is arbitrary. For example, assuming that the horizontal direction is x, the vertical direction is y, and the pixel coordinates are expressed by (x, y), the pixel value at coordinates (i, j) is expressed as coordinates (i-1, j-1). It is also possible to predict from the value of the pixel, the value of the pixel at the coordinates (i, j−1), and the value of the pixel at the coordinates (i−1, j).

予測誤差算出手段333は、画像メモリ321に記憶された画素毎に、その画素の予測誤差を算出し、予測誤差メモリ323に記憶する。或る画素の予測誤差は、画像メモリ321に記憶されたその画素の値と、画素予測値メモリ322に記憶されたその画素の予測値との差として算出される。   The prediction error calculation unit 333 calculates a prediction error of each pixel stored in the image memory 321 and stores the prediction error in the prediction error memory 323. The prediction error of a certain pixel is calculated as the difference between the value of that pixel stored in the image memory 321 and the prediction value of that pixel stored in the pixel prediction value memory 322.

符号化パラメータ決定手段334は、符号化対象となる予測誤差の符号化パラメータを、予測誤差メモリ323に記憶された予測誤差のうち、既に符号化された1以上の他の予測誤差に基づいて算出する。符号化パラメータを決定する方法は任意である。例えば、特許文献1に記載される方法と同様の方法を用いることができる。その場合、符号化パラメータ決定手段334は、予測誤差統計メモリ324に、それまでに出現した予測誤差の絶対値の累積値、累積回数といった統計値を記憶する。   The encoding parameter determination unit 334 calculates the encoding parameter of the prediction error to be encoded based on one or more other already encoded prediction errors among the prediction errors stored in the prediction error memory 323. To do. The method for determining the encoding parameter is arbitrary. For example, a method similar to the method described in Patent Document 1 can be used. In that case, the encoding parameter determination unit 334 stores statistical values such as the cumulative value of the absolute value and the cumulative number of prediction errors that have appeared so far in the prediction error statistical memory 324.

算出された符号化パラメータkは、符号化パラメータ決定手段334からゴロムライス符号化手段335に伝達される。   The calculated encoding parameter k is transmitted from the encoding parameter determination unit 334 to the Golomb-Rice encoding unit 335.

ゴロムライス符号化手段335は、符号化対象データに対して、第1の実施の形態の図1のゴロムライス符号化手段134と同様の方法(第1の符号化方法、第2の符号化方法)で符号化を行う。ゴロムライス符号化手段335は、生成した符号の符号長を符号出力判定手段336に伝達し、符号を出力して良いか否かの判定結果を符号出力判定手段336から受け取る。符号出力可の判定結果を受け取った場合、ゴロムライス符号化手段335は、上記生成した符号を符号FIFO325に格納し、符号FIFO空き容量メモリ326に記憶されている空き容量を、今回出力した符号の符号量だけ減算する。他方、ゴロムライス符号化手段335は、符号出力不可の判定結果を受け取った場合、上記生成した符号は符号FIFO325へ格納せずに破棄する。   The Golomb-Rice encoding means 335 uses the same method (first encoding method and second encoding method) as the Golomb-Rice encoding means 134 of FIG. 1 of the first embodiment for the data to be encoded. Encoding is performed. The Golomb-Rice encoding unit 335 transmits the code length of the generated code to the code output determination unit 336 and receives a determination result as to whether or not the code can be output from the code output determination unit 336. When the determination result indicating that the code can be output is received, the Golomb-Rice encoding means 335 stores the generated code in the code FIFO 325 and uses the free capacity stored in the code FIFO free capacity memory 326 as the code of the code output this time. Subtract by amount. On the other hand, when the Golomb-Rice encoding means 335 receives the determination result indicating that the code cannot be output, the generated code is discarded without being stored in the code FIFO 325.

符号出力判定手段336は、ゴロムライス符号化手段335で生成された符号の符号長、符号FIFO空き容量メモリ326に記憶されている符号FIFOメモリ325の空き容量、画素スキップ数メモリ327に記憶されている画素スキップ数、画素スキップ数符号化手段338で生成された画素スキップ数を符号化した符号の符号長に基づいて、それら各符号の符号FIFOメモリ325への出力の可否判定を実施し、各部を制御する。   The code output determination unit 336 stores the code length of the code generated by the Golomb-Rice encoding unit 335, the free space of the code FIFO memory 325 stored in the code FIFO free space memory 326, and the pixel skip count memory 327. Based on the code length of the code obtained by encoding the number of pixel skips and the number of pixel skips generated by the pixel skip number encoding unit 338, whether or not each code is output to the code FIFO memory 325 is determined. Control.

符号出力省略手段337は、符号化対象となる画素の予測誤差についてゴロムライス符号化手段335で生成された符号が符号FIFO325に格納されなかった場合、符号出力判定手段336からの指示に従い、画素スキップ数メモリ327に記憶されている画素スキップ数を1加算する。また、符号出力省略手段337は、予測誤差が符号化されなかった画素の値を変更するように画素参照値変更手段331に通知する。   When the code generated by the Golomb-Rice encoding unit 335 is not stored in the code FIFO 325 for the prediction error of the pixel to be encoded, the code output omitting unit 337 follows the instruction from the code output determining unit 336 and the number of pixel skips. The number of pixel skips stored in the memory 327 is incremented by one. Further, the code output omitting unit 337 notifies the pixel reference value changing unit 331 to change the value of the pixel for which the prediction error is not encoded.

画素参照値変更手段331は、符号出力省略手段337からの通知を受けて、画像メモリ321に記憶された画素の値のうち、予測画素が符号化されなかった画素の値を変更する。本実施の形態は、符号化されなかった予測誤差は、符号側および復号側ともに0と見なすように取り決めている。従って、画素参照値変更手段331は、予測誤差が0となるように画素の値を変更する。具体的には、画素参照値変更手段331は、予測画素が符号化されなかった画素の予測値を画素予測値メモリ322から読み出し、画像メモリ321中の当該画素の値に上書きする。なお、予測誤差を0以外の値Dと見なすように取り決めている場合、画素参照値変更手段331は、画素の予測値にDを加えた値で当該画素の値を書き換える。   In response to the notification from the code output omitting unit 337, the pixel reference value changing unit 331 changes the value of the pixel in which the predicted pixel is not encoded among the pixel values stored in the image memory 321. In the present embodiment, the prediction error that has not been encoded is determined to be regarded as 0 on both the encoding side and the decoding side. Therefore, the pixel reference value changing unit 331 changes the pixel value so that the prediction error becomes zero. Specifically, the pixel reference value changing unit 331 reads the predicted value of the pixel in which the predicted pixel has not been encoded from the pixel predicted value memory 322 and overwrites the value of the pixel in the image memory 321. When it is determined that the prediction error is regarded as a value D other than 0, the pixel reference value changing unit 331 rewrites the value of the pixel with a value obtained by adding D to the predicted value of the pixel.

画素スキップ数符号化手段338は、符号出力判定手段336からの通知を受けて、画素スキップ数メモリ327に記憶された画素スキップ数を、第1の実施の形態の図1の係数スキップ数符号化手段137と同様の方法で符号化して、符号FIFOメモリ325に記憶し、符号FIFO空き容量メモリ326に記憶されている空き容量を、今回出力した符号の符号量だけ減算する。   The pixel skip number encoding unit 338 receives the notification from the code output determination unit 336 and converts the pixel skip number stored in the pixel skip number memory 327 into the coefficient skip number encoding of FIG. 1 of the first embodiment. The data is encoded by the same method as that of the means 137, stored in the code FIFO memory 325, and the free space stored in the code FIFO free space memory 326 is subtracted by the code amount of the code output this time.

符号出力手段339は、符号FIFOメモリ325に記憶された符号を読み出して、符号出力装置34へ出力する。また、符号出力手段339は、符号FIFOメモリ325から読み出した符号の符号量に応じて、符号FIFO空き容量メモリ326に記憶された空き容量を増大する。   The code output means 339 reads the code stored in the code FIFO memory 325 and outputs it to the code output device 34. The code output means 339 increases the free capacity stored in the code FIFO free capacity memory 326 in accordance with the code amount of the code read from the code FIFO memory 325.

次に図8および図9のフローチャートを参照して、本実施の形態の全体の動作を説明する。   Next, the overall operation of the present embodiment will be described with reference to the flowcharts of FIGS.

データ処理装置33は、図8に示す動作と図9に示す動作とを並行して実行する。図8に示す動作では、まず、符号FIFOメモリ325の記憶内容をクリアする(S301)。その後、符号出力手段339は、符号出力装置34への信号送信タイミング毎に、符号FIFOメモリ325に未送信データがあるかどうかを調べ、あれば未送信データを符号出力装置34へ送信して、符号FIFO空き容量メモリ326に記憶された空き容量を更新する操作を繰り返す(S302〜S306)。   The data processing device 33 executes the operation shown in FIG. 8 and the operation shown in FIG. 9 in parallel. In the operation shown in FIG. 8, first, the stored contents of the code FIFO memory 325 are cleared (S301). Thereafter, the code output means 339 checks whether there is untransmitted data in the code FIFO memory 325 at every signal transmission timing to the code output device 34, and if there is, transmits the untransmitted data to the code output device 34, The operation of updating the free space stored in the code FIFO free space memory 326 is repeated (S302 to S306).

他方、図9に示す動作では、画像入力装置31から入力された画像の各画素に対する予測誤差の符号化が行われて、符号FIFOメモリ325に蓄積される動作が行われる。具体的には、以下のような動作が行われる。   On the other hand, in the operation illustrated in FIG. 9, the prediction error is encoded for each pixel of the image input from the image input device 31, and the operation stored in the code FIFO memory 325 is performed. Specifically, the following operations are performed.

まず、画素抽出座標が初期化される(S311)。次に、符号出力省略手段337は、画素スキップ数メモリ327に記憶されている画素スキップ数を0にクリアする(S312)。   First, pixel extraction coordinates are initialized (S311). Next, the code output omitting unit 337 clears the number of pixel skips stored in the pixel skip number memory 327 to 0 (S312).

次に、画素予測手段332は、画素抽出座標の画素の予測値を求める符号化済の他の画素を画像メモリ321から読み出す(S313)。次に、画素予測手段332は、上記読み出した符号化済の他の画素から画素抽出座標の画素の予測値を求めて画素予測値メモリ322に記憶し、予測誤差算出手段333は、画素抽出座標の画素の値とその予測値との差分を予測誤差として求めて予測誤差メモリ323に記憶する(S314)。   Next, the pixel predicting unit 332 reads other encoded pixels for obtaining the predicted value of the pixel at the pixel extraction coordinate from the image memory 321 (S313). Next, the pixel prediction unit 332 calculates a pixel predicted value of the pixel extraction coordinates from the other encoded pixels that have been read out and stores them in the pixel predicted value memory 322, and the prediction error calculation unit 333 calculates the pixel extraction coordinates. The difference between the pixel value and the predicted value is obtained as a prediction error and stored in the prediction error memory 323 (S314).

次に、符号化パラメータ決定手段334は、画素抽出座標の画素の予測値をゴロムライス符号化するための符号化パラメータkを予測誤差統計メモリ324に記憶された統計値から決定する(S315)。   Next, the encoding parameter determination means 334 determines an encoding parameter k for performing Golomb-Rice encoding on the predicted value of the pixel at the pixel extraction coordinate from the statistical value stored in the prediction error statistical memory 324 (S315).

次に、ゴロムライス符号化手段335は、画素抽出座標の画素の予測誤差の符号化を行い、その符号長を符号出力判定手段336に伝達する(S316)。ゴロムライス符号化手段335は、単進符号の符号長が上限長maxを超えない場合、符号化パラメータ決定手段334で決定された符号化パラメータkを用いて、第1の符号化方法(ゴロムライス符号化)で符号化する。また、ゴロムライス符号化手段335は、単進符号の符号長が上限長maxを超える場合、第2の符号化方法(ロウモードによる符号化)で符号化する。   Next, the Golomb-Rice encoding unit 335 encodes the prediction error of the pixel at the pixel extraction coordinate, and transmits the code length to the code output determination unit 336 (S316). If the code length of the unicode code does not exceed the upper limit length max, the Golomb-Rice encoding unit 335 uses the encoding parameter k determined by the encoding parameter determination unit 334 to perform the first encoding method (Golom-Rice encoding). ). Further, when the code length of the unicode code exceeds the upper limit length max, the Golomb-Rice encoding means 335 performs encoding by the second encoding method (encoding in the low mode).

符号出力判定手段336は、符号FIFO空き容量メモリ326から符号FIFOメモリ325の空き容量を読み出す(S317)。また符号出力判定手段336は、画素スキップ数メモリ327から画素スキップ数を読み出し、画素スキップ数が0か、1以上かを判定する(S319)。画素スキップ数が0であれば、符号出力判定手段336は、ゴロムライス符号化手段335で生成された符号の符号長と符号FIFOメモリ325の空き容量とを比較して、今回生成された符号を符号FIFOメモリ325に出力できるかどうかを判定する(S323)。若し、出力可能であれば、符号出力判定手段336は、ゴロムライス符号化手段335に対して符号出力可を通知する。ゴロムライス符号化手段335は、符号FIFOメモリ325に今回生成した符号を出力し、符号FIFO空き容量メモリ326に記憶された空き容量をその符号長だけ減算する(S324)。なお、このようにゴロムライス符号化手段335で生成された符号が符号FIFOメモリ325に出力された場合、符号化パラメータ決定手段334は、予測誤差統計メモリ324を更新する。つまり、予測誤差メモリ323から画素抽出座標の画素の予測値を読み出し、この読み出した予測値と予測誤差統計メモリ324に記憶された統計値とから新たな統計値を算出して、予測誤差統計メモリ324に記憶しておく。そして、ステップS327の処理へと進む。   The code output determination unit 336 reads the free capacity of the code FIFO memory 325 from the code FIFO free capacity memory 326 (S317). Further, the code output determination unit 336 reads the pixel skip number from the pixel skip number memory 327 and determines whether the pixel skip number is 0 or 1 (S319). If the number of pixel skips is 0, the code output determination unit 336 compares the code length of the code generated by the Golomb-Rice encoding unit 335 with the free capacity of the code FIFO memory 325 and encodes the code generated this time. It is determined whether or not the data can be output to the FIFO memory 325 (S323). If output is possible, the code output determination unit 336 notifies the Golomb-Rice encoding unit 335 that code output is possible. The Golomb-Rice encoding means 335 outputs the code generated this time to the code FIFO memory 325, and subtracts the free capacity stored in the code FIFO free capacity memory 326 by the code length (S324). When the code generated by the Golomb-Rice encoding unit 335 is output to the code FIFO memory 325, the encoding parameter determining unit 334 updates the prediction error statistical memory 324. That is, the prediction value of the pixel at the pixel extraction coordinate is read from the prediction error memory 323, and a new statistical value is calculated from the read prediction value and the statistical value stored in the prediction error statistical memory 324, and the prediction error statistical memory Stored in 324. Then, the process proceeds to step S327.

他方、符号出力判定手段336は、ゴロムライス符号化手段335で生成された符号の符号長よりも符号FIFOメモリ325の空き容量の方が少ないときは、ゴロムライス符号化手段335に対して符号出力不可を通知する。さらに符号出力判定手段336は、符号出力省略手段337を動作させる。符号出力省略手段337は、画素スキップ数メモリ327に記憶された画素スキップ数を1だけ加算する(S325)。さらに符号出力省略手段337は、画素参照値変更手段331を動作させる。画素参照値変更手段331は、画像メモリ321における係数抽出座標の画素の値をその予測値で書き換える(S326)。そして、ステップS327の処理へと進む。   On the other hand, the code output determination unit 336 prohibits code output from the Golomb-Rice encoding unit 335 when the free space in the code FIFO memory 325 is smaller than the code length of the code generated by the Golo-Murice encoding unit 335. Notice. Further, the code output determining unit 336 operates the code output omitting unit 337. The code output omission unit 337 adds 1 to the number of pixel skips stored in the pixel skip number memory 327 (S325). Further, the code output omitting unit 337 operates the pixel reference value changing unit 331. The pixel reference value changing unit 331 rewrites the pixel value of the coefficient extraction coordinate in the image memory 321 with the predicted value (S326). Then, the process proceeds to step S327.

また符号出力判定手段336は、ステップS318において、画素スキップ数メモリ327に記憶されている画素スキップ数が1以上であると判定した場合、ステップS317で読み出した符号FIFO325の空き容量と画素スキップ数の符号の符号長とを比較して、画素スキップ数の符号を符号FIFOメモリ325に出力できるかどうかを判定する(S319)。若し、出力不可能であれば、符号の出力順序の逆転が生じるのを防ぐために、符号出力判定手段336は、ゴロムライス符号化手段335に対して符号出力不可を通知する。そして、符号出力判定手段336は、符号出力省略手段337を動作させる。符号出力省略手段337は、画素スキップ数メモリ327に記憶された画素スキップ数を1だけ加算する(S325)。さらに符号出力省略手段337は、画素参照値変更手段331を動作させる。画素参照値変更手段331は、画像メモリ321における画素抽出座標の画素値をその画素の予測値に置き換える(S326)。そして、ステップS327の処理へと進む。   If the code output determination unit 336 determines in step S318 that the number of pixel skips stored in the pixel skip number memory 327 is 1 or more, the code output determination unit 336 sets the free space and the number of pixel skips of the code FIFO 325 read in step S317. The code length of the code is compared to determine whether or not the code of the pixel skip count can be output to the code FIFO memory 325 (S319). If the output is impossible, the code output determination unit 336 notifies the Golomb-Rice encoding unit 335 that the code output is impossible in order to prevent the reverse of the code output order. Then, the code output determining unit 336 operates the code output omitting unit 337. The code output omission unit 337 adds 1 to the number of pixel skips stored in the pixel skip number memory 327 (S325). Further, the code output omitting unit 337 operates the pixel reference value changing unit 331. The pixel reference value changing unit 331 replaces the pixel value of the pixel extraction coordinate in the image memory 321 with the predicted value of the pixel (S326). Then, the process proceeds to step S327.

他方、符号出力判定手段336は、符号FIFOメモリ325の空き容量が画素スキップ数の符号の符号長以上あれば、画素スキップ数符号化手段338を動作させる。画素スキップ数符号化手段338は、画素スキップ数メモリ327から画素スキップ数を読み出して符号化し、符号FIFOメモリ325に出力し、符号FIFO空き容量メモリ326に記憶されている空き容量を画素スキップ数の符号長だけ減算する(S320)。さらに画素スキップ数符号化手段338は、符号出力省略手段337を動作させる。符号出力省略手段337は、画素スキップ数メモリ327に記憶されている画素スキップ数をクリアして0にする(S321)。続いて、符号出力判定手段336は、符号FIFO空き容量メモリ326から再び空き容量を読み出し(S322)、ゴロムライス符号化手段335で生成された符号の符号長と符号FIFOメモリ325の空き容量とを比較して、今回生成された符号を符号FIFOメモリ325に出力できるかどうかを判定する(S323)。若し、出力可能であれば、符号出力判定手段336は、ゴロムライス符号化手段335に対して符号出力可を通知する。ゴロムライス符号化手段335は、符号FIFOメモリ325に今回生成した符号を出力し、符号FIFO空き容量メモリ326に記憶された空き容量をその符号長だけ減算する(S324)。そして、ステップS327の処理へと進む。他方、符号出力判定手段336は、ゴロムライス符号化手段335で生成された符号の符号長よりも符号FIFOメモリ325の空き容量の方が少ないときは、ゴロムライス符号化手段335に対して符号出力不可を通知する。さらに符号出力判定手段336は、符号出力省略手段337を動作させる。符号出力省略手段337は、画素スキップ数メモリ327に記憶された係数スキップ数を1だけ加算する(S325)。さらに符号出力省略手段337は、画素参照値変更手段331を動作させる。画素参照値変更手段331は、画像メモリ321における画像抽出座標の画素の値をその予測値で置き換える(S326)。そして、ステップS327の処理へと進む。   On the other hand, the code output determination unit 336 operates the pixel skip number encoding unit 338 if the free capacity of the code FIFO memory 325 is greater than or equal to the code length of the code of the pixel skip number. The pixel skip number encoding means 338 reads out the pixel skip number from the pixel skip number memory 327, encodes it, outputs it to the code FIFO memory 325, and sets the free capacity stored in the code FIFO free capacity memory 326 as the pixel skip number. Only the code length is subtracted (S320). Further, the pixel skip number encoding unit 338 operates the code output omitting unit 337. The code output omitting unit 337 clears the pixel skip number stored in the pixel skip number memory 327 to 0 (S321). Subsequently, the code output determination means 336 reads the free capacity from the code FIFO free capacity memory 326 again (S322), and compares the code length of the code generated by the Golomb-rice coding means 335 with the free capacity of the code FIFO memory 325. Then, it is determined whether or not the code generated this time can be output to the code FIFO memory 325 (S323). If output is possible, the code output determination unit 336 notifies the Golomb-Rice encoding unit 335 that code output is possible. The Golomb-Rice encoding means 335 outputs the code generated this time to the code FIFO memory 325, and subtracts the free capacity stored in the code FIFO free capacity memory 326 by the code length (S324). Then, the process proceeds to step S327. On the other hand, the code output determination unit 336 prohibits code output from the Golomb-Rice encoding unit 335 when the free space in the code FIFO memory 325 is smaller than the code length of the code generated by the Golo-Murice encoding unit 335. Notice. Further, the code output determining unit 336 operates the code output omitting unit 337. The code output omitting unit 337 adds 1 to the coefficient skip count stored in the pixel skip count memory 327 (S325). Further, the code output omitting unit 337 operates the pixel reference value changing unit 331. The pixel reference value changing unit 331 replaces the pixel value of the image extraction coordinate in the image memory 321 with the predicted value (S326). Then, the process proceeds to step S327.

ステップS327においては、全ての画素についての処理が終了したかどうかが判定される。未処理の画素が残っていれば、画像抽出座標をシフトし(S328)、ステップS313に戻って、上述した処理と同様の処理を繰り返す。   In step S327, it is determined whether or not processing for all pixels has been completed. If unprocessed pixels remain, the image extraction coordinates are shifted (S328), the process returns to step S313, and the same process as described above is repeated.

全ての画素についての処理を終えていれば、符号出力判定手段336は、画素スキップ数メモリ327に記憶されている画素スキップ数が0か、1以上かを判定する(S329)。画素スキップ数が0であれば、図9の処理を終える。画素スキップ数が1以上であれば、符号出力判定手段336は、画素スキップ数の符号を格納できるだけの空き容量が符号FIFOメモリ325に有れば直ちに、無ければ、空きができるのを待って(S330)、画素スキップ数符号化手段338を動作させる。画素スキップ数符号化手段338は、画素スキップ数メモリ327から画素スキップ数を読み出して符号化し、符号FIFOメモリ325に出力する(S331)。そして、図9の処理を終える。   If the processing for all the pixels has been completed, the code output determination unit 336 determines whether the number of pixel skips stored in the pixel skip number memory 327 is 0, 1 or more (S329). If the number of pixel skips is 0, the process in FIG. If the number of pixel skips is 1 or more, the code output determination unit 336 immediately waits if there is enough free space in the code FIFO memory 325 to store the code for the number of pixel skips. S330), the pixel skip number encoding means 338 is operated. The pixel skip number encoding means 338 reads out the pixel skip number from the pixel skip number memory 327, encodes it, and outputs it to the code FIFO memory 325 (S331). Then, the process of FIG. 9 is finished.

このように本実施の形態によれば、符号FIFOメモリ325の空き容量不足により、ゴロムライス符号化手段335で生成された符号を符号FIFOメモリ325に格納できなくなった場合、符号FIFOメモリ325に十分な空きができるまで、ゴロムライス符号化手段335で生成された符号を符号FIFOメモリ325へ出力する動作を停止する。その代わりに、予測誤差の符号を出力できなかった画素の個数を画素スキップ数として計数しておき、符号FIFOメモリ325に空きができた時点で、この画素スキップ数を符号化して符号FIFOメモリ325を通じて符号出力装置34に出力する。これにより、復号側では、画素スキップ数符号を復号することにより、幾つの画素の予測誤差が符号化されなかったかを識別できる。このため、どの画素の予測誤差の符号が消失したかすら復号側で分からなくなって復号が困難になるという事態を回避することができる。   As described above, according to the present embodiment, when the code generated by the Golomb-Rice encoding means 335 cannot be stored in the code FIFO memory 325 due to a lack of free space in the code FIFO memory 325, the code FIFO memory 325 is sufficient. The operation of outputting the code generated by the Golomb-rice coding means 335 to the code FIFO memory 325 is stopped until a space is available. Instead, the number of pixels for which the code of the prediction error could not be output is counted as the number of pixel skips, and when the code FIFO memory 325 is vacant, the number of pixel skips is encoded and the code FIFO memory 325 is encoded. To the code output device 34. Accordingly, the decoding side can identify how many prediction errors of the pixels have not been encoded by decoding the pixel skip number code. For this reason, it is possible to avoid a situation in which decoding is difficult because even the prediction error code of which pixel has disappeared is unknown on the decoding side.

また、本実施の形態によれば、予測誤差の符号を出力できなかった画素については、画素参照値変更手段331によって、所定の値(本実施の形態ではその画素の予測誤差と同じ値)に変更する。これにより、既に符号化済の他の画素の値を参照して符号化パラメータkを決定する場合に、符号化側も、復号側も、同じ値の画素値を参照することができ、パラメータkを用いたゴロムライス符号による符号化、復号を継続することができる。   Further, according to the present embodiment, a pixel for which a sign of the prediction error could not be output is set to a predetermined value (the same value as the prediction error of the pixel in the present embodiment) by the pixel reference value changing unit 331. change. As a result, when the encoding parameter k is determined with reference to the values of other already encoded pixels, both the encoding side and the decoding side can refer to the same pixel value, and the parameter k It is possible to continue encoding and decoding using the Golomb-Rice code using.

[第4の実施の形態]
次に、本発明の第4の実施の形態について図面を参照して説明する。
[Fourth embodiment]
Next, a fourth embodiment of the present invention will be described with reference to the drawings.

図10を参照すると、本発明の第4の実施の形態は、本発明を予測誤差復号装置に適用したものであり、符号入力装置41と、プログラム制御により動作するデータ処理装置42と、データ記憶装置43と、画像出力装置44とから構成されている。   Referring to FIG. 10, in the fourth embodiment of the present invention, the present invention is applied to a prediction error decoding device, which includes a code input device 41, a data processing device 42 operated by program control, and a data storage. The apparatus 43 and the image output apparatus 44 are comprised.

符号入力装置41は、第2の実施の形態の図5の符号入力装置21と同じものである。   The code input device 41 is the same as the code input device 21 of FIG. 5 of the second embodiment.

データ記憶装置43は、予測誤差統計メモリ431と、予測誤差メモリ432と、画素予測値メモリ433と、画像メモリ434とを備えている。   The data storage device 43 includes a prediction error statistical memory 431, a prediction error memory 432, a pixel prediction value memory 433, and an image memory 434.

予測誤差統計メモリ431は、データ処理装置42により算出された予測誤差の統計値を記憶する。   The prediction error statistical memory 431 stores the statistical value of the prediction error calculated by the data processing device 42.

予測誤差メモリ432は、データ処理装置42により復号された予測誤差を記憶する。   The prediction error memory 432 stores the prediction error decoded by the data processing device 42.

画素予測値メモリ433は、データ処理装置42により復号された画素の予測値を記憶する。   The predicted pixel value memory 433 stores the predicted value of the pixel decoded by the data processing device 42.

画像メモリ434は、データ処理装置42により復号された画素の値を格納する。   The image memory 434 stores the pixel value decoded by the data processing device 42.

データ処理装置42は、復号パラメータ決定手段421と、ゴロムライス復号手段422と、画素値復元手段423と、画素スキップ手段424と、画素予測手段425とを備えている。   The data processing device 42 includes a decoding parameter determination unit 421, a Golomurice decoding unit 422, a pixel value restoration unit 423, a pixel skip unit 424, and a pixel prediction unit 425.

復号パラメータ決定手段421は、復号対象となる予測誤差毎に、予測誤差統計メモリ431に記憶された予測誤差の統計値に基づいて、符号化に使われた符号化パラメータkと同じ値の復号パラメータを算出する。   For each prediction error to be decoded, the decoding parameter determination unit 421 uses a decoding parameter having the same value as the encoding parameter k used for encoding based on the prediction error statistical value stored in the prediction error statistical memory 431. Is calculated.

ゴロムライス復号手段422は、復号対象の画素の予測誤差を、符号入力装置41から入力された符号から復号する。具体的には、ゴロムライス復号手段422は、入力された符号が予め定められた上限長maxに等しいビット"0"の連続を含むか否かによって、上述した第1の符号化方法(ゴロムライス符号化)による符号か、上述した第2の符号化方法(ロウモードによる符号化)による符号かを判別する。第1の符号化方法による符号であれば、ゴロムライス復号手段222は、復号パラメータ決定手段421で決定された復号パラメータkを用いて当該符号であるゴロムライス符号を復号し、得られた予測誤差を予測誤差メモリ432に記憶する。   The Golombrice decoding means 422 decodes the prediction error of the decoding target pixel from the code input from the code input device 41. More specifically, the Golomb-Rice decoding means 422 determines whether the input code includes the continuation of the bit “0” equal to the predetermined upper limit length max, depending on whether or not the first encoding method (Golom-Rice encoding) is performed. ) Or the code according to the above-described second encoding method (encoding in the low mode). If the code is based on the first encoding method, the Golomb-Rice decoding unit 222 uses the decoding parameter k determined by the decoding parameter determination unit 421 to decode the Golomb-Rice code, which is the code, and predicts the obtained prediction error. Store in the error memory 432.

また、第2の符号化方法による符号であれば、ゴロムライス復号手段422は、上限長maxに等しいビット"0"の連続の直後における所定ビット長の2進表記を復号結果とする。そして、復号結果の値が32以上であれば、その復号結果から予測誤差の復号値を得て予測誤差メモリ432に記憶する。他方、復号結果が32未満であれば、その復号結果を画素スキップ数の復号値として画素スキップ手段424に伝達する。   In the case of a code according to the second encoding method, the Golombrice decoding means 422 uses a binary representation of a predetermined bit length immediately after the continuation of the bit “0” equal to the upper limit length max as the decoding result. If the decoding result value is 32 or more, a prediction error decoding value is obtained from the decoding result and stored in the prediction error memory 432. On the other hand, if the decoding result is less than 32, the decoding result is transmitted to the pixel skip means 424 as a decoded value of the number of pixel skips.

画素スキップ手段424は、ゴロムライス復号手段422から受け取った画素スキップ数分の画素について、画素予測値メモリ433に記憶されている画素予測値を画素値として持つ画素を生成して画像メモリ434に記憶する。   The pixel skip unit 424 generates a pixel having the pixel predicted value stored in the pixel predicted value memory 433 as a pixel value for the pixels corresponding to the number of pixel skips received from the Golomb-rice decoding unit 422 and stores the generated pixel in the image memory 434. .

画素値復元手段423は、予測誤差メモリ432に記憶された予測誤差と画素予測値メモリ433に記憶された画素予測値とから、画素の値を復元し、画像メモリ434に記憶する。   The pixel value restoration unit 423 restores the pixel value from the prediction error stored in the prediction error memory 432 and the pixel prediction value stored in the pixel prediction value memory 433, and stores the pixel value in the image memory 434.

画素予測手段425は、画像メモリ434に記憶された既に復号済の他の画素の値から、復号対象となる画素の予測値を算出し、画素予測値メモリ433に記憶する。   The pixel prediction unit 425 calculates a predicted value of a pixel to be decoded from the values of other already decoded pixels stored in the image memory 434, and stores them in the pixel predicted value memory 433.

画像出力装置44は、第2の実施の形態の図5の画像出力装置24と同じものである。   The image output device 44 is the same as the image output device 24 of FIG. 5 of the second embodiment.

次に図11のフローチャートを参照して、本実施の形態の全体の動作を説明する。   Next, the overall operation of the present embodiment will be described with reference to the flowchart of FIG.

まず、画素抽出座標が初期化される(S401)。   First, pixel extraction coordinates are initialized (S401).

次に、画素予測手段425は、画素抽出座標の画素の予測値を算出するために参照する復号済の他の画素を画像メモリ434から読み出す(S402)。次に、画素予測手段425は、この読み出した他の画素の値から画素抽出座標の画素の値を予測し、画素予測値メモリ433に記憶する(S403)。なお、該当する他の画素が存在しない場合には、存在しない他の画素の値として、所定値(例えば0)を用いる。   Next, the pixel predicting unit 425 reads other decoded pixels that are referred to in order to calculate the predicted value of the pixel of the pixel extraction coordinates from the image memory 434 (S402). Next, the pixel predicting means 425 predicts the pixel value of the pixel extraction coordinate from the read values of the other pixels, and stores it in the pixel predicted value memory 433 (S403). When there is no other applicable pixel, a predetermined value (for example, 0) is used as the value of the other pixel that does not exist.

次に、復号パラメータ決定手段421は、予測誤差統計メモリ431に記憶された予測誤差の統計値から復号パラメータkを決定する(S404)。次に、ゴロムライス復号手段422は、符号入力装置41から入力された符号から画素抽出座標の画素の予測誤差を復号する(S405)。   Next, the decoding parameter determination unit 421 determines a decoding parameter k from the statistical value of the prediction error stored in the prediction error statistical memory 431 (S404). Next, the Golomb-rice decoding means 422 decodes the prediction error of the pixel at the pixel extraction coordinate from the code input from the code input device 41 (S405).

ゴロムライス復号手段422は、予測誤差の復号に成功したときは、その復号値を画素抽出座標の画素の予測誤差として予測誤差メモリ432に記憶する。画素値復元手段423は、予測誤差メモリ432から読み出した画素抽出座標の画素の予測誤差と、画素予測値メモリ433から読み出した画素抽出座標の画素の予測値とから、画素抽出座標の画素の値を復元し、画像メモリ434に記憶する(S406〜S408)。次にゴロムライス復号手段422は、今回復号した予測誤差を用いて、予測誤差統計メモリ431の予測誤差の統計値を更新する(S409)。   When the Golomb-rice decoding means 422 succeeds in decoding the prediction error, the Golombrice decoding means 422 stores the decoded value in the prediction error memory 432 as the prediction error of the pixel at the pixel extraction coordinate. The pixel value restoration unit 423 calculates the pixel value of the pixel extraction coordinate from the prediction error of the pixel of the pixel extraction coordinate read from the prediction error memory 432 and the prediction value of the pixel of the pixel extraction coordinate read from the pixel prediction value memory 433. Is stored in the image memory 434 (S406 to S408). Next, the Golomb-Rice decoding means 422 updates the statistical value of the prediction error in the prediction error statistical memory 431 using the prediction error decoded this time (S409).

他方、ゴロムライス復号手段422は、画素の予測誤差の復号に失敗したときは、得られた復号値から画素スキップ数を得て、画素スキップ手段424へ出力する。画素スキップ手段424は、画素抽出座標から画素スキップ数分の各座標の予測値を画素予測値メモリ433から読み出し、画像抽出座標から画素スキップ数分の各座標の画素の値として画像メモリ434に記憶する(S410)。   On the other hand, the Golomb-rice decoding unit 422 obtains the number of pixel skips from the obtained decoded value and outputs it to the pixel skip unit 424 when decoding of the pixel prediction error fails. The pixel skip means 424 reads the predicted value of each coordinate for the number of pixel skips from the pixel extraction coordinate from the pixel predicted value memory 433 and stores it in the image memory 434 as the value of the pixel for each number of pixel skip from the image extraction coordinate. (S410).

次に、全画素の復号が終了したかどうかを判別し(S411)、終了していなければ、画素抽出座標を次の座標にシフトし(S412)、ステップS402に戻って上述と同様の処理を繰り返す。   Next, it is determined whether or not the decoding of all the pixels has been completed (S411). If not, the pixel extraction coordinates are shifted to the next coordinates (S412), and the process returns to step S402 to perform the same processing as described above. repeat.

全画素の復号が終了していれば、図11の処理を終了する。画像メモリ434に記憶された画素データは、その後に画像出力装置44に出力される。   If the decoding of all the pixels has been completed, the processing in FIG. 11 ends. The pixel data stored in the image memory 434 is then output to the image output device 44.

本実施の形態は、第2の実施の形態で符号化されたデータの復号装置に相当する。画素スキップ数を復号し、この復号された画素スキップ数分だけ、画素の予測値をその画素の値として使用することにより、復号を破たんなく継続することができる利点がある。   This embodiment corresponds to a data decoding device encoded in the second embodiment. By decoding the number of pixel skips and using the predicted value of the pixel as the value of the pixel by the number of decoded pixel skips, there is an advantage that decoding can be continued without failure.

また、画素スキップ数の復号によって、幾つの画素の予測値が符号化されずに送信されたかを復号側で検知することができる。このため、必要ならば符号側に対して改めて再送要求を行うなどの対処をとることもできる。   Further, by decoding the number of pixel skips, the decoding side can detect how many prediction values of pixels have been transmitted without being encoded. For this reason, if necessary, it is possible to take measures such as making a retransmission request to the code side again.

以上本発明の実施の形態について説明したが、本発明は以上の実施の形態にのみ限定されず、その他各種の付加変更が可能である。例えば、可変長符号はゴロムライス符号に限定されない。また、本発明のデータ符号化/復号装置は、その有する機能をハードウェア的に実現することは勿論、コンピュータとプログラムとで実現することができる。プログラムは、磁気ディスクや半導体メモリ等のコンピュータ可読記録媒体に記録されて提供され、コンピュータの立ち上げ時などにコンピュータに読み取られ、そのコンピュータの動作を制御することにより、そのコンピュータを前述した各実施の形態におけるデータ符号化/復号装置として機能させる。   Although the embodiment of the present invention has been described above, the present invention is not limited to the above embodiment, and various other additions and modifications can be made. For example, the variable length code is not limited to the Golomb-Rice code. In addition, the data encoding / decoding device of the present invention can be realized by a computer and a program, as well as by hardware. The program is provided by being recorded on a computer-readable recording medium such as a magnetic disk or a semiconductor memory, and is read by the computer at the time of starting up the computer, etc. It functions as a data encoding / decoding device in the form.

11 画像入力装置
12 データ記憶装置
13 データ処理装置
14 符号出力装置
21 符号入力装置
22 データ処理装置
23 データ記憶装置
24 画像出力装置
32 データ記憶装置
33 データ処理装置
34 符号出力装置
41 符号入力装置
42 データ処理装置
43 データ記憶装置
44 画像出力装置
121 画像メモリ
122 変換係数メモリ
123 符号FIFO
124 符号FIFO容量メモリ
125 係数スキップ数メモリ
131 画像変換手段
132 係数参照値変更手段
133 符号化パラメータ決定手段
134 ゴロムライス符号化手段
135 符号出力判定手段
136 符号出力省略手段
137 係数スキップ数符号化手段
138 符号出力手段
221 復号パラメータ決定手段
222 ゴロムライス復号手段
223 係数スキップ手段
224 画像逆変換手段
231 変換係数メモリ
232 画像メモリ
321 画像メモリ
322 画素予測値メモリ
323 予測誤差メモリ
324 予測誤差統計メモリ
325 符号FIFO
326 符号FIFO容量メモリ
327 画素スキップ数メモリ
331 画素参照値変更手段
332 画素予測手段
333 予測誤差算出手段
334 符号化パラメータ決定手段
335 ゴロムライス符号化手段
336 符号出力判定手段
337 符号出力省略手段
338 画素スキップ数符号化手段
339 符号出力手段
421 復号パラメータ決定手段
422 ゴロムライス復号手段
423 画素値復元手段
424 画素スキップ手段
425 画素予測手段
431 予測誤差統計メモリ
432 予測誤差メモリ
433 画素予測値メモリ
434 画像メモリ
11 Image input device 12 Data storage device 13 Data processing device 14 Code output device 21 Code input device 22 Data processing device 23 Data storage device 24 Image output device 32 Data storage device 33 Data processing device 34 Code output device 41 Code input device 42 Data Processing device 43 Data storage device 44 Image output device 121 Image memory 122 Conversion coefficient memory 123 Code FIFO
124 Code FIFO capacity memory 125 Coefficient skip number memory 131 Image converting means 132 Coefficient reference value changing means 133 Coding parameter determining means 134 Golomurice coding means 135 Code output determining means 136 Code output omitting means 137 Coefficient skip number coding means 138 Code Output means 221 Decoding parameter determination means 222 Golomurice decoding means 223 Coefficient skip means 224 Image inverse transform means 231 Transformation coefficient memory 232 Image memory 321 Image memory 322 Pixel prediction value memory 323 Prediction error memory 324 Prediction error statistics memory 325 Code FIFO
326 Code FIFO capacity memory 327 Pixel skip number memory 331 Pixel reference value change means 332 Pixel prediction means 333 Prediction error calculation means 334 Coding parameter determination means 335 Golomurice coding means 336 Code output determination means 337 Code output omission means 338 Number of pixel skips Coding means 339 Code output means 421 Decoding parameter determination means 422 Golomurice decoding means 423 Pixel value restoration means 424 Pixel skip means 425 Pixel prediction means 431 Prediction error statistical memory 432 Prediction error memory 433 Pixel prediction value memory 434 Image memory

Claims (35)

生成された符号を一時的に蓄積するバッファと、
符号化対象データを可変長符号化する可変長符号化手段と、
前記可変長符号化手段で生成された符号のうち、前記バッファの空き容量不足により前記バッファに格納できなかった符号の1以上の連続数をスキップ数として計数する符号出力省略手段と、
前記バッファに空きが生じたときに前記符号出力省略手段で計数された前記スキップ数を符号化して前記バッファに格納するスキップ数符号化手段と、
を備えることを特徴とするデータ符号化装置。
A buffer for temporarily storing the generated code;
Variable length encoding means for variable length encoding the encoding target data;
Code output omitting means for counting, as a skip number, one or more consecutive codes of codes that could not be stored in the buffer due to a lack of free space in the buffer among the codes generated by the variable length encoding means;
A skip number encoding means for encoding the skip number counted by the code output omitting means when the buffer is empty and storing it in the buffer;
A data encoding device comprising:
前記可変長符号化手段で生成された符号のうち、前記バッファに格納できなかった符号については、その符号化対象データが予め定められた値で符号化されたものとして符号化処理が継続できるようにする変更手段を備えることを特徴とする請求項1に記載のデータ符号化装置。   Of the codes generated by the variable-length coding means, the codes that could not be stored in the buffer can continue the encoding process as if the data to be encoded was encoded with a predetermined value. The data encoding apparatus according to claim 1, further comprising a changing unit configured to change to 前記符号化対象データは、入力データに対して所定の変換処理を施して得られた変換データであることを特徴とする請求項2に記載のデータ符号化装置。   The data encoding apparatus according to claim 2, wherein the encoding target data is conversion data obtained by performing predetermined conversion processing on input data. 前記変更手段は、前記バッファに格納できなかった符号については、その符号化対象データである前記変換データを前記予め定められた値に変更することを特徴とする請求項3に記載のデータ符号化装置。   4. The data encoding according to claim 3, wherein the changing unit changes the conversion data, which is data to be encoded, to the predetermined value for a code that could not be stored in the buffer. apparatus. 前記符号化対象データは、入力データの値を既に符号化した他の入力データの値から予測した予測値と前記入力データの値との差を示す予測誤差であることを特徴とする請求項2に記載のデータ符号化装置。   3. The encoding target data is a prediction error indicating a difference between a predicted value predicted from the value of another input data that has already encoded the value of the input data and the value of the input data. The data encoding device described in 1. 前記変更手段は、前記バッファに格納できなかった符号については、その符号化対象データである前記予測誤差が前記予め定められた値であるものとして見なして、その符号化対象データである前記予測誤差の算出に使用した前記予測値と前記予め定められた値とを加えた値で、前記予測誤差の算出に使用した前記入力データの値を書き換えることを特徴とする請求項5に記載のデータ符号化装置。   For the code that could not be stored in the buffer, the changing unit regards the prediction error that is the encoding target data as the predetermined value, and the prediction error that is the encoding target data. 6. The data code according to claim 5, wherein the value of the input data used for calculating the prediction error is rewritten with a value obtained by adding the predicted value used for calculating the predetermined value and the predetermined value. Device. 符号出力判定手段を備え、
前記符号出力判定手段は、
前記可変長符号化手段で符号が生成される毎に、前記スキップ数が所定値以上か否かを判定し、
所定値以上であれば、現時点の前記スキップ数の符号を格納するだけの空き容量が前記バッファにあるか否かを判定し、
空き容量がなければ前記符号出力省略手段により前記スキップ数を更新し、
空き容量があれば、現時点の前記スキップ数を前記スキップ数符号化手段で符号化した符号を前記バッファに格納するとともに前記スキップ数を初期化し、さらに前記可変長符号化手段で今回生成された符号を格納するだけの空き容量が前記バッファにあるか否かを再度判定し、空き容量があれば、今回生成された当該符号を前記バッファに格納し、空き容量がなければ前記符号出力省略手段により前記スキップ数を更新し、
前記スキップ数が所定値以上でなければ、前記可変長符号化手段で今回生成された符号を格納するだけの空き容量が前記バッファにあるか否かを判定し、空き容量があれば、今回生成された当該符号を前記バッファに格納し、空き容量がなければ前記符号出力省略手段により前記スキップ数を更新する、
ことを特徴とする請求項1乃至6の何れか1項に記載のデータ符号化装置。
A code output judging means;
The code output determination means includes
Each time a code is generated by the variable length encoding means, it is determined whether or not the skip number is a predetermined value or more,
If it is greater than or equal to a predetermined value, it is determined whether or not the buffer has enough free space to store the code of the current skip number,
If there is no free space, the skip number is updated by the code output omitting means,
If there is free space, a code obtained by encoding the current skip number by the skip number encoding unit is stored in the buffer, the skip number is initialized, and the code generated this time by the variable length encoding unit It is determined again whether or not the buffer has enough free space to store the code. If there is free space, the code generated this time is stored in the buffer, and if there is no free space, the code output omitting means Update the number of skips,
If the number of skips is not greater than or equal to a predetermined value, it is determined whether or not there is enough free space in the buffer to store the code generated this time by the variable length coding means. The code is stored in the buffer, and if there is no free space, the skip number is updated by the code output omitting means.
The data encoding device according to claim 1, wherein the data encoding device is a data encoding device.
前記可変長符号化手段は、符号化パラメータをkとするとき、前記符号化対象データを下位kビットと上位の残りビットとに2分割し、前記上位の残りビットを単進符号に置き換えたときの前記単進符号の符号長が予め設定した上限長maxを超えなければ、前記上位の残りビットを前記単進符号に置き換える第1の符号化により前記符号化対象データを符号化し、前記単進符号の符号長が前記上限長maxを超えれば、前記上限長maxの数に等しい所定値のビットの連続を前記符号化対象データの前に付加する第2の符号化により前記符号化対象データを符号化し、
前記スキップ数符号化手段は、前記上限長maxの数に等しい所定値のビットの連続を符号化対象とするスキップ数を示す固定長の2進表記の前に付加することにより、前記スキップ数の符号化を行う、
ことを特徴とする請求項1乃至7の何れか1項に記載のデータ符号化装置。
The variable length encoding means, when the encoding parameter is k, the data to be encoded is divided into two, lower k bits and upper remaining bits, and the upper remaining bits are replaced with a hexadecimal code If the code length of the unicode code does not exceed a preset upper limit length max, the encoding target data is encoded by first encoding that replaces the higher-order remaining bits with the unicode code, and the unicode If the code length of the code exceeds the upper limit length max, the encoding target data is obtained by second encoding that adds a sequence of bits having a predetermined value equal to the number of the upper limit length max before the encoding target data. Encoding,
The skip number encoding means adds a continuation of bits having a predetermined value equal to the number of the upper limit length max before a fixed-length binary notation indicating the number of skips to be encoded. Encoding,
The data encoding apparatus according to claim 1, wherein the data encoding apparatus is a data encoding apparatus.
符号化対象データを可変長符号化した符号と、幾つの連続する符号化対象データが符号化されていないかを示すスキップ数を符号化した符号とを含む符号列を入力とする復号装置であって、
前記符号列から前記符号化対象データと前記スキップ数とを復号する復号手段と、
前記復号手段で復号されたスキップ数分だけ、符号化対象データが予め定められた値で符号化されているものとして扱うスキップ手段と、
を備えることを特徴とするデータ復号装置。
A decoding device that receives as input a code string that includes a variable-length encoded code of encoding target data and a code that encodes a skip number indicating how many consecutive encoding target data are not encoded. And
Decoding means for decoding the encoding target data and the skip number from the code string;
The skip means that treats the data to be encoded as being encoded with a predetermined value by the number of skips decoded by the decoding means,
A data decoding apparatus comprising:
前記符号化対象データは、入力データに対して所定の変換処理を施して得られた変換データであることを特徴とする請求項9に記載のデータ復号装置。   The data decoding apparatus according to claim 9, wherein the encoding target data is conversion data obtained by performing predetermined conversion processing on input data. 前記スキップ手段は、前記予め定められた値を前記変換データを前記スキップ数分だけ生成することを特徴とする請求項10に記載のデータ復号装置。   11. The data decoding apparatus according to claim 10, wherein the skip means generates the converted data by the skip count for the predetermined value. 前記符号化対象データは、入力データの値を既に符号化した他の入力データの値から予測した予測値と前記入力データの値との差を示す予測誤差であることを特徴とする請求項9に記載のデータ復号装置。   10. The encoding target data is a prediction error indicating a difference between a predicted value predicted from a value of another input data that has already encoded the value of the input data and the value of the input data. The data decoding device described in 1. 前記スキップ手段は、前記符号化対象データである前記予測誤差が前記予め定められた値であるものとして見なして、前記符号化対象データである前記予測誤差の算出に使用した前記予測値と前記予め定められた値とを加えた値を持つ入力データを前記スキップ数分だけ生成することを特徴とする請求項12に記載のデータ復号装置。   The skip means regards the prediction error that is the encoding target data as the predetermined value, and the prediction value used for calculating the prediction error that is the encoding target data 13. The data decoding apparatus according to claim 12, wherein input data having a value obtained by adding a predetermined value is generated for the number of skips. 符号化対象データを可変長符号化して生成した符号をバッファに格納し、
前記バッファの空き容量不足により前記バッファに格納できなかった符号の1以上の連続数をスキップ数として計数し、
前記バッファに空きが生じたときに前記計数した前記スキップ数を符号化して前記バッファに格納する、
ことを特徴とするデータ符号化方法。
The code generated by variable length encoding of the data to be encoded is stored in the buffer,
The number of consecutive ones or more of codes that could not be stored in the buffer due to insufficient free space in the buffer is counted as a skip number,
When the buffer is vacant, the counted skip number is encoded and stored in the buffer.
A data encoding method characterized by the above.
前記バッファに格納できなかった符号については、その符号化対象データが予め定められた値で符号化されたものとして符号化処理を継続することを特徴とする請求項14に記載のデータ符号化方法。   15. The data encoding method according to claim 14, wherein the encoding process is continued with respect to a code that cannot be stored in the buffer, assuming that the encoding target data is encoded with a predetermined value. . 前記符号化対象データは、入力データに対して所定の変換処理を施して得られた変換データであることを特徴とする請求項15に記載のデータ符号化方法。   The data encoding method according to claim 15, wherein the encoding target data is conversion data obtained by performing predetermined conversion processing on input data. 前記バッファに格納できなかった符号については、その符号化対象データである前記変換データを前記予め定められた値に変更することを特徴とする請求項16に記載のデータ符号化方法。   17. The data encoding method according to claim 16, wherein for the code that could not be stored in the buffer, the converted data that is the data to be encoded is changed to the predetermined value. 前記符号化対象データは、入力データの値を既に符号化した他の入力データの値から予測した予測値と前記入力データの値との差を示す予測誤差であることを特徴とする請求項15に記載のデータ符号化方法。   16. The encoding target data is a prediction error indicating a difference between a predicted value predicted from the value of another input data that has already encoded the value of the input data and the value of the input data. The data encoding method described in 1. 前記バッファに格納できなかった符号については、その符号化対象データである前記予測誤差が前記予め定められた値であるものとして見なして、その符号化対象データである前記予測誤差の算出に使用した前記予測値と前記予め定められた値とを加えた値で、前記予測誤差の算出に使用した前記入力データの値を書き換えることを特徴とする請求項18に記載のデータ符号化方法。   For the code that could not be stored in the buffer, the prediction error that is the data to be encoded is considered to be the predetermined value, and was used to calculate the prediction error that is the data to be encoded. 19. The data encoding method according to claim 18, wherein the value of the input data used for calculation of the prediction error is rewritten with a value obtained by adding the prediction value and the predetermined value. 符号化対象データを可変長符号化した符号と、幾つの連続する符号化対象データが符号化されていないかを示すスキップ数を符号化した符号とを含む符号列を入力とし、
前記符号列から前記符号化対象データと前記スキップ数とを復号し、
前記復号されたスキップ数分だけ、符号化対象データが予め定められた値で符号化されているものとして以後の復号を継続する、
ことを特徴とするデータ復号方法。
A code string including a code obtained by variable-length coding the data to be encoded and a code obtained by encoding a number of skips indicating how many continuous data to be encoded are not encoded,
Decoding the encoding target data and the skip number from the code string,
Continue decoding thereafter, assuming that the data to be encoded is encoded with a predetermined value by the number of skips that have been decoded.
The data decoding method characterized by the above-mentioned.
前記符号化対象データは、入力データに対して所定の変換処理を施して得られた変換データであることを特徴とする請求項20に記載のデータ復号方法。   The data decoding method according to claim 20, wherein the encoding target data is conversion data obtained by performing predetermined conversion processing on input data. 前記予め定められた値を前記変換データを前記スキップ数分だけ生成することを特徴とする請求項21に記載のデータ復号方法。   The data decoding method according to claim 21, wherein the predetermined value is generated by the number of skips for the converted data. 前記符号化対象データは、入力データの値を既に符号化した他の入力データの値から予測した予測値と前記入力データの値との差を示す予測誤差であることを特徴とする請求項20に記載のデータ復号方法。   21. The encoding target data is a prediction error indicating a difference between a predicted value predicted from a value of another input data that has already encoded the value of the input data and the value of the input data. The data decoding method described in 1. 前記符号化対象データである前記予測誤差が前記予め定められた値であるものとして見なして、前記符号化対象データである前記予測誤差の算出に使用した前記予測値と前記予め定められた値とを加えた値を持つ入力データを前記スキップ数分だけ生成することを特徴とする請求項23に記載のデータ復号方法。   Assuming that the prediction error that is the encoding target data is the predetermined value, the prediction value used for the calculation of the prediction error that is the encoding target data and the predetermined value 24. The data decoding method according to claim 23, wherein input data having a value obtained by adding is generated for the number of skips. 生成された符号を一時的に蓄積するバッファを備えたコンピュータを、
符号化対象データを可変長符号化する可変長符号化手段と、
前記可変長符号化手段で生成された符号のうち、前記バッファの空き容量不足により前記バッファに格納できなかった符号の1以上の連続数をスキップ数として計数する符号出力省略手段と、
前記バッファに空きが生じたときに前記符号出力省略手段で計数された前記スキップ数を符号化して前記バッファに格納するスキップ数符号化手段と、
して機能させるためのプログラム。
A computer having a buffer for temporarily storing the generated code;
Variable length encoding means for variable length encoding the encoding target data;
Code output omitting means for counting, as a skip number, one or more consecutive codes of codes that could not be stored in the buffer due to a lack of free space in the buffer among the codes generated by the variable length encoding means;
A skip number encoding means for encoding the skip number counted by the code output omitting means when the buffer is empty and storing it in the buffer;
Program to make it function.
前記コンピュータを、さらに、
前記可変長符号化手段で生成された符号のうち、前記バッファに格納できなかった符号については、その符号化対象データが予め定められた値で符号化されたものとして符号化処理が継続できるようにする変更手段、
として機能させるための請求項25に記載のプログラム。
Said computer further
Of the codes generated by the variable-length coding means, the codes that could not be stored in the buffer can continue the encoding process as if the data to be encoded was encoded with a predetermined value. Change means,
The program according to claim 25, for causing the program to function as:
前記符号化対象データは、入力データに対して所定の変換処理を施して得られた変換データであることを特徴とする請求項25に記載のプログラム。   26. The program according to claim 25, wherein the encoding target data is conversion data obtained by performing predetermined conversion processing on input data. 前記変更手段は、前記バッファに格納できなかった符号については、その符号化対象データである前記変換データを前記予め定められた値に変更することを特徴とする請求項27に記載のプログラム。   28. The program according to claim 27, wherein the changing unit changes the conversion data, which is data to be encoded, to the predetermined value for a code that could not be stored in the buffer. 前記符号化対象データは、入力データの値を既に符号化した他の入力データの値から予測した予測値と前記入力データの値との差を示す予測誤差であることを特徴とする請求項26に記載のプログラム。   27. The encoding target data is a prediction error indicating a difference between a predicted value predicted from the value of another input data that has already encoded the value of the input data and the value of the input data. The program described in. 前記変更手段は、前記バッファに格納できなかった符号については、その符号化対象データである前記予測誤差が前記予め定められた値であるものとして見なして、その符号化対象データである前記予測誤差の算出に使用した前記予測値と前記予め定められた値とを加えた値で、前記予測誤差の算出に使用した前記入力データの値を書き換えることを特徴とする請求項29に記載のプログラム。   For the code that could not be stored in the buffer, the changing unit regards the prediction error that is the encoding target data as the predetermined value, and the prediction error that is the encoding target data. 30. The program according to claim 29, wherein the value of the input data used for calculation of the prediction error is rewritten with a value obtained by adding the prediction value used for calculation of the value and the predetermined value. 符号化対象データを可変長符号化した符号と、幾つの連続する符号化対象データが符号化されていないかを示すスキップ数を符号化した符号とを含む符号列を入力とする復号装置を構成するコンピュータを、
前記符号列から前記符号化対象データと前記スキップ数とを復号する復号手段と、
前記復号手段で復号されたスキップ数分だけ、符号化対象データが予め定められた値で符号化されているものとして扱うスキップ手段と、
して機能させるためのプログラム。
Configuring a decoding apparatus that receives as input a code string that includes a variable-length encoded code of the data to be encoded and a code that encodes the number of skips indicating how many consecutive data to be encoded are not encoded Computer
Decoding means for decoding the encoding target data and the skip number from the code string;
The skip means that treats the data to be encoded as being encoded with a predetermined value by the number of skips decoded by the decoding means,
Program to make it function.
前記符号化対象データは、入力データに対して所定の変換処理を施して得られた変換データであることを特徴とする請求項31に記載のプログラム。   32. The program according to claim 31, wherein the encoding target data is conversion data obtained by performing predetermined conversion processing on input data. 前記スキップ手段は、前記予め定められた値を前記変換データを前記スキップ数分だけ生成することを特徴とする請求項32に記載のプログラム。   33. The program according to claim 32, wherein the skip means generates the conversion data by the skip count for the predetermined value. 前記符号化対象データは、入力データの値を既に符号化した他の入力データの値から予測した予測値と前記入力データの値との差を示す予測誤差であることを特徴とする請求項31に記載のプログラム。   32. The encoding target data is a prediction error indicating a difference between a predicted value predicted from the value of another input data that has already encoded the value of the input data and the value of the input data. The program described in. 前記スキップ手段は、前記符号化対象データである前記予測誤差が前記予め定められた値であるものとして見なして、前記符号化対象データである前記予測誤差の算出に使用した前記予測値と前記予め定められた値とを加えた値を持つ入力データを前記スキップ数分だけ生成することを特徴とする請求項34に記載のプログラム。   The skip means regards the prediction error that is the encoding target data as the predetermined value, and the prediction value used for calculating the prediction error that is the encoding target data 35. The program according to claim 34, wherein input data having a value obtained by adding a predetermined value is generated for the number of skips.
JP2009180294A 2009-08-03 2009-08-03 Data encoding / decoding method and apparatus Expired - Fee Related JP5369973B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009180294A JP5369973B2 (en) 2009-08-03 2009-08-03 Data encoding / decoding method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009180294A JP5369973B2 (en) 2009-08-03 2009-08-03 Data encoding / decoding method and apparatus

Publications (2)

Publication Number Publication Date
JP2011035682A true JP2011035682A (en) 2011-02-17
JP5369973B2 JP5369973B2 (en) 2013-12-18

Family

ID=43764309

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009180294A Expired - Fee Related JP5369973B2 (en) 2009-08-03 2009-08-03 Data encoding / decoding method and apparatus

Country Status (1)

Country Link
JP (1) JP5369973B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160032119A (en) * 2013-07-12 2016-03-23 퀄컴 인코포레이티드 Rice parameter initialization for coefficient level coding in video coding process
KR20170087525A (en) * 2012-01-20 2017-07-28 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
CN108134942A (en) * 2012-04-11 2018-06-08 杜比国际公司 Coding and decoding methods are carried out for a pair bit stream associated with transformation coefficient
WO2020129718A1 (en) * 2018-12-21 2020-06-25 日本電信電話株式会社 Conversion device, encoding device, decoding device, methods of conversion device, encoding device, and decoding device, and program
WO2021067278A1 (en) * 2019-10-01 2021-04-08 Beijing Dajia Internet Informationtechnology Co., Ltd. Methods and apparatus of residual and coefficient coding
CN114363636A (en) * 2016-07-05 2022-04-15 株式会社Kt Method and apparatus for processing video signal
US11968395B2 (en) 2023-03-23 2024-04-23 Ge Video Compression, Llc Transform coefficient coding

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MX358516B (en) * 2011-10-19 2018-08-24 Kt Corp Method and apparatus for encoding/decoding image.

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06327001A (en) * 1993-05-11 1994-11-25 Olympus Optical Co Ltd Picture processor
JPH11205791A (en) * 1998-01-07 1999-07-30 Fujitsu Ltd Image coding method and image encoder
JP2000165877A (en) * 1998-11-30 2000-06-16 Fuji Xerox Co Ltd Image coder and image decoder
JP2005323167A (en) * 2004-05-10 2005-11-17 Seiko Epson Corp Image data compression apparatus, encoder, electronic apparatus, and image data compression method
JP2006339990A (en) * 2005-06-01 2006-12-14 Olympus Imaging Corp Data encoding device, method, and program
JP2008252562A (en) * 2007-03-30 2008-10-16 Renesas Technology Corp Moving image coding control method, and moving image coding device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06327001A (en) * 1993-05-11 1994-11-25 Olympus Optical Co Ltd Picture processor
JPH11205791A (en) * 1998-01-07 1999-07-30 Fujitsu Ltd Image coding method and image encoder
JP2000165877A (en) * 1998-11-30 2000-06-16 Fuji Xerox Co Ltd Image coder and image decoder
JP2005323167A (en) * 2004-05-10 2005-11-17 Seiko Epson Corp Image data compression apparatus, encoder, electronic apparatus, and image data compression method
JP2006339990A (en) * 2005-06-01 2006-12-14 Olympus Imaging Corp Data encoding device, method, and program
JP2008252562A (en) * 2007-03-30 2008-10-16 Renesas Technology Corp Moving image coding control method, and moving image coding device

Cited By (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210107147A (en) * 2012-01-20 2021-08-31 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR20170087525A (en) * 2012-01-20 2017-07-28 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR101951886B1 (en) 2012-01-20 2019-02-26 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR20170100048A (en) * 2012-01-20 2017-09-01 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR20170100049A (en) * 2012-01-20 2017-09-01 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR20170100050A (en) * 2012-01-20 2017-09-01 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR101771656B1 (en) 2012-01-20 2017-09-05 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
US11616982B2 (en) 2012-01-20 2023-03-28 Ge Video Compression, Llc Transform coefficient coding
KR101951887B1 (en) 2012-01-20 2019-02-26 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR102466326B1 (en) 2012-01-20 2022-11-14 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR102217956B1 (en) 2012-01-20 2021-02-19 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR102626883B1 (en) 2012-01-20 2024-01-18 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR20220160118A (en) * 2012-01-20 2022-12-05 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR101951888B1 (en) 2012-01-20 2019-02-26 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR101952360B1 (en) 2012-01-20 2019-02-27 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
US10271068B2 (en) 2012-01-20 2019-04-23 Ge Video Compression, Llc Transform coefficient coding
US10462487B2 (en) 2012-01-20 2019-10-29 Ge Video Compression, Llc Transform coefficient coding
US10582219B2 (en) 2012-01-20 2020-03-03 Ge Video Compression, Llc Transform coefficient coding
KR102293126B1 (en) 2012-01-20 2021-08-25 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR20200037450A (en) * 2012-01-20 2020-04-08 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
KR20210020177A (en) * 2012-01-20 2021-02-23 지이 비디오 컴프레션, 엘엘씨 Transform coefficient coding
US10757447B2 (en) 2012-01-20 2020-08-25 Ge Video Compression, Llc Transform coefficient coding
CN108134943B (en) * 2012-04-11 2020-06-16 杜比国际公司 Method for encoding and decoding a bitstream associated with transform coefficients
US11496768B2 (en) 2012-04-11 2022-11-08 Dolby International Ab GOLOMB-RICE/EG coding technique for CABAC in HEVC
US11706451B2 (en) 2012-04-11 2023-07-18 Dolby International Ab Golomb-Rice/EG coding technique for CABAC in HEVC
CN108347619B (en) * 2012-04-11 2020-09-15 杜比国际公司 Method for encoding and decoding a bitstream associated with transform coefficients
CN108134942B (en) * 2012-04-11 2020-09-15 杜比国际公司 Method for encoding and decoding a bitstream associated with transform coefficients
CN108282663B (en) * 2012-04-11 2020-06-16 杜比国际公司 Method for encoding and decoding a bitstream associated with transform coefficients
CN108134942A (en) * 2012-04-11 2018-06-08 杜比国际公司 Coding and decoding methods are carried out for a pair bit stream associated with transformation coefficient
CN108134943A (en) * 2012-04-11 2018-06-08 杜比国际公司 Coding and decoding methods are carried out for a pair bit stream associated with transformation coefficient
US11039169B2 (en) 2012-04-11 2021-06-15 Dolby International Ab GOLOMB-RICE/EG coding technique for CABAC in HEVC
US10582218B2 (en) 2012-04-11 2020-03-03 Dolby International Ab Golomb-rice/eg coding technique for CABAC in HEVC
CN108347619A (en) * 2012-04-11 2018-07-31 杜比国际公司 Coding and decoding methods are carried out for a pair bit stream associated with transformation coefficient
CN108282663A (en) * 2012-04-11 2018-07-13 杜比国际公司 Coding and decoding methods are carried out for a pair bit stream associated with transformation coefficient
KR102315238B1 (en) * 2013-07-12 2021-10-19 퀄컴 인코포레이티드 Rice parameter initialization for coefficient level coding in video coding process
KR20160032119A (en) * 2013-07-12 2016-03-23 퀄컴 인코포레이티드 Rice parameter initialization for coefficient level coding in video coding process
JP2016528796A (en) * 2013-07-12 2016-09-15 クゥアルコム・インコーポレイテッドQualcomm Incorporated Rice parameter initialization for coefficient level coding in video coding process
CN114363636A (en) * 2016-07-05 2022-04-15 株式会社Kt Method and apparatus for processing video signal
JP2020102763A (en) * 2018-12-21 2020-07-02 日本電信電話株式会社 Conversion apparatus, coding apparatus, decode apparatus, and method and program for them
JP7183776B2 (en) 2018-12-21 2022-12-06 日本電信電話株式会社 Encoding apparatus, decoding apparatus, methods and programs thereof
WO2020129718A1 (en) * 2018-12-21 2020-06-25 日本電信電話株式会社 Conversion device, encoding device, decoding device, methods of conversion device, encoding device, and decoding device, and program
WO2021067278A1 (en) * 2019-10-01 2021-04-08 Beijing Dajia Internet Informationtechnology Co., Ltd. Methods and apparatus of residual and coefficient coding
US11968395B2 (en) 2023-03-23 2024-04-23 Ge Video Compression, Llc Transform coefficient coding

Also Published As

Publication number Publication date
JP5369973B2 (en) 2013-12-18

Similar Documents

Publication Publication Date Title
JP5369973B2 (en) Data encoding / decoding method and apparatus
JP4295356B1 (en) Method and apparatus for encoding transform coefficients in image and / or video encoder and decoder and corresponding computer program and corresponding computer readable storage medium
US7978103B2 (en) Code amount estimating device, image coding apparatus including the code amount estimating device, and code amount estimating method
JP4987086B2 (en) Image encoding method and decoding method, apparatus thereof, program thereof, and recording medium recording the program
JP4831372B2 (en) Encoding and decoding apparatus, encoding and decoding method, and program
JP4650592B1 (en) Wavelet transform coding / decoding method and apparatus
JP4427003B2 (en) Data encoding apparatus, data decoding apparatus, data encoding method, data decoding method, and program
US20100054328A1 (en) Encoding apparatus and control method thereof
US11425410B2 (en) Video picture prediction method and apparatus
JP2007142637A (en) Image information encoder
RU2693902C2 (en) Encoder, decoder and method
TW201240471A (en) Method and apparatus for frame memory
JP6476900B2 (en) Moving picture coding apparatus, moving picture coding method, and computer program for moving picture coding
JP6727011B2 (en) Image coding apparatus and control method thereof
JPWO2009050766A1 (en) Video compression encoding / restoration device, video compression encoding / restoration program, and video generation / output device
JP2009021775A (en) Coder and coding method
JPWO2012160626A1 (en) Image compression apparatus, image restoration apparatus, and program
KR102071459B1 (en) Encoding apparatus and encoding method
TW201811037A (en) Device for decoding images, method for decoding images and record medium
CN110536133B (en) Video data decoding method and device
JP2009111625A (en) Video coding device and video coding method
JP2012089917A (en) Encoder, method, and program
JP5772623B2 (en) Moving picture coding apparatus, moving picture coding method, and moving picture coding program
JP5574072B1 (en) Video encoding apparatus, video encoding method, and video encoding program
CA3124545A1 (en) Video prediction encoding and decoding devices, methods, and programs which adaptively control the size of the frame memory

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120705

RD07 Notification of extinguishment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7427

Effective date: 20120713

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130703

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130709

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130725

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130902

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5369973

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees