JPH1051776A - Image coding device - Google Patents
Image coding deviceInfo
- Publication number
- JPH1051776A JPH1051776A JP20376996A JP20376996A JPH1051776A JP H1051776 A JPH1051776 A JP H1051776A JP 20376996 A JP20376996 A JP 20376996A JP 20376996 A JP20376996 A JP 20376996A JP H1051776 A JPH1051776 A JP H1051776A
- Authority
- JP
- Japan
- Prior art keywords
- coefficient
- circuit
- data
- code
- data 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.)
- Pending
Links
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
(57)【要約】
【課題】 所定期間毎のデータ量を適性に保ちつつ画面
全域に適当な符号化を行う小規模回路で高速に処理可能
な画像符号化装置を得ることを目的とする。
【解決手段】 ビットシフト回路29は、量子化回路2
8aで量子化されたデータを複数種類の所定ビット数m
1〜m4だけシフトし、複数のシフトデータを並列に出
力する。符号量演算手段61は、複数のシフトデータを
可変長符号化した際のデータ量を、1画面分だけ演算し
て複数のデータ量情報b1〜b4を出力する。スケーリ
ング係数更新回路42は、データ量情報b1〜b4に応
じて初期の係数k1を更新して得た係数k2を、符号化
手段62に対し出力する。符号化手段62は、この係数
k2を用いて符号化することで、符号化後のデータ量を
所望のデータ量未満でかつ所望のデータ量に近い量にす
る。
(57) Abstract: An object of the present invention is to provide an image encoding device capable of high-speed processing with a small-scale circuit that performs appropriate encoding over the entire screen while maintaining an appropriate amount of data for each predetermined period. SOLUTION: A bit shift circuit 29 includes a quantization circuit 2
8a is converted into a plurality of types of predetermined bit numbers m
Shift by 1 to m4, and output a plurality of shift data in parallel. The code amount calculation means 61 calculates a data amount when a plurality of shift data are subjected to variable length coding for one screen, and outputs a plurality of data amount information b1 to b4. The scaling coefficient update circuit 42 outputs the coefficient k2 obtained by updating the initial coefficient k1 according to the data amount information b1 to b4 to the encoding means 62. The encoding unit 62 performs encoding using the coefficient k2 so that the encoded data amount is less than the desired data amount and close to the desired data amount.
Description
【0001】[0001]
【発明の属する技術分野】この発明は画像符号化装置に
関し、特に画像情報を周波数領域に変換して得た変換デ
ータを量子化し、該量子化されたデータを可変長符号化
する画像符号化装置に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image coding apparatus, and more particularly to an image coding apparatus for quantizing transformed data obtained by transforming image information into a frequency domain and performing variable length encoding on the quantized data. It is about.
【0002】[0002]
【従来の技術】近年、マルチメディア化の進展に伴い、
画像のデジタル処理、特に、画像データを圧縮するため
の高能率符号化技術が注目されており、カラー静止画像
の符号化方式の国際標準機関として設立されたJPEG
(Joint Photographic ExpertGroup)においてDCT符
号化方式が国際標準として採用されている。2. Description of the Related Art In recent years, with the development of multimedia,
Digital processing of images, especially high-efficiency coding technology for compressing image data, has attracted attention, and JPEG has been established as an international standard organization for coding color still images.
(Joint Photographic Expert Group) has adopted the DCT coding method as an international standard.
【0003】以下、この種の符号化方式の基本システム
の概要について簡単に説明する。図4は、DCT方式を
用いた従来の画像符号化装置の概略構成を説明するため
のブロック図である。表1〜表3は図4に示す符号化方
式の処理を説明するための図である。符号化しようとす
るデジタル画像信号は、入力端子2に入力される。入力
端子2に入力された画像信号は、8×8ブロック化回路
4に入力され、ここで二次元的に(8×8)画素からな
る画素ブロックに分割される。ブロック化回路4は、こ
の画素ブロック単位で後段に画像信号を送出する。DC
T回路6は、このブロック化回路4から受けた画像信号
を離散コサイン変換(DCT)し、周波数領域について
の(8×8)のデータマトリクスを出力する。即ち、表
1に示すような画像データB11〜B88からなる画素ブロ
ックは、DCT回路6により表2に示すようなD11〜D
88からなるデータマトリクスに変換される。[0003] An outline of a basic system of this type of coding system will be briefly described below. FIG. 4 is a block diagram for explaining a schematic configuration of a conventional image encoding device using the DCT method. Tables 1 to 3 are diagrams for explaining the processing of the encoding method shown in FIG. A digital image signal to be encoded is input to an input terminal 2. The image signal input to the input terminal 2 is input to an 8 × 8 blocking circuit 4 where it is two-dimensionally divided into pixel blocks consisting of (8 × 8) pixels. The blocking circuit 4 sends an image signal to the subsequent stage in units of this pixel block. DC
The T circuit 6 performs a discrete cosine transform (DCT) on the image signal received from the blocking circuit 4 and outputs an (8 × 8) data matrix for the frequency domain. That is, the pixel block composed of the image data B 11 to B 88 as shown in Table 1 is converted by the DCT circuit 6 into D 11 to D 88 as shown in Table 2.
It is converted to a data matrix consisting of 88 .
【0004】[0004]
【表1】 [Table 1]
【0005】[0005]
【表2】 [Table 2]
【0006】ここで、D11は画素ブロックの直流(D
C)成分、即ち、この画素ブロックの平均値を示してい
る。残りの交流成分D12〜D88を一般に交流成分Dijと
表現すると、この添字のi、jが大きいほど高い周波数
成分となる。Here, D 11 is the direct current (D
C) component, that is, the average value of this pixel block. If the remaining AC components D 12 to D 88 are generally expressed as AC components D ij , the higher the subscripts i and j, the higher the frequency components.
【0007】DCT回路6から出力されたデータマトリ
クスは、量子化回路8に入力される。一方、量子化マト
リクス発生回路18は、各DCT係数D11〜D88に対す
る量子化ステップサイズの重み付けを意味する表3に示
す量子化マトリクスW11〜W88を発生する。スケーリン
グ係数発生回路16は係数kを発生する。この量子化マ
トリクスW11〜W88及び係数kは、乗算器20に入力さ
れる。乗算器20では、(Wij×k)を演算し、量子化
回路8の量子化ステップはこの乗算器20の出力Q11〜
Q88に従って決定される。ここで、Wijは量子化マトリ
クスW11〜W88を表現しており、また、係数kは正の値
であり、この係数kの値により画質や発生データ量が制
御される。[0007] The data matrix output from the DCT circuit 6 is input to the quantization circuit 8. On the other hand, the quantization matrix generation circuit 18 generates quantization matrix W 11 to W-88 shown in Table 3, which means the weighting of the quantization step size for each DCT coefficient D 11 to D 88. The scaling coefficient generation circuit 16 generates a coefficient k. The quantization matrix W 11 to W-88 and the coefficient k is input to the multiplier 20. The multiplier 20 calculates (W ij × k), and the quantizing step of the quantizing circuit 8 is based on the outputs Q 11 to Q 11 of the multiplier 20.
It is determined according to Q 88. Here, W ij represents the quantization matrices W 11 to W 88 , and the coefficient k is a positive value, and the image quality and the amount of generated data are controlled by the value of the coefficient k.
【0008】[0008]
【表3】 [Table 3]
【0009】実際には、量子化回路8では、Dij/Qij
が演算され、出力される。この量子化回路8の出力をR
11〜R88とする。この量子化された変換データR11〜R
88はジグザグ変換回路10にて低周波成分から順に送出
される。即ち、ジグザグ変換回路10からは、R11〜R
88が、R11,R12,R21,R31,R22,R13,R14,R
23,R32,R41…R85,R86,R77,R68,R78,
R87,R88の順で可変長符号化(以下VLCという。)
回路12に供給される。VLC回路12において、例え
ば、直流成分R11については近傍に位置する画素ブロッ
ク間で予測値を算出し、この予測値との予測誤差をハフ
マン符号化する。また、交流(AC)成分R12〜R88に
ついては、上述のように低周波成分から高周波成分へと
ジグザグに走査しながら符号化し、量子化出力が0でな
い有意係数はその値によりグループ分類する。分類され
ているグループに与えられているグループ識別番号と、
直前の有意係数との間に挟まれた量子化出力が0の無効
係数のラン長とを組にしてハフマン符号化し、続いてグ
ループ内のいずれの値であるかを示す等長符号を付加す
る。一般に、画像の高周波成分は出現確率が低いため、
ジグザグ走査後のRijの後半部分はすべて0になること
が多い。従って、このようにして得た可変長符号は非常
に高い圧縮率が期待できる。高周波領域のDCT係数で
ゼロになるものが多いほど可変長符号化後の符号長が短
くなるのは、AC係数の符号化の仕組みに起因する。つ
まり、AC係数の符号化は、有意係数(値がゼロでない
AC係数)とその有意係数に先行する無効係数(値がゼ
ロのAC係数)のラン長との組合せを可変長符号化する
という仕組みにより、量子化計数値を大きくして(大き
な値で割り算して)、無効係数を増やし、無効係数が連
続するようにすれば、それらの係数をまとめて一つの符
号に変換でき、符号量が減少する。ここで前述の係数k
を大きく取ればRijが0となる確率が増加し、符号化さ
れたデータの総ビット数nbが減少する。この係数kと
総ビット数nbとの関係は、単純減少関数である。In practice, the quantization circuit 8 uses D ij / Q ij
Is calculated and output. The output of the quantization circuit 8 is R
And 11 ~R 88. The quantized transform data R 11 to R 11
Reference numeral 88 denotes a zigzag conversion circuit 10 which sends out the low frequency components in order. That is, the zigzag conversion circuit 10, R 11 to R
88 is R 11 , R 12 , R 21 , R 31 , R 22 , R 13 , R 14 , R
23 , R32 , R41 ... R85 , R86 , R77 , R68 , R78 ,
Variable-length coding in the order of R 87 and R 88 (hereinafter referred to as VLC)
It is supplied to the circuit 12. In VLC circuit 12, for example, calculates a predicted value between pixel blocks located near about DC component R 11, Huffman encodes the prediction error between the predicted value. Further, the alternating current (AC) component R 12 to R 88 encodes while scanning from the low-frequency components as described above and in zigzag to the high-frequency component, significant coefficients quantized output is not zero classified group by the value . A group identification number assigned to the group being classified,
The quantized output sandwiched between the immediately preceding significant coefficient and the run length of the invalid coefficient having a value of 0 is paired to perform Huffman coding, and then an equal length code indicating which value in the group is added. . Generally, the high-frequency components of an image have a low probability of appearance,
The latter half of Rij after zigzag scanning often becomes all zeros. Therefore, a very high compression ratio can be expected for the variable length code obtained in this way. The reason why the code length after variable length coding becomes shorter as the number of DCT coefficients in the high frequency region that becomes zero becomes larger is due to the mechanism of coding AC coefficients. That is, the coding of the AC coefficient is performed by a variable length coding of a combination of a significant coefficient (an AC coefficient having a non-zero value) and a run length of an invalid coefficient (an AC coefficient having a zero value) preceding the significant coefficient. By increasing the quantization count value (by dividing by a large value) and increasing the invalid coefficients so that the invalid coefficients are continuous, the coefficients can be collectively converted into one code, and the code amount is reduced. Decrease. Where the coefficient k
Is increased, the probability that R ij becomes 0 increases, and the total number of bits nb of the encoded data decreases. The relationship between the coefficient k and the total number of bits nb is a simple decreasing function.
【0010】ところで、画像を圧縮符号化した場合に、
一般的に細かい絵柄に対しては総ビット数が増大し、滑
らかな画像では総ビット数が減少する傾向がある。この
ため、画像毎にデータ圧縮後の総ビット数が変化し、デ
ジタル電子スチルカメラ等の応用において、画像を記録
する記録媒体の容量が不足してしまうことがあるという
不都合がある。そこで、図5に示すように、出力部にバ
ッファメモリを有して、絵柄に拘わらず、画像毎の総ビ
ット数nbを一定にしたものがある。すなわち、バッフ
ァメモリ13は、図4における量子化ステップを決定す
る乗算器20の出力Qijに替えてバッファメモリ13の
使用状態に応じた符号化特性(量子化ステップサイズ)
を量子化回路8に与える。そのため、スケーリング係数
発生回路16、量子化マトリクス発生回路18および乗
算器20に替えて、VLC回路12の出力を記憶するバ
ッファメモリ13が設けられている。しかしながら、こ
の画像符号化装置は、バッファメモリ13の使用状態に
応じて、逐次量子化ステップサイズを変化させているこ
とから、画面全体にわたって最適な調整をすることがで
きない。例えば、画面の上半分が平坦で下半分が細かい
絵柄の画像データが入力された場合は、画面の上半分の
画像データの符号化には不必要なビットが割り当てら
れ、下半分の画像データの符号化には十分なビットを割
り当てることができず、画質が劣化してしまう。By the way, when an image is compressed and encoded,
In general, the total number of bits tends to increase for a fine picture, and to decrease for a smooth image. For this reason, the total number of bits after data compression changes for each image, and in applications such as digital electronic still cameras, there is an inconvenience that the capacity of a recording medium for recording images may be insufficient. Therefore, as shown in FIG. 5, there is a type in which a buffer memory is provided in the output unit and the total number of bits nb for each image is constant regardless of the picture. That is, the buffer memory 13 replaces the output Q ij of the multiplier 20 that determines the quantization step in FIG. 4 with the encoding characteristic (quantization step size) according to the use state of the buffer memory 13.
Is given to the quantization circuit 8. Therefore, a buffer memory 13 that stores the output of the VLC circuit 12 is provided instead of the scaling coefficient generation circuit 16, the quantization matrix generation circuit 18, and the multiplier 20. However, in this image encoding device, since the quantization step size is sequentially changed in accordance with the use state of the buffer memory 13, it is not possible to make an optimal adjustment over the entire screen. For example, when image data of a picture whose upper half is flat and whose lower half is fine is input, unnecessary bits are assigned to encode the image data of the upper half of the screen, and the lower half of the image data of the image data is input. Sufficient bits cannot be allocated for encoding, and image quality deteriorates.
【0011】一方、所望のデータ量となるまで、複数の
量子化ステップサイズを用いて量子化を繰り返し、総ビ
ット数nbを所望の値nb0未満に抑えるようにした画
像符号化装置を、図6および図7を用いて説明する。図
6と図7は、図中の符号70で示した一点鎖線の部分で
繋がる。図6および図7の両図を用いて示した画像符号
化装置において、入力端子20に入力された、符号化し
ようとするデジタル画像信号は、8×8ブロック化回路
22に入力され、ここで二次元的に(8×8)画素から
なる画素ブロックに分割される。DCT回路24は、こ
のブロック化回路22から受けた画像信号を離散コサイ
ン変換し、周波数領域についての(8×8)のデータマ
トリクスを出力する。DCT回路24から出力されたデ
ータマトリクスは、ジグザグ変換回路26において、ジ
グザグ変換される。一方、量子化マトリクス発生回路3
2は、表3に示す量子化マトリクスW11〜W88を発生
し、スケーリング初期係数発生回路38は係数k1を発
生する。この量子化マトリクスW11〜W88及び係数k1
は、乗算器34aに入力される。On the other hand, an image coding apparatus in which quantization is repeated using a plurality of quantization step sizes until a desired data amount is reached, and the total number of bits nb is suppressed to less than a desired value nb0, is shown in FIG. This will be described with reference to FIG. FIGS. 6 and 7 are connected by a dashed line indicated by reference numeral 70 in the figure. In the image encoding apparatus shown in FIGS. 6 and 7, the digital image signal to be encoded, which is input to the input terminal 20, is input to the 8 × 8 blocking circuit 22, where It is divided two-dimensionally into pixel blocks consisting of (8 × 8) pixels. The DCT circuit 24 performs a discrete cosine transform on the image signal received from the blocking circuit 22, and outputs an (8 × 8) data matrix for the frequency domain. The data matrix output from the DCT circuit 24 is zigzag-converted by a zigzag conversion circuit 26. On the other hand, the quantization matrix generation circuit 3
2, the quantization matrix W 11 to W-88 shown in Table 3 were generated, scaled initial coefficient generating circuit 38 generates the coefficient k1. The quantization matrix W 11 to W-88 and the coefficient k1
Is input to the multiplier 34a.
【0012】乗算器34aでは、(Wij×k)を演算
し、量子化回路28aの量子化ステップはこの乗算器3
4aの出力Q11〜Q88に従って決定される。実際には、
量子化回路28aでは、Dij/Qijが演算され、出力さ
れる。この量子化回路28aの出力をR11〜R88とす
る。VLC回路36aは、量子化回路28aの出力をハ
フマン符号化し、グループ内のいずれの値であるかを示
す等長符号を付加する。次に、符号量計算回路40a
は、VLC回路36aから出力された可変長符号データ
を1画面分累算して、総ビット数b1を求める。係数演
算回路41aは、符号量計算回路40の計算結果に基づ
いて、初期係数k1と異なる係数k2を発生する。乗算
器34bは、この係数k2と量子化マトリクスW11〜W
88を用いて、出力Qa11〜Qa88を量子化回路28bに
与える。係数演算回路41a〜41cでは、符号量計算
回路40a〜40cで得られる1フレーム期間の総符号
量b1〜b3と所望の符号量とを比較して、スケーリン
グ係数の値をk2〜k4に更新する。具体的には、例え
ば、係数演算回路41aでは、初期係数k1を用いて量
子化した場合の総符号量b1が、所望の符号量よりも大
きければ、スケーリング係数k2をk1よりも大きな値
に更新し、初期係数k1を用いて量子化した場合の総符
号量b1が、所望の符号量よりも小さければ、スケーリ
ング係数k2を係数k1よりも小さな値に更新する。こ
れは、一般に、量子化計数値をより大きくすれば、高周
波領域のより多くのDCT係数がゼロになり、その結
果、可変長符号化後の符号長がより短くなるという性質
があるためである。The multiplier 34a calculates (W ij × k), and the quantization step of the quantization circuit 28a is performed by the multiplier 3a.
It is determined according to the output Q 11 to Q 88 of 4a. actually,
In the quantization circuit 28a, D ij / Q ij is calculated and output. The output of the quantization circuit 28a and R 11 to R 88. The VLC circuit 36a performs Huffman coding on the output of the quantization circuit 28a, and adds an equal length code indicating which value in the group. Next, the code amount calculation circuit 40a
Calculates the total number of bits b1 by accumulating the variable-length code data output from the VLC circuit 36a for one screen. The coefficient calculation circuit 41a generates a coefficient k2 different from the initial coefficient k1 based on the calculation result of the code amount calculation circuit 40. The multiplier 34b, the coefficients k2 and quantization matrix W 11 to W-
The outputs Qa 11 to Qa 88 are supplied to the quantization circuit 28b by using 88 . The coefficient calculation circuits 41a to 41c compare the total code amounts b1 to b3 in one frame period obtained by the code amount calculation circuits 40a to 40c with a desired code amount, and update the scaling coefficient values to k2 to k4. . Specifically, for example, in the coefficient operation circuit 41a, if the total code amount b1 when quantized using the initial coefficient k1 is larger than a desired code amount, the scaling coefficient k2 is updated to a value larger than k1. If the total code amount b1 when quantized using the initial coefficient k1 is smaller than the desired code amount, the scaling coefficient k2 is updated to a value smaller than the coefficient k1. This is because, in general, the larger the quantization count value, the more DCT coefficients in the high frequency region become zero, and as a result, the code length after variable length coding becomes shorter. .
【0013】量子化回路28bには、ジグザグ変換回路
26の出力が、遅延回路30aによって1画面分遅延し
て与えられている。量子化回路28bは、乗算器34b
の出力Qa11〜Qa88を用い、この遅延回路30aの出
力を量子化する。VLC回路36bと符号量計算回路4
0bは、この量子化回路28bの出力を用い、VLC回
路36aと符号量計算回路40aと係数演算回路41a
と同じように、1画面分累算した総ビット数b2を求
め、係数k3を発生する。同様に、遅延回路30bと量
子化回路28cとVLC回路36cと符号量計算回路4
0cと係数演算回路41cは、係数k3を用い、総ビッ
ト数b3と係数k4を求める。さらに、遅延回路30c
と量子化回路28dとVLC回路36dと符号量計算回
路40dは、総ビット数b4を求める。遅延回路30b
〜30dも、遅延回路30aと同様に、入力されたデー
タを1画面分遅延する。最初に発生した係数k1と求め
られた係数k2〜k4は、それぞれ、遅延回路43a〜
43dによって、4画面〜1画面分遅延させられ、一斉
に係数セレクタ47に入力される。また、符号量計算回
路40a〜40dの出力b1〜b4は、それぞれ、3〜
0画面分遅延させられ、一斉に係数決定回路45に入力
される。係数決定回路45は、総ビット数b1〜b4に
基づいて係数k1〜k4のいずれの係数を使用するか決
定し、係数セレクタ47がこの係数決定回路45の決定
結果に基づいて係数k1〜k4の選択を行い、選択され
た係数を係数k5として乗算器34eに対し出力する。The output of the zigzag conversion circuit 26 is given to the quantization circuit 28b with a delay of one screen by a delay circuit 30a. The quantization circuit 28b includes a multiplier 34b
Using the output Qa 11 ~Qa 88, quantizes the output of the delay circuit 30a. VLC circuit 36b and code amount calculation circuit 4
0b uses the output of the quantization circuit 28b, and uses a VLC circuit 36a, a code amount calculation circuit 40a, and a coefficient calculation circuit 41a.
Similarly to the above, the total number of bits b2 accumulated for one screen is obtained, and a coefficient k3 is generated. Similarly, the delay circuit 30b, the quantization circuit 28c, the VLC circuit 36c, and the code amount calculation circuit 4
0c and the coefficient calculation circuit 41c calculate the total number of bits b3 and the coefficient k4 using the coefficient k3. Further, the delay circuit 30c
, The quantization circuit 28d, the VLC circuit 36d, and the code amount calculation circuit 40d obtain the total bit number b4. Delay circuit 30b
30d also delays the input data by one screen, similarly to the delay circuit 30a. The first generated coefficient k1 and the obtained coefficients k2 to k4 are respectively provided by the delay circuits 43a to 43a.
At 43d, the delay is delayed by four to one screen and input to the coefficient selector 47 all at once. The outputs b1 to b4 of the code amount calculation circuits 40a to 40d are 3 to 4 respectively.
The data is delayed by 0 screen and input to the coefficient determination circuit 45 all at once. The coefficient determination circuit 45 determines which of the coefficients k1 to k4 to use based on the total number of bits b1 to b4, and the coefficient selector 47 determines the coefficient k1 to k4 based on the determination result of the coefficient determination circuit 45. The selection is performed, and the selected coefficient is output to the multiplier 34e as the coefficient k5.
【0014】このような従来の画像符号化装置において
は、総ビット数nbが目標値nb0よりも多い場合に
は、スケーリング係数kを増加させて量子化を行って総
ビット数nbを低減させる。逆に、総ビット数nbが目
標値よりも小さい場合には、スケーリング係数kを減少
させて量子化を行って総ビット数nbを増大させる。こ
のような、スケーリング係数を変えた量子化の繰り返し
によって、最終的には出力データ量を目標値に収束させ
る。しかしながら、この方法では、最適なスケーリング
係数を求めるための量子化回路や時間差補償のためのフ
レーム期間遅延回路を多数必要とするため、回路規模が
増大するという欠点がある。In such a conventional image coding apparatus, when the total number of bits nb is larger than the target value nb0, the scaling is increased by increasing the scaling coefficient k to reduce the total number of bits nb. Conversely, when the total number of bits nb is smaller than the target value, the scaling factor k is reduced and quantization is performed to increase the total number of bits nb. By repeating the quantization with the scaling coefficient changed, the output data amount finally converges to the target value. However, this method requires a large number of quantization circuits for obtaining an optimum scaling coefficient and a large number of frame period delay circuits for time difference compensation.
【0015】[0015]
【発明が解決しようとする課題】このように、上述した
従来の画像符号化装置は、出力バッファの使用量に応じ
て逐次符号化特性を変化させて出力レートを一定とした
場合、画面全体にわたって最適な符号化を行うことがで
きず、画質が劣化してしまうという問題があった。ま
た、スケーリング係数を変えて量子化を繰り返して出力
レートを一定とする方法を採用した場合には、回路規模
が非常に増大するという問題があった。この発明は上記
のような問題点を解消するためになされたもので、画面
全域に最適な符号化を行い、かつ、所定期間毎のデータ
量を所望のデータ量未満でこれに近い量に設定すること
ができ、小規模回路で高速に処理するのに適した画像符
号化装置を堤供することを目的とする。As described above, the conventional image coding apparatus described above, when the output rate is kept constant by sequentially changing the coding characteristics according to the use amount of the output buffer, can be applied to the entire screen. There has been a problem that the optimum encoding cannot be performed and the image quality deteriorates. Further, when a method of changing the scaling coefficient and repeating the quantization to keep the output rate constant is employed, there is a problem that the circuit scale is significantly increased. The present invention has been made in order to solve the above-described problems, and performs optimal encoding over the entire screen, and sets a data amount for each predetermined period to a value less than a desired data amount and close to the desired data amount. It is an object of the present invention to provide an image encoding device suitable for high-speed processing by a small-scale circuit.
【0016】[0016]
【課題を解決するための手段】第1の発明に係る画像符
号化装置は、画像情報を周波数領域に変換して得た第1
の変換データおよび該第1の変換データに対し所定時間
遅延した第2の変換データを並列に出力する並列化手段
と、制御係数の初期値を用いて前記第1の変換データを
量子化する量子化手段と、前記第1の量子化手段で量子
化されたデータを複数種類の所定ビット数だけシフト
し、複数のシフトデータを並列に出力するシフト手段
と、前記複数のシフトデータを可変長符号化した際のデ
ータ量を、前記所定時間分だけ演算して複数のデータ量
情報を出力する符号量演算手段と、前記複数のデータ量
情報に応じて、データ量を所望のデータ量に近づけるた
め量子化ステップを画面単位で制御する制御係数を初期
値より最適な値に更新する係数更新手段と、前記係数更
新手段の出力する制御係数を用いて前記第2の変換デー
タを量子化し、符号化して得た可変長符号を出力する符
号化手段とを備えて構成される。According to a first aspect of the present invention, there is provided an image encoding apparatus comprising: a first image encoding apparatus that converts image information into a frequency domain;
Parallelizing means for outputting in parallel the converted data and the second converted data delayed by a predetermined time with respect to the first converted data, and a quantizer for quantizing the first converted data using an initial value of the control coefficient. Means for shifting the data quantized by the first quantizing means by a plurality of types of predetermined number of bits, and outputting a plurality of pieces of shifted data in parallel; Code amount calculating means for calculating the data amount at the time of conversion for the predetermined time and outputting a plurality of data amount information; and for bringing the data amount closer to a desired data amount according to the plurality of data amount information. A coefficient updating means for updating a control coefficient for controlling a quantization step on a screen basis to an optimum value from an initial value, and quantizing and encoding the second transformed data using a control coefficient output from the coefficient updating means. Constructed and a coding means for outputting a variable length code obtained by.
【0017】第2の発明に係る画像符号化装置は、第1
の発明の画像符号化装置において、前記制御係数の初期
値を発生するスケーリング初期係数発生回路と、前記ス
ケーリング初期係数発生回路が出力した前記制御係数の
初期値を前記所定時間遅延させる遅延回路とをさらに備
えて構成される。An image coding apparatus according to a second aspect of the present invention comprises:
In the image encoding device according to the invention, a scaling initial coefficient generation circuit that generates an initial value of the control coefficient, and a delay circuit that delays the initial value of the control coefficient output from the scaling initial coefficient generation circuit by the predetermined time. In addition, it is configured.
【0018】第3の発明に係る画像符号化装置は、第1
または第2の発明の画像符号化装置において、前記所定
時間は、1画面に相当する時間を含み、前記係数更新手
段は、前記複数のデータ量情報の中から所望のデータ量
より少なく、かつ、該所望のデータ量に最も近いデータ
量情報を検出し、最も近い該データ量情報を得た時に前
記シフト手段においてシフトしたビット数に対応する値
に制御係数を変更することを特徴とする。An image coding apparatus according to a third aspect of the present invention comprises:
Alternatively, in the image encoding apparatus according to the second aspect, the predetermined time includes a time corresponding to one screen, and the coefficient updating unit is smaller than a desired data amount from the plurality of data amount information, and Data amount information closest to the desired data amount is detected, and when the closest data amount information is obtained, the control coefficient is changed to a value corresponding to the number of bits shifted by the shift means.
【0019】第4の発明に係る画像符号化装置は、第3
の発明の画像符号化装置において、前記符号量演算手段
は、直流係数差分値のグループ化および交流係数のグル
ープ化を行うとともに、差分直流係数用符号表を用いて
差分直流係数を可変長符号に変換し、交流係数用符号表
を用いて交流係数を可変長符号に変換する可変長符号化
回路と、前記可変長符号化回路から出力された可変長符
号の符号長を1画面分累算して、総ビット数を求める符
号量計算回路とを備えて構成される。An image coding apparatus according to a fourth aspect of the present invention is the
In the image encoding apparatus according to the invention, the code amount calculation unit performs grouping of the DC coefficient difference value and grouping of the AC coefficient, and converts the difference DC coefficient into a variable-length code using the code table for the difference DC coefficient. And a variable-length coding circuit for converting the AC coefficient into a variable-length code using the AC coefficient code table, and accumulating the code length of the variable-length code output from the variable-length coding circuit for one screen. And a code amount calculation circuit for obtaining the total number of bits.
【0020】第5の発明に係る画像符号化装置は、第3
の発明の画像符号化装置において、前記符号量演算手段
は、直流係数差分値のグループ化および交流係数のグル
ープ化を行い、それらグループ化の結果から符号長を算
出する符号長算出回路と、前記符号長算出回路から出力
された可変長符号の符号長を1画面分累算して、総ビッ
ト数を求める符号量計算回路とを備えて構成される。An image coding apparatus according to a fifth aspect of the present invention has a third
In the image coding apparatus according to the invention, the code amount calculating means performs a grouping of DC coefficient difference values and a grouping of AC coefficients, and calculates a code length from a result of the grouping. A code amount calculation circuit for accumulating the code length of the variable length code output from the code length calculation circuit for one screen to obtain the total number of bits.
【0021】[0021]
実施の形態1.以下、図面を参照してこの発明の実施の
形態1による画像符号化装置について説明する。図1は
実施の形態1に係る画像符号化装置の構成を示すブロッ
ク図である。画像符号化装置の入力端子20に入力され
た、符号化しようとするデジタル画像信号は、8×8ブ
ロック化回路22に入力される。ここで二次元的に(8
×8)画素からなる画素ブロックに分割される。ブロッ
ク化回路22は、この画素ブロック単位で後段に画像信
号を送出する。DCT回路24は、このブロック化回路
22から受けた画像信号を離散コサイン変換し、周波数
領域についての(8×8)のデータマトリクスを出力す
る。即ち、表1に示すような画像データB11〜B88から
なる画素ブロックは、DCT回路24により表2に示す
ようなD11〜D88からなるデータマトリクスに変換さ
れ、ジグザグ変換回路26に供給される。Embodiment 1 FIG. Hereinafter, an image encoding device according to a first embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram illustrating a configuration of an image encoding device according to Embodiment 1. The digital image signal to be encoded, which is input to the input terminal 20 of the image encoding device, is input to the 8 × 8 blocking circuit 22. Here, two-dimensionally (8
× 8) The image is divided into pixel blocks composed of pixels. The blocking circuit 22 sends an image signal to the subsequent stage in units of the pixel blocks. The DCT circuit 24 performs a discrete cosine transform on the image signal received from the blocking circuit 22, and outputs an (8 × 8) data matrix for the frequency domain. That is, a pixel block composed of image data B 11 to B 88 as shown in Table 1 is converted into a data matrix composed of D 11 to D 88 as shown in Table 2 by the DCT circuit 24 and supplied to the zigzag conversion circuit 26. Is done.
【0022】ジグザグ変換回路26は、図4のジグザグ
変換回路10と同様の動作を行い、離散コサイン変換さ
れたデータマトリクスD11〜D88をD11,D12,D21,
D31,D22,D13,D14,D23,D32,D41…D85,D
86,D77,D68,D78,D87,D88の順で出力する。The zigzag conversion circuit 26 performs the same operation as the zigzag conversion circuit 10 shown in FIG. 4, and converts the data matrices D 11 to D 88 subjected to discrete cosine conversion into D 11 , D 12 , D 21 ,
D 31, D 22, D 13 , D 14, D 23, D 32, D 41 ... D 85, D
86, D 77, D 68, and outputs in the order of D 78, D 87, D 88 .
【0023】量子化マトリクス発生回路32は、前述の
量子化マトリクスW11〜W88を発生する。但し、実施の
形態1の画像符号化装置では、各量子化回路28a〜2
8bには、既にジグザグ走査されたデータが入力される
ので、この量子化マトリクスW11〜W88もジグザグ走査
に対応した順序で発生され、乗算器34a,34bに供
給される。乗算器34aには、スケーリング初期係数発
生回路38より制御係数の初期値として係数k1が供給
されて、(Wij×k1)が演算されて量子化回路28a
に入力される。このようにして、量子化回路28aにお
いては、この制御係数k1による量子化データR111〜
R188が得られる。この量子化されたデータR111〜R
188はビットシフト回路29に入力される。ビットシフ
ト回路29では、量子化データR111〜R188を、予め
定められたビット数m1,m2,m3,m4だけそれぞ
れ右にシフトする。The quantization matrix generation circuit 32 generates the above-described quantization matrices W 11 to W 88 . However, in the image encoding device according to the first embodiment, each of the quantization circuits 28a to 28a
The 8b, because data already zigzag scanning is input, the quantization matrix W 11 to W-88 is also generated in an order corresponding to the zigzag scanning, a multiplier 34a, is supplied to 34b. The multiplier k is supplied with the coefficient k1 as the initial value of the control coefficient from the scaling initial coefficient generation circuit 38, and calculates (W ij × k1) to the quantization circuit a.
Is input to Thus, in the quantization circuit 28a, quantized data R1 11 ~ by the control coefficient k1
R1 88 is obtained. The quantized data R1 11 to R
188 is input to the bit shift circuit 29. The bit shift circuit 29, the quantized data R1 11 ~R1 88, shifted to the right by the number of bits m1, m2, m3, m4 predetermined respectively.
【0024】ビットシフト回路29においてシフトする
ビット数m1〜m4は、この画像符号化装置が用いられ
るアプリケーション、例えば、処理対象の画像の種類、
圧縮画像の記憶装置・蓄積装置の容量等によってシフト
すべきビット数は異なる設定にする必要がある。例え
ば、実施の形態1では、シフトするビット数として−4
〜4の範囲を挙げたが、アプリケーションによってはそ
れ以外の値を取った方がよい場合もある。そこで、シス
テム側で予め実験をしてアプリケーションに応じた最適
値を求めておき、これをデフォールト値として、実行時
に適当に変更できるよう設定するよう構成してもよい。
ここで、表4〜表7は、JPEG符号化方式におけるハ
フマン符号表の一例を示している。The number of bits m1 to m4 to be shifted in the bit shift circuit 29 depends on the application in which the image encoding apparatus is used, for example, the type of image to be processed,
The number of bits to be shifted needs to be set differently depending on the capacity of the storage device and storage device of the compressed image. For example, in the first embodiment, the number of bits to be shifted is −4.
Although the range of ~ 4 has been mentioned, it may be better to take other values depending on the application. Therefore, an experiment may be performed in advance on the system side to determine an optimum value according to the application, and this may be set as a default value so that it can be appropriately changed at the time of execution.
Here, Tables 4 to 7 show examples of the Huffman code table in the JPEG encoding method.
【0025】[0025]
【表4】 [Table 4]
【0026】[0026]
【表5】 [Table 5]
【0027】[0027]
【表6】 [Table 6]
【0028】[0028]
【表7】 [Table 7]
【0029】量子化されたDCT係数のうち、直流成分
(DC係数)は、表4に従ってグループ化されて、グル
ープ番号が決定される。そのグループ番号に対して、表
5のような符号表により、可変長符号化される。このよ
うにして決まった符号語と、同一のグループ中の各DC
T係数を区別するための付加ビットとを連結させたもの
が符号化データとなる。例えば、量子化されたDC係数
差分値が“5”ならば、表4により、グループ番号
“3”が割り当てられ、付加ビットは“101”とな
る。表5より、グループ番号3の符号語は“100”と
なる。従って、この場合の符号化データは、“1001
01”となる。量子化されたDCT係数のうち、交流成
分(AC係数)は、表6に従ってグループ化されて、グ
ループ番号が決定される。量子化出力が0でない有意係
数は、そのグループ番号と、直前の有意係数との間に挟
まれた量子化出力が0の無効係数のラン長との組に対し
て、表7のような符号表により、可変長符号化される。
このようにして決まった符号語と、同一のグループ中の
各DCT係数を区別するための付加ビットとを連結させ
たものが符号化データとなる。Among the quantized DCT coefficients, DC components (DC coefficients) are grouped according to Table 4, and a group number is determined. The group number is subjected to variable length coding according to a code table as shown in Table 5. The codeword determined in this way and each DC in the same group
The coded data is obtained by linking the additional coefficient for distinguishing the T coefficient with the additional bit. For example, if the quantized DC coefficient difference value is “5”, the group number “3” is assigned according to Table 4, and the additional bit is “101”. From Table 5, the code word of group number 3 is “100”. Therefore, the encoded data in this case is “1001”
01 ". Among the quantized DCT coefficients, AC components (AC coefficients) are grouped according to Table 6, and a group number is determined. A significant coefficient whose quantized output is not 0 is the group number. A variable length encoding is performed by a code table as shown in Table 7 for a set of a null coefficient and a run length of an invalid coefficient sandwiched between the immediately preceding significant coefficient and a null output.
Coded data obtained by concatenating the code word determined in this way and additional bits for distinguishing each DCT coefficient in the same group is used.
【0030】例えば、量子化されたAC係数値が“2”
で、無効係数のラン長が“1”ならば、表6により、グ
ループ番号“2”が割り当てられ、付加ビットは“1
0”となる。表7より、ラン長1でグループ番号2の符
号語は“11011”となる。従って、この場合の符号
化データは、“1101110”となる。このような仕
組みで符号化されるので、DC係数の場合は、グループ
番号が決まると、符号化データ量(符号語のビット数+
付加ビット数)は一意に決まる。AC係数の場合は、無
効係数のラン長とグループ番号の組み合わせが決まる
と、符号化データ量は一意に決まる。いずれにせよ、総
ビット数(符号化データ量の総和)を求める際には、D
CT係数値自体は重要ではなく、グループ番号(及びA
C係数の無効係数のラン長)が分かれば良い。この実施
の形態1では、ビットシフト回路29によりシフトされ
るビット数(m1,m2,m3,m4)として、4、
3、2、1、0、−1、−2、−3、−4の値を取り得
る。ビットシフト回路29によりシフトされるビット数
が、4、3、2または1の場合、量子化出力が、それぞ
れ、1/16倍、1/8倍、1/4倍または1/2倍さ
れる。つまり、スケーリング係数を、それぞれ、16
倍、8倍、4倍または2倍したときと同一の量子化出力
が得られ、グループ番号も、それぞれ、同一のものとな
る。For example, if the quantized AC coefficient value is "2"
If the run length of the invalid coefficient is “1”, the group number “2” is assigned according to Table 6, and the additional bit is “1”.
According to Table 7, the codeword of the run number 1 and the group number 2 is “11011.” Therefore, the encoded data in this case is “1101110.” The encoding is performed by such a mechanism. Therefore, in the case of the DC coefficient, when the group number is determined, the encoded data amount (the number of bits of the codeword +
The number of additional bits) is uniquely determined. In the case of the AC coefficient, when the combination of the run length of the invalid coefficient and the group number is determined, the encoded data amount is uniquely determined. In any case, when calculating the total number of bits (sum of the amount of encoded data), D
The CT coefficient value itself is not important and the group number (and A
What is necessary is just to know the run length of the invalid coefficient of the C coefficient). In the first embodiment, the number of bits (m1, m2, m3, m4) shifted by the bit shift circuit 29 is 4,
Values of 3, 2, 1, 0, -1, -2, -3, -4 can be taken. When the number of bits shifted by the bit shift circuit 29 is 4, 3, 2, or 1, the quantized output is multiplied by 1/16, 1/8, 1/4, or 1/2, respectively. . That is, the scaling factor is set to 16
The same quantized output as when multiplying by 8, 8, 4 or 2 times is obtained, and the group numbers are also the same.
【0031】ビットシフト回路29によりシフトされる
ビット数が、−4、−3、−2または−1の場合、量子
化出力が、それぞれ、16倍、8倍、4倍または2倍さ
れる。この場合、スケーリング係数を、それぞれ、1/
16倍、1/8倍、1/4倍または1/2倍したときと
同一の量子化出力が得られるとは限らないが、グループ
番号は、それぞれ、同一のものとなる。ビットシフト回
路29によりシフトされるビット数が、0の場合、量子
化出力がそのまま得られる。これは、スケーリング係数
をそのまま用いたときの量子化出力に相当する。When the number of bits shifted by the bit shift circuit 29 is -4, -3, -2 or -1, the quantized output is multiplied by 16 times, 8 times, 4 times or 2 times, respectively. In this case, the scaling factors are 1 /
Although the same quantized output is not always obtained when the multiplication is performed by 16 times, 1/8 times, 1/4 times or 1/2 times, the group numbers are the same. When the number of bits shifted by the bit shift circuit 29 is 0, a quantized output is obtained as it is. This corresponds to a quantized output when the scaling coefficient is used as it is.
【0032】このように、ビットシフト回路29によ
り、スケーリング係数を様々に変えて複数の量子化器で
相異なる量子化ステップサイズを用いて量子化を行った
場合と実質的に同等の効果が得られる。As described above, the bit shift circuit 29 provides substantially the same effect as the case where quantization is performed by changing the scaling factor in various ways and using different quantization step sizes in a plurality of quantizers. Can be
【0033】ビットシフト回路29によりそれぞれm
1、m2、m3、m4ビット右シフトされたデータは並
列にVLC回路36a〜36dに入力され、可変長符号
化が行われる。VLC回路36a〜36dの出力は、符
号量計算回路40a〜40dに入力され、可変長符号デ
ータが1画面分累算されて、総ビット数b1〜b4が求
められる。総ビット数b1〜b4は、係数更新回路42
に入力される。ここで、VLC回路36a〜36dおよ
び符号量計算回路40a〜40dは、それぞれのシフト
データに対応するデータ量を得るために、複数のシフト
データをエントロピー符号化して可変長符号を割り付け
て符号化した際のデータ量を画分単位で演算する符号量
演算手段61を構成する。遅延回路44は、初期係数発
生回路38が出力した初期係数k1を1画面(フレー
ム)期間遅延する。これにより、初期係数k1に対応す
る総ビット数b1〜b4と初期係数k1とが同一のタイ
ミングで係数更新回路42に入力される。係数更新回路
42は、総ビット数b1〜b4のうち所望の総ビット数
nb0未満で最もnb0に近い情報を検知する。その情
報のビットシフト回路29におけるビットシフト量がm
のとき、初期係数k1をmビット左シフトしたものを制
御係数k2として出力する。The bit shift circuit 29 outputs m
The data shifted right by 1, m2, m3, and m4 bits are input in parallel to the VLC circuits 36a to 36d, where variable length coding is performed. The outputs of the VLC circuits 36a to 36d are input to code amount calculation circuits 40a to 40d, and the variable length code data is accumulated for one screen to obtain the total bit numbers b1 to b4. The total bit numbers b1 to b4 are calculated by the coefficient update circuit 42.
Is input to Here, the VLC circuits 36a to 36d and the code amount calculation circuits 40a to 40d perform entropy coding of a plurality of shift data and assign and assign a variable length code to obtain a data amount corresponding to each shift data. The code amount calculation means 61 for calculating the data amount at the time of the calculation on a fraction basis is configured. The delay circuit 44 delays the initial coefficient k1 output from the initial coefficient generation circuit 38 by one screen (frame) period. Accordingly, the total bit numbers b1 to b4 corresponding to the initial coefficient k1 and the initial coefficient k1 are input to the coefficient updating circuit 42 at the same timing. The coefficient updating circuit 42 detects information that is less than the desired total bit number nb0 and is closest to nb0 among the total bit numbers b1 to b4. The bit shift amount of the information in the bit shift circuit 29 is m
In this case, the initial coefficient k1 is shifted to the left by m bits and output as the control coefficient k2.
【0034】一方、遅延回路30は、ジグザグ変換回路
26の出力を1画面(フレーム)期間遅延する回路であ
る。係数更新回路42の出力する制御係数k2は、この
制御係数k2を得るために用いた1画面分の変換データ
が、量子化回路28bに入力されるタイミングで乗算器
34bに入力される。ここで、ジグザグ変換回路26の
出力を分岐するノードと遅延回路30は、画像情報を周
波数領域に変換して得た変換データを相互に1画面分の
遅延を持つ2つの変換データに分岐して並列に出力する
並列化手段60を構成する。乗算器34bでは、(Wij
×k2)が演算されて、量子化回路28bに入力され
る。即ち、量子化回路28bでは、同一の画面について
最終的な量子化が行われる。この量子化データは、VL
C回路36eに供給される。VLC回路36eは、実際
の可変長符号化を行い、符号化データを出力端子50か
ら出力する。この乗算器34bと量子化回路28bとV
LC回路36eは、スケーリング係数更新回路42の出
力する制御係数k2を用いて遅延回路30が出力する変
換データを量子化し、エントロピー符号化により変換デ
ータを符号化した可変長符号を出力する符号化手段62
を構成する。On the other hand, the delay circuit 30 is a circuit for delaying the output of the zigzag conversion circuit 26 by one screen (frame) period. The control coefficient k2 output from the coefficient update circuit 42 is input to the multiplier 34b at the timing when the conversion data for one screen used to obtain the control coefficient k2 is input to the quantization circuit 28b. Here, the node that branches the output of the zigzag conversion circuit 26 and the delay circuit 30 branch the conversion data obtained by converting the image information into the frequency domain into two conversion data having a delay of one screen with respect to each other. The parallelizing means 60 for outputting in parallel is constituted. In the multiplier 34b, (W ij
× k2) is calculated and input to the quantization circuit 28b. That is, the quantization circuit 28b performs final quantization on the same screen. This quantized data is VL
It is supplied to the C circuit 36e. The VLC circuit 36e performs actual variable-length encoding, and outputs encoded data from the output terminal 50. This multiplier 34b, quantization circuit 28b and V
The LC circuit 36e quantizes the converted data output from the delay circuit 30 using the control coefficient k2 output from the scaling coefficient updating circuit 42, and outputs a variable length code obtained by coding the converted data by entropy coding. 62
Is configured.
【0035】上述のような構成によれば、制御係数kの
最適値を求める際に、単一の量子化回路28aしか用い
なくて済み、小規模回路で極めて高速に処理可能とな
る。また、符号化後の総ビット数nbは、所望の総ビッ
ト数nb0未満で極めてこのnb0に近い値となる。According to the above-described configuration, only the single quantization circuit 28a needs to be used when obtaining the optimum value of the control coefficient k, and the processing can be performed at extremely high speed with a small-scale circuit. The total number of bits nb after encoding is less than the desired total number of bits nb0 and extremely close to nb0.
【0036】実施の形態2.実施の形態1の画像符号化
装置は、VLC回路36a〜36dで可変長符号化を行
ったが、総ビット数を求める際には実際の符号化を行う
必要はないので、VLC回路36a〜36dを、符号化
データ量のみを算出する符号長算出回路37a〜37d
に置き換えた構成とすることも可能である。図2はこの
発明の実施の形態2に係る画像符号化装置の構成を示す
ブロック図である。符号長算出回路37a〜37dは、
それぞれビットシフト回路29によりm1〜m4ビット
右シフトされた変換データを入力し、入力した変換デー
タについてDC係数差分値のグループ化、およびAC係
数のグループ化を行い、符号長を算出する。実施の形態
2による画像符号化装置は、符号長算出回路37a〜3
7dを用いているので、実施の形態1の画像符号化装置
がVLC回路36a〜36dを用いるのに比べて回路構
成が簡単になる。Embodiment 2 In the image encoding apparatus according to the first embodiment, the VLC circuits 36a to 36d perform variable-length encoding. However, it is not necessary to perform actual encoding when calculating the total number of bits. To code length calculation circuits 37a to 37d for calculating only the encoded data amount
It is also possible to adopt a configuration replaced with FIG. 2 is a block diagram showing a configuration of an image encoding device according to Embodiment 2 of the present invention. The code length calculation circuits 37a to 37d
Each of the conversion data shifted right by m1 to m4 bits by the bit shift circuit 29 is input, and the input conversion data is grouped into DC coefficient difference values and AC coefficients to calculate a code length. The image encoding device according to the second embodiment includes code length calculation circuits 37a to 37a.
Since 7d is used, the circuit configuration is simplified as compared with the case where the image coding apparatus according to the first embodiment uses the VLC circuits 36a to 36d.
【0037】実施の形態3.実施の形態1の画像符号化
装置は、初期係数k1と量子化マトリクスWとを乗算し
て量子化回路28aにおける量子化値を算出したが、初
期係数k1=1として乗算器34aを削除して量子化マ
トリクスの値をそのまま用いて量子化回路28aで量子
化を行うようにした構成も可能である。例えば、実施の
形態1の画像符号化装置が係数k1=4という条件で符
号化を行っているとすると、乗算器34aで量子化マト
リクスWに対し係数k1が乗算され、量子化回路28a
における量子化係数は、量子化マトリクスWの各値を4
倍した値となる。すなわち、量子化マトリクスの各要素
W11×4,W12×4,…で、ジグザグ変換後のDCT係
数を割り算する。ここで、係数k1=4とした実施の形
態1の画像符号化装置と同じ結果を得るには、この時の
実施の形態3の画像符号化装置は、ビットシフト回路2
9で、この時の実施の形態1の画像符号化装置より2ビ
ットだけ多く右シフトする。ビットシフト回路29で、
2ビット右シフトすることは、4で割り算することと等
価である。これにより、実施の形態1の画像符号化装置
から乗算器34aを削除して回路規模を削減できる。こ
の様子を図3に示す。図3は、この発明の実施の形態3
に係る画像符号化装置の構成を示すブロック図である。Embodiment 3 The image coding apparatus according to the first embodiment calculates the quantization value in the quantization circuit 28a by multiplying the initial coefficient k1 by the quantization matrix W, but deletes the multiplier 34a as the initial coefficient k1 = 1. It is also possible to adopt a configuration in which the quantization circuit 28a performs quantization using the value of the quantization matrix as it is. For example, if the image encoding apparatus according to the first embodiment performs encoding under the condition that the coefficient k1 = 4, the multiplier 34a multiplies the quantization matrix W by the coefficient k1, and the quantization circuit 28a
, The respective values of the quantization matrix W are 4
The value is multiplied. That is, the DCT coefficients after the zigzag transformation are divided by the respective elements W 11 × 4, W 12 × 4,... Of the quantization matrix. Here, in order to obtain the same result as that of the image encoding device of the first embodiment in which the coefficient k1 = 4, the image encoding device of the third embodiment at this time uses the bit shift circuit 2
At 9, the image is right-shifted by two bits more than the image coding apparatus of the first embodiment. In the bit shift circuit 29,
Shifting right by two bits is equivalent to dividing by four. As a result, the circuit size can be reduced by eliminating the multiplier 34a from the image encoding device according to the first embodiment. This is shown in FIG. FIG. 3 shows Embodiment 3 of the present invention.
1 is a block diagram illustrating a configuration of an image encoding device according to.
【0038】なお、実施の形態1の画像符号化装置は、
係数k1の値が2のべき乗でない場合には、実施の形態
3の画像符号化装置で全く同じ結果を得ることはできな
い。しかし、実施の形態1の画像符号化装置も実施の形
態3の画像符号化装置も画像に応じて量子化マトリクス
のスケーリング係数を適性化することを目的としてお
り、乗算器34bで量子化マトリクスに乗じた値を用い
て最終的な量子化を量子化回路28bで行うので、デー
タ量を適当にするという目的に対し同様の効果を得るこ
とができる。スケーリング係数更新回路42は、上記各
実施の形態では、所望のデータ量に最も近いデータ量情
報得るため制御係数を発生するよう構成されていたが、
所望のデータ量を僅かに上回るが、所望のデータ量に最
も近いデータ量情報が得られるように制御係数を設定す
るよう構成されていてもよく、上記各実施の形態と同様
の効果を奏する。Note that the image coding apparatus according to the first embodiment
If the value of the coefficient k1 is not a power of 2, the same result cannot be obtained by the image encoding device of the third embodiment. However, both the image coding apparatus according to the first embodiment and the image coding apparatus according to the third embodiment aim at optimizing the scaling coefficient of the quantization matrix according to the image. Since the final quantization is performed by the quantization circuit 28b using the multiplied value, the same effect can be obtained for the purpose of optimizing the data amount. In each of the above embodiments, the scaling coefficient update circuit 42 is configured to generate a control coefficient to obtain data amount information closest to a desired data amount.
The control coefficient may be set so that data amount information slightly exceeding the desired data amount but closest to the desired data amount may be obtained, and the same effects as those of the above embodiments can be obtained.
【0039】また、上記各実施の形態では、可変長符号
化後のデータ量を計算するのに1画面分のデータ量を計
算したが、例えば、1画面分より少なくてもまた、多く
てもよく、そこから1画面分のデータ量を推定してよ
く、上記実施の形態と同様の効果を奏する。Further, in each of the above embodiments, the data amount for one screen is calculated to calculate the data amount after the variable length coding. For example, the data amount may be smaller or larger than one screen. From there, the data amount for one screen may be estimated, and the same effect as in the above embodiment can be obtained.
【0040】[0040]
【発明の効果】以上説明したように、請求項1記載の発
明の画像符号化装置によれば、シフト手段によって第1
の量子化手段が出力するデータを複数種類の所定ビット
数だけシフトし、乗算器等を用いず、第1の量子化手段
が一つであるにも係わらず複数のシフトデータを得るこ
とができ、符号化手段が所定時間の遅延で適切な制御係
数を用いて符号変換を行って可変長符号を出力するよう
構成されているので、画面全域に最適な符号化を行い、
かつ、所定期間毎のデータ量を適正化する処理を、小規
模回路で高速に処理することができるという効果があ
る。As described above, according to the image encoding apparatus of the first aspect, the first means is provided by the shift means.
, The data output by the quantizing means is shifted by a predetermined number of bits of a plurality of types, and a plurality of shifted data can be obtained without using a multiplier or the like, even though the first quantizing means is one. Since the encoding means is configured to perform code conversion using an appropriate control coefficient with a delay of a predetermined time and output a variable length code, perform optimal encoding over the entire screen,
In addition, there is an effect that processing for optimizing the data amount for each predetermined period can be performed at high speed by a small-scale circuit.
【0041】請求項2記載の発明の画像符号化装置によ
れば、遅延回路によりスケーリング初期係数発生回路が
出力した制御係数の初期値を所定時間遅延させるよう構
成されているので、所定の時間の遅延で符号化すること
ができ、高速に処理することができるという効果があ
る。According to the image coding apparatus of the present invention, since the initial value of the control coefficient output from the scaling initial coefficient generation circuit is delayed by the delay circuit for the predetermined time, There is an effect that encoding can be performed with delay and processing can be performed at high speed.
【0042】請求項3記載の発明の画像符号化装置によ
れば、係数更新手段によって更新された制御係数を用い
れば、符号化後の1画面分のデータ量が常に所望のデー
タ量より少なくなり、取り扱いが簡単な画像符号化装置
を得ることができるという効果がある。According to the image coding apparatus of the third aspect of the present invention, when the control coefficient updated by the coefficient updating means is used, the data amount of one screen after the encoding is always smaller than the desired data amount. In addition, there is an effect that an image encoding device that can be easily handled can be obtained.
【0043】請求項4記載の発明の画像符号化装置によ
れば、従来からある可変長符号化回路および符号量計算
回路を用いて符号量演算手段を容易に実現できるという
効果がある。According to the image coding apparatus of the fourth aspect, there is an effect that the code amount calculating means can be easily realized by using the conventional variable length coding circuit and code amount calculation circuit.
【0044】請求項5記載の発明の画像符号化装置によ
れば、符号長算出回路は、直流係数差分値のグループ化
および交流係数のグループ化を行い、それらグループ化
の結果から符号長を算出し、差分直流係数や交流係数を
可変長符号に変換しないので、画像符号化装置の回路規
模を小さくできるという効果がある。According to the image coding apparatus of the present invention, the code length calculating circuit performs grouping of DC coefficient difference values and grouping of AC coefficients, and calculates a code length from the grouping result. However, since the difference DC coefficient or AC coefficient is not converted into a variable length code, the circuit scale of the image encoding device can be reduced.
【図1】 この発明の実施の形態1に係る画像符号化装
置の構成を示すブロック図である。FIG. 1 is a block diagram illustrating a configuration of an image encoding device according to Embodiment 1 of the present invention.
【図2】 この発明の実施の形態2に係る画像符号化装
置の構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of an image encoding device according to Embodiment 2 of the present invention.
【図3】 図3は、この発明の実施の形態3に係る画像
符号化装置の構成を示すブロック図である。FIG. 3 is a block diagram showing a configuration of an image encoding device according to Embodiment 3 of the present invention.
【図4】 従来の画像符号化装置の構成の第1の例を示
すブロック図である。FIG. 4 is a block diagram illustrating a first example of a configuration of a conventional image encoding device.
【図5】 従来の画像符号化装置の構成の第2の例を示
すブロック図である。FIG. 5 is a block diagram illustrating a second example of the configuration of a conventional image encoding device.
【図6】 従来の画像符号化装置の構成の第3の例を示
すブロック図である。FIG. 6 is a block diagram illustrating a third example of the configuration of a conventional image encoding device.
【図7】 従来の画像符号化装置の構成の第3の例を示
すブロック図である。FIG. 7 is a block diagram illustrating a third example of the configuration of a conventional image encoding device.
22 8×8ブロック化回路、24 DCT回路、26
ジグザグ変換回路、28a,28b 量子化回路、2
9 ビットシフト回路、30,44 遅延回路、32
量子化マトリックス発生回路、34a,34b 乗算
器、36a〜36e 可変長符号化回路、37a〜37
d 符号長算出回路、38 スケーリング初期係数発生
回路、40a〜40d 符号量計算回路、42 スケー
リング係数更新回路、60 並列化手段、61,63
符号量演算手段、62 符号化手段。22 8 × 8 block circuit, 24 DCT circuit, 26
Zigzag conversion circuit, 28a, 28b quantization circuit, 2
9-bit shift circuit, 30, 44 delay circuit, 32
Quantization matrix generation circuit, 34a, 34b multiplier, 36a-36e variable length coding circuit, 37a-37
d code length calculation circuit, 38 scaling initial coefficient generation circuit, 40a to 40d code amount calculation circuit, 42 scaling coefficient update circuit, 60 parallelizing means, 61, 63
Code amount calculation means, 62 coding means.
Claims (5)
1の変換データおよび該第1の変換データに対し所定時
間遅延した第2の変換データを並列に出力する並列化手
段と、 制御係数の初期値を用いて前記第1の変換データを量子
化する量子化手段と、 前記第1の量子化手段で量子化されたデータを複数種類
の所定ビット数だけシフトし、複数のシフトデータを並
列に出力するシフト手段と、 前記複数のシフトデータを可変長符号化した際のデータ
量を、前記所定時間分だけ演算して複数のデータ量情報
を出力する符号量演算手段と、 前記複数のデータ量情報に応じて、データ量を所望のデ
ータ量に近づけるため量子化ステップを画面単位で制御
する制御係数を初期値より最適な値に更新する係数更新
手段と、 前記係数更新手段の出力する制御係数を用いて前記第2
の変換データを量子化し、符号化して得た可変長符号を
出力する符号化手段とを備える、画像符号化装置。1. parallelizing means for outputting in parallel first converted data obtained by converting image information into a frequency domain and second converted data delayed by a predetermined time with respect to the first converted data; Quantizing means for quantizing the first transformed data using an initial value of a coefficient; and shifting the data quantized by the first quantizing means by a plurality of types of predetermined number of bits to obtain a plurality of shifted data. Shift means for outputting a plurality of pieces of shift amount data in parallel, code amount calculating means for calculating a data amount when the plurality of pieces of shift data are variable-length encoded for the predetermined time, and outputting a plurality of pieces of data amount information, A coefficient updating unit that updates a control coefficient that controls a quantization step on a screen basis in order to bring the data amount closer to a desired data amount to an optimal value from an initial value, according to the data amount information of Do Using said control coefficients second
Encoding means for quantizing the converted data and outputting a variable-length code obtained by encoding.
リング初期係数発生回路と、 前記スケーリング初期係数発生回路が出力した前記制御
係数の初期値を前記所定時間遅延させる遅延回路とをさ
らに備える、請求項1記載の画像符号化装置。2. The apparatus according to claim 1, further comprising: a scaling initial coefficient generating circuit for generating an initial value of the control coefficient; and a delay circuit for delaying the initial value of the control coefficient output from the scaling initial coefficient generating circuit for the predetermined time. Item 7. The image encoding device according to Item 1.
を含み、 前記係数更新手段は、 前記複数のデータ量情報の中から所望のデータ量より少
なく、かつ、該所望のデータ量に最も近いデータ量情報
を検出し、最も近い該データ量情報を得た時に前記シフ
ト手段においてシフトしたビット数に対応する値に制御
係数を変更することを特徴とする、請求項1または請求
項2記載の画像符号化装置。3. The method according to claim 2, wherein the predetermined time includes a time corresponding to one screen, and wherein the coefficient updating unit determines that the desired data amount is smaller than a desired data amount among the plurality of data amount information. The control coefficient is changed to a value corresponding to the number of bits shifted by the shift means when the closest data amount information is obtained and the closest data amount information is obtained. Image encoding device.
化を行うとともに、差分直流係数用符号表を用いて差分
直流係数を可変長符号に変換し、交流係数用符号表を用
いて交流係数を可変長符号に変換する可変長符号化回路
と、 前記可変長符号化回路から出力された可変長符号の符号
長を1画面分累算して、総ビット数を求める符号量計算
回路とを備える、請求項3記載の画像符号化装置。4. The code amount calculating means performs grouping of DC coefficient difference values and grouping of AC coefficients, and converts a difference DC coefficient into a variable length code using a code table for a difference DC coefficient. A variable-length encoding circuit that converts AC coefficients into a variable-length code using a coefficient code table; and accumulates the code length of the variable-length code output from the variable-length encoding circuit for one screen to obtain total bits. 4. The image encoding apparatus according to claim 3, further comprising a code amount calculation circuit for calculating the number.
化を行い、それらグループ化の結果から符号長を算出す
る符号長算出回路と、 前記符号長算出回路から出力された可変長符号の符号長
を1画面分累算して、総ビット数を求める符号量計算回
路とを備える、請求項3記載の画像符号化装置。5. A code length calculation circuit for performing grouping of DC coefficient difference values and grouping of AC coefficients, and calculating a code length from a result of the grouping; 4. The image coding apparatus according to claim 3, further comprising: a code amount calculating circuit for accumulating the code length of the variable length code output from the one screen for one screen to obtain a total bit number.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20376996A JPH1051776A (en) | 1996-08-01 | 1996-08-01 | Image coding device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20376996A JPH1051776A (en) | 1996-08-01 | 1996-08-01 | Image coding device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH1051776A true JPH1051776A (en) | 1998-02-20 |
Family
ID=16479516
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP20376996A Pending JPH1051776A (en) | 1996-08-01 | 1996-08-01 | Image coding device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH1051776A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1294197A4 (en) * | 2000-05-23 | 2004-11-24 | Matsushita Electric Industrial Co Ltd | VARIABLE LENGTH ENCODING METHOD AND VARIABLE LENGTH ENCODER |
| US7468803B2 (en) | 2002-02-21 | 2008-12-23 | Canon Kabushiki Kaisha | Image processing apparatus and image processing method |
-
1996
- 1996-08-01 JP JP20376996A patent/JPH1051776A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1294197A4 (en) * | 2000-05-23 | 2004-11-24 | Matsushita Electric Industrial Co Ltd | VARIABLE LENGTH ENCODING METHOD AND VARIABLE LENGTH ENCODER |
| US7468803B2 (en) | 2002-02-21 | 2008-12-23 | Canon Kabushiki Kaisha | Image processing apparatus and image processing method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4859368B2 (en) | High-speed codec with minimum required resources providing a high compression ratio | |
| RU2479942C2 (en) | Image processing device and image processing method | |
| JP3109854B2 (en) | Image coding method and apparatus | |
| US9049421B2 (en) | System and method for using pattern vectors for video and image coding and decoding | |
| US7132964B2 (en) | Coding apparatus, program and data processing method | |
| JPH0491587A (en) | Orthogonal transformation encoder | |
| JPH0595536A (en) | High efficiency coded signal processor | |
| JPH05276501A (en) | Method for variable-length-compressing adaptive video and device therefor | |
| JP2003032677A (en) | Video compression encoding device | |
| US5822000A (en) | Video encoding using rearrangement of transform coefficients and inter-block correlation | |
| JP3163880B2 (en) | Image compression coding device | |
| JPH06350854A (en) | Picture compression encoding device | |
| JPH1051776A (en) | Image coding device | |
| JPH11215499A (en) | Image coding device | |
| KR0165405B1 (en) | Bit rate control device of variable length code using neural circuit | |
| JP3143487B2 (en) | Image processing device | |
| JP2820807B2 (en) | Image data encoding method | |
| JP3232160B2 (en) | Encoding device and method | |
| US7720300B1 (en) | System and method for effectively performing an adaptive quantization procedure | |
| JPH01267781A (en) | Method for compressing multilevel image data | |
| JP3135271B2 (en) | Encoding device | |
| JP2938653B2 (en) | Quantizer in video coding device | |
| JPH0310486A (en) | Video encoding device | |
| JPH03252284A (en) | Data compressor | |
| JP3016805B2 (en) | Image data compression method |