JPH04207352A - Encoding device and encoding method for image data - Google Patents

Encoding device and encoding method for image data

Info

Publication number
JPH04207352A
JPH04207352A JP2325688A JP32568890A JPH04207352A JP H04207352 A JPH04207352 A JP H04207352A JP 2325688 A JP2325688 A JP 2325688A JP 32568890 A JP32568890 A JP 32568890A JP H04207352 A JPH04207352 A JP H04207352A
Authority
JP
Japan
Prior art keywords
block
code amount
amount
code
color component
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
JP2325688A
Other languages
Japanese (ja)
Inventor
Chihiro Nakagawa
千尋 中川
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.)
Olympus Corp
Original Assignee
Olympus Optical 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 Olympus Optical Co Ltd filed Critical Olympus Optical Co Ltd
Priority to JP2325688A priority Critical patent/JPH04207352A/en
Publication of JPH04207352A publication Critical patent/JPH04207352A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

PURPOSE:To facilitate coding in such a manner that a code quantity is confined within the specified code quantity within the specified processing time without impairing image quality by providing code quantity calculating means, reference code determining means, code quantity allotting means, and variable length encoding discontinuing means for respective blocks. CONSTITUTION:The statistical processing to obtain the code quantity for each of the respective blocks is executed by quantization 6 at an initially provisionally determined quantization width 12 and variable length encoding 8. The code quantity for each of the respective blocks determined by this statistical processing, the optimum quantization width 12 suitable from the target value of the total code quantity per image, and the allotted code quantity 20 for each of the respective blocks are then determined. The code quantity of each block by each color component is calculated in the variable length encoding calculating means 14. The target value of the total code quantity is proportionally distributed and the reference code quantity of each block by each color component is determined in the determining means 20. The allotting means 20 discontinues the variable length encoding so as not to exceed the allotted code quantity at the time of encoding processing. The encoding processing is so executed that the code quantity is confined within the specified code quantity in the specified processing time without impairing the image quality in this way.

Description

【発明の詳細な説明】[Detailed description of the invention]

〔産業上の利用分野〕 本発明は画像データを所定の容量に高圧縮符号化するた
めの・符号化装置および符号化方法に関する。 〔従来の技術〕 CCDに代表される固体撮像装置等により撮像された画
像信号をメモリカート、磁気ディスクあるいは磁気テー
プ等の記憶装置にディジタルデータとし、で記憶する場
合、そのデータ量は膨大なものとなるため、多くのフレ
ーム画像を限られた記憶容量の1囲で記録しようとする
には、得られた画像信号のデータに対し、何らかの高能
率な圧縮を行うことが必要となる。さらに、ディジタル
電子スチルカメラなどにおいては、撮影した画像を銀塩
フィルムの代わりに、メモリカード、磁気ディスクある
いは磁気テープ等の記憶媒体にディジタルデータとして
保存するので、〕枚のメモリカート・、磁気ディスクあ
るいは1巻の磁気テープ装置に記録できる画像の枚数か
規定され、この規定枚数分の画像の記録が保証されなけ
ればならすし5かも、データの記録再生処理に要する時
間が短< 、jlつ、一定である必要がある。 同様に、ディジタルVTR(ビデオテープレコーダ)、
ディジタル動画ファイル等において動画像を記録する場
合もフレーム当たりの画像のデータ量に影響されること
なく、諸定量のフレームを記録できなければならない。 すなわち、静止両像であっても、動画像であっても、必
要なコマ数分を確実に記録できる必要かあるとともにデ
ータの記録再生処理に要する時間か短く、月つ、一定で
ある必要がある。 高能率な画像データの圧縮力式として、直交変換符号化
と可変長符号化を組み合わセた符号化方法か広く知られ
ている。 その代表的なものとして、静■画符号化国際標準化にお
いて検討されている方式かある。 この方式について次に概略を説明する。まず画像データ
を所定の大きさのブロックに分割し、分割されたブロッ
ク毎に直交変換と1.て2次元のDCT (離散コサイ
ン変換)を行う。次に各周波成分に応じた線形量子化を
行い、この量子化された値に対し可変長符号化として・
1フマン符号化を行う。この時、直流成分に関
[Industrial Application Field] The present invention relates to an encoding device and encoding method for highly compression encoding image data to a predetermined capacity. [Prior Art] When image signals captured by a solid-state imaging device such as a CCD are stored as digital data in a storage device such as a memory cart, magnetic disk, or magnetic tape, the amount of data is enormous. Therefore, in order to record many frame images in one area of limited storage capacity, it is necessary to perform some kind of highly efficient compression on the data of the obtained image signal. Furthermore, in digital electronic still cameras, captured images are stored as digital data on storage media such as memory cards, magnetic disks, or magnetic tapes instead of silver halide film, so they are stored on memory cards, magnetic disks, etc. Alternatively, the number of images that can be recorded on one roll of magnetic tape device is specified, and the recording of this specified number of images must be guaranteed. Must be constant. Similarly, digital VTR (video tape recorder),
When recording moving images such as digital moving image files, it is necessary to be able to record various amounts of frames without being affected by the amount of image data per frame. In other words, whether it is a still image or a moving image, it is necessary to be able to reliably record the required number of frames, and the time required to record and reproduce data must be short and constant over a month. be. A coding method that combines orthogonal transform coding and variable length coding is widely known as a highly efficient compression method for image data. A typical example is the method being considered in the international standardization of still image coding. An outline of this method will be explained below. First, image data is divided into blocks of a predetermined size, and each divided block is subjected to orthogonal transformation. A two-dimensional DCT (discrete cosine transform) is performed. Next, linear quantization is performed according to each frequency component, and this quantized value is encoded as a variable length code.
1. Perform human encoding. At this time, regarding the DC component,

【1.で
は近傍ブロックのめ流成分との差分値をハフマン符号化
する。交流成分はジグザグスキャンと呼ばれる低い周波
数成分から高い周波数成分へのスキャンを行い無効(値
か0)の成分の連続する個数とそれに続く有効な成分の
値とから2次元のノ\フマン符号化する。 この基本部分だけでは、可変長符号化であるハフマン符
号化を用いているために符号量か画像毎に一定ではなく
なってしまう。 そこで、符号量の制御の方法として次の方式が提案され
ている。まず、前記基本部分の処理を行うと同時に全画
面の発生した総符号量を求める。 この総符号量と目的とする符号量とからDCT係数に対
する目的とする符号量に近づけるのに最適な量子化幅を
予測する。次にこの量子化幅を用いて前記基本部分の量
子化以降の処理を繰り返す。 そし5て、今回発生した総符号量と、前回発生した総符
号量と、目的とする符号量とから再び目的の符号量に近
づけるのに最適な量子化幅を予測する。 そ【、て、この予測した量子化幅と前回の量子化幅が充
分に近づき、かつ目的の符号量よりも今回発生した紀行
シ≧の方か少ない場合には処理を終了し、nぢを出力世
る。そうでない場合には新し、い量子化幅を用いて処理
を繰り返す。 量子化幅は、各周波数成分に対する相対的な量子化特性
を表す基本形である量子化マトリックスを用意し、この
量子化マトリックスに対して、量子化係数を乗じて必要
な量子化幅を得る。具体的には最初に標準的な量子化係
数を用いて得た量子化幅により上述の基本部分での量子
化を行い、これを可変長符号化し7、これにより得られ
た総符号量の情報と、収めるべき限度となる予め設定し
た目標の総符号量との比較を行い、目標総符号量以内に
達したときはその量子化幅を使用して最終的な符号化処
理を行い、目標総符号量以内に収まらなかったときは、
発生総符号量と目標総符号量とから、例えば、線形予測
により目的総符号量に近づくに最適な量子化係数を求め
、この求めた量子化係数と量子化マトリックスとから、
より最適化した量子化幅を計算し7、これを用いて最終
的な符号化処理を行う。このよう−トカ法で、量子化幅
の変更を行う。 しかし、上述の符号量の制御の方法では符号化の基本部
分のバスを何度繰り返すかが画像によって異なるために
処理時間が不定となるばかりでなく、−船釣に処理時間
を長く必要とする欠点があ一ンた。 そこで、この問題を解決する手法として本発明者らは次
のような方式を提案した。(特願平]、 −2837B
 1号、特願平2−137222号参照)この提案した
