JP3937248B2 - Video signal encoding method and video signal encoding apparatus - Google Patents

Video signal encoding method and video signal encoding apparatus Download PDF

Info

Publication number
JP3937248B2
JP3937248B2 JP30697396A JP30697396A JP3937248B2 JP 3937248 B2 JP3937248 B2 JP 3937248B2 JP 30697396 A JP30697396 A JP 30697396A JP 30697396 A JP30697396 A JP 30697396A JP 3937248 B2 JP3937248 B2 JP 3937248B2
Authority
JP
Japan
Prior art keywords
calculating
parameter
picture
code amount
gop
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.)
Expired - Fee Related
Application number
JP30697396A
Other languages
Japanese (ja)
Other versions
JPH10136354A (en
Inventor
卓也 北村
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 JP30697396A priority Critical patent/JP3937248B2/en
Publication of JPH10136354A publication Critical patent/JPH10136354A/en
Application granted granted Critical
Publication of JP3937248B2 publication Critical patent/JP3937248B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【目次】
以下の順序で本発明を説明する。
発明の属する技術分野
従来の技術
発明が解決しようとする課題
課題を解決するための手段
発明の実施の形態
(1)全体構成(図1)
(2−1)量子化制御部の構成(図2〜図4)
(2−2)実施例の動作及び効果
(3)第3実施例
発明の効果
【0002】
【発明の属する技術分野】
本発明は映像信号符号化方法及び映像信号符号化装置に関し、特にデイジタル映像信号を所定の映像単位毎に可変レートで符号化する映像信号符号化方法及び映像信号符号化装置に適用し得る。
【0003】
【従来の技術】
従来、映像信号をデイジタル化して所定の記録媒体に記録し又は伝送する場合、データ量が膨大となるためデータを符号化(圧縮)している。代表的な符号化方式として動き補償予測符号化が知られている。
この動き補償予測符号化は、映像信号の時間軸方向の相関を利用する方法であり、既に復号再生されている映像信号より現在の符号化対象の動き情報(動きベクトル)を推定し、復号されている映像信号を信号の動きに合わせて移動させ、この動きベクトルとその時の予測残差を伝送することにより、符号化に必要な情報量を圧縮する方法である。
【0004】
この動き補償予測符号化の代表的なものとして、MPEG(Moving Picture Expert Group )が知られている。このMPEG方式は、1画像(1フレーム又は1フイールド)を16×16画素で構成されるマクロブロツクと呼ばれるブロツクに分割し、このブロツク単位で動き補償予測符号化を行う。
この動き補償予測符号化には、イントラ符号化及び非イントラ符号化の2つの方法がある。イントラ符号化は自らのマクロブロツクの情報だけを用いる符号化方法であり、非イントラ符号化は自らのマクロブロツクの情報と他の時刻に現れる画像より得た情報との双方の情報を用いる符号化方法である。
【0005】
MPEG方式は、各フレームを3つの画像タイプ、すなわちIピクチヤ(intra coded picture )、Pピクチヤ(predictive coded picture)又はBピクチヤ(bidirectionally predictive coded picture)のいずれかの画像タイプのピクチヤとして符号化する。
Iピクチヤの画像信号は、その1フレーム分の画像信号がそのまま符号化されて伝送される。Pピクチヤの画像信号は、当該Pピクチヤより時間的に過去にあるIピクチヤ又はPピクチヤの画像信号との差分が符号化されて伝送される。Bピクチヤは、時間的に過去にあるPピクチヤ若しくはIピクチヤ又は時間的に未来にあるPピクチヤ若しくはIピクチヤのいずれかのピクチヤとの差分が符号化されて伝送されるか、又は時間的に過去及び未来にあるIピクチヤ又はPピクチヤの双方のピクチヤとの差分が符号化されて伝送される。
【0006】
このように映像信号符号化装置において符号化されたデータ(ビツトストリーム)は固定ビツトレートで出力され、所定の記録媒体に記録され又はデイジタル映像信号復号装置に伝送される。
【0007】
【発明が解決しようとする課題】
ところで映像信号には、動きが激しい絵柄であるために圧縮符号化に向かない画像と、圧縮符号化を非常に簡単に行うことができる静止画に近いような画像が含まれている。従つて映像信号を固定レートで符号化すると、複雑な絵柄の画質が大幅に劣化することになる。
【0008】
そこで複雑な絵柄に割り当てる符号量を多くし、簡単な絵柄に割り当てる符号量を少なくすることより、平均のビツトレートが低くても映像信号全体として高画質を実現するようにした可変レート符号化方式と呼ばれる符号化方法が提案されている。この可変レート符号化方式は、読出し速度を自由に調整できるような記録媒体、例えばデイジタルビデオデイスク(Digital Video Disk、DVD)で用いることかできる。
【0009】
従つてこの可変レート符号化方式を用いる場合には、入力される映像信号の圧縮の難しさ(すなわち絵柄の複雑さや動きの激しさ)を予め把握しておかなければないならい。そこでこの可変レート符号化方式においては、まずデイジタル映像信号を固定の量子化ステツプ基づいて符号化することにより発生した発生符号量に基づいてGOP(Group of Pictures )又はフレーム毎の割当て符号量を算出し、当該割当て符号量に応じてデイジタル映像信号を符号化するといういわゆる2パスエンコーデイングと呼ばれる方法を用いている。
【0010】
ここで各フレーム毎の割当て符号量が決定すると、当該割当て符号量を満たすように量子化制御する必要がある。ここで量子化制御とは、符号化によつて発生する発生符号量を、ある時間幅においてみたときに所定のビツトレートになるように、量子化における量子化ステツプを制御することを言う。この量子化制御法としては、MPEG方式において規定されたテストモデル(Test Model)と呼ばれる量子化制御法が一般に使用されている。このテストモデルと呼ばれる量子化制御法は、発生符号量と割当て符号量(目標ビツト数)の差をフイードバツクするものである。
【0011】
以下、このテストモデルにおける量子化制御アルゴリズムについて説明する。この量子化制御アルゴリズムは3つの大きなステツプによつて構成されている。
【0012】
(1)量子化制御アルゴリズムの第1ステツプ
この第1ステツプにおいては、各画像タイプ毎の割当て符号量を算出するステツプであり、各フレームを符号化する前に、それぞれ次式
【数1】

Figure 0003937248
【数2】
Figure 0003937248
【数3】
Figure 0003937248
によつて定義されたIピクチヤ、Pピクチヤ及びBピクチヤの複雑さ指標XI 、XP 及びXB を更新する。
【0013】
ここでSI 、SP 及びSB は、それぞれIピクチヤ、Pピクチヤ及びBピクチヤでの発生符号量を表す。またQIave、QPave及びQBaveは、それぞれIピクチヤ、Pピクチヤ及びBピクチヤにおける平均的な量子化パラメータ、すなわち1フレーム中における全てのマクロブロツクの量子化ステツプの平均値(1〜31の範囲に正規化されている)を表す。
【0014】
この複雑さ指標XI 、XP 及びXB は、符号化した際の発生符号量が多いような画像対しては大きくなり、高い圧縮率が得られる画像に対しては小さくなる。従つてこれから符号化を行おうとしている画像タイプによつてどの程度符号量が必要であるかを、ある数値で規格化することにより相対的に見積もつたものである。
【0015】
この複雑さ指標XI 、XP 及びXB の初期値XI(init) 、XP(init) 及びXB(init) は、それぞれ次式
【数4】
Figure 0003937248
【数5】
Figure 0003937248
【数6】
Figure 0003937248
によつて定義されている。
【0016】
GOP中の次のフレームに対する割当て符号量TI 、TP 及びTB は、Iピクチヤ、Pピクチヤ及びBピクチヤ毎にそれぞれ次式
【数7】
Figure 0003937248
【数8】
Figure 0003937248
【数9】
Figure 0003937248
によつて表される。
【0017】
ここでGOPとは、必ずIピクチヤを含む何枚かのピクチヤをひとまとまりとした処理単位であり、GOP内のフレームの枚数(すなわちIピクチヤの間隔)をNというパラメータで表し、Pピクチヤ又はIピクチヤの間隔をMというパラメータで表す。従つてGOPはパラメータN及びMによつて決定される。
【0018】
(7)式〜(9)式において、KP 及びKB は、量子化マトリクスに依存する恒常的な定数であり、それぞれIピクチヤに対するPピクチヤの量子化の際の粗さの程度、及びIピクチヤに対するBピクチヤの量子化の際の粗さの程度を表す。このテストモデルの場合、KP = 1.0と定義されているので、PピクチヤはIピクチヤと同じ粗さで量子化され、Bピクチヤについては、KB = 1.4と定義されているので、BピクチヤはIピクチヤの 1.4倍の粗さで量子化される。
【0019】
またNP 及びNB は、それぞれ1GOP中の符号化順序において、Pピクチヤ及びBピクチヤの残りの枚数を表す。Rは、符号化対象としているGOPに与えられた残りの符号量(ビツト数)であり、あるフレームを符号化した後においては、次式
【数10】
Figure 0003937248
【数11】
Figure 0003937248
【数12】
Figure 0003937248
のいずれかとなる。
【0020】
すなわち例えば(7)式を用いてIピクチヤの割当て符号量TI を算出した後、Iピクチヤの後に続くピクチヤ、例えばBピクチヤの割当て符号量TB を(9)式を用いて算出する際には、(9)式におけるRは、Iピクチヤに使用された符号量SI を除いた値(すなわち(10)式で計算されたR=R−SI )が用いられ、これにより1GOPに割り当てられた割当て符号量を一定に保持している。ここでGOP中の最初のピクチヤ、すなわち符号化順序で最初のピクチヤであるIピクチヤの割当て符号量TI を算出する際のRは、次式
【数13】
Figure 0003937248
に設定されている。
【0021】
従つてIピクチヤの割当て符号量TI 、Pピクチヤの割当て符号量TP 及びBピクチヤの割当て符号量TB は、GOP中における残りの符号量Rを、当該GOP中におけるIピクチヤ、Pピクチヤ及びBピクチヤの残りの枚数の自分の画像タイプに換算したもので除算することによつて得ることができる。すなわち(7)式〜(9)式は、GOP中における符号化されていない全てのピクチヤが、これから符号化しようとするピクチヤと同じ画像タイプであるとみなしたとき、1フレーム当たりどの程度の符号量を割り当てることができるかの目安を与えることを表している。
【0022】
(2)量子化制御アルゴリズムの第2ステツプ
この第2ステツプは、各フレームにおける各マクロブロツクを順次符号化しながら、仮の量子化ステツプ、すなわち後述するように、画像の複雑さや動きの激しさを考慮しない場合の量子化ステツプ(以下、これを参照量子化ステツプと呼ぶ)を第1の量子化ステツプとして算出するステツプであり、符号化対象としているフレームに対する割当て符号量TI 、TP 又はTB と、符号化して実際に発生した発生符号量との差分をマクロブロツク毎にフイードバツクする。
【0023】
従つて実際に符号化して発生した発生符号量が、当初想定していた割当て符号量より多い場合には、発生符号量を減らすために量子化ステツプは大きくなり、発生符号量が割当て符号量より少ない場合には、量子化ステツプは小さくなる。
【0024】
まず符号化対象としているIピクチヤ、Pピクチヤ又はBピクチヤにおけるi番目のマクロブロツクiを符号化する前に、Iピクチヤ、Pピクチヤ及びBピクチヤ毎にそれぞれ用意された仮想的なバツフアの充満度dIi、dPi及びdBiを、それぞれ次式
【数14】
Figure 0003937248
【数15】
Figure 0003937248
【数16】
Figure 0003937248
を用いて算出する。
【0025】
これら(14)式〜(16)式において、Bi-1 は、i番目のマクロブロツクを含んで符号化対象としているフレームのそれまでの全てのマクロブロツクを実際に符号化して発生した発生符号量の合計を表し、MB_cnt は、1フレーム内のマクロブロツク数を表す(以下、同様)。従つて(14)式、(15)式及び(16)式において、TI ×(i−1)/MB_cnt 、TP ×(i−1)/MB_cnt 及びTB ×(i−1)/MB_cnt は、それぞれIピクチヤ、Pピクチヤ及びBピクチヤにそれぞれ割り当てられた割当て符号量TI 、TP 及びTB を、それぞれIピクチヤ、Pピクチヤ及びBピクチヤにおける各マクロブロツクに対して均等に割り当てたと想定したときの想定割当て符号量を表すことになる。
【0026】
従つて(14)式、(15)式及び(16)式は、i番目のマクロブロツクを含んで符号化対象としているフレームのそれまでの全てのマクロブロツクを符号化して発生した発生符号量の合計と、符号化対象としているフレームの割当て符号量TI 、TP 又はTB を符号化対象としているフレームの各マクロブロツクに均等に割り当てたと想定したときのi−1番目までの想定符号量の合計との差分をマクロブロツク毎に算出し、当該差分を、符号化対象としているフレームと同じ画像タイプの1つ前のフレームの最後のマクロブロツクについての参照量子化ステツプQを算出する際に用いた仮想的なバツフアの充満度dI0 、dP0 又はdB0 に加算することにより、符号化対象としているマクロブロツクiについての参照量子化ステツプQi を算出する際に用いる仮想的なバツフアの充満度dIi 、dPi 及びdBi として算出している。
【0027】
ここで各画像タイプにおける最後のマクロブロツクについて算出した仮想的なバツフアの充満度dIi 、dPi 及びdBi は、次の同じ画像タイプのフレームにおける各マクロブロツクについての参照量子化ステツプQを算出する際の初期値dI0 、dP0 及びdB0 として使用される。
【0028】
また最初のGOP中の最初のIピクチヤ、Pピクチヤ及びBピクチヤにおける最初のマクロブロツクについての参照量子化ステツプQを算出する際に用いる仮想的なバツフアの充満度dIi 、dPi 及びdBi を算出するために必要となる仮想的なバツフアの充満度dI0 、dP0 及びdB0 (すなわち初期値)は、それぞれ次式
【数17】
Figure 0003937248
【数18】
Figure 0003937248
【数19】
Figure 0003937248
によつて定義されている。
【0029】
続いてマクロブロツクiの参照量子化ステツプQi は、次式
【数20】
Figure 0003937248
で与えられる。ここで*は当該フレームの画像タイプのいずれかを表す(以下、同様)。またピクチヤレートに対するビツトレート(符号化データ速度)の割合いで表される第1のパラメータrは、次式
【数21】
Figure 0003937248
によつて定義されている。ここで(17)式における第1のパラメータrも(20)式によつて表される。
【0030】
かくして各画像タイプにおける各マクロブロツク毎の参照量子化ステツプQが算出される。
【0031】
(3)量子化制御アルゴリズムの第3ステツプ
上述の第2ステツプにおいて算出した参照量子化ステツプQは、各マクロブロツクにおける画像の複雑さ(空間周波数の振幅の大きさ)や動きの激しさを考慮せずに算出した値であるため、この第3ステツプにおいては、各マクロブロツクにおける画像の複雑さや動きの激しさを考慮した各マクロブロツク毎の量子化ステツプMQUANTを第2の量子化ステツプとして算出するステツプである。すなわち量子化パラメータの平均値を、マクロブロツク毎のアクテイビテイ(ブロツク当たりのAC成分のエネルギー(活性度))によつて変化させる。
【0032】
マクロブロツクiの空間的なアクテイビテイact i は、その輝度ブロツク(1マクロブロツク中に4個存在する)よりイントラ(intra )画素値を用いて次式
【数22】
Figure 0003937248
を用いて算出する。ここで varsblkは、マクロブロツクiの4つの輝度ブロツク(サブブロツクsblk)におけるアクテイビテイを表し、各サブブロツクsblkにおけるアクテイビテイ varsblkは、次式
【数23】
Figure 0003937248
によつて算出する。ここで各マクロブロツクは16×16画素から構成されているものとし、Pj は画素値を表す。
【0033】
すなわち(23)式は、4つの各サブブロツクsblkついて、サブブロツクsblkにおける各画素値Pj と、次式
【数24】
Figure 0003937248
を用いて算出した当該サブブロツクsblkにおける各画素値Pj の平均値Pave との差分を2乗したものを、当該サブブロツクsblkにおける全ての画素(64個)について算出し、これら各画素毎に算出した演算結果(Pj −Pave 2 の合計を当該サブブロツクsblkにおけるアクテイビテイ varsblkとして算出し、4つのサブブロツクsblkについてそれぞれ算出したアクテビテイ varsblkのうち、最小のアクテイビテイ varsblkをもつサブブロツクsblkのアクテイビイテイ varsblkをマクロブロツクiについてのアクテイビテイ acti とすることを意味する。
【0034】
このようにして算出したマクロブロツクiのアクテイビテイ acti を正規化した係数を次式
【数25】
Figure 0003937248
を用いて正規化する。すなわちアクテイビテイ acti を、平均的なアクテイビテイの値からの偏りによつて 0.5〜2.0 の範囲に正規化した係数 N_ acti を算出する。
【0035】
ここで avg_act は、符号化対象としているフレームの1つ前のフレームにおける acti の平均値を表す。マクロブロツクiについての最終的な量子化ステツプMQUANTi は、次式
【数26】
Figure 0003937248
によつて得られる。
【0036】
すなわち画像の複雑さや動きの激しさを考慮しないときの各マクロブロツクについての参照量子化ステツプQi に、正規化した係数 N_ acti を乗ずることにより、マクロブロツクiについて画像の複雑さや動きの激しさを考慮した量子化ステツプMQUANTi を得ることかできる。最終的にMQUANTi は、1〜31の範囲の整数に制限される。
【0037】
このようにして符号化対象としているフレームの符号化対象としているマクロブロツクiについての量子化ステツプMQUANTi が決定されると、当該量子化ステツプMQUANTi を用いてマクロブロツクが量子化されて符号化され、このときに実際に発生した発生符号量が(14)式、(15)式又は(16)式におけるBi-1 に加算される。
【0038】
以降、次のフレームに対して上述の第1〜第3のステツプを繰り返すことにより当該フレームについての全てのマクロブロツクについて量子化ステツプMQUANTi が順次決定し、デイジタル映像信号中のあるGOPにおける全てのフレームについて全てのマクロブロツクに対する量子化ステツプMQUANTが決定すると、次のGOPについて上述の第1〜第3のステツプが行われる。
【0039】
ところが上述のようなテストモデルによる量子化制御法においては、ビツトレートとして固定レートを前提としているので、上述のような可変レート符号化方式に適用することができなかつた。すなわちビツトレートが固定であるということは、(21)式において第1のパラメータrが固定であることを意味し、従つて各GOPにおける第1のパラメータrも一定となるので、テストモデルによる量子化制御法を絵柄の複雑さや動きの激しさに応じてビツトレートを可変にする可変レート符号化方式には適用できなかつた。
【0040】
本発明は以上の点を考慮してなされたもので、可変レート符号化方式に対応し得る量子化制御を行うことのできる映像信号符号化方法及び映像信号符号化装置を提案しようとするものである。
【0041】
【課題を解決するための手段】
かかる課題を解決するため本発明においては、GOP又はピクチヤ毎の割当て符号量に基づいて、GOPにおけるピクチヤ当たりの平均符号化データ速度を算出し、ピクチヤレートに対する平均符号化データ速度の割合いで表される第1のパラメータをGOP毎に算出し、符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対照のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出し、第1のパラメータ及び第2のパラメータに基づいて符号化対象としているブロツクについての第1の量子化ステツプを算出するようにした。
【0042】
【発明の実施の形態】
以下図面について、本発明の一実施例を詳述する。
【0043】
(1)全体構成
図1において、1は全体として本発明を適用した映像信号符号化装置を示し、映像信号S1は画像符号化タイプ指定回路2に入力される。
画像符号化タイプ指定回路2は入力される映像信号S1の各フレームを第2の映像単位としてIピクチヤ、Pピクチヤ又はBピクチヤのうちのどの画像タイプのピクチヤとして処理するかを指定して画像符号化並替え回路3に送出する。この映像信号符号化装置1は、例えば15個のフレームを第1の映像単位としての1GOPとして処理の1単位とする。
【0044】
画像符号化順序並替え回路3は指定された画像符号化タイプに従つて各フレームを符号化する順番に並び替えて画像信号S2としてスキヤンコンバータ4に送出すると共に、当該画像信号S2についての画像符号化タイプS3を予測モード決定回路5、動きベクトル検出回路6及び量子化制御回路7に送出する。また画像符号化並替え回路3は現在符号化されているフレームの動きベクトルを検出するために現在画像と、当該現在画像より時間的に過去にある画像(以下、これを過去参照画像と呼ぶ)及び又は現在画像より時間的に未来にある画像(以下、これを未来参照画像と呼ぶ)S4とを動きベクトル検出回路6に送出する。
【0045】
スキヤンコンバータ4は、画像信号S2をフレーム毎にブロツクフオーマツトの信号に変換し、この1フレームの信号を16ラインを1単位としてN個のスライスに区分すると共に、各スライスを16×16の画素に対応する輝度信号によつて構成されるM個のマクロブロツクに分割し、当該各マクロブロツクを第3の映像単位(伝送単位)として量子化制御回路7及び演算回路8に送出する。
【0046】
動きベクトル検出回路6は画像信号S2の各フレームに同期した画像符号化タイプS3に従つて各フレームの画像データをIピクチヤ、Pピクチヤ又はBピクツチヤとして処理する。すなわちIピクチヤとして処理されるフレームの画像データは、動きベクトル検出回路6から、過去参照画像を格納する過去参照画像メモリ(図示せず)に格納され、Bピクチヤとして処理されるフレームの画像データは現在画像を格納する現在画像メモリ(図示せず)に格納され、Pピクチヤとして処理されるフレームの画像データは未来参照画像を格納する未来参照画像メモリ(図示せず)に格納される。
【0047】
ここで次のタイミングにおいて、Bピクチヤ又はPピクチヤとして処理すべきフレームが動きベクトル検出回路6に入力されたとき、これまでに未来参照画像メモリに格納されていた最初のPピクチヤの画像データは過去参照画像メモリに格納される。また次のBピクチヤの画像データは現在画像メモリに格納され、次のPピクチヤの画像データは未来参照画像メモリに格納される。以降このような動作が順次繰り返される。
【0048】
動きベクトル検出回路6は順方向予測における動きベクトル及びそのときの動きベクトル推定残差S5を予測モード決定回路5に送出する。ここで動きベクトル検出回路6は、Bピクチヤの場合には、逆方向予測における動きベクトルとそのときの動きベクトル推定残差とを送出する。
予測モード決定回路5はイントラモード、順方向予測モード、逆方向予測モード又は双方向予測モードのうちどの予測モードを選択するかを決定する。
【0049】
ここでイントラモードは、符号化対象となるフレームの画像データをそのまま伝送データとして伝送する処理であり、順方向予測モードは、過去参照画像との予測残差と順方向動きベクトルとを伝送する処理である。また逆方向予測モードは、未来参照画像との予測残差と逆方向動きベクトルとを伝送する処理であり、双方向予測モードは、過去参照画像と未来参照画像の2つの予測画像の平均値との予測残差と順方向及び逆方向の2つの動きベクトルとを伝送する処理である。Bピクチヤの場合には、これら4種類の予測モードをマクロブロツク単位で切り換える。
【0050】
予測モード決定回路5は画像符号化並替え回路3から送出される画像符号化タイプS3に基づいて、Iピクチヤの場合にはイントラモードを選択し、Pピクチヤの場合にはイントラモード又は順方向予測モードのいずれかの予測モードを選択し、Bピクチヤの場合には、イントラモード、順方向予測モード、逆方向予測モード又は双方向予測モードのうちいずれかの予測モードを選択し、選択した予測モードS6を演算回路8に送出する。
【0051】
演算回路8はスキヤンコンバータ4より読み出されたマクロブロツクS7に対して、予測モードS6に基づいてイントラ、順方向予測、逆方向予測又は双方向予測の演算を行う。
演算回路8はマクロブロツクS7としてIピクチヤとして処理すべき画像データが入力された場合、当該画像データをイントラ符号化してDCT(Discrete Cosine Transform 、離散コサイン変換)回路9に送出する。DCT回路9はイントラ符号化された画像データをDCT係数に変換して量子化回路10に送出する。
【0052】
量子化回路10は各DCT係数を量子化制御回路7から指定された量子化ステツプで量子化して可変長符号化回路11及び逆量子化回路12に送出する。
可変長符号化回路11は量子化された画像データ、予測モード決定回路5から送出される予測モードS6及び動きベクトル検出回路6から送出される動きベクトルS5を例えばハフマン符号などの可変長符号に変換し、バツフア13を介して量子化制御回路7に送出すると共に外部に出力する。
【0053】
逆量子化回路12は量子化された画像データを量子化時における量子化ステツプに応じて逆量子化してIDCT(逆DCT)回路14に送出する。IDCT回路14は逆量子化回路12からの出力を逆DCT処理する。IDCT回路14からの出力は演算器15を介してフレームメモリ16内の過去参照画像を格納する過去参照画像記憶部(図示せず)に格納される。
【0054】
次に演算回路8にスキヤンコンバータ4からPピクチヤとして処理すべき画像データが入力され、予測モード決定回路5から送出される予測モードS6がイントラモードの場合、当該画像データは上述のIピクチヤの場合と同様にイントラ符号化されてDCT回路9、量子化回路10、可変長符号化回路11及びバツフア13を介して量子化制御回路7に送出される共に外部に出力され、逆量子化回路12、IDCT回路14及び演算器15を介してフレームメモリ16内の未来参照画像を格納する未来参照画像記憶部(図示せず)に格納される。
【0055】
予測モードS6が順方向予測モードの場合には、フレームメモリ16の過去参照画像記憶部に格納されている画像データ(この場合Iピクチヤの画像データ)が読み出されて動き補償回路17に送出される。
動き補償回路17はこの画像データを動きベクトル検出回路6から送出される順方向動きベクトルS5に対応して動き補償する。
【0056】
すなわち動き補償回路17は、順方向予測モードの場合、フレームメモリ16の過去参照画像記憶部の読出しアドレスを、動きベクトル検出回路6が現在出力しているマクロブロツクの位置に対応する位置から順方向動きベクトルS5に対応する分だけずらしてデータを読み出して予測参照画像を生成し、演算回路8及び演算器15に送出する。
【0057】
演算回路8はスキヤンコンバータ4から送出される参照画像のマクロブロツクのデータから、動き補償回路17から送出された当該マクロブロツクに対応する予測参照画像の画像データを減算して予測残差としての差分データを得、この差分データをDCT回路9に送出する。この差分データはDCT回路9、量子化回路10、可変長符号化回路11及びバツフア13を介して量子化制御回路7に送出されると共に外部に出力される。またこの差分データは逆量子化回路12及びIDCT回路14によつて局所的に復号されて演算器15に送出される。
【0058】
演算器15はIDCT回路14から送出される差分データに、動き補償回路17から送出される予測参照画像の画像データを加算する。これにより局所的に復号したPピクチヤの画像データが得られる。このPピクチヤの画像データはフレームメモリ16内の未来参照画像を格納する未来参照画像記憶部に格納される。
【0059】
次に演算回路8にスキヤンコンバータ4からBピクチヤとして処理すべきフレームの画像データが入力され、予測モード決定回路5から送出される予測モードS6がイントラモード又は順方向予測モードの場合、当該フレームの画像データは上述のPピクチヤの場合と同様に処理される。これに対して予測モードS6が逆方向予測モードに設定された場合には、フレームメモリ16の未来参照画像記憶部に格納されている画像データ(この場合Pピクチヤの画像データ)が読み出されて動き補償回路17に送出される。
動き補償回路17はこの画像データを動きベクトル検出回路6から送出される逆方向動きベクトルS5に対応して動き補償する。
【0060】
すなわち動き補償回路17は、逆方向予測モードの場合、フレームメモリ16の未来参照画像記憶部の読出しアドレスを、動きベクトル検出回路6が現在出力しているマクロブロツクの位置に対応する位置から動きベクトルS5に対応する分だけずらしてデータを読み出して予測参照画像を生成し、演算回路8及び演算器15に送出する。
【0061】
演算回路8はスキヤンコンバータ4から送出される参照画像のマクロブロツクのデータから、動き補償回路17から送出された当該マクロブロツクに対応する予測参照画像の画像データを減算して予測残差としての差分データを得、この差分データをDCT回路9に送出する。この差分データはDCT回路9、量子化回路10、可変長符号化回路11及びバツフア13を介して量子化制御回路7に送出されると共に外部に送出される。またこの差分データは逆量子化回路12及びIDCT回路14によつて局所的に復号されて演算器15に送出される。
演算器15はIDCT回路14から送出される差分データに、動き補償回路17から送出される予測参照画像の画像データを加算する。これにより局所的に復号したBピクチヤの画像データが得られる。
【0062】
双方向予測モードの場合には、フレームメモリ16の過去参照画像記憶部に格納されている画像データ(この場合Iピクチヤの画像データ)と、未来参照画像記憶部に格納されている画像データ(この場合Pピクチヤの画像データ)とが読み出されて動き補償回路17に送出される。
動き補償回路17はこの画像データを動きベクトル検出回路6から送出される順方向動きベクトル及び逆方向動きベクトルS5に対応して動き補償する。
【0063】
すなわち動き補償回路17は、双方向予測モードの場合、フレームメモリ16の過去参照画像記憶部と未来参照画像記憶部の読出しアドレスを、動きベクトル検出回路6が現在出力しているマクロブロツクの位置に対応する位置から順方向動きベクトル及び逆方向動きベクトルS5に対応する分だけずらしてデータを読み出して予測参照画像を生成し、演算回路8及び演算器15に送出する。
【0064】
演算回路8はスキヤンコンバータ4から送出される参照画像のマクロブロツクのデータから、動き補償回路17から送出された当該マクロブロツクに対応する予測参照画像の画像データの平均値を減算して予測残差としての差分データを得、この差分データをDCT回路9に送出する。この差分データはDCT回路9、量子化回路10、可変長符号化回路11及びバツフア13を介して量子化制御回路7に送出されると共に外部に出力される。またこの差分データは逆量子化回路12及びIDCT回路14によつて局所的に復号されて演算器15に送出される。
【0065】
演算器15はIDCT回路14から送出される差分データに、動き補償回路17から送出される予測参照画像の画像データを加算する。これにより局所的に復号したBピクチヤの画像データが得られる。ここでBピクチヤは他の画像の予測画像として使用されないので、フレームメモリ16には格納されない。
【0066】
(2−1)量子化制御部の構成
ここで映像信号符号化装置1における量子化制御部7の構成について説明する。図2に示すように、量子化制御部7は、以下に説明する量子化制御アルゴリズに応じたプログラムを記録媒体としてのROM(Read Only Memory)7Aに格納しており、CPU7Bがこの量子化制御アルゴリズムに従つて量子化回路10において各マクロブロツクを量子化する際に用いる量子化ステツプMQUANTを、RAM(Random Access Memory)7Cをワークエリアとして用いて算出し、当該量子化ステツプMQUANTを量子化回路10に送出する。
【0067】
量子化制御部7における量子化制御アルゴリズムについて図3及び図4に示すフローチヤートを用いて説明する。
ここでこの映像信号符号化装置1は、符号化方法として可変レート符号化方式を採用しており、量子化制御アルゴリズムを開始する前に、まずデイジルタ映像信号S1を固定の量子化ステツプで符号化した際に発生した発生符号量に基づいて各フレーム毎の割当て符号量Ti を決定し、当該各フレーム毎の割当て符号量Ti を量子化制御部7のRAM7Cに格納しているものとする。
【0068】
実際上、量子化制御部7は固定の量子化ステツプQSを量子化回路10に送出する。量子化回路10は、量子化制御部7によつて指定された量子化ステツプQSに基づいて、DCT回路9から出力されるDCT係数を量子化して可変長符号化回路11に送出する。可変長符号化回路11は、量子化回路10からの出力を可変長符号化して、当該符号化結果を量子化制御部7に送出する。量子化制御部7は、可変長符号化回路11からの出力に基づいて、各フレーム毎に実際に発生した発生符号量を算出し、当該発生符号量に基づいて各フレーム毎の割当て符号量Ti を算出し、RAM7Cに格納する。
【0069】
CPU7Bは、ステツプSP1より量子化制御アルゴリズムを開始し、ステツプSP2において、デイジタル映像信号S1における最初のGOP中において符号化順序で最初のIピクチヤの最初のマクロブロツクについての量子化ステツプqIPREVの初期値を「10」に設定する。また最初のGOP中において符号化順序で最初のPピクチヤの最初のマクロブロツクについての量子化ステツプqPPREVとして、Iピクチヤにおける最後のマクロブロツクについての参照量子化ステツプQ(第1の量子化ステツプ)にkP (kP = 1.0)を乗じた値を設定し、最初のGOP中において符号化順序で最初のBピクチヤの最初のマクロブロツクについての量子化ステツプqBPREVとして、Iピクチヤにおける最後のマクロブロツクについての参照量子化ステツプQにkB (kB = 1.0)を乗じた値を設定する。ここでKP = 1.0、KB = 1.4であり、上述したテストモデルの場合と同様にIピクチヤに対する粗さの程度を表す。
【0070】
ここで実際上、量子化制御は各ピクチヤ毎に符号化順に行われるので、ステツプSP2において、最初のGOP中において符号化順序で最初のPピクチヤ及びBピクチヤにおけるそれぞれ最初のマクロブロツクについての量子化ステツプqBPREV及びqPPREVは、Iピクチヤに対する量子化制御が終了してから設定される。
【0071】
またデイジルタ映像信号S1における最初のGOP以降のGOPにおいて符号化順序で最初のIピクチヤにおける最初のマクロブロツクについての量子化ステツプqIPREVとして、1つ前のGOPにおける最後のIピクチヤの最後のマクロブロツクについての参照量子化ステツプQを用いる。従つて最初のGOP以降のGOPにおいて符号化順序で最初のPピクチヤ及びBピクチヤにおける最初のマクロブロツクについての量子化ステツプqPPREV及びqIPREVとしては、符号化対象としているGOPにおけるIピクチヤの最後のマクロブロツクについての量子化ステツプqIPREVにそれぞれKP 及びKB を乗じたものが使用される。
【0072】
続いてCPU7Bは、ステツプSP3において、カウンタcurr_GOP を最初のGOPに設定した後、ステツプSP4において、符号化対象としているGOPcurr_GOP に対応する各フレームの割当て符号量Ti をRAM7Cより順次読み出し、符号化対象としているGOPcurr_GOP における1フレーム当たりの平均ビツトレートcurr_brを、平均符号化データ速度として、次式
【数27】
Figure 0003937248
を用いて算出する。ここでこの映像信号符号化装置1は、可変レート符号化方式を採用しているので、ステツプSP4において算出した平均ビツトレートCurr_brはGOP毎に変化することになる。
【0073】
平均ビツトレートCurr_brの算出処理について図4に示すフローチヤートを用いて説明する。
CPU7Bは、ステツプSP20より平均ビツトレートCurr_brの算出処理を開始し、ステツプSP21において、フレーム数をカウントするカウンタのカウンタ値kを初期化すると共に、符号化対象としているGOPcurr_GOP 中における各フレームの割当て符号量Ti の累積値を演算する演算器の累計値sum を初期化した後、ステツプSP22において、符号化対象としているGOPcurr_GOP 中のk番目のフレームの割当て符号量Tk を演算器の累積値sum に足し込む。
【0074】
続いてCPU7Bは、ステツプSP23において、カウンタのカウント値kと符号化対象としているGOPcurr_GOP 中のフレーム数Nとを比較し、カウンタのカウント値kとフレーム数Nとが一致していないと判断したときには、当該GOPcurr_GOP 中の全てのフレームについての割当て符号量Ti が累積値sum に累積されていないと判断してステツプSP24に進み、カウンタのカウント値kをインクリメントしてステツプSP22に進む。
【0075】
すなわちCPU7Bは、符号化対象としているGOPcurr_GOP 中の全てのフレームの割当て符号量Ti の累積値sum を得るまでステツプSP22からステツプSP24までの処理ループを実行する。CPU7Bは、ステツプSP23において肯定結果を得ると、ステツプSP25に進んで、累積値sum 及びピクチヤレート Picture_rateに基づいて、符号化対象としているGOPcurr_GOP における1フレーム当たりの平均ビツトレートCurr_brを算出し、ステツプSP26において平均ビツトレートCurr_brの算出処理を終了してメインルーチンのステツプSP5に進む。
【0076】
CPU7Bは、ステツプSP5において、平均ビツトレートCurr_br及びピクチヤレート Picture_rateに基づき、次式
【数28】
Figure 0003937248
を用いて第1のパラメータrを算出する。すなわちCPU7Bは、ピクチヤレート Picture_rateに対する平均ビツトレートCurr_br(平均符号化データ速度)の割合いで表される第1のパラメータrを算出する。ここでステツプSP4において算出した平均ビツトレートCurr_brはGOP毎に変化するので、これに連動して第1のパラメータrもGOP毎に変化することになる。
【0077】
次いでCPU7Bは、ステツプSP6において、符号化対象としているGOPcurr_GOP の1つ前のGOPにおける各ピクチヤタイプの最後のフレームにおける最後のマクロブロツクの量子化ステツプqIPREV、qPPREV又はqBPREV(すなわち後述する参照量子化ステツプQ)と、ステツプSP5において算出した第1のパラメータrとに基づき、次式
【数29】
Figure 0003937248
【数30】
Figure 0003937248
【数31】
Figure 0003937248
をそれぞれ用いて、符号化対象としているマクロブロツクjについての参照量子化ステツプQj を算出する際に用いる各ピクチヤタイプ毎の仮想的なバツフアの充満度dI0 、dP0 及びdB0 を第3のパラメータとして算出する。
【0078】
ここで従来のテストモデルは、第1のパラメータrが固定であつた(すなわちビツトレートが固定であつた)ため学習効果を利用することができたが、本発明では、ビツトレートがGOP毎に変化するために第1のパラメータrもGOP毎に変化するため、そのままでは学習効果を得ることができない。このため本発明においては、第1のパラメータrの変化に伴つて仮想的なバツフアの充満度をGOP毎に計算する。
【0079】
また最初のGOP中における符号化順序で最初のピクチヤとなるIピクチヤの最初のマクロブロツクについての参照量子化ステツプQを算出する際に用いるIピクチヤ用の仮想的なバツフアの充満度dI0 を算出するために必要となる量子化ステツプqIPREV(ステツプSP6)は、「10」となる。
【0080】
次いでCPU7Bは、ステツプSP7において、符号化対象としているフレームCurr_frame を符号化対象としているGOPcurr_GOP 中の最初のフレームに設定した後、ステツプSP8において、フレームカウンタjを初期化する。続いてCPU7Bは、ステツプSP9において、次式
【数32】
Figure 0003937248
を用いて、符号化対象としているフレームCurr_frame についての仮想的なバツフアの充満度d*j を第2のパラメータとして算出する。
【0081】
ここでCPU7Bは、(32)式におけるd*0 として、各ピクチヤタイプに応じて、ステツプSP6において算出した仮想的なバツフアの充満度dI0 、dP0 又はdB0 を初期値として用いる。従つてステツプSP6において算出した仮想的なバツフアの充満度dI0 、dP0 又はdB0 は、第1のパラメータrがGOP毎に変動すると共に、後述するように量子化ステツプqIPREV、qPPREV及びqBPREVもGOP毎に変動するので、仮想的なバツフアの充満度d*0 (すなわち第3のパラメータdI0 、dP0 及びdB0 )はGOP毎に更新されることになる。
【0082】
ここでBj-1 は符号化対象としているフレームCurr_frame における最初のマクロブロツクから(j−1)番目のマクロブロツクまでに実際に発生した発生符号量の合計を表し、Tcurr_frame は符号化対象としているフレームCurr_frame の割当て符号量Tを表す。従つてd*j は、符号化対象としているフレームのj番目のマクロブロツクについての参照量子化ステツプQj を算出する際に用いる仮想的なバツフアの充満度を表している。さらにMB_cnt は、符号化対象としているフレームにおけるマクロブロツク数を表す。
【0083】
すなわちCPU7Bは、ステツプSP6において算出した各ピクチヤタイプ毎の第3のパラメータとしての仮想的なバツフアの充満度d*0 (すなわちdI0 、dP0 又はdB0 )を初期値として、当該第3のパラメータに、(j−1)番目のマクロブロツクまでに実際に発生した発生符号量Bi-1 と、符号化対象としているフレームCurr_frame の割当て符号量Tcurr_frame を符号化対象としているフレームCurr_frame の各マクロブロツクに均等に割り当てたと想定したときのj−1番目までの想定割当て符号量の合計((j−1)×Tcurr_frame /MB_cnt)との差分(マクロブロツク毎の差分)を反映させたものを、符号化対象としているマクロブロツクjについての参照量子化ステツプQj を算出する際に用いる仮想的なバツフアの充満度d*j (dIj 、dPj 又はdBj )を第2のパラメータとして算出する。これにより、ステツプSP5において算出した第1のパラメータrが、符号化対象としているGOPCurr_GOP において変化しないように、第2のパラメータとしての仮想的なバツフアの充満度d*j を制御するようになされている。
【0084】
次いでCPU7Bは、ステツプSP10において、第1のパラメータr及び第2のパラメータとしての仮想的なバツフアの容量d*j に基づき、次式
【数33】
Figure 0003937248
を用いて、符号化対象としているマクロブロツクjの参照量子化ステツプQj を算出した後、ステツプSP11において、ステツプSP6における量子化ステツプq*prev(qIprev、qPprev又はqBprev)を当該参照量子化ステツプQj に更新する。
【0085】
従つて符号化対象としているGOP中の全てのフレームについて全てのマクロブロツクについて参照量子化ステツプQを算出すると、当該GOP中における各ピクチヤタイプの最後のピクチヤにおける最後のマクロブロツクについての参照量子化ステツプQが、次のGOP中における各ピクチヤタイプの最初のマクロブロツクについての量子化ステツプqIprev、qPprev及びqBprev(ステツプSP6)として使用され、これにより次のGOPにおいて、各ピクチヤタイプ毎に各マクロブロツクについての参照量子化ステツプQを算出する際に用いる第2のパラメータとしての仮想的なバツフアの充満度d*j を算出する際に用いる第3のパラメータとしての仮想的なバツフアの充満度dI0 、dP0 及びdB0 (初期値)が更新される。かくして各GOP毎に第1のパラメータrが変化しても参照量子化ステツプQの連続性を保持することができるようになされている。
【0086】
続いてCPU7Bは、ステツプSP12において、上述したテストモデルにおける第3のステツプと同様の処理を行うことにより、マクロブロツクjについての量子化ステツプMQUANTj を第2の量子化ステツプとして算出する。すなわちCPU7Bは、まずマクロブロツクjを4つのサブブロツク(輝度ブロツク)sblkに分割した後、4つの各サブブロツクsblkについて、サブブロツクsblkにおける各画素値Pm と、次式
【数34】
Figure 0003937248
を用いて算出した当該サブブロツクsblkにおける各画素値Pm の平均値Pave との差分を2乗したものを、当該サブブロツクsblkにおける全ての画素(64個)について算出し、これら各画素毎に算出した演算結果(Pm −Pave 2 の合計を当該サブブロツクsblkにおけるアクテイビテイ varsblkとして次式
【数35】
Figure 0003937248
を用いて算出し、次式
【数36】
Figure 0003937248
を用いて、4つのサブブロツクsblkのうち、最小のアクテイビテイ varsblkをもつサブブロツクsblkのアクテイビテイ varsblkをマクロブロツクjについてのアクテイビテイ actj として算出する。
【0087】
次いでCPU7Bは、マクロブロツクjについてのアクテイビテイ actj を次式
【数37】
Figure 0003937248
を用いて正規化した後、正規化した係数 N_ actj と、ステツプSP11で算出した参照量子化ステツプQj とに基づき、次式
【数38】
Figure 0003937248
を用いて、マクロブロツクjについての最終的な量子化ステツプMQUANTj を算出する。
【0088】
続いてCPU7Bは、ステツプSP13において、符号化対象としているマクロブロツクjが符号化対象としているフレームCurr_frame における最後のマクロブロツクか否かを判定し、否定結果を得たときには、ステツプSP14に進んで、フレームカウンタjをインクリメントとし、ステツプSP9からステツプSP12までの処理を実行する。すなわちCPU7Bは、ステツプSP13において肯定結果を得るまで、すなわち符号化対象としているフレームCurr_frame の全てのマクロブロツクについて量子化ステツプMQUANTを算出するまで、ステツプSP9からステツプSP14までの処理ループを実行する。
【0089】
CPU7Bは、ステツプSP13において肯定結果を得ると、ステツプSP15に進んで、符号化対象としているフレームCurr_frame が符号化対象としているGOPCurr_GOP における最後のフレームであるか否かを判定し、否定結果を得たときには、ステツプSP16に進んで処理対象を次のフレームに設定し、ステツプSP8からステツプSP13までの処理を実行する。すなわちCPU7Bは、ステツプSP15において肯定結果を得るまで、すなわち符号化対象としているGOPCurr_GOP 中の全てのフレームにおける全てのマクロブロツクについて量子化ステツプMQUANTを算出するまで、ステツプSP8からステツプSP16までの処理ループを実行する。
【0090】
CPU7Bは、ステツプSP15において肯定結果を得ると、ステツプSP17に進んで、符号化対象としているGOPCurr_GOP がデイジルタ映像信号S1における最後のGOPであるか否かを判定し、否定結果を得たときには、ステツプSP18に進んで処理対象を次のGOPに設定し、ステツプSP4からステツプSP17までの処理を実行する。すなわちCPU7Bは、ステツプSP17において肯定結果を得るまで、すなわち符号化対象としているデイジルタ映像信号S1における全てのGOP中において、全てのフレームにおける全てのマクロブロツクについて量子化ステツプMQUANTを算出するまで、ステツプSP4からステツプSP18までの処理ループを実行する。
CPU7Bは、ステツプSP17において肯定結果を得ると、ステツプSP19において量子化制御アルゴリズムを終了する。
【0091】
量子化制御部7は上述の量子化制御アルゴリズムに従つて各マクロブロツク毎に算出した量子化ステツプMQUANTを量子化回路11に送出し、量子化回路11は、DCT回路9から出力されるDCT係数を量子化制御部7によつて指定された量子化ステツプMQUANTに基づいて量子化する。
かくしてこの映像信号符号化装置1は、可変レート符号化方式においても量子化制御し得るようになされている。
【0092】
(2−2)実施例の動作及び効果
以上の構成において、この映像信号符号化装置1は、GOP毎にGOPにおける1フレーム当たりの平均符号化データ速度curr_brを算出し、当該平均符号化データ速度curr_brを用いてGOP毎に第1のパラメータrを算出するので、第1のパラメータrを各GOPにおける符号化データ速度curr_brに応じて変化させることができる。
【0093】
またこの映像信号符号化装置1は、GOP中における各ピクチヤタイプ毎の各フレームについての量子化ステツプQを算出する際に用いる第3のパラメータとしての仮想的なバツフアの充満度dIo 、dPo 及びdBo を、それぞれ符号化対象としているGOPより1つ前のGOPにおいて、符号化順序で各ピクチヤタイプの最後のフレームにおける最後のマクロブロツクについての参照量子化ステツプQを用いて更新したので、GOP毎に第1のパラメータrが変化しても各GOP間における参照量子化ステツプQの連続性を維持することができる。
【0094】
以上の構成によれば、GOP毎にGOPにおける1フレーム当たりの平均符号化データ速度curr_brを算出し、当該平均符号化データ速度curr_brを用いてGOP毎に第1のパラメータrを算出し、符号化対象としているGOPより1つ前のGOPにおいて、符号化順序で各ピクチヤタイプの最後のフレームにおける最後のマクロブロツクについての参照量子化ステツプQ及び符号化対象としているGOPについて算出した第1のパラメータrに基づいて、各ピクチヤタイプ毎の各フレームにおける各マクロブロツクについての量子化ステツプQを算出する際に用いる仮想的なバツフアの充満度dIo 、dPo 及びdBo を第3のパラメータとして算出し、当該仮想的なバツフアの充満度dIo 、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間における参照量子化ステツプQの連続性を維持することができる。
かくして可変レート符号化方式に対応し得る量子化制御を行うことのできる映像信号符号化方法及び映像信号符号化装置を実現し得る。また図3に示すような量子化アルゴリズムをプログラムとして記録媒体(ROM7A)に記録することにより、可変レート符号化方式に対応し得る量子化制御を行うことのできる映像信号符号化装置を実現することができる。
【0095】
(3)第3実施例
なお上述の実施例においては、デイジタル映像信号S1を固定の量子化ステツプに基づいて符号化して発生した発生符号量に基づいて各フレーム毎の割当て符号量Ti を決定し、当該各フレーム毎の割当て符号量Ti を量子化制御部7のRAM7Cに格納した場合について述べたが、本発明はこれに限らず、デイジタル映像信号S1を固定の量子化ステツプで符号化して発生した発生符号量に基づいて各GOP毎の割当て符号量を決定し、当該各GOP毎の割当て符号量を量子化制御部7のRAM7Cに格納しておくようにしてもよい。この場合、上述のタイムモデルにおける第1ステツプにおけるR(GOPに与えられた残りの符号量)をGOP毎に変えて、この第1ステツプと同様の処理で各フレームに対して割当て符号量を割り当てた後、本発明の量子化制御アルゴリズムを適用する。
【0096】
また上述の実施例においては、デイジタル映像信号S1を固定の量子化ステツプに基づいて符号化して発生した発生符号量に基づいて決定した各フレーム毎の割当て符号量Ti を予め量子化制御部7のRAM7Cに格納しておいた場合について述べたが、本発明はこれに限らず、デイジタル映像信号S1を固定の量子化ステツプで符号化して発生した発生符号量に基づいて各フレーム毎の割当て符号量Ti を決定するステツプを、図3に示す量子化アルゴリズムの最初の処理ステツプとしてプログラムしてもよい。
【0097】
さらに上述の実施例においては、GOPを第1の映像単位として平均符号化データ速度を算出した場合について述べたが、本発明はこれに限らず、図5に示すように、符号化対象としているフレームを含んで1つずつフレームをスライドさせていくようにして平均ビツトレートを算出するようにしてもよい。この場合、符号化対象としているフレームを含んで所定数分スライドさせていくようにしてもよい。またGOPよりも大きな映像単位、例えば2GOP単位で平均ビツトレートを算出したり、GOPより小さな単位で平均ビツトレートを算出するようにしてもよい。この図5においては、N=6の場合の例である。
【0098】
さらに上述の実施例においては、映像信号符号化装置1において、デイジタル映像信号S1を固定の量子化ステツプで符号化した際に発生した発生符号量に基づいて各フレーム毎の割当て符号量Ti を決定し、当該各フレーム毎の割当て符号量Ti を量子化制御部7のRAM7Cに格納した場合について述べたが、本発明はこれに限らず、別の映像信号符号化装置を用いて各フレーム毎の割当て符号量を算出し、当該各フレーム毎の割当て符号量を量子化制御部7に送出してRAM7Cに格納させるようにしてもよい。
【0099】
さらに上述の実施例においては、図3に示した量子化制御アルゴリズムをプログラムとして有するROM7Aを用いて実現した場合について述べたが、本発明はこれに限らず、図3に示した量子化制御アルゴリズムをハードウエアとして実現するようにしてもよい。
【0100】
【発明の効果】
上述のように本発明によれば、GOP又はピクチヤ毎の割当て符号量に基づいて、GOPにおけるピクチヤ当たりの平均符号化データ速度を算出し、ピクチヤレートに対する平均符号化データ速度の割合いで表される第1のパラメータをGOP毎に算出し、符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対照のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出し、第1のパラメータ及び第2のパラメータに基づいて符号化対象としているブロツクについての第1の量子化ステツプを算出することにより、第1のパラメータを各GOPにおける平均符号化データ速度に応じて変化させることができる。かくして可変レート符号化方式に対応し得る量子化制御を行うことのできる映像信号符号化方法及び映像信号符号化装置を実現することができる。
【図面の簡単な説明】
【図1】本発明を適用した映像信号符号化装置の全体構成を示すブロツク図である。
【図2】量子化制御部の構成を示すブロツク図である。
【図3】量子化制御部における量子化アルゴリズムの説明に供するフローチヤートである。
【図4】平均ビツトレートの算出処理の処理手順の説明に供するフローチヤートである。
【図5】他の実施例による平均ビツトレートの算出方法の説明に供する略線図である。
【符号の説明】
1……映像信号符号化装置、2……画像符号化タイプ指定回路、3……画像符号化順序並替え回路、4……スキヤンコンバータ、5……予測モード決定回路、6……動きベクトル検出回路、7……量子化制御回路、7A……ROM、7B……CPU、7C……RAM、8……演算回路、9……DCT回路、10……量子化回路、11……可変長符号化回路、12……逆量子化回路、13……バツフア、14……IDCT回路、15……演算器、16……フレームメモリ、17……動き補償回路。[0001]
【table of contents】
The present invention will be described in the following order.
TECHNICAL FIELD OF THE INVENTION
Conventional technology
Problems to be solved by the invention
Means for solving the problem
BEST MODE FOR CARRYING OUT THE INVENTION
(1) Overall configuration (Fig. 1)
(2-1) Configuration of quantization control unit (FIGS. 2 to 4)
(2-2) Operation and effect of the embodiment
(3) Third embodiment
The invention's effect
[0002]
BACKGROUND OF THE INVENTION
The present invention relates to a video signal encoding method and a video signal encoding device, and in particular, can be applied to a video signal encoding method and a video signal encoding device that encode a digital video signal at a variable rate for each predetermined video unit.
[0003]
[Prior art]
Conventionally, when a video signal is digitized and recorded or transmitted on a predetermined recording medium, the amount of data is enormous, and thus the data is encoded (compressed). Motion compensation predictive coding is known as a typical coding method.
This motion-compensated predictive coding is a method that uses the correlation in the time axis direction of a video signal. The motion information (motion vector) to be encoded is estimated from a video signal that has already been decoded and reproduced, and is decoded. This is a method of compressing the amount of information necessary for encoding by moving a moving video signal in accordance with the motion of the signal and transmitting this motion vector and the prediction residual at that time.
[0004]
MPEG (Moving Picture Expert Group) is known as a representative example of the motion compensation predictive coding. In this MPEG system, one image (one frame or one field) is divided into blocks called macroblocks composed of 16 × 16 pixels, and motion compensation predictive coding is performed in units of the blocks.
There are two methods of motion compensation predictive coding: intra coding and non-intra coding. Intra coding is a coding method that uses only information of its own macroblock, and non-intra coding is coding that uses both information of its own macroblock and information obtained from images appearing at other times. Is the method.
[0005]
The MPEG system encodes each frame as a picture of one of three picture types: I picture (intra coded picture), P picture (predictive coded picture), or B picture (bidirectionally predictive coded picture).
The I-picture image signal is transmitted by encoding the image signal for one frame as it is. The difference between the image signal of the P picture and the image signal of the I picture or the P picture that is temporally earlier than the P picture is encoded and transmitted. The difference between the B picture and the P picture or I picture that is in the past in time or the picture of the P picture or I picture that is in the future in time is encoded and transmitted, or the past is temporally past. The difference between both the I-picture and the P-picture in the future is encoded and transmitted.
[0006]
Thus, the data (bit stream) encoded by the video signal encoding apparatus is output at a fixed bit rate, recorded on a predetermined recording medium, or transmitted to the digital video signal decoding apparatus.
[0007]
[Problems to be solved by the invention]
By the way, the video signal includes an image that is not suitable for compression coding because it has a pattern with intense motion, and an image that is close to a still image that can be compressed and encoded very easily. Therefore, when the video signal is encoded at a fixed rate, the image quality of a complex picture is greatly deteriorated.
[0008]
Therefore, by increasing the amount of code to be assigned to complex pictures and reducing the amount of code to be assigned to simple pictures, a variable-rate coding method that realizes high image quality as a whole video signal even if the average bit rate is low, A so-called encoding method has been proposed. This variable rate encoding method can be used in a recording medium whose reading speed can be freely adjusted, for example, a digital video disk (DVD).
[0009]
Therefore, when this variable rate coding method is used, it is necessary to grasp in advance the difficulty of compression of the input video signal (that is, the complexity of the pattern and the intensity of movement). Therefore, in this variable rate coding method, first, a GOP (Group of Pictures) or an allocated code amount for each frame is calculated based on a generated code amount generated by encoding a digital video signal based on a fixed quantization step. A so-called two-pass encoding method is used in which a digital video signal is encoded according to the allocated code amount.
[0010]
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 that the quantization step in the quantization is controlled so that the generated code amount generated by the encoding becomes a predetermined bit rate when viewed in a certain time width. As this quantization control method, a quantization control method called a 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 assigned code amount (target number of bits).
[0011]
Hereinafter, the quantization control algorithm in this test model will be described. This quantization control algorithm is composed of three large steps.
[0012]
(1) First step of quantization control algorithm
This first step is a step of calculating an assigned code amount for each image type. Before encoding each frame, the following equations are used.
[Expression 1]
Figure 0003937248
[Expression 2]
Figure 0003937248
[Equation 3]
Figure 0003937248
Complexity index X of I-picture, P-picture and B-picture defined by I , X P And X B Update.
[0013]
Where S I , S P And S B Represents the amount of generated codes in the I picture, P picture and B picture, respectively. Q Iave , Q Pave And Q Bave Represents the average quantization parameter in each of the I, P, and B pictures, ie, the average value of the quantization steps of all macroblocks in one frame (normalized to a range of 1 to 31). .
[0014]
This complexity index X I , X P And X B Is large for an image that has a large amount of generated code when it is encoded, and small for an image that provides a high compression rate. Therefore, the amount of code required for the type of image to be encoded will be relatively estimated by standardizing with a certain numerical value.
[0015]
This complexity index X I , X P And X B Initial value X I (init) , X P (init) And X B (init) Respectively
[Expression 4]
Figure 0003937248
[Equation 5]
Figure 0003937248
[Formula 6]
Figure 0003937248
Defined by
[0016]
Allocated code amount T for the next frame in the GOP I , T P And T B For each of the I, P, and B pictures
[Expression 7]
Figure 0003937248
[Equation 8]
Figure 0003937248
[Equation 9]
Figure 0003937248
It is expressed by
[0017]
Here, the GOP is a processing unit in which several pictures including the I picture are always collected, and the number of frames in the GOP (that is, the interval between the I pictures) is represented by a parameter N, and the P picture or I picture is displayed. The interval between pictures is represented by a parameter M. Therefore, the GOP is determined by the parameters N and M.
[0018]
In the equations (7) to (9), K P And K B Are constants that depend on the quantization matrix, and represent the degree of roughness in the quantization of the P-picture for the I-picture and the degree of roughness in the quantization of the B-picture for the I-picture, respectively. . For this test model, K P = 1.0, so the P picture is quantized with the same roughness as the I picture, and for the B picture, B Since it is defined as 1.4, the B picture is quantized with 1.4 times the roughness of the I picture.
[0019]
N P And N B Represents the remaining number of P-pictures and B-pictures, respectively, in the encoding order in 1 GOP. R is the remaining code amount (number of bits) given to the GOP to be encoded. After encoding a certain frame, R
[Expression 10]
Figure 0003937248
## EQU11 ##
Figure 0003937248
[Expression 12]
Figure 0003937248
Either.
[0020]
That is, for example, using the equation (7), the I code assigned code amount T I After calculating I, the assigned code amount T of the picture following the I picture, for example, the B picture B Is calculated using equation (9), R in equation (9) is the code amount S used for the I-picture. I (Ie, R = R−S calculated by equation (10)) I ) Is used, and the allocated code amount allocated to 1 GOP is kept constant. Here, the allocated code amount T of the first picture in the GOP, that is, the I picture which is the first picture in the coding order. I R when calculating is
[Formula 13]
Figure 0003937248
Is set to
[0021]
Therefore, the assigned code amount T for I-picture I , P picture allocation code amount T P And B picture code size T B Can be obtained by dividing the remaining code amount R in the GOP by converting the remaining number of I-pictures, P-pictures, and B-pictures in the GOP into their own image types. In other words, the equations (7) to (9) indicate that all the unencoded pictures in the GOP have the same image type as the picture to be encoded, and how many codes per frame It represents giving an indication of whether the amount can be allocated.
[0022]
(2) Second step of quantization control algorithm
This second step is a temporary quantization step while sequentially encoding each macroblock in each frame, that is, a quantization step in the case where the complexity of the image and the intensity of motion are not considered, as will be described later. Is referred to as a reference quantization step) as a first quantization step, and the allocated code amount T for the frame to be encoded is calculated. I , T P Or T B And the difference between the generated code amount actually generated by encoding is fed back for each macro block.
[0023]
Accordingly, 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 larger than the allocated code amount. If it is less, the quantization step will be smaller.
[0024]
First, before the i-th macroblock i in the I-picture, P-picture, or B-picture to be encoded is encoded, the degree of fullness d of the virtual buffer prepared for each of the I-picture, P-picture, and B-picture. Ii , D Pi And d Bi Respectively,
[Expression 14]
Figure 0003937248
[Expression 15]
Figure 0003937248
[Expression 16]
Figure 0003937248
Calculate using.
[0025]
In these formulas (14) to (16), B i-1 Represents the total amount of generated codes generated by actually encoding all the macroblocks up to that point including the i-th macroblock and MB_cnt is the number of macroblocks in one frame (Hereinafter the same). Therefore, in the equations (14), (15) and (16), T I × (i-1) / MB_cnt, T P × (i-1) / MB_cnt and T B X (i-1) / MB_cnt is an assigned code amount T assigned to each of the I picture, the P picture, and the B picture. I , T P And T B Are assumed to be allocated code amounts when it is assumed that they are equally allocated to the macroblocks in the I picture, the P picture, and the B picture, respectively.
[0026]
Therefore, Equations (14), (15) and (16) are used to calculate the amount of generated code generated by encoding all the macroblocks up to that point in the frame to be encoded including the i-th macroblock. The total and the allocated code amount T of the frame to be encoded I , T P Or T B Is calculated for each macroblock, and the difference from the sum of the assumed code amount up to the (i-1) th when assuming that the frame is equally allocated to each macroblock of the frame to be encoded is set as the encoding target. The degree of fullness dI of the virtual buffer used in calculating the reference quantization step Q for the last macroblock of the previous frame of the same image type as the current frame 0 , DP 0 Or dB 0 To the reference quantization step Q for the macroblock i to be encoded. i Degree of fullness dI of the virtual buffer used when calculating i , DP i And dB i It is calculated as
[0027]
Here, the virtual buffer fullness dI calculated for the last macroblock in each image type i , DP i And dB i Is the initial value dI for calculating the reference quantization step Q for each macroblock in the next frame of the same image type 0 , DP 0 And dB 0 Used as.
[0028]
Also, the virtual buffer fullness dI used in calculating the reference quantization step Q for the first macroblock in the first I, P and B pictures in the first GOP. i , DP i And dB i The degree of fullness dI of the virtual buffer required to calculate 0 , DP 0 And dB 0 (That is, the initial value)
[Expression 17]
Figure 0003937248
[Formula 18]
Figure 0003937248
[Equation 19]
Figure 0003937248
Defined by
[0029]
Subsequently, the reference quantization step Q of the macroblock i i Is
[Expression 20]
Figure 0003937248
Given in. Here, * represents one of the image types of the frame (hereinafter the same). The first parameter r expressed as the ratio of bit rate (encoded data rate) to picture rate is given by
[Expression 21]
Figure 0003937248
Defined by Here, the first parameter r in the equation (17) is also expressed by the equation (20).
[0030]
Thus, the reference quantization step Q for each macroblock in each image type is calculated.
[0031]
(3) Third step of quantization control algorithm
The reference quantization step Q calculated in the second step described above is a value calculated without considering the complexity of the image (the magnitude of the spatial frequency amplitude) and the intensity of motion in each macro block. In the third step, a quantization step MQUANT for each macro block in consideration of the complexity of the image and the intensity of motion in each macro block is calculated as the second quantization step. That is, the average value of the quantization parameter is changed depending on the activity (energy (activity) of the AC component per block) for each macro block.
[0032]
Macroblock i spatial activity act i Is calculated from the luminance block (there are four in one macro block) using the intra pixel value as follows:
[Expression 22]
Figure 0003937248
Calculate using. Where var sblk Represents the activity in the four luminance blocks (subblock sblk) of the macroblock i, and the activity var in each subblock sblk sblk Is
[Expression 23]
Figure 0003937248
To calculate. Here, each macro block is assumed to be composed of 16 × 16 pixels, and P j Represents a pixel value.
[0033]
That is, the equation (23) indicates that each pixel value P in the sub-block sblk is related to each of the four sub-blocks sblk. j And the following formula
[Expression 24]
Figure 0003937248
Each pixel value P in the sub-block sblk calculated using j Average value P ave Is calculated for all pixels (64 pixels) in the sub-block sblk, and the calculation result (P j -P ave ) 2 The total of the activity in the subblock sblk var sblk The activity var calculated for each of the four subblocks sblk sblk Of the minimum activity var sblk Subblock sblk activity with var sblk Act on Macroblock i act i Means that
[0034]
Activity of macro block i calculated in this way act i Is the coefficient normalized to
[Expression 25]
Figure 0003937248
Normalize using. That is, act i Is a coefficient N_act normalized to a range of 0.5 to 2.0 by deviation from the average activity value i Is calculated.
[0035]
Where avg_act is the act in the previous frame of the frame to be encoded i The average value of. Final quantization step for macroblock i MQUANT i Is
[Equation 26]
Figure 0003937248
Is obtained.
[0036]
That is, the reference quantization step Q for each macro block when the complexity of the image and the intensity of motion are not considered. i To the normalized coefficient N_act i Quantization step MQUANT taking into account the complexity of the image and the intensity of motion for macroblock i i You can get. Finally MQUANT i Is limited to an integer in the range of 1-31.
[0037]
In this way, the quantization step MQUANT for the macroblock i to be encoded of the frame to be encoded i Is determined, the quantization step MQUANT i The macro block is quantized and encoded using the above, and the generated code amount actually generated at this time is the B in the equation (14), (15) or (16). i-1 Is added to
[0038]
Thereafter, the quantization step MQUANT for all macroblocks for the frame is repeated by repeating the first to third steps described above for the next frame. i Are sequentially determined, and when the quantization steps MQUANT for all macroblocks for all frames in a GOP in the digital video signal are determined, the first to third steps described above are performed for the next GOP.
[0039]
However, the quantization control method using the test model as described above assumes a fixed rate as the bit rate, and thus cannot be applied to the variable rate encoding 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 could not be applied to a variable rate coding method in which the bit rate is variable according to the complexity of the pattern and the intensity of movement.
[0040]
The present invention has been made in consideration of the above points, and intends to propose a video signal encoding method and a video signal encoding apparatus capable of performing quantization control compatible with a variable rate encoding method. is there.
[0041]
[Means for Solving the Problems]
In order to solve such a problem, in the present invention, an average encoded data rate per picture in the GOP is calculated based on an assigned code amount for each GOP or picture, and is expressed as a ratio of the average encoded data rate to the picture rate. The first parameter is calculated for each GOP, and in the GOP temporally preceding the GOP to be encoded, the last parameter in the last picture of the same image type as the current encoding control picture in the encoding order Based on the first quantization step for the block and the first parameter for the GOP to be encoded, a virtual step used to calculate the quantization step for each block in each picture for each image type. The buffer fill level is calculated as the third parameter and is one of the blocks to be encoded. The degree of fullness of the virtual buffer reflecting the difference between the allocated code amount and the generated code amount up to the block of the second parameter is calculated as the second parameter, and the first parameter and the second parameter are calculated. Based on the above, the first quantization step for the block to be encoded is calculated.
[0042]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
[0043]
(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 S 1 is input to an image encoding type designation circuit 2.
The image coding type designation circuit 2 designates each frame of the input video signal S1 as a second video unit as a picture type of I picture, P picture, or B picture, and designates it as an image code. It is sent to the conversion / rearrangement circuit 3. The video signal encoding apparatus 1 uses, for example, 15 frames as 1 GOP as a first video unit as one unit of processing.
[0044]
The image coding order rearrangement circuit 3 rearranges the frames in the order of coding according to the designated image coding type and sends the frames to the scan converter 4 as an image signal S2, and the image coding for the image signal S2 The quantization type S3 is sent to the prediction mode determination circuit 5, the motion vector detection circuit 6, and the quantization control circuit 7. The image encoding / reordering circuit 3 detects a motion vector of a frame that is currently encoded, and an image temporally past the current image (hereinafter referred to as a past reference image). In addition, an image that is in the future in time from the current image (hereinafter referred to as a future reference image) S4 is sent to the motion vector detection circuit 6.
[0045]
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 each slice is a 16 × 16 pixel. Are divided into M macroblocks constituted by luminance signals corresponding to, and each macroblock is sent to the quantization control circuit 7 and the arithmetic circuit 8 as a third video unit (transmission unit).
[0046]
The motion vector detection circuit 6 processes the image data of each frame as an I-picture, P-picture, or B-picture according to an image encoding type S3 synchronized with each frame of the image signal S2. That is, the image data of the frame processed as the I picture is stored from the motion vector detection circuit 6 in the past reference image memory (not shown) for storing the past reference image, and the image data of the frame processed as the B picture is Image data of a frame that is stored in a current image memory (not shown) that stores a current image and processed as a P-picture is stored in a future reference image memory (not shown) that stores a future reference image.
[0047]
Here, at the next timing, when a frame to be processed as a B-picture or P-picture is input to the motion vector detection circuit 6, the image data of the first P-picture stored in the future reference picture memory so far is past. Stored in the 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]
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 the 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 is selected from the intra mode, the forward prediction mode, the backward prediction mode, or the bidirectional prediction mode.
[0049]
Here, the intra mode is a process of transmitting image data of a frame to be encoded as transmission data as it is, and the forward prediction mode is a process of transmitting a prediction residual with a past reference image and a forward motion vector. It is. The backward prediction mode is a process of transmitting a prediction residual with a future reference image and a backward motion vector, and the bidirectional prediction mode is an average value of two predicted images of the past reference image and the future reference image. This is a process of transmitting the prediction residual and two motion vectors in the forward and backward directions. In the case of the B picture, these four types of prediction modes are switched in units of macroblocks.
[0050]
The prediction mode determination circuit 5 selects the intra mode in the case of the I picture and the intra mode or the forward prediction in the case of the P picture based on the image coding type S3 sent from the image coding rearrangement circuit 3. One of the prediction modes is selected, and in the case of the B-picture, the prediction mode is selected from among the intra mode, the forward prediction mode, the backward prediction mode, or the bidirectional prediction mode. S6 is sent to the arithmetic circuit 8.
[0051]
The arithmetic circuit 8 performs intra, forward prediction, backward prediction or bidirectional prediction on the macroblock S7 read from the scan converter 4 based on the prediction mode S6.
When image data to be processed as an I-picture is input as the macroblock S7, the arithmetic circuit 8 intra-codes the image data and sends it to a DCT (Discrete Cosine Transform) circuit 9. The DCT circuit 9 converts the intra-coded image data into DCT coefficients and sends them to the quantization circuit 10.
[0052]
The quantization circuit 10 quantizes each DCT coefficient at the 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 coding circuit 11 converts the quantized image data, the prediction mode S6 sent from the prediction mode determination circuit 5 and the motion vector S5 sent from the motion vector detection circuit 6 into a variable length code such as a Huffman code. Then, the data is sent to the quantization control circuit 7 via the buffer 13 and output to the outside.
[0053]
The inverse quantization circuit 12 inversely quantizes the quantized image data according to the quantization step at the time of quantization, and sends it to the IDCT (inverse DCT) circuit 14. The IDCT circuit 14 performs inverse DCT processing on the output from the inverse quantization circuit 12. An output from the IDCT circuit 14 is stored in a past reference image storage unit (not shown) that stores a past reference image in the frame memory 16 via the calculator 15.
[0054]
Next, when image data to be processed as a P-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, the image data is the above-mentioned I-picture. In the same manner as above, the intra-coded signal 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 also output to the outside. The data is stored in a future reference image storage unit (not shown) that stores the future reference image in the frame memory 16 via the IDCT circuit 14 and the arithmetic unit 15.
[0055]
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 unit of the frame memory 16 is read and sent to the motion compensation circuit 17. The
The motion compensation circuit 17 performs motion compensation on this image data in accordance with the forward motion vector S5 sent from the motion vector detection circuit 6.
[0056]
That is, in the forward prediction mode, the motion compensation circuit 17 forwards the read address of the past reference image storage unit of the frame memory 16 from the position corresponding to the position of the macroblock currently output by the motion vector detection circuit 6. The prediction reference image is generated by reading the data shifted by the amount corresponding to the motion vector S5, and sent to the arithmetic circuit 8 and the arithmetic unit 15.
[0057]
The arithmetic circuit 8 subtracts the image data of the prediction reference image corresponding to the macro block transmitted from the motion compensation circuit 17 from the macro block data of the reference image transmitted from the scan converter 4 to obtain a difference as a prediction residual. Data is obtained and the difference data is sent 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 locally decoded by the inverse quantization circuit 12 and the IDCT circuit 14 and sent to the computing unit 15.
[0058]
The computing 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. The image data of the P picture is stored in a future reference image storage unit that stores a future reference image in the frame memory 16.
[0059]
Next, when image data of a frame to be processed as a 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 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, the 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. It is sent to the motion compensation circuit 17.
The motion compensation circuit 17 performs motion compensation on this image data in accordance with the backward motion vector S5 sent from the motion vector detection circuit 6.
[0060]
That is, in the backward prediction mode, the motion compensation circuit 17 sets the read address of the future reference image storage unit of the frame memory 16 from the position corresponding to the position of the macroblock currently output by the motion vector detection circuit 6. The prediction reference image is generated by reading the data shifted by the amount corresponding to S5 and sent to the arithmetic circuit 8 and the arithmetic unit 15.
[0061]
The arithmetic circuit 8 subtracts the image data of the prediction reference image corresponding to the macro block transmitted from the motion compensation circuit 17 from the macro block data of the reference image transmitted from the scan converter 4 to obtain a difference as a prediction residual. Data is obtained and the difference data is sent 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 locally decoded by the inverse quantization circuit 12 and the IDCT circuit 14 and sent to the computing unit 15.
The computing 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 B-picture image data is obtained.
[0062]
In the bidirectional prediction mode, image data stored in the past reference image storage unit of the frame memory 16 (in this case, I-picture image data) and image data stored in the future reference image storage unit (this (P-picture image data) is read out and sent to the motion compensation circuit 17.
The motion compensation circuit 17 performs motion compensation on this image data in accordance with the forward motion vector and the backward motion vector S5 sent from the motion vector detection circuit 6.
[0063]
That is, in the bidirectional prediction mode, the motion compensation circuit 17 sets the read addresses of the past reference image storage unit and the future reference image storage unit of the frame memory 16 to the position of the macro block currently output by the motion vector detection circuit 6. Data is read out from the corresponding position by an amount corresponding to the forward motion vector and the backward motion vector S5 to generate a predicted reference image, and is sent to the arithmetic circuit 8 and the arithmetic unit 15.
[0064]
The arithmetic circuit 8 subtracts the average value of the image data of the predicted reference image corresponding to the macro block transmitted from the motion compensation circuit 17 from the macro block data of the reference image transmitted from the scan converter 4 to predict the residual. And the difference data is sent 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 locally decoded by the inverse quantization circuit 12 and the IDCT circuit 14 and sent to the computing unit 15.
[0065]
The computing 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 B-picture image data 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) 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 corresponding to a quantization control algorithm described below in a ROM (Read Only Memory) 7A as a recording medium, and the CPU 7B performs this quantization control. According to the algorithm, a quantization step MQUANT used when quantizing each macroblock in the quantization circuit 10 is calculated using a RAM (Random Access Memory) 7C as a work area, and the quantization step MQUANT is calculated. 10 to send.
[0067]
The quantization control algorithm in the quantization control unit 7 will be described with reference to the flowcharts shown in FIGS.
Here, the video signal encoding apparatus 1 employs a variable rate encoding method as an encoding method. Before starting the quantization control algorithm, first, the digital video signal S1 is encoded by a fixed quantization step. The allocated code amount T for each frame based on the generated code amount generated i And the allocated code amount T for each frame i Are stored in the RAM 7C of the quantization control unit 7.
[0068]
In practice, the quantization control unit 7 sends a fixed quantization step QS to the quantization circuit 10. The quantization circuit 10 quantizes the DCT coefficient output from the DCT circuit 9 based on the quantization step QS designated by the quantization control unit 7 and sends it 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 encoding circuit 11, and assigns the allocated code amount T for each frame based on the generated code amount. i Is calculated and stored in the RAM 7C.
[0069]
The CPU 7B starts the quantization control algorithm from step SP1, and in step SP2, the quantization step qI for the first macroblock of the first I-picture in the coding order in the first GOP in the digital video signal S1. PREV Set the initial value of to "10". Also, the quantization step qP for the first macroblock of the first P picture in the coding order in the first GOP PREV Let k be the reference quantization step Q (first quantization step) for the last macroblock in the I-picture. P (K P = 1.0), and the quantization step qB for the first macroblock of the first B picture in the coding order in the first GOP PREV As k in the reference quantization step Q for the last macroblock in the I-picture. B (K B = A value multiplied by 1.0) is set. Where K P = 1.0, K B = 1.4, which represents the degree of roughness for the I-picture as in the case of the test model described above.
[0070]
Here, in practice, since the quantization control is performed for each picture in the coding order, the quantization for the first macroblock in the first P picture and the B picture in the coding order in the first GOP in step SP2. Step qB PREV And qP PREV Is set after the quantization control for the I-picture is completed.
[0071]
Also, the quantization step qI for the first macroblock in the first I picture in the encoding order in the GOP after the first GOP in the digital video signal S1. PREV As a reference quantization step Q for the last macroblock of the last I-picture in the previous GOP. Therefore, the quantization step qP for the first macroblock in the first P-picture and B-picture in the GOP after the first GOP in the coding order. PREV And qI PREV Is the quantization step qI for the last macroblock of the I-picture in the GOP being encoded. PREV Each with K P And K B The one multiplied by is used.
[0072]
Subsequently, in step SP3, the CPU 7B sets the counter curr_GOP to the first GOP, and then in step SP4, the allocated code amount T of each frame corresponding to GOPcurr_GOP to be encoded. i Are sequentially read from the RAM 7C, and the average bit rate curr_br per frame in the GOP curr_GOP to be encoded is defined as the average encoded data rate as follows:
[Expression 27]
Figure 0003937248
Calculate using. Here, since the video signal encoding apparatus 1 employs a variable rate encoding method, the average bit rate Curr_br calculated in step SP4 changes for each GOP.
[0073]
The calculation process of the average bit rate Curr_br will be described using the flowchart shown in FIG.
The CPU 7B starts the calculation process of the average bit rate Curr_br from the step SP20, initializes the counter value k of the counter that counts the number of frames at the step SP21, and assigns the code amount allocated to each frame in the GOPcurr_GOP to be encoded. T i After initializing the cumulative value sum of the arithmetic unit that calculates the cumulative value of, the allocated code amount T of the kth frame in the GOPcurr_GOP to be encoded in step SP22 k Is added to the cumulative value sum of the calculator.
[0074]
Subsequently, in step SP23, the CPU 7B compares the count value k of the counter with the number of frames N in GOPcurr_GOP to be encoded, and determines that the count value k of the counter does not match the number of frames N. , Allocated code amount T for all frames in the GOPcurr_GOP i Is not accumulated in the accumulated value sum, the process proceeds to step SP24, the count value k of the counter is incremented, and the process proceeds to step SP22.
[0075]
That is, the CPU 7B assigns the allocated code amount T of all frames in the GOPcurr_GOP to be encoded. i The processing loop from step SP22 to step SP24 is executed until the cumulative value sum of is obtained. If the CPU 7B obtains a positive result in step SP23, it proceeds to step SP25, calculates the average bit rate Curr_br per frame in the GOPcurr_GOP to be encoded based on the accumulated value sum and the picture rate Picture_rate, and averages it in step SP26. The calculation processing of bit rate Curr_br is terminated, and the process proceeds to step SP5 of the main routine.
[0076]
In step SP5, the CPU 7B calculates the following equation based on the average bit rate Curr_br and the picture rate Picture_rate.
[Expression 28]
Figure 0003937248
Is used to calculate the first parameter r. That is, the CPU 7B calculates the first parameter r represented by the ratio of the average bit rate Curr_br (average encoded data rate) to the picture rate Picture_rate. Here, since the average bit rate Curr_br calculated in step SP4 changes for each GOP, the first parameter r also changes for each GOP in conjunction with this.
[0077]
Next, in step SP6, the CPU 7B determines the quantization step qI of the last macroblock in the last frame of each picture type in the GOP immediately preceding the GOPcurr_GOP to be encoded. PREV , QP PREV Or qB PREV (Ie, a reference quantization step Q to be described later) and the first parameter r calculated in step SP5,
[Expression 29]
Figure 0003937248
[30]
Figure 0003937248
[31]
Figure 0003937248
, And a reference quantization step Q for the macroblock j to be encoded j Of virtual buffer dI for each picture type used to calculate 0 , DP 0 And dB 0 Is calculated as a third parameter.
[0078]
Here, the conventional test model can use the learning effect because the first parameter r is fixed (that is, the bit rate is fixed), but in the present invention, the bit rate changes for each GOP. Therefore, since the first parameter r also changes for each GOP, the learning effect cannot be obtained as it is. Therefore, in the present invention, the virtual buffer fullness is calculated for each GOP as the first parameter r changes.
[0079]
In addition, the fullness dI of the virtual buffer for the I picture used in calculating the reference quantization step Q for the first macroblock of the I picture that is the first picture in the coding order in the first GOP. 0 Quantization step qI required to calculate PREV (Step SP6) is "10".
[0080]
Next, in step SP7, the CPU 7B sets the frame Curr_frame to be encoded as the first frame in the GOPcurr_GOP to be encoded, and then initializes the frame counter j in step SP8. Subsequently, in step SP9, the CPU 7B
[Expression 32]
Figure 0003937248
, The virtual buffer fullness d * for the frame Curr_frame to be encoded j Is calculated as the second parameter.
[0081]
Here, the CPU 7B determines d * in the equation (32). 0 As shown below, the virtual buffer fullness dI calculated in step SP6 according to each picture type 0 , DP 0 Or dB 0 Is used as the initial value. Therefore, the virtual buffer fullness dI calculated in step SP6. 0 , DP 0 Or dB 0 The first parameter r varies from GOP to GOP and, as will be described later, the quantization step qI PREV , QP PREV And qB PREV Fluctuates from GOP to GOP, so the virtual buffer fullness d * 0 (Ie the third parameter dI 0 , DP 0 And dB 0 ) Is updated for each GOP.
[0082]
Where B j-1 Represents the total amount of generated codes actually generated from the first macroblock to the (j−1) th macroblock in the frame Curr_frame to be encoded, T curr _ frame Represents the allocated code amount T of the frame Curr_frame to be encoded. Therefore d * j Is the reference quantization step Q for the jth macroblock of the frame to be encoded. j This represents the degree of fullness of the virtual buffer used when calculating. Furthermore, MB_cnt represents the number of macroblocks in the frame to be encoded.
[0083]
That is, the CPU 7B determines the virtual buffer fullness d * as the third parameter for each picture type calculated in step SP6. 0 (Ie dI 0 , DP 0 Or dB 0 ) As an initial value, the generated code amount B actually generated up to the (j−1) th macroblock is set as the third parameter. i-1 And the allocated code amount T of the frame Curr_frame to be encoded curr _ frame Is the total of (j−1) × T assumed allocation code amounts up to the j−1th when it is assumed that the frame is uniformly allocated to each macro block of the frame Curr_frame to be encoded. curr _ frame / MB_cnt), which reflects the difference (difference for each macroblock), the reference quantization step Q for the macroblock j to be encoded j Degree of virtual buffer d * used when calculating j (DI j , DP j Or dB j ) As the second parameter. As a result, the degree of fullness d * of the virtual buffer as the second parameter is set so that the first parameter r calculated in step SP5 does not change in GOPCurr_GOP to be encoded. j Has been made to control.
[0084]
Next, in step SP10, the CPU 7B determines the capacity d * of the virtual buffer as the first parameter r and the second parameter. j Based on
[Expression 33]
Figure 0003937248
And the reference quantization step Q of the macroblock j to be encoded j Is calculated, and in step SP11, the quantization step q * in step SP6 is calculated. prev (QI prev , QP prev Or qB prev ) For the reference quantization step Q j Update to
[0085]
Therefore, when the reference quantization step Q is calculated for all macroblocks for all frames in the GOP to be encoded, the reference quantization step Q for the last macroblock in the last picture of each picture type in the GOP is calculated. Is the quantization step qI for the first macroblock of each picture type in the next GOP prev , QP prev And qB prev (Step SP6), so that in the next GOP, the filling degree d * of the virtual buffer as the second parameter used when calculating the reference quantization step Q for each macroblock for each picture type j Of virtual buffer dI as a third parameter used when calculating 0 , DP 0 And dB 0 (Initial value) is updated. Thus, the continuity of the reference quantization step Q can be maintained even if the first parameter r changes for each GOP.
[0086]
Subsequently, in step SP12, the CPU 7B performs the same process as the third step in the above-described test model, whereby the quantization step MQUANT for the macroblock j is performed. j Is calculated as a second quantization step. That is, the CPU 7B first divides the macro block j into four sub blocks (luminance blocks) sblk, and then, for each of the four sub blocks sblk, each pixel value P in the sub block sblk. m And the following formula
[Expression 34]
Figure 0003937248
Each pixel value P in the sub-block sblk calculated using m Average value P ave Is calculated for all pixels (64 pixels) in the sub-block sblk, and the calculation result (P m -P ave ) 2 The total of the activity in the subblock sblk var sblk As
[Expression 35]
Figure 0003937248
Is calculated using the following formula:
[Expression 36]
Figure 0003937248
The minimum activity var of the four sub-blocks sblk sblk Subblock sblk activity with var sblk Act on Macroblock j act j Calculate as
[0087]
Next, the CPU 7B performs an activity act on the macroblock j. j The following formula
[Expression 37]
Figure 0003937248
Followed by normalization using the normalized coefficient N_act j And the reference quantization step Q calculated in step SP11. j And based on
[Formula 38]
Figure 0003937248
, The final quantization step for macroblock j MQUANT j Is calculated.
[0088]
Subsequently, in step SP13, the CPU 7B determines whether or not the macro block j to be encoded is the last macro block in the frame Curr_frame to be encoded, and when a negative result is obtained, the process proceeds to step SP14. The frame counter j is incremented, and the processing from step SP9 to step SP12 is executed. That is, the CPU 7B executes a processing loop from step SP9 to step SP14 until a positive result is obtained at step SP13, that is, until the quantization step MQUANT is calculated for all macroblocks of the frame Curr_frame to be encoded.
[0089]
When the CPU 7B obtains a positive result in step SP13, the CPU 7B proceeds to step SP15, determines whether or not the frame Curr_frame to be encoded is the last frame in GOPCurr_GOP to be encoded, and obtains a negative result. In some cases, the process proceeds to step SP16 to set the processing target to the next frame, and the processing from step SP8 to step SP13 is executed. That is, the CPU 7B executes the processing loop from step SP8 to step SP16 until it obtains a positive result at step SP15, that is, until it calculates the quantization step MQUANT for all macroblocks in all frames in the GOPCurr_GOP to be encoded. Execute.
[0090]
If the CPU 7B obtains an affirmative result at step SP15, it proceeds to step SP17 to determine whether or not GOPCurr_GOP to be encoded is the last GOP in the digital video signal S1. Proceeding to SP18, the processing target is set to the next GOP, and the processing from step SP4 to step SP17 is executed. That is, until the CPU 7B obtains a positive result in step SP17, that is, until it calculates the quantization step MQUANT for all macroblocks in all frames in all GOPs in the digital video signal S1 to be encoded, step SP4. To the process SP18 is executed.
If the CPU 7B obtains a positive result at step SP17, it ends the quantization control algorithm at step SP19.
[0091]
The quantization control unit 7 sends the quantization step MQUANT calculated for each macro block to the quantization circuit 11 according to the above-described quantization control algorithm. The quantization circuit 11 outputs the DCT coefficient output from the DCT circuit 9. Is quantized based on the quantization step MQUANT designated by the quantization control unit 7.
Thus, the video signal encoding apparatus 1 can perform quantization control even in the variable rate encoding method.
[0092]
(2-2) Operation and effect of the embodiment
In the above configuration, the video signal encoding apparatus 1 calculates the average encoded data rate curr_br per frame in the GOP for each GOP, and uses the average encoded data rate curr_br for the first parameter for each GOP. Since r is calculated, the first parameter r can be changed according to the encoded data rate curr_br in each GOP.
[0093]
The video signal encoding apparatus 1 also includes a virtual buffer fullness dI as a third parameter used when calculating the quantization step Q for each frame for each picture type in the GOP. o , DP o And dB o Is updated using the reference quantization step Q for the last macroblock in the last frame of each picture type in the GOP in the GOP immediately before the GOP to be encoded. Even if the parameter r of 1 changes, the continuity of the reference quantization step Q between the GOPs can be maintained.
[0094]
According to the above configuration, the average encoded data rate curr_br per frame in the GOP is calculated for each GOP, and the first parameter r is calculated for each GOP using the average encoded data rate curr_br. In the GOP immediately preceding the target GOP, the reference quantization step Q for the last macroblock in the last frame of each picture type in the encoding order and the first parameter r calculated for the GOP to be encoded Based on the virtual buffer fullness dI used to calculate the quantization step Q for each macroblock in each frame for each picture type. o , DP o And dB o As the third parameter, and the virtual buffer fullness dI o , DP o And dB o Further, the sum of the generated code amounts actually generated up to the macro block immediately before the macro block j to be encoded and the assumed allocation code to the macro block immediately before the macro block j to be encoded A virtual buffer fullness dI as a second parameter for each picture type that reflects the difference from the total amount j , DP j And dB j And the degree of fullness dI of the virtual buffer j , DP j Or dB j And a reference quantization step Q for each macroblock in each frame of each picture type based on the first parameter r calculated for the GOP to be encoded, and the complexity of the image for each reference quantization step Q By calculating the quantization step MQUANT considering the intensity of sheath movement, the first parameter r can be changed according to the average encoded data rate curr_br in each GOP, and the first parameter for each GOP. Even if r changes, the continuity of the reference quantization step Q between the GOPs can be maintained.
Thus, it is possible to realize a video signal encoding method and a video signal encoding apparatus capable of performing quantization control that can support a variable rate encoding method. Further, by recording a quantization algorithm as shown in FIG. 3 on a recording medium (ROM 7A) as a program, a video signal encoding device capable of performing quantization control compatible with a variable rate encoding method is realized. Can do.
[0095]
(3) Third embodiment
In the above-described embodiment, the allocated code amount T for each frame based on the generated code amount generated by encoding the digital video signal S1 based on the fixed quantization step. i And the allocated code amount T for each frame i Is stored in the RAM 7C of the quantization controller 7, but the present invention is not limited to this. For each GOP, the digital video signal S1 is encoded by a fixed quantization step. May be determined, and the allocated code amount for each GOP may be stored in the RAM 7C of the quantization control unit 7. In this case, the R (remaining code amount given to the GOP) in the first step in the above time model is changed for each GOP, and the allocated code amount is assigned to each frame in the same process as in the first step. After that, the quantization control algorithm of the present invention is applied.
[0096]
In the above-described embodiment, the allocated code amount T for each frame determined based on the generated code amount generated by encoding the digital video signal S1 based on the fixed quantization step. i Was previously stored in the RAM 7C of the quantization control unit 7, but the present invention is not limited to this, and is based on the generated code amount generated by encoding the digital video signal S1 in a fixed quantization step. Code amount T for each frame i May be programmed as the first processing step of the quantization algorithm shown in FIG.
[0097]
Further, in the above-described embodiment, the case where the average encoded data rate is calculated using 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 frames. In this case, a predetermined number of frames including the frame to be encoded may be slid. Also, the average bit rate may be calculated in video units larger than GOP, for example, 2 GOP units, or the average bit rate may be calculated in units smaller than GOP. FIG. 5 shows an example when N = 6.
[0098]
Further, in the above-described embodiment, in the video signal encoding apparatus 1, the allocated code amount T for each frame is based on the generated code amount generated when the digital video signal S1 is encoded in a fixed quantization step. i And the allocated code amount T for each frame i Is stored in the RAM 7C of the quantization control unit 7, but the present invention is not limited to this, and the allocated code amount for each frame is calculated by using another video signal encoding device, and for each frame. May be sent to the quantization control unit 7 and stored in the RAM 7C.
[0099]
Further, in the above-described embodiment, the case where the quantization control algorithm shown in FIG. 3 is realized using the ROM 7A as a program has been described. However, the present invention is not limited to this, and the quantization control algorithm shown in FIG. May be realized as hardware.
[0100]
【The invention's effect】
As described above, according to the present invention, the average encoded data rate per picture in the GOP is calculated based on the allocated code amount for each GOP or picture, and is expressed as a ratio of the average encoded data rate to the picture rate. 1 parameter is calculated for each GOP, and the last block in the last picture of the same picture type as the current coding control picture in the coding order in the GOP one temporally before the GOP to be coded. A virtual buffer used to calculate the quantization step for each block in each picture for each image type based on the first quantization step for GOP and the first parameter for the GOP to be encoded. Is calculated as the third parameter, and the block before the block to be encoded is calculated. The degree of fullness of the virtual buffer reflecting the difference between the assigned code amount and the generated code amount for the third parameter is calculated as the second parameter, and based on the first parameter and the second parameter By calculating the first quantization step for the block to be encoded, the first parameter can be changed according to the average encoded data rate in each GOP. Thus, it is possible to realize a video signal encoding method and a video signal encoding apparatus capable of performing quantization control that can support a variable rate encoding method.
[Brief description of the drawings]
FIG. 1 is a block diagram showing the overall configuration of a video signal encoding apparatus to which the present invention is applied.
FIG. 2 is a block diagram showing a configuration of a quantization control unit.
FIG. 3 is a flowchart for explaining a quantization algorithm in a quantization control unit;
FIG. 4 is a flowchart for explaining the processing procedure of the average bit rate calculation processing.
FIG. 5 is a schematic diagram for explaining a method of calculating an average bit rate according to another embodiment.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Video signal encoding device, 2 ... Image encoding type designation circuit, 3 ... Image encoding order rearrangement circuit, 4 ... Scan converter, 5 ... Prediction mode determination 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 code , 12... Inverse quantization circuit, 13... Buffer, 14... IDCT circuit, 15... Arithmetic unit, 16.

Claims (12)

デイジタル映像信号を符号化する映像信号符号化方法において、
上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することにより得られるGOP(Group of Pictures)又はピクチヤ毎の発生符号量に基づいて生成された、上記GOP又は上記ピクチヤ毎の割当て符号量に基づいて、上記GOPにおける上記ピクチヤ当たりの平均符号化データ速度を算出する平均符号化データ速度算出ステツプと、
ピクチヤレートに対する上記平均符号化データ速度の割合いで表される第1のパラメータを上記GOP毎に算出する第1のパラメータ算出ステツプと、
符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対象のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての上記第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を上記第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出する第2のパラメータ算出ステツプと、
上記第1のパラメータ及び上記第2のパラメータに基づいて上記符号化対象としているブロツクについての上記第1の量子化ステツプを算出する第1の量子化ステツプ算出ステツプと
上記第1の量子化ステツプ算出ステツプで算出された上記第1の量子化ステツプを用いて上記デイジタル映像信号を量子化して量子化データを生成する量子化処理ステツプと、
上記量子化データを符号化する符号化ステツプと
を具えることを特徴とする映像信号符号化方法。
In a video signal encoding method for encoding a digital video signal,
Assigned code amount for each GOP or each picture generated based on a GOP (Group of Pictures) or a generated code amount for each picture obtained by encoding the digital video signal based on a fixed quantization step An average encoded data rate calculating step for calculating an average encoded data rate per picture in the GOP, based on
A first parameter calculation step for calculating, for each GOP, a first parameter expressed by a ratio of the average encoded data rate to a picture rate;
In GOP before one temporally than the GOP is an encoding target, the first quantization step and codes for the last block in the last picture of the same picture type as the current encoding target picture in the coding order Based on the first parameter for the GOP to be converted, the third parameter is the degree of fullness of the virtual buffer used when calculating the quantization step for each block in each picture for each image type. The degree of fullness of the virtual buffer, which is calculated and reflects the difference between the allocated code amount and the generated code amount up to the block immediately preceding the block to be encoded in the third parameter, is set as the second parameter. A second parameter calculating step to calculate as
A first quantization step calculating step for calculating the first quantization step for the block to be encoded based on the first parameter and the second parameter ;
A quantization processing step for generating quantized data by quantizing the digital video signal using the first quantization step calculated in the first quantization step calculating step;
A video signal encoding method comprising: an encoding step for encoding the quantized data .
上記ピクチヤ毎の割当て符号量は、上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することにより発生した発生符号量に基づいて上記GOP毎の割当て符号量を算出し、当該GOP毎の割当て符号量に基づいて決定される
ことを特徴とする請求項1に記載の映像信号符号化方法。
The allocated code amount for each picture is calculated by calculating the allocated code amount for each GOP based on the generated code amount generated by encoding the digital video signal based on a fixed quantization step. The video signal encoding method according to claim 1, wherein the video signal encoding method is determined based on an allocated code amount.
上記符号化対象としているブロツクの各輝度ブロツクにおける画素値に基づいて当該ブロツクについてのアクテイビテイを算出し、当該アクテイビテイ及び上記符号化対象としているブロツクについての上記第1の量子化ステツプに基づいて当該ブロツクについての第2の量子化ステツプを算出する第2の量子化ステツプ算出ステツプを具え、
上記量子化処理ステツプは、上記第2の量子化ステツプ算出ステツプで算出された上記第2の量子化ステツプを用いて上記デイジタル映像信号を量子化して上記量子化データを生成する
ことを特徴とする請求項1に記載の映像信号符号化方法。
The activity for the block is calculated based on the pixel value in each luminance block of the block to be encoded, and the block is based on the activity and the first quantization step for the block to be encoded. A second quantization step calculating step for calculating a second quantization step for
The quantization processing step generates the quantized data by quantizing the digital video signal using the second quantization step calculated in the second quantization step calculating step. The video signal encoding method according to claim 1.
デイジタル映像信号を符号化する映像信号符号化方法において、
上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することにより得られる符号化対象のピクチヤを含む所定数のピクチヤの発生符号量に基づいて生成された、上記所定数のピクチヤの割当て符号量に基づいて、上記所定数のピクチヤにおけるピクチヤ当たりの平均符号化データ速度を算出する平均符号化データ速度算出ステツプと、
ピクチヤレートに対する上記平均符号化データ速度の割合いで表される第1のパラメータをGOP(Group of Pictures)毎に算出する第1のパラメータ算出ステツプと、
符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対象のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての上記第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を上記第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出する第2のパラメータ算出ステツプと、
上記第1のパラメータ及び上記第2のパラメータに基づいて上記符号化対象としているブロツクについての上記第1の量子化ステツプを算出する第1の量子化ステツプ算出ステツプと
上記第1の量子化ステツプ算出ステツプで算出された上記第1の量子化ステツプを用いて上記デイジタル映像信号を量子化して量子化データを生成する量子化処理ステツプと、
上記量子化データを符号化する符号化ステツプと
を具えることを特徴とする映像信号符号化方法。
In a video signal encoding method for encoding a digital video signal,
Assigned code of the predetermined number of pictures generated based on the generated code amount of the predetermined number of pictures including the picture to be encoded obtained by encoding the digital video signal based on a fixed quantization step An average encoded data rate calculating step for calculating an average encoded data rate per picture for the predetermined number of pictures based on a quantity;
A first parameter calculating step for calculating a first parameter expressed by a ratio of the average encoded data rate to a picture rate for each GOP (Group of Pictures);
In GOP before one temporally than the GOP is an encoding target, the first quantization step and codes for the last block in the last picture of the same picture type as the current encoding target picture in the coding order Based on the first parameter for the GOP to be converted, the third parameter is the degree of fullness of the virtual buffer used when calculating the quantization step for each block in each picture for each image type. The degree of fullness of the virtual buffer, which is calculated and reflects the difference between the allocated code amount and the generated code amount up to the block immediately preceding the block to be encoded in the third parameter, is set as the second parameter. A second parameter calculating step to calculate as
A first quantization step calculating step for calculating the first quantization step for the block to be encoded based on the first parameter and the second parameter ;
A quantization processing step for generating quantized data by quantizing the digital video signal using the first quantization step calculated in the first quantization step calculating step;
A video signal encoding method comprising: an encoding step for encoding the quantized data .
デイジタル映像信号を符号化する映像信号符号化方法において、
上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することによりGOP(Group of Pictures)又はピクチヤ毎の発生符号量を算出する発生符号量算出ステツプと、
上記発生符号量算出ステツプで算出された発生符号量に基づいて上記GOP又は上記ピクチヤ毎の割当て符号量を算出する割当符号量算出ステツプと、
上記割当符号量算出ステツプで算出された割当て符号量に基づいて上記GOPにおける上記ピクチヤ当たりの平均符号化データ速度を算出する平均符号化データ速度算出ステツプと、
ピクチヤレートに対する上記平均符号化データ速度の割合いで表される第1のパラメータを上記GOP毎に算出する第1のパラメータ算出ステツプと、
符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対象のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての上記第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を上記第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出する第2のパラメータ算出ステツプと、
上記第1のパラメータ及び上記第2のパラメータに基づいて上記符号化対象としているブロツクについての上記第1の量子化ステツプを算出する第1の量子化ステツプ算出ステツプと、
上記第1の量子化ステツプ算出ステツプで算出された上記第1の量子化ステツプを用いて上記デイジタル映像信号を量子化して量子化データを生成する量子化処理ステツプと、
上記量子化データを符号化する符号化ステツプと
を具えることを特徴とする映像信号符号化方法。
In a video signal encoding method for encoding a digital video signal,
A generated code amount calculating step for calculating a generated code amount for each GOP (Group of Pictures) or picture by encoding the digital video signal based on a fixed quantization step;
An allocated code amount calculation step for calculating an allocated code amount for each GOP or the picture based on the generated code amount calculated in the generated code amount calculation step;
An average encoded data rate calculating step for calculating an average encoded data rate per picture in the GOP based on the allocated code amount calculated in the allocated code amount calculating step;
A first parameter calculation step for calculating, for each GOP, a first parameter expressed by a ratio of the average encoded data rate to a picture rate;
In GOP before one temporally than the GOP is an encoding target, the first quantization step and codes for the last block in the last picture of the same picture type as the current encoding target picture in the coding order Based on the first parameter for the GOP to be converted, the third parameter is the degree of fullness of the virtual buffer used when calculating the quantization step for each block in each picture for each image type. The degree of fullness of the virtual buffer, which is calculated and reflects the difference between the allocated code amount and the generated code amount up to the block immediately preceding the block to be encoded in the third parameter, is set as the second parameter. A second parameter calculating step to calculate as
A first quantization step calculating step for calculating the first quantization step for the block to be encoded based on the first parameter and the second parameter;
A quantization processing step for generating quantized data by quantizing the digital video signal using the first quantization step calculated in the first quantization step calculating step;
A video signal encoding method comprising: an encoding step for encoding the quantized data.
デイジタル映像信号を符号化する映像信号符号化方法において、
上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することにより符号化対象のピクチヤを含む所定数のピクチヤの発生符号量を算出する発生符号量算出ステツプと、
上記発生符号量算出ステツプで算出された発生符号量に基づいて上記所定数のピクチヤの割当て符号量を算出する割当符号量算出ステツプと、
上記割当符号量算出ステツプで算出された割当て符号量に基づいて上記所定数のピクチヤにおける上記ピクチヤ当たりの平均符号化データ速度を算出する平均符号化データ速度算出ステツプと、
ピクチヤレートに対する上記平均符号化データ速度の割合いで表される第1のパラメータをGOP(Group of Pictures)毎に算出する第1のパラメータ算出ステツプと、
符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対象のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての上記第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を上記第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出する第2のパラメータ算出ステツプと、
上記第1のパラメータ及び上記第2のパラメータに基づいて上記符号化対象としているブロツクについての上記第1の量子化ステツプを算出する第1の量子化ステツプ算出ステツプと、
上記第1の量子化ステツプ算出ステツプで算出された上記第1の量子化ステツプを用いて上記デイジタル映像信号を量子化して量子化データを生成する量子化処理ステツプと、
上記量子化データを符号化する符号化ステツプと
を具えることを特徴とする映像信号符号化方法。
In a video signal encoding method for encoding a digital video signal,
A generated code amount calculating step for calculating a generated code amount of a predetermined number of pictures including a picture to be encoded by encoding the digital video signal based on a fixed quantization step;
An allocation code amount calculation step for calculating an allocation code amount of the predetermined number of pictures based on the generated code amount calculated in the generated code amount calculation step;
An average encoded data rate calculating step for calculating an average encoded data rate per picture in the predetermined number of pictures based on the assigned code quantity calculated in the allocated code quantity calculating step;
A first parameter calculating step for calculating a first parameter expressed by a ratio of the average encoded data rate to a picture rate for each GOP (Group of Pictures);
In GOP before one temporally than the GOP is an encoding target, the first quantization step and codes for the last block in the last picture of the same picture type as the current encoding target picture in the coding order Based on the first parameter for the GOP to be converted, the third parameter is the degree of fullness of the virtual buffer used when calculating the quantization step for each block in each picture for each image type. The degree of fullness of the virtual buffer, which is calculated and reflects the difference between the allocated code amount and the generated code amount up to the block immediately preceding the block to be encoded in the third parameter, is set as the second parameter. A second parameter calculating step to calculate as
A first quantization step calculating step for calculating the first quantization step for the block to be encoded based on the first parameter and the second parameter;
A quantization processing step for generating quantized data by quantizing the digital video signal using the first quantization step calculated in the first quantization step calculating step;
A video signal encoding method comprising: an encoding step for encoding the quantized data.
デイジタル映像信号を符号化する映像信号符号化装置において、
上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することにより得られるGOP(Group of Pictures)又はピクチヤ毎の発生符号量に基づいて生成された、上記GOP又は上記ピクチヤ毎の割当て符号量に基づいて、上記GOPにおける上記ピクチヤ当たりの平均符号化データ速度を算出する平均符号化データ速度算出手段と、
ピクチヤレートに対する上記平均符号化データ速度の割合いで表される第1のパラメータを上記GOP毎に算出する第1のパラメータ算出手段と、
符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対象のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての上記第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を上記第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出する第2のパラメータ算出手段と、
上記第1のパラメータ及び上記第2のパラメータに基づいて上記符号化対象としているブロツクについての上記第1の量子化ステツプを算出する第1の量子化ステツプ算出手段と
上記第1の量子化ステツプ算出手段によつて算出された上記第1の量子化ステツプを用いて上記デイジタル映像信号を量子化して量子化データを生成する量子化手段と、
上記量子化データを符号化する符号化手段と
を具えることを特徴とする映像信号符号化装置。
In a video signal encoding device for encoding a digital video signal,
Assigned code amount for each GOP or each picture generated based on a GOP (Group of Pictures) or a generated code amount for each picture obtained by encoding the digital video signal based on a fixed quantization step An average encoded data rate calculating means for calculating an average encoded data rate per picture in the GOP,
First parameter calculating means for calculating, for each GOP, a first parameter expressed by a ratio of the average encoded data rate to a picture rate;
In GOP before one temporally than the GOP is an encoding target, the first quantization step and codes for the last block in the last picture of the same picture type as the current encoding target picture in the coding order Based on the first parameter for the GOP to be converted, the third parameter is the degree of fullness of the virtual buffer used when calculating the quantization step for each block in each picture for each image type. The degree of fullness of the virtual buffer, which is calculated and reflects the difference between the allocated code amount and the generated code amount up to the block immediately preceding the block to be encoded in the third parameter, is set as the second parameter. Second parameter calculation means for calculating
First quantization step calculating means for calculating the first quantization step for the block to be encoded based on the first parameter and the second parameter ;
Quantization means for quantizing the digital video signal using the first quantization step calculated by the first quantization step calculation means to generate quantized data;
A video signal encoding apparatus comprising encoding means for encoding the quantized data .
上記ピクチヤ毎の割当て符号量は、上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することにより発生した発生符号量に基づいて上記GOP毎の割当て符号量を算出し、当該GOP毎の割当て符号量に基づいて決定される
ことを特徴とする請求項7に記載の映像信号符号化装置。
The allocated code amount for each picture is calculated by calculating the allocated code amount for each GOP based on the generated code amount generated by encoding the digital video signal based on a fixed quantization step. The video signal encoding apparatus according to claim 7, wherein the video signal encoding apparatus is determined based on an allocated code amount.
上記符号化対象としているブロツクの各輝度ブロツクにおける画素値に基づいて当該ブロツクについてのアクテイビテイを算出し、当該アクテイビテイ及び上記符号化対象としているブロツクについての上記第1の量子化ステツプに基づいて当該ブロツクについての第2の量子化ステツプを算出する第2の量子化ステツプ算出手段を具え、
上記量子化手段は、上記第2の量子化ステツプ算出手段で算出された上記第2の量子化ステツプを用いて上記デイジタル映像信号を量子化して上記量子化データを生成する
ことを特徴とする請求項7に記載の映像信号符号化装置。
The activity for the block is calculated based on the pixel value in each luminance block of the block to be encoded, and the block is based on the activity and the first quantization step for the block to be encoded. Comprising a second quantization step calculating means for calculating a second quantization step for
The quantization means quantizes the digital video signal using the second quantization step calculated by the second quantization step calculation means to generate the quantized data. Item 8. The video signal encoding device according to Item 7.
デイジタル映像信号を符号化する映像信号符号化装置において、
上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することにより得られる符号化対象のピクチヤを含む所定数のピクチヤの発生符号量に基づいて生成された、上記所定数のピクチヤの割当て符号量に基づいて、上記所定数のピクチヤにおけるピクチヤ当たりの平均符号化データ速度を算出する平均符号化データ速度算出手段と、
ピクチヤレートに対する上記平均符号化データ速度の割合いで表される第1のパラメータをGOP(Group of Pictures)毎に算出する第1のパラメータ算出手段と、
符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対象のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての上記第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を上記第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出する第2のパラメータ算出手段と、
上記第1のパラメータ及び上記第2のパラメータに基づいて上記符号化対象としているブロツクについての上記第1の量子化ステツプを算出する第1の量子化ステツプ算出手段と
上記第1の量子化ステツプ算出手段によつて算出された上記第1の量子化ステツプを用いて上記デイジタル映像信号を量子化して量子化データを生成する量子化手段と、
上記量子化データを符号化する符号化手段と
を具えることを特徴とする映像信号符号化装置。
In a video signal encoding device for encoding a digital video signal,
Assigned code of the predetermined number of pictures generated based on the generated code amount of the predetermined number of pictures including the picture to be encoded obtained by encoding the digital video signal based on a fixed quantization step An average encoded data rate calculating means for calculating an average encoded data rate per picture in the predetermined number of pictures based on a quantity;
First parameter calculation means for calculating a first parameter expressed by a ratio of the average encoded data rate to a picture rate for each GOP (Group of Pictures);
In GOP before one temporally than the GOP is an encoding target, the first quantization step and codes for the last block in the last picture of the same picture type as the current encoding target picture in the coding order Based on the first parameter for the GOP to be converted, the third parameter is the degree of fullness of the virtual buffer used when calculating the quantization step for each block in each picture for each image type. The degree of fullness of the virtual buffer, which is calculated and reflects the difference between the allocated code amount and the generated code amount up to the block immediately preceding the block to be encoded in the third parameter, is set as the second parameter. Second parameter calculation means for calculating
First quantization step calculating means for calculating the first quantization step for the block to be encoded based on the first parameter and the second parameter ;
Quantization means for quantizing the digital video signal using the first quantization step calculated by the first quantization step calculation means to generate quantized data;
A video signal encoding apparatus comprising encoding means for encoding the quantized data .
デイジタル映像信号を符号化する映像信号符号化装置において、
上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することによりGOP(Group of Pictures)又はピクチヤ毎の発生符号量を算出する発生符号量算出手段と、
上記発生符号量算出手段によつて算出された発生符号量に基づいて上記GOP又は上記ピクチヤ毎の割当て符号量を算出する割当符号量算出手段と、
上記割当符号量算出手段によつて算出された割当て符号量に基づいて上記GOPにおける上記ピクチヤ当たりの平均符号化データ速度を算出する平均符号化データ速度算出手段と、
ピクチヤレートに対する上記平均符号化データ速度の割合いで表される第1のパラメータを上記GOP毎に算出する第1のパラメータ算出手段と、
符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対象のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての上記第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を上記第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出する第2のパラメータ算出手段と、
上記第1のパラメータ及び上記第2のパラメータに基づいて上記符号化対象としているブロツクについての上記第1の量子化ステツプを算出する第1の量子化ステツプ算出手段と、
上記第1の量子化ステツプ算出手段によつて算出された上記第1の量子化ステツプを用いて上記デイジタル映像信号を量子化して量子化データを生成する量子化手段と、
上記量子化データを符号化する符号化手段と
を具えることを特徴とする映像信号符号化装置。
In a video signal encoding device for encoding a digital video signal,
A generated code amount calculating means for calculating a generated code amount for each GOP (Group of Pictures) or picture by encoding the digital video signal based on a fixed quantization step;
An allocated code amount calculating means for calculating an allocated code amount for each GOP or the picture based on the generated code amount calculated by the generated code amount calculating means;
Average encoded data rate calculating means for calculating an average encoded data rate per picture in the GOP based on the allocated code amount calculated by the allocated code amount calculating means;
First parameter calculating means for calculating, for each GOP, a first parameter expressed by a ratio of the average encoded data rate to a picture rate;
In GOP before one temporally than the GOP is an encoding target, the first quantization step and codes for the last block in the last picture of the same picture type as the current encoding target picture in the coding order Based on the first parameter for the GOP to be converted, the third parameter is the degree of fullness of the virtual buffer used when calculating the quantization step for each block in each picture for each image type. The degree of fullness of the virtual buffer, which is calculated and reflects the difference between the allocated code amount and the generated code amount up to the block immediately preceding the block to be encoded in the third parameter, is set as the second parameter. Second parameter calculation means for calculating
First quantization step calculating means for calculating the first quantization step for the block to be encoded based on the first parameter and the second parameter;
Quantization means for quantizing the digital video signal using the first quantization step calculated by the first quantization step calculation means to generate quantized data;
A video signal encoding apparatus comprising: encoding means for encoding the quantized data.
デイジタル映像信号を符号化する映像信号符号化装置において、
上記デイジタル映像信号を固定の量子化ステツプに基づいて符号化することにより符号化対象のピクチヤを含む所定数のピクチヤの発生符号量を算出する発生符号量算出手段と、
上記発生符号量算出手段によつて算出された発生符号量に基づいて上記所定数のピクチヤの割当て符号量を算出する割当符号量算出手段と、
上記割当符号量算出手段によつて算出された割当て符号量に基づいて上記所定数のピクチヤにおける上記ピクチヤ当たりの平均符号化データ速度を算出する平均符号化データ速度算出手段と、
ピクチヤレートに対する上記平均符号化データ速度の割合いで表される第1のパラメータをGOP(Group of Pictures)毎に算出する第1のパラメータ算出手段と、
符号化対象としているGOPより時間的に1つ前のGOPにおいて、符号化順序で現在の符号化対象のピクチヤと同じ画像タイプの最後のピクチヤにおける最後のブロツクについての第1の量子化ステツプ及び符号化対象としているGOPについての上記第1のパラメータに基づいて、各画像タイプ毎の各ピクチヤにおける各ブロツクについての量子化ステツプを算出する際に用いる仮想的なバツフアの充満度を第3のパラメータとして算出し、符号化対象のブロツクの一つ前のブロツクまでについての割当て符号量と発生符号量との差分を上記第3のパラメータに反映させた仮想的なバツフアの充満度を、第2のパラメータとして算出する第2のパラメータ算出手段と、
上記第1のパラメータ及び上記第2のパラメータに基づいて上記符号化対象としているブロツクについての上記第1の量子化ステツプを算出する第1の量子化ステツプ算出手段と、
上記第1の量子化ステツプ算出手段によつて算出された上記第1の量子化ステツプを用いて上記デイジタル映像信号を量子化して量子化データを生成する量子化手段と、
上記量子化データを符号化する符号化手段と
を具えることを特徴とする映像信号符号化装置。
In a video signal encoding device for encoding a digital video signal,
A generated code amount calculating means for calculating a generated code amount of a predetermined number of pictures including a picture to be encoded by encoding the digital video signal based on a fixed quantization step;
Allocation code amount calculation means for calculating an allocation code amount of the predetermined number of pictures based on the generated code amount calculated by the generated code amount calculation means;
Average encoded data rate calculating means for calculating an average encoded data rate per picture in the predetermined number of pictures based on the assigned code quantity calculated by the allocated code quantity calculating means;
First parameter calculation means for calculating a first parameter expressed by a ratio of the average encoded data rate to a picture rate for each GOP (Group of Pictures);
In GOP before one temporally than the GOP is an encoding target, the first quantization step and codes for the last block in the last picture of the same picture type as the current encoding target picture in the coding order Based on the first parameter for the GOP to be converted, the third parameter is the degree of fullness of the virtual buffer used when calculating the quantization step for each block in each picture for each image type. The degree of fullness of the virtual buffer, which is calculated and reflects the difference between the allocated code amount and the generated code amount up to the block immediately preceding the block to be encoded in the third parameter, is set as the second parameter. Second parameter calculation means for calculating
First quantization step calculating means for calculating the first quantization step for the block to be encoded based on the first parameter and the second parameter;
Quantization means for quantizing the digital video signal using the first quantization step calculated by the first quantization step calculation means to generate quantized data;
A video signal encoding apparatus comprising: encoding means for encoding the quantized data.
JP30697396A 1996-10-31 1996-10-31 Video signal encoding method and video signal encoding apparatus Expired - Fee Related JP3937248B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30697396A JP3937248B2 (en) 1996-10-31 1996-10-31 Video signal encoding method and video signal encoding apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30697396A JP3937248B2 (en) 1996-10-31 1996-10-31 Video signal encoding method and video signal encoding apparatus

Publications (2)

Publication Number Publication Date
JPH10136354A JPH10136354A (en) 1998-05-22
JP3937248B2 true JP3937248B2 (en) 2007-06-27

Family

ID=17963500

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30697396A Expired - Fee Related JP3937248B2 (en) 1996-10-31 1996-10-31 Video signal encoding method and video signal encoding apparatus

Country Status (1)

Country Link
JP (1) JP3937248B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060227870A1 (en) * 2005-03-10 2006-10-12 Tao Tian Context-adaptive bandwidth adjustment in video rate control
JP4254867B2 (en) 2007-01-31 2009-04-15 ソニー株式会社 Information processing apparatus and method, program, and recording medium
JP4254866B2 (en) 2007-01-31 2009-04-15 ソニー株式会社 Information processing apparatus and method, program, and recording medium
JP4488027B2 (en) 2007-05-17 2010-06-23 ソニー株式会社 Information processing apparatus and method, and information processing system

Also Published As

Publication number Publication date
JPH10136354A (en) 1998-05-22

Similar Documents

Publication Publication Date Title
US7881373B2 (en) Video data compression apparatus and method of same
JP3952509B2 (en) Image encoding apparatus, image encoding method, and medium storing image encoding program
EP0677969B1 (en) Moving picture coding method and an apparatus therefor
JPH05252507A (en) Motion video compression system using adaptive bit allocation and quantization
EP1383339A1 (en) Memory management method for video sequence motion estimation and compensation
US6661840B1 (en) Image encoder and method of the same
JP3872849B2 (en) Video encoding device
JP4295828B2 (en) Encoding with region information
JP3937248B2 (en) Video signal encoding method and video signal encoding apparatus
KR100790148B1 (en) Real-time video content complexity measur for rate control of video encoder
JPH10164588A (en) Video-signal encoding method, video-signal encoder and recording medium
JPH09294267A (en) Image compression coder
JPH08307860A (en) Scene re-encoder
JPH10108197A (en) Image coder, image coding control method, and medium storing image coding control program
JPH09191458A (en) Moving image compression coding method and its device
JP2001008207A (en) Dynamic image coder and method therefor
JPH10126794A (en) Compressor for image signal between motion prediction frames
JP3765129B2 (en) Encoding apparatus and encoding method
JPH114444A (en) Image coder and its method
JP3652889B2 (en) Video encoding method, video encoding device, recording medium, and video communication system
JPH1066092A (en) Video data compressor and its method
JPH0646411A (en) Picture coder
JPH09261633A (en) Video data compression device and method therefor
JP3651302B2 (en) Data encoding method and apparatus
JPH11136678A (en) Coding method and coder

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050901

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050909

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051108

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060901

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061018

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070302

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070315

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100406

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110406

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120406

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees