JPH04220875A - Encoding device for picture data - Google Patents

Encoding device for picture data

Info

Publication number
JPH04220875A
JPH04220875A JP2404795A JP40479590A JPH04220875A JP H04220875 A JPH04220875 A JP H04220875A JP 2404795 A JP2404795 A JP 2404795A JP 40479590 A JP40479590 A JP 40479590A JP H04220875 A JPH04220875 A JP H04220875A
Authority
JP
Japan
Prior art keywords
code
circuit
code amount
block
amount
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.)
Withdrawn
Application number
JP2404795A
Other languages
Japanese (ja)
Inventor
Hidetoshi Yamada
秀俊 山田
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 JP2404795A priority Critical patent/JPH04220875A/en
Publication of JPH04220875A publication Critical patent/JPH04220875A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To encode a data so as to be within a prescribed code quantity in a shorter processing time with a simple circuit by decreasing a loss of picture quality as small as possible. CONSTITUTION:A total code quantity from a code quantity calculation circuit 32 and a setting code quantity are compared and when the total code quantity is larger than the setting code quantity, a code allocation circuit 38 uses a code generated in each block to decide the allocated code quantity for each block and a code limit circuit 34 is featured to limit a variable length code so that the encoded data stored in advance in a memory 12 does not exceed the allocated code quantity.

Description

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

【0001】0001

【産業上の利用分野】本発明は、画像デ−タを所定の容
量に高圧縮符号化するための符号化装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a coding apparatus for highly compressing and coding image data to a predetermined capacity.

【0002】0002

【従来の技術】画像信号をメモリカ−ド、磁気ディスク
あるいは磁気テ−プなどの記憶装置にデジタルデ−タと
して記憶する場合、そのデ−タ量は膨大なものとなるた
め、多くのフレ−ム画像を限られた記憶容量の範囲で記
録しようとするには、得られた画像信号のデ−タに対し
、何等かの高能率な圧縮を行うことが必要となる。さら
に、デジタル電子スチルカメラなどにおいては、撮影し
た画像を銀塩フィルムの代わりに、メモリカ−ド、磁気
ディスクあるいは磁気テ−プ装置などの記憶媒体にデジ
タルデ−タとして保存するので、1枚のメモリカ−ド、
磁気ディスクあるいは1巻の磁気テ−プ装置に記録でき
る画像の枚数が規定され、この規定枚数分の画像の記録
が保証されなければならず、しかも、デ−タの記録再生
処理に要する時間が短くかつ、一定である必要がある。
2. Description of the Related Art When image signals are stored as digital data in storage devices such as memory cards, magnetic disks, or magnetic tapes, the amount of data is enormous, so many frames are used. In order to record a system image within a limited storage capacity, it is necessary to perform some kind of highly efficient compression on the obtained image signal data. Furthermore, in digital electronic still cameras, captured images are stored as digital data on storage media such as memory cards, magnetic disks, or magnetic tape devices instead of silver halide film. memory card,
The number of images that can be recorded on a magnetic disk or one roll of magnetic tape device is specified, and recording of this specified number of images must be guaranteed, and moreover, the time required for data recording and reproduction processing is limited. Must be short and constant.

【0003】同様に、デジタルVTR(ビデオテ−プレ
コ−ダ)、デジタル動画ファイルなどにおいて動画像を
記録する場合も、フレ−ム当たりの画像のデ−タ量に影
響されることなく、所定量のフレ−ムを記録できなけれ
ばならない。すなわち、静止画像であっても、動画像で
あっても、必要なコマ数分を確実に記録できる必要があ
るとともに、デ−タの記録再生処理に要する時間が短く
かつ、一定である必要がある。
Similarly, when recording moving images on a digital VTR (video tape recorder), digital moving image file, etc., a predetermined amount of data is recorded without being affected by the amount of image data per frame. Must be able to record frames. 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 for data recording and playback processing must be short and constant. be.

【0004】ところで、高能率な画像デ−タの圧縮方式
として、直交変換符号化と可変長符号化とを組み合わせ
た符号化方法が広く知られている。その代表的なものと
して静止画符号化国際標準化において検討されている方
式がある。
By the way, as a highly efficient image data compression method, a coding method that combines orthogonal transform coding and variable length coding is widely known. A typical example is a method being considered in the international standardization of still image coding.

【0005】以下、この方式についてその概略を説明す
る。まず、画像デ−タを所定の大きさのブロックに分割
し、分割されたブロックごとに直交変換して2次元のD
CT(離散コサイン変換)を行う。次に、各周波数成分
に応じて線形量子化を行い、この量子化された値に対し
可変長符号化としてハフマン符号化を行う。このとき、
直流成分に関しては近傍ブロックの直流成分との差分値
をハフマン符号化する。交流成分はジクザグスキャンと
呼ばれる低い周波数成分から高い周波数成分へのスキャ
ンを行い、無効(値が0)の成分の連続する個数とそれ
に続く有効な成分の値とから2次元のハフマン符号化を
行なう。
[0005] This method will be briefly explained below. First, image data is divided into blocks of a predetermined size, and each divided block is orthogonally transformed to create a two-dimensional D
Perform CT (discrete cosine transform). Next, linear quantization is performed according to each frequency component, and Huffman encoding is performed as variable length encoding on the quantized value. At this time,
As for the DC component, the difference value between it and the DC component of neighboring blocks is Huffman encoded. The AC component is scanned from a low frequency component to a high frequency component, which is called a zigzag scan, and two-dimensional Huffman encoding is performed from the consecutive number of invalid (value 0) components and the value of the subsequent valid component. .

【0006】以上の動作を図3を参照して説明する。ま
ず、(a)において、1フレ−ムの画像デ−タ(国際標
準化案で例示されている1フレ−ムの画像は、720×
576画素)を所定の大きさのブロック(例えば、8×
8の画素よりなるブロックA、B、C、…)に分割し、
(b)に示すように、この分割されたブロックごとに直
交変換として2次元のDCT(離散コサイン変換)を行
ない、8×8のマトリックス上に順次格納する。画像デ
−タは2次元平面で眺めてみると、濃淡情報の分布に基
づく周波数情報である空間周波数を有している。
The above operation will be explained with reference to FIG. First, in (a), one frame of image data (one frame of image exemplified in the international standardization proposal is 720×
576 pixels) into a block of a predetermined size (for example, 8×
Divide into blocks A, B, C, ...) each consisting of 8 pixels,
As shown in (b), a two-dimensional DCT (discrete cosine transform) is performed as an orthogonal transform for each divided block, and the resultant blocks are sequentially stored on an 8×8 matrix. When image data is viewed on a two-dimensional plane, it has a spatial frequency that is frequency information based on the distribution of gradation information.

【0007】したがって、上記DCTを行なうことによ
り、画像デ−タは直流成分DCと交流成分DCに変換さ
れ、8×8のマトリックス上には原点位置すなわち(0
、0)位置に直流成分DCの値を示すデ−タが、そして
、(0、7)位置には横軸方向の交流成分ACの最大周
波数値を示すデ−タが、(7、0)位置には縦軸方向の
交流成分ACの最大周波数値を示すデ−タが、さらに、
(7、7)位置には斜め方向の交流成分ACの最大周波
数値を示すデ−タがそれぞれ格納され、中間位置ではそ
れぞれの座標位置により関係付けられる方向における周
波数デ−タが、原点側より順次高い周波数のものが出現
する形で格納されることになる。
Therefore, by performing the above DCT, the image data is converted into a direct current component DC and an alternating current component DC, and the origin position, that is, (0
, 0), data indicating the value of the DC component DC, and position (0, 7), data indicating the maximum frequency value of the AC component AC in the horizontal axis direction, (7, 0). At the position, there is data indicating the maximum frequency value of the alternating current component AC in the vertical axis direction.
(7, 7) positions respectively store data indicating the maximum frequency value of the alternating current component AC in the diagonal direction, and at the intermediate position, frequency data in the direction related by each coordinate position is stored from the origin side. The data will be stored in such a way that those with higher frequencies appear in sequence.

【0008】次に、このマトリックスにおける各座標位
置の格納デ−タを、各周波数成分ごとの量子化幅により
割ることにより、各周波数成分に応じた線形量子化を行
ない(c)、この量子化された値に対し可変長符号化と
してハフマン符号化を行なう。このとき、直流成分DC
に関しては、近傍ブロックの直流成分との差分値をクル
−プ番号(付加ビット数)と付加ビットで表現し、その
グル−プ番号をハフマン符号化し、得られた符号語と付
加ビットを合わせて符号化デ−タとする(d1、d2、
e1、e2)。
Next, by dividing the data stored at each coordinate position in this matrix by the quantization width for each frequency component, linear quantization is performed according to each frequency component (c), and this quantization Huffman encoding is performed on the obtained value as variable length encoding. At this time, the direct current component DC
Regarding, the difference value with the DC component of the neighboring block is expressed by a group number (number of additional bits) and additional bits, the group number is Huffman encoded, and the obtained code word and additional bits are combined and Let it be encoded data (d1, d2,
e1, e2).

【0009】交流成分ACに関して有効な、すなわち、
値が0でない係数は、グル−プ番号と付加ビットで表現
する。そのため、交流成分ACはジクザグスキャンと呼
ばれる低い周波数成分から高い周波数成分へのスキャン
を行ない、無効、すなわち、値が0の成分の連続する個
数(0のラン数)と、それに続く有効な成分の値のグル
−プ番号とから2次元のハフマン符号化を行ない、得ら
れた符号語と付加ビットを合わせて符号化デ−タとする
Valid for the alternating current component AC, ie:
A coefficient whose value is not 0 is expressed by a group number and additional bits. Therefore, the AC component AC performs a scan called zigzag scan from low frequency components to high frequency components, and detects the number of consecutive invalid components (run number of 0) and the following valid components. Two-dimensional Huffman encoding is performed using the value group number, and the resulting code word and additional bits are combined to form encoded data.

【0010】ハフマン符号化は、フレ−ム画像当たりの
上記直流成分DC及び交流成分ACの各々のデ−タ分布
における発生頻度のピ−クのものを中心として、この中
心のものほど、デ−タビットを少なくし、周辺になるほ
どビット数を多くするようにしてビット割り当てをした
形でデ−タを符号化して符号語を得ることで行なう。以
上がこの方式の基本部分である。
[0010] Huffman encoding is based on the peak frequency of occurrence in the data distribution of each of the DC component DC and AC component AC per frame image. This is done by encoding data and obtaining a code word by assigning bits such that the number of bits decreases and the number of bits increases toward the periphery. The above is the basic part of this method.

【0011】しかしながら、この基本部分だけでは、可
変長符号化であるハフマン符号化を用いているために符
号量が画像ごとに一定でなくなってしまう。そこで、符
号量の制御の方法として、本発明者らは次のような方式
を特願平2−137222号において提案した。すなわ
ち、直交変換と可変長符号化とを組み合わせた圧縮方式
において、発生符号量の制御を行なうために、メモリに
記憶した画像信号をブロックに分割し、この分割された
ブロックごとに直交変換を行なってから、この変換出力
を暫定的な量子化幅で量子化した後、この量子化出力を
可変長符号化するとともに、各ブロックごとの発生符号
量と画像全体の総発生符号量とを算出し、次に前記暫定
的な量子化幅、前記総発生符号量および、目的とする総
符号量とから、新しい量子化幅を予測する。また、前記
各ブロックごとの発生符号量と、前記総発生符号量と、
目的とする総符号量とから、各ブロックごとの割り当て
符号量を計算する。そして、新しい量子化幅を用いて再
び画像メモリの画像信号をブロック分割、直交変換、量
子化、可変長符号化を行なうとともに、各ブロックの発
生符号量が各ブロックの割り当て符号量を越える場合に
は、途中で可変長符号化を打ち切り、次のブロックの処
理に移る。これにより、画像全体の総発生符号量が目的
の設定符号量を越えないように符号量の制御を行なうも
のである。
[0011] However, in this basic part alone, the amount of code is not constant for each image because Huffman coding, which is variable length coding, is used. Therefore, as a method for controlling the amount of code, the present inventors proposed the following method in Japanese Patent Application No. 2-137222. That is, in a compression method that combines orthogonal transformation and variable length coding, in order to control the amount of generated code, the image signal stored in memory is divided into blocks, and orthogonal transformation is performed for each divided block. Then, this converted output is quantized using a provisional quantization width, and this quantized output is variable-length coded, and the amount of generated codes for each block and the total amount of generated codes for the entire image are calculated. , Next, a new quantization width is predicted from the provisional quantization width, the total generated code amount, and the target total code amount. Further, the amount of generated codes for each block, the total amount of generated codes,
The allocated code amount for each block is calculated from the target total code amount. Then, the image signal in the image memory is divided into blocks, orthogonally transformed, quantized, and variable length encoded again using the new quantization width, and if the generated code amount of each block exceeds the allocated code amount of each block, stops variable-length encoding midway through and moves on to processing the next block. Thereby, the code amount is controlled so that the total generated code amount for the entire image does not exceed the target set code amount.

【0012】0012

【発明が解決しようとする課題】上記したように、デジ
タル電子スチルカメラや他のアプリケ−ションなどにお
いては、高能率で画像デ−タの圧縮が行なえることが望
まれる。このような要求を満たす圧縮方式として上記の
国際標準方式があり、この方式においては、例示したよ
うなブロックごとの直交変換と可変長符号化を組み合わ
せた手法では、画像デ−タの圧縮を高能率で行なえるも
のの、可変長符号化を用いているために符号量が一定に
ならず、1枚のメモリカ−ドあるいは磁気ディスクある
いは1本の磁気テ−プなどの記録媒体に記録できる画像
の枚数が不定になるという欠点があった。
As described above, in digital electronic still cameras and other applications, it is desirable to be able to compress image data with high efficiency. The above-mentioned international standard method is a compression method that satisfies these requirements.In this method, the method that combines block-by-block orthogonal transformation and variable-length coding, as shown in the example, cannot achieve high compression of image data. Although this can be done efficiently, since variable length encoding is used, the amount of code is not constant, and the number of images that can be recorded on a recording medium such as a single memory card, magnetic disk, or single magnetic tape is limited. There was a drawback that the number of sheets was indefinite.

【0013】画像デ−タの記録においては、1枚のメモ
リカ−ドあるいは磁気ディスク装置あるいは1本の磁気
テ−プなどに記録できる画像に枚数が保証されていなけ
ればならない。また、操作性や消費電力の上からデ−タ
圧縮の処理時間はできるだけ短い必要がある。
In recording image data, it is necessary to guarantee the number of images that can be recorded on one memory card, magnetic disk device, or magnetic tape. Furthermore, from the viewpoint of operability and power consumption, the processing time for data compression must be as short as possible.

【0014】これに対し、上記の特願平2−13722
2号において提案した方式は、符号量を一定にすること
では非常に良好な結果が得られるが、画像信号を記憶す
るためのメモリが必要であり、回路の大きさ、コストや
消費電力が大きくなる。このため、小型化が非常に重要
視される製品や低価格の製品に上記方式を応用すること
は困難であった。近年では、製品が高値でも画像の質を
重視する場合や、画像の質を多少犠牲にしても安価な製
品を望むといった様々なユ−ザのニ−ズがあり、これに
応えるためには上記の方式のようにやや複雑な回路にな
るが高画質の得られる方式だけでなく、画質を多少犠牲
にしても簡単な回路で実現できる方式も必要である。ま
た、この2つの方式は圧縮デ−タに関して相互に再生時
の互換性がなくてはならない。
[0014] In contrast, the above-mentioned patent application No. 2-13722
The method proposed in No. 2 can obtain very good results by keeping the amount of code constant, but it requires memory to store the image signal, which increases the circuit size, cost, and power consumption. Become. For this reason, it has been difficult to apply the above method to products for which miniaturization is of great importance or to low-priced products. In recent years, there have been various needs of users, such as those who place importance on image quality even if the product is expensive, and those who want an inexpensive product even if they sacrifice some image quality.To meet these needs, the above-mentioned We need not only a method that can provide high image quality even though it requires a somewhat complicated circuit, such as the method shown in , but also a method that can be realized with a simple circuit even if the image quality is sacrificed to some extent. Furthermore, these two systems must be compatible with each other when reproducing compressed data.

【0015】本発明の画像デ−タの符号化装置はこのよ
うな課題に着目してなされたもので、その目的とすると
ころは、画質の損失をできるだけ小さくして、簡単な回
路により短い処理時間内で一定の符号量内に収まるよう
にデ−タを符号化可能な画像デ−タの符号化装置を提供
することにある。
The image data encoding device of the present invention has been developed with attention to such problems, and its purpose is to minimize the loss of image quality and to perform short processing using a simple circuit. An object of the present invention is to provide an image data encoding device capable of encoding data within a certain amount of code within a certain amount of time.

【0016】[0016]

【課題を解決するための手段】上記の課題を解決するた
めに本発明の画像デ−タの符号化装置は、画像デ−タを
ブロックに分割するブロック化手段と、この分割された
ブロックごとに直交変換を行う直交変換手段と、この変
換出力を量子化する量子化手段と、この量子化出力を可
変長符号化する可変長符号化手段と、可変長符号化にお
いて発生した各ブロックごとの符号量を記憶する手段と
、前記各ブロックごとの発生符号量を用いて各ブロック
ごとの割り当て符号量を決定する符号量割り当て手段と
、可変長符号化において発生した総符号量を算出しこれ
を設定符号量と比較する手段とを具備し、前記可変長符
号化において発生した総符号量が設定符号量より大きい
場合は、前記各ブロックごとの発生符号量を用いて各ブ
ロックごとの割り当て符号量を決定し、前記メモリに記
憶された符号化デ−タが割り当てされた割り当て符号量
を越えないように可変長符号を打ち切る手段をさらに具
備する。
[Means for Solving the Problems] In order to solve the above problems, the image data encoding device of the present invention includes a blocking means for dividing image data into blocks, and a blocking means for dividing image data into blocks. an orthogonal transform means that performs orthogonal transform on the transform, a quantizer that quantizes the transform output, a variable length encoder that encodes the quantized output with variable length, and a means for storing code amount; code amount allocation means for determining the allocated code amount for each block using the generated code amount for each block; means for comparing with a set code amount, and if the total code amount generated in the variable length encoding is larger than the set code amount, the allocated code amount for each block is determined using the generated code amount for each block. The apparatus further comprises means for determining the variable length code and terminating the variable length code so that the encoded data stored in the memory does not exceed the allocated allocated code amount.

【0017】[0017]

【作用】すなわち、本発明においては、記録媒体にデ−
タを記録するときに、目的とする符号量を設定した上で
、まずブロックごとに直交変換を行なってからこの変換
出力を量子化し、この量子化出力を可変長符号化して符
号化されたデ−タをメモリに記録する。この時点で発生
した総符号量を設定符号量と比較し、総符号量が設定符
号量以内であればそこで符号化を終了する。一方、もし
総符号量が設定符号量を越えていた場合には、先の符号
化において発生した各ブロックごとの符号量を用いて各
ブロックごとの割り当て符号量を決定し、前記メモリに
記録された符号化デ−タに対し、割り当てられた符号量
を越えないように各ブロックにおいて可変長符号を打ち
切る処理を追加することで、総符号量が設定符号量以内
になるように制御するものである。
[Operation] That is, in the present invention, data is stored in the recording medium.
When recording data, set the desired amount of code, first perform orthogonal transform for each block, then quantize the transform output, and then variable-length encode the quantized output to create the encoded data. - record the data in memory. The total code amount generated at this point is compared with the set code amount, and if the total code amount is within the set code amount, the encoding is terminated. On the other hand, if the total code amount exceeds the set code amount, the code amount allocated for each block is determined using the code amount for each block generated in the previous encoding, and the amount of code allocated to each block is determined and recorded in the memory. This method controls the total code amount to be within the set code amount by adding processing to terminate the variable length code in each block so that the coded data does not exceed the allocated code amount. be.

【0018】[0018]

【実施例】以下、図面を参照して本発明に係る画像の符
号化装置を説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An image encoding apparatus according to the present invention will be described below with reference to the drawings.

【0019】図2は図1に示す本発明の符号化回路10
が適用されるデジタル電子スチルカメラ本体(以下、電
子カメラ本体と略す)の構成を示すブロック図である。 ここで、本発明とは直接関係のない電子カメラ本体の機
構は図示及び説明を省略する。図2において、電子カメ
ラ本体1はレンズ2、CCDなどの撮像素子4、プロセ
ス回路6、A/D変換器8、符号化回路10、メモリ1
2、記録媒体14及びシステムコントロ−ラ16を具備
する。
FIG. 2 shows the encoding circuit 10 of the present invention shown in FIG.
1 is a block diagram showing the configuration of a digital electronic still camera body (hereinafter abbreviated as electronic camera body) to which this is applied. Here, illustrations and explanations of mechanisms of the electronic camera body that are not directly related to the present invention will be omitted. In FIG. 2, an electronic camera body 1 includes a lens 2, an image sensor 4 such as a CCD, a process circuit 6, an A/D converter 8, an encoding circuit 10, and a memory 1.
2, a recording medium 14 and a system controller 16.

【0020】レンズ2は撮像素子4の前方に配置され、
被写体像を撮像素子上に投影する。撮像素子4により出
力された映像信号はプロセス回路6により色分離、ホワ
イトバランス、ガンマ補正等の処理がなされ、A/D変
換器8によりデジタル信号に変換される。符号化回路1
0は入力された画像デ−タに圧縮処理を行ない圧縮デ−
タをメモリ12に出力する。メモリ12は例えばFIF
O(ファ−ストイン・ファ−ストアウト・メモリ)で構
成可能である。圧縮処理が終了したデ−タは記録媒体1
4に記録される。システムコントロ−ラ16は上記した
各構成要素の制御を行なう。
[0020] The lens 2 is arranged in front of the image sensor 4,
A subject image is projected onto an image sensor. The video signal output by the image sensor 4 is subjected to processing such as color separation, white balance, and gamma correction by the process circuit 6, and is converted into a digital signal by the A/D converter 8. Encoding circuit 1
0 is compressed data that performs compression processing on the input image data.
output data to memory 12. The memory 12 is, for example, a FIF.
It can be configured with O (first-in first-out memory). The data that has been compressed is stored on recording medium 1.
Recorded in 4. The system controller 16 controls each of the above-mentioned components.