方式は、直交変換と可変長符号化を組み合わせた圧縮方
式において、発生符号量の制御を行うために、画像メモ
リに記憶した標本化した画像信号を、ブロックに分割し
、この分割されたブロック毎に直交変換を行ってから、
この変換出力を暫定的な量子化幅で量子化した後、この
量子化出力を可変長符号化すると共に、各ブロック毎の
発生符号量と画像全体の総発生符号量を算出し、次に前
記暫定的な量子化幅、前記総発生符号量および、目的と
する総符号量とから、新しい量子化幅を予測する。また
、前記各ブロック毎の発生符号量と、前記総発づ一符号
量と、lI的とする総符号量とから、各ブロック毎の割
当符号量を計算する。そして、新し、い量子化幅を用い
て再び画像メモリの画像信号をブロック分割、直交変換
、量子化、可変長符号化を行うと共に、各ブロックの発
生符号量が各ブロックの割当符号量を越える場合には、
途中で可変長符号化を中止して、次のブロックの処理に
移る。これにより、画像全体の総発生符号量か目的の総
符号量を越えないようにすると、まず、(a)に示すよ
うに、1フレームの画像データ(国際標準化案で例示さ
れている〕フレームの画像は720 X576画素)を
所定の大きさのブロック(例えば、8X8の画素よりな
るブロックA、B、C,・・ )に分割し、(b)に示
すように、この分割されたブロック毎に直交変換として
2次元のDCT(fi散ココサイン変換を行い、8×8
のマトリックス上に順次格納する。画像データは2次元
甲面で眺めてみると、濃淡情報の分布に基づく周波数情
報である空間周波数を有している。 従って、−F記DCTを行うことにより、画像データは
直流成分DCと交流成分ACに変換され、8×8のマト
リックス上には原点位置(0,0位置)に直流成分DC
の値を示すデニタが、そして、0.7位置には横軸方向
の交流成分ACの最大周波数値を示すデータが、そして
、7.0位置には縦軸方向の交流成分ACの最大周波数
値を示すデータが、さらに、7.7位置には斜方向の交
流成分ACの最大周波数値を示すデータがそれぞれ格納
され、中間位置ではそれぞれの座標位置により関係(1
けられる方向における周波数データが、原点側より順次
高い周波数のものが出現する形で格納されることになる
。 次にこのマトリックスにおける各座標位置の格納データ
を、各周波数成分毎の量子化幅により割ることにより、
各周波数成分に応じた線形量子化を行い(C)、この量
子化された値に対し可変長符号化と(7てハフマン符号
化を行う。この時、直流成分DCに関しては近傍ブロッ
クの直流成分との差分値をグループ番号(付加ビット数
)と付加ビットで表現し、そのグループ番号をノ\フマ
ン符号化し、得られた符号語と付加ビットを合わせて符
号化データとする( di、 d2. el、 e2)
。 交流成分ACに関しても有効でない(値が“0“でない
)係数は、グループ番号と付加ビットで表現する。 そのため、交流成分ACはジグザグスキャンと呼ばれる
低い周波数成分から高い周波数成分へのスキャンを行い
、無効(値が0′)の成分の連続する個数(零のラン数
)と、それに続く有効な成分の値のグループ番号とから
2次元のハフマン符号化を行い、得られた符号語と付加
ビットを合わせて符号化データとする。 ハフマン符号化はフレーム画像当たりの上記直流成分D
Cおよび交流成分ACの各々のデータ分布における発生
頻度のピークのものを中心として、この中心のものほど
、データビットを少なく 1−1周辺になるほとビット
数を多くするようにしてビット割り当てをした形でデー
タを符号化【7て符号語を得ることで行う。 以上がこの方式の基本部分である。 この基本部分たけでは、可変長符号化であるハフマン符
号化を用いているために符号か画像毎に一定ではなくな
ってし7まうから、符号量の制御の方法とし、で例えは
、次のように処理する。 まず、暫定的な量子化係数を用いて、定められた量子化
マトリックスと量子化係数を掛は合わせて得られる各周
波数成分毎の量子化幅で前記基本部分の処理を行うと同
時に、全画面の発生した総符号量(総ピッ)・数)を求
める(g)。この総符号量と、目的とする符号量と、用
いた暫定的な量子化係数などからDCT係数に対する目
的とする符号量に近付けるのに最適な量子化係数を予測
すル(h)。次に、この量子化係数を用いて(i)、前
述の基本部分の量子化以降の処理を繰り返す。そして、
今回発生した総符号量と、前回発生した総符号量と、目
的とする符号量と、今回用いた量子化係数と、前回用い
た量子化係数とから、再び目的の符号量に近イ・1ける
のに最適な量子化係数をニュートン・ラプソン・イタレ
ージづン(Ne警tonRaphson 11erra
tion)によりT−測する。 そして、この予測した量子化係数と前回の量子化係数か
充分に近づき、かつ目的の符号量よりも今回発生(また
総符号量の力か少ない場合には処理を終了し、今回発生
し7た符号化データを出力してメモリカードに記憶する
(f)。そうでない場合には量子化係数を変更し1、こ
の新し7い量子化係数を用いて処理を繰り返す。 しかし、上述の符号量の制御の方法では符号化の基本部
分のバスを何度繰り返すかが画像によって異なるために
処理時間か不定となるばかりでなく、−船釣に処理時間
を長く必要とする欠点があった。そこで、本発明名らは
次のような方式でこれを解決した。 まず、暫定的な量子化係数を用いて、定められた量子化
マトリックスとjl ’T−化係数を掛は合わせて得ら
れる各周波数成分毎の量子化幅で前記基本部分の処理を
行うと同時に、全画面の発生した総符号量(総ビット数
)と各ブロック毎の発性符号量を求める(gl)。この
総符号量と、目的とする符号量と、用いた暫定的な;丁
化係数な どからDCT係数に対する目的とする符号量に近付ける
のに最適な量子化係数を予測する(hl)。また、総符
号量と、目的とする符号量と、各ブロック毎の発生符号
量から比例配分により、各ブロックの割当符号量を求め
る(h2)。次に、予測した量子化係数を用いてH) 
、前述の基本部分の処理を繰り返す。つまり、再び画像
メモリの画像信号をブロック分割、直交変換、量子化、
可変長符号化を行うと共に、各ブロックの発生符号量が
各ブロックの割当符号量を越える場合には、途中で可変
長符号化を中止して、次のブロックの処理に移る。 そし、で、すべてのブロックについて上記の処理を終了
したら、今回発生した符号化データを出力してメモリカ
ードに記憶する(f)。 〔発明が解決しようとする課題〕 上述したように、例えば、ディジタル電子スチルカメラ
なとにおいでは、1枚のメモリカー ドあるいは磁気デ
ィスク装置あるいは1本の磁気テープ等に記録できる画
像に枚数が保証されていなければならず、そのため、画
像データを圧縮しで記録するが、操作性の上からその処
理時間はできるだけ短く、■1つ、一定である必要があ
る。また、高能率で画像データの圧縮か行えることか望
まれる。これらはディジタル電子スチルカメラに限らず
他のアプリ今一ジョンにおいても少なからず要求される
項目である。 そ【、で、このような要求を満たす圧縮方式として上述
の国際標準室7j式かあり、この方式において、前記基
本部分て例示したようなブロック毎の直交変換と可変長
符号化を組み合わせた手法では、画像データの圧縮を高
能率で行えるものの、可変長符号化を用いているが故に
符号量が一定にならず、1枚のメモリカードあるいは磁
気ディスクあるいは1本の磁気テープ等の記録媒体に記
憶できる画像の枚数が不定になるという欠点かぁ−。 た。 また、二わを解決するだめの従来技術として、上述した
静+L画符号化国際標準化において検討されている符号
量制御の方式かあるか、この方式では符号化の基本部分
のバスを何度繰り返すかが画像によって異なるために処
理時間が不定となるばかりてフa < 、−船釣に処理
時間を長く必要とする欠点かあった。 この問題を解決する手法として本発明者ら力i提案した
特願平1−2837B1号および特願平2−1.372
22号の方式かある。この提案した方式は、通常の場合
、大変に良好な結果が得られるか、応用するシステムに
よっては、空間周波数の特に低ts、するいは特に高い
画像では若干画質が低下し7、発生した符号量の目標の
?1号量に対する隔たりが通常の場合よりも若干多くな
ることが極く稀に生じる。 この原因に関して説明する。前述のよう1こ、量イ化幅
を各周波数成分に対する相対的な量子化特性を表す基本
形である量子化マトリ・ソクス1こ、量子化係数を乗じ
たもので表すとき、量子化係数と発生符号量の間にはお
よそ次の関係がある。 log BR−a log SF+ b−(1)ここで
、BRは一画素当たりの符号Jfl(ビ・ソトレート)
、SFは量子化係数、aおよびbは定数であり、aは特
にシステムに大きく依存し、b l′i特1こ画像に大
きく依存する。 色成分に分離されたカラー画像の量子化の際に、色成分
に対し、複数の量子化マトリ・ンクス、例えば、輝度用
と色差用の二つの量子化マトリックスを用いるとともに
、共通の量子化係数を用いるとすると、 10g BR−a  log sp+ b 、    
 −=(2)y      y 1ag BR−a   log SF+ b c   
       ・・・ く3)CC のような関係になる。尚、上記各式においてはBR。 a、bに、それぞれy5Cを添えて輝度、色差の区別を
しである。ここでもし、a  −a、であれば、 !og(BR十BR)    c by   bc −a   log SF+(10+IO)−a log
  SF+ b            −(4)のよ
うになり、各ブロック毎の割当符号量の決定は、統計量
に応じて目的の符号量を比例配分して得れば良いことか
わかる。 通常の場合、aZ:a  であるか、システムy   
   c によっては極く稀にa とa の大きさかかなりy  
     c 異なることかある。 つまり、総符号量log BRをY軸に、量子化係数l
og SFをX軸にとり、式(2)と式(3)の関係を
示すと第10図の如きとなり、量子化係数log 5P
IN=応じた総符号JllogBRの大きさは輝度系と
色差系で少し違いがある。第10図を眺めてみると、符
号化するときの量子化係数、つまり、最適値と予測され
る量子化係数が、特に大きかったり、あるいは小さいと
き、言い換えると特に空間周波数の高い画像のとき、あ
るいは低い画像の場合においては、各ブロックの統計量
に応じて目的の符号量を比例配分することによって割当
符号量を決定すると、その予測された量子化係数を用い
て実際に符号化を行った際に、輝度成分のブロックにお
いては割当符号量が不十分となり、色差成分のブロック
では余分となる、あるいはその逆になる。 輝度成分における割当符号量か不足するか、色差成分に
おける割当符号量が不足するかは、a  :2a  の
大小関係’!:、 % r−測されたm f化係数V 
      C のべ小による。、 以[の原因から、応用するシ〆、ヴムに、、]ンでは、
空間周波数の特に低い、あるいは特に高い画像では、若
干画質が低下し、発生した符号量の目標の符号量に対す
る隔たりが通常の場合よりも若干多くなることがあった
。 そこで、本発明の目的とするところは、空間周波数分布
傾向が片寄った画像であっても、画質を損なわずに、一
定の処理時間内で一定の符号量内に収まるように符号化
することのできる画像データの符号化装置および符号化
方法を提供することにある。 [課題を解決するための手段] 上記目的を達成するため、本発明は次のように構成する
。 すなわち、色成分別に分離されたカラー画像データそれ
ぞれを所定画素数のブロックに分割し、色成分別のこの
分割されたブロック毎に順に直交変換を行って周波数成
分別のデータに変換し、この変換された周波数成分別の
デ・−夕を量子化手段により隘]′−化し、その後、こ
の量子化出力をl’lJ変長符号化Jコ段′に与λて可
変長符号化し、画像デ−夕の符号化を行う際に、初めに
暫定的tご定めた量子化幅で量子化して可変長符号化し
、各ブロック毎の符号量を得る統計処理を行い、次にこ
の統計処理により求めた各ブロック毎の符号量と、画像
あたりの総符号量目標値とからこの総符号量目標値に収
めるに適した最適量子化幅と各ブロック毎の割当符号量
とを決定し、この決定した最適量子化幅に従って各ブロ
ック毎の前記変換出力の量子化を行うと共にこの量子化
出力を各ブロック毎の割当符号量に従って各ブロック毎
に符号量制御を行いながら順次i’=1変長符号化する
符号化処理を実施する符号化装貿において、 第1には、前記統計処理時の可変長符号化出力をもとに
各色成分別前記各ブロックの符号量を算出する算出手段
と、前記最適息子化幅て量子化L5た際の各色成分別符
号量を予測し、この各″f−測色測色成分性符号量づい
て前記総符号;1−]標値を比例配分し、各色成分別符
号量を決定すると几に、これを前記算出手段の算出値に
従って比例配分し5、各色成分別各ブロックの基準符号
量を決定する決定手段と、符号化処理H4jζご前記決
定手段L 7決定した各色成分別各ブロックの基準符号
量を用い、前記ブロックの・うち、次に符号化処理する
処理対象ブロックの前に処理した処理済みブロックでの
符号化により発生した符号量と当該処理済みブロックで
の割当符号量との差を求めてこれを前記処理対象ブロッ
クの前記基準符号量に加えることにより得られる符号量
を当該処理対象グτ−フックでの割当符号量として割り
当てる割当手段と、前記処理対象ブロックでの符号化処
理において前記割当手段により割り当てられた前記割当
符号量を越えないように、前記口■変長符号化を打ち切
る打ち切り手段とを具偏して構成する。 また、第2には前記統計処理時のEiJ変長符号化出力
をもとにδ包成分別前記各ブロックの符号量を算出する
と共に各色成分別の総符号回おjび画像全体の総符号量
を算出するや8手段と、前記総符号量目標値と前記%出
手段の算出値に基づいて各色成分別の最適量子化幅をY
−測する量J1化幅Y−II手段と、前記最適量子化幅
で量子化した際の各色成分別符号量を予測し1、この各
予測色成分別符号量に基づいて前記総符号量目標値を比
例配分し、各色成分別符号量を決定すると共に、これを
前記算出手段の算出値に従って比例配分し、各色成分別
各ブロックの基準符号量を決定する決定手段と、符号化
処理時に前記決定手段にて決定した各色成分別各ブロッ
クの基準符号量を用い、前記ブロックのうち、次に符号
化処理する処理対象ブロックの前に処理した処理済みブ
ロックでの符号化により発生した符号量と当該処理済み
ブロックでの割当符号量との差を求めてこれを前記処理
対象ブロックの前記基準符号量に加えることにより得ら
れる符号量を当該処理対象ブロックでの割当符号量とし
て割り当てる割当手段と、前記処理対象ブロックでの符
号化処理において前記割当手段により割り当てられた前
記割当符号量を越えないように、前記り変長符号化を打
ち切る打ち切り手段とを備えて構成する。 また、第3には上記第1および第2の構成それぞれに、
更に、目的とする圧縮率を選択すると共に、選択された
圧縮率に応じて収めるべき目的の符号量および前記暫定
的量子化幅を決定する圧縮率選択手段を設けて構成する
。 また、第4には上記第1および第3の構成それぞれにお
いて、更に、前記量子化手段には前記符号化処理時での
量イ化は、前記直交変換により得られる周波数成分別の
データのうち、低周波数成分のデータより実施させると
共に、前記IjJ変長符号化手段には前記直交変換によ
り周波数成分別に得られる前記各ブロック単位の画像デ
ータの周波数成分別データのうち、直流成分については
前の処理ブロックでの直流成分との差分を得ると共にこ
の差分を可変長符号化する直流成分用の符号化処理部と
、この直流成分について符号化処理部の処理か終った後
、前記交流成分について可変長符号化する交流成分用の
符号化処理部とを設け、前記符号化打ち切り手段は交流
成分用の符号化処理部にのみ設けて構成する。 マタ、第5には、色成分別に分離されたカラー画像デー
タを所定画素数のブロックに分割しこの分割されたブロ
ック毎に順に直交変換を行ってからこの変換出力を量子
化手段により量子化し、その後、この量子化出力を可変
長符号化手段に与えて可変長符号化し、データの符号化
を行う際に、予め求めた収めるべき総符号員目標値およ
び各ブロック毎の統計量から決定した各ブロック毎の割
当符号量に従って各ブロック毎に符号量制御を行いなが
ら可変長符号化を行うにあたり、前記量子化を暫定的な
量子化幅を使用して行い、これにより得た量子化出力に
ついて符号化処理を行い、最適化するに必要な画像全体
の符号量および各ブロック毎の符号量を調べる第1のス
テップと、この第1のステップで得た画像全体の符号量
から最適化に必要な量子化幅の予測を行う第2のステッ
プと、前記予測した最適量子化幅で量子化した際の各色
成分別符号量を予測し、この各予測色成分別ね号星に基
づいて前記総符号量目標値を比例配分し5、各色成分別
符号量を決定すると共に、これを前記各ブロックの符号
量に基づいて比例配分し、各ブロック毎の基準割当符号
量を求める第′うのステップと、前記予測した量子化幅
を用いて前記各ブロック毎の前記量子化を行う第4のス
テップと、この第4のステップでの前記各ブロック毎の
量子化出力をそのブロックに対する割当符号量に収まる
範囲で可変長符号化する第5のステップと、前記第5の
ステップにおける現在可変長符号化処理しようとするブ
ロックの、直前に処理したブロックでの可変長符号化に
よる符号量とこのブロックでの割当符号量との差を求め
、これを繰り越し量として前記現在処理しようとするブ
ロックでの前記基準割当符号量に加算し、前記現在処理
しようとするブロックでの割当符号量とする第6のステ
ップとより構成する。 また、第6には前記第5のケースにおいて、第1のステ
ップでは前記量子化を暫定的な量子化幅を使用して行い
、これにより得た量子化出力について符号化処理を行い
、最適化するに必要な画像全体の符号量および各色成分
別符号量および各色成分別各ブロック毎の符号量を調べ
るようにし、第2のステップではこの第1のステップで
得た画像全体の符号量と各色成分別符号量から最適化に
必要な量子化幅のf−測を各色成分別に行うと共に、第
3のステップでは前記予測した最適量子化幅で量子化1
7た際の各色成分別符号量を予測し、この各予測色成分
別符号量に基づいて前記総符号量目標値を比例配分し、
各色成分別符号量を決定すると共に、これを前記各色成
分別各ブロックの符号量に基づいて比例配分し、各色成
分別各ブロック毎の基準割当符号量を求め、第4のステ
ップでは前記予測した前記各色成分別の量子化幅を用い
て前記各色成分別各ブロック毎の前記量子化を行い、第
5のステップでは、この第4のステップでの前記各色成
分別各ブロック毎の量子化出力をそのブロックに対する
割当符号量に収まる範囲で可変長符号化すると共に、第
6のステップでは前記第5のステップにおける現在可変
長符号化処理しようとするブロックの、直前に処理した
ブロックでの61変長符号化による符号量とこのブロッ
クでの割当符号量との差を求め、これを繰り越し量とし
て・・・・前記現在処理しようとするブロックでの前記
基準割当符号量に加算し、前記現在処理しようとするブ
ロックでの割当符号量とすると云った手順を踏む。 また、第7には色成分別に分離されたカラー画像データ
を所定画素数のブロックに分割し、この分割されたブロ
ック毎に順に直交変換を行って周波数成分別のデータに
変換すると共に、この直交変換により得られる周波数成
分別のデータを量子化手段により低周波数成分より順次
量子化し、その後、この量子化出力を可変長符号化手段
に与えて可変長符号化し、データの符号化を行う際に、
予め求めた収めるべき総符号量目標値および各ブロック
毎の統計量から決定した各ブロック毎の割当符号量に従
って各ブロック毎に符号量制御を行いながら可変長符号
化を行うにあたり、前記量子化を暫定的な量子化幅を使
用して行い、これにより得た量子化出力について符号化
処理を行い、最適化するに必要な画像全体の符号量およ
び各色成分別符号量および各色成分別各ブロック毎の符
号量を調へる第1のステップと、この第1のステッブで
得た画像全体の符号量と各色成分別符号量から最適化に
必要な量子化幅の予測を各色成分別に行う第2のステッ
プと、前記予測した最適量子化幅で量子化した際の各色
成分別符号量を予測し、この各予測色成分別符号量に基
づいて前記総符号量目標値を比例配分し、各色成分別符
号量を決定すると共に、これを前記各ブロックの符号量
に応じて配分することにより、各ブロック毎の基準割当
符号量を求める第3のステップと、前記予Mjシた前記
各色成分別の量子化幅を用いて前記各色成分別各ブロッ
ク毎の前記量子化を行う第4のステップと、この第4の
ステップでの前記各ブロック毎の量子化出力をそのブロ
ックに対する割当符号量に収まる範囲で可変長符号化す
るものであって、前記直交変換により得らオ]る前記各
ブロック単位の画像データのうち、直流成分については
前の処理ブロックでの直流成分との差分を得て、この差
分を可変長符号化し、この直流成分について符号化処理
か終わった後、前記交流成分について可変長符号化処理
する第5のステップと、前記第5のステップにおける現
在iq変長符号化処理し7よ)とするブロックの、直前
に処理したブロックでの可変長符号化による符号量とこ
のブロックでの割当符号量との差を求め、これを繰り越
し量として前記現在処理しようとするブロックでの前記
基準割当符号量に加算し、前記現在処理しよ)とするブ
ロックでの割当符号量とする第6のステップとを含み、
前記第5のステップにおける前記割当?’1号量に収ま
る範囲での可変長符号化処理は前記交流成分についての
み適用することを特徴とする。 更にまた第8には前記第5乃至第7の方法において、前
記暫定的な量子化幅1コ、選択設定した画面あたりの総
符号量に応じてチめ定めた値を用いることを特徴とする
。 [作 用] このような構成において、色成分別に分離されたカラー
画像データそれぞれを所定画素数のブロックに分割し、
色成分別のこの分割されたブロック毎に順に直交変換を
杓−)゛〔周波数成分別のデータに変換し、この変換さ
れた周波数成分別のデータを量子化手段により量子化し
、その後、この量子化出力を可変長符号化手段に与えて
可変長符号化し、データの符号化を行う際に、初めに暫
定的に定めた量子化幅で量子化して可変長符号化し2、
各ブロック毎の符号量を得る統計処理を行い、次にこの
統計処理により求めた各ブロック毎の符号量と、画像あ
たりの総符号量目標値とからこの総符号量目標値に収め
るに適した最適量子化幅と各ブロック毎の割当符号量と
を決定し、この決定した最適量子化幅に従って各ブロッ
ク毎の前記変換出力の量子化を行うと共にこの量子化出
力を各ブロック毎の割当符号量に従って各ブロック毎に
符号量制御を行いながら順次可変長符号化する符号化処
理を実施するが、第1の構成の場合、算出手段は前記統
計処理時の可変長符号化出力をもとに各色成分別前記各
ブロックの符号量を算出し、決定手段は前記最適量子化
幅で量子化した際の各色成分別符号量を予測し7、この
各予測色成分別符号量に基づいて前記総符号量目標値を
比例配分し、各色成分別符号量を決定すると共に、これ
を前記算出手段の算出値に従って比例配分し、当該各色
成分別各ブロックの基準符号量を決定する。また、割当
手段は符号化処理時に、前記決定手段に゛C決定した各
色成分別各ブロックの基準符号量を用い、前記ブロック
のうち、次に符号化処理する処理対象ブロックの前に処
理した処理済みブロックでの符号化により発生した符号
量と当該処理済みブロックでの割当符号量との差を求め
てこれと前記処理対象ブロックの前記割当符号量とを加
え、当該処理対象ブロックでの割当符号量として割り当
てる。そして、打ち切り手段は前記処理対象ブロックで
の符号化処理時に前記割当手段により割り当てられた割
当符号量を越えないように、前記可変長符号化を打ち切
る。 また、第2の構成の場合、前記p、出丁、段は前記統語
処理時の可変長符号化出力をもとに各色成分別前記各ブ
ロックの符号量を算出すると共に各色成分別の総符号量
および画像全体の総符号量を算出し、また、量子化幅子
#j手段は前記総符号量目標値と前記算出手段の算出値
に基づいて各色成分別の最適量J″′−′−化幅し1、
前記決定手段は前記鹸適−了化幅で量子化した際の各色
成分別符号量を’?−測し、この各予測色成分別符号量
に基づいて前記総符号量目標値を前記算出した各色成分
別の総符号量に従って比例配分し、且つ、これを前記算
出し7た各色成分別各ブロックの符号量に応じて配分す
ることにより当該各色成分別各ブロックの基準符号量を
決定する。また、割当手段は符号化処理時に前記決定手
段にて決定した各色成分別各ブロックの基準符号量を用
い、前記ブロックのうち、次に符号化処理する処理対象
ブロックの前に処理した処理済みブロックでの符号化に
より発生した符号量と当該処理済みブロックでの割当符
号量との差を求めてこれを前記処理対象ブロックの前記
基準符号量に加えることにより得られる符号量を当該処
理対象ブロックでの割当符号量として割り当てる。ぞし
、で、打ぢ切り手段は前記処理対象ブロックでの符号化
処理において前記割当二手段により割り当てられた前記
割当符号量を越スないように、前記i3J変長変長化打
ち切り制御をする。 以−1−I町、統2]処理時に暫定的な量子化幅を用い
ての量子化に基づく画面全体の総発生符号L、および各
色成分別の発生符号量、各色成分別符号1各ブロックの
発4−符号量の状態を知り、これ・−1の情報から最J
量子化幅をt測し7、また、予測最適量子化幅で量子化
した際の各色成分別符刊量ヲ予API L、この各予測
色成分別符号量に基ついて前記総符号ff1tj標値を
比例配分し、各色成分別符号;を決定すると共に、これ
を各色成分別giJ記各ブロックの発生71号量で配分
して各色成分別の各ブロック毎の基準割当符号量を決め
、符号化処理における各ブロックの符号化に当たっては
そのブ[ノックの基準割当符号量に、そのljすのブロ
ック”Jのンで1列化における符号量と割当n列置の差
を繰り越し量として加算して割当符’Q Qとし1、こ
の割当n号二に収まるi囲て符号化してゆくと云−)だ
もので、統一1処理時のデータに基づいて、各色成分別
の各ブロック毎の基準割当符号量を、そのT′−想発生
符号量に応して合理的に配分E5て定めてあり、また、
先に処理したブロックでの割当符号量の未消化分を繰り
越し分とし5て後のブロックの符号化に振り向けること
かできることから、符号量を多く必要とする色成分であ
っても各ブロックでの符号化打ち切りが少なくなり、画
質向上に寄与すると共に、符号化処理の回数を規定回数
に定めると符号化に要する時間は一定とすることかでき
る。 また、第3の構成の場合、上記第1および第2のケース
に、更に、圧縮率選択手段を設ける構成としたもので、
目的とする圧縮率を選択すると、圧縮率選択手段はこの
選択された圧縮率に応して収めるべき目的の符号量およ
び前記暫定的fl T化幅を決定する。 従って、この方式では第1および第2の構成の作用と効
果に加え、目的とする圧縮率を選択することができ、こ
れに対応して暫定的量イ化幅と収めるべき]画像当たり
の目的の符号量を定めて統計処理を行うので、所望の符
号量に収まる最適量子化幅をより精度良く見付けること
かできるようになる利点が得られる。 また、第4の構成の場合、上記第1および第3の構成そ
れぞれにおいて、前記可変長符号化−手段の機能を、前
記直交変換により得られる前記各ブロック単位の画像デ
ータのうち、直流成分については前の処理ブロックでの
直流成分との差分を得ると共にこの差分を弓変&符号化
し、この直流成分について符号化処理部の処理か終わっ
た後、前記交流成分について可変長符号化すると共に前
記符号化打ち切りは交流成分用の符号化処理においての
み、実施する構成としたものを使用している。従って、
前記量子化手段は前記符号化処理時での量子化は、前記
直交変換により得られる周波数成分別のデータのうち、
低周波数成分のデータより実施させると共に、前記可変
長符号化手段には前記直交変換により周波数成分別に得
られる前記各ブロック単位の画像データの周波数成分別
データのうち、直流成分については前の処理ブロックで
の直流成分との差分を得てこの差分をn丁度長符号化し
、この直流成分に一ついて符号化処理が終った後、前記
交流成分について可変長符号化すると共に、前記符号化
の打ち切りは交流成分にのみ適用する。 この結果、上記第1乃至第3のケースに、さらに符号化
処理時の符号化打ち切りを交流成分に幻してのみとした
ことで視覚上、影響の少ない高い周波数領域の打ち切り
に止めることかでき、画質の劣化を防11−できる。 第5のケースでは色成分別に分離されたカラー画像デー
タを所定画素数のブロックに分割し、この分割されたブ
ロック毎に順に直交変換を行ってからこの変換出力を量
子化手段により量子化し2、その後、この量子化出力を
可変長符号化手段に与えて可変長?:f号化し5、デー
タの符号化を行う際に、予め求めた収めるべき総符号量
目標値および各ブロック毎の統計量から決定した各ブロ
ック毎の割当符号;に従って各ブロック毎に符号量制御
を行いながら可変長符号化を行うにあたり、第1のステ
・ノブで前記量子化を暫定的な量子化幅を使用して行い
、これにより得た量子化出力について符号化処理を行い
、最適化するに必要な画像全体の符号量および各ブロッ
ク毎の符号量を調べ、第2のステップでは二の第1のス
テップで得た画像全体の符号量から最適化に必要な量子
化幅のf−測を行い、第3のステップにおいて、前記予
測した最適量子化幅で量子化した際の各色成分別符号量
を予測し、この各予測色成分別符号量に基づいて前記総
符号量目標値を比例配分し、各色成分別符号量を決定す
ると共に、これを前記各ブロックの符号量に基づいて比
例配分し、各ブロック毎の基準割当符号量を求め、第4
のステップにおいて、前記予測した量子化幅を用いて前
記各ブロック毎の前記量子化を行う。そして、第5のス
テップおいて、この第4のステップでの前記各ブロック
毎の量子化出力をそのプロ・ンクに対する割当符号量に
収まる範囲で可変長符号化するか、このステップにおけ
る現在処理しようとするブロックでの割当符号量は、当
該現在可変長符号化処理しようとするブロックの、直前
に処理したブロックでの可変長符号化による符号量とこ
のブロックでの割当ね対量との差を求め、これを繰り越
し1、量として前記現在処理しようとするブロックでの
前記基準割当符号量に加算したちのをあてる。 このように第5のケースは、初めに暫定的な量子化幅を
用いての量子化に基づく画面全体の総発生符号量、およ
び各色成分別の発生符号量、各色成分別前記各ブロック
の発生符号量の状態を知り、これらの情報から最適量子
化幅を予測し、また、予測最適量子化幅で量子化した際
の各色成分別符号量を予測し、この各予測色成分別符号
量に基づいて前記総符号量目標値を比例配分し、各色成
分別符号量を決定すると共に、これを各色成分別各ブロ
ックの発生符号量に応じて各ブロックに比例配分し、各
色成分別の各ブロック毎の基準割当符号量を決め、符号
化処理における各ブロックの符号化に当たってはそのブ
ロックの基準割当符号量に、その前のブロックでの符号
化における符号;と割当符号量の差を繰り越Lffiと
して加算1゜て割当符号量とし2、この割当符号量に収
まる範囲で符号化j、てゆくと云−たもので、統ニー1
処理時のデータに基づいて゛、各色成分別の名ブロック
旬の基準割当わ対量を)想発生符対量に応して合理的に
配分して定めてあり、また、先に処理したブロックでの
割当符号量の未消化分を繰り越し7分とし5て後のブロ
ックの符号化に振り向けることができることから、符号
量を多く必要とする色成分であっても各ブロックでの符
号化打ち切りが少なくなり、画質向上に寄与すると共に
、符号化処理の回数を規定回数に定めると符号化に要す
る時間は一定とすることができる。 第6の場合では、前記第5のケースにおいて、第1のス
テップで1j前記量了化を暫定的な量子化幅を使用して
行い、これにより得た量子化出力について符号化処理を
行い、最適化するに必要な画像全体の符号量および各色
成分別符号量および各色成分別各ブロック毎の符号量を
調べるようにし、第2のステップではこの第1のステッ
プで得た画像全体の符号量と各色成分別符+3童から最
適化に必要な量子化幅のlf−測を各色成分別に行う2
−共に、第3のステップでは前記最適量子化幅て量子化
し、た際の各色成分別初号量を予iip+ L、この各
予測色成分別符号量に基づいて前記紛1句す量目標値を
比例配分し、各色成分別符号量を決定すると共に、これ
を前記各色成分別各ブロックの符号量に基づいて比例配
分して各色成分別各ブロック毎の基準割当符号量を求め
、第4のステップでは前記予測した前記各色成分別の量
子化幅を用いて前記各色成分別各ブロック毎の前記量子
化を行い、第5のステップでは、この第4のステップで
の前記各色成分別各ブロック毎の量子化出力をそのブロ
ックに対する割=i符対量に収まる範囲で可変長ね対比
すると共に、第6のステ・ンプでは前記第5のステップ
における現在可変長祠号化処理しようとするブロックの
、直前に処理したブロックでの可変長符号化による符号
量とこのブロックでの割当符号量との差を求め、これを
繰り越し量として前記現在処理しようとするブロックで
の前記基準割当符号量に加算し、前記現在処理しようと
するプロ・ノつての割当符号;とする。 第6の場合では、量子化を暫定的な量子化幅に〔行い、
これにより得たfit ”F比出力について符号化処理
を行い、最適化するに必要な画像全体の符号量および各
色成分別符号量および各色成分別各ブロック毎のR’T
fflを調へ、これにより得た画像全体の符号量と各色
成分別符号量から最適化に必要な量子化幅の工・測を各
色成分別にイjうと共に、予め求めた収めるべき総符号
量目標値、色成分別予想発生符号量および前記各色成分
別各ブロックの符号量から比例配分により各色成分別各
ブロック毎の基準割当符号量を求め、ついて前記T−謝
した各色成分別量子化幅を用いて前記各色成分別各ブロ
ック毎の前記量子化を行い、ここて11)たM”J 2
各ブロック毎の量子化出力を、そのブロックに対する割
当符号量に収まる範囲で可変長符号化する。 −力、現在可変長符号化処理しようとするブロックの、
直前に処理したブロックでの可変長符号化による符号量
とそのブロックでの割当符号量との差を求め、これを繰
り越シー量として前記現在処理(、よ・うとするブロッ
クでの前記基準割当fJ号;に加%(7、前記現在処理
し2よっとするブ[コックでの割当符号量とし、この割
当符号量の範囲て符号化すなわぢ、可変長符号化をする
。 二のように、鹸初に暫定的な量子化幅を用いての量子化
に基づく画面全体の総発生符号量、および各色成分別の
発生符号量、各色成分別前記各ブロックの発生符号量の
状態を知り、これらの情報から最適量子化幅を′f−測
し、また、前記紀行対量11標値を予想発生符号量に応
じて各色成分別に分配し5、更にこれを各色成分別の発
生符号量に応じて比例配分して、各色成分別の各ブロッ
ク毎の基準割当符号量を決め、符号化処理における各ブ
ロックの符号化に当たってはそのブロックの基準割当符
号量に、その前のブロックでの符号化における符号量と
割当符号量の差を繰り越し量と[7て加算し5て割当符
号量とし、この割当符号量に収まる範囲で符号化L2て
ゆくと云ったもの−C1暫定的な量子化幅を用いての処
理時のデータと、予測最適量子化幅での予測符号量とに
基づい゛C1各色成分別の各ブロック毎の基準割当符号
量を合理的に配分し5て定めてあり、また、先に処理し
たブロックでの割当符号量の未消化分を繰り越し分とし
て後のブロックの符号化に振り向けることかできること
から、符号量を多く必要とする色成分であっても各ブロ
ックでの符号化打ち切りか少なくなり、画質向上に寄与
すると共に、符号化処理の回数を規定回数に定めると符
号化に要する時間は一定とすることができる。 また、第7のケースでは、色成分別に分離されたカラー
画像データを所定画素ザイズのブロックに分割し、この
分割されたブロック毎に直交変換を行って周波数成分別
のデータに変換すると共に、この直交変換により得られ
る周波数成分別のデータを量子化手段により低周波数成
分より順次量子化し、その後、この量j°−化出力出力
変長符号化手段に′テえて可変長符号化し、データの符
号化を行う際に、予め求めた収めるべき総符号量目標値
および各ブロック毎の統計量から決定1また各ブロック
毎の割当符号量に従−〕で各ブロック毎に符号量制御を
行いながら可変良化ぢ化を行うにあたり、前記Hr化を
暫定的な量子化幅を使用して杓い、これにより得た量f
比出力について符号化処理を行い、最適化するに必要な
画像全体の符号量および各色成分別符号量および各色成
分別各ブロック毎の符号量を調べ、これにより得た画像
全体の符号量と各色成分別符号量から最適化に必要な量
子化幅の予測を各色成分別に行い、更に前記最適量子化
幅で量子化した際の各色成分別符号量を予測し、この各
予測色成分別符号量に基づいて前記総符号量目標値を比
例配分し、各色成分別符号量を決定すると共に、これを
前記各色成分別各ブロックの符号量に基づいて比例配分
して各色成分別各ブロック毎の基準割当符号量を求める
。そして、前λ己予測した前記各色成分別の息子化幅を
用いて前記各色成分別各ブロック毎の前記量子化を行う
が、その際の前記各ブロック毎の量子化出力をそのブロ
ックに対する割当符号量に収まる範囲で可変長符号化す
る。このとき、前記直交変換により得られる前記各ブロ
ック単位の画像データのうち、直流成分については前の
処理ブロックでの直流成分との差分を得て、この差分を
可変長符号化し5、この直流成分につい°C符号化処理
か終オ)−9た後、前記交流成分について+1]′変長
符号化処理し、二の処理における現在可変長符号化処理
しようとするブロックの、直前に処理【7たブロックで
の可変長符号化による符号量とこのブロックでの割当符
号量との差を求め、これを繰り越し量と(、て前記現在
処理しようとするブロックでの前記基準割当符号量に加
算し、前記現在処理し7ようとするブロックでの割当符
号量とする。そして、前記割当符号量に収まる範囲での
可変長n9化処理は前記交流成分についてのろ適用する
。 このようにすると、可変長符号化の1]ち切りは、交流
成分のみとなり、視覚的影響の大きい低い周波数成分の
打ち切りは抑制されるので、画質の維持か図れる。 さらにまた第8には前記第5乃至@7のケースにおいて
、前記暫定的な量子化幅は、選択設定した画面あたりの
紀行対量に応し7°ζ予め定めた値を用いる。 この結果、暫定的な息子化幅は収めるべき画面あたりの
紀行対量に応じた蛙適値に近いものとなり、より適正な
圧縮符号化が可能になる。 二のように本発明は鰻初に統;4処理を行い、この統≧
−1処理により各色成分別の最適な量子化幅の予測と、
各色成分別各ブロックの基準割当符号Iの決定に必要な
統計量を得、これらの情報をもとに符号化の処理に入り
、予測した量子化幅を考慮して各ブロックに基準符号量
を割り当てると共に順次君号化出力を見ながら、処理し
ようとするフロックノ基準割当符号量とそのブロックの
前の処理ブロックでの割当符号量の過も足労を合わせて
得られた当該処理しようとするブロックの割当符号量内
に収まるように、可変長符号化を打ぢ切ることでブロッ
ク毎に符号量を制御し、所望の符号量内で収まった符号
化出力を最終出力とじて得るようにしたものである。 これは、次に示す考え方によるものである。 従来例で説明(7たよっに、符号化するときのl1lr
 r化係数か特に犬きが〜たり小さいとき、言い換える
と特に空間周波数の高いあるいは低い画像の場合におい
ては、名70ツクの統計量に応じてLi的の符号量を比
例41分する−とによ−)て割当符号量を決定すると、
そのY−測されたQF化係数を用いて実際に符号化を行
った際に、輝度成分のブロックにおいては割当符号量か
不十分で色差成分のブロックでは余分である、あるいは
その逆になることかある。すると、符号量の不十分たっ
た色成分の方は符号化を途中で打ち切られるので、当然
画質が劣化する。このような現象か発生するか否か、色
成分における輝度成分での割当符号量か不足するか否か
、色成分における色差成分ての割当符号量が不足するか
が占かは、式(2)のa と式(3)のa の大小関係
と予測された量子化係数の大小によって容易に判断する
ことができるか、これは、つまりはシステムと画像によ
って決まるものである。 そこで、前述の関係から予測し7た色成分別の量子化幅
を用いて実際に符号化したときの各色成分毎の符号量の
比に、各ブロック毎の各基準割当符号;の各色成分毎の
比か合うよ−)に、チ#1(また前記量子化幅で符号化
を(T)ときの各色成分毎の発/1′R月mをJ″、2
式(2,) 、式(3) カらr−#IL、、:の予測
 した各色成分毎の発生符号量の比で、目的の紀行対量
を配分した後、各色成分において、各ブロック毎の統計
量に基づいて、更に比例配分する。このようにし、で、
各ブロック毎の基準割当符号量を決定すると共に、符号
化処理済みのブロックでの割当符号量の余った分を、以
降のブロックの割当符号Iに回すことにより、これに従
ってブロック毎の符号量制御を行いながら、符号化を実
施する。 この予測した各色成分毎の量子化幅を用いて実際に符号
化したときの各色成分毎の符号量の比に、各ブロック毎
の基準割当符号量の各色成分毎の比を合わせることによ
り、各ブロック毎の割当符号量は予測した量子化幅を用
いて実際に符号化したときの各ブロック毎の発生符号量
に極近いものとなり、色成分ともに良好な結果か得られ
る。 各色成分毎の量子化幅の予測は式(2)、式(3)から
線形予測すれば良い。 従って、この発明によれば、幅広い空間周波数の画像に
対し5、画質をなるべく損なわすに、簡単な回路により
一定の処理時間内で一定のη対量内に収まるように符号
化できるようになる。 〔実施例〕 以下、本発明の実施例について、図面を参照して説明す
る。カラー画像データを圧縮符号化する場合において、
予測した最適量子化係数で量子化し、これを符号化する
にあたり、輝度成分や色差成分等の各色成分毎に規定の
符号量範囲内に収まるようにそれぞれ符号化処理した場
合、色成分によっては符号量に余裕があり、他方では本
肥すると云ったことか生しることがあり、このような場
合では不足した色成分の側では高い周波数成分をカット
する事態が続出し、一方の色成分ではこのような事態が
生ぜずにむしろ符号量か余り気味であるというような不
合理が生じる。 本発明は最初に色成分に分離されたカラー画像データに
対して統計処理を行い、この統計処理により最適な量子
化幅の予測を行い、この統計処理により最適な量f−化
幅の予測と、各ブロックの基環″割当符号量の決定に必
要な統工1量を得る。そして、これらの情報をもとに、
各色成分毎(Y用、C用もしくはY用、Cr用、Cb用
)の最適な量子化幅の予測と各ブロックの割当符号量の
決定を行った後、実際の符号化処理を実施する。 このときの各ブロックの基準割当符号量の決定は、前記
予測した色成分別の量子化幅を用いて実際に符号化した
ときの各色成分毎の符号量の比に、各ブロック毎の各基
準割当符号量の各色成分毎の比が合うように、予測した
前記量子化幅で符号化を行うときの各色成分毎の発生符
号量を上記式(2)、式(3)から予測し、この予測し
た各色成分毎の発斗符号量の比で、目的の紀行対量を配
分し、各色成分において、各ブロック毎の統計量に基づ
いて、更に比例配分することで行う。符号化処理におい
では、色成分別の量子化幅を用いてブロック順に量子化
し、符号化処理済みのブロックテ(7) 111 当打
対量の余った分を、以降のブロックの割当符号量に回し
、なから調整しつつ、その割当符号量の範囲内に収まる
ようにブロック毎の符号量制御を行いつつLiJ変長n
号化を実施する。 初めに本発明を分かり品くするために、本発明の基本的
な考え方を説明しておく。すなわち、本発明は例えば、
1つのカラー画像(画面)を色成分別14分け、これら
色成分別のカラー画像データを所定画素数のブロックに
区分し、これら色成分別各ブロックを順に、ブロック単
位でそのブロックの構成画素のデータを直交変換して周
波数域分別に分離し、これを更に量子化し、圧縮符号化
し、圧縮符号化した各色成分の紀行対量が目的の符号量
に収まるように符号化するにあたり、最初に色成分に分
離されたカラー画像データに対して統計処理を行い、こ
の統計処理により各色成分別の最適な量子化幅の予測と
、各色成分別の発生符号量に基づく各色成分別の割当符
号量比例配分および各色成分別各ブロックの基準割当符
号量の決定に必要な統計量を得る。そして、これらの情
報をもとに各色成分毎の各ブロック別基準割当符号量を
定め、この各色成分毎の各ブロック別基準割当R+3量
内に収まるように各色成分毎の各ブロックについで符号
化処理を実施する。 符号化処理は予測した各色成分毎の量子化幅を用いて色
成分別に且つ、ブロック順に順次行い、その符号化出力
を見ながら、各ブロックの基準割当?TJ号;と、その
処理ブロックの1つ前の処理ブ「フックでの発生符号量
における割当符号量に対しての過不足量(繰り越し分)
を合わせて得られたそのブロックの割当符号量内に収ま
るように、可変長符号化によって得られる符号量を監視
しながら、符号化を進め %含め、発生符号量が割当符
号量に達するとそのブロックの符号化は終了させるか、
直流成分は割当符号量を越える場合でも必ず符号化させ
、そのときの割当符号量に対する過不足量を記憶、して
おき、次のブロックの符号化に移ってゆくというもので
ある。 統計処理は各色成分別の最適な量子化幅を予測するとと
もに、各色成分毎の符号量を最適に割振り、さらにこね
に基づく各色成分毎の各ブロック別基準割当符号量を決
定するための基準となる統J1量を得るだめのものであ
る。 統工1処理により得られた最適化された量子化幅を、次
の符号化処理で使用することで、はぼ目的の総荀号−に
近付けることかできるか、1画像のデータ量の上限が規
定されている場合、1・1イトはおろか、1ビツトでも
目的の符号量をオーバすることはできない。 そこて、ブロック毎の割当符号量による制御を行う。こ
ねは符号化を行−ンだときの符号量が目的の符号量をオ
ーバしたときの微調整に使用jるものであ−〕で、各ブ
ロック毎の標準的な割当符号量である基準割当符号量を
決め、この基準割当符号量に、そのブロックの1つ前の
処理ブロックでの割当符号量に対する発生符号量を差し
、引いた残りを繰り越し分として貰い、この繰り越(2
、分を加えて補正した割当符号量を当該ブロックでの符
号化処理の最大枠として、特別の場合を除き、これに収
まる範囲で符号化するよう符号化制御を行う。 この繰り越しによる割当符号量の調整は、符号化を行っ
たときの符号量かブロック毎に異なるので、余りの生し
るブロックではその余り分を、不足の生しるブロックに
融通して、全体として目的の符号量に収まるように合理
的に配分するためである。これにより、基準符号量をオ
ーバしたときの微調整の機能が得られることになる。各
ブロックの符号化において低い周波数成分から高い周波
数成分に順次、符号化しなから、ガイドライン(コブロ
ック当たりの割当符号量)を越えた時点で、それ以上の
高周波成分の符号化を打ち切る。 これは、視覚的な影響を最小にするために、各ブロック
の高い周波数成分から省略して行くためである。この交
流成分の打ち切りに関しては、高い周波数成分は特に周
波数か高くなる程、視覚的影響か少ないと云う傾向があ
ることを逆に利用している。 EOBを含めて発生した符号量か、割り当てられた符号
量よりも少なかった、あるいはぢようど同じだったブロ
ックは、問題なく符号化を終了、つまり、EOBを出力
する。このようにして、その余りが生したときは次のブ
ロックの基準割当符号量に加λ、このブロックでの割当
符号量とする。 途中でオーバーしてしまうブロックは符号化を打ち切り
、そのブロックの符号化を終了、つまり、EOBを出力
する。 極端に圧縮率を高くしない限り現実にはあり得ないか、
万一、与えられた割当符号量が直流成分さえも符号化す
るに足りない場合には、直流成分のみは符号化を実施し
、そのブロックの符号化を終了、つまり、EOBを出力
する。そして、足りなかった符号量は不足分として、次
のブロックに繰り越し、その不足分をそのブロックの基
準割当符号量から減じ、そのブロックの割当符号量とす
る。この時、E OBも符号の一つであるから、EOB
も含めて割当符号量内に収まるようにする。 このように、割当符号量を無駄にしないようにすること
も本発明の目的であり、発生符号量の割当符号量に対す
る余剰分を以降のブロックの割当符号量へと繰り越すと
ともに、統計量を得たときの各ブロック毎の統計量の比
か維持されるように各色成分毎の量子化幅の予測を実施
することにより、実際に発生する符号量に対して各ブロ
ック毎の割り当て符号量かより妥当なものとなり、各色
成分ともに良好な結果が得られる。 本発明は基本的には、「統計処理」と「符号化処理」の
2つを杓って符号化を終了する2バス方式と称する方式
を採用しているもので、ある量子化幅で量子化してこれ
を可変長符号化するに際し、各ブロックに割り当てた基
準割当符号量を一つの基準とし、各ブロックでの発生符
号量にばらつきかあるのを、次のブロックで吸収するこ
とで調整しようと云うもので、この調整したものを割当
符号Iとし、この割当符号量の範囲でブロックでの符号
化を実施し、割当符号量を越えるときはそのブロックの
符号化を打ち切るようにする。しかし、画像データは直
交変換により直流成分と交流成分に分解されおり、視覚
的に影響の大きい直流成分については符号量が仮に割当
符号量を越えてもn号仕打ち切りは行わす、次のブロッ
クでの割当符号量をそのオーバした分だけ差し引き、ま
た、交流成分に入って割当符号量をオーバする危険が9
−ニジた場合は符号化を打ち切る。また、符号化により
発生した符4−i量が割当符号量に満たないときはその
余剰分を、次のブロックの割当符号量に加えて、当該次
のブロックでの割当符号量を多くする。このようにして
、一つ前の処理ブロックでの符号量か割当符号量に灼し
て過不犀を住(、た場合に、その過不戻分を次のブロッ
クの割当符号量に反映させ、調整する。 一般に、特に空間周波数の高いあるいは低い画像の場合
において、各ブロックの統訓;に応して、画像あたりの
収めるべき目的の紀行対量を比例配分することによって
各ブロックの基準割当符号量を決定し、予測された各色
成分共通のひとつの量子化係数を用いて実際に符号化を
行う従来方式を採用すると、輝度成分のブロックにおい
ては割り当て符号量か不十分で色差成分のブロックでは
余分であったり、あるいはその逆になることかあり、符
号量の不十分たった色成分の方は符号化を途中で打ち切
られることになって、当然画質劣化か生じるか、本発明
によれば幅広い空間周波数の画像に対し、画質をなるべ
く損なわすに、筒中な回路により一定の処理時間内で一
定の符号量内に収まるように符号化できるようになる。 以上の原理を用いた本装置の実施例を説明する。 第1図に本発明による画像データの符号化装置をディジ
タル電子スチルカメラに適用した一実施例を、また、第
2図には本発明による画像データの符号化装置の構成を
それぞれブロック図で示す。なお、本発明とは直接関係
のないディジタル電子スチルカメラの機構は図示および
説明を省略する。 第1図に示すように、ディジタル電子スチルカメラ本体
(以下、電子カメラ本体と称する)1は画像を撮像する
撮像系40と、この撮影系40の出力に対し、所定の信
号処理を行う信号処理回路60と、直交変換、線形量子
化、fil変長符号化機能等を持ち、前記イ1号処理回
路60の出力を圧縮符号化1〜で出力する符す化回路8
0と、この符号化回路80により符号化された画像デー
タおよび量子化幅(またはこれに対応した情報)を記録
媒体7Iに記録する記録系70と、所望のデータ圧縮率
を設定人力するスイッチ30、システム全体の制御を司
る制御回路90とから構成される。 電子カメラ本体]の操作部には画像の圧縮率を設定する
スイッチ30か設けられており、スイッ・チ30は制御
回路90に接続されている。 前記撮像系40は光学像を結像するためのレンズ40a
と、CCD等の撮像素子40bとを備える。前記信号処
理回路60は増幅およびノイズ除去等を行うアンプBO
aと、アナログ信号をディジタル信号に変換する^/D
変換器60bと、)?AM等からなるバッファメモリf
ileと、色信号形成等を行うプロセス回路GOdとを
備える。符号化回路80は例えば、DCT  (離散コ
サイン変換)等の直交変換を行う直交変換回路4、線形
量子化を行う量子化回路6、可変長符号化としてハフマ
ン符号化を行うハフマン符号化回路8を伺え、更に量子
化幅−Y−測回路12゜符号量算出回路14、符号量割
当回路20、符号打切回路1Bおよび符号化回路80内
の制御処理を行う制御回路18とを有している。 前記記録系70はインタフェース回路70aおよび記録
媒体として用いられるICメモリを内蔵したメモリカー
ト71とからなる。メモリカード71は電子カメラ本体
1に対し、着脱可能となっている。 制御回路90はマイクロプロセツサ(MPtl)により
実現されている。 第6図に電子カメラ本体〕の外観を斜視図で示す。図は
双眼鏡形のものを示しており、48は操作部における1
、CI)  (液晶〕表示器、30は操作部におけるス
イッチ30であり、その他、テレ・ワイド切り替えスイ
ッチ、シャッタ操作ボタン50等が設けられている。ま
た、49はファインダである。 1−5CI)表示器48には制御回路90の制御のもと
に撮影モ・−トやコマ数、日4=j、時間等、種々の値
や状態か表示される。本電子カメラでは、電子カメラ本
体1の操作部に設けられたスイッチ30をa f’+す
ることにJ゛す、画像の圧縮率を所望の値に設定するこ
とができる。すなわち、制御回路90には予め標準的な
複数種の圧縮率情報か設定されており、これかスイッチ
30の操作により設定される撮影−11能枚数の値をも
Jに、2着されているメモリカー ド(記録媒体)の容
量から、適用する圧縮率を求め、この求めたH縮率の値
およびメモリカードに記録できる画像の枚数の値に換算
されて操作部のLCD表示器48に表示さゼるようにな
っている。そし2て、ユーザかスイッチ30を押すと、
制御回路90i;eスイッチ30か押される毎に、これ
らの値を変更する。 ユーザは表示される変更値を見ながら、所望の値のとこ
ろでスイッチ3oを押すのを止めるごとにより、制御回
路90はその時点での撮影iJ能両画像枚数指示値対応
する指示圧縮率を設定するようになっている。これは圧
縮率に応じて定まる画像当りの標準的な紀行対量を制御
回路90が求めて、これを目的n号jlia定情報とし
て符号化回路8oに与えることで行う。また、トリガス
イッチであるシャッタ操作ボタン50か押されることに
より、シャッタ機能がイ1動して撮像素子40bには被
写体像か結像され、撮像素子4()bにはこの像に対応
して屯伺像か蓄積されるので、これを読出し、制御する
ことて撮像素子AObから映像信号を得ることができる
。これらの制御も制御回路90か5]る、。 第1図における撮像系40は、撮影レンズ40aやCC
D等の撮像デバイスよりなる撮像素子40bを有し1、
前記撮影レンズ40aにより撮像素子40b上に結像さ
れた光学像を画像信号に変換して信号処理回路60に出
力するものである。信号処理回路60は増幅器60a 
SA/D変換器60b、バッフアメモリ60C1プロセ
ス回路80dか含まれ、このプロセス回路Hcfにより
前記撮像素子4Ωbにより得られた画像信号をカラー信
号のY、 R−Y  (以下、この1? −YをCr(
クロマレッド)と略称する) 、B−Y(以下、二〇B
 −YをCb(クロマブルー)と略称する)の各色成分
