JPH0564008A - Encoder - Google Patents
EncoderInfo
- Publication number
- JPH0564008A JPH0564008A JP3244923A JP24492391A JPH0564008A JP H0564008 A JPH0564008 A JP H0564008A JP 3244923 A JP3244923 A JP 3244923A JP 24492391 A JP24492391 A JP 24492391A JP H0564008 A JPH0564008 A JP H0564008A
- Authority
- JP
- Japan
- Prior art keywords
- prediction
- value
- prediction value
- pixel
- encoding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000004364 calculation method Methods 0.000 claims abstract description 16
- 238000013144 data compression Methods 0.000 abstract description 15
- 238000013500 data storage Methods 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 20
- 238000000034 method Methods 0.000 description 16
- 238000007906 compression Methods 0.000 description 8
- 230000006835 compression Effects 0.000 description 8
- 238000007792 addition Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 238000013139 quantization Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000010422 painting Methods 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
- G06T9/004—Predictors, e.g. intraframe, interframe coding
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
(57)【要約】
【目的】 予測値が当たらないときであっても発生符号
量を抑えることができ、データ圧縮効率の高い符号化装
置を提供する。
【構成】 画像データ圧縮装置11は圧縮すべきデータ
を記憶する画像データ記憶装置12と、符号化対象画素
の周辺数画素の値により予測値のアドレスを指定するア
ドレス発生装置13と、指定されたアドレスに対応する
値を基に予測値表31から予測値(X)を出力する画素
予測値記憶装置14と、画像データ記憶装置12からの
出力と画素予測値記憶装置14からの予測値(X)出力
とにより予測誤差を算出する予測誤差算出装置15と、
算出された予測誤差を符号化するQ−Coder16とを設
け、上記予測値表31は入力パターンを予測値が当たり
にくい特定入力パターンとそうでない入力パターンとに
2分し、予測値が当たりにくい特定入力パターンのもの
は予測値を無効にするとともに符号化用の変数Qe,M
PSを固定し、Qeの更新を行わないようにする。
(57) [Abstract] [Purpose] To provide an encoding device capable of suppressing the amount of generated codes even when a predicted value does not hit, and having high data compression efficiency. An image data compression device 11 is designated by an image data storage device 12 for storing data to be compressed, and an address generation device 13 for designating an address of a predicted value by the values of several pixels around a pixel to be encoded. The pixel prediction value storage device 14 that outputs the prediction value (X) from the prediction value table 31 based on the value corresponding to the address, the output from the image data storage device 12, and the prediction value (X ) A prediction error calculation device 15 for calculating a prediction error based on the output,
A Q-Coder 16 that encodes the calculated prediction error is provided, and the prediction value table 31 divides the input pattern into a specific input pattern that does not hit the predicted value and an input pattern that does not hit the predicted value, and specifies that the predicted value does not hit easily. For input patterns, the prediction value is invalidated and the encoding variables Qe and M are used.
Fix PS so that Qe is not updated.
Description
【0001】[0001]
【産業上の利用分野】本発明は、画像データを圧縮/伸
張する画像データ処理装置等に用いられる符号化装置に
係り、詳細には算術符号の一種であるQ−Coderを用い
て符号化を行なう符号化装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an encoding device used in an image data processing device or the like for compressing / decompressing image data, and more particularly to encoding using an Q-Coder which is a type of arithmetic code. The present invention relates to an encoding device.
【0002】[0002]
【従来の技術】画像信号に含まれる冗長な信号成分を除
去することによって、原画像信号のデータ量を低減する
ための処理を画像の高能率符号化(high-efficiency co
ding)、あるいは単に画像符号化(picture coding)と
いう。また、この技術は、データ圧縮符号化、冗長度抑
圧符号化、ビットレート低減符号化(bit-rate reducti
on coding)などと呼ばれることもある。2. Description of the Related Art A process for reducing the data amount of an original image signal by removing redundant signal components contained in the image signal is performed by high-efficiency coding of the image.
ding), or simply picture coding. In addition, this technique is based on data compression coding, redundancy suppression coding, and bit rate reduction coding.
on coding) and so on.
【0003】ファクシミリのように文書、図面など中間
調の信号成分を含まず、白黒2値のみでできているとみ
なせる画像を2値画像と呼んでいる。2値画像は一般に
大きな冗長性を有しており、情報源符号化の手法により
データ圧縮が可能である。2値画像の画質は、振幅方向
の量子化レベル数が2で十分なため、標本化密度によっ
て定まるとみてよい。An image that does not include a halftone signal component such as a document or a drawing and can be regarded as being made up of only black and white binary data is called a binary image. Binary images generally have large redundancy, and data compression is possible by the method of information source coding. Since the number of quantization levels in the amplitude direction is two, the image quality of a binary image may be determined by the sampling density.
【0004】データ圧縮符号化のうちで重要なものは、
予測符号化(predictive coding)と変換符号化(trans
form coding)及び、ベクトル量子化(vector quantiza
tion)である。これらの2者、3者を組み合わせること
も多く(ハイブリッド符号化)、更に、上記の諸手法に
組み合わせてデータ圧縮効果を高める有力な手段とし
て、エントロピーコーディング(可変長符号化、ハフマ
ン符号化)がよく用いられる。The most important data compression encoding is
Predictive coding and transcoding
form coding and vector quantiza
tion). Often, these two and three parties are combined (hybrid coding), and entropy coding (variable-length coding, Huffman coding) is a powerful means of increasing the data compression effect by combining the above methods. Often used.
【0005】冗長度を除去するためのエントロピー符号
化のうち、最も代表的なエントロピー符号化の一つは不
等長符号化であり、これは頻度に高い出力レベルには短
い符号を、出現頻度の低い出力レベルには長い符号をそ
れぞれ割り当てる。これによって符号出力の平均符号長
を短くできる。エントロピー符号化を行うことによっ
て、符号出力の発生速度は一定ではなくなる。一般の伝
送路は、一定速度で情報を伝送するようにできているの
で、不均一に発生した情報(符号)をそのまま伝送路に
送出することはできない。このため、一旦バッファ記憶
によって情報を平滑化してから信号として送出する。ま
た、バッファ記憶のオーバーフロー、アンダーフローを
防ぐために、バッファ記憶占有率を監視し、常に一定範
囲に収まるように冗長度除去符号化のパラメータを制御
する。Among the entropy codings for removing redundancy, one of the most typical entropy codings is unequal length coding, which is a short code for a high output level and an appearance frequency. A long code is assigned to each low output level. As a result, the average code length of code output can be shortened. By performing entropy coding, the code generation rate is not constant. Since a general transmission line is designed to transmit information at a constant speed, it is not possible to send out information (codes) generated unevenly to the transmission line as it is. Therefore, the information is temporarily smoothed by the buffer storage and then transmitted as a signal. Further, in order to prevent the overflow and underflow of the buffer storage, the buffer storage occupancy rate is monitored, and the redundancy removal encoding parameter is controlled so that it is always within a certain range.
【0006】以下、上記予測符号化、算術符号及びQ−
Coderについて説明する。予測符号化 上記予測符号化は、符号器内のメモリに既に符号化され
た過去の画素値を記憶しておき、これから新たに入力さ
れる画素Xの予測値(X)を求めるものである。その差
(予測誤差という)X−(X)を量子化し、その出力レベ
ルを適当な2進符号に変換して送出する。受信側におい
ても全く同様の計算によって、予測値(X)が再生できる
から、伝送されてきた符号から予測誤差を再生し、これ
を既に復号された直前の画像信号に加えて新たな画像信
号が復元できる。標本値間の相関が大きい信号に対して
は精度の高い予測が可能なため、予測値(X)が実際の信
号Xに近くなり、予測誤差は小さくなる。従って、信号
Xよりも少ない情報量で伝送が可能となり、高能率符号
化が実現できる。Hereinafter, the above predictive coding, arithmetic code and Q-
Coder will be explained. Predictive Coding In the predictive coding, the past pixel value that has already been coded is stored in the memory in the encoder, and the predicted value (X) of the pixel X newly input from this is obtained. The difference (referred to as prediction error) X- (X) is quantized, the output level thereof is converted into an appropriate binary code, and the binary code is transmitted. Since the prediction value (X) can be reproduced by the same calculation on the receiving side, the prediction error is reproduced from the transmitted code, and this is added to the previously decoded image signal, and a new image signal is added. Can be restored. Since a highly accurate prediction is possible for a signal having a large correlation between sample values, the predicted value (X) becomes close to the actual signal X, and the prediction error becomes small. Therefore, it is possible to transmit with a smaller amount of information than the signal X, and high efficiency coding can be realized.
【0007】図8は予測誤差を符号化することによって
画像データを画素レベルで圧縮するQ−Coderを用いた
画像データ圧縮装置の符号化フローである。図8におい
て、2値画像(例えば、ファクシミリ)の1画素につい
て予測誤差を算出し符号化するまでの処理は次のような
ものである。FIG. 8 is an encoding flow of an image data compression apparatus using a Q-Coder for compressing image data at a pixel level by encoding a prediction error. In FIG. 8, the process until the prediction error is calculated and encoded for one pixel of a binary image (for example, a facsimile) is as follows.
【0008】先ず、ステップS1で符号化をしようとす
る画素(符号化対象画素)の周辺7画素から符号化しよ
うとする画素の予測値を求め、ステップS2で符号化し
ようとする画素と上記予測値をEX−ORして予測誤差
を算出する。次いで、ステップS3で算出した予測誤差
をQ−Coder(後述する図14参照)を用いて符号化す
る。この処理を図9〜図11により具体的に説明する。First, in step S1, a predicted value of a pixel to be coded is obtained from the seven pixels around the pixel to be coded (pixel to be coded), and in step S2 the pixel to be coded and the above prediction are calculated. EX-OR the values to calculate the prediction error. Next, the prediction error calculated in step S3 is encoded using Q-Coder (see FIG. 14 described later). This processing will be specifically described with reference to FIGS.
【0009】図9は文書等の画像データ1とその一部を
拡大した予測値対象を示す図である。この図に示すよう
に、符号化時には画像データ1の左上から右方向に走査
を行って白黒(0か1)2値のドットデータを得るもの
であるが、ある画素Xのドットを符号化しようとした場
合に原データを直接符号化するのではなく、図9の拡大
部に示すように画素Xの左上、上及び右のa〜gの7つ
の画素の値(白黒の値)からXの値を予測してその予測
との誤差を求めるようにする。すなわち、図9に示すよ
うに、画素Xの左上方向のa〜gの周囲7画素の値を基
に予測値を統計的に記憶した予測値表(予測符号表)2
(図10)を作成しておき、上記a〜gの周囲7画素の
値によって予測値表2のアドレスを指定し、対応する予
測値(X)を得る。上記予測値表2は、a〜gの画素の値
0000000から1111111までのすべての組合
せに対応して0から1の予測値(X)を予め統計的に求め
て記憶しておくもので、例えば画像データ1を走査して
画素Xの周りに0(例えば、白)が多いときにはこの符
号化しようとするドットデータも白が多いと想定される
ので予測値(X)は0(白)とする。逆に、ベタ塗りのよ
うなときは1(例えば、黒)である確率は高いと想定さ
れるので予測値(X)は1(黒)とする。このようにa〜
gの画素の値に対応して最適な予測値(X)を予め統計的
に求めてROM等に記憶しておき、この予測値(X)と画
素Xを図11に示すEX−OR(排他的論理和)回路3
に入力してEX−OR論理をとり予測誤差を算出する。
EX−ORした結果、予測が正しければ“0”、誤りの
場合は“1”とする。予測が合っている限りは“0”が
多くなるから、この“0”が多いデータを符号化装置に
通して符号化すればこれは偏りが多いデータであるから
かなりの圧縮が期待できる。このようにa〜gの画素の
値による予測値(X)がXと一致していれば圧縮率が高く
なる。FIG. 9 is a diagram showing image data 1 of a document or the like and a predicted value object obtained by enlarging a part thereof. As shown in this figure, at the time of encoding, black and white (0 or 1) binary dot data is obtained by scanning the image data 1 from the upper left to the right. Let's encode the dot of a certain pixel X. In such a case, the original data is not directly encoded, but as shown in the enlarged part of FIG. Predict the value and find the error from the prediction. That is, as shown in FIG. 9, a prediction value table (prediction code table) 2 in which the prediction values are statistically stored based on the values of the seven pixels around a to g in the upper left direction of the pixel X.
(FIG. 10) is created, and the address of the prediction value table 2 is designated by the values of the seven pixels surrounding the above a to g to obtain the corresponding prediction value (X). The above-mentioned predicted value table 2 is a table in which predicted values (X) of 0 to 1 are statistically obtained in advance and stored in correspondence with all combinations of the pixel values ag to 0000000 to 1111111. When the image data 1 is scanned and there are many 0s (for example, white) around the pixel X, it is assumed that the dot data to be encoded also has many whites, so the prediction value (X) is set to 0 (white). .. On the contrary, in the case of solid painting, the probability of being 1 (for example, black) is assumed to be high, so the prediction value (X) is set to 1 (black). Like this
The optimum predicted value (X) corresponding to the pixel value of g is statistically obtained in advance and stored in the ROM or the like, and the predicted value (X) and the pixel X are EX-OR (exclusive Logical OR circuit 3
To EX-OR logic to calculate the prediction error.
As a result of EX-OR, "0" is set if the prediction is correct, and "1" is set if the prediction is incorrect. As long as the prediction is correct, there will be many "0" s. If this data with many "0s" is passed through an encoding device and encoded, this is data with a large amount of bias, so considerable compression can be expected. In this way, if the predicted value (X) based on the pixel values of a to g matches X, the compression rate becomes high.
【0010】上述のようにして算出された予測誤差をQ
−Coderを用いて符号化していくことになる。Q is the prediction error calculated as described above.
-It will be encoded using Coder.
【0011】次に、Q−Coderの概要について説明す
る。Q−Coderは算術符号の一種であり、0〜1の数直
線上を符号化するデータの発生確率で次々と分割してい
くものである。従って、先ず算術符号について簡単に述
べる。算術符号 算術符号は、0〜1の数直線数を符号化するデータの発
生確率で分割することによって原データを一旦発生頻度
(発生確率)に置き換える。例えば、図12に示すよう
に入力値11001…を、“1”の出る予測確率が高い
P(0≦P≦1)と“0”の出る予想確率Q(Q=1−
P)とによる発生頻度に置き換え、これを図13に示す
起点C、幅Aの数直線上の分割比率で表す。すなわち、
数直線上に2つの変数C(原点)とA(幅)をもたせ、
最初はC=0,A=1(図13(ア)参照)とする。発
生確率が高いときは原点Cを変えずに数直線の分割を行
い、新たに図13(ア)のPの大きさを数直線の幅にす
る。そして、 i)数直線の分割をするときに発生頻度の高い符号
“1”がきた場合には数直線の幅をPにして原点(起
点)はそのまま据え置く。 ii)また、数直線の分割をするときに発生頻度の低い符
号“0”がきた場合には図13(イ)に示すように原点
(C)の位置をPだけ動かして幅Aを変える。Next, the outline of the Q-Coder will be described. Q-Coder is a kind of arithmetic code, and is divided one after another by the probability of occurrence of data to be encoded on the number line of 0 to 1. Therefore, the arithmetic code will first be briefly described. Arithmetic Code The arithmetic code divides the number of linear numbers 0 to 1 by the occurrence probability of the data to be encoded, thereby replacing the original data once with the occurrence frequency (occurrence probability). For example, as shown in FIG. 12, input values 11001 ... P (0 ≦ P ≦ 1) with a high prediction probability of “1” and prediction probability Q (Q = 1−0) of “0”.
P) and the occurrence frequency according to P. That is,
Give two variables C (origin) and A (width) on the number line,
Initially, C = 0 and A = 1 (see FIG. 13A). When the probability of occurrence is high, the number line is divided without changing the origin C, and the size of P in FIG. 13A is newly set to the width of the number line. Then, i) When a code "1" with a high occurrence frequency is generated when dividing the number line, the width of the number line is set to P and the origin (starting point) is left unchanged. ii) Further, when a code "0" having a low occurrence frequency is generated when dividing the number line, the position of the origin (C) is moved by P to change the width A, as shown in FIG.
【0012】上述した方法に従って図12に示す入力値
1100…を連続的に符号化していくと数直線の幅はど
んどん狭くなって0〜1の間のある点に近づき、最終的
には原点の位置が数直線上のある点に収束する。かかる
符号化を算術符号という。When the input values 1100 shown in FIG. 12 are continuously encoded according to the above-described method, the width of the number line becomes narrower and closer to a certain point between 0 and 1 and finally the origin. The position converges to a point on the number line. Such encoding is called arithmetic code.
【0013】従って、原点Cは発生頻度の高い符号
“1”がきた場合には分割はされるが変化(移動)はせ
ず、発生頻度の高い符号“1”が続く限り分割して割っ
ていくだけで原点の位置は変わらない。すなわち、発生
頻度の高い符号が多ければ多い程分割位置を表現する手
段は小数点以下となり、発生頻度が高い場合は更に分割
が進んでいったとしても桁は増えない(発生頻度の低い
符号“0”がきたときだけ原点の位置が動く)。従っ
て、発生頻度が高い符号が続いている限りにおいては何
千ビットという符号がきてもあるビット線(例えば、数
十ビット)で表現できることになる。ここで、この発生
確率と最終的な符号があれば逆の手順をたどれば元の符
号を得る(復元する)ことができる。このように、発生
確率が予めわかっているものに対して符号の偏りが大き
ければ大きい程圧縮率の高い符号化ができる。Therefore, the origin C is divided when a code "1" having a high occurrence frequency comes, but is not changed (moved), and is divided and divided as long as the code "1" having a high occurrence frequency continues. The position of the origin does not change just by cutting. That is, as the number of codes with a high occurrence frequency increases, the means for expressing the division position is below the decimal point, and with a high frequency of occurrence, the number of digits does not increase even if the division progresses further (the code "0" with a low occurrence frequency). The position of the origin moves only when "is"). Therefore, as long as a code with a high occurrence frequency continues, even if a code of thousands of bits comes, it can be expressed by a certain bit line (for example, several tens of bits). If the occurrence probability and the final code are present, the original code can be obtained (restored) by following the reverse procedure. In this way, the greater the deviation of the code with respect to the one whose occurrence probability is known in advance, the higher the compression rate can be encoded.
【0014】上述した算術符号は高能率符号化が可能で
あるが、次のような欠点がある。先ず、上記“1”の
出る予想確率P、“0”の出る予想確率Qを求めるため
に発生頻度(発生確率)を知る必要があるが、発生頻度
というのは予め全部のデータをスキャンしなければ決定
することができない。例えば、ファクシミリ等では一度
全文章等をスキャンしてみないと発生頻度がわからな
い。また、上記P,Qは整数ではないから精度を高め
ようとすれば小数点以下の多くの桁が必要になり、その
多数桁での数直線の分割は非常に計算が困難である。The arithmetic code described above can be encoded with high efficiency, but has the following drawbacks. First, it is necessary to know the occurrence frequency (occurrence probability) in order to obtain the above-described expected probability P of "1" and expected probability Q of "0". The occurrence frequency must be scanned in advance for all data. If you can't decide. For example, in a facsimile or the like, the frequency of occurrence cannot be known until the entire text or the like is scanned once. Further, since P and Q are not integers, many digits below the decimal point are required to improve the accuracy, and it is very difficult to calculate the number line with a large number of digits.
【0015】上記算術符号の欠点を解消するものとして
算術符号の一種であるQ−Coderが提案された(A multi
-purpose VLSI chip for adaptive data compressin of
bilevel images及び Software imprementation of the
Q-Coder IBM J.RES.DEVELOP VOL32.No6 11-1988参
照)。Q-Coder, which is a kind of arithmetic code, has been proposed as a solution to the above-mentioned drawbacks of arithmetic code (A multi).
-purpose VLSI chip for adaptive data compressin of
bilevel images and Software imprementation of the
Q-Coder IBM J.RES.DEVELOP VOL32.No6 11-1988).
【0016】以下、Q−Coderについて説明する。Q−Coder Q−Coderにおいて、0〜1の数直線上を符号化するデ
ータの発生確率で分割することでは上述した算術符号と
基本的には同じであるが、上記算術符号の欠点、を
解消するために以下のような改良が施されている。すな
わち、上記欠点を解消するためには、前記P,Qを、
予め全部のデータをスキャンして発生確率を算出してお
くのではなく、最初は発生確率がどちらか分からないか
ら0.5と仮定し、符号が入力されるに従ってこの発生
確率を動的に変化させる。例えば、P=0.5と仮定し
た場合、入ってくる符号に“1”が多いときはPは0.
5よりも大きく(P>0.5)なる方向に変化させる。
また、スキャンしている途中から“0”が多くなってき
たときは発生確率を下げていきPは0.5よりも小さく
(P<0.5)する。このように動的に発生確率を変化
させる(これを予測発生確率という)ことにより予め全
データをスキャンして発生確率を決定する必要がなくな
る。動的に発生確率を変化させる方法は図16に示す表
を使用して行われるが、これについては後述する。The Q-Coder will be described below. Q-Coder In Q-Coder, the number line 0 to 1 is divided by the probability of occurrence of data to be encoded, which is basically the same as the above-mentioned arithmetic code, but the drawbacks of the above arithmetic code are solved. In order to do so, the following improvements have been made. That is, in order to eliminate the above drawbacks, the P and Q are
Instead of scanning all data in advance and calculating the probability of occurrence, it is assumed that it is 0.5 because the probability of occurrence is unknown at first, and this probability of occurrence changes dynamically as the code is input. Let For example, assuming that P = 0.5, P is 0 ..
The value is changed to be larger than 5 (P> 0.5).
When the number of “0” s increases during scanning, the probability of occurrence is decreased and P is made smaller than 0.5 (P <0.5). By dynamically changing the occurrence probability in this way (this is called the predicted occurrence probability), it is not necessary to scan all data in advance to determine the occurrence probability. The method of dynamically changing the occurrence probability is performed using the table shown in FIG. 16, which will be described later.
【0017】一方、上記欠点を解消するためには、上
述した算術符号では元の数直線の幅Aに対して発生確率
Pを掛けたものが新しい幅になるようにし(A←A×
P)、このPが例えば0.3256…等小数点以下何桁
もあると精度の上から計算が困難であったが、Q−Code
rでは分割時の乗算をすべて足し算と引算に置き換えて
しまうことによって上記欠点をなくすようにする。すな
わち、数直線を分割するということは発生確率を引くこ
とによって、また、原点の位置を動かすということは発
生確率を足すことによって近似する。On the other hand, in order to solve the above-mentioned drawback, in the above-mentioned arithmetic code, the width A of the original number line is multiplied by the occurrence probability P to obtain a new width (A ← A ×
P), if this P has several digits after the decimal point, such as 0.3256, it was difficult to calculate due to the accuracy, but Q-Code
In r, all the multiplications at the time of division are replaced with additions and subtractions so as to eliminate the above drawbacks. That is, dividing the number line is approximated by subtracting the occurrence probability, and moving the position of the origin is approximated by adding the occurrence probabilities.
【0018】図14〜図16を参照しながらQ−Coder
の概要を述べる。図14はQ−Coderの符号化の過程を
示す原理図である。この図において、Q−Coderは入力
値の系列を0〜A0(通常1)の範囲の数直線上の1点
で表し、その点の値を符号系列として伝送するものであ
る。最初、幅A0起点C0が与えられたとき、入力系列先
頭値に従って幅A0をPe:Qe(Peは“M”の出る
予想確率、Qeは“L”の出る予想確率であり、0<P
e≦0.5,Qe=1−Peとする)に分割し、次の幅
A1と起点C1を得る。同様に、次の入力系列値に従っ
て、分割し幅A2、起点C2を得る。これを順次繰り返
し、求める符号化系列を得る。図14に示す符号化過程
は4Bitのデータ“MMLM”(M=1のときは、11
01)を入力したときの動作である。すべての入力で分
割し終わったときの点を符号とし、0<x<1の少数値
が得られる。入力bitが“M”のときは符号の範囲Aを
分割しA・Qeとする。Q-Coder with reference to FIGS.
The outline of is described. FIG. 14 is a principle diagram showing a process of Q-Coder encoding. In this figure, the Q-Coder represents a series of input values by one point on the number line in the range of 0 to A 0 (normally 1), and the value at that point is transmitted as a code series. First, when the width A 0 starting point C 0 is given, the width A 0 is set to Pe: Qe (Pe is an expected probability of "M", Qe is an expected probability of "L" according to the input sequence head value, and 0 <P
e ≦ 0.5, Qe = 1−Pe) and obtain the next width A 1 and starting point C 1 . Similarly, division is performed according to the next input sequence value to obtain the width A 2 and the starting point C 2 . This is sequentially repeated to obtain the desired coded sequence. The encoding process shown in FIG. 14 is performed using 4-bit data “MMLM” (11 when M = 1).
This is the operation when 01) is input. The point at the end of division for all inputs is used as a code, and a decimal value of 0 <x <1 is obtained. When the input bit is “M”, the code range A is divided into A · Qe.
【0019】すなわち、入力系列値に対し、発生確率の
高いデータMPS(More ProbableSymbol)と発生確率
の低いデータLPS(Less Probable symbol)を想定
し、入力値がMPSならばAn=An-1・(1−Q
e),Cn=Cn-1+An-1・Qeとし、LPSならば、
An=An-1・Qeとして数直線を分割する。この場
合、演算を容易にするために分割時の乗算を加減算に置
き換えて、An-1=1と近似するとともにMPSのとき
はAn=An-1・Qe,Cn=Cn-1+Qeとし、LPS
のときはAn=Qeとして数直線の分割を行う(図15
のQ−CoderフローのステップS11〜S13参照)。
次いで、ステップS14でA,Cを毎回1≦A<2とな
るように正規化する(例えば、A<1のときはA≧1と
なるまで左シフトさせる)ことによって演算精度を確保
し、ステップS15でQe更新を行ってQ−Coderフロ
ーを終了する。このQe更新は、例えばMPSの場合は
図14に示すように下側の線が上に上がっていくように
Qeを動的に変化させていくことである。なお、このQ
−Coderフロー(図15)が前記図8の符号化フローの
ステップS3符号化処理に対応している。That is, assuming that data MPS (More Probable Symbol) having a high probability of occurrence and data LPS (Less Probable symbol) having a low probability of occurrence with respect to the input sequence value, if the input value is MPS, An = A n-1. (1-Q
e), Cn = C n-1 + A n-1 · Qe, and if LPS,
The number line is divided as An = A n-1 · Qe. In this case, multiplication at the time of division is replaced with addition and subtraction to facilitate the calculation, and it is approximated as A n-1 = 1 and at the time of MPS, An = A n-1 · Qe, Cn = C n-1 + Qe. And LPS
In this case, An = Qe is set and the number line is divided (see FIG. 15).
(See Steps S11 to S13 of the Q-Coder flow).
Then, in step S14, A and C are normalized so that 1 ≦ A <2 each time (for example, when A <1 is shifted to the left until A ≧ 1), the calculation accuracy is secured. In S15, Qe is updated and the Q-Coder flow is ended. This Qe update is to dynamically change Qe so that the lower line goes up as shown in FIG. 14 in the case of MPS, for example. In addition, this Q
-The Coder flow (FIG. 15) corresponds to the step S3 encoding process of the encoding flow of FIG.
【0020】このように、Q−Coderでは符号化の起点
を0とし、加算によって符号Cを決定していくので、図
に示すように下側の線が加算によって中央に寄ってい
く。さらに、Q−Coderでは分割比に相当するLPSの
発生確率見種値Qeも毎回更新している。Qe値は図1
6に示すU字形の状態図において、0〜29までの値を
とる30のステートを指示することによってそのステー
トのQe値を決定する。すなわち、図16に示すように
発生頻度の高いビットをMPSとし、U字形の左側をM
PS=1,右側をMPS=0として最初はQe値が最大
の0.5(ステート0〜29の値のうちのステート0の
位置)から開始する。そして、1入力値を符号化する度
に、図16のmに示すようにこのU字形のステートの位
置を上下させステートを変化させる。各々ステート0〜
29に対し、固有のQe値がありステート0ではQe=
0.5、ステート29では非常に小さな値(例えば、
0.00018)となる。As described above, in the Q-Coder, the starting point of encoding is set to 0 and the code C is determined by addition, so that the lower line moves toward the center by addition as shown in the figure. Further, in the Q-Coder, the LPS occurrence probability seed value Qe corresponding to the division ratio is also updated every time. Qe value is shown in Figure 1.
In the U-shaped state diagram shown in FIG. 6, the Qe value of the state is determined by designating 30 states that take values from 0 to 29. That is, as shown in FIG. 16, the bit with high occurrence frequency is MPS, and the left side of the U-shape is M
PS = 1, the right side is set to MPS = 0, and the Qe value starts at 0.5 (position of state 0 of states 0 to 29), which is the maximum. Then, every time one input value is encoded, the position of this U-shaped state is moved up and down as shown by m in FIG. 16 to change the state. State 0
There is a unique Qe value for 29, and in state 0, Qe =
0.5, a very small value in state 29 (eg
0.00018).
【0021】Qeの変化の仕方は、想定しているMPS
(例えば、MPS=1)と実際に入ってくるMPSが一
致した場合には図16の表のステートを1つづつ上に登
っていく。すなわち、想定したMPS=1が多い場合に
は発生頻度が高いから発生確率が高いとみなすようにす
る。The method of changing Qe depends on the assumed MPS.
When (for example, MPS = 1) and the MPS that actually comes in match, the states in the table of FIG. 16 are climbed up one by one. That is, if the number of assumed MPS = 1 is large, the occurrence frequency is high, and therefore the occurrence probability is considered to be high.
【0022】また、0がいくつか続いた場合は図16の
表のステートを2つとばし(あるいは3つとばし)で降
ろすことによって追随を速くする。そして、図16の表
の真中(ステート0の位置)にきて更にMPS=1でな
い1がきた場合には以後発生頻度が高いのは0ではない
かと想定してMPS=0として上述したMPS=1の場
合と同様に変化させる。従って、MPSが1,0どちら
でも発生頻度の高い方に追随するようにできる。When several 0s continue, the states in the table of FIG. 16 are skipped by two (or three) to speed up the follow-up. Then, in the middle of the table of FIG. 16 (position of state 0), when 1 other than MPS = 1 comes, it is assumed that the frequency of occurrence is 0 thereafter, and MPS = 0 described above assuming MPS = 0. Change as in the case of 1. Therefore, whether MPS is 1 or 0 can be followed by the one with the highest occurrence frequency.
【0023】このように、入力値にMPSが続くと、ス
テートは徐々に上がっていってQe値が小、すなわち数
直線の分割が小さくなり、発生符号量が小さくなる。逆
に、MPSが続かず、ステート0近辺でMPS,LPS
が交互に入力された場合、MPSの設定が入れ替わり、
ステートが上がらず、Qe値が大きく、発生符号量は大
きくなってしまうことになる。As described above, when MPS continues to the input value, the state gradually rises and the Qe value becomes small, that is, the division of the number line becomes small and the generated code amount becomes small. Conversely, MPS does not continue and MPS, LPS near state 0
When is input alternately, the MPS settings are switched,
The state does not rise, the Qe value is large, and the generated code amount is large.
【0024】[0024]
【発明が解決しようとする課題】しかしながら、このよ
うな従来のQ−Coderを用いた符号化装置にあっては、
予測値の当りにくい入力パターンにおいても一律に予測
値表(図10)を用いて予測誤差を符号化する構成とな
っていたため、Q−CoderにLPSが入力されることも
多く、図16のU字形のステートの上下も多いことから
予測値の精度が低い入力パターンがわかっていても、発
生符号量を抑えることはできないという問題点があっ
た。すなわち、図16に示したように想定したMPSと
入力されたMPSが一致した場合には図16のU字形の
ステートを1つづつ登り、一致しない場合にはU字形の
ステートを2つ(3つ)とばしに下りるようにしていた
ため追随性はよいものの、例えばMPSが一致し続けて
いるとき(MPS=1と仮定した場合に1が入力される
とき)に0が少し続くようなことがあると、発生確率が
高くなっている符号化の効率のよい前記U字形の上のス
テートから下のステートにすぐにおちてしまうことにな
る。このため、数直線の分割が粗くなり発生する符号量
が増大してしまう。すなわち、MPSでない部分が少し
続くことによってその時点で符号が増えてしまい、一度
下のステートまで下がると上のステートに登るのに時間
がかかってその間符号量が増えてしまうという問題点が
あった。However, in such a conventional coding apparatus using the Q-Coder,
Since the prediction error is uniformly coded using the prediction value table (FIG. 10) even in the input pattern where the prediction value is hard to hit, LPS is often input to the Q-Coder. Since there are many upper and lower glyph states, even if an input pattern with low prediction value accuracy is known, the generated code amount cannot be suppressed. That is, if the assumed MPS and the input MPS match as shown in FIG. 16, the U-shaped states of FIG. 16 are climbed up one by one, and if they do not match, two U-shaped states (3 (3) Although it has good followability because it was designed to go down by skipping, for example, 0 may continue a little when MPS continues to match (when 1 is input when MPS = 1 is assumed). Then, the U-shaped upper state, which has a high probability of occurrence and is highly efficient in encoding, immediately falls to the lower state. For this reason, the division of the number line becomes rough and the generated code amount increases. That is, there is a problem in that the number of codes increases at that point due to a small number of non-MPS portions continuing, and it takes time to climb to the upper state once the state has dropped to the lower state, and the code amount increases during that time. ..
【0025】ところで、上記MPSが一致しないという
ことは“1”と“0”が混合して入力されるような場合
であり、このようなときは予測が外れる確率も高い。例
えば、前記図10の予測値表2にあっては符号化しよう
とする画素Xの周囲7画素a〜gの値が1又は0半々づ
つ存在するような場合である。このような場合には予測
値が外れる確率が高いので、予測値が外れてしまうと符
号化効率の高い上のステートから2つあるいは3つとば
しに下のステートに落ちてしまい、再び上のステートに
戻るのに時間がかかり、発生符号量が増大してしまうこ
とになる。そこで本発明は、予測値が当たらないときで
あっても発生符号量を抑えることができ、データ圧縮効
率の高い符号化装置を提供することを目的としている。By the way, the fact that the MPSs do not match is a case where "1" and "0" are mixed and input, and in such a case, there is a high probability that the prediction will be wrong. For example, in the prediction value table 2 of FIG. 10, there is a case where the values of the seven pixels a to g around the pixel X to be coded are 1 or 0 and half. In such a case, there is a high probability that the predicted value will deviate, so if the predicted value deviates, it will fall from the upper state with high coding efficiency to the lower state by skipping two or three, and then the upper state again. It takes a long time to return to, and the generated code amount increases. Therefore, it is an object of the present invention to provide an encoding device that can suppress the amount of generated codes even when the predicted value does not hit and that has high data compression efficiency.
【0026】[0026]
【課題を解決するための手段】請求項1記載の発明は、
上記目的達成のため、符号化対象のデータを供給するた
めのデータ供給手段と、符号化対象画素の周囲複数画素
の値に対応した符号化対象画素の予測値を予測値表とし
て記憶する予測値記憶手段と、前記データ供給手段から
供給された符号化対象画素と前記予測値記憶手段から出
力された予測値に基づいて予測誤差を算出する予測誤差
算出手段と、前記予測誤差算出手段により算出された予
測誤差を、所定の変数を変えることにより算術符号の分
割比率が動的に変化する算術符号化によって符号化する
符号化手段とを備えた符号化装置であって、前記予測値
表は、前記周囲複数画素が特定パターンのときに予測値
が無効であることを示すデータを有し、該特定パターン
のときには前記符号化手段の変数を所定値に固定して符
号化するようにしている。請求項2記載の発明は、符号
化対象のデータを供給するためのデータ供給手段と、符
号化対象画素の周囲複数画素の値に対応した符号化対象
画素の予測値を予測値表として記憶するとともに、該周
囲複数画素が特定パターンであることを示すデータを記
憶する予測値記憶手段と、前記データ供給手段から供給
された符号化対象画素と前記予測値記憶手段から出力さ
れた予測値に基づいて予測誤差を算出する予測誤差算出
手段と、前記予測誤差算出手段により算出された予測誤
差を符号化する符号化手段と、を備えている。前記予測
値記憶手段における特定パターンは、例えば、請求項1
および請求項2に記載されているように、前記予測値が
当たる確率が小さい画素入力パターンであってもよく、
また、前記符号化手段は、算術符号の分割比率が動的に
変化するQコーダを用いたものであってもよい。The invention according to claim 1 is
In order to achieve the above object, a data supply unit for supplying data to be encoded, and a prediction value that stores a prediction value of a pixel to be encoded corresponding to values of a plurality of pixels around the pixel to be encoded as a prediction value table. Storage means, prediction error calculation means for calculating a prediction error based on the encoding target pixel supplied from the data supply means and the prediction value output from the prediction value storage means, and the prediction error calculation means A prediction error, a coding device comprising a coding means for coding by arithmetic coding in which the division ratio of the arithmetic code dynamically changes by changing a predetermined variable, wherein the prediction value table is When the plurality of surrounding pixels have data indicating that the predicted value is invalid when the pixel has a specific pattern, the variable of the encoding means is fixed to a predetermined value and is encoded when the pixel has the specific pattern. There. According to a second aspect of the present invention, a data supply unit for supplying data to be encoded and a predicted value of a pixel to be encoded corresponding to values of a plurality of pixels around the pixel to be encoded are stored as a prediction value table. Along with the prediction value storage means for storing data indicating that the surrounding plural pixels are a specific pattern, the encoding target pixel supplied from the data supply means and the prediction value output from the prediction value storage means. Prediction error calculating means for calculating a prediction error by means of the above, and encoding means for encoding the prediction error calculated by the prediction error calculating means. The specific pattern in the predicted value storage means is, for example,
And a pixel input pattern having a small probability of hitting the prediction value, as described in claim 2,
Further, the encoding means may use a Q coder in which the division ratio of the arithmetic code dynamically changes.
【0027】[0027]
【作用】本発明の手段の作用は次の通りである。請求項
1記載の発明では、符号化対象のデータはデータ供給手
段により供給され、符号化対象画素の周囲複数画素の値
に対応した符号化対象画素の予測値は予測値表として予
測値記憶手段に記憶されている。符号化しようとする画
素の周辺数画素の値により予測値表のアドレスを指定す
ると、予測値記憶手段から指定されたアドレスに対応す
る値が予測値表を基に取出されて予測値として予測誤差
算出手段に出力される。この予測値表には周囲複数画素
が予測値が当たる確率が小さい特定パターンのときに予
測値が無効であることを示すデータが付加されており、
この特定パターンのときは予測値を使用しない。そし
て、データ記憶手段から出力された符号化対象画素と予
測値発生手段から出力された予測値に基づいて予測誤差
手段により予測誤差が算出される。符号化手段は予測誤
差を、所定の変数を変えることにより算術符号の分割比
率が動的に変化する算術符号化によって符号化するが、
予測値が当りにくい特定パターンのときには上記変数を
所定値に固定して符号化するようにする。従って、予測
値が当たらない場合の発生符号量を抑制することがで
き、圧縮率を大幅に高めることができる。請求項2記載
の発明では、予測値記憶手段が、符号化対象画素の周囲
複数画素の値により符号化対象画素の予測値を予測値表
として記憶するとともに、周囲複数画素が特定パターン
であることを示す付加データを記憶する。従って、単に
予測値に基づく予測誤差を算出するだけではなく、周囲
複数画素が特定パターンのときには付加データを基にし
て種々の制御が可能になる。The operation of the means of the present invention is as follows. In the invention of claim 1, the data to be encoded is supplied by the data supply means, and the prediction value of the encoding target pixel corresponding to the values of a plurality of pixels around the encoding target pixel is a prediction value table as a prediction value storage means. Remembered in. When the address of the prediction value table is specified by the values of several pixels around the pixel to be encoded, the value corresponding to the specified address is fetched from the prediction value storage means on the basis of the prediction value table and the prediction error as the prediction value. It is output to the calculation means. In this predicted value table, data indicating that the predicted value is invalid is added to a specific pattern in which a plurality of surrounding pixels have a small probability that the predicted value will hit,
The predicted value is not used for this specific pattern. Then, a prediction error is calculated by the prediction error means based on the encoding target pixel output from the data storage means and the prediction value output from the prediction value generation means. The encoding means encodes the prediction error by arithmetic encoding in which the division ratio of the arithmetic code dynamically changes by changing a predetermined variable.
When the predicted value is difficult to hit, the variable is fixed to a predetermined value and encoded. Therefore, it is possible to suppress the amount of generated code when the predicted value does not hit, and to significantly increase the compression rate. In the invention according to claim 2, the prediction value storage means stores the prediction value of the pixel to be coded as a prediction value table according to the values of the plurality of pixels around the pixel to be coded, and the plurality of surrounding pixels is a specific pattern. Is stored. Therefore, in addition to simply calculating the prediction error based on the prediction value, various controls can be performed based on the additional data when the surrounding pixels have a specific pattern.
【0028】[0028]
【実施例】以下、本発明を図面に基づいて説明する。図
1〜図7は本発明に係る符号化装置の一実施例を示す図
であり、画像データ圧縮装置に適用した例である。図1
において、画像データ圧縮装置11は圧縮すべきデータ
を記憶する画像データ記憶装置12と、符号化しようと
する画素(符号化対象画素)の周辺数画素の値により予
測値のアドレスを指定するアドレス発生装置13と、ア
ドレス発生装置13により指定されたアドレスに対応す
る値を基に予測値表31(図3)から予測値(X)を出
力する画素予測値記憶装置14と、画像データ記憶装置
12から出力された符号化しようとする画素と画素予測
値記憶装置14からの予測値(X)出力とにより予測誤
差を算出する予測誤差算出装置15と、算出された予測
誤差を符号化することによって画像データを圧縮するQ
−Coder16と、発生した符号を順次記憶する符号記憶
装置17と、上記各装置の動作を制御する制御装置18
とにより構成されている。DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings. 1 to 7 are diagrams showing an embodiment of an encoding apparatus according to the present invention, which is an example applied to an image data compression apparatus. Figure 1
In the image data compression device 11, the image data storage device 12 that stores the data to be compressed and the address generation that specifies the address of the prediction value by the value of several pixels around the pixel to be encoded (encoding target pixel) The device 13, the pixel prediction value storage device 14 that outputs the prediction value (X) from the prediction value table 31 (FIG. 3) based on the value corresponding to the address designated by the address generation device 13, and the image data storage device 12 A prediction error calculation device 15 for calculating a prediction error based on the pixel to be encoded output from the pixel prediction value storage device 14 and the prediction value (X) output from the pixel prediction value storage device 14, and by encoding the calculated prediction error Q to compress image data
A Coder 16, a code storage device 17 for sequentially storing generated codes, and a control device 18 for controlling the operation of each of the above devices.
It is composed of and.
【0029】図2はQ−Coder16のブロック構成図で
ある。図2において、Q−Coder16は分割される数直
線の起点Cデータを一時的に格納するCレジスタ21
と、分割される数直線の幅Aデータを一時的に格納する
Aレジスタ22と、Aレジスタ22からの出力及びCレ
ジスタ21からの出力を選択するセレクタ23と、セレ
クタ23により選択されたAレジスタ22出力あるいは
Cレジスタ21出力が入力端子Aに入力され、後述する
Qeテーブル26から読出した符号化用の変数(確率見
積値)Qeあるいは固定値が入力端子Bに入力され、こ
れらの入力値を加算又は減算して数直線を分割する加減
算器24と、0〜29の値をとりQeテーブル26から
LPSの発生確率見積値Qeを読取るステートSをカウ
ントするSカウンタ25と、0〜29のステートに対応
するQe値を記憶するQeテーブル26と、エンコード
入力又はデコード出力が1bitづつ入出力されるととも
にMPSが入力され、制御信号を出力して各部の動作を
制御するQ−Coderコントローラ27とにより構成され
ている。FIG. 2 is a block diagram of the Q-Coder 16. In FIG. 2, the Q-Coder 16 is a C register 21 that temporarily stores the starting point C data of the divided number line.
An A register 22 for temporarily storing the width A data of the divided number line, a selector 23 for selecting an output from the A register 22 and an output from the C register 21, and an A register selected by the selector 23. 22 output or C register 21 output is input to the input terminal A, the encoding variable (probability estimated value) Qe or fixed value read from the Qe table 26 described later is input to the input terminal B, and these input values are input. An adder / subtractor 24 that divides the number line by adding or subtracting, an S counter 25 that counts the state S that reads the LPS occurrence probability estimated value Qe from the Qe table 26 by taking a value of 0 to 29, and states 0 to 29 Qe table 26 that stores the Qe value corresponding to, and input / output of encode input or decode output bit by bit and MPS is input. It is constituted by outputs a control signal and Q-Coder controller 27 for controlling the operation of each unit.
【0030】上記Cレジスタ21は、入出力bitが25b
itのレジスタからなり、コントローラ27の指示に従っ
て符号化時にはその上位8bitを符号化出力として符号
化記憶装置17に出力し、復号化時には下位8bitに符
号化記憶装置17から符号化入力が供給される。Cレジ
スタ21には、加算により符号の範囲が狭められた値が
入力され、内部でビットシフトして符号化終了時にレジ
スタに残ったビット数が幅、すなわち符号になる。上記
Cレジスタ21では分割して小さくなった値を1〜2ま
での値になるようにビットが立つまで左シフトさせてQ
eの値を正規化するためにAレジスタ22よりも長い2
5bitのレジスタとしている。この左シフトした結果、
値が変化しない部分が最終的に符号となる。また、加算
して結果を出力するときはコントローラ27よりLOA
D、左シフトして正規かするときはSHIFTが指示さ
れる。The input / output bit of the C register 21 is 25b.
It consists of a register of it, and outputs the upper 8 bits as an encoded output to the encoding storage device 17 at the time of encoding according to the instruction of the controller 27, and supplies the encoding input from the encoding storage device 17 to the lower 8 bits at the time of decoding. .. A value whose code range has been narrowed by addition is input to the C register 21, and the number of bits left in the register at the end of encoding due to bit shift internally becomes the width, that is, the code. The C register 21 shifts the divided and reduced value to the value 1 to 2 by left-shifting until a bit is set, and then Q.
2 longer than the A register 22 to normalize the value of e
It is a 5-bit register. As a result of this left shift,
The part where the value does not change finally becomes the code. When adding and outputting the result, the controller 27
D, SHIFT is instructed when shifting left and normalizing.
【0031】上記Aレジスタ22は、演算幅を格納する
のに十分なビット(13bit)を有し、コントローラ2
7よりSHIFT/LOADが指示される。上記加減算
器24は、コントローラ27からのADD/SUB制御
信号により加算器又は減算器に切り替えられ、Aレジス
タ22の内容又はCレジスタ21の内容とを足し算又は
引算してAレジスタ22に戻したりCレジスタ21に戻
したりする。The A register 22 has enough bits (13 bits) to store the operation width, and the controller 2
SHIFT / LOAD is instructed from 7. The adder / subtractor 24 is switched to an adder or a subtractor by an ADD / SUB control signal from the controller 27, and the contents of the A register 22 or the contents of the C register 21 are added or subtracted to return to the A register 22. It is returned to the C register 21.
【0032】上記Qeテーブル26は、ステート0〜2
9に対応して0〜29段階の値をとるQe値を記憶する
ためのテーブルであり、Qeテーブル26からはSカウ
ンタ25の変数(ステート)Sで指示されたQe値が読
出されて加減算器24に出力される。上記Sカウンタ2
5は、前記図16に示すようにMPSが一致すればカウ
ントを1つ進めて上のステートSを指示し、MPSが一
致しなければカウントを3つ、2つあるいは1つ戻して
下のステートSを指示するカウンタであり、初期値は0
である。The Qe table 26 has states 0-2.
9 is a table for storing a Qe value that takes a value of 0 to 29 corresponding to 9, and the Qe value designated by the variable (state) S of the S counter 25 is read from the Qe table 26 and added / subtracted. 24 is output. The S counter 2
As shown in FIG. 16, if the MPSs match, the numeral 5 advances the count by 1 to indicate the upper state S, and if the MPSs do not match, the count is returned by 3, 2, or 1 to decrease the lower state. This is a counter that indicates S, and the initial value is 0.
Is.
【0033】また、Q−Coderコントローラ27は、1b
itずつ符号化する度に、現在のMPSと入力bitを比較
して、一致すればSカウンタ25のステートSを1つの
MPSだけ進める。不一致ならステートSを2つあるい
は3つ減らす。また、S=0のときにMPSが不一致な
らMPSとLPSを交換し、交換した後も同様に、MP
Sと入力bitの比較を行い、ステートSを決定する。S
の示すQeテーブル26値が必要なQe値である。Further, the Q-Coder controller 27 has 1b
Each time it is encoded, the current MPS is compared with the input bit, and if they match, the state S of the S counter 25 is advanced by one MPS. If they do not match, the state S is reduced by two or three. If the MPS does not match when S = 0, the MPS and LPS are exchanged, and after the exchange, the MPS
The state S is determined by comparing S with the input bit. S
The Qe table 26 value indicated by is the required Qe value.
【0034】図3は画素予測値値記憶装置14に記憶さ
れた予測値表31を示す図である。この図において、予
測値表31は、符号化対象画素Xの周辺7画素a〜gの
値を基に予測値を統計的に記憶した予測値(0又は1)
記憶部31aと、予測値が当りにくい特定パターンのと
きに予測値を決めずに(図中−参照)、Qe,MPSを
固定にする付加情報を記憶する固定値記憶部31bとか
らなる。予測値が当りにくいとされる周囲7画素の特定
入力パターンは、例えば図4及び図5で示される。図4
及び図5に示すように周辺7画素が1010101や0
101010などの発生確率が50%に近い予測値が当
りにくいものについては予測値を決めずに、代わりに変
数Qe,MPSを固定にしておく。FIG. 3 is a diagram showing a prediction value table 31 stored in the pixel prediction value storage device 14. In this figure, the prediction value table 31 is a prediction value (0 or 1) that statistically stores the prediction value based on the values of the seven pixels a to g around the pixel X to be encoded.
The storage unit 31a includes a fixed value storage unit 31b that stores additional information for fixing the Qe and MPS without determining the predicted value (see -in the figure) when the predicted pattern is difficult to hit. The specific input patterns of the surrounding 7 pixels that are hard to hit the predicted value are shown in FIGS. 4 and 5, for example. Figure 4
And as shown in FIG. 5, the peripheral 7 pixels are 1010101 or 0.
For a predictive value such as 101010 whose occurrence probability is close to 50% is hard to hit, the predictive value is not determined and the variables Qe and MPS are fixed instead.
【0035】次に、本実施例の動作を説明する。全体動作 先ず、画像データ記憶装置12には、符号化すべき画像
データが蓄えられている。アドレス発生装置13が符号
化しようとする画素の周辺数画素の値により予測値表3
1(図3)のアドレスを指定すると、画素予測値記憶装
置14は指定されたアドレスに対応する値を予測値表3
1を基に取出して予測値として予測誤差算出装置15に
出力する。この場合、符号化対象Xに対し周囲7画素か
ら予測値を得て、Qe,MPSが固定でなければ予測誤
差算出装置15は従来と同様に符号対象と予測値との予
測誤差を算出する。一方、周辺7画素が0101010
や1010101などのように予測値が当りにくいもの
については、予測値ではなくてQe=0.5,MPS=
1に固定し、また、Qeの更新はしない。Q−Coder1
6は算出された予測誤差を符号化することによって画像
データを圧縮していく。発生した符号は符号化記憶装置
17で順次記憶される。Next, the operation of this embodiment will be described. Overall Operation First, the image data storage device 12 stores image data to be encoded. Prediction value table 3 based on the values of several pixels around the pixel to be encoded by the address generator 13
When the address of 1 (FIG. 3) is designated, the pixel prediction value storage device 14 stores the value corresponding to the designated address in the prediction value table 3
It is extracted based on 1 and is output to the prediction error calculation device 15 as a prediction value. In this case, the prediction value is obtained from the surrounding 7 pixels for the coding target X, and if Qe and MPS are not fixed, the prediction error calculation device 15 calculates the prediction error between the coding target and the prediction value as in the conventional case. On the other hand, the peripheral 7 pixels are 0101010
For items such as 1010101 and 1010101 that are difficult to predict, Qe = 0.5, MPS =
It is fixed at 1, and Qe is not updated. Q-Coder 1
At 6, the image data is compressed by encoding the calculated prediction error. The generated codes are sequentially stored in the encoding storage device 17.
【0036】以下、図6及び図7に示すフローチャート
を用いて具体的な動作を説明する。図6は画像データ圧
縮装置11の符号化フローを示す図である。先ず、ステ
ップS31で符号化をしようとする画素(符号化対象画
素)の周辺7画素から符号化しようとする画素の予測値
を求め、ステップS32で予測値が当りにくいとされる
周囲7画素の特定入力パターンか否かを判別し、特定入
力パターンでないときはQe,MPSが固定でないとき
であるから従来と同様にステップS32で符号化しよう
とする画素と上記予測値をEX−ORして予測誤差を算
出する。次いで、ステップS24で算出された予測誤差
をQ−Coderを用いて符号化して本フローを終了する。The specific operation will be described below with reference to the flow charts shown in FIGS. 6 and 7. FIG. 6 is a diagram showing an encoding flow of the image data compression device 11. First, in step S31, a predicted value of a pixel to be encoded is obtained from the peripheral 7 pixels of the pixel to be encoded (encoding target pixel). It is determined whether or not it is the specific input pattern, and when it is not the specific input pattern, it means that Qe and MPS are not fixed. Calculate the error. Next, the prediction error calculated in step S24 is encoded using Q-Coder, and this flow ends.
【0037】一方、予測値が当たりにくいとされる周囲
7画素の特定入力パターンのときはステップS25で予
測値を用いず、Q−Coder16によりQe,MPSを固
定して符号化して処理を終える。On the other hand, in the case of the specific input pattern of the surrounding 7 pixels where the predicted value is hard to hit, the predicted value is not used in step S25, the Qe and MPS are fixed and encoded by the Q-Coder 16, and the process ends.
【0038】図7はQe,MPS固定時のQ−Coderの
フローを示す図であり、上記図6のステップS25に対
応する処理である。なお、Qe,MPSを固定しないと
きのQ−Coderのフロー(ステップS24の処理)は前
記図15に示されている。FIG. 7 is a diagram showing the flow of the Q-Coder when Qe and MPS are fixed, which is the process corresponding to step S25 of FIG. The flow of Q-Coder when Qe and MPS are not fixed (processing of step S24) is shown in FIG.
【0039】先ず、ステップS31で入力値がMPSか
LPSかを判別し、MPSのときはステップS32でQ
e=0.5,MPS=1に固定してA=A−0.5,C
=C+0.5とし、LPSのときはA=0.5として数
直線の分割を行う。次いで、ステップS34でA,Cを
毎回1≦A<2となるように正規化する(例えば、A<
1のときはA≧1となるまで左シフトさせる)ことによ
って演算精度を確保して本フローを終える。また、Qe
=0.5,MPS=1に固定し、符号化したときはQe
の更新はしない。従って、LPSを符号化しても図16
に示すU字形のステートは下がることはなく、以降の入
力系列の符号化に際し、発生符号量が一時的に上がるこ
とがない。First, in step S31, it is determined whether the input value is MPS or LPS. When the input value is MPS, Q is determined in step S32.
Fixing e = 0.5 and MPS = 1, A = A-0.5, C
= C + 0.5, and in the case of LPS, A = 0.5 to divide the number line. Next, in step S34, A and C are normalized each time so that 1 ≦ A <2 (for example, A <
When it is 1, the calculation accuracy is ensured by shifting left until A ≧ 1), and the present flow ends. Also, Qe
= 0.5, MPS = 1 and Qe when coded
Will not be updated. Therefore, even if the LPS is encoded,
The U-shaped state shown by does not decrease, and the generated code amount does not temporarily increase in the subsequent encoding of the input sequence.
【0040】以上説明したように、本実施例の画像デー
タ圧縮装置11は圧縮すべきデータを記憶する画像デー
タ記憶装置12と、符号化しようとする画素(符号化対
象画素)の周辺数画素の値により予測値のアドレスを指
定するアドレス発生装置13と、アドレス発生装置13
により指定されたアドレスに対応する値を基に予測値表
31から予測値(X)を出力する画素予測値記憶装置1
4と、画像データ記憶装置12から出力された符号化し
ようとする画素と画素予測値記憶装置14からの予測値
(X)出力とにより予測誤差を算出する予測誤差算出装
置15と、算出された予測誤差を符号化することによっ
て画像データを圧縮するQ−Coder16と、発生した符
号を順次記憶する符号化記憶装置17と、上記各装置の
動作を制御する制御装置18とを設け、上記予測値表3
1は入力パターンを予測値が当たりにくい特定入力パタ
ーンとそうでない入力パターンとに2分し、予測値が当
たりにくい特定入力パターンのものは予測値を無効にす
るとともに符号化用の変数Qe,MPSを固定し、Qe
の更新を行わないようにしているので、予測値が外れた
場合に発生符号量が増大することを防止することができ
る。このように、予測値が外れる頻度が高い入力値に対
する発生符号量の増加を抑えることができるため高圧縮
率な2値画像圧縮伸張装置を実現することが可能とな
り、例えば本装置11をファクシミリ装置に適用した場
合には伝送時間を短縮することができる。As described above, the image data compression apparatus 11 of the present embodiment has the image data storage apparatus 12 for storing the data to be compressed and the several pixels around the pixel to be encoded (encoding target pixel). An address generator 13 for designating an address of a predicted value by a value, and an address generator 13
Pixel predicted value storage device 1 that outputs a predicted value (X) from the predicted value table 31 based on the value corresponding to the address specified by
4 and a prediction error calculation device 15 that calculates a prediction error based on the pixel to be encoded output from the image data storage device 12 and the prediction value (X) output from the pixel prediction value storage device 14, A Q-Coder 16 that compresses image data by encoding a prediction error, a coding storage device 17 that sequentially stores generated codes, and a control device 18 that controls the operation of each device are provided, and the prediction value Table 3
1 divides the input pattern into a specific input pattern whose predictive value is hard to hit and an input pattern whose predictive value is hard to hit, and invalidates the predictive value for the specific input pattern whose predictive value is hard to hit, and the encoding variables Qe, MPS Fixed, Qe
Since it is not updated, it is possible to prevent the generated code amount from increasing when the predicted value deviates. In this way, since it is possible to suppress an increase in the amount of generated code for an input value whose prediction value often deviates, it is possible to realize a binary image compression / expansion device with a high compression rate. When applied to, the transmission time can be shortened.
【0041】なお、本実施例では符号化装置を画像デー
タ圧縮装置に適用した例であるが、勿論これには限定さ
れず、予測値を使用するものであれば全ての装置に適用
可能であることは言うまでもない。The present embodiment is an example in which the encoding device is applied to the image data compression device, but of course the present invention is not limited to this, and can be applied to any device as long as it uses a prediction value. Needless to say.
【0042】また、本実施例では予測値表の入力パター
ンを2分し、予測値が当りにくいものは予測値を無効と
し、符号化用の変数Qe,MPSを固定し、Qeの更新
を行わないようにしてるが、要は予測値に画素の入力パ
ターンに対応した情報を付加するものであればどのよう
なものでもよいことは言うまでもない。Further, in the present embodiment, the input pattern of the prediction value table is divided into two, the prediction value is invalid if the prediction value is difficult to hit, the encoding variables Qe and MPS are fixed, and Qe is updated. Although it is not provided, it goes without saying that any information may be added as long as the information corresponding to the pixel input pattern is added to the predicted value.
【0043】さらに、上記符号化対象画素の周囲画素の
取出方法やその個数、Q−Coder16のQeテーブル2
6やステート変化方法は前述した実施例に限られるもの
ではなく任意のものが使用可能である。Further, the extraction method and the number of pixels around the pixel to be coded, the Qe table 2 of the Q-Coder 16 are used.
6 and the state change method are not limited to those in the above-described embodiment, and any method can be used.
【0044】また、上記画像データ圧縮装置11やQ−
Coder16等を構成する回路や部材の数、種類などは前
述した実施例に限られないことは言うまでもない。Further, the image data compression device 11 and Q-
It goes without saying that the numbers and types of circuits and members that make up the Coder 16 and the like are not limited to those in the above-described embodiments.
【0045】[0045]
【発明の効果】請求項1記載の発明によれば、周囲複数
画素が特定パターンのときに予測値が無効であること示
すデータを記憶し、該特定パターンのときには符号化手
段の変数を所定値に固定して符号化するようにしている
ので、予測値が外れる頻度が高い入力値に対する発生符
号量の増加を抑えることができ、圧縮率を格段に高める
ことができる。その結果、2値画像圧縮伸張装置に利用
して好適である。According to the first aspect of the present invention, data indicating that the predicted value is invalid when the surrounding plural pixels have a specific pattern is stored, and the variable of the encoding means is set to a predetermined value when the specific pattern is used. Since the fixed value is set to, and the encoding is performed, it is possible to suppress an increase in the generated code amount with respect to an input value whose prediction value often deviates, and to significantly increase the compression rate. As a result, it is suitable for use in a binary image compression / decompression device.
【0046】請求項2記載の発明によれば、符号化対象
画素の周囲複数画素の値に符号化対象画素の予測値を予
測値表として記憶するとともに、該周囲複数画素が特定
パターンであることを示すデータを記憶するようにして
いるので、このデータを基に多様な符号化処理を行うこ
とができる。According to the second aspect of the present invention, the predicted values of the pixels to be coded are stored in the values of the plurality of pixels around the pixel to be coded as a prediction value table, and the plurality of surrounding pixels are a specific pattern. Since the data indicating the is stored, various encoding processing can be performed based on this data.
【図1】符号化装置のブロック構成図である。FIG. 1 is a block configuration diagram of an encoding device.
【図2】符号化装置のQ−Coderのブロック構成図であ
る。FIG. 2 is a block configuration diagram of a Q-Coder of an encoding device.
【図3】符号化装置の予測値表を示す図である。FIG. 3 is a diagram showing a prediction value table of the encoding device.
【図4】符号化装置の予測値表を用いない場合の周囲画
素の値を示す図である。FIG. 4 is a diagram showing values of surrounding pixels when a prediction value table of the encoding device is not used.
【図5】符号化装置の予測値表を用いない場合の周囲画
素の値を示す図である。FIG. 5 is a diagram showing values of surrounding pixels when a prediction value table of the encoding device is not used.
【図6】符号化装置の符号化のフローチャートである。FIG. 6 is a flowchart of encoding performed by the encoding device.
【図7】符号化装置のQ−Coderによる符号化のフロー
チャートである。FIG. 7 is a flowchart of encoding by Q-Coder of the encoding device.
【図8】従来のQ−Coderによる符号化フローチャート
である。FIG. 8 is an encoding flowchart according to a conventional Q-Coder.
【図9】従来の画像データ及び符号化対象画素の周囲画
素を示す図である。FIG. 9 is a diagram showing conventional image data and pixels surrounding a pixel to be encoded.
【図10】従来の予測値表を示す図である。FIG. 10 is a diagram showing a conventional prediction value table.
【図11】従来の予測誤差算出装置の回路構成図であ
る。FIG. 11 is a circuit configuration diagram of a conventional prediction error calculation device.
【図12】算術符号を説明するための図である。FIG. 12 is a diagram for explaining an arithmetic code.
【図13】算術符号を説明するための図である。FIG. 13 is a diagram for explaining an arithmetic code.
【図14】Q−Coderの原理を説明するための図であ
る。FIG. 14 is a diagram for explaining the principle of Q-Coder.
【図15】Q−Coderによる符号化フローチャートであ
る。FIG. 15 is an encoding flowchart according to Q-Coder.
【図16】Q−Coderのステート変化を示す図である。FIG. 16 is a diagram showing Q-Coder state changes.
11 画像データ圧縮装置 12 画像データ記憶装置 13 アドレス発生装置 14 画素予測値記憶装置 15 予測誤差算出装置 16 Q−Coder 17 符号化記憶装置 18 制御装置 21 Cレジスタ 22 Aレジスタ 23 セレクタ 24 加減算器 25 Sカウンタ 26 Qeテーブル 27 Q−Coderコントローラ A 分割される数直線の幅 C 分割される数直線の起点 M 発生確率の高いデータ L 発生確率の低いデータ Pe “M”の出る予測確率 Qe “L”の出る予測確率 11 image data compression device 12 image data storage device 13 address generation device 14 pixel prediction value storage device 15 prediction error calculation device 16 Q-Coder 17 encoding storage device 18 control device 21 C register 22 A register 23 selector 24 adder / subtractor 25 S Counter 26 Qe table 27 Q-Coder controller A Width of number line to be divided C Starting point of number line to be divided M Data with high occurrence probability L Data with low occurrence probability Pe Predicted probability of “M” occurrence of Qe “L” Prediction probability
Claims (4)
ータ供給手段と、 符号化対象画素の周囲複数画素の値に対応した符号化対
象画素の予測値を予測値表として記憶する予測値記憶手
段と、 前記データ供給手段から供給された符号化対象画素と前
記予測値記憶手段から出力された予測値に基づいて予測
誤差を算出する予測誤差算出手段と、 前記予測誤差算出手段により算出された予測誤差を、所
定の変数を変えることにより算術符号の分割比率が動的
に変化する算術符号化によって符号化する符号化手段と
を備えた符号化装置であって、 前記予測値表は、前記周囲複数画素が特定パターンのと
きに予測値が無効であることを示すデータを有し、 該特定パターンのときには前記符号化手段の変数を所定
値に固定して符号化するようにしたことを特徴とする符
号化装置。1. A data supply unit for supplying data to be encoded, and a prediction value storage for storing a prediction value of a pixel to be encoded corresponding to values of a plurality of pixels around the pixel to be encoded as a prediction value table. Means, a prediction error calculation means for calculating a prediction error based on the encoding target pixel supplied from the data supply means and the prediction value output from the prediction value storage means, and the prediction error calculation means A prediction error, a coding device comprising a coding means for coding by arithmetic coding in which the division ratio of the arithmetic code dynamically changes by changing a predetermined variable, the prediction value table, A plurality of surrounding pixels have data indicating that the predicted value is invalid when the pixel has a specific pattern, and when the pixel has the specific pattern, the variable of the encoding means is fixed to a predetermined value for encoding. Encoding apparatus according to claim.
ータ供給手段と、 符号化対象画素の周囲複数画素の値に対応した符号化対
象画素の予測値を予測値表として記憶するとともに、該
周囲複数画素が特定パターンであることを示すデータを
記憶する予測値記憶手段と、 前記データ供給手段から供給された符号化対象画素と前
記予測値記憶手段から出力された予測値に基づいて予測
誤差を算出する予測誤差算出手段と、 前記予測誤差算出手段により算出された予測誤差を符号
化する符号化手段と、 を具備したことを特徴とする符号化装置。2. A data supply means for supplying data to be encoded, a prediction value of a pixel to be coded corresponding to values of a plurality of pixels around the pixel to be coded is stored as a prediction value table, and A prediction value storage unit that stores data indicating that a plurality of surrounding pixels have a specific pattern, a prediction error based on the encoding target pixel supplied from the data supply unit and the prediction value output from the prediction value storage unit An encoding device, comprising: a prediction error calculating unit that calculates the error, and an encoding unit that encodes the prediction error calculated by the prediction error calculating unit.
ンは、前記予測値が当たる確率が小さい画素入力パター
ンであることを特徴とする請求項2記載の符号化装置。3. The encoding device according to claim 2, wherein the specific pattern in the prediction value storage means is a pixel input pattern having a small probability of being hit by the prediction value.
が動的に変化するQコーダを用いたことを特徴とする請
求項1または請求項2記載の符号化装置。4. The coding apparatus according to claim 1, wherein the coding means uses a Q coder in which a division ratio of the arithmetic code dynamically changes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP03244923A JP3127513B2 (en) | 1991-08-29 | 1991-08-29 | Encoding device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP03244923A JP3127513B2 (en) | 1991-08-29 | 1991-08-29 | Encoding device |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH0564008A true JPH0564008A (en) | 1993-03-12 |
JP3127513B2 JP3127513B2 (en) | 2001-01-29 |
Family
ID=17125987
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP03244923A Expired - Fee Related JP3127513B2 (en) | 1991-08-29 | 1991-08-29 | Encoding device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3127513B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6106560B2 (en) * | 2013-09-09 | 2017-04-05 | 株式会社ソニック | Buckwheat hammer and buckwheat hammer |
-
1991
- 1991-08-29 JP JP03244923A patent/JP3127513B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP3127513B2 (en) | 2001-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6549676B1 (en) | Encoding device | |
US5045852A (en) | Dynamic model selection during data compression | |
US6711295B2 (en) | Encoding apparatus and method, and storage medium | |
CN1980393B (en) | Image coding device, method and integrated circuit | |
EP0066697A1 (en) | A method and system for compressing grey scale image data | |
JPH10336682A (en) | Coder, its method and storage medium storing the method | |
JP4717780B2 (en) | Encoding apparatus and control method thereof | |
US6912318B2 (en) | Method and system for compressing motion image information | |
JPH09135358A (en) | Image encoding device using arithmetic code | |
US5668737A (en) | High-speed data processor and coding method | |
JP3457269B2 (en) | Arithmetic encoding / decoding method and arithmetic encoding / decoding device | |
FI97591B (en) | The picture coding | |
EP0719052B1 (en) | Image coding method and apparatus with code amount estimation | |
JP2954438B2 (en) | Encoding device | |
US6631161B1 (en) | Method and system for compressing motion image information | |
JP3127513B2 (en) | Encoding device | |
JPH08204971A (en) | Image compression method using predictive coding and error diffusion | |
JP4415651B2 (en) | Image encoding apparatus and image decoding apparatus | |
JP3139460B2 (en) | Method and apparatus for encoding binary document image | |
JP2872334B2 (en) | Color image encoding device | |
JPH07249995A (en) | Data encoder | |
JP4936574B2 (en) | Encoding apparatus and control method thereof | |
JP3847891B2 (en) | Encoding apparatus and method and storage medium storing method | |
JPH1155531A (en) | Arithmetic coder | |
JPH0645945A (en) | Arithmetic coding method and its decoding method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20071110 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081110 Year of fee payment: 8 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081110 Year of fee payment: 8 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091110 Year of fee payment: 9 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101110 Year of fee payment: 10 |
|
LAPS | Cancellation because of no payment of annual fees |