JP3407588B2 - Encoding / decoding device - Google Patents

Encoding / decoding device

Info

Publication number
JP3407588B2
JP3407588B2 JP06605397A JP6605397A JP3407588B2 JP 3407588 B2 JP3407588 B2 JP 3407588B2 JP 06605397 A JP06605397 A JP 06605397A JP 6605397 A JP6605397 A JP 6605397A JP 3407588 B2 JP3407588 B2 JP 3407588B2
Authority
JP
Japan
Prior art keywords
code
probability
signal
input
generated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP06605397A
Other languages
Japanese (ja)
Other versions
JPH10261966A (en
Inventor
達基 大塚
大 藤井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP06605397A priority Critical patent/JP3407588B2/en
Publication of JPH10261966A publication Critical patent/JPH10261966A/en
Application granted granted Critical
Publication of JP3407588B2 publication Critical patent/JP3407588B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、エントロピー符号
化に係り、特に符号化復号化装置の処理手順と装置構成
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to entropy coding, and more particularly to a processing procedure and a device configuration of a coding / decoding device.

【0002】[0002]

【従来の技術】信号を符号に変換する処理は、一般にモ
デル化部とエントロピー符号化部から構成される。モデ
ル化部は信号系列の変換を目的としており、例えば画像
信号を複数画素からなるブロックに分割して該ブロック
内の信号を周波数成分に変換したり、あるいは、同一信
号レベルの連続個数に変換をする等、多くの手法があ
る。一方、エントロピー符号化部は、モデル化部で作ら
れた信号系列に符号の割り当てを行う。入力信号と、符
号のビット数の比率は圧縮率として表される。圧縮率は
高いことが望まれ、このために多くのモデル化部とエン
トロピー符号化部の構成が提案されてきた。
2. Description of the Related Art The process of converting a signal into a code generally comprises a modeling section and an entropy coding section. The modeling unit is intended to convert a signal sequence. For example, the image signal is divided into blocks each including a plurality of pixels and the signals in the blocks are converted into frequency components. Alternatively, the modeling unit converts the signals into a continuous number having the same signal level. There are many methods such as On the other hand, the entropy coding unit allocates codes to the signal series created by the modeling unit. The ratio between the input signal and the number of bits of the code is expressed as a compression rate. It is desired that the compression rate is high, and therefore many configurations of the modeling unit and the entropy coding unit have been proposed.

【0003】韓,小林共著による岩波書店発行「情報と
符号化の数理」(1994年)に、従来から提案されて
いる符号生成のアルゴリズム、および、それらの特長と
性質が詳述されている。情報理論によれば、達成できる
圧縮率の限界を示す「エントロピー」と呼ばれる指標が
定義されている。また、符号の性質を表す技術用語とし
て「最適」と「瞬時復号可能」がある。ここで、最適と
は平均符号長が最小になる符号のことであり、また、瞬
時復号可能とは全ての符号系列を見ることなくそれぞれ
の符号を復号できることである。これらは実際に装置を
実現する上で重要な性質である。従来、両者の性質をも
つ符号として、1952年にハフマンが提案したハフマ
ン符号が知られている(Huffman, D. A. : A method fo
r theconstruction of minimum-redundancy codes, Pro
c. IRE, vol. 40, pp. 1098-1101, Sept. 1952)。
The previously proposed code generation algorithms and their characteristics and properties are described in detail in "Mathematical Mathematics of Information and Coding" (1994), published by Iwanami Shoten, by Han and Kobayashi. Information theory defines an index called "entropy" that indicates the limit of achievable compression ratio. Also, there are “optimal” and “instantaneous decodable” as technical terms that represent the property of the code. Here, the optimum means a code having the smallest average code length, and the instantaneous decodable means that each code can be decoded without looking at all code sequences. These are important properties for actually realizing the device. Conventionally, the Huffman code proposed by Huffman in 1952 is known as a code having both properties (Huffman, DA: A method fo
r theconstruction of minimum-redundancy codes, Pro
c. IRE, vol. 40, pp. 1098-1101, Sept. 1952).

【0004】ハフマン符号の利用方法として、符号化対
象とする事象の全体の生起確率をあらかじめ測定し、こ
の生起確率に基づく符号を生成し、該符号を表形式にし
てメモリに蓄積しておくことで、実際の符号対象の事象
について表検索によって得られ対応する符号に変換す
る。簡単な手順で「最適」と「瞬時復号可能」を実現で
きることから、広い分野で行われている。また、ハフマ
ン符号は、一つの信号に対して一つの符号が対応すると
いう性質からブロック符号として分類されている。
As a method of using the Huffman code, the total occurrence probability of an event to be encoded is measured in advance, a code based on this occurrence probability is generated, and the code is stored in a memory in a table format. Then, the actual code target event is obtained by a table search and converted into a corresponding code. It is used in a wide range of fields because "optimal" and "instantaneous decodable" can be realized with simple procedures. Further, the Huffman code is classified as a block code because of the property that one code corresponds to one signal.

【0005】[0005]

【発明が解決しようとする課題】ハフマン符号は、理論
的には「最適」と「瞬時復号可能」を実現できるエント
ロピー符号化方式である。しかし、現実の符号化処理に
おいては、例えば、 (a)符号化対象の生起確率の変動 (b)モデル化部の信号処理手順 (c)上記を実現する装置構成 等を考慮に入れた信号処理を行わなければ効率の向上は
実現できない。
The Huffman code is an entropy coding system that can theoretically realize "optimal" and "instantaneous decodable". However, in the actual encoding process, for example, (a) a change in the occurrence probability of the encoding target (b) a signal processing procedure of the modeling unit (c) a signal process in consideration of a device configuration or the like for realizing the above If you do not, you cannot achieve efficiency improvement.

【0006】まず(a)に関しては、符号化対象の生起
確率は必ずしも一定の性質ではなく、さまざまな要因に
よって変動するのが一般的である。ハフマン符号を符号
表としてあらかじめ設定しておく方式では、符号化対象
の生起確率が変動した場合には、効率が低下することに
なる。仮に、事象の生起確率の変動に対応させて、適応
的に符号を生成しようとしても、ハフマン符号の符号生
成手順が、確率値の最も小さな事象から最も高い事象へ
実行していくトリー構造になっていることから、全ての
符号生成手順が終了した時点でなければ符号を利用でき
ない。このため、適応的な符号化を行うためには、処理
負荷が膨大になり、装置構成も複雑になる。これらの特
性をまとめれば、事象の生起確率値に変動がない、言い
換えれば静的な符号化対象に対してハフマン符号は適し
ているが、逆の場合である動的な符号化対象に対しては
不適であると言える。
First, with respect to (a), the occurrence probability of an object to be coded is not necessarily constant in nature, but generally fluctuates due to various factors. In the method in which the Huffman code is set in advance as the code table, the efficiency decreases when the occurrence probability of the encoding target changes. Even if an attempt is made to adaptively generate a code in response to changes in the occurrence probability of an event, the Huffman code code generation procedure becomes a tree structure in which the event with the smallest probability value is executed to the event with the highest probability value. Therefore, the code can be used only at the time when all the code generation procedures are completed. Therefore, in order to perform adaptive coding, the processing load becomes enormous and the device configuration becomes complicated. To summarize these characteristics, there is no change in the occurrence probability value of an event. In other words, Huffman codes are suitable for static coding targets, but the opposite case for dynamic coding targets. Can be said to be unsuitable.

【0007】次に(b)のモデル化部の信号処理には様
々な方法が提案され、利用されている。複数の信号をま
とめて変換処理を行う一例として、ファクシミリで使わ
れているラン長がある。基本方式であるMH(モディフ
ァイド・ハフマン)方式では、同一の信号レベルの連続
する個数(ラン長)を計測し、その結果をあらかじめ用
意したハフマン符号に変換する。しかし、1ラインの中
のランの基点によって連続するラン長の生起確率は変化
し、さらに1ライン毎にラン長を0に初期化するにも関
わらず、固定した符号表を利用することから圧縮率の低
下を招く要因となっている。このように、モデル化部の
信号処理手順の内容を把握した上で、エントロピー符号
化を行わなければ効率向上は望めない。
Next, various methods have been proposed and used for the signal processing of the modeling unit of (b). As an example of performing conversion processing by collecting a plurality of signals, there is a run length used in a facsimile. In the basic MH (Modified Huffman) method, the number of consecutive identical signal levels (run length) is measured, and the result is converted into a prepared Huffman code. However, the probability of occurrence of consecutive run lengths changes depending on the origin of the runs in one line, and even though the run length is initialized to 0 for each line, a fixed code table is used to compress the run length. It is a factor that causes a decline in the rate. In this way, efficiency improvement cannot be expected unless entropy coding is performed after grasping the contents of the signal processing procedure of the modeling unit.

【0008】そして(c)について符号化復号化処理を
実現するには、符号化対象とする信号の一時的な蓄積手
段が不可欠である。従来の提案は、半導体回路による実
現手段の観点が抜けており、特にメモリのデータ入出力
の高速化が装置の性能を決める大きな要因であり、モデ
ル化部あるいはエントロピー符号化部の信号処理手順と
組み合わせて考察されていない。上記符号化復号化処理
を実行するための専用LSIが開発されているが、例え
ば1画面分の圧縮データを同一チップに蓄積できるよう
なメモリ機能と混在させたものはなく、別のチップで構
成されるメモリを配線によって組み合わせるため、実行
速度の問題が残っている。
In order to realize the coding / decoding processing for (c), a temporary storage means for the signal to be coded is indispensable. In the conventional proposal, the viewpoint of the realization means by the semiconductor circuit is omitted, and in particular, the speedup of the data input / output of the memory is a major factor that determines the performance of the device. Not considered in combination. A dedicated LSI for executing the above encoding / decoding processing has been developed, but for example, there is no one mixed with a memory function capable of accumulating compressed data for one screen on the same chip, and it is configured on another chip. Since the combined memory is combined by wiring, the problem of execution speed remains.

【0009】[0009]

【課題を解決するための手段】上記目的を達成するため
に、本願発明では入力が取り得る事象と、この事象が起
こり得る確率とを確率が大きい順にメモリに記憶し、こ
の記憶された確率及び事象を確率が大きいものから順に
読み出し、この読み出した確率から符号の符号長を決定
し、更にこの符号長に基づいて累積確率を求め、この求
めた符号長及び累積確率から符号を生成することを特徴
としている。
In order to achieve the above object, according to the present invention, an event that an input can take and a probability that this event can occur are stored in a memory in descending order of probability, and the stored probability and The events are read in order from the one with the highest probability, the code length of the code is determined from the read probability, the cumulative probability is calculated based on this code length, and the code is generated from the calculated code length and cumulative probability. It has a feature.

【0010】[0010]

【発明の実施の形態】以下、本発明の一実施例を図面に
従って説明する。
BEST MODE FOR CARRYING OUT THE INVENTION An embodiment of the present invention will be described below with reference to the drawings.

【0011】まず、符号化装置について説明する。First, the encoding device will be described.

【0012】図2に符号化システムの基本構成を示す。
符号化システムに入力される信号は、入力装置200に
より外部からアナログ信号を受け、この信号をA/D変
換器201によりディジタル信号に変換する。変換され
たディジタル信号は符号化装置203により符号が作成
され、符号はメモリ202に格納されたり、あるいは通
信装置204により外部に出力され、他のシステムへ送
られる。尚、入力装置200は外部からの入力を単に受
け付けるだけでなくスキャナ等の原稿を読み取る装置で
あってもよい。また、A/D変換器201については、
入力される信号がディジタル信号であれば省いても問題
はない。
FIG. 2 shows the basic configuration of the encoding system.
A signal input to the encoding system receives an analog signal from the outside by the input device 200, and this signal is converted into a digital signal by the A / D converter 201. A code is created by the encoding device 203 in the converted digital signal, and the code is stored in the memory 202 or output to the outside by the communication device 204 and sent to another system. It should be noted that the input device 200 may be a device such as a scanner that reads an original document in addition to simply receiving an input from the outside. Further, regarding the A / D converter 201,
If the input signal is a digital signal, there is no problem even if it is omitted.

【0013】符号化処理は、連続して入力される信号系
列について、この系列を構成する各信号のとりうる事象
を、符号で置き換えることにより、情報量の削減を図る
ものである。例えば、入力信号が3ビットの2進数で構
成されている場合には、信号の取りうる事象は8種類あ
り、それぞれの信号が入力される確率は、例えば入力装
置がスキャナであれば原稿に描かれている内容によって
定まる。
The encoding process is intended to reduce the amount of information in a continuously input signal sequence by replacing the events that can be taken by each signal forming the sequence with a code. For example, when the input signal is composed of a 3-bit binary number, there are eight kinds of events that the signal can take, and the probability of inputting each signal is, for example, if the input device is a scanner, it is drawn on the manuscript. It depends on the content.

【0014】図1は符号化システムの符号化装置203
を示したものである。管理部101は、符号生成部10
2,符号化誤差演算部103,確率設定部104を管理
し、必要に応じて各部の起動停止を行うものである。確
率設定部104は、初期設定を行うもので、外部から与
えられた入力信号が取り得る事象と発生する確率とを対
応づけて、更に発生する確率が大きい順にメモリ202
に格納する。また、入力信号が取りうる値に対応する確
率が明確に分からない場合は、確率関数,統計値等を与
える。符号生成部102は、確率設定部104によっ
て、メモリ202に設定された順に従って事象と確率を
読み出し、入力信号に対応する符号を生成する。従っ
て、最適かつ瞬時復号可能な符号を生成することができ
る。符号化誤差演算部103は、各事象の符号長設定時
に発生する符号化誤差を求め、この符号化誤差を用いて
符号生成の終わっていない残りの事象の生起確率の修正
を行う。
FIG. 1 shows a coding device 203 of the coding system.
Is shown. The management unit 101 includes a code generation unit 10
2. It manages the coding error calculation unit 103 and the probability setting unit 104, and starts and stops each unit as necessary. The probability setting unit 104 performs initial setting, associates an event that can be taken by an input signal given from the outside with a probability of occurrence, and the memory 202 in descending order of probability of occurrence.
To store. If the probability corresponding to the value that the input signal can take is not clearly known, a probability function, statistical value, etc. are given. The code generation unit 102 reads events and probabilities according to the order set in the memory 202 by the probability setting unit 104, and generates a code corresponding to the input signal. Therefore, it is possible to generate an optimal and instantly decodable code. The coding error calculation unit 103 obtains a coding error that occurs when the code length of each event is set, and uses the coding error to correct the occurrence probabilities of the remaining events for which code generation has not ended.

【0015】符号化とは、事象の生起確率値に基づき、
有限なビット数の符号で置き換えることである。基本的
に高い確率値の事象には短い符号を、逆に確率値の低い
事象には長い符号を割り当てる。ここで、なるべく平均
符号長を短くすることが重要な点であるが、この限界を
実現するのが「最適」な符号である。
Encoding is based on the occurrence probability value of an event,
It is to replace with a code with a finite number of bits. Basically, a short code is assigned to an event with a high probability value, and conversely, a long code is assigned to an event with a low probability value. Here, it is important to shorten the average code length as much as possible, but it is the "optimum" code that realizes this limit.

【0016】本発明の符号化は、入力されうる事象k
(生起事象)に対応付けされ、s進数で表された確率値か
ら符号を生成するものであり、平均符号長を短くした
「最適」な符号を生成するものである。
The encoding of the present invention is based on the event k that can be input.
A code is generated from a probability value represented by an s-adic number in association with (occurrence event), and an "optimal" code with a short average code length is generated.

【0017】次に図3を用いて、s=2とした場合、つ
まり2進符号の場合の符号生成の概要を説明する。
Next, the outline of code generation when s = 2, that is, in the case of a binary code will be described with reference to FIG.

【0018】まず、初期設定を行う(301)。初期設
定として、入力される信号が取りうる事象ki (i=1
〜n)と、事象Ki が発生する確率Pi (i=1〜n)と
を対応付けして、確率が大きいものから順に並べる。例
えば符号化装置203への入力信号が3ビットであれ
ば、起こり得る事象は(000),(001),(01
0),(011),(100),(101),(110),(1
11)の8つであり、それぞれの事象が発生する確率が
1=0.21,P2=0.19,P3=0.18 ,P4
0.17,P5=0.10,P6=0.10,P7=0.0
5,P8=0.00 であれば、図4のようになる。
First, initial setting is performed (301). As an initial setting, an event k i (i = 1
~ N) and the probability P i (i = 1 to n) of occurrence of the event K i are associated with each other and are arranged in order from the one with the highest probability. For example, if the input signal to the encoder 203 is 3 bits, possible events are (000), (001), (01
0), (011), (100), (101), (110), (1
11), and the probability that each event occurs is P 1 = 0.21, P 2 = 0.19, P 3 = 0.18, P 4 =
0.17, P 5 = 0.10, P 6 = 0.10, P 7 = 0.0
If 5, P 8 = 0.00, the result is as shown in FIG.

【0019】次に、入力信号が入力されると(30
2)、符号のビット長(符号長)bk を求める(30
3)。先に述べたように本発明は2進の確率値に基づい
て符号を生成するので、bk =log(1/Pk )(底は
2)で求める。そして、求めたbk の小数点以下は四捨
五入する。但し、四捨五入したbk から確率値を求めた
場合、四捨五入により図4に示した順位が変動してしま
う場合がある。本発明では、確率値が大きいものから符
号を生成するため、順位の変動が起こらないようにする
必要がある。従って、順位の変動が起きる場合は小数点
以下を切り上げ又は切り捨て処理し、順位変動が起こら
ないようにする。
Next, when an input signal is input (30
2) Obtain the bit length (code length) b k of the code (30
3). As described above, since the present invention generates a code based on a binary probability value, b k = log (1 / P k ) (base is 2). Then, the obtained b k is rounded off after the decimal point. However, when the probability value is obtained from the rounded b k , the rounding may change the rank shown in FIG. In the present invention, since the code is generated from the one having a large probability value, it is necessary to prevent the rank from changing. Therefore, if the ranking changes, the decimal places are rounded up or down to prevent the ranking from changing.

【0020】次に、符号誤差Ek を求め、確率値の低い
事象に対して符号誤差を分配する(304)。符号誤差
k はEk =(1/2)^bk −Pk により求める。求め
た符号誤差Ek を分配する場合には、確率値の順位に変
動が生じないように分配を行う。このように、符号誤差
k を求めて分配することにより、平均符号長を短くす
ることができる。つまり、符号長を設定する際に切り上
げ処理を行い、かつ分配を行わない場合、個々の事象の
発生する確率は実際の値よりも符号誤差分だけ小さくな
る。また、事象全体の確率値も、符号誤差の累積された
値だけ小さくなる。言い換えれば、発生する確率が実際
の値よりも小さく設定されてしまうことになる。先に述
べた通り符号のビット数(符号長)は、bk =log(1/
k )によって求めるため、Pk が小さい程bk が大き
くなってしまい符号のビット数(符号長)が大きくなっ
てしまう結果になる。本発明では、符号誤差Ek を求め
分配しているため、最終的に平均符号長を短くすること
ができる。
Next, the sign error E k is obtained, and the sign error is distributed to the event having a low probability value (304). The sign error E k is calculated by E k = (1/2) ̂b k −P k . When the obtained code error E k is distributed, the distribution is performed so that the order of the probability values does not change. In this way, the average code length can be shortened by obtaining and distributing the code error E k . That is, when rounding up is performed when setting the code length and distribution is not performed, the probability of occurrence of each event is smaller than the actual value by the code error. Also, the probability value of the entire event is reduced by the accumulated value of sign errors. In other words, the probability of occurrence will be set smaller than the actual value. As described above, the number of bits (code length) of the code is b k = log (1 /
Since it is obtained by P k ), the smaller P k is, the larger b k is and the larger the number of bits (code length) of the code is. In the present invention, since the code error E k is calculated and distributed, the average code length can be finally shortened.

【0021】実際に生起した符号化対象とする事象の符
号長が生成されたか判断し、修正済みの確率値を用いて
上記処理を繰り返す。実際に生起した事象の処理が終了
したら、符号長bk を設定して次の処理を行う(30
5)。
It is judged whether or not the code length of the event that actually occurred and is to be coded is generated, and the above process is repeated using the corrected probability value. When the processing of the event actually occurred is completed, the code length b k is set and the next processing is performed (30
5).

【0022】符号化対象とする事象の符号長が求まった
なら、符号のビットを設定する(306)。符号ビット
は、2進数表現した累積確率値qk (qk=Σ(1/2)
^bk-1 )の小数点以下を、ビット数bk だけ切り出し
て設定する。なお、k=1の場合にはqk =0であり、
符号はbk 個の0の並びとなる。
When the code length of the event to be coded is obtained, the bit of the code is set (306). The sign bit is a cumulative probability value represented by a binary number q k (q k = Σ (1/2)
^ B k-1 ) is set by cutting out the number of bits b k after the decimal point. Note that when k = 1, q k = 0,
The code is a sequence of b k 0s.

【0023】次に、符号生成についてフローチャートを
用いて具体的に説明する。ここでは入力される信号を3
ビットで表される2進の信号を用い、入力される信号が
取り得る事象ki に対する確率Pk が予め分かっている
場合について説明する。
Next, the code generation will be specifically described with reference to a flowchart. Here, the input signal is 3
A case will be described in which a binary signal represented by bits is used and the probability P k for an event k i that the input signal can take is known in advance.

【0024】図5に全体の処理のフローチャートを示
す。図1で説明した管理部101はこのフローチャート
に従って各部の起動,停止を管理,制御する。
FIG. 5 shows a flowchart of the entire processing. The management unit 101 described in FIG. 1 manages and controls the start and stop of each unit according to this flowchart.

【0025】まず、符号化装置203が起動されると初
期設定を行う(501)。初期設定は、管理部101が
確率設定部104を起動して行う。次に、管理部101
は入力信号INの入力があった場合(502)、符号生
成部102を起動して符号を生成する(503)。符号
生成部102で生成された符号は、管理部101がメモ
リ202又は通信装置204に出力し、次の入力信号を
待つ(504)。
First, when the encoding device 203 is activated, initialization is performed (501). The initial setting is performed by the management unit 101 activating the probability setting unit 104. Next, the management unit 101
When the input signal IN is input (502), starts the code generation unit 102 and generates a code (503). The management unit 101 outputs the code generated by the code generation unit 102 to the memory 202 or the communication device 204, and waits for the next input signal (504).

【0026】図6は、初期設定(501)の詳細を示し
たものであり、これは確率設定部104が行う。確率設
定部104が起動されると、入力され得る事象ki と発
生する確率Pi を符号化装置203の外部から又はメモ
リ202から取り込む(601)。そして、確率Pi
大きい順に事象ki ,確率Pi とを対応づけてメモリ2
02に格納する。このようにして、メモリに格納するこ
とにより先に説明した図4のようになる。ここで、フラ
グFは、符号を既に生成したか否かを判断するもので、
既に符号を生成した場合には、F=1となる。
FIG. 6 shows details of the initial setting (501), which is performed by the probability setting unit 104. When the probability setting unit 104 is activated, the event k i that can be input and the probability P i that occurs will be fetched from outside the encoding device 203 or from the memory 202 (601). Then, the events k i and the probabilities P i are associated with each other in the descending order of the probabilities P i and stored in the memory 2
Stored in 02. By thus storing in the memory, it becomes as shown in FIG. 4 described above. Here, the flag F is for determining whether or not a code has already been generated,
If the code has already been generated, F = 1.

【0027】図7は、符号生成部102により、入力信
号INに対する符号Cを生成する符号生成(503)の
詳細を示したものである。
FIG. 7 shows details of the code generation (503) for generating the code C for the input signal IN by the code generation unit 102.

【0028】符号生成部102が起動すると、メモリに
格納されている確率Pi が高いものから順に、入力信号
INとメモリに格納されている事象ki が一致するまで
符号生成を行い、入力信号INとメモリに格納されてい
る事象ki が一致した時点で符号Ci を出力する。
When the code generation unit 102 is activated, code generation is performed in order from the highest probability P i stored in the memory until the input signal IN and the event k i stored in the memory match, and the input signal IN When IN matches the event k i stored in the memory, the code C i is output.

【0029】符号生成部102が起動すると、メモリ2
02からi番目の事象ki ,確率Pi ,符号Ci ,フラ
グFi を読み出す(701)。ここで、Fi を判断し
(702),Fi =1のときは既に符号Ci が作成され
ているので、入力信号INと事象ki が一致するかの判
断を行う(713)。Fi =0となっている場合は符号
i が作成されていない。そこで、符号のビット数を求
めるためlog(1/Ri )を計算し(703)、この計算
結果を小数点以下を四捨五入し符号長bi を求める。そ
して、この四捨五入の処理により、確率Pi の順位が変
動する場合があるので、再度確率Pを求め(705)、
順位が変動する場合には切り上げ又は切り捨て処理を行
う(707〜709)。このようにして求めた符号長b
i に基づいて符号誤差演算を行う(710)。尚、この
符号誤差演算(710)は、先に説明したように符号化
誤差演算部103により行う。これについては後述す
る。
When the code generator 102 is activated, the memory 2
The i-th event k i , probability P i , code C i , and flag F i from 02 are read (701). Here, F i is judged (702), and when F i = 1 the code C i has already been created, so it is judged whether the input signal IN and the event k i match (713). When F i = 0, the code C i is not created. Therefore, log (1 / R i ) is calculated to obtain the number of bits of the code (703), and the calculation result is rounded off to the nearest decimal point to obtain the code length b i . Since the rounding process may change the rank of the probability P i , the probability P is calculated again (705),
If the rank changes, rounding up or rounding down is performed (707 to 709). Code length b obtained in this way
A sign error calculation is performed based on i (710). The code error calculation (710) is performed by the coding error calculation unit 103 as described above. This will be described later.

【0030】次に、求めた符号長bと累積確率値q
i により符号Ci を生成する。このようにして符号が生
成されたら対応するフラグFi =1とし、生成した符号
i と共にメモリ202に格納する(711,71
2)。そして、次に入力信号INと事象ki とを比較し
て(713)、一致していない場合には、累積確率値q
i(=Σ(1/2)^bk-1)を求め(7150、次に確率
i が大きいものについて、符号生成の処理を行う。
Next, the calculated code length b i and the cumulative probability value q
A code C i is generated from i . When the code is generated in this way, the corresponding flag F i is set to 1 and stored in the memory 202 together with the generated code C i (711, 71).
2). Then, the input signal IN is compared with the event k i (713), and if they do not match, the cumulative probability value q
i (= Σ (1/2) ^ b k-1 ) is calculated (7150, and the code generation process is performed for the next highest probability P i .

【0031】このようにして、入力信号INと事象ki
とが一致した時点で処理を終了し、その時の符号を出力
する。
In this way, the input signal IN and the event k i
When and match, the process ends and the code at that time is output.

【0032】次に、符号化誤差演算部103で行う符号
誤差演算(710)について説明する。
Next, the code error calculation (710) performed by the coding error calculation unit 103 will be described.

【0033】図8は符号誤差演算(710)の処理を示
したものである。符号生成部102より符号長bi と確
率Pi を得て、Ei =(1/2)^bi −Ri により確率
誤差Ei を求める(801)。ここで、Ei =0の場合
は、分配を行わずに処理を終了する。確率誤差Ei が生
じている場合には、確率Pi より小さい順位の事象につ
いて確率誤差Ei を配分する。ここで確率誤差を均等に
配分すると共に確率の順位に変動が生じないように1つ
上に順位付けされている確率と比較する(804)。予め
定めたN0個の事象への分配を終了すると、分配した誤
差をメモリ202に格納し、処理を終了する。
FIG. 8 shows the processing of the sign error calculation (710). The code length b i and the probability P i are obtained from the code generation unit 102, and the probability error E i is obtained by E i = (½) ̂b i −R i (801). Here, when E i = 0, the process is terminated without performing the distribution. When the probability error E i is generated, the probability error E i is distributed to the events having the ranks smaller than the probability P i . Here, the probability error is evenly distributed and compared with the probability ranked one higher so that the rank of the probability does not change (804). When the distribution to the predetermined N0 events is completed, the distributed error is stored in the memory 202 and the process is completed.

【0034】このようにして、符号化装置203により
入力信号に対する符号を順次生成していく。
In this way, the coding device 203 sequentially generates codes for the input signal.

【0035】ここで、入力信号INとして“010”が
入力された場合について具体的に説明する。尚、事象,
確率,フラグは図4のようにメモリに格納されているも
のとする。
Here, the case where "010" is input as the input signal IN will be specifically described. In addition, the event,
The probability and flag are assumed to be stored in the memory as shown in FIG.

【0036】入力信号IN(=101)が入力されると事
象k1 ,確率P1 ,符号C1 ,フラグF1 をメモリ20
2から読み出す。F1 =0であるから符号生成を行う。
まず、log(1/P1 )を計算し、この計算結果を小数点
以下を四捨五入すると符号長b1 =2が得られ、この符
号長b1 =2の場合に順位の変動が生ずるかを調べ最終
的に符号長を決定する。この場合、順位の変動が生じな
いためb1 =2と確定する(図25(a))。
When the input signal IN (= 101) is input, the event k 1 , the probability P 1 , the code C 1 , and the flag F 1 are stored in the memory 20.
Read from 2. Since F 1 = 0, code generation is performed.
First, calculate the log (1 / P 1), the calculation result code length b 1 = 2 when rounded to the nearest whole can be obtained, examined whether variations in rank occurs when the code length b 1 = 2 Finally, the code length is determined. In this case, since the ranking does not change, it is determined that b 1 = 2 (FIG. 25 (a)).

【0037】次に符号誤差演算を行うために、E1
(1/2)^b1 −P1 を求めるとE1=0.04 とな
る。そこで、下位に順位付けされている事象(k2 〜k
7 )に誤差を分配する。この場合、誤差を分配しても順
位付けに変動が生じないため、そのまま分配する(図2
5(c))。
Next, in order to perform the sign error calculation, E 1 =
When (1/2) ^ b 1 −P 1 is obtained, E 1 = 0.04. Therefore, the events (k 2 to k
Distribute the error to 7 ). In this case, even if the error is distributed, the ranking does not change, so the distribution is performed as it is (FIG. 2).
5 (c)).

【0038】次に符号長b1 =2と確定したので、累積
確率値から符号C1 を生成する。符号C1 は符号長b1
=2であるから累積確率値q1 の小数点以下を左側から
2つ取り符号C1 =00を生成する。そして、符号を生
成したのでフラグF1 =1として、符号C1 ,フラグF
1 をメモリに格納する。次に、入力信号と事象k1 とを
比較するが、一致しないため次に順位付けされている事
象K2について同様に処理を行う。このように処理を行う
ことにより、入力信号INに対応する符号C3=100
が得られる。
Next, since it is determined that the code length b 1 = 2, the code C 1 is generated from the cumulative probability value. The code C 1 is the code length b 1
= 2, two decimal places of the cumulative probability value q 1 are taken from the left side to generate a code C 1 = 00. Then, since the code is generated, the flag F 1 = 1 is set, and the code C 1 and the flag F are set.
Store 1 in memory. Next, the input signal and the event k 1 are compared, but since they do not match, the same process is performed for the event K 2 that is ranked next. By performing the processing in this way, the code C 3 = 100 corresponding to the input signal IN
Is obtained.

【0039】図9に全ての事象に対して処理が行われた
場合のメモリ202に格納されている内容を示す。また
図10に生成された符号の関係を示すが、このように符
号は一意に定まる。
FIG. 9 shows the contents stored in the memory 202 when processing is performed for all events. Further, although the relationship between the generated codes is shown in FIG. 10, the codes are uniquely determined in this way.

【0040】次に、起きうる事象kと確率Pが確率関数
f(x)により与えられている場合について説明する。こ
の場合は、入力信号INが与えられる度に事象に対する
確率を求めて、符号を生成する。例えば、図11(a)
に示すように確率Pが確率関数f(x)で与えられている
場合、図11(b)に示すように入力信号IN1 が最大
の確率となるように取り得る全ての事象と確率とを求め
る。このようにして得た事象kと確率Pに基づいて先に
説明したのと同様に入力信号IN1 に対する符号C1
生成する。次の入力信号IN2 があった場合には、図1
1(c)に示すように入力信号IN2 が最大の確率とな
るように、取り得る全ての事象と確率とを求め、先と同
様に入力信号IN1 に対する符号C1 を生成する。
Next, the case where the possible event k and the probability P are given by the probability function f (x) will be described. In this case, each time the input signal IN is given, the probability for the event is obtained and the code is generated. For example, FIG.
When the probability P is given by the probability function f (x) as shown in FIG. 11, all possible events and probabilities are taken so that the input signal IN 1 has the maximum probability as shown in FIG. Ask. Thus to generate a code C 1 for similar input signal IN 1 as described above on the basis of event k and the probability P obtained by the. When there is the next input signal IN 2 ,
1 the input signal IN 2 as shown in (c) is to maximize the probability to obtain the all events and probabilities may take to generate a code C 1 with respect to earlier as well as the input signal IN 1.

【0041】この場合の装置構成については、図1に示
したのと同様の構成であり、基本的な処理は図5に示し
たのと同様である。従って、以下では処理が異なる部分
を中心に説明する。
The apparatus configuration in this case is the same as that shown in FIG. 1, and the basic processing is the same as that shown in FIG. Therefore, in the following, the description will focus on the parts that differ in processing.

【0042】図5により処理が開始すると管理部101
により確率設定部104が起動され、初期設定が行われ
る(501)。
When the processing starts according to FIG. 5, the management unit 101
Then, the probability setting unit 104 is activated and initial setting is performed (501).

【0043】図12に確率設定部104が行う処理を示
す。まず、外部又はメモリに記憶されている確率関数f
(x)を取り込むと共に初期値IN0 を設定する(120
1,1202)。そして次に、初期値IN0 が最大の確
率となるように入力され得る事象ki と確率Pi を求め
る(1203)。そして、事象ki 、確率Pi を確率P
i が大きい順にメモリに格納し、初期設定を終了する。
FIG. 12 shows the processing performed by the probability setting unit 104. First, the probability function f stored externally or in a memory
(x) is taken in and the initial value IN 0 is set (120
1, 1202). Then, next, an event k i and a probability P i that can be input so that the initial value IN 0 has the maximum probability are obtained (1203). Then, the event k i and the probability P i are
The data are stored in the memory in descending order of i , and the initialization is completed.

【0044】次に、管理部101が入力信号INを受け
ると符号生成部102を起動して符号の生成を行う。図
13は符号生成部102の処理を示したものである。入
力信号INが入力されると符号生成部102は、入力信
号INが確率の最大とした場合に、i番目に大きい確率
をとる事象ki を求める(1301)。そして、メモリ
からi番目の確率Pi ,符号Ci ,フラグFi を読み出
す(1302)。このように読み出した後は、図7で説
明した処理(702〜712)と同様の処理を行い符号
i を生成する(1303〜1313)そして入力信号
INと事象kiが一致するか判断し、一致しない場合は
累積確率qi を求め、再び符号生成処理を行い一致した
場合は符号Ci を出力する。
Next, when the management section 101 receives the input signal IN, the code generation section 102 is activated to generate a code. FIG. 13 shows the processing of the code generator 102. When the input signal IN is input, the code generation unit 102 obtains an event k i having the i-th largest probability when the input signal IN has the maximum probability (1301). Then, the i-th probability P i , code C i , and flag F i are read from the memory (1302). After reading in this way, to generate a code C i performs the same processing as the processing described (702-712) in FIG. 7 (1,303 to 1,313) and it is judged whether the input signal IN and event k i matches If they do not match, the cumulative probability q i is obtained, and the code generation process is performed again. If they match, the code C i is output.

【0045】尚、符号の生成における符号誤差演算13
09については符号誤差演算部103により図8に示した
処理を行う。
The code error calculation 13 in the code generation is performed.
For 09, the code error calculation unit 103 performs the processing shown in FIG.

【0046】以上、確率関数f(x)が与えられた場合の
入力信号INに対する符号の生成について説明したが、
この処理を一部変更することで確率が変動する場合に応
用することができる。確率が変動する場合とは、例えば
図14に示すように原稿から読み取った信号について符
号を生成する場合であり、今まで入力された信号に基づ
いて入力され得る事象に対する確率を作成する場合であ
る。この場合について図15を用いて1つの画素が0〜
7の8階調をとる場合を例に説明する。図15(a)に
示すように画素信号が入力された場合、20番目の入力
信号に対する符号を生成するために19番目までの入力
された信号に基づいて確率を求めると図15(b)のよ
うになる。そして、入力信号が取りうる事象Ki につい
て確率の大きいものから順に図15(c)に示すように
割り当てる。つまり、i番目の画素を入力信号INi
して符号を生成する場合、それまでの入力信号(I
0, IN1,IN2……INi-3,INi-2,INi-1)
から、入力されうる事象Kに対する確率Pを求める。こ
の場合、符号化装置の構成は図2と同様の構成である。
The generation of the code for the input signal IN when the probability function f (x) is given has been described above.
By partially modifying this process, it can be applied when the probability changes. The case where the probability fluctuates is, for example, a case where a code is generated for a signal read from a document as shown in FIG. 14, and a case where a probability for an event that can be input is created based on a signal input so far. . In this case, one pixel is 0 to 0 using FIG.
The case of taking 8 gradations of 7 will be described as an example. When a pixel signal is input as shown in FIG. 15A, the probability is calculated based on the input signals up to the 19th in order to generate a code for the 20th input signal. Like Then, the events K i that the input signal can take are assigned in order from the one with the highest probability as shown in FIG. That is, when a code is generated with the i-th pixel as the input signal IN i , the input signal (I
N 0 , IN 1 , IN 2 ...... IN i-3 , IN i-2 , IN i-1 )
From this, the probability P for the event K that can be input is obtained. In this case, the configuration of the encoding device is the same as that of FIG.

【0047】図16に管理部101の処理を示す。管理
部101は、まず初期設定1601を行い、入力信号I
Nが入力されると符号生成1により符号生成を行う。そ
して、予め定めた数NRの入力信号が入力された後は、
符号生成部102により符号生成を行う。これは、入力
信号INの数が少ない場合は、正しい確率を求めること
ができないから、ある程度の入力信号があるまでは、予
め設定した確率に基づいて処理を行う。
FIG. 16 shows the processing of the management unit 101. The management unit 101 first performs the initial setting 1601 and then the input signal I
When N is input, code generation is performed by code generation 1. Then, after inputting a predetermined number NR of input signals,
Code generation is performed by the code generation unit 102. This is because if the number of input signals IN is small, the correct probability cannot be obtained, and therefore the process is performed based on the preset probability until there is a certain number of input signals.

【0048】管理部101により確率設定部104が起
動され、図6に示した初期設定を行う。
The probability setting unit 104 is activated by the management unit 101 to perform the initial setting shown in FIG.

【0049】入力信号INの入力があると管理部101
は、符号生成部102を起動し、図7に示した処理に基
づいて符号の生成を行う。次に管理部101は、予め定
めた数の入力があった場合、符号生成部102に対して
処理を切り替えるよう指示し、図17に示した処理を符
号生成部102は実行する。
When the input signal IN is input, the management unit 101
Activates the code generator 102 and generates a code based on the process shown in FIG. Next, when there is a predetermined number of inputs, the management unit 101 instructs the code generation unit 102 to switch the processing, and the code generation unit 102 executes the processing shown in FIG.

【0050】図17の処理について説明する。The processing of FIG. 17 will be described.

【0051】符号生成部102は、今まで入力された入
力信号に基づいて確率Pi を求め、確率の大きいものか
ら順に並べ、メモリ202に格納する(1701)。そ
して、i番目の確率Pi と事象Ki とをメモリから読み
出す(1702)。今まで説明したのと異なり、入力信
号INにより確率を求めていくために入力信号が入力さ
れる度に確率が変動するため、フラグ,符号を格納して
いない。この後の処理は、図7に示した処理(703〜
710)と同じ処理を行う(1703〜1710)。次に
入力信号INと事象ki とを比較し、一致している場合
に符号を生成Ciする。これも、確率Pi が変動するた
めに最後に符号Ci を求めている。
The code generator 102 obtains the probabilities P i based on the input signals input so far, arranges the probabilities P i in descending order of probability, and stores them in the memory 202 (1701). Then, the i-th probability P i and the event K i are read from the memory (1702). Unlike the above description, since the probability varies each time the input signal is input to obtain the probability with the input signal IN, the flag and the code are not stored. The subsequent processing is the processing shown in FIG.
The same processing as that of 710) is performed (1703 to 1710). Next, the input signal IN and the event k i are compared, and if they match, a code is generated C i . Also in this case, since the probability P i changes, the code C i is finally obtained.