に分離させると共にガンマ補正やホワイトバラユ・ス処
理等を行うようにしである。 A/D変換器60bによりディジタル変換された撮像系
40の出力映像信号は、例えば、1フレ一ム分の容量を
有するバッファメモリ60eに画像データが格納され、
読ろ出されてプロセス回路60dに5入られることによ
り、輝度信号系であるV成分とクロマ(C5色差信号)
糸であるCr、 Cb酸成分分離される。バッフ7メモ
リ60e 1.1:格納された画像データは、例えば最
初に輝度系のf−号について統ま1処理を行うべく、プ
ロセス回路によりプロセス処理して画像信号のY成分デ
ータを得、これを符号化回路80に与えて、Y成分デー
タについての符号化処理を行い、該処理が終ったならば
、次にクロマ系Cr、 Cb酸成分データについてプロ
セス処理した後、符号化処理を行う。 f5号処理回路60にはブロック化機能があり、バッフ
ァメモリ60cより読み出さオL1プロセス処理されて
得たY成分用およびCr、 CI)成分用の画像データ
(17レーノ、分、若り、 <は1フイ一ルド分)を、
所定の大きさのブロックに分割するブロック化処理を行
うことかできる。ここでは例と(7てブロックサイズは
8×8画素とするが、このブロックサイズは8×8に限
るものではなく、またYとC(クロマ系)でブロックサ
イズが異なっても良い。 本実施例では、輝度系Yのデータを読出してブロック化
し、後段の処理系にljλて、このY成分データについ
ての統計処理を行わせ、該統計処理か終了したならば、
次にクロマ系Cr、 Cb成分のデータについての統計
処理に入るべく該クロマ系Crx Cb成分のデータの
読出しとブロック化に入る。 クロマ系のブロック化は、最初にCr成分の画像データ
についてすべてのブロック化を行い、その後に、cb成
分の画像データをブロック化して?うくものとする。 符号化回路80は第2図に示す構成とな−)ている。第
2図において、4は直交変換回路であり、ブロック化さ
れて入力された各画像データを受1:lて、この画像デ
ータに対し2、各ブロック毎に2次元の直交変換を行う
ものである。直交変換とし、ではコサイン変換、サイン
変換、フーリエ変換、アダマール変換などが使用できる
。直交変換を行うことにより、変換係数としての画像デ
ータか得られる。この変換係数としての画像データは直
交変換であるが故に、画像の持つ空間周波数を周波数成
分毎にう)解したデータとなる。 6は量子化回路であり、前記直交変換回路4の出力する
画像データ(変換係数)を受けると、第1回L]の量子
化では各色成分に応(、で予め設定された各周波数成分
毎の量子化幅に、撮影上〜Fに応して予め設定された量
子化係数aを掛けて補正した量子化幅で、変換係数の量
子化を行い、第2回目では前回の処理により決定された
最適量r化係数αを用いて量子化を行う構成とし、であ
る。 8は可変長符号化回路であり、可変良化ぢ化回路8は量
子化回路6の出力する前記量子化出力を可変長符号化す
るものである。可変長符号化としてはハフマン符号化、
算術符号化なとを利用する。可変長符号化ではブロック
毎の符号量、画像全体の石対量などか画像毎に変化する
。どのよらな可変長符号化を用いるかは本発明とは直接
関係が無いが、ここではハフマン符号化を使用したー・
例を示すこととする。 可変長符号化回路8ては、入力した量子化された変換係
数を第7図に示す順序てス4−ヤンするジグザグ・スギ
ナ〉と呼ばれる手法により、低い周波数成分から高い周
波数成分への走査を行う。 第7図の走査順序の 1番目の直流成分N)C]のデー
タは、直前に可変長符号化を行ったブロックの直流成分
との差分値を・1フマンね号化しで出力する。交流成分
[AC]については第7図の走査順序の2番目から64
番目まで順番に変換係数を見て行き、変換係数か0でな
い(すなわち、有効な)係数か出て来たらその直前に存
在した連続した0(無効)の係数の数(ゼロラン)とそ
の有効係数の値とで2次元のハフマン符号化して出力す
ると云った動作をする。 また、ある係数以降64番目の係数まで連続して無効係
数が続く場合はブロックの終りを示すEOB  (エン
ド・オブ・ブロック)の符号を出力する。また、打ぢ切
り信号が入力されると符号化を終了し、EOBを付加し
て出力する。そして、その各符号について発生した符号
長を符号量算出回路14に出力する。 符号量算出回路14は入力されたY、 Cr5Cb各色
成う)の各符号毎の符号長の積算を行い、Y、Cr、C
b各成分の各ブロック毎の符号量データの収集と、8包
成分毎の符号量と、画像全体の符号量を計算し、この各
色成分毎の符号量と画像全体の符号量のデータについて
量子化幅予測回路12に出力すると共に、各色成分毎の
符号量と画像全体の符号量のデータについてはn対量割
当て回路20に出力する構成とし、である。 量子化幅予測回路12は第1バスの開始にあたり、制御
回路18から目的とする符号量の情報を受け、この符号
量情報から先に説明した(4)式に基づく log (BRy  →BRe )  ;a  X l
og SF+b但し、BRは符号量0画素あたりのビッ
ト数)、SFは量子化係数、a、bは定数。 の関係を用いて量子化係数αの初期値を設定11、量子
化回路6に出力し、史には第2ノτスの開始に先駆けて
、n対量算出回路14から人力さ才また画像全体の符号
量と、1画像当りの許容される最入、′7)データ量で
ある目的縁符号量とから、例スば、<2)式、<3)式
の関係を用い、線形予Mjにより目的縁符号量に近づけ
るのに最適な色成分毎のQ f化係数aを、今回実際に
使用(7、たffi ’F化係数を勘案して予測するも
のである。 ここで、量子化係数を如何にして最適な値にするかが、
重要な課題となるので、この点について少し説明する。 画像データを前処理し、この出力を量子化し、この量子
化出力を可変長符号化する場合、この量子化の量子化幅
を変化させると発生する符号量が変化することは良く知
られている。これは、ハフマン符号化に代表される可変
長符号化は、符号化するデータの発生確率の偏りを利用
してそのデータを表現するのに必要な符号量を減少させ
ると云うものであることから、前記「量子化幅を変化さ
せる」と云うことは、量子化値の発生確率を変化させる
ことでもあるから、量子化幅を変化させることにより発
生符号量も変化することがわかる。 ところで、同じ量子化幅で同一の符号化を行っても1.
そのときの画像データによって発生符号量は異なる。L
、かし、]っの画像データに対して量子化幅を変化させ
て同一の6号化を行った場合は量子化幅と、発生符号量
との間には一定の関係が得られる。また、多くの画像デ
ータで量子化幅と発す符号量の関係を求めると、最も発
生軸度の高い関係か統計的に得られることが明らかにな
った。 具体的には多くの場合、次の関係が得られた。 すなわち、ある量子化幅に対する相対的な比をSFとし
、発生符号量1画素あたりのビット数(ビットレート)
で表わしてこれをBRとすると上記(1)式の関係が成
立する。(1)式において、aは同一の符号化であれば
、画像によらず略一定であり、bは画像に依存する。こ
のbの値は画像により、一定の分布を持ち、この発生頻
度分布から代表的なりが得られる。 故に(1)式の関係から最適な量子化係数を求めること
ができる。 上記符号量割当回路20は符号量算出回路14から入力
された各色成分毎の画像データの符号量、各色成分別品
ブロック毎の符号量、画像全体の符号量と、目的紀行号
量とから各色成分別品ブロック毎の基準割当符号量を算
出して符号化打切回路16に出力するものである。具体
的には、量子化幅予測回路12が予測した色成分別の量
子化幅を用いて実際に符号化したときの各色成分毎の符
号量の比に、各ブロック毎の各基準割当符号量の各色成
分毎の比か合うように、予測した前記量子化幅で符号化
を行うときの各色成分毎の発生符号量を上記式(2)、
式(3)から予測し、この予測した各色成分毎の発生符
号量の比で、目的の総符号量を配分した後、各色成分に
おいて、各ブロック毎の統計量に基づいて、更に比例配
分する。このようにして、各ブロック毎の基準割当符号
量を決定する。 なお、各色成分別品ブロック毎の符号量の比で、目的総
符号量を比例配分する方法は、例えば、あるブロックの
符号量と目的総符号量との乗算をイjい、それを画像全
体の符号量で割ることにより、そのブロックの基準割当
符号量を決定するか、或いは、目的総符号量を各色成分
別符号量で比例配5) L、こねをその包成分各ブロッ
クの発生符号量で比例配分する。 この結果、各ブロックの基準割当符号量は色成分別の量
子化幅を用いて実際に符号化したときの各色成分毎の符
号量の比に、各ブロック毎の各基準割当符号量の各色成
分毎の比が合うように、目的の総符号量を配分され、こ
れを更に色成分別品ブロック毎の予測符号量で比例配分
した符号量となり、そのブロックでの実際の符号量に応
じた符号量に相応に多く割り当てられる。 符号量割当回路20は符号量情報テーブルとブロック割
当符号量データテーブルとを持ち、符号量情報テーブル
における該当ブロック位置の符号量情報を符号量算出回
路14がら入力された符号量情報に書き替える一方、符
号m算出回路14がら入力された各ブロック毎の符号量
および画像全体の符号量と、目的総符号量および量子化
幅予測回路12から与えられる色成分別子?91!了化
係数αとがら上述のようにして各色成分別各ブロックの
基準割当符号量を算出し、この算出した各ブロックの基
準割当符号量のデータをブロック割当符号量データテー
ブルに格納する。このブロック割当符号量データテーブ
ルの各ブロック別の基準割当符号量は、該当のブロック
が可変長符号化処理される際に符号化打切回路16に−
りえられる。 符号化打切回路16は、符号量割当回路20からの上記
該当ブロックの基準割当符号量に、このブロックの1つ
前に処理したブロックでの割当符号量に対する発生符号
量の差である過不足量を、前ブロックからの繰り越し分
として加えて、この該当ブロックでの割当符号量とする
と共に、符号量割当回路20からの各ブロックの符号長
を割当視対量から減算し、割当符号量の残りが、送出す
べき符号量とEOBの符号との合計符号量より小さくな
った場合には打切り信号を出力して可変長符号化回路8
に与え、そのブロックの符号化を終了し、該ブロックの
割当符号量から送出した符号量を減じてその値を割当符
号量の余りとして保持すると云った機能を有する。従っ
て、符号化打切回路16ではこの割当符号量を参照し、
入力された送出すべき符号量およびEOBの符号を送出
しても割当符号量を越えない場合は、打切りは行われず
、そのブロックの杓−帰化を終了し、該ブロックの割当
符号量から送出すべき符号量を減【、て、その鎖ヲ割当
符号量の余りとして保持すると云った動作を行う。また
、符号化打切回路16ではこの割当荀対量を参照し、入
力された送出すべき直流成分の符号とEOBのね号を送
出するのに割当符号量が十分でない場合には、二の2つ
の符号を送出し7た後、そのブロックの符号化を終゛γ
し7、該ブロックの割当符号量から送出した符号量を減
する。すなわち、割当符号量の余りは負の値として保持
すると云−)た動作を行う。 10は符号81力回路であり、このn号出力回路10は
可変長符号化回路8より人力される可変長の符号をつな
ぎ合わせるもので、この繋ぎ合わせた符号をメモリカー
ド等の記録媒体にて構成される記録系22に書き込むよ
うに機能する。 本システムでは撮影モードに応して定めた各色成分に共
通な初期時用標準の量子化係数αを使用【、て最初に統
J1処理を行い(第1バス)、最適化するに必要なブロ
ック毎の情報量や各色成分毎の情報量、画像全体の情報
量等を調べ、次にこの統計処理により得た情報をもとに
最適化された符号化を行うための処理に入る(第2バス
)。そのため、最初に画像のブロック化、このブロック
化された画像の要素に対する各色成分に共通な標準の量
子化係数αを使用しての量子化、量子化により得られた
変換係数の可変長符号化、そして、この可変長符号化に
より得られる各ブロックの各要素の符号量情報と、各色
成分毎の符号量と、画像全体の符号量情報より、各色成
分毎に最適な符号量にするのに必要な符号化係数αの予
測、各色成分毎に割り当てる符号量の比例配分、この配
分された符号量とその色成分の各ブロックでの発生符号
量に基づく該各ブロックに対する基準割当符号量の決定
、これらに基づく処理対象画像への最適符号化の処理モ
ードへの移行、この処理モードの実施における画像のブ
ロック化処理、このブロック化された画像の要素に対す
る前記各色成分毎の予測量子化係数αを使用しての量子
化処理、この量子化により得られた変換係数の口[長符
号化、各ブロックに対する基準割当符号量とそのブロッ
クの1つ前の処理ブロックからの繰越符号量を加えた割
当符号量内での当該可変長符号化処理制御、処理対象画
像の符号化情報の保存のため、当該可変長符号化処理制
御されて得られた可変長符号符号情報のの出力処理と云
った手順を実施させるが、その全体の制御管理は図にお
ける制御回路18により行うようにしであるものとする
。尚、制御回路18のこのような機能はマイクロプロセ
ッサ(MPLI)を使用することで容易に実現できる。 以上か符号化回路80の構成である。 第1図における記録系70はインタフェース回路70a
と、これに着脱自在に接続される記録媒体7】があり、
符号化回路80により符号化されて出力された画像デー
タおよび量子化幅(またはこれ≦こ対応した情報)はイ
ンタフェース回路70aを介して記録媒体71に記録さ
れる構成となっている。 次に上記第1図および第2図に示す構成の本装置の作用
を説明するが、全体の概要を掴むt:めに初めに動作遷
移図である第8図を参照して基本動作を説明する。 カメラの使用者かカメラを使用するにあたり、スイッチ
30を操作して所望とする撮影i:lJ能枚数を設定す
る。これにより設定撮影可能枚数に応じ、制御回路90
か最適符号量を求めて、これを目的符号量設定情報とし
て符号化回路80に与える。このよつにして撮影可能枚
数が設定される。 次に撮影を行うと、撮影レンズ40aの後方におかれた
撮像素子40b上に被写体像が光学像として結像される
。そして、この撮像素子40bはこの結像された光学像
を画像信号に変換して出力する。 撮像素′f′−40bによりj−リらtまた画像信号は
信号処理回路60に入力され、ここで信号処理回路60
内の増幅回路Boaによる増幅、A/D変換器6obに
よる^/D を換後、バッフアメセリ6oeに一時保持
される。そして、この後、・くラフアメモリ60eから
読み出され、信号処理回路60内のプロセス回路60d
により帯域補正、色信号形成等の処理か5われる。 ここで、後の1パス目の処理かV(輝度成句) 、Cr
、 Cb(クロマ系、いずれも色差成分)信号の順序で
行われるため、色信号形成もこれに合ゎせて杓われる。 すなわぢ、画像信号は8×8画素のマトリックスでブロ
ック化さ才して読み比され、プロセス回路ではこのブロ
ック化された画像(5号データから Y成分、Cr成分
(1?4成分) 、Cb酸成分 B−Y成分)の順序で
これら各色成分の信号を分離させると共に、ガンマ補n
やホワイトバランス処理等を行う。 プロセス回路Godにより分離された8×8のマトリッ
クスのブロック化画像信号における各色成分の画像信号
データは、符号化回路80に入力される。これにより、
1フレ一ム分(若しくは]フィールド分)の画像データ
は、上記所定の大きさのブロックに分割されて順次、符
号化回路80に入力される。尚、プロセス回路60dに
より処理された各色成分の画像信号は、Y、 Cr、 
Cbの各色成分別にバッファメモリに記憶させ、後の処
理において、読出して使用するようにし、でも良い。 本実施例では、(に号処理回路60からは]画像性の画
像信号データにおける)′成分(輝度成分)について出
力か行われ、これについての後段での処理(統計処理)
か済んだ後に、次にCr成分の画像データについて総て
のブロック化を行い、これについて後段での統計処理を
行い、その後に、eb酸成分画像をブロック化し、これ
について後段での統計処理を行ってゆくと云った処理を
行う。 符号化回路80では、信号処理回路60より受けたこの
入力データを直交変換回路4に与える。すると、直交変
換回路4はブロック化された入力画像データ(以下、ブ
ロック画像データと呼ぶ)に対し7、各ブロック毎に例
えば、離散コサイン変換(DCT)による2次元の直交
変換を行う。このDCTによる直交変換と云うのは、あ
る波形を周波数成分に分割し、これを入力サンプル数と
同じ数だけの各々異なる周波数のコサイン波で表現する
と云った処理である。 そして、直交変換されたブロック画像データ(変換係数
)は図示し5ないバッファメモリにおける8×8のマト
リックス上の対応する周波数成分位置に格納され(マト
リックスの原点位置が直流成分、それ以外は交流成分で
原点位置より離れるに従い周波数が高くなるような関係
を持たせたマトリックスに格納する)、これか量子化回
路6に入力される。 すると量子化回路6は、このブロック画像データ(変換
係数)に対して1バス目(第1回目)の量子化を行う。 この第1回目の量子化では、予め設定された各周波数成
分毎(周波数成分はブロックの各マトリックス位置に対
応して決まる)の量子化マトリックスに対し、撮影に当
り使用者が設定した画質設定値に対応して制御回路1B
より与えられる標準(暫定)の量子化係数αを掛けた量
子化幅で、変換係数の量子化を行う(第8図(hl 、
 i))。この時の量子化マトリックスは輝度系とクロ
マ系とでそれぞれで同しであっても良いが、それぞれに
適した量子化マトリックスを設定する力が良い結果が得
られる。 量子化されたブロック画像データ(変換係数)はiil
変長ね帰化回路8に入力され、ここで、ri1変長n号
化される。司変長符号化回路8ではmf化されて入力さ
れた変換係数を第7図に示す順序でジグザグスキャンし
、低い周波数成分から高い周波数成分への走査を行う。 すなわち、変換係数は8×8のマトリックスに、周波数
成分に対応して格納されており、瞑点に近いほど、周波
数が低いので、ジグザグスキャンすることで低い周波数
成分から高い周波数成分へと走査できる。 第7図の走査順序の1番目のデータは直流成分DCであ
るから、この直流成分DCのデータは直前に可変長符号
化を行ったブロック(一つ前のブロック)の直流成分D
Cとの差分値djrf−DCをノ1フマン符号化する(
第8図(di)、 (el、))。 交流成分A、Cについては第7図の走査順序の2番目か
ら64番目まで順番に変換係数を見て行き、変換係数が
0でない(すなわち、有効な)係数が出て来たらその直
前に存在した連続した0(無効)の係数の数(ゼロラン
)とその有効係数の値とて2次元のハフマン符号化を行
う((d2)、 (e2))。 また、可変長符号化回路8は、ある係数以降64番目の
係数まで連続して無効係数が続く場合はブロックの終り
を示すEOB  (エンド・オブ・ブロック)の符号を
′すえる。そ(5て、そのR”yについて発外した符号
長を符号量算出回路14にH4力する(gl)。 1画像分の全ブロックについてこのような処理を人イデ
して行く。 Y成分についてのこのような処理か終j′し7たなら、
次にCr、 Cb各成分についCも同様の処理イ行う。 一方、符号量算出回路14は入力さtしたYSCr、C
b各成分の各色成分毎に1画像全体の符号量の計算をす
べく、)゛、Cr、、、Cb各成分の各ブロック毎の一
符号量の算出と、その符号量の各色成分毎および画像全
体についての積算を行う(g2)と共に、各ブロック毎
の符号量のデータを符号量割当回路20に出力する。符
号量割当回路20はこの各ブロック毎のη対量のデータ
を符号量情報デープルにお1フる該当ブロック位置の符
号量情報と
[1. in
Huffman encodes the difference value with the flow component of the neighboring block
do. The AC component is a low frequency called zigzag scan.
Scans from several components to high frequency components and disables (value
or 0) and the number of subsequent effective components.
Perform two-dimensional Nofman encoding from the values. With just this basic part, Huffman code, which is variable length encoding, is
Because encoding is used, the amount of code is not constant for each image.
turn into. Therefore, the following method was proposed as a method for controlling the amount of code.
ing. First, while processing the basic part mentioned above,
Determine the total amount of code generated for the surface. The DCT coefficient is calculated from this total code amount and the target code amount.
The optimal quantization width to get close to the desired code amount is determined.
Predict. Next, using this quantization width, the amount of the basic part is
Repeat the process after childization. 5.The total number of codes generated this time and the total number of codes generated last time.
The target code amount is again approximated from the code amount and the target code amount.
Predict the optimal quantization width for Then, this predicted quantization width and the previous quantization width are full.
The travelogue that occurred this time is closer to the minute and the amount of code is higher than the target code amount.
If the number is less than or equal to
Ru. If not, process using a new, higher quantization width.
repeat. Quantization width is the relative quantization characteristic for each frequency component.
Prepare a quantization matrix, which is the basic form representing
Required by multiplying the quantization matrix by the quantization coefficient
obtain a quantization width. Specifically, first the standard quantization
The quantum in the basic part mentioned above is determined by the quantization width obtained using the number
This is then variable-length encoded7, resulting in
information on the total code amount and the preset limit that should be stored.
The target total code amount is compared with the target total code amount.
When the quantization width is reached, the final encoding process is performed using that quantization width.
If the target total code amount is not within the target total code amount,
For example, linear prediction is performed from the total generated code amount and the target total code amount.
Find the optimal quantization coefficient that approaches the target total code amount by
, From the obtained quantization coefficient and quantization matrix,
Calculate a more optimized quantization width 7 and use this to create the final
Performs encoding processing. In this way - Toca method, the quantization width is
Make changes. However, with the code amount control method described above, the basic part of encoding
Because the number of times the minute bus is repeated varies depending on the image.
Not only is the processing time unstable, but the processing time is longer than that required for boat fishing.
There was one drawback that it required a long period of time. Therefore, the inventors proposed the following method to solve this problem.
proposed a method like this. (Special application flat), -2837B
No. 1, see Japanese Patent Application No. 137222/1999)
The compression method is a combination of orthogonal transformation and variable length encoding.
In order to control the amount of code generated in the formula, image memo is
Divide the sampled image signal stored in the memory into blocks.
, After performing orthogonal transformation for each divided block,
After quantizing this conversion output with a provisional quantization width, this
In addition to variable-length encoding the quantized output,
Calculate the generated code amount and the total generated code amount for the entire image, and then
The provisional quantization width, the total generated code amount, and the purpose.
A new quantization width is predicted from the total code amount. Also
, the amount of codes generated for each block, and the total number of codes
The allocation for each block is calculated from the amount of code and the total code amount
Calculate the amount of code. Then, using a new, higher quantization width,
Then divide the image signal in the image memory into blocks again and perform orthogonal transformation.
, quantization, and variable length encoding, as well as the generation of each block.
If the raw code amount exceeds the allocated code amount for each block,
Stop variable length encoding midway and start processing the next block.
Move. This allows you to determine whether the total amount of code generated for the entire image or the total amount of code for the purpose is
If you do not exceed the code amount, first, as shown in (a),
One frame of image data (as exemplified in the international standardization proposal)
The frame image is 720 x 576 pixels)
A block of a predetermined size (for example, 8x8 pixels or more)
) into blocks A, B, C, etc., as shown in (b).
As an orthogonal transformation for each divided block,
Performs two-dimensional DCT (fi scattered cocosine transform, 8×8
are stored sequentially on a matrix. Image data is two-dimensional
When viewed from the back side, frequency information based on the distribution of gradation information can be seen.
It has a spatial frequency that is a signal. Therefore, by performing -F DCT, the image data becomes
It is converted into a direct current component DC and an alternating current component AC.
There is a DC component DC at the origin position (0,0 position) on the
There is a detector indicating the value of , and at the 0.7 position there is a
The data indicating the maximum frequency value of the alternating current component AC is, and
, the maximum frequency of the alternating current component AC in the vertical axis direction is at the 7.0 position.
Furthermore, the data indicating the value is diagonally crossed at the 7.7 position.
Data indicating the maximum frequency value of flow component AC is stored respectively.
At the intermediate position, the relationship (1
Frequency data in the direction of eclipse is displayed sequentially from the origin side.
It will be stored in such a way that higher frequencies will appear.
. Next, the stored data for each coordinate position in this matrix
By dividing by the quantization width for each frequency component,
Linear quantization is performed according to each frequency component (C), and this amount
Variable length encoding is applied to the child value (7) and Huffman code is applied.
make a change. At this time, regarding the DC component DC, the neighboring block
The group number (number of additional bits) is
) and additional bits, and the group number is expressed as
The resulting codeword and additional bits are combined and encoded.
as encoded data (di, d2. el, e2)
. It is also not valid for alternating current component AC (value is not “0”).
) Coefficients are expressed by group numbers and additional bits. Therefore, the alternating current component AC is called zigzag scan.
Scans from low frequency components to high frequency components.
, the number of consecutive invalid (value 0') components (the number of zero runs)
), followed by the group number of the valid component value.
Two-dimensional Huffman encoding is performed, and the resulting code word and addition
The bits are combined to form encoded data. Huffman encoding is the above DC component D per frame image.
Occurrence in each data distribution of C and alternating current component AC
Focusing on the peak frequency, the more
, reduce the number of data bits to around 1-1.
Data is allocated in such a way that the number of bits is increased.
This is done by encoding the data [7] to obtain a code word. The above is the basic part of this method. In this basic part, Huffman code, which is variable length encoding, is used.
Because encoding is used, the code is not constant for each image.
Therefore, we will use a method of controlling the amount of code, and for example,
, process as follows. First, using the provisional quantization coefficients, the predetermined quantization
Each cycle obtained by multiplying the matrix and the quantization coefficient
It is the same as processing the basic part above using the quantization width for each wavenumber component.
At the same time, the total code amount (total bits) and number of bits generated for the entire screen is calculated.
Melt (g). This total code amount, the target code amount, and the usage
An estimate of the DCT coefficients from the provisional quantization coefficients etc.
Predict the optimal quantization coefficient to get close to the target code amount
Sur (h). Next, using this quantization coefficient, (i)
Repeat the process after quantization of the basic part described above. and,
The total amount of code generated this time, the total amount of code generated last time, and the target
The target code amount, the quantization coefficient used this time, and the
From the quantization coefficient obtained, the target code amount is again subtracted by 1.
Newton-Raphson Itare to find the optimal quantization coefficient for
- Jizun (Nekeiton Raphson 11erra
tion). And this predicted quantization coefficient and the previous quantization coefficient?
Close enough and the amount of code that occurred this time (also
If the total amount of code is small, the process is terminated and the current occurrence is
Output the encoded data and store it on the memory card.
(f). If not, change the quantization coefficient to 1 and
The process is repeated using the new 7 quantization coefficients. However, with the code amount control method described above, the basic part of encoding
Because the number of times the minute bus is repeated varies depending on the image.
Not only is the processing time uncertain, but the processing time is also shortened to boat fishing.
The disadvantage was that it required a long period of time. Therefore, the present inventors
I solved this using the following method. First, using the provisional quantization coefficients, the predetermined quantization
The matrix is multiplied by the jl 'T-ization coefficient, and the result is
The basic part is processed using the quantization width for each frequency component.
At the same time, the total code amount (total number of bits) generated for the entire screen is calculated.
) and calculate the generated code amount for each block (gl). this
The total code amount, the target code amount, and the tentative code size used.
Approach the target code amount for DCT coefficients from conversion coefficients, etc.
Predict the optimal quantization coefficient for (hl). Also, total sign
code amount, target code amount, and generated code for each block
Calculate the allocated code amount for each block by proportional allocation from the amount.
(h2). Next, using the predicted quantization coefficients H)
, repeat the basic processing described above. That is, the image again
Divide memory image signals into blocks, orthogonally transform, quantize,
In addition to variable length encoding, the amount of code generated for each block is
If the amount of code allocated to each block is exceeded, it can be changed midway.
Stop long encoding and move on to processing the next block. Then, finish the above process for all blocks with
After that, output the encoded data generated this time and store it in the memory card.
(f). [Problems to be solved by the invention] As mentioned above, for example, digital electronic still cameras
Natonioi uses one memory card or magnetic disk.
Images that can be recorded on a disk device or a single magnetic tape, etc.
The number of images must be guaranteed, so
The image data is compressed and recorded, but this processing is not recommended for ease of use.
The processing time must be as short as possible and constant.
Ru. It is also desirable to be able to compress image data with high efficiency.
will be included. These are not limited to digital electronic still cameras.
This is also required in many other applications.
It is an item. Therefore, the above-mentioned compression method satisfies such requirements.
There is also the International Standards Laboratory 7j method, and in this method, the above-mentioned standard
Orthogonal transformation and variable length for each block as illustrated in this section
Methods that combine encoding can highly compress image data.
Although it can be done efficiently, because variable length encoding is used,
The amount of code is not constant, and one memory card or magnetic
recorded on a recording medium such as a disk or a piece of magnetic tape.
The drawback is that the number of images that can be stored is indefinite. Ta. In addition, as a conventional technique that does not solve the two problems, the above-mentioned
Codes being considered for international standardization of still + L image coding
Is there an amount control method? In this method, the basic part of encoding is
The number of times the bus is repeated varies depending on the image, so
Since the fishing time becomes undefined, I decided to go fishing on a boat.
The drawback was that it took a long time. The inventors have proposed a method to solve this problem.
Japanese Patent Application No. 1-2837B1 and Japanese Patent Application No. 2-1.372
There is method number 22. This proposed method is usually
, very good results can be obtained or the system to be applied
Therefore, if the spatial frequency is particularly low ts or particularly high
The quality of the image deteriorated slightly7, and the amount of generated code was below the target level.
? The gap to the No. 1 amount is slightly larger than usual.
This happens very rarely. The cause of this will be explained. As mentioned above, the amount of change is 1.
is the basic expression that represents the relative quantization characteristics for each frequency component.
The quantization matrix in the form 1 is multiplied by the quantization coefficient.
When expressed in terms of
There is another relationship. log BR-a log SF+ b-(1) where
, BR is the code per pixel Jfl (bi-sotorate)
, SF is a quantization coefficient, a and b are constants, and a is a special
It is highly dependent on the system, and the image quality is very high.
Depends on it. When quantizing a color image separated into color components, the color components
For example, multiple quantization matrices, e.g.
and two quantization matrices for color difference and
, if a common quantization coefficient is used, then 10g BR-a log sp+ b ,
-=(2)y y 1ag BR-a log SF+ b c
... 3) The relationship will be like CC. In addition, in each of the above formulas, BR. Add y5C to a and b to distinguish between brightness and color difference.
It is. Here, if a − a, then ! og(BR1BR) c by bc -a log SF+(10+IO)-a log
Like SF+ b - (4)
The amount of code allocated to each block is determined using the statistics.
Is it okay to obtain the target code amount by proportionally distributing it according to the
Recognize. In the normal case, aZ:a or the system y
Depending on c, in very rare cases the size of a and a may be quite large y
c There is something different. In other words, the total code amount log BR is plotted on the Y axis, and the quantization coefficient l
og SF on the X-axis and the relationship between equations (2) and (3)
The result is as shown in Figure 10, and the quantization coefficient log 5P
The magnitude of the total code JllogBR according to IN= is the luminance system and
There is a slight difference in color difference. If you look at Figure 10, you will see that
The quantization coefficient when encoding, that is, the predicted optimal value.
If the quantization coefficient is particularly large or small,
In other words, especially for images with high spatial frequencies,
In the case of low or low images, the statistics of each block
Allocate by proportionally distributing the target code amount according to
Once the code amount is determined, the predicted quantization coefficient is used to
When actually encoding the luminance component block,
If the number of blocks of color difference components is
Then it becomes redundant, or vice versa. Is there a shortage of allocated code for the luminance component or for the chrominance component?
Whether there is a shortage of allocated code amount in a:2a
Size matters! :, % r - measured m f coefficient V
C Depends on the total size. , From the cause, to the applied scenario,...
For images with particularly low or particularly high spatial frequencies, young
The image quality deteriorates and the amount of code generated is less than the target amount of code.
In some cases, the gap was slightly larger than usual.
. Therefore, the purpose of the present invention is to obtain a spatial frequency distribution.
Even if the image has a skewed tendency, it can be used without sacrificing image quality.
Encoded within a certain amount of code within a certain processing time
Image data encoding device and encoding capable of
The purpose is to provide a method. [Means for Solving the Problem] In order to achieve the above object, the present invention is configured as follows.
. In other words, color image data separated by color component.
Divide each into blocks of a predetermined number of pixels, and divide each color component into blocks.
Perform orthogonal transformation for each divided block in order to generate frequency.
Convert this converted frequency component into separate data.
The data is quantized by quantization means, and then this
The quantized output of can be given to l'lJ variable length coding stage J'.
When encoding image data using variable length encoding, first
Temporarily quantize with the specified quantization width and encode with variable length code.
, perform statistical processing to obtain the code amount for each block, and then perform the following steps.
The code amount for each block obtained by statistical processing and the image
This total code amount target value is calculated from the total code amount target value of
optimal quantization width and amount of code allocated for each block
and each block is determined according to the determined optimal quantization width.
This quantization is performed while quantizing the conversion output for each block.
The output is divided into blocks according to the allocated code amount for each block.
Sequentially perform variable length encoding with i'=1 while controlling the code amount.
In the coding system that performs coding processing, firstly, based on the variable length coding output during the statistical processing,
Calculation means for calculating the code amount of each block for each color component
and each color component when the optimal sonization width is quantized L5.
For each "f-colorimetric colorimetric component code amount"
The total code; 1-] is distributed proportionally to the target value, and each color component is given a separate code.
Once the quantity is determined, this is used as the calculated value of the calculation means.
Therefore, the standard code of each block for each color component is proportionally distributed.
Determining means for determining the amount and encoding processing H4jζ
Determining means L 7 Determined reference code for each block for each color component
of the block is then encoded using the amount
In the processed block processed before the target block
The amount of code generated by encoding and the processed block
The difference between the allocated code amount and the allocated code amount is calculated and used as the
The code amount obtained by adding the code amount to the standard code amount of
is assigned as the allocated code amount for the target group τ-hook.
an allocation means for assigning and encoding processing in the target block;
the said allocation allocated by said allocation means in the process;
The above-mentioned variable-length encoding is discontinued so as not to exceed the code amount.
and terminating means. Second, the EiJ variable length encoding output during the statistical processing
Calculate the code amount of each block for each δ hull component based on
together with the total number of codes for each color component and the total number of codes for the entire image.
8 means, the total code amount target value and the % output
The optimum quantization width for each color component is determined by Y based on the calculated value of the means.
- a quantity to be measured J1 quantization width Y-II means and the optimum quantization width
Predict the code amount for each color component when quantized with 1, and calculate each of these
Compare the target total code amount based on the predicted code amount for each color component.
In addition to determining the amount of code for each color component,
Proportional distribution is made according to the calculated value of the calculation means, and each color component is
Determining means for determining the reference code amount of each block and encoding
Each block for each color component determined by the determining means during processing.
Using the reference code amount of the block, the next code amount of the block is
Processed blocks processed before the target block to be processed
Amount of code generated by lock encoding and the corresponding processing completed
Find the difference with the allocated code amount in the block and process it as described above.
obtained by adding it to the reference code amount of the target block.
The amount of code allocated to the block to be processed is the amount of code allocated to the target block.
the allocation means for allocating the
before being allocated by the allocation means in the encoding process.
Variable-length encoding is performed so as not to exceed the allocated code amount.
and terminating means for terminating. Thirdly, for each of the above first and second configurations,
Furthermore, select the desired compression ratio and
The target amount of code that should be accommodated according to the compression rate and the provisional amount
Compression rate selection means for determining the desired quantization width is provided.
. Also, fourthly, each of the above first and third configurations
Furthermore, the quantization means has a
Quantification is the conversion of each frequency component obtained by the orthogonal transformation.
When performed using data of low frequency components of data,
In both cases, the IjJ variable-length encoding means has the orthogonal transform.
The image data of each block obtained for each frequency component is
Of the data by frequency component of the motor, for the DC component,
In addition to obtaining the difference with the DC component in the previous processing block,
a DC component encoding processing unit that variable-length encodes the difference between
, after the encoding processing unit has finished processing this DC component.
, for the AC component to be variable-length coded for the AC component.
an encoding processing section, and the encoding aborting means is an AC
It is provided only in the component encoding processing section. Fifth, color image data separated by color component.
The data is divided into blocks of a predetermined number of pixels, and the divided blocks are
After sequentially performing orthogonal transformation for each block, the output of this transformation is
quantization means, and then this quantization output is variable.
The data is encoded by applying variable length encoding to the long encoding means.
When performing
and the percentage for each block determined from the statistics for each block.
The code amount is controlled for each block according to the code amount.
When performing variable length encoding, the quantization is temporarily
This is done using the quantization width, and the resulting quantization output is
Entire image required for encoding and optimization
The first step is to check the code amount for each block and the code amount for each block.
step and the code amount of the entire image obtained in this first step
The second step is to predict the quantization width required for optimization from
and each color when quantized with the predicted optimal quantization width.
The amount of code for each component is predicted, and the number of codes for each predicted color component is calculated.
Then, the total code amount target value is proportionally distributed5, and each color component is divided into
Determine the amount of code and apply it to the code of each block.
Proportional allocation based on quantity, standard allocation code for each block
The first step of calculating the amount and the predicted quantization width
a fourth step that performs the quantization for each block using
step and for each block in this fourth step.
The quantized output fits within the allocated code amount for that block.
a fifth step of variable length encoding in the range;
The block currently trying to perform variable length encoding processing in step
Variable-length encoding of the lock's most recently processed block.
Find the difference between the amount of code and the amount of code allocated for this block.
, use this as the carryover amount for the block that is currently being processed.
Add it to the standard allocated code amount in the lock, and add it to the current processing
The sixth step is to set the allocated code amount in the block to be
It consists of a top and a top. Sixthly, in the fifth case, the first step
In the step, the quantization is performed using a provisional quantization width.
, perform encoding processing on the quantized output obtained by this.
, the amount of code for the entire image and each color component required for optimization
Check the amount of code for each block and the amount of code for each color component.
In the second step, this first step
Optimization is performed from the obtained code amount for the entire image and the code amount for each color component.
In addition to performing f-measurement of the necessary quantization width for each color component,
In step 3, quantization 1 is performed using the predicted optimal quantization width.
7, predict the code amount for each color component, and calculate the amount of code for each color component.
proportionally allocating the total code amount target value based on another code amount,
Determine the amount of code for each color component, and apply this to each color component.
Proportional distribution is performed based on the code amount of each block, and each color component is
The standard allocated code amount for each block is determined, and the fourth step
In the step, the predicted quantization width for each color component is used.
perform the quantization for each block for each color component, and
In step 5, each color formation in this fourth step is performed.
The quantized output for each block is
In addition to performing variable length encoding within the allocated code amount,
In step 6, the current variable in the fifth step is
Processed immediately before the block to be long encoded
Code amount by 61 variable length coding in block and this block
Calculate the difference between the amount of code allocated in the
...The above in the block that is currently being processed
The block to be currently processed is added to the standard allocated code amount.
The procedure is to allocate the amount of code in the lock. Seventhly, color image data separated by color component
is divided into blocks of a predetermined number of pixels, and this divided block is
Perform orthogonal transformation for each block in order to create data for each frequency component.
At the same time, the frequency component obtained by this orthogonal transformation is
Separate data is sequentially divided into low frequency components by quantization means.
quantize and then apply this quantized output to variable length encoding means.
When encoding data by variable length encoding,
Total code amount target value to be stored and each block determined in advance
According to the allocated code amount for each block determined from the statistics for each block.
variable length code while controlling the code amount for each block.
When performing quantization, the quantization is performed using a provisional quantization width.
The quantized output obtained by this is encoded using
The amount of code for the entire image required for processing and optimization.
and the amount of code for each color component and the code amount for each block for each color component.
The first step is to measure the amount, and in this first step
Optimization is performed from the obtained code amount for the entire image and the code amount for each color component.
The second step is to predict the required quantization width for each color component.
and each color when quantized with the predicted optimal quantization width.
The amount of code for each component is predicted, and based on this amount of code for each predicted color component,
Then, the total code amount target value is distributed proportionally, and each color component is divided into separate codes.
In addition to determining the code amount, this is also determined as the code amount of each block.
Standard allocation for each block by allocating according to
A third step of determining the code amount, and the aforementioned predetermined Mj
Using the quantization width for each color component, each block for each color component is
a fourth step of performing the quantization for each block;
The quantized output for each block in the step is
Variable-length encoding is performed within the allocated code amount for the block.
each of the above obtained by the orthogonal transformation.
Regarding the DC component of the block-based image data,
Obtain the difference from the DC component in the previous processing block, and calculate this difference
variable-length encoding of the DC component, and encoding processing is performed for this DC component.
After that, the AC component is subjected to variable length encoding processing.
a fifth step, and the current state in the fifth step.
Immediately before the block to be processed with iq variable length encoding (7)
The code amount by variable length coding in the block processed in
Calculate the difference between the amount of code allocated in the block and carry it forward.
and the amount of the above in the block that is currently being processed.
Add the block to the standard allocated code amount and perform the current processing.
a sixth step of assigning the code amount in the lock;
The allocation in the fifth step? '1 quantity
The variable length encoding process in the range of
It is characterized by the fact that it can be applied. Furthermore, in the eighth method, in the fifth to seventh methods,
Note: Tentative quantization width of 1, total per selected screen
It is characterized by using a predetermined value according to the amount of code.
. [Function] In such a configuration, colors separated by color component
Divide each image data into blocks of a predetermined number of pixels,
Perform orthogonal transformation for each divided block for each color component.
Convert to data for each frequency component, and use this conversion to
The data for each frequency component is quantized by a quantization means.
, then this quantized output is given to variable length encoding means.
When data is encoded using variable length encoding, a temporary
Quantize with a fixed quantization width and perform variable length encoding2.
Statistical processing is performed to obtain the amount of code for each block, and then this
The amount of code for each block obtained through statistical processing and the image
The total code amount target value is within this total code amount target value.
The optimal quantization width and allocated code amount for each block
is determined, and each block is
quantizes the conversion output for each
power for each block according to the allocated code amount for each block.
Coding process that sequentially performs variable length encoding while controlling the amount of code.
However, in the case of the first configuration, the calculation means is
Based on the variable-length encoded output during measurement processing, each color component is
The code amount of the block is calculated, and the determining means is the optimal quantization.
The code amount for each color component when quantized by width is predicted7, and this
The total code amount target value is determined based on the code amount for each predicted color component.
Proportional allocation is made to determine the amount of code for each color component.
is distributed proportionally according to the calculated value of the calculation means, and each color is
Determine the reference code amount for each component block. Also, the quota
The means is configured to send each of the determined values to the determining means during the encoding process.
Using the standard code amount of each block for each color component,
Of these, the processing block is processed before the next block to be encoded.
code generated by encoding in the processed block
Find the difference between the amount of code and the amount of code allocated in the processed block.
Add this to the allocated code amount of the block to be processed.
Yes, the amount of code allocated in the block to be processed is
Teru. Then, the aborting means is the block to be processed.
The allocation allocated by the allocation means during the encoding process of
The variable length encoding is terminated so as not to exceed the specified code amount.
Ru. In addition, in the case of the second configuration, the p, page appearance, and column are the syntax
Based on the variable length encoded output during processing, each color component is
Calculate the lock code amount and total code amount for each color component
and calculate the total code amount of the entire image, and also calculate the quantization width
#j means is the total code amount target value and the calculated value of the calculation means
Based on the optimal amount J″′-′- conversion width for each color component1,
The determining means determines each color when quantized with the appropriate quantization width.
What is the code amount for each component? −The amount of code for each predicted color component
The total code amount target value is calculated based on each color component.
Proportional allocation according to another total code amount, and this is calculated according to the above calculation.
The code amount is distributed according to the code amount of each block for each color component.
By doing so, the standard code amount for each block for each color component is determined.
decide. In addition, the allocation means is configured to use the determining method at the time of encoding processing.
Using the standard code amount for each block for each color component determined in step
Among the blocks, the next processing target to be encoded
For encoding on processed blocks processed before the block
The amount of code generated and the assigned code in the processed block
Find the difference between the
The code amount obtained by adding it to the standard code amount is
Assigned as the allocated code amount for the block to be processed. Zoshi
, and the termination means is the encoding in the block to be processed.
The above assigned by the above two assigning means in the process.
In order not to exceed the allocated code amount, the i3J variable length
Controls tearing. [I-1-I Town, Tokyo 2] Using a provisional quantization width during processing
The total generated code L of the entire screen based on the quantization of
Generated code amount for each color component, code for each color component 1 for each block
Source 4 - Know the code amount status, and calculate the maximum J from this -1 information.
Measure the quantization width by t7, and quantize with the predicted optimal quantization width.
API L predicts the print amount for each color component when
The target value of the total code ff1tj is calculated based on the code amount for each color component.
Proportional allocation is made and the code for each color component is determined.
Distributed by the amount of 71 generated in each block of giJ for each color component.
to determine the standard allocated code amount for each block for each color component.
, when encoding each block in the encoding process,
The standard allocation code amount for that block [knock]
Difference between the code amount and the allocated n column when unifying the block
is added as the carryover amount and the assignment mark is 'QQ', which is 1.
It is said that it is encoded by enclosing i that fits in the allocation n number 2.
Based on data from unified 1 processing, each color component is
The standard allocated code amount for each block of
The distribution E5 is determined rationally according to the amount of code, and
The unused portion of the allocated code amount in the previously processed block is repeated.
5 to be used for encoding later blocks.
This is a color component that requires a large amount of code.
However, the number of coding truncation in each block is reduced, and the image quality is improved.
In addition to contributing to quality improvement, the number of encoding processes is reduced to a specified number of times.
The time required for encoding can be kept constant if
Ru. In addition, in the case of the third configuration, the above first and second cases
In addition, a compression ratio selection means is provided,
When you select the desired compression ratio, the compression ratio selection method
The desired amount of code to be stored according to the selected compression rate and
and determine the tentative fl T conversion width. Therefore, in this method, the functions and effects of the first and second configurations are
In addition to this, you can select the desired compression ratio.
In response to this, the provisional quantity should be adjusted to the width per image.
The desired code amount is determined and statistical processing is performed.
To more accurately find the optimal quantization width that fits within the
This gives you the advantage of being able to do more. In addition, in the case of the fourth configuration, the first and third configurations
In each case, the function of the variable length encoding means is
The image data of each block obtained by the orthogonal transformation is
Of the data, the DC component is processed in the previous processing block.
Obtain the difference with the DC component and transform and encode this difference
However, the encoding processing unit has finished processing this DC component.
After that, the AC component is variable length encoded and
Coding truncation is used in the encoding process for AC components.
We are using a configuration that is designed to understand and implement the system. Therefore,
The quantization means performs quantization at the time of the encoding process.
Among the data for each frequency component obtained by orthogonal transformation,
It is carried out based on data of low frequency components, and the variable
The long encoding means obtains each frequency component by the orthogonal transformation.
Frequency components of each block of image data
The DC component of the data is processed in the previous processing block.
Obtain the difference with the DC component of
, after the encoding process is completed for this DC component, the above-mentioned
Variable-length encoding is performed on the AC component, and the encoding
The truncation applies only to the AC component. As a result, in the first to third cases above, further encoding is performed.
The encoding truncation during processing was made only by illusion for the alternating current component.
This allows for the truncation of high frequency regions that have little visual impact.
It is possible to prevent deterioration of image quality. In the fifth case, color image data separated by color component is used.
Divide the data into blocks of a predetermined number of pixels, and
After sequentially performing orthogonal transformation for each lock, the output of this transformation is quantified.
It is quantized by the childization means 2, and then this quantized output is
Variable length given to variable length encoding means? : f code 5, data
The total amount of code that should be stored in advance when encoding data.
Each block determined from the target value and statistics for each block.
Code amount is controlled for each block according to the assigned code for each block.
When performing variable length encoding while performing
・Use the knob to perform the quantization using the provisional quantization width.
, perform encoding processing on the quantized output obtained by this.
, the amount of code for the entire image and each block required for optimization.
In the second step, the amount of code for each block is checked.
The quantum required for optimization is calculated from the code amount of the entire image obtained in step
In the third step, the prediction width is f-measured.
Code amount for each color component when quantized using the measured optimal quantization width
is predicted, and the total amount is calculated based on the code amount for each predicted color component.
The code amount target value is distributed proportionally to determine the code amount for each color component.
At the same time, this is compared based on the code amount of each block.
example, calculate the standard allocated code amount for each block, and
In the step, the predicted quantization width is used to
The quantization is performed for each block. And the fifth step
Each block in this fourth step
The quantized output for each time is assigned to the code amount for that pro-nk.
Either use variable length encoding to fit within the range, or use
The allocated code amount for the block currently being processed is
Immediately before the block to be currently variable-length encoded
The amount of code generated by variable length coding for blocks processed in
Find the difference between the allocation and the amount in the block and carry this forward.
1, the amount in the block currently being processed is
The amount added to the standard allocated code amount is applied. In this way, in the fifth case, we first set a provisional quantization width.
The total generated code amount for the entire screen based on the quantization using
and the generated code amount for each color component, and each block for each color component.
Knowing the state of the generated code amount, and using this information, the optimal quantum
When predicting the quantization width and quantizing with the predicted optimal quantization width
The code amount for each color component is predicted, and the code amount for each predicted color component is
The total code amount target value is distributed proportionally based on the amount of code, and each color component is
In addition to determining the amount of code for classification, this is applied to each block for each color component.
The code is distributed proportionally to each block according to the amount of code generated in the block.
Determine the standard allocated code amount for each block for each color component, and
When encoding each block in the encoding process,
The code of the previous block is added to the lock standard allocated code amount.
The difference between the code in
Add 1 to the allocated code amount 2, and fit into this allocated code amount.
It is said that it is encoded in the range j, t, and the unified knee 1
Based on the data during processing, each color component is divided into blocks
(The standard assigned vs. amount) reasonably according to the generated sign vs. amount
It is distributed and determined, and the block processed earlier is
The unused portion of the allocated code amount is carried over as 7 minutes and used as 5 for later blocks.
Since the code can be used to encode the
Even for color components that require a large amount, the sign in each block is
This reduces decoding truncation, contributes to improved image quality, and
, if the number of encoding processes is set to a specified number of times, the number of times required for encoding is
The period of time can be fixed. In a sixth case, in the fifth case, the first step
Using the provisional quantization width of 1j in step
and encode the resulting quantized output.
The amount of code required for the entire image and each color for optimization.
The amount of code for each component and the amount of code for each block for each color component.
The second step is to investigate this first step.
The code amount of the entire image obtained by
Perform lf-measurement of the quantization width required for optimization for each color component 2
- In the third step, the optimal quantization width is used for quantization.
Then, the initial amount of each color component is preliminarily iip + L, and each of these
Based on the predicted code amount for each color component, set the target value for the amount of confusion described above.
Proportional allocation is made to determine the amount of code for each color component.
is proportionally distributed based on the code amount of each block for each color component.
and calculate the standard allocated code amount for each block for each color component.
, in the fourth step, the predicted amount of each color component is calculated.
The quantum size for each block for each color component is calculated using the child width.
and in the fifth step, in this fourth step
The quantized output for each block for each color component of
Divide to the block = variable length within the range of i sign to quantity
At the same time, in the sixth step, the fifth step
The block that is currently being processed for variable length encoding in
, code by variable length encoding in the block processed immediately before
Find the difference between the amount of code and the amount of code allocated for this block, and calculate this as
In the block currently being processed as the carryover amount
is added to the standard allocated code amount, and the amount of code currently being processed is
The assigned code for the professional note shall be; In the sixth case, quantization is carried out to a provisional quantization width,
Encoding process for the fit “F ratio output obtained by this
The amount of code required for the entire image and each
Code amount for each color component and R'T for each block for each color component
ffl to key, and the code amount of the entire image obtained by this and each color
Calculates and measures the quantization width required for optimization from the amount of code for each component.
In addition to calculating each color component, we also calculate the total code that should be stored in advance.
Quantity target value, expected generated code amount for each color component, and each of the above color components
For each color component, each color component is allocated proportionally from the code amount of each block.
Determine the standard allocated code amount for each block, and then
The quantization width for each color component is used to calculate each block for each color component.
The above quantization is performed for each block, and here 11) M”J 2
The quantized output for each block is divided into that block.
Variable-length encoding is performed within the code amount. - force, of the block to be currently variable-length encoded;
Code amount due to variable length encoding in the block processed immediately before
Find the difference between
The current processing (,
In addition to the standard allocation fJ in the
2. Assuming that the allocated code amount is
To encode within this code amount range, use variable length encoding.
. 2, quantization using a provisional quantization width for the first time
The total generated code amount for the entire screen based on
Amount of generated code, amount of generated code for each block for each color component
Know the state and use this information to find the optimal quantization width using the f-measure.
In addition, the travel log amount 11 target value is adjusted according to the expected generated code amount.
5, and then distribute this to each color component.
Each block for each color component is distributed proportionally according to the raw code amount.
Determine the standard allocated code amount for each block, and
When encoding a lock, the standard assignment mark for that block is used.
The code amount in the encoding of the previous block is added to the code amount in the previous block.
The difference between the allocated code amount and the carryover amount [7 is added and 5 is the allocated code]
code amount, and encode L2 within the allocated code amount.
What is said to be - C1 processing using provisional quantization width
data at the time of calculation and the predicted code amount at the predicted optimal quantization width.
Based on C1 Standard assigned code for each block for each color component
The amount is rationally allocated and determined, and the amount is
The unused portion of the allocated code amount in the allocated block is carried over.
What can be done to encode later blocks?
Therefore, even for color components that require a large amount of code, each block
This reduces the number of coding aborts during storage, contributing to improved image quality.
At the same time, if the number of encoding processes is set to a specified number, the sign
The time required for encoding can be fixed. In addition, in the seventh case, the colors separated by color component are
Divide the image data into blocks with a predetermined pixel size, and
Perform orthogonal transformation for each divided block to separate frequency components
In addition to converting the data into
The data for each frequency component is converted into low frequency components using quantization means.
Quantize sequentially from minute to minute, and then convert this quantity j°−
Variable-length encoding is performed using variable-length encoding means to encode the data.
The target value of the total code amount that should be stored in advance when performing encoding.
Determine from the statistics for each block 1 and each block
Control the code amount for each block according to the allocated code amount for each block.
In performing variable improvement while performing, the above-mentioned Hr improvement
Using the provisional quantization width, the obtained quantity f
Perform encoding processing on the specific output and use the necessary
The amount of code for the entire image, the amount of code for each color component, and the amount of code for each color component.
The image obtained by examining the code amount for each block of classification
Amount required for optimization based on overall code amount and code amount for each color component
Prediction of the child width is performed for each color component, and then the optimal quantization is performed.
The code amount for each color component when quantized by width is predicted, and each
Compare the target total code amount based on the predicted code amount for each color component.
As well as determining the amount of code for each color component,
Proportional allocation based on the code amount of each block for each color component
Find the standard allocated code amount for each block for each color component.
. Then, the sonization width for each color component predicted by the previous λ is
perform the quantization for each block for each color component using
At that time, the quantized output for each block is
Variable-length encoding is performed within the allocated code amount for the block.
Ru. At this time, each block obtained by the orthogonal transformation
Of the image data for each block, the DC component is
Obtain the difference from the DC component in the processing block and use this difference as
Variable length encoding 5, and °C encoding processing for this DC component
After -9, +1]' variable length for the AC component
Encoding process and current variable length encoding process in the second process
In the block processed immediately before the block to be
The code amount by variable length encoding and the assigned code in this block
Calculate the difference between the current amount and the carryover amount.
In addition to the standard allocated code amount for the block to be processed.
and the assignment mark in the block that is currently being processed.
The quantity shall be the number. Then, within the range of the allocated code amount,
The variable length n9 processing is applied slowly to the AC component.
. In this way, the first cut in variable length encoding is
component only, and the low frequency component that has a large visual impact
Since truncation is suppressed, image quality can be maintained. Furthermore, eighthly, in the cases 5th to 7th above,
, the provisional quantization width is set per selected screen.
A predetermined value of 7°ζ is used depending on the amount of travel. As a result, the provisional sonization width is the same as the width of the screen that should be accommodated.
It is close to the suitable value for frogs depending on the amount of travel, and is more appropriate.
Compression encoding becomes possible. As shown in 2, the present invention first performs four treatments on eel, and this process ≧
-1 processing predicts the optimal quantization width for each color component,
Necessary for determining the standard assignment code I for each block for each color component
Obtain the statistics and start the encoding process based on this information.
, the standard code amount for each block considering the predicted quantization width.
Process while allocating the
The standard allocation code amount of the block to be used and the block's
In addition to the excessive amount of code allocated in the previous processing block,
Within the allocated code amount of the block to be processed
block by discontinuing variable length encoding so that the
The code amount is controlled for each code, and the code is within the desired code amount.
The converted output is obtained as the final output. This is based on the following idea. Explanation using a conventional example (7) l1lr when encoding
When the r conversion coefficient is particularly small or small, paraphrase
and especially for images with high or low spatial frequencies.
Then, we compare the code amount of Li according to the statistical amount of the name 70.
Example 4: When determining the allocated code amount by
Actual encoding is performed using the Y-measured QF coefficients.
When this happens, the allocated code amount for the luminance component block is
Insufficient and redundant in the chrominance component block, or
The opposite may be true. Then, the amount of code is insufficient.
Of course, the encoding of the color component is aborted midway through.
Image quality deteriorates. Whether this phenomenon occurs or not, the color
Whether the amount of allocated code for the luminance component is insufficient or not
, Is the allocated code amount insufficient for all color difference components in the color components?
Whether it is fortune-telling or not depends on the magnitude relationship between a in equation (2) and a in equation (3).
It can be easily determined by the magnitude of the predicted quantization coefficient.
Is this possible? This means that it depends on the system and the image.
It is determined. Therefore, the quantization width for each color component was predicted from the above relationship.
The code amount for each color component when actually encoded using
For each color component of each standard assignment code for each block;
The ratio is the same.
When (T), the emission for each color component/1'R month m is J'', 2
Equation (2,), Equation (3) Prediction of r-#IL, , :
The ratio of the generated code amount for each color component is the target travel amount.
After allocating, statistics for each block in each color component.
Further proration based on quantity. In this way,
In addition to determining the standard allocated code amount for each block,
The remaining amount of code allocated in the block that has been encoded is calculated as follows.
Follow this by passing the assignment code I of the next block.
Encoding is performed while controlling the amount of code for each block.
give The code is actually encoded using this predicted quantization width for each color component.
For each block, the ratio of the amount of code for each color component when
By adjusting the ratio of the standard allocated code amount for each color component,
The amount of code allocated to each block is determined using the predicted quantization width.
Amount of code generated for each block when actually encoded
The result is very close to
Ru. The prediction of the quantization width for each color component is based on equations (2) and (3).
Just do linear prediction. Therefore, according to the present invention, images with a wide range of spatial frequencies can be obtained.
On the other hand, if you want to reduce the image quality as much as possible, use a simple circuit.
Sign so that it falls within a certain η logarithm within a certain processing time.
become able to become [Examples] Examples of the present invention will be described below with reference to the drawings.
Ru. When compressing and encoding color image data,
Quantize with the predicted optimal quantization coefficient and encode it
For each color component such as luminance component and color difference component, the specified
If each is encoded to fit within the code amount range,
In this case, depending on the color component, there is a margin in the code amount, and on the other hand, the actual
In addition to fertilizing, it also grows, and in places like this,
In this case, high frequency components are cut on the side of the missing color component.
This happens one after another with one color component.
There may be problems such as the amount of code being too large rather than
Rationality arises. The present invention first uses color image data separated into color components.
We perform statistical processing on the
Predict the width of change, and use this statistical processing to find the optimal amount f-
Necessary for predicting the width and determining the amount of code allocated to the base ring for each block.
Obtains 1 amount of necessary engineering. And based on this information,
For each color component (for Y, for C or for Y, for Cr, for Cb)
) prediction of the optimal quantization width and the amount of code allocated to each block.
After making the decision, the actual encoding process is performed. At this time, the standard allocated code amount for each block is determined as described above.
Actual encoding using the predicted quantization width for each color component
When the ratio of the code amount for each color component is
Prediction is made so that the ratio of quasi-allocated code amount for each color component matches.
Occurrence code for each color component when encoding with the above quantization width
The amount of signal is predicted from the above equations (2) and (3), and this prediction
Allocate the desired amount of travel by the ratio of the amount of doto codes for each color component.
based on the statistics for each block for each color component.
This is done by further distributing the amount on a pro rata basis. In the encoding process
Then, quantize in block order using the quantization width for each color component.
And encoded block text (7) 111 hit
The remaining amount is used to allocate the amount of code for subsequent blocks.
, while making some adjustments to keep it within the allocated code amount.
While controlling the code amount for each block, the LiJ variable length n
Implement the code. First, in order to make the present invention easier to understand, we will explain the basics of the present invention.
Let me explain my thinking. That is, the present invention, for example,
One color image (screen) is divided into 14 color components, and these
Color image data for each color component is divided into blocks of a predetermined number of pixels.
Then, each block by color component is divided into blocks.
The data of the constituent pixels of that block are orthogonally transformed and
Separate the wavenumber range, further quantize it, and compress and encode it.
Then, the travel pair amount of each color component compressed and encoded is the target code amount.
In order to encode the color so that it fits within the
Statistical processing is performed on the separated color image data, and this
Through statistical processing, we can predict the optimal quantization width for each color component.
, the assigned code for each color component based on the generated code amount for each color component.
Proportional allocation of color and standard allocation mark for each block for each color component
Obtain the statistics needed to determine the quantity. And these circumstances
Based on the information, the standard allocated code amount for each block for each color component is determined.
The standard allocation R+3 amount for each block for each color component is determined.
code for each block for each color component so that it fits within
Perform conversion processing. The encoding process uses the predicted quantization width for each color component.
It is performed sequentially for each component and in block order, and the encoded output is
While looking at the standard allocation for each block? TJ; and its
The amount of code generated in the processing block “hook” before the processing block
Excess/deficiency amount for the allocated code amount (carryover amount)
within the allocated code amount of the block obtained by combining the
Monitor the amount of code obtained by variable length encoding so that
The amount of generated code, including %, is the allocated code.
When the amount of code is reached, the encoding of that block is terminated, or
The DC component must be encoded even if it exceeds the allocated code amount.
, stores the excess/deficiency amount for the allocated code amount at that time.
and then moves on to encoding the next block.
be. Statistical processing is used to predict the optimal quantization width for each color component.
In addition, the code amount for each color component is optimally allocated and further kneaded.
Determine the standard allocated code amount for each block for each color component based on
This is the only way to obtain the standard J1 quantity, which is the standard for determining the
Ru. The optimized quantization width obtained by the Toko 1 process is expressed as follows:
By using it in the encoding process, it becomes the general code for the purpose of
The upper limit of the amount of data for one image is regulated.
If it is set, not only 1.1 byte but also 1 bit
It is not possible to exceed the target code amount. Therefore, control is performed based on the allocated code amount for each block. child
The code amount at the time of encoding is the target code amount.
This is used for fine adjustment when changing the settings for each block.
The standard allocated code amount, which is the standard allocated code amount for each lock, is
This standard allocation code amount is used for the previous block.
Subtract the generated code amount from the allocated code amount in the processing block.
, the remainder after subtraction is received as a carryover amount, and this carryover (2
, the allocated code amount corrected by adding
This is the maximum limit for encryption processing, except in special cases.
Encoding control is performed to encode within the range. Adjustment of the allocated code amount due to this carryover is performed after encoding.
Since the amount of code differs for each block, the remaining
In the block where there is a shortage, the surplus is transferred to the block where there is a shortage.
Flexible and rational to fit within the target code amount as a whole
This is for the purpose of allocating the amount. This enables the standard code amount to be turned off.
This will give you the ability to make fine adjustments when changing the settings. each
From low frequency components to high frequencies in block encoding
The guideline (Cobro
When the amount of code allocated per block is exceeded, further
Aborts encoding of high frequency components. This is done for each block to minimize visual impact.
This is to omit the high frequency components first. This interaction
Regarding truncation of flow components, high frequency components are particularly
There is a tendency that the higher the wave number, the less the visual impact.
They are using the opposite. Amount of code generated including EOB or assigned code
The amount was less than the amount, or the amount was the same.
The code finishes encoding without any problems, that is, outputs EOB.
do. In this way, when there is a surplus, it is necessary to move on to the next block.
In addition to the lock standard allocated code amount, λ is allocated in this block.
Let it be the amount of code. Encoding is discontinued for blocks that overlap in the middle.
, finishes encoding that block, that is, outputs EOB
do. This is not possible in reality unless the compression ratio is extremely high.
In the unlikely event that the given allocated amount of code encodes even the DC component,
If the amount is not enough, encode only the DC component.
, finishes encoding that block, that is, outputs EOB
do. Then, the insufficient amount of code is treated as the missing amount.
block, and the shortfall is carried over to the base of that block.
Subtract it from the quasi-allocated code amount and use it as the allocated code amount for that block.
Ru. At this time, EOB is also one of the codes, so EOB
The amount of code including the amount of code should be within the allocated code amount. In this way, the allocated code amount is not wasted.
It is also an object of the present invention to reduce the amount of generated code to the allocated code amount.
If the surplus is carried over to the allocated code amount of subsequent blocks,
Both are the ratio of statistics for each block when statistics are obtained.
Predicts the quantization width for each color component so that the
By doing this, each block is
The amount of code allocated for each color is more reasonable, and each color
Good results can be obtained with both ingredients. The present invention basically consists of "statistical processing" and "encoding processing".
A method called the 2-bus method, in which encoding is completed by combining two
is adopted, and this is quantized with a certain quantization width.
When variable-length encoding is performed, the base assigned to each block is
Using the quasi-allocated code amount as a standard, the generated code in each block is
It is possible to absorb variations in the amount of data in the next block.
We are going to adjust this by assigning this adjusted value.
The code is I, and the code in the block is within this allocated code amount.
When the allocated code amount is exceeded, the block is
Encoding should be aborted. However, the image data is
It is decomposed into a DC component and an AC component by AC transformation, and the visual
The amount of code is tentatively assigned to the DC component that has a large impact on the
Even if the number of codes exceeds the number of bits, partitioning will be performed for the next block.
Subtract the amount of code allocated by the network by the amount that exceeds the allocated code amount,
In addition, there is a risk of entering the AC component and exceeding the allocated code amount.
- If the error occurs, the encoding is terminated. Also, by encoding
If the generated code 4-i amount is less than the allocated code amount,
The surplus is added to the allocated code amount of the next block, and
Increase the amount of code allocated to the block. In this way
, the code amount in the previous processing block or the allocated code amount is burned.
If the excess amount is returned to the next block,
This is reflected in the allocated code amount for the network and adjusted accordingly. In general, especially for images with high or low spatial frequencies
In, each block's lesson;
By allocating proportionately the amount of travel to the purpose to be accommodated.
Determine the standard allocated code amount for each block, and calculate each predicted color.
Actual encoding using one quantization coefficient common to all components
If the conventional method is adopted, the luminance component block
If the amount of allocated code is insufficient, and the block of color difference components
It may be redundant or vice versa;
For color components with insufficient signal amount, encoding is aborted midway.
If this happens, the image quality will naturally deteriorate.
According to
The main reason for this is that the internal circuit allows for
Encoding can be performed within a certain amount of code. An embodiment of this device using the above principle will be described. Figure 1 shows an image data encoding device according to the present invention.
An example applied to a digital still camera is also described below.
Figure 2 shows the configuration of the image data encoding device according to the present invention.
Each is shown in a block diagram. Note that this invention is not directly related to the present invention.
The mechanism of a digital electronic still camera without
The explanation will be omitted. As shown in Figure 1, the digital electronic still camera body
(hereinafter referred to as the electronic camera body) 1 captures images
A predetermined signal is applied to the imaging system 40 and the output of this imaging system 40.
A signal processing circuit 60 that performs signal processing, orthogonal transformation, linear quantum
It has functions such as conversion, fil variable length encoding, etc., and
An encoding circuit 8 outputs the output of the circuit 60 through compression encoding 1 to
0 and the image data encoded by this encoding circuit 80.
records data and quantization width (or corresponding information)
Recording system 70 for recording on medium 7I and desired data compression rate
Switch 30, which is manually set, controls the entire system.
It is composed of a control circuit 90. Set the image compression rate on the control panel of the electronic camera body.
A switch 30 is provided, and the switch 30 controls
It is connected to circuit 90. The imaging system 40 includes a lens 40a for forming an optical image.
and an image sensor 40b such as a CCD. The signal processing
The logic circuit 60 is an amplifier BO that performs amplification, noise removal, etc.
a and convert analog signals to digital signals ^/D
The converter 60b and )? Buffer memory f consisting of AM, etc.
ile and a process circuit GOd that performs color signal formation, etc.
Be prepared. The encoding circuit 80 is, for example, a DCT (discrete code).
Orthogonal transform circuit 4 that performs orthogonal transform such as sine transform), linear
Quantization circuit 6 that performs quantization, Huffma as variable length encoding
You can see the Huffman encoding circuit 8 that performs quantum encoding, and
Converting width - Y - measurement circuit 12° code amount calculation circuit 14, code amount division
In this circuit 20, code terminating circuit 1B and encoding circuit 80
It has a control circuit 18 that performs control processing. The recording system 70 includes an interface circuit 70a and a recording
Memory card with built-in IC memory used as a medium
71. Memory card 71 is the electronic camera body
1, it is removable. The control circuit 90 is controlled by a microprocessor (MPtl).
It has been realized. FIG. 6 shows a perspective view of the external appearance of the electronic camera body. The diagram is
A binocular type one is shown, and 48 indicates 1 in the operating section.
, CI) (liquid crystal) display, 30 is the screen on the operation section.
switch 30, and also a tele/wide switch.
A switch, a shutter operation button 50, etc. are provided. Ma
In addition, 49 is a finder. 1-5CI) The display 48 is under the control of the control circuit 90.
Various values such as shooting mode, number of frames, day 4 = j, time, etc.
and status will be displayed. With this electronic camera,
Press the switch 30 provided on the operation part of the body 1 by pressing a f' +
In particular, it is possible to set the image compression ratio to the desired value.
I can do that. That is, the control circuit 90 is provided with a standard
Multiple types of compression ratio information are set, and this or switch
The value of the number of shots set by the operation in step 30 is also
The capacity of the memory card (recording medium) installed in J
Determine the compression rate to be applied from the amount, and calculate the value of the H compression rate found.
and converted to the value of the number of images that can be recorded on a memory card.
It will now be displayed on the LCD display 48 of the operation unit.
ing. Then, when the user presses the switch 30,
Each time the control circuit 90i;e switch 30 is pressed, this
Change the values of While viewing the displayed change values, the user selects the desired value.
Each time you stop pressing switch 3o, the control circuit changes.
Route 90 corresponds to the instruction value for the number of images taken at that time.
It is now possible to set the indicated compression ratio. This is pressure
Controls the standard travel amount per image determined according to the reduction ratio
The circuit 90 obtains this and uses it as the objective n jlia constant information.
This is done by applying the same to the encoding circuit 8o. Also, trigger gas
The shutter operation button 50, which is the switch, is pressed.
As a result, the shutter function moves and the image sensor 40b is exposed to light.
An image of the subject is formed, and the image sensor 4()b corresponds to this image.
Then, the image is stored, so read it out and control it.
It is possible to obtain a video signal from the image sensor AOb.
. These controls are also controlled by the control circuit 90 or 5. The imaging system 40 in FIG. 1 includes a photographic lens 40a and a CC
1, having an image sensor 40b made of an image sensor such as D;
An image is formed on the image sensor 40b by the photographing lens 40a.
The obtained optical image is converted into an image signal and outputted to the signal processing circuit 60.
It is something that gives strength. The signal processing circuit 60 is an amplifier 60a
SA/D converter 60b, buffer memory 60C1 process
A process circuit 80d is included, and this process circuit Hcf
The image signal obtained by the image sensor 4Ωb is converted into a color signal.
No. Y, RY (Hereinafter, this 1? -Y is Cr(
(abbreviated as Chroma Red), B-Y (hereinafter referred to as 20B)
-Y is abbreviated as Cb (chroma blue)) each color component
In addition to separating the
It is recommended that you do the following: Imaging system digitally converted by A/D converter 60b
For example, the output video signal of 40 has a capacity for one frame.
Image data is stored in a buffer memory 60e having
By being read out and input into the process circuit 60d,
The V component of the luminance signal system and chroma (C5 color difference signal)
The Cr and Cb acid components of the thread are separated. buff 7 memo
60e 1.1: The stored image data is
First, in order to perform a unified process on the f-number of the luminance system, we
The Y component of the image signal is processed by the process circuit.
Y component data is obtained and given to the encoding circuit 80.
After the encoding process is completed,
Next, we will discuss the chroma-based Cr and Cb acid component data.
After processing, encoding processing is performed. The f5 processing circuit 60 has a blocking function and a buffer
The data read from the memory 60c is processed by the L1 process.
Obtained image data for Y component and Cr, CI) component
(17 reno, minutes, young, < is 1 field),
Performs blocking processing to divide into blocks of a predetermined size.
I can do it. Here is an example (7) and the block size is
The block size is 8 x 8 pixels, but the block size is limited to 8 x 8.
It is not a block sensor with Y and C (chroma system).
The size may be different. In this embodiment, the luminance system Y data is read and divided into blocks.
Then, the subsequent processing system uses ljλ to process this Y component data.
After the statistical processing is completed,
Next, statistics on the data of chroma-based Cr and Cb components.
Data on the chroma-based Crx and Cb components to be processed.
Enter reading and blocking. To create chroma blocks, first Cr component image data is
Perform all blocking for , then cb formation
Block image data? It shall be carried out. The encoding circuit 80 has the configuration shown in FIG. No.
In Figure 2, 4 is an orthogonal transform circuit, which is divided into blocks.
Receive each image data inputted by
2, perform two-dimensional orthogonal transformation for each block.
It is something. Let's assume orthogonal transformation, then cosine transformation, sine
Transforms, Fourier transforms, Hadamard transforms, etc. can be used.
. By performing orthogonal transformation, the image data as transform coefficients can be
data can be obtained. The image data as this conversion coefficient is directly
Since it is an alternating transform, the spatial frequency of the image can be converted into a frequency component.
The data is analyzed every minute. 6 is a quantization circuit, which outputs the orthogonal transform circuit 4.
When receiving the image data (transform coefficients), the quantum of the first L]
In , each frequency component is set in advance for each color component.
For each quantization width, the amount set in advance according to the shooting
The amount of conversion coefficient is the quantization width corrected by multiplying by the childization coefficient a.
Childization is performed, and the second time it is determined by the previous processing.
The configuration is such that quantization is performed using the optimal r-ization coefficient α, and
Ru. 8 is a variable length encoding circuit, and the variable length encoding circuit 8 is a variable length encoding circuit.
The quantized output output from the slave circuit 6 is variable-length coded.
It is something that Huffman coding is used as variable length coding,
Use arithmetic encoding. Block in variable length coding
The amount of code for each image, the amount of stone for the entire image, etc. change for each image.
. The type of variable length encoding to be used is directly related to the present invention.
Although unrelated, I used Huffman encoding here.
Let me give an example. The variable length encoding circuit 8 converts the input quantized transform coefficient into
Zigzag cedar with numbers in the order shown in Figure 7
By using a method called
Performs scanning to wavenumber components. Data of the first DC component N)C] in the scanning order in Figure 7.
is the DC component of the block that was previously variable-length encoded.
Output the difference value with 1-fuman encoding. AC component
For [AC], 64 from the second in the scanning order in Figure 7
Look at the conversion coefficients in order until the conversion coefficient is 0.
When a valid (i.e. valid) coefficient appears, it is
The number of consecutive 0 (invalid) coefficients that existed (zero run) and their
Two-dimensional Huffman encoding is performed using the effective coefficient values of
It does the following actions. In addition, invalid coefficients are continuously displayed after a certain coefficient up to the 64th coefficient.
If the number continues, EOB (Enter) indicates the end of the block.
Outputs the code of block (de of block). Also, discontinued
When a signal is input, encoding is finished and EOB is added.
and output it. And the code generated for each code
The length is output to the code amount calculation circuit 14. The code amount calculation circuit 14 inputs each color of Y, Cr5Cb.
Y, Cr, C
b Collection of code amount data for each block of each component and 8 packets
Calculate the amount of code for each component and the amount of code for the entire image, and
Regarding data on the amount of code for each color component and the amount of code for the entire image
In addition to outputting to the quantization width prediction circuit 12, the
For the data of the code amount and the code amount of the whole image, divide the amount by n.
The configuration is such that the output is output to the applying circuit 20. The quantization width prediction circuit 12 performs control at the start of the first bus.
Information on the target code amount is received from the circuit 18, and this code is
Log (BRy → BRe) ; a X l based on the equation (4) explained earlier from the quantity information
og SF+b However, BR is a bit per pixel with a code amount of 0.
SF is a quantization coefficient, and a and b are constants. Set the initial value of the quantization coefficient α using the relationship 11, quantum
output to the converter circuit 6, and the signal is output to the history prior to the start of the second node.
, n vs. calculation circuit 14 to manually calculate the sign of the entire image.
amount and the maximum allowable input per image, '7) data amount.
From a certain target edge code amount, for example, <2) formula, <3) formula
Using the relationship, approach the target edge code amount by linear pre-Mj
The optimal Q f coefficient a for each color component was actually calculated this time.
Use (7, ffi 'Although it is predicted by taking into account the F coefficient
It is. Here, how to set the quantization coefficient to an optimal value is
Since this is an important issue, I will explain this point a little. Preprocess the image data, quantize this output, and
When variable-length encoding the encoded output, the quantization width of this quantization
It is well known that changing the amount of code will change the amount of code generated.
It is being This is a variable method represented by Huffman encoding.
Long encoding uses the bias in the probability of occurrence of the data to be encoded.
to reduce the amount of code required to represent that data.
Therefore, the above-mentioned ``changing the quantization width''
"to change the probability of occurrence of the quantized value"
Therefore, by changing the quantization width, the
It can be seen that the raw code amount also changes. By the way, even if the same encoding is performed with the same quantization width, 1.
The amount of generated code varies depending on the image data at that time. L
The quantization width is changed for the image data of
If the same 6-encoding is performed, the quantization width and the generated code amount
A certain relationship can be obtained between Also, many image data
When determining the relationship between the quantization width and the amount of code emitted by the
It is clear that a relationship with a high degree of raw axis can be obtained statistically.
It was. Specifically, in many cases, the following relationships were obtained. In other words, let SF be the relative ratio to a certain quantization width.
, generated code amount, number of bits per pixel (bit rate)
If this is expressed as BR, then the relationship in equation (1) above is established.
stand up In equation (1), if a is the same encoding, then
, is approximately constant regardless of the image, and b depends on the image. child
The value of b has a certain distribution depending on the image, and this occurrence frequency
The typical value can be obtained from the degree distribution. Therefore, find the optimal quantization coefficient from the relationship in equation (1).
I can do it. The code amount allocation circuit 20 receives input from the code amount calculation circuit 14.
Code amount of image data for each color component, product for each color component
Code amount for each block, code amount for the entire image, and target travel number
Calculate the standard allocated code amount for each color component and product block from the amount.
The signal is then output to the encoding abort circuit 16. concrete
Specifically, the amount of each color component predicted by the quantization width prediction circuit 12
Sign for each color component when actually encoded using child width
The ratio of the code amount to each color component of each standard allocated code amount for each block.
Encoded using the predicted quantization width to match the minute-by-minute ratio.
The amount of code generated for each color component when performing is expressed by the above formula (2),
Predicted from equation (3), and the occurrence mark for each predicted color component.
After allocating the target total amount of code according to the ratio of the amount of code, it is divided into each color component.
Then, based on the statistics for each block, further proportional allocation is performed.
divide In this way, the standard assigned code for each block is
Determine the amount. Note that the ratio of the amount of code for each color component and product block determines the total objective
For example, the method of proportionally distributing the amount of code is
Multiply the code amount by the target total code amount, and multiply it by the total amount of code.
The standard allocation for that block is determined by dividing the code amount of the block.
Decide the amount of code, or divide the target total amount of code into each color component.
5) Proportional distribution with different code amount 5) L, knead each block of its packaging components.
The amount of generated code is distributed proportionally. As a result, the standard allocated code amount for each block is the amount for each color component.
Sign for each color component when actually encoded using child width
The ratio of the code amount to each color component of each standard allocated code amount for each block.
The target total amount of code is distributed so that the ratio of each minute is matched.
This is further distributed proportionally using the predicted code amount for each color component block.
The amount of code is calculated based on the actual amount of code in that block.
A large amount of code is allocated according to the same amount of code. The code amount allocation circuit 20 uses the code amount information table and block allocation.
This code amount data table has a code amount information table.
The code amount information of the corresponding block position is calculated at the code amount calculation time.
While rewriting the input code amount information from the code path 14,
The amount of code for each block input from the code m calculation circuit 14
and the code amount of the entire image, the target total code amount and quantization
Color component identifier given from width prediction circuit 12? 91! Completion
As described above, the coefficient α is calculated for each block for each color component.
Calculate the standard allocated code amount and use the calculated base of each block.
The semi-allocated code amount data is stored in the block allocated code amount data table.
Store it in a bull. This block allocation code amount data table
The standard allocated code amount for each block of the file is
When the variable-length encoding process is performed, the encoding abort circuit 16 -
I can come back. The encoding abort circuit 16 receives the above information from the code amount allocation circuit 20.
One of this block is added to the standard allocated code amount of the corresponding block.
Generated code for allocated code amount in previously processed block
The excess or deficiency amount, which is the difference in amount, is carried over from the previous block.
In addition, the allocated code amount for this corresponding block is
In addition, the code length of each block from the code amount allocation circuit 20
is subtracted from the allocated code amount, and the remaining allocated code amount is sent out.
smaller than the total code amount of power code amount and EOB code.
If the error occurs, a termination signal is output and the variable length encoding circuit 8
, complete the encoding of the block, and
Subtract the transmitted code amount from the allocated code amount and use that value as the allocated code.
It has the function of holding the remainder of the quantity. follow
Then, the encoding abort circuit 16 refers to this allocated code amount,
Sends input code amount to be sent and EOB code
However, if the allocated code amount is not exceeded, no abort is performed.
, complete the naturalization of the block and assign the block
Reduce the amount of code to be sent from the amount of code [and then allocate that chain]
An operation such as holding the remainder of the code amount is performed. Also
, the encoding abort circuit 16 refers to this allocation amount and inputs the
Sends the sign of the input DC component to be sent and the sign of EOB.
If the allocated code amount is not enough to output
After sending out the code of 7, the encoding of that block is terminated.
7, reduce the transmitted code amount from the allocated code amount of the block.
do. In other words, the remainder of the allocated code amount is retained as a negative value.
Then perform the following actions. 10 is a code 81 output circuit, and this n-th output circuit 10 is
Connects the variable length code manually input from the variable length encoding circuit 8.
This is a code that is used to connect the code to a memory card.
The data is written to the recording system 22, which is composed of a recording medium such as a hard drive.
It works like a sea urchin. In this system, each color component determined according to the shooting mode is
Use the commonly used initial standard quantization coefficient α.
Performs J1 processing (first bus) and blocks necessary for optimization.
The amount of information for each color component, the amount of information for each color component, and the information for the entire image.
Investigate the amount, etc., and then, based on the information obtained through this statistical processing,
Starts processing to perform optimized encoding (second bus
). So first block the image, this block
standard amount common to each color component for elements of the image
Quantization using the childization coefficient α, obtained by quantization
Variable length encoding of transform coefficients, and this variable length encoding
The code amount information of each element of each block obtained from
Each color component is calculated from the code amount for each component and the code amount information for the entire image.
Prediction of the coding coefficient α required to obtain the optimal amount of code for each minute.
measurement, proportional allocation of code amount allocated to each color component, and this allocation.
The divided code amount and the code generated in each block of its color components
Determining the standard allocated code amount for each block based on the amount
, a processing model for optimal encoding of the image to be processed based on these.
transition to the
Locking process, for the elements of this blocked image.
quantization using the predicted quantization coefficient α for each color component.
quantization process, the transform coefficients obtained by this quantization [long sign
coding, standard allocated code amount for each block and that block.
The amount of code carried over from the previous processing block is added to the
Variable length encoding processing control within the specified code amount, processing target image
In order to preserve the encoded information of the image, the variable length encoding processing system is
This is called output processing of the variable length code code information obtained by controlling the variable length code.
However, the overall control management is not as shown in the diagram.
It is assumed that the control circuit 18
. Note that this function of the control circuit 18 is performed by a microprocessor.
This can be easily realized by using a processor (MPLI). The above is the configuration of the encoding circuit 80. The recording system 70 in FIG. 1 is an interface circuit 70a.
and a recording medium 7 which is removably connected to this.
Image data encoded and output by the encoding circuit 80
The data and quantization width (or information corresponding to this ≦ this) are
recorded on the recording medium 71 via the interface circuit 70a.
The configuration is as follows. Next, the operation of this device having the configuration shown in FIGS. 1 and 2 above.
I will explain the operation process first, but to get an overview of the whole process.
The basic operation will be explained with reference to FIG. 8 which is a diagram. When using the camera, the user of the camera must switch
30 to set the desired number of shots.
Ru. As a result, the control circuit 90
Find the optimal code amount and use this as the target code amount setting information.
and is applied to the encoding circuit 80. Pictures that can be taken with this model
number is set. When the next photograph is taken, the camera is placed behind the photographic lens 40a.
A subject image is formed as an optical image on the image sensor 40b.
. This image sensor 40b then captures this formed optical image.
is converted into an image signal and output. By the image sensor 'f'-40b, the image signal is
is input to the signal processing circuit 60, where the signal processing circuit 60
Amplification by the amplifier circuit Boa inside, A/D converter 6ob
After exchanging Yoru^/D, temporarily held in buffer Ameseri 6oe
be done. And after this, from Kurahua Memory 60e
The process circuit 60d in the signal processing circuit 60
Accordingly, processing such as band correction and color signal formation is performed. Here, for the later first pass processing, V (luminance phrase), Cr
, in the order of Cb (chroma system, both color difference components) signals.
Therefore, the color signal formation is also affected accordingly. In other words, the image signal is blocked in an 8x8 pixel matrix.
In process circuits, this block is
image (Y component, Cr component from No. 5 data)
(1?4 components), Cb acid component, B-Y component) in the order
In addition to separating the signals of each color component, gamma correction n
Performs white balance processing, etc. 8x8 matrix separated by process circuit God
Image signal of each color component in the blocked image signal of
Data is input to encoding circuit 80. This results in
Image data for one frame (or field)
is divided into blocks of the above-determined size and sequentially
The signal is input to the encoding circuit 80. Furthermore, in the process circuit 60d
The image signals of each color component processed by Y, Cr,
Each color component of Cb is stored in a buffer memory for later processing.
In theory, it may be read out and used. In this embodiment, the image quality (from the No. processing circuit 60) is
)′ component (luminance component) in image signal data.
force is applied, and this is processed later (statistical processing)
After that, all the image data of the Cr component is
Blocking is performed, and statistical processing is performed on this at a later stage.
After that, block the eb acid component image and
The process of performing later statistical processing on
conduct. The encoding circuit 80 receives this signal from the signal processing circuit 60.
Input data is given to the orthogonal transform circuit 4. Then, the orthogonal transformation
The conversion circuit 4 converts input image data into blocks (hereinafter referred to as blocks).
7 for each block (called lock image data)
For example, two-dimensional orthogonal transformation by discrete cosine transform (DCT)
Perform the conversion. This orthogonal transformation by DCT is
Divide the waveform into frequency components and divide this into frequency components as the number of input samples.
Represented by the same number of cosine waves, each with a different frequency
This is the process. Then, orthogonally transformed block image data (transform coefficient
) is an 8×8 matrix in the buffer memory (not shown).
is stored at the corresponding frequency component position on the matrix (matrix).
The origin position of Rix is the DC component, and the rest are AC components.
A relationship in which the frequency increases as the distance from the origin position increases
(stored in a matrix with
6. Then, the quantization circuit 6 converts this block image data (transformed
The first bus (first time) quantization is performed on the coefficient). In this first quantization, each preset frequency component is
every minute (frequency components are for each matrix position of the block)
quantization matrix (determined accordingly) at the time of shooting.
Control circuit 1B corresponds to the image quality setting value set by the user.
The amount multiplied by the standard (provisional) quantization coefficient α given by
Quantize the transform coefficients using the child width (Figure 8 (hl,
i)). The quantization matrix at this time is the luminance system and the chrominance system.
It may be the same for both Ma-kei and Ma-kei, but each
The ability to set a suitable quantization matrix gives good results.
It will be done. The quantized block image data (transform coefficients) is iil
It is input to the variable length naturalization circuit 8, where ri1 variable length n
be converted into In the variable length encoding circuit 8, it is converted into mf and inputted.
Zigzag scan the obtained conversion coefficients in the order shown in Figure 7.
, scans from low frequency components to high frequency components. That is, the transform coefficients are divided into an 8×8 matrix and the frequency
It is stored corresponding to the component, and the closer it is to the meditated point, the higher the frequency.
Since the number is low, zigzag scanning can be used to detect low frequencies.
It is possible to scan from component to higher frequency component. The first data in the scanning order in Figure 7 is the DC component DC.
Therefore, this DC component DC data is immediately preceded by a variable length code.
DC component D of the converted block (previous block)
The difference value djrf-DC with C is manually encoded (
Figure 8 (di), (el,)). For AC components A and C, are they the second in the scanning order in Figure 7?
Look at the conversion coefficients in order from 64th to
When a non-zero (i.e. valid) coefficient appears, immediately
Number of consecutive 0 (invalid) coefficients that existed before (zero run)
) and its effective coefficient values to perform two-dimensional Huffman encoding.
((d2), (e2)). Further, the variable length encoding circuit 8 encodes the 64th coefficient after a certain coefficient.
End of block if invalid coefficients continue up to the coefficient
The EOB (end of block) sign indicating
'Save. (5) The code emitted for that R”y
The length is input H4 to the code amount calculation circuit 14 (gl). This kind of processing for all blocks of one image can be done manually.
I'll go. If this processing for the Y component is completed, then
Next, the same process is applied to each of the Cr and Cb components. On the other hand, the code amount calculation circuit 14 inputs YSCr, C
b Calculate the code amount for the entire image for each color component.
For each block of each component of )゛, Cr, , Cb,
Calculate the code amount and calculate the code amount for each color component and for the entire image.
In addition to performing integration for the body (g2), for each block
The code amount data is output to the code amount allocation circuit 20. sign
The quantity allocation circuit 20 receives this data of η versus quantity for each block.
The sign of the corresponding block position with 1 added to the code amount information table
volume information and

