JPH07222152A - Picture processor and compressed data control method in the picture processor - Google Patents

Picture processor and compressed data control method in the picture processor

Info

Publication number
JPH07222152A
JPH07222152A JP2493894A JP2493894A JPH07222152A JP H07222152 A JPH07222152 A JP H07222152A JP 2493894 A JP2493894 A JP 2493894A JP 2493894 A JP2493894 A JP 2493894A JP H07222152 A JPH07222152 A JP H07222152A
Authority
JP
Japan
Prior art keywords
block
compressed data
data
bits
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.)
Pending
Application number
JP2493894A
Other languages
Japanese (ja)
Inventor
Kazuhiro Yamamoto
和弘 山本
Eiji Yokogawa
英二 横川
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.)
Kokusai Electric Corp
Original Assignee
Kokusai Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kokusai Electric Corp filed Critical Kokusai Electric Corp
Priority to JP2493894A priority Critical patent/JPH07222152A/en
Publication of JPH07222152A publication Critical patent/JPH07222152A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To facilitate the management of a memory for storing compressed data and to save a memory capacity by calculating the bit number of the compressed data to be allocated to one block from a compressed data size set beforehand and performing entropy encoding within the bit number. CONSTITUTION:In an entropy encoder 13, respective group charts and Huffman code tables are used and the encoding-of a DC coefficient and an AC coefficient is allocated to the codes of plural bits. At the time of controlling the compressed data size in a compressed data size control processing means 14, a compression size set beforehand is used, an allocatable bit number is calculated and when the allocatable bit number is exceeded at the time of encoding picture data in the encoder 13, the encoding is stopped and a block completion code is set. Also, when the encoding of one block becomes less than the allocatable bit number, the remaining bit number is allocated to the next block and addition is performed. Constitution is performed in such a manner, the data size set beforehand is utilized at most and the data not exceeding it are prepared.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、JPEG方式の画像圧
縮・伸張を行う画像処理装置に係り、特にハフマン符号
化における圧縮データのデータサイズを制御し、圧縮デ
ータのメモリ管理を容易にしてメモリ容量を節約できる
画像処理装置及びそれにおける圧縮データ制御方法に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus for compressing / decompressing an image in the JPEG system, and particularly controlling the data size of compressed data in Huffman coding to facilitate memory management of the compressed data. BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus capable of saving capacity and a compressed data control method in the image processing apparatus.

【0002】[0002]

【従来の技術】画像圧縮のための符号化及び画像伸張の
ための復号化を行うJPEG(JointPhotographic Expe
rt Group )方式の従来の画像処理装置について図7を
使って説明する。図7は、従来の画像処理装置の構成ブ
ロック図である。
2. Description of the Related Art JPEG (Joint Photographic Expe) for encoding for image compression and decoding for image expansion
A conventional image processing apparatus of the rt group) system will be described with reference to FIG. FIG. 7 is a configuration block diagram of a conventional image processing apparatus.

【0003】従来の画像処理装置は、DCTをベースと
した符号化器1と、DCTをベースとした復号化器2
と、符号化器1側のメモリ(a)5と、復号化器2側の
メモリ(b)7と、メモリ5からメモリ7へ圧縮データ
を伝送する伝送路6と、量子化の際に用いられる量子化
テーブル3と、符号化・復号化の際に用いられる符号化
テーブル4とから構成されている。
A conventional image processing apparatus includes a DCT-based encoder 1 and a DCT-based decoder 2.
A memory (a) 5 on the encoder 1 side, a memory (b) 7 on the decoder 2 side, a transmission line 6 for transmitting compressed data from the memory 5 to the memory 7, and used for quantization. And a coding table 4 used at the time of coding / decoding.

【0004】更に、符号化器1内には、DCT(Discre
te Cosine Transform )演算を行うDCT演算手段11
と、量子化を行う量子化器12と、エントロピー符号化
を行うエントロピー符号化器13とが設けられている。
また、復号化器2内には、圧縮データのエントロピー復
号化を行うエントロピー復号化器23と、逆量子化を行
う量子化器22と、逆DCT(IDCT)演算を行うI
DCT演算手段21とが設けられている。
Further, in the encoder 1, a DCT (Discrete
te Cosine Transform) DCT calculation means 11 for performing calculation
, A quantizer 12 for performing quantization, and an entropy encoder 13 for performing entropy encoding are provided.
In the decoder 2, an entropy decoder 23 that performs entropy decoding of compressed data, a quantizer 22 that performs inverse quantization, and an I DC that performs an inverse DCT (IDCT) operation.
DCT calculation means 21 is provided.

【0005】従来の画像処理装置における動作は、原画
像を入力し、符号化器1内のDCT演算手段11でDC
T演算を行い、量子化器12で量子化テーブル3を用い
て量子化を行い、エントロピー符号化器13で符号化テ
ーブル4を用いてエントロピー符号化を行って、メモリ
5にパラメータと符号データを格納する。そして、伝送
路6を介してメモリ5からメモリ7へパラメータと符号
データが伝送され、メモリ7に格納される。
In the operation of the conventional image processing apparatus, the original image is input, and the DCT calculation means 11 in the encoder 1 performs DC operation.
The T operation is performed, the quantizer 12 performs quantization using the quantization table 3, the entropy encoder 13 performs entropy encoding using the encoding table 4, and the parameters and code data are stored in the memory 5. Store. Then, the parameters and the code data are transmitted from the memory 5 to the memory 7 via the transmission path 6 and stored in the memory 7.

【0006】更に、メモリ7内のパラメータと符号デー
タが復号化器2内に取り込まれ、エントロピー復号化器
23で符号化テーブル4を用いてエントロピー復号化を
行い、復号化されたデータを量子化器22で量子化テー
ブル3を用いて逆量子化を行い、IDCT演算手段21
で逆DCT(IDCT)演算を行って、画像を再生する
ものである(インターフェース「カラー静止画像の国際
標準符号化方式」遠藤俊明著 1991年12月号p1
60〜p182参照)。
Further, the parameters and the coded data in the memory 7 are taken into the decoder 2, and the entropy decoder 23 performs entropy decoding using the coding table 4, and the decoded data is quantized. Dequantization is performed in the device 22 using the quantization table 3, and the IDCT calculation means 21
Inverse DCT (IDCT) operation is performed in order to reproduce an image (Interface "International standard encoding system for color still images" Toshiaki Endo December 1991 p1
60-p182).

【0007】[0007]

【発明が解決しようとする課題】しかしながら、上記従
来のJPEG方式による画像圧縮技術では、画像データ
サイズの制御は一般的に行われておらず、同じ量子化テ
ーブルを使用しても画像の細かさによって圧縮データサ
イズが大きく変動してしまい、指定した圧縮率に圧縮で
きず、よって量子化テーブルは圧縮率のおおよその目安
にしかならず、以下のような問題点があった。
However, in the conventional image compression technique based on the JPEG method, the control of the image data size is not generally performed, and even if the same quantization table is used, the fineness of the image can be reduced. As a result, the compressed data size fluctuates greatly, and the compressed data cannot be compressed to the specified compression ratio. Therefore, the quantization table is only a rough standard of the compression ratio, and there are the following problems.

【0008】つまり、ICメモリカード等に圧縮した画
像データを記録する場合、圧縮データサイズが事前に正
確に見積れないために、1枚の画像の圧縮画像データを
格納するのにかなり余裕を持った領域を確保するか、又
はメモリ領域を節約するために複雑なメモリ管理処理が
必要となっていた。
That is, when compressed image data is recorded on an IC memory card or the like, the compressed data size cannot be accurately estimated in advance, so there is a considerable margin for storing the compressed image data of one image. However, a complicated memory management process is required to secure a large area or save a memory area.

【0009】また、従来技術として、圧縮データサイズ
を制御する方法があるが、その制御方法が、1度画像を
読み込んで細かさを確認した後、細かさに応じて量子化
テーブルを操作してデータサイズを制御するという方法
(デレビジョン学会誌「画像情報工学と放送技術」Vol.
46 No.3 1992,参照)であるため、1回の圧縮処理で2
度画像を読み込まなければならず、圧縮処理速度が遅く
なって圧縮処理に時間がかかってしまい、かつ量子化テ
ーブルを操作するため比較的変化の小さいブロックに関
しても同等に高圧縮がかけられてしまい、圧縮処理効率
が悪いという問題点があった。
As a conventional technique, there is a method of controlling the compressed data size. The control method reads the image once to check the fineness, and then operates the quantization table according to the fineness. Method of controlling data size (Devision Society of Japan "Image Information Engineering and Broadcasting Technology" Vol.
46 No.3 1992, refer to 2) in one compression process.
The image must be read once, the compression processing speed becomes slow and the compression processing takes time, and since the quantization table is manipulated, high compression is similarly applied to blocks with relatively small changes. However, there is a problem that the compression processing efficiency is poor.

【0010】本発明は上記実情に鑑みて為されたもの
で、指定した圧縮率(データサイズ)以下にデータサイ
ズを制御し、また、圧縮データを格納するメモリの管理
を容易にし、メモリ容量を節約し、更に、1度の画像読
み込みのみで符号化を行い、標準的なJPEG方式にお
ける圧縮処理速度と変わらない処理速度、並びに標準的
なJPEG方式における圧縮処理に近い画質を実現でき
る画像処理装置及びそれにおける圧縮データ制御方法を
提供することを目的とする。
The present invention has been made in view of the above circumstances, and controls the data size to a specified compression rate (data size) or less, and facilitates the management of the memory for storing the compressed data to reduce the memory capacity. An image processing apparatus that can save the cost and that can perform the encoding only by reading the image once to realize a processing speed that is the same as the compression processing speed in the standard JPEG method and an image quality close to the compression processing in the standard JPEG method. And a compressed data control method therefor.

【0011】[0011]

【課題を解決するための手段】上記従来例の問題点を解
決するための請求項1記載の発明は、画像処理装置にお
いて、入力された画像情報をブロック単位にDCT変換
を行い、量子化テーブルを用いて量子化を行い、符号化
テーブルを用いてエントロピー符号化を行って画像デー
タの圧縮が為される画像処理装置において、予め設定し
た圧縮データのサイズから1ブロックに割り当てられる
圧縮データのビット数を算出し、前記1ブロックに割り
当てられる圧縮データのビット数以内でエントロピー符
号化を行う圧縮データサイズ制御処理手段を設けたこと
を特徴としている。
According to a first aspect of the present invention for solving the problems of the conventional example, an image processing apparatus performs DCT conversion on input image information in block units, and a quantization table. In the image processing device in which the image data is compressed by performing the quantization with the use of the encoding table and the entropy coding with the use of the encoding table, the bits of the compressed data assigned to one block from the preset size of the compressed data. A compressed data size control processing means for calculating the number and performing entropy coding within the number of bits of the compressed data assigned to the one block is provided.

【0012】上記従来例の問題点を解決するための請求
項2記載の発明は、請求項1記載の画像処理装置におけ
る圧縮データ制御方法において、量子化されたデータを
符号化テーブルを用いてブロック毎にエントロピー符号
化して行く際に、算出された1ブロックに割り当てられ
る圧縮データのビット数を超える場合には、前記1ブロ
ックに割り当てられる圧縮データのビット数を超えるデ
ータ以降のデータについてのエントロピー符号化を止
め、ブロックの終了を示す終了符号を付加することを特
徴としている。
According to a second aspect of the present invention for solving the problems of the conventional example, in the compressed data control method in the image processing apparatus according to the first aspect, the quantized data is blocked using an encoding table. When the number of bits of the compressed data allocated to one block exceeds the calculated entropy code for each entropy coding, the entropy code for the data after the data exceeding the number of bits of the compressed data allocated to the one block It is characterized by stopping conversion and adding an end code indicating the end of the block.