【0052】尚、符号誤差演算については既に説明した
図8の処理を符号化誤差演算部203で実行する。
Regarding the code error calculation, the processing of FIG. 8 already described is executed by the coding error calculation section 203.

【0053】次に、復号化装置について説明する。Next, the decoding device will be described.

【0054】図18に復号化システムの基本構成を示
す。復号化システムに入力される信号は、符号信号であ
り通信装置1804から入力され、復号化装置1802
により復号し、入力信号が再生される。
FIG. 18 shows the basic configuration of the decoding system. The signal input to the decoding system is a code signal and is input from the communication device 1804, and the decoding device 1802.
And the input signal is reproduced.

【0055】図19は復号化システムの復号化装置18
02を示したものである。管理部1901は、復号部1
902,符号化誤差演算部103,確率設定部104を
管理し、必要に応じて各部の起動停止を行うものであ
る。符号から入力信号を再生する復号化処理は、符号化
処理と重複した処理を行う。これは、入力された符号信
号と一致するまで符号を生成し、一致した時点で生成し
た符号に対応する事象を出力するためである。
FIG. 19 shows a decoding device 18 of the decoding system.
02 is shown. The management unit 1901 uses the decryption unit 1
The control unit 902 manages the coding error calculation unit 103 and the probability setting unit 104, and starts and stops each unit as necessary. The decoding process of reproducing the input signal from the code performs the same process as the coding process. This is because the code is generated until it matches the input code signal, and the event corresponding to the code generated at the time of the match is output.