【、て書き込む。 そして、1画像分の全ブロックに゛つい°US )″、
crscb各成ノI〕、全ての・\フマン符列化処理を
終了した段階で、制御回路18の制御により、符号量算
出回路14はこの各色成分毎の符号量と画像全体の符号
量のデータを量子化幅を測回路12に出力すると共に、
画像全体の符号】のデータを符号量割当回路20に出力
する。 量子化幅予測回路12はこの入力された各色成分毎の符
号量と、画像全体の符号量データと、目的総n号量デー
タとから、例えば、線形予測により目紀行符号量の値に
近づけるのに最適な各色成分毎の量子化係数αを、実際
に使用したjir化係数に基づいて予測する(第8図(
h2))。 また、符号量割当回路20は入力された各ブロック毎の
符号量および画像全体の符号量と、目紀行符号量および
量子化幅予測回路12から与えられる色成分別予測量子
化係数αとから各ブロックの基準割当符号量を算出する
(第8図(h3))。 具体的には、量子化幅予測回路12が予測した色成分別
の量子化幅を用いて実際に符号化したときの各色成分毎
の符号量の比に、各ブロック毎の各基準割当符号量の各
色成分毎の比が合うように、予測した前記jilf化幅
で符号化を行うときの各色成分毎の発生符号量を上記式
(2)、式(3)から予測し1、この予測した各色成分
毎の発生符号量の比で、目的の紀行対量を配分した後、
各色成分において、各ブロック毎の統計量に基づいて、
更に比例配分する。このようにして、各ブロック毎の基
準割当符号量を決定する。 そして、この算出した各ブロックの基準割当符号量のデ
ータを、ブロック割当符号量データテーブルに格納する
。このブロック割当打+3量データテーブルの各ブロッ
ク別割当符号量のデータは、該当のブロックが可変長符
号化処理される際に符−帰化打切回路j6に与えられる
ことになる。 以上で1バス目、すなオ)ぢ、各ブロックの割当符号量
の決定及び量子化幅の最適化のための第1の符号化(統
計処理)を終了する。 次に2バス目の処理に入る。この2パス目の処理は第2
の符号化(n号化処理)であり、目的総荀対量に収まる
ように最適化した最終の符号化出力をiする処理である
。 この処理はますY成分について行い、Y成分か終了した
後にCr、 Cb酸成分処理を行う。Cr、 Cb酸成
分処理順序はいずれか先でも良い。従って、処理順序が
Cr、 CbO順であれば、Cr成分の処理を行い、そ
の後にCb酸成分ついて行うようにする。 順序か、Cb、 Crの順ならば、最初にCb酸成分つ
いて処理を行い、Cb酸成分終γした後にCr成分につ
いて行うようにすると云った具合である。 2ベスト1の処理は、初めに画像データをブロック化し
て読出し、これについて抽出されて信号処理回路60か
ら出力される)r成分(輝度系)の画像伝号データを符
号化回路80に人力する(a)。入力されたブロック化
画像データは符号化回路80における直交変換回路4に
入力され、再び直交変換が行われる(b)。この直交変
換により得られた変換係数は量子化回路6に入力され、
再び量子化が行われる(C)。ただ[5、このとき使用
する量子化係数aは前回のバスにおいて量子化幅予測回
路12が算出した各色成分別の予測の最適量子化係数a
である。 次に、量子化したブロック画像データの変換係数は、可
変長符号化回路8に入力される。可変長符号化は統旧処
理の時と同様、このブロック画像データの変換係数のう
ち、まず直流成分I)Cの差分値diff−DCをハフ
マン符号化しく (di)、  (el))、次に交流
成分ACをジグザグスキャンで順次データ抽出し5て2
次元のハフマン符号化を行う((d2)。 (e2))。 但し、一つの要素(マトリックス内の一つの位置)に対
するハフマン符号か発生する度に符号量割当回路20か
ら、割当符号量データテーブルに格納されているそのブ
ロックに対する基準割当符号量を符号化打切回路16に
出力し、一方、符号化打切回路16ではこの各ブロック
の基準割当符号;と前ブロックでの符号化処理における
割当符号;に対する余りを加えて該当ブロックの割当符
号量とすると共に、送出すべき符号量およびIEOBの
符号を送出しても割当符号量を越えない場合は、打切り
信号を発生せず、該ブロックの割当符号量から送出すべ
き符号量を減する処理を行う。 そし、で、送出すべき該ブロックの符号量とEOBの符
号との合計の符号量が、割当符号量の残りの符号量を上
まわったときに、符号化打切回路i6は可変長符号化回
路8に打切り信号を出力し、そのブロックのハフマン符
号化を終了させると共に、該ブロックの割当符号量から
、送出した符号量を減じて、その値を割当符号量の余り
として保持する。そして、可変長符号化回路8は量子化
回路6より得られる次のブロックのハフマン符号化に移
る。 また、符号化打ち切り回路16では、直流成分とEOB
の符号を送出するに割当符号量が足りない場合には、こ
れらの符号量は送出させた後、符号化打ち切り回路16
は可変長符号化回路8に打ち切り信号を出力し、そのブ
ロックのハフマン符号化を終了させると共に、該ブロッ
クの割当符号量から送出した符号量を減して割当符号量
の余りを負の値として保持する。 従って、”J変長符号化回路8は符号化打切回路1[i
から打切り信号か入力されるまで、変換された′\フマ
゛、・符号を、符号出力回路10に出力し、打切り信号
発生前にマトリックスのすべての要素に対するハフマン
符号化が終わった場合には、可変長符号化回路8はEO
Bの符号を符号出力回路1oに出力する。また、可変長
符号化回路8はマトリックスの全ての要素に対するハフ
マン符号化が終わる前に打切り信号か入力された場合に
は、その符号の代りにEOBの符号を符号出力回路1o
に出力することになる。符号出力回路1oではこの符号
化されたデータを一時記憶する。 そして、可変長符号化回路8は量子化回路6より得られ
る次のブロックのハフマン符号化に移る。 このような動作を繰り返し、1画面の画像の全ブロック
の処理か終わることにより、全ての符号化処理を終了す
る。Y成分に対するこのような処理か終ると、次に同様
の手法でクロマ系成分(Cr 、 Cb)の処理に入る
。この2番手の成分の処理でも、量子化回路6は前回の
バスにおいて量子化幅′f−測回路12が算出したクロ
マ系成分用のT′−測された最適息子化係数αを使用す
る。 二のようにしてすべての色成分について、1画面分の画
像の全ブロックの上記2バス目の処理が終わることによ
り、全ての符号化処理を終了する。 この終了にあたり、符号出力回路10では最適化された
]画像分のハフマン符号化データを記録系22に出力し
、記録系22におけるメモリカードと云った記憶媒体7
】に書き込む(f)。これは、符号出力回路10の出力
により行われるが、符号出力回路10は口1変良化号化
回路8からの可変長符号であるハフマン符号をつなぎ合
わせ、記憶媒体71であるメモリカードに与えることで
書き込む。この符号出力回路10の出力による記憶媒体
71への書き込みは、第2バスか終わった段階でまとめ
て行うようにしても良いか、第1バスが終って第2バス
実行に入った段階で弓変長のハフマン符号をつなぎ合わ
せた結果が、1バイト若しくは数バイト単位、まとまり
次第、順次、記憶媒体へ書き込むようにしても良い。 尚、これに先立ぢ、符号出力回路10では符号化に使用
した各色成分の量子化マトリックスの情報を、当該符号
化した画像の記憶データにおけるヘッダ部分に書き込み
、再生時の手掛かりと1.で残す。 以上、本装置においては、最初に統計処理を行い、この
統計処理により各色成分別の最適な量子化幅の予測値と
、各色成分別品ブロックの基マ割当符号量の決定に必要
な統;1量を得、これらの情報をもとに、各色成分別の
最適な量子化幅の予測と、各色成分別の符号量の割当、
この割当てられた符号量と各色成分別品ブロックの発生
符号量の情報とを用いて各色成分別品ブロックの基準割
当符号量の決定を行った後、実際の符号化の処理に入り
、各色成分別にその色成分における各ブロックについて
順に、符号化出力を見ながら、そのブロックに割り当−
Cられた基準割当符号量と、そのブロックの一つ前の処
理ブロックでの割当符号量に対する実際の出力符号量の
過本肥分(繰り越し分)を合わせて得られたそのブロッ
クの割当符号量内に収まるように、可変長符号化を打ぢ
切ることで、ブロック毎の符号量を制御し、所望の符号
量内に収まった符号化出力を最終出力として得るように
したものであり、この点が本発明の重要なポイントとな
っている。 よって、本実施例で使用したブロックサイズ、直交変換
の種類、可変長符号化の種類等に限定されるものではな
い。また、統計処理は必ずしも1回である必要はなく、
無くても良いし、後数回でも良い。 但し、統計処理を一回実施するのが、処理時間と得られ
る効果の点で最も得策である。また、統計処理は実際に
符号化を行って発生符号量を確認する必要は必ずしも無
く、各ブロック毎にアクティビティを求め、その結果か
ら各ブロック毎の基準割当符号量と量子化係数を求める
方式であっても良い。 また、必ずしも、目紀行符号量を全て各ブロックに割り
当てる必要はなく、例えば、目紀行符号量を各ブロック
の割当符号量に割り当てたときの余りを仮に最初のブロ
ックに対して、前の処理ブロックでの過不足労として与
える等しても良い他、本実施例においては、各ブロック
の基準割当符号量の決定及び符号量の制御にEOBの符
号量を含めていたが、EOBの符号量は量子化幅が変化
しても変わらないので、予めこのEOBの符号量を除外
して各ブロックの基準割当符号量の決定及び符号量の制
御を実施しても勿論差支えなく、むしろこの方か精度が
向上するので望ましい。同様に、量子化幅の予測におい
てもEOBの符号量を除外し。 た符号量を用いて予測を行うと良い。 また、圧縮率はり変でなくとも良く、一種類の圧縮率に
固定であり、目的総旬対量、暫定的−量子係数などか全
て、固定値としてりえられても良く、このようにした場
合にはその構成はより簡単になる。また、画像データバ
ッファメモリは直交変換回路4と量子化回路6との間に
あ−)でも良く、むしろこのようにすると符号化処理に
おけるブロック化と直交変換のプロセスを省略てきる。 しかし、精度を保った豹には、この場合、画像メモリの
サイズか大きくなる。 また、プロセス処理もA/D変換の前に行うようにLl
その後にディジタル化するようにしても構わない。また
、本装置においては、ブロック毎の可変長符号化を低周
波成分より行い、画質への視覚的影響の比較的少ない高
周波成分か符号化の打ぢ切りにより省略されるようにし
ているので、画質の劣化を最小限に抑えて、しかも、高
圧縮で符号化できるようになる。 以上、詳述した第1図および第2図の構成の本発明は、
要するに、統計処理の結果をもとに、各色成分別の量子
化係数の予測を行い、また、色成分別の量子化幅を用い
て実際に符号化したときの各色成分毎の符号量の比に、
各ブロック毎の各基準割当符号量の各色成分毎の比が合
うように、目的の紀行対量を配分し、これを更に色成分
別品ブロック毎の予測ね活量で比例配分してその各ブロ
ックの基準割当符号量を求め、また、符号化処理におい
ては、このF 11した各色成分別Nf化係数を使用し
ての各色成分別各ブロックの量子化並びに可変長符号化
と、その可変長符号化処理対象ブロックの基準割当符号
量とそのブロックの前の処理ブロックでの割当符号量に
対する過不足労とを加えて得られる割当符号量に、上記
可変長符号化による符号量が収まるように、ブロック毎
に符号量を監視しながら、可変長符号化を進め、符号量
が割当符号量に達すると、そのブロックの符号化は終了
させるか、直流成分は割当符号量を越える場合でも必す
符号化させ、そのときの割当符号量の過不足を記憶し5
ておき、次のブロックの符号化に移ってゆくようにする
と云うものである。 これは単に各ブロック毎の統t]量たけで目的とする符
号量を比例配分して求めた各ブロック毎の割り当て符号
量を用いたのでは、ある色成分ではブロック毎の割り当
て符号量か余分であり、ある色成分では不足する場合か
あるか、予測した各色成分毎の発lト符号量の比で目的
とする紀行対量を配分し、これを更に各ブロック毎の統
計量をもとに比例配分することで、各ブロック毎の割り
当て符号量を求めることにより、この各ブロック毎の割
り当で符+3量の各色成分毎の比と、実際にn号化した
ときの発生符号量の各包成句毎の比と極く近くなるので
、各ブロック毎の割り当て符号量は妥当なものとするこ
とかできると云うものであり、このような合理的な配分
を予め行うことで、 各色成分ともにバランスのとれた符号化か行えるように
するためである。 従ってこの発明によれば、幅広い空間周波数の画像に対
し5、画質を損なうことなく、一定の処理時間内で一定
の符号量内に収まるように符号化できるようになる。 上述し7た第2図の構成の符号化回路80は、圧縮符号
化において、一連の処理を[1釣行号量に基づき、算出
した暫定的な量子化幅で第1バスの処理を行い、その結
果をもとに最適な量子化幅を求めてこの最適なffi 
f化幅により第2パスを実施し、鹸終的な圧縮石号化デ
ータを得ると云った二回の処理で完成させるもので、第
1バスにより各色成分別の最適なaと各色成分別品ブロ
ック毎の基準割当ね活量を決定するものである。 第一3図1:符号化回路80の処理の流れを・jりす。 第3図においては符号化回路80の処理の流れをわかり
わくするために、第1バスでの信号の流れを点線の矢印
■で、また、第2バスでの信号の流れを実線の矢印■で
それぞれ図示し7である。この信号の流れに沿ってざっ
と動作を追ってろると次のようになる。 画像データの符号化か行われるに当り、目的とする紀行
対量が符号化回路80の制御回路18内に設定される。 これはスイッチ30の操作により、使用者が所望の撮影
可能枚数を設定することにより、この設定した撮影口J
能枚数に応じて制御回路90が最適符号量を選択し、こ
れを目紀行符号量の情報として符号化回路80に与える
ことで実現し一〇いる。 尚、初期状態では予め定めた標準的な撮影可能枚数に設
定される。 撮影か行われると、これにより撮像系40内の撮像系f
から画像信号か出力される。この出力された画像信号は
信号処理回路60内においてディジタル伝号に変換され
、バッファメモリに記憶された後、8X8画素のブロッ
ク単位で読み出され、Y成分、次にCv酸成分次にCb
酸成分分離される。 この分離は最初に )′成分について行われ、8×8画
素のブロック単位で出力される Y成分の画像データは
直交変換回路4に入力されて、ブロック毎に旧交変換(
本例ではI)CT  ;離散コサイン変換(Disc、
rcl、e Co51ne Transrorm)が行
われ、周波数成分別にデータが分解される。 直交変換回路4て得られたDCT変換係数は量子化回路
6に入力され、一方、制御回路18から目紀行符号量が
量子化幅予測回路12に出力され、量子化幅予測回路1
2では[」紀行符号量から式(1)の関係を用いて量子
化係数αの初期値を設定し、量子化回路6に出力する。 量子化回路6では、入力された初期値の量子化係数α(
すなわち、暫定的な量子化係数α)を用いて、変換係数
を線形量子化する。量子化された変換係数は可変長符号
化回路8に入力され、可変長符号化(本例ではハフマン
符号化)が行われる。 ここで入力された量子化係数は、ジグサグスキャー・と
呼ばれる低周波数成分から高周波数成分への走査か行わ
れ、一番目の直流成分のデータは直前に可変長符号化を
行ったブロックの直流成分との差分値かハフマン符号化
さねて出力される。 交流成分については走査順序の2番目から64番目まで
順番に変換係数を見てゆき、変換係数か0てない(すな
わち、有効な)係数が出てきたら、その直前に存在した
連続したO(零、無効)の係数の数(ゼロラン)とその
有効係数との値で、2次元のハフマン符号化が行われる
。また、ある係数以降、64番目の係数まで、連続して
無効出力が続く場合には、ブロックの終りを示すEOB
の符号を出力する。 可変長良化化回路8は、以上のような符号化か行われ、
1つの符号か発住する毎に、その符号長を符号量算出回
路14に出力する。符号量算出回路14は入力された各
符号長を色成分別各ブロック別に記憶すると共に、色成
分毎に符号長を累積し、記憶する。 〜゛成分ついてのこのような処理か終了すると、次にC
r成分、そ
[, write. Then, ゛°US)'' for all blocks of one image,
crscb each generation], at the stage when all human encoding processing is completed, the code amount calculation circuit 14 calculates the data of the code amount for each color component and the code amount for the entire image under the control of the control circuit 18. While outputting the quantization width to the measurement circuit 12,
The code of the entire image] is output to the code amount allocation circuit 20. The quantization width prediction circuit 12 uses the input code amount for each color component, the code amount data for the entire image, and the target total n code amount data to approximate the value of the eye travel code amount by linear prediction, for example. The optimal quantization coefficient α for each color component is predicted based on the jirization coefficients actually used (see Fig. 8).
h2)). Further, the code amount allocation circuit 20 uses the input code amount for each block and the code amount of the entire image, and the predicted quantization coefficient α for each color component given from the eye travel code amount and quantization width prediction circuit 12. The standard allocated code amount of the block is calculated (FIG. 8 (h3)). Specifically, each reference allocated code amount for each block is determined by the ratio of the code amount for each color component when actually encoding using the quantization width for each color component predicted by the quantization width prediction circuit 12. The generated code amount for each color component when encoding is performed using the predicted jilf width is predicted from the above equations (2) and (3) so that the ratio of each color component matches 1. After allocating the target travel amount by the ratio of the generated code amount for each color component,
For each color component, based on the statistics for each block,
Furthermore, it will be distributed proportionately. In this way, the standard allocated code amount for each block is determined. Then, the calculated standard allocated code amount data for each block is stored in the block allocated code amount data table. The data of the allocated code amount for each block in this block allocation + 3 amount data table will be given to the code-naturalization abort circuit j6 when the corresponding block is subjected to variable length encoding processing. This completes the first encoding (statistical processing) for determining the allocated code amount for each block and optimizing the quantization width for the first bus. Next, processing for the second bus begins. This second pass process is
(n-encoding process), and is a process in which the final encoded output optimized to fit within the target total amount is i. This treatment is performed first on the Y component, and after the Y component is completed, the Cr and Cb acid components are treated. The Cr and Cb acid components may be treated in any order. Therefore, if the treatment order is Cr and CbO, the Cr component is treated first, and then the Cb acid component is treated. If the order is Cb and Cr, then the Cb acid component is treated first, and after the Cb acid component has been treated, the Cr component is treated. In the 2 best 1 process, image data is first read out in blocks, and image transmission data of the r component (luminance system) (which is extracted and output from the signal processing circuit 60) is manually input to the encoding circuit 80. (a). The input blocked image data is input to the orthogonal transformation circuit 4 in the encoding circuit 80, and orthogonal transformation is performed again (b). The transform coefficients obtained by this orthogonal transform are input to the quantization circuit 6,
Quantization is performed again (C). However, [5, the quantization coefficient a used at this time is the optimum quantization coefficient a of the prediction for each color component calculated by the quantization width prediction circuit 12 in the previous bus.
It is. Next, the transform coefficients of the quantized block image data are input to the variable length encoding circuit 8. In variable length encoding, as in the conventional processing, among the transform coefficients of this block image data, first the difference value diff-DC of the DC component I)C is Huffman encoded (di), (el)), and then Data is extracted sequentially from the alternating current component AC by zigzag scanning.
Perform dimensional Huffman encoding ((d2). (e2)). However, each time a Huffman code for one element (one position in the matrix) is generated, the code amount allocation circuit 20 sends the standard allocated code amount for that block stored in the allocated code amount data table to the encoding abort circuit. On the other hand, the encoding abort circuit 16 adds the remainder to the reference assigned code of each block and the assigned code in the encoding process of the previous block to obtain the assigned code amount of the corresponding block, and sends it out. If the allocated code amount is not exceeded even if the exponent code amount and the IEOB code are sent, a process is performed to reduce the code amount to be sent from the allocated code amount of the block without generating an abort signal. Then, when the total code amount of the code amount of the block to be sent and the EOB code exceeds the remaining code amount of the allocated code amount, the encoding abort circuit i6 starts the variable length encoding circuit. 8, a termination signal is output to terminate the Huffman encoding of the block, and the transmitted code amount is subtracted from the allocated code amount of the block, and the value is held as the remainder of the allocated code amount. The variable length encoding circuit 8 then proceeds to Huffman encoding the next block obtained from the quantization circuit 6. Further, in the encoding aborting circuit 16, the DC component and the EOB
If the amount of allocated codes is insufficient to send out the codes, these codes are sent out and then sent to the coding abort circuit 16.
outputs an abort signal to the variable length encoding circuit 8 to end the Huffman encoding of the block, and also subtracts the transmitted code amount from the allocated code amount of the block and sets the remainder of the allocated code amount as a negative value. Hold. Therefore, the "J variable length encoding circuit 8 is the encoding abort circuit 1 [i
The converted '\huma', - code is output to the code output circuit 10 until a truncation signal is input from , and if Huffman encoding is completed for all elements of the matrix before the truncation signal is generated, The variable length encoding circuit 8 is EO
The code of B is output to the code output circuit 1o. Furthermore, if the variable length encoding circuit 8 receives an abort signal before completing Huffman encoding for all elements of the matrix, the code output circuit 1o outputs the EOB code instead of that code.
It will be output to . The encoded data is temporarily stored in the code output circuit 1o. The variable length encoding circuit 8 then proceeds to Huffman encoding of the next block obtained from the quantization circuit 6. By repeating such operations and completing processing of all blocks of one screen image, all encoding processing is completed. Once the Y component is processed in this way, the chroma components (Cr, Cb) are processed in a similar manner. In processing this second component as well, the quantization circuit 6 uses the T'-measured optimal sonization coefficient α for the chroma component calculated by the quantization width 'f-measurement circuit 12 in the previous bus. As shown in step 2 above, all the encoding processes are completed by completing the processing of the second bus for all blocks of one screen's worth of images for all color components. Upon completion of this process, the encoder output circuit 10 outputs the optimized Huffman encoded data for the image to the recording system 22, where it is stored in a storage medium 7 such as a memory card.
] (f). This is performed by the output of the code output circuit 10, which connects the Huffman code, which is a variable length code, from the variable-length encoding circuit 8 and provides it to the memory card, which is the storage medium 71. Write about it. The writing to the storage medium 71 by the output of the code output circuit 10 may be performed all at once when the second bus is completed, or it may be performed once the first bus is completed and the second bus is executed. The results of connecting variable-length Huffman codes may be sequentially written to the storage medium in units of one byte or several bytes as soon as they are assembled. Note that, prior to this, the code output circuit 10 writes information on the quantization matrix of each color component used for encoding into the header part of the stored data of the encoded image, and uses it as a clue during playback and 1. I'll leave it there. As described above, in this apparatus, statistical processing is first performed, and through this statistical processing, the necessary techniques are used to determine the predicted value of the optimal quantization width for each color component and the base map allocation code amount for each color component-specific product block. Based on this information, predict the optimal quantization width for each color component, allocate the code amount for each color component,
After determining the standard allocated code amount for each color component block using this allocated code amount and information on the generated code amount for each color component block, the actual encoding process begins. Separately, look at the encoded output for each block in that color component in turn and assign it to that block.
The allocated code amount for that block, which is obtained by combining the standard allocated code amount calculated by C and the excess (carryover) of the actual output code amount for the allocated code amount in the processing block immediately before the block. The amount of code for each block is controlled by terminating the variable length encoding so that the amount of code is within the desired amount, and the final output is a coded output that is within the desired amount of code. This point is an important point of the present invention. Therefore, the block size, the type of orthogonal transformation, the type of variable length encoding, etc. used in this embodiment are not limited. Also, statistical processing does not necessarily have to be done once;
You don't have to do it, or you can do it a few more times. However, it is best to perform statistical processing once in terms of processing time and effects obtained. In addition, statistical processing does not necessarily require actual encoding to check the generated code amount; instead, it is a method that calculates the activity for each block and calculates the standard allocated code amount and quantization coefficient for each block from the results. It's okay to have one. In addition, it is not necessarily necessary to allocate all of the code amount of the memory to each block. For example, when the code amount of the memory is allocated to the allocated code amount of each block, the remainder may be used for the first block and the previous processing block. In addition, in this embodiment, the EOB code amount is included in the determination of the standard allocated code amount for each block and the code amount control. Since it does not change even if the quantization width changes, it is of course possible to exclude this EOB code amount in advance and determine the standard allocated code amount for each block and control the code amount. It is desirable because it improves Similarly, in predicting the quantization width, the EOB code amount is excluded. It is better to perform prediction using the code amount. Also, the compression ratio does not have to be variable, it is fixed to one type of compression ratio, and the objective total summation coefficient, provisional quantum coefficient, etc. may all be set as fixed values. The configuration becomes simpler. Further, the image data buffer memory may be provided between the orthogonal transform circuit 4 and the quantization circuit 6, and in this case, the blocking and orthogonal transform processes in the encoding process can be omitted. However, in this case, the size of the image memory increases to maintain accuracy. Also, process processing is performed before A/D conversion.
You may digitize it afterwards. In addition, in this device, variable length encoding is performed for each block starting with low frequency components, and high frequency components that have relatively little visual impact on image quality are omitted by discontinuing encoding. Encoding can be performed with high compression while minimizing deterioration in image quality. The present invention having the configuration shown in FIGS. 1 and 2 described above has the following features:
In short, based on the results of statistical processing, we predict the quantization coefficient for each color component, and also compare the amount of code for each color component when actually encoding using the quantization width for each color component. To,
The target travel pair amount is distributed so that the ratio of each standard allocated code amount for each color component is matched, and this is further distributed proportionally by the predicted energy amount for each color component product block. The standard allocated code amount for the block is determined, and in the encoding process, quantization and variable length encoding of each block for each color component using the F11 Nf coefficient for each color component, and variable length encoding are performed. The amount of code obtained by the variable-length encoding is made to fit within the allocated code amount obtained by adding the standard allocated code amount of the block to be encoded and the excess or deficiency of the allocated code amount in the processing block before that block. , proceed with variable length encoding while monitoring the code amount for each block, and when the code amount reaches the allocated code amount, the coding of that block is terminated, or even if the DC component exceeds the allocated code amount, it is necessary to Encode it and store the excess or deficiency of the allocated code amount at that time5.
Then, the next block is encoded. This means that if you simply use the allocated code amount for each block, which is obtained by proportionally allocating the target code amount by the amount of code for each block, for a certain color component, the allocated code amount for each block or the extra Then, if there is a shortage in a certain color component, the target amount of travel code is allocated based on the predicted ratio of the emitted code amount for each color component, and this is further calculated based on the statistics for each block. By calculating the allocated code amount for each block, we can calculate the ratio of sign + 3 amount for each color component and the generated code amount when actually n-coding. Since the ratio is very close to the ratio for each inclusive phrase, it is possible to make the allocated code amount for each block reasonable.By making such a rational allocation in advance, each color component This is to enable balanced encoding. Therefore, according to the present invention, it becomes possible to encode images with a wide range of spatial frequencies within a certain amount of code within a certain processing time without degrading the image quality. In compression encoding, the encoding circuit 80 having the configuration shown in FIG. , based on the results, find the optimal quantization width and calculate this optimal ffi
The process is completed in two steps: the second pass is carried out depending on the f-size width, and the final compressed and encoded data is obtained.The first pass is used to determine the optimal a for each color component and the This is to determine the standard allocated activity for each product block. Figure 1 3: Process flow of the encoding circuit 80. In FIG. 3, in order to clearly understand the flow of processing in the encoding circuit 80, the flow of signals on the first bus is indicated by dotted arrows, and the flow of signals on the second bus is indicated by solid arrows. 7, respectively. If you follow the operation along the flow of this signal, it will look like the following. When encoding image data, a target travel pair quantity is set in the control circuit 18 of the encoding circuit 80. By operating the switch 30, the user sets the desired number of shots that can be taken.
This is achieved by the control circuit 90 selecting the optimum code amount according to the number of sheets of information, and providing this to the encoding circuit 80 as information on the number of travel code amounts. Note that in the initial state, the number of images that can be taken is set to a predetermined standard number. When photographing is performed, this causes the imaging system f in the imaging system 40 to
An image signal is output from. This outputted image signal is converted into a digital signal in the signal processing circuit 60, stored in a buffer memory, and then read out in blocks of 8x8 pixels.
The acid component is separated. This separation is first performed on the )′ component, and the Y component image data is output in blocks of 8×8 pixels.
In this example, I) CT; Discrete cosine transform (Disc,
rcl, e Co51ne Transrorm) is performed to decompose the data into frequency components. The DCT transform coefficients obtained by the orthogonal transform circuit 4 are input to the quantization circuit 6 , while the control circuit 18 outputs the number of travel codes to the quantization width prediction circuit 12 .
In step 2, the initial value of the quantization coefficient α is set from the travel code amount using the relationship of equation (1), and is output to the quantization circuit 6. In the quantization circuit 6, the quantization coefficient α(
That is, the transform coefficients are linearly quantized using the provisional quantization coefficient α). The quantized transform coefficients are input to a variable length encoding circuit 8, and variable length encoding (Huffman encoding in this example) is performed. The quantization coefficients input here are scanned from low frequency components to high frequency components called jigsag scanning, and the data of the first DC component is the DC component of the block that was variable-length encoded immediately before. The difference value is Huffman encoded and output. For the AC component, look at the conversion coefficients in order from the 2nd to the 64th in the scanning order, and when a conversion coefficient or a non-zero (in other words, valid) coefficient appears, it is , invalid) coefficients (zero run) and their effective coefficients, two-dimensional Huffman encoding is performed. Also, if invalid output continues after a certain coefficient up to the 64th coefficient, EOB indicating the end of the block will be displayed.
Outputs the sign of . The variable length improvement circuit 8 performs encoding as described above,
Every time one code occurs, its code length is output to the code amount calculation circuit 14. The code amount calculation circuit 14 stores each input code length for each color component block, and also accumulates and stores the code lengths for each color component. 〜゛When this kind of processing for the component is finished, next C
r component,

【7てcb成分についても同様の処理を行う
。 一画像について、符号化が終了すると、符号量算出回路
14は累積した各色成分別各ブロック毎の符号量を加算
して各色成分毎の符号量と画像全体の符号量を紀行対量
値として算出する。この各色成分毎の符号量と紀行対量
値は量子化幅予測回M+、2に出力され、また、各色成
分毎の符号量及び画像全体の符号量割当回路20に出力
される。 以上の第1バスの符号化処理か終了すると、符号量割当
回路20は符号量算出回路14から入力された各色成分
毎の符号量、画像全体の符号量と、目的符号量および各
色成分別品ブロックの符号量から、比例配分により、各
色成分毎の各ブロックの基準割当符号量を算出し記憶す
る。また、量子化幅予測回路12では第1バスでの符号
化により求められた絵画像符号量と、制御回路18から
与えられた「J紀行符号量とから、より適した量子化係
数αを各色成分毎に予測1−7、量子化回路6に出力す
る。また、符号量割当回路20は目紀行符号量と、量子
化幅″f−測回路12から与えられる色成分別予測量子
化係数α等とから各ブロックの基準割当符号量を算出す
る。 続いて同じ画像データに対して第2バスの符号化処理が
行われる。第2バスでは信号処理回路60内のメモリか
ら読み出された画像データは、第1バスでの処理順序で
色成分に分離され、それぞれの成分の画像データは8×
8画素のブロック化等の処理が行われた後、直交変換回
路4に入力され、ブロック毎に順に直交変換(DCT変
換)され、これにより、直交変換回路4で得られたDC
T変換係数は量子化回路6に入力される。 一方、量子化回路6においては、与えられたこの予測に
よる新たな各色成分毎の量子化係数αによる補正済み量
子化幅を用いて、DCT変換係数を線形量子化する。量
子化された係数は可変長符号化回路8に入力され、第1
バスの符号化時と同様の方式でハフマン符号化される。 ここで符号化時に発生した符号量は、第1バスの終了時
に求められ、符号量割当回路20に記憶されている各色
成分別品ブロックの基準割当符号量のうちの当該符対比
処理しようとするブロックの基準割当符号Iと、当該符
号化処理しようとするブロックの1つ前の符号化処理ブ
ロックでの割当符号量に対する符号量の過不足性(繰り
越し分)とを加えた当該ブロックの割当符号量を基準値
としての比較が行われ、この基準値を越えた場合には符
号打切回路16の働きにより、そのブロック内でそれ以
降の符号化が打ち切られる。また、当該ブロックの符号
化を終了した時点での割当符号量の過不足は、符号量割
当回路20に記憶される。 以上の方法により目的縁符号量に制御された符号化デー
タは順次、符号出力回路10を経由して記録系70に出
力され、記録される。 次に記録系70にて記録された記録媒体71の圧縮符号
化記録画像データの再生について説明する。 第4図に再生機の構成を示す。図において、100は再
生機本体であり、この再生機本体100は読取71B3
02、復号化回路】04および処理回路106および制
御回路108を備える。読取部】02は記憶媒体71を
着脱でき、記憶媒体71の内容をインタフェース回路1
10を介して読出すようになっている。 復号化回路104は第5図のような機能ブロックを有す
る。すなわち、】12はハフマン符号化データを復号化
するハフマン復号部、11′4はこの/%フマン復号さ
れて得られたデータを、記憶媒体71から読み出されて
設定入力された量子化幅の情報に基づいて逆量子化する
逆量子化部、116はこの逆量子化されて得られたデー
タを逆DCT変換して映像信号データとして出力するI
DcT (逆DCT変換)部、そして、118はこれら
の制御を司る制御部である。 処理回WHosはバッファメモリ120、エンコーダ1
22およびDハ変換器124を備える。バッファメモリ
120は復号化回路104から出力された映像信号デー
タを一時保持するメモリであり、エンコーダ122はこ
のバッファメモリ120から読ろ出される映像信号デー
タをNTSC’方式の映像信号に変換するものであり、
Dハ変換器124はこのNTSC方式の映像信号をアナ
ログ変換してテレビ用の映像ら号として出力するための
ものである。 前記制御回路108は再生機本体100全体の制御を司
るものであり、再生機本体100の読取部102に対し
、符号化時の量子化幅の情報を読み出すべく制御して、
その結果、記録媒体71から読み出された符号化時の量
子化幅の情報を復号化回路104の逆量子化部114に
設定させ、続いて制御回路108は情報記録媒体71か
ら圧縮符号化された映像信号データを読出すべく、読取
部102を制御すると云った制御を行う。また、図示し
ないが再生機本体100には、コマ送りスイッチ等があ
り、このスイッチにより指定されたコマ位置の映像を再
生したりすることができる。このような制御も制御回路
108が行う。 次に上記構成の再生機の動作を説明する。圧縮符号化さ
れた映像信号データが記録された記録媒体(メモリカー
ド) 71が再生機本体100の読取部102に装着さ
れると、まず、制御回路108は読取部102に対し、
符号化時の各色成分毎の量子化幅の情報を読み出すべく
制御する。その結果、読取部102において記録媒体7
Iから符号化時の量子化幅の情報が読み出され、この情
報は復号化回路104の逆量子化部1.14に設定され
る。続いて制御回路108は記録媒体71から映像信号
を読出すべく、読取部102を制御するので、読取部1
02は記録媒体71から映像信号を順次読み出し、復号
化回路104に入力する。 これを受けた復号化回路104では、ハフマン復号部1
12においてハフマン符号を復号し、量子化係数を得る
。こうして得られた量子化係数は逆量子化回路114に
与えて逆量子化する。ここでの逆量子化は先に設定され
ている前記色成分別量子化幅の情報を用いて行われる。 逆量子化により得られた変換係数は、I DCT部11
Bにおいてブロック毎に逆DCT変換され、元の映像信
号に復元される。このようにしてY 、 Cr。 CbO順で映像信号か復元されて復号化回路104から
出力され、処理回路10B内のバッファメモリ120に
書き込まれる。1画面の映像信号データの書き込みが終
了すると、バッファメモリ120から通常のテレビ信号
の走査順で映像信号データが読み出され、エンコーダ1
22においてNTSC方式の映像(≦号に変換される。 更にl)/Δ変換器124によりアナログ信号に変換さ
れ、出力される。この映像(、−号をテレビモニタに入
力することにより、画像かテレビ映像として再生され、
映像として鑑賞でき、また、ビデオプリンタ等のプリン
ト装置にちえてプリントすることにより、ハードコピー
が得られるので、写真等と同様な形で鑑賞することがき
るようになる。 以上説明したように、カメラは所望の撮影可能枚数を設
定でき、撮影可能枚数を設定することで、カメラではこ
れに対応する圧縮率を自動設定すると共に、初めにこの
設定圧縮率に応じて定まる暫定的な量子化幅を用いて、
]画面分の撮影画像データを各色成分別各ブロック単位
で順に量子化し、可変長符号化し、その結果得られるそ
の各色成分毎および]画面分の撮影画像データの符号量
より“各色成分毎の最適fLF化幅”を1測し、11つ
、各色成分毎の符号量から各色成分毎の割り当て可能な
符号量を比例配分して定めると共に、各色成分毎の各ブ
ロック別に割り当てる基準符号量をそのブロックでの発
生符号量に応じて比例配分して定め、次に、前記予測し
た各色成分毎の最適量子化幅により、前記1画面分の撮
影画像データを各色成分別各ブロック毎に再び順に量子
化し、この量子化出力に対する可変長符号化にあたって
は、その各ブロックの基準割当符号量とその1つ前に処
理したブロックでの符号化処理における符号化の際の割
当符号量に対する余り分を加えた割当符号量を最大枠と
してこの範囲で可変長符号化処理するようにし、符号化
された映像信号の再生時には撮影時に使用した前記最適
量子化幅を用いて復号することにより、所望の圧縮率で
の符号化を圧縮率別にハードウェアを設けることなく、
共通の一つのハードウェアで実現でき、同様に所望の圧
縮率で符号化された画像データの復号化を圧縮率別にハ
ードウェアを設けることなく、共通の一つのハードウェ
アで実現できる。 以上、実施例では符号化の過程か第1バス(統計処理)
を]回、第2バス(符号化処理)を]回の計2回の処理
で終了する2バス方式としたが、これに限るものではな
く、第1バスを更に何度か繰り返すと更に良好な結果が
得られる。また、記録媒体にメモリカードを用いた例を
示したが、その他、フロッピディスク、光ディスク、磁
気テープ等を利用することもできる。また、カメラと再
生機か別体となっているものを示したが、カメラが再生
機の機能を合せ持つ一体型のものでも良い。更にまた、
実施例では量子化幅の値そのものを記録媒体に記録する
ようにしたが、量子化幅値を変換あるいは符号化して記
録するようにし、でも良い。また、以上の実施例では目
紀行符号量から量子化幅を設定し、でいたが、複数の目
紀行符号量をモードで切換えて使用するようなアプリケ
ーションにおいては、それぞれのモードに対応する量子
化幅を予め用意しておき、これをモードで切り換えて使
用するようにしても勿論差支えない。 尚、本発明は上記り、、Jlつ、図面に示す実施例に限
定することなくその要旨を変更しない範囲内で適宜変形
して実施し得るものであり、例えば、本発明はスチル画
像に限らず動画像等、種々の画像に対しての圧縮符号化
に適用できるものである。 また、上記実施例では圧縮率対応情報より紀行対量の情
報を与え、この紀行対量に対応した量子化幅を与えるこ
とのできる各色成分毎の量子化係数の予測を行い、この
予測された量子化係数に基づく量子化幅で量子化を行う
ようにしているが、予め圧縮率対応情報に対する量子化
幅の関係を計算で求めてテーブル化しておき、これをメ
モリ等に記憶して、圧縮率対応情報から直接、量子化幅
の情報(すなわち、量子化係数或いは量子化幅の値)を
出力させるようにすることもできる。このようにすれば
、所望の圧縮率に対応する情報を入力すると、この入力
された圧縮率対応情報に対応して一義的に定まる量子化
幅の情報を読出して出力でき、即座に最適量子化幅を設
定できて直ちに量子化回路にこの量子化幅で画像信号デ
ータを量子化させることができる。 この構成によれば、メモリ等に各種の圧縮率に対応した
最適量子化幅の情報を予め記憶させて、これを入力圧縮
率対応情報に対応して続出ずだけで最適量子化幅の情報
を与えることができるので、目紀行符号量に収まるよう
符号化するに当り、その処理を極めて短時間で行える他
、ハードウェアも簡単で済むようになる。 〔発明の効果〕 以上詳述したように、本発明によれば、幅広い空間周波
数の画像に対し、画質を損なうことなく、符号量の制御
が行えると共に、一定の処理時間で一定の符号量内に収
まるように符号化処理ができる等、電子カメラシステム
等に最適な画像データの符号化装置および符号化方法を
提供できる。
[7] Similar processing is performed for the cb component. When the encoding of one image is completed, the code amount calculation circuit 14 adds the accumulated code amounts for each block for each color component and calculates the code amount for each color component and the code amount for the entire image as a travel value. do. The code amount and travel pair value for each color component are output to the quantization width prediction circuit M+, 2, and are also output to the code amount for each color component and the code amount allocation circuit 20 for the entire image. When the encoding process of the first bus is completed, the code amount allocation circuit 20 receives the code amount for each color component inputted from the code amount calculation circuit 14, the code amount for the entire image, the target code amount, and the code amount for each color component. Based on the code amount of the block, a standard allocated code amount for each block for each color component is calculated and stored by proportional allocation. In addition, the quantization width prediction circuit 12 calculates a more suitable quantization coefficient α for each color from the picture image code amount obtained by encoding on the first bus and the “J travel code amount” given from the control circuit 18. The predictions 1-7 are output for each component to the quantization circuit 6.The code amount allocation circuit 20 also outputs the prediction quantization coefficient α for each color component given from the quantization width f-measurement circuit 12. The standard allocated code amount for each block is calculated from the above. Subsequently, encoding processing on the second bus is performed on the same image data. On the second bus, the image data read from the memory in the signal processing circuit 60 is separated into color components in the order of processing on the first bus, and the image data of each component is divided into 8×
After processing such as 8-pixel blocking is performed, the data is input to the orthogonal transform circuit 4, and orthogonal transform (DCT transform) is performed for each block in order.
The T transform coefficients are input to the quantization circuit 6. On the other hand, the quantization circuit 6 linearly quantizes the DCT transform coefficients using the corrected quantization width based on the new quantization coefficient α for each color component based on the given prediction. The quantized coefficients are input to the variable length encoding circuit 8, and the first
Huffman encoding is performed using the same method used for bus encoding. Here, the amount of code generated during encoding is obtained at the end of the first bus, and processing is performed on the corresponding sign of the standard allocated code amount of each color component block stored in the code amount allocation circuit 20. The assigned code of the block is the sum of the standard assigned code I of the block and the excess/deficiency of the code amount (carryover) with respect to the assigned code amount in the encoding processing block immediately before the block to be encoded. Comparison is performed using the amount as a reference value, and when this reference value is exceeded, the subsequent coding within that block is aborted by the action of the code abort circuit 16. Furthermore, the excess or deficiency of the allocated code amount at the time when the encoding of the block is finished is stored in the code amount allocation circuit 20. The encoded data controlled to the target edge code amount by the above method is sequentially outputted to the recording system 70 via the code output circuit 10 and recorded. Next, reproduction of compressed and encoded recorded image data recorded on the recording medium 71 by the recording system 70 will be explained. Figure 4 shows the configuration of the playback machine. In the figure, 100 is the main body of the playback machine, and this main body 100 of the playback machine reads 71B3.
02, decoding circuit] 04, a processing circuit 106, and a control circuit 108. Reading unit]02 can attach and detach the storage medium 71, and reads the contents of the storage medium 71 to the interface circuit 1.
10. The decoding circuit 104 has functional blocks as shown in FIG. That is, ]12 is a Huffman decoding unit that decodes Huffman encoded data, and 11'4 is a Huffman decoding unit that reads out the data obtained by the /% Huffman decoding from the storage medium 71 and converts it to the input quantization width. An inverse quantization unit 116 performs inverse quantization based on information, and an I inverse DCT transforms the data obtained by inverse quantization and outputs it as video signal data.
A DcT (inverse DCT transform) section, and 118 a control section that controls these. Processing time WHOs includes buffer memory 120 and encoder 1
22 and a D/H converter 124. The buffer memory 120 is a memory that temporarily holds the video signal data output from the decoding circuit 104, and the encoder 122 converts the video signal data read out from the buffer memory 120 into an NTSC' video signal. can be,
The D/C converter 124 converts this NTSC video signal into analog and outputs it as a video signal for television. The control circuit 108 is in charge of overall control of the player main body 100, and controls the reading section 102 of the player main body 100 to read out information on the quantization width at the time of encoding.
As a result, the information on the quantization width at the time of encoding read from the recording medium 71 is set in the inverse quantization unit 114 of the decoding circuit 104, and then the control circuit 108 sets the information of the quantization width at the time of encoding read from the information recording medium 71. In order to read out the video signal data, the reading section 102 is controlled. Further, although not shown, the playback main body 100 includes a frame advance switch and the like, and the video at the frame position specified by this switch can be played back. The control circuit 108 also performs such control. Next, the operation of the reproducing machine having the above configuration will be explained. When the recording medium (memory card) 71 on which compression-encoded video signal data is recorded is attached to the reading section 102 of the main body 100 of the playback device, the control circuit 108 first tells the reading section 102 to
Control is performed to read out information on the quantization width for each color component during encoding. As a result, the reading unit 102 reads the recording medium 7.
Information about the quantization width at the time of encoding is read from I, and this information is set in the inverse quantization section 1.14 of the decoding circuit 104. Next, the control circuit 108 controls the reading section 102 to read the video signal from the recording medium 71, so that the reading section 1
02 sequentially reads video signals from the recording medium 71 and inputs them to the decoding circuit 104. In the decoding circuit 104 that receives this, the Huffman decoding unit 1
12, the Huffman code is decoded to obtain quantized coefficients. The quantized coefficients obtained in this way are supplied to an inverse quantization circuit 114 for inverse quantization. The inverse quantization here is performed using the previously set information on the quantization width for each color component. The transform coefficients obtained by inverse quantization are transferred to the IDCT section 11
In B, each block is subjected to inverse DCT transformation and restored to the original video signal. In this way Y, Cr. The video signals are restored in CbO order, output from the decoding circuit 104, and written into the buffer memory 120 in the processing circuit 10B. When the writing of one screen of video signal data is completed, the video signal data is read out from the buffer memory 120 in the normal scanning order of the television signal, and the encoder 1
At step 22, the NTSC video (≦) signal is converted. Further, it is converted into an analog signal by an l/Δ converter 124, and output. By inputting this video (, -) to a TV monitor, it will be played back as an image or TV video,
It can be viewed as a video, and a hard copy can be obtained by printing with a printing device such as a video printer, so it can be viewed in the same way as a photograph. As explained above, the camera can set the desired number of shots that can be taken, and by setting the number of shots that can be taken, the camera automatically sets the corresponding compression rate, and the compression rate is initially determined according to this set compression rate. Using the provisional quantization width,
]Screen's worth of photographed image data is sequentially quantized and variable-length coded for each color component in each block, and from the code amount of each color component and screen's worth of photographed image data obtained as a result, the "optimum for each color component" is determined. fLF conversion width" is measured, and the code amount that can be assigned to each color component is determined by proportional allocation from the code amount for each color component, and the standard code amount to be allocated to each block for each color component is determined by that block. Then, using the predicted optimal quantization width for each color component, the captured image data for one screen is sequentially quantized again for each block for each color component. , when performing variable-length encoding on this quantized output, the standard allocated code amount for each block and the remainder of the allocated code amount during encoding in the encoding process of the block processed one before it are added. Variable length encoding is performed within this range with the allocated code amount as the maximum frame, and when the encoded video signal is played back, it is decoded using the optimum quantization width used at the time of shooting, thereby achieving the desired compression rate. can be encoded without installing hardware for different compression rates.
It can be realized with one common hardware, and similarly, decoding of image data encoded with a desired compression rate can be realized with one common hardware without providing hardware for each compression rate. As described above, in the embodiment, the encoding process or the first bus (statistical processing)
] times, and the second bus (encoding process) times, which completes the process two times in total. However, the method is not limited to this, and it will be even better if the first bus is repeated several times. results. Further, although an example is shown in which a memory card is used as the recording medium, other media such as a floppy disk, an optical disk, and a magnetic tape may also be used. Further, although the camera and the playback device are shown as separate bodies, it is also possible to use an integrated camera in which the camera also has the functions of the playback device. Furthermore,
In the embodiment, the quantization width value itself is recorded on the recording medium, but the quantization width value may be converted or encoded and then recorded. In addition, in the above example, the quantization width was set based on the amount of code for the travel code, but in applications where multiple code amounts for the travel code are switched and used by mode, the quantization width corresponding to each mode is Of course, it is also possible to prepare widths in advance and use them by switching them depending on the mode. It should be noted that the present invention is not limited to the embodiments described above and shown in the drawings, and can be implemented with appropriate modifications within the scope of the gist thereof.For example, the present invention is not limited to still images. It can be applied to compression encoding of various images such as moving images. In addition, in the above embodiment, information on travel vs. amount is given from compression ratio correspondence information, and a quantization coefficient for each color component that can give a quantization width corresponding to this travel vs. amount is predicted. Quantization is performed using the quantization width based on the quantization coefficient, but the relationship between the quantization width and the compression rate correspondence information is calculated in advance and created in a table. This is stored in memory etc. and the compression It is also possible to output quantization width information (ie, quantization coefficient or quantization width value) directly from the rate correspondence information. In this way, when information corresponding to the desired compression ratio is input, information on the quantization width that is uniquely determined according to the input compression ratio information can be read and output, and optimal quantization can be performed immediately. Immediately after setting the width, the quantization circuit can quantize the image signal data using this quantization width. According to this configuration, information on the optimal quantization width corresponding to various compression ratios is stored in advance in a memory, etc., and the information on the optimal quantization width is stored in correspondence with the input compression ratio information without being repeatedly displayed. Therefore, when encoding to fit within the code amount of the code, the processing can be done in an extremely short time and the hardware can be simple. [Effects of the Invention] As detailed above, according to the present invention, it is possible to control the amount of code for images with a wide range of spatial frequencies without degrading the image quality, and it is possible to control the amount of code within a certain amount of code in a certain processing time. It is possible to provide an image data encoding device and encoding method that are optimal for electronic camera systems, etc., and can perform encoding processing so that the image data fits within the range of .

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