【0013】上記従来例の問題点を解決するための請求
項3記載の発明は、請求項2記載の画像処理装置におけ
る圧縮データ制御方法において、1ブロックに割り当て
られる圧縮データのビット数を超えるデータ以降のデー
タについてエントロピー符号化を止めた場合で、前記1
ブロックに割り当てられる圧縮データのビット数に対し
て実際にエントロピー符号化された圧縮データのビット
数が小さくて余りのビット数が生じた時には、該余った
ビット数を次のブロックの1ブロックに割り当てられる
圧縮データのビット数に加算することを特徴としてい
る。
According to a third aspect of the present invention for solving the problem of the conventional example, in the compressed data control method for an image processing apparatus according to the second aspect, data exceeding the number of bits of compressed data assigned to one block is used. If entropy coding is stopped for the following data,
When the number of bits of compressed data that is actually entropy-coded is smaller than the number of bits of compressed data assigned to a block and a surplus bit number occurs, the surplus bit number is assigned to one block of the next block. It is characterized in that it is added to the number of bits of compressed data to be compressed.

【0014】[0014]

【作用】請求項1記載の発明によれば、予め設定した圧
縮データサイズから1ブロックに割り当てられる圧縮デ
ータのビット数を算出し、そのビット数以内でエントロ
ピー符号化を行う圧縮データサイズ制御処理手段を設け
た画像処理装置としているので、設定した圧縮率(デー
タサイズ)以下にデータを圧縮することができ、圧縮デ
ータを格納するメモリの管理を容易にし、メモリ容量を
節約できる。
According to the invention described in claim 1, the compressed data size control processing means for calculating the number of bits of the compressed data assigned to one block from the preset compressed data size and performing entropy coding within the number of bits. Since the image processing apparatus is provided with, the data can be compressed to a compression rate (data size) or less that is set, the management of the memory storing the compressed data is facilitated, and the memory capacity can be saved.

【0015】請求項2記載の発明によれば、ブロック毎
にエントロピー符号化していく過程で、算出された1ブ
ロックに割り当てられる圧縮データのビット数を越える
場合に、越える分のデータ以降についてエントロピー符
号化を止め、ブロックの終了を示す終了符号を付加する
請求項1記載の画像処理装置の圧縮データ制御方法とし
ているので、設定した圧縮率(データサイズ)以下にデ
ータを圧縮することができ、圧縮データを格納するメモ
リの管理を容易にし、メモリ容量を節約できる。
According to the second aspect of the present invention, in the process of entropy-encoding each block, if the calculated bit number of compressed data assigned to one block exceeds the entropy code, the entropy code is added for the excess data. The compression data control method of the image processing apparatus according to claim 1, wherein the end of the block is stopped and an end code indicating the end of the block is added, the data can be compressed to a compression rate (data size) or less that is set. The memory for storing data can be easily managed and the memory capacity can be saved.

【0016】請求項3記載の発明によれば、1ブロック
に割り当てられる圧縮データのビット数に対して実際に
エントロピー符号化された圧縮データのビット数が小さ
くて、余りのビット数が生じた時に、余ったビット数を
次のブロックの1ブロックに割り当てられる圧縮データ
のビット数に加算する請求項2記載の画像処理装置の圧
縮データ制御方法としているので、設定した圧縮率(デ
ータサイズ)以下にデータを圧縮することができ、更に
1画像を格納する為のメモリ容量を最大限に利用し圧縮
データを格納するメモリの管理を容易にし、メモリ容量
を節約できる。
According to the third aspect of the present invention, when the bit number of the compressed data actually entropy-coded is smaller than the bit number of the compressed data assigned to one block and a surplus bit number occurs, 3. The compressed data control method for an image processing apparatus according to claim 2, wherein the surplus number of bits is added to the number of bits of compressed data assigned to one block of the next block. The data can be compressed, the memory capacity for storing one image can be utilized to the maximum, the management of the memory for storing the compressed data can be facilitated, and the memory capacity can be saved.

【0017】[0017]

【実施例】本発明の一実施例について図面を参照しなが
ら説明する。図1は、本発明の一実施例に係る画像処理
装置の構成ブロック図である。尚、図7と同様の構成を
とる部分については同一の符号を付して説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a configuration block diagram of an image processing apparatus according to an embodiment of the present invention. It should be noted that portions having the same configuration as in FIG.

【0018】本実施例の画像処理装置は、図1に示すよ
うに、従来の画像処理装置と比べて、符号化器1内に、
エントロピー符号化器13とメモリ(a)5との間に圧
縮データサイズ制御処理手段14を設けたことが特徴で
ある。その他の構成部分は、従来の画像処理装置とほぼ
同様であり、また、その各部の処理動作も前述したイン
ターフェース「カラー静止画像の国際標準符号化方式」
に具体的に記載されている。
As shown in FIG. 1, the image processing apparatus according to the present embodiment is different from the conventional image processing apparatus in the encoder 1 in that
The feature is that the compressed data size control processing means 14 is provided between the entropy encoder 13 and the memory (a) 5. The other components are almost the same as those of the conventional image processing apparatus, and the processing operation of each unit is the interface "International standard encoding system for color still images" described above.
It is specifically described in.

【0019】本実施例の圧縮データサイズ制御処理手段
14での処理の前段階について簡単に説明すると、例え
ば、原画像を8×8画素毎のブロック単位で読み込み、
8×8画素の原画像データを8×8の平均値(DC成
分)と平均値との差分(AC成分)の8×8の行列に変
換するDCT変換をDCT演算手段11で行い、DCT
変換されたデータと量子化テーブル3の値で割り算を行
い、差分の小さなデータ、高周波成分データを0にし、
圧縮率を制御する量子化を量子化器12で行う。尚、こ
の0の数を多くすればするほど圧縮率は高くなるもので
ある。
To briefly explain the previous stage of the processing in the compressed data size control processing means 14 of the present embodiment, for example, the original image is read in block units of 8 × 8 pixels,
The DCT calculation means 11 performs a DCT conversion for converting the original image data of 8 × 8 pixels into an 8 × 8 matrix of an 8 × 8 average value (DC component) and a difference (AC component) between the average value and
The converted data and the value of the quantization table 3 are divided, and the data with a small difference and the high frequency component data are set to 0,
The quantizer 12 performs the quantization for controlling the compression rate. The compression rate increases as the number of 0s increases.

【0020】次に、エントロピー符号化器13におい
て、前述したインターフェース「カラー静止画像の国際
標準符号化方式」のp167〜のハフマン符号化に記載
されているように、DC係数及びAC係数の符号化を各
々のグループ表とハフマン符号テーブルを用いて複数ビ
ットの符号に割り当てるハフマン符号化を行う。
Next, in the entropy encoder 13, as described in the Huffman coding of p167 to p167 of the above-mentioned "International Standard Coding Method for Color Still Image", coding of DC coefficient and AC coefficient is performed. Is assigned to a code of a plurality of bits by using each group table and Huffman code table.

【0021】そして、本実施例の圧縮データサイズ制御
処理手段14における圧縮データサイズ制御の処理概要
は、予め設定した圧縮データサイズから、1ブロック
(8×8画素[ピクセル])に割り当て可能なビット数
を算出しておき、エントロピー符号化器13において画
像データの符号化を行う時に、割り当てビット数を越え
る場合は符号化を止め、EOB(End Of Block)のブロ
ック終了符号をセットするものである。また、1ブロッ
クの符号化が割り当てビット数以下で終わった場合は、
余ったビット数を次のブロックの割り当てビット数に加
算してゆくようにしている。
The processing outline of the compressed data size control in the compressed data size control processing means 14 of this embodiment is as follows: bits that can be assigned to one block (8 × 8 pixels [pixels]) from the preset compressed data size. When the number of bits is calculated and the image data is encoded by the entropy encoder 13, if the number of allocated bits is exceeded, the encoding is stopped and the block end code of EOB (End Of Block) is set. . Also, if the encoding of one block ends with the number of allocated bits or less,
The number of surplus bits is added to the number of allocated bits of the next block.

【0022】この結果、予め設定したデータサイズを最
大限に利用し、それを越えない圧縮画像データを作成す
ることができる。
As a result, it is possible to make maximum use of the preset data size and create compressed image data that does not exceed that size.

【0023】ここで、1ブロックに割当可能なビット数
を60ビットとすると、1ブロックの符号化データが6
0ビットを越えてしまう場合(細かい画像の場合)はデ
ータが失われてしまうが、失われるデータは比較的高周
波成分のデータで、1ブロックの画像に与える影響は少
ないものと考えられる。また、1ブロックの符号化デー
タが60ビット以下の場合(平淡な画像の場合)は1ブ
ロック全てが符号化され、データが失われることはな
い。
Here, assuming that the number of bits that can be assigned to one block is 60 bits, the encoded data of one block is 6
When the number of bits exceeds 0 bit (in the case of a fine image), the data is lost, but the lost data is relatively high frequency component data, and it is considered that the influence on the image of one block is small. Further, when the encoded data of one block is 60 bits or less (in the case of a flat image), the entire one block is encoded and the data is not lost.

【0024】次に、本実施例の画像処理装置における圧
縮データ制御方法を説明する前に、正規のハフマン符号
化について、図2、図3を用いて簡単に説明する。図2
は、1ブロックの量子化データの例を示す説明図であ
り、図3は、図2の量子化データを従来の正規のハフマ
ン符号化方法で符号化した結果を示す説明図である。
尚、図2において量子化データのDC成分値”2”は、
前のブロックのDC成分値との差分を示している。
Before describing the compressed data control method in the image processing apparatus of this embodiment, the normal Huffman coding will be briefly described with reference to FIGS. 2 and 3. Figure 2
FIG. 3 is an explanatory diagram showing an example of one block of quantized data, and FIG. 3 is an explanatory diagram showing a result of encoding the quantized data of FIG. 2 by a conventional regular Huffman encoding method.
In addition, in FIG. 2, the DC component value “2” of the quantized data is
The difference from the DC component value of the previous block is shown.

【0025】前述したインターフェース「カラー静止画
像の国際標準符号化方式」のp167〜のハフマン符号
化に記載されているように、DC係数及びAC係数の符
号化を各々のグループ表とハフマン符号テーブルを用い
て複数ビットの符号に割り当てるハフマン符号化方法
で、図2に示す1ブロックの量子化データをDC成分
値”2”からジグザグ・スキャンしながらAC成分値”
25”,”−6”,”−1”,”16”,・・・,”
1”,”−2”,”0”,”4”までを順次符号化し、
残りのAC成分値がすべて”0”となった時にEOB符
号を書き込んで、図3に示すような符号データを作成す
ることになる。
As described in the Huffman coding of p167 to p167 of the above-mentioned interface "International standard coding method for color still image", coding of the DC coefficient and the AC coefficient is performed by using the respective group table and Huffman code table. Using the Huffman coding method for allocating to a code of a plurality of bits, the quantized data of one block shown in FIG. 2 is zigzag-scanned from the DC component value "2" and the AC component value "
25 ","-6 ","-1 "," 16 ", ...,"
1 "," -2 "," 0 ", and" 4 "are sequentially encoded,
When all the remaining AC component values become "0", the EOB code is written to create code data as shown in FIG.

【0026】次に、本実施例の画像処理装置における圧
縮データ制御方法について、図2、図4を用いて簡単に
説明する。図4は、図2の量子化データを本実施例の圧
縮データ制御方法を用いて符号化した結果を示す説明図
である。尚、図4では1ブロックの割り当てビット数を
60ビットとして符号化した場合の例を示している。
Next, a compressed data control method in the image processing apparatus of this embodiment will be briefly described with reference to FIGS. FIG. 4 is an explanatory diagram showing the result of encoding the quantized data of FIG. 2 using the compressed data control method of this embodiment. It should be noted that FIG. 4 shows an example in which the number of allocated bits of one block is encoded as 60 bits.