【0056】では図20を用いて、s=2とした場合、
つまり2進符号が入力され復号し、入力信号を再生する
場合について概要を説明する。
Then, referring to FIG. 20, when s = 2,
That is, the outline of the case where a binary code is input, decoded, and the input signal is reproduced will be described.

【0057】まず初期設定を行う(2001)。この初期
設定は、図3で説明した処理301と同じ処理を行う。
次に符号が入力される(2002)と、符号のビット長
(符号長)bk ,符号誤差Ek を求め、確率値の低い事
象に対して符号誤差を分配する(2003,200
4)。そして、入力された符号CINと生成したi番目
の符号Ci とを比較し、一致した場合には事象ki を入
力信号として出力し、一致しなかった場合には再度符号
生成を行う(2006)。尚、符号のビット長(符号
長)bi ,符号誤差Ei を求め、確率値の低い事象に対
して符号誤差を分配する処理については図3の処理30
3,304と同じ処理である。
First, initial setting is performed (2001). For this initial setting, the same processing as the processing 301 described in FIG. 3 is performed.
Next, when a code is input (2002), the bit length (code length) b k of the code and the code error E k are obtained, and the code error is distributed to the event having a low probability value (2003, 200
4). Then, the input code CIN is compared with the generated i-th code C i, and if they match, the event k i is output as an input signal, and if they do not match, code generation is performed again (2006 ). The process of obtaining the code bit length (code length) b i and the code error E i and distributing the code error to the event having a low probability value is the process 30 of FIG.
This is the same processing as 3,304.

【0058】次に入力された符号から入力信号の再生で
ある復号化処理について詳細に説明する。
Next, the decoding process for reproducing the input signal from the input code will be described in detail.

【0059】図21は、管理部1901の処理を示した
ものである。管理部1901は、確率設定部104を起
動し、初期設定を行う。そして、符号CINが入力され
ると(2102)、復号部1902を起動して入力され
た符号CINに対する事象kを抽出し(2103)、再
生した入力信号として出力する(2104)。
FIG. 21 shows the processing of the management section 1901. The management unit 1901 activates the probability setting unit 104 and performs initial setting. When the code CIN is input (2102), the decoding unit 1902 is activated to extract the event k corresponding to the input code CIN (2103) and output it as a reproduced input signal (2104).

【0060】管理部1901により起動された確率設定
部1904は図6に示した処理と同様の処理を行う。つ
まり、確率Pi が大きい順に入力信号が取りうる事象k
i ,確率Pi をメモリに格納する。
The probability setting unit 1904 activated by the management unit 1901 performs the same processing as that shown in FIG. That is, the event k that can be taken by the input signal in the descending order of probability P i
Store i and probability P i in memory.