第1図は本発明の第1の実施例を示すブロック図、第2
図は本発明装置の要部構成例を示すブロック図、第3図
は第2図回路の動作の流れを説明するためのブロック図
、第4図および第5図は再生機の構成を示すブロック図
、第6図は本発明による電子カメラ本体の外観を示す斜
視図、第7図は8X8画素に分けられたブロックのジグ
ザグ・スキャンを説明するだめの図、第8図は本発明の
原理的なfr用を説明するだめの動作遷移図、第C9図
は従来技術を説明するだめの動作遷移図、第10図は符
号量と量子化幅の関係を説明膚るための図である。 1・・・電子カメラ本体、6・・・量子化回路、8・・
可変長符号化回路、】O・・−符号出力回路、12・量
子化幅や#1回路、14・・・符号量算出回路、1B・
・・?1号仕打切回路、18.18a・・制御回路、2
0・・・符号量割当回路、24・・・DCPM回路、3
0・・スイッチ、40・撮像糸、48・・・1.、、C
I)表示器、60・・信号処理回路、80・・符号化回
路、70・・・記録系、71・・記録媒体、90  制
御回路、JOD・・・再生機本体、102・・・読取部
、104・・・復号化回路、lO6・・・処理回路、J
H・・制御回路、110 ・インタフェース回路、11
2・・ハフマン復号部、114  ・逆量了化部、11
6・・・IDcT(逆+1)CT変換)部、118・・
・制御部。 出願人代理人 弁理−七 坪井  淳 第6図 15気ル′井     交7九泳′佇 第7図 ogSF 量子化f系数 −−一−− 第10図
FIG. 1 is a block diagram showing a first embodiment of the present invention;
The figure is a block diagram showing an example of the main part configuration of the device of the present invention, FIG. 3 is a block diagram for explaining the flow of operation of the circuit shown in FIG. 2, and FIGS. 4 and 5 are block diagrams showing the configuration of the regenerator. 6 is a perspective view showing the external appearance of the electronic camera body according to the present invention, FIG. 7 is a diagram illustrating zigzag scanning of a block divided into 8×8 pixels, and FIG. 8 is a diagram showing the principle of the present invention. FIG. C9 is an operational transition diagram for explaining the conventional technique, and FIG. 10 is a diagram for explaining the relationship between code amount and quantization width. 1... Electronic camera body, 6... Quantization circuit, 8...
Variable length encoding circuit, ]O... - code output circuit, 12. quantization width and #1 circuit, 14... code amount calculation circuit, 1B.
...? No. 1 partition termination circuit, 18.18a...control circuit, 2
0... Code amount allocation circuit, 24... DCPM circuit, 3
0...Switch, 40...Imaging thread, 48...1. ,,C
I) Display device, 60...signal processing circuit, 80...encoding circuit, 70...recording system, 71...recording medium, 90 control circuit, JOD...player main body, 102...reading section , 104...Decoding circuit, lO6... Processing circuit, J
H... Control circuit, 110 - Interface circuit, 11
2... Huffman decoding unit, 114 - Inverse quantity conversion unit, 11
6...IDcT (inverse +1) CT conversion) section, 118...
・Control unit. Applicant's agent Patent attorney - 7 Atsushi Tsuboi Figure 6 Figure 15 Figure 7 ogSF Quantized f series --- 1 -- Figure 10

Claims (17)