【0021】符号化回路10は図1に示すように、ブロ
ック化回路20、直交変換回路22、量子化回路24、
エントロピ−符号化回路26、符号出力回路28、量子
化幅設定回路30、符号量算出回路32、符号打切回路
34、制御回路36及び符号割当回路38とを具備する
。ブロック化回路20は入力される画像デ−タを所定の
サイズのブロックに分割するブロック化処理を行なうも
のである。ここでは、例として、ブロックサイズは8×
8とするが、これに限定されない。
As shown in FIG. 1, the encoding circuit 10 includes a blocking circuit 20, an orthogonal transform circuit 22, a quantization circuit 24,
It includes an entropy encoding circuit 26, a code output circuit 28, a quantization width setting circuit 30, a code amount calculation circuit 32, a code truncation circuit 34, a control circuit 36, and a code allocation circuit 38. The blocking circuit 20 performs blocking processing to divide input image data into blocks of a predetermined size. Here, as an example, the block size is 8×
8, but is not limited to this.

【0022】このようなブロック化回路は例えば、水平
8ライン分のRAM(ランダムアクセスメモリ)を輝度
及び色差成分に対応する容量分備えることで構成される
。直交変換回路22はブロック化処理された画像デ−タ
を、各ブロックごとに直交変換、ここでは例として、D
CTを行なうものである。
[0022] Such a blocking circuit is constructed by, for example, having a RAM (random access memory) for eight horizontal lines with a capacity corresponding to the luminance and color difference components. The orthogonal transform circuit 22 orthogonally transforms the block-processed image data for each block.
This is a CT scan.

【0023】量子化回路24は直交変換回路22から出
力される直交変換係数に対し、各周波数成分ごとにあら
かじめ設定された各周波数成分ごとの量子化幅を用いて
線形量子化を行なう。エントロピ−符号化回路26は量
子化された変換係数をエントロピ−符号化するものであ
る。ここではハフマン符号化を使用した例を示す。符号
出力回路28は符号化された画像デ−タを一定のバス幅
、例えば8ビットに揃えてメモリ12に出力する制御を
行なう。
The quantization circuit 24 linearly quantizes the orthogonal transform coefficients output from the orthogonal transform circuit 22 using a quantization width for each frequency component that is preset for each frequency component. The entropy encoding circuit 26 entropy encodes the quantized transform coefficients. Here, an example using Huffman encoding is shown. The code output circuit 28 performs control to output the encoded image data to the memory 12 with a constant bus width, for example, 8 bits.

【0024】量子化幅設定回路30は設定された目的符
号量に対する量子化幅を量子化回路24に出力する。符
号量算出回路32は符号化された画像デ−タの符号量を
計算し、符号割当回路38及び制御回路36に出力する
The quantization width setting circuit 30 outputs the quantization width for the set target code amount to the quantization circuit 24. The code amount calculation circuit 32 calculates the code amount of the encoded image data and outputs it to the code allocation circuit 38 and the control circuit 36.

【0025】符号打切回路34は符号化デ−タに対し、
割り当られた符号量を越えないように、各ブロックにお
いて可変長符号を打ち切る処理を行なう。符号割当回路
38は符号量算出回路32から与えられた符号量を用い
て、各ブロックごとの割り当て符号量を決定する。
The code terminating circuit 34 performs the following on the encoded data:
The variable length code is truncated in each block so that the allocated code amount is not exceeded. The code allocation circuit 38 uses the code amount given from the code amount calculation circuit 32 to determine the allocated code amount for each block.

【0026】制御回路36はシステムコントロ−ラ16
から与えられる目的符号量情報と、符号量算出回路32
からの符号量入力を用いて符号化の過程の進行を制御す
るとともに、符号化回路10の各構成要素の制御を行な
う。
The control circuit 36 is the system controller 16
The target code amount information given from the code amount calculation circuit 32
The code amount input from the encoder 10 is used to control the progress of the encoding process and to control each component of the encoding circuit 10.

【0027】以上のように構成された電子カメラの動作
について説明する。画像の撮影に先立ち、システムコン
トロ−ラ16から制御回路36に目的符号量情報が与え
られる。ここで、目的符号量はカメラ固有の値に固定さ
れていても良いし、あるいは、切り替えスイッチにより
所望の値がそのつど選択できるようにされていても良い
The operation of the electronic camera configured as above will be explained. Prior to photographing an image, target code amount information is given from the system controller 16 to the control circuit 36. Here, the target code amount may be fixed to a value specific to the camera, or a desired value may be selected each time using a changeover switch.

【0028】次に、図示せぬシャッタが押されることに
より撮影が開始されると、レンズ2により投影された被
写体像が撮像素子4により映像信号に変換され、プロセ
ス回路6に出力される。プロセス回路6ではこの映像信
号に色分離、ホワイトバランス、ガンマ補正などの処理
がなされる。プロセス処理された映像信号はA/D変換
器8によりデジタル信号に変換され、輝度及び色差線順
次信号として符号化回路10に入力される。
Next, when a shutter (not shown) is pressed to start photographing, the image of the subject projected by the lens 2 is converted into a video signal by the image sensor 4 and output to the process circuit 6. The process circuit 6 performs processing such as color separation, white balance, and gamma correction on this video signal. The processed video signal is converted into a digital signal by the A/D converter 8, and is input to the encoding circuit 10 as a luminance and color difference line sequential signal.

【0029】符号化回路10では入力された画像デ−タ
に対して、まず、ブロック化回路20により8×8のサ
イズのブロックに分割するブロック化処理が行われる。 ここで、処理の順序として、まず、輝度信号の2ブロッ
ク分が出力され、次に、色差信号の1ブロック分が出力
されるというように、いわゆる、インタ−リ−ブの手法
により画面上の各ブロックごとに輝度及び色差信号が交
互に処理される。
In the encoding circuit 10, the input image data is first subjected to blocking processing in which the input image data is divided into 8×8 blocks by the blocking circuit 20. Here, the processing order is such that first, two blocks of luminance signals are output, then one block of color difference signals is output, and so on, using a so-called interleaving method. Luminance and color difference signals are processed alternately for each block.

【0030】ブロック化処理の結果得られたDCT係数
に対し、量子化回路24により各周波数成分ごとに各周
波数成分ごとの量子化幅を用いて線形量子化が行われる
。ここでの量子化幅としては、先にシステムコントロ−
ラ16から制御回路36に与えられた目的符号量情報に
対応し、量子化幅設定回路30が設定した量子化幅が用
いられる。
The quantization circuit 24 linearly quantizes the DCT coefficients obtained as a result of the blocking process for each frequency component using a quantization width for each frequency component. The quantization width here is determined by the system control first.
The quantization width set by the quantization width setting circuit 30 is used in accordance with the target code amount information given from the controller 16 to the control circuit 36.

【0031】量子化された変換係数は、エントロピ−符
号化回路26によりハフマン符号化される。このとき、
直流成分DCに関しては近傍ブロックの直流成分との差
分値をグル−プ番号(付加ビット数)と付加ビットで表
現し、そのグル−プ番号をハフマン符号化し、得られた
符号語と付加ビットを合わせて符号化デ−タとされる。 交流成分ACはジクザグスキャンと呼ばれる低い周波数
成分から高い周波数成分へのスキャンを行ない、無効(
値が0)の成分の連続する個数(0のラン数)と、それ
に続く有効な(値が0でない)成分の値のグル−プ番号
とから2次元のハフマン符号化が行われ、得られた符号
語と付加ビットを合わせて符号化デ−タとされる。
The quantized transform coefficients are Huffman encoded by the entropy encoding circuit 26. At this time,
Regarding the DC component DC, the difference value with the DC component of neighboring blocks is expressed by a group number (number of additional bits) and additional bits, the group number is Huffman encoded, and the obtained code word and additional bits are Together, they are used as encoded data. The alternating current component AC performs a scan called zigzag scan from low frequency components to high frequency components, and is invalidated (
Two-dimensional Huffman encoding is performed from the number of consecutive components (value is 0) (run number of 0) and the group number of the subsequent valid component values (value is not 0). The code word and additional bits are combined to form encoded data.

【0032】符号化された画像デ−タは符号出力回路2
8により8ビットに揃えて区切られ、メモリ12に出力
される。これと同時に、符号量算出回路32は符号化さ
れた画像デ−タの符号量を計算し、符号割当回路38に
出力する。符号割当回路38は各ブロックごとに発生し
た符号量を記憶する。
The encoded image data is sent to the encoder output circuit 2.
The data is divided into 8 bits by 8 and output to the memory 12. At the same time, the code amount calculation circuit 32 calculates the code amount of the encoded image data and outputs it to the code allocation circuit 38. The code allocation circuit 38 stores the amount of codes generated for each block.

【0033】上記の処理が各ブロックごとに順次行われ
る。全画面分のブロックの処理が終了した時点で、発生
した総符号量が符号量算出回路32から制御回路36に
出力され設定符号量と比較される。総符号量が設定符号
量以内であれば、制御回路36の働きによりそこで符号
化が終了され、メモリ12に記録されていた符号化デ−
タが記録媒体14に転送記録されて撮影が終了する。一
方、もし、総符号量が設定符号量を越えていた場合には
次の処理が行われる。
The above processing is performed sequentially for each block. When the processing of blocks for the entire screen is completed, the total code amount generated is output from the code amount calculation circuit 32 to the control circuit 36 and compared with the set code amount. If the total code amount is within the set code amount, the control circuit 36 will terminate the encoding and the encoded data recorded in the memory 12 will be deleted.
The data is transferred and recorded on the recording medium 14, and the photographing ends. On the other hand, if the total code amount exceeds the set code amount, the following process is performed.

【0034】まず、先の符号化において発生した総符号
量及び各ブロックごとの符号量が符号量算出回路32か
ら符号割当回路38に与えられ、各ブロックごとの符号
量に目的符号量と総符号量との比が掛けられることによ
り、各ブロックごとの割り当て符号量が決定される。次
に、メモリ12から符号打切回路34に符号化デ−タが
順次読み出され、各ブロックごとに割り当てされた符号
量を越えた分に対し、可変長符号を打ち切る処理が行わ
れる。すなわち、交流成分ACを表現する2次元のハフ
マン符号のうち、割り当て符号量以内の成分が残され、
割り当て符号量を超過する高い周波数成分の符号語と付
加ビットデ−タは切り捨てられ、EOB(エンドオブブ
ロック)符号が付加される。処理された画像デ−タは打
切回路34から符号出力回路28に出力され、ここで、
8ビットに揃えて区切られてメモリ12に出力される。 全画面分のブロックの処理が終了した時点で、メモリ1
2に記憶されていた符号化デ−タが記録媒体14に転送
記録されて撮影が終了する。
First, the total code amount generated in the previous encoding and the code amount for each block are given from the code amount calculation circuit 32 to the code allocation circuit 38, and the code amount for each block is divided into the target code amount and the total code amount. The allocated code amount for each block is determined by multiplying by the ratio. Next, the encoded data is sequentially read out from the memory 12 to the code abort circuit 34, and processing is performed to abort the variable length codes for the amount of code that exceeds the amount of code allocated to each block. That is, among the two-dimensional Huffman codes expressing the AC component AC, components within the allocated code amount are left,
High frequency component code words and additional bit data exceeding the allocated code amount are truncated and an EOB (end of block) code is added. The processed image data is output from the abort circuit 34 to the code output circuit 28, where it is
The data is divided into 8 bits and output to the memory 12. When processing of blocks for the entire screen is completed, memory 1
The encoded data stored in 2 is transferred to and recorded on the recording medium 14, and the photographing is completed.

【0035】以上説明したように、本発明においては、
符号量を一定の符号量内に収まるように制御できるとと
もに、画像信号を記憶するためのメモリが不要となり、
圧縮された後の符号化デ−タを記憶するためだけの容量
のメモリをもてば良い。このため、回路の規模、コスト
を低減できる利点がある。
As explained above, in the present invention,
The code amount can be controlled to stay within a certain code amount, and no memory is required to store the image signal.
It is sufficient to have a memory with a capacity sufficient to store encoded data after being compressed. Therefore, there is an advantage that the scale and cost of the circuit can be reduced.

【0036】上記の実施例において、線形量子化を行な
うときの量子化幅としては、一般的な画像のうち高周波
成分の多い画像に対し、ちょうど目的符号量になるよう
に設定すれば良い。すなわち、例えば、風景写真のよう
に高周波成分の多い画像では符号量が多くなる傾向があ
るので、このような画像に対しちょうど目的符号量にな
るようにすることで、第1の符号化過程において発生符
号量が目的符号量を越えることを少なくできる。この場
合、例えば、人物写真のように高周波成分の少ない画像
では符号量が目的符号量をかなり下回ることが多くなる
が、このような画像では少ない符号量で符号化しても画
質が悪くなることが少ないので実用上さほど問題はない
In the above embodiment, the quantization width when linear quantization is performed may be set to exactly the target code amount for an image with many high frequency components among general images. That is, for example, images with many high-frequency components, such as landscape photographs, tend to have a large amount of code, so by adjusting the amount of code exactly to the target amount for such images, the first encoding process can be It is possible to reduce the occurrence of the generated code amount exceeding the target code amount. In this case, for example, in images with few high-frequency components, such as portraits, the amount of code is often much lower than the target amount of code, but even if such images are encoded with a small amount of code, the image quality may deteriorate. Since it is small, there is no problem in practical use.

【0037】また、メモリ12の容量としては、目的符
号量に若干の余裕を見込んだ容量、例えば目的符号量の
1.5倍から2倍の容量とすればよい。このような値に
設定しておけば、ほとんどの場合について問題なく符号
化することができるが、ごく希には第1の符号化過程に
おいて発生した符号量がメモリ12の容量を越えること
がある。この問題点を解決するには、あらかじめ、符号
化の途中、例えば、全体の1/3から1/2の数のブロ
ックまでの発生符号量の上限を定めておき、ここまでの
符号化を行なった時点で発生符号量が上限値を越えた場
合には、そこまでに発生した符号デ−タに対し、各ブロ
ックごとに可変長符号を打ち切る処理を行なうようにす
ればよい。すなわち、発生した符号量が上限値を越えた
場合、制御回路36の働きによりそこで符号化を一時停
止し、メモリ12から符号打切回路34に符号化デ−タ
が順次読み出され、各ブロックごとに、あらかじめ定め
られた上限符号量を越えた分に対し、可変長符号を打ち
切る処理が行われる。
Further, the capacity of the memory 12 may be set to allow for a slight margin for the target code amount, for example, from 1.5 times to twice the target code amount. If this value is set, encoding can be performed without problems in most cases, but in rare cases, the amount of code generated in the first encoding process may exceed the capacity of the memory 12. . To solve this problem, set the upper limit of the amount of generated code in advance during encoding, for example, from 1/3 to 1/2 of the total number of blocks, and then perform the encoding up to this point. If the amount of generated codes exceeds the upper limit at that point, the variable-length codes may be truncated for each block for the code data generated up to that point. That is, when the amount of generated code exceeds the upper limit, the control circuit 36 temporarily stops the encoding, and the encoded data is sequentially read out from the memory 12 to the code abort circuit 34, and the encoded data is read out for each block. Next, processing is performed to terminate the variable length code for the amount exceeding the predetermined upper limit code amount.

【0038】それと同時に、制御回路36からシステム
コントロ−ラ16に一時停止信号が出力され撮像素子4
の読み出しが一時停止される。可変長符号の打切処理が
終了した時点で撮像素子4の読み出しと符号化とが再開
されるが、上記の処理によりメモリ12にはその後の符
号化をするに十分な空容量が生じているので、継続して
符号化を行ない、1画面分のデ−タ処理を終了すること
ができる。
At the same time, a temporary stop signal is output from the control circuit 36 to the system controller 16, and the image sensor 4
reading is suspended. When the variable length code abort process is completed, reading and encoding from the image sensor 4 are restarted, but the above process has created enough free space in the memory 12 for subsequent encoding. , it is possible to continue encoding and complete data processing for one screen.

【0039】また、上記した実施例においては、メモリ
12にすべての符号化デ−タを一旦記録することを仮定
したが、これは記録媒体14そのものをメモリとして使
用し、目的符号量に対し余裕を見込んだ容量だけを記録
媒体外に付加メモリとして設けるようにしてもよい。こ
の場合、全体のメモリ容量をさらに減らすことが可能と
なる。
Furthermore, in the above-mentioned embodiment, it was assumed that all encoded data was once recorded in the memory 12, but in this case, the recording medium 14 itself is used as a memory, and there is a margin for the target code amount. It is also possible to provide additional memory outside the recording medium with only the capacity that allows for this. In this case, the overall memory capacity can be further reduced.

【0040】[0040]

【発明の効果】以上詳記したように本発明によれば、画
質の損失をできるだけ小さくして、簡単な回路により短
い処理時間内で一定の符号量内に収まるようにデ−タを
符号化可能な画像デ−タの符号化装置を提供することが
できる。
[Effects of the Invention] As detailed above, according to the present invention, data can be encoded within a certain amount of code within a short processing time using a simple circuit, with the loss of image quality as small as possible. A possible image data encoding device can be provided.

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

【図1】本発明に係る画像デ−タの符号化装置の一回路
構成を示すブロック図。
FIG. 1 is a block diagram showing a circuit configuration of an image data encoding device according to the present invention.

【図2】図1の符号化装置を含む電子カメラの構成を示
すブロック図。
FIG. 2 is a block diagram showing the configuration of an electronic camera including the encoding device of FIG. 1.

【図3】従来の符号化方法の原理を説明するための動作
遷移図。
FIG. 3 is an operation transition diagram for explaining the principle of a conventional encoding method.

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

20…ブロック化回路、22…直交変換回路、24…量
子化回路、26…エントロピ−符号化回路、28…符号
出力回路、30…量子化幅設定回路、32…符号量算出
回路、34…符号打切回路、36…制御回路、38…符
号割当回路。
20... Blocking circuit, 22... Orthogonal transform circuit, 24... Quantization circuit, 26... Entropy encoding circuit, 28... Code output circuit, 30... Quantization width setting circuit, 32... Code amount calculation circuit, 34... Code Termination circuit, 36...control circuit, 38...code assignment circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  画像デ−タをブロックに分割するブロ
ック化手段と、この分割されたブロックごとに直交変換
を行う直交変換手段と、この変換出力を量子化する量子
化手段と、この量子化出力を可変長符号化する可変長符
号化手段と、可変長符号化において発生した各ブロック
ごとの符号量を記憶する手段と、前記各ブロックごとの
発生符号量を用いて各ブロックごとの割り当て符号量を
決定する符号量割り当て手段と、可変長符号化において
発生した総符号量を算出しこれを設定符号量と比較する
手段とを具備し、前記可変長符号化において発生した総
符号量が設定符号量より大きい場合は、前記各ブロック
ごとの発生符号量を用いて各ブロックごとの割り当て符
号量を決定し、前記メモリに記憶された符号化デ−タが
割り当てされた割り当て符号量を越えないように可変長
符号を打ち切る手段をさらに具備することを特徴とする
画像デ−タの符号化装置。
Claim 1: Blocking means for dividing image data into blocks; orthogonal transformation means for performing orthogonal transformation for each divided block; quantization means for quantizing the output of this transformation; variable-length encoding means for variable-length encoding an output; means for storing the amount of code for each block generated in the variable-length encoding; and an allocation code for each block using the amount of codes generated for each block. and a means for calculating a total code amount generated in variable length encoding and comparing it with a set code amount, the total code amount generated in the variable length encoding being set. If it is larger than the code amount, determine the allocated code amount for each block using the generated code amount for each block, and ensure that the coded data stored in the memory does not exceed the allocated allocated code amount. An image data encoding device further comprising means for terminating the variable length code in such a manner.
JP2404795A 1990-12-21 1990-12-21 Encoding device for picture data Withdrawn JPH04220875A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2404795A JPH04220875A (en) 1990-12-21 1990-12-21 Encoding device for picture data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2404795A JPH04220875A (en) 1990-12-21 1990-12-21 Encoding device for picture data

Publications (1)

Publication Number Publication Date
JPH04220875A true JPH04220875A (en) 1992-08-11

Family

ID=18514455

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2404795A Withdrawn JPH04220875A (en) 1990-12-21 1990-12-21 Encoding device for picture data

Country Status (1)

Country Link
JP (1) JPH04220875A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6509929B1 (en) 1999-05-06 2003-01-21 Nec Corporation Apparatus and method for coding a moving picture
JP2007295023A (en) * 2006-04-20 2007-11-08 Pioneer Electronic Corp Moving picture processing apparatus and method, and computer program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6509929B1 (en) 1999-05-06 2003-01-21 Nec Corporation Apparatus and method for coding a moving picture
JP2007295023A (en) * 2006-04-20 2007-11-08 Pioneer Electronic Corp Moving picture processing apparatus and method, and computer program

Similar Documents

Publication Publication Date Title
JP3085465B2 (en) Image data encoding apparatus and encoding method
US5291282A (en) Image data coding apparatus and method capable of controlling amount of codes
US5335016A (en) Image data compressing/coding apparatus
EP0868092B1 (en) Method and apparatus for compression coding of color image data and digital camera including the same
EP0677969A2 (en) Moving picture coding method and an apparatus therefor
US6330369B1 (en) Method and apparatus for limiting data rate and image quality loss in lossy compression of sequences of digital images
JPH0379182A (en) Image encoding control system
JPH0832037B2 (en) Image data compression device
JP2952000B2 (en) Image data encoding apparatus and encoding method
JP2871139B2 (en) Image data encoding device and decoding device
JPH04220875A (en) Encoding device for picture data
JP2959831B2 (en) Image data encoding device
JP3076081B2 (en) Image signal processing device
JPH04114564A (en) Picture signal recording device
JP3038020B2 (en) Image data recording method and apparatus
JPH04363969A (en) Coding device and coding method for picture data
JP3192133B2 (en) Electronic camera device
JPH04971A (en) Picture encoding system
JP3055954B2 (en) Electronic still camera
JP3095788B2 (en) Electronic camera device
JPH04314266A (en) Device and method for encoding picture data
JPH04208775A (en) Bit distribution encoding system
JPH04211588A (en) Electronic camera device and electronic camera reproducing device
JP2619535B2 (en) Image signal compression encoding apparatus and decoding reproduction apparatus
JPH07222152A (en) Picture processor and compressed data control method in the picture processor

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19980312