【0061】管理部1901では入力される符号を監視
し、符号が入力された時には入力信号生成部1901を
起動する。尚、管理部において入力される符号の切り出
しは、符号が図10に示したように生成されるので、符
号を切り出すことができる。管理部1901により起動
された復号部1902を起動して図22に示す処理を行
う。まずメモリ1803からi番目の事象ki ,確率P
i ,符号Ci ,フラグFi を読み出す(2201)。こ
こで、Fi を判断し(2202)、Fi =1のときは既
に符号Ci が作成されているので、入力符号CINと符
号Ci が一致するかの判断を行う(2212)。Fi
0となっている場合は符号Ci が作成されていない。そ
こで、符号のビット数を求めるためlog(1/Pi )を計
算し(2203)、この計算結果を小数点以下を四捨五
入し符号長bi を求める。そして、この四捨五入の処理
により、確率Pi の順位が変動する場合があるので、再
度確率を求め(2205)、順位が変動する場合には切
り上げ又は切り捨て処理を行う(2207〜220
9)。このようにして求めた符号長bi に基づいて符号
誤差演算を行う(2210)。
The management unit 1901 monitors the input code, and when the code is input, activates the input signal generation unit 1901. The cutout of the code input in the management unit can be cut out because the code is generated as shown in FIG. The decryption unit 1902 activated by the management unit 1901 is activated and the processing shown in FIG. 22 is performed. First, from the memory 1803, the i-th event k i , probability P
i , code C i , and flag F i are read (2201). Here, F i is determined (2202), and when F i = 1 the code C i has already been created, so it is determined whether the input code CIN and the code C i match (2212). F i =
When it is 0, the code C i is not created. Therefore, log (1 / P i ) is calculated to find the number of bits of the code (2203), and the calculation result is rounded off to the nearest decimal point to obtain the code length b i . Since the order of the probabilities P i may change due to this rounding processing, the probabilities are calculated again (2205), and if the order changes, rounding up or rounding down is performed (2207 to 220).
9). A code error calculation is performed based on the code length b i thus obtained (2210).

【0062】次に、求めた符号長bi と累積確率値qi
により符号Ci を生成する。このようにして符号が生成
されたら対応するフラグFi =1とし、生成した符号C
i と共にメモリ1803に格納する。そして、次に入力
された符号CINと符号Ciとを比較して(221
2)、一致していない場合には、累積確率値qi を求め
(2214)、次に確率Pi が大きいものについて、符
号生成の処理を行う。
Next, the calculated code length b i and the cumulative probability value q i
To generate the code C i . When the code is generated in this way, the corresponding flag F i = 1 is set, and the generated code C
It is stored in the memory 1803 together with i . Then, the next input code CIN and code C i are compared (221
2) If they do not match, the cumulative probability value q i is calculated (2214), and the code generation process is performed for the next highest probability P i .

【0063】このようにして、入力された符号CINと
符号Ci とが一致した時点で処理を終了し、その時の符
号Ci に対応する事象Ki を出力する。
In this way, the processing is terminated when the input code CIN and the code C i match, and the event K i corresponding to the code C i at that time is output.

【0064】次に、起きうる事象kと確率Pが確率関数
f(x)により与えられ、生成された符号を復号する場合
について説明する。
Next, a case will be described in which the possible event k and the probability P are given by the probability function f (x) and the generated code is decoded.

【0065】基本的には、先に説明した処理とほぼ同じ
である。つまり、初期設定は確率設定部104におい
て、図12に示した処理を行う。そして管理部1901
により起動された復号部1902は、図23に示した処
理を行う。
Basically, it is almost the same as the processing described above. That is, for the initial setting, the probability setting unit 104 performs the processing shown in FIG. And the management unit 1901
The decoding unit 1902 activated by performing the processing shown in FIG.

【0066】図23に示すように、入力される符号CI
Nが確率の最大とした場合に、i番目に大きい確率をと
る事象ki を求める(2301)。そして、メモリから
i番目の確率Pi ,符号Ci ,フラグFi を読み出す
(2302)。このように読み出した後は、図22で説
明した処理(2202〜2215)と同様の処理を行い
符号を生成する(2303〜2316)。
As shown in FIG. 23, the input code CI
When N is the maximum probability, the event k i having the i-th largest probability is obtained (2301). Then, the i-th probability P i , code C i , and flag F i are read from the memory (2302). After reading in this way, the same processing as the processing (2202 to 2215) described in FIG. 22 is performed to generate a code (2303 to 2316).

【0067】次に、確率が変動し、生成された符号を復
号する場合について説明する。
Next, the case where the probability changes and the generated code is decoded will be described.

【0068】図24に管理部1901の処理を示す。管
理部1901は、まず初期設定2401を行い、符号CIN
が入力されると符号1により入力信号の再生を行う。そ
して、予め定めた数の符号NRが入力された後は、符号
2により入力信号の再生を行う。
FIG. 24 shows the processing of the management unit 1901. The management unit 1901 first performs the initial setting 2401, and the code CIN
Is input, the input signal is reproduced by the code 1. Then, after a predetermined number of codes NR have been input, the input signal is reproduced with code 2.

【0069】管理部1901により確率設定部104が
起動され、図6に示した初期設定を行う。
The probability setting section 104 is activated by the management section 1901 to perform the initial setting shown in FIG.

【0070】符号CINの入力があると管理部1901
は、復号部1902を起動し、図22に示した符号の生
成を行う。次に管理部1901は、予め定めた数の入力
があった場合、復号部1902に対して処理を切り替え
るよう指示し、図25に示した処理を復号部1902は
実行する。
When the code CIN is input, the management unit 1901
Activates the decoding unit 1902 to generate the code shown in FIG. Next, when there is a predetermined number of inputs, the management unit 1901 instructs the decoding unit 1902 to switch the processing, and the decoding unit 1902 executes the processing shown in FIG. 25.

【0071】図25の処理について説明する。The processing of FIG. 25 will be described.

【0072】復号部1902は、今まで入力された符号
に基づいて入力信号とされ得る事象ki に対する確率P
i を求め、確率の大きいものから順に並べた後、メモリ
1803に格納する(2500)。この後の処理は、図22
に示した処理(2203〜2215)と同じ処理を行う
(2501〜2513)。
The decoding unit 1902 receives the probability P for the event k i that can be used as an input signal based on the code input so far.
i is calculated and arranged in descending order of probability.
It is stored in 1803 (2500). The process after this is shown in FIG.
The same processing (2501 to 2513) as the processing shown in (2203 to 2215) is performed.

【0073】以上説明した処理については、当然のこと
ながら符号生成部102の処理と復号部1902が扱う
処理が同じになるようにする。
As for the processing described above, the processing of the code generation section 102 and the processing handled by the decoding section 1902 are naturally the same.

【0074】図27に符号化装置と復号化装置とを一体
化した、符号化復号化装置を示す。尚、各部の処理につ
いては今まで説明したものと同様の処理を行うものであ
る。以上説明した処理は一例であり、これに限られるも
のではない。そこで以下、他の処理について述べる。
FIG. 27 shows an encoding / decoding device in which the encoding device and the decoding device are integrated. The processing of each unit is the same as that described above. The processing described above is an example, and the present invention is not limited to this. Therefore, other processing will be described below.

【0075】(1)ある確率値以下、あるいは、ある順
位以下の事象の生起確率を均一な確率値に置き換えるこ
とで、符号ビットの生成を簡易化することができる。例
えば、信号が8ビットで構成され、すなわち事象は25
6種類(2の8乗)ある場合に、上位の8種類の事象に
ついてのみ予測確率値を設定することにして、残りの2
48種類の事象については均一の確率値を割り当てるこ
とができる。ただし、全ての事象の生起確率の合計は
1.0 以下でなければならない。信号の入力毎に逐次に
確率値を算出することの負荷が大きい場合に有効な方法
であり、確率値の大きさによる順番付けも上位の8個の
事象について実行すればよい。均一な確率値である事象
(上記の例では、第9番目から256番目まで)には、
均一な符号長を割り当てることができることから、順位
の隣接する事象間の符号は、符号長で表される2進小数
(1/2)^bk の最下位ビットの値が差分であるように
設定できる。この結果、事象の順位が直接に符号ビット
に反映するため、符号化処理および復号処理の高速化が
実現できる。
(1) The generation of code bits can be simplified by replacing the occurrence probabilities of events below a certain probability value or below a certain rank with uniform probability values. For example, the signal consists of 8 bits, that is, the event is 25
If there are 6 types (2 to the 8th power), the prediction probability value is set only for the top 8 types of events, and the remaining 2
Uniform probability values can be assigned for the 48 types of events. However, the sum of the occurrence probabilities of all events must be 1.0 or less. This is an effective method when the load of sequentially calculating the probability value for each signal input is large, and the ordering according to the magnitude of the probability value may be executed for the upper eight events. For events with uniform probability values (9th to 256th in the above example),
Since a uniform code length can be assigned, the code between adjacent events of rank is a binary fraction represented by the code length.
The value of the least significant bit of (1/2) ^ b k can be set to be the difference. As a result, the order of events is directly reflected in the code bit, so that the speed of encoding and decoding can be increased.

【0076】(2)符号ビットの設定において、累積確
率値qk を用いてbk ビットの符号を生成している。こ
こで、累積確率値に一定のオフセット値を加えたり、
(1−qk )を累積確率値として利用することもでき
る。
(2) In setting the code bit, the cumulative probability value q k is used to generate a b k bit code. Here, add a constant offset value to the cumulative probability value,
(1-q k) may be utilized as the accumulated probability values.

【0077】(3)符号長bk の設定方法として、log
(1/Pk )を四捨五入しているが、五捨四入してもよ
い。ただし、符号化手段と復号化手段間で統一されてい
なければならない。ここで符号長を求めるための対数演
算を簡略化するには、幾つかのサンプル点の対数演算結
果をテーブルにまとめておき、入力信号に基づいて、テ
ーブル検索と補間処理を組み合わせて行うことで実現で
きる。補間処理に伴う演算誤差は、確率値に再換算した
ときに元より大きくならないように制限することが重要
であり、このためには対数演算結果の最小桁を切り上げ
するように符号長を設定すればよい。
(3) As a method of setting the code length b k , log
Although (1 / P k ) is rounded off, it may be rounded off. However, the encoding means and the decoding means must be unified. Here, in order to simplify the logarithmic calculation for obtaining the code length, the logarithmic calculation results of several sample points are collected in a table, and table search and interpolation processing are performed in combination based on the input signal. realizable. It is important to limit the calculation error that accompanies the interpolation process so that it does not become larger than the original when reconverted to a probability value.To do this, set the code length so that the minimum digit of the logarithmic calculation result is rounded up. Good.

【0078】ここで、本発明により得られる具体的なメ
リットと挙げておく。
Here, specific merits obtained by the present invention will be mentioned.

【0079】(1)圧縮率の観点からは、最適かつ瞬時
復号可能な性質を持つ。本発明の特長は、各事象におけ
る符号化誤差を最小にすると共に、発生した符号化誤差
を残りの事象によって補完して、圧縮率の損失を防ぐこ
とである。すなわち、符号化誤差の分配によって、累積
する符号化誤差を0にする、もしくは0に近づけること
ができる。別の表現をすれば、累積符号化誤差を0にす
る、もしくは0に近づけるように、各事象で発生した符
号化誤差を打ち消す処理をしていく。本発明は、最適性
と瞬時復号可な性質を実現する。
(1) From the viewpoint of compression rate, it has an optimal and instantaneously decodable property. A feature of the present invention is to minimize the coding error in each event and to supplement the coding error that has occurred with the remaining events to prevent loss of compression ratio. That is, the cumulative coding error can be set to 0 or close to 0 by distributing the coding error. In other words, the processing for canceling the coding error generated in each event is performed so that the cumulative coding error becomes 0 or approaches 0. The present invention realizes optimality and instantaneous decodability.

【0080】(2)予測した生起確率値の高い順番に、
実際に生起した事象までの符号生成手順を実行すればよ
いので、符号生成のための平均的な処理時間を短縮する
ことができる。高速に符号を生成できるということは、
あらかじめ符号表を準備することなく、符号化対象の生
起確率の変動に対応しながら、逐次に符号生成するに適
していることを意味する。また、生起確率の低い事象に
ついては、一定の符号長を割り当て、順位付けによる符
号生成ができる。一方、ハフマン符号で適応的な符号生
成を行おうとすると、確率値の最も小さな事象から高い
事象へ向けて信号処理を実行していくトリー構造である
ことから、逐次に全ての符号を生成しなければならず、
符号生成のために膨大な処理時間がかかり、実用的でな
い。
(2) In descending order of the predicted occurrence probability value,
Since it is sufficient to execute the code generation procedure up to the event that actually occurred, the average processing time for code generation can be shortened. The ability to generate codes at high speed means
This means that it is suitable for sequentially generating codes while coping with fluctuations in the occurrence probability of a coding target without preparing a code table in advance. In addition, for an event with a low occurrence probability, a certain code length can be assigned and code can be generated by ranking. On the other hand, when trying to perform adaptive code generation with the Huffman code, it is necessary to generate all codes sequentially because it is a tree structure that performs signal processing from the event with the smallest probability value to the event with the highest probability value. Must
Enormous processing time is required for code generation, which is not practical.

【0081】(3)情報源の拡大による圧縮率向上を容
易に組み込むことができる。複数の事象についてまとめ
て一つの符号を割り当てることは、情報源の拡大として
知られており、これにより圧縮率の向上が実現できるこ
とは、いわゆるシャノンの定理として知られている。し
かしながら、n値レベルの信号をm個組み合わせたなら
ばn^m(nのm乗)種類の事象に対応した符号が必要
となる。ハフマン符号を用いて逐次に符号生成を行うな
らば、符号生成時間が長大となり膨大な符号表が必要と
なり実用的でない。これに対して本発明では、実際に生
起した事象に対応する符号が生成されるまでの手順を実
行すればよいので、高速に信号処理できると共に、符号
表も必要としない。
(3) It is possible to easily incorporate the improvement of the compression rate by expanding the information source. Assigning one code collectively for a plurality of events is known as expansion of an information source, and it is known as so-called Shannon's theorem that improvement of compression rate can be realized by this. However, if m signals of n-value level are combined, a code corresponding to n ^ m (n to the m-th power) types of events is required. If the Huffman code is used to sequentially generate codes, the code generation time becomes long and a huge code table is required, which is not practical. On the other hand, in the present invention, since the procedure until the code corresponding to the event actually occurred is generated, the signal processing can be performed at high speed and the code table is not required.

【0082】(4)本発明によって生成される符号は、
小数点以下の数値としてみると、生起確率の順番にした
がって数値の大きさが増加する性質を持っている。この
性質を利用して、符号の区別を行うことができる。
(4) The code generated by the present invention is
When viewed as numbers below the decimal point, it has the property of increasing in size according to the order of occurrence probabilities. By utilizing this property, it is possible to distinguish the codes.

【0083】次に本発明の符号化復号化装置の応用例と
して、メモリと同一チップ上に配置した混載型LSIに
ついて説明する。
Next, as an application example of the encoding / decoding apparatus of the present invention, a mixed LSI arranged on the same chip as the memory will be described.

【0084】図28に混載型LSIを示す。混載型LS
Iは、外部との信号の入出力を行う入出力制御部280
1,入力されたデータを符号としてメモリに蓄え、符号
として蓄えられたデータを再生する符号化復号化部28
02,符号化されたデータ,入力されたデータを蓄える
メモリ2704との間でデータの分配を行う分配器27
03から構成されている。
FIG. 28 shows a mixed LSI. Mixed LS
I is an input / output control unit 280 that inputs and outputs signals to and from the outside.
1, a coding / decoding unit 28 that stores input data as a code in a memory and reproduces the data stored as a code
02, a distributor 27 that distributes data to and from a memory 2704 that stores encoded data and input data
It is composed of 03.

【0085】以下、各部について説明する。Each section will be described below.

【0086】符号化復号化部2802は、管理部270
1,確率設定部104,符号生成部102,復号部19
02,符号化誤差演算部103から構成されている。各
部の処理については既に説明した、予め確率が分かって
いる場合の処理を実行する(図6〜図8,図22)。
The encoding / decoding section 2802 has a management section 270.
1, probability setting unit 104, code generation unit 102, decoding unit 19
02, a coding error calculation unit 103. Regarding the processing of each part, the processing when the probability is known in advance is executed (FIGS. 6 to 8 and 22).