【0027】本実施例の画像処理装置における圧縮デー
タ制御方法では、正規のハフマン符号化方法と同様に、
図2に示す1ブロックの量子化データをDC成分値”
2”からジグザグ・スキャンしながらAC成分値”2
5”,”−6”,”−1”,”16”,・・・を順次符
号化し、その都度符号データ長の累積と割り当てビット
数(60ビット)とを比較し、60ビット以下の場合は
符号データをメモリ5に格納して行く。但し、実際は最
後にEOB符号を書き込まなければならばないので、割
り当てビット数からEOB符号分を差し引いた値で比較
していく。図4の例では、AC成分値”1”までは60
ビット以下である)。
In the compressed data control method in the image processing apparatus of this embodiment, as in the regular Huffman coding method,
The quantized data of one block shown in FIG.
AC component value "2 while zigzag scanning from 2"
5 "," -6 "," -1 "," 16 ", ... are sequentially encoded, and the accumulated code data length and the number of allocated bits (60 bits) are compared each time. Stores the code data in the memory 5. However, since the EOB code has to be written at the end, the comparison is made with the value obtained by subtracting the EOB code from the number of allocated bits. , AC component value up to "1" is 60
Less than a bit).

【0028】そして,60ビットを越えてしまう時点
(図4の例では、AC成分値”−2”を符号化した時)
で符号化を中止し、EOB符号を書き込み、図4に示す
ような符号データを作成することになる。尚、余った3
ビットは次のブロックの1ブロックの割り当てビット数
に加算されるようになっている。
Then, when it exceeds 60 bits (in the example of FIG. 4, when the AC component value "-2" is encoded).
Then, the coding is stopped, the EOB code is written, and code data as shown in FIG. 4 is created. In addition, the remaining 3
The bit is added to the number of allocated bits of one block of the next block.

【0029】次に、本実施例の画像処理装置における圧
縮データ制御方法を実現する処理動作について、圧縮デ
ータサイズ制御処理手段14を中心に、図5及び図6を
用いて説明する。図5及び図6は、本実施例の圧縮デー
タ制御方法における1ブロックのデータ圧縮処理動作を
示すフローチャート図である。尚、図5,6において、
1ブロックの残りビット数をカウントするために1ブロ
ックビットカウンターを使用する。つまり、本実施例の
圧縮データサイズ制御処理手段14内には、1ブロック
ビットカウンターが設けられている。
Next, a processing operation for realizing the compressed data control method in the image processing apparatus of this embodiment will be described with reference to FIGS. 5 and 6 centering on the compressed data size control processing means 14. 5 and 6 are flowcharts showing the data compression processing operation of one block in the compressed data control method of this embodiment. In addition, in FIGS.
A 1-block bit counter is used to count the number of remaining bits in 1 block. That is, a 1-block bit counter is provided in the compressed data size control processing means 14 of this embodiment.

【0030】本実施例の圧縮データ制御方法における1
ブロックのデータ圧縮処理動作は、図5に示すように、
まず、初期処理として、原画像データサイズを圧縮率で
割って圧縮画像のデータサイズを算出し(100)、間
引き比から1画面の総ブロック数を算出し(102)、
圧縮画像データサイズを1画面総ブロック数で割って1
ブロックの割り当てビット数(1ブロックビット数)を
算出し(104)、1ブロックの残りビット数をカウン
トする1ブロックビットカウンターに1ブロックビット
数をセットする(106)。尚、間引き比については、
前述のインターフェース「カラー静止画像の国際標準符
号化方式」に具体的に記載されている。
1 in the compressed data control method of this embodiment
As shown in FIG. 5, the data compression processing operation of the block is as follows.
First, as an initial process, the data size of the compressed image is calculated by dividing the original image data size by the compression rate (100), and the total number of blocks in one screen is calculated from the thinning ratio (102).
Divide the compressed image data size by the total number of blocks on one screen to obtain 1
The number of allocated bits (the number of 1 block bits) of the block is calculated (104), and the number of 1 block bits is set in a 1 block bit counter that counts the number of remaining bits of 1 block (106). Regarding the thinning ratio,
It is specifically described in the above-mentioned interface "International standard encoding system for color still image".

【0031】次に、ブロック単位の処理として、DCT
変換を行い(110)、量子化を行い(120)、輝度
データか色差データかによって輝度データであればEO
Bビット数を4(”1010”)とし(132)、色差
データであればEOBビット数を2(”00”)とする
(134)。尚、DCT変換及び量子化技術は従来のも
のと同様である。
Next, as the processing in block units, DCT
Transform is performed (110), quantization is performed (120), and if the data is luminance data, EO if it is luminance data.
The number of B bits is set to 4 (“1010”) (132), and for color difference data, the number of EOB bits is set to 2 (“00”) (134). The DCT transform and quantization techniques are the same as conventional ones.

【0032】次に、正規ハフマン符号化と同様の方法で
符号化を行い(140)、そして本実施例の特徴部分で
ある圧縮データサイズ制御処理手段14の動作として、
1ブロックビットカウンターの値とEOBビット数とを
比較し(150)、1ブロックビットカウンターの値の
方が大きい場合は、ハフマン符号化データビット数と
(1ブロックビットカウンターの値−EOBビット数)
とを比較する(152)。
Next, encoding is performed by the same method as the normal Huffman encoding (140), and the operation of the compressed data size control processing means 14, which is a characteristic part of this embodiment, is as follows.
The 1-block bit counter value and the EOB bit number are compared (150), and if the 1-block bit counter value is larger, the Huffman-encoded data bit number and (1 block bit counter value-EOB bit number)
And are compared (152).

【0033】そして、ハフマン符号化データビット数の
方が小さいか、又は同じ場合は、ハフマン符号化データ
の内容が”FFh(11111111)”であるか判断
し(160)、”FFh”である場合は、ハフマン符号
化データビット数に8を加え(162)、ハフマン符号
化データビット数と(1ブロックビットカウンターの値
−EOBビット数)とを比較する(164)。
If the number of Huffman-encoded data bits is smaller or the same, it is judged whether the content of the Huffman-encoded data is "FFh (11111111)" (160), and if "FFh". Adds 8 to the number of Huffman-encoded data bits (162), and compares the number of Huffman-encoded data bits with (the value of one block bit counter-the number of EOB bits) (164).

【0034】尚、処理160〜処理164の処理は、正
規のハフマン符号化において符号化データが”FFh”
であった場合は、その直後に必ず”00h(00000
000)”の8ビットを付加しなければならないという
規則に基づく処理である。
In the processings 160 to 164, the coded data is "FFh" in the regular Huffman coding.
If it is, immediately after that "00h (000000
000) ”must be added. This is a process based on the rule that 8 bits must be added.

【0035】処理160において、ハフマン符号化デー
タの内容が”FFh”でない場合、及び処理164にお
いてハフマン符号化データビット数の方が小さいか、又
は同じ場合は、ハフマン符号化データを書き込む(17
0)。但し、ハフマン符号化データの内容が”FFh”
である場合は、ハフマン符号化データと”00h”を書
き込むものである。
If the content of the Huffman-encoded data is not "FFh" in the process 160, and if the number of Huffman-encoded data bits is smaller or the same in the process 164, the Huffman-encoded data is written (17).
0). However, the content of Huffman encoded data is "FFh".
If it is, Huffman coded data and "00h" are written.

【0036】そして、1ブロックビットカウンターから
ハフマン符号化データビット数を引算し(172)、1
ブロックの処理が終了していない場合は、処理140に
戻り、1ブロックの処理が終了した場合は、1ブロック
ビットカウンターに1ブロックビット数を加算する(1
90)。これにより、余ったビットを次のブロックの1
ブロックの割り当てビット数に加算する処理を行い、1
ブロックのデータ圧縮処理を終了する。
Then, the number of Huffman-encoded data bits is subtracted from the 1-block bit counter (172), 1
If the processing of the block is not completed, the processing returns to processing 140, and if the processing of one block is completed, the number of 1 block bits is added to the 1 block bit counter (1
90). As a result, the remaining bits are set to 1 in the next block.
Perform the process of adding to the number of allocated bits of the block, and
The block data compression process ends.

【0037】尚、処理150において、1ブロックビッ
トカウンターの値の方がEOBビット数より小さいか、
又は同じ場合と、処理152において、ハフマン符号化
データビット数の方が(1ブロックビットカウンターの
値−EOBビット数)より大きい場合と、処理164に
おいて、ハフマン符号化データビット数の方が(1ブロ
ックビットカウンターの値−EOBビット数)より大き
い場合は、符号化処理を中止してEOBを書き込み(1
80)、1ブロックビットカウンターからEOBビット
数を引算し(182)、処理190に移る。
In the process 150, whether the value of the 1-block bit counter is smaller than the EOB bit number,
Alternatively, in the same case, in the process 152, the number of Huffman-encoded data bits is larger than (value of 1 block bit counter−EOB bit number), and in process 164, the number of Huffman-encoded data bits is (1 If it is larger than the value of the block bit counter-the number of EOB bits), the encoding process is stopped and EOB is written (1
80) Subtract the number of EOB bits from the 1-block bit counter (182), and move to the processing 190.

【0038】本実施例の画像処理装置及びそれにおける
圧縮データ制御方法によれば、予め設定した圧縮データ
サイズから、1ブロックに割り当て可能なビット数を算
出しておき、エントロピー符号化器13において画像デ
ータの符号化を行う時に、割り当てビット数を超える場
合に、超える分のデータ以降について符号化を止めてブ
ロック終了符号のEOBを付加し、また1ブロックの符
号化が割り当てビット数以下で終わった場合は、余った
ビット数を次のブロックの割り当てビット数に加算して
ゆくものであるので、予め設定したデータサイズを最大
限に利用し、それを超えない圧縮画像データを作成する
ことができ、その結果、圧縮画像データをメモリに保存
する場合のメモリ管理が容易になり、メモリ容量を節約
することができる効果がある。
According to the image processing apparatus and the compressed data control method therefor of the present embodiment, the number of bits that can be assigned to one block is calculated from the preset compressed data size, and the image is encoded by the entropy encoder 13. When the number of allocated bits exceeds the number of allocated bits when encoding the data, the encoding is stopped for the excess data and the block end code EOB is added, and the encoding of one block ends with the number of allocated bits or less. In this case, the number of surplus bits is added to the number of allocated bits of the next block, so it is possible to make maximum use of the preset data size and create compressed image data that does not exceed it. As a result, memory management becomes easier when saving compressed image data in memory, and memory capacity can be saved. There is a result.

【0039】更に、本実施例の画像処理装置及びそれに
おける圧縮データ制御方法によれば、エントロピー符号
化器13において画像データの符号化を行う時に、指定
した圧縮率(データサイズ)以下にデータサイズを制御
でき、また、1度の画像読み込みのみで符号化を行い、
標準的なJPEG方式における圧縮処理速度と変わらな
い処理速度で画像データの圧縮を実現できる効果があ
る。
Further, according to the image processing apparatus of this embodiment and the compressed data control method therefor, when the entropy encoder 13 encodes the image data, the data size is not more than the specified compression rate (data size). Can be controlled, and encoding is performed only by reading the image once.
There is an effect that image data can be compressed at a processing speed that is the same as the compression processing speed in the standard JPEG system.

【0040】また、本実施例の画像処理装置及びそれに
おける圧縮データ制御方法を使用すれば、事前に使用す
る最大のメモリ容量を計算することができるため、無駄
なメモリを実装する必要がなく、画像処理装置のコスト
を削減することができる効果がある。また、複雑なメモ
リ管理機能を持たなくて済む。
Further, by using the image processing apparatus of this embodiment and the compressed data control method in the image processing apparatus, it is possible to calculate the maximum memory capacity to be used in advance, so that it is not necessary to mount an unnecessary memory. There is an effect that the cost of the image processing apparatus can be reduced. Moreover, it is not necessary to have a complicated memory management function.

【0041】更に、本実施例の画像処理装置及びそれに
おける圧縮データ制御方法によれば、予め算出した1ブ
ロックに割り当て可能なビット数の範囲内では、従来と
同様の符号化技術を用いた符号化を行い、残りの部分は
すべて値”0”としたことになるので、他のJPEG方
式のファイルとの互換性を保つことができ、標準的なJ
PEG方式における圧縮処理に近い画質を実現できる効
果がある。
Further, according to the image processing apparatus of this embodiment and the compressed data control method in the image processing apparatus, within the range of the number of bits that can be assigned to one block calculated in advance, the code using the same coding technique as the conventional one is used. Since all of the remaining parts are set to "0", compatibility with other JPEG format files can be maintained, and standard J
There is an effect that an image quality similar to the compression processing in the PEG system can be realized.

【0042】[0042]

【発明の効果】請求項1記載の発明によれば、予め設定
した圧縮データサイズから1ブロックに割り当てられる
圧縮データのビット数を算出し、そのビット数以内でエ
ントロピー符号化を行う圧縮データサイズ制御処理手段
を設けた画像処理装置としているので、設定した圧縮率
(データサイズ)以下にデータを圧縮することができ、
圧縮データを格納するメモリの管理を容易にし、メモリ
容量を節約できる効果がある。
According to the first aspect of the present invention, the compressed data size control is performed in which the number of bits of compressed data assigned to one block is calculated from the preset compressed data size, and entropy coding is performed within the number of bits. Since the image processing apparatus is provided with the processing means, it is possible to compress the data at a compression rate (data size) or less that is set,
This has the effect of facilitating the management of the memory that stores compressed data and saving the memory capacity.

【0043】請求項2記載の発明によれば、ブロック毎
にエントロピー符号化していく過程で、算出された1ブ
ロックに割り当てられる圧縮データのビット数を越える
場合に、越える分のデータ以降についてエントロピー符
号化を止め、ブロックの終了を示す終了符号を付加する
請求項1記載の画像処理装置の圧縮データ制御方法とし
ているので、設定した圧縮率(データサイズ)以下にデ
ータを圧縮することができ、圧縮データを格納するメモ
リの管理を容易にし、メモリ容量を節約できる効果があ
る。
According to the second aspect of the present invention, in the process of entropy coding for each block, if the calculated bit number of compressed data assigned to one block exceeds the entropy code, the entropy code is added to the excess data. The compression data control method of the image processing apparatus according to claim 1, wherein the end of the block is stopped and an end code indicating the end of the block is added, the data can be compressed to a compression rate (data size) or less that is set. This has the effect of facilitating the management of the memory that stores data and saving the memory capacity.

【0044】請求項3記載の発明によれば、1ブロック
に割り当てられる圧縮データのビット数に対して実際に
エントロピー符号化された圧縮データのビット数が小さ
くて、余りのビット数が生じた時に、余ったビット数を
次のブロックの1ブロックに割り当てられる圧縮データ
のビット数に加算する請求項2記載の画像処理装置の圧
縮データ制御方法としているので、設定した圧縮率(デ
ータサイズ)以下にデータを圧縮することができ、更に
1画像を格納する為のメモリ容量を最大限に利用し圧縮
データを格納するメモリの管理を容易にし、メモリ容量
を節約できる効果がある。
According to the third aspect of the present invention, when the bit number of the compressed data actually entropy-coded is smaller than the bit number of the compressed data assigned to one block and a surplus bit number occurs, 3. The compressed data control method for an image processing apparatus according to claim 2, wherein the surplus number of bits is added to the number of bits of compressed data assigned to one block of the next block. There is an effect that the data can be compressed, the memory capacity for storing one image is utilized to the maximum, the management of the memory for storing the compressed data is facilitated, and the memory capacity can be saved.

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

【図1】本発明の一実施例に係る画像処理装置の構成ブ
ロック図である。
FIG. 1 is a configuration block diagram of an image processing apparatus according to an embodiment of the present invention.

【図2】1ブロックの量子化データの例を示す説明図で
ある。
FIG. 2 is an explanatory diagram showing an example of quantized data of one block.

【図3】図2の量子化データを従来の正規のハフマン符
号化方法で符号化した結果を示す説明図である。
FIG. 3 is an explanatory diagram showing a result of encoding the quantized data of FIG. 2 by a conventional regular Huffman encoding method.

【図4】図2の量子化データを本実施例の圧縮データ制
御方法を用いて符号化した結果を示す説明図である。
FIG. 4 is an explanatory diagram showing a result of encoding the quantized data of FIG. 2 using the compressed data control method of the present embodiment.

【図5】本実施例の圧縮データ制御方法における1ブロ
ックのデータ圧縮処理動作を示すフローチャート図であ
る。
FIG. 5 is a flowchart showing a data compression processing operation of one block in the compressed data control method of the present embodiment.

【図6】本実施例の圧縮データ制御方法における1ブロ
ックのデータ圧縮処理動作を示すフローチャート図であ
る。
FIG. 6 is a flowchart showing a data compression processing operation of one block in the compressed data control method of the present embodiment.

【図7】従来の画像処理装置の構成ブロック図である。FIG. 7 is a configuration block diagram of a conventional image processing apparatus.

【符号の説明】[Explanation of symbols]

1…符号化器、 2…復号化器、 3…量子化テーブ
ル、 4…符号化テーブル、 5…メモリ(a)、 6
…伝送路、 7…メモリ(b)、 11…DCT演算手
段、 12、22…量子化器、 13…エントロピー符
号化器、 14…圧縮データサイズ制御処理手段、 2
1…IDCT演算手段、 23…エントロピー復号化器
DESCRIPTION OF SYMBOLS 1 ... Encoder, 2 ... Decoder, 3 ... Quantization table, 4 ... Encoding table, 5 ... Memory (a), 6
... Transmission path, 7 ... Memory (b), 11 ... DCT computing means, 12,22 Quantizer, 13 ... Entropy encoder, 14 ... Compressed data size control processing means, 2
1 ... IDCT calculation means, 23 ... Entropy decoder

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 入力された画像情報をブロック単位にD
CT変換を行い、量子化テーブルを用いて量子化を行
い、符号化テーブルを用いてエントロピー符号化を行っ
て画像データの圧縮が為される画像処理装置において、
予め設定した圧縮データのサイズから1ブロックに割り
当てられる圧縮データのビット数を算出し、前記1ブロ
ックに割り当てられる圧縮データのビット数以内でエン
トロピー符号化を行う圧縮データサイズ制御処理手段を
設けたことを特徴とする画像処理装置。
1. The input image information is D in block units.
In an image processing apparatus in which CT conversion is performed, quantization is performed using a quantization table, and entropy encoding is performed using an encoding table to compress image data,
A compressed data size control processing means for calculating the number of bits of compressed data assigned to one block from the preset size of compressed data and performing entropy coding within the number of bits of compressed data assigned to the one block is provided. An image processing device characterized by:
【請求項2】 量子化されたデータを符号化テーブルを
用いてブロック毎にエントロピー符号化して行く際に、
算出された1ブロックに割り当てられる圧縮データのビ
ット数を超える場合には、前記1ブロックに割り当てら
れる圧縮データのビット数を超えるデータ以降のデータ
についてのエントロピー符号化を止め、ブロックの終了
を示す終了符号を付加することを特徴とする請求項1記
載の画像処理装置における圧縮データ制御方法。
2. When entropy-encoding the quantized data for each block using an encoding table,
If the calculated number of bits of compressed data assigned to one block exceeds the number of bits of compressed data assigned to the one block, entropy coding is stopped for data after the data that exceeds the number of bits of compressed data assigned to the one block, and an end indicating the end of the block is finished. The compressed data control method in an image processing apparatus according to claim 1, wherein a code is added.
【請求項3】 1ブロックに割り当てられる圧縮データ
のビット数を超えるデータ以降のデータについてエント
ロピー符号化を止めた場合で、前記1ブロックに割り当
てられる圧縮データのビット数に対して実際にエントロ
ピー符号化された圧縮データのビット数が小さくて余り
のビット数が生じた時には、該余ったビット数を次のブ
ロックの1ブロックに割り当てられる圧縮データのビッ
ト数に加算することを特徴とする請求項2記載の画像処
理装置における圧縮データ制御方法。
3. When entropy coding is stopped for data after the data exceeding the number of bits of compressed data assigned to one block, entropy coding is actually performed for the number of bits of compressed data assigned to said one block. 3. When the number of bits of the compressed data that has been generated is small and a surplus number of bits is generated, the number of surplus bits is added to the number of bits of the compressed data that is assigned to one block of the next block. A method for controlling compressed data in the image processing apparatus described.
JP2493894A 1994-01-28 1994-01-28 Picture processor and compressed data control method in the picture processor Pending JPH07222152A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2493894A JPH07222152A (en) 1994-01-28 1994-01-28 Picture processor and compressed data control method in the picture processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2493894A JPH07222152A (en) 1994-01-28 1994-01-28 Picture processor and compressed data control method in the picture processor

Publications (1)

Publication Number Publication Date
JPH07222152A true JPH07222152A (en) 1995-08-18

Family

ID=12152004

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2493894A Pending JPH07222152A (en) 1994-01-28 1994-01-28 Picture processor and compressed data control method in the picture processor

Country Status (1)

Country Link
JP (1) JPH07222152A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8229235B2 (en) 2005-10-06 2012-07-24 Samsung Electronics Co., Ltd. Hybrid image data processing system and method
CN108989800A (en) * 2017-06-03 2018-12-11 上海天荷电子信息有限公司 The data compression method and device of compressed data byte stream are generated using byte as unit

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8229235B2 (en) 2005-10-06 2012-07-24 Samsung Electronics Co., Ltd. Hybrid image data processing system and method
CN108989800A (en) * 2017-06-03 2018-12-11 上海天荷电子信息有限公司 The data compression method and device of compressed data byte stream are generated using byte as unit
CN108989800B (en) * 2017-06-03 2024-01-09 上海天荷电子信息有限公司 Data compression method and apparatus for generating a compressed data byte stream in byte units

Similar Documents

Publication Publication Date Title
US5677689A (en) Fixed rate JPEG compliant still image compression
US6233359B1 (en) File size bounded JPEG transcoder (FSBJT)
US6330369B1 (en) Method and apparatus for limiting data rate and image quality loss in lossy compression of sequences of digital images
JPH05316360A (en) Coding/decoding device for picture signal
US6968088B2 (en) Modification of detected quantization step size from the encoded bitstream based on a region of interest (ROI) bitmask
JPH0832037B2 (en) Image data compression device
JPH0487460A (en) Picture processor
JPH07222152A (en) Picture processor and compressed data control method in the picture processor
JP2915922B2 (en) Image signal compression coding device
JPH05227519A (en) Encoder and decoder for picture data
JPH05176171A (en) Method and device for compressing picture data
JP2993212B2 (en) How to combine images
JP3230336B2 (en) Recompression device and recompression system
JPH0575867A (en) Image data coder
JP2931328B2 (en) Image signal compression coding device
JPH0548914A (en) Image data coder
JPH089373A (en) Picture compression device
JP3001758B2 (en) Huffman encoding device and Huffman encoding method
JPH03238970A (en) Conversion coding system
JP3200073B2 (en) Image processing device
JPH0746407A (en) Picture data compressing device and picture data restoring device
JPH04343578A (en) Image compressing/coding device
JPH029271A (en) Compression rate conversion method for picture data
JPH0730889A (en) Picture data encoder
JPH07184202A (en) Picture data coder