JP4583514B2 - Video encoding device - Google Patents

Video encoding device Download PDF

Info

Publication number
JP4583514B2
JP4583514B2 JP00983998A JP983998A JP4583514B2 JP 4583514 B2 JP4583514 B2 JP 4583514B2 JP 00983998 A JP00983998 A JP 00983998A JP 983998 A JP983998 A JP 983998A JP 4583514 B2 JP4583514 B2 JP 4583514B2
Authority
JP
Japan
Prior art keywords
code length
code
unit
motion vector
image
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
JP00983998A
Other languages
Japanese (ja)
Other versions
JPH11215504A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP00983998A priority Critical patent/JP4583514B2/en
Publication of JPH11215504A publication Critical patent/JPH11215504A/en
Application granted granted Critical
Publication of JP4583514B2 publication Critical patent/JP4583514B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、動画像を動き補償して符号化する動画像符号化装置に関する。
【0002】
【従来の技術】
従来、動画像を動き補償して予測符号化することにより動画像の符号量(情報量)を低減させる動画像符号化技術が知られている。
例えば、特開平6−105299号公報には、動画像でなる入力画像の1画面を所定の画像ブロックに分割して各画像ブロックごとに複数候補の動きベクトルを用意し、フレーム間予測を行なうに際して符号化効率を最も改善する動きベクトルを選択する動画像圧縮装置が開示されている。
【0003】
具体的に、その構成を図6に示す。
同図において、430はコントローラ、431は画像メモリ、432は減算器、433はDCT(Discrete Cosine Transform)演算部、434は量子化部、435は可変長符号化部(VLC)、436はバッファ、438は逆量子化部、439は逆DCT演算部(IDCT)、440は加算器、441ないし443はスイッチ、444および445は予測器である。また、上述の逆量子化部438、逆DCT演算部439、加算器440、スイッチ441ないし443、予測器444および445は、動き補償フレーム間予測部(符号なし)を構成する。
【0004】
以下、図7に示すフローチャートに沿って、図6に示す動画像圧縮装置の4種類の動作(第1ないし第4の動作)を説明する。
なお、第1ないし第4の各動作の説明では、図7に示すフローチャートの各ステップを引用するが、各動作の説明で引用されないステップについては、その動作に関する限り図7に示すフローチャートから削除するものとする。
【0005】
まず、この動画像圧縮装置の第1の動作を説明する。
以下に述べる一連の動作はコントローラ430の制御の下に行われる。
画像メモリ431には外部からの画像データが蓄積される。減算器432は、画像メモリ431から読み出された画像データと後述の予測器444または445からの予測画像との差分を出力する。DCT演算部433は、減算器432からの差分データを直交変換して周波数軸に変換する。量子化部434および可変長符号化部435は、DCT演算部433からのデータをそれぞれ量子化して可変長符号化し、バッファ436を介して符号化データとして外部に出力する。
【0006】
ここで、動き補償フレーム間予測部(符号なし)は、コントローラ430の制御の下に、時間軸方向の圧縮のためのフレーム間予測処理を行う。すなわち、量子化部434からのデータは、逆量子化部438および逆DCT演算部439により復号されて予測器443または444からの予測画像に加算される。この予測画像に基づき、1画面を分割して得られる所定の画像ブロック(部分画像)ごとに複数候補の動きベクトルが検出されて用意される(ステップS1)。
【0007】
そして、複数候補の動きベクトルの中から実際に符号化するときに最もよい符号化効率を与える動きベクトルが決定され(ステップS5)、既に符号化された画像(予測画像)を動きベクトル分だけ移動させて動き補償が行われ、フレーム間予測が行われる。
なお、スイッチ441ないし443は、画像モードおよび予測モードに応じて、コントローラ430により切り替えられる。
【0008】
次に、この動画像圧縮装置の第2の動作を説明する。
上述の第1の動作と同様にフレーム間予測が行われ、各画像ブロックごとに複数候補の動きベクトルが検出されて用意される(ステップS1)。検出された複数候補の動きベクトルについて予測誤差が検出され、この予測誤差について最小予測誤差に対する誤差係数が算出される(ステップS2)。そして、算出された誤差係数に基づいて、複数候補の動きベクトルの中から実際に符号化するときに最もよい符号化効率を与える動きベクトルが決定される(ステップS5)。
【0009】
次に、この動画像圧縮装置の第3の動作を説明する。
上述の第2の動作と同様にして複数候補の動きベクトルの予測誤差が検出されると(ステップS1〜ステップ2)、この複数候補の動きベクトルに対して実際に符号化対象となる動きベクトルの値が算出される(ステップS3)。算出された動きベクトルの値を基に、符号化したときのコード長が図8に例示するベクトル符号化係数として算出される(ステップS4)。そして、この符号化係数に基づいて、実際に符号化するときに最もよい符号化効率を与える動きベクトルが決定される(ステップS5)。
【0010】
次に、この動画像圧縮装置の第4の動作を説明する。
上述の第3の動作と同様にして複数候補の動きベクトルの予測誤差が検出されると(ステップS1〜ステップS2)、複数候補の動きベクトルを基に、符号化したときのコード長がコード長ベクトル符号化係数として算出される(ステップS4)。そして、この符号化係数に基づいて、実際に符号化するとき最もよい符号化効率を与える動きベクトルが決定される(ステップS5)。
【0011】
【発明が解決しようとする課題】
ところで、上述の従来技術にかかる動画像圧縮装置は、予め検出された複数候補の動きベクトルの中から最もよい符号化効率を与える動きベクトルを選択して符号化するものであって、動きベクトルのコード長は、その動きベクトルの大きさに関係なく設定される。このため、動きベクトルによっては、そのコード長が冗長となる場合があり、符号量を有効に低減できないという問題がある。
【0012】
具体的には、上述の従来技術によれば、算出された符号化係数に基づいて動きベクトルが決定されるが、この符号化係数は動きベクトルの大きさに関係なく一意に定まり、動きベクトルを符号化するための規則は固定されている。したがって、最もよい符号化効率を与える動きベクトルであっても、そのコード長は固定されており、冗長となる場合を生じているのが現状である。
【0013】
本発明は、このような問題に鑑みてなされたものであり、動きベクトルの大きさに応じて符号量を低減させ、符号化効率を改善することのできる動画像符号化装置を提供することを課題とする。
【0014】
【課題を解決するための手段】
本発明は、前記課題を解決達成するため、以下の構成を有する。
即ち、本発明は、入力画像を所定の画像ブロックに分割し、上記入力画像とあらかじめ符号化された予測画像とから上記画像ブロックごとに動きベクトルを発生して上記動きベクトルに基づき上記予測画像の動きを補償する動き補償手段を有し、上記動き補償手段により動き補償して上記入力画像を符号化すると共に、指定されたコード長で上記動きベクトルを符号化する符号化手段と、上記画像ブロックからなる所定の画像ユニットを単位として、上記動き補償手段で発生した上記動きベクトルを符号化するため、および上記動き補償手段による次のフレームに対する入力画像の動きベクトルの探索範囲を定めるために、上記符号化手段に対し上記動きベクトルのコード長を指定するコード長指定手段と、上記符号化手段が次の画像ユニットに対する上記入力画像を符号化するに際し、上記動き補償手段が現在の画像ユニットで発生した動きベクトルの大きさに基づき、上記動きベクトルの大きさに応じた動きベクトルの探索範囲を表現するのに足りる最小のコード長を算出し、算出した上記最小のコード長に基づいて上記コード長指定手段が指定するコード長を更新するコード長更新手段とを備え、上記コード長更新手段は、上記現在の画像ユニットで発生した動きベクトルの大多数となる所定の割合の動きベクトルの大きさが、上記現在の画像ユニットに対して上記コード長指定手段が指定するコード長より少ないコード長を用いて表現される場合、上記コード長指定手段が指定するコード長を、上記動きベクトルの大多数となる所定の割合の動きベクトルの大きさを表現するのに足りる最小のコード長に更新する
【0017】
さらにまた、本発明の上記コード長更新手段は、上記コード長指定手段が指定するコード長を用いて上記現在の画像ユニットで発生した動きベクトルの大きさを表現して上記入力画像を符号化したときに発生する第1の符号量と、上記動きベクトルの大きさを表現するのに足りる最小のコード長を用いて上記現在の画像ユニットで発生した動きベクトルを表現して上記入力画像を符号化したときに発生する第2の符号量とを求め、上記第1の符号量に対する上記第2の符号量の増分が所定の閾値以下となる場合に上記コード長指定手段が指定するコード長を更新する構成を有する。
【0018】
さらにまた、本発明の上記コード長更新手段は、上記コード長指定手段が指定するコード長を用いて上記現在の画像ユニットで発生した動きベクトルの大きさを表現して上記入力画像を符号化したときに発生する第1の符号量と、上記コード長指定手段が指定するコード長よりも少ないコード長を用いて上記現在の画像ユニットで発生した動きベクトルを表現して上記入力画像を符号化したときに発生する第2の符号量とを求め、上記第1の符号量に対する上記第2の符号量の増分が所定の閾値以下となる場合に上記コード長指定手段が指定するコード長を上記コード長指定手段が指定するコード長よりも少ないコード長に更新する構成を有する。
【0019】
さらにまた、本発明の上記コード長更新手段は、上記第1の符号量に対する上記第2の符号量の増分が所定の閾値を超える場合、上記符号化手段により上記入力画像を符号化したときに発生する符号量が上記所定の閾値以下となる範囲内で、上記コード長指定手段が指定するコード長を増やす方向に更新する構成を有する。
【0020】
さらにまた、本発明は、外部から指定されたコード長を入力するコード長入力手段をさらに備え、上記コード長更新手段は、上記コード長更新手段が生成したコード長に基づいて符号化したときに発生する符号量と、上記コード長入力手段に入力されたコード長に基づいて符号化したときに発生する符号量との比較に基づいて、上記コード長更新手段が生成したコード長または上記コード長入力手段に入力されたコード長を選択して、上記コード長指定手段が指定するコード長を更新する構成を有する。
【0021】
さらにまた、本発明の上記コード長更新手段は、上記画像ブロックに対して許容される動き探索範囲内で取り得る複数候補のコード長を生成し、上記複数候補のコード長を用いて上記動きベクトルを表現して上記入力画像をそれぞれ符号化したときに発生する符号量を比較し、上記複数候補のコード長の中から上記符号量が最も小さくなるコード長を選択する構成を有する。
【0022】
さらにまた、本発明の上記コード長更新手段は、上記コード長入力手段に入力されたコード長を用いて上記動きベクトルを表現して得られる符号量と、上記コード長更新手段が生成したコード長を用いて上記動きベクトルを表現して得られる符号量とをそれぞれ重み付けして比較し、該比較の結果に基づきコード長を選択する構成を有する。
【0023】
さらにまた、本発明は、上記画像ユニットが2以上のフレームからなり、上記画像ユニットをなすフレーム数を可変とした構成を有する。
【0024】
【発明の実施の形態】
以下、本発明の実施の形態について、図面を参照しながら説明する。
なお、各図において共通する要素には同一符号を付して、重複する説明を省略する。
【0025】
実施の形態1.
図1に、本発明の実施の形態1にかかる動画像符号化装置の構成を示す。
同図において、100は、動画像でなる入力画像10を所定の画像ブロックに分割し、入力画像10とあらかじめ符号化された予測画像10Aとから上記画像ブロックごとに動きベクトルを発生して上記動きベクトルに基づき予測画像10Aの動きを補償する動き補償予測部44(動き補償手段)を有し、上記動き補償部44により動き補償して入力画像10を符号化すると共に、指定されたコード長で上記動きベクトルを符号化する符号化部(符号化手段)である。
【0026】
また、50は、上記画像ブロックからなる所定の画像ユニットを単位として、符号化部100に対し動きベクトルのコード長を指定するコード長指定部(コード長指定手段)、60は、符号化部100が次に符号化の対象とされる画像ユニットに対する入力画像を符号化するに際し、動き補償予測部44が現在符号化の対象とする画像ユニットで発生した動きベクトルの大きさに基づきコード長指定部50が指定するコード長を更新するコード長更新部(コード長更新手段)である。
【0027】
さらに、31は、あらかじめ符号化された画像を格納する画像メモリ、32は、入力画像10と画像メモリ31からの予測画像10Aとの差分を演算する差分演算器、33は、差分演算器32からの差分データを符号化する符号化器、35は、符号化器33からのデータを可変長符号化して符号化データを得る可変長符号化器(VLC)、36は、可変長符号化器35からの符号化データを一時的に蓄積するバッファ、38は、符号化器33からのデータを局部的に復号する複号器、40は、画像メモリ31からの予測画像10Aと復号器38からのデータとを加算する加算器である。
【0028】
次に、フレーム間予測符号化を行う場合を例として、本実施の形態1にかかる動画像符号化装置の動作を説明する。
なお、本実施の形態1では、上述の「画像ユニット」を「フレーム」とし、各フレームをいくつかの所定の画像ブロックに分割して得られる各画像ブロックごとに符号化を行うものとする。
【0029】
まず、画像メモリ31から、現在符号化の対象とされる入力画像10の画像ブロックと同位置の画像データまたは動き補償予測部44が発生した動きベクトルにより指定された画像データが、予測画像10Aとして画像ブロックごとに読み出される。差分演算器32は、画像メモリ31からの予測画像10Aと入力画像10との差分を演算し、歪み評価値46と差分データとを得る。
【0030】
ここで、動き補償予測部44は、あらかじめ指定された動きベクトル探索範囲内での歪み評価値46(たとえばブロック単位での差分絶対値和)が最小となるように、画像メモリ31から入力画像10に最も近い画像または一致する画像データを予測画像10aとして抽出して動きベクトルを検出する。
【0031】
歪み評価値46が最小を示すときの差分演算器32からの差分データは、符号化器33で符号化され、可変長符号化器35で可変長符号化される。このとき、動き補償予測部44により検出された動きベクトルは、後述のコード長指定部50により指定されたコード長で符号化される。可変長符号化器35で可変長符号化されたデータは、一旦バッファ36に蓄積され、伝送レートにしたがって伝送路(図示なし)に符号化データ90として出力される。
【0032】
また、符号化器33で符号化されたデータは、複号部38により局部的に復号され、画像メモリ31からの予測画像10Aと加算器40にて復号加算されて画像メモリ31に書き込まれる。これにより、画像メモリ31の画像データが更新される。
以上により、入力画像10に対してフレーム間予測符号化が行われる。
【0033】
上述の一連のフレーム間予測符号化の動作の過程において、コード長指定部50は、1フレーム(所定の画像ユニット)を単位として、符号化部100を構成する可変長符号化器35に対し動きベクトルのコード長を指定する。このコード長は、動きベクトルの符号化コードの一部であっても全部であってもよい。コード長指定部50が指定したコード長は、動き補償予測部44にも与えられ、動き補償予測部44での動きベクトルの探索範囲を定める。
【0034】
また、コード長更新部60は、符号化部100が次のフレームに対する入力画像10を符号化するに際し、動き補償予測部44が現在のフレームで発生した動きベクトルの大きさに基づき、コード長指定部50が指定するコード長を更新する。
【0035】
以下、コード長指定部50およびコード長更新部60の動作について、水平方向の動きベクトルの符号化コードの一部のコード長を指定(更新)する場合を例として具体的に説明する。
【0036】
まず、動きベクトルの符号化コードの一部のコード長をpsizeとし、このコード長psizeを、動きベクトルの探索範囲を表すことができる整数Rで表現する。たとえば一例として、整数Rを下式(1)で表現する。ただし、式(1)において、記号「≪」は、ビットシフト演算子を表す。
【0037】
R=1≪psize (1)
【0038】
この場合、整数Rは、psize[bit]分だけ「1」をMSB(Most Significant Bit:最上位ビット)側にビットシフトさせた2進数として表され、10進数の2psizeと等価となる。
【0039】
このようにコード長psizeを整数Rで表現した場合、動き補償の単位がM×N画素ブロック(M,Nは自然数)のとき、水平画素数は「M」であるから、発生しうる動きベクトルの最高値maxおよび最低値minは、下式(2)で表され、発生しうる動きベクトルの範囲rangeは、下式(3)で表される。
【0040】
max=(M×R)-1,min={(-M)×R} (2)
【0041】
range=(2M×R) (3)
【0042】
ここで、一例として、psize=3,M=8とすると、上式(2)および(3)より、R=1≪3=8,max=(8×8)-1=63,min=((-8)×8)=-64,range=128 を得る。
【0043】
次に、-M≦mccode≦Mを満たす整数値mccodeとpsize[bit]のコード長で表される整数値mcresとをパラメータとして、動きベクトルの大きさの値MVを整数値mccodeと整数値mcrecとの組み合わせで表現する。
【0044】
一例として、R=1,mccode=0なる条件が満足された場合、動きベクトルの大きさの値MVを下式(4)で表し、上述のR=1,mccode=0なる条件が満足されない場合には、動きベクトルの大きさの値MVを下式(5)で表す。
ただし、式(5)において、abs(mccode)は、整数値mccodeの絶対値を表し、mccode<0のとき、MV=-MVとする。
【0045】
MV=mccode (4)
【0046】
MV=[{abs(mccode)-1}×R]+mcres+1 (5)
【0047】
このように、動きベクトルの大きさの値MVを表現した場合、動きベクトルの大きさの値MVを整数Rで割った商{abs(mccode)-1}と剰余(mcres+1)とから整数値mccodeおよびmcresを設定することができる。
【0048】
一例として、動きベクトルの大きさの値MVとして「53」を表現する場合、「53」をM(=8)で割った商と余りは、それぞれ「6」と「5」であるから、mccode=6+1=7,mcres=5-1=4となる。このように整数値mccodeおよびmcresを設定した場合、上式(5)よりMV=((abs(7)-1)×8)+4+1=53が得られる。
【0049】
他の例として、動きベクトルの大きさの値MVとして「40」を表現する場合、「40」をM(=8)で割った商と余りは、それぞれ「5」と「0」である。この場合、余りが「0」となってmcresのコード長を与えるpsize[bit]も「0」となり、動きベクトルの大きさを表現できなくなる。
【0050】
そこでこの場合、商の一部を余りに転化させて、商と余りを、それぞれ「4」と「8」とし、mccode=5,mcres=7(2進数表示では「111」)とする。このように整数値mccodeおよびmcresを設定した場合、上式(5)よりMV=((abs(5)-1)×8)+7+1=40が得られる。
以上の例から、動きベクトルの大きさの値MVが、整数値mccodeとmcresとをパラメータとして表現されることが分かる。
【0051】
仮に、動きベクトルの大きさの値MVが「0」の近傍ほど高い確率で発生するなら、整数値mccodeについては可変長符号で表したほうが符号化効率がよくなる。
また、整数値mcresを可変長符号で表現すると、整数Rの倍数の前後の値の動きベクトルのコード長が逆転してしまうので、整数値mcresについては固定長符号で表現したほうが符号化効率がよくなる。
【0052】
上述の式(4)および式(5)を用いて動きベクトルの大きさMVを表現することにより、コード長psizeから導かれる整数Rを単位として動きベクトルの探索範囲が決められ、整数値mcresにより整数Rでは表現できない探索範囲の隙間が埋められる。したがって、整数値mccodeおよびmcresにより動きベクトルの大きさMVが表現され、動きベクトルの大きさに基づきコード長psizeを決定することが可能となる。
【0053】
ここで、再び説明を図1に戻す。
コード長指定部50は、上述のように、動きベクトルの大きさに基づき決定されたコード長psizeを符号化部100に対して指定する。このコード長psizeは、現在のフレームで発生する動きベクトルのコード長に影響を与え、動きベクトルのコード長psizeが大きいと動きベクトルの探索範囲(ベクトル分布範囲)が広くなり、小さいと逆に狭くなる。
【0054】
一方、コード長更新部60は、コード長指定手段50が指定するコード長psizeの影響を受けて現在のフレームで発生した動きベクトルの大きさに基づき、次のフレーム全体で動きベクトルの符号量が少なくなるように、コード長指定部50が指定するコード長psizeを更新する。
以上により、現在のフレームで発生した動きベクトルの大きさに基づき、動きベクトルのコード長が更新されて、次のフレームでの符号量が低減される。
【0055】
上述した本実施の形態1では、値MVを動きベクトルの大きさとしたが、現在のフレームで発生した動きベクトルの大きさの「分布」や、あらかじめ符号化された動きベクトルとの「差分」としてもよく、本発明の内容を制限するものではない。
【0056】
また、整数値mccodeとmcresとをパラメータとして動きベクトルの大きさを表現したが、この表現方法に限定されることなく、動きベクトルの一部または全部の符号化コードのコード長が、コード長指定部50が指定するコード長psizeによって変わるように表現されていればよい。さらに、歪み評価値46として差分絶対値和を用いたが、たとえば差分二乗和であってもよい。
【0057】
さらにまた、本実施の形態1では、フレーム間予測符号化を行うものとしたが、たとえばフレーム内符号化のように、典型的な動画像符号化装置として動作するように構成してもよい。この場合、入力画像10を条件によりそのまま符号化器33で符号化するように構成すればよい。
【0058】
実施の形態2.
次に、図1を援用して、本発明の実施の形態2を説明する。
本実施の形態2では、コード長更新部50(コード長更新手段)は、現在のフレーム(現在の画像ユニット)で発生したすべての動きベクトルの大きさが、現在のフレームに対してコード長指定部50が指定するコード長psizeより少ないコード長を用いて表現される場合、コード長指定部50が指定するコード長psizeを、上記すべての動きベクトルの大きさを表現するのに足りる最小のコード長qsizeに更新するように構成される。
【0059】
たとえば、現在のフレームにおいて、psize=3,M=8である場合、現在のフレーム内で発生したすべての動きベクトルの大きさ(vector)が、-32≦vector≦32を満たす場合、すべての動きベクトルの大きさを表現するのに足りる最小のコード長は「2」となり、psize=2でもすべての動きベクトルを表現できる。
【0060】
なぜなら、psize=2のとき、前述の式(1)および(2)より、動きベクトルの最高値maxは「31」,動きベクトルの大きさの最低値minは「-32」となるからである。そこで、コード長更新部60は、コード長qsizeを「2」として、コード長指定部50が指定するコード長psizeをコード長qsizeに更新する。
【0061】
この場合、整数値mcresは2ビットで表現できるため、1動きベクトルあたりコード長が1ビットだけ削減される。よって、仮にコード長psizeを「2」として現在のフレームの動きベクトルを再符号化すれば、現在のフレームで発生する符号量を削減することができる。
【0062】
しかし、実際には装置の演算処理速度の制約から、現在のフレームで再符号化する時間的余裕がない。仮に時間的余裕があったとしても、1フレーム分の符号化された動きベクトルを蓄積するだけのバッファ容量を確保することができない環境下にある場合には現在のフレームでの再符号化が困難となる。そこで、コード長更新部60は、次のフレームでコード長psizeを「2」(qsize)に更新して符号化する。
【0063】
ここで、一般に、動画像においては急激に動きの変化がない状態では隣接する画像フレームの動きが類似している傾向にあり、次のフレームでも現在のフレームでの動きベクトルに類似した動きベクトルが求められると予測される。したがって、次のフレームでコード長psizeを「2」(qsize)に更新して符号化しても、次のフレームで発生する符号量を有効に削減することができる。
【0064】
なお、再符号化するに足りる演算処理速度を有し、またフレーム単位で符号化された動きベクトルを蓄積するだけのバッファ容量を有し、さらにバッファより伝送路に出力される符号化データが途切れることなく指定された伝送レートを維持することができるのであれば、現在のフレームでコード長を更新して再符号化してもよい。この場合、次のフレームでコード長を更新するよりも、より符号量を低く抑えることができる。
【0065】
実施の形態3.
次に、図1を援用して、本発明の実施の形態3を説明する。
上述の実施の形態2では、現在のフレームで発生した「すべて」の動きベクトルをコード長qsizeを用いて表現できる場合にコード長を更新するとしたが、本実施の形態3では、コード長更新部50は、現在のフレームで発生した動きベクトルの「大多数」となる所定の割合の動きベクトルの大きさが、上記現在の画像ユニットに対してコード長指定部50が指定するコード長psizeより少ないコード長を用いて表現される場合、コード長指定部50が指定するコード長psizeを、上記大多数となる所定の割合の動きベクトルの大きさを表現するのに足りる最小のコード長qsizeに更新するように構成される。
【0066】
以下、上述の「大多数」となる所定の割合の動きベクトルに着目してコード長を更新することの妥当性を説明する。
隣接する動画像の動きの傾向が類似する場合、仮に現在のフレームの「すべて」の動きベクトルがコード長qsizeに基づいて表現できれば、次のフレームでも大多数の動きベクトルがコード長qsizeに基づいて表現できることが予測される。したがって、次のフレームでコード長qsizeを指定すれば、発生する符号量を極めて高い確率で減少させることができる。上述の実施の形態2では、この観点に立ってコード長を更新する。
【0067】
しかし、現在のフレームで「すべて」の動きベクトルがコード長qsizeに基づいて表現できるベクトルであるとしても、次のフレームでも「すべて」の動きベクトルがコード長qsizeに基づいて表現できるベクトルであるとは限らない。また、現在のフレームで「大多数」の動きベクトルがコード長qsizeに基づいて表現できるベクトルであるときに、次のフレームでも「すべて」の動きベクトルがコード長qsizeに基づいて表現できるベクトルであることもある。
【0068】
すなわち、次のフレームにおいて「大多数」の動きベクトルがコード長qsizeに基づいて表現できると予測できるのであれば、必ずしも現在のフレームで発生した動きベクトルの「すべて」に着目する必要はなく、「大多数」となる所定の割合の動きベクトルに着目すれば足りる。本実施の形態3では、この観点に立って、コード長更新部60が、現在のフレームで「大多数」となる所定の割合の動きベクトルに着目してコード長を更新する。
【0069】
実施の形態4.
次に、図2を参照して、本発明の実施の形態4を説明する。
上述の実施の形態2および3では、それぞれ「すべて」および「大多数」の動きベクトルがコード長qsizeに基づいて表現できるベクトルである場合、コード長psizeをコード長qsizeに更新するとしたが、本実施の形態4では、さらに条件を加えて、符号量の増分が所定の閾値以下となる場合にコード長を更新する。
【0070】
すなわち、本実施の形態4にかかる動画像符号化装置は、図1に示す前述の実施の形態2または3の構成において、コード長更新部60に代えて、コード長更新部60Aを備える。
【0071】
このコード長更新部60Aは、コード長指定部50が指定するコード長psizeを用いて現在のフレームで発生した動きベクトルの大きさを表現して入力画像10を符号化したときに発生する第1の符号量と、現在のフレームでの動きベクトルの大きさを表現するのに足りる最小のコード長qsizeを用いて現在のフレームで発生した動きベクトルを表現して入力画像10を符号化したときに発生する第2の符号量とを求め、第1の符号量に対する第2の符号量の増分が所定の閾値TH以下となる場合にコード長指定部50が指定するコード長psizeをコード長qsizeに更新するように構成される。
【0072】
以下、具体的に、本実施の形態4にかかるコード長更新部60Aの動作(コード長の更新方法)を説明する。
コード長psizeに基づいて符号化した場合とコード長qsizeに基づいて符号化した場合とで発生する動きベクトルの符号量を比較すると、少ないコード長qsizeに基づいて符号化した方が動きベクトル自体の符号量はより少なくなる。しかし、総符号量が減少するか否かについては、符号化器33で発生する差分データの符号量も考慮して判断する必要がある。
【0073】
以下、符号化器33で発生する差分データの符号量を考慮した場合のコード長の更新方法を具体的に説明する。
現在のフレームで歪み評価値46が最も小さい動きベクトルmvpはコード長psizeに基づいて符号化できるが、コード長qsizeに基づいて符号化することができない場合、動きベクトルmvpを採択することはできない。したがってこの場合、コード長qsizeに基づいた動き探索範囲内で歪み評価値46が最も小さくなる動きベクトルmvqを用いて動き補償を行って符号化することになる。
【0074】
ここで、動きベクトルmvpを用いて動き補償して符号化したときの1フレームあたりの符号量をfrcap(第1の符号量)、動きベクトルmvqを用いて動き補償を行って符号化したときの1フレームあたりの符号量をfrcaq(第2の符号量)とすると、符号化部33においてコード長qsizeに更新することで増加する符号量は、(frcaq-frcap)である。現在のフレームで符号化される動きベクトルの数が十分多く、符号量の増分(frcaq-frcap)が十分小さい場合、次のフレームでコード長qsizeを指定すれば、次のフレームで発生する動きベクトル自体の符号量は削減される。
【0075】
しかし、コード長qsizeに更新することで削減される動きベクトルの符号量ommvが、コード長qsizeに更新することで反対に増加する符号量(frcaq-frcap)より小さい場合、次のフレームでコード長qsizeを指定すると総符号量が増加し、符号化効率が悪くなる。そこで、コード長更新部60Aは、削減できる符号量ommvだけでなく、以下のように、増加する符号量(frcaq-frcap)も評価して、コード長qsizeを指定するかどうかを判定する。
【0076】
1フレームあたり符号化される動きベクトルの数をafrmvとし、そのうちコード長qsizeに基づいても表すことができる動きベクトルの数をafrmvqとすると、コード長psizeをコード長qsizeに更新することにより1フレームあたり削減される符号量ommvは、ommv=(psize-qsize)×afrmvq[bit]である。
【0077】
一方、コード長psizeをコード長qsizeに更新することにより1フレームあたり増加する符号量(frcaq-frcap)は、frcaq-frcap=(bcaq-bcap)×(afrmv-afrmvq)[bit]である。ここで、bcaqは、動きベクトルmvqを用いて動き補償を行って符号化したときの1符号化ブロック(画像ブロック)当たりの符号量、bcapは、動きベクトルmvpを用いて動き補償を行って符号化したときの1符号化ブロック当たりの符号量である。
【0078】
コード長更新部50は、1フレームあたり増加する符号量(frcaq-frcap)を閾値THと比較して判定し、現在のフレームにおいてTH≧(frcaq-frcap)なる判定条件が満足された場合に次のフレームではコード長qsizeに更新する。この閾値THは、1フレームあたり削減される符号量ommvに設定される。ここで、現在のフレームと次のフレームとで動きベクトルの発生特性が変わることを考慮してマージンを設定するために、符号量ommvの値に重み付けした値(w×ommv:たとえばw=0.7)を閾値THとして設定してもよい。
【0079】
一例として、連続した複数のフレームにわたって動きベクトルの大きさの範囲が徐々に減少したり、反対に増加する特性がある場合、次のフレームでも同様の特性が期待される。しかし、被写体の動きが急激に変化して動きベクトルの発生特性が変わると、この期待が外れて全体の発生符号量の予想が大きく外れる場合が生じる。そこで、動きベクトルの発生特性が変わることにより発生符号量の予想が外れる可能性を考慮する場合、重み付け係数wを大きい値(1に近い少数)に設定する。
【0080】
実施の形態5.
次に、図1を援用して、本発明の実施の形態5を説明する。
前述の実施の形態2ないし4では、現在のフレームで発生した「すべて」または「大多数」の動きベクトルの大きさに着目してコード長を更新するように構成したが、本実施の形態5では、「すべて」または「大多数」の動きベクトルに限定されることなく、現在のフレームで発生した符号量に着目して次のフレームでのコード長を指定(更新)する。
【0081】
すなわち、援用する図1に示す本実施の形態5にかかるコード長更新部60は、コード長指定部50が指定するコード長psizeを用いて現在のフレームで発生した動きベクトルの大きさを表現して入力画像10を符号化したときに発生する第1の符号量と、コード長指定部50が指定するコード長psizeよりも少ないコード長qsizeを用いて現在のフレームで発生した動きベクトルを表現して入力画像10を符号化したときに発生する第2の符号量とを求め、第1の符号量に対する第2の符号量の増分が所定の閾値TH以下となる場合にコード長指定部50が指定するコード長psizeを、このコード長psizeよりも少ないコード長qsizeに更新するように構成される。
【0082】
以下、本実施の形態5にかかるコード長更新部60の動作を説明する。
実施の形態4で述べたように、コード長psizeをコード長qsizeに更新することにより1フレームあたり削減される符号量ommvは、ommv=(psize-qsize)×afrmvq[bit]であり、一方、増加する符号量(frcaq-frcap)は、frcaq-frcap=(bcaq-bcap)×(afrmv-afrmvq)[bit]である。
【0083】
したがって、仮に現在のフレームで「すべて」または「大多数」の動きベクトルがコード長qsizeで表現できるのであれば、コード長qsizeに基づいて表すことができる動きベクトルの数afrmvqが十分大きくなり、ommv>>(frcaq-frcap)となる。
【0084】
しかし、符号量ommvが符号量(frcaq-frcap)を超えなければ、符号化効率は改善されるので、必ずしも動きベクトルの数afrmvqが十分大きい値である必要はない。すなわち、ommv≧(frcaq-frcap)なる条件を満足しさえすれば、符号量frcapおよびfrcaqに基づいてコード長qsizeを指定することにより、次のフレームでの符号量を削減することができる。
【0085】
実施の形態6.
次に、図1を援用して、本発明の実施の形態6を説明する。
上述の実施の形態5では、現在のフレームでの符号量に基づき、コード長指定部50が指定するコード長を更新するようにしたが、本実施の形態6にかかるコード長更新部60Aは、第1の符号量に対する第2の符号量の増分が所定の閾値THを超える場合、符号化部100により入力画像10を符号化したときに発生する符号量が所定の閾値以下となる範囲内で、コード長指定部50が指定するコード長psizeを増やす方向に更新するように構成される。
【0086】
ここで、前述のように、第1の符号量は、コード長指定部50が指定するコード長psizeを用いて現在のフレームで発生した動きベクトルの大きさを表現して入力画像10を符号化したときに発生する符号量であり、第2の符号量は、コード長指定部50が指定するコード長psizeよりも少ないコード長qsizeを用いて現在のフレームで発生した動きベクトルを表現して入力画像10を符号化したときに発生する符号量である。
【0087】
以下、本実施の形態6にかかるコード長更新部60Aの動作を説明する。
前述の実施の形態2ないし4では、「すべて」または「大多数」の動きベクトルに着目したので動きベクトルの数afrmvqが十分大きい値であったが、上述の実施の形態5のように、「すべて」または「大多数」の動きベクトルに着目しなくても、1フレームあたり削減される符号量ommvは、ommv≧(frcaq-frcap)を満足する可能性がある。
【0088】
そこで、上述の実施の形態5では、閾値THを符号量ommvに設定し、現在のフレームにおいてTH≧(frcaq-frcap)なる判定条件が満足された場合に、コード長psizeに更新する。これにより、「すべて」または「大多数」の動きベクトルに着目することなく、発生符号量の削減を可能とした。
【0089】
ところで、総符号量の増加分が動きベクトルの符号量の減少分を上回り、TH<(frcaq-frcap)が成り立つ場合もある。ただし、この閾値THは、符号量ommvまたはこの符号量ommvに重み付け係数wを乗じて重み付けした値(w×ommv)に設定される。そこで、本実施の形態6では、総符号量の増加分が動きベクトルの符号量の減少分を上回る場合、動き探索範囲がより広い範囲で許容されるならば、次のフレームではコード長を増やして指定する。
【0090】
具体的には、入力画像10を符号化したときに発生する符号量が後述の所定の閾値TS以下となる範囲内で、コード長指定部50が指定するコード長psizeを増やす方向に更新し、コード長psizeよりも多いコード長rsizeに更新する。これにより、結果として、発生符号量を低く抑えられ、動き探索可能範囲の中で符号化効率のよいコード長を指定することができる。
【0091】
ここで、前述の実施の形態1で述べたように、動きベクトルの探索範囲rangeは、range=(2M×R)であり、コード長rsizeの物理的な上限は整数Rのビット幅の制約を受けるが、所定の閾値TSを導入してコード長rsizeの上限を定める。すなわち、コード長rsizeの上限は、入力画像10を符号化したときに発生する符号量が所定の閾値TS以下となる範囲内で選ばれる。この閾値TSは、符号量を有効に抑えることができる範囲内で適切に設定され、上述の閾値THであってもよい。
【0092】
実施の形態7.
次に、図3を参照して、本発明の実施の形態7を説明する。
上述の実施の形態1ないし6では、コード長をコード更新部60により更新するように構成したが、図3に示す本実施の形態7にかかる動画像符号化装置は、図1に示す前述の実施の形態1の構成において、外部から指定されたコード長を入力するコード長入力部70をさらに備え、コード長更新部60は、所定の条件に従って、コード長更新部60が生成したコード長qsizeまたはコード長入力部70に入力されたコード長exsizeを選択して、コード長指定部50が指定するコード長qsizeを更新するように構成される。
【0093】
以下、本実施の形態7にかかる動画像符号化装置の動作を説明する。
コード長更新部60は、コード長入力部70に入力されたコード長exsizeおよびコード長更新部60が生成したコード長qsizeが、コード長指定部50が指定するコード長psizeより少ない値であって、いずれのコード長exsizeおよびqsizeを採択してもコード長psizeに基づいて符号化した場合より発生する符号量が少なくなる場合、後述の所定の条件に従っていずれかを採択する。
【0094】
また、逆に、コード長exsizeおよびコード長qsizeがコード長psizeより多い値ではあるが、いずれのコード長exsizeおよびコード長qsizeを採択してもコード長psizeに基づいて符号化した場合より発生する符号量が少なくなる場合にも同様に、所定の条件に従っていずれかを採択する。
【0095】
ここで、上述の所定の条件として、コード長更新部60が生成したコード長qsizeに基づいて符号化したときに発生する符号量と外部から指定されたコード長exsizeに基づいて符号化したときに発生する符号量とを比較し、符号化部100により入力画像を符号化したときに発生する符号量がより小さくなるコード長を選択することが設定される。
【0096】
また、上述の所定の条件として、外部からのコード長exsizeをコード長の上限とすることを設定してもよい。この所定の条件に従えば、実際にはコード長exsizeが与える探索範囲より広い範囲で動き探索ができる場合であっても、コード長qsizeがコード長exsizeを超えない場合にコード長qsizeが採択され、コード長qsizeがコード長exsizeを超える場合にコード長exsizeが採択される。
【0097】
さらに、上述の所定の条件として、コード長exsizeをコード長の下限とすることを設定してもよい。この所定の条件に従えば、たとえば符号化データを蓄積するバッファ36の容量上の制約により、少ないコード長で動きベクトルを符号化したい状況下において、通常の符号化を行う場合に次のフレームに対しコード長exsizeまたはコード長exsizeより多いコード長q-sizeに更新し、通常以外の符号化を行う場合に強制的に外部からのコード長exsizeを指定して更新することが可能となる。
上述のように、外部からコード長exsizeを導入することにより、符号化の方式に応じてコード長を使い分けることが可能となる。
【0098】
なお、本実施の形態7では、コード長更新部60が、コード長exsizeおよびコード長qsizeのいずれかを採択するものとしたが、これに限定されることなく、他の構成要素に割り付けてもよい。また、本実施の形態7では、実施の形態1の構成にコード長入力部70を付加した場合を例として説明したが、他の実施の形態2ないし6に対して適用してもよい。
【0099】
実施の形態8.
次に、図4を参照して、本発明の実施の形態8を説明する。
上述の実施の形態7では、外部からのコード長exsizeを選択して指定するように構成したが、本実施の形態8にかかる動画像符号化装置は、図3に示す実施の形態7の構成において、コード長更新部60に代えて、コード長更新部60Bを備える。
【0100】
このコード長更新部60Bは、画像ブロックに対して許容される動き探索範囲内で取り得る複数候補のコード長を生成し、上記複数候補のコード長を用いて動きベクトルを表現して入力画像10をそれぞれ符号化したときに発生する符号量を比較し、複数候補のコード長の中から上記符号量が最も小さくなるコード長を選択するように構成される。
【0101】
以下、本実施の形態8にかかる動画像符号化装置の動作を説明する。
上述の実施の形態7によれば、実際には、コード長指定部50が指定するコード長psizeより少ないコード長がよい符号化効率を与える場合もあり、逆に多いコード長がよい符号化効率を与える場合もある。そこで、本実施の形態8では、コード長指定部50が指定するコード長psizeよりも多いコード長と少ないコード長とを含む複数のコード長を準備して、最も少ない符号量を与えるコード長を選択する。
【0102】
すなわち、コード長更新部60Bは、図5に例示するように、現在のフレームで各画像ブロックに対して許容される動き探索範囲内で取り得る複数候補のコード長psize1ないしpsize4を生成して準備する。ここで、psize1は、最小コード長であり、現在符号化の対象とされているフレームでの最小の動き探索範囲を与える。また、psize4は、最大コード長であり、最大の動き探索範囲を与える。
【0103】
コード長更新部60Bは、コード長psize1ないしpsize4のそれぞれのコード長ごとに、歪み評価値46が最小となる各予測画像ブロックに基づいて符号化したときに符号化器33で発生する符号量を求めて積算する。1フレーム分の符号化が終わった時点で、各コード長ごとに符号化部33で発生した1フレーム分の符号量を得る。
【0104】
次に、各コード長ごとに符号化部33で発生した符号量とコード長psizeを変更することに伴う動きベクトルの符号量の増減分とを合わせた総符号量を求める。ここで、コード長exsizeに基づいて符号化したときに発生する総符号量が最小となる場合は、コード長exsizeを選択する。
【0105】
また、コード長exsizeに基づいて符号化したときに発生する総符号量が最小とならない場合は、コード長psize1ないしコード長psize4の中から、総符号量が最小となるコード長を選択する。コード長更新部60Bは、コード長指定部50が指定するコード長psizeを、選択されたコード長に更新する。
【0106】
なお、本実施の形態8では、複数候補のコード長の生成から選択まで、コード長更新部60Bが担うものとしたが、これに限定されることなく、他の構成要素に割り付けてもよく、本発明の本質を限定するものではない。また、図5では、複数候補のコード長として、4種類のコード長を例示したが、4種類に限定されることなく、必要に応じて複数候補のコード長を定めればよい。
【0107】
実施の形態9.
次に、図3を援用して、本発明の実施の形態9を説明する。
前述の実施の形態7では、所定の条件に従って外部から指定されたコード長を選択するように構成したが、本実施の形態9にかかる動画像符号化装置のコード長更新部60は、コード長入力部70に外部から入力されたコード長exsizeを用いて動きベクトルを表現して得られる符号量と、コード長更新部60が生成したコード長qsizeを用いて上記動きベクトルを表現して得られる符号量とをそれぞれ重み付けして比較し、該比較の結果に基づきコード長を選択するように構成される。
【0108】
以下、本実施の形態9にかかる動画像符号化装置の動作を説明する。
前述の実施の形態7では、たとえば、最小となる総符号量を与えるコード長がコード長exsizeであったとき、内部で更新(指定)されるコード長qsize(psize)の値もコード長exsizeと同じ値となる。しかし、この場合、符号化部100に対して、外部より指定されたコード長exsizeが優先的に選択されて指定されたわけではなく、最小の総符号量を与えるコード長qsize(psize)の値が、コード長exsizeの値に等しくなっているだけである。
【0109】
そこで、本実施の形態9にかかる動画像符号化装置のコード長更新部60は、内部で発生したコード長qsize(psize)に基づいて符号化したときに発生する符号量を重み付けした重み付け符号量と、外部から指定されたコード長exsizeに基づいて符号化したときに発生する符号量を重み付けして比較し、より小さい重み付け符号量を与えるコード長qsize(psize)またはコード長exsizeを選択する。
【0110】
このように、各コード長に基づいて符号化したときに発生する符号量を重み付けして比較することにより、符号量(重み付けされていない符号量)が最小となるか否かによらず、外部より指定されたコード長exsizeを優先させて選択することが可能となる。
【0111】
なお、本実施の形態9では、コード長更新部60が、符号量を重み付けして比較し、コード長を選択するものとしたが、これに限定されることなく、他の構成要素に割り付けてもよく、本発明の本質を限定するものではない。
【0112】
実施の形態10.
次に、本発明の実施の形態10を説明する。
上述の実施の形態1ないし9では、「所定の画像ユニット」を「1フレーム」としたが、本実施の形態10にかかる動画像符号化装置は、図1に示す前述の実施の形態1の構成において、上記所定の画像ユニットは2以上のフレームから構成され、上記画像ユニットを構成するフレーム数が可変なように構成される。
【0113】
たとえば、現在のフレームで発生した動きベクトルの大きさに応じて「所定の画像ユニット」を構成するフレーム数を可変設定するものとした場合、画像の動きの大きさに応じて、コード長の指定(更新)に関する動作を簡略化することができる。
【0114】
具体的には、現在のフレームでの動きベクトルの大きさから、次の数フレームでも同様の大きさを有する動きベクトルが発生すると予測される場合、コード長指定部50は、コード長更新部60によるコード長の更新を拒否して、現在のフレームに対して指定したコード長を数フレームにわたって維持する。これにより、コード長の更新回数が減少し、更新動作が簡略化される。
【0115】
なお、実施の形態10では、実施の形態1の構成においてフレーム数を可変としたが、他の実施の形態2ないし9に対して適用してもよい。
また、上述した実施の形態1ないし10では、フレームを単位として画像ユニットを定義したが、1フレームの一部分を画像ユニットとして定義してもよく、必要に応じて画像ユニットの大きさを定義すればよい。さらに、画像ユニットをいくつかに分割して画像ブロックを定義したが、画像ブロックの大きさは、画像ユニットの大きさを超えなければよく、特に限定されない。
【0116】
【発明の効果】
以上の説明から明らかなように、本発明によれば以下のような効果を得ることができる。
すなわち、本発明によれば、入力画像を所定の画像ブロックに分割し、上記入力画像とあらかじめ符号化された予測画像とから上記画像ブロックごとに動きベクトルを発生して上記動きベクトルに基づき上記予測画像の動きを補償する動き補償手段を有し、上記動き補償手段により動き補償して上記入力画像を符号化すると共に、指定されたコード長で上記動きベクトルを符号化する符号化手段と、上記画像ブロックからなる所定の画像ユニットを単位として、上記動き補償手段で発生した上記動きベクトルを符号化するため、および上記動き補償手段による次のフレームに対する入力画像の動きベクトルの探索範囲を定めるために、上記符号化手段に対し上記動きベクトルのコード長を指定するコード長指定手段と、上記符号化手段が次の画像ユニットに対する上記入力画像を符号化するに際し、上記動き補償手段が現在の画像ユニットで発生した動きベクトルの大きさに基づき、上記動きベクトルの大きさに応じた動きベクトルの探索範囲を表現するのに足りる最小のコード長を算出し、算出した上記最小のコード長に基づいて上記コード長指定手段が指定するコード長を更新するコード長更新手段とを備えたので、動きベクトルの大きさに応じて符号量を低減させ、符号化効率を改善することができる。
【0117】
また、上記コード長更新手段は、上記現在の画像ユニットで発生したすべての動きベクトルの大きさが、上記現在の画像ユニットに対して上記コード長指定手段が指定するコード長より少ないコード長を用いて表現される場合、上記コード長指定手段が指定するコード長を、上記すべての動きベクトルの大きさを表現するのに足りる最小のコード長に更新するので、次の画像ユニット全体での符号量を低く抑えることができる。
【0118】
さらに、上記コード長更新手段は、上記現在の画像ユニットで発生した動きベクトルの大多数となる所定の割合の動きベクトルの大きさが、上記現在の画像ユニットに対して上記コード長指定手段が指定するコード長より少ないコード長を用いて表現される場合、上記コード長指定手段が指定するコード長を、上記動きベクトルの大多数となる所定の割合の動きベクトルの大きさを表現するのに足りる最小のコード長に更新するので、次の画像ユニット全体での符号量を実質的に低く抑えることができる。
【0119】
さらにまた、上記コード長更新手段は、上記コード長指定手段が指定するコード長を用いて上記現在の画像ユニットで発生した動きベクトルの大きさを表現して上記入力画像を符号化したときに発生する第1の符号量と、上記動きベクトルの大きさを表現するのに足りる最小のコード長を用いて上記現在の画像ユニットで発生した動きベクトルを表現して上記入力画像を符号化したときに発生する第2の符号量とを求め、上記第1の符号量に対する上記第2の符号量の増分が所定の閾値以下となる場合に上記コード長指定手段が指定するコード長を更新するので、次の画像ユニット全体での符号量を有効に低く抑えることができる。
【0120】
さらにまた、上記コード長更新手段は、上記コード長指定手段が指定するコード長を用いて上記現在の画像ユニットで発生した動きベクトルの大きさを表現して上記入力画像を符号化したときに発生する第1の符号量と、上記コード長指定手段が指定するコード長よりも少ないコード長を用いて上記現在の画像ユニットで発生した動きベクトルを表現して上記入力画像を符号化したときに発生する第2の符号量とを求め、上記第1の符号量に対する上記第2の符号量の増分が所定の閾値以下となる場合に上記コード長指定手段が指定するコード長を上記コード長指定手段が指定するコード長よりも少ないコード長に更新するので、次の画像ユニット全体での符号量を低く抑えることができる。
【0121】
さらにまた、上記コード長更新手段は、上記第1の符号量に対する上記第2の符号量の増分が所定の閾値を超える場合、上記符号化手段により上記入力画像を符号化したときに発生する符号量が上記所定の閾値以下となる範囲内で、上記コード長指定手段が指定するコード長を増やす方向に更新するので、動き探索可能範囲内で符号化効率が良くなるように、次の画像ユニット全体での符号量を有効に低く抑えることができる。
【0122】
さらにまた、外部から指定されたコード長を入力するコード長入力手段をさらに備え、上記コード長更新手段は、上記コード長更新手段が生成したコード長に基づいて符号化したときに発生する符号量と、上記コード長入力手段に入力されたコード長に基づいて符号化したときに発生する符号量との比較に基づいて、上記コード長更新手段が生成したコード長または上記コード長入力手段に入力されたコード長を選択して、上記コード長指定手段が指定するコード長を更新するので、所定の条件の下で符号化効率が改善されるように、次の画像ユニット全体での符号量を有効に低く抑えることができる。
【0123】
さらにまた、上記コード長更新手段は、上記画像ブロックに対して許容される動き探索範囲内で取り得る複数候補のコード長を生成し、上記複数候補のコード長を用いて上記動きベクトルを表現して上記入力画像をそれぞれ符号化したときに発生する符号量を比較し、上記複数候補のコード長の中から上記符号量が最も小さくなるコード長を選択するので、現在のフレームで許容される探索範囲の中で符号化効率が良くなるように、次の画像ユニット全体での符号量を有効に低く抑えることができる。
【0124】
さらにまた、上記コード長更新手段は、上記コード長入力手段に入力されたコード長を用いて上記動きベクトルを表現して得られる符号量と、上記コード長更新手段が生成したコード長を用いて上記動きベクトルを表現して得られる符号量とをそれぞれ重み付けして比較し、該比較の結果に基づきコード長を選択するので、コード長更新手段によるコード長の更新に優先させて、コード長入力手段を介して外部から指定されたコード長を指定することができる。
【0125】
さらにまた、上記画像ユニットは2以上のフレームからなり、上記画像ユニットをなすフレーム数を可変としたので、画像の変化の大きさに応じて、次の画像ユニット全体での符号量を低く抑えることができる。
【図面の簡単な説明】
【図1】本発明の実施形態1に係る動画像符号化装置の構成を示すブロック図である。
【図2】本発明の実施形態4に係る動画像符号化装置の構成を示すブロック図である。
【図3】本発明の実施形態7に係る動画像符号化装置の構成を示すブロック図である。
【図4】本発明の実施形態8に係る動画像符号化装置の構成を示すブロック図である。
【図5】本発明の実施形態8に係る動画像符号化装置のコード長更新部が生成するコード長と動き探索範囲との関係を説明するための図である。
【図6】従来技術に係る動画像圧縮装置のブロック図である。
【図7】従来技術に係る動画像圧縮装置の動作の流れを示すフローチャートである。
【図8】従来技術に係る動画像圧縮装置が内部で生成する係数を表す図である。
【符号の説明】
10 入力画像、10A 予測画像、31 画像メモリ、32 差分演算器、33 符号化器、35 可変符号化器、36 バッファ、38 復号器、40 加算器、44 動き補償予測部、50 コード長指定部、60,60A,60Bコード長更新部、70 コード長入力部、90 符号化データ、100 符号化部。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a moving image encoding apparatus that encodes a moving image with motion compensation.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, there has been known a moving image coding technique that reduces the code amount (information amount) of a moving image by performing motion compensation on the moving image and predictive coding.
For example, in Japanese Patent Laid-Open No. 6-105299, when one frame of an input image composed of moving images is divided into predetermined image blocks and a plurality of candidate motion vectors are prepared for each image block, inter-frame prediction is performed. A moving picture compression apparatus that selects a motion vector that improves the coding efficiency most is disclosed.
[0003]
Specifically, the configuration is shown in FIG.
In the figure, 430 is a controller, 431 is an image memory, 432 is a subtractor, 433 is a DCT (Discrete Cosine Transform) calculation unit, 434 is a quantization unit, 435 is a variable length coding unit (VLC), 436 is a buffer, 438 is an inverse quantization unit, 439 is an inverse DCT operation unit (IDCT), 440 is an adder, 441 to 443 are switches, and 444 and 445 are predictors. In addition, the above-described inverse quantization unit 438, inverse DCT operation unit 439, adder 440, switches 441 to 443, and predictors 444 and 445 constitute a motion compensation inter-frame prediction unit (no code).
[0004]
Hereinafter, four types of operations (first to fourth operations) of the moving image compression apparatus illustrated in FIG. 6 will be described with reference to the flowchart illustrated in FIG.
In the description of each of the first to fourth operations, the steps of the flowchart shown in FIG. 7 are cited, but the steps not cited in the description of each operation are deleted from the flowchart shown in FIG. 7 as far as the operations are concerned. Shall.
[0005]
First, the first operation of the moving image compression apparatus will be described.
A series of operations described below is performed under the control of the controller 430.
Image data from the outside is stored in the image memory 431. The subtractor 432 outputs a difference between the image data read from the image memory 431 and a predicted image from a predictor 444 or 445 described later. The DCT calculation unit 433 performs orthogonal transformation on the difference data from the subtractor 432 and converts it to the frequency axis. The quantization unit 434 and the variable length coding unit 435 quantize the data from the DCT calculation unit 433, respectively, variable-length code, and output to the outside through the buffer 436 as encoded data.
[0006]
Here, the motion compensation inter-frame prediction unit (no code) performs inter-frame prediction processing for compression in the time axis direction under the control of the controller 430. That is, the data from the quantization unit 434 is decoded by the inverse quantization unit 438 and the inverse DCT calculation unit 439 and added to the predicted image from the predictor 443 or 444. Based on the predicted image, a plurality of candidate motion vectors are detected and prepared for each predetermined image block (partial image) obtained by dividing one screen (step S1).
[0007]
Then, a motion vector that gives the best coding efficiency is determined from among a plurality of candidate motion vectors (step S5), and an already coded image (predicted image) is moved by the motion vector. Thus, motion compensation is performed and inter-frame prediction is performed.
Note that the switches 441 to 443 are switched by the controller 430 in accordance with the image mode and the prediction mode.
[0008]
Next, a second operation of the moving image compression apparatus will be described.
Inter-frame prediction is performed as in the first operation described above, and a plurality of candidate motion vectors are detected and prepared for each image block (step S1). A prediction error is detected for the detected motion vectors of a plurality of candidates, and an error coefficient for the minimum prediction error is calculated for this prediction error (step S2). Then, based on the calculated error coefficient, a motion vector that gives the best coding efficiency when actually coding is determined from among a plurality of candidate motion vectors (step S5).
[0009]
Next, a third operation of the moving image compression apparatus will be described.
When a prediction error of a plurality of candidate motion vectors is detected in the same manner as in the second operation described above (steps S1 to S2), the motion vector actually to be encoded with respect to the plurality of candidate motion vectors is detected. A value is calculated (step S3). Based on the calculated value of the motion vector, the code length when encoded is calculated as a vector encoding coefficient illustrated in FIG. 8 (step S4). Based on the coding coefficient, a motion vector that gives the best coding efficiency when actually coding is determined (step S5).
[0010]
Next, a fourth operation of the moving image compression apparatus will be described.
When a prediction error of a plurality of candidate motion vectors is detected in the same manner as in the third operation described above (steps S1 to S2), the code length when encoded based on the plurality of candidate motion vectors is the code length. It is calculated as a vector coding coefficient (step S4). Then, based on the coding coefficient, a motion vector that gives the best coding efficiency when actually coding is determined (step S5).
[0011]
[Problems to be solved by the invention]
By the way, the above-described moving image compression apparatus according to the prior art selects and encodes a motion vector that gives the best encoding efficiency from a plurality of candidate motion vectors detected in advance, The code length is set regardless of the size of the motion vector. For this reason, depending on the motion vector, the code length may be redundant, and there is a problem that the code amount cannot be reduced effectively.
[0012]
Specifically, according to the above-described prior art, a motion vector is determined based on the calculated coding coefficient. This coding coefficient is uniquely determined regardless of the magnitude of the motion vector, and the motion vector is determined as follows. The rules for encoding are fixed. Therefore, even in the case of a motion vector that gives the best coding efficiency, the code length is fixed and there is a case where the motion vector becomes redundant.
[0013]
The present invention has been made in view of such a problem, and provides a moving image encoding apparatus capable of reducing the amount of code according to the size of a motion vector and improving the encoding efficiency. Let it be an issue.
[0014]
[Means for Solving the Problems]
In order to achieve the above object, the present invention has the following configuration.
That is, the present invention divides an input image into predetermined image blocks, generates a motion vector for each image block from the input image and a predicted image encoded in advance, and generates the predicted image based on the motion vector. Encoding means for encoding the input image with motion compensation by the motion compensation means, encoding the motion vector with a designated code length, and the image block; In order to encode the motion vector generated by the motion compensation unit and to determine the search range of the motion vector of the input image for the next frame by the motion compensation unit in units of a predetermined image unit consisting of Code length designating means for designating the code length of the motion vector to the encoding means, and the encoding means for the next image unit. When the input image is encoded, it is sufficient for the motion compensation means to represent a motion vector search range corresponding to the size of the motion vector based on the size of the motion vector generated in the current image unit. Code length updating means for calculating the minimum code length and updating the code length designated by the code length designation means based on the calculated minimum code length The code length update means designates the size of a predetermined percentage of motion vectors, which is the majority of motion vectors generated in the current image unit, for the current image unit. When expressed using a code length smaller than the code length, the code length specified by the code length specifying means is a minimum that is sufficient to express the size of a predetermined percentage of motion vectors that is the majority of the motion vectors. Update to the code length of .
[0017]
Furthermore, the code length update unit of the present invention encodes the input image by expressing the magnitude of the motion vector generated in the current image unit using the code length designated by the code length designation unit. The input image is encoded by expressing the motion vector generated in the current image unit using the first code amount generated sometimes and the minimum code length sufficient to express the size of the motion vector. The code length designated by the code length designation means is updated when the increment of the second code amount with respect to the first code amount is equal to or less than a predetermined threshold. It has the composition to do.
[0018]
Furthermore, the code length update unit of the present invention encodes the input image by expressing the magnitude of the motion vector generated in the current image unit using the code length designated by the code length designation unit. The input image is encoded by expressing a motion vector generated in the current image unit using a first code amount that is sometimes generated and a code length smaller than the code length specified by the code length specifying means. A code length designated by the code length designation means when the increment of the second code quantity with respect to the first code quantity is equal to or less than a predetermined threshold. The code is updated to a code length smaller than the code length specified by the length specifying means.
[0019]
Still further, the code length updating means of the present invention may be configured such that when the increment of the second code amount with respect to the first code amount exceeds a predetermined threshold, the input image is encoded by the encoding means. The code length is updated in a direction to increase the code length designated by the code length designation means within a range where the generated code amount is not more than the predetermined threshold value.
[0020]
Furthermore, the present invention further comprises code length input means for inputting a code length designated from the outside, and the code length update means comprises: Comparison between the amount of code generated when encoded based on the code length generated by the code length update means and the amount of code generated when encoded based on the code length input to the code length input means On the basis of the The code length generated by the code length update means or the code length input to the code length input means is selected, and the code length designated by the code length designation means is updated.
[0021]
Furthermore, the code length update means of the present invention generates a plurality of candidate code lengths that can be taken within a motion search range allowed for the image block, and uses the plurality of candidate code lengths to generate the motion vector. And the amount of code generated when the input image is encoded respectively, and the code length with the smallest code amount is selected from the plurality of candidate code lengths.
[0022]
Furthermore, the code length update means of the present invention includes a code amount obtained by expressing the motion vector using the code length input to the code length input means, and a code length generated by the code length update means. And a code amount obtained by expressing the motion vector with each other and comparing the weights, and selecting a code length based on the comparison result.
[0023]
Furthermore, the present invention has a configuration in which the image unit is composed of two or more frames, and the number of frames forming the image unit is variable.
[0024]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
In addition, the same code | symbol is attached | subjected to the element which is common in each figure, and the overlapping description is abbreviate | omitted.
[0025]
Embodiment 1 FIG.
FIG. 1 shows a configuration of a moving image encoding apparatus according to the first embodiment of the present invention.
In the figure, 100 divides an input image 10 consisting of a moving image into predetermined image blocks, generates a motion vector for each image block from the input image 10 and a predicted image 10A encoded in advance, and moves the motion image. It has a motion compensation prediction unit 44 (motion compensation means) that compensates for the motion of the predicted image 10A based on the vector, encodes the input image 10 with motion compensation by the motion compensation unit 44, and with a specified code length An encoding unit (encoding means) that encodes the motion vector.
[0026]
Reference numeral 50 denotes a code length designating unit (code length designating unit) for designating the code length of a motion vector to the encoding unit 100 in units of a predetermined image unit made up of the image blocks. Reference numeral 60 denotes an encoding unit 100. When encoding an input image for an image unit to be encoded next, the motion compensation prediction unit 44 uses a code length designation unit based on the magnitude of a motion vector generated in the image unit to be encoded at present. Reference numeral 50 denotes a code length update unit (code length update means) for updating the code length designated.
[0027]
Further, 31 is an image memory for storing a pre-encoded image, 32 is a difference calculator for calculating the difference between the input image 10 and the predicted image 10A from the image memory 31, and 33 is from the difference calculator 32. Is a variable length encoder (VLC) that obtains encoded data by variable length encoding the data from the encoder 33, and 36 is a variable length encoder 35. Is a buffer for temporarily accumulating encoded data from, a decoding unit for locally decoding data from the encoder 33, and a predicted image 10 A from the image memory 31 and a decoder from the decoder 38. An adder that adds data.
[0028]
Next, the operation of the moving picture coding apparatus according to the first embodiment will be described by taking the case of performing interframe predictive coding as an example.
In the first embodiment, it is assumed that the above-described “image unit” is a “frame” and that each image block obtained by dividing each frame into several predetermined image blocks is encoded.
[0029]
First, from the image memory 31, image data at the same position as the image block of the input image 10 that is the current encoding target or image data specified by the motion vector generated by the motion compensation prediction unit 44 is used as the predicted image 10A. Read for each image block. The difference calculator 32 calculates a difference between the predicted image 10A from the image memory 31 and the input image 10 to obtain a distortion evaluation value 46 and difference data.
[0030]
Here, the motion compensation predicting unit 44 receives the input image 10 from the image memory 31 so that the distortion evaluation value 46 (for example, the sum of absolute differences in units of blocks) within the motion vector search range designated in advance is minimized. A motion vector is detected by extracting the image closest to or matching the image data as the predicted image 10a.
[0031]
Difference data from the difference calculator 32 when the distortion evaluation value 46 indicates the minimum is encoded by the encoder 33 and variable-length encoded by the variable-length encoder 35. At this time, the motion vector detected by the motion compensation prediction unit 44 is encoded with the code length designated by the code length designation unit 50 described later. The data variable-length encoded by the variable-length encoder 35 is temporarily stored in the buffer 36 and output as encoded data 90 to a transmission path (not shown) according to the transmission rate.
[0032]
The data encoded by the encoder 33 is locally decoded by the decoding unit 38, decoded and added by the adder 40 and the predicted image 10 </ b> A from the image memory 31, and written to the image memory 31. As a result, the image data in the image memory 31 is updated.
As described above, inter-frame predictive encoding is performed on the input image 10.
[0033]
In the process of the series of inter-frame predictive encoding operations described above, the code length specifying unit 50 moves with respect to the variable length encoder 35 constituting the encoding unit 100 in units of one frame (predetermined image unit). Specifies the code length of the vector. This code length may be a part or all of the encoded code of the motion vector. The code length designated by the code length designation unit 50 is also given to the motion compensation prediction unit 44, and the motion vector search range in the motion compensation prediction unit 44 is determined.
[0034]
Further, the code length update unit 60 specifies the code length based on the magnitude of the motion vector generated in the current frame by the motion compensation prediction unit 44 when the encoding unit 100 encodes the input image 10 for the next frame. The code length designated by the unit 50 is updated.
[0035]
Hereinafter, the operations of the code length specifying unit 50 and the code length updating unit 60 will be specifically described by taking as an example the case of specifying (updating) the code length of a part of the encoded code of the motion vector in the horizontal direction.
[0036]
First, the code length of a part of the encoded code of the motion vector is psize, and this code length psize is expressed by an integer R that can represent the search range of the motion vector. For example, as an example, the integer R is expressed by the following formula (1). However, in Expression (1), the symbol “<<” represents a bit shift operator.
[0037]
R = 1 << psize (1)
[0038]
In this case, the integer R is represented as a binary number obtained by bit-shifting “1” to the MSB (Most Significant Bit) side by psize [bit], and is expressed as a decimal number 2 psize Is equivalent to
[0039]
In this way, when the code length psize is expressed by an integer R, when the unit of motion compensation is an M × N pixel block (M and N are natural numbers), the number of horizontal pixels is “M”, and thus a motion vector that can be generated. The maximum value max and the minimum value min are represented by the following expression (2), and the range range of motion vectors that can be generated is represented by the following expression (3).
[0040]
max = (M × R) -1, min = {(-M) × R} (2)
[0041]
range = (2M × R) (3)
[0042]
Here, as an example, if psize = 3 and M = 8, R = 1 << 3 = 8, max = (8 × 8) -1 = 63, min = ( (-8) × 8) =-64, range = 128 is obtained.
[0043]
Next, with the integer value mccode satisfying −M ≦ mccode ≦ M and the integer value mcres represented by the code length of psize [bit] as parameters, the motion vector magnitude value MV is set to the integer value mccode and the integer value mcrec. Expressed in combination with.
[0044]
As an example, when the condition R = 1, mccode = 0 is satisfied, the magnitude MV of the motion vector is expressed by the following equation (4), and the above condition R = 1, mccode = 0 is not satisfied The value MV of the magnitude of the motion vector is expressed by the following equation (5).
However, in equation (5), abs (mccode) represents the absolute value of the integer value mccode, and mccode When <0, MV = -MV.
[0045]
MV = mccode (4)
[0046]
MV = [{abs (mccode) -1} × R] + mcres + 1 (5)
[0047]
In this way, when the motion vector magnitude value MV is expressed, the motion vector magnitude value MV divided by the integer R {abs (mccode) -1} and the remainder (mcres + 1) are adjusted. Numeric values mccode and mcres can be set.
[0048]
As an example, when “53” is expressed as the motion vector magnitude value MV, the quotient and remainder obtained by dividing “53” by M (= 8) are “6” and “5”, respectively. = 6 + 1 = 7, mcres = 5-1 = 4. When integer values mccode and mcres are set in this way, MV = ((abs (7) -1) × 8) + 4 + 1 = 53 is obtained from the above equation (5).
[0049]
As another example, when “40” is expressed as the motion vector magnitude value MV, the quotient and remainder obtained by dividing “40” by M (= 8) are “5” and “0”, respectively. In this case, the remainder is “0” and psize [bit] giving the code length of mcres is also “0”, and the size of the motion vector cannot be expressed.
[0050]
Therefore, in this case, a part of the quotient is converted too much so that the quotient and the remainder are “4” and “8”, respectively, and mccode = 5 and mcres = 7 (“111” in binary notation). When the integer values mccode and mcres are set in this way, MV = ((abs (5) -1) × 8) + 7 + 1 = 40 is obtained from the above equation (5).
From the above example, it can be seen that the value MV of the magnitude of the motion vector is expressed using the integer values mccode and mcres as parameters.
[0051]
If the motion vector magnitude value MV is nearer to “0”, the higher the probability of occurrence, the better the coding efficiency when the integer value mccode is represented by a variable length code.
In addition, if the integer value mcres is represented by a variable-length code, the code length of the motion vector of the value before and after a multiple of the integer R is reversed. Therefore, it is more efficient to express the integer value mcres by a fixed-length code. Get better.
[0052]
By expressing the magnitude MV of the motion vector using the above formulas (4) and (5), the motion vector search range is determined in units of the integer R derived from the code length psize, and the integer value mcres is used. The gap of the search range that cannot be expressed by the integer R is filled. Therefore, the magnitude MV of the motion vector is expressed by the integer values mccode and mcres, and the code length psize can be determined based on the magnitude of the motion vector.
[0053]
Here, the description returns to FIG. 1 again.
As described above, the code length specifying unit 50 specifies the code length psize determined based on the size of the motion vector to the encoding unit 100. This code length psize affects the code length of the motion vector generated in the current frame. If the code length psize of the motion vector is large, the motion vector search range (vector distribution range) is widened. Become.
[0054]
On the other hand, the code length update unit 60 determines the code amount of the motion vector in the entire next frame based on the size of the motion vector generated in the current frame under the influence of the code length psize designated by the code length designation means 50. The code length psize designated by the code length designation unit 50 is updated so as to decrease.
As described above, the code length of the motion vector is updated based on the magnitude of the motion vector generated in the current frame, and the code amount in the next frame is reduced.
[0055]
In the first embodiment described above, the value MV is the magnitude of the motion vector. However, as the “distribution” of the magnitude of the motion vector generated in the current frame and the “difference” with the motion vector encoded in advance. It does not limit the content of the present invention.
[0056]
In addition, the magnitude of the motion vector is expressed using the integer values mccode and mcres as parameters, but the code length of a part or all of the encoded code of the motion vector is not limited to this expression method. It may be expressed so as to change according to the code length psize specified by the unit 50. Furthermore, although the difference absolute value sum is used as the distortion evaluation value 46, for example, a difference square sum may be used.
[0057]
Furthermore, in the first embodiment, inter-frame predictive encoding is performed. However, for example, it may be configured to operate as a typical moving image encoding apparatus like intra-frame encoding. In this case, the input image 10 may be configured to be directly encoded by the encoder 33 depending on conditions.
[0058]
Embodiment 2. FIG.
Next, Embodiment 2 of the present invention will be described with reference to FIG.
In the second embodiment, the code length update unit 50 (code length update means) specifies the code length for all the motion vectors generated in the current frame (current image unit) for the current frame. When the code length psize specified by the code length specifying unit 50 is expressed using a code length less than the code length psize specified by the unit 50, the code length psize specified by the code length specifying unit 50 is the minimum code sufficient to express the sizes of all the motion vectors. Configured to update to long qsize.
[0059]
For example, if psize = 3 and M = 8 in the current frame, all motion vectors in the current frame that satisfy -32 ≦ vector ≦ 32 satisfy all motions. The minimum code length required to express the vector size is “2”, and all motion vectors can be expressed even with psize = 2.
[0060]
This is because, when psize = 2, the maximum value max of the motion vector is “31” and the minimum value min of the size of the motion vector is “−32” from the above equations (1) and (2). . Therefore, the code length update unit 60 sets the code length qsize to “2” and updates the code length psize specified by the code length specifying unit 50 to the code length qsize.
[0061]
In this case, since the integer value mcres can be expressed by 2 bits, the code length per motion vector is reduced by 1 bit. Therefore, if the code length psize is set to “2” and the motion vector of the current frame is re-encoded, the amount of codes generated in the current frame can be reduced.
[0062]
However, in practice, there is no time for re-encoding in the current frame due to the limitation of the processing speed of the apparatus. Even if there is a time margin, re-encoding in the current frame is difficult in an environment where it is not possible to secure a buffer capacity sufficient to store encoded motion vectors for one frame. It becomes. Therefore, the code length update unit 60 updates the code length psize to “2” (qsize) in the next frame and encodes it.
[0063]
Here, in general, in a moving image, the motion of adjacent image frames tends to be similar when there is no sudden change in motion, and a motion vector similar to the motion vector in the current frame also exists in the next frame. Expected to be required. Therefore, even if the code length psize is updated to “2” (qsize) and encoded in the next frame, the amount of codes generated in the next frame can be effectively reduced.
[0064]
It has a processing speed sufficient for re-encoding, has a buffer capacity sufficient to store motion vectors encoded in units of frames, and encoded data output from the buffer to the transmission path is interrupted. If the specified transmission rate can be maintained without any change, the code length may be updated and re-encoded in the current frame. In this case, the amount of codes can be kept lower than when the code length is updated in the next frame.
[0065]
Embodiment 3 FIG.
Next, Embodiment 3 of the present invention will be described with reference to FIG.
In the second embodiment, the code length is updated when the “all” motion vectors generated in the current frame can be expressed using the code length qsize. However, in the third embodiment, the code length update unit is updated. 50, the size of a predetermined percentage of motion vectors, which is the “majority” of motion vectors generated in the current frame, is smaller than the code length psize specified by the code length specification unit 50 for the current image unit. When the code length is expressed using the code length, the code length psize specified by the code length specifying unit 50 is updated to the minimum code length qsize sufficient to express the size of a predetermined percentage of the motion vectors. Configured to do.
[0066]
Hereinafter, the validity of updating the code length will be described by paying attention to the above-mentioned “majority” of motion vectors of a predetermined ratio.
If the motion trends of adjacent moving images are similar, if the motion vector of “all” in the current frame can be expressed based on the code length qsize, the majority of motion vectors in the next frame will be based on the code length qsize. It is predicted that it can be expressed. Therefore, if the code length qsize is specified in the next frame, the generated code amount can be reduced with a very high probability. In the second embodiment described above, the code length is updated from this viewpoint.
[0067]
However, even if the “all” motion vector can be expressed based on the code length qsize in the current frame, the “all” motion vector can be expressed based on the code length qsize in the next frame. Is not limited. In addition, when the “most” motion vector can be expressed based on the code length qsize in the current frame, the “all” motion vector can be expressed based on the code length qsize in the next frame. Sometimes.
[0068]
That is, if it can be predicted that the “majority” motion vector can be expressed based on the code length qsize in the next frame, it is not always necessary to focus on “all” motion vectors generated in the current frame. It is sufficient to focus on a predetermined percentage of motion vectors that are “majority”. In the third embodiment, from this point of view, the code length update unit 60 updates the code length by paying attention to a predetermined percentage of motion vectors that are “majority” in the current frame.
[0069]
Embodiment 4 FIG.
Next, a fourth embodiment of the present invention will be described with reference to FIG.
In Embodiments 2 and 3 described above, when the “all” and “most” motion vectors are vectors that can be expressed based on the code length qsize, the code length psize is updated to the code length qsize. In the fourth embodiment, a condition is further added, and the code length is updated when the increment of the code amount is equal to or less than a predetermined threshold.
[0070]
That is, the moving picture encoding apparatus according to the fourth embodiment includes a code length update unit 60A instead of the code length update unit 60 in the configuration of the second or third embodiment shown in FIG.
[0071]
The code length update unit 60A generates a first motion vector when the input image 10 is encoded by expressing the size of the motion vector generated in the current frame using the code length psize designated by the code length designation unit 50. When the input image 10 is encoded by expressing the motion vector generated in the current frame using the minimum code length qsize sufficient to express the size of the current vector and the size of the motion vector in the current frame. The code length psize specified by the code length specifying unit 50 when the increment of the second code amount with respect to the first code amount is equal to or less than a predetermined threshold TH is obtained as the code length qsize. Configured to update.
[0072]
The operation (code length update method) of the code length update unit 60A according to the fourth embodiment will be specifically described below.
Comparing the amount of code of the motion vector generated when encoded based on the code length psize and when encoded based on the code length qsize, it is better to encode based on the smaller code length qsize of the motion vector itself. The code amount is smaller. However, whether or not the total code amount is reduced needs to be determined in consideration of the code amount of the difference data generated by the encoder 33.
[0073]
Hereinafter, a method for updating the code length when the code amount of the difference data generated in the encoder 33 is considered will be specifically described.
The motion vector mvp having the smallest distortion evaluation value 46 in the current frame can be encoded based on the code length psize, but if it cannot be encoded based on the code length qsize, the motion vector mvp cannot be adopted. Therefore, in this case, encoding is performed by performing motion compensation using the motion vector mvq having the smallest distortion evaluation value 46 within the motion search range based on the code length qsize.
[0074]
Here, when coding is performed by motion compensation using the motion vector mvp, the coding amount per frame is frcap (first coding amount), and the motion compensation is performed using the motion vector mvq. If the code amount per frame is frcaq (second code amount), the code amount that is increased by updating to the code length qsize in the encoding unit 33 is (frcaq-frcap). When the number of motion vectors encoded in the current frame is sufficiently large and the code amount increment (frcaq-frcap) is sufficiently small, if the code length qsize is specified in the next frame, the motion vector generated in the next frame The code amount itself is reduced.
[0075]
However, if the code amount ommv of the motion vector reduced by updating to the code length qsize is smaller than the code amount (frcaq-frcap) that increases by updating to the code length qsize, the code length in the next frame If qsize is specified, the total code amount increases and the coding efficiency deteriorates. Therefore, the code length updating unit 60A evaluates not only the code amount ommv that can be reduced but also the increasing code amount (frcaq-frcap) as follows, and determines whether or not to specify the code length qsize.
[0076]
If the number of motion vectors encoded per frame is afrmv and the number of motion vectors that can be expressed based on the code length qsize is afrmvq, one frame is obtained by updating the code length psize to the code length qsize. The code amount ommv reduced per unit is ommv = (psize−qsize) × afrmvq [bit].
[0077]
On the other hand, the code amount (frcaq-frcap) increased per frame by updating the code length psize to the code length qsize is frcaq-frcap = (bcaq-bcap) × (afrmv-afrmvq) [bit]. Here, bcaq is a code amount per one encoded block (image block) when motion compensation is performed using the motion vector mvq, and bcap is a code obtained by performing motion compensation using the motion vector mvp. This is the amount of code per one encoded block when it is converted.
[0078]
The code length update unit 50 determines the amount of code (frcaq-frcap) that increases per frame by comparing it with the threshold value TH, and when the determination condition TH ≧ (frcaq-frcap) is satisfied in the current frame, In this frame, the code length is updated to qsize. This threshold value TH is set to the code amount ommv reduced per frame. Here, in order to set a margin in consideration of changes in motion vector generation characteristics between the current frame and the next frame, a value weighted to the value of the code amount ommv (w × ommv: w = 0.7, for example) May be set as the threshold value TH.
[0079]
As an example, when there is a characteristic in which the range of the magnitude of the motion vector gradually decreases or increases on the contrary over a plurality of consecutive frames, the same characteristic is expected in the next frame. However, if the motion of the subject changes suddenly and the generation characteristics of the motion vector change, this expectation may be lost and the prediction of the total generated code amount may be greatly deviated. Therefore, when considering the possibility that the generated code amount is unpredictable due to the change in the motion vector generation characteristic, the weighting coefficient w is set to a large value (a small number close to 1).
[0080]
Embodiment 5 FIG.
Next, Embodiment 5 of the present invention will be described with reference to FIG.
In the above-described second to fourth embodiments, the code length is updated by paying attention to the size of the “all” or “majority” motion vector generated in the current frame. Then, the code length in the next frame is designated (updated) by focusing on the code amount generated in the current frame, without being limited to “all” or “majority” motion vectors.
[0081]
That is, the code length update unit 60 according to the fifth embodiment shown in FIG. 1 to be used expresses the size of the motion vector generated in the current frame using the code length psize designated by the code length designation unit 50. The motion vector generated in the current frame is expressed using the first code amount generated when the input image 10 is encoded and the code length qsize smaller than the code length psize specified by the code length specifying unit 50. The code length designation unit 50 obtains the second code amount generated when the input image 10 is encoded and the increment of the second code amount with respect to the first code amount is equal to or less than a predetermined threshold value TH. The designated code length psize is updated to a code length qsize smaller than the code length psize.
[0082]
The operation of the code length update unit 60 according to the fifth embodiment will be described below.
As described in the fourth embodiment, the code amount ommv reduced per frame by updating the code length psize to the code length qsize is ommv = (psize-qsize) × afrmvq [bit], The increasing code amount (frcaq-frcap) is frcaq-frcap = (bcaq-bcap) × (afrmv-afrmvq) [bit].
[0083]
Therefore, if `` all '' or `` most '' motion vectors can be represented by code length qsize in the current frame, the number of motion vectors afrmvq that can be represented based on code length qsize is sufficiently large, and ommv >> (frcaq-frcap)
[0084]
However, if the code amount ommv does not exceed the code amount (frcaq-frcap), the encoding efficiency is improved, so the number of motion vectors afrmvq does not necessarily have to be a sufficiently large value. That is, as long as the condition ommv ≧ (frcaq−frcap) is satisfied, the code amount in the next frame can be reduced by designating the code length qsize based on the code amounts frcap and frcaq.
[0085]
Embodiment 6 FIG.
Next, Embodiment 6 of the present invention will be described with reference to FIG.
In the fifth embodiment described above, the code length designated by the code length designation unit 50 is updated based on the code amount in the current frame. However, the code length update unit 60A according to the sixth embodiment When the increment of the second code amount with respect to the first code amount exceeds a predetermined threshold value TH, the code amount generated when the input image 10 is encoded by the encoding unit 100 is within a range where the code amount is equal to or less than the predetermined threshold value. The code length specifying unit 50 is configured to update the code length psize specified by the code length specifying unit 50.
[0086]
Here, as described above, the first code amount encodes the input image 10 by expressing the size of the motion vector generated in the current frame using the code length psize designated by the code length designation unit 50. The second code amount is input by expressing the motion vector generated in the current frame using the code length qsize smaller than the code length psize specified by the code length specifying unit 50. This is the amount of code generated when the image 10 is encoded.
[0087]
The operation of the code length update unit 60A according to the sixth embodiment will be described below.
In the above-described second to fourth embodiments, since “all” or “majority” motion vectors are focused on, the number of motion vectors afrmvq is a sufficiently large value. However, as in the above-described fifth embodiment, “ The code amount ommv reduced per frame may satisfy ommv ≧ (frcaq-frcap) without paying attention to “all” or “most” motion vectors.
[0088]
Therefore, in the above-described fifth embodiment, the threshold value TH is set to the code amount ommv, and the code length is updated to the code length psize when the determination condition TH ≧ (frcaq-frcap) is satisfied in the current frame. As a result, the generated code amount can be reduced without paying attention to “all” or “most” motion vectors.
[0089]
By the way, the increase in the total code amount exceeds the decrease in the code amount of the motion vector, and TH <(frcaq-frcap) may hold. However, the threshold value TH is set to a code amount ommv or a value (w × ommv) obtained by multiplying the code amount ommv by a weighting coefficient w. Therefore, in the sixth embodiment, when the increase in the total code amount exceeds the decrease in the code amount of the motion vector, if the motion search range is allowed in a wider range, the code length is increased in the next frame. Specify.
[0090]
Specifically, the code amount generated when the input image 10 is encoded is updated in a direction in which the code length psize specified by the code length specifying unit 50 is increased within a range where the code amount is equal to or less than a predetermined threshold value TS described later. Update to a code length rsize greater than the code length psize. As a result, the amount of generated codes can be kept low, and a code length with good coding efficiency can be specified within the motion searchable range.
[0091]
Here, as described in the first embodiment, the motion vector search range range is range = (2M × R), and the physical upper limit of the code length rsize is limited by the bit width of the integer R. However, the upper limit of the code length rsize is determined by introducing a predetermined threshold TS. That is, the upper limit of the code length rsize is selected within a range in which the amount of code generated when the input image 10 is encoded is equal to or less than the predetermined threshold value TS. This threshold value TS is appropriately set within a range in which the code amount can be effectively suppressed, and may be the above-described threshold value TH.
[0092]
Embodiment 7 FIG.
Next, a seventh embodiment of the present invention will be described with reference to FIG.
In the first to sixth embodiments described above, the code length is updated by the code update unit 60. However, the moving picture encoding apparatus according to the seventh embodiment shown in FIG. The configuration of the first embodiment further includes a code length input unit 70 for inputting a code length designated from the outside, and the code length update unit 60 generates a code length qsize generated by the code length update unit 60 according to a predetermined condition. Alternatively, the code length exsize input to the code length input unit 70 is selected, and the code length qsize designated by the code length designation unit 50 is updated.
[0093]
Hereinafter, the operation of the video encoding apparatus according to the seventh embodiment will be described.
In the code length update unit 60, the code length exsize input to the code length input unit 70 and the code length qsize generated by the code length update unit 60 are smaller than the code length psize specified by the code length specifying unit 50. If any code length exsize and qsize is adopted and the amount of code generated is smaller than when encoding is performed based on the code length psize, either one is adopted according to a predetermined condition described later.
[0094]
Conversely, although the code length exsize and the code length qsize are larger than the code length psize, any code length exsize and code length qsize is used, but it occurs when encoding is performed based on the code length psize. Similarly, when the code amount decreases, either one is adopted according to a predetermined condition.
[0095]
Here, as the predetermined condition described above, when encoding is performed based on the code amount generated when encoding is performed based on the code length qsize generated by the code length update unit 60 and the code length exsize specified from the outside. It is set to select a code length that is smaller than the generated code amount by comparing the generated code amount and encoding the input image by the encoding unit 100.
[0096]
Further, as the predetermined condition described above, it may be set that the code length exsize from the outside is set as the upper limit of the code length. If the code length qsize does not exceed the code length exsize, the code length qsize is adopted even if motion search can be performed in a range wider than the search range given by the code length exsize, according to this predetermined condition. The code length exsize is adopted when the code length qsize exceeds the code length exsize.
[0097]
Furthermore, as the predetermined condition described above, the code length exsize may be set as the lower limit of the code length. If this predetermined condition is followed, for example, when the normal encoding is performed in a situation where it is desired to encode the motion vector with a small code length due to the capacity limitation of the buffer 36 for storing the encoded data, the next frame is displayed. On the other hand, when the code length exsize or the code length q-size larger than the code length exsize is updated and encoding other than normal is performed, the code length exsize can be forcibly specified and updated.
As described above, by introducing the code length exsize from the outside, it is possible to selectively use the code length according to the encoding method.
[0098]
In the seventh embodiment, the code length update unit 60 adopts either the code length exsize or the code length qsize. However, the present invention is not limited to this, and the code length update unit 60 may be assigned to other components. Good. In the seventh embodiment, the case where the code length input unit 70 is added to the configuration of the first embodiment has been described as an example. However, the present invention may be applied to other second to sixth embodiments.
[0099]
Embodiment 8 FIG.
Next, an eighth embodiment of the present invention will be described with reference to FIG.
In the seventh embodiment described above, the code length exsize from the outside is selected and specified. However, the moving picture coding apparatus according to the eighth embodiment has the configuration of the seventh embodiment shown in FIG. The code length update unit 60B is replaced with a code length update unit 60B.
[0100]
The code length update unit 60B generates code lengths of a plurality of candidates that can be taken within the motion search range allowed for the image block, expresses a motion vector using the code lengths of the plurality of candidates, and represents the input image 10 Are compared, and the code length that minimizes the code amount is selected from among a plurality of candidate code lengths.
[0101]
Hereinafter, the operation of the moving picture coding apparatus according to the eighth embodiment will be described.
According to the above-described seventh embodiment, in practice, a code length smaller than the code length psize designated by the code length designation unit 50 may give good coding efficiency. Conversely, a large code length may give good coding efficiency. May give. Therefore, in the eighth embodiment, a plurality of code lengths including a code length larger than a code length psize designated by the code length designation unit 50 and a code length smaller than that are prepared, and the code length giving the smallest code amount is set. select.
[0102]
That is, as illustrated in FIG. 5, the code length update unit 60B generates and prepares a plurality of candidate code lengths psize1 to psize4 that can be taken within the motion search range allowed for each image block in the current frame. To do. Here, psize1 is the minimum code length and gives the minimum motion search range in the frame currently being encoded. Psize4 is the maximum code length and gives the maximum motion search range.
[0103]
The code length updating unit 60B calculates the code amount generated by the encoder 33 when encoding is performed based on each prediction image block having the minimum distortion evaluation value 46 for each code length of the code lengths psize1 to psize4. Find and accumulate. When the encoding for one frame is completed, the code amount for one frame generated by the encoding unit 33 is obtained for each code length.
[0104]
Next, a total code amount is obtained by combining the code amount generated by the encoding unit 33 for each code length and the increase / decrease in the code amount of the motion vector accompanying the change of the code length psize. Here, when the total code amount generated when encoding is performed based on the code length exsize, the code length exsize is selected.
[0105]
If the total code amount generated when encoding is performed based on the code length exsize is not minimized, the code length that minimizes the total code amount is selected from the code length psize1 to the code length psize4. The code length update unit 60B updates the code length psize designated by the code length designation unit 50 to the selected code length.
[0106]
In the eighth embodiment, the code length update unit 60B is responsible for the generation and selection of a plurality of candidate code lengths. However, the present invention is not limited to this and may be assigned to other components. It is not intended to limit the essence of the present invention. In FIG. 5, four types of code lengths are exemplified as the code lengths of a plurality of candidates. However, the code lengths of a plurality of candidates may be determined as necessary without being limited to four types.
[0107]
Embodiment 9 FIG.
Next, Embodiment 9 of the present invention will be described with reference to FIG.
In the seventh embodiment described above, the code length designated from the outside is selected according to a predetermined condition. However, the code length update unit 60 of the moving picture coding apparatus according to the ninth embodiment uses the code length. It is obtained by expressing the motion vector using the code amount obtained by expressing the motion vector using the code length exsize input from the outside to the input unit 70 and the code length qsize generated by the code length update unit 60. The code amounts are respectively weighted and compared, and the code length is selected based on the comparison result.
[0108]
Hereinafter, the operation of the moving picture encoding apparatus according to the ninth embodiment will be described.
In the above-described seventh embodiment, for example, when the code length giving the minimum total code amount is the code length exsize, the value of the code length qsize (psize) updated (designated) internally is also the code length exsize. It becomes the same value. However, in this case, the code length exsize designated externally is not preferentially selected and designated for the encoding unit 100, but the value of the code length qsize (psize) that gives the minimum total code amount is determined. Is just equal to the value of the code length exsize.
[0109]
Therefore, the code length update unit 60 of the moving picture encoding apparatus according to the ninth embodiment weights the code amount generated when encoding is performed based on the internally generated code length qsize (psize). The code amount generated when encoding is performed based on the code length exsize designated from the outside, and the code length qsize (psize) or the code length exsize giving a smaller weighted code amount is selected.
[0110]
In this way, by comparing the code amount generated when encoding based on each code length by weighting and comparing the code amount (unweighted code amount), whether or not it is minimized, the external It becomes possible to select the code length exsize that is specified more preferentially.
[0111]
In the ninth embodiment, the code length update unit 60 weights and compares the code amount and selects the code length. However, the present invention is not limited to this, and the code length update unit 60 assigns the code length to other components. However, the essence of the present invention is not limited.
[0112]
Embodiment 10 FIG.
Next, an embodiment 10 of the invention will be described.
In the first to ninth embodiments described above, the “predetermined image unit” is set to “1 frame”. However, the moving picture encoding apparatus according to the tenth embodiment is the same as that of the first embodiment shown in FIG. In the configuration, the predetermined image unit is composed of two or more frames, and the number of frames constituting the image unit is variable.
[0113]
For example, if the number of frames making up the “predetermined image unit” is variably set according to the size of the motion vector generated in the current frame, the code length is specified according to the size of the image motion. The operation related to (update) can be simplified.
[0114]
Specifically, if it is predicted from the magnitude of the motion vector in the current frame that a motion vector having the same magnitude is generated in the next few frames, the code length designation unit 50 includes the code length update unit 60. The code length update is rejected and the code length specified for the current frame is maintained for several frames. As a result, the number of code length updates is reduced, and the update operation is simplified.
[0115]
In the tenth embodiment, the number of frames is variable in the configuration of the first embodiment, but the present invention may be applied to other second to ninth embodiments.
In the first to tenth embodiments described above, an image unit is defined in units of frames. However, a part of one frame may be defined as an image unit, and if the size of the image unit is defined as necessary. Good. Further, the image block is defined by dividing the image unit into several parts. However, the size of the image block is not particularly limited as long as it does not exceed the size of the image unit.
[0116]
【The invention's effect】
As is clear from the above description, the following effects can be obtained according to the present invention.
That is, according to the present invention, an input image is divided into predetermined image blocks, a motion vector is generated for each image block from the input image and a prediction image encoded in advance, and the prediction based on the motion vector is performed. A motion compensation means for compensating for the motion of the image, the motion compensation means for motion compensation to encode the input image, and a coding means for coding the motion vector with a specified code length; and As a unit of a predetermined image unit composed of image blocks, In order to encode the motion vector generated by the motion compensation means, and to define a search range of the motion vector of the input image for the next frame by the motion compensation means, Code length designating means for designating the code length of the motion vector to the encoding means, and when the encoding means encodes the input image for the next image unit, the motion compensation means is the current image unit. Based on the magnitude of the generated motion vector Calculating a minimum code length sufficient to represent a motion vector search range according to the size of the motion vector, and based on the calculated minimum code length Since the code length updating means for updating the code length designated by the code length designation means is provided, the code amount can be reduced according to the magnitude of the motion vector, and the coding efficiency can be improved.
[0117]
The code length updating means uses a code length in which all motion vectors generated in the current image unit are smaller than the code length designated by the code length designation means for the current image unit. In this case, the code length specified by the code length specifying means is updated to the minimum code length sufficient to express the sizes of all the motion vectors. Can be kept low.
[0118]
Furthermore, the code length update means specifies the size of a predetermined percentage of motion vectors, which is the majority of the motion vectors generated in the current image unit, for the current image unit. The code length specified by the code length specifying means is sufficient to express the size of a predetermined percentage of motion vectors that is the majority of the motion vectors. Since the code length is updated to the minimum code length, the code amount in the next entire image unit can be substantially reduced.
[0119]
Furthermore, the code length update means is generated when the input image is encoded by expressing the magnitude of the motion vector generated in the current image unit using the code length designated by the code length designation means. When the input image is encoded by expressing the motion vector generated in the current image unit using the first code amount and the minimum code length sufficient to express the size of the motion vector. Since the code length designated by the code length designation means is updated when the increment of the second code amount with respect to the first code amount is equal to or less than a predetermined threshold, the code length designated by the code length designation means is updated. The amount of codes in the entire next image unit can be effectively reduced.
[0120]
Furthermore, the code length update means is generated when the input image is encoded by expressing the magnitude of the motion vector generated in the current image unit using the code length designated by the code length designation means. Occurs when the input image is encoded by expressing a motion vector generated in the current image unit using a first code amount to be performed and a code length smaller than the code length specified by the code length specifying means The code length designated by the code length designation means when the increment of the second code quantity with respect to the first code quantity is equal to or less than a predetermined threshold. Is updated to a code length shorter than the code length designated by the user, the code amount in the next image unit as a whole can be kept low.
[0121]
Furthermore, the code length update means generates a code generated when the input image is encoded by the encoding means when the increment of the second code quantity with respect to the first code quantity exceeds a predetermined threshold. Since the code length specified by the code length specifying means is updated so as to increase the code length within a range where the amount is equal to or less than the predetermined threshold, the next image unit is improved so that the coding efficiency is improved within the motion searchable range. The overall code amount can be effectively reduced.
[0122]
The code length update means further includes a code length input means for inputting a code length designated from the outside. Comparison between the amount of code generated when encoded based on the code length generated by the code length update means and the amount of code generated when encoded based on the code length input to the code length input means On the basis of the The code length generated by the code length update means or the code length input to the code length input means is selected and the code length designated by the code length designation means is updated. The code amount in the next image unit as a whole can be effectively suppressed so as to improve the conversion efficiency.
[0123]
Furthermore, the code length updating means generates a plurality of candidate code lengths that can be taken within a motion search range allowed for the image block, and expresses the motion vector using the plurality of candidate code lengths. Thus, the code amount generated when each of the input images is encoded is compared, and the code length with the smallest code amount is selected from among the plurality of candidate code lengths. In order to improve the coding efficiency within the range, it is possible to effectively reduce the code amount in the entire next image unit.
[0124]
Furthermore, the code length update means uses the code amount obtained by expressing the motion vector using the code length input to the code length input means, and the code length generated by the code length update means. Since the code amount obtained by expressing the motion vector is weighted and compared, and the code length is selected based on the comparison result, the code length input is given priority over the code length update by the code length update means. The code length designated from the outside can be designated via the means.
[0125]
Furthermore, since the image unit is composed of two or more frames, and the number of frames forming the image unit is variable, the code amount of the next image unit as a whole can be kept low according to the magnitude of image change. Can do.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a moving picture encoding apparatus according to Embodiment 1 of the present invention.
FIG. 2 is a block diagram showing a configuration of a moving picture encoding apparatus according to Embodiment 4 of the present invention.
FIG. 3 is a block diagram showing a configuration of a moving picture encoding apparatus according to Embodiment 7 of the present invention.
FIG. 4 is a block diagram illustrating a configuration of a moving picture encoding apparatus according to an eighth embodiment of the present invention.
FIG. 5 is a diagram for explaining a relationship between a code length generated by a code length update unit of a video encoding device according to an eighth embodiment of the present invention and a motion search range.
FIG. 6 is a block diagram of a moving image compression apparatus according to the prior art.
FIG. 7 is a flowchart showing a flow of operations of the moving image compression apparatus according to the prior art.
FIG. 8 is a diagram illustrating coefficients generated internally by the moving image compression apparatus according to the related art.
[Explanation of symbols]
10 input images, 10A prediction image, 31 image memory, 32 difference calculator, 33 encoder, 35 variable encoder, 36 buffer, 38 decoder, 40 adder, 44 motion compensation prediction unit, 50 code length designation unit 60, 60A, 60B code length update unit, 70 code length input unit, 90 encoded data, 100 encoding unit.