【0087】入出力制御部2801は、外部CPUとの
データを入出力することで、符号生成,復号処理の起動
・終了・一時停止、あるいはリセットなどを実行する。
具体的には、CPUから送られてきたデータを受けると
符号化復号化部2802の管理部2701へデータの入
力があったことを伝える。これにより入力されたデータ
の符号を生成し、メモリ2804に格納する。また、C
PUから読み出し命令があった場合には、管理部270
1へ伝えメモリに符号として格納されたデータを読み出
し、復号部1902でデータの再生を行う。ここで、外
部入出力データ幅とチップ上のメモリデータ幅は異なる
ことから、データ入出力レジスタ2801を用いてデータ幅
の変換を行う。このように、メモリアクセスが高速であ
ること、およびメモリデータ幅が大きいことから、外部
CPUからのデータ入出力に対して十分に余裕のある制
御を行うことができる。すなわち、チップ上に搭載した
信号処理装置によるメモリアクセスの隙間を利用するこ
とで、外部CPUに対しても高速なデータ入出力を実現
できる。このため、一定の条件に基づけば、内部の信号
処理を実行しながら、外部装置に対して「待ち状態」と
ならないデータ入出力速度を保証することもできる。
The input / output control unit 2801 inputs / outputs data to / from an external CPU to execute activation / termination / temporary suspension, resetting, etc. of code generation / decoding processing.
Specifically, when receiving the data sent from the CPU, it notifies the management unit 2701 of the encoding / decoding unit 2802 that the data has been input. As a result, the code of the input data is generated and stored in the memory 2804. Also, C
When there is a read command from the PU, the management unit 270
The data stored in the memory as a code is read, and the decoding unit 1902 reproduces the data. Here, since the external input / output data width and the memory data width on the chip are different, the data width conversion is performed using the data input / output register 2801. As described above, since the memory access is fast and the memory data width is large, it is possible to perform control with a sufficient margin for data input / output from the external CPU. That is, high-speed data input / output can be realized with respect to the external CPU by utilizing the memory access gap by the signal processing device mounted on the chip. Therefore, based on a certain condition, it is possible to guarantee the data input / output speed that does not enter the "waiting state" for the external device while executing the internal signal processing.

【0088】確率設定部104は、メモリ2804ら一
括してアクセスできるデータ幅を大きく設定し、読み出
しレジスタ2812に一時蓄積した後に、データ分配器
2817を用いて確率,事象のデータを取り込む。
The probability setting unit 104 sets a large data width that can be collectively accessed from the memory 2804, temporarily stores it in the read register 2812, and then sets the data distributor.
The 2817 is used to capture probability and event data.

【0089】符号生成部102,確率設定部104,復
号部1902,符号化誤差演算部103は、演算途中の
データを個別の処理部に蓄積することなく、メモリ部に
蓄積しておくことができる。このため、メモリ2804
と各信号処理部の入出力信号を、信号分配器2803内
のデータ集配分配器2811を用いて集配もしくは分配
する。ビット幅の大きなメモリを内蔵することで、複数
種類の信号を同一のメモリアクセスで入出力し、メモリ
アクセスの高速化を等価的に実現できる。
The code generation unit 102, the probability setting unit 104, the decoding unit 1902, and the coding error calculation unit 103 can store the data in the middle of calculation in the memory unit without storing in the individual processing units. . Therefore, the memory 2804
And the input / output signals of each signal processing unit are collected or distributed by using the data distribution / distribution device 2811 in the signal distribution device 2803. By incorporating a memory with a large bit width, it is possible to equivalently realize high-speed memory access by inputting and outputting a plurality of types of signals with the same memory access.

【0090】符号生成部102は、メモリ2804に一
時的に蓄積した符号化対象の信号を、読み出しレジスタ
2812、およびデータ分配器2713を用いて、符号
変換部に伝えて符号に変換する。ここで生成した符号は
可変長であるため、データ入出力のデータ幅にあわせた
ビット単位の整列を行う必要がある。このため、生成し
た符号を符号レジスタ2814に一時蓄積して、ビット
整列器2815を用いて、書き込みレジスタ2816に
書き込む。書き込みレジスタ2816がフルになった時
点で、メモリ2804の圧縮データ蓄積領域に転送す
る。ここで、二つのデータにまたがって符号を並べる場
合には、境界部分で符号を分割することも必要となり、
処理手順が複雑になる。しかし、メモリデータ幅が大き
ければ、このような境界処理も少なくて済み、高速化に
効果がある。
The code generation unit 102 uses the read register 2812 and the data distributor 2713 to transfer the signal to be coded, which is temporarily stored in the memory 2804, to the code conversion unit and converts it into a code. Since the code generated here has a variable length, it is necessary to perform bit-wise alignment according to the data width of data input / output. Therefore, the generated code is temporarily stored in the code register 2814 and is written in the write register 2816 using the bit aligner 2815. When the write register 2816 is full, the data is transferred to the compressed data storage area of the memory 2804. Here, when the codes are arranged over two data, it is necessary to divide the code at the boundary part,
The processing procedure becomes complicated. However, if the memory data width is large, such boundary processing can be reduced, which is effective for speeding up.

【0091】尚、復号部1902も符号生成部と同様に
レジスタを介してメモリへのデータの入出力を行う。
The decoding unit 1902 also inputs / outputs data to / from the memory via the register, similarly to the code generation unit.

【0092】なお、ここで利用するメモリ2804に種
類の限定はなく、S−RAM,D−RAM,SD−RA
M,F−RAMなどを利用できる。ここでF−RAM
は、無電源でデータを保存できる特性を持っているた
め、確率,符号となった圧縮データなどを保存するに適
する。この構成により、LSIチップ外に入出力するデ
ータは符号化されていないが、LSIチップ内のメモリ
に蓄積するデータは符号化復号化装置2802により圧
縮データとすることで、メモリの見かけ上の容量を増加
させることができる。このような混載型LSIは、デー
タの実体と見かけが異なることから、「仮想メモリ」と
も呼べるものである。機能混載型LSI内部に蓄積した
圧縮データを、外部の記憶装置に転送したり、あるいは
伝送装置を介して他装置と通信することもできる。
There is no limitation on the type of memory 2804 used here, and S-RAM, D-RAM, SD-RA
M, F-RAM, etc. can be used. F-RAM here
Has a characteristic that data can be stored without a power source, and is therefore suitable for storing probability, coded compressed data, and the like. With this configuration, the data input / output to / from the LSI chip is not encoded, but the data to be stored in the memory inside the LSI chip is compressed data by the encoding / decoding device 2802, so that the apparent capacity of the memory is reduced. Can be increased. Such an embedded LSI can be called a “virtual memory” because it has a different appearance from the substance of data. The compressed data stored inside the function-embedded LSI can be transferred to an external storage device or can be communicated with another device via a transmission device.

【0093】このようにLSIチップ内でメモリアクセ
スを行うことにより、 (1)データ幅を大きく設定できることから、複数のデ
ータを一括してアクセスできる。
By thus performing the memory access in the LSI chip, (1) since the data width can be set large, it is possible to collectively access a plurality of data.

【0094】(2)半導体チップ上の配線によるため、
配線容量も少なく、信号線間のスキューも小さいので、
高速な転送レートを実現できる。
(2) Because of the wiring on the semiconductor chip,
Since the wiring capacity is small and the skew between the signal lines is also small,
A high transfer rate can be realized.

【0095】(3)外部のノイズ等の影響を受けにく
い。
(3) Less susceptible to external noise and the like.

【0096】(4)装置の低コスト化が実現でき、信頼
性も向上する。
(4) The cost of the device can be reduced and the reliability is improved.

【0097】(5)チップ上のメモリアクセスが高速な
ため、キャッシュメモリが不要となる。
(5) Since the memory access on the chip is fast, the cache memory becomes unnecessary.

【0098】等を実現できる。And the like can be realized.

【0099】図29は、混載型の仮想メモリを、プロセ
ッサと接続してデータ入出力動作をさせる場合の構成例
を示したものである。入出力するデータの種類がCPU
の出力するメモリアドレスによって区別できるとすれ
ば、入出力制御部2801を用いてデータ種別を判定す
ることができる。データ種別として、連続して高速な入
出力が望まれるデータの場合には、メモリのレイアウト
構成に基づくチップ内の実メモリアドレス信号に変換す
ることができる。例えば、メモリのレイアウト構成の一
つとして、「バンク」と呼ばれるメモリブロック構造が
あり、複数の該バンクを用意して交互にデータ入出力す
ることによりメモリアクセスの高速化を実現できる。こ
のようなメモリレイアウト構成とメモリアクセス順序を
入出力制御部2801が管理することで、外部CPUの
出力したアドレス信号とは異なる、チップ内部のメモリ
アドレス信号を生成してメモリアクセスの高速化を実現
できる。また別のデータ種別として、符号化復号化装置
の起動をかける信号である場合には、前記のような高速
化のためのアドレス変換を必要とせず、該当する回路に
起動信号が伝達できれば良い。
FIG. 29 shows an example of a configuration in which a mixed virtual memory is connected to a processor for data input / output operation. Type of data to be input / output is CPU
If it is possible to distinguish by the memory address output by, the data type can be determined using the input / output control unit 2801. When the data type is data for which continuous high-speed input / output is desired, it can be converted into an actual memory address signal in the chip based on the layout configuration of the memory. For example, as one of the memory layout configurations, there is a memory block structure called a "bank", and a plurality of the banks are prepared and data can be input / output alternately to achieve high-speed memory access. The input / output control unit 2801 manages such a memory layout configuration and a memory access sequence to generate a memory address signal inside the chip, which is different from the address signal output from the external CPU, to realize high-speed memory access. it can. As another data type, when the signal is a signal for activating the encoding / decoding device, it is sufficient that the activation signal can be transmitted to the corresponding circuit without requiring the address conversion for speeding up as described above.

【0100】これを実現するためには、あらかじめ、ア
ドレス信号とデータ種別の関係を、プロセッサから上記
仮想メモリに連絡しておくことが有効である。仮想メモ
リは、上記連絡事項をLSIチップ内に格納しておき、
プロセッサからアクセスを受けた際のアドレス信号を用
いて該内容を参照しながら、信号の性質を判断すること
ができる。また、上記連絡事項がなくても、信号の性質
を測定することで同様の信号種別を行うことができる。
そして、信号性質に適応した符号を生成できる。
In order to realize this, it is effective to inform the virtual memory of the relationship between the address signal and the data type in advance from the processor. The virtual memory stores the above contact information in the LSI chip,
The nature of the signal can be judged by referring to the contents using the address signal when the access is received from the processor. Further, even without the above-mentioned notification items, the same signal type can be performed by measuring the property of the signal.
Then, a code adapted to the signal property can be generated.

【0101】具体的な装置構成においては、モデル化部
とエントロピー符号化部の組み合わせを行うことで高い
圧縮率を実現できる。LSIとして作るには、汎用と専
用の2種類の考え方がある。
In a specific device configuration, a high compression rate can be realized by combining the modeling unit and the entropy coding unit. There are two types of ideas for creating an LSI, one for general purpose and one for exclusive use.

【0102】(1)モデル化部の信号処理内容を限定す
ることなく、汎用のエントロピー符号化を実行する装置
としてLSIチップを作ることができる。例えば、JP
EG,MPEG等の場合では、LSIチップの外部にお
いて離散コサイン変換等のモデル化部に相当する部分を
実行し、LSIチップはエントロピー符号化処理を実行
することができる。さらに、様々な符号化対象を限定し
ないことから、いわゆるマルチメディア信号処理に適し
ており、画像・音声・テキスト・線図形などを対象にし
た共通のエントロピー符号化装置として利用できる。
(1) An LSI chip can be manufactured as a device for executing general-purpose entropy coding without limiting the signal processing contents of the modeling unit. For example, JP
In the case of EG, MPEG, etc., a portion corresponding to a modeling unit such as discrete cosine transform can be executed outside the LSI chip, and the LSI chip can execute entropy coding processing. Further, since various encoding targets are not limited, it is suitable for so-called multimedia signal processing, and can be used as a common entropy encoding device for images, voices, texts, line graphics, and the like.

【0103】(2)モデル化部とエントロピー符号化部
の両者をLSIチップとすることで、特定の符号化対象
に限定した専用装置を構成できる。例えば、JPEG,MPEG
等の場合では、離散コサイン変換等のモデル化部とエン
トロピー符号化部の両者をLSIチップとして構成でき
る。この場合のメリットは、両者間の信号伝送をLSI
チップ上で配線できること、バッファリングのメモリを
チップ上に搭載することで装置の小型化を実現できるこ
と、モデル化部の信号処理結果を参照することで圧縮率
の向上を図れること、などがある。
(2) By using both the modeling unit and the entropy coding unit as LSI chips, a dedicated device limited to a specific coding target can be constructed. For example, JPEG, MPEG
In such cases, both the modeling unit such as the discrete cosine transform and the entropy coding unit can be configured as an LSI chip. The advantage of this case is that the signal transmission between
Wiring on the chip is possible, miniaturization of the device can be realized by mounting a buffering memory on the chip, and the compression rate can be improved by referring to the signal processing result of the modeling unit.

【0104】次に本発明の符号化装置203をデジタル
・アーカイブ装置へ適用した場合について説明する。
Next, a case where the encoding device 203 of the present invention is applied to a digital archive device will be described.

【0105】例えば、美術品などを対象にして入力した
画像データは、劣化なく高品位なまま蓄積することで、
再生した画像を鑑賞したり、学術的な調査に利用でき
る。このような目的でデータを保存するものに、デジタ
ル・アーカイブ装置がある。しかしながら、入力した画
像信号は、一般に複数の色信号から構成される多値信号
であり、これを劣化させずに効率よく圧縮することは困
難とされている。
For example, the image data input for a work of art, etc. can be stored in high quality without deterioration,
It can be used for viewing reproduced images and for academic research. A digital archive device stores data for such a purpose. However, the input image signal is generally a multi-valued signal composed of a plurality of color signals, and it is difficult to efficiently compress it without degrading it.

【0106】本発明の符号化装置203を用いれば、図
30のような構成で、高い圧縮率を実現することができ
る。
By using the encoding device 203 of the present invention, a high compression rate can be realized with the configuration shown in FIG.

【0107】モデル化部の構成としては、例えば、バッ
ファメモリに蓄積した信号を参照して予測した信号と、
実際に入力した信号との差分値を算出する方法がある。
そして、差分値の生起確率を予測して、差分値のエント
ロピー符号化を行うことができる。一般に、差分値は0
を中心として+−に振幅することから、差分値の0に最
も短い符号を割り当て、+−の振幅の大きさの順に長い
符号を割り当てることになる。ここで、本発明では、図
30に示したように、モデル化部の信号処理手順の途中
のデータである、 (1)符号化対象の信号の統計的な性質 (2)差分値の出現分布特性 等を測定することで生起確率を求め、符号生成すること
ができる。さらに、複数の画素の信号を組み合わせた情
報源の拡大によって、圧縮率の向上を実現できる。本発
明の符号化装置203を用いれば、差分値が0である信
号が連続して発生すると判断した場合には、差分値を複
数組み合わせて一つの符号に変換するように手順を設定
することが容易に実現できる。コンピュータ・グラフィ
ックスのようにノイズ成分のない画像では、予測による
差分値が0となる場合が多くある。このような画像信号
は、複数の画像信号の生起確率を組み合わせて情報源の
拡大をすることで圧縮率を向上させることができる。
As the structure of the modeling unit, for example, a signal predicted by referring to a signal accumulated in a buffer memory,
There is a method of calculating a difference value from an actually input signal.
Then, the occurrence probability of the difference value can be predicted, and the entropy coding of the difference value can be performed. Generally, the difference value is 0
Since the amplitude is +/- around the center, the shortest code is assigned to the difference value 0, and the long code is assigned in the order of the amplitude of +-. Here, in the present invention, as shown in FIG. 30, it is data in the middle of the signal processing procedure of the modeling unit. (1) Statistical properties of the signal to be coded (2) Appearance distribution of difference values The occurrence probability can be obtained by measuring the characteristics and the like, and the code can be generated. Furthermore, the compression rate can be improved by expanding the information source that combines the signals of a plurality of pixels. If the encoding apparatus 203 of the present invention is used, when it is determined that signals having a difference value of 0 occur successively, it is possible to set a procedure such that a plurality of difference values are combined and converted into one code. Easy to implement. In an image having no noise component such as computer graphics, the difference value due to prediction is often 0. In such an image signal, the compression rate can be improved by combining the occurrence probabilities of a plurality of image signals to expand the information source.

【0108】上記に基づく具体的な手順の一例として
は、 (a)初期化として、参照信号の初期設定を行う。
As an example of a specific procedure based on the above, (a) as initialization, the reference signal is initialized.

【0109】(b)参照信号から予測確率値の設定を行
い、第一位の信号レベルを予測信号とする。
(B) The prediction probability value is set from the reference signal, and the first signal level is used as the prediction signal.

【0110】(c)入力した信号と予測信号との差分値
を算出する。
(C) The difference value between the input signal and the predicted signal is calculated.

【0111】(d)差分値を符号に変換する。(D) Convert the difference value into a code.

【0112】(e)次の信号について手順(b)から繰
り返す。信号入力が終了ならば、終了手順を実行して終
わる。
(E) Repeat the procedure from step (b) for the next signal. If the signal input is completed, the end procedure is executed and the process ends.

【0113】記憶装置として、CD−ROM,DVD,
ハードディスク、あるいは通信網に接続したファイル装
置、などを利用できる。このようなデジタル・アーカイ
ブ装置においては、符号化する装置と、復号化する装置
は全く別に構成されるが、その符号生成手順は一貫した
処理内容である必要がある。このため、復号化のための
手順(プログラム)内容を、該圧縮データと併せて記憶
させて置き、再生装置は復号化のための内容を利用する
ことで、圧縮データを再生することもできる。次に、ラ
ン長符号化への適用について説明する。
As a storage device, a CD-ROM, a DVD,
A hard disk or a file device connected to a communication network can be used. In such a digital archive device, an encoding device and a decoding device are constructed separately, but the code generation procedure needs to have consistent processing contents. Therefore, the procedure (program) content for decoding is stored together with the compressed data, and the playback device can play back the compressed data by using the content for decoding. Next, application to run length coding will be described.

【0114】例えばファクシミリのように、白黒2値画
像をラスタスキャンする場合では、各画素の信号レベル
は0と1のいずれかであり、同一レベルの信号の連続個
数(ラン長)で画像データを表現できる。0と1の生起
確率は、すでに符号化処理の終了した隣接画素信号を参
照することで予測を行うことができる。このような符号
化対象に本発明を適用することは次のように行うことが
できる。
For example, in the case of raster scanning a black-and-white binary image such as a facsimile, the signal level of each pixel is either 0 or 1, and the image data is obtained by the continuous number (run length) of signals of the same level. Can be expressed. The occurrence probabilities of 0 and 1 can be predicted by referring to the adjacent pixel signals that have already undergone the encoding process. The present invention can be applied to such an encoding target as follows.

【0115】ファクシミリの基本符号化方式として従来
から使われてきているMH(モディファイド・ハフマ
ン)方式では、ラン長を置換するための符号表自体を標
準規格としてあらかじめ作成しておく。このため、送信
側と受信側の装置で、あらゆる種類の画像の符号化にお
いて共通的に利用できるメリットがある。しかし、一方
で、符号表作成時と異なる画像性質の場合には圧縮性能
が十分に得られないデメリットがある。例えば、画像の
ラスタスキャンを行いながらラン長を符号に変換する際
に、1ラインの画素数が一定であることから、ランの基
点によってラン長分布が変化するにも関わらず、固定し
た符号表を使っているため圧縮率が劣化する場合があ
る。さらに、文字画像とディザ画像とではラン長の生起
分布が異なるにも関わらず固定した符号表を使っている
ため、後者では圧縮率が著しく劣る場合がある。
In the MH (Modified Huffman) method which has been conventionally used as a basic encoding method for facsimiles, a code table itself for replacing run lengths is prepared in advance as a standard. For this reason, there is an advantage that the transmission side device and the reception side device can commonly use it for encoding all kinds of images. However, on the other hand, there is a demerit that the compression performance is not sufficiently obtained when the image property is different from that when the code table is created. For example, when the run length is converted into a code while performing a raster scan of an image, the number of pixels in one line is constant, so the run length distribution changes depending on the base point of the run, but the fixed code table is used. The compression ratio may be deteriorated due to the use of. Further, since the character image and the dither image use the fixed code table even though the run length occurrence distributions are different, the compression ratio may be significantly inferior in the latter case.

【0116】これに対して、本発明の符号化復号化装置
を用いれば、ラン長の性質を測定しながら符号生成を行
い、高い圧縮率を達成することができる。
On the other hand, if the coding / decoding apparatus of the present invention is used, code generation can be performed while measuring the run length property, and a high compression rate can be achieved.

【0117】確率設定部は、図14に示すように既に符
号化処理の終了している信号を参照して、ラン長の出現
頻度を測定する。この信号処理は、符号化装置および復
号化装置の両者で共通に実行できる。ところで、符号化
処理を開始する初期状態においては、事象(ラン長)の
生起分布が不明である。また、参照する信号の数が少な
い場合には、生起する全ての事象(ラン長)についての
生起分布を測定できないことがある。これらの場合に
は、次の手段を利用できる。
As shown in FIG. 14, the probability setting unit measures the frequency of appearance of run lengths by referring to the signals for which the encoding process has already been completed. This signal processing can be commonly executed by both the encoding device and the decoding device. By the way, in the initial state where the encoding process is started, the occurrence distribution of the event (run length) is unknown. Further, when the number of signals to be referred to is small, the occurrence distribution for all the occurring events (run length) may not be measured. In these cases, the following means can be used.

【0118】(a)初期化時に、計測手段に何らかの初
期値をプリセットする。
(A) At initialization, some initial value is preset in the measuring means.

【0119】(b)測定済みの計測数から、事象全体の
確率値を求める。
(B) The probability value of the entire event is obtained from the number of measurements that have already been measured.

【0120】(c)一定の測定数毎に、生起確率の算出
を行う。
(C) The occurrence probability is calculated for every fixed number of measurements.

【0121】(d)何らかの関数、あるいはパタンを当
てはめて、確率を設定する。
(D) Apply some function or pattern to set the probability.

【0122】図31は、測定個数が少ないために、全て
のラン長についての頻度を測定できない場合を図示した
ものである。そこで、測定結果を補完するように、例え
ば正規分布関数で確率分布を設定するとともに、あるラ
ン長以上については一定の確率値で置き換えを行う。こ
のような確率値の設定のメリットを以下にまとめる。 (1)正規分布関数で確率分布が表現されるため、確率
値の順位付けが関数から算出でき、また、符号長を算出
する演算は、正規分布関数の対数演算となり簡単な形に
なる。
FIG. 31 illustrates a case where the frequencies for all run lengths cannot be measured because the number of measurements is small. Therefore, a probability distribution is set by, for example, a normal distribution function so as to complement the measurement result, and a certain probability value is replaced for a run length or more. The merits of setting such probability values are summarized below. (1) Since the probability distribution is expressed by the normal distribution function, the ranking of the probability values can be calculated from the function, and the operation for calculating the code length is a logarithmic operation of the normal distribution function and has a simple form.

【0123】(2)現実の多くの事象の発生が正規分布
で近似できることから、補完誤差が少ない。
(2) Since the occurrence of many actual events can be approximated by a normal distribution, the complementation error is small.

【0124】(3)順位付けした事象のある順位以下に
ついて、累積確率値が1.0 を超えない原則を守りなが
ら、同一の予測確率値を割り当てることができる。これ
らの事象については、前記した符号生成手順に基づき一
定に符号長を割り当てることができる。この結果、これ
らの符号の区別は、数値としての大きさの違いによって
判断できることになる。
(3) It is possible to assign the same predicted probability value to a certain rank or lower of the ranked events while keeping the principle that the cumulative probability value does not exceed 1.0. For these events, a code length can be constantly assigned based on the code generation procedure described above. As a result, the distinction between these codes can be determined by the difference in the numerical size.

【0125】次にJPEG(MPEG)方式の圧縮率改
良について説明する。
Next, the improvement of the compression rate of the JPEG (MPEG) system will be described.

【0126】本発明は、既存の標準符号化方式で使われ
ているハフマン符号への変換部を置き換えることで、圧
縮率を改善する効果を実現することも可能である。例え
ば、JPEGあるいはMPEG方式として知られる画像
符号化方式はモデル化部において、複数の画素から構成
されるブロックを符号化の単位として、DCT(離散コ
サイン変換)部,量子化部,スキャン部などの信号処理
部から構成される。そしてエントロピー符号化部におい
て、スキャン順序に従ってラン長と信号振幅をハフマン
符号に変換する。ここで、最終段のハフマン符号変換部
を本発明を用いた適応型の符号変換部に置き換えること
によって、効率向上を実現できる。
The present invention can also realize the effect of improving the compression rate by replacing the conversion unit for the Huffman code used in the existing standard encoding method. For example, in an image coding method known as JPEG or MPEG method, a DCT (discrete cosine transform) section, a quantizing section, a scanning section, etc. are used in a modeling section with a block composed of a plurality of pixels as an encoding unit. It is composed of a signal processing unit. Then, the entropy coding unit converts the run length and the signal amplitude into Huffman code according to the scan order. Here, the efficiency can be improved by replacing the Huffman code conversion unit at the final stage with the adaptive code conversion unit according to the present invention.

【0127】図32に、JPEG方式を実行する処理装
置の基本的な構成を示す。符号に変換する信号対象は、
モデル化部の信号処理単位である8×8の2次元的に配
置された信号について、DCT,量子化を行った64個
の信号の系列である。DCTは一種の2次元の周波数変
換であり、量子化は周波数成分に重み付けを行う処理で
ある。従来方式では、これらの信号系列を、信号値が0
である信号の連続個数を示すラン長と、ランの区切りに
ある信号(0以外)のレベルを組み合わせてハフマン符
号に変換している。ここで従来方式のハフマン符号変換
部における圧縮率を低下させる要因に、単一の符号表に
よる符号化を行っていることがある。このため、 (a)対象とする画像信号の性質,周波数成分の性質な
どが考慮されていない。 (b)ラン長と信号レベルの性質は、信号系列における
ランの開始位置によって異なってくることを考慮に入れ
ていない。
FIG. 32 shows a basic configuration of a processing device that executes the JPEG system. The signal target to be converted to the code is
It is a series of 64 signals obtained by subjecting 8 × 8 two-dimensionally arranged signals, which are the signal processing units of the modeling unit, to DCT and quantization. DCT is a kind of two-dimensional frequency conversion, and quantization is a process of weighting frequency components. In the conventional method, these signal sequences have a signal value of 0.
Is combined with the run length indicating the number of continuous signals and the level of the signal (other than 0) at the run delimiter is converted into the Huffman code. Here, there is a case where encoding by a single code table is performed as a factor that reduces the compression rate in the conventional Huffman code conversion unit. For this reason, (a) the characteristics of the target image signal, the characteristics of the frequency component, etc. are not taken into consideration. (B) It is not taken into consideration that the characteristics of the run length and the signal level differ depending on the start position of the run in the signal sequence.

【0128】(c)ラン長と信号レベルという、異なる
性質を組み合わせた事象に対してハフマン符号を割り当
てている。
(C) A Huffman code is assigned to an event that combines different properties such as run length and signal level.

【0129】上記問題点をハフマン符号を用いながら解
決を図っても、次に示すような問題がある。
Even if the above problem is solved by using the Huffman code, there are the following problems.

【0130】(a)複数の符号表をあらかじめ用意して
おき、隣接ブロックの信号系列を参照しながら、符号表
を逐次に切り替えていく。しかしながら、符号表が膨大
になり、装置規模が増大する。
(A) A plurality of code tables are prepared in advance, and the code tables are sequentially switched while referring to the signal series of adjacent blocks. However, the code table becomes huge and the device scale increases.

【0131】(b)隣接ブロックの信号系列を参照しな
がら、符号表を逐次に生成していく。しかし、処理時間
が長大となり、装置規模が増大する。
(B) The code table is sequentially generated with reference to the signal sequence of the adjacent block. However, the processing time becomes long and the device scale increases.

【0132】図32に、JPEG方式の圧縮率を向上さ
せる装置構成を示す。JPEG方式と同一のモデル化部
を用いることを前提に、スキャン順序に従って0の連続
するラン長と、ランの区切り目の信号レベルを符号に変
換する場合について説明する。信号処理の高速化のため
には、少なくとも1ブロックの信号を蓄積するバッファ
メモリを、DCT部,量子化部の前後に配置して、各部
の動作を並行して行うことが有効である。ここに蓄積さ
れる各種の信号を、符号化効率の向上のために参照し、
次に示すような信号処理を行うことができる。
FIG. 32 shows a device configuration for improving the compression ratio of the JPEG system. Assuming that the same modeling unit as in the JPEG system is used, a case will be described in which the run length of continuous 0 and the signal level at the break point of the run are converted into a code according to the scan order. In order to speed up the signal processing, it is effective to dispose a buffer memory for accumulating at least one block of signals before and after the DCT unit and the quantization unit, and perform the operations of the respective units in parallel. Various signals stored here are referred to in order to improve coding efficiency,
The following signal processing can be performed.

【0133】(a)参照可能な信号系列として、プリス
キャンによる符号化対象自身の信号、既に符号化処理の
終了した信号、カラー画像の場合には同一画像の異なる
色信号、動画像の場合には異なるフレームの信号、など
がある。すでに処理済みの信号と、ラン長分布および信
号レベル分布を対応づけて置くことで、参照信号を用い
て符号化対象のラン長分布および信号レベル分布を予測
することができる。
(A) As a referenceable signal sequence, a signal of the object to be encoded by prescan, a signal which has already been encoded, a different color signal of the same image in the case of a color image, and a moving image in the case of a moving image There are different frame signals, etc. By correlating the already processed signal with the run length distribution and the signal level distribution, it is possible to predict the run length distribution and the signal level distribution to be encoded using the reference signal.

【0134】(b)ランの基点が、8×8の信号系列の
どこに位置するかを用いて、ラン長と信号レベルの生起
確率を変更することができる。これは、信号系列の最大
長が64(=8×8)に限定されており、スキャン順序
にしたがって符号化処理を進めていくことから、ランの
基点によってラン長の生起確率が変動するのは当然であ
るためである。仮に、ランの基点に関わらず常に同一の
符号表を用いることは、ラン長の生起確率を有効に利用
しないことになり、圧縮の効率は低下する要因となる。
(B) The run length and the occurrence probability of the signal level can be changed depending on where the run base point is located in the 8 × 8 signal sequence. This is because the maximum length of the signal sequence is limited to 64 (= 8 × 8), and since the encoding process proceeds according to the scan order, the run length occurrence probability varies depending on the run base point. This is because it is natural. If the same code table is always used regardless of the origin of the run, the probability of occurrence of the run length is not effectively used, and the compression efficiency is reduced.

【0135】(c)ラン長と、信号振幅の両者につい
て、独立した生起確率を予測して符号を生成する。
(C) For both the run length and the signal amplitude, independent occurrence probabilities are predicted to generate a code.

【0136】なお、いずれの場合も初期時点では参照で
きる信号がないため、何らかの設定値を利用するか、従
来に処理した画像に関する情報を保存しておいて利用す
る、などの初期化処理を行うことにする。上記のように
信号参照することで、適応型の符号生成を行うタイミン
グとしては、 (a)ラン長と信号レベルのそれぞれの符号変換のタイ
ミングで符号生成を行う。
In any case, since there is no signal that can be referred to at the initial point, initialization processing is performed, such as using some set value or storing and using information related to a conventionally processed image. I will decide. By referring to the signals as described above, the timing for performing adaptive code generation is as follows: (a) Code generation is performed at each code conversion timing of the run length and the signal level.

【0137】(b)一つ、もしくは複数のブロックを単
位として符号生成を行う。
(B) Code generation is performed in units of one or a plurality of blocks.

【0138】(c)1画面(カラー画像の場合には色信
号)を単位として符号生成を行う。
(C) Code generation is performed in units of one screen (color signal in the case of a color image).

【0139】(d)時間的に連続する複数の画像フレー
ムから構成される画像を対象とする場合には、時間的に
隣接する画像フレーム間の性質が似ていることから、何
枚かのフレーム毎に符号生成する。
(D) In the case of targeting an image composed of a plurality of temporally consecutive image frames, some frames are similar because the temporally adjacent image frames have similar properties. A code is generated for each.

【0140】具体的な処理手順の一例を次に述べる。An example of a specific processing procedure will be described below.

【0141】(a)8×8の信号系列の符号化処理の初
期時点では、ランの基点を最も周波数成分の低い信号
(直流成分)におく。ランの基点位置RS=0と設定す
る。
(A) At the initial point of the encoding process of the 8 × 8 signal sequence, the base point of the run is set to the signal (DC component) having the lowest frequency component. The run base point position RS = 0 is set.

【0142】(b)ラン基点RSからスキャン順序に従
って、信号成分が0である個数jを計測する。0でない
信号レベルSSを検出したら、ラン長RL=jとして次
の手順に進む。ただし、計測中にランが終端に達したら
(d)に進む。
(B) The number j of which the signal component is 0 is measured from the run base point RS in the scanning order. When the signal level SS which is not 0 is detected, the run length RL = j is set and the process proceeds to the next step. However, if the run reaches the end during the measurement, proceed to (d).

【0143】(c)ランの基点位置RSに基づきラン長
分布を予測し、ラン長RLの符号を生成するまで符号生
成手順を実行する。引き続き、ランの基点位置RSに基
づき信号レベル分布を予測し、信号レベルSSの符号を
生成するまで符号生成手順を実行する。なお予測処理の
ために、ラン基点以外の信号を参照できることは既に述
べた通りである。
(C) The run length distribution is predicted based on the run base point position RS, and the code generation procedure is executed until the run length RL code is generated. Subsequently, the signal level distribution is predicted based on the run base point RS, and the code generation procedure is executed until the code of the signal level SS is generated. As described above, the signals other than the run base point can be referred to for the prediction process.

【0144】(d)ランが信号系列の終端に達したら、
終端処理(例えば終端符号の付加など)を行って終了す
る。終端でなければ、新たなラン基点をRS+RLとし
て(b)にもどる。
(D) When the run reaches the end of the signal sequence,
Termination processing (for example, addition of a termination code) is performed, and the process ends. If it is not the end point, the new run base point is set to RS + RL and the process returns to (b).

【0145】なお、上記の適応型の符号変換部を利用し
た場合に生成される符号は、標準的方式とはデータ互換
がないが、双方ともブロック符号であることから、何ら
かの手段で1対1の符号変換を行うことができる。
The code generated when the above adaptive code conversion unit is used is not data compatible with the standard method, but since both are block codes, it is 1: 1 by some means. The code conversion of can be performed.

【0146】次に辞書型符号化への適用について説明す
る。
Next, application to dictionary type encoding will be described.

【0147】文字コードの並びによって作られているテ
キスト等を対象に、出現確率の高い文字列を逐次登録し
ながら、該登録の順位を符号として表す符号化方式が、
辞書型符号化(例えばLZ符号など)として知られてい
る。この登録手段の構成、および信号処理手順はモデル
化部に分類できる。一方で、エントロピー符号化部にあ
たる部分では、符号として、登録の順位値を直接利用す
る方法、あるいは順位をハフマン符号に変換する方法な
どが提案されている。圧縮率の観点からは、文字間の生
起確率の特異性については既に知られている事実であ
り、入力するキャラクターコードに基づき逐次に統計値
を作成していき、この内容に基づき確率分布を作成する
ことで、効率のよい符号化処理を行うことができる。
An encoding method in which a character string having a high appearance probability is sequentially registered and the order of registration is represented as a code is targeted for a text or the like formed by a sequence of character codes.
It is known as dictionary type encoding (for example, LZ encoding). The configuration of the registration means and the signal processing procedure can be classified into the modeling unit. On the other hand, in the part corresponding to the entropy coding unit, a method of directly using the rank value of registration or a method of converting the rank into a Huffman code has been proposed as a code. From the viewpoint of compression rate, it is a fact that the uniqueness of the occurrence probability between characters is already known, and the statistical value is created sequentially based on the input character code, and the probability distribution is created based on this content. By doing so, efficient encoding processing can be performed.

【0148】ここで、従来のハフマン符号を適用するな
らば、符号表を固定にすると適応性に欠けることにな
り、逐次に符号の生成を行うと処理負荷が増大するとい
う問題がある。
Here, if the conventional Huffman code is applied, there is a problem that if the code table is fixed, the adaptability is lacking, and if the codes are sequentially generated, the processing load increases.

【0149】これに対して、本発明の圧縮伸長装置を用
いれば、次に示す辞書型符号化の特長を利用して符号生
成を行うことができる。
On the other hand, when the compression / expansion device of the present invention is used, code generation can be performed by utilizing the following features of dictionary type coding.

【0150】(a)複数の文字を組み合わせた文字列の
符号化は、情報源の拡大に他ならない。
(A) Encoding a character string in which a plurality of characters are combined is nothing but expansion of the information source.

【0151】(b)文字列を順次に登録していくこと
は、生起確率を測定することに他ならない。
(B) Sequential registration of character strings is nothing but measuring the occurrence probability.

【0152】上記の性質を利用することで、図33に示
すような文字列の遷移確率を割り当てたリンクを作り、
以下のように手順で効率のよいブロック符号を生成する
ことができる。
By utilizing the above property, a link to which transition probabilities of character strings are assigned as shown in FIG. 33 is created,
An efficient block code can be generated by the following procedure.

【0153】(a)候補文字列を、文字間の遷移確率を
属性として持つリンクで接続されるデータ構造として用
意する。
(A) A candidate character string is prepared as a data structure connected by a link having a transition probability between characters as an attribute.

【0154】(b)入力文字列が、上記候補文字列と一
致する場合は、該候補文字列の遷移確率に基づく符号を
生成する。
(B) If the input character string matches the candidate character string, a code based on the transition probability of the candidate character string is generated.

【0155】(c)遷移確率は、実際の符号化対象とし
て入力する文字列によって逐次に更新することができ
る。ここで、遷移確率の更新処理は、一文字毎、あるい
は、一定個数の文字が入力してから行う、等のアルゴリ
ズムと手段の構成を採用することができるが、本発明で
は特に限定するものではない。
(C) The transition probability can be sequentially updated by the character string input as the actual encoding target. Here, the transition probability updating process can be performed for each character or after a certain number of characters are input, and the like, and the configuration of the algorithm and means can be adopted, but the present invention is not particularly limited thereto. .

【0156】入力文字列の区切りの判定は、スペース,
カッコなどの区切りを示す文字によって判定することが
できるとともに、文字間の遷移確率がしきい値より低い
場合に区切りと判定することができる。候補文字列は、
遷移確率が低いリンクを随時削除することで、規模と複
雑さを抑えることができる。このリンクの削除のアルゴ
リズムと手段の構成は、特に限定するものではない。一
定以下の遷移確率については、それぞれ均一な遷移確率
に置き換えて扱うことができる。
The judgment of the delimiter of the input character string is performed by a space,
It can be determined by a character indicating a delimiter such as parentheses, and can be determined as a delimiter when the transition probability between characters is lower than a threshold value. The candidate string is
By deleting links with low transition probability from time to time, it is possible to reduce the scale and complexity. The configuration of the algorithm and means for deleting this link is not particularly limited. Transition probabilities below a certain level can be replaced with uniform transition probabilities.

【0157】(d)符号ビット設定は、文字間の遷移確
率を順次に掛け合わせていくことで算出できるが、演算
のための負荷が大きくなる場合がある。しかし、全ての
候補文字列の個数と、該当する文字列の出現個数との比
率が遷移確率であることから、この比率を求めるために
は両者の個数を用いた1回の除算を行えばよい。さら
に、遷移確率の更新を、入力文字列の個数が2のN乗
(例えば1024など)になるタイミングで行うなら
ば、前記の除算は2進数のNビットシフトに置き換える
ことができる。このようにして求めた確率値をもとに、
符号生成を高速に行い、高い圧縮率を実現できる。
(D) The sign bit setting can be calculated by sequentially multiplying the transition probabilities between characters, but the load for the calculation may increase. However, since the ratio of the number of all candidate character strings to the number of appearance of the corresponding character string is the transition probability, it is sufficient to perform one division using both numbers in order to obtain this ratio. . Furthermore, if the transition probability is updated at the timing when the number of input character strings becomes 2 N (for example, 1024), the division can be replaced with a binary N-bit shift. Based on the probability value obtained in this way,
Code generation can be performed at high speed and a high compression rate can be realized.

【0158】次に算術符号との関連について説明する。Next, the relation with the arithmetic code will be described.

【0159】本発明による符号生成アルゴリズムを用い
て情報源の拡大を行うことで、生成される符号は算術符
号に近い性質を持つようにできる。その結果、エントロ
ピーに限りなく近い、圧縮率を実現することが可能であ
る。
By expanding the information source using the code generation algorithm according to the present invention, the generated code can be made to have a property close to an arithmetic code. As a result, it is possible to realize a compression rate as close as possible to the entropy.

【0160】例えば、符号化対象とする全ての信号系列
について、実際に生起した事象の生起確率を組み合わせ
ることで一つの確率値を算出し、この確率値を対象にし
た符号化処理を実行することができる。
For example, for all the signal sequences to be coded, one probability value is calculated by combining the occurrence probabilities of the events that actually occurred, and the coding process for this probability value is executed. You can

【0161】ここで前記したように、本発明による符号
は、数値の大きさとして一意に区別できることに注目す
る。これは、算術符号の解説で示されるように、0.0
以上で1.0 より小さな範囲の数直線上の領域を事象の
確率値で分割し、分割領域の上端もしくは下端の位置を
数値として示すことで、符号を生成できることを意味す
る。前記符号生成手順で述べたように、確率値の大きさ
の順序で符号生成していくことは、生成される符号の数
値としての大きさは、数直線状を0.0から1.0に向かっ
て順次に上っていくことになる。図34に、数直線の分
割を示す。個別の信号毎に符号化処理を行うことは、図
34(a)に示すように数直線の分割を各符号で独立し
て実行することになる。一方、複数の信号を組み合わて
情報源の拡大をすることは、図34(b)に示すように
数直線上の分割を、信号の生起確率で繰り返して実行す
ることに相当する。この分割の原理は、算術符号と生成
手順と同一であるが、次の点に特徴がある。
It should be noted here that, as described above, the code according to the present invention can be uniquely distinguished as the magnitude of a numerical value. This is 0.0, as shown in the explanation of arithmetic codes.
As described above, it means that the code can be generated by dividing the area on the number line in the range smaller than 1.0 by the probability value of the event and indicating the position of the upper end or the lower end of the divided area as a numerical value. As described in the code generation procedure, when the code is generated in the order of the magnitude of the probability value, the magnitude as the numerical value of the generated code is such that the number linear shape changes from 0.0 to 1.0. You will go up in sequence. FIG. 34 shows division of the number line. Performing the encoding process for each individual signal means that the division of the number line is independently performed for each code as shown in FIG. On the other hand, expanding the information source by combining a plurality of signals corresponds to repeatedly performing division on the number line as shown in FIG. 34B with the occurrence probability of the signal. The principle of this division is the same as the arithmetic code and the generation procedure, but is characterized by the following points.

【0162】(a)符号化対象の信号個数を任意に設定
し、符号系列にブロック符号の特性を持たせられる。す
なわち、生成した符号のビット数を明確に設定できる。
これは、算術符号では不可である。
(A) The number of signals to be encoded can be arbitrarily set to give the code sequence the characteristics of the block code. That is, the number of bits of the generated code can be set clearly.
This is not possible with arithmetic codes.

【0163】(b)算術符号の応用例として、ITU
(International Telecommunication Union)がT.82
として勧告しているJBIG符号化方式がある。これ
は、白黒2値画像を対象に、従来のMH符号などよりも
高い効率を実現することを目的に、算術符号の考え方に
基づいて定められた符号化方式である。しかし、実用性
の観点から信号処理手順の大幅な簡易化が行われてい
る。例えば、高速化を目的に、個別の事象の生起確率を
(1/2)のべき乗に置き換えてから、生起確率の演算
を行っている。上記例は符号化対象として2値信号を前
提としているが、多値信号の場合には複雑さが増すた
め、さらなる簡易化が必要になる。このように、算術符
号の理論的な圧縮効率は高いものであるが、実用上の観
点からは簡易化による効率の低下が避けれられない。
(B) As an application example of the arithmetic code, ITU
(International Telecommunication Union) is T.82
There is a JBIG encoding system recommended as. This is a coding method determined based on the idea of arithmetic codes for the purpose of realizing higher efficiency than conventional MH codes for black-and-white binary images. However, the signal processing procedure has been greatly simplified from the viewpoint of practicality. For example, for the purpose of speeding up, the occurrence probability of each event is replaced with a power of (1/2), and then the occurrence probability is calculated. The above example is premised on a binary signal as an encoding target, but in the case of a multilevel signal, the complexity is increased, and therefore further simplification is required. As described above, the theoretical compression efficiency of the arithmetic code is high, but from a practical point of view, a reduction in efficiency due to simplification is inevitable.

【0164】これに対して本発明では、事象の生起確率
を正しく利用し、多値信号に対しても有効に活用でき、
さらに、情報源の拡大による圧縮率向上の効果を実現で
きる。組み合わせる信号の個数は、例えば画像の1スキ
ャンライン、あるいは複数の画素から構成されるブロッ
クなど、モデル化部の動作と連携して設定することがで
きる。
On the other hand, in the present invention, the occurrence probability of an event is correctly used, and it can be effectively used even for a multilevel signal,
Further, the effect of improving the compression rate by expanding the information source can be realized. The number of signals to be combined can be set in cooperation with the operation of the modeling unit, such as one scan line of an image or a block composed of a plurality of pixels.

【0165】次にN進数符号化について説明する。Next, the N-ary number encoding will be described.

【0166】今までは2進数の符号の場合について説明
してきたが、本発明を用いてN進数の符号を生成するこ
とで同様な効果を得ることができるのは言うまでもな
い。このような装置例として、1ビットあたりN値を記
憶できるメモリ、また、振幅位相変調(モデム)などで
通信を行うN値通信路などがある。従来は、2進数符号
を複数ビット組み合わせることで多値信号を生成してい
るが、本発明ではN進数符号を直接生成することができ
る。たとえば、+1,−1,0の3種類の電圧レベルで
データ伝送を行う場合には、3進数符号を用いることで
効率の良いデータ伝送を実現できる。さらに符号化処理
に伴い、3種類の信号のそれぞれの出現はほぼランダム
になることから、平均的には電圧0に平衡させることが
できる。また、伝送路上の特性(ノイズ,LR特性,距
離など)に応じてNの値を適応的に変更することが容易
であり、また、各種の誤り訂正方式と組み合わせて信頼
性の高いデータ伝送を実現することができる。例えば、
伝送誤りが発生した場合に、前回よりNの値を小さくし
て生成した符号を再送することで、誤りに対する耐性を
高くすることができる。
Although the case of the binary code has been described so far, it is needless to say that the same effect can be obtained by generating the N-ary code by using the present invention. Examples of such an apparatus include a memory that can store N values per bit, and an N-value communication path that performs communication by amplitude / phase modulation (modem). Conventionally, a multi-level signal is generated by combining a binary code with a plurality of bits, but in the present invention, an N-ary code can be directly generated. For example, when data transmission is performed at three voltage levels of +1, -1, 0, efficient data transmission can be realized by using a ternary code. Furthermore, with the encoding process, the appearance of each of the three types of signals becomes almost random, so that the voltage can be balanced to 0 on average. In addition, it is easy to adaptively change the value of N according to the characteristics (noise, LR characteristics, distance, etc.) on the transmission path, and highly reliable data transmission can be performed by combining with various error correction methods. Can be realized. For example,
When a transmission error occurs, the resistance to the error can be increased by retransmitting the generated code with a smaller N value than the previous time.

【0167】なお、生成したN進数符号を、N値メモリ
あるいはN値通信路等に渡すまでの伝送路あるいは一時
蓄積バッファ等の信号表現が例えば2進数であり、Nと
異なる値の場合がある。
The signal representation of the transmission line or the temporary storage buffer until the generated N-ary code is passed to the N-value memory or the N-value communication line is, for example, a binary number and may have a value different from N. .

【0168】この場合には、一時的に、N進数符号を2
進数表現することで解決できる。このように通信路符号
化として知られている符号変換と組み合わせて、信号処
理を実行することができる。
In this case, the N-ary code is temporarily set to 2
It can be solved by expressing it in a decimal number. Thus, signal processing can be performed in combination with code conversion known as channel coding.

【0169】[0169]

【発明の効果】以上説明したように本発明によれば、最
適かつ瞬時復号可能な性質を持つ符号を高速に生成でき
る。このため、信号性質に適応した符号を逐次に生成し
て、高い圧縮率を実現できる。また、情報源の拡大によ
り、圧縮率の向上を容易に実現できる。
As described above, according to the present invention, it is possible to generate a code having an optimal and instantaneously decodable property at high speed. Therefore, it is possible to sequentially generate a code adapted to the signal property and realize a high compression rate. Further, the expansion of the information source makes it possible to easily improve the compression rate.

【図面の簡単な説明】[Brief description of drawings]

【図1】符号化装置の基本構成を示す図。FIG. 1 is a diagram showing a basic configuration of an encoding device.

【図2】符号化システムの構成を示す図。FIG. 2 is a diagram showing a configuration of an encoding system.

【図3】符号生成処理の概要を説明するための図。FIG. 3 is a diagram for explaining an outline of code generation processing.

【図4】符号生成のためのメモリの記憶を示す図。FIG. 4 is a diagram showing memory storage for code generation.

【図5】符号生成の全体の処理を示す図。FIG. 5 is a diagram showing an overall process of code generation.

【図6】初期設定の処理を示す図。FIG. 6 is a diagram showing a process of initial setting.

【図7】符号生成の処理を示す図。FIG. 7 is a diagram showing a code generation process.

【図8】符号化誤差演算の処理を示す図。FIG. 8 is a diagram showing a process of encoding error calculation.

【図9】メモリに記憶された内容を示した図。FIG. 9 is a diagram showing the contents stored in a memory.

【図10】生成された符号の関係を示した図。FIG. 10 is a diagram showing a relationship between generated codes.

【図11】確率関数を用いる場合の概要を説明するため
の図。
FIG. 11 is a diagram for explaining an outline when a probability function is used.

【図12】確率関数を用いる場合の初期設定の処理を示
す図。
FIG. 12 is a diagram showing a process of initial setting when a probability function is used.

【図13】確率関数を用いる場合の符号生成の処理を示
した図。
FIG. 13 is a diagram showing a process of code generation when a probability function is used.

【図14】画像データの構成を説明するための図。FIG. 14 is a diagram for explaining the configuration of image data.

【図15】画像データの符号化を行う場合の確率の初期
設定を説明するための図。
FIG. 15 is a diagram for explaining initial setting of probability when image data is encoded.

【図16】逐次確率を求める場合の符号生成処理の全体
を示す図。
FIG. 16 is a diagram showing an entire code generation process when obtaining a sequential probability.

【図17】逐次確率を求める場合の符号生成処理を示す
図。
FIG. 17 is a diagram showing a code generation process when obtaining a sequential probability.

【図18】復号化システムの構成を示した図。FIG. 18 is a diagram showing a configuration of a decoding system.

【図19】符号化装置の構成を示した図。FIG. 19 is a diagram showing a configuration of an encoding device.

【図20】復号処理の概要を説明するための図。FIG. 20 is a diagram for explaining the outline of the decoding process.

【図21】復号の全体の処理を示した図。FIG. 21 is a diagram showing the entire process of decoding.

【図22】復号の処理を示した図。FIG. 22 is a diagram showing a decryption process.

【図23】確率関数を用いる場合の復号の処理を示した
図。
FIG. 23 is a diagram showing a decoding process when a probability function is used.

【図24】逐次確率を求める場合の復号処理の全体を示
す図。
FIG. 24 is a diagram showing an entire decoding process when obtaining a sequential probability.

【図25】逐次確率を求める場合の符号生成処理を示す
図。
FIG. 25 is a diagram showing a code generation process for obtaining a sequential probability.

【図26】符号化復号化装置の構成を示す図。FIG. 26 is a diagram showing the configuration of an encoding / decoding device.

【図27】混載型LSIの構成を示す図。FIG. 27 is a diagram showing a configuration of an embedded LSI.

【図28】仮想メモリを用いたシステムの構成を示す
図。
FIG. 28 is a diagram showing a configuration of a system using virtual memory.

【図29】ディジタルアーカイブ装置の構成を示す図。FIG. 29 is a diagram showing a configuration of a digital archive device.

【図30】ラン長符号化への適用例を示す図。FIG. 30 is a diagram showing an application example to run length encoding.

【図31】JPEG(MPEG)方式の圧縮率改良への
適用例を示す図。
FIG. 31 is a diagram showing an example of application of the JPEG (MPEG) method to improve the compression rate.

【図32】辞書型符号化への適用例を示す図。FIG. 32 is a diagram showing an application example to dictionary type encoding.

【図33】算術符号との関係を示す図。FIG. 33 is a diagram showing a relationship with arithmetic codes.

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) H03M 7/40 H04N 1/41 H04N 7/24 ─────────────────────────────────────────────────── ─── Continuation of front page (58) Fields surveyed (Int.Cl. 7 , DB name) H03M 7/40 H04N 1/41 H04N 7/24

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】入力された信号の符号を生成する符号化方
法において、 予め定められた事象が生起する生起確率に基づき符号語
を生成し、 生成された前記符号語の符号長に基づいて累積確率を求
め、 生成された前記符号語の符号長から符号化に伴う符号化
誤差を求め、 求められた前記符号化誤差に基づく確率値を他の事象の
生起確率に分配し、 前記符号長と前記累積確率から符号を生成 することを特
徴とする符号化方法
1. A coding method for generating a sign of the input signal, the codeword based on the occurrence probability of a defined event to occur in advance
And calculate the cumulative probability based on the code length of the generated codeword.
Therefore, from the code length of the generated codeword,
The error is calculated, and the probability value based on the calculated coding error is calculated for other events.
An encoding method characterized by distributing to occurrence probabilities and generating a code from the code length and the cumulative probability .
【請求項2】入力された符号から信号を再生する復号化
方法において、 予め定められた事象が生起する生起確率に基づき符号語
を生成し、 生成された前記符号語の符号長に基づいて累積確率を求
め、 生成された前記符号語の符号長から符号化に伴う符号化
誤差を求め、 求められた前記符号化誤差に基づく確率値を他の事象の
生起確率に分配し、 前記符号長と前記累積確率から符号を生成し、 入力された符号と前記生成した符号を対応付けることを
特徴とする復号化方法
2. Decoding for recovering a signal from an input code
In the method, the code word is based on the probability of occurrence of a predetermined event.
And calculate the cumulative probability based on the code length of the generated codeword.
Therefore, from the code length of the generated codeword,
The error is calculated, and the probability value based on the calculated coding error is calculated for other events.
Distribution to occurrence probabilities, generating a code from the code length and the cumulative probability, and associating an input code with the generated code.
Characterizing decoding method .
【請求項3】入力された信号の符号を生成する符号化装
置において予め定められた事象が生起する生起確率に基づき符号語
を生成する符号生成部と、 前記符号生成部で生成された符号語の符号長に基づいて
累積確率を求め、生成された前記符号語の符号長から符
号化に伴う符号化誤差を求め、求められた前記符号化誤
差に基づく確率値を他の事象の生起確率に分配する符号
化誤差演算部とを有し、 前記符号生成部は、前記符号長と前記累積確率から符号
を生成 することを特徴とする符号化装置。
3. A coding device for generating a code of an input signal.
, A codeword based on the occurrence probability that a predetermined event will occur.
Based on the code length of the codeword generated by the code generation unit and the code generation unit
The cumulative probability is calculated, and the code is calculated from the code length of the generated code word.
The coding error associated with the coding is calculated, and the calculated coding error is calculated.
A code that divides the probability value based on the difference into the occurrence probabilities of other events.
A coded error calculation unit, and the code generation unit calculates a code from the code length and the cumulative probability.
Encoding apparatus and generates a.
【請求項4】入力された符号から信号を再生する復号化
装置において、 予め定められた事象が生起する生起確率に基づき符号語
を生成する復号化部と、 前記復号化部で生成された符号語の符号長に基づいて累
積確率を求め、生成された前記符号語の符号長から符号
化に伴う符号化誤差を求め、求められた前記符号化誤差
に基づく確率値を他の事象の生起確率に分配する符号化
誤差演算部とを有し、 前記復号化部は、前記符号長と前記累積確率から符号を
生成し、入力された符号と前記生成した符号を対応付け
ことを特徴とする復号化装置。
4. Decoding for recovering a signal from an input code
In the device, a code word based on the probability of occurrence of a predetermined event
Based on the code length of the code word generated by the decoding unit and the decoding unit that generates
The product probability is calculated, and the code is calculated from the code length of the generated code word.
Encoding error due to encoding, and the obtained encoding error
Coding for Distributing Probability Values Based on Attribute to Occurrence Probabilities of Other Events
An error calculation unit, and the decoding unit calculates a code from the code length and the cumulative probability.
Generate and associate the input code with the generated code
Decoding device, characterized in that that.
JP06605397A 1997-03-19 1997-03-19 Encoding / decoding device Expired - Lifetime JP3407588B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP06605397A JP3407588B2 (en) 1997-03-19 1997-03-19 Encoding / decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP06605397A JP3407588B2 (en) 1997-03-19 1997-03-19 Encoding / decoding device

Publications (2)

Publication Number Publication Date
JPH10261966A JPH10261966A (en) 1998-09-29
JP3407588B2 true JP3407588B2 (en) 2003-05-19

Family

ID=13304757

Family Applications (1)

Application Number Title Priority Date Filing Date
JP06605397A Expired - Lifetime JP3407588B2 (en) 1997-03-19 1997-03-19 Encoding / decoding device

Country Status (1)

Country Link
JP (1) JP3407588B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3132456B2 (en) 1998-03-05 2001-02-05 日本電気株式会社 Hierarchical image coding method and hierarchical image decoding method
JP2001251625A (en) * 1999-12-28 2001-09-14 Matsushita Electric Ind Co Ltd Image decoder and image coder
ES2834473T3 (en) * 2001-08-31 2021-06-17 Panasonic Ip Corp America Image encoding and decoding procedure and system
JP4497029B2 (en) * 2005-06-10 2010-07-07 沖電気工業株式会社 Data encoding apparatus and data encoding method

Also Published As

Publication number Publication date
JPH10261966A (en) 1998-09-29

Similar Documents

Publication Publication Date Title
JP3369422B2 (en) Data decoding method and apparatus
US7085424B2 (en) Method and system for compressing motion image information
Blelloch Introduction to data compression
JP3978478B2 (en) Apparatus and method for performing fixed-speed block-unit image compression with estimated pixel values
US5818877A (en) Method for reducing storage requirements for grouped data values
US7109898B2 (en) Variable length coding method and variable length decoding method
US5604498A (en) Huffman decoder
US5583657A (en) Method and apparatus for scanning image data
US20040008896A1 (en) Fast loss less image compression system based on neighborhood comparisons
JP2011130413A (en) Digital content encoder, decoder, search apparatus, method of encoding, method of searching, record carrier, signal, and storage device
US4366506A (en) Picture transfer method and apparatus therefor
US5883981A (en) Lattice vector transform coding method for image and video compression
JPH09327019A (en) Object area encoding device
Alzina et al. 2D-pattern matching image and video compression: Theory, algorithms, and experiments
JP3407588B2 (en) Encoding / decoding device
AU2002230101A2 (en) Moving picture information compressing method and its system
JPH0865171A (en) Data expansion device, data expansion method, decoder, decoding method, real time video equipment, encoder and entropy decoder
JPH08274650A (en) Method of generating data structure representing haffman code method of generating haffman code and its device
JPH0918350A (en) Coding/decoding device and coding/decoding method
JPH08116268A (en) Information processing unit
JPH0936749A (en) Coding decoding device and coding method used for it
Denecker et al. Design of an improved lossless halftone image compression codec
JP2934603B2 (en) Method and apparatus for decoding variable length code
JPH0621828A (en) Vector quantizing decoder
Patel Enhanced Encoding Technique for Lossless Image Compression

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090314

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090314

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100314

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110314

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110314

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120314

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130314

Year of fee payment: 10