【特許請求の範囲】[Claims] (1)色成分別に分離されたカラー画像データそれぞれ
を所定画素数のブロックに分割し、色成分別のこの分割
されたブロック毎に順に直交変換を行ってからこの変換
出力を量子化手段により量子化し、その後、この量子化
出力を可変長符号化手段に与えて可変長符号化し、画像
データの符号化を行う際に、初めに暫定的に定めた量子
化幅で量子化して可変長符号化し、各ブロック毎の符号
量を得る統計処理を行い、次にこの統計処理により求め
た各ブロック毎の符号量と、画像あたりの総符号量目標
値とからこの総符号量目標値に収めるに適した最適量子
化幅と各ブロック毎の割当符号量とを決定し、この決定
した最適量子化幅に従つて各ブロック毎の前記変換出力
の量子化を行うと共に、この量子化出力を各ブロック毎
の割当符号量に従つて各ブロック毎に符号量制御を行い
ながら順次可変長符号化する符号化処理を実施する符号
化装置において、 前記統計処理時の可変長符号化出力をもとに各色成分別
前記各ブロックの符号量を算出する算出手段と、 前記最適量子化幅で量子化した際の各色成分別符号量を
予測し、この各予測色成分別符号量に基づいて前記総符
号量目標値を比例配分し、各色成分別符号量を決定する
と共に、これを前記算出手段の算出値に従って比例配分
し、各色成分別各ブロックの基準符号量を決定する決定
手段と、符号化処理時に前記決定手段にて決定した各色
成分別各ブロックの基準符号量を用い、前記ブロックの
うち、次に符号化処理する処理対象ブロックの前に処理
した処理済みブロックでの符号化により発生した符号量
と当該処理済みブロックでの割当符号量との差を求めて
これを前記処理対象ブロックの前記基準符号量に加える
ことにより得られる符号量を当該処理対象ブロックでの
割当符号量として割り当てる割当手段と、 前記処理対象ブロックでの符号化処理において前記割当
手段により割り当てられた前記割当符号量を越えないよ
うに、前記可変長符号化を打ち切る打ち切り手段と を備えたことを特徴とする画像データの符号化装置。
(1) Divide each of the color image data separated by color component into blocks of a predetermined number of pixels, perform orthogonal transformation for each divided block by color component, and then quantize the transformed output by quantization means. Then, this quantized output is given to a variable-length encoding means to be variable-length encoded, and when encoding image data, it is first quantized with a provisionally determined quantization width and then variable-length encoded. , performs statistical processing to obtain the code amount for each block, and then calculates the code amount for each block obtained through this statistical processing and the total code amount target value per image to find the appropriate amount to fit within this total code amount target value. The optimal quantization width and allocated code amount for each block are determined, and the transform output for each block is quantized according to the determined optimal quantization width, and the quantization output is quantized for each block. In an encoding device that sequentially performs variable length coding while controlling the code amount for each block according to the allocated code amount, each color component is Calculating means for calculating the code amount of each block; and predicting the code amount for each color component when quantized with the optimum quantization width, and based on the predicted code amount for each color component, the total code amount target. a determining means for proportionally allocating the value and determining a code amount for each color component, and also for proportionally allocating this according to the calculated value of the calculation means to determine a reference code amount for each block for each color component; Using the reference code amount for each block for each color component determined by the determining means, the code amount generated by encoding in the processed block processed before the next target block to be encoded among the blocks is calculated. Allocation means that allocates the code amount obtained by calculating the difference from the allocated code amount in the processed block and adding it to the reference code amount of the processing target block as the allocated code amount in the processing target block; Encoding of image data, characterized by comprising: aborting means for aborting the variable length encoding so as not to exceed the allocated code amount allocated by the allocating means in the encoding process of the processing target block. Device.
(2)色成分別に分離されたカラー画像データそれぞれ
を所定画素数のブロックに分割し、色成分別のこの分割
されたブロック毎に順に直交変換を行ってからこの変換
出力を量子化手段により量子化し、その後、この量子化
出力を可変長符号化手段に与えて可変長符号化し、画像
データの符号化を行う際に、初めに暫定的に定めた量子
化幅で量子化して可変長符号化し、各ブロック毎の符号
量を得る統計処理を行い、次にこの統計処理により求め
た各ブロック毎の符号量と、画像あたりの総符号量目標
値とからこの総符号量目標値に収めるに適した最適量子
化幅と各ブロック毎の割当符号量とを決定し、この決定
した最適量子化幅に従って各ブロック毎の前記変換出力
の量子化を行うと共に、この量子化出力を各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら順次可変長符号化する符号化処理を実施する符号
化装置において、 前記統計処理時の可変長符号化出力をもとに各色成分別
前記各ブロックの符号量を算出する算出手段と、 前記最適量子化幅で量子化した際の各色成分別符号量を
予測し、この各予測色成分別符号量に基づいて前記総符
号量目標値を比例配分し、各色成分別符号量を決定する
と共に、これを前記算出手段の算出値に従って比例配分
し、各色成分別各ブロックの基準符号量を決定する決定
手段と、符号化処理時に前記決定手段にて決定した各色
成分別各ブロックの基準符号量を用い、前記ブロックの
うち、次に符号化処理する処理対象ブロックの前に処理
した処理済みブロックでの符号化により発生した符号量
と当該処理済みブロックでの割当符号量との差を求めて
これを前記処理対象ブロックの前記基準符号量に加える
ことにより得られる符号量を当該処理対象ブロックでの
割当符号量として割り当てる割当手段と、 前記処理対象ブロックでの符号化処理において前記割当
手段により割り当てられた前記割当符号量を越えないよ
うに、前記可変長符号化を打ち切る打ち切り手段と、 前記可変長符号化手段により可変長符号化された変換係
数を符号として出力する符号化出力手段と を備えたことを特徴とする画像データの符号化装置。
(2) Divide each of the color image data separated by color component into blocks of a predetermined number of pixels, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by quantization means. Then, this quantized output is given to a variable-length encoding means to be variable-length encoded, and when encoding image data, it is first quantized with a provisionally determined quantization width and then variable-length encoded. , performs statistical processing to obtain the code amount for each block, and then calculates the code amount for each block obtained through this statistical processing and the total code amount target value per image to find the appropriate amount to fit within this total code amount target value. The optimal quantization width and allocated code amount for each block are determined, and the transform output for each block is quantized according to the determined optimal quantization width, and the quantized output is allocated for each block. In an encoding device that performs a coding process of sequentially performing variable length coding while controlling the code amount for each block according to the code amount, each block is coded for each color component based on the variable length coding output during the statistical processing. a calculation means for calculating a code amount for each color component when quantized with the optimum quantization width, and proportionately allocating the total code amount target value based on the predicted code amount for each color component; a determining means for determining a code amount for each color component and proportionally distributing it according to the calculated value of the calculation means to determine a reference code amount for each block for each color component; Using the determined standard code amount for each block for each color component, calculate the code amount generated by encoding in the processed block processed before the next target block to be encoded among the blocks and the processed block. an allocation unit that allocates a code amount obtained by calculating the difference between the code amount and the code amount allocated to the block to be processed and adding it to the reference code amount of the block to be processed as the amount of code to be allocated to the block to be processed; terminating means for aborting the variable length encoding so as not to exceed the allocated code amount allocated by the allocating means in the encoding process; 1. An image data encoding device comprising: encoding output means for outputting as a code.
(3)色成分別に分離されたカラー画像データそれぞれ
を所定画素数のブロックに分割し、色成分別のこの分割
されたブロック毎に順に直交変換を行ってからこの変換
出力を量子化手段により量子化し、その後、この量子化
出力を可変長符号化手段に与えて可変長符号化し、画像
データの符号化を行う際に、初めに暫定的に定めた量子
化幅で量子化して可変長符号化し、各ブロック毎の符号
量を得る統計処理を行い、次にこの統計処理により求め
た各ブロック毎の符号量と、画像あたりの総符号量目標
値とからこの総符号量目標値に収めるに適した最適量子
化幅と各ブロック毎の割当符号量とを決定し、この決定
した最適量子化幅に従って各ブロック毎の前記変換出力
の量子化を行うと共に、この量子化出力を各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら順次可変長符号化する符号化処理を実施する符号
化装置において、 前記統計処理時の可変長符号化出力をもとに各色成分別
前記各ブロックの符号量を算出すると共に、各色成分別
の総符号量および画像全体の総符号量を算出する算出手
段と、 前記総符号量目標値と前記算出手段の算出値に基づいて
各色成分別の最適量子化幅を予測する量子化幅予測手段
と、 前記最適量子化幅で量子化した際の各色成分別符号量を
予測し、この各予測色成分別符号量に基づいて前記総符
号量目標値を比例配分し、各色成分別符号量を決定する
と共に、これを前記算出手段の算出した各色成分別各ブ
ロックの符号量に応じて配分することにより当該各色成
分別各ブロックの基準符号量を決定する決定手段と、 符号化処理時に前記決定手段にて決定した各色成分別各
ブロックの基準符号量を用い、前記ブロックのうち、次
に符号化処理する処理対象ブロックの前に処理した処理
済みブロックでの符号化により発生した符号量と当該処
理済みブロックでの割当符号量との差を求めてこれを前
記処理対象ブロックの前記基準符号量に加えることによ
り得られる符号量を当該処理対象ブロックでの割当符号
量として割り当てる割当手段と、 前記処理対象ブロックでの符号化処理において前記割当
手段により割り当てられた前記割当符号量を越えないよ
うに、前記可変長符号化を打ち切る打ち切り手段と を備えたことを特徴とする画像データの符号化装置。
(3) Divide each of the color image data separated by color component into blocks of a predetermined number of pixels, perform orthogonal transformation for each divided block by color component, and then quantize the transformed output by quantization means. Then, this quantized output is given to a variable-length encoding means to be variable-length encoded, and when encoding image data, it is first quantized with a provisionally determined quantization width and then variable-length encoded. , performs statistical processing to obtain the code amount for each block, and then calculates the code amount for each block obtained through this statistical processing and the total code amount target value per image to find the appropriate amount to fit within this total code amount target value. The optimal quantization width and allocated code amount for each block are determined, and the transform output for each block is quantized according to the determined optimal quantization width, and the quantized output is allocated for each block. In an encoding device that performs a coding process of sequentially performing variable length coding while controlling the code amount for each block according to the code amount, each block is coded for each color component based on the variable length coding output during the statistical processing. calculation means for calculating the total code amount for each color component and the total code amount for the entire image; quantization width prediction means for predicting a quantization width; and predicting a code amount for each color component when quantized with the optimum quantization width, and determining the total code amount target value based on the predicted code amount for each color component. is distributed proportionally, the code amount for each color component is determined, and the standard code amount for each block for each color component is determined by distributing this according to the code amount for each block for each color component calculated by the calculation means. and determining means for determining a processed block processed before a target block to be encoded next among the blocks, using a reference code amount for each block for each color component determined by the determining means during encoding processing. The code amount obtained by calculating the difference between the code amount generated by the encoding and the allocated code amount in the processed block and adding this to the reference code amount of the processing target block is calculated in the processing target block. an allocation means for allocating an allocated code amount as an allocated code amount, and an abort means for terminating the variable length encoding so as not to exceed the allocated code amount allocated by the allocation means in the encoding process of the processing target block. An image data encoding device characterized by:
(4)色成分別に分離されたカラー画像データそれぞれ
を所定画素数のブロックに分割し、色成分別のこの分割
されたブロック毎に順に直交変換を行ってからこの変換
出力を量子化手段により量子化し、その後、この量子化
出力を可変長符号化手段に与えて可変長符号化し、画像
データの符号化を行う際に、初めに暫定的に定めた量子
化幅で量子化して可変長符号化し、各ブロック毎の符号
量を得る統計処理を行い、次にこの統計処理により求め
た各ブロック毎の符号量と、画像あたりの総符号量目標
値とからこの総符号量目標値に収めるに適した最適量子
化幅と各ブロック毎の割当符号量とを決定し、この決定
した最適量子化幅に従って各ブロック毎の前記変換出力
の量子化を行うと共に、この量子化出力を各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら順次可変長符号化する符号化処理を実施する符号
化装置において、 前記統計処理時の可変長符号化出力をもとに各色成分別
前記各ブロックの符号量を算出する算出手段と、 前記最適量子化幅で量子化した際の各色成分別符号量を
予測し、この各予測色成分別符号量に基づいて前記総符
号量目標値を比例配分し、各色成分別符号量を決定する
と共に、これを前記算出手段の算出値に従って比例配分
し、各色成分別各ブロックの基準符号量を決定する決定
手段と、符号化処理時に前記決定手段にて決定した各色
成分別各ブロックの基準符号量を用い、前記ブロックの
うち、次に符号化処理する処理対象ブロックの前に処理
した処理済みブロックでの符号化により発生した符号量
と当該処理済みブロックでの割当符号量との差を求めて
これを前記処理対象ブロックの前記基準符号量に加える
ことにより得られる符号量を当該処理対象ブロックでの
割当符号量として割り当てる割当手段と、 前記処理対象ブロックでの符号化処理において前記割当
手段により割り当てられた前記割当符号量を越えないよ
うに、前記可変長符号化を打ち切る打ち切り手段と、 前記可変長符号化手段により可変長符号化された変換係
数を符号として出力する符号化出力手段と、 前記可変長符号化手段により可変長符号化された変換係
数を符号として出力する符号化出力手段と を備えたことを特徴とする画像データの符号化装置。
(4) Divide each of the color image data separated by color component into blocks of a predetermined number of pixels, sequentially perform orthogonal transformation for each divided block by color component, and then quantize the transformed output by quantization means. Then, this quantized output is given to a variable-length encoding means to be variable-length encoded, and when encoding image data, it is first quantized with a provisionally determined quantization width and then variable-length encoded. , performs statistical processing to obtain the code amount for each block, and then calculates the code amount for each block obtained through this statistical processing and the total code amount target value per image to find the appropriate amount to fit within this total code amount target value. The optimal quantization width and allocated code amount for each block are determined, and the transform output for each block is quantized according to the determined optimal quantization width, and the quantized output is allocated for each block. In an encoding device that performs a coding process of sequentially performing variable length coding while controlling the code amount for each block according to the code amount, each block is coded for each color component based on the variable length coding output during the statistical processing. a calculation means for calculating a code amount for each color component when quantized with the optimum quantization width, and proportionately allocating the total code amount target value based on the predicted code amount for each color component; a determining means for determining a code amount for each color component and proportionally distributing it according to the calculated value of the calculation means to determine a reference code amount for each block for each color component; Using the determined standard code amount for each block for each color component, calculate the code amount generated by encoding in the processed block processed before the next target block to be encoded among the blocks and the processed block. an allocation unit that allocates a code amount obtained by calculating the difference between the code amount and the code amount allocated to the block to be processed and adding it to the reference code amount of the block to be processed as the amount of code to be allocated to the block to be processed; terminating means for aborting the variable length encoding so as not to exceed the allocated code amount allocated by the allocating means in the encoding process; An image data encoding device comprising: encoding output means for outputting as a code; and encoding output means for outputting the transform coefficients variable-length encoded by the variable-length encoding means as a code.
(5)色成分別に分離されたカラー画像データそれぞれ
を所定画素数のブロックに分割し、色成分別のこの分割
されたブロック毎に順に直交変換を行ってからこの変換
出力を量子化手段により量子化し、その後、この量子化
出力を可変長符号化手段に与えて可変長符号化し、画像
データの符号化を行う際に、初めに暫定的に定めた量子
化幅で量子化して可変長符号化し、各ブロック毎の符号
量を得る統計処理を行い、次にこの統計処理により求め
た各ブロック毎の符号量と、画像あたりの総符号量目標
値とからこの総符号量目標値に収めるに適した最適量子
化幅と各ブロック毎の割当符号量とを決定し、この決定
した最適量子化幅に従って各ブロック毎の前記変換出力
の量子化を行うと共に、この量子化出力を各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら順次可変長符号化する符号化処理を実施する符号
化装置において、 目的とする圧縮率を選択すると共に、選択された圧縮率
に応じて収めるべき目的の総符号量および前記暫定的量
子化幅を決定する圧縮率選択手段と、 前記統計処理時の可変長符号化出力をもとに各色成分別
前記各ブロックの符号量を算出する算出手段と、 前記最適量子化幅で量子化した際の各色成分別符号量を
予測し、この各予測色成分別符号量に基づいて前記総符
号量目標値を比例配分し、各色成分別符号量を決定する
と共に、これを前記算出手段の算出値に従って比例配分
し、各色成分別各ブロックの基準符号量を決定する決定
手段と、符号化処理時に前記決定手段にて決定した各色
成分別各ブロックの基準符号量を用い、前記ブロックの
うち、次に符号化処理する処理対象ブロックの前に処理
した処理済みブロックでの符号化により発生した符号量
と当該処理済みブロックでの割当符号量との差を求めて
これを前記処理対象ブロックの前記基準符号量に加える
ことにより得られる符号量を当該処理対象ブロックでの
割当符号量として割り当てる割当手段と、 前記処理対象ブロックでの符号化処理において前記割当
手段により割り当てられた前記割当符号量を越えないよ
うに、前記可変長符号化を打ち切る打ち切り手段と を備えたことを特徴とする画像データの符号化装置。
(5) Divide each color image data separated by color component into blocks of a predetermined number of pixels, sequentially perform orthogonal transformation for each divided block by color component, and then quantize the transform output by quantization means. Then, this quantized output is given to a variable-length encoding means to be variable-length encoded, and when encoding image data, it is first quantized with a provisionally determined quantization width and then variable-length encoded. , performs statistical processing to obtain the code amount for each block, and then calculates the code amount for each block obtained through this statistical processing and the total code amount target value per image to find the appropriate amount to fit within this total code amount target value. The optimal quantization width and allocated code amount for each block are determined, and the transform output for each block is quantized according to the determined optimal quantization width, and the quantized output is allocated for each block. In an encoding device that performs sequential variable length coding while controlling the code amount for each block according to the code amount, the target compression rate is selected and the data should be stored according to the selected compression rate. Compression rate selection means for determining the target total code amount and the provisional quantization width; Calculation means for calculating the code amount for each block for each color component based on the variable length encoded output during the statistical processing; , predicting the code amount for each color component when quantized with the optimum quantization width, and proportionally distributing the total code amount target value based on the predicted code amount for each color component, and determining the code amount for each color component. and determining means for proportionally distributing this in accordance with the calculated value of the calculating means to determine a standard code amount for each block for each color component, and a standard for each block for each color component determined by the determining means during encoding processing. Using the code amount, calculate the difference between the code amount generated by encoding in the processed block processed before the next block to be encoded among the blocks and the allocated code amount in the processed block. an allocation means for allocating a code amount obtained by calculating the code amount and adding it to the reference code amount of the processing target block as an allocated code amount for the processing target block; and an allocation means in the encoding process for the processing target block. an aborting means for aborting the variable length encoding so as not to exceed the allocated code amount allocated by the image data encoding apparatus.
(6)色成分別に分離されたカラー画像データそれぞれ
を所定画素数のブロックに分割し、色成分別のこの分割
されたブロック毎に順に直交変換を行ってからこの変換
出力を量子化手段により量子化し、その後、この量子化
出力を可変長符号化手段に与えて可変長符号化し、画像
データの符号化を行う際に、初めに暫定的に定めた量子
化幅で量子化して可変長符号化し、各ブロック毎の符号
量を得る統計処理を行い、次にこの統計処理により求め
た各ブロック毎の符号量と、画像あたりの総符号量目標
値とからこの総符号量目標値に収めるに適した最適量子
化幅と各ブロック毎の割当符号量とを決定し、この決定
した最適量子化幅に従って各ブロック毎の前記変換出力
の量子化を行うと共に、この量子化出力を各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら順次可変長符号化する符号化処理を実施する符号
化装置において、 目的とする圧縮率を選択すると共に、選択された圧縮率
に応じて収めるべき目的の総符号量および前記暫定的量
子化幅を決定する圧縮率選択手段と、 前記統計処理時の可変長符号化出力をもとに各色成分別
前記各ブロックの符号量を算出する算出手段と、 前記最適量子化幅で量子化した際の各色成分別符号量を
予測し、この各予測色成分別符号量に基づいて前記総符
号量目標値を比例配分し、各色成分別符号量を決定する
と共に、これを前記算出手段の算出値に従って比例配分
し、各色成分別各ブロックの基準符号量を決定する決定
手段と、符号化処理時に前記決定手段にて決定した各色
成分別各ブロックの基準符号量を用い、前記ブロックの
うち、次に符号化処理する処理対象ブロックの前に処理
した処理済みブロックでの符号化により発生した符号量
と当該処理済みブロックでの割当符号量との差を求めて
これを前記処理対象ブロックの前記基準符号量に加える
ことにより得られる符号量を当該処理対象ブロックでの
割当符号量として割り当てる割当手段と、 前記処理対象ブロックでの符号化処理において前記割当
手段により割り当てられた前記割当符号量を越えないよ
うに、前記可変長符号化を打ち切る打ち切り手段と、 前記可変長符号化手段により可変長符号化された変換係
数を符号として出力する符号化出力手段と を備えたことを特徴とする画像データの符号化装置。
(6) Divide each of the color image data separated by color component into blocks of a predetermined number of pixels, perform orthogonal transformation for each divided block by color component, and then quantize the transformed output by quantization means. Then, this quantized output is given to a variable-length encoding means to be variable-length encoded, and when encoding image data, it is first quantized with a provisionally determined quantization width and then variable-length encoded. , performs statistical processing to obtain the code amount for each block, and then calculates the code amount for each block obtained through this statistical processing and the total code amount target value per image to find the appropriate amount to fit within this total code amount target value. The optimal quantization width and allocated code amount for each block are determined, and the transform output for each block is quantized according to the determined optimal quantization width, and the quantized output is allocated for each block. In an encoding device that performs sequential variable length coding while controlling the code amount for each block according to the code amount, the target compression rate is selected and the data should be stored according to the selected compression rate. Compression rate selection means for determining the target total code amount and the provisional quantization width; Calculation means for calculating the code amount for each block for each color component based on the variable length encoded output during the statistical processing; , predicting the code amount for each color component when quantized with the optimum quantization width, and proportionally distributing the total code amount target value based on the predicted code amount for each color component, and determining the code amount for each color component. and determining means for proportionally distributing this in accordance with the calculated value of the calculating means to determine a standard code amount for each block for each color component, and a standard for each block for each color component determined by the determining means during encoding processing. Using the code amount, calculate the difference between the code amount generated by encoding in the processed block processed before the next block to be encoded among the blocks and the allocated code amount in the processed block. an allocation means for allocating a code amount obtained by calculating the code amount and adding it to the reference code amount of the processing target block as an allocated code amount for the processing target block; and an allocation means in the encoding process for the processing target block. terminating means for terminating the variable length encoding so as not to exceed the allocated code amount allocated by the variable length encoding means; and encoding output means for outputting the transform coefficients variable length encoded by the variable length encoding means as codes. An image data encoding device comprising:
(7)色成分別に分離されたカラー画像データそれぞれ
を所定画素数のブロックに分割し、色成分別のこの分割
されたブロック毎に順に直交変換を行ってからこの変換
出力を量子化手段により量子化し、その後、この量子化
出力を可変長符号化手段に与えて可変長符号化し、画像
データの符号化を行う際に、初めに暫定的に定めた量子
化幅で量子化して可変長符号化し、各ブロック毎の符号
量を得る統計処理を行い、次にこの統計処理により求め
た各ブロック毎の符号量と、画像あたりの総符号量目標
値とからこの総符号量目標値に収めるに適した最適量子
化幅と各ブロック毎の割当符号量とを決定し、この決定
した最適量子化幅に従って各ブロック毎の前記変換出力
の量子化を行うと共に、この量子化出力を各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら順次可変長符号化する符号化処理を実施する符号
化装置において、 目的とする圧縮率を選択すると共に、選択された圧縮率
に応じて収めるべき目的の総符号量および前記暫定的量
子化幅を決定する圧縮率選択手段と、 前記統計処理時の可変長符号化出力をもとに各色成分別
前記各ブロックの符号量を算出すると共に、各色成分別
の総符号量および画像全体の総符号量を算出する算出手
段と、 前記総符号量目標値と前記算出手段の算出値に基づいて
各色成分別の最適量子化幅を予測する量子化幅予測手段
と、 前記最適量子化幅で量子化した際の各色成分別符号量を
予測し、この各予測色成分別符号量に基づいて前記総符
号量目標値を比例配分し、各色成分別符号量を決定する
と共に、これを前記算出手段の算出した各色成分別各ブ
ロックの符号量に応じて配分することにより当該各色成
分別各ブロックの基準符号量を決定する決定手段と、 符号化処理時に前記決定手段にて決定した各色成分別各
ブロックの基準符号量を用い、前記ブロックのうち、次
に符号化処理する処理対象ブロックの前に処理した処理
済みブロックでの符号化により発生した符号量と当該処
理済みブロックでの割当符号量との差を求めてこれを前
記処理対象ブロックの前記基準符号量に加えることによ
り得られる符号量を当該処理対象ブロックでの割当符号
量として割り当てる割当手段と、 前記処理対象ブロックでの符号化処理において前記割当
手段により割り当てられた前記割当符号量を越えないよ
うに、前記可変長符号化を打ち切る打ち切り手段と を備えたことを特徴とする画像データの符号化装置。
(7) Divide each of the color image data separated by color component into blocks of a predetermined number of pixels, sequentially perform orthogonal transformation for each divided block by color component, and then quantize the transformed output by quantization means. Then, this quantized output is given to a variable-length encoding means to be variable-length encoded, and when encoding image data, it is first quantized with a provisionally determined quantization width and then variable-length encoded. , performs statistical processing to obtain the code amount for each block, and then calculates the code amount for each block obtained through this statistical processing and the total code amount target value per image to find the appropriate amount to fit within this total code amount target value. The optimal quantization width and allocated code amount for each block are determined, and the transform output for each block is quantized according to the determined optimal quantization width, and the quantized output is allocated for each block. In an encoding device that performs sequential variable length coding while controlling the code amount for each block according to the code amount, the target compression rate is selected and the data should be stored according to the selected compression rate. compression rate selection means for determining the target total code amount and the provisional quantization width; a calculation means for calculating the total code amount for each component and the total code amount for the entire image; and a quantization width for predicting the optimal quantization width for each color component based on the total code amount target value and the calculated value by the calculation means. a prediction means, predicting a code amount for each color component when quantized with the optimum quantization width, proportionately allocating the total code amount target value based on the predicted code amount for each color component, and calculating a code amount for each color component; determining means for determining a reference code amount for each block for each color component by determining the amount and allocating this according to the code amount for each block for each color component calculated by the calculation means; Using the standard code amount of each block for each color component determined by the determining means, the amount of code generated by encoding in the processed block processed before the target block to be encoded next among the blocks. and allocation means for allocating the code amount obtained by calculating the difference between the code amount and the allocated code amount for the processed block and adding this to the reference code amount for the processing target block as the allocated code amount for the processing target block; , a terminating means for terminating the variable length encoding so as not to exceed the allocated code amount allocated by the allocating means in the encoding process for the processing target block. conversion device.
(8)色成分別に分離されたカラー画像データそれぞれ
を所定画素数のブロックに分割し、色成分別のこの分割
されたブロック毎に順に直交変換を行ってからこの変換
出力を量子化手段により量子化し、その後、この量子化
出力を可変長符号化手段に与えて可変長符号化し、画像
データの符号化を行う際に、初めに暫定的に定めた量子
化幅で量子化して可変長符号化し、各ブロック毎の符号
量を得る統計処理を行い、次にこの統計処理により求め
た各ブロック毎の符号量と、画像あたりの総符号量目標
値とからこの総符号量目標値に収めるに適した最適量子
化幅と各ブロック毎の割当符号量とを決定し、この決定
した最適量子化幅に従って各ブロック毎の前記変換出力
の量子化を行うと共に、この量子化出力を各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら順次可変長符号化する符号化処理を実施する符号
化装置において、 目的とする圧縮率を選択すると共に、選択された圧縮率
に応じて収めるべき目的の総符号量および前記暫定的量
子化幅を決定する圧縮率選択手段と、 前記統計処理時の可変長符号化出力をもとに各色成分別
前記各ブロックの符号量を算出する算出手段と、 前記最適量子化幅で量子化した際の各色成分別符号量を
予測し、この各予測色成分別符号量に基づいて前記総符
号量目標値を比例配分し、各色成分別符号量を決定する
と共に、これを前記算出手段の算出値に従って比例配分
し、各色成分別各ブロックの基準符号量を決定する決定
手段と、符号化処理時に前記決定手段にて決定した各色
成分別各ブロックの基準符号量を用い、前記ブロックの
うち、次に符号化処理する処理対象ブロックの前に処理
した処理済みブロックでの符号化により発生した符号量
と当該処理済みブロックでの割当符号量との差を求めて
これを前記処理対象ブロックの前記基準符号量に加える
ことにより得られる符号量を当該処理対象ブロックでの
割当符号量として割り当てる割当手段と、 前記処理対象ブロックでの符号化処理において前記割当
手段により割り当てられた前記割当符号量を越えないよ
うに、前記可変長符号化を打ち切る打ち切り手段と、 前記可変長符号化手段により可変長符号化された変換係
数を符号として出力する符号化出力手段と、 を備えたことを特徴とする画像データの符号化装置。
(8) Divide each of the color image data separated by color component into blocks of a predetermined number of pixels, perform orthogonal transformation for each divided block by color component, and then quantize the transform output by quantization means. Then, this quantized output is given to a variable-length encoding means to be variable-length encoded, and when encoding image data, it is first quantized with a provisionally determined quantization width and then variable-length encoded. , performs statistical processing to obtain the code amount for each block, and then calculates the code amount for each block obtained through this statistical processing and the total code amount target value per image to find the appropriate amount to fit within this total code amount target value. The optimal quantization width and allocated code amount for each block are determined, and the transform output for each block is quantized according to the determined optimal quantization width, and the quantized output is allocated for each block. In an encoding device that performs sequential variable length coding while controlling the code amount for each block according to the code amount, the target compression rate is selected and the data should be stored according to the selected compression rate. Compression rate selection means for determining the target total code amount and the provisional quantization width; Calculation means for calculating the code amount for each block for each color component based on the variable length encoded output during the statistical processing; , predicting the code amount for each color component when quantized with the optimum quantization width, and proportionally distributing the total code amount target value based on the predicted code amount for each color component, and determining the code amount for each color component. and determining means for proportionally distributing this in accordance with the calculated value of the calculating means to determine a standard code amount for each block for each color component, and a standard for each block for each color component determined by the determining means during encoding processing. Using the code amount, calculate the difference between the code amount generated by encoding in the processed block processed before the next block to be encoded among the blocks and the allocated code amount in the processed block. an allocation means for allocating a code amount obtained by calculating the code amount and adding it to the reference code amount of the processing target block as an allocated code amount for the processing target block; and an allocation means in the encoding process for the processing target block. terminating means for terminating the variable length encoding so as not to exceed the allocated code amount allocated by the variable length encoding means; and encoding output means for outputting the transform coefficients variable length encoded by the variable length encoding means as codes. An image data encoding device comprising: .
(9)前記量子化手段には前記符号化処理時での量子化
は、前記直交変換により得られる周波数成分別のデータ
のうち、低周波数成分のデータより実施させると共に、
前記可変長符号化手段には前記直交変換により周波数成
分別に得られる前記各ブロック単位の画像データの周波
数成分別データのうち、直流成分については前の処理ブ
ロックでの直流成分との差分を得ると共に、この差分を
可変長符号化する直流成分用の符号化処理部と、この直
流成分について符号化処理部の処理が終った後、前記交
流成分について可変長符号化する交流成分用の符号化処
理部とを設け、前記符号化打ち切り手段は交流成分用の
符号化処理部にのみ設けて構成することを特徴とする請
求項(1)乃至(8)記載の画像データの符号化装置。
(9) The quantization means performs quantization during the encoding process from data of low frequency components among the frequency component data obtained by the orthogonal transformation, and
The variable-length encoding means obtains the difference between the DC component and the DC component in the previous processing block among the frequency component data of the image data for each block obtained by the orthogonal transformation for each frequency component. , a DC component encoding processing unit that variable-length encodes this difference, and an AC component encoding processing unit that performs variable-length encoding on the AC component after the encoding processing unit finishes processing the DC component. 9. The image data encoding apparatus according to claim 1, wherein the encoding aborting means is provided only in the AC component encoding processing section.
(10)色成分別に分離されたカラー画像データをそれ
ぞれ所定画素数のブロックに分割し、この分割されたブ
ロック毎に順に直交変換を行ってからこの変換出力を量
子化手段により量子化し、その後、この量子化出力を可
変長符号化手段に与えて可変長符号化し、データの符号
化を行う際に、予め求めた収めるべき総符号量目標値お
よび各ブロック毎の統計量とから決定した各ブロック毎
の割当符号量に従って各ブロック毎に符号量制御を行い
ながら可変長符号化を行うにあたり、 前記量子化を暫定的な量子化幅を使用して行い、これに
より得た量子化出力について符号化処理を行い、最適化
するに必要な画像全体の符号量および各ブロック毎の符
号量を調べる第1のステップと、 この第1のステップで得た画像全体の符号量から最適化
に必要な量子化幅の予測を行う第2のステップと、 前記予測した最適量子化幅で量子化した際の各色成分別
符号量を予測し、この各予測色成分別符号量に基づいて
前記総符号量目標値を比例配分し、各色成分別符号量を
決定すると共に、これを前記各ブロックの符号量に基づ
いて比例配分し、各ブロック毎の基準割当符号量を求め
る第3のステップと、 前記予測した量子化幅を用いて前記各ブロック毎の前記
量子化を行う第4のステップと、 この第4のステップでの前記各ブロック毎の量子化出力
をそのブロックに対する割当符号量に収まる範囲で可変
長符号化する第5のステップと、前記第5のステップに
おける現在可変長符号化処理しようとするブロックの、
直前に処理したブロックでの可変長符号化による符号量
とこのブロックでの割当符号量との差を求め、これを繰
り越し量として前記現在処理しようとするブロックでの
前記基準割当符号量に加算し、前記現在処理しようとす
るブロックでの割当符号量とする第6のステップとを含
んでなる画像データの符号化方法。
(10) Divide the color image data separated by color component into blocks each having a predetermined number of pixels, sequentially perform orthogonal transformation for each divided block, and then quantize the transformation output by a quantization means, and then, This quantized output is given to variable length encoding means to be variable length encoded, and each block is determined based on the total code amount target value to be stored and the statistics for each block. When performing variable length encoding while controlling the code amount for each block according to the allocated code amount for each block, the quantization is performed using a provisional quantization width, and the quantized output obtained thereby is encoded. The first step is to check the amount of code for the entire image and the amount of code for each block required for processing and optimization, and calculate the amount of code required for optimization from the amount of code for the entire image obtained in this first step. a second step of predicting the quantization width; and predicting the code amount for each color component when quantized with the predicted optimal quantization width, and determining the total code amount target based on the predicted code amount for each color component. a third step of proportionally allocating the values and determining the amount of code for each color component, and allocating this proportionally based on the amount of code of each block to obtain a standard allocated amount of code for each block; a fourth step of performing the quantization for each block using the quantization width; and quantizing the quantization output for each block in this fourth step to a variable length within the allocated code amount for the block. a fifth step of encoding, and a block to be currently subjected to variable length encoding processing in the fifth step;
The difference between the code amount by variable length coding in the block processed immediately before and the allocated code amount in this block is calculated, and this is added as a carryover amount to the standard allocated code amount in the block to be currently processed. and a sixth step of setting the amount of code to be allocated to the block to be currently processed.
(11)色成分別に分離されたカラー画像データをそれ
ぞれ所定画素数のブロックに分割し、この分割されたブ
ロック毎に順に直交変換を行ってからこの変換出力を量
子化手段により量子化し、その後、この量子化出力を可
変長符号化手段に与えて可変長符号化し、データの符号
化を行う際に、予め求めた収めるべき総符号量目標値お
よび各ブロック毎の統計量から決定した各ブロック毎の
割当符号量に従って各ブロック毎に符号量制御を行いな
がら可変長符号化を行うにあたり、 前記量子化を暫定的な量子化幅を使用して行い、これに
より得た量子化出力について符号化処理を行い、最適化
するに必要な画像全体の符号量および各色成分別符号量
および各色成分別各ブロック毎の符号量を調べる第1の
ステップと、 この第1のステップで得た画像全体の符号量と各色成分
別符号量から最適化に必要な量子化幅の予測を各色成分
別に行う第2のステップと、前記予測した最適量子化幅
で量子化した際の各色成分別符号量を予測し、この各予
測色成分別符号量に基づいて前記総符号量目標値を比例
配分し、各色成分別符号量を決定すると共に、これを前
記各ブロックの符号量に基づいて比例配分し、各色成分
別各ブロック毎の基準割当符号量を求める第3のステッ
プと、 前記予測した前記各色成分別の量子化幅を用いて前記各
色成分別各ブロック毎の前記量子化を行う第4のステッ
プと、 この第4のステップでの前記各色成分別各ブロック毎の
量子化出力をそのブロックに対する割当符号量に収まる
範囲で可変長符号化する第5のステップと、 前記第5のステップにおける現在可変長符号化処理しよ
うとするブロックの、直前に処理したブロックでの可変
長符号化による符号量とこのブロックでの割当符号量と
の差を求め、これを繰り越し量として前記現在処理しよ
うとするブロックでの前記基準割当符号量に加算し、前
記現在処理しようとするブロックでの割当符号量とする
第6のステップとを含んでなる画像データの符号化方法
(11) Divide the color image data separated by color component into blocks each having a predetermined number of pixels, sequentially perform orthogonal transformation for each divided block, and then quantize the transform output by a quantization means, and then, This quantized output is given to variable length encoding means to be variable length encoded, and when encoding data, each block is determined from the total code amount target value determined in advance and the statistics for each block. When performing variable length encoding while controlling the code amount for each block according to the allocated code amount, the quantization is performed using a provisional quantization width, and the resulting quantized output is encoded. The first step is to check the amount of code for the entire image, the amount of code for each color component, and the amount of code for each block for each color component necessary for optimization, and the code for the entire image obtained in this first step. The second step is to predict the quantization width required for optimization for each color component from the amount of code and the amount of code for each color component, and to predict the amount of code for each color component when quantized with the predicted optimal quantization width. , the total code amount target value is proportionally distributed based on the predicted code amount for each color component, the code amount for each color component is determined, and this is proportionally allocated based on the code amount for each block, and each color component is a third step of determining a standard allocated code amount for each block; and a fourth step of performing the quantization for each block for each color component using the predicted quantization width for each color component. a fifth step of variable-length encoding the quantized output for each block for each color component in the fourth step within a range that falls within the allocated code amount for the block; and a current variable-length code in the fifth step. Find the difference between the code amount due to variable length coding in the block processed immediately before the block to be processed and the allocated code amount in this block, and use this as the carryover amount for the block to be processed currently. a sixth step of adding the standard allocated code amount to the allocated code amount for the block to be currently processed.
(12)色成分別に分離されたカラー画像データをそれ
ぞれ所定画素数のブロックに分割し、この分割されたブ
ロック毎に順に直交変換を行って直流成分と交流成分と
に分け、この直交変換出力を量子化手段により量子化し
、その後、この量子化出力を可変長符号化手段に与えて
可変長符号化し、データの符号化を行う際に、予め求め
た収めるべき総符号量目標値および各ブロック毎の統計
量から決定した各ブロック毎の割当符号量に従って各ブ
ロック毎に符号量制御を行いながら可変長符号化を行う
にあたり、 前記量子化を暫定的な量子化幅を使用して行い、これに
より得た量子化出力について符号化処理を行い、最適化
するに必要な画像全体の符号量および各ブロック毎の符
号量を調べる第1のステップと、 この第1のステップで得た画像全体の符号量から最適化
に必要な量子化幅の予測を行う第2のステップと、 前記予測した最適量子化幅で量子化した際の各色成分別
符号量を予測し、この各予測色成分別符号量に基づいて
前記総符号量目標値を比例配分し、各色成分別符号量を
決定すると共に、これを前記各ブロックの符号量に基づ
いて比例配分し、各ブロック毎の基準割当符号量を求め
る第3のステップと、 前記予測した量子化幅を用いて前記各ブロック毎の前記
量子化を行う第4のステップと、 この第4のステップでの前記各ブロック毎の量子化出力
をそのブロックに対する割当符号量に収まる範囲で可変
長符号化するものであって、前記直交変換により得られ
る前記各ブロック単位の画像データのうち、直流成分に
ついては前の処理ブロックでの直流成分との差分を得て
、この差分を可変長符号化し、この直流成分について符
号化処理が終わった後、前記交流成分について可変長符
号化処理する第5のステップと、 前記第5のステップにおける現在可変長符号化処理しよ
うとするブロックの、直前に処理したブロックでの可変
長符号化による符号量とこのブロックでの割当符号量と
の差を求め、これを繰り越し量として前記現在処理しよ
うとするブロックでの前記基準割当符号量に加算し、前
記現在処理しようとするブロックでの割当符号量とする
第6のステップとを含んでなる画像データの符号化方法
(12) Divide the color image data separated by color component into blocks each having a predetermined number of pixels, perform orthogonal transformation on each divided block in order to separate it into a DC component and an AC component, and use the orthogonal transformation output as Quantization is performed by the quantization means, and then this quantized output is given to the variable length encoding means for variable length encoding. When encoding data, the total code amount target value determined in advance and for each block are When performing variable length encoding while controlling the code amount for each block according to the allocated code amount for each block determined from the statistics of , the quantization is performed using a provisional quantization width, thereby The first step is to perform encoding processing on the obtained quantized output and check the amount of code for the entire image and the amount of code for each block required for optimization, and the code for the entire image obtained in this first step. a second step of predicting the quantization width necessary for optimization from the amount; and predicting the amount of code for each color component when quantized with the predicted optimal quantization width, and calculating the amount of code for each predicted color component. Proportional allocation of the total code amount target value based on the code amount to determine the code amount for each color component, and proportional allocation based on the code amount of each block to determine the standard allocated code amount for each block. a fourth step of performing the quantization for each block using the predicted quantization width; and assigning the quantization output for each block in this fourth step to that block. Variable-length coding is performed within the code amount, and among the image data for each block obtained by the orthogonal transformation, for the DC component, the difference with the DC component in the previous processing block is obtained. , a fifth step in which this difference is variable-length coded, and after the coding process is completed for the DC component, the AC component is variable-length coded; and the current variable-length coding process in the fifth step is performed. Find the difference between the code amount by variable-length encoding in the block processed immediately before and the allocated code amount in this block, and use this as the carryover amount to calculate the reference allocation in the block to be currently processed. and a sixth step of adding the code amount to the code amount to be allocated to the block to be currently processed.
(13)色成分別に分離されたカラー画像データをそれ
ぞれ所定画素数のブロックに分割し、この分割されたブ
ロック毎に順に直交変換を行ってからこの変換出力を量
子化手段により量子化し、その後、この量子化出力を可
変長符号化手段に与えて可変長符号化し、データの符号
化を行う際に、予め求めた収めるべき総符号量目標値お
よび各ブロック毎の統計量から決定した各ブロック毎の
割当符号量に従って各ブロック毎に符号量制御を行いな
がら可変長符号化を行うにあたり、 前記量子化を暫定的な量子化幅を使用して行い、これに
より得た量子化出力について符号化処理を行い、最適化
するに必要な画像全体の符号量および各色成分別符号量
および各色成分別各ブロック毎の符号量を調べる第1の
ステップと、 この第1のステップで得た画像全体の符号量と各色成分
別符号量から最適化に必要な量子化幅の予測を各色成分
別に行う第2のステップと、前記予測した最適量子化幅
で量子化した際の各色成分別符号量を予測し、この各予
測色成分別符号量に基づいて前記総符号量目標値を比例
配分し、各色成分別符号量を決定すると共に、これを前
記各色成分別各ブロックの符号量に基づいて比例配分し
、各色成分別各ブロック毎の基準割当符号量を求める第
3のステップと、 前記予測した前記各色成分別の量子化幅を用いて前記各
色成分別各ブロック毎の前記量子化を行う第4のステッ
プと、 この第4のステップでの前記各ブロック毎の量子化出力
をそのブロックに対する割当符号量に収まる範囲で可変
長符号化するものであって、前記直交変換により得られ
る前記各ブロック単位の画像データのうち、直流成分に
ついては前の処理ブロックでの直流成分との差分を得て
、この差分を可変長符号化し、この直流成分について符
号化処理が終わった後、前記交流成分について可変長符
号化処理する第5のステップと、 前記第5のステップにおける現在可変長符号化処理しよ
うとするブロックの、直前に処理したブロックでの可変
長符号化による符号量とこのブロックでの割当符号量と
の差を求め、これを繰り越し量として前記現在処理しよ
うとするブロックでの前記基準割当符号量に加算し、前
記現在処理しようとするブロックでの割当符号量とする
第6のステップとを含んでなる画像データの符号化方法
(13) Divide the color image data separated by color component into blocks each having a predetermined number of pixels, sequentially perform orthogonal transformation for each divided block, and then quantize the transformation output by a quantization means, and then, This quantized output is given to variable length encoding means to be variable length encoded, and when encoding data, each block is determined from the total code amount target value determined in advance and the statistics for each block. When performing variable length encoding while controlling the code amount for each block according to the allocated code amount, the quantization is performed using a provisional quantization width, and the resulting quantized output is encoded. The first step is to check the amount of code for the entire image, the amount of code for each color component, and the amount of code for each block for each color component necessary for optimization, and the code for the entire image obtained in this first step. The second step is to predict the quantization width required for optimization for each color component from the amount of code and the amount of code for each color component, and to predict the amount of code for each color component when quantized with the predicted optimal quantization width. , the total code amount target value is distributed proportionally based on the predicted code amount for each color component, the code amount for each color component is determined, and this is proportionally allocated based on the code amount for each block for each color component. , a third step of determining a standard allocated code amount for each block for each color component, and a fourth step for performing the quantization for each block for each color component using the predicted quantization width for each color component. step, the quantized output for each block in this fourth step is variable-length encoded within the allocated code amount for that block, and the quantization output for each block obtained by the orthogonal transformation is For the DC component of the image data, the difference between the DC component and the DC component in the previous processing block is obtained, this difference is variable-length encoded, and after the encoding process is completed for the DC component, the AC component is variable-length coded. a fifth step of performing encoding processing; and the amount of code obtained by variable length encoding in the block processed immediately before the block to be currently subjected to variable length encoding processing in the fifth step, and the amount of allocated code for this block. and a sixth step of calculating the difference between the two and adding this as a carryover amount to the reference allocated code amount for the block to be currently processed, and setting it as the allocated code amount for the block to be currently processed. An image data encoding method.
(14)色成分別に分離されたカラー画像データをそれ
ぞれ所定画素数のブロックに分割し、この分割されたブ
ロック毎に順に直交変換を行って周波数成分別のデータ
に変換すると共に、この直交変換により得られる周波数
成分別のデータを量子化手段により低周波数成分より順
次量子化し、その後、この量子化出力を可変長符号化手
段に与えて可変長符号化し、データの符号化を行う際に
、予め求めた収めるべき総符号量目標値および各ブロッ
ク毎の統計量から決定した各ブロック毎の割当符号量に
従って各ブロック毎に符号量制御を行いながら可変長符
号化を行うにあたり、 前記量子化を暫定的な量子化幅を使用して行い、これに
より得た量子化出力について符号化処理を行い、最適化
するに必要な画像全体の符号量および各ブロック毎の符
号量を調べる第1のステップと、 この第1のステップで得た画像全体の符号量から最適化
に必要な量子化幅の予測を行う第2のステップと、 前記予測した最適量子化幅で量子化した際の各色成分別
符号量を予測し、この各予測色成分別符号量に基づいて
前記総符号量目標値を比例配分し、各色成分別符号量を
決定すると共に、これを前記各ブロックの符号量に基づ
いて比例配分し、各ブロック毎の基準割当符号量を求め
る第3のステップと、 前記予測した量子化幅を用いて前記各ブロック毎の前記
量子化を行う第4のステップと、 この第4のステップでの前記各ブロック毎の量子化出力
をそのブロックに対する割当符号量に収まる範囲で可変
長符号化するものであって、前記直交変換により得られ
る前記各ブロック単位の画像データのうち、直流成分に
ついては前の処理ブロックでの直流成分との差分を得て
、この差分を可変長符号化し、この直流成分について符
号化処理が終わった後、前記交流成分について可変長符
号化処理する第5のステップと、 前記第5のステップにおける現在可変長符号化処理しよ
うとするブロックの、直前に処理したブロックでの可変
長符号化による符号量とこのブロックでの割当符号量と
の差を求め、これを繰り越し量として前記現在処理しよ
うとするブロックでの前記基準割当符号量に加算し、前
記現在処理しようとするブロックでの割当符号量とする
第6のステップとを含み、 前記第5のステップにおける前記割当符号量に収まる範
囲での可変長符号化処理は前記交流成分についてのみ適
用することを特徴とする画像データの符号化方法。
(14) Divide the color image data separated by color component into blocks each having a predetermined number of pixels, perform orthogonal transformation on each divided block in order to convert it into data by frequency component, and use this orthogonal transformation to The obtained data for each frequency component is quantized sequentially from the low frequency component by the quantization means, and then this quantized output is given to the variable length encoding means to be variable length encoded. When performing variable length encoding while controlling the code amount for each block according to the total code amount target value to be stored and the allocated code amount for each block determined from the statistics for each block, the above quantization is temporarily performed. The first step is to perform encoding processing on the quantized output obtained by this method, and to check the amount of code for the entire image and the amount of code for each block required for optimization. , a second step of predicting the quantization width necessary for optimization from the code amount of the entire image obtained in the first step; and a code for each color component when quantized with the predicted optimal quantization width. The total code amount target value is allocated proportionally based on the predicted code amount for each color component, the code amount for each color component is determined, and this is allocated proportionally based on the code amount for each block. a third step of calculating a reference allocated code amount for each block; a fourth step of performing the quantization for each block using the predicted quantization width; The quantized output for each block is variable-length encoded within the allocated code amount for that block, and among the image data for each block obtained by the orthogonal transformation, the DC component is A fifth step of obtaining a difference between the DC component and the DC component in the processing block, variable-length encoding the difference, and after completing the encoding process for the DC component, performing variable-length encoding process for the AC component; In the fifth step, the difference between the code amount due to variable length coding of the block processed immediately before the block to be subjected to variable length coding processing and the allocated code amount for this block is calculated, and this is carried over as the amount of code. and a sixth step of adding the standard allocated code amount in the block to be currently processed as the allocated code amount in the block to be currently processed as the allocated code amount in the fifth step. A method for encoding image data, characterized in that variable length encoding processing is applied only to the alternating current component within a range within a certain amount.
(15)色成分別に分離されたカラー画像データをそれ
ぞれ所定画素数のブロックに分割し、この分割されたブ
ロック毎に順に直交変換を行って周波数成分別のデータ
に変換すると共に、この直交変換により得られる周波数
成分別のデータを量子化手段により低周波数成分より順
次量子化し、その後、この量子化出力を可変長符号化手
段に与えて可変長符号化し、データの符号化を行う際に
、予め求めた収めるべき総符号量目標値および各ブロッ
ク毎の統計量から決定した各ブロック毎の割当符号量に
従って各ブロック毎に符号量制御を行いながら可変長符
号化を行うにあたり、 前記量子化を暫定的な量子化幅を使用して行い、これに
より得た量子化出力について符号化処理を行い、最適化
するに必要な画像全体の符号量および各色成分別符号量
および各色成分別各ブロック毎の符号量を調べる第1の
ステップと、 この第1のステップで得た画像全体の符号量と各色成分
別符号量から最適化に必要な量子化幅の予測を各色成分
別に行う第2のステップと、前記予測した最適量子化幅
で量子化した際の各色成分別符号量を予測し、この各予
測色成分別符号量に基づいて前記総符号量目標値を比例
配分し、各色成分別符号量を決定すると共に、これを前
記各色成分別各ブロックの符号量に基づいて比例配分し
、各色成分別各ブロック毎の基準割当符号量を求める第
3のステップと、 前記予測した前記各色成分別の量子化幅を用いて前記各
色成分別各ブロック毎の前記量子化を行う第4のステッ
プと、 この第4のステップでの前記各ブロック毎の量子化出力
をそのブロックに対する割当符号量に収まる範囲で可変
長符号化するものであって、前記直交変換により得られ
る前記各ブロック単位の画像データのうち、直流成分に
ついては前の処理ブロックでの直流成分との差分を得て
、この差分を可変長符号化し、この直流成分について符
号化処理が終わった後、前記交流成分について可変長符
号化処理する第5のステップと、 前記第5のステップにおける現在可変長符号化処理しよ
うとするブロックの、直前に処理したブロックでの可変
長符号化による符号量とこのブロックでの割当符号量と
の差を求め、これを繰り越し量として前記現在処理しよ
うとするブロックでの前記基準割当符号量に加算し、前
記現在処理しようとするブロックでの割当符号量とする
第6のステップとを含み、 前記第5のステップにおける前記割当符号量に収まる範
囲での可変長符号化処理は前記交流成分についてのみ適
用することを特徴とする画像データの符号化方法。
(15) Divide the color image data separated by color component into blocks each having a predetermined number of pixels, perform orthogonal transformation on each divided block in order to convert it into data by frequency component, and use this orthogonal transformation to The obtained data for each frequency component is quantized sequentially from the low frequency component by the quantization means, and then this quantized output is given to the variable length encoding means to be variable length encoded. When performing variable length encoding while controlling the code amount for each block according to the total code amount target value to be stored and the allocated code amount for each block determined from the statistics for each block, the above quantization is temporarily performed. The resulting quantization output is encoded, and the code amount for the entire image necessary for optimization, the code amount for each color component, and the code amount for each block for each color component are A first step of examining the amount of code, and a second step of predicting the quantization width required for optimization for each color component from the amount of code for the entire image obtained in the first step and the amount of code for each color component. , predict the code amount for each color component when quantized with the predicted optimal quantization width, and proportionally distribute the total code amount target value based on the predicted code amount for each color component, and calculate the code amount for each color component. a third step of determining a standard allocated code amount for each block for each color component by allocating it proportionally based on the code amount for each block for each color component; a fourth step of performing the quantization for each block for each color component using the quantization width; and a range in which the quantization output for each block in this fourth step falls within the allocated code amount for the block. Among the image data for each block obtained by the orthogonal transformation, the difference between the DC component and the DC component in the previous processing block is obtained, and this difference is variable-length coded. After the DC component is long encoded and the encoding process is completed, the alternating current component is subjected to variable length encoding. The difference between the code amount by variable length coding in the block processed immediately before and the allocated code amount in this block is calculated, and this is added as a carryover amount to the standard allocated code amount in the block to be currently processed. , a sixth step in which the code amount is allocated to the block to be currently processed, and variable length encoding processing within the range of the allocated code amount in the fifth step is applied only to the alternating current component. An image data encoding method characterized by:
(16)前記暫定的な量子化幅は、画面あたりの総符号
量に応じて予め定めた値を用いることを特徴とする請求
項(10)乃至(15)記載の画像データの符号化方法
(16) The image data encoding method according to any one of claims (10) to (15), wherein the provisional quantization width uses a predetermined value depending on the total amount of code per screen.
(17)前記暫定的な量子化幅は、選択設定した画面あ
たりの総符号量に応じて予め定めた値を用いることを特
徴とする請求項(10)乃至(15)記載の画像データ
の符号化方法。
(17) The code of image data according to any one of claims (10) to (15), characterized in that the provisional quantization width uses a predetermined value according to the selected total code amount per screen. method.
JP2325688A 1990-11-29 1990-11-29 Encoding device and encoding method for image data Pending JPH04207352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2325688A JPH04207352A (en) 1990-11-29 1990-11-29 Encoding device and encoding method for image data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2325688A JPH04207352A (en) 1990-11-29 1990-11-29 Encoding device and encoding method for image data

Publications (1)

Publication Number Publication Date
JPH04207352A true JPH04207352A (en) 1992-07-29

Family

ID=18179608

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2325688A Pending JPH04207352A (en) 1990-11-29 1990-11-29 Encoding device and encoding method for image data

Country Status (1)

Country Link
JP (1) JPH04207352A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0694901A2 (en) 1994-07-25 1996-01-31 Yamaha Corporation Keyboard musical instrument having hammer stopper exactly position at blocking position
US5543844A (en) * 1992-11-25 1996-08-06 Matsushita Electric Industrial Co., Ltd. Method and apparatus for coding image data
US9456991B2 (en) 2011-12-22 2016-10-04 Erik Baes Gelatin/alginate delayed release capsules comprising omega-3 fatty acids, and methods and uses thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5543844A (en) * 1992-11-25 1996-08-06 Matsushita Electric Industrial Co., Ltd. Method and apparatus for coding image data
EP0694901A2 (en) 1994-07-25 1996-01-31 Yamaha Corporation Keyboard musical instrument having hammer stopper exactly position at blocking position
US9456991B2 (en) 2011-12-22 2016-10-04 Erik Baes Gelatin/alginate delayed release capsules comprising omega-3 fatty acids, and methods and uses thereof

Similar Documents

Publication Publication Date Title
JP3012698B2 (en) Image data encoding apparatus and encoding method
JP3085465B2 (en) Image data encoding apparatus and encoding method
US5291282A (en) Image data coding apparatus and method capable of controlling amount of codes
US5517583A (en) Image encoding method and apparatus
US8615140B2 (en) Compression of image data in accordance with depth information of pixels
US8009924B2 (en) Method and apparatus for recording image data
JPH05145773A (en) Device and method of encoding video picture
JPH10271530A (en) Image data compression coder, method therefor and digital camera
US20080298702A1 (en) Fixed rate JPEG encoding
US20050053299A1 (en) Encoding of digital data combining a plurality of encoding modes
US8259811B2 (en) Method for determining a number of items of encoded data that can be stored in a memory, and method for controlling sizes of items of encoded image data to be stored in a memory
JP2959831B2 (en) Image data encoding device
JPH04207352A (en) Encoding device and encoding method for image data
JP2013162340A (en) Image processing apparatus and electronic apparatus using the same
JP3222780B2 (en) Image compression device
JP2004040300A (en) Image processing apparatus
JP2004214985A (en) Image processor and image reproducing device
JP2002252759A (en) Image quantization method and device, and image coder utilizing them
JP3192133B2 (en) Electronic camera device
JPH02248180A (en) Picture information coding device
JP3038022B2 (en) Electronic camera device
JPH04179371A (en) Device and method for encoding picture data
JP3752931B2 (en) Digital camera and image data processing method
EP0926883B1 (en) Image processing method and apparatus
JPH04207266A (en) Encoder and encoding method for image data