JPH10164588A - Video-signal encoding method, video-signal encoder and recording medium - Google Patents

Video-signal encoding method, video-signal encoder and recording medium

Info

Publication number
JPH10164588A
JPH10164588A JP33044196A JP33044196A JPH10164588A JP H10164588 A JPH10164588 A JP H10164588A JP 33044196 A JP33044196 A JP 33044196A JP 33044196 A JP33044196 A JP 33044196A JP H10164588 A JPH10164588 A JP H10164588A
Authority
JP
Japan
Prior art keywords
video unit
video
parameter
encoded
code 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
Application number
JP33044196A
Other languages
Japanese (ja)
Inventor
Takuya Kitamura
卓也 北村
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.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP33044196A priority Critical patent/JPH10164588A/en
Publication of JPH10164588A publication Critical patent/JPH10164588A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To perform quantization control, capable of facing a variable rate encoding system by calculating an average encoding data speed per second video unit for each first video unit and calculating a first parameter by using it. SOLUTION: This video signal encoder 1 calculates the average encoding data speed per frame in a GOP for each GOP and calculates the first parameter (r) by using it. Thus, the first parameter (r) can be changed, corresponding to the average encoding speed in the respective GOPs. Also, the video signal encoder 1 uses an average quantization step, updated for each GOP with the average value of reference quantization steps Q for respective images in the GOP, one which precedes time-wise the GOP defined as a present encoding object as an initial value and calculates the filling degree of a virtual buffer as a third parameter used at the time of calculating a quantization step Q for each macro-block for each image type in the GOP.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【目次】【table of contents】

以下の順序で本発明を説明する。 発明の属する技術分野 従来の技術 発明が解決しようとする課題 課題を解決するための手段 発明の実施の形態 (1)全体構成(図1) (2−1)量子化制御部の構成(図2〜図5) (2−2)実施例の動作及び効果 (3)第3実施例(図6) 発明の効果 The present invention will be described in the following order. Technical Field to which the Invention pertains Related Art Problems to be Solved by the Invention Means for Solving the Problems Embodiments of the Invention (1) Overall Configuration (FIG. 1) (2-1) Configuration of Quantization Control Unit (FIG. 2) (FIG. 5) FIG. 5 (2-2) Operation and Effect of Embodiment (3) Third Embodiment (FIG. 6) Effect of the Invention

【0002】[0002]

【発明の属する技術分野】本発明は映像信号符号化方
法、映像信号符号化装置及び記録媒体に関し、特にデイ
ジタル映像信号を所定の映像単位毎に可変レートで符号
化する映像信号符号化方法及び映像信号符号化装置に適
用し得る。また量子化制御アルゴリズムをプログラムと
して有する記録媒体に適用し得る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a video signal encoding method, a video signal encoding device and a recording medium, and more particularly to a video signal encoding method and a video signal for encoding a digital video signal at a variable rate for each predetermined video unit. It can be applied to a signal encoding device. Further, the present invention can be applied to a recording medium having a quantization control algorithm as a program.

【0003】[0003]

【従来の技術】従来、映像信号をデイジタル化して所定
の記録媒体に記録し又は伝送する場合、データ量が膨大
となるためデータを符号化(圧縮)している。代表的な
符号化方式として動き補償予測符号化が知られている。
この動き補償予測符号化は、映像信号の時間軸方向の相
関を利用する方法であり、既に復号再生されている映像
信号より現在の符号化対象の動き情報(動きベクトル)
を推定し、復号されている映像信号を信号の動きに合わ
せて移動させ、この動きベクトルとその時の予測残差を
伝送することにより、符号化に必要な情報量を圧縮する
方法である。
2. Description of the Related Art Conventionally, when a video signal is digitized and recorded or transmitted on a predetermined recording medium, the data amount is enormous, so that the data is encoded (compressed). Motion-compensated predictive coding is known as a typical coding method.
This motion compensation prediction coding is a method using the correlation in the time axis direction of the video signal, and the current coding target motion information (motion vector) is obtained from the video signal which has already been decoded and reproduced.
, The decoded video signal is moved in accordance with the motion of the signal, and the motion vector and the prediction residual at that time are transmitted, thereby compressing the amount of information necessary for encoding.

【0004】この動き補償予測符号化の代表的なものと
して、MPEG(Moving Picture Expert Group )が知
られている。このMPEG方式は、1画像(1フレーム
又は1フイールド)を16×16画素で構成されるマクロブ
ロツクと呼ばれるブロツクに分割し、このブロツク単位
で動き補償予測符号化を行う。この動き補償予測符号化
には、イントラ符号化及び非イントラ符号化の2つの方
法がある。イントラ符号化は自らのマクロブロツクの情
報だけを用いる符号化方法であり、非イントラ符号化は
自らのマクロブロツクの情報と他の時刻に現れる画像よ
り得た情報との双方の情報を用いる符号化方法である。
As a typical example of the motion compensation prediction coding, MPEG (Moving Picture Expert Group) is known. According to the MPEG method, one image (one frame or one field) is divided into blocks called macroblocks composed of 16 × 16 pixels, and motion compensation prediction coding is performed in units of these blocks. There are two methods of this motion compensation predictive coding: intra coding and non-intra coding. Intra coding is a coding method that uses only the information of its own macro block, and non-intra coding is a coding method that uses both information of its own macro block and information obtained from an image appearing at another time. Is the way.

【0005】MPEG方式は、各フレームを3つの画像
符号化タイプ(以下、これを画像タイプと呼ぶ)、すな
わちIピクチヤ(intra coded picture )、Pピクチヤ
(predictive coded picture)又はBピクチヤ(bidire
ctionally predictive codedpicture)のいずれかの画
像タイプのピクチヤとして符号化する。Iピクチヤの画
像信号は、その1フレーム分の画像信号がそのまま符号
化されて伝送される。Pピクチヤの画像信号は、当該P
ピクチヤより時間的に過去にあるIピクチヤ又はPピク
チヤの画像信号との差分が符号化されて伝送される。B
ピクチヤは、時間的に過去にあるPピクチヤ若しくはI
ピクチヤ又は時間的に未来にあるPピクチヤ若しくはI
ピクチヤのいずれかのピクチヤとの差分が符号化されて
伝送されるか、又は時間的に過去及び未来にあるIピク
チヤ又はPピクチヤの双方のピクチヤとの差分が符号化
されて伝送される。
In the MPEG system, each frame has three image coding types (hereinafter, referred to as image types), namely, I-picture (intra coded picture), P-picture (predictive coded picture), or B-picture (bidire).
Encoding as a picture of one of the image types (ctionally predictive coded picture). As for the I-picture image signal, the image signal for one frame is directly encoded and transmitted. The image signal of the P picture is
The difference from the I-picture or P-picture image signal that is temporally earlier than the picture is encoded and transmitted. B
The picture is a P picture or I
Picture or P picture or I in the future in time
The difference between any of the pictures and one of the pictures is encoded and transmitted, or the difference between the pictures in the past and future in both the I and P pictures is encoded and transmitted.

【0006】このように映像信号符号化装置において符
号化されたデータ(ビツトストリーム)は固定ビツトレ
ートで出力され、所定の記録媒体に記録され又はデイジ
タル映像信号復号装置に伝送される。
The data (bit stream) coded by the video signal coding apparatus is output at a fixed bit rate and recorded on a predetermined recording medium or transmitted to a digital video signal decoding apparatus.

【0007】[0007]

【発明が解決しようとする課題】ところで映像信号に
は、動きが激しい絵柄であるために圧縮符号化に向かな
い画像と、圧縮符号化を非常に簡単に行うことができる
静止画に近いような画像が含まれている。従つて映像信
号を固定レートで符号化すると、複雑な絵柄の画質が大
幅に劣化することになる。
By the way, a video signal has an image which is not suitable for compression encoding because of a pattern which moves rapidly, and a video signal which is similar to a still image which can perform compression encoding very easily. Images are included. Therefore, if a video signal is encoded at a fixed rate, the image quality of a complicated picture will be significantly degraded.

【0008】そこで複雑な絵柄に割り当てる符号量を多
くし、簡単な絵柄に割り当てる符号量を少なくすること
より、平均のビツトレートが低くても映像信号全体とし
て高画質を実現するようにした可変レート符号化方式と
呼ばれる符号化方法が提案されている。この可変レート
符号化方式は、読出し速度を自由に調整できるような記
録媒体、例えばデイジタルビデオデイスク(Digital Vi
deo Disk、DVD)で用いることができる。
[0008] Therefore, by increasing the amount of code allocated to a complicated pattern and reducing the amount of code allocated to a simple pattern, a variable-rate code capable of realizing high picture quality as a whole video signal even when the average bit rate is low. An encoding method called an encoding method has been proposed. This variable rate coding system uses a recording medium such as a digital video disk (Digital Video Disk) that can freely adjust the reading speed.
deo Disk, DVD).

【0009】従つてこの可変レート符号化方式を用いる
場合には、入力される映像信号の圧縮の難しさ(すなわ
ち絵柄の複雑さや動きの激しさ)を予め把握しておかな
ければならない。そこでこの可変レート符号化方式にお
いては、まずデイジタル映像信号を固定の量子化ステツ
プに基づいて符号化することにより発生した発生符号量
に基づいてGOP(Group of Pictures )又はフレーム
毎の割当て符号量を算出し、当該割当て符号量に応じて
デイジタル映像信号を符号化するといういわゆる2パス
エンコーデイングと呼ばれる方法を用いている。
Therefore, when using this variable rate coding method, it is necessary to know in advance how difficult it is to compress the input video signal (that is, the complexity of the picture and the intensity of the movement). Therefore, in this variable rate coding system, first, a GOP (Group of Pictures) or an allocated code amount for each frame is determined based on a generated code amount generated by coding a digital video signal based on a fixed quantization step. A so-called two-pass encoding method of calculating and encoding a digital video signal according to the allocated code amount is used.

【0010】ここで各フレーム毎の割当て符号量が決定
すると、当該割当て符号量を満たすように量子化制御す
る必要がある。ここで量子化制御とは、符号化によつて
発生する発生符号量を、ある時間幅においてみたときに
所定のビツトレートになるように、量子化における量子
化ステツプを制御することを言う。この量子化制御法と
しては、MPEG方式において規定されたテストモデル
(Test Model)と呼ばれる量子化制御法が一般に使用さ
れている。このテストモデルと呼ばれる量子化制御法
は、発生符号量と割当て符号量(目標ビツト数)の差を
フイードバツクするものである。
Here, when the assigned code amount for each frame is determined, it is necessary to perform quantization control so as to satisfy the assigned code amount. Here, the quantization control means controlling the quantization step in the quantization so that the generated code amount generated by the encoding becomes a predetermined bit rate in a certain time width. As this quantization control method, a quantization control method called a test model (Test Model) defined in the MPEG system is generally used. This quantization control method called a test model feeds back the difference between the generated code amount and the allocated code amount (target number of bits).

【0011】以下、このテストモデルにおける量子化制
御アルゴリズムについて説明する。この量子化制御アル
ゴリズムは3つの大きなステツプによつて構成されてい
る。
The quantization control algorithm in the test model will be described below. This quantization control algorithm is composed of three major steps.

【0012】(1)量子化制御アルゴリズムの第1ステ
ツプ この第1ステツプにおいては、各画像タイプ毎の割当て
符号量を算出するステツプであり、各フレームを符号化
する前に、それぞれ次式
(1) First Step of Quantization Control Algorithm In this first step, the amount of code to be allocated for each image type is calculated. Before encoding each frame, the following equation is used.

【数1】 (Equation 1)

【数2】 (Equation 2)

【数3】 によつて定義されたIピクチヤ、Pピクチヤ及びBピク
チヤの複雑さ指標XI 、XP 及びXB を更新する。
(Equation 3) Update the complexity indices X I , X P and X B of the I, P and B pictures defined by

【0013】ここでSI 、SP 及びSB は、それぞれI
ピクチヤ、Pピクチヤ及びBピクチヤでの発生符号量を
表す。またQIave、QPave及びQBaveは、それぞれIピ
クチヤ、Pピクチヤ及びBピクチヤにおける平均的な量
子化パラメータ、すなわち1フレーム中における全ての
マクロブロツクの量子化ステツプの平均値(1〜31の範
囲に正規化されている)を表す。
Here, S I , S P and S B are respectively I
It represents the amount of codes generated in a picture, a P picture, and a B picture. Q Iave , Q Pave and Q Bave are average quantization parameters in I-picture, P-picture and B-picture, respectively, that is, average values of quantization steps of all macroblocks in one frame (range of 1 to 31). Is normalized to).

【0014】この複雑さ指標XI 、XP 及びXB は、符
号化した際の発生符号量が多いような画像対しては大き
くなり、高い圧縮率が得られる画像に対しては小さくな
る。従つてこれから符号化を行おうとしている画像タイ
プによつてどの程度符号量が必要であるかを、ある数値
で規格化することにより相対的に見積もつたものであ
る。
The complexity indices X I , X P and X B are large for an image having a large amount of generated code upon encoding, and small for an image having a high compression rate. Therefore, it is relatively estimated by standardizing with a certain numerical value how much code amount is required depending on the image type to be coded.

【0015】この複雑さ指標XI 、XP 及びXB の初期
値XI(init) 、XP(init) 及びXB(init) は、それぞれ
次式
[0015] The complex index X I, X P and X B of the initial value X I (init), X P (init) and X B (init) are respectively the following formulas

【数4】 (Equation 4)

【数5】 (Equation 5)

【数6】 によつて定義されている。(Equation 6) Is defined by

【0016】GOP中の次のフレームに対する割当て符
号量TI 、TP 及びTB は、Iピクチヤ、Pピクチヤ及
びBピクチヤ毎にそれぞれ次式
The code amounts T I , T P, and T B allocated to the next frame in the GOP are expressed by the following formulas for each of I picture, P picture, and B picture.

【数7】 (Equation 7)

【数8】 (Equation 8)

【数9】 によつて表される。(Equation 9) Is represented by

【0017】ここでGOPとは、必ずIピクチヤを含む
何枚かのピクチヤをひとまとまりとした処理単位であ
り、GOP内のフレームの枚数(すなわちIピクチヤの
間隔)をNというパラメータで表し、Pピクチヤ又はI
ピクチヤの間隔をMというパラメータで表す。従つてG
OPはパラメータN及びMによつて決定される。
Here, the GOP is a processing unit in which a number of pictures including the I picture are always grouped, and the number of frames in the GOP (that is, the interval of the I picture) is represented by a parameter N. Picture or I
The picture interval is represented by a parameter M. Therefore G
OP is determined by parameters N and M.

【0018】(7)式〜(9)式において、KP 及びK
B は、量子化マトリクスに依存する恒常的な定数であ
り、それぞれIピクチヤに対するPピクチヤの量子化の
際の粗さの程度、及びIピクチヤに対するBピクチヤの
量子化の際の粗さの程度を表す。このテストモデルの場
合、KP = 1.0と定義されているので、PピクチヤはI
ピクチヤと同じ粗さで量子化され、Bピクチヤについて
は、KB = 1.4と定義されているので、BピクチヤはI
ピクチヤの 1.4倍の粗さで量子化される。
In equations (7) to (9), K P and K
B is a constant that depends on the quantization matrix, and represents the degree of roughness when quantizing the P-picture with respect to the I-picture and the degree of roughness when quantizing the B-picture with respect to the I-picture, respectively. Represent. In the case of this test model, since K P = 1.0 is defined, P picture is I
Quantized in the same roughness as the picture, for B-picture, since it is defined as K B = 1.4, B-picture I
It is quantized to 1.4 times the roughness of a picture.

【0019】またNP 及びNB は、それぞれ1GOP中
の符号化順序において、Pピクチヤ及びBピクチヤの残
りの枚数を表す。Rは、符号化対象としているGOPに
与えられた残りの符号量(ビツト数)であり、あるフレ
ームを符号化した後においては、次式
N P and N B represent the remaining numbers of P pictures and B pictures, respectively, in the coding order in one GOP. R is the remaining code amount (number of bits) given to the GOP to be coded, and after coding a certain frame,

【数10】 (Equation 10)

【数11】 [Equation 11]

【数12】 のいずれかとなる。(Equation 12) Will be one of

【0020】すなわち例えば(7)式を用いてIピクチ
ヤの割当て符号量TI を算出した後、Iピクチヤの後に
続くピクチヤ、例えばBピクチヤの割当て符号量TB
(9)式を用いて算出する際には、(9)式におけるR
は、Iピクチヤに使用された符号量SI を除いた値(す
なわち(10)式で計算されたR=R−SI )が用いら
れ、これにより1GOPに割り当てられた割当て符号量
を一定に保持している。ここでGOP中の最初のピクチ
ヤ、すなわち符号化順序で最初のピクチヤであるIピク
チヤの割当て符号量TI を算出する際のRは、次式
[0020] That is, for example (7) After calculating the allocation amount of codes T I of the I-picture by using the equation, using picture following the I picture, for example, the assigned code amount T B of B-picture (9) expression calculation When performing, the R in the equation (9)
Uses a value excluding the code amount S I used for the I-picture (that is, R = R−S I calculated by the equation (10)), thereby keeping the code amount allocated to one GOP constant. keeping. Here, R for calculating the allocated code amount T I of the first picture in the GOP, ie, the first picture in the coding order, is I,

【数13】 に設定されている。(Equation 13) Is set to

【0021】従つてIピクチヤの割当て符号量TI 、P
ピクチヤの割当て符号量TP 及びBピクチヤの割当て符
号量TB は、GOP中における残りの符号量Rを、当該
GOP中におけるIピクチヤ、Pピクチヤ及びBピクチ
ヤの残りの枚数の自分の画像タイプに換算したもので除
算することによつて得ることができる。すなわち(7)
式〜(9)式は、GOP中における符号化されていない
全てのピクチヤが、これから符号化しようとするピクチ
ヤと同じ画像タイプであるとみなしたとき、1フレーム
当たりどの程度の符号量を割り当てることができるかの
目安を与えることを表している。
Accordingly, the code amount T I , P assigned to the I picture
Assigned code amount T B allocation code amount T P and B-picture of the picture is the remaining code amount R in the GOP, I picture in the in GOP, to their image type of the remaining number of P-picture and B-picture It can be obtained by dividing by the converted value. That is, (7)
Expressions (9) are used to determine how much code amount is assigned to one frame when all uncoded pictures in the GOP are considered to be the same image type as the picture to be coded. To give an indication of what you can do.

【0022】(2)量子化制御アルゴリズムの第2ステ
ツプ この第2ステツプは、各フレームにおける各マクロブロ
ツクを順次符号化しながら、仮の量子化ステツプ、すな
わち後述するように、画像の複雑さや動きの激しさを考
慮しない場合の量子化ステツプ(以下、これを参照量子
化ステツプと呼ぶ)を第1の量子化ステツプとして算出
するステツプであり、符号化対象としているフレームに
対する割当て符号量TI 、TP 又はTB と、符号化して
実際に発生した発生符号量との差分をマクロブロツク毎
にフイードバツクする。
(2) Second Step of Quantization Control Algorithm In this second step, while temporarily encoding each macro block in each frame, a temporary quantization step, that is, the complexity and motion of the This is a step for calculating a quantization step when the intensity is not taken into account (hereinafter referred to as a reference quantization step) as a first quantization step, and the code amounts T I and T assigned to the frame to be encoded. and P or T B, is fed back to the difference between the generated code amount has actually generated by encoding each macroblock.

【0023】従つて実際に符号化して発生した発生符号
量が、当初想定していた割当て符号量より多い場合に
は、発生符号量を減らすために量子化ステツプは大きく
なり、発生符号量が割当て符号量より少ない場合には、
量子化ステツプは小さくなる。
Therefore, when the generated code amount actually generated by encoding is larger than the initially assumed allocated code amount, the quantization step is increased to reduce the generated code amount, and the generated code amount is allocated. If less than the code amount,
The quantization step becomes smaller.

【0024】まず符号化対象としているIピクチヤ、P
ピクチヤ又はBピクチヤにおけるi番目のマクロブロツ
クiを符号化する前に、Iピクチヤ、Pピクチヤ及びB
ピクチヤ毎にそれぞれ用意された仮想的なバツフアの充
満度dIi、dPi及びdBiを、それぞれ次式
First, I picture, P to be encoded
Before encoding the i-th macroblock i in a picture or a B picture, an I-picture, a P-picture and a B-picture
The filling degrees d Ii , d Pi, and d Bi of the virtual buffers prepared for each picture are expressed by the following equations, respectively.

【数14】 [Equation 14]

【数15】 (Equation 15)

【数16】 を用いて算出する。(Equation 16) Is calculated using

【0025】これら(14)式〜(16)式において、
i-1 は、i番目のマクロブロツクを含んで符号化対象
としているフレームのそれまでの全てのマクロブロツク
を実際に符号化して発生した発生符号量の合計を表し、
MB_cnt は、1フレーム内のマクロブロツク数を表す
(以下、同様)。従つて(14)式、(15)式及び
(16)式において、TI ×(i−1)/MB_cnt 、T
P ×(i−1)/MB_cnt及びTB ×(i−1)/MB_c
nt は、それぞれIピクチヤ、Pピクチヤ及びBピクチ
ヤにそれぞれ割り当てられた割当て符号量TI 、TP
びTB を、それぞれIピクチヤ、Pピクチヤ及びBピク
チヤにおける各マクロブロツクに対して均等に割り当て
たと想定したときの想定割当て符号量を表すことにな
る。
In these equations (14) to (16),
B i-1 represents the total amount of generated codes generated by actually coding all the macro blocks up to that point of the frame to be coded including the i-th macro block;
MB_cnt represents the number of macroblocks in one frame (the same applies hereinafter). Therefore, in equations (14), (15) and (16), T I × (i-1) / MB_cnt, T
P × (i-1) / MB_cnt and T B × (i-1) / MB_c
nt indicates that the allocated code amounts T I , T P and T B respectively allocated to the I-picture, P-picture and B-picture are equally allocated to each macro block in the I-picture, P-picture and B-picture, respectively. This represents the assumed allocated code amount when assumed.

【0026】従つて(14)式、(15)式及び(1
6)式は、i番目のマクロブロツクを含んで符号化対象
としているフレームのそれまでの全てのマクロブロツク
を符号化して発生した発生符号量の合計と、符号化対象
としているフレームの割当て符号量TI 、TP 又はTB
を符号化対象としているフレームの各マクロブロツクに
均等に割り当てたと想定したときのi−1番目までの想
定符号量の合計との差分をマクロブロツク毎に算出し、
当該差分を、符号化対象としているフレームと同じ画像
タイプの1つ前のフレームの最後のマクロブロツクにつ
いての参照量子化ステツプQを算出する際に用いた仮想
的なバツフアの充満度dI0 、dP0 又はdB0 に加算
することにより、符号化対象としているマクロブロツク
iについての参照量子化ステツプQi を算出する際に用
いる仮想的なバツフアの充満度dIi 、dPi 及びdB
i として算出している。
Therefore, equations (14), (15) and (1)
Equation (6) represents the sum of the generated code amount generated by coding all the macro blocks up to that point of the frame to be coded including the i-th macro block, and the allocated code amount of the frame to be coded. T I , T P or T B
Is calculated for each macro block from the sum of the assumed code amount up to the (i-1) -th code when it is assumed that is equally allocated to each macro block of the frame to be encoded.
The difference is calculated as the virtual buffer fullness dI 0 , dP used in calculating the reference quantization step Q for the last macroblock of the immediately preceding frame of the same image type as the frame to be encoded. 0 or dB 0 to add a virtual buffer fullness dI i , dP i and dB used in calculating a reference quantization step Q i for the macroblock i to be encoded.
It is calculated as i .

【0027】ここで各画像タイプにおける最後のマクロ
ブロツクについて算出した仮想的なバツフアの充満度d
i 、dPi 及びdBi は、次の同じ画像タイプのフレ
ームにおける各マクロブロツクについての参照量子化ス
テツプQを算出する際の初期値dI0 、dP0 及びdB
0 として使用される。
Here, the virtual buffer fullness d calculated for the last macroblock in each image type
I i , dP i and dB i are initial values dI 0 , dP 0 and dB for calculating the reference quantization step Q for each macroblock in the next frame of the same image type.
Used as 0 .

【0028】また最初のGOP中の最初のIピクチヤ、
Pピクチヤ及びBピクチヤにおける最初のマクロブロツ
クについての参照量子化ステツプQを算出する際に用い
る仮想的なバツフアの充満度dIi 、dPi 及びdBi
を算出するために必要となる仮想的なバツフアの充満度
dI0 、dP0 及びdB0 (すなわち初期値)は、それ
ぞれ次式
Also, the first I-picture in the first GOP,
The virtual buffer fullness dI i , dP i and dB i used in calculating the reference quantization step Q for the first macroblock in the P and B pictures
The virtual buffer filling degrees dI 0 , dP 0, and dB 0 (ie, initial values) required to calculate

【数17】 [Equation 17]

【数18】 (Equation 18)

【数19】 によつて定義されている。[Equation 19] Is defined by

【0029】続いてマクロブロツクiの参照量子化ステ
ツプQi は、次式
Subsequently, the reference quantization step Qi of the macroblock i is expressed by the following equation.

【数20】 で与えられる。ここで*は当該フレームの画像タイプの
いずれかを表す(以下、同様)。またピクチヤレートに
対するビツトレート(符号化データ速度)の割合いで表
される第1のパラメータrは、次式
(Equation 20) Given by Here, * represents one of the image types of the frame (the same applies hereinafter). A first parameter r expressed by a ratio of a bit rate (encoding data rate) to a picture rate is represented by the following equation.

【数21】 によつて定義されている。ここで(17)式における第
1のパラメータrも(20)式によつて表される。
(Equation 21) Is defined by Here, the first parameter r in the equation (17) is also represented by the equation (20).

【0030】かくして各画像タイプにおける各マクロブ
ロツク毎の参照量子化ステツプQが算出される。
Thus, the reference quantization step Q for each macroblock in each image type is calculated.

【0031】(3)量子化制御アルゴリズムの第3ステ
ツプ 上述の第2ステツプにおいて算出した参照量子化ステツ
プQは、各マクロブロツクにおける画像の複雑さ(空間
周波数の振幅の大きさ)や動きの激しさを考慮せずに算
出した値であるため、この第3ステツプにおいては、各
マクロブロツクにおける画像の複雑さや動きの激しさを
考慮した各マクロブロツク毎の量子化ステツプMQUANTを
第2の量子化ステツプとして算出するステツプである。
すなわち量子化パラメータの平均値を、マクロブロツク
毎のアクテイビテイ(ブロツク当たりのAC成分のエネ
ルギー(活性度))によつて変化させる。
(3) Third Step of Quantization Control Algorithm The reference quantization step Q calculated in the second step described above is used to calculate the image complexity (magnitude of the spatial frequency amplitude) and intense motion in each macroblock. Therefore, in this third step, the quantization step MQUANT for each macroblock taking into account the complexity of the image in each macroblock and the intensity of the motion is taken into account in the third quantization step. This is a step calculated as a step.
That is, the average value of the quantization parameter is changed by the activity (energy (activity) of the AC component per block) for each macroblock.

【0032】マクロブロツクiの空間的なアクテイビテ
イ acti は、その輝度ブロツク(1マクロブロツク中に
4個存在する)よりイントラ(intra )画素値を用いて
次式
The spatial activity act i of the macro block i is obtained by using the intra pixel value from the luminance block (four in one macro block) as follows:

【数22】 を用いて算出する。ここで varsblkは、マクロブロツク
iの4つの輝度ブロツク(サブブロツクsblk)における
アクテイビテイを表し、各サブブロツクsblkにおけるア
クテイビテイ varsblkは、次式
(Equation 22) Is calculated using Here, var sblk represents the activity in four luminance blocks (sub-blocks sblk) of macro block i, and the activity var sblk in each sub-block sblk is expressed by the following equation.

【数23】 によつて算出する。ここで各マクロブロツクは16×16画
素から構成されているものとし、Pj は画素値を表す。
(Equation 23) It is calculated by Here, each macro block is assumed to be composed of 16 × 16 pixels, and P j represents a pixel value.

【0033】すなわち(23)式は、8 ×8 画素の4つ
の各サブブロツクsblkついて、サブブロツクsblkにおけ
る各画素値Pj と、次式
That is, equation (23) shows that for each of the four sub-blocks sblk of 8 × 8 pixels, each pixel value P j in the sub-block sblk and the following equation:

【数24】 を用いて算出した当該サブブロツクsblkにおける各画素
値Pj の平均値Pave との差分を2乗したものを、当該
サブブロツクsblkにおける全ての画素(64個)について
算出し、これら各画素毎に算出した演算結果(Pj −P
ave 2 の合計を当該サブブロツクsblkにおけるアクテ
イビテイ varsblkとして算出し、4つのサブブロツクsb
lkについてそれぞれ算出したアクテビテイ varsblkのう
ち、最小のアクテイビテイ varsblkをもつサブブロツク
sblkのアクテイビイテイ varsblkをマクロブロツクiに
ついてのアクテイビテイ acti とすることを意味する。
(Equation 24) The square of the difference between the average value P ave of each pixel value P j in the sub-block sblk calculated using the above is calculated for all the pixels (64) in the sub-block sblk, and calculated for each of these pixels. Calculation result (P j −P
ave ) The sum of 2 is calculated as the activity var sblk in the sub- block sblk , and the four sub- blocks sblk are calculated.
Sub- block with minimum activity var sblk of activity var sblk calculated for lk
It means that the activity var sblk of sblk is the activity act i for the macroblock i.

【0034】このようにして算出したマクロブロツクi
のアクテイビテイ acti を正規化した係数を次式
The macro block i thus calculated
The normalized coefficient of the activity act i of

【数25】 を用いて正規化する。すなわちアクテイビテイ act
i を、平均的なアクテイビテイの値からの偏りによつて
0.5〜2.0 の範囲に正規化した係数 N_ acti を算出す
る。
(Equation 25) Is normalized using. That is, activity act
i by the deviation from the average activity value
Calculating a normalized coefficient N_ act i in the range of 0.5 to 2.0.

【0035】ここで avg_act は、符号化対象としてい
るフレームの1つ前のフレームにおける acti の平均値
を表す。マクロブロツクiについての最終的な量子化ス
テツプMQUANTi は、次式
Here, avg_act represents the average value of act i in the frame immediately before the frame to be encoded. The final quantization step MQUANT i for macroblock i is

【数26】 によつて得られる。(Equation 26) Is obtained by

【0036】すなわち画像の複雑さや動きの激しさを考
慮しないときの各マクロブロツクについての参照量子化
ステツプQi に、正規化した係数 N_ acti を乗ずるこ
とにより、マクロブロツクiについて画像の複雑さや動
きの激しさを考慮した量子化ステツプMQUANTi を得るこ
とができる。最終的にMQUANTi は、1〜31の範囲の整数
に制限される。
[0036] That the reference quantization step Q i for each macroblock when no consideration of the complexity and intensity of movement of the image, by multiplying the normalized coefficient N_ act i, the complexity of the image Ya for macroblock i it is possible to obtain a quantization step MQUANT i considering intensity of movement. Finally, MQUANT i is limited to an integer in the range of 1-31.

【0037】このようにして符号化対象としているフレ
ームの符号化対象としているマクロブロツクiについて
の量子化ステツプMQUANTi が決定されると、当該量子化
ステツプMQUANTi によつてマクロブロツクが量子化され
て符号化され、このときに実際に発生した発生符号量が
(14)式、(15)式又は(16)式におけるBi-1
に加算される。
When the quantization step MQUANT i for the macro block i to be coded for the frame to be coded is determined in this way, the macro block is quantized by the quantization step MQUANT i. The amount of generated code actually generated at this time is represented by Bi-1 in the expression (14), (15) or (16).
Is added to

【0038】以降、次のフレームに対して上述の第1〜
第3のステツプを繰り返すことにより当該フレームにつ
いての全てのマクロブロツクについて量子化ステツプMQ
UANTが順次決定し、デイジタル映像信号中のあるGOP
における全てのフレームについて全てのマクロブロツク
に対する量子化ステツプMQUANTが決定すると、次のGO
Pについて上述の第1〜第3のステツプが行われる。
Hereinafter, the first to the above-mentioned frames are performed for the next frame.
By repeating the third step, the quantization step MQ for all macroblocks for the frame is performed.
UANT is sequentially determined and a GOP in the digital video signal
When the quantization step MQUANT for all macroblocks is determined for all frames in
The above-described first to third steps are performed for P.

【0039】ところが上述のようなテストモデルによる
量子化制御法においては、ビツトレートとして固定レー
トを前提としているので、上述のような可変レート符号
化方式に適用することができなかつた。すなわちビツト
レートが固定であるということは、(21)式において
第1のパラメータrが固定であることを意味し、従つて
各GOPにおける第1のパラメータrも一定となるの
で、テストモデルによる量子化制御法を絵柄の複雑さや
動きの激しさに応じてビツトレートを可変にする可変レ
ート符号化方式には適用できなかつた。
However, in the quantization control method based on the test model as described above, since a fixed rate is assumed as the bit rate, it cannot be applied to the variable rate coding method as described above. That is, the fact that the bit rate is fixed means that the first parameter r in equation (21) is fixed, and therefore the first parameter r in each GOP is also constant. The control method cannot be applied to a variable rate coding method in which a bit rate is varied according to the complexity of a picture or the intensity of movement.

【0040】本発明は以上の点を考慮してなされたもの
で、可変レート符号化方式に対応し得る量子化制御を行
うことのできる映像信号符号化方法、映像信号符号化装
置及び記録媒体を提案しようとするものである。
The present invention has been made in view of the above points, and provides a video signal encoding method, a video signal encoding apparatus, and a recording medium capable of performing quantization control compatible with a variable rate encoding method. It is something to propose.

【0041】[0041]

【課題を解決するための手段】かかる課題を解決するた
め本発明においては、第1の映像単位又は第2の映像単
位毎の割当て符号量に基づいて、第1の映像単位におけ
る第2の映像単位当たりの平均符号化データ速度を算出
し、単位時間当たりに伝送されてくる第2の映像単位に
応じた画像のデータ量に対する平均符号化データ速度の
割合いで表される第1のパラメータを第1の映像単位毎
に算出し、符号化対象としている第2の映像単位に対す
る割当て符号量と、当該第2の映像単位において現在ま
でに符号化して実際に発生した発生符号量との差分を第
3の映像単位毎に算出し、当該第3の映像単位毎の差分
を、符号化対象としている第3の映像単位についての第
1の量子化ステツプを算出する際に反映させるための第
2のパラメータを算出し、第1のパラメータ及び第2の
パラメータに基づいて符号化対象としている第3の映像
単位についての第1の量子化ステツプを算出するように
した。本発明によれば、第1の映像単位毎に第2の映像
単位当たりの平均符号化データ速度を算出し、当該平均
符号化データ速度を用いて第1のパラメータを算出する
ので、第1のパラメータを各第1の映像単位における平
均符号化データ速度に応じて変化させることができる。
According to the present invention, in order to solve the above-mentioned problems, a second video in a first video unit is determined based on a code amount allocated to the first video unit or the second video unit. An average encoded data rate per unit is calculated, and a first parameter represented by a ratio of an average encoded data rate to an image data amount corresponding to a second video unit transmitted per unit time is defined as a first parameter. 1 is calculated for each video unit, and the difference between the allocated code amount for the second video unit to be coded and the generated code amount actually generated by encoding the second video unit up to the present. 2 for calculating the first quantization step for the third video unit to be encoded when calculating the first quantization step for the third video unit to be encoded. Parameter Out, and to calculate the first quantization step for the third video unit that is to be coded based on the first parameter and the second parameter. According to the present invention, the average encoded data rate per second video unit is calculated for each first video unit, and the first parameter is calculated using the average encoded data rate. The parameters can be varied according to the average encoded data rate in each first video unit.

【0042】[0042]

【発明の実施の形態】以下図面について、本発明の一実
施例を詳述する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below in detail with reference to the drawings.

【0043】(1)全体構成 図1において、1は全体として本発明を適用した映像信
号符号化装置を示し、映像信号S1は画像符号化タイプ
指定回路2に入力される。画像符号化タイプ指定回路2
は入力される映像信号S1の各フレームを第2の映像単
位としてIピクチヤ、Pピクチヤ又はBピクチヤのうち
のどの画像符号化タイプ(以下、これを画像タイプと呼
ぶ)のピクチヤとして処理するかを指定して画像符号化
並替え回路3に送出する。この映像信号符号化装置1
は、例えば15個のフレームを第1の映像単位としての1
GOPとして処理の1単位とする。
(1) Overall Configuration In FIG. 1, reference numeral 1 denotes a video signal encoding apparatus to which the present invention is applied as a whole, and a video signal S1 is input to an image encoding type designation circuit 2. Image coding type designation circuit 2
Indicates which of the I-, P-, or B-pictures is to be processed as a picture of an image coding type (hereinafter referred to as an image type) with each frame of the input video signal S1 as a second video unit. It is designated and sent to the image coding rearrangement circuit 3. This video signal encoding device 1
Is, for example, 1 frame of 15 frames as a first video unit.
A GOP is one unit of processing.

【0044】画像符号化順序並替え回路3は指定された
画像タイプに従つて各フレームを符号化する順番に並び
替えて画像信号S2としてスキヤンコンバータ4に送出
すると共に、当該画像信号S2についての画像タイプ信
号S3を予測モード決定回路5、動きベクトル検出回路
6及び量子化制御回路7に送出する。また画像符号化並
替え回路3は現在符号化されているフレームの動きベク
トルを検出するために現在画像と、当該現在画像より時
間的に過去にある画像(以下、これを過去参照画像と呼
ぶ)及び又は現在画像より時間的に未来にある画像(以
下、これを未来参照画像と呼ぶ)S4とを動きベクトル
検出回路6に送出する。
The image coding order rearranging circuit 3 rearranges the frames in the coding order according to the specified image type and sends them to the scan converter 4 as an image signal S2. The type signal S3 is sent to the prediction mode determination circuit 5, the motion vector detection circuit 6, and the quantization control circuit 7. In addition, the image encoding / reordering circuit 3 includes a current image and an image temporally past the current image in order to detect a motion vector of the currently encoded frame (hereinafter, referred to as a past reference image). And / or an image (hereinafter referred to as a future reference image) S4 that is temporally future from the current image is sent to the motion vector detection circuit 6.

【0045】スキヤンコンバータ4は、画像信号S2を
フレーム毎にブロツクフオーマツトの信号に変換し、こ
の1フレームの信号を16ラインを1単位としてN個のス
ライスに区分すると共に、各スライスを16×16の画素に
対応する輝度信号によつて構成されるM個のマクロブロ
ツクに分割し、当該各マクロブロツクを第3の映像単位
(伝送単位)として量子化制御回路7及び演算回路8に
送出する。
The scan converter 4 converts the image signal S2 into a block format signal for each frame, divides the signal of one frame into N slices with 16 lines as one unit, and divides each slice into 16 ×. It is divided into M macroblocks composed of luminance signals corresponding to 16 pixels, and each macroblock is sent to the quantization control circuit 7 and the arithmetic circuit 8 as a third video unit (transmission unit). .

【0046】動きベクトル検出回路6は画像信号S2の
各フレームに同期した画像タイプ信号S3に従つて各フ
レームの画像データをIピクチヤ、Pピクチヤ又はBピ
クツチヤとして処理する。すなわちIピクチヤとして処
理されるフレームの画像データは、動きベクトル検出回
路6から、過去参照画像を格納する過去参照画像メモリ
(図示せず)に格納され、Bピクチヤとして処理される
フレームの画像データは現在画像を格納する現在画像メ
モリ(図示せず)に格納され、Pピクチヤとして処理さ
れるフレームの画像データは未来参照画像を格納する未
来参照画像メモリ(図示せず)に格納される。
The motion vector detecting circuit 6 processes the image data of each frame as I-picture, P-picture or B-picture according to the picture type signal S3 synchronized with each frame of the picture signal S2. That is, the image data of the frame processed as I-picture is stored in the past reference image memory (not shown) for storing the past reference image from the motion vector detection circuit 6, and the image data of the frame processed as B-picture is The image data of a frame stored in a current image memory (not shown) for storing the current image and processed as a P-picture is stored in a future reference image memory (not shown) for storing a future reference image.

【0047】ここで次のタイミングにおいて、Bピクチ
ヤ又はPピクチヤとして処理すべきフレームが動きベク
トル検出回路6に入力されたとき、これまでに未来参照
画像メモリに格納されていた最初のPピクチヤの画像デ
ータは過去参照画像メモリに格納される。また次のBピ
クチヤの画像データは現在画像メモリに格納され、次の
Pピクチヤの画像データは未来参照画像メモリに格納さ
れる。以降このような動作が順次繰り返される。
At the next timing, when a frame to be processed as a B-picture or a P-picture is inputted to the motion vector detecting circuit 6, the image of the first P-picture previously stored in the future reference picture memory is obtained. The data is stored in the past reference image memory. The image data of the next B picture is stored in the current image memory, and the image data of the next P picture is stored in the future reference image memory. Thereafter, such an operation is sequentially repeated.

【0048】動きベクトル検出回路6は順方向予測にお
ける動きベクトル及びそのときの動きベクトル推定残差
S5を予測モード決定回路5に送出する。ここで動きベ
クトル検出回路6は、Bピクチヤの場合には、逆方向予
測における動きベクトルとそのときの動きベクトル推定
残差とを送出する。予測モード決定回路5はイントラモ
ード、順方向予測モード、逆方向予測モード又は双方向
予測モードのうちどの予測モードを選択するかを決定す
る。
The motion vector detection circuit 6 sends the motion vector in the forward prediction and the motion vector estimation residual S5 at that time to the prediction mode determination circuit 5. Here, in the case of a B picture, the motion vector detection circuit 6 sends out the motion vector in the backward prediction and the motion vector estimation residual at that time. The prediction mode determination circuit 5 determines which prediction mode to select from the intra mode, the forward prediction mode, the backward prediction mode, or the bidirectional prediction mode.

【0049】ここでイントラモードは、符号化対象とな
るフレームの画像データをそのまま伝送データとして伝
送する処理であり、順方向予測モードは、過去参照画像
との予測残差と順方向動きベクトルとを伝送する処理で
ある。また逆方向予測モードは、未来参照画像との予測
残差と逆方向動きベクトルとを伝送する処理であり、双
方向予測モードは、過去参照画像と未来参照画像の2つ
の予測画像の平均値との予測残差と順方向及び逆方向の
2つの動きベクトルとを伝送する処理である。Bピクチ
ヤの場合には、これら4種類の予測モードをマクロブロ
ツク単位で切り換える。
Here, the intra mode is a process for transmitting the image data of the frame to be encoded as transmission data as it is, and the forward prediction mode is a process in which the prediction residual from the past reference image and the forward motion vector are calculated. This is the process of transmitting. The backward prediction mode is a process of transmitting a prediction residual with respect to a future reference image and a backward motion vector. The bidirectional prediction mode is a process of transmitting an average value of two prediction images of a past reference image and a future reference image. This is a process of transmitting the prediction residual of the above and two motion vectors in the forward direction and the backward direction. In the case of B picture, these four types of prediction modes are switched on a macroblock basis.

【0050】予測モード決定回路5は画像符号化並替え
回路3から送出される画像タイプ信号S3に基づいて、
Iピクチヤの場合にはイントラモードを選択し、Pピク
チヤの場合にはイントラモード又は順方向予測モードの
いずれかの予測モードを選択し、Bピクチヤの場合に
は、イントラモード、順方向予測モード、逆方向予測モ
ード又は双方向予測モードのうちいずれかの予測モード
を選択し、選択した予測モードS6を演算回路8に送出
する。
The prediction mode decision circuit 5 is based on the picture type signal S3 sent from the picture coding and rearranging circuit 3,
In the case of the I picture, the intra mode is selected, in the case of the P picture, either the intra mode or the forward prediction mode is selected, and in the case of the B picture, the intra mode, the forward prediction mode, Either the backward prediction mode or the bidirectional prediction mode is selected, and the selected prediction mode S6 is sent to the arithmetic circuit 8.

【0051】演算回路8はスキヤンコンバータ4より読
み出されたマクロブロツクS7に対して、予測モードS
6に基づいてイントラ、順方向予測、逆方向予測又は双
方向予測の演算を行う。演算回路8はマクロブロツクS
7としてIピクチヤとして処理すべき画像データが入力
された場合、当該画像データをイントラ符号化してDC
T(Discrete Cosine Transform 、離散コサイン変換)
回路9に送出する。DCT回路9はイントラ符号化され
た画像データをDCT係数に変換して量子化回路10に
送出する。
The arithmetic circuit 8 applies the prediction mode S to the macroblock S7 read from the scan converter 4.
6, the calculation of intra, forward prediction, backward prediction or bidirectional prediction is performed. The arithmetic circuit 8 is a macro block S
7, when image data to be processed as an I-picture is input, the image data is intra-coded and
T (Discrete Cosine Transform, Discrete Cosine Transform)
Send it to the circuit 9. The DCT circuit 9 converts the intra-coded image data into DCT coefficients and sends the DCT coefficients to the quantization circuit 10.

【0052】量子化回路10は各DCT係数を量子化制
御回路7から指定された量子化ステツプで量子化して可
変長符号化回路11及び逆量子化回路12に送出する。
可変長符号化回路11は量子化された画像データ、予測
モード決定回路5から送出される予測モードS6及び動
きベクトル検出回路6から送出される動きベクトルS5
を例えばハフマン符号などの可変長符号に変換し、バツ
フア13を介して量子化制御回路7に送出すると共に外
部に出力する。
The quantization circuit 10 quantizes each DCT coefficient at a quantization step designated by the quantization control circuit 7 and sends it to the variable length coding circuit 11 and the inverse quantization circuit 12.
The variable length encoding circuit 11 performs quantization image data, a prediction mode S6 sent from the prediction mode determination circuit 5, and a motion vector S5 sent from the motion vector detection circuit 6.
Is converted to a variable-length code such as a Huffman code, sent to the quantization control circuit 7 via the buffer 13 and output to the outside.

【0053】逆量子化回路12は量子化された画像デー
タを量子化時における量子化ステツプに応じて逆量子化
してIDCT(逆DCT)回路14に送出する。IDC
T回路14は逆量子化回路12からの出力を逆DCT処
理する。IDCT回路14からの出力は演算器15を介
してフレームメモリ16内の過去参照画像を格納する過
去参照画像記憶部(図示せず)に格納される。
The inverse quantization circuit 12 inversely quantizes the quantized image data in accordance with the quantization step at the time of quantization and sends it to the IDCT (inverse DCT) circuit 14. IDC
The T circuit 14 performs an inverse DCT process on the output from the inverse quantization circuit 12. The output from the IDCT circuit 14 is stored in a past reference image storage unit (not shown) for storing the past reference image in the frame memory 16 via the calculator 15.

【0054】次に演算回路8にスキヤンコンバータ4か
らPピクチヤとして処理すべき画像データが入力され、
予測モード決定回路5から送出される予測モードS6が
イントラモードの場合、当該画像データは上述のIピク
チヤの場合と同様にイントラ符号化されてDCT回路
9、量子化回路10、可変長符号化回路11及びバツフ
ア13を介して量子化制御回路7に送出される共に外部
に出力され、逆量子化回路12、IDCT回路14及び
演算器15を介してフレームメモリ16内の未来参照画
像を格納する未来参照画像記憶部(図示せず)に格納さ
れる。
Next, image data to be processed as P pictures is input from the scan converter 4 to the arithmetic circuit 8.
When the prediction mode S6 sent from the prediction mode determination circuit 5 is the intra mode, the image data is intra-coded as in the case of the above-mentioned I-picture, and the DCT circuit 9, the quantization circuit 10, the variable length coding circuit A future reference image transmitted to the quantization control circuit 7 via the buffer 11 and the buffer 13 is output to the outside, and is stored in the frame memory 16 via the inverse quantization circuit 12, the IDCT circuit 14 and the arithmetic unit 15. It is stored in a reference image storage unit (not shown).

【0055】予測モードS6が順方向予測モードの場合
には、フレームメモリ16の過去参照画像記憶部に格納
されている画像データ(この場合Iピクチヤの画像デー
タ)が読み出されて動き補償回路17に送出される。動
き補償回路17はこの画像データを動きベクトル検出回
路6から送出される順方向動きベクトルS5に対応して
動き補償する。
When the prediction mode S6 is the forward prediction mode, the image data (in this case, I-picture image data) stored in the past reference image storage section of the frame memory 16 is read out and the motion compensation circuit 17 Sent to The motion compensation circuit 17 performs motion compensation on the image data in accordance with the forward motion vector S5 sent from the motion vector detection circuit 6.

【0056】すなわち動き補償回路17は、順方向予測
モードの場合、フレームメモリ16の過去参照画像記憶
部の読出しアドレスを、動きベクトル検出回路6が現在
出力しているマクロブロツクの位置に対応する位置から
順方向動きベクトルS5に対応する分だけずらしてデー
タを読み出して予測参照画像を生成し、演算回路8及び
演算器15に送出する。
That is, in the case of the forward prediction mode, the motion compensating circuit 17 sets the read address of the past reference image storage section of the frame memory 16 to the position corresponding to the position of the macro block currently output by the motion vector detecting circuit 6. Is read out by shifting the data by an amount corresponding to the forward motion vector S5 to generate a predicted reference image, which is sent to the arithmetic circuit 8 and the arithmetic unit 15.

【0057】演算回路8はスキヤンコンバータ4から送
出される参照画像のマクロブロツクのデータから、動き
補償回路17から送出された当該マクロブロツクに対応
する予測参照画像の画像データを減算して予測残差とし
ての差分データを得、この差分データをDCT回路9に
送出する。この差分データはDCT回路9、量子化回路
10、可変長符号化回路11及びバツフア13を介して
量子化制御回路7に送出されると共に外部に出力され
る。またこの差分データは逆量子化回路12及びIDC
T回路14によつて局所的に復号されて演算器15に送
出される。
The arithmetic circuit 8 subtracts the image data of the predicted reference image corresponding to the macroblock sent from the motion compensation circuit 17 from the macroblock data of the reference image sent from the scan converter 4 to obtain a prediction residual. And sends the difference data to the DCT circuit 9. The difference data is sent to the quantization control circuit 7 via the DCT circuit 9, the quantization circuit 10, the variable length coding circuit 11, and the buffer 13, and is output to the outside. The difference data is supplied to the inverse quantization circuit 12 and the IDC.
The data is locally decoded by the T circuit 14 and sent to the arithmetic unit 15.

【0058】演算器15はIDCT回路14から送出さ
れる差分データに、動き補償回路17から送出される予
測参照画像の画像データを加算する。これにより局所的
に復号したPピクチヤの画像データが得られる。このP
ピクチヤの画像データはフレームメモリ16内の未来参
照画像を格納する未来参照画像記憶部に格納される。
The arithmetic unit 15 adds the image data of the predicted reference image sent from the motion compensation circuit 17 to the difference data sent from the IDCT circuit 14. As a result, locally decoded P-picture image data is obtained. This P
The picture image data is stored in a future reference image storage unit for storing a future reference image in the frame memory 16.

【0059】次に演算回路8にスキヤンコンバータ4か
らBピクチヤとして処理すべきフレームの画像データが
入力され、予測モード決定回路5から送出される予測モ
ードS6がイントラモード又は順方向予測モードの場
合、当該フレームの画像データは上述のPピクチヤの場
合と同様に処理される。これに対して予測モードS6が
逆方向予測モードに設定された場合には、フレームメモ
リ16の未来参照画像記憶部に格納されている画像デー
タ(この場合Pピクチヤの画像データ)が読み出されて
動き補償回路17に送出される。動き補償回路17はこ
の画像データを動きベクトル検出回路6から送出される
逆方向動きベクトルS5に対応して動き補償する。
Next, when the image data of the frame to be processed as the B-picture is input from the scan converter 4 to the arithmetic circuit 8 and the prediction mode S6 sent from the prediction mode determination circuit 5 is the intra mode or the forward prediction mode, The image data of the frame is processed in the same manner as in the case of the P picture described above. On the other hand, when the prediction mode S6 is set to the backward prediction mode, image data (in this case, P-picture image data) stored in the future reference image storage unit of the frame memory 16 is read out. The data is sent to the motion compensation circuit 17. The motion compensation circuit 17 performs motion compensation on the image data in accordance with the backward motion vector S5 sent from the motion vector detection circuit 6.

【0060】すなわち動き補償回路17は、逆方向予測
モードの場合、フレームメモリ16の未来参照画像記憶
部の読出しアドレスを、動きベクトル検出回路6が現在
出力しているマクロブロツクの位置に対応する位置から
動きベクトルS5に対応する分だけずらしてデータを読
み出して予測参照画像を生成し、演算回路8及び演算器
15に送出する。
That is, in the case of the backward prediction mode, the motion compensation circuit 17 sets the read address of the future reference image storage section of the frame memory 16 to the position corresponding to the position of the macro block currently output by the motion vector detection circuit 6. Is read out by shifting the data by an amount corresponding to the motion vector S5, a predicted reference image is generated, and sent to the arithmetic circuit 8 and the arithmetic unit 15.

【0061】演算回路8はスキヤンコンバータ4から送
出される参照画像のマクロブロツクのデータから、動き
補償回路17から送出された当該マクロブロツクに対応
する予測参照画像の画像データを減算して予測残差とし
ての差分データを得、この差分データをDCT回路9に
送出する。この差分データはDCT回路9、量子化回路
10、可変長符号化回路11及びバツフア13を介して
量子化制御回路7に送出されると共に外部に送出され
る。またこの差分データは逆量子化回路12及びIDC
T回路14によつて局所的に復号されて演算器15に送
出される。演算器15はIDCT回路14から送出され
る差分データに、動き補償回路17から送出される予測
参照画像の画像データを加算する。これにより局所的に
復号したBピクチヤの画像データが得られる。
The arithmetic circuit 8 subtracts the image data of the predicted reference image corresponding to the macroblock sent from the motion compensation circuit 17 from the macroblock data of the reference image sent from the scan converter 4 to obtain a prediction residual. And sends the difference data to the DCT circuit 9. The difference data is sent to the quantization control circuit 7 via the DCT circuit 9, the quantization circuit 10, the variable length coding circuit 11 and the buffer 13, and is sent to the outside. The difference data is supplied to the inverse quantization circuit 12 and the IDC.
The data is locally decoded by the T circuit 14 and sent to the arithmetic unit 15. The calculator 15 adds the image data of the predicted reference image sent from the motion compensation circuit 17 to the difference data sent from the IDCT circuit 14. As a result, locally decoded image data of B picture is obtained.

【0062】双方向予測モードの場合には、フレームメ
モリ16の過去参照画像記憶部に格納されている画像デ
ータ(この場合Iピクチヤの画像データ)と、未来参照
画像記憶部に格納されている画像データ(この場合Pピ
クチヤの画像データ)とが読み出されて動き補償回路1
7に送出される。動き補償回路17はこの画像データを
動きベクトル検出回路6から送出される順方向動きベク
トル及び逆方向動きベクトルS5に対応して動き補償す
る。
In the case of the bidirectional prediction mode, the image data stored in the past reference image storage unit of the frame memory 16 (in this case, I-picture image data) and the image data stored in the future reference image storage unit Data (in this case, P-picture image data) is read out and the motion compensation circuit 1
7 is sent. The motion compensation circuit 17 performs motion compensation on the image data in accordance with the forward motion vector and the backward motion vector S5 sent from the motion vector detection circuit 6.

【0063】すなわち動き補償回路17は、双方向予測
モードの場合、フレームメモリ16の過去参照画像記憶
部と未来参照画像記憶部の読出しアドレスを、動きベク
トル検出回路6が現在出力しているマクロブロツクの位
置に対応する位置から順方向動きベクトル及び逆方向動
きベクトルS5に対応する分だけずらしてデータを読み
出して予測参照画像を生成し、演算回路8及び演算器1
5に送出する。
That is, in the case of the bidirectional prediction mode, the motion compensating circuit 17 reads the read addresses of the past reference image storage unit and the future reference image storage unit of the frame memory 16 from the macro block which the motion vector detection circuit 6 is currently outputting. Is read out from the position corresponding to the position corresponding to the position corresponding to the forward motion vector and the backward direction motion vector S5 to generate a predicted reference image, and the arithmetic circuit 8 and the arithmetic unit 1
5

【0064】演算回路8はスキヤンコンバータ4から送
出される参照画像のマクロブロツクのデータから、動き
補償回路17から送出された当該マクロブロツクに対応
する予測参照画像の画像データの平均値を減算して予測
残差としての差分データを得、この差分データをDCT
回路9に送出する。この差分データはDCT回路9、量
子化回路10、可変長符号化回路11及びバツフア13
を介して量子化制御回路7に送出されると共に外部に出
力される。またこの差分データは逆量子化回路12及び
IDCT回路14によつて局所的に復号されて演算器1
5に送出される。
The arithmetic circuit 8 subtracts the average value of the image data of the predicted reference image corresponding to the macroblock sent from the motion compensation circuit 17 from the macroblock data of the reference image sent from the scan converter 4. Obtain difference data as a prediction residual, and apply this difference data to DCT
Send it to the circuit 9. The difference data is supplied to a DCT circuit 9, a quantization circuit 10, a variable length coding circuit 11, and a buffer 13
Is sent to the quantization control circuit 7 via the, and is also output to the outside. The difference data is locally decoded by the inverse quantization circuit 12 and the IDCT circuit 14, and
5 is sent.

【0065】演算器15はIDCT回路14から送出さ
れる差分データに、動き補償回路17から送出される予
測参照画像の画像データを加算する。これにより局所的
に復号したBピクチヤの画像データが得られる。ここで
Bピクチヤは他の画像の予測画像として使用されないの
で、フレームメモリ16には格納されない。
The arithmetic unit 15 adds the image data of the predicted reference image sent from the motion compensation circuit 17 to the difference data sent from the IDCT circuit 14. As a result, locally decoded image data of B picture is obtained. Here, since the B picture is not used as a predicted image of another image, it is not stored in the frame memory 16.

【0066】(2−1)量子化制御部の構成 ここで映像信号符号化装置1における量子化制御部7の
構成について説明する。図2に示すように、量子化制御
部7は、以下に説明する量子化制御アルゴリズムに応じ
たプログラムを記録媒体としてのROM(Read Only Me
mory)7Aに格納しており、CPU7Bがこの量子化制
御アルゴリズムに従つて量子化回路10において各マク
ロブロツクを量子化する際に用いる量子化ステツプMQUA
NTを、RAM(Random Access Memory)7Cをワークエ
リアとして用いて算出し、当該量子化ステツプMQUANTを
量子化回路10に送出する。
(2-1) Configuration of Quantization Control Unit Here, the configuration of the quantization control unit 7 in the video signal encoding device 1 will be described. As shown in FIG. 2, the quantization control unit 7 stores a program according to a quantization control algorithm described below in a ROM (Read Only Me
mory) 7A, and a quantization step MQUA used when the CPU 7B quantizes each macroblock in the quantization circuit 10 in accordance with the quantization control algorithm.
NT is calculated by using a RAM (Random Access Memory) 7C as a work area, and the quantization step MQUANT is sent to the quantization circuit 10.

【0067】量子化制御部7における量子化制御アルゴ
リズムについて図3、図4及び図5に示すフローチヤー
トを用いて説明する。ここでこの映像信号符号化装置1
は、符号化方法として可変レート符号化方式を採用して
おり、量子化制御アルゴリズムを開始する前に、まずデ
イジタル映像信号S1を固定の量子化ステツプで符号化
した際に発生した発生符号量に基づいて各フレーム毎の
割当て符号量Tj (j=1−N)を決定し、当該各フレ
ーム毎の割当て符号量Tj を量子化制御部7のRAM7
Cに格納しているものとする。
The quantization control algorithm in the quantization control unit 7 will be described with reference to the flowcharts shown in FIGS. 3, 4 and 5. Here, the video signal encoding device 1
Adopts a variable rate coding method as a coding method. Before starting a quantization control algorithm, firstly, the generated code amount generated when the digital video signal S1 is coded by a fixed quantization step is calculated. based determines the allocation amount of codes T j for each frame (j = 1-N), RAM7 of quantization controller 7 allocation amount of codes T j for each said respective frame
It is assumed that it is stored in C.

【0068】実際上、量子化制御部7は固定の量子化ス
テツプQSを量子化回路10に送出する。量子化回路1
0は、量子化制御部7によつて指定された量子化ステツ
プQSに基づいて、DCT回路9から出力されるDCT
係数を量子化して可変長符号化回路11に送出する。可
変長符号化回路11は、量子化回路10からの出力を可
変長符号化し、当該符号化結果を量子化制御部7に送出
する。量子化制御部7は、可変長符号化回路11からの
出力に基づいて、各フレーム毎に実際に発生した発生符
号量を算出し、当該発生符号量に基づいて各フレーム毎
の割当て符号量Tj を算出し、RAM7Cに格納する。
In practice, the quantization control unit 7 sends out a fixed quantization step QS to the quantization circuit 10. Quantization circuit 1
0 is the DCT output from the DCT circuit 9 based on the quantization step QS designated by the quantization controller 7.
The coefficients are quantized and sent to the variable length coding circuit 11. The variable-length coding circuit 11 performs variable-length coding on the output from the quantization circuit 10 and sends the coding result to the quantization control unit 7. The quantization control unit 7 calculates the generated code amount actually generated for each frame based on the output from the variable length coding circuit 11, and based on the generated code amount, the allocated code amount T for each frame. j is calculated and stored in the RAM 7C.

【0069】CPU7Bは、ステツプSP1より量子化
制御アルゴリズムを開始し、ステツプSP2において、
後述するように、それぞれIピクチヤ、Pピクチヤ及び
Bピクチヤにおける各マクロブロツクについての参照量
子化ステツプQを算出する際に使用される各画像タイプ
毎に用意された仮想的なバツフアの充満度dI0 、dP
0 及びdB0 を算出する際に必要となる平均量子化ステ
ツプ(qIPREVave、(qPPREVave 及び(qB
PREVave の初期値を、それぞれ「10」、kp ×(qI
PREVave (すなわち「10」)及びkB ×(qIPREV
ave (すなわち「10」)に設定する。ここでKP = 1.
0、KB = 1.4であり、上述したテストモデルの場合と
同様にIピクチヤに対する粗さの程度を表す。
The CPU 7B starts the quantization control algorithm from step SP1, and in step SP2,
As will be described later, a virtual buffer fullness dI 0 prepared for each image type used in calculating the reference quantization step Q for each macroblock in the I-picture, P-picture and B-picture, respectively. , DP
0 and dB 0 , the average quantization steps (qI PREV ) ave , (qP PREV ) ave and (qB
PREV ) The initial values of ave are “10” and k p × (qI
PREV) ave (or "10") and k B × (qI PREV)
Set to ave (ie "10"). Where K P = 1.
0, K B = 1.4, as in the case of the test model described above represents the degree of roughness for the I picture.

【0070】続いてCPU7Bは、ステツプSP3にお
いて、カウンタcurr_GOP を最初のGOPに設定した
後、ステツプSP4において、現在符号化対象としてい
るGOPcurr_GOP に対応する各フレーム毎の割当て符
号量Tj をRAM7Cより順次読み出し、現在符号化対
象としているGOPcurr_GOP における1フレーム当た
りの平均ビツトレートcurr_brを、平均符号化データ速
度として、次式
[0070] Subsequently CPU7B, in step SP3, after setting the counter curr_GOP the first GOP, in step SP4, sequentially from RAM7C allocation amount of codes T j for each frame corresponding to GOPcurr_GOP currently a coded The average bit rate per frame curr_br in the GOPcurr_GOP to be read and currently encoded is defined as the average encoded data rate by the following equation.

【数27】 を用いて算出する。ここでこの映像信号符号化装置1
は、可変レート符号化方式を採用しているので、ステツ
プSP4において算出した平均ビツトレートCurr_brは
GOP毎に変化することになる。
[Equation 27] Is calculated using Here, the video signal encoding device 1
Adopts a variable rate coding method, the average bit rate Curr_br calculated in step SP4 changes for each GOP.

【0071】平均ビツトレートCurr_brの算出処理につ
いて図5に示すフローチヤートを用いて説明する。CP
U7Bは、ステツプSP30より平均ビツトレートCurr
_brの算出処理を開始し、ステツプSP31において、
フレーム数をカウントするカウンタのカウンタ値kを初
期化すると共に、符号化対象としているGOPcurr_GO
P 中における各フレームの割当て符号量Tj の累積値を
演算する演算器の累計値sum を初期化した後、ステツプ
SP32において、符号化対象としているGOPcurr_
GOP中のk番目のフレームの割当て符号量Tk を演算器
の累積値sum に足し込む。
The calculation of the average bit rate Curr_br will be described with reference to the flowchart shown in FIG. CP
U7B calculates the average bit rate Curr from step SP30.
_Br calculation processing is started, and in step SP31,
The counter value k of the counter for counting the number of frames is initialized, and the GOPcurr_GO to be encoded is initialized.
After initializing the cumulative value sum arithmetic unit for calculating a cumulative value of the assignment code amount T j of each frame in the P, in step SP32, GOPcurr_ it is encoding target
The allocated code amount T k of the k-th frame in the GOP is added to the accumulated value sum of the arithmetic unit.

【0072】続いてCPU7Bは、ステツプSP33に
おいて、カウンタのカウント値kと符号化対象としてい
るGOPcurr_GOP 中のフレーム数Nとを比較し、カウ
ンタのカウント値kとフレーム数Nとが一致していない
と判断したときには、当該GOPcurr_GOP 中の全ての
フレームについての割当て符号量Tj が累積値sum に累
積されていないと判断してステツプSP34に進み、カ
ウンタのカウント値kをインクリメントしてステツプS
P32に進む。
Subsequently, in step SP33, the CPU 7B compares the count value k of the counter with the number N of frames in the GOPcurr_GOP to be encoded, and determines that the count value k of the counter does not match the frame number N. If it is determined, the process proceeds to step SP34 it is determined that the allocated code amount T j for all frames in the GOPcurr_GOP is not accumulated in the cumulative value sum, step S increments the count value k of the counter
Proceed to P32.

【0073】すなわちCPU7Bは、現在符号化対象と
しているGOPcurr_GOP 中の全てのフレームの割当て
符号量Tj の累積値sum を得るまでステツプSP32か
らステツプSP34までの処理ループを実行する。CP
U7Bは、ステツプSP33において肯定結果を得る
と、ステツプSP35に進んで、累積値sum 及びピクチ
ヤレート Picture_rateに基づいて、符号化対象として
いるGOPcurr_GOP における1フレーム当たりの平均
ビツトレートCurr_brを算出し、ステツプSP36にお
いて平均ビツトレートCurr_brの算出処理を終了してメ
インルーチンのステツプSP5に進む。
That is, the CPU 7B executes a processing loop from step SP32 to step SP34 until the accumulated value sum of the allocated code amounts T j of all the frames in the GOPcurr_GOP to be currently encoded is obtained. CP
When the U7B obtains a positive result in step SP33, it proceeds to step SP35, calculates an average bit rate Curr_br per frame in the GOPcurr_GOP to be coded based on the accumulated value sum and the picture rate Picture_rate, and calculates an average bit rate Curr_br in step SP36. The calculation processing of the bit rate Curr_br ends, and the flow advances to step SP5 of the main routine.

【0074】CPU7Bは、ステツプSP5において、
平均ビツトレートCurr_br及びピクチヤレート Picture
_rateに基づき、次式
The CPU 7B determines in step SP5
Average bitrate Curr_br and picture rate Picture
Based on _rate,

【数28】 を用いて第1のパラメータrを算出する。すなわちCP
U7Bは、単位時間当たりに伝送されてくるフレーム画
像のデータ量(ピクチヤレート Picture_rate)に対す
る平均ビツトレートCurr_br(平均符号化データ速度)
の割合いで表される第1のパラメータrを算出する。こ
こでステツプSP4において算出した平均ビツトレート
Curr_brはGOP毎に変化するので、これに連動して第
1のパラメータrもGOP毎に変化することになる。
[Equation 28] Is used to calculate a first parameter r. That is, CP
U7B is an average bit rate Curr_br (average encoded data rate) with respect to a data amount (picture rate) of a frame image transmitted per unit time.
A first parameter r represented by the following ratio is calculated. Here, the average bit rate calculated in step SP4
Since Curr_br changes for each GOP, the first parameter r also changes for each GOP in conjunction with this.

【0075】次いでCPU7Bは、ステツプSP6にお
いて、ステツプSP2においてそれぞれIピクチヤ、P
ピクチヤ及びBピクチヤ毎に設定した初期値としての平
均量子化ステツプ(qIPREVave 、(qPPREVave
及び(qBPREVave と、ステツプSP5において算出
した第1のパラメータrとに基づき、次式
Next, in step SP6, the CPU 7B executes the I-picture and the P-picture in step SP2, respectively.
Average quantization steps (qI PREV ) ave , (qP PREV ) ave as initial values set for each picture and B picture
Based on (qB PREV ) ave and the first parameter r calculated in step SP5,

【数29】 (Equation 29)

【数30】 [Equation 30]

【数31】 をそれぞれ用いて、現在符号化対象としているフレーム
の各マクロブロツクjについての参照量子化ステツプQ
j を算出する際に用いる各画像タイプ毎に用意された仮
想的なバツフアの充満度dI0 、dP0 及びdB0 を第
3のパラメータとして算出する。
(Equation 31) , The reference quantization step Q for each macroblock j of the frame currently being encoded.
The filling degree dI 0 , dP 0, and dB 0 of the virtual buffer prepared for each image type used in calculating j are calculated as the third parameter.

【0076】ここで従来のテストモデルは、第1のパラ
メータrが固定であつた(すなわちビツトレートが固定
であつた)ため学習効果を利用することができたが、本
発明では、ビツトレートがGOP毎に変化するために第
1のパラメータrもGOP毎に変化するため、そのまま
では学習効果を得ることができない。このため本発明に
おいては、第1のパラメータrの変化に伴つて仮想的な
バツフアの充満度dI 0 、dP0 及びdB0 をGOP毎
に計算する。
Here, the conventional test model corresponds to the first parameter.
The meter r is fixed (that is, the bit rate is fixed).
I was able to use the learning effect because
In the invention, since the bit rate changes for each GOP,
Since the parameter r of 1 also changes for each GOP,
Cannot achieve learning effects. For this reason, the present invention
In this case, the virtual value is changed with the change of the first parameter r.
Buffer filling degree dI 0, DP0And dB0For each GOP
To calculate.

【0077】ここで後述するように、デイジタル映像信
号S1において最初のGOP以降のGOPにおける各画
像タイプ毎の仮想的なバツフアの充満度dI0 、dP0
及びdB0 を算出する際には、ステツプSP6における
平均量子化ステツプ(qIPREVave 、(qPPREV
ave 及び(qBPREVave として、それぞれ1つ前のG
OPにおける各画像タイプ毎の参照量子化ステツプQの
平均値を用いる。
As will be described later, in the digital video signal S1, the virtual buffer fullness dI 0 , dP 0 for each image type in the GOPs after the first GOP.
When calculating the average quantization step and dB 0 , the average quantization steps (qI PREV ) ave and (qP PREV ) in step SP6 are used.
ave and (qB PREV ) ave , the previous G
The average value of the reference quantization steps Q for each image type in the OP is used.

【0078】従つてデイジタル映像信号S1において最
初のGOPを符号化対象としているときだけ、平均量子
化ステツプ(qIPREVave 、(qPPREVave 及び
(qBPREVave として、ステツプSP2において設定
した値を初期値として用いることにより、各画像タイプ
毎の仮想的なバツフアの充満度dI0 、dP0 及びdB
0 を算出し、最初のGOP以外のGOPを符号化対象と
している場合には、ステツプSP6における平均量子化
ステツプ(qIPREVave 、(qPPREVave 及び(q
PREVave として、それぞれ時間的に1つ前のGOP
における各画像タイプ毎の参照量子化ステツプQの平均
値を初期値として用いることにより、各画像タイプ毎の
仮想的なバツフアの充満度dI0 、dP0 及びdB0
算出するようになされている。従つて平均量子化ステツ
プ(qIPREVave 、(qPPREVave 及び(q
PREVave は、GOP毎に更新されることになる。
Therefore, only when the first GOP in the digital video signal S1 is to be coded, the average quantization steps (qI PREV ) ave , (qP PREV ) ave and (qB PREV ) ave are set in step SP2. By using the values as initial values, the virtual buffer fullness dI 0 , dP 0 and dB for each image type
0 is calculated, and if a GOP other than the first GOP is to be encoded, the average quantization steps (qI PREV ) ave , (qP PREV ) ave and (q
B PREV ) As ave , the GOP one time earlier
By using the average value of the reference quantization steps Q for each image type as the initial value, the virtual buffer fullness dI 0 , dP 0 and dB 0 for each image type is calculated. . Therefore, the average quantization steps (qI PREV ) ave , (qP PREV ) ave and (q
B PREV ) ave is updated every GOP.

【0079】従つてステツプSP6において算出した仮
想的なバツフアの充満度dI0 、dP0 又はdB0 は、
第1のパラメータrがGOP毎に変動すると共に、平均
量子化ステツプ(qIPREVave 、(qPPREVave
び(qBPREVave もGOP毎に変動するので、ステツ
プSP6において算出した第3のパラメータとしての仮
想的なバツフアの充満度d*0 (すなわちdI0 、dP
0 及びdB0 )はGOP毎に更新されることになる。
Accordingly, the virtual buffer fullness dI 0 , dP 0 or dB 0 calculated in step SP 6 is
The first parameter r varies for each GOP, and the average quantization steps (qI PREV ) ave , (qP PREV ) ave, and (qB PREV ) ave also vary for each GOP, so the third parameter r calculated in step SP6. The virtual buffer fullness d * 0 as a parameter (ie dI 0 , dP
0 and dB 0 ) will be updated for each GOP.

【0080】次いでCPU7Bは、ステツプSP7にお
いて、現在符号化対象としているGOPの次のGOPに
おける各画像タイプ毎の仮想的なバツフアの充満度dI
0 、dP0 及びdB0 を算出する際に用いる平均量子化
ステツプ(qIPREVave 、(qPPREVave 及び(q
PREVave を算出するために、Iピクチヤ、Pピクチ
ヤ及びBピクチヤ毎にそれぞれ用意された参照量子化ス
テツプQの合計値を計算する加算器qIsum 、qPsum
及びqBsum を初期化すると共に、各画像タイプ毎のマ
クロブロツクの数をカウントするカウンタmb_num I、
mb_num P及びmb_num Bを初期化する。
Next, in step SP7, the CPU 7B fills the virtual buffer fullness dI for each image type in the GOP next to the GOP currently being encoded.
0 , dP 0 and dB 0 used in calculating the average quantization steps (qI PREV ) ave , (qP PREV ) ave and (q
To calculate the B PREV) ave, I picture, P picture and B picture to calculate the total value of the reference quantization step Q, which is prepared respectively for each adder qI sum, qP sum
And a counter mb_num I that initializes qB sum and counts the number of macroblocks for each image type.
Initialize mb_num P and mb_num B.

【0081】すなわちCPU7Bは、現在符号化対象と
しているGOP中の全てのフレームの全てのマクロブロ
ツクについて、各画像タイプ毎に参照量子化ステツプQ
の値をそれぞれ加算器qIsum 、qPsum 及びqBsum
に足し込んでいくと共にマクロブロツク数をカウントす
る。従つて加算器qIsum 、qPsum 及びqBsum 及び
カウンタmb_num I、mb_num P及びmb_num Bは、G
OP毎に初期化される。
That is, the CPU 7B sets the reference quantization step Q for each image type for all macroblocks of all frames in the GOP to be encoded.
Are added to adders qI sum , qP sum and qB sum , respectively.
And the number of macroblocks is counted. Accordingly, the adders qI sum , qP sum and qB sum and the counters mb_num I, mb_num P and mb_num B are G
Initialized for each OP.

【0082】次いでCPU7Bは、ステツプSP8にお
いて、現在符号化対象としているフレームCurr_frame
を現在符号化対象としているGOPcurr_GOP 中の最初
のフレームに設定した後、ステツプSP9において、現
在符号化対象としているフレームについてのマクロブロ
ツクカウンタjを初期化する。続いてCPU7Bは、ス
テツプSP10において、次式
Next, in step SP8, the CPU 7B changes the frame Curr_frame to be currently encoded.
Is set to the first frame in the GOPcurr_GOP currently being encoded, and in step SP9, the macroblock counter j for the frame currently being encoded is initialized. Subsequently, in step SP10, the CPU 7B calculates the following equation.

【数32】 を用いて、現在符号化対象としているフレームCurr_fr
ame 中において現在符号化対象としているマクロブロツ
クjについての参照量子化ステツプQj を算出する際に
用いる仮想的なバツフアの充満度d*j (dIj 、dP
j 又はdBj )を第2のパラメータとして算出する。こ
こでCPU7Bは、(32)式におけるd*0 として、
各画像タイプに応じて、ステツプSP6において算出し
た仮想的なバツフアの充満度dI0 、dP0又はdB0
を初期値として用いる。
(Equation 32) , The current frame to be encoded Curr_fr
ame, a virtual buffer fullness d * j (dI j , dP j) used to calculate the reference quantization step Q j for the macro block j currently being encoded.
j or dB j ) is calculated as the second parameter. Here, the CPU 7B calculates d * 0 in Expression (32) as
According to each image type, the virtual buffer fullness dI 0 , dP 0 or dB 0 calculated in step SP6.
Is used as an initial value.

【0083】ここでBj-1 は、現在符号化対象としてい
るフレームCurr_frame における最初のマクロブロツク
から(j−1)番目のマクロブロツクまでに実際に発生
した発生符号量(使用符号量)の合計を表し、Tcurr_
frame は現在符号化対象としているフレームCurr_fram
e の割当て符号量Tを表す。従つてd*j は、現在符号
化対象としているフレームのj番目のマクロブロツクに
ついての参照量子化ステツプQj を算出する時点におけ
る仮想的なバツフアの充満度を表している。またMB_cn
t は、符号化対象としているフレームにおけるマクロブ
ロツク数を表す。
Here, B j−1 is the sum of the generated code amount (used code amount) actually generated from the first macro block to the (j−1) th macro block in the frame Curr_frame to be currently encoded. And Tcurr_
frame is the current frame to be encoded Curr_fram
e represents the allocated code amount T of e. Accordance connexion d * j represents the imaginary buffer fullness at the time of calculating a reference quantization step Q j for the j-th macroblock of the frame being currently encoded object. Also MB_cn
t represents the number of macroblocks in the frame to be encoded.

【0084】従つてCPU7Bは、ステツプSP6にお
いて算出した各画像タイプ毎の第3のパラメータとして
の仮想的なバツフアの充満度d*0 (dI0 、dP0
はdB0 )を初期値として、当該第3のパラメータに、
(j−1)番目のマクロブロツクまでに実際に発生した
発生符号量Bj-1 と、現在符号化対象としているフレー
ムCurr_frame の割当て符号量Tcurr_frame を現在符
号化対象としているフレームCurr_frame の各マクロブ
ロツクに均等に割り当てたと想定したときのj−1番目
までの想定割当て符号量の合計((j−1)×Tcurr_
frame /MB_cnt )との差分(マクロブロツク毎の差
分)を反映させたものを、現在符号化対象としているマ
クロブロツクjについての参照量子化ステツプQj を算
出する際に用いる第2のパラメータとしての仮想的なバ
ツフアの充満度d*j (dIj 、dPj 又はdBj )と
して算出する。これにより、ステツプSP5において算
出した第1のパラメータrが、現在符号化対象としてい
るGOPCurr_GOP において変化しないように、第2の
パラメータとしての仮想的なバツフアの充満度d*j
マクロブロツク毎に制御するようになされている。
Accordingly, the CPU 7B sets the virtual buffer fullness d * 0 (dI 0 , dP 0 or dB 0 ) as the third parameter for each image type calculated in step SP6 as an initial value. The third parameter is
And (j-1) -th generated code amount B j-1 that actually occurs until macroblock, frame Curr_frame that the assigned code amount T curr _ frame of frame Curr_frame that currently encoded object as the current coded The total ((j−1) × T curr —) of the assumed allocated code amount up to j−1th when it is assumed that the macro blocks are equally allocated.
those reflecting the frame / MB_cnt) and the difference (difference for each macroblock), as a second parameter used for calculating a reference quantization step Q j for macroblock j that is currently encoded object It is calculated as the fullness d * j of the virtual buffer (dI j, dP j or dB j). Thus, the virtual buffer fullness d * j as the second parameter is controlled for each macroblock so that the first parameter r calculated in step SP5 does not change in the current encoding target GOPCurr_GOP. It has been made to be.

【0085】次いでCPU7Bは、ステツプSP11に
おいて、第1のパラメータr及び第2のパラメータとし
ての仮想的なバツフアの充満度d*j に基づき、次式
Next, in step SP11, the CPU 7B calculates the following equation based on the virtual buffer fullness d * j as the first parameter r and the second parameter.

【数33】 を用いて、現在符号化対象としているマクロブロツクj
の参照量子化ステツプQj を算出した後、ステツプSP
12において、当該マクロブロツクjについて算出した
参照量子化ステツプQの値を、画像タイプに応じて加算
器qIsum 、qPsum 又はqBsum に足し込むと共に、
カウンタmb_num I、mb_num P又はmb_num Bをイン
クリメントする。
[Equation 33] , The macro block j currently being encoded
Of reference after calculating the quantization step Q j, step SP
At 12, the value of the reference quantization step Q calculated for the macroblock j is added to an adder qI sum , qP sum or qB sum depending on the image type, and
Increment the counter mb_num I, mb_num P or mb_num B.

【0086】続いてCPU7Bは、ステツプSP13に
おいて、上述したテストモデルにおける第3のステツプ
と同様の処理を行うことにより、マクロブロツクjにつ
いての量子化ステツプMQUANTj を第2の量子化ステツプ
として算出する。すなわちCPU7Bは、まずマクロブ
ロツクjを4つのサブブロツク(輝度ブロツク)sblkに
分割した後、4つの各サブブロツクsblkについて、サブ
ブロツクsblkにおける各画素値Pm と、次式
Subsequently, in step SP13, the CPU 7B calculates the quantization step MQUANT j for the macro block j as the second quantization step by performing the same processing as in the third step in the test model described above. . That is, the CPU 7B first divides the macro block j into four sub-blocks (brightness blocks) sblk, and then, for each of the four sub-blocks sblk, the pixel value P m in the sub-block sblk and the following equation:

【数34】 を用いて算出した当該サブブロツクsblkにおける各画素
値Pm の平均値Pave との差分を2乗したものを、当該
サブブロツクsblkにおける全ての画素(64個)について
算出し、これら各画素毎に算出した演算結果(Pm −P
ave 2 の合計を当該サブブロツクsblkにおけるアクテ
イビテイ varsblkとして次式
(Equation 34) Is calculated by squaring the difference between the average value P ave of each pixel value P m in the sub-block sblk and the average value P ave of all the pixels (64) in the sub-block sblk, and calculating for each of these pixels Calculation result (P m -P
ave ) The sum of 2 is defined as the activity var sblk in the corresponding sub-block sblk as follows:

【数35】 を用いて算出し、次式(Equation 35) Is calculated using the following equation.

【数36】 を用いて、4つのサブブロツクsblkのうち、最小のアク
テイビテイ varsblkをもつサブブロツクsblkのアクテイ
ビテイ varsblkをマクロブロツクjについてのアクテイ
ビテイ actj として算出する。
[Equation 36] Using, among the four sub-blocks sblk, calculates the Akuteibitei var sblk of subblock sblk with the smallest Akuteibitei var sblk as Akuteibitei act j for macroblock j.

【0087】次いでCPU7Bは、マクロブロツクjに
ついてのアクテイビテイ actj を次式
Next, the CPU 7B calculates the activity act j for the macro block j by the following equation.

【数37】 を用いて正規化した後、正規化した係数 N_ actj と、
ステツプSP11で算出した参照量子化ステツプQj
に基づき、次式
(37) After normalizing using, the normalized coefficient N_act j and
Based on a reference quantization step Q j calculated in step SP11, the following equation

【数38】 を用いて、マクロブロツクjについての最終的な量子化
ステツプMQUANTj を算出する。
(38) Is used to calculate the final quantization step MQUANT j for macro block j.

【0088】続いてCPU7Bは、ステツプSP14に
おいて、現在符号化対象としているマクロブロツクjが
現在符号化対象としているフレームCurr_frame におけ
る最後のマクロブロツクか否かを判定し、否定結果を得
たときには、ステツプSP15に進んで、次のマクロブ
ロツクを符号化対象としてフレームカウンタjをインク
リメントとし、ステツプSP10からステツプSP13
までの処理を実行する。すなわちCPU7Bは、ステツ
プSP14において肯定結果を得るまで、すなわち現在
符号化対象としているフレームCurr_frame の全てのマ
クロブロツクについて量子化ステツプMQUANTを算出する
まで、ステツプSP10からステツプSP15までの処
理ループを実行する。
Subsequently, in step SP14, the CPU 7B determines whether or not the current macroblock j to be coded is the last macroblock in the current frame to be coded Curr_frame. If a negative result is obtained, the CPU 7B proceeds to step SP14. Proceeding to SP15, the next macroblock is to be coded, the frame counter j is incremented, and steps SP10 to SP13 are executed.
Execute the processing up to. That is, the CPU 7B executes a processing loop from step SP10 to step SP15 until a positive result is obtained in step SP14, that is, until the quantization step MQUANT is calculated for all the macroblocks of the frame Curr_frame to be currently encoded.

【0089】CPU7Bは、ステツプSP14において
肯定結果を得ると、ステツプSP16に進んで、現在符
号化対象としているフレームCurr_frame が現在符号化
対象としているGOPCurr_GOP における最後のフレー
ムであるか否かを判定し、否定結果を得たときには、ス
テツプSP17に進んで処理対象を次のフレームに設定
し、ステツプSP10からステツプSP15までの処理
ループを実行する。すなわちCPU7Bは、ステツプS
P16において肯定結果を得るまで、すなわち現在符号
化対象としているGOPCurr_GOP 中の全てのフレーム
における全てのマクロブロツクについて量子化ステツプ
MQUANTを算出するまで、ステツプSP9からステツプS
P17までの処理ループを実行する。
When the CPU 7B obtains an affirmative result in step SP14, it proceeds to step SP16, and determines whether or not the current encoding target frame Curr_frame is the last frame in the current encoding target GOPCurr_GOP. If a negative result is obtained, the process proceeds to step SP17, where the processing target is set to the next frame, and the processing loop from step SP10 to step SP15 is executed. That is, the CPU 7B determines in step S
Until a positive result is obtained at P16, that is, for all macroblocks in all frames in the GOPCurr_GOP currently being encoded, the quantization step is performed.
Until the MQUANT is calculated, from step SP9 to step S
The processing loop up to P17 is executed.

【0090】CPU7Bは、ステツプSP16において
肯定結果を得ると、ステツプSP18に進んで、現在符
号化対象としているGOPCurr_GOP がデイジルタ映像
信号S1における最後のGOPであるか否かを判定す
る。CPU7Bは、ステツプSP18において否定結果
を得たときには、ステツプSP19に進んで、それぞれ
加算器qIsum 、qPsum 及びqBsum の合計値とカウ
ンタmb_num I、mb_num P及びmb_num Bのカウンタ
値とに基づいて、各画像タイプ毎の参照量子化ステツプ
Qの平均値を算出し、当該各画像タイプ毎の参照量子化
ステツプQの平均値を平均量子化ステツプ(qIPREV
ave 、(qPPREVave 及び(qBPREVave に代入す
ることにより、ステツプSP6で用いる平均量子化ステ
ツプ(qIPREVave 、(qPPREVave 及び(qB
PREVave の値を更新する。
When the CPU 7B obtains an affirmative result in step SP16, it proceeds to step SP18, and determines whether or not the current encoding target GOPCurr_GOP is the last GOP in the digital video signal S1. When a negative result is obtained in step SP18, the CPU 7B proceeds to step SP19, and based on the total values of the adders qI sum , qP sum and qB sum and the counter values of the counters mb_num I, mb_num P and mb_num B, respectively. , The average value of the reference quantization step Q for each image type is calculated, and the average value of the reference quantization step Q for each image type is calculated as the average quantization step (qI PREV ).
By substituting ave , (qP PREV ) ave and (qB PREV ) ave , the average quantization steps (qI PREV ) ave , (qP PREV ) ave and (qB PREV ) used in step SP6.
PREV ) Update the value of ave .

【0091】次いでCPU7Bは、ステツプSP20に
進んで、処理対象を次のGOPに設定し、ステツプSP
4からステツプSP17までの処理ループを実行する。
すなわちCPU7Bは、ステツプSP18において肯定
結果を得るまで、すなわちデイジルタ映像信号S1にお
ける全てのGOP中において、全てのフレームにおける
全てのマクロブロツクについての量子化ステツプMQUANT
を算出するまで、ステツプSP4からステツプSP17
までの処理ループを実行する。CPU7Bは、ステツプ
SP18において肯定結果を得ると、ステツプSP21
において量子化制御アルゴリズムを終了する。
Next, the CPU 7B proceeds to step SP20, sets the processing target to the next GOP, and executes step SP20.
The processing loop from step 4 to step SP17 is executed.
That is, the CPU 7B continues the quantization step MQUANT for all macro blocks in all frames until a positive result is obtained in step SP18, that is, in all GOPs in the digital video signal S1.
Step SP4 to step SP17 until calculation of
Execute the processing loop up to. If the CPU 7B obtains a positive result in step SP18, it proceeds to step SP21.
Ends the quantization control algorithm.

【0092】量子化制御部7は上述の量子化制御アルゴ
リズムに従つて各マクロブロツク毎に算出した量子化ス
テツプMQUANTを量子化回路10に送出し、量子化回路1
0は、DCT回路9から出力されるDCT係数を量子化
制御部7によつて指定された量子化ステツプMQUANTに基
づいて量子化する。かくしてこの映像信号符号化装置1
は、可変レート符号化方式においても量子化制御し得る
ようになされている。
The quantization control unit 7 sends out the quantization step MQUANT calculated for each macroblock to the quantization circuit 10 according to the above-described quantization control algorithm, and the quantization circuit 1
"0" quantizes the DCT coefficient output from the DCT circuit 9 based on the quantization step MQUANT specified by the quantization control unit 7. Thus, the video signal encoding device 1
Is designed to be able to perform quantization control even in a variable rate coding system.

【0093】(2−2)実施例の動作及び効果 以上の構成において、この映像信号符号化装置1は、G
OP毎にGOPにおける1フレーム当たりの平均符号化
データ速度curr_brを算出し、当該平均符号化データ速
度curr_brを用いてGOP毎に第1のパラメータrを算
出するので、第1のパラメータrを各GOPにおける平
均符号化データ速度curr_brに応じて変化させることが
できる。
(2-2) Operation and Effect of Embodiment In the above configuration, the video signal encoding device 1
The average coded data rate curr_br per frame in the GOP is calculated for each OP, and the first parameter r is calculated for each GOP using the average coded data rate curr_br. Can be changed according to the average encoded data rate curr_br at

【0094】またこの映像信号符号化装置1は、現在符
号化対象としているGOPより時間的に1つ前のGOP
における各画像タイプ毎の参照量子化ステツプQの平均
値を初期値としてGOP毎に更新される平均量子化ステ
ツプ(qIPREVave 、(qPPREVave 及び(qB
PREVave を用いて、GOP中における各画像タイプ毎
の各マクロブロツクについての量子化ステツプQを算出
する際に用いる第3のパラメータとしての仮想的なバツ
フアの充満度dIo 、dPo 及びdBo を算出している
ので、GOP毎に第1のパラメータrが変化しても各G
OP間における量子化ステツプの連続性を維持すること
ができる。
The video signal encoding apparatus 1 also includes a GOP temporally one before the GOP currently being encoded.
The average quantization steps (qI PREV ) ave , (qP PREV ) ave, and (qB) are updated for each GOP with the average value of the reference quantization steps Q for each image type in as an initial value.
PREV) using ave, virtual buffer fullness dI o as a third parameter which is used to calculate the quantization step Q for each macroblock of each picture type in the GOP, dP o and dB Since o is calculated, even if the first parameter r changes for each GOP,
The continuity of the quantization step between OPs can be maintained.

【0095】以上の構成によれば、GOP毎にGOPに
おける1フレーム当たりの平均符号化データ速度curr_
brを算出し、当該平均符号化データ速度curr_brを用い
てGOP毎に第1のパラメータrを算出し、現在符号化
対象としているGOPより時間的に1つ前のGOPにお
ける各画像タイプ毎の参照量子化ステツプQの平均値を
初期値としてGOP毎に更新される平均量子化ステツプ
(qIPREVave 、(qPPREVave 又は(qBPREV
ave と、現在符号化対象としているGOPについて算出
した第1のパラメータrとに基づいて、各画像タイプ毎
の各フレームにおける各マクロブロツクについての参照
量子化ステツプQを算出する際に用いる仮想的なバツフ
アの充満度dIo 、dPo 及びdBo を第3のパラメー
タとして算出し、当該仮想的なバツフアの充満度d
o 、dPo 及びdBo に、現在符号化対象としている
マクロブロツクjの1つ前のマクロブロツクまでに実際
に発生した発生符号量の合計と、現在符号化対象として
いるマクロブロツクjの1つ前のマクロブロツクまでの
想定割当て符号量の合計との差分を反映させたものを、
各画像タイプ毎に第2のパラメータとしての仮想的なバ
ツフアの充満度dIj 、dPj 及びdBj として算出
し、当該仮想的なバツフアの充満度dIj 、dPj又は
dBj と、現在符号化対象としているGOPについて算
出した第1のパラメータrとに基づいて、各画像タイプ
毎に各マクロブロツクについての参照量子化ステツプQ
を算出し、当該各参照量子化ステツプQについて画像の
複雑さや動きの激しさを考慮した量子化ステツプMQUANT
を算出したことにより、第1のパラメータrを各GOP
における平均符号化データ速度curr_brに応じて変化さ
せることができると共に、GOP毎に第1のパラメータ
rが変化しても各GOP間における量子化ステツプの連
続性を維持することができる。かくして可変レート符号
化方式に対応し得る量子化制御を行うことのできる映像
信号符号化方法及び映像信号符号化装置を実現し得る。
また図3及び図4に示すような量子化アルゴリズムをプ
ログラムとして記録媒体(ROM7A)に記録すること
により、可変レート符号化方式に対応し得る量子化制御
を行うことのできる映像信号符号化装置を実現すること
ができる。
According to the above configuration, the average coded data rate per frame in the GOP for each GOP curr_
br is calculated, a first parameter r is calculated for each GOP using the average encoded data rate curr_br, and reference is made for each image type in the GOP temporally immediately before the GOP currently being encoded. The average quantization step (qI PREV ) ave , (qP PREV ) ave or (qB PREV ) updated for each GOP with the average value of the quantization step Q as an initial value.
The virtual quantization step Q used for calculating the reference quantization step Q for each macro block in each frame for each image type based on ave and the first parameter r calculated for the GOP currently being encoded. fullness dI o of buffer, dP o and dB o is calculated as the third parameter, fullness d of the virtual buffer
In I o , dP o and dB o , the sum of the generated code amount actually generated up to the macro block immediately before the current macro block j to be encoded and one of the currently encoded macro block j are set. The one that reflects the difference from the total assumed code amount allocated up to the previous macro block is
The virtual buffer fullness dI j , dP j and dB j as a second parameter for each image type is calculated, and the virtual buffer fullness dI j , dP j or dB j and the current code are calculated. On the basis of the first parameter r calculated for the GOP to be quantized, the reference quantization step Q for each macroblock is provided for each image type.
Is calculated, and for each of the reference quantization steps Q, a quantization step MQUANT taking into account the complexity of the image and the intensity of the motion is considered.
Is calculated, the first parameter r is set to each GOP
And the continuity of the quantization step between the GOPs can be maintained even if the first parameter r changes for each GOP. Thus, it is possible to realize a video signal encoding method and a video signal encoding device capable of performing quantization control compatible with a variable rate encoding method.
Also, by recording a quantization algorithm as shown in FIGS. 3 and 4 as a program on a recording medium (ROM 7A), a video signal encoding device capable of performing quantization control compatible with a variable rate encoding method is provided. Can be realized.

【0096】(3)第3実施例 なお上述の実施例においては、デイジタル映像信号S1
を固定の量子化ステツプに基づいて符号化して発生した
発生符号量に基づいて各フレーム毎の割当て符号量を決
定し、当該各フレーム毎の割当て符号量を量子化制御部
7のRAM7Cに格納した場合について述べたが、本発
明はこれに限らず、デイジタル映像信号S1を固定の量
子化ステツプで符号化して発生した発生符号量に基づい
て各GOP毎の割当て符号量を決定し、当該各GOP毎
の割当て符号量を量子化制御部7のRAM7Cに格納し
ておくようにしてもよい。この場合、上述のタイムモデ
ルにおける第1ステツプにおけるR(GOPに与えられ
た残りの割当て符号量)をGOP毎に変えて、テストモ
デルにおける第1ステツプと同様の処理を行うことによ
り各フレームに対して割当て符号量を割り当てた後、本
発明の量子化制御アルゴリズムを適用する。
(3) Third Embodiment In the above embodiment, the digital video signal S1
Is determined on the basis of the generated code amount generated by encoding based on the fixed quantization step, and the allocated code amount for each frame is stored in the RAM 7C of the quantization control unit 7. Although the case has been described, the present invention is not limited to this, the code amount allocated to each GOP is determined based on the generated code amount generated by encoding the digital video signal S1 at a fixed quantization step, and The assigned code amount for each may be stored in the RAM 7C of the quantization control unit 7. In this case, the same processing as in the first step in the test model is performed by changing R (the remaining code amount given to the GOP) in the first step in the above-described time model for each GOP. After allocating the allocated code amount, the quantization control algorithm of the present invention is applied.

【0097】また上述の実施例においては、デイジタル
映像信号S1を固定の量子化ステツプに基づいて符号化
して発生した発生符号量に基づいて決定した各フレーム
毎の割当て符号量を予め量子化制御部7のRAM7Cに
格納しておいた場合について述べたが、本発明はこれに
限らず、デイジタル映像信号S1を固定の量子化ステツ
プで符号化して発生した発生符号量に基づいて各フレー
ム毎の割当て符号量を決定するステツプを、図3及び図
4に示す量子化アルゴリズムの最初の処理ステツプとし
てプログラムしてもよい。
Also, in the above-described embodiment, the quantization control unit preliminarily sets the assigned code amount for each frame determined based on the generated code amount generated by coding the digital video signal S1 based on the fixed quantization step. 7 is stored in the RAM 7C, but the present invention is not limited to this, and the allocation for each frame is performed based on the generated code amount generated by coding the digital video signal S1 at a fixed quantization step. The step of determining the code amount may be programmed as the first processing step of the quantization algorithm shown in FIGS.

【0098】さらに上述の実施例においては、GOPを
第1の映像単位として平均符号化データ速度を算出した
場合について述べたが、本発明はこれに限らず、図6に
示すように、現在符号化対象としているフレームを含ん
でフレームを1つずつスライドさせていくようにして平
均ビツトレートを算出するようにしてもよい。この場
合、現在符号化対象としているフレームを含んでフレー
ムを所定数分スライドさせていくようにしてもよい。ま
たGOPよりも大きな映像単位、例えば2GOP単位で
平均ビツトレートを算出したり、GOPより小さな単位
で平均ビツトレートを算出するようにしてもよい。この
図6においては、N=6の場合の例である。
Further, in the above-described embodiment, the case where the average encoded data rate is calculated using the GOP as the first video unit has been described. However, the present invention is not limited to this, and as shown in FIG. The average bit rate may be calculated by sliding the frames one by one including the frame to be converted. In this case, the frame may be slid by a predetermined number including the frame currently being encoded. The average bit rate may be calculated in video units larger than the GOP, for example, in units of 2 GOPs, or the average bit rate may be calculated in units smaller than the GOP. FIG. 6 shows an example where N = 6.

【0099】さらに上述の実施例においては、映像信号
符号化装置1において、デイジタル映像信号S1を固定
の量子化ステツプで符号化した際に発生した発生符号量
に基づいて各フレーム毎の割当て符号量を決定し、当該
各フレーム毎の割当て符号量を量子化制御部7のRAM
7Cに格納した場合について述べたが、本発明はこれに
限らず、別の映像信号符号化装置を用いて各フレーム毎
の割当て符号量を算出し、当該各フレーム毎の割当て符
号量を量子化制御部7に送出してRAM7Cに格納させ
るようにしてもよい。
Further, in the above-described embodiment, the video signal encoding apparatus 1 allocates the code amount for each frame based on the code amount generated when the digital video signal S1 is coded by the fixed quantization step. Is determined, and the allocated code amount for each frame is stored in the RAM of the quantization control unit 7.
7C, but the present invention is not limited to this, and another video signal encoding device is used to calculate the allocated code amount for each frame and quantize the allocated code amount for each frame. The data may be sent to the control unit 7 and stored in the RAM 7C.

【0100】さらに上述の実施例においては、平均量子
化ステツプ(qIPREVave 、(qPPREVave 及び
(qBPREVave をGOP毎に算出した場合について述
べたが、本発明はこれに限らず、例えばフレーム単位毎
に平均量子化ステツプ(qIPREVave 、(qPPREV
ave 及び(qBPREVave を算出するようにしてもよ
い。この場合、現在符号化対象としているGOP中にお
ける全てのフレームの全てのマクロブロツクについての
量子化ステツプMQUANTの算出が終了した後、各フレーム
毎に求まつている平均量子化ステツプに基づいて、各画
像タイプ毎の平均量子化ステツプ(qIPREVave
(qPPREVave 及び(qBPREVave を算出し、ステ
ツプSP6における平均量子化ステツプ(qIPREV
ave 、(qPPREVave 及び(qBPREVave をGOP
毎に更新する。
Further, in the above embodiment, the case where the average quantization steps (qI PREV ) ave , (qP PREV ) ave and (qB PREV ) ave are calculated for each GOP has been described, but the present invention is not limited to this. For example, the average quantization step (qI PREV ) ave , (qP PREV ) for each frame unit
ave and (qB PREV ) ave may be calculated. In this case, after the calculation of the quantization step MQUANT for all the macroblocks of all the frames in the GOP currently being encoded is completed, each of the macroblocks is calculated based on the average quantization step obtained for each frame. Average quantization step for each image type (qI PREV ) ave ,
(QP PREV ) ave and (qB PREV ) ave are calculated, and the average quantization step (qI PREV ) in step SP6 is performed.
Gave ave , (qP PREV ) ave and (qB PREV ) ave
Update every time.

【0101】さらに上述の実施例においては、図3及び
図4に示した量子化制御アルゴリズムをプログラムとし
て有するROM7Aを用いて可変レート符号化方式に対
応し得る量子化制御を行うようにした場合について述べ
たが、本発明はこれに限らず、図3及び図4に示した量
子化制御アルゴリズムをハードウエアで実現するように
してもよい。
Further, in the above-described embodiment, a case is described in which the ROM 7A having the programs for the quantization control algorithms shown in FIGS. 3 and 4 is used to perform quantization control compatible with the variable rate coding method. As described above, the present invention is not limited to this, and the quantization control algorithm shown in FIGS. 3 and 4 may be realized by hardware.

【0102】[0102]

【発明の効果】上述のように本発明によれば、第1の映
像単位又は第2の映像単位毎の割当て符号量に基づい
て、第1の映像単位における第2の映像単位当たりの平
均符号化データ速度を算出し、単位時間当たりに伝送さ
れてくる第2の映像単位に応じた画像のデータ量に対す
る平均符号化データ速度の割合いで表される第1のパラ
メータを第1の映像単位毎に算出し、符号化対象として
いる第2の映像単位に対する割当て符号量と、実際に符
号化して発生した発生符号量との差分を第3の映像単位
毎に算出し、当該第3の映像単位毎の差分を、符号化対
象としている第3の映像単位についての第1の量子化ス
テツプを算出する際に反映させるための第2のパラメー
タを算出し、第1のパラメータ及び第2のパラメータに
基づいて符号化対象としている第3の映像単位について
の第1の量子化ステツプを算出することにより、第1の
パラメータを各第1の映像単位における平均符号化デー
タ速度に応じて変化させることができる。かくして可変
レート符号化方式に対応し得る量子化制御を行うことの
できる映像信号符号化方法、映像信号符号化装置及び記
録媒体を実現することができる。
As described above, according to the present invention, the average code per second video unit in the first video unit is determined based on the allocated code amount for each of the first video unit and the second video unit. A first parameter expressed as a ratio of an average encoded data rate to an image data amount corresponding to a second video unit transmitted per unit time is calculated for each first video unit. Is calculated for each third video unit, and the difference between the allocated code amount for the second video unit to be encoded and the generated code amount actually generated by encoding is calculated for each third video unit. A second parameter is calculated to reflect the difference for each encoding when calculating the first quantization step for the third video unit to be encoded, and is used as the first parameter and the second parameter. To be coded based on And by calculating the first quantization step for it is the third video unit can be changed in accordance with the first parameter to the average coding data rate in each of the first video unit. Thus, it is possible to realize a video signal encoding method, a video signal encoding device, and a recording medium that can perform quantization control compatible with a variable rate encoding method.

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

【図1】本発明を適用した映像信号符号化装置の全体構
成を示すブロツク図である。
FIG. 1 is a block diagram showing an overall configuration of a video signal encoding apparatus to which the present invention is applied.

【図2】量子化制御部の構成を示すブロツク図である。FIG. 2 is a block diagram showing a configuration of a quantization control unit.

【図3】量子化制御部における量子化アルゴリズム
(1)の説明に供するフローチヤートである。
FIG. 3 is a flowchart for explaining a quantization algorithm (1) in a quantization control unit;

【図4】量子化制御部における量子化アルゴリズム
(2)の説明に供するフローチヤートである。
FIG. 4 is a flowchart for explaining a quantization algorithm (2) in a quantization control unit;

【図5】平均ビツトレートの算出処理の処理手順の説明
に供するフローチヤートである。
FIG. 5 is a flowchart for explaining a processing procedure of an average bit rate calculation process.

【図6】他の実施例による平均ビツトレートの算出方法
の説明に供する略線図である。
FIG. 6 is a schematic diagram for explaining a method of calculating an average bit rate according to another embodiment.

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

1……映像信号符号化装置、2……画像符号化タイプ指
定回路、3……画像符号化順序並替え回路、4……スキ
ヤンコンバータ、5……予測モード決定回路、6……動
きベクトル検出回路、7……量子化制御回路、7A……
ROM、7B……CPU、7C……RAM、8……演算
回路、9……DCT回路、10……量子化回路、11…
…可変長符号化回路、12……逆量子化回路、13……
バツフア、14……IDCT回路、15……演算器、1
6……フレームメモリ、17……動き補償回路。
DESCRIPTION OF SYMBOLS 1 ... Video signal coding apparatus, 2 ... Picture coding type designation circuit, 3 ... Picture coding order rearrangement circuit, 4 ... Scan converter, 5 ... Prediction mode decision circuit, 6 ... Motion vector detection Circuit 7, Quantization control circuit, 7A ...
ROM, 7B CPU, 7C RAM, 8 arithmetic circuit, 9 DCT circuit, 10 quantization circuit, 11
... variable length coding circuit, 12 ... inverse quantization circuit, 13 ...
Buffer 14, IDCT circuit 15, arithmetic unit 1,
6 ... frame memory, 17 ... motion compensation circuit.

─────────────────────────────────────────────────────
────────────────────────────────────────────────── ───

【手続補正書】[Procedure amendment]

【提出日】平成9年2月24日[Submission date] February 24, 1997

【手続補正1】[Procedure amendment 1]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0061[Correction target item name] 0061

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0061】演算回路8はスキヤンコンバータ4から送
出される参照画像のマクロブロツクのデータから、動き
補償回路17から送出された当該マクロブロツクに対応
する予測参照画像の画像データを減算して予測残差とし
ての差分データを得、この差分データをDCT回路9に
送出する。この差分データはDCT回路9、量子化回路
10、可変長符号化回路11及びバツフア13を介して
量子化制御回路7に送出されると共に外部に送出され
る。またこの差分データは逆量子化回路12及びIDC
T回路14によつて局所的に復号されて演算器15に送
出される。演算器15はIDCT回路14から送出され
る差分データに、動き補償回路17から送出される予測
参照画像の画像データを加算する。これにより局所的に
復号したBピクチヤの画像データから得られる。ここで
Bピクチヤは他の画像の予測画像として使用されないの
でフレームメモリ16には格納されない。
The arithmetic circuit 8 subtracts the image data of the predicted reference image corresponding to the macroblock sent from the motion compensation circuit 17 from the macroblock data of the reference image sent from the scan converter 4 to obtain a prediction residual. And sends the difference data to the DCT circuit 9. The difference data is sent to the quantization control circuit 7 via the DCT circuit 9, the quantization circuit 10, the variable length coding circuit 11 and the buffer 13, and is sent to the outside. The difference data is supplied to the inverse quantization circuit 12 and the IDC.
The data is locally decoded by the T circuit 14 and sent to the arithmetic unit 15. The calculator 15 adds the image data of the predicted reference image sent from the motion compensation circuit 17 to the difference data sent from the IDCT circuit 14. As a result, it is obtained from locally decoded image data of B picture. Here, the B picture is not stored in the frame memory 16 because it is not used as a predicted image of another image.

【手続補正2】[Procedure amendment 2]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0067[Correction target item name] 0067

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0067】量子化制御部7における量子化制御アルゴ
リズムについて図3、図4及び図5に示すフローチヤー
トを用いて説明する。ここでこの映像信号符号化装置1
は、符号化方法として可変レート符号化方式を採用して
おり、量子化制御アルゴリズムを開始する前に、まずデ
イジタル映像信号S1を固定の量子化ステツプで符号化
した際に発生した発生符号量に基づいて各フレーム毎の
割当て符号量T(j=1,……,N)を決定し、当該
各フレーム毎の割当て符号量Tを量子化制御部7のR
AM7Cに格納しているものとする。
The quantization control algorithm in the quantization control unit 7 will be described with reference to the flowcharts shown in FIGS. 3, 4 and 5. Here, the video signal encoding device 1
Adopts a variable rate coding method as a coding method. Before starting a quantization control algorithm, firstly, the generated code amount generated when the digital video signal S1 is coded by a fixed quantization step is calculated. based allocated code amount T j for each frame (j = 1, ......, N ) is determined and the allocation amount of codes T j for each said respective frame of the quantization control unit 7 R
It is assumed that it is stored in AM7C.

Claims (18)

【特許請求の範囲】[Claims] 【請求項1】デイジタル映像信号を固定の量子化ステツ
プに基づいて符号化することにより発生した発生符号量
に基づいて第1の映像単位又は第2の映像単位毎の割当
て符号量を算出し、当該割当て符号量に応じて上記デイ
ジタル映像信号を符号化する映像信号符号化方法におい
て、 上記第1の映像単位又は上記第2の映像単位毎の割当て
符号量に基づいて、上記第1の映像単位における上記第
2の映像単位当たりの平均符号化データ速度を算出する
平均符号化データ速度算出ステツプと、 単位時間当たりに伝送されてくる上記第2の映像単位に
応じた画像のデータ量に対する上記平均符号化データ速
度の割合いで表される第1のパラメータを上記第1の映
像単位毎に算出する第1のパラメータ算出ステツプと、 符号化対象としている第2の映像単位に対する割当て符
号量と、当該第2の映像単位において現在までに符号化
して実際に発生した発生符号量との差分を第3の映像単
位毎に算出し、当該第3の映像単位毎の差分を、符号化
対象としている第3の映像単位についての第1の量子化
ステツプを算出する際に反映させるための第2のパラメ
ータを算出する第2のパラメータ算出ステツプと、 上記第1のパラメータ及び上記第2のパラメータに基づ
いて上記符号化対象としている第3の映像単位について
の上記第1の量子化ステツプを算出する第1の量子化ス
テツプ算出ステツプとを具えることを特徴とする映像信
号符号化方法。
And calculating an allocated code amount for each of the first video unit and the second video unit based on a generated code amount generated by coding the digital video signal based on a fixed quantization step. In the video signal encoding method for encoding the digital video signal according to the allocated code amount, the first video unit is set based on the allocated code amount for each of the first video unit and the second video unit. Calculating the average encoded data rate per second video unit in the above-mentioned method, and calculating the average for the data amount of the image corresponding to the second video unit transmitted per unit time. A first parameter calculation step of calculating a first parameter expressed by a ratio of an encoded data rate for each of the first video units, and a second parameter to be encoded. The difference between the code amount allocated to the video unit and the generated code amount actually encoded and generated in the second video unit up to now is calculated for each third video unit, and the difference is calculated for each third video unit. A second parameter calculation step for calculating a second parameter for reflecting the difference when calculating a first quantization step for a third video unit to be encoded; and the first parameter And a first quantization step calculating step of calculating the first quantization step for the third video unit to be encoded based on the second parameter. Signal encoding method.
【請求項2】上記第2のパラメータ算出ステツプは、 上記第1の映像単位より時間的に1つ前の第1の映像単
位における各画像符号化タイプ毎の上記第1の量子化ス
テツプの平均値及び上記第1のパラメータに基づいて算
出した第3のパラメータを初期値として、上記第3のパ
ラメータに、上記符号化対象としている第2の映像単位
に対する割当て符号量と、当該第2の映像単位において
現在までに符号化して実際に発生した発生符号量との上
記第3の映像単位毎の上記差分を反映させたものを上記
第2のパラメータとして算出することを特徴とする請求
項1に記載の映像信号符号化方法。
2. The method according to claim 1, wherein the second parameter calculation step comprises averaging the first quantization steps for each image coding type in the first video unit temporally one before the first video unit. Using the value and the third parameter calculated based on the first parameter as initial values, the third parameter includes the code amount allocated to the second video unit to be coded and the second video 2. The method according to claim 1, wherein the second parameter is calculated by reflecting, as a second parameter, a difference between the generated code amount which has been encoded in the unit up to the present and the actually generated code amount for each of the third video units. The video signal encoding method described in the above.
【請求項3】上記第1の映像単位は、グループオブピク
チヤーズであり、 上記第2の映像単位は、フレーム画像であり、 上記第3の映像単位は、マクロブロツクであることを特
徴とする請求項1に記載の映像信号符号化方法。
3. The method according to claim 2, wherein the first video unit is a group of pictures, the second video unit is a frame image, and the third video unit is a macro block. The video signal encoding method according to claim 1.
【請求項4】上記第2の映像単位毎の割当て符号量は、
上記デイジタル映像信号を固定の量子化ステツプに基づ
いて符号化することにより発生した発生符号量に基づい
て上記第1の映像単位毎の割当て符号量を算出し、当該
第1の映像単位毎の割当て符号量に基づいて決定される
ことを特徴とする請求項1に記載の映像信号符号化方
法。
4. The code amount assigned to each second video unit is as follows:
The code amount assigned to each of the first image units is calculated based on the code amount generated by encoding the digital image signal based on a fixed quantization step, and is assigned to each of the first image units. 2. The video signal encoding method according to claim 1, wherein the method is determined based on a code amount.
【請求項5】上記平均符号化データ速度算出ステツプ
は、 符号化対象としている第2の映像単位を含んで上記第2
の映像単位毎に所定数分スライドさせていくようにして
上記第1の映像単位における上記第2の映像単位当たり
の平均符号化データ速度を算出することを特徴とする請
求項1に記載の映像信号符号化方法。
5. The average encoded data rate calculation step includes the second video unit to be encoded.
The video according to claim 1, wherein the average encoded data rate per second video unit in the first video unit is calculated by sliding the video data by a predetermined number for each video unit. Signal encoding method.
【請求項6】上記符号化対象としている第3の映像単位
の各輝度ブロツクにおける画素値に基づいて上記符号化
対象としている第3の映像単位についてのアクテイビテ
イを算出し、当該アクテイビテイ及び上記符号化対象と
している第3の映像単位についての上記第1の量子化ス
テツプに基づいて上記符号化対象としている第3の映像
単位についての第2の量子化ステツプを算出する第2の
量子化ステツプ算出ステツプを具えることを特徴とする
請求項1に記載の映像信号符号化方法。
6. An activity for the third video unit to be encoded is calculated based on a pixel value in each luminance block of the third video unit to be encoded, and the activity and the encoding are calculated. A second quantization step calculation step for calculating a second quantization step for the third video unit to be encoded based on the first quantization step for the third video unit to be encoded; 2. The video signal encoding method according to claim 1, further comprising:
【請求項7】デイジタル映像信号を固定の量子化ステツ
プに基づいて符号化することにより発生した発生符号量
に基づいて第1の映像単位又は第2の映像単位毎の割当
て符号量を算出し、当該割当て符号量に応じて上記デイ
ジタル映像信号を符号化する映像信号符号化装置におい
て、 上記第1の映像単位又は上記第2の映像単位毎の割当て
符号量に基づいて、上記第1の映像単位における上記第
2の映像単位当たりの平均符号化データ速度を算出する
平均符号化データ速度算出手段と、 単位時間当たりに伝送されてくる上記第2の映像単位に
応じた画像のデータ量に対する上記平均符号化データ速
度の割合いで表される第1のパラメータを上記第1の映
像単位毎に算出する第1のパラメータ算出手段と、 符号化対象としている第2の映像単位に対する割当て符
号量と、当該第2の映像単位において現在までに符号化
して実際に発生した発生符号量との差分を第3の映像単
位毎に算出し、当該第3の映像単位毎の差分を、符号化
対象としている第3の映像単位についての第1の量子化
ステツプを算出する際に反映させるための第2のパラメ
ータを算出する第2のパラメータ算出手段と、 上記第1のパラメータ及び上記第2のパラメータに基づ
いて上記符号化対象としている第3の映像単位について
の上記第1の量子化ステツプを算出する第1の量子化ス
テツプ算出手段とを具えることを特徴とする映像信号符
号化装置。
7. An allocated code amount for each of the first video unit and the second video unit is calculated based on a generated code amount generated by coding a digital video signal based on a fixed quantization step, A video signal encoding device that encodes the digital video signal according to the allocated code amount, wherein the first video unit is based on the allocated code amount for each of the first video unit or the second video unit. Average encoding data rate calculating means for calculating an average encoding data rate per second video unit in the above, and the average for an amount of image data corresponding to the second video unit transmitted per unit time A first parameter calculating means for calculating a first parameter represented by a ratio of an encoded data rate for each of the first video units, a second video unit to be encoded; Is calculated for each third video unit, and the difference between the allocated code amount for the second video unit and the actually generated code amount that has been encoded so far in the second video unit is calculated for each of the third video units. A second parameter calculating means for calculating a second parameter to be reflected when calculating a first quantization step for a third video unit to be coded, the first parameter and the second parameter Video signal coding comprising: first quantization step calculating means for calculating the first quantization step for the third video unit to be coded based on a second parameter. Device.
【請求項8】上記第2のパラメータ算出手段は、 上記第1の映像単位より時間的に1つ前の第1の映像単
位における各画像符号化タイプ毎の上記第1の量子化ス
テツプの平均値及び上記第1のパラメータに基づいて算
出した第3のパラメータを初期値として、上記第3のパ
ラメータに、上記符号化対象としている第2の映像単位
に対する割当て符号量と、当該第2の映像単位において
現在までに符号化して実際に発生した発生符号量との上
記第3の映像単位毎の上記差分を反映させたものを上記
第2のパラメータとして算出することを特徴とする請求
項7に記載の映像信号符号化装置。
8. The second parameter calculating means, comprising: an average of the first quantization steps for each image coding type in a first video unit temporally preceding the first video unit; Using the value and the third parameter calculated based on the first parameter as initial values, the third parameter includes the code amount allocated to the second video unit to be coded and the second video 8. The method according to claim 7, wherein the second parameter is calculated by reflecting the difference between the generated code amount actually encoded and generated in the unit and the above-mentioned difference for each third video unit. The video signal encoding device according to any one of the preceding claims.
【請求項9】上記第1の映像単位は、グループオブピク
チヤーズであり、 上記第2の映像単位は、フレーム画像であり、 上記第3の映像単位は、マクロブロツクであることを特
徴とする請求項7に記載の映像信号符号化装置。
9. The method according to claim 8, wherein the first video unit is a group of pictures, the second video unit is a frame image, and the third video unit is a macro block. The video signal encoding device according to claim 7.
【請求項10】上記第2の映像単位毎の割当て符号量
は、上記デイジタル映像信号を固定の量子化ステツプに
基づいて符号化することにより発生した発生符号量に基
づいて上記第1の映像単位毎の割当て符号量を算出し、
当該第1の映像単位毎の割当て符号量に基づいて決定さ
れることを特徴とする請求項7に記載の映像信号符号化
装置。
10. The allocated code amount for each second video unit is determined based on the generated code amount generated by coding the digital video signal based on a fixed quantization step. Calculate the assigned code amount for each,
The video signal encoding apparatus according to claim 7, wherein the video signal encoding apparatus is determined based on the code amount allocated to each first video unit.
【請求項11】上記平均符号化データ速度算出手段は、 符号化対象としている第2の映像単位を含んで上記第2
の映像単位毎に所定数分スライドさせていくようにして
上記第1の映像単位における上記第2の映像単位当たり
の平均符号化データ速度を算出することを特徴とする請
求項7に記載の映像信号符号化装置。
11. The average encoded data rate calculating means includes a second video unit including a second video unit to be encoded.
The video according to claim 7, wherein the average encoded data rate per second video unit in the first video unit is calculated by sliding the video data by a predetermined number for each video unit. Signal encoding device.
【請求項12】上記符号化対象としている第3の映像単
位の各輝度ブロツクにおける画素値に基づいて上記符号
化対象としている第3の映像単位についてのアクテイビ
テイを算出し、当該アクテイビテイ及び上記符号化対象
としている第3の映像単位についての上記第1の量子化
ステツプに基づいて上記符号化対象としている第3の映
像単位についての第2の量子化ステツプを算出する第2
の量子化ステツプ算出手段を具えることを特徴とする請
求項7に記載の映像信号符号化装置。
12. An activity for the third video unit to be encoded is calculated based on a pixel value in each luminance block of the third video unit to be encoded, and the activity and the encoding are calculated. Calculating a second quantization step for the third video unit to be encoded based on the first quantization step for the third video unit to be encoded;
8. The video signal encoding apparatus according to claim 7, further comprising: a quantization step calculating means.
【請求項13】第1の映像単位又は第2の映像単位毎の
割当て符号量に基づいて、上記第1の映像単位における
上記第2の映像単位当たりの平均符号化データ速度を算
出する平均符号化データ速度算出ステツプと、 単位時間当たりに伝送されてくる上記第2の映像単位に
応じた画像のデータ量に対する上記平均符号化データ速
度の割合いで表される第1のパラメータを上記第1の映
像単位毎に算出する第1のパラメータ算出ステツプと、 符号化対象としている第2の映像単位に対する割当て符
号量と、当該第2の映像単位において現在までに符号化
して実際に発生した発生符号量との差分を第3の映像単
位毎に算出し、当該第3の映像単位毎の差分を、符号化
対象としている第3の映像単位についての第1の量子化
ステツプを算出する際に反映させるための第2のパラメ
ータを算出する第2のパラメータ算出ステツプと、 上記第1のパラメータ及び上記第2のパラメータに基づ
いて上記符号化対象としている第3の映像単位について
の上記第1の量子化ステツプを算出する第1の量子化ス
テツプ算出ステツプとが記録されていることを特徴とす
る記録媒体。
13. An average code for calculating an average encoded data rate per said second video unit in said first video unit based on an allocated code amount for each of said first video unit and said second video unit. And calculating a first parameter represented by a ratio of the average encoded data rate to a data amount of an image corresponding to the second video unit transmitted per unit time. A first parameter calculation step to be calculated for each video unit, a code amount allocated to a second video unit to be coded, and a generated code amount actually generated by encoding the second video unit up to now Is calculated for each third video unit, and the difference for each third video unit is calculated when calculating the first quantization step for the third video unit to be encoded. A second parameter calculation step for calculating a second parameter for projecting, and the first parameter for the third video unit to be encoded based on the first parameter and the second parameter. A recording medium, wherein a first quantization step calculation step for calculating a quantization step is recorded.
【請求項14】上記第2のパラメータ算出ステツプは、 上記第1の映像単位より時間的に1つ前の第1の映像単
位における各画像符号化タイプ毎の上記第1の量子化ス
テツプの平均値及び上記第1のパラメータに基づいて算
出した第3のパラメータを初期値として、上記第3のパ
ラメータに、上記符号化対象としている第2の映像単位
に対する割当て符号量と、当該第2の映像単位において
現在までに符号化して実際に発生した発生符号量との上
記第3の映像単位毎の差分を反映させたものを上記第2
のパラメータとして算出することを特徴とする請求項1
3に記載の記録媒体。
14. The second parameter calculation step includes calculating an average of the first quantization steps for each image coding type in a first video unit temporally one before the first video unit. Using the value and the third parameter calculated based on the first parameter as initial values, the third parameter includes the code amount allocated to the second video unit to be coded and the second video In the second unit, the difference reflecting the difference for each third video unit from the actually generated code amount that has been encoded so far is referred to as the second video unit.
2. The parameter is calculated as a parameter of
4. The recording medium according to 3.
【請求項15】上記第1の映像単位は、グループオブピ
クチヤーズでなり、 上記第2の映像単位は、フレーム画像であり、 上記第3の映像単位は、マクロブロツクであることを特
徴とする請求項13に記載の記録媒体。
15. The method according to claim 15, wherein the first video unit is a group of pictures, the second video unit is a frame image, and the third video unit is a macro block. The recording medium according to claim 13.
【請求項16】デイジタル映像信号を固定の量子化ステ
ツプに基づいて符号化した際に発生した発生符号量に基
づいて上記第1の映像単位又は上記第2の映像単位毎の
割当て符号量を決定する割当て符号量決定ステツプが記
録されていることを特徴とする請求項13に記載の記録
媒体。
16. An allocated code amount for each of the first video unit and the second video unit is determined based on a generated code amount generated when a digital video signal is coded based on a fixed quantization step. 14. The recording medium according to claim 13, wherein an assigned code amount determining step to be performed is recorded.
【請求項17】上記平均符号化データ速度算出ステツプ
は、 符号化対象としている第2の映像単位を含んで上記第2
の映像単位毎に所定数分スライドさせていくようにして
上記第1の映像単位における上記第2の映像単位当たり
の平均符号化データ速度を算出することを特徴とする請
求項13に記載の記録媒体。
17. The step of calculating the average encoded data rate includes the step of calculating the average encoded data rate including the second video unit to be encoded.
14. The recording according to claim 13, wherein the average encoded data rate per second video unit in the first video unit is calculated by sliding the video data by a predetermined number for each video unit. Medium.
【請求項18】上記符号化対象としている第3の映像単
位の各輝度ブロツクにおける画素値に基づいて上記符号
化対象としている第3の映像単位についてのアクテイビ
テイを算出し、当該アクテイビテイ及び上記符号化対象
としている第3の映像単位についての上記第1の量子化
ステツプに基づいて上記符号化対象としている第3の映
像単位についての第2の量子化ステツプを算出する第2
の量子化ステツプ算出ステツプが記録されていることを
特徴とする請求項13に記載の記録媒体。
18. An activity for the third video unit to be encoded is calculated based on a pixel value in each luminance block of the third video unit to be encoded, and the activity and the encoding are performed. Calculating a second quantization step for the third video unit to be encoded based on the first quantization step for the third video unit to be encoded;
14. The recording medium according to claim 13, wherein the quantization step calculation step is recorded.
JP33044196A 1996-11-26 1996-11-26 Video-signal encoding method, video-signal encoder and recording medium Pending JPH10164588A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33044196A JPH10164588A (en) 1996-11-26 1996-11-26 Video-signal encoding method, video-signal encoder and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33044196A JPH10164588A (en) 1996-11-26 1996-11-26 Video-signal encoding method, video-signal encoder and recording medium

Publications (1)

Publication Number Publication Date
JPH10164588A true JPH10164588A (en) 1998-06-19

Family

ID=18232661

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33044196A Pending JPH10164588A (en) 1996-11-26 1996-11-26 Video-signal encoding method, video-signal encoder and recording medium

Country Status (1)

Country Link
JP (1) JPH10164588A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1091588A1 (en) * 1999-04-23 2001-04-11 Sony Corporation Image encoder and its method
JP2001346214A (en) * 2000-06-05 2001-12-14 Sony Corp Image information transform device and method
US6879632B1 (en) 1998-12-24 2005-04-12 Nec Corporation Apparatus for and method of variable bit rate video coding
WO2005104561A1 (en) * 2004-04-20 2005-11-03 Sony Corporation Data processing device, method thereof, and encoding device
JP2008533844A (en) * 2005-03-10 2008-08-21 クゥアルコム・インコーポレイテッド Situation adaptive bandwidth adjustment in video rate control
JP2009246513A (en) * 2008-03-28 2009-10-22 Canon Inc Moving image encoder, control method thereof, and computer program
US7801214B2 (en) 2003-11-18 2010-09-21 Sony Corporation Method and apparatus for controlling encoding rate and quantization scales

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6879632B1 (en) 1998-12-24 2005-04-12 Nec Corporation Apparatus for and method of variable bit rate video coding
EP1091588A1 (en) * 1999-04-23 2001-04-11 Sony Corporation Image encoder and its method
EP1091588A4 (en) * 1999-04-23 2004-08-11 Sony Corp Image encoder and its method
JP2001346214A (en) * 2000-06-05 2001-12-14 Sony Corp Image information transform device and method
US7801214B2 (en) 2003-11-18 2010-09-21 Sony Corporation Method and apparatus for controlling encoding rate and quantization scales
WO2005104561A1 (en) * 2004-04-20 2005-11-03 Sony Corporation Data processing device, method thereof, and encoding device
US7711197B2 (en) 2004-04-20 2010-05-04 Sony Corporation Method and apparatus for determining a quantization scale of encoded data
JP2008533844A (en) * 2005-03-10 2008-08-21 クゥアルコム・インコーポレイテッド Situation adaptive bandwidth adjustment in video rate control
JP2009246513A (en) * 2008-03-28 2009-10-22 Canon Inc Moving image encoder, control method thereof, and computer program

Similar Documents

Publication Publication Date Title
KR100756596B1 (en) Video data encoder and video data encoding method
US5949490A (en) Distributing video buffer rate control over a parallel compression architecture
US5933532A (en) Video data compression apparatus and method of same
EP0825782A2 (en) Video data compression apparatus and method
JPH05252507A (en) Motion video compression system using adaptive bit allocation and quantization
JPH10174103A (en) Image encoder, encoded image recording medium, image decoder, image encoding method and encoded image transmitting method
KR20050012782A (en) A method and system for optimizing image sharpness during coding
JP4295828B2 (en) Encoding with region information
JPH10164588A (en) Video-signal encoding method, video-signal encoder and recording medium
JP3173369B2 (en) Image compression coding device
KR100790148B1 (en) Real-time video content complexity measur for rate control of video encoder
US6141449A (en) Coding mode determination system
JP3937248B2 (en) Video signal encoding method and video signal encoding apparatus
JPH07203430A (en) Image coding device
JP3858520B2 (en) Video encoding apparatus and method
US20050129112A1 (en) Data processing apparatus and method and encoding device of same
JPH10243397A (en) Method, device for encoding and transmitting image and recording medium
JP2001025016A (en) Moving image encoder and method therefor
JP3812269B2 (en) Video encoding apparatus and method
KR100602803B1 (en) Encoding block-organized data
JPH10108197A (en) Image coder, image coding control method, and medium storing image coding control program
JP3765129B2 (en) Encoding apparatus and encoding method
JP2712646B2 (en) Video signal encoding device and video signal encoding method
JP3652889B2 (en) Video encoding method, video encoding device, recording medium, and video communication system
JPH09261633A (en) Video data compression device and method therefor