Claims (8)

入力画像を所定の画像ブロックに分割し、上記入力画像とあらかじめ符号化された予測画像とから上記画像ブロックごとに動きベクトルを発生して上記動きベクトルに基づき上記予測画像の動きを補償する動き補償手段を有し、上記動き補償手段により動き補償して上記入力画像を符号化すると共に、指定されたコード長で上記動きベクトルを符号化する符号化手段と、
上記画像ブロックからなる所定の画像ユニットを単位として、上記動き補償手段で発生した上記動きベクトルを符号化するため、および上記動き補償手段による次のフレームに対する入力画像の動きベクトルの探索範囲を定めるために、上記符号化手段に対し上記動きベクトルのコード長を指定するコード長指定手段と、
上記符号化手段が次の画像ユニットに対する上記入力画像を符号化するに際し、上記動き補償手段が現在の画像ユニットで発生した動きベクトルの大きさに基づき、上記動きベクトルの大きさに応じた動きベクトルの探索範囲を表現するのに足りる最小のコード長を算出し、算出した上記最小のコード長に基づいて上記コード長指定手段が指定するコード長を更新するコード長更新手段と
を備えた動画像符号化装置において、
上記コード長更新手段は、
上記現在の画像ユニットで発生した動きベクトルの大多数となる所定の割合の動きベクトルの大きさが、上記現在の画像ユニットに対して上記コード長指定手段が指定するコード長より少ないコード長を用いて表現される場合、上記コード長指定手段が指定するコード長を、上記動きベクトルの大多数となる所定の割合の動きベクトルの大きさを表現するのに足りる最小のコード長に更新することを特徴とする動画像符号化装置。
Motion compensation that divides an input image into predetermined image blocks, generates a motion vector for each image block from the input image and a previously encoded predicted image, and compensates for the motion of the predicted image based on the motion vector Encoding means for encoding the input image with motion compensation by the motion compensation means, and encoding the motion vector with a specified code length;
In order to encode the motion vector generated by the motion compensation unit in units of a predetermined image unit composed of the image block, and to define a search range of a motion vector of an input image for the next frame by the motion compensation unit Code length specifying means for specifying the code length of the motion vector to the encoding means;
When the encoding means encodes the input image for the next image unit, the motion compensation means moves the motion vector according to the magnitude of the motion vector based on the magnitude of the motion vector generated in the current image unit. A code length update unit that calculates a minimum code length sufficient to express the search range of the code and updates a code length specified by the code length specification unit based on the calculated minimum code length In the encoding device,
The code length update means
Use a code length that is smaller than the code length specified by the code length specifying means for the current image unit, and that the size of a predetermined percentage of the motion vectors generated in the current image unit is the majority. The code length designated by the code length designation means is updated to the minimum code length sufficient to represent the size of a predetermined percentage of motion vectors that is the majority of the motion vectors. A moving image encoding device.
上記コード長更新手段は、
上記コード長指定手段が指定するコード長を用いて上記現在の画像ユニットで発生した動きベクトルの大きさを表現して上記入力画像を符号化したときに発生する第1の符号量と、上記動きベクトルの大きさを表現するのに足りる最小のコード長を用いて上記現在の画像ユニットで発生した動きベクトルを表現して上記入力画像を符号化したときに発生する第2の符号量とを求め、上記第1の符号量に対する上記第2の符号量の増分が所定の閾値以下となる場合に上記コード長指定手段が指定するコード長を更新することを特徴とする請求項1に記載の動画像符号化装置。
The code length update means
A first code amount generated when the input image is encoded by expressing the magnitude of a motion vector generated in the current image unit using the code length specified by the code length specifying means, and the motion A second code amount generated when the input image is encoded by expressing the motion vector generated in the current image unit using the minimum code length sufficient to express the size of the vector. 2. The moving image according to claim 1, wherein the code length designated by the code length designation unit is updated when an increment of the second code amount with respect to the first code amount is a predetermined threshold value or less. Image encoding device.
入力画像を所定の画像ブロックに分割し、上記入力画像とあらかじめ符号化された予測画像とから上記画像ブロックごとに動きベクトルを発生して上記動きベクトルに基づき上記予測画像の動きを補償する動き補償手段を有し、上記動き補償手段により動き補償して上記入力画像を符号化すると共に、指定されたコード長で上記動きベクトルを符号化する符号化手段と、
上記画像ブロックからなる所定の画像ユニットを単位として、上記動き補償手段で発生した上記動きベクトルを符号化するため、および上記動き補償手段による次のフレームに対する入力画像の動きベクトルの探索範囲を定めるために、上記符号化手段に対し上記動きベクトルのコード長を指定するコード長指定手段と、
上記符号化手段が次の画像ユニットに対する上記入力画像を符号化するに際し、上記動き補償手段が現在の画像ユニットで発生した動きベクトルの大きさに基づき、上記動きベクトルの大きさに応じた動きベクトルの探索範囲を表現するのに足りる最小のコード長を算出し、算出した上記最小のコード長に基づいて上記コード長指定手段が指定するコード長を更新するコード長更新手段と
を備えた動画像符号化装置において、
上記コード長更新手段は、
上記コード長指定手段が指定するコード長を用いて上記現在の画像ユニットで発生した動きベクトルの大きさを表現して上記入力画像を符号化したときに発生する第1の符号量と、上記コード長指定手段が指定するコード長よりも少ないコード長を用いて上記現在の画像ユニットで発生した動きベクトルを表現して上記入力画像を符号化したときに発生する第2の符号量とを求め、上記第1の符号量に対する上記第2の符号量の増分が所定の閾値以下となる場合に上記コード長指定手段が指定するコード長を上記コード長指定手段が指定するコード長よりも少ないコード長に更新することを特徴とする動画像符号化装置
Motion compensation that divides an input image into predetermined image blocks, generates a motion vector for each image block from the input image and a previously encoded predicted image, and compensates for the motion of the predicted image based on the motion vector Encoding means for encoding the input image with motion compensation by the motion compensation means, and encoding the motion vector with a specified code length;
In order to encode the motion vector generated by the motion compensation unit in units of a predetermined image unit composed of the image block, and to define a search range of a motion vector of an input image for the next frame by the motion compensation unit Code length specifying means for specifying the code length of the motion vector to the encoding means;
When the encoding means encodes the input image for the next image unit, the motion compensation means moves the motion vector according to the magnitude of the motion vector based on the magnitude of the motion vector generated in the current image unit. A code length updating unit that calculates a minimum code length sufficient to express the search range of the code, and updates a code length specified by the code length specifying unit based on the calculated minimum code length;
In a video encoding device comprising:
The code length update means
A first code amount generated when the input image is encoded by expressing the magnitude of a motion vector generated in the current image unit using the code length specified by the code length specifying means, and the code A second code amount generated when the input image is encoded by expressing a motion vector generated in the current image unit using a code length smaller than the code length specified by the length specifying means, The code length specified by the code length specifying means is smaller than the code length specified by the code length specifying means when the increment of the second code quantity with respect to the first code quantity is equal to or less than a predetermined threshold. A moving picture coding apparatus, which is updated to
上記コード長更新手段は、
上記第1の符号量に対する上記第2の符号量の増分が所定の閾値を超える場合、上記符号化手段により上記入力画像を符号化したときに発生する符号量が上記所定の閾値以下となる範囲内で、上記コード長指定手段が指定するコード長を増やす方向に更新することを特徴とする請求項3に記載の動画像符号化装置。
The code length update means
A range in which the amount of code generated when the input image is encoded by the encoding means is less than or equal to the predetermined threshold when the increment of the second code amount with respect to the first code amount exceeds a predetermined threshold 4. The moving picture coding apparatus according to claim 3, wherein the code length designation unit updates the code length so as to increase the code length.
外部から指定されたコード長を入力するコード長入力手段をさらに備え、
上記コード長更新手段は、上記コード長更新手段が生成したコード長に基づいて符号化したときに発生する符号量と、上記コード長入力手段に入力されたコード長に基づいて符号化したときに発生する符号量との比較に基づいて、上記コード長更新手段が生成したコード長または上記コード長入力手段に入力されたコード長を選択して、上記コード長指定手段が指定するコード長を更新することを特徴とする請求項1ないし4のいずれかに記載の動画像符号化装置。
It further comprises a code length input means for inputting a code length designated from the outside,
The code length updating unit is configured to perform encoding based on a code amount generated when encoding is performed based on the code length generated by the code length updating unit and a code length input to the code length input unit. Based on the comparison with the generated code amount, the code length generated by the code length update unit or the code length input to the code length input unit is selected, and the code length designated by the code length designation unit is updated. 5. The moving picture coding apparatus according to claim 1, wherein the moving picture coding apparatus according to claim 1 is used.
上記コード長更新手段は、
上記画像ブロックに対して許容される動き探索範囲内で取り得る複数候補のコード長を生成し、上記複数候補のコード長を用いて上記動きベクトルを表現して上記入力画像をそれぞれ符号化したときに発生する符号量を比較し、上記複数候補のコード長の中から上記符号量が最も小さくなるコード長を選択することを特徴とする請求項5に記載の動画像符号化装置。
The code length update means
When a plurality of candidate code lengths that can be taken within the motion search range allowed for the image block are generated, and the input vector is encoded by expressing the motion vector using the code lengths of the plurality of candidates. 6. The moving picture encoding apparatus according to claim 5, wherein the code amounts generated in the plurality of candidates are compared, and the code length having the smallest code amount is selected from the code lengths of the plurality of candidates.
上記コード長更新手段は、
上記コード長入力手段に入力されたコード長を用いて上記動きベクトルを表現して得られる符号量と、上記コード長更新手段が生成したコード長を用いて上記動きベクトルを表現して得られる符号量とをそれぞれ重み付けして比較し、該比較の結果に基づきコード長を選択することを特徴とする請求項5に記載の動画像符号化装置。
The code length update means
Code obtained by expressing the motion vector using the code amount obtained by expressing the motion vector using the code length input to the code length input means and the code length generated by the code length updating means 6. The moving picture coding apparatus according to claim 5, wherein the amount is weighted and compared, and a code length is selected based on a result of the comparison.
上記画像ユニットは2以上のフレームからなり、上記画像ユニットをなすフレーム数を可変としたことを特徴とする請求項1ないし7のいずれかに記載の動画像符号化装置。  8. The moving picture coding apparatus according to claim 1, wherein the image unit includes two or more frames, and the number of frames forming the image unit is variable.
JP00983998A 1998-01-21 1998-01-21 Video encoding device Expired - Fee Related JP4583514B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP00983998A JP4583514B2 (en) 1998-01-21 1998-01-21 Video encoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP00983998A JP4583514B2 (en) 1998-01-21 1998-01-21 Video encoding device

Publications (2)

Publication Number Publication Date
JPH11215504A JPH11215504A (en) 1999-08-06
JP4583514B2 true JP4583514B2 (en) 2010-11-17

Family

ID=11731305

Family Applications (1)

Application Number Title Priority Date Filing Date
JP00983998A Expired - Fee Related JP4583514B2 (en) 1998-01-21 1998-01-21 Video encoding device

Country Status (1)

Country Link
JP (1) JP4583514B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11310467B2 (en) 2017-05-11 2022-04-19 Inovision Software Solutions, Inc. Object inspection system and method for inspecting an object
US12070764B2 (en) 2020-06-17 2024-08-27 Inovision Software Solutions, Inc. System and method for defect repair

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001197501A (en) 2000-01-07 2001-07-19 Fujitsu Ltd Motion vector searching device and motion vector searching method, and moving picture coder

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11310467B2 (en) 2017-05-11 2022-04-19 Inovision Software Solutions, Inc. Object inspection system and method for inspecting an object
US11937020B2 (en) 2017-05-11 2024-03-19 Inovision Software Solutions, Inc. Object inspection system and method for inspecting an object
US12070764B2 (en) 2020-06-17 2024-08-27 Inovision Software Solutions, Inc. System and method for defect repair

Also Published As

Publication number Publication date
JPH11215504A (en) 1999-08-06

Similar Documents

Publication Publication Date Title
JP4662636B2 (en) Improvement of motion estimation and block matching pattern
JP2963416B2 (en) Video encoding method and apparatus for controlling bit generation amount using quantization activity
US20050243930A1 (en) Video encoding method and apparatus
JP2004048552A (en) Image encoder, image encoding method, image decoder, image decoding method and communication equipment
JPH09252470A (en) Method for encoding and decoding image
JPH09172644A (en) Moving image coding/decoding device using moving compensation inter-frame prediction system employing affine transformation
KR20010082934A (en) Motion estimation method and device
JP2008124772A (en) Coding device and coding method
JP2009055519A (en) Encoding processing apparatus, encoding processing method, decoding processing apparatus, and decoding processing method
US7333660B2 (en) Apparatus for and method of coding moving picture
JP3982615B2 (en) System for converting encoded video data
JPH1093975A (en) Motion compensation inter-frame predicting method in moving image encoder
JP5571542B2 (en) Video encoding method and video decoding method
JP4583514B2 (en) Video encoding device
JP2001128179A (en) Device and method for encoding moving picture
JP4130617B2 (en) Moving picture coding method and moving picture coding apparatus
US6975681B2 (en) Method and apparatus for coding moving pictures
CN100508616C (en) Moving picture signal coding method, decoding method, coding apparatus, and decoding apparatus
JPH10313463A (en) Video signal encoding method and encoding device
WO2019150411A1 (en) Video encoding device, video encoding method, video decoding device, and video decoding method, and video encoding system
JP6728870B2 (en) Image compression apparatus, image compression method, and image compression program
JP4243205B2 (en) Moving picture coding apparatus, method and program thereof
JPH10341436A (en) Highly efficient encoding device
JP2012120108A (en) Interpolation image generating apparatus and program, and moving image decoding device and program
JP2004297696A (en) Video signal encoder

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050107

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061226

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070109

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070226

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20070607

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080318

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080417

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20080529

A912 Removal of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20080620

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100804

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

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130910

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees