JP4362794B2 - Video encoding apparatus and method - Google Patents

Video encoding apparatus and method Download PDF

Info

Publication number
JP4362794B2
JP4362794B2 JP19014499A JP19014499A JP4362794B2 JP 4362794 B2 JP4362794 B2 JP 4362794B2 JP 19014499 A JP19014499 A JP 19014499A JP 19014499 A JP19014499 A JP 19014499A JP 4362794 B2 JP4362794 B2 JP 4362794B2
Authority
JP
Japan
Prior art keywords
image
screen complexity
average
complexity
picture
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 - Lifetime
Application number
JP19014499A
Other languages
Japanese (ja)
Other versions
JP2001025016A (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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP19014499A priority Critical patent/JP4362794B2/en
Publication of JP2001025016A publication Critical patent/JP2001025016A/en
Application granted granted Critical
Publication of JP4362794B2 publication Critical patent/JP4362794B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
動画像の高能率符号化に係り、特に、リアルタイムで可変ビットレート符号化を行う際に好適な符号量制御装置及びその方法に関する。
【0002】
【従来の技術】
TV信号などの動画像を高能率に符号化する技術の国際標準として既にMPEG2が規定されている。
MPEG2は、動画像を構成する「フレーム」画像を「マクロブロック」と呼ばれる16×16画素のブロックに分割し、各マクロブロック単位に、時間的に前または後に所定の数フレーム離れた参照画像と符号化画像の間で「動きベクトル」と呼ばれる動き量を求め、この動き量を基に参照画像から符号化画像を構成する「動き補償予測」技術と、動き補償予測の誤差信号または符号化画像そのものに対して、直交変換の一種であるDCT(離散コサイン変換)を用いて情報量を圧縮する「変換符号化」技術の2つの画像符号化の要素技術をベースに規定されている。
【0003】
従来のMPEG2の動画像符号化装置の一構成例を図5に示す。
また、符号化ピクチャ構造の一例を図4に示す。
動き補償予測では、図5に示した符号化ピクチャ構造のように、 Iピクチャ(フレーム内符号化)、Pピクチャ(順方向予測符号化)、Bピクチャ(双方向予測符号化)と呼ばれる、予測方法の異なる3種類のピクチャの組合せによって構成される。
図5に示されるように、変換符号化では、Iピクチャでは符号化画像そのものに対し、P,Bピクチャでは動き補償器77による動き補償予測の誤差信号である減算器71の出力に対して、DCTがDCT器72で施される。
【0004】
DCT器72で得られたDCT係数に対して量子化が、符号量制御部90の出力により制御して量子化器73によってなされた後に、動きベクトル等のその他の付帯情報と共に可変長符号化が可変長符号化器75でなされ、符号列が「ビットストリーム」としてバッファ76に記憶された後に出力される。
この際、バッファ76の充足度に応じて符号量制御部90で量子化スケールが制御される。
一方、量子化器73の出力係数は、逆量子化器77、IDCT器78に供給さて、局部復号されてブロック毎にフレームメモリ81に貯えられる。
【0005】
MPEG2は可変長符号化であるため、単位時間当りの発生符号量(ビットレート)は一定ではない。
そこで、量子化器73での量子化の際の量子化スケールをマクロブロック単位に適宜変更することにより、所要のビットレートに制御することが可能になっている。
MPEG2 Test Model 5では、GOP単位で発生符号量を一定にする固定ビットレート制御方法が提案されている。
【0006】
このTest Model 5における固定ビットレート制御方法は、一定の転送レートが要求される用途に対しては有効な方法である。
しかし、動画像シーケンスのどの部分に対してもほぼ同じ符号量が割り当てられるため、情報量を多く含む複雑なシーンに対しては十分な符号量が与えられずに画質劣化が生じてしまう。これに対して、情報量が少ない単純なシーンの場合には符号量が余剰になって無駄が生じ、DVD-Videoのように可変転送レートが可能な用途に対しては、適切なレート制御方法とは言えなかった。
【0007】
以上のような問題を解決するレート制御方法が可変ビットレート制御方法である。特開平6−141298号公報には、可変ビットレート制御による符号化装置が開示されている。
この装置では、最初に、入力動画像に対して固定量子化スケールによって仮符号化を行い、単位時間毎に発生符号量がカウントされる。つぎに、入力動画像全体の発生符号量が所要値になるように、仮符号化時の発生符号量に基づいて各部分の目標転送レートを設定する。そしてこの目標転送レートに合致するように制御を行いながら、入力動画像に対して2回目の符号化、言い換えると実符号化が行われる。
【0008】
しかし、上記従来例では、出力ビットストリームを得るためには少なくとも2回の符号化を行わなければならず、リアルタイム性を要求されるような用途ではこの装置のような2パス方式の可変ビットレート制御は使用出来ない。
【0009】
これに対し、動画像をほぼリアルタイムで符号化するための可変ビットレート制御方法、すなわち1パス方式の可変ビットレート制御方法も存在する。特開平10−164577号公報には、1パス方式の可変ビットレート制御方法による符号化装置が前記公報の図6等に開示されている。
【0010】
この装置では、動画像を符号化する際に画面内の発生符号量と画面内の量子化スケールの平均値の積を「画面複雑度」として求め、過去の画面複雑度の平均値に対する現在の画面複雑度の割合を基に、画面の目標発生符号量または目標量子化スケールを決定することにより、可変ビットレート制御を実現している。図6にこの従来発明における動画像符号化装置を示す。
【0011】
【発明が解決しようとする課題】
しかしながら上記従来発明の1パス方式においては、符号化開始して間もない区間においては、過去の画面複雑度の平均値を求める際の過去の画面複雑度の累積が少ないため、この区間で画面複雑度の変化が大きいと不適切な目標符号量の配分または量子化スケールの決定が行われやすい。
【0012】
特に映画等においては動画像シーケンスの最初の部分はタイトルのみの画面や、フェードインで始まる場合が多く、最初の画面複雑度の低い部分で画面複雑度の平均値が決定して、それが画面複雑度の高い本編に切換ったとき、目標符号量の配分に反映される画面複雑度の平均値に対する割合が相対的に高くなり、不必要に高い目標符号量が配分される可能性が高い。
逆に最初の部分でいきなり画面複雑度の高い場面が続き、その後で画面複雑度の低いタイトル部分が続いた場合は、タイトル部分に配分される目標符号量が不十分になる可能性が高い。
【0013】
このように上記従来発明では、動画像シーケンスの最初の部分で不適切な符号量配分が起きるという問題があった。
本発明は、動画像をほぼリアルタイムで符号化するための1パス方式の可変ビットレート制御方法において、動画像シーケンスの最初の部分においても、より適切な符号量割当を実現する方法を提供することを目的とする。
【0014】
【課題を解決するための手段】
そこで本発明は、上記課題を解決するために以下の装置及び方法を提供するものである。
(1)入力動画像を、動き補償予測手段、直交変換手段、量子化手段、及び可変長符号化手段を有して符号化を行う動画像符号化装置において、
前記入力動画像を構成する各画像の符号化時において、前記各画像毎の発生符号量を検出する手段と、
前記入力動画像を構成する各画像の符号化時において、前記各画像毎の平均量子化スケールを検出する手段と、
前記各画像毎の発生符号量と前記各画像毎の平均量子化スケールとの積に対して所定の変換を施すことによって、前記各画像毎の画面複雑度を算出する手段と、
予め設定される第1の所定期間毎に、前記各画像毎の画面複雑度を加算平均して平均画面複雑度を算出する手段と、
符号化開始時点では予め設定された平均画面複雑度の初期値を選択平均画面複雑度として出力し、
その後、前記初期値に対して符号化経過時間と共に重み付けが減少する関数を乗じて第1の平均画面複雑度を得、前記平均画面複雑度に対して符号化経過時間と共に重み付けが増加する関数を乗じて第2の平均画面複雑度を得、これら第1及び第2の平均画面複雑度を加算して得た値を選択平均画面複雑度として出力する手段と、
符号化単位である第2の所定期間毎に予め決定される目標符号量に、これから符号化を行なう符号化対象画像の画面複雑度を前記選択平均画面複雑度で除した値を乗ずることで、前記第2の所定期間毎の割当符号量を決定すると共に、この第2の所定期間毎の割当符号量から、既知の方法により、前記第2の所定期間内の各画像毎の割当符号量を算出し、この各画像毎の割当符号量と各マクロブロックの発生符号量とから、既知の方法により、各マクロブロックの量子化スケールを決定する手段と、
を備えたことを特徴とする動画像符号化装置。
(2)上記(1)に記載された動画像符号化装置において、
前記入力動画像のアクティビティを検出する手段を更に有し、
前記画面複雑度を算出する手段は、
前記発生符号量と前記平均量子化スケールの積に対して所定の変換を施すことによってピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)別に前記画面複雑度を求め、
前記符号化対象画像と同じピクチャタイプの前記符号化対象画像の直前に符号化が行なわれた画像の画面複雑度に対し、前記直前に符号化が行なわれた画像における前記アクティビティと前記符号化対象画像の前記アクティビティとの割合を乗ずることによって前記符号化対象画像の画面複雑度を得ることを特徴とする動画像符号化装置。
(3)上記(1)1または(2)に記載された動画像符号化装置において、
前記平均画面複雑度を算出する手段は、
予め定めた過去の一定期間において、前記画面複雑度をピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)別に加算した上で各々のピクチャタイプの画像数で割ることによって各ピクチャタイプの平均画面複雑度を求め、
前記選択平均画面複雑度を出力する手段は、
予め既知の方法によって求めた各ピクチャタイプにおける平均画面複雑度の初期値を保持してあり、
符号化開始時点では前記初期値を選択平均画面複雑度として出力し、
その後、前記初期値に対して符号化経過時間と共に重み付けが減少する関数を乗じて第1の平均画面複雑度を得、前記平均画面複雑度に対して前記経過時間によって重み付けが増加する関数を乗じて第2の平均画面複雑度を得、これら第1及び第2の平均画面複雑度を加算して得た値を選択平均画面複雑度として出力することを特徴とする動画像符号化装置。
(4)入力動画像を、動き補償予測ステップ、直交変換ステップ、量子化ステップ、及び可変長符号化ステップを有して符号化を行う動画像符号化方法において、
前記入力動画像を構成する各画像の符号化時において、前記各画像毎の発生符号量を検出するステップと、
前記入力動画像を構成する各画像の符号化時において、前記各画像毎の平均量子化スケールを検出するステップと、
前記各画像毎の発生符号量と前記各画像毎の平均量子化スケールとの積に対して所定の変換を施すことによって、前記各画像毎の画面複雑度を算出するステップと、
予め設定される第1の所定期間毎に、前記各画像毎の画面複雑度を加算平均して平均画面複雑度を算出するステップと、
符号化開始時点では予め設定された平均画面複雑度の初期値を選択平均画面複雑度として出力し、
その後、前記初期値に対して符号化経過時間と共に重み付けが減少する関数を乗じて第1の平均画面複雑度を得、前記平均画面複雑度に対して符号化経過時間と共に重み付けが増加する関数を乗じて第2の平均画面複雑度を得、これら第1及び第2の平均画面複雑度を加算して得た値を選択平均画面複雑度として出力するステップと、
符号化単位である第2の所定期間毎に予め決定される目標符号量に、これから符号化を行なう符号化対象画像の画面複雑度を前記選択平均画面複雑度で除した値を乗ずることで、前記第2の所定期間毎の割当符号量を決定すると共に、この第2の所定期間毎の割当符号量から、既知の方法により、前記第2の所定期間内の各画像毎の割当符号量を算出し、この各画像毎の割当符号量と各マクロブロックの発生符号量とから、既知の方法により、各マクロブロックの量子化スケールを決定するステップと、
を備えたことを特徴とする動画像符号化方法。
(5)上記(4)に記載された動画像符号化方法において、
前記入力動画像のアクティビティを検出するステップを更に有し、
前記画面複雑度を算出するステップは、
前記発生符号量と前記平均量子化スケールの積に対して所定の変換を施すことによってピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)別に前記画面複雑度を求め、
前記符号化対象画像と同じピクチャタイプの前記符号化対象画像の直前に符号化が行なわれた画像の画面複雑度に対し、前記直前に符号化が行なわれた画像における前記アクティビティと前記符号化対象画像の前記アクティビティとの割合を乗ずることによって前記符号化対象画像の画面複雑度を得ることを特徴とする動画像符号化方法。
(6)上記(4)または(5)に記載された動画像符号化方法において、
前記平均画面複雑度を算出するステップは、
予め定めた過去の一定期間において、前記画面複雑度をピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)別に加算した上で各々のピクチャタイプの画像数で割ることによって各ピクチャタイプの平均画面複雑度を求め、
前記選択平均画面複雑度を出力するステップは、
予め既知の方法によって求めた各ピクチャタイプにおける平均画面複雑度の初期値を保持してあり、
符号化開始時点では前記初期値を選択平均画面複雑度として出力し、
その後、前記初期値に対して符号化経過時間と共に重み付けが減少する関数を乗じて第1の平均画面複雑度を得、前記平均画面複雑度に対して前記経過時間によって重み付けが増加する関数を乗じて第2の平均画面複雑度を得、これら第1及び第2の平均画面複雑度を加算して得た値を選択平均画面複雑度として出力することを特徴とする動画像符号化方法。
【0017】
【発明の実施の形態】
本発明の動画像符号化装置及びその方法の第1の実施例について、以下に図1と共に説明する。
図1に示したように、本発明の動画像符号化装置の第1の実施例は、減算器11、DCT器12、量子化器13、符号量制御器14、可変長符号化器15、バッファ16、逆量子化器17、IDCT器18、動き補償予測器19、加算器20、フレームメモリ21、平均量子化スケール検出器22、発生符号量検出器23、画面複雑度算出器24、画像特性検出器25、複雑度初期値設定器41、経過時間カウンタ42、及び平均画面複雑度選択器43より構成されている。
【0018】
原画像は図示されていない画像ブロック分割器(図示せず。)によって、予めマクロブロック単位に分割されているものとする。
分割された原画像は、Iピクチャについては動き補償予測が行われず、原画像ブロックそのものがDCT器12に送られ、DCTされた後に量子化器13で符号量制御器14から送られる量子化スケールによって量子化される。
量子化器13の出力は、可変長符号化器15で符号に変換されて、バッファ16で調整された後に符号が出力される。
【0019】
一方、量子化器13の出力係数は逆量子化器17、IDCT器18で局部復号されて、ブロック毎にフレームメモリ21に貯えられる。
P及びBピクチャについては、分割された原画像とフレームメモリ21に貯えられた所定の局部復号画像ブロックが動き補償予測器19に供給され、ここで動きベクトル検出及び動き補償が行われて、この補償予測器19の出力の予測画像ブロックが減算器11で原画像ブロックとの間で画素間差分が取られ、差分値である誤差画像ブロックがDCT器12に送られる。
この後はIピクチャと同様にDCTされ、量子化器13で符号量制御器14から送られる量子化スケールによって量子化された後に、可変長符号化器15で符号に変換されて、バッファ16で調整された後に符号が出力される。
【0020】
一方、量子化器13の出力係数は逆量子化器17、IDCT器18で局部復号された後に前記補償予測器19の出力の予測画像ブロックが加算器20によって画素毎に加算され、ブロック毎にフレームメモリ21に貯えられる。
各ピクチャについて、マクロブロック毎の量子化スケールが平均量子化スケール検出器22に送られ、そこで1フレーム分の量子化スケールが加算され、1フレームの平均量子化スケールが算出される。
【0021】
一方、バッファ16において発生符号量が監視され、値が発生符号量検出器23に送られる。ここにおいて、発生符号量がフレーム単位に加算され、1フレームの発生符号量が検出される。
フレーム毎について検出された平均量子化スケール、発生符号量は画面複雑度算出器24に送られる。
【0022】
一方、図2に示すように、画像特性検出器25は、ACTcur検出器25J、ACTpred検出器25K、ACTmv検出器25L、及びフレーム単位画像特性パラメータ算出器25Mにより構成されている。
【0023】
画像特性検出器25では図2に示すように、分割された原画像が入力され、原画像の各フレームについてマクロブロック単位に画像特性を示すパラメータ、すなわち原画像アクティビティ ACTcur が検出され、フレーム単位に加算されて、その結果が画面複雑度算出器24に送られる。
画像特性を示すパラメータとしては輝度値の分散、画素間差分値などが考えられるが、画像特性を示すものであればその他のパラメータでもよい。
【0024】
なお、P及びBピクチャについては前記分割された原画像ばかりでなく、動き補償予測器19におけるマクロブロック単位の動き補償予測誤差画像または動きベクトル検出における符号化画像と参照画像との差分画像に対してもアクティビティ(この場合は画素間差分値またはその2乗誤差) ACTpred をACTpred検出器25Kで求め、これとACTmv検出器25Lで求まる動き補償予測の動きベクトルの隣接ブロックとの差分値ACTmv、及びACTcur検出器25Jで求まる前記原画像アクティビティACTcurを係数とする所定の関数によって、フレーム単位の画像特性パラメータをフレーム単位画像特性パラメータ算出器25Mで求め、これを前記原画像アクティビティに代えて画面複雑度算出器24に送ってもよい。
【0025】
画面複雑度算出器24では、供給された各フレームの平均量子化スケールと発生符号量が乗算された後に乗算結果に所定の変換が施されて、各フレームの画面複雑度として求められる。
画面複雑度は符号化ピクチャタイプ別に一定期間内の値が加算された後にその期間内の同じピクチャタイプのフレーム数で除算されて、各ピクチャタイプの平均画面複雑度 Xi-ave, Xp-ave, Xb-ave が算出される。
【0026】
ここで言う一定期間内は、符号化の終了したばかりの画像から時間的に前に予め定めるフレーム数、例えば15フレームとか、300フレームといった一定のフレーム数の場合もあり、符号化開始フレームから符号化の終了したばかりの画像までのように、順次フレーム数が増加する場合もある。
【0027】
なお、前者の一定フレーム数の場合でも、符号化したフレーム数が定めた一定期間を満たさない場合は後者と同様に順次フレーム数が増加していくことになる。
各ピクチャタイプの平均画面複雑度 Xi-ave, Xp-ave, Xb-aveは平均画面複雑度選択器43に送られる。
【0028】
一方、これから符号化する現在の画像の画面複雑度は、得られた過去の画像の画面複雑度と、画像特性検出器25より送られてくる現在の画像のアクティビティより推定して求める。
すなわち、同じピクチャタイプの直前の画像の画面複雑度に、その画像におけるアクティビティに対する現在の画像のアクティビティの割合を乗算することによって得られた値を推定画面複雑度とする。
【0029】
なお、アクティビティによる画面複雑度の推定を行わず、同じピクチャタイプの直前の画像の画面複雑度の値をそのまま現在の画像の画面複雑度としてもよい。現在の画像の画面複雑度は符号量制御器14に送られる。
平均画面複雑度選択器43には、画面複雑度算出器24で算出された平均画面複雑度と、予め一般的な画像で統計的に求めた各ピクチャタイプの平均画面複雑度の初期値が複雑度初期値設定器41から送られる。
【0030】
さらに、符号化の開始と共に計測される符号化経過時間ET(Encode Time)が経過時間カウンタ42より送られる。
各ピクチャタイプについて、最初に符号化する画像では算出平均画面複雑度が存在しないので、複雑度初期値設定器41から送られる平均画面複雑度の初期値を選択平均画面複雑度として符号量制御器14に送る。
【0031】
符号化経過時間の増大と共に算出平均画面複雑度が算出されてくるが、符号化が開始されてしばらくは平均画面複雑度の算出に使用される画像数が少ないため、画面複雑度の一寸した変化によって平均画面複雑度が大きく変化し、結果としてこれから符号化する画像に割当てる符号量が大きく変動し、適切な符号量制御が行いにくくなる。
【0032】
また、各ピクチャタイプについて、最初に符号化する画像は予め設定された初期値で、2番目以降の画像は算出値に切換えた場合、平均画面複雑度の差が大きいと切換点で違和感が生じる。
そこで平均画面複雑度の初期値に対しては経過時間によって重み付けが減少する関数、算出値に対しては経過時間によって重み付けが増加する関数を設定し、各々の平均画面複雑度に各々の関数を乗じて、関数を乗じた2つの平均画面複雑度を加算した後に重み付けの正規化を行い、得られた値を選択平均画面複雑度として符号量制御器14に送る。
【0033】
具体的には、次式(1)のように設定して、選択平均画面複雑度を得る。
なお、ETは符号化経過時間、
PTは算出平均画面複雑度のみとなる経過時間、
Xk-aveは選択平均画面複雑度、
Xsk-aveは平均画面複雑度初期値、
Xok-aveは算出平均画面複雑度
である。
また、Xk-ave、Xsk-ave、Xok-aveのkはピクチャ別 (i, p, b)を示すものとする。
【0034】

Figure 0004362794
【0035】
図3に、上記の関数を設定した場合の算出平均画面複雑度Xop-aveと選択平均画面複雑度Xp-aveの変化の一実施例を示す。
ここで、細い実曲線は算出平均画面複雑度Xop-aveを、太い実曲線は選択平均画面複雑度Xp-aveを夫々指し示している。
これにより、符号化開始して間もない区間においても、より適切な符号量割当を行うことが出来る。
【0036】
符号量制御器14では、画面複雑度算出器24から送られてきた現在の画像の画面複雑度と、平均画面複雑度選択器43から送られてきた選択平均画面複雑度から、可変ビットレート制御のための量子化スケールの設定が行われる。
【0037】
目標平均ビットレートをBitRate、1秒当りのフレーム数をPictureRate、1つの符号化単位である1GOP(通常はIピクチャの間隔)のフレーム数をNとすると、1GOPの平均割当符号量(目標符号量)Raveは次式(2)で与えられる。
【0038】
Figure 0004362794
【0039】
上式のRaveは平均画面複雑度の時の1GOPの必要割当符号量とすると、これから符号化する現在の画像を含む1GOPの画像が一様に前記画面複雑度算出器24で求めた現在の画像の画面複雑度Xk (k=i, p, b)に等しいと仮定すると、画質を一定に保持する場合に必要な1GOPの必要割当符号量Rck (k=i, p, b)は次式(3) で与えられる。
【0040】
Figure 0004362794
【0041】
なお、この例ではピクチャ別に求めた平均画面複雑度Xk-aveを使用しているが、Xk-aveの代りに、ピクチャタイプで区別しない平均画面複雑度X-aveを使用してもよい。
これら上式のRcを1GOPの各ピクチャにMPEG2 Test Model 5の方法、もしくは別の方法によって適切に割り振ることにより、これから符号化する現在の画像の目標割当符号量を算出する。
【0042】
この目標割当符号量と、バッファ16で検出される各マクロブロックの発生符号量をもとに、MPEG2 Test Model 5の方法、もしくは別の方法によって各マクロブロックの量子化スケールを決定する。
【0043】
なお、画像特性検出器25からは符号量制御器14へも各マクロブロックの原画像アクティビティが送られ、MPEG2 Test Model 5の方法、もしくは別の方法における、アクティビティに基づいて各マクロブロックの量子化スケールを変更する適応量子化制御に使用されるが、この適応量子化制御は行わなくてもよい。
【0044】
符号量制御器14から出力される各マクロブロックの量子化スケールが量子化器13に送られ、現在の画像(DCT後の分割された原画像または動き補償予測の誤差画像ブロック)がこの量子化スケールで量子化される。
量子化器13の出力は、可変長符号化器15で可変長符号化されて、バッファ16で調整された後に符号が出力される。
【0045】
マクロブロック毎の量子化スケール、バッファ16で監視される発生符号量がそれぞれ、平均量子化スケール検出器22、発生符号量検出器23に送られ、次のピクチャの符号量制御に使用される。
【0046】
【発明の効果】
以上のように本発明は、各ピクチャタイプの平均画面複雑度を算出する際、符号化開始して間もない区間においては、予め統計的に求めた平均画面複雑度の初期値と前記算出平均画面複雑度から、選択平均画面複雑度を求め、前記選択平均画面複雑度に対する符号化画像特性によって推定した現在の画像の画面複雑度の割合を、目標ビットレートによる符号量に乗ずることにより割当符号量を得ているので、符号化開始して間もない区間においても、より適切な符号量割当を行うことが出来る。
【図面の簡単な説明】
【図1】本発明の動画像符号化装置及びその方法の第1の実施例を示したブロック構成図である。
【図2】本発明の動画像符号化装置及びその方法の第1の実施例における画像特性検出器のブロック構成図を示したものである。
【図3】本発明の動画像符号化装置及びその方法の第1の実施例における選択平均画面複雑度の変化の実施例を示したものである。
【図4】符号化ピクチャ構造の一例を示した図である。
【図5】一般的な動画像符号化装置の一構成例を示した図である。
【図6】従来における動画像符号化装置の一構成例を示した図である。
【符号の説明】
11 減算器
12 DCT器
13 量子化器
14 符号量制御器
15 可変長符号化器
16 バッファ
17 逆量子化器
18 IDCT器
19 動き補償予測器
20 加算器
21 フレームメモリ
22 平均量子化スケール検出器
23 発生符号量検出器
24 画面複雑度算出器
25 画像特性検出器
25J ACTcur検出器
25K ACTpred検出器
25L ACTmv検出器
25M ピクチヤアクティビティ算出器
41 複雑度初期値設定器
42 経過時間カウンタ
43 平均画面複雑度選択器
ET 符号化経過時間
PT 算出平均画面複雑度のみとなる経過時間、
Xk-ave 選択平均画面複雑度
Xok-ave 算出平均画面複雑度
Xp-ave 選択平均画面複雑度(Pピクチャの場合)
Xsk-ave 平均画面複雑度初期値
Xi,Xp,Xb 現在の画像の画面複雑度
Xi-ave,Xp-ave,Xb-ave 平均画面複雑度[0001]
BACKGROUND OF THE INVENTION
The present invention relates to high-efficiency encoding of moving images, and more particularly to a code amount control apparatus and method suitable for performing variable bit rate encoding in real time.
[0002]
[Prior art]
MPEG2 has already been defined as an international standard for technology for efficiently encoding moving images such as TV signals.
MPEG2 divides a "frame" image that constitutes a moving image into blocks of 16x16 pixels called "macroblocks", and a reference image separated by a predetermined number of frames before or after in time for each macroblock unit. “Motion compensated prediction” technology that obtains a motion amount called “motion vector” between encoded images and constructs an encoded image from a reference image based on this motion amount, and an error signal or encoded image of motion compensated prediction In contrast, it is defined based on two image encoding elemental technologies of “transform encoding” that compresses the amount of information using DCT (Discrete Cosine Transform), which is a kind of orthogonal transform.
[0003]
An example of the configuration of a conventional MPEG2 moving image encoding apparatus is shown in FIG.
An example of the encoded picture structure is shown in FIG.
In motion-compensated prediction, as in the coded picture structure shown in FIG. 5, predictions called I picture (intraframe coding), P picture (forward prediction coding), and B picture (bidirectional prediction coding) It consists of a combination of three types of pictures with different methods.
As shown in FIG. 5, in transform coding, with respect to the output of the subtracter 71, which is an error signal of motion compensation prediction by the motion compensator 77, with respect to the encoded image itself in the I picture and with the motion compensator 77 in the P and B pictures, DCT is performed by the DCT unit 72.
[0004]
After the quantization is performed on the DCT coefficient obtained by the DCT unit 72 by the quantizer 73 under the control of the output of the code amount control unit 90, variable length coding is performed together with other incidental information such as a motion vector. The variable length encoder 75 is used, and the code string is stored in the buffer 76 as a “bit stream” and then output.
At this time, the quantization scale is controlled by the code amount control unit 90 in accordance with the sufficiency of the buffer 76.
On the other hand, the output coefficient of the quantizer 73 is supplied to the inverse quantizer 77 and the IDCT device 78, and is locally decoded and stored in the frame memory 81 for each block.
[0005]
Since MPEG2 is variable length coding, the generated code amount (bit rate) per unit time is not constant.
Therefore, the required bit rate can be controlled by appropriately changing the quantization scale at the time of quantization in the quantizer 73 in units of macroblocks.
MPEG2 Test Model 5 proposes a fixed bit rate control method that makes the generated code amount constant in GOP units.
[0006]
The constant bit rate control method in Test Model 5 is an effective method for applications requiring a constant transfer rate.
However, since almost the same code amount is assigned to any part of the moving image sequence, a sufficient amount of code is not given to a complicated scene including a large amount of information, resulting in image quality degradation. On the other hand, in the case of a simple scene with a small amount of information, the code amount becomes excessive, resulting in waste, and an appropriate rate control method for applications capable of variable transfer rates such as DVD-Video. I couldn't say that.
[0007]
A rate control method that solves the above problems is a variable bit rate control method. Japanese Patent Laid-Open No. 6-141298 discloses an encoding apparatus based on variable bit rate control.
In this apparatus, first, provisional encoding is performed on an input moving image using a fixed quantization scale, and a generated code amount is counted every unit time. Next, the target transfer rate of each part is set based on the generated code amount at the time of temporary encoding so that the generated code amount of the entire input moving image becomes a required value. Then, the second encoding, that is, the actual encoding is performed on the input moving image while performing control so as to match the target transfer rate.
[0008]
However, in the above conventional example, in order to obtain an output bit stream, encoding must be performed at least twice, and in applications where real-time performance is required, the variable bit rate of the two-pass method such as this device is used. Control cannot be used.
[0009]
On the other hand, there is a variable bit rate control method for encoding a moving image in almost real time, that is, a one-pass variable bit rate control method. Japanese Patent Application Laid-Open No. 10-164577 discloses an encoding apparatus using a one-pass variable bit rate control method in FIG.
[0010]
In this apparatus, when a moving image is encoded, the product of the generated code amount in the screen and the average value of the quantization scale in the screen is obtained as “screen complexity”, and the current average value of the past screen complexity is calculated. Variable bit rate control is realized by determining the target generated code amount or target quantization scale based on the ratio of the screen complexity. FIG. 6 shows a moving picture coding apparatus according to the conventional invention.
[0011]
[Problems to be solved by the invention]
However, in the one-pass method of the above-described conventional invention, since the past screen complexity is less accumulated when obtaining an average value of past screen complexity in a section shortly after the start of encoding, the screen is displayed in this section. If the change in complexity is large, inappropriate allocation of the target code amount or determination of the quantization scale is likely to be performed.
[0012]
Especially in movies, the first part of a video sequence often starts with a title-only screen or fade-in, and the average value of the screen complexity is determined at the first low-complexity part. When switching to the main part with high complexity, the ratio of the screen complexity to the average value reflected in the distribution of the target code amount is relatively high, and there is a high possibility that an unnecessarily high target code amount is allocated. .
Conversely, when a scene with a high screen complexity continues suddenly in the first part, and then a title part with a low screen complexity continues, there is a high possibility that the target code amount allocated to the title part will be insufficient.
[0013]
As described above, the conventional invention has a problem that inappropriate code amount distribution occurs in the first part of the moving image sequence.
The present invention provides a one-pass variable bit rate control method for encoding a moving image in almost real time, and a method for realizing more appropriate code amount allocation even in the first part of a moving image sequence. With the goal.
[0014]
[Means for Solving the Problems]
Accordingly, the present invention provides the following apparatus and method in order to solve the above problems.
(1) In a moving image encoding apparatus that encodes an input moving image by including motion compensation prediction means, orthogonal transform means, quantization means, and variable length encoding means,
Means for detecting a generated code amount for each image at the time of encoding each image constituting the input moving image;
Means for detecting an average quantization scale for each image at the time of encoding each image constituting the input moving image;
Means for calculating a screen complexity for each image by performing a predetermined transformation on the product of the generated code amount for each image and the average quantization scale for each image;
Means for calculating an average screen complexity by averaging the screen complexity of each image for each preset first predetermined period;
At the time of encoding start, the initial value of the preset average screen complexity is output as the selected average screen complexity,
Thereafter, a first average screen complexity is obtained by multiplying the initial value by a function whose weight decreases with the encoding elapsed time, and a function whose weight increases with the encoding elapsed time is obtained for the average screen complexity. Means for multiplying to obtain a second average screen complexity, and outputting a value obtained by adding the first and second average screen complexity as a selected average screen complexity;
A target code amount that is previously determined for each second predetermined time period is a coding unit, a cheat can multiply a value obtained by dividing the screen complexity of the encoding target image to be encoded from now at the selected average screen complexity The allocated code amount for each second predetermined period is determined, and the allocated code amount for each image in the second predetermined period is determined from the allocated code amount for each second predetermined period by a known method. Means for determining the quantization scale of each macroblock by a known method from the allocated code amount for each image and the generated code amount of each macroblock ;
A moving picture encoding apparatus comprising:
(2) In the video encoding device described in (1) above,
Means for detecting an activity of the input moving image;
The means for calculating the screen complexity is:
Picture type by the performing predetermined conversion on the generated code amount and the product of the average quantization scale (I picture, P picture, B picture) asked additional the screen complexity,
With respect to the screen complexity of an image encoded immediately before the encoding target image of the same picture type as the encoding target image, the activity in the image encoded immediately before and the encoding target A moving picture coding apparatus characterized in that a screen complexity of the picture to be coded is obtained by multiplying a ratio of the picture with the activity.
(3) In the moving image encoding device described in (1) 1 or (2) above,
The means for calculating the average screen complexity is:
In a predetermined fixed period in the past, before Kiga surface complexity of the picture type (I picture, P picture, B picture) average for each picture type by dividing the number of images of each picture type screen on which is obtained by adding separately Seeking complexity,
The means for outputting the selected average screen complexity is:
It holds the initial value of average screen complexity for each picture type obtained by a known method in advance,
At the start of encoding, the initial value is output as the selected average screen complexity,
Then, to obtain a first average picture complexity by multiplying a function weighting decreases with coding elapsed time relative to the initial value, the function of the weighting is increased by the elapsed time for the previous Kitaira equalizing screen complexity To obtain a second average screen complexity, and output a value obtained by adding the first and second average screen complexity as a selected average screen complexity. .
(4) In a moving picture coding method for coding an input moving picture, including a motion compensation prediction step, an orthogonal transformation step, a quantization step, and a variable length coding step,
Detecting a generated code amount for each image at the time of encoding each image constituting the input moving image;
A step of detecting an average quantization scale for each image at the time of encoding each image constituting the input moving image;
Calculating a screen complexity for each image by performing a predetermined transformation on the product of the generated code amount for each image and the average quantization scale for each image;
Calculating an average screen complexity by averaging the screen complexity for each image for each preset first predetermined period;
At the time of encoding start, the initial value of the preset average screen complexity is output as the selected average screen complexity,
Thereafter, a first average screen complexity is obtained by multiplying the initial value by a function whose weight decreases with the encoding elapsed time, and a function whose weight increases with the encoding elapsed time is obtained for the average screen complexity. Multiplying to obtain a second average screen complexity, and adding a value obtained by adding the first and second average screen complexity as a selected average screen complexity;
A target code amount that is previously determined for each second predetermined time period is a coding unit, a cheat can multiply a value obtained by dividing the screen complexity of the encoding target image to be encoded from now at the selected average screen complexity The allocated code amount for each second predetermined period is determined, and the allocated code amount for each image in the second predetermined period is determined from the allocated code amount for each second predetermined period by a known method. Calculating a quantization scale of each macroblock by a known method from the allocated code amount for each image and the generated code amount of each macroblock ;
A moving picture encoding method comprising:
(5) In the video encoding method described in (4) above,
Further comprising detecting an activity of the input moving image;
The step of calculating the screen complexity includes:
Picture type by the performing predetermined conversion on the generated code amount and the product of the average quantization scale (I picture, P picture, B picture) asked additional the screen complexity,
With respect to the screen complexity of an image encoded immediately before the encoding target image of the same picture type as the encoding target image, the activity in the image encoded immediately before and the encoding target A moving picture coding method characterized by obtaining a screen complexity of the picture to be coded by multiplying a ratio of the picture with the activity.
(6) In the video encoding method described in (4) or (5) above,
Calculating the average screen complexity,
In a predetermined fixed period in the past, before Kiga surface complexity of the picture type (I picture, P picture, B picture) average for each picture type by dividing the number of images of each picture type screen on which is obtained by adding separately Seeking complexity,
Outputting the selected average screen complexity;
It holds the initial value of average screen complexity for each picture type obtained by a known method in advance,
At the start of encoding, the initial value is output as the selected average screen complexity,
Then, to obtain a first average picture complexity by multiplying a function weighting decreases with coding elapsed time relative to the initial value, the function of the weighting is increased by the elapsed time for the previous Kitaira equalizing screen complexity To obtain a second average screen complexity, and to output a value obtained by adding the first and second average screen complexity as a selected average screen complexity .
[0017]
DETAILED DESCRIPTION OF THE INVENTION
A first embodiment of the moving picture coding apparatus and method according to the present invention will be described below with reference to FIG.
As shown in FIG. 1, the first embodiment of the moving picture encoding apparatus of the present invention includes a subtractor 11, a DCT unit 12, a quantizer 13, a code amount controller 14, a variable length encoder 15, Buffer 16, inverse quantizer 17, IDCT device 18, motion compensation predictor 19, adder 20, frame memory 21, average quantization scale detector 22, generated code amount detector 23, screen complexity calculator 24, image It comprises a characteristic detector 25, a complexity initial value setter 41, an elapsed time counter 42, and an average screen complexity selector 43.
[0018]
It is assumed that the original image is divided into macroblock units in advance by an image block divider (not shown) (not shown).
The divided original image is not subjected to motion compensation prediction for the I picture, the original image block itself is sent to the DCT unit 12, and is quantized by the quantizer 13 and sent from the code amount controller 14 after DCT. Quantized by
The output of the quantizer 13 is converted into a code by the variable length encoder 15, adjusted by the buffer 16, and then the code is output.
[0019]
On the other hand, the output coefficient of the quantizer 13 is locally decoded by the inverse quantizer 17 and the IDCT unit 18 and stored in the frame memory 21 for each block.
For P and B pictures, the divided original image and a predetermined locally decoded image block stored in the frame memory 21 are supplied to the motion compensation predictor 19, where motion vector detection and motion compensation are performed. An inter-pixel difference is taken between the predicted image block output from the compensation predictor 19 and the original image block by the subtractor 11, and an error image block as a difference value is sent to the DCT unit 12.
Thereafter, it is DCT like the I picture, quantized by the quantizer 13 by the quantization scale sent from the code amount controller 14, converted to a code by the variable length encoder 15, and then buffered by the buffer 16. The code is output after adjustment.
[0020]
On the other hand, the output coefficient of the quantizer 13 is locally decoded by the inverse quantizer 17 and the IDCT unit 18, and then the predicted image block of the output of the compensation predictor 19 is added for each pixel by the adder 20. Stored in the frame memory 21.
For each picture, the quantization scale for each macroblock is sent to the average quantization scale detector 22, where the quantization scale for one frame is added, and the average quantization scale for one frame is calculated.
[0021]
On the other hand, the generated code amount is monitored in the buffer 16, and the value is sent to the generated code amount detector 23. Here, the generated code amount is added in units of frames, and the generated code amount of one frame is detected.
The average quantization scale and generated code amount detected for each frame are sent to the screen complexity calculator 24.
[0022]
On the other hand, as shown in FIG. 2, the image characteristic detector 25 includes an ACTcur detector 25J, an ACTpred detector 25K, an ACTmv detector 25L, and a frame unit image characteristic parameter calculator 25M.
[0023]
As shown in FIG. 2, the image characteristic detector 25 receives the divided original image, detects a parameter indicating the image characteristic for each frame of the original image, that is, the original image activity ACTcur, and detects for each frame. The result is added and the result is sent to the screen complexity calculator 24.
As the parameter indicating the image characteristics, dispersion of luminance values, inter-pixel difference values, and the like are conceivable, but other parameters may be used as long as they indicate the image characteristics.
[0024]
For P and B pictures, not only the divided original image but also a motion compensated prediction error image for each macroblock in the motion compensated predictor 19 or a difference image between a coded image and a reference image in motion vector detection. However, the activity (in this case, the inter-pixel difference value or its square error) ACTpred is obtained by the ACTpred detector 25K, and the difference value ACTmv between this and the adjacent block of the motion vector of the motion compensation prediction obtained by the ACTmv detector 25L, and A frame unit image characteristic parameter is obtained by a frame unit image characteristic parameter calculator 25M by a predetermined function using the original image activity ACTcur obtained by the ACTcur detector 25J as a coefficient. You may send to the calculator 24.
[0025]
The screen complexity calculator 24 multiplies the supplied average quantization scale and the generated code amount, and then performs a predetermined transformation on the multiplication result to obtain the screen complexity of each frame.
The screen complexity is added for each encoded picture type within a certain period, then divided by the number of frames of the same picture type within that period, and the average screen complexity for each picture type Xi-ave, Xp-ave, Xb-ave is calculated.
[0026]
Within a certain period of time here, there may be a fixed number of frames, such as 15 frames or 300 frames, which is predetermined in time from the image that has just been encoded. There may be a case where the number of frames sequentially increases as in the case of the image just completed.
[0027]
Even in the case of the former fixed number of frames, if the number of encoded frames does not satisfy the predetermined period, the number of frames will increase sequentially as in the latter case.
The average screen complexity Xi-ave, Xp-ave, and Xb-ave for each picture type is sent to the average screen complexity selector 43.
[0028]
On the other hand, the screen complexity of the current image to be encoded is estimated and obtained from the screen complexity of the past image obtained and the activity of the current image sent from the image characteristic detector 25.
That is, the estimated screen complexity is a value obtained by multiplying the screen complexity of the previous image of the same picture type by the ratio of the activity of the current image to the activity in the image.
[0029]
Note that the screen complexity of the immediately preceding image of the same picture type may be used as it is as the screen complexity of the current image without estimating the screen complexity by the activity. The screen complexity of the current image is sent to the code amount controller 14.
In the average screen complexity selector 43, the average screen complexity calculated by the screen complexity calculator 24 and the initial value of the average screen complexity of each picture type statistically obtained from a general image in advance are complex. Sent from the initial value setter 41.
[0030]
Further, an elapsed time ET (Encode Time) measured with the start of encoding is sent from the elapsed time counter 42.
For each picture type, since the calculated average screen complexity does not exist in the image to be encoded first, the code amount controller uses the initial value of the average screen complexity sent from the complexity initial value setting unit 41 as the selected average screen complexity. 14
[0031]
The calculated average screen complexity is calculated as the encoding elapsed time increases, but since the number of images used to calculate the average screen complexity is small for a while after encoding starts, the screen complexity changes slightly. As a result, the average screen complexity greatly changes, and as a result, the amount of code to be assigned to an image to be encoded fluctuates greatly, making it difficult to perform appropriate code amount control.
[0032]
In addition, for each picture type, when an image to be encoded first is set to a preset initial value and the second and subsequent images are switched to a calculated value, if the difference in average screen complexity is large, a sense of incongruity occurs at the switching point. .
Therefore, for the initial value of the average screen complexity, a function for decreasing the weight by the elapsed time is set for the calculated value, and for the calculated value, a function for increasing the weight by the elapsed time is set, and each function is set for each average screen complexity. Multiplying and adding the two average screen complexity multiplied by the function, weighting normalization is performed, and the obtained value is sent to the code amount controller 14 as the selected average screen complexity.
[0033]
Specifically, the selection average screen complexity is obtained by setting as the following equation (1).
ET is encoding elapsed time,
PT is the elapsed time which is only the calculated average screen complexity,
Xk-ave is a selection average screen complexity,
Xsk-ave is the default average screen complexity,
Xok-ave is the calculated average screen complexity.
In addition, k in Xk-ave, Xsk-ave, and Xok-ave indicate (i, p, b) for each picture.
[0034]
Figure 0004362794
[0035]
FIG. 3 shows an example of changes in the calculated average screen complexity Xop-ave and the selected average screen complexity Xp-ave when the above function is set.
Here, the thin real curve indicates the calculated average screen complexity Xop-ave, and the thick real curve indicates the selected average screen complexity Xp-ave.
Thereby, more appropriate code amount allocation can be performed even in a section shortly after the start of encoding.
[0036]
In the code amount controller 14, variable bit rate control is performed from the screen complexity of the current image sent from the screen complexity calculator 24 and the selected average screen complexity sent from the average screen complexity selector 43. The quantization scale for is set.
[0037]
If the target average bit rate is BitRate, the number of frames per second is PictureRate, and the number of frames in 1 GOP (usually the interval between I pictures), which is one coding unit, is N, the average allocated code amount (target code amount) ) Rave is given by the following equation (2).
[0038]
Figure 0004362794
[0039]
If the Rave in the above equation is the required allocation code amount of 1 GOP at the average screen complexity, the current image obtained by the screen complexity calculator 24 is uniformly obtained from the 1 GOP image including the current image to be encoded. Assuming that the screen complexity is equal to Xk (k = i, p, b), the required allocated code amount Rck (k = i, p, b) required for maintaining a constant image quality is Given in 3).
[0040]
Figure 0004362794
[0041]
In this example, the average screen complexity Xk-ave obtained for each picture is used, but instead of Xk-ave, an average screen complexity X-ave that is not distinguished by picture type may be used.
By appropriately assigning Rc in the above equation to each picture of 1 GOP by the method of MPEG2 Test Model 5 or another method, the target assigned code amount of the current image to be encoded is calculated.
[0042]
Based on the target allocated code amount and the generated code amount of each macroblock detected by the buffer 16, the quantization scale of each macroblock is determined by the MPEG2 Test Model 5 method or another method.
[0043]
It should be noted that the original image activity of each macroblock is also sent from the image characteristic detector 25 to the code amount controller 14, and the quantization of each macroblock is performed based on the activity in the MPEG2 Test Model 5 method or another method. Although used for adaptive quantization control for changing the scale, this adaptive quantization control may not be performed.
[0044]
The quantization scale of each macroblock output from the code amount controller 14 is sent to the quantizer 13, and the current image (the divided original image after DCT or the error-compensated image of motion compensation prediction) is quantized. Quantized by scale.
The output of the quantizer 13 is variable-length encoded by the variable-length encoder 15 and adjusted by the buffer 16 before being output.
[0045]
The quantization scale for each macroblock and the generated code amount monitored by the buffer 16 are sent to the average quantization scale detector 22 and the generated code amount detector 23, respectively, and used for controlling the code amount of the next picture.
[0046]
【The invention's effect】
As described above, according to the present invention, when calculating the average screen complexity of each picture type, the initial value of the average screen complexity statistically obtained in advance and the calculated average are calculated in a section immediately after the start of encoding. From the screen complexity, the selected average screen complexity is obtained, and the ratio of the screen complexity of the current image estimated by the encoded image characteristics with respect to the selected average screen complexity is multiplied by the code amount by the target bit rate to assign the code Since the amount is obtained, more appropriate code amount allocation can be performed even in a section shortly after the start of encoding.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a first embodiment of a moving picture coding apparatus and method according to the present invention.
FIG. 2 is a block diagram of an image characteristic detector in the first embodiment of the moving picture coding apparatus and method according to the present invention.
FIG. 3 shows an example of change in selected average screen complexity in the first embodiment of the moving picture coding apparatus and method according to the present invention.
FIG. 4 is a diagram illustrating an example of a coded picture structure.
FIG. 5 is a diagram illustrating a configuration example of a general moving image encoding device.
FIG. 6 is a diagram illustrating a configuration example of a conventional moving image encoding apparatus.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 11 Subtractor 12 DCT device 13 Quantizer 14 Code amount controller 15 Variable length encoder 16 Buffer 17 Inverse quantizer 18 IDCT device 19 Motion compensation predictor 20 Adder 21 Frame memory 22 Average quantization scale detector 23 Generated code amount detector 24 Screen complexity calculator 25 Image characteristic detector 25J ACTcur detector 25K ACTpred detector 25L ACTmv detector 25M Picture activity calculator 41 Complexity initial value setter 42 Elapsed time counter 43 Average screen complexity Selector
ET encoding elapsed time
PT calculated elapsed time, only the average screen complexity,
Xk-ave selection average screen complexity
Xok-ave calculated average screen complexity
Xp-ave selection average screen complexity (for P picture)
Xsk-ave Average screen complexity initial value Xi, Xp, Xb Screen complexity of current image Xi-ave, Xp-ave, Xb-ave Average screen complexity

Claims (6)

入力動画像を、動き補償予測手段、直交変換手段、量子化手段、及び可変長符号化手段を有して符号化を行う動画像符号化装置において、
前記入力動画像を構成する各画像の符号化時において、前記各画像毎の発生符号量を検出する手段と、
前記入力動画像を構成する各画像の符号化時において、前記各画像毎の平均量子化スケールを検出する手段と、
前記各画像毎の発生符号量と前記各画像毎の平均量子化スケールとの積に対して所定の変換を施すことによって、前記各画像毎の画面複雑度を算出する手段と、
予め設定される第1の所定期間毎に、前記各画像毎の画面複雑度を加算平均して平均画面複雑度を算出する手段と、
符号化開始時点では予め設定された平均画面複雑度の初期値を選択平均画面複雑度として出力し、
その後、前記初期値に対して符号化経過時間と共に重み付けが減少する関数を乗じて第1の平均画面複雑度を得、前記平均画面複雑度に対して符号化経過時間と共に重み付けが増加する関数を乗じて第2の平均画面複雑度を得、これら第1及び第2の平均画面複雑度を加算して得た値を選択平均画面複雑度として出力する手段と、
符号化単位である第2の所定期間毎に予め決定される目標符号量に、これから符号化を行なう符号化対象画像の画面複雑度を前記選択平均画面複雑度で除した値を乗ずることで、前記第2の所定期間毎の割当符号量を決定すると共に、この第2の所定期間毎の割当符号量から、既知の方法により、前記第2の所定期間内の各画像毎の割当符号量を算出し、この各画像毎の割当符号量と各マクロブロックの発生符号量とから、既知の方法により、各マクロブロックの量子化スケールを決定する手段と、
を備えたことを特徴とする動画像符号化装置。
In a moving image encoding apparatus that encodes an input moving image by including motion compensation prediction means, orthogonal transform means, quantization means, and variable length encoding means,
Means for detecting a generated code amount for each image at the time of encoding each image constituting the input moving image;
Means for detecting an average quantization scale for each image at the time of encoding each image constituting the input moving image;
Means for calculating a screen complexity for each image by performing a predetermined transformation on the product of the generated code amount for each image and the average quantization scale for each image;
Means for calculating an average screen complexity by averaging the screen complexity of each image for each preset first predetermined period;
At the time of encoding start, the initial value of the preset average screen complexity is output as the selected average screen complexity,
Thereafter, a first average screen complexity is obtained by multiplying the initial value by a function whose weight decreases with the encoding elapsed time, and a function whose weight increases with the encoding elapsed time is obtained for the average screen complexity. Means for multiplying to obtain a second average screen complexity, and outputting a value obtained by adding the first and second average screen complexity as a selected average screen complexity;
A target code amount that is previously determined for each second predetermined time period is a coding unit, a cheat can multiply a value obtained by dividing the screen complexity of the encoding target image to be encoded from now at the selected average screen complexity The allocated code amount for each second predetermined period is determined, and the allocated code amount for each image in the second predetermined period is determined from the allocated code amount for each second predetermined period by a known method. Means for determining the quantization scale of each macroblock by a known method from the allocated code amount for each image and the generated code amount of each macroblock ;
A moving picture encoding apparatus comprising:
請求項1に記載された動画像符号化装置において、
前記入力動画像のアクティビティを検出する手段を更に有し、
前記画面複雑度を算出する手段は、
前記発生符号量と前記平均量子化スケールの積に対して所定の変換を施すことによってピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)別に前記画面複雑度を求め、
前記符号化対象画像と同じピクチャタイプの前記符号化対象画像の直前に符号化が行なわれた画像の画面複雑度に対し、前記直前に符号化が行なわれた画像における前記アクティビティと前記符号化対象画像の前記アクティビティとの割合を乗ずることによって前記符号化対象画像の画面複雑度を得ることを特徴とする動画像符号化装置。
In the video encoding device according to claim 1,
Means for detecting an activity of the input moving image;
The means for calculating the screen complexity is:
Picture type by the performing predetermined conversion on the generated code amount and the product of the average quantization scale (I picture, P picture, B picture) asked additional the screen complexity,
With respect to the screen complexity of an image encoded immediately before the encoding target image of the same picture type as the encoding target image, the activity in the image encoded immediately before and the encoding target A moving picture coding apparatus characterized in that a screen complexity of the picture to be coded is obtained by multiplying a ratio of the picture with the activity.
請求項1または請求項2に記載された動画像符号化装置において、
前記平均画面複雑度を算出する手段は、
予め定めた過去の一定期間において、前記画面複雑度をピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)別に加算した上で各々のピクチャタイプの画像数で割ることによって各ピクチャタイプの平均画面複雑度を求め、
前記選択平均画面複雑度を出力する手段は、
予め既知の方法によって求めた各ピクチャタイプにおける平均画面複雑度の初期値を保持してあり、
符号化開始時点では前記初期値を選択平均画面複雑度として出力し、
その後、前記初期値に対して符号化経過時間と共に重み付けが減少する関数を乗じて第1の平均画面複雑度を得、前記平均画面複雑度に対して前記経過時間によって重み付けが増加する関数を乗じて第2の平均画面複雑度を得、これら第1及び第2の平均画面複雑度を加算して得た値を選択平均画面複雑度として出力することを特徴とする動画像符号化装置。
In the moving image encoding device according to claim 1 or 2,
The means for calculating the average screen complexity is:
In a predetermined fixed period in the past, before Kiga surface complexity of the picture type (I picture, P picture, B picture) average for each picture type by dividing the number of images of each picture type screen on which is obtained by adding separately Seeking complexity,
The means for outputting the selected average screen complexity is:
It holds the initial value of average screen complexity for each picture type obtained by a known method in advance,
At the start of encoding, the initial value is output as the selected average screen complexity,
Then, to obtain a first average picture complexity by multiplying a function weighting decreases with coding elapsed time relative to the initial value, the function of the weighting is increased by the elapsed time for the previous Kitaira equalizing screen complexity To obtain a second average screen complexity, and output a value obtained by adding the first and second average screen complexity as a selected average screen complexity. .
入力動画像を、動き補償予測ステップ、直交変換ステップ、量子化ステップ、及び可変長符号化ステップを有して符号化を行う動画像符号化方法において、
前記入力動画像を構成する各画像の符号化時において、前記各画像毎の発生符号量を検出するステップと、
前記入力動画像を構成する各画像の符号化時において、前記各画像毎の平均量子化スケールを検出するステップと、
前記各画像毎の発生符号量と前記各画像毎の平均量子化スケールとの積に対して所定の変換を施すことによって、前記各画像毎の画面複雑度を算出するステップと、
予め設定される第1の所定期間毎に、前記各画像毎の画面複雑度を加算平均して平均画面複雑度を算出するステップと、
符号化開始時点では予め設定された平均画面複雑度の初期値を選択平均画面複雑度として出力し、
その後、前記初期値に対して符号化経過時間と共に重み付けが減少する関数を乗じて第1の平均画面複雑度を得、前記平均画面複雑度に対して符号化経過時間と共に重み付けが増加する関数を乗じて第2の平均画面複雑度を得、これら第1及び第2の平均画面複雑度を加算して得た値を選択平均画面複雑度として出力するステップと、
符号化単位である第2の所定期間毎に予め決定される目標符号量に、これから符号化を行なう符号化対象画像の画面複雑度を前記選択平均画面複雑度で除した値を乗ずることで、前記第2の所定期間毎の割当符号量を決定すると共に、この第2の所定期間毎の割当符号量から、既知の方法により、前記第2の所定期間内の各画像毎の割当符号量を算出し、この各画像毎の割当符号量と各マクロブロックの発生符号量とから、既知の方法により、各マクロブロックの量子化スケールを決定するステップと、
を備えたことを特徴とする動画像符号化方法。
In a moving image encoding method for encoding an input moving image, including a motion compensation prediction step, an orthogonal transform step, a quantization step, and a variable length encoding step,
Detecting a generated code amount for each image at the time of encoding each image constituting the input moving image;
A step of detecting an average quantization scale for each image at the time of encoding each image constituting the input moving image;
Calculating a screen complexity for each image by performing a predetermined transformation on the product of the generated code amount for each image and the average quantization scale for each image;
Calculating an average screen complexity by averaging the screen complexity for each image for each preset first predetermined period;
At the time of encoding start, the initial value of the preset average screen complexity is output as the selected average screen complexity,
Thereafter, a first average screen complexity is obtained by multiplying the initial value by a function whose weight decreases with the encoding elapsed time, and a function whose weight increases with the encoding elapsed time is obtained for the average screen complexity. Multiplying to obtain a second average screen complexity, and adding a value obtained by adding the first and second average screen complexity as a selected average screen complexity;
A target code amount that is previously determined for each second predetermined time period is a coding unit, a cheat can multiply a value obtained by dividing the screen complexity of the encoding target image to be encoded from now at the selected average screen complexity The allocated code amount for each second predetermined period is determined, and the allocated code amount for each image in the second predetermined period is determined from the allocated code amount for each second predetermined period by a known method. Calculating a quantization scale of each macroblock by a known method from the allocated code amount for each image and the generated code amount of each macroblock ;
A moving picture encoding method comprising:
請求項に記載された動画像符号化方法において、
前記入力動画像のアクティビティを検出するステップを更に有し、
前記画面複雑度を算出するステップは、
前記発生符号量と前記平均量子化スケールの積に対して所定の変換を施すことによってピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)別に前記画面複雑度を求め、
前記符号化対象画像と同じピクチャタイプの前記符号化対象画像の直前に符号化が行なわれた画像の画面複雑度に対し、前記直前に符号化が行なわれた画像における前記アクティビティと前記符号化対象画像の前記アクティビティとの割合を乗ずることによって前記符号化対象画像の画面複雑度を得ることを特徴とする動画像符号化方法。
In the moving image encoding method according to claim 4 ,
Further comprising detecting an activity of the input moving image;
The step of calculating the screen complexity includes:
Picture type by the performing predetermined conversion on the generated code amount and the product of the average quantization scale (I picture, P picture, B picture) asked additional the screen complexity,
With respect to the screen complexity of an image encoded immediately before the encoding target image of the same picture type as the encoding target image, the activity in the image encoded immediately before and the encoding target A moving picture coding method characterized by obtaining a screen complexity of the picture to be coded by multiplying a ratio of the picture with the activity.
請求項4または請求項5記載された動画像符号化方法において、
前記平均画面複雑度を算出するステップは、
予め定めた過去の一定期間において、前記画面複雑度をピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)別に加算した上で各々のピクチャタイプの画像数で割ることによって各ピクチャタイプの平均画面複雑度を求め、
前記選択平均画面複雑度を出力するステップは、
予め既知の方法によって求めた各ピクチャタイプにおける平均画面複雑度の初期値を保持してあり、
符号化開始時点では前記初期値を選択平均画面複雑度として出力し、
その後、前記初期値に対して符号化経過時間と共に重み付けが減少する関数を乗じて第1の平均画面複雑度を得、前記平均画面複雑度に対して前記経過時間によって重み付けが増加する関数を乗じて第2の平均画面複雑度を得、これら第1及び第2の平均画面複雑度を加算して得た値を選択平均画面複雑度として出力することを特徴とする動画像符号化方法
In the moving image encoding method according to claim 4 or 5,
Calculating the average screen complexity,
In a predetermined fixed period in the past, before Kiga surface complexity of the picture type (I picture, P picture, B picture) average for each picture type by dividing the number of images of each picture type screen on which is obtained by adding separately Seeking complexity,
Outputting the selected average screen complexity;
It holds the initial value of average screen complexity for each picture type obtained by a known method in advance,
At the start of encoding, the initial value is output as the selected average screen complexity,
Then, to obtain a first average picture complexity by multiplying a function weighting decreases with coding elapsed time relative to the initial value, the function of the weighting is increased by the elapsed time for the previous Kitaira equalizing screen complexity To obtain a second average screen complexity, and to output a value obtained by adding the first and second average screen complexity as a selected average screen complexity .
JP19014499A 1999-07-05 1999-07-05 Video encoding apparatus and method Expired - Lifetime JP4362794B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19014499A JP4362794B2 (en) 1999-07-05 1999-07-05 Video encoding apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19014499A JP4362794B2 (en) 1999-07-05 1999-07-05 Video encoding apparatus and method

Publications (2)

Publication Number Publication Date
JP2001025016A JP2001025016A (en) 2001-01-26
JP4362794B2 true JP4362794B2 (en) 2009-11-11

Family

ID=16253147

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19014499A Expired - Lifetime JP4362794B2 (en) 1999-07-05 1999-07-05 Video encoding apparatus and method

Country Status (1)

Country Link
JP (1) JP4362794B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4063202B2 (en) 2003-11-20 2008-03-19 セイコーエプソン株式会社 Image data compression apparatus and encoder
JP4063203B2 (en) 2003-11-20 2008-03-19 セイコーエプソン株式会社 Image data compression apparatus and encoder
JP4063204B2 (en) 2003-11-20 2008-03-19 セイコーエプソン株式会社 Image data compression apparatus and encoder
JP4063205B2 (en) 2003-11-20 2008-03-19 セイコーエプソン株式会社 Image data compression apparatus and encoder
WO2009055443A1 (en) 2007-10-23 2009-04-30 Research In Motion Corporation System and method for communication diversion notification
JP6319545B2 (en) * 2013-03-15 2018-05-09 パナソニックIpマネジメント株式会社 Image coding apparatus, photographing system, photographing and recording system, image quality coding method, and image coding control program
WO2014199566A1 (en) * 2013-06-13 2014-12-18 日本電気株式会社 Video encoding device, video encoding method, and program-containing non-transitory computer-readable medium
JP6537817B2 (en) * 2014-12-15 2019-07-03 株式会社パロマ Display system for displaying the target usage of energy and display system for displaying the target usage of energy

Also Published As

Publication number Publication date
JP2001025016A (en) 2001-01-26

Similar Documents

Publication Publication Date Title
JP3954656B2 (en) Image coding apparatus and method
KR101518358B1 (en) A buffer-based rate control exploiting frame complexity buffer level and position of intra frames in video coding
JP3748717B2 (en) Video encoding device
US6141380A (en) Frame-level rate control for video compression
JPH11346362A (en) Real time single path variable bit rate control method, and encoder
JP2002525989A (en) Intra-frame quantizer selection for video compression
JP2001169281A (en) Device and method for encoding moving image
KR20070111550A (en) Quasi-constant-quality rate control with look-ahead
Wang Rate control for MPEG video coding
JP3259702B2 (en) Moving picture variable bit rate coding apparatus and method
WO1999001987A1 (en) Device and method for controlling image encoding, encoding system, transmission system and broadcast system
MXPA05014209A (en) Multipass video rate control to match sliding window channel constraints.
JP2001008215A (en) Dynamic image encoder and method therefor
JP4362795B2 (en) Video encoding apparatus and method
JP4257655B2 (en) Video encoding device
JP4362794B2 (en) Video encoding apparatus and method
JP3508916B2 (en) Moving image variable bit rate encoding method and apparatus
JP3173369B2 (en) Image compression coding device
JP3812267B2 (en) Video encoding apparatus and method
JPH0998427A (en) Dynamic image encoding device
JP4362793B2 (en) Video encoding apparatus and method
JP3858520B2 (en) Video encoding apparatus and method
JP3480067B2 (en) Image coding apparatus and method
JP3812269B2 (en) Video encoding apparatus and method
JPH07203430A (en) Image coding device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060331

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080226

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080424

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090501

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090625

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: 20090724

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090806

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

Free format text: PAYMENT UNTIL: 20120828

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4362794

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20120828

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

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

Free format text: PAYMENT UNTIL: 20120828

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20120828

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130828

Year of fee payment: 4

EXPY Cancellation because of completion of term