JPH03250865A - Compression data quantity control system - Google Patents

Compression data quantity control system

Info

Publication number
JPH03250865A
JPH03250865A JP2045677A JP4567790A JPH03250865A JP H03250865 A JPH03250865 A JP H03250865A JP 2045677 A JP2045677 A JP 2045677A JP 4567790 A JP4567790 A JP 4567790A JP H03250865 A JPH03250865 A JP H03250865A
Authority
JP
Japan
Prior art keywords
block
data
amount
value
quantization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2045677A
Other languages
Japanese (ja)
Inventor
Hirofumi Sakagami
弘文 阪上
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2045677A priority Critical patent/JPH03250865A/en
Publication of JPH03250865A publication Critical patent/JPH03250865A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】 (産業上の利用分野] この発明は静止画像データを可変長符号によって圧縮し
て伝送または記録する際に、圧縮後のデータ量が要求さ
れるデータ量となるように制御する圧縮データ量制御方
式に関する。
[Detailed Description of the Invention] (Industrial Application Field) This invention provides a method for compressing still image data using a variable length code and transmitting or recording the data so that the amount of data after compression becomes the required amount of data. This invention relates to a method for controlling the amount of compressed data to be controlled.

〔従来の技術〕[Conventional technology]

自然画符号化方式の標準化を図るために“Ba5eli
ne System″や“Extended Syst
em”等の各種国際標準化方式が提案されている。
In order to standardize the natural image encoding method, “Ba5eli
ne System” or “Extended System”
Various international standardization methods such as "em" have been proposed.

第7図は国際標準化方式のうちの“Ba5elineS
ys tem”の処理手順を示す概略図である。このシ
ステムは一枚の入力画像を1ブロック8×8画素の複数
ブロックに分割し、各ブロック毎に2次元の離散コサイ
ン変換(D CT : Discrete CoCo5
1neTransforを行い(処理P1)、得られる
DCT係数に8×8個の閾値からなる量子化マトリクス
の各閾値を除算することで量子化を行う(処理P2)。
Figure 7 shows “Ba5elineS”, one of the international standardization methods.
This system divides one input image into multiple blocks of 8×8 pixels, and performs two-dimensional discrete cosine transformation (DCT) on each block. CoCo5
1neTransform is performed (processing P1), and quantization is performed by dividing the obtained DCT coefficient by each threshold of a quantization matrix consisting of 8×8 thresholds (processing P2).

第8図および第9図は輝度信号用および色差信号用の量
子化マトリクスの例である。
FIGS. 8 and 9 are examples of quantization matrices for luminance signals and color difference signals.

量子化したDCT係数のうち直流(DC)成分は前のブ
ロックで量子化したDC成分と差分を取り、その差分の
ビット数をハフマン符号化する。
The difference between the direct current (DC) component of the quantized DCT coefficient and the DC component quantized in the previous block is taken, and the number of bits of the difference is Huffman encoded.

交流(AC)成分はブロック内でジグザグスキャンを行
って一次元の数列に変換し、有効係数のビット数と連続
する零(無効係数)の個数とで2次元のハフマン符号化
を行う(処理P3およびP4)。
The alternating current (AC) component is converted into a one-dimensional sequence by performing zigzag scanning within the block, and then subjected to two-dimensional Huffman encoding using the number of bits of effective coefficients and the number of consecutive zeros (invalid coefficients) (Process P3 and P4).

第10図にジグザグスキャンのテーブルの例を示す。FIG. 10 shows an example of a zigzag scan table.

なお、処理P2における量子化のときに、量子化マトリ
クスの各閾値に対しである係数(スケールファクタ)を
乗算したのちDCT係数の除算を行う。圧縮画像の画質
および圧縮率はこのスケールファクタによって調整され
る。
Note that during quantization in process P2, each threshold value of the quantization matrix is multiplied by a certain coefficient (scale factor), and then the DCT coefficient is divided. The image quality and compression rate of the compressed image are adjusted by this scale factor.

こうして圧縮したデータは、処理P1〜P4と逆の処理
によって伸張する。すなわち、処理P5におけるハフマ
ン復号化、処理P6におけるDC成分およびAC成分の
復号化、処理P7における逆量子化および処理P8にお
ける逆DCT(IDCT)である。
The data compressed in this way is decompressed by the reverse process of processes P1 to P4. That is, Huffman decoding in process P5, decoding of DC and AC components in process P6, inverse quantization in process P7, and inverse DCT (IDCT) in process P8.

〔発明が解決しようとする課題] ところで、前述のシステムでは可変長符号であるハフマ
ン符号を用いてデータ圧縮を行っているため、圧縮後の
全データ量は圧縮工程(処理P1〜P4)が終了するま
で知ることが出来ない。このため、予め設定したデータ
量の範囲内で符号化を行う必要がある場合は、何らかの
データ量の制御が必要となる。
[Problems to be Solved by the Invention] By the way, in the above-mentioned system, data compression is performed using a Huffman code, which is a variable length code, so the total amount of data after compression is the same as that at the end of the compression process (processes P1 to P4). You won't know until you do. Therefore, if it is necessary to perform encoding within a preset data amount range, some kind of data amount control is required.

この発明は圧縮後のデータ量が要求されるデータ量とな
るように制御することの出来る圧縮データ量制御方式を
提供することを目的とする。
An object of the present invention is to provide a compressed data amount control method that can control the amount of data after compression to be the required amount of data.

〔課題を解決するための手段〕[Means to solve the problem]

この発明は、一枚のディジタル画像を、1ブロックn×
n画素からなる複数のブロックに分割し、各ブロック毎
に離散コサイン変換を行い、変換して得られるn×n個
の変換係数を、n×n個の閾値からなる量子化マトリク
スの各閾値で除算して量子化を行い、離散コサイン変換
後または量子化後の変換係数を、直流成分から高周波成
分に向かって一定の順序で一次元の数列に変換し、変換
して得られる数列中の連続する零の個数を符号化するデ
ータ圧縮方式であって、一次元の数列ap(p=0.1
.・・・、n”−1)に対し特定の値kを設定し、数列
apの中で「k≦P≦n 2− I Jなる条件を満た
す係数apを零とした後、連続する零の個数を符号化し
てデータ圧縮を行うと共に、離散コサイン変換係数のA
C成分の2乗和の累積分布を各ブロック毎に求め、この
累積分布から所望の圧縮データ量に比例換算した関数G
を決定し、この関数Gと実際の圧縮データ量の累積値■
とをブロック毎に比較し、累積値■が関数Gに追随する
ように変数にの値をブロック毎に調整して圧縮後のデー
タ量が所望のデータ量となるように制御するものである
In this invention, one digital image is divided into one block n×
Divide into multiple blocks each consisting of n pixels, perform discrete cosine transformation for each block, and apply the resulting n×n transform coefficients to each threshold of a quantization matrix consisting of n×n thresholds. Perform division and quantization, convert the transform coefficients after discrete cosine transform or quantization into a one-dimensional sequence in a fixed order from the DC component to the high frequency component, and then convert the resulting sequence into a one-dimensional sequence. This is a data compression method that encodes the number of zeros in a one-dimensional sequence ap (p=0.1
.. ..., n''-1), set the coefficient ap that satisfies the condition ``k≦P≦n2-IJ'' in the sequence ap to zero, and then In addition to encoding the number of data and compressing the data, A of the discrete cosine transform coefficient
The cumulative distribution of the sum of the squares of the C component is determined for each block, and the function G is proportionally converted to the desired amount of compressed data from this cumulative distribution.
Determine this function G and the cumulative value of the actual compressed data amount■
is compared for each block, and the value of the variable is adjusted for each block so that the cumulative value ■ follows the function G, thereby controlling the amount of data after compression to be the desired amount of data.

〔作 用] この発明において、変数にのブロック毎の調整は次のよ
うにして行う。まず、ブロック5(s=12、・・・、
T)毎に離散コサイン変換係数F uvのAC成分の2
乗和す、を求める。次いで、このAC成分の2乗和の全
ブロックについて累積分布Bsを求め、さらに累積分布
B3の最大値B↑が圧縮後の所望のデータ量に対応する
ように比例換算したデータ量関数G、を次式で求める。
[Operation] In this invention, the adjustment of variables for each block is performed as follows. First, block 5 (s=12,...
2 of the AC component of the discrete cosine transform coefficient F uv for each T)
Find the sum of the products. Next, calculate the cumulative distribution Bs for all blocks of the sum of squares of the AC components, and then calculate the data amount function G, which is proportionally converted so that the maximum value B↑ of the cumulative distribution B3 corresponds to the desired data amount after compression. Calculate using the following formula.

こうして求めたデータ量関数G、と実際の圧縮データ量
の累積値■3とをブロック毎に比較し、G、<V、なら
ば変数kから調整値Δkを引いた値を次ブロックの変数
にとし、V、<G、ならば変数kに調整値Δkを加えた
値を次ブロックの変数にとし、V s =G sならば
そのままとする。
The data amount function G obtained in this way is compared with the cumulative value ■3 of the actual compressed data amount for each block, and if G<V, the value obtained by subtracting the adjustment value Δk from the variable k is used as the variable for the next block. If V<G, the value obtained by adding the adjustment value Δk to the variable k is set as the variable of the next block, and if V s =G s, it is left as is.

このようにしてブロック毎に変数にの値を設定し、量子
化後の変換係数の一次元の数列ap中の「k≦p≦n!
1.なる関係を満たす係数apを零にして、圧縮データ
量累積値■3を関数G、に追随させる。
In this way, the value of the variable is set for each block, and the value of "k≦p≦n!" in the one-dimensional sequence ap of the transform coefficient after quantization is set.
1. The coefficient ap that satisfies the following relationship is set to zero, and the compressed data amount cumulative value 3 is made to follow the function G.

[実施例] 第1図はこの発明による圧縮データ量制御方式の処理手
順の一実施例を示す概略図で、第7図と同一部分には同
一符号を付して説明する。
[Embodiment] FIG. 1 is a schematic diagram showing an embodiment of the processing procedure of the compressed data amount control method according to the present invention, and the same parts as in FIG. 7 are given the same reference numerals and will be described.

まず、入力画像データを水平および垂直方向に1ブロッ
クn×n画素、例えば8×8画素からなる複数pxq個
のブロックに分割し、各ブロック毎に2次元の離散コサ
イン変換(DCT)を施す(処理PL)。
First, input image data is divided horizontally and vertically into a block of n×n pixels, for example, a plurality of p×q blocks each consisting of 8×8 pixels, and a two-dimensional discrete cosine transform (DCT) is applied to each block ( Processing PL).

DCTは周波数領域における直交変換の一種で、変換係
数をFuv(u、v=o、1.−、n−1)、1ブロッ
ク分の入力画像データをf 47(i、j=0.I、・
−、n−1) とすると、 但し、G=1/72  (w=o) =1   (W≠0) で定義される。得られる変換係数F uvは1ブロック
分の入力画像データを空間周波数に分解した成分を示す
DCT is a type of orthogonal transformation in the frequency domain, where the transform coefficients are Fuv (u, v=o, 1.-, n-1), and the input image data for one block is f47 (i, j=0.I,・
-, n-1), where G=1/72 (w=o) =1 (W≠0). The obtained transformation coefficient F uv indicates a component obtained by decomposing one block of input image data into spatial frequencies.

変換係数F uvにおいて、係数F0゜は入力画像デー
タf ijのn×n画素の平均値に比例した値(DC成
分)を示し、u、vが大きくなるにつれて空間周波数の
高い成分(AC成分)を表す。
In the conversion coefficient F uv, the coefficient F0° indicates a value (DC component) proportional to the average value of n×n pixels of the input image data f ij, and as u and v become larger, the component with a higher spatial frequency (AC component) represents.

二のようにして得られるDCT係数F uvは一画面毎
にメモリに記憶される(処理P10)。記憶された係数
F uvはブロック毎に次式で表されるAC成分の2乗
和b s (s=1,2.−、pXq)が取られる(処
理pH)。
The DCT coefficients F uv obtained as in step 2 are stored in the memory for each screen (process P10). The stored coefficient F uv is the sum of squares of AC components b s (s=1, 2.-, pXq) expressed by the following equation for each block (processing pH).

次いで、一画面の全ブロックについて各ブロック毎に次
式で表される2乗和す、の累積分布Bsを求め(処理P
12)、 さらに、累積分布B、の最大値、すなわちAC成分の2
乗和す、の全ブロックについての総和B7(T=pXq
)が圧縮後の所定のデータ量に対応するように比例換算
したデータ量関数G、を求める(処理P13)。
Next, for all blocks on one screen, the cumulative distribution Bs of the sum of squares expressed by the following formula is determined for each block (processing P
12), Furthermore, the maximum value of the cumulative distribution B, that is, the AC component 2
B7 (T=pXq
) is proportionally converted so that it corresponds to a predetermined data amount after compression (process P13).

第2図に2乗和す5、累積分布B、およびデータ量関数
G、の一例を示す。
FIG. 2 shows an example of the sum of squares 5, the cumulative distribution B, and the data amount function G.

メモリに記憶された一画面分のDCT係数は、ブロック
毎に読み出されてn×n個の閾値からなる量子化マトリ
クスの各閾値にスケールファクタを乗算した値で除算さ
れ、量子化される(処理P2)。スケールファクタによ
る乗算処理は量子化マトリクスの各閾値にビットシフト
を施すことによって行う。
The DCT coefficients for one screen stored in the memory are read out block by block, divided by the value obtained by multiplying each threshold value of a quantization matrix consisting of n×n threshold values by a scale factor, and quantized ( Processing P2). Multiplication processing using a scale factor is performed by bit-shifting each threshold value of the quantization matrix.

次いで、DC成分については前のブロックで量子化した
成分と差分を取り(処理P30)、差分のビット数をハ
フマン符号化する(処理P4)。
Next, for the DC component, a difference is taken from the component quantized in the previous block (processing P30), and the number of bits of the difference is Huffman encoded (processing P4).

AC成分については、第10図に示す順序でジグザグス
キャンを行い一次元の数列ap(p=1+2+・・・、
63)に変換する(処理P31)。第3図に量子化後の
DCT係数のマトリクスを示し、第4図(a)にジグザ
グスキャン後の一次元数列apを示す。
For the AC component, zigzag scanning is performed in the order shown in Figure 10, and a one-dimensional sequence ap (p=1+2+...,
63) (processing P31). FIG. 3 shows a matrix of DCT coefficients after quantization, and FIG. 4(a) shows a one-dimensional sequence ap after zigzag scanning.

次に、この数列apに対し「k≦p≦63」なる関係を
満たす係数a9を零とする処理を行う(処理P32)。
Next, a process is performed for this sequence ap in which a coefficient a9 that satisfies the relationship "k≦p≦63" is set to zero (process P32).

第4図(b)はrk=8Jとした例を示す。FIG. 4(b) shows an example in which rk=8J.

第3図および第4図から明らかように、処理P32は数
列apのに番目以降の高周波成分を零にする処理で、一
種のローパスフィルタ処理に相当する。
As is clear from FIGS. 3 and 4, the process P32 is a process for zeroing out the high frequency components after the second in the sequence ap, and corresponds to a type of low-pass filter process.

従って、kの値を変化させることによって連続する零の
個数を変化させることができ、圧縮後のデータ量、すな
わち圧縮率を調整することが出来る。
Therefore, by changing the value of k, the number of consecutive zeros can be changed, and the amount of data after compression, that is, the compression ratio can be adjusted.

次いで、連続する零の個数をランレングス符号化しく処
理P33)、このランレングス符号化した連続する零の
個数データと有効係数のビット数とで2次元のハフマン
符号化を行う(処理P4)。
Next, the number of consecutive zeros is run-length encoded (process P33), and two-dimensional Huffman encoding is performed using the run-length encoded data on the number of consecutive zeros and the number of bits of the effective coefficient (process P4).

ハフマン符号化はDC成分およびAC成分共に量子化し
た係数値そのものを使用せず、その値を表現するのに必
要なビット数をハフマン符号化する。
Huffman encoding does not use the quantized coefficient values themselves for both DC and AC components, but performs Huffman encoding on the number of bits necessary to express the values.

そしてハフマン符号とは別にそのビット数の値を付加情
報として付は加える。例えば、量子化した係数が2(1
0進数)とした場合、2進数で表現すると“000・・
・010 ”となるが、これを表現するのに必要なビッ
ト数2をこの値を代表する値としてハフマン符号化し、
2ビツトのデータ“10”を付加ビットとして付加する
In addition to the Huffman code, the value of the number of bits is added as additional information. For example, if the quantized coefficient is 2(1
0 base), if expressed in binary, it would be “000...
・010'', but the number of bits required to express this, 2, is Huffman encoded as a value that represents this value,
Add 2-bit data "10" as an additional bit.

他方、量子化した係数が負の場合は付加ビットから1を
引いたデータを付加する。例えば、量子化した係数が−
2(10進数)であるとすると、2進数(2の補数表示
)で表現すると“′111・・・110”となり、下2
ビットが付加ビットとなるが、“10”から「1」を引
いた“01”を付加ビットとして付加する。こうするこ
とにより、量子化した係数が正のときは付加ピントが1
で始まり、負であれば0で始まることになり、正負の判
別が容易に行える。
On the other hand, if the quantized coefficient is negative, data obtained by subtracting 1 from the additional bit is added. For example, if the quantized coefficient is −
2 (decimal number), when expressed in binary number (2's complement representation), it becomes "'111...110", and the lower 2
The bit becomes an additional bit, and "01", which is obtained by subtracting "1" from "10", is added as an additional bit. By doing this, when the quantized coefficient is positive, the additional focus is 1.
If it is negative, it starts with 0, making it easy to distinguish between positive and negative.

続いて、圧縮した1ブロック分の画像データの圧縮後の
データ量を計数しく処理P14)、その累積データ量V
、と処理P13で求めたデータ量関数G、とを比較しく
処理P15)、ローパスフィルタ処理における変数にの
調整を行う(処理P16)。
Next, the amount of compressed image data of one block of compressed image data is counted and processed P14), and the cumulative amount of data V is calculated.
, and the data amount function G obtained in process P13 are compared (process P15), and the variables in the low-pass filter process are adjusted (process P16).

すなわち、G3 <V、ならば変数kを「k−Δk」と
して連続する零データの個数を増加させ、圧縮後のデー
タ量が減少するようにし、逆に■。
That is, if G3<V, the variable k is set to "k-Δk" to increase the number of consecutive zero data, and the amount of data after compression is decreased, and vice versa.

<G、ならば変数kを「k+Δk」として連続する零デ
ータの個数を減少させ、圧縮後のデータ量が増加するよ
うにし、Vs”Osならばそのままとして次ブロックの
データ圧縮処理を行う。
If <G, then the variable k is set to "k+Δk" to reduce the number of consecutive zero data and increase the amount of data after compression; if Vs''Os, leave it as is and perform data compression processing for the next block.

この一連の処理は全ブロックについて繰す返され、第5
図に示すように、圧縮後の累積データ量■、がデータ量
関数G、に追随しながら所望のデータ量となるようにブ
ロック毎に変数kを制御する。
This series of processing is repeated for all blocks, and the fifth
As shown in the figure, the variable k is controlled for each block so that the cumulative data amount after compression, ■, follows the data amount function G, and becomes the desired data amount.

圧縮データを伸張するには、従来どおりのデータ伸張処
理を行えばよい。すなわち、まずハフマン復号化を行い
(処理P5)、DC成分に関しては差分復号化、AC成
分についてはランレングス復号化を行った後、ジグザグ
スキャンの順序にデータを並べ替えて1ブロック分の変
換係数を得(処理P6)、この変換係数に量子化マトリ
クスの各閾値にスケールファクタを乗算した値を乗算し
て逆量子化を行い(処理P7)、さらに逆離散コサイン
変換(I D CT)を行って(処理P8)、伸張処理
を終了する。この場合、データ伸張時に使用した変数に
はデータ伸張時には不要となるので、従来の方式による
伸張処理が行える。
To decompress compressed data, conventional data decompression processing may be performed. That is, first Huffman decoding is performed (processing P5), differential decoding is performed for the DC component, and run-length decoding is performed for the AC component, and then the data is rearranged in the order of zigzag scan to obtain the transform coefficients for one block. (processing P6), inverse quantization is performed by multiplying this transform coefficient by the value obtained by multiplying each threshold value of the quantization matrix by the scale factor (processing P7), and further, inverse discrete cosine transform (ID CT) is performed. (process P8), and the decompression process ends. In this case, the variables used at the time of data expansion are no longer needed at the time of data expansion, so that the conventional method can be used for expansion processing.

次に、第6図のフローチャートを参照しながらデータ圧
縮処理の動作について詳説する。
Next, the operation of the data compression process will be explained in detail with reference to the flowchart of FIG.

まず、システムの初期設定を行う(ステップS1)。す
なわち、AC成分の2乗和す5.2乗和す、の累積分布
B5.2乗和す、の全ブロックについての総和Brおよ
びデータ量関数G、の各値をそれぞれリセットし、さら
にブロック番号Sの値を初期値「1」に設定する。
First, initial settings of the system are performed (step S1). That is, each value of the total sum Br and the data amount function G for all blocks of the cumulative distribution B5. Set the value of S to the initial value "1".

次いで、最初の1ブロック分の画像データを入力しくス
テップS2)、DCTを行う(ステップ33)。DCT
によって得た変換係数F uVは一旦メモリにストアす
る(ステップS4)。次いで、当該ブロックのAC成分
の2乗和す、を演算しくステップS5)、その累積分布
B、を求める(ステップS6)。今の場合、最初のブロ
ック(S=1)の処理中であるので、Bs =btとな
る。
Next, the first block of image data is input (step S2), and DCT is performed (step 33). DCT
The conversion coefficient F uV obtained by is temporarily stored in memory (step S4). Next, the sum of the squares of the AC components of the block is calculated (step S5), and its cumulative distribution B is obtained (step S6). In this case, since the first block (S=1) is being processed, Bs = bt.

続いて、全ブロックについて処理したか否か判定する(
ステップ37)。今の場合、まだ全ブロックの処理を終
了していないので、ブロック番号Sに「1」を加え(ス
テップS8)、次のブロックの画像データを入力しくス
テップS2)、前述のステップS3〜S7の処理を繰り
返す。
Next, determine whether all blocks have been processed (
Step 37). In this case, since the processing of all blocks has not yet been completed, "1" is added to the block number S (step S8), the image data of the next block is input (step S2), and the steps S3 to S7 described above are performed. Repeat the process.

全ブロックの処理が終了すると、ブロック番号Sを変数
とするデータ量関数G、を求め(ステップS9)、次い
でローパスフィルタ処理の変数にとして初期値koを設
定しくステップ510)、メモリにストアした一画面分
のDCT係数から最初のブロックのDCT係数を読み出
して量子化を行う(ステップ511)。
When all blocks have been processed, a data amount function G is calculated using the block number S as a variable (step S9), and an initial value ko is set as a variable for low-pass filter processing (step 510). The DCT coefficients of the first block are read out from the DCT coefficients of the screen and quantized (step 511).

量子化後の係数がDC成分であれば(ステップ5L2)
、前のブロックで量子化したDC成分と差分を取り差分
値を符号化する(ステップ513)。
If the coefficient after quantization is a DC component (step 5L2)
, and the DC component quantized in the previous block, and the difference value is encoded (step 513).

量子化後の係数がAC成分であれば(ステップ512)
、ジグザグスキャンを行って一次元の数列apに変換し
くステップ514)、この数列apのに番目以降の高周
波成分を零にするローパスフィルタ処理を行い(ステッ
プ315)、連続する零の個数を圧縮するランレングス
符号化を行う(ステップ516)。
If the coefficient after quantization is an AC component (step 512)
, a zigzag scan is performed to convert it into a one-dimensional number sequence ap (step 514), and a low-pass filter process is performed to zero out the high frequency components after the number sequence ap of this number sequence ap (step 315) to compress the number of consecutive zeros. Run-length encoding is performed (step 516).

次いで、DC成分については符号化した差分値をハフマ
ン符号化し、AC成分についてはランレングス符号化し
た連続する零の個数データと有効係数のビット数とで2
次元のハフマン符号化を行う(ステップ517)。
Next, for the DC component, the encoded difference value is Huffman encoded, and for the AC component, the run length encoded data on the number of consecutive zeros and the number of bits of the effective coefficient are
Huffman encoding of the dimensions is performed (step 517).

次いで、全ブロックについて処理したか否が判定しくス
テップ318)、全ブロックについての処理が終了して
いれば圧縮処理を終了する。今の場合、最初のブロック
を処理したのみであるから、圧縮後の累積データ量■s
を求める処理(ステップ519)に移行する。そして、
求めた累積データ量■sとステップS9で求めたデータ
量関数G。
Next, it is determined whether all blocks have been processed (step 318), and if all blocks have been processed, the compression process is ended. In this case, only the first block has been processed, so the cumulative amount of data after compression is
The process proceeds to step 519. and,
The obtained cumulative data amount ■s and the data amount function G obtained in step S9.

とを比較しくステップ520) 、cs <v、ならば
変数kを「k−Δk」として連続する零データの個数を
多くシ(ステップ521) 、Vs <Gsならば変数
kを「k+Δk」として連続する零データの個数を少な
くシ(ステップ522) 、v、=c。
(step 520), if cs < v, set variable k to "k-Δk" and increase the number of consecutive zero data (step 521); if Vs < Gs, set variable k to "k+Δk" and increase the number of consecutive zero data (step 521). Reduce the number of zero data (step 522), v,=c.

ならばそのままの値で次ブロックのデータ圧縮処理(ス
テップ311−317)を行う。
If so, data compression processing for the next block (steps 311-317) is performed using the same values.

このようにして、ブロック毎に変数にの値を調整しなが
らデータ圧縮を行い、第5図に示すように、累積データ
量■、がデータ量関数G、に追随するように制御して圧
縮後のデータ量が所望のデータ量となるようにする。
In this way, data compression is performed while adjusting the values of variables for each block, and as shown in Figure 5, after compression, the cumulative data amount ■, is controlled to follow the data amount function G, so that the amount of data becomes the desired amount of data.

なお、変数にの変化量Δkとして一定の値を用いるので
はなく、例えば、 Δk=a (Vs  Gs )   (a :定数)と
すれば、データ量関数Gsと実際のデータ量■。
Note that instead of using a constant value as the amount of change Δk in a variable, for example, if Δk=a (Vs Gs ) (a: constant), the data amount function Gs and the actual data amount ■.

との誤差をフィードバックすることになり、追随性能が
より向上する。
This will feed back the error between the two, further improving the tracking performance.

また、この実施例では、データ圧縮処理中のローパスフ
ィルタ処理(処理P32)を、量子化処理(処理P2)
の後に行うようにしたが、量子化処理の前に行うように
してもよい。
In addition, in this embodiment, the low-pass filter processing (processing P32) during the data compression processing is replaced by the quantization processing (processing P2).
Although this is performed after the quantization process, it may also be performed before the quantization process.

〔発明の効果] この発明によれば、2次元DCT係数のマトリクスを、
直流成分から高周波成分に向かって一定の順序で一次元
の数列に変換し、任意のに番目以降の高周波成分のDC
T係数を零にすることでデータ量を調整する方法を用い
、画像の各ブロック毎に圧縮後のデータ量を前もって定
めてデータ量関数を決定し、この決定したデータ量関数
と実際に圧縮して得られるブロック毎の累積データ量と
を比較し、実際の圧縮データ量がデータ量関数に追随す
るように変数にの値をブロック毎に変化させながらデー
タ圧縮を行っていくので、圧縮後のデータ量を所望のデ
ータ量に制御することが可能となる。
[Effect of the invention] According to this invention, a matrix of two-dimensional DCT coefficients is
Convert the DC component to a one-dimensional sequence in a fixed order from the DC component to the high frequency component, and calculate the DC of the high frequency component after the arbitrary number.
Using a method of adjusting the amount of data by setting the T coefficient to zero, the amount of data after compression is determined in advance for each block of the image, a data amount function is determined, and this determined data amount function is used to adjust the amount of data when actually compressed. Data compression is performed while changing the value of the variable for each block so that the actual compressed data amount follows the data amount function. It becomes possible to control the amount of data to a desired amount of data.

また、データ量関数を定めるときに、各ブロックのDC
T係数のAC成分の2乗和を基本にしているので、画像
信号の変化の激しい部分には多くのデータ量を割り当て
、変化の緩やかな部分には少ないデータ量を割り当てる
ことかでき、画像内容に応じた自然な圧縮が行える。
Also, when determining the data amount function, the DC of each block
Since it is based on the sum of the squares of the AC components of the T coefficient, it is possible to allocate a large amount of data to areas where the image signal changes rapidly, and a small amount of data to areas where the change is gradual. Natural compression can be performed according to the situation.

さらに、データ圧縮時に使用する変数にはデータ伸張時
には不要であるので、データ伸張は従来方式との互換性
が維持できる。
Furthermore, since variables used during data compression are not required during data expansion, data expansion can maintain compatibility with conventional methods.

また、変数kを変化させるときに一定の変化幅ではなく
、実際の圧縮データ量とデータ量関数との誤差に応した
値で変化させれば、実際の圧縮データ量のデータ量関数
への追随性能がさらに向上する。
In addition, if the variable k is changed not by a fixed range of change but by a value corresponding to the error between the actual compressed data amount and the data amount function, the actual compressed data amount can follow the data amount function. Performance is further improved.

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

第1図はこの発明による圧縮データ量制御方式の処理手
順の一実施例を示す図、 第2図(a) 、 (b) 、 (C)はAC成分の2
乗和bs、累積分布BS!データ量関数G、の−例を示
す図、 第3図は量子化後のDCT係数を示すマトリクス表、 第4図はDCT係数を一次元の数列に変換した表、 第5図はデータ量関数と実際のデータ量との関係を示す
図、 第6図は第1図のデータ圧縮動作を説明するためのフロ
ーチャート、 第7図は従来の圧縮・伸張処理の処理手順を示す図、 第8図は輝度信号の量子化マトリクスを示す表、第9図
は色差信号の量子化マトリクスを示す表、第10図はジ
グザグスキャンのテーブルを示す表である。 図 (a) (b) (0 図 ブロック番号 p^q
FIG. 1 is a diagram showing an embodiment of the processing procedure of the compressed data amount control method according to the present invention, and FIG.
Sum of powers bs, cumulative distribution bs! Figure 3 is a matrix table showing DCT coefficients after quantization; Figure 4 is a table in which DCT coefficients are converted into a one-dimensional sequence; Figure 5 is a data volume function. Fig. 6 is a flowchart for explaining the data compression operation of Fig. 1, Fig. 7 is a diagram showing the processing procedure of conventional compression/expansion processing, Fig. 8 9 is a table showing the quantization matrix of the luminance signal, FIG. 9 is a table showing the quantization matrix of the color difference signal, and FIG. 10 is a table showing the zigzag scan table. Figure (a) (b) (0 Figure block number p^q

Claims (2)

【特許請求の範囲】[Claims] (1)一枚のディジタル画像を、1ブロックn×n画素
からなる複数のブロックに分割し、各ブロック毎に離散
コサイン変換を行い、変換して得られるn×n個の変換
係数を、n×n個の閾値からなる量子化マトリクスの各
閾値で除算して量子化を行い、上記離散コサイン変換後
または上記量子化後の変換係数を、直流成分から高周波
成分に向かって一定の順序で一次元の数列に変換し、変
換して得られる数列中の連続する零の個数を符号化する
データ圧縮方式であって、上記一次元の数列a_p(p
=0,1,・・・,n^2−1)に対し特定の値kを設
定し、上記数列a_pの中の「k≦p≦n^2−1」な
る条件を満たす係数a_pを零とした後、連続する零の
個数を符号化してデータ圧縮を行うと共に、上記離散コ
サイン変換係数のAC成分の2乗和の累積分布を各ブロ
ック毎に求め、この累積分布から所望の圧縮データ量に
比例換算した関数Gを決定し、この関数Gと実際の圧縮
データ量の累積値Vとを上記ブロック毎に比較し、上記
累積値Vが上記関数Gに追随するように上記変数kの値
を上記ブロック毎に調整することを特徴とする圧縮デー
タ量制御方式。
(1) Divide one digital image into multiple blocks each block consisting of n×n pixels, perform discrete cosine transformation for each block, and convert the resulting n×n transform coefficients into n Quantization is performed by dividing by each threshold of a quantization matrix consisting of x n thresholds, and the transform coefficients after the above discrete cosine transform or after the above quantization are linearly arranged in a fixed order from the DC component to the high frequency component. A data compression method that converts the one-dimensional number sequence a_p(p
= 0, 1, ..., n^2-1), and set the coefficient a_p that satisfies the condition "k≦p≦n^2-1" in the above sequence a_p to zero. After that, data compression is performed by encoding the number of consecutive zeros, and the cumulative distribution of the sum of squares of the AC components of the above-mentioned discrete cosine transform coefficients is obtained for each block, and from this cumulative distribution, the desired amount of compressed data is determined. A function G proportionally converted to is determined, and this function G and the cumulative value V of the actual compressed data amount are compared for each block, and the value of the variable k is determined so that the cumulative value V follows the function G. A compressed data amount control method characterized in that the amount of compressed data is adjusted for each block.
(2)上記変数kの上記ブロック毎の調整値Δkを、Δ
k=a(V−G)(a:定数)で定義することを特徴と
する請求項1記載の圧縮データ量制御方式。
(2) Let the adjustment value Δk of the variable k for each block be Δ
2. The compressed data amount control method according to claim 1, wherein k=a(V-G) (a: constant).
JP2045677A 1990-02-28 1990-02-28 Compression data quantity control system Pending JPH03250865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2045677A JPH03250865A (en) 1990-02-28 1990-02-28 Compression data quantity control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2045677A JPH03250865A (en) 1990-02-28 1990-02-28 Compression data quantity control system

Publications (1)

Publication Number Publication Date
JPH03250865A true JPH03250865A (en) 1991-11-08

Family

ID=12726021

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2045677A Pending JPH03250865A (en) 1990-02-28 1990-02-28 Compression data quantity control system

Country Status (1)

Country Link
JP (1) JPH03250865A (en)

Similar Documents

Publication Publication Date Title
JPH02305182A (en) Picture signal compressing and encoding device
JP2003032677A (en) Video compression encoding device
JPH0418857A (en) Picture data compression system
JP4274234B2 (en) Compressed data amount control method and image data compression apparatus
CN117354545B (en) Video image wavelet transform high-frequency coefficients are divided into blocks and encoded according to limited size.
JPH03250865A (en) Compression data quantity control system
JP3017510B2 (en) Compressed data amount control method
JP2552350B2 (en) Image signal compression coding device
JPH03229570A (en) Compressed data amount control method
JP2915922B2 (en) Image signal compression coding device
JP2843397B2 (en) Compressed data amount control method
JPH03256453A (en) Compressed data amount control system
JP3016805B2 (en) Image data compression method
JPH03224363A (en) Compressed data quantity control system
JPH03213059A (en) Image data compression method
JP2633118B2 (en) Image data compression apparatus and method
JPH03256452A (en) Picture data processing system
JPH03252284A (en) Data compressor
JP2946833B2 (en) Quantization method in image coding
JPH03192878A (en) Image data compression device
JPH03256454A (en) Image data processing method
JPH04144489A (en) Image data recording method
JPH03181230A (en) Image processing method
JPH06105297A (en) Encoder
JPH04208775A (en) Bit distribution encoding system