JP4243472B2 - Image coding apparatus, image coding method, and image coding program - Google Patents

Image coding apparatus, image coding method, and image coding program Download PDF

Info

Publication number
JP4243472B2
JP4243472B2 JP2002326288A JP2002326288A JP4243472B2 JP 4243472 B2 JP4243472 B2 JP 4243472B2 JP 2002326288 A JP2002326288 A JP 2002326288A JP 2002326288 A JP2002326288 A JP 2002326288A JP 4243472 B2 JP4243472 B2 JP 4243472B2
Authority
JP
Japan
Prior art keywords
encoding
code amount
coding
hybrid
mode
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
JP2002326288A
Other languages
Japanese (ja)
Other versions
JP2004165751A (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.)
Japan Broadcasting Corp
NHK Engineering System Inc
Original Assignee
NHK Engineering Services Inc
Japan Broadcasting 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 NHK Engineering Services Inc, Japan Broadcasting Corp filed Critical NHK Engineering Services Inc
Priority to JP2002326288A priority Critical patent/JP4243472B2/en
Publication of JP2004165751A publication Critical patent/JP2004165751A/en
Application granted granted Critical
Publication of JP4243472B2 publication Critical patent/JP4243472B2/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】
【従来の技術】
一般に、動画像等の画像データを符号化する方式として、動きベクトルによる動き補償予測を行う予測符号化と、DCT(直交コサイン変換)係数を用いた変換符号化とを組み合わせたハイブリッド符号化による動画像符号化方式が広く普及している。
【0003】
この動画像符号化方式において、デジタルテレビジョン放送等に使用されている動画像符号化にMPEG−2ビデオ(非特許文献1参照)がある。このMPEG−2ビデオに準拠した動画像符号化方式を実現したものとして、TM5(Test Model 5,ISO/IEC JTC1/SC29/WG11/N0400,MPEG93/475)が挙げられ、このTM5は、動画像符号化方式おけるMPEG−2ビデオの規格を実現したエンコーダである。
【0004】
ここで、このMPEG−2ビデオについて詳細に説明する。
MPEG−2ビデオでは、画面を構成するフレームの標本がすべて同一の時間的瞬間を示すプログレッシブシーケンスに加えて、当該フレームの交互の走査線が時間的に異なる瞬間を示すインターレスシーケンスにも対応するため、階層的にフレーム処理またはフィールド処理が適応選択することができるように規格化されている。1フレームは2つのフィールドからなっている。また、1フレームを1画面として符号化する場合、或いは、2つのフィールドを2画面として符号化する場合等、当初の画面(当初の画像)をどのように符号化するかを決定することを符号化画面構造(画像構造)という。1フレームを1画面として符号化したものをフレーム画像といい、2つのフィールドを2画面として符号化したそれぞれのものをフィールド画像といい、これらフレーム画像およびフィールド画像をフレーム単位で適応的(任意)に選択することができる。
【0005】
そして、フレーム画像に符号化する際には、フレームDCTまたはフィールドDCTのDCTタイプの使い分けが可能であり、当初の画像はマクロブロック(輝度成分16画素×16ラインおよびこの領域に対応する色差成分)に分割され、さらに、マクロブロックは、各DCTタイプによって、細かいブロック(輝度成分および色差成分とも、それそれ8画素×8ライン)に分割され、DCT符号化される。DCTタイプにフレームDCTが使用された場合では、細かいブロックは2つのフィールドからの交互のラインで構成され、DCTタイプにフィールドDCTが使用された場合では、細かいブロックは2つのフィールドからの一方のラインで構成される。
【0006】
マクロブロックには、当該マクロブロックのみの情報を用いて、当初の画像を符号化するイントラマクロブロックと、先に符号化された画像の予測に基づいて当初の画像を符号化するインターマクロブロックとがある。また、予測符号化における予測タイプは、フィールド予測とフレーム予測との2種類に大別されている。フィールド予測は、先に符号化されたフィールドを使用し、トップフィールドとボトムフィールドについて独立に予測を行うものである。フレーム予測は、先に符号化されたフレームから予測を行うものである。
【0007】
フィールド画像では、予測タイプは全てフィールド予測であり、フレーム画像では、フィールド予測またはフレーム予測をマクロブロック毎に予測タイプを選択することができる。ただし、フレーム画像では、FPFD(Frame Pred Frame Dct)フラグが“1”に設定されると、フレームDCTとフレーム予測のみが使用され、フィールド画像では、FPFDフラグは“0”とされる。
【0008】
また、MPEG−2ビデオにおいて、当初の画像が符号化されたピクチャタイプには、I、P、B(Iピクチャ、Pピクチャ、Bピクチャ)がある。Iピクチャは、自らの情報のみが使用されて符号化された画像であり、イントラマクロブロックのみで構成されている。Pピクチャは、過去(当該Pピクチャ符号化前)の参照画像から動き予測補償が使用されて符号化された画像であり、イントラマクロブロックと過去から予測される前方向予測のインターマクロブロックで構成されている。Bピクチャは、過去(当該Bピクチャ符号化前)および未来(当該Bピクチャ符号化後)の参照画像から動き予測補償が使用されて符号化された画像であり、イントラマクロブロックと、過去から予測される前方向予測および未来から予測される後方向予測ならびに過去および未来から予測される両方向予測のインターマクロブロックとによって構成されている。
【0009】
なお、補足までに、前記した予測符号化における予測タイプ以外のものについて説明しておくと、例えば、「デュアルプライム」と、「16×8動き補償」といった予測タイプがある。「デュアルプライム」では、当初の画像中における動きベクトル1つと、この動きベクトルよりも小さい差分ベクトルとが使用される。また、「16×8動き補償」では、マクロブロック単位に16×8領域の上部と下部との2組の動きベクトルが使用され、「16×8動き補償」はフィールド画像のみに使用される。
【0010】
ところで、このMPEG−2ビデオ準拠の動画像符号化方式では、動きベクトルや、マクロブロックモードの決定は以下に示すように行われている。
【0011】
この動画像符号化方式では、まず、各予測タイプについて、選択候補の動きベクトルの絶対値予測誤差を比較し、この絶対値予測誤差が最小となる動きベクトルを選択する。次に、各予測タイプの平均二乗予測誤差を比較し、この平均二乗予測誤差が最小となる予測タイプを選択する。最後に、マクロブロックの入力誤差の分散と選択された予測タイプの平均二乗予測誤差とを比較し、入力誤差の分散の方が小さい場合、イントラマクロブロックを、平均二乗予測誤差の方が小さい場合、選択された予測タイプのイントラマクロブロックをそれぞれ選択する。
【0012】
また、変換符号化におけるバッファ制御は、バッファの占有量からフィードバック制御によって得られたDCT係数の量子化値に基づいて、DCT係数発生符号量が調整されることによって行われている。
【0013】
参考までに、この動画像符号化方式によって画像データを符号化する従来の画像符号化装置を図14に示す。この画像符号化装置101では、ビデオ入力からの入力された画像データ(入力画素)の符号化の仕方を符号化モード決定部103で決定している。この符号化モード決定部103では、入力画素と、フレームメモリに蓄積されている参照画素(入力画素より以前に入力された画素)とにより、予測誤差値を演算し、この予測誤差値に基づいて符号化モードを決定するものである。
【0014】
【非特許文献1】
ISO/IEC13818−2 1995年(動画像の圧縮規格書)
【0015】
【発明が解決しようとする課題】
しかしながら、従来のMPEG−2ビデオ準拠の動画像符号化方式では、動きベクトル、予測タイプ、マクロブロックモードの選択基準に符号化ビットレートが考慮されていなかったので、同じ画像データ(映像)であれば、符号化ビットレートに拘わらず、動きベクトルやマクロブロックモードに係る情報について発生する発生符号量がほぼ等しくなる。そして、符号化ビットレートが低くなると、動きベクトル等の発生符号量の割合が増加する傾向にあり、この結果、DCT係数への割当符号量が減少し、この割当符号量の減少により、符号化した画像データの画質が劣化するという問題がある。
【0016】
そこで、本発明の目的は前記した従来の技術が有する課題を解消し、ハイブリッド符号化において符号化ビットレートが低くなっても、符号化した画像データの画質劣化を抑制することができる画像符号化装置、画像符号化方法および画像符号化プログラムを提供することにある。
【0017】
【課題を解決するための手段】
本発明は、前記した目的を達成するため、以下に示す構成とした。
請求項1記載の画像符号化装置は、動きベクトルによる動き補償予測を用いた予測符号化と直交変換を用いた変換符号化とを組み合わせたハイブリッド符号化によって、画像データを符号化する画像符号化装置であって、予測誤差値演算手段と、変換係数割当符号量演算手段と、符号化効率評価値演算手段と、符号化モード選択手段と、符号化手段と、を備える構成とした。
【0018】
かかる構成によれば、画像符号化装置は、予測誤差値演算手段によって、予測符号化によって前記画像データを符号化した際の誤差値として、前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、イントラ符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックに含まれる変換ブロックの入力画素の分散の平均により演算し、インター符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックの入力画素と当該ブロックの参照画素との平均二乗誤差、平均絶対値誤差、又は、相互相関係数により演算する
いて、画像符号化装置は、変換係数割当符号量演算手段によって、画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、前記イントラ符号化モードにおける変換係数割当符号量 C1 を、前記ハイブリッド符号化する際のハイブリッド符号化ブロックに割り当てられるハイブリッド符号化ブロック割当符号量から、前記イントラ符号化モードの発生符号量と、当該ハイブリッド符号化ブロックに含まれる変換ブロックの直流係数の発生符号量の総和とを減算することで求め、前記インター符号化モードにおける変換係数割当符号量T C2 を、前記ハイブリッド符号化ブロック割当符号量から、前記インター符号化モードの発生符号量と、前記動きベクトルの発生符号量とを減算することで求める
た、画像符号化装置は、符号化効率評価値演算手段によって、前記イントラ符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C1 との積を演算し、前記インター符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C2 との積を演算することで、符号化効率を示す評価値を求める
して、画像符号化装置は、符号化モード選択手段によって、符号化効率評価値演算手段で演算された評価値が最大となる符号化モードを選択する
して、画像符号化装置は、符号化手段によって、符号化モード選択手段で選択した符号化モードにより、画像データを符号化する。
【0019】
つまり、予測誤差値演算手段および変換係数割当符号量演算手段で算出される、画像データを符号化する際の動きベクトルやマクロブロックモード(インターマクロブロックまたはイントラマクロブロック)の発生符号量が制御され、予測誤差値と、変換係数割当符号量とに基づいて評価値が演算され、この評価値が符号化モード選択手段に入力され、この符号化モード選択手段にて、符号化モードが選択される。符号化効率評価値演算手段では、例えば、予測誤差値の逆数と、変換係数割当符号量との積が演算され、符号化モード選択手段では、符号化効率評価値演算手段によって演算された評価値の最大のものが選択される。
【0020】
また、この符号化モード選択手段では、選択候補の動きベクトルおよびマクロブロックモードについて符号化効率の評価値が最大となる動きベクトルおよびマクロブロックモードが選択される。インターマクロブロックについては、動きベクトルおよびマクロブロックモード情報の合計発生符号量を求め、マクロブロック割当符号量から減算したものをDCT係数割当符号量とし、動きベクトルの予測誤差の逆数とDCT係数割当符号量とを積算したものを評価値とする。イントラマクロブロックについては、イントラDC係数(イントラ直流係数)およびマクロブロックモード情報の合計発生符号量を求め、マクロブロック割当符号量から減算したものをDCT係数割当符号量とし、マクロブロックの入力画素の分散の逆数とDCT係数割当符号量とを積算したものを評価値とする。
【0031】
請求項に記載の画像符号化装置は、請求項1に記載の画像符号化装置において、前記符号化手段が、前記画像データに含まれる画面を符号化する際に割り当てられる画面割当符号量を、前記画面を構成するハイブリッド符号化ブロック数で除算することで、前記ハイブリッド符号化する際のハイブリッド符号化ブロックの割当符号量を求めることを特徴とする。
【0032】
かかる構成によれば、画像符号化装置は、符号化手段によって、画像データに含まれる画面を符号化する際に割り当てられる画面割当符号量を、画面を構成するハイブリッド符号化ブロック数で除算することで、ハイブリッド符号化する際のハイブリッド符号化ブロックの割当符号量を求める。
【0033】
請求項に記載の画像符号化方法は、符号化済みの画素に基づいて符号化対象画素を予測する予測符号化と、前記符号化対象画素からなる符号化対象画像が連続する画像信号を変換して得られる変換係数を量子化し、可変長符号化する変換符号化とを組み合わせたハイブリッド符号化によって、画像データを符号化する画像符号化方法であって、予測誤差値演算ステップと、変換係数割当符号量演算ステップと、符号化効率評価値演算ステップと、符号化ステップと、を含むことを特徴とする。
【0034】
この方法によれば、予測誤差値演算ステップにおいて、予測符号化によって画像データを符号化した際の誤差値として、前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、イントラ符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックに含まれる変換ブロックの入力画素の分散の平均により演算し、インター符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックの入力画素と当該ブロックの参照画素との平均二乗誤差、平均絶対値誤差、又は、相互相関係数により演算し、変換係数割当符号量演算ステップにおいて、画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、前記イントラ符号化モードにおける変換係数割当符号量 C1 を、前記ハイブリッド符号化する際のハイブリッド符号化ブロックに割り当てられるハイブリッド符号化ブロック割当符号量から、前記イントラ符号化モードの発生符号量と、当該ハイブリッド符号化ブロックに含まれる変換ブロックの直流係数の発生符号量の総和とを減算することで求め、前記インター符号化モードにおける変換係数割当符号量T C2 を、前記ハイブリッド符号化ブロック割当符号量から、前記インター符号化モードの発生符号量と、前記動きベクトルの発生符号量とを減算することで求める
して、符号化効率評価値演算ステップにおいて、前記イントラ符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C1 との積を演算し、前記インター符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C2 との積を演算することで、符号化効率を示す評価値を求め、 符号化ステップにおいて、符号化効率評価値演算ステップにて演算された評価値が最大となる符号化モードを選択して、選択した符号化モードによって前記画像データを符号化する。
【0035】
請求項に記載の画像符号化プログラムは、動きベクトルによる動き補償予測を用いた予測符号化と直交変換を用いた変換符号化とを組み合わせたハイブリッド符号化によって、画像データを符号化するために、コンピュータを、予測誤差値演算手段、変換係数割当符号量演算手段、符号化効率評価値演算手段、符号化モード選択手段、符号化手段、として機能させる構成とした。
【0036】
かかる構成によれば、画像符号化プログラムは、予測誤差値演算手段によって、予測符号化によって前記画像データを符号化した際の誤差値として、前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、イントラ符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックに含まれる変換ブロックの入力画素の分散の平均により演算し、インター符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックの入力画素と当該ブロックの参照画素との平均二乗誤差、平均絶対値誤差、又は、相互相関係数により演算し、変換係数割当符号量演算手段によって、画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、前記イントラ符号化モードにおける変換係数割当符号量 C1 を、前記ハイブリッド符号化する際のハイブリッド符号化ブロックに割り当てられるハイブリッド符号化ブロック割当符号量から、前記イントラ符号化モードの発生符号量と、当該ハイブリッド符号化ブロックに含まれる変換ブロックの直流係数の発生符号量の総和とを減算することで求め、前記インター符号化モードにおける変換係数割当符号量T C2 を、前記ハイブリッド符号化ブロック割当符号量から、前記インター符号化モードの発生符号量と、前記動きベクトルの発生符号量とを減算することで求める
して、符号化効率評価値演算手段によって、前記イントラ符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C1 との積を演算し、前記インター符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C2 との積を演算することで、符号化効率を示す評価値を求め、符号化モード選択手段によって、符号化効率評価値演算手段で演算された評価値が最大となる符号化モードを選択し、符号化手段によって、符号化モード選択手段で選択した符号化モードにより、前記画像データを符号化する。
【0041】
【発明の実施の形態】
以下、本発明の一実施の形態について、図面を参照して詳細に説明する。
(画像符号化装置の構成)
図1は、画像符号化装置のブロック図である。この図1に示すように、画像符号化装置1は、ビデオ入力から入力された入力画素(画像データ)を符号化したビットストリームとして出力するもので、符号化モード決定部3と、動き補償予測部5と、減算器7と、DCT部9と、量子化器11と、逆量子化器13と、IDCT部15と、加算器17と、フレームメモリ19と、可変長符号部21と、バッファ23と、バッファ制御部25とを備えている。
【0042】
この画像符号化装置1は、MPEG−2映像符号化(ISO/IEC13818−2)に適応しており、符号化対象である入力画素(画像データ)を、ピクチャタイプ(Iピクチャ、Pピクチャ、Bピクチャ)および画像構造(フレーム画像、フィールド画像)によって選択可能な符号化モード(マクロブロックモード)と動きベクトルとの組み合わせに基づき符号化するものである。なお、この符号化モード(マクロブロックモード)は、イントラ/インターマクロブロック、予測方向、予測タイプ、DCTタイプの組み合わせによって決定されるものである。
【0043】
符号化モード決定部3は、画像データを符号化する符号化の仕方である符号化モードを決定するもので、予測誤差値演算手段3aと、変換係数割当符号量演算手段3bと、符号化モード・動きベクトル発生手段3cと、ハイブリッド符号化ブロック割当符号量演算手段3dと、符号化効率評価値演算手段3eと、符号化モード選択手段3fとを備えている。なお、この符号化モード決定部3では、イントラマクロブロックと、インターマクロブロックとのいずれかを取り扱うのかを判断する判断機能を有しており、この判断機能による判断結果に基づいて、イントラマクロブロックと、インターマクロブロックとを取り扱う場合で、各手段3a〜3fにおいて、入出力される情報が若干異なっており、この詳細は、符号化モード決定部3の動作の説明にて行うこととする。
【0044】
予測誤差値演算手段3aは、ビデオ入力からの入力画素(画像データ)と、フレームメモリ19に保持されている(記憶されている)参照画素(直前の画像データ)と符号化モード・動きベクトル発生手段3cから入力された符号化モード(インターマクロブロックの場合、動きベクトルも入力される)とに基づいて、予測誤差値を演算するものである。つまり、この予測誤差値演算手段3aは、符号化モード・動きベクトル発生手段3cで発生された符号化モードの発生数に応じて繰り返し、予測誤差値を演算するものである。予測誤差値は、入力画素と参照画素との差分を示すものであり、例えば、連続する入力画素で描画される被写体の動きが激しい場合(速い動きの映像)では、この予測誤差値が大きくなる。
【0045】
なお、符号化モード決定部3の判断機能によって、イントラマクロブロックを取り扱うと判断された場合、この予測誤差値演算手段3aには、入力画素および符号化モードが入力され、インターマクロブロックを取り扱うと判断された場合(イントラマクロブロックを取り扱うと判断されなかった場合)、入力画素、参照画素、符号化モードおよび動きベクトルが入力される。また、この予測誤差値の算出の仕方については、後記する(図5に示すイントラマクロブロックの予測誤差値の演算方法について、図7、図8、図9に示すインターマクロブロックの予測誤差値の演算方法について、を参照)こととする。
【0046】
変換係数割当符号量演算手段3bは、ビデオ入力からの入力画素(画像データ)と、ハイブリッド符号化ブロック割当符号量演算手段3dから入力されたハイブリッド符号化ブロック割当符号量と、符号化モード・動きベクトル発生手段3cから入力された符号化モード(インターマクロブロックの場合、動きベクトルも入力される)とに基づいて、変換係数割当符号量を演算するものである。つまり、この変換係数割当符号量演算手段3bは、符号化モード・動きベクトル発生手段3cで発生された符号化モードの発生数に応じて繰り返し、変換係数割当符号量を演算するものである。変換係数割当符号量は、変換係数、すなわち、DCT係数に割り当てる符号量のことである。
【0047】
また、この変換係数割当符号量演算手段3bには、入力された情報から符号量を演算する符号量演算機能3b1(図6または図10参照)と、ハイブリッド符号化ブロック割当符号量と、符号量演算機能3b1にて演算された符号量とに基づいて、変換係数割当符号量演算機能3b2(図6または図10参照)とを有している。
【0048】
なお、符号化モード決定部3の判断機能によって、イントラマクロブロックを取り扱うと判断された場合、この変換係数割当符号量演算手段3bには、入力画素および符号化モードが入力され、インターマクロブロックを取り扱うと判断された場合(イントラマクロブロックを取り扱うと判断されなかった場合)、符号化モードおよび動きベクトルが入力される。そして、イントラマクロブロックを取り扱うと判断された場合、この変換係数割当符号量演算手段3bの符号量演算機能3b1(図6または図10参照)は、符号化モード符号量、直流係数符号量を出力し、インターマクロブロックを取り扱うと判断された場合(イントラマクロブロックを取り扱うと判断されなかった場合)、この変換係数割当符号量演算手段3bの符号量演算機能3b1(図6または図10参照)は、符号化モード符号量、動きベクトル符号量を出力するものである。
【0049】
符号化モード符号量は、符号化モード毎に割り当てられる符号量であり、直流係数符号量は、入力画素の直流成分に割り当てられる符号量であり、動きベクトル符号量は、入力画素中の動きベクトル毎に割り当てられる符号量のことである。また、この変換係数割当符号量の算出の仕方については、後記する(図6に示すイントラマクロブロックの変換係数割当符号量の演算方法について、図10に示すインターマクロブロックの変換係数割当符号量の演算方法について、を参照)こととする。
【0050】
符号化モード・動きベクトル発生手段3cは、符号化モードおよび動きベクトルを発生させるものである。符号化モードは、符号化モード選択手段3fで選択対象となるもので、マクロブロックタイプ(イントラマクロブロックまたはインターマクロブロック)、予測方向(前方向予測、後方向予測、両方向予測)、予測タイプ(フィールド予測またはフレーム予測)、DCTタイプ(フィールドDCTまたはフレームDCT)の組み合わせによって成り立つものである。
【0051】
マクロブロックタイプに関して、イントラマクロブロックは、マクロブロックのみの情報によって符号化するものであり、インターマクロブロックは、直前に符号化した画像データ(符号化画像データ)から現在の画像データを予測して符号化するものである。
【0052】
予測方向に関して、前方向予測は、過去(符号化する直前のフレームまたはフィールド)から予測することであり、後方向予測は、未来(符号化する直後のフレームまたはフィールド)から予測することであり、両方向予測は過去および未来から符号化対象となるマクロブロックを符号化する(予測する)ことである。
【0053】
予測タイプに関して、フィールド予測は、直前に符号化されたフィールドを使用してトップフィールド(奇数ライン)およびボトムフィールド(偶数ライン)に独立に予測を行うもので、フレーム予測は、直前に符号化されたフレームから予測を行うものである。
【0054】
DCTタイプに関して、画像データがハイブリッド符号化ブロック(マクロブロック:輝度成分16画素×16ラインおよび空間的に対応する色差成分)に分割され、さらに変換ブロック(ブロック:輝度成分および色差成分とも8画素×8ライン)に分割されてDCT符号化される場合、フィールドDCTは2つのフィールドの一方から得られるラインで当該ブロックを構成するものであり、フレームDCTは2つのフィールドから交互に得られるラインで当該変換ブロックを構成するものである。
【0055】
ハイブリッド符号化ブロック割当符号量演算手段3dは、バッファ制御部25から出力される符号化画面割当符号量をハイブリッド符号化ブロック数(マクロブロック数)で除算して、各ハイブリッド符号化ブロック(マクロブロック)に割り当てられる符号量(ハイブリッド符号化ブロック割当符号量)を演算し、変換係数割当符号量演算手段3bに出力するものである。
【0056】
符号化効率評価値演算手段3eは、予測誤差値演算手段3aで演算された予測誤差値と変換係数割当符号量演算手段3bで演算された変換係数割当符号量とに基づいて、画像データの符号化効率を示す評価値を演算し、この評価値を符号化モード選択手段3fに出力するものである。この実施の形態では、符号化効率評価値演算手段3eは、予測誤差値の逆数と、変換係数割当符号量との積を評価値として演算する。
【0057】
また、この符号化効率評価演算手段3eは、ハイブリッド符号化ブロックの変換係数割当符号量または予測誤差値から、符号化する画面の変換係数割当符号量または予測誤差値を合計する符号化画面合計機能3e1、3e2と、符号化する画面の変換係数割当符号量の合計と、符号化する画面の予測誤差値の合計とに基づいて、評価値を演算する符号化効率計算機能3e3(図11および図12参照)と、個々のハイブリッド符号化ブロックの符号化効率を符号化画面毎に集計し当該符号化画面毎の符号化効率の平均をFPFD符号化効率として出力する符号化画面平均機能3e4とを有している。なお、評価値の演算方法については後記する。
【0058】
符号化モード選択手段3fは、符号化効率評価値演算手段3eで演算され出力された評価値に基づいて、符号化モードを選択し、この選択された符号化モード情報を動き補償予測部5に出力するものである。この実施の形態では、符号化モード選択手段3fは、符号化効率評価値演算手段3eで演算され出力された評価値の中で最大のもの(最大評価値)を選択する。
【0059】
この符号化モード選択手段3fには、ハイブリッド符号化ブロックを任意に選択する符号化モード(任意選択符号化モード)と、ハイブリッド符号化ブロックを一意に選択する符号化モード(一意選択符号化モード)とを選択する選択機能を有している。この選択機能は、符号化される符号対象画像を構成する各ハイブリッド符号化ブロックの予測誤差値の逆数と、変換係数割当符号量との積の平均値を比較し、この平均値が最大となる符号化モード(任意選択符号化モードまたは一意選択符号化モード)を選択するものである。つまり、この場合、符号化モード選択手段3fは、符号化効率評価値演算手段3eで演算され出力された評価値を参照せず、予測誤差値演算手段3aおよび変換係数割当符号量演算手段3bからの予測誤差値および変換係数割当符号量を取得して、各ハイブリッド符号化ブロックの予測誤差値の逆数と、変換係数割当符号量との積の平均値を演算し、比較するものである。
【0060】
すなわち、符号化モード選択手段3fの選択機能は、フレーム画像構造時において、FPFDを判定するものである。FPFD=0の場合、ハイブリッド符号化ブロック(マクロブロック)毎に、予測タイプがフレーム予測、フィールド予測、デュアルプライム予測の3種類から任意に選択可能であり(任意選択符号化モード)、DCTタイプがフレームDCT、フィールドDCTの2種類から任意に1つ選択可能である。また、FPFD=1の場合、符号化画面(1画面)の全てのハイブリッド符号化ブロック(マクロブロック)は、予測タイプがフレーム予測、DCTタイプがフレームDCTと一意の選択(一意選択符号化モード)である。なお、FPFDは符号化画面単位に設定可能である。
【0061】
動き補償予測部5は、符号化モード決定部3の符号化モード選択手段3fから出力された符号化モード情報に基づいて、ビデオ入力から入力された入力画素(画像データ)とフレームメモリ19に保持されている(記憶されている)参照画素とからPピクチャ、Bピクチャに係る動き補償予測信号(マクロブロック単位に動きが補償されたフレーム間予測誤差信号)を生成し、減算器7および加算器17に出力するものである。
【0062】
減算器7は、ビデオ入力から入力された入力画素から動き補償予測信号を減算した補償予測信号減算画素データを、DCT部9に出力するものである。
【0063】
DCT部9は、補償予測信号減算画素データを変換ブロック単位に分割し、符号化モード選択手段3fから出力された符号化モード情報に基づいて、この変換ブロックにフレームDCT、フィールドDCTを施したDCT係数値を量子化器11に出力するものである。なお、イントラマクロブロックの変換ブロックの直流成分(イントラDC)は8〜11ビット精度で量子化され、交流成分はバッファ制御部25から与えられる量子化値によって量子化される。また、インターマクロブロックの変換ブロックは直流成分、交流成分ともバッファ制御部25から与えられる量子化値によって量子化される。
【0064】
量子化器11は、バッファ制御部25から出力された符号化画面割当符号量とに基づいて、DCT部9から出力されたDCT係数値を、量子化値に変換して、逆量子化器13および可変長符号部21に出力するものである。
【0065】
逆量子化器13は、量子化器11で量子化された量子化値を逆量子化して、元のDCT係数値を生成し、IDCT部15に出力するものである。
【0066】
IDCT部15は、逆量子化器13から出力されたDCT係数値を、減算器7から出力された補償予測信号減算画素データに逆変換し、加算器17に出力するものである。
【0067】
加算器17は、IDCT部15から出力された補償予測信号減算画素データに、動き補償予測部5で生成された動き補償予測信号を加算した画素(画像データ)を参照画素としてフレームメモリ19に出力するものである。
【0068】
フレームメモリ19は、加算器17から出力された参照画素を、フレーム単位で記憶すると共に、ビデオ入力から新たな入力画素が入力された場合、符号化モード決定部3の予測誤差値演算手段3aおよび動き補償予測部5に参照画素を出力するものである。
【0069】
可変長符号部21は、量子化器11から出力された量子化値に、係数値0の個数と、次に来る係数値との組み合わせに対して、1つの可変長符号が割り当てられる2次元可変長符号化を施して、ビットストリームを生成するものである。
【0070】
バッファ23は、可変長符号部21で符号化されたビットストリームを一時的に蓄えた後、外部に出力するものである。
【0071】
バッファ制御部25は、バッファ23から出力されたビットストリームに基づいて、1画面(1フレーム)に割当可能な符号量である符号化画面割当符号量を演算し、符号化モード決定部3および量子化器11に出力するものである。なお、符号化画面割当符号量が符号化ビットレートに相当するものである。また、動き補償予測部5、減算器7、DCT部9、量子化器11、逆量子化器13、IDCT部15、加算器17、フレームメモリ19、可変長符号部21、バッファ23およびバッファ制御部25が、特許請求の範囲の請求項に記載した符号化手段に相当するものである。
【0072】
この画像符号化装置1によれば、符号化モード決定部3の予測誤差値演算手段3aで、入力画素(画像データ)を符号化する際の予測誤差値が演算され、この予測誤差値が符号化効率評価値演算手段3eに出力される。また、変換係数割当符号量演算手段3bで、入力画素(画像データ)を符号化する際に変換係数に割り当てられる変換係数割当符号量が演算される。符号化効率評価値演算手段3eで、予測誤差値の逆数と、変換係数割当符号量との積が評価値として演算され、そして、符号化モード選択手段3fで、この評価値の最大のもの(最大評価値)に基づいた符号化モードが選択される。その後、動き補償予測部5、減算器7、DCT部9、量子化器11、逆量子化器13、IDCT部15、加算器17、フレームメモリ19、可変長符号部21、バッファ23およびバッファ制御部25で、符号化モード選択手段3fにて選択された符号化モードにより、画像データが符号化される。このため、予測誤差値の逆数と、変換係数割当符号量との積が最大となる評価値に基づいて符号化モードが選択され、この符号化モードが符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0073】
(画像符号化装置の動作)
次に、図2に示すフローチャートを参照して、画像符号化装置1の動作を説明する(適宜図1参照)。まず、ビデオ入力より入力画素(画像データ)が入力され、この入力画素(画像データ)が符号化モード決定部3、動き補償予測部5および減算器7に入力される(S1)。
【0074】
続いて、減算器7に入力された入力画素から動き補償予測部5から出力された動き補償予測信号が減算され、補償予測信号減算画素データとして、DCT部9に入力される。このDCT部9でDCT係数値に、続いて量子化器11で量子化値に、さらに逆量子化器13でDCT係数値に、引き続いてIDCT部15で補償予測信号減算画素データに逐次変換される。そして、加算器17で、補償予測信号減算画素データに動き補償予測信号が加算され、直前の入力画素(参照画素)として、フレームメモリ19に保持される(蓄積される)。このフレームメモリ19を経て、符号化モード決定部3の予測誤差値演算手段3aおよび動き補償予測部5に参照画素が入力される(S2)。
【0075】
また、量子化器11で変換された量子化値が可変長符号部21に入力され、この可変長符号部21でビットストリームが生成され、バッファ制御部25に入力され、このバッファ制御部25で入力されたビットストリームに基づいて、符号化画面割当符号量が演算され、この符号化画面割当符号量が符号化モード決定部3および量子化器11に入力される(S3)。
【0076】
そして、符号化モード決定部3の内部で各処理(詳細は符号化モード決定部3の動作の説明を参照)が施され、符号化モード(マクロブロックモード)情報が動き補償予測部5に入力される(S4)。その後、符号化モード(マクロブロックモード)情報に基づいて、入力画素(画像データ)が動き補償予測部5、減算器7、DCT部9、量子化器11、可変長符号部21、バッファ23を経て、ビットストリームとして、外部に出力される(S5)。
【0077】
(符号化モード決定部の動作)
次に、図3に示すフローチャートを参照して、画像符号化装置1の符号化モード決定部3の動作を説明する。まず、イントラマクロブロックを取り扱うのかどうかが判断される(S11)。或いは、このS11は、インターマクロブロックを取り扱うかどうかを判断してもよい。
【0078】
イントラマクロブロックを取り扱うと判断された場合(S11、Yes)、入力画素が予測誤差値演算手段3a、変換係数割当符号量演算手段3bに入力される(S12)。また、符号化モード・動きベクトル発生手段3cで発生された符号化モード(選択対象となる符号化モードに関する情報)が予測誤差値演算手段3a、変換係数割当符号量演算手段3b、符号化モード選択手段3fに入力される(S13)。
【0079】
さらに、ハイブリッド符号化ブロック割当符号量演算手段3dで、バッファ制御部25から入力された符号化画面割当符号量に基づいて、ハイブリッド符号化ブロック割当符号量が演算され、このハイブリッド符号化ブロック割当符号量が変換係数割当符号量演算手段3bに出力される(S14)。
【0080】
そして、予測誤差値演算手段3aで、入力画素および符号化モードに基づいて、予測誤差値が演算され、この予測誤差値が符号化効率評価値演算手段3eに出力される(S15)。そしてまた、変換係数割当符号量演算手段3bで、入力画素および符号化モードに基づいて、符号化モード・動きベクトル発生手段3cで発生された符号化モードにおける符号化モード符号量と入力画素の直流成分を符号化する際の符号量である直流係数符号量とが演算される。さらに、この変換係数割当符号量演算手段3bで、これら符号化モード符号量および直流係数符号量と、ハイブリッド符号化ブロック割当符号量演算手段3dで演算されたハイブリッド符号化ブロック割当符号量とに基づいて、変換係数割当符号量が演算され、符号化効率評価値演算手段3eに出力される(S16)。
【0081】
すると、符号化効率評価値演算手段3eで、予測誤差値演算手段3aにて演算された予測誤差値および変換係数割当符号量演算手段3bにて演算された変換係数割当符号量に基づいて、符号化効率を示す評価値が演算され、この評価値が符号化モード選択手段3fに出力される(S17)。なお、図3に示すフローチャートに図示を省略したが、この符号化効率評価値演算手段3eの動作では、FPFDのフラグが“1”の場合、つまり、フレーム予測、フレームDCTのみが使用される場合、このFPFDにおけるFPFD符号化効率(符号化画面毎の符号化効率を示す評価値)が演算される。また、個々のハイブリッド符号化ブロックの符号化効率が入力された場合、符号化画面毎に平均して、FPFD符号化効率(符号化画面毎の符号化効率を示す評価値)が演算される。
【0082】
その後、符号化モード選択手段3fで、符号化効率評価値演算手段3eにて演算された評価値に基づいて、符号化モードが選択され(符号化モード情報となる)、この符号化モード情報が動き補償予測部5に出力される(S18)。なお、図3に示すフローチャートに図示を省略したが、符号化モード選択手段3fの選択機能によって、ハイブリッド符号化ブロックを任意に選択する符号化モード(任意選択符号化モード)と、ハイブリッド符号化ブロックを一部に選択する符号化モード(一意選択符号化モード)とが選択される場合、各ハイブリッド符号化ブロックの予測誤差値の逆数と、変換係数割当符号量との積の平均値を比較し、平均値が最大となる符号化モード選択される。
【0083】
S11にて、イントラマクロブロックを取り扱うと判断されなかった場合(S11、No)、入力画素が予測誤差値演算手段3aに入力される(S19)。また、符号化モード・動きベクトル発生手段3cで発生された符号化モード(選択対象となる符号化モードに関する情報)および動きベクトルが予測誤差値演算手段3a、変換係数割当符号量演算手段3bに、符号化モード(選択対象となる符号化モードに関する情報)が符号化モード選択手段3fにそれぞれ入力される(S20)。
【0084】
さらに、ハイブリッド符号化ブロック割当符号量演算手段3dで、バッファ制御部25から入力された符号化画面割当符号量に基づいて、ハイブリッド符号化ブロック割当符号量が演算され、このハイブリッド符号化ブロック割当符号量が変換係数割当符号量演算手段3bに出力される(S21)。
【0085】
そして、予測誤差値演算手段3aで、入力画素、参照画素、符号化モードおよび動きベクトルに基づいて、予測誤差値が演算され、この予測誤差値が符号化効率評価値演算手段3eに出力される(S22)。そしてまた、変換係数割当符号量演算手段3bで、符号化モードおよび動きベクトルに基づいて、符号化モード・動きベクトル発生手段3cで発生された符号化モードにおける符号化モード符号量と入力画素および参照画素から得られる動きベクトルに基づく符号量である動きベクトル符号量とが演算される。さらに、この変換係数割当符号量演算手段3bで、これら符号化モード符号量および動きベクトル符号量とハイブリッド符号化ブロック割当符号量演算手段3dで演算されたハイブリッド符号化ブロック割当符号量とに基づいて、変換係数割当符号量が演算され、符号化効率評価値演算手段3eに出力される(S23)。
【0086】
すると、符号化効率評価値演算手段3eで、予測誤差値演算手段3aにて演算された予測誤差値および変換係数割当符号量演算手段3bにて演算された変換係数割当符号量に基づいて、符号化効率を示す評価値が演算され、この評価値が符号化モード選択手段3fに出力される(S17)。その後、符号化モード選択手段3fで、符号化効率評価値演算手段3eにて演算された評価値に基づいて、符号化モードが選択され(符号化モード情報となる)、この符号化モード情報が動き補償予測部5に出力される(S18)。
【0087】
(符号化モード[マクロブロックモード]、動きベクトルの決定について)
次に、図4を参照して、符号化モード[マクロブロックモード]、動きベクトルの決定の仕方について説明する。この図4に示すように、符号化効率評価値演算手段3eに予測誤差値および変換係数割当符号量が入力されると、評価値が演算され、この評価値が符号化モード選択手段3fに出力される。
【0088】
この符号化効率評価値演算手段3eにおける評価値は、評価値EMM、変換係数割当符号量(DCT係数割当符号量)TC、予測誤差値Dとすると、この評価値EMMは以下に示す式によって演算されるものである。
MM=TC/D・・・(1)
【0089】
この(1)式に示すように、評価値EMMは、予測誤差値Dの逆数と、変換係数割当符号量(DCT係数割当符号量)TCとの積で表すことができるものである。すなわち、この符号化モード選択手段3fでは、(1)式によって計算される評価値EMMが最大となる符号化モード(マクロブロックモード)と動きベクトルとの組み合わせが選択される。
【0090】
(イントラマクロブロックの予測誤差値の演算方法について)
次に、図5を参照して、イントラマクロブロックの予測誤差値の演算方法について説明する(適宜図1参照)。イントラマクロブロックを符号化モード決定部3で処理し、予測誤差値を演算する場合、図5に示すように、予測誤差値演算手段3aに符号化モードおよび入力画素が入力され、予測誤差値演算手段3a内において、変換ブロック画素分散が求められ、この変換ブロック画素分散が予測誤差値として出力される。この予測誤差値を予測誤差値Dとすると、以下に示す式によって演算される。
【0091】
【数1】

Figure 0004243472
【0092】
・・・(2)
この(2)式において、VARは、変換ブロック(DCTブロック)における入力画素の分散、block_countは、マクロブロックを構成する変換ブロック(DCTブロック)の個数を示すものである。
【0093】
この(2)式に示すように、予測誤差値Dは、マクロブロック内の変換ブロック(DCTブロック)の入力画素の分散を求め、この入力画素の分散の平均を取ったものである。
【0094】
これによれば、予測誤差値演算手段3aで、入力画素(画像データ)を所定の大きさに分割した変換ブロックを直流係数に基づいて符号化する符号化モードにおける予測誤差値Dが、変換ブロックの入力画素の分散平均とされる。つまり、変換ブロック毎に分散が求められ、ハイブリッド符号化ブロックを構成する変換ブロックの平均を予測誤差値として演算しており、この予測誤差値Dが符号化効率を示す評価値の算出に利用され、この評価値に基づいて符号化モードが選択され、この符号化モードが符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0095】
(イントラマクロブロックの変換係数割当符号量の演算方法について)
次に、図6を参照して、イントラマクロブロックの変換係数割当符号量の演算方法について説明する(適宜図1参照)。イントラマクロブロックを符号化モード決定部3で処理し、変換係数割当符号量を演算する場合、図6に示すように、変換係数割当符号量演算手段3b内において、符号化モードおよび入力画素が符号量演算機能3b1に入力され、符号化モード符号量および直流係数符号量が求められる。続いて、これら符号化モード符号量および直流係数符号量と、ハイブリッド符号化ブロック割当符号量とが変換係数割当符号量演算機能3b2に入力され、変換係数割当符号量が求められ、出力される。この変換係数割当符号量を変換係数割当符号量TCとすると、以下に示す式によって演算される。
【0096】
【数2】
Figure 0004243472
【0097】
・・・(3)
この(3)式において、TMはハイブリッド符号化ブロック割当符号量(マクロブロック割当符号量)、SMMは符号化モード(マクロブロックモード)の発生符号量、SDCは、変換ブロック(DCTブロック)の直流係数(イントラDC係数)の発生符号量、block_countは、マクロブロックを構成する変換ブロック(DCTブロック)の個数を示すものである。
【0098】
この(3)式に示すように、変換係数割当符号量TCは、ハイブリッド符号化ブロック割当符号量(マクロブロック割当符号量)TMから符号化モード(マクロブロックモード)の発生符号量SMMと、変換ブロック(DCTブロック)の直流係数(イントラDC係数)の発生符号量SDCとを減算したものである。
【0099】
これによれば、変換係数割当符号量演算手段3bで、入力画素(画像データ)を所定の大きさに分割した変換ブロックを直流係数に基づいて符号化する符号化モードにおける変換係数割当符号量TCが、ハイブリッド符号化ブロック割当符号量TMと変換ブロックを直流係数により符号化する際に生じる発生符号量SDCとに基づいて算出される。この変換係数割当符号量TCが符号化効率を示す評価値の算出に利用され、この評価値に基づいて符号化モードが選択され、この符号化モードが符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0100】
(インターマクロブロックの予測誤差値の計算方法について[平均二乗誤差])次に、図7を参照して、インターマクロブロックの予測誤差値の演算方法について説明する(適宜図1参照)。インターマクロブロックを符号化モード決定部3で処理し、予測誤差値を演算する場合、図7に示すように、予測誤差値演算手段3aに符号化モード、動きベクトル、入力画素および参照画素が入力され、予測誤差値演算手段3a内において、平均二乗誤差が演算され、この平均二乗誤差が予測誤差値として出力される。この予測誤差値を予測誤差値Dとすると、以下に示す式によって演算される。
【0101】
【数3】
Figure 0004243472
【0102】
・・・(4)
この(4)式において、M1(i,j)は、ハイブリッド符号化ブロック(マクロブロック)の入力画素と、動き補償による参照画素の平均二乗誤差である。Xm、nは現フレーム/フィールドにおける水平m、垂直nの位置の画素、Xm+i,n+jは参照フレーム/フィールドにおける水平m+i,垂直n+jの位置の画素である。この(4)式に示すように、予測誤差値Dは、入力画素と参照画素との誤差を二乗した値をハイブリッド符号化ブロックで平均したものである。
【0103】
これによれば、予測誤差値演算手段3aで、動き補償により入力画素(画像データ)を符号化する符号化モードにおける予測誤差値Dが、ハイブリッド符号化する際のハイブリッド符号化ブロックの入力画素と参照画素との誤差を二乗した値をハイブリッド符号化ブロックで平均した平均二乗誤差とされる。平均二乗誤差の算出は、入力画素と参照画素との誤差を二乗した値を演算することで、画素上におけるエネルギの算出に相当し、直交変換を用いた変換符号化における周波数上のエネルギと同次元で優劣が比較できることになり、予測誤差値の精度が向上する。この予測誤差値Dが符号化効率を示す評価値の算出に利用され、この評価値に基づいて符号化モードが選択され、この符号化モードが符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0104】
(インターマクロブロックの予測誤差値の計算方法について[平均絶対値])
次に、図8を参照して、インターマクロブロックの予測誤差値の演算方法について説明する(適宜図1参照)。インターマクロブロックを符号化モード決定部3で処理し、予測誤差値を演算する場合、図8に示すように、予測誤差値演算手段3aに符号化モード、入力画素および参照画素が入力され、予測誤差値演算手段3a内において、平均絶対値誤差が演算され、この平均絶対値誤差が予測誤差値として出力される。この予測誤差値を予測誤差値Dとすると、以下に示す式によって演算される。
【0105】
【数4】
Figure 0004243472
【0106】
・・・(5)
この(5)式において、M2(i,j)は、ハイブリッド符号化ブロック(マクロブロック)の入力画素と、動き補償による参照画素の平均絶対値誤差である。Xm、nは現フレーム/フィールドにおける水平m、垂直nの位置の画素、Xm+i,n+jは参照フレーム/フィールドにおける水平m+i,垂直n+jの位置の画素である。この(5)式に示すように、予測誤差値Dは、入力画素と参照画素の平均絶対値誤差である。
【0107】
これによれば、予測誤差値演算手段3aで、動き補償により入力画素(画像データ)を符号化する符号化モードにおける予測誤差値Dが、ハイブリッド符号化する際のハイブリッド符号化ブロックの入力画素と参照画素との誤差の絶対値をハイブリッド符号化ブロックで平均した値とされる。絶対値の平均を取るだけの平均絶対値誤差を予測誤差値とすることで、予測誤差値演算手段3aの演算量が軽減され、処理速度が向上する。この予測誤差値Dが符号化効率を示す評価値の算出に利用され、この評価値に基づいて符号化モードが選択され、この符号化モードが符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0108】
(インターマクロブロックの予測誤差値の計算方法について[相互相関係数])次に、図9を参照して、インターマクロブロックの予測誤差値の演算方法について説明する(適宜図1参照)。インターマクロブロックを符号化モード決定部3で処理し、予測誤差値を演算する場合、図9に示すように、予測誤差値演算手段3aに符号化モード、入力画素および参照画素が入力され、予測誤差値演算手段3a内において、相互相関係数が演算され、この相互相関係数が予測誤差値として出力される。この予測誤差値を予測誤差値Dとすると、以下に示す式によって演算される。
【0109】
【数5】
Figure 0004243472
【0110】
・・・(6)
この(6)式において、M3(i,j)は、ハイブリッド符号化ブロック(マクロブロック)の入力画素と、動き補償による参照画素の相互相関係数である。Xm、nは現フレーム/フィールドにおける水平m、垂直nの位置の画素、Xm+i,n+jは参照フレーム/フィールドにおける水平m+i,垂直n+jの位置の画素である。この(6)式に示すように、予測誤差値Dは、入力画素と参照画素の相互相関係数である。
【0111】
これによれば、予測誤差値演算手段3aで、動き補償により入力画素(画像データ)を符号化する符号化モードにおける予測誤差値Dが、ハイブリッド符号化する際のハイブリッド符号化ブロックの入力画素と参照画素との相互相関係数とされる。入力画素と参照画素とを比較して、相関係数を演算した相互相関係数を予測誤差値としているので、予測誤差値の精度が向上する。この予測誤差値Dが符号化効率を示す評価値の算出に利用され、この評価値に基づいて符号化モードが選択され、この符号化モードが符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0112】
(インターマクロブロックのDCT係数割当符号量の計算方法について)
次に、図10を参照して、インターマクロブロックの変換係数割当符号量の演算方法について説明する(適宜図1参照)。インターマクロブロックを符号化モード決定部3で処理し、変換係数割当符号量を演算する場合、図10に示すように、変換係数割当符号量演算手段3b内において、符号化モードおよび動きベクトルが符号量演算機能3b1に入力され、符号化モード符号量および動きベクトル符号量が求められる。続いて、これら符号化モード符号量および動きベクトル符号量とハイブリッド符号化ブロック割当符号量とが変換係数割当符号量演算機能3b2に入力され、変換係数割当符号量が求められ、出力される。この変換係数割当符号量を変換係数割当符号量TCとすると、以下に示す式によって演算される。
【0113】
C=TM−SMM−SMV
【0114】
・・・(7)
この(7)式において、TMはハイブリッド符号化ブロック割当符号量(マクロブロック割当符号量)、SMMは符号化モード(マクロブロックモード)の発生符号量、SMVは、動きベクトルの発生符号量を示すものである。
【0115】
この(7)式に示すように、変換係数割当符号量TCは、ハイブリッド符号化ブロック割当符号量(マクロブロック割当符号量)TMから符号化モード(マクロブロックモード)の発生符号量SMMと、動きベクトルの発生符号量SMVとを減算したものである。
【0116】
これによれば、変換係数割当符号量演算手段3bで、動き補償により画像データを符号化する符号化モードにおける変換係数割当符号量TCが、ハイブリッド符号化ブロック割当符号量TMと、符号化モード(マクロブロックモード)の発生符号量SMMと、動き補償に供される動きベクトルにより符号化する際に生じる発生符号量SMVとに基づいて算出される。この変換係数割当符号量TCが符号化効率を示す評価値の算出に利用され、この評価値に基づいて符号化モードが選択され、この符号化モードが符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0117】
(FPFDの決定方法について[その1])
次に、図11を参照して、ハイブリッド符号化ブロック(マクロブロック)において符号化する変換ブロックを任意に選択する、または、一意に選択する画面符号化モードであるFPFD(符号化パラメータ)について説明する。この図11は画面全体の符号化効率を演算しFPFD(符号化パラメータ)を決定する場合について説明した図である。
【0118】
この図11に示すように、符号化効率評価値演算手段3eの符号化画面合計機能3e1にハイブリッド符号化ブロックの変換係数割当符号量が入力され、符号化画面合計機能3e2にハイブリッド符号化ブロックの予測誤差値が入力される。符号化画面合計機能3e1から符号化画面の変換係数割当符号量が、符号化画面合計機能3e2から符号化画面の予測誤差値が出力され、符号化効率計算機能3e3に入力され、この符号化効率計算機能3e3でFPFD符号化効率を表す評価値(符号化画面の平均の符号化率を表す評価値)が計算され、計算されたFPFD符号化効率を表す評価値(符号化画面の平均の符号化率を表す評価値)が符号化モード選択手段3fに出力される。このFPFD符号化効率を表す評価値(符号化画面の平均の符号化率を表す評価値)を評価値EFとすると、以下に示す式によって演算される。
【0119】
【数6】
Figure 0004243472
【0120】
・・・(8)
この(8)式において、Dは予測誤差値、T は変換係数符号量、MB_countは符号化画面を構成するハイブリッド符号化ブロック(マクロブロック)の個数を示すものである。
【0121】
この(8)式に示すように、符号化画面の符号化効率を表す評価値Eは、各ハイブリッド符号化ブロック(マクロブロック)の予測誤差値Dを符号化画面毎に合計したものを、変換係数符号量T を符号化画面毎に合計したもので除算したものである。そして、この符号化画面平均の画面の符号化率を表す評価値Eが最大となるFPFD(符号化パラメータ)が符号化モード選択手段3fで選択される。
【0122】
これによれば、符号化効率評価値演算手段3eで演算された評価値EFが最大となるFPFD(符号化パラメータ)が符号化モード選択手段3fで選択され、FPFD(符号化パラメータ)が符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0123】
(FPFDの決定方法について[その2])
次に、図12を参照して、ハイブリッド符号化ブロック(マクロブロック)において符号化する変換ブロックを任意に選択する、または、一意に選択する画面符号化モードであるFPFD(符号化パラメータ)の別の決定方法について説明する。この図12はハイブリッド符号化ブロック毎に符号化効率を演算しFPFD(符号化パラメータ)を決定する場合について説明した図である。
【0124】
この図12に示すように、符号化効率評価値演算手段3eの符号化画面平均機能3e4にハイブリッド符号化ブロックの符号化効率が入力され、この符号化画面平均機能3e4でFPFD符号化効率を表す評価値(符号化画面の平均の符号化率を表す評価値)が計算され、計算されたFPFD符号化効率を表す評価値(符号化画面の平均の符号化率を表す評価値)が符号化モード選択手段3fに出力される。このFPFD符号化効率を表す評価値(符号化画面の平均の符号化率を表す評価値)を評価値EFとすると、以下に示す式によって演算される。
【0125】
【数7】
Figure 0004243472
【0126】
・・・(9)
この(9)式において、 MM は各ハイブリッド符号化ブロック(マクロブロック)の符号化効率を表す評価値、MB_countは符号化画面を構成するハイブリッド符号化ブロック(マクロブロック)の個数を示すものである。
【0127】
この(9)式に示すように、符号化画面平均の画面の符号化率を表す評価値Eは、各ハイブリッド符号化ブロック(マクロブロック)の符号化効率を表す評価値E MM の合計をハイブリッド符号化ブロック(マクロブロック)の個数で除算したものである。そして、この符号化画面平均の画面の符号化率を表す評価値Eが最大となるFPFD(符号化パラメータ)が符号化モード選択手段3fで選択される。
【0128】
これによれば、符号化効率評価値演算手段3eで演算された評価値EFが最大となるFPFD(符号化パラメータ)が符号化モード選択手段3fで選択されるので、FPFD(符号化パラメータ)が符号化画面割当符号量(符号化ビットレート)の増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0129】
(マクロブロック割当符号量の演算方法について)
次に、図13を参照して、ハイブリッド符号化ブロック(マクロブロック)の割当符号量の演算方法について説明する。図13は、バッファ制御部25とハイブリッド符号化ブロック割当符号量演算手段3dとによってハイブリッド符号化ブロック(マクロブロック)の符号量を演算する仕方について説明した図である。
【0130】
この図13に示すように、バッファ制御部25から符号化画面毎に割り当てられる符号量である符号化画面割当符号量がハイブリッド符号化ブロック割当符号量演算手段3dに入力され、このハイブリッド符号化ブロック割当符号量演算手段3dで各ハイブリッド符号化ブロックに割り当てられるハイブリッド符号化ブロック割当符号量が演算される。このハイブリッド符号化ブロック割当符号量をハイブリッド符号化ブロック割当符号量TMとすると、以下に示す式によって演算される。
【0131】
【数8】
Figure 0004243472
【0132】
・・・(10)
この(10)式において、TPはバッファ制御部25から与えられる符号化画面割当符号量、MB_countは符号化画面を構成するハイブリッド符号化ブロック(マクロブロック)の個数を示すものである。
【0133】
この(10)式に示すように、ハイブリッド符号化ブロック割当符号量TMは、バッファ制御部25から与えられる符号化画面割当符号量TPをハイブリッド符号化ブロック(マクロブロック)の個数で除算したものである。
【0134】
これによれば、バッファ制御部25から与えられる符号化画面割当符号量TPの増減によって、ハイブリッド符号化ブロック割当符号量TMも増減するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0135】
(画像符号化装置の効果について)
最後に、画像符号化装置1と、従来技術の段落で説明したTM5とについて、符号化シミュレーションを行った結果、画像符号化装置1で確認された顕著な効果について説明する。なお、バッファ制御部25の構成はTM5(エンコーダ、従来技術の説明参照)と同様とした。
【0136】
ITEハイビジョン標準動画像“European Market”、“Whale Show”、“Green Leaves”について、画像符号化装置1における符号化ビットレートを11,15Mbpsとし、TM5における符号化ビットレートを11,15,22Mbpsとして、PSNR(Peak Signal to Noise Ratio)の比較を行った。
【0137】
すると、同一ビットレートのTM5と比較した結果、いずれの画像(シーン)においても1〜3dB程度の画質の改善を確認することができ、画像符号化装置1の符号化ビットレートが15MbpsにおけるPSNRは、TM5の符号化ビットレート22Mbps以上のPSNRであることを確認することができた。
【0138】
また、画像符号化装置1によって符号化されたビットストリームを視聴した視聴者によって、視覚的にも全ての画像(シーン)で解像度感が向上し、特に、動きの速い映像では画質改善効果が高いことが確認された。
【0139】
さらに、15Mbpsで符号化したビットストリームについて、画像符号化装置1における変換係数符号量と動きベクトル符号量との比率と、TM5における変換係数符号量と動きベクトル符号量との比率とを比較すると、いずれの画像(シーン)においても動きベクトル符号量が1/5〜1/6に低減され、変換係数符号量が増加していることが確認でき、変換係数に符号量が多く割り当てられることで、画質改善できたことが確認できた。
【0140】
以上、一実施形態に基づいて本発明を説明したが、本発明はこれに限定されるものではない。
【0141】
例えば、画像符号化装置1の各構成の処理を一つずつの過程ととらえた画像符号化方法とみなすこともできる。また、画像符号化装置1の各構成の処理を汎用的なコンピュータ言語で記述した画像符号化プログラムとみなすこともできる。これらの場合、画像符号化装置1と同様の効果を得ることができ、さらに、画像符号化プログラムの場合、当該プログラムをネットワークに配信したり、或いは当該プログラムを記憶できる記憶媒体に記憶させて流通させたりすることも可能である。
【0142】
請求項1、3、記載の発明によれば、画像データを符号化する際の誤差値と、変換係数に割り当てられる変換係数割当符号量とが演算される。誤差値と、変換係数割当符号量とに基づいて評価値が演算され、この評価値に基づいた符号化モードが選択され、選択された符号化モードにより、画像データが符号化される。このため、変換係数割当符号量が符号化ビットレートの増減によって変化するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【0143】
また、請求項1、3、4記載の発明によれば、画像データを所定の大きさに分割したハイブリッド変換ブロックに含まれる変換ブロック毎に分散を求め、ハイブリッド符号化ブロックを構成する変換ブロックの分散の平均を、イントラ符号化モードにおける誤差値として得ることができると共に、この誤差値が利用され、最適な符号化モードが選択されるので、符号化した画像データの画質劣化を抑制することができる。
【0144】
また、請求項1、3、4記載の発明によれば、入力画素と参照画素の誤差を二乗した値を、ハイブリッド符号化ブロックで平均した平均二乗誤差をインター符号化モードにおける誤差値とすることにより、直交変換を用いた変換符号化における周波数上のエネルギと同次元で優劣が比較できると共に、この誤差値が利用されて、最適な符号化モードが選択されるので、符号化した画像データの画質劣化を抑制することができる。
【0145】
また、請求項1、3、4記載の発明によれば、入力画素と参照画素の誤差の絶対値をハイブリッド符号化ブロックで平均した平均絶対値誤差をインター符号化モードにおける誤差値とすることにより、予測誤差値演算手段における演算量を軽減することができると共に、この誤差値が利用され、最適な符号化モードが選択されるので、符号化した画像データの画質劣化を抑制することができる。
【0146】
また、請求項1、3、4記載の発明によれば、入力画素と参照画素とを比較して、相関係数を演算した相互相関係数によって、精度の向上したインター符号化モードにおける誤差値を得ることができると共に、この誤差値が利用され、最適な符号化モードが選択されるので、符号化した画像データの画質劣化を抑制することができる。
【0147】
請求項記載の発明によれば、ハイブリッド符号化ブロックの割当符号量が、画像データに含まれる画面を構成するハイブリッド符号化ブロック数で演算された符号量とされ、符号化ビットレートの増減によって、ハイブリッド符号化ブロックの割当符号量も増減するので、符号化ビットレートが低くなっても、最適な符号化モードが選択され、符号化した画像データの画質劣化を抑制することができる。
【図面の簡単な説明】
【図1】本発明による一実施の形態である画像符号化装置のブロック図である。
【図2】画像符号化装置の動作を説明したフローチャートである。
【図3】符号化モード決定部の動作を説明したフローチャートである。
【図4】符号化モードの決定方法について説明した図である。
【図5】イントラマクロブロックの予測誤差値の演算方法について説明した図である。
【図6】イントラマクロブロックの変換係数割当符号量の演算方法について説明した図である。
【図7】インターマクロブロックの予測誤差値の演算方法(平均二乗誤差)について説明した図である。
【図8】インターマクロブロックの予測誤差値の演算方法(平均絶対値誤差)について説明した図である。
【図9】インターマクロブロックの予測誤差値の演算方法(相互相関係数)について説明した図である。
【図10】インターマクロブロックの変換係数割当符号量の演算方法について説明した図である。
【図11】FPFDの決定方法(符号化画面全体)について説明した図である。
【図12】FPFDの決定方法(ハイブリッド符号化ブロック)について説明した図である。
【図13】ハイブリッド符号化ブロック(マクロブロック)割当符号量の演算方法について説明した図である。
【図14】従来の画像符号化装置のブロック図である。
【符号の説明】
1 画像符号化装置
3 符号化モード決定部
3a 予測誤差値演算手段
3b 変換係数割当符号量演算手段
3c 符号化モード・動きベクトル発生手段
3d ハイブリッド符号化ブロック割当符号量演算手段
3e 符号化効率評価値演算手段
3f 符号化モード選択手段
5 動き補償予測部
7 減算器
9 DCT部
11 量子化器
13 逆量子化器
15 IDCT部
17 加算器
19 フレームメモリ
21 可変長符号部
23 バッファ
25 バッファ制御部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image encoding device, an image encoding method, and an image encoding program for encoding an image by hybrid encoding combining predictive encoding and transform encoding.
[0002]
[Prior art]
In general, as a method of encoding image data such as a moving image, a moving image by hybrid encoding combining prediction encoding for performing motion compensation prediction using a motion vector and transform encoding using a DCT (orthogonal cosine transform) coefficient. Image coding methods are widely used.
[0003]
In this moving picture coding system, there is MPEG-2 video (see Non-Patent Document 1) as a moving picture coding used for digital television broadcasting or the like. TM5 (Test Model 5, ISO / IEC JTC1 / SC29 / WG11 / N0400, MPEG93 / 475) can be cited as a moving picture encoding method compliant with the MPEG-2 video. This is an encoder that realizes the MPEG-2 video standard in the encoding system.
[0004]
Here, the MPEG-2 video will be described in detail.
In MPEG-2 video, in addition to a progressive sequence in which all the frame samples constituting the screen indicate the same time instant, an interless sequence in which alternate scan lines of the frame indicate different moments in time is supported. Therefore, it is standardized so that frame processing or field processing can be adaptively selected hierarchically. One frame consists of two fields. In addition, when encoding one frame as one screen or when encoding two fields as two screens, it is determined that the initial screen (original image) is to be encoded. This is called a structured screen structure (image structure). One frame encoded as one screen is referred to as a frame image, and each of two fields encoded as two screens is referred to as a field image. These frame images and field images are adaptive in units of frames (arbitrary). Can be selected.
[0005]
When the frame image is encoded, the DCT type of the frame DCT or the field DCT can be used properly. The initial image is a macroblock (luminance component 16 pixels × 16 lines and color difference components corresponding to this area). Further, the macroblock is divided into fine blocks (both luminance and chrominance components are each 8 pixels × 8 lines) and DCT-coded according to each DCT type. When frame DCT is used for the DCT type, the fine block is composed of alternating lines from two fields, and when the field DCT is used for the DCT type, the fine block is one line from the two fields. Consists of.
[0006]
The macroblock includes an intra macroblock that encodes the original image using information of only the macroblock, and an inter macroblock that encodes the original image based on prediction of the previously encoded image. There is. In addition, prediction types in predictive coding are roughly classified into two types: field prediction and frame prediction. Field prediction uses a previously encoded field and performs prediction independently for the top field and the bottom field. In frame prediction, prediction is performed from a previously encoded frame.
[0007]
In the field image, all prediction types are field prediction, and in the frame image, the prediction type can be selected for each macroblock for field prediction or frame prediction. However, when the FPFD (Frame Pred Frame Dct) flag is set to “1” in the frame image, only the frame DCT and the frame prediction are used, and in the field image, the FPFD flag is set to “0”.
[0008]
In MPEG-2 video, picture types in which an initial image is encoded include I, P, and B (I picture, P picture, and B picture). An I picture is an image encoded using only its own information, and is composed only of intra macroblocks. A P picture is an image that has been encoded using motion prediction compensation from a reference image in the past (before encoding the P picture), and includes an intra macro block and an inter macro block for forward prediction predicted from the past. Has been. A B picture is an image that is encoded using motion prediction compensation from a reference image in the past (before the B picture is encoded) and in the future (after the B picture is encoded), and is predicted from an intra macroblock and the past. Forward prediction, backward prediction predicted from the future, and inter-macroblocks of bidirectional prediction predicted from the past and the future.
[0009]
By the way, only the prediction types other than the prediction types in the above-described predictive encoding will be described until the supplement, for example, there are prediction types such as “dual prime” and “16 × 8 motion compensation”. In “dual prime”, one motion vector in the original image and a difference vector smaller than this motion vector are used. In “16 × 8 motion compensation”, two sets of motion vectors of the upper and lower parts of the 16 × 8 region are used for each macroblock, and “16 × 8 motion compensation” is used only for field images.
[0010]
By the way, in this MPEG-2 video-compliant moving image coding system, determination of a motion vector and a macroblock mode is performed as follows.
[0011]
In this moving image coding method, first, for each prediction type, the absolute value prediction errors of the motion vectors of the selection candidates are compared, and the motion vector that minimizes the absolute value prediction error is selected. Next, the mean square prediction error of each prediction type is compared, and the prediction type that minimizes the mean square prediction error is selected. Finally, the macroblock input error variance is compared with the mean square prediction error of the selected prediction type. If the variance of the input error is smaller, the intra macroblock is less than the mean square prediction error. , Select each intra macroblock of the selected prediction type.
[0012]
Buffer control in transform coding is performed by adjusting the DCT coefficient generation code amount based on the quantized value of the DCT coefficient obtained by feedback control from the buffer occupancy.
[0013]
For reference, FIG. 14 shows a conventional image encoding apparatus that encodes image data by this moving image encoding method. In this image encoding device 101, the encoding mode determination unit 103 determines how to encode image data (input pixels) input from video input. The encoding mode determination unit 103 calculates a prediction error value from the input pixel and the reference pixel (pixel input before the input pixel) stored in the frame memory, and based on the prediction error value The encoding mode is determined.
[0014]
[Non-Patent Document 1]
ISO / IEC13818-2 1995 (Video compression standard)
[0015]
[Problems to be solved by the invention]
However, in the conventional MPEG-2 video-compliant moving image coding method, the coding bit rate is not considered in the selection criteria of the motion vector, the prediction type, and the macroblock mode, so the same image data (video) can be used. For example, regardless of the encoding bit rate, the generated code amounts generated for the information related to the motion vector and the macroblock mode are substantially equal. When the encoding bit rate is lowered, the ratio of the generated code amount such as a motion vector tends to increase. As a result, the allocated code amount to the DCT coefficient decreases. There is a problem that the image quality of the processed image data deteriorates.
[0016]
Accordingly, an object of the present invention is to solve the problems of the conventional techniques described above, and image coding that can suppress deterioration in the image quality of the coded image data even when the coding bit rate is lowered in hybrid coding. An apparatus, an image encoding method, and an image encoding program are provided.
[0017]
[Means for Solving the Problems]
  In order to achieve the above-described object, the present invention has the following configuration.
  Claim 1InThe described image encoding device is an image encoding device that encodes image data by hybrid encoding that combines predictive encoding using motion compensated prediction based on motion vectors and transform encoding using orthogonal transform. TheThe prediction error value calculating means, the transform coefficient allocation code amount calculating means, the encoding efficiency evaluation value calculating means, the encoding mode selecting means, and the encoding means are provided.
[0018]
  According to such a configuration, the image encoding device uses the prediction error value calculation means to encode an error value when the image data is encoded by predictive encoding.As for the hybrid coding block obtained by dividing the image data into a predetermined size, the error value D in the intra coding mode 1 Is calculated by averaging the variances of the input pixels of the transform block included in the hybrid coding block, and an error value D in the inter coding mode is calculated. 2 By the mean square error, mean absolute value error, or cross-correlation coefficient between the input pixel of the hybrid coding block and the reference pixel of the block.Operate.
  ContinuedThe image encoding apparatus divides the image data into a predetermined size by the transform coefficient allocation code amount calculation means.Hybrid coding blockabout,SaidTransform coefficient allocation code amount in intra coding modeT C1 Is generated from the hybrid coding block allocation code amount allocated to the hybrid coding block at the time of the hybrid encoding, and the generated code amount of the intra coding modeIncluded in the hybrid coding blockGenerated code amount of DC coefficient of transform blockSum ofObtained by subtracting, Transform coefficient allocation code amount T in the inter coding mode C2 From the hybrid coding block allocation code amount, the generated code amount of the inter coding mode, and the generated code amount of the motion vectorFind by subtracting.
  MaIn addition, the image encoding device uses the encoding efficiency evaluation value calculation means,Evaluation value E indicating coding efficiency in the intra coding mode 1 The error value D calculated by the prediction error value calculation means 1 And the transform coefficient allocation code amount T calculated by the transform coefficient allocation code amount calculation means. C1 And an evaluation value E indicating the coding efficiency in the inter coding mode. 2 The error value D calculated by the prediction error value calculation means 2 And the transform coefficient allocation code amount T calculated by the transform coefficient allocation code amount calculation means. C2 The evaluation value indicating the coding efficiency is obtained by calculating the product of.
  SoThen, the image encoding device selects the encoding mode in which the evaluation value calculated by the encoding efficiency evaluation value calculating unit is maximized by the encoding mode selecting unit..
  SoThen, the image encoding device encodes the image data by the encoding unit in the encoding mode selected by the encoding mode selection unit.
[0019]
In other words, the motion vector and the generated code amount of the macro block mode (inter macro block or intra macro block) when encoding the image data calculated by the prediction error value calculating unit and the transform coefficient allocation code amount calculating unit are controlled. The evaluation value is calculated based on the prediction error value and the transform coefficient allocation code amount, and the evaluation value is input to the encoding mode selection unit, and the encoding mode selection unit selects the encoding mode. . In the coding efficiency evaluation value calculation means, for example, the product of the reciprocal of the prediction error value and the transform coefficient allocation code amount is calculated, and in the coding mode selection means, the evaluation value calculated by the coding efficiency evaluation value calculation means The largest of is selected.
[0020]
Also, in this encoding mode selection means, the motion vector and macroblock mode that maximize the evaluation value of the encoding efficiency for the selection candidate motion vector and macroblock mode are selected. For inter-macroblocks, the total generated code amount of the motion vector and macroblock mode information is obtained, and the subtraction from the macroblock allocation code amount is used as the DCT coefficient allocation code amount. The reciprocal of the motion vector prediction error and the DCT coefficient allocation code The value obtained by integrating the quantity is taken as the evaluation value. For the intra macroblock, the total generated code amount of the intra DC coefficient (intra direct current coefficient) and the macroblock mode information is obtained, and the subtraction from the macroblock allocation code amount is set as the DCT coefficient allocation code amount. The sum of the reciprocal of the variance and the DCT coefficient allocation code amount is taken as the evaluation value.
[0031]
  Claim2The image encoding device according to claim 11In the image encoding device described above, the encoding unit divides the screen allocation code amount allocated when encoding the screen included in the image data by the number of hybrid encoding blocks constituting the screen. The allocation code amount of the hybrid coding block at the time of the hybrid coding is obtained.
[0032]
  According to such a configuration,The image encoding device performs hybrid encoding by dividing the screen allocation code amount allocated when encoding the screen included in the image data by the number of hybrid encoding blocks constituting the screen by the encoding means. The allocated code amount of the hybrid coding block at that time is obtained.
[0033]
  Claim3The image encoding method described in 1 is obtained by converting predictive encoding for predicting an encoding target pixel based on encoded pixels and an image signal in which an encoding target image composed of the encoding target pixels is continuous. An image encoding method for encoding image data by hybrid encoding combined with transform encoding for quantizing a transform coefficient and variable-length encoding, comprising: a prediction error value calculating step; and a transform coefficient allocation code amount It includes a calculation step, a coding efficiency evaluation value calculation step, and a coding step.
[0034]
  According to this method, in the prediction error value calculation step, an error value when image data is encoded by predictive encoding.As for the hybrid coding block obtained by dividing the image data into a predetermined size, the error value D in the intra coding mode 1 Is calculated by averaging the variances of the input pixels of the transform block included in the hybrid coding block, and an error value D in the inter coding mode is calculated. 2 By the mean square error, mean absolute value error, or cross-correlation coefficient between the input pixel of the hybrid coding block and the reference pixel of the block.In the transform coefficient allocation code amount calculation step, the image data is divided into a predetermined size.Hybrid coding blockabout,SaidTransform coefficient allocation code amount in intra coding modeT C1 Is generated from the hybrid coding block allocation code amount allocated to the hybrid coding block at the time of the hybrid encoding, and the generated code amount of the intra coding modeIncluded in the hybrid coding blockGenerated code amount of DC coefficient of transform blockSum ofObtained by subtracting, Transform coefficient allocation code amount T in the inter coding mode C2 From the hybrid coding block allocation code amount, the generated code amount of the inter coding mode, and the generated code amount of the motion vectorFind by subtracting.
  SoIn the encoding efficiency evaluation value calculation step,Evaluation value E indicating coding efficiency in the intra coding mode 1 The error value D calculated by the prediction error value calculation means 1 And the transform coefficient allocation code amount T calculated by the transform coefficient allocation code amount calculation means. C1 And an evaluation value E indicating the coding efficiency in the inter coding mode. 2 The error value D calculated by the prediction error value calculation means 2 And the transform coefficient allocation code amount T calculated by the transform coefficient allocation code amount calculation means. C2 To calculate an evaluation value indicating the encoding efficiency, and in the encoding step, select an encoding mode in which the evaluation value calculated in the encoding efficiency evaluation value calculation step is maximum, The image data is encoded according to the selected encoding mode.
[0035]
  Claim4The image encoding program described in the above describes a computer for encoding image data by hybrid encoding combining prediction encoding using motion compensated prediction based on motion vectors and transform encoding using orthogonal transform. , A prediction error value calculation unit, a transform coefficient allocation code amount calculation unit, a coding efficiency evaluation value calculation unit, a coding mode selection unit, and a coding unit.
[0036]
  According to this configuration, the image encoding program uses the prediction error value calculation means to encode the error value when the image data is encoded by predictive encoding.As for the hybrid coding block obtained by dividing the image data into a predetermined size, the error value D in the intra coding mode 1 Is calculated by averaging the variances of the input pixels of the transform block included in the hybrid coding block, and an error value D in the inter coding mode is calculated. 2 By the mean square error, mean absolute value error, or cross-correlation coefficient between the input pixel of the hybrid coding block and the reference pixel of the block.And the image data is divided into a predetermined size by the transform coefficient allocation code amount calculation means.Hybrid coding blockabout,AboveTransform coefficient allocation code amount in intra coding modeT C1 Is generated from the hybrid coding block allocation code amount allocated to the hybrid coding block at the time of the hybrid encoding, and the generated code amount of the intra coding modeIncluded in the hybrid coding blockGenerated code amount of DC coefficient of transform blockSum ofObtained by subtracting, Transform coefficient allocation code amount T in the inter coding mode C2 From the hybrid coding block allocation code amount, the generated code amount of the inter coding mode, and the generated code amount of the motion vectorFind by subtracting.
  SoThen, by the coding efficiency evaluation value calculation means,Evaluation value E indicating coding efficiency in the intra coding mode 1 The error value D calculated by the prediction error value calculation means 1 And the transform coefficient allocation code amount T calculated by the transform coefficient allocation code amount calculation means. C1 And an evaluation value E indicating the coding efficiency in the inter coding mode. 2 The error value D calculated by the prediction error value calculation means 2 And the transform coefficient allocation code amount T calculated by the transform coefficient allocation code amount calculation means. C2 To calculate an evaluation value indicating the encoding efficiency, and the encoding mode selection unit selects an encoding mode that maximizes the evaluation value calculated by the encoding efficiency evaluation value calculation unit, The image data is encoded by the encoding means in the encoding mode selected by the encoding mode selection means.
[0041]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
(Configuration of image encoding device)
FIG. 1 is a block diagram of an image encoding device. As shown in FIG. 1, an image encoding device 1 outputs an input pixel (image data) input from a video input as an encoded bit stream, and includes an encoding mode determination unit 3 and a motion compensated prediction. Unit 5, subtractor 7, DCT unit 9, quantizer 11, inverse quantizer 13, IDCT unit 15, adder 17, frame memory 19, variable length coding unit 21, buffer 23 and a buffer control unit 25.
[0042]
This image encoding device 1 is adapted to MPEG-2 video encoding (ISO / IEC13818-2), and an input pixel (image data) to be encoded is converted into a picture type (I picture, P picture, B). Coding is performed based on a combination of a coding mode (macroblock mode) and a motion vector that can be selected by a picture) and an image structure (frame image, field image). This encoding mode (macroblock mode) is determined by a combination of an intra / inter macroblock, a prediction direction, a prediction type, and a DCT type.
[0043]
The encoding mode determination unit 3 determines an encoding mode which is an encoding method for encoding image data, and includes a prediction error value calculation unit 3a, a transform coefficient allocation code amount calculation unit 3b, and an encoding mode. A motion vector generation unit 3c, a hybrid coding block allocation code amount calculation unit 3d, a coding efficiency evaluation value calculation unit 3e, and a coding mode selection unit 3f are provided. The encoding mode determination unit 3 has a determination function for determining whether to handle an intra macroblock or an inter macroblock. Based on the determination result of the determination function, the intra macroblock is determined. When the inter-macroblock is handled, the information input / output is slightly different in each of the means 3a to 3f. The details will be described in the description of the operation of the encoding mode determination unit 3.
[0044]
The prediction error value calculation means 3a is configured to generate input pixels (image data) from video input, reference pixels (previous image data) held (stored) in the frame memory 19, and encoding mode / motion vector generation. A prediction error value is calculated based on the encoding mode input from the means 3c (in the case of an inter macro block, a motion vector is also input). That is, the prediction error value calculation means 3a repeatedly calculates the prediction error value according to the number of encoding modes generated by the encoding mode / motion vector generation means 3c. The prediction error value indicates the difference between the input pixel and the reference pixel. For example, when the motion of the subject drawn by the continuous input pixel is intense (fast motion video), the prediction error value becomes large. .
[0045]
  Note that if it is determined by the determination function of the encoding mode determination unit 3 that an intra macroblock is handled, this prediction error is performed.Difference value operatorIn the stage 3a, the input pixel and the encoding mode are input, and when it is determined that the inter macroblock is handled (when it is not determined that the intra macroblock is handled), the input pixel, the reference pixel, the encoding mode, and the motion A vector is input. Further, the calculation method of the prediction error value will be described later (the prediction error value calculation method of the intra macroblock shown in FIG. 5 will be described below with respect to the prediction error value of the inter macroblock shown in FIGS. 7, 8, and 9). For the calculation method, see).
[0046]
The transform coefficient allocation code amount calculation means 3b includes input pixels (image data) from a video input, a hybrid coding block allocation code amount input from the hybrid coding block allocation code amount calculation means 3d, and a coding mode / motion. Based on the coding mode input from the vector generating means 3c (in the case of an inter macroblock, a motion vector is also input), the transform coefficient allocation code amount is calculated. That is, the transform coefficient allocation code amount calculation unit 3b repeatedly calculates the transform coefficient allocation code amount according to the number of encoding modes generated by the encoding mode / motion vector generation unit 3c. The transform coefficient allocation code amount is a code amount allocated to transform coefficients, that is, DCT coefficients.
[0047]
The transform coefficient allocation code amount calculation means 3b includes a code amount calculation function 3b1 (see FIG. 6 or 10) for calculating a code amount from input information, a hybrid coding block allocation code amount, and a code amount. Based on the code amount calculated by the calculation function 3b1, it has a transform coefficient allocation code amount calculation function 3b2 (see FIG. 6 or FIG. 10).
[0048]
If it is determined by the determination function of the encoding mode determination unit 3 that an intra macroblock is handled, the input pixel and the encoding mode are input to the transform coefficient allocation code amount calculation unit 3b, and the inter macroblock is converted into an inter macroblock. When it is determined that it is handled (when it is not determined that an intra macroblock is handled), an encoding mode and a motion vector are input. When it is determined that the intra macroblock is handled, the code amount calculation function 3b1 (see FIG. 6 or 10) of the transform coefficient allocation code amount calculation means 3b outputs the encoding mode code amount and the DC coefficient code amount. When it is determined that the inter macroblock is handled (when it is not determined that the intra macroblock is handled), the code amount calculation function 3b1 (see FIG. 6 or FIG. 10) of the transform coefficient allocation code amount calculation means 3b is The coding mode code amount and the motion vector code amount are output.
[0049]
The coding mode code amount is a code amount assigned for each coding mode, the DC coefficient code amount is a code amount assigned to the DC component of the input pixel, and the motion vector code amount is a motion vector in the input pixel. This is the amount of code allocated for each. Further, the calculation method of the transform coefficient allocation code amount will be described later (for the calculation method of the transform coefficient allocation code amount of the intra macroblock shown in FIG. 6, the transform coefficient allocation code amount of the inter macroblock shown in FIG. For the calculation method, see).
[0050]
The encoding mode / motion vector generating means 3c generates an encoding mode and a motion vector. The encoding mode is to be selected by the encoding mode selection means 3f, and includes a macroblock type (intra macroblock or intermacroblock), a prediction direction (forward prediction, backward prediction, bidirectional prediction), prediction type ( Field prediction or frame prediction) and DCT type (field DCT or frame DCT) are combined.
[0051]
As for the macro block type, an intra macro block is encoded by information of only a macro block, and an inter macro block predicts current image data from image data (encoded image data) encoded immediately before. It is to be encoded.
[0052]
With regard to the prediction direction, forward prediction is to predict from the past (frame or field immediately before encoding), backward prediction is to predict from the future (frame or field immediately after encoding), Bidirectional prediction is encoding (predicting) a macroblock to be encoded from the past and the future.
[0053]
With regard to the prediction type, field prediction is performed by independently predicting the top field (odd line) and the bottom field (even line) using the previously encoded field, and the frame prediction is encoded immediately before. Prediction is performed from the frame.
[0054]
Regarding the DCT type, the image data is divided into hybrid coding blocks (macroblock: luminance component 16 pixels × 16 lines and spatially corresponding color difference components), and further converted blocks (block: both luminance components and color difference components are 8 pixels × Field DCT is a line obtained from one of two fields to form the block, and frame DCT is a line obtained alternately from two fields. It constitutes a conversion block.
[0055]
The hybrid encoding block allocation code amount calculation means 3d divides the encoding screen allocation code amount output from the buffer control unit 25 by the number of hybrid encoding blocks (the number of macroblocks) to obtain each hybrid encoding block (macroblock). ) Is calculated and output to the transform coefficient allocation code amount calculation means 3b.
[0056]
The coding efficiency evaluation value calculation unit 3e is configured to code image data based on the prediction error value calculated by the prediction error value calculation unit 3a and the transform coefficient allocation code amount calculated by the transform coefficient allocation code amount calculation unit 3b. An evaluation value indicating the conversion efficiency is calculated, and this evaluation value is output to the encoding mode selection means 3f. In this embodiment, the coding efficiency evaluation value calculation means 3e calculates the product of the reciprocal of the prediction error value and the transform coefficient allocation code amount as the evaluation value.
[0057]
  Also, this coding efficiency evaluationvalueThe calculation means 3e includes coding screen summation functions 3e1 and 3e2 for summing up the transform coefficient allocation code amount or the prediction error value of the screen to be coded from the transform coefficient allocation code amount or the prediction error value of the hybrid coding block. Encoding efficiency calculation function 3e3 (see FIG. 11 and FIG. 12) for calculating an evaluation value based on the sum of transform coefficient allocation code amounts of screens to be calculated and the sum of prediction error values of screens to be encoded, It has a coding screen average function 3e4 that counts the coding efficiency of the hybrid coding block for each coding screen and outputs the average of the coding efficiency for each coding screen as the FPFD coding efficiency. The evaluation value calculation method will be described later.
[0058]
The encoding mode selection unit 3f selects an encoding mode based on the evaluation value calculated and output by the encoding efficiency evaluation value calculation unit 3e, and sends the selected encoding mode information to the motion compensation prediction unit 5. Output. In this embodiment, the encoding mode selection unit 3f selects the maximum (maximum evaluation value) among the evaluation values calculated and output by the encoding efficiency evaluation value calculation unit 3e.
[0059]
The encoding mode selection means 3f includes an encoding mode for arbitrarily selecting a hybrid encoding block (optional selection encoding mode) and an encoding mode for uniquely selecting a hybrid encoding block (unique selection encoding mode). And a selection function for selecting. This selection function compares the average value of the product of the reciprocal of the prediction error value of each hybrid encoding block constituting the encoding target image to be encoded and the transform coefficient allocation code amount, and this average value is maximized. A coding mode (an arbitrary coding mode or a unique selection coding mode) is selected. That is, in this case, the encoding mode selection unit 3f does not refer to the evaluation value calculated and output by the encoding efficiency evaluation value calculation unit 3e, but from the prediction error value calculation unit 3a and the transform coefficient allocation code amount calculation unit 3b. The prediction error value and the transform coefficient allocation code amount are obtained, and the average value of the products of the reciprocal of the prediction error value of each hybrid coding block and the transform coefficient allocation code amount is calculated and compared.
[0060]
That is, the selection function of the encoding mode selection means 3f is to determine the FPFD when the frame image is structured. When FPFD = 0, the prediction type can be arbitrarily selected from three types of frame prediction, field prediction, and dual prime prediction for each hybrid coding block (macroblock) (optional coding mode), and the DCT type is Any one of the two types of frame DCT and field DCT can be selected. When FPFD = 1, all hybrid coding blocks (macroblocks) on the coding screen (one screen) are uniquely selected with a prediction type of frame prediction and a DCT type of frame DCT (unique selection coding mode). It is. Note that the FPFD can be set for each encoded screen.
[0061]
The motion compensation prediction unit 5 holds the input pixel (image data) input from the video input and the frame memory 19 based on the encoding mode information output from the encoding mode selection unit 3 f of the encoding mode determination unit 3. A motion compensated prediction signal (an interframe prediction error signal in which motion is compensated in units of macroblocks) related to a P picture and a B picture from a reference pixel that is stored (stored), and a subtracter 7 and an adder 17 is output.
[0062]
The subtracter 7 outputs compensated prediction signal subtraction pixel data obtained by subtracting the motion compensation prediction signal from the input pixel input from the video input to the DCT unit 9.
[0063]
The DCT unit 9 divides the compensated prediction signal subtraction pixel data into transform block units, and based on the coding mode information output from the coding mode selection means 3f, DCT obtained by applying frame DCT and field DCT to the transform block The coefficient value is output to the quantizer 11. Note that the direct current component (intra DC) of the transform block of the intra macroblock is quantized with an accuracy of 8 to 11 bits, and the alternating current component is quantized with a quantization value given from the buffer control unit 25. Also, the conversion block of the inter macro block is quantized by the quantization value given from the buffer control unit 25 for both the DC component and the AC component.
[0064]
The quantizer 11 converts the DCT coefficient value output from the DCT unit 9 into a quantized value based on the encoded screen allocation code amount output from the buffer control unit 25, and the inverse quantizer 13 And it outputs to the variable-length encoding part 21.
[0065]
The inverse quantizer 13 inversely quantizes the quantized value quantized by the quantizer 11 to generate an original DCT coefficient value and outputs it to the IDCT unit 15.
[0066]
The IDCT unit 15 inversely converts the DCT coefficient value output from the inverse quantizer 13 into compensated prediction signal subtracted pixel data output from the subtractor 7 and outputs it to the adder 17.
[0067]
The adder 17 outputs a pixel (image data) obtained by adding the motion compensation prediction signal generated by the motion compensation prediction unit 5 to the compensated prediction signal subtraction pixel data output from the IDCT unit 15 to the frame memory 19 as a reference pixel. To do.
[0068]
The frame memory 19 stores the reference pixels output from the adder 17 in units of frames, and when a new input pixel is input from the video input, the prediction error value calculation means 3a of the encoding mode determination unit 3 and A reference pixel is output to the motion compensation prediction unit 5.
[0069]
The variable length code unit 21 is a two-dimensional variable in which one variable length code is assigned to the combination of the number of coefficient values 0 and the next coefficient value to the quantized value output from the quantizer 11. Long coding is performed to generate a bit stream.
[0070]
  Buffer 23 is a variable length markPartThe bit stream encoded in 21 is temporarily stored and then output to the outside.
[0071]
Based on the bit stream output from the buffer 23, the buffer control unit 25 calculates a coding screen allocation code amount that is a code amount that can be allocated to one screen (one frame), and performs coding mode determination unit 3 and quantum Is output to the generator 11. The encoded screen allocation code amount corresponds to the encoded bit rate. Also, the motion compensation prediction unit 5, the subtractor 7, the DCT unit 9, the quantizer 11, the inverse quantizer 13, the IDCT unit 15, the adder 17, the frame memory 19, the variable length coding unit 21, the buffer 23, and buffer control The unit 25 corresponds to the encoding means described in the claims.
[0072]
According to the image encoding device 1, the prediction error value calculation unit 3a of the encoding mode determination unit 3 calculates a prediction error value when encoding an input pixel (image data), and the prediction error value is encoded. Is output to the efficiency evaluation value calculation means 3e. Further, the transform coefficient allocation code amount calculation means 3b calculates the transform coefficient allocation code amount allocated to the transform coefficient when the input pixel (image data) is encoded. The encoding efficiency evaluation value calculation means 3e calculates the product of the reciprocal of the prediction error value and the transform coefficient allocation code amount as the evaluation value, and the encoding mode selection means 3f calculates the maximum value of this evaluation value ( The encoding mode based on the maximum evaluation value) is selected. Then, motion compensation prediction unit 5, subtractor 7, DCT unit 9, quantizer 11, inverse quantizer 13, IDCT unit 15, adder 17, frame memory 19, variable length coding unit 21, buffer 23 and buffer control The unit 25 encodes the image data in the encoding mode selected by the encoding mode selection unit 3f. Therefore, a coding mode is selected based on an evaluation value that maximizes the product of the reciprocal of the prediction error value and the transform coefficient allocation code amount, and this encoding mode is the encoded screen allocation code amount (encoding bit rate). ), The optimum encoding mode is selected even when the encoding bit rate is low, and deterioration of the image quality of the encoded image data can be suppressed.
[0073]
(Operation of image coding apparatus)
Next, the operation of the image coding apparatus 1 will be described with reference to the flowchart shown in FIG. 2 (see FIG. 1 as appropriate). First, input pixels (image data) are input from the video input, and the input pixels (image data) are input to the encoding mode determination unit 3, the motion compensation prediction unit 5, and the subtractor 7 (S1).
[0074]
Subsequently, the motion compensated prediction signal output from the motion compensated prediction unit 5 is subtracted from the input pixel input to the subtractor 7 and input to the DCT unit 9 as compensated prediction signal subtracted pixel data. The DCT unit 9 sequentially converts the DCT coefficient value to the quantized value, the quantizer 11 to the quantized value, the inverse quantizer 13 to the DCT coefficient value, and the IDCT unit 15 to the compensated prediction signal subtracted pixel data sequentially. The Then, the adder 17 adds the motion compensated prediction signal to the compensated prediction signal subtraction pixel data, and holds (accumulates) it in the frame memory 19 as the previous input pixel (reference pixel). Through this frame memory 19, reference pixels are input to the prediction error value calculation means 3a and the motion compensation prediction unit 5 of the encoding mode determination unit 3 (S2).
[0075]
The quantized value converted by the quantizer 11 is input to the variable length coding unit 21, a bit stream is generated by the variable length coding unit 21, and input to the buffer control unit 25. Based on the input bitstream, the encoded screen allocation code amount is calculated, and this encoded screen allocation code amount is input to the encoding mode determination unit 3 and the quantizer 11 (S3).
[0076]
Then, each process (refer to the description of the operation of the coding mode determination unit 3 for details) is performed inside the coding mode determination unit 3, and coding mode (macroblock mode) information is input to the motion compensation prediction unit 5. (S4). Then, based on the coding mode (macroblock mode) information, the input pixel (image data) is stored in the motion compensation prediction unit 5, the subtractor 7, the DCT unit 9, the quantizer 11, the variable length coding unit 21, and the buffer 23. Then, it is output to the outside as a bit stream (S5).
[0077]
(Operation of coding mode determination unit)
Next, the operation of the encoding mode determination unit 3 of the image encoding device 1 will be described with reference to the flowchart shown in FIG. First, it is determined whether or not an intra macroblock is handled (S11). Alternatively, this S11 may determine whether to handle an inter macro block.
[0078]
When it is determined that the intra macroblock is handled (S11, Yes), the input pixel is input to the prediction error value calculation unit 3a and the transform coefficient allocation code amount calculation unit 3b (S12). Also, the encoding mode (information relating to the encoding mode to be selected) generated by the encoding mode / motion vector generating means 3c is the prediction error value calculating means 3a, the transform coefficient allocation code amount calculating means 3b, and the encoding mode selection. It is input to the means 3f (S13).
[0079]
Further, the hybrid coding block allocation code amount calculation means 3d calculates a hybrid coding block allocation code amount based on the coding screen allocation code amount input from the buffer control unit 25, and this hybrid coding block allocation code The amount is output to the transform coefficient allocation code amount calculation means 3b (S14).
[0080]
Then, the prediction error value calculation unit 3a calculates a prediction error value based on the input pixel and the encoding mode, and outputs the prediction error value to the encoding efficiency evaluation value calculation unit 3e (S15). In addition, the transform coefficient allocation code amount calculation unit 3b, based on the input pixel and the encoding mode, encodes the coding mode code amount in the coding mode generated by the coding mode / motion vector generation unit 3c and the direct current of the input pixel. A DC coefficient code amount, which is a code amount when the component is encoded, is calculated. Further, the transform coefficient allocation code amount calculation means 3b is based on the coding mode code amount and DC coefficient code amount and the hybrid coding block allocation code amount calculated by the hybrid coding block allocation code amount calculation means 3d. Thus, the transform coefficient allocation code amount is calculated and output to the encoding efficiency evaluation value calculation means 3e (S16).
[0081]
Then, in the coding efficiency evaluation value calculation means 3e, the code is calculated based on the prediction error value calculated by the prediction error value calculation means 3a and the transform coefficient allocation code amount calculated by the transform coefficient allocation code amount calculation means 3b. An evaluation value indicating the conversion efficiency is calculated, and this evaluation value is output to the encoding mode selection means 3f (S17). Although not shown in the flowchart shown in FIG. 3, in the operation of the coding efficiency evaluation value calculation means 3e, when the FPFD flag is “1”, that is, when only frame prediction and frame DCT are used. Then, the FPFD encoding efficiency (an evaluation value indicating the encoding efficiency for each encoding screen) in this FPFD is calculated. When the coding efficiency of each hybrid coding block is input, the FPFD coding efficiency (an evaluation value indicating the coding efficiency for each coding screen) is calculated on an average for each coding screen.
[0082]
Thereafter, the encoding mode selection means 3f selects an encoding mode (becomes encoding mode information) based on the evaluation value calculated by the encoding efficiency evaluation value calculation means 3e. It is output to the motion compensation prediction unit 5 (S18). Although not shown in the flowchart shown in FIG. 3, a coding mode (optional coding mode) in which a hybrid coding block is arbitrarily selected by a selection function of the coding mode selection unit 3f, and a hybrid coding block When a coding mode (unique selection coding mode) is selected, the average value of the product of the reciprocal of the prediction error value of each hybrid coding block and the transform coefficient allocation code amount is compared. The encoding mode with the maximum average value is selected.
[0083]
If it is not determined in S11 that the intra macroblock is handled (S11, No), the input pixel is input to the prediction error value calculation unit 3a (S19). Also, the coding mode (information related to the coding mode to be selected) and the motion vector generated by the coding mode / motion vector generating means 3c are transferred to the prediction error value calculating means 3a and the transform coefficient allocation code amount calculating means 3b. The encoding mode (information regarding the encoding mode to be selected) is input to the encoding mode selection unit 3f (S20).
[0084]
Further, the hybrid coding block allocation code amount calculation means 3d calculates a hybrid coding block allocation code amount based on the coding screen allocation code amount input from the buffer control unit 25, and this hybrid coding block allocation code The amount is output to the transform coefficient allocation code amount calculation means 3b (S21).
[0085]
The prediction error value calculation unit 3a calculates a prediction error value based on the input pixel, the reference pixel, the encoding mode, and the motion vector, and outputs the prediction error value to the encoding efficiency evaluation value calculation unit 3e. (S22). In addition, the transform coefficient allocation code amount calculation means 3b, based on the coding mode and motion vector, the coding mode code amount, the input pixel and the reference in the coding mode generated by the coding mode / motion vector generation means 3c. A motion vector code amount that is a code amount based on a motion vector obtained from a pixel is calculated. Further, in the transform coefficient allocation code amount calculation means 3b, based on the coding mode code amount and motion vector code amount and the hybrid coding block allocation code amount calculated by the hybrid coding block allocation code amount calculation means 3d. The transform coefficient allocation code amount is calculated and output to the encoding efficiency evaluation value calculation means 3e (S23).
[0086]
Then, in the coding efficiency evaluation value calculation means 3e, the code is calculated based on the prediction error value calculated by the prediction error value calculation means 3a and the transform coefficient allocation code amount calculated by the transform coefficient allocation code amount calculation means 3b. An evaluation value indicating the conversion efficiency is calculated, and this evaluation value is output to the encoding mode selection means 3f (S17). Thereafter, the encoding mode selection means 3f selects an encoding mode (becomes encoding mode information) based on the evaluation value calculated by the encoding efficiency evaluation value calculation means 3e. It is output to the motion compensation prediction unit 5 (S18).
[0087]
(Encoding mode [macroblock mode], determination of motion vector)
Next, with reference to FIG. 4, a description will be given of how to determine a coding mode [macroblock mode] and a motion vector. As shown in FIG. 4, when the prediction error value and the transform coefficient allocation code amount are input to the encoding efficiency evaluation value calculation unit 3e, the evaluation value is calculated and the evaluation value is output to the encoding mode selection unit 3f. Is done.
[0088]
The evaluation value in the coding efficiency evaluation value calculation means 3e is the evaluation value EMM, Transform coefficient allocation code amount (DCT coefficient allocation code amount) TCWhen the prediction error value D is assumed, this evaluation value EMMIs calculated by the following equation.
EMM= TC/ D (1)
[0089]
As shown in the equation (1), the evaluation value EMMIs the reciprocal of the prediction error value D and the transform coefficient allocation code amount (DCT coefficient allocation code amount) TCCan be represented by the product of. That is, in this encoding mode selection means 3f, the evaluation value E calculated by the equation (1).MMA combination of a coding mode (macroblock mode) and a motion vector that maximizes the value is selected.
[0090]
(Calculation method of prediction error value of intra macroblock)
Next, a calculation method of a prediction error value of an intra macroblock will be described with reference to FIG. 5 (see FIG. 1 as appropriate). When an intra macroblock is processed by the encoding mode determination unit 3 and a prediction error value is calculated, as shown in FIG. 5, the encoding mode and the input pixel are input to the prediction error value calculation means 3a, and the prediction error value calculation is performed. Within the means 3a, a transform block pixel variance is obtained, and this transform block pixel variance is output as a prediction error value. When this prediction error value is a prediction error value D, the calculation is performed according to the following equation.
[0091]
[Expression 1]
Figure 0004243472
[0092]
... (2)
In this equation (2), VAR represents the variance of input pixels in the transform block (DCT block), and block_count represents the number of transform blocks (DCT blocks) constituting the macro block.
[0093]
As shown in the equation (2), the prediction error value D is obtained by calculating the variance of the input pixels of the transform block (DCT block) in the macroblock and taking the average of the variances of the input pixels.
[0094]
According to this, the prediction error value D in the encoding mode in which the prediction error value calculation unit 3a encodes the conversion block obtained by dividing the input pixel (image data) into a predetermined size based on the DC coefficient is converted into the conversion block. Is the average of the variance of the input pixels. That is, variance is obtained for each transform block, and the average of transform blocks constituting the hybrid coding block is calculated as a prediction error value, and this prediction error value D is used to calculate an evaluation value indicating coding efficiency. The encoding mode is selected based on the evaluation value, and the encoding mode changes depending on the increase / decrease of the encoding screen allocation code amount (encoding bit rate). Therefore, even if the encoding bit rate decreases, the optimal An encoding mode is selected, and image quality deterioration of encoded image data can be suppressed.
[0095]
(Intra macroblock transform coefficient allocation code amount calculation method)
Next, with reference to FIG. 6, a method for calculating the transform coefficient allocation code amount of the intra macroblock will be described (see FIG. 1 as appropriate). When the intra macroblock is processed by the encoding mode determination unit 3 and the transform coefficient allocation code amount is calculated, the encoding mode and the input pixel are encoded in the transform coefficient allocation code amount calculation means 3b as shown in FIG. It is input to the quantity calculation function 3b1, and the coding mode code quantity and the DC coefficient code quantity are obtained. Subsequently, the coding mode code amount, the DC coefficient code amount, and the hybrid coding block allocation code amount are input to the transform coefficient allocation code amount calculation function 3b2, and the transform coefficient allocation code amount is obtained and output. This transform coefficient allocation code amount is converted into a transform coefficient allocation code amount T.CThen, it is calculated by the following formula.
[0096]
[Expression 2]
Figure 0004243472
[0097]
... (3)
In this equation (3), TMIs a hybrid coding block allocation code amount (macroblock allocation code amount), SMMIs the amount of generated code in the coding mode (macroblock mode), SDCRepresents the amount of generated code of the DC coefficient (intra DC coefficient) of the transform block (DCT block), and block_count represents the number of transform blocks (DCT blocks) constituting the macro block.
[0098]
As shown in the equation (3), the transform coefficient allocation code amount TCIs a hybrid coding block allocation code amount (macroblock allocation code amount) TMTo encoding mode (macroblock mode) generated code amount SMMAnd the generated code amount S of the DC coefficient (intra DC coefficient) of the transform block (DCT block)DCAre subtracted.
[0099]
According to this, the transform coefficient assignment code amount T in the coding mode in which the transform block obtained by dividing the input pixel (image data) into a predetermined size is coded based on the DC coefficient by the transform coefficient assignment code amount calculation means 3b.CIs the hybrid coding block allocation code amount TMAnd a generated code amount S generated when the transform block is encoded with a DC coefficient.DCBased on the above. This conversion coefficient allocation code amount TCIs used to calculate an evaluation value indicating encoding efficiency, and an encoding mode is selected based on the evaluation value, and this encoding mode changes according to an increase / decrease in the encoding screen allocation code amount (encoding bit rate). Even when the encoding bit rate is lowered, the optimum encoding mode is selected, and deterioration of the image quality of the encoded image data can be suppressed.
[0100]
(Regarding Calculation Method of Intermacroblock Prediction Error Value [Mean Square Error]) Next, a calculation method of the prediction error value of the intermacroblock will be described with reference to FIG. 7 (see FIG. 1 as appropriate). When the inter macroblock is processed by the encoding mode determination unit 3 and the prediction error value is calculated, as shown in FIG. 7, the encoding mode, the motion vector, the input pixel, and the reference pixel are input to the prediction error value calculation unit 3a. Then, a mean square error is calculated in the prediction error value calculation means 3a, and this mean square error is output as a prediction error value. When this prediction error value is a prediction error value D, the calculation is performed according to the following equation.
[0101]
[Equation 3]
Figure 0004243472
[0102]
... (4)
In this equation (4), M1(I, j) is the mean square error between the input pixel of the hybrid coding block (macroblock) and the reference pixel due to motion compensation. Xm and n are pixels at the position of horizontal m and vertical n in the current frame / field, and Xm + i and n + j are pixels at the position of horizontal m + i and vertical n + j in the reference frame / field. As shown in the equation (4), the prediction error value D is an average of values obtained by squaring the error between the input pixel and the reference pixel in the hybrid coding block.
[0103]
According to this, the prediction error value D in the encoding mode in which the prediction error value calculation unit 3a encodes the input pixel (image data) by motion compensation is used as the input pixel of the hybrid encoding block at the time of hybrid encoding. A value obtained by squaring the error from the reference pixel is an average square error obtained by averaging the values in the hybrid coding block. The calculation of the mean square error corresponds to the calculation of energy on the pixel by calculating a value obtained by squaring the error between the input pixel and the reference pixel, and is the same as the energy on the frequency in transform coding using orthogonal transform. Superiority and inferiority can be compared in dimension, and the accuracy of the prediction error value is improved. The prediction error value D is used to calculate an evaluation value indicating the encoding efficiency, and an encoding mode is selected based on the evaluation value. The encoding mode is an encoding screen allocation code amount (encoding bit rate). Since it changes depending on the increase / decrease, even when the encoding bit rate is lowered, the optimum encoding mode is selected, and the image quality deterioration of the encoded image data can be suppressed.
[0104]
(Inter macro block prediction error value calculation method [average absolute value])
Next, with reference to FIG. 8, a method for calculating the prediction error value of the inter macroblock will be described (see FIG. 1 as appropriate). When the inter-macroblock is processed by the encoding mode determination unit 3 and the prediction error value is calculated, as shown in FIG. 8, the encoding mode, the input pixel, and the reference pixel are input to the prediction error value calculation unit 3a. In the error value calculation means 3a, an average absolute value error is calculated, and this average absolute value error is output as a prediction error value. When this prediction error value is a prediction error value D, the calculation is performed according to the following equation.
[0105]
[Expression 4]
Figure 0004243472
[0106]
... (5)
In this equation (5), M2(I, j) is an average absolute value error between the input pixel of the hybrid coding block (macro block) and the reference pixel by motion compensation. Xm and n are pixels at the position of horizontal m and vertical n in the current frame / field, and Xm + i and n + j are pixels at the position of horizontal m + i and vertical n + j in the reference frame / field. As shown in the equation (5), the prediction error value D is an average absolute value error between the input pixel and the reference pixel.
[0107]
  According to this, the prediction error value D in the encoding mode in which the prediction error value calculation unit 3a encodes the input pixel (image data) by motion compensation is used as the input pixel of the hybrid encoding block at the time of hybrid encoding. The absolute value of the error from the reference pixel is a value obtained by averaging the hybrid coding block. Prediction error value calculation means by taking the average absolute value error that only takes the average of absolute values as the prediction error value3aThe calculation amount is reduced, and the processing speed is improved. The prediction error value D is used to calculate an evaluation value indicating the encoding efficiency, and an encoding mode is selected based on the evaluation value. The encoding mode is an encoding screen allocation code amount (encoding bit rate). Since it changes depending on the increase / decrease, even when the encoding bit rate is lowered, the optimum encoding mode is selected, and the image quality deterioration of the encoded image data can be suppressed.
[0108]
(Regarding Calculation Method of Inter-macroblock Prediction Error Value [Cross-Correlation Coefficient]) Next, the calculation method of the inter-macroblock prediction error value will be described with reference to FIG. 9 (see FIG. 1 as appropriate). When the inter-macroblock is processed by the encoding mode determination unit 3 and the prediction error value is calculated, the encoding mode, the input pixel, and the reference pixel are input to the prediction error value calculation unit 3a as shown in FIG. In the error value calculation means 3a, a cross-correlation coefficient is calculated, and this cross-correlation coefficient is output as a prediction error value. When this prediction error value is a prediction error value D, the calculation is performed according to the following equation.
[0109]
[Equation 5]
Figure 0004243472
[0110]
... (6)
In this equation (6), MThree(I, j) is a cross-correlation coefficient between the input pixel of the hybrid coding block (macroblock) and the reference pixel by motion compensation. Xm and n are pixels at the position of horizontal m and vertical n in the current frame / field, and Xm + i and n + j are pixels at the position of horizontal m + i and vertical n + j in the reference frame / field. As shown in the equation (6), the prediction error value D is a cross-correlation coefficient between the input pixel and the reference pixel.
[0111]
According to this, the prediction error value D in the encoding mode in which the prediction error value calculation unit 3a encodes the input pixel (image data) by motion compensation is used as the input pixel of the hybrid encoding block at the time of hybrid encoding. The cross correlation coefficient with the reference pixel is used. Since the cross correlation coefficient obtained by comparing the input pixel and the reference pixel and calculating the correlation coefficient is used as the prediction error value, the accuracy of the prediction error value is improved. The prediction error value D is used to calculate an evaluation value indicating the encoding efficiency, and an encoding mode is selected based on the evaluation value. The encoding mode is an encoding screen allocation code amount (encoding bit rate). Since it changes depending on the increase / decrease, even when the encoding bit rate is lowered, the optimum encoding mode is selected, and the image quality deterioration of the encoded image data can be suppressed.
[0112]
(Regarding calculation method of DCT coefficient allocation code amount of inter macro block)
Next, with reference to FIG. 10, a method of calculating the transform coefficient allocation code amount of the inter macroblock will be described (see FIG. 1 as appropriate). When the inter-macroblock is processed by the encoding mode determination unit 3 and the transform coefficient allocation code amount is calculated, the encoding mode and the motion vector are encoded in the transform coefficient allocation code amount calculation means 3b as shown in FIG. It is input to the quantity calculation function 3b1, and the encoding mode code quantity and motion vector code quantity are obtained. Subsequently, the coding mode code amount, the motion vector code amount, and the hybrid coding block allocation code amount are input to the transform coefficient allocation code amount calculation function 3b2, and the transform coefficient allocation code amount is obtained and output. The transform coefficient allocation code amount is converted into the transform coefficient allocation code amount T.CThen, it is calculated by the following formula.
[0113]
TC= TM-SMM-SMV
[0114]
... (7)
In this equation (7), TMIs a hybrid coding block allocation code amount (macroblock allocation code amount), SMMIs the amount of generated code in the coding mode (macroblock mode), SMVIndicates the generated code amount of the motion vector.
[0115]
As shown in the equation (7), the transform coefficient allocation code amount TCIs a hybrid coding block allocation code amount (macroblock allocation code amount) TMTo encoding mode (macroblock mode) generated code amount SMMAnd the generated code amount S of the motion vectorMVAre subtracted.
[0116]
According to this, the transform coefficient allocation code amount calculation means 3b performs transform coefficient allocation code amount T in a coding mode in which image data is encoded by motion compensation.CIs the hybrid coding block allocation code amount TMAnd the generated code amount S in the coding mode (macroblock mode)MMAnd a generated code amount S generated when encoding with a motion vector used for motion compensationMVBased on the above. This conversion coefficient allocation code amount TCIs used to calculate an evaluation value indicating encoding efficiency, and an encoding mode is selected based on the evaluation value, and this encoding mode changes according to an increase / decrease in the encoding screen allocation code amount (encoding bit rate). Even when the encoding bit rate is lowered, the optimum encoding mode is selected, and deterioration of the image quality of the encoded image data can be suppressed.
[0117]
(How to determine FPFD [part 1])
Next, with reference to FIG. 11, FPFD (encoding parameter) which is a screen encoding mode for arbitrarily selecting or uniquely selecting a transform block to be encoded in a hybrid encoding block (macro block) will be described. To do. FIG. 11 is a diagram illustrating a case where the encoding efficiency of the entire screen is calculated to determine the FPFD (encoding parameter).
[0118]
As shown in FIG. 11, the transform coefficient allocation code amount of the hybrid coding block is input to the coding screen total function 3e1 of the coding efficiency evaluation value calculation means 3e, and the hybrid coding block of the hybrid coding block is input to the coding screen total function 3e2. A prediction error value is input. From the coding screen total function 3e1, the coding coefficient allocation code amount of the coding screen is output, and the prediction error value of the coding screen is output from the coding screen total function 3e2, and is input to the coding efficiency calculation function 3e3. An evaluation value representing the FPFD coding efficiency (evaluation value representing the average coding rate of the coding screen) is calculated by the calculation function 3e3, and the evaluation value representing the calculated FPFD coding efficiency (the average code of the coding screen) (Evaluation value representing the conversion rate) is output to the encoding mode selection means 3f. An evaluation value representing this FPFD coding efficiency (an evaluation value representing the average coding rate of the coding screen) is used as an evaluation value E.FThen, it is calculated by the following formula.
[0119]
[Formula 6]
Figure 0004243472
[0120]
... (8)
  In this equation (8),D is the prediction error value, T C Is transform coefficient code amount, MB_count indicates the number of hybrid coding blocks (macroblocks) constituting the coding screen.
[0121]
  As shown in this equation (8), an evaluation value E representing the coding efficiency of the coding screen.FFor each hybrid coding block (macroblock)The sum of the prediction error values D for each coding screen is calculated as the transform coefficient code amount T. C Total for each encoding screenDivided by. Then, an evaluation value E representing the coding rate of the screen of the coding screen averageFThe FPFD (encoding parameter) that maximizes is selected by the encoding mode selection means 3f.
[0122]
According to this, the evaluation value E calculated by the encoding efficiency evaluation value calculation means 3e.FIs selected by the encoding mode selection means 3f, and the FPFD (encoding parameter) changes according to the increase / decrease of the encoding screen allocation code amount (encoding bit rate). Even when the rate is lowered, an optimal encoding mode is selected, and deterioration in image quality of the encoded image data can be suppressed.
[0123]
(How to determine FPFD [2])
Next, referring to FIG. 12, another transform block to be encoded in a hybrid encoding block (macroblock) is arbitrarily selected, or another FPFD (encoding parameter) that is a screen encoding mode that is uniquely selected. The determination method will be described. FIG. 12 is a diagram for explaining a case where FPFD (encoding parameter) is determined by calculating encoding efficiency for each hybrid encoding block.
[0124]
As shown in FIG. 12, the encoding efficiency of the hybrid coding block is input to the encoding screen average function 3e4 of the encoding efficiency evaluation value calculation means 3e, and the FPFD encoding efficiency is expressed by this encoding screen average function 3e4. An evaluation value (an evaluation value representing the average coding rate of the coded screen) is calculated, and an evaluation value representing the calculated FPFD coding efficiency (an evaluation value representing the average coding rate of the coded screen) is encoded. It is output to the mode selection means 3f. An evaluation value representing this FPFD coding efficiency (an evaluation value representing the average coding rate of the coding screen) is used as an evaluation value E.FThen, it is calculated by the following formula.
[0125]
[Expression 7]
Figure 0004243472
[0126]
... (9)
  In this equation (9),E MM Is an evaluation value indicating the coding efficiency of each hybrid coding block (macroblock), MB_count indicates the number of hybrid coding blocks (macroblocks) constituting the coding screen.
[0127]
  As shown in the equation (9), an evaluation value E representing the coding rate of the screen of the coding screen average.FFor each hybrid coding block (macroblock)Evaluation value E indicating coding efficiency MM The total number of hybrid coding blocks (macroblocks)Divided by. Then, an evaluation value E representing the coding rate of the screen of the coding screen averageFThe FPFD (encoding parameter) that maximizes is selected by the encoding mode selection means 3f.
[0128]
According to this, the evaluation value E calculated by the encoding efficiency evaluation value calculation means 3e.FSince the FPFD (encoding parameter) that maximizes the value is selected by the encoding mode selection means 3f, the FPFD (encoding parameter) changes with the increase / decrease of the encoding screen allocation code amount (encoding bit rate). Even when the encoding bit rate is lowered, the optimum encoding mode is selected, and the image quality deterioration of the encoded image data can be suppressed.
[0129]
(About calculation method of macroblock allocation code amount)
Next, with reference to FIG. 13, a method for calculating the allocated code amount of the hybrid coding block (macroblock) will be described. FIG. 13 is a diagram for explaining how to calculate the code amount of the hybrid coding block (macroblock) by the buffer control unit 25 and the hybrid coding block allocation code amount calculation means 3d.
[0130]
As shown in FIG. 13, an encoded screen allocation code amount, which is a code amount allocated to each encoded screen, is input from the buffer control unit 25 to the hybrid encoding block allocation code amount calculation means 3d. The allocated code amount calculation means 3d calculates the hybrid encoded block allocated code amount allocated to each hybrid encoded block. This hybrid coding block allocation code amount is converted to a hybrid coding block allocation code amount T.MThen, it is calculated by the following formula.
[0131]
[Equation 8]
Figure 0004243472
[0132]
... (10)
In this equation (10), TPIndicates the encoded screen allocation code amount given from the buffer control unit 25, and MB_count indicates the number of hybrid encoded blocks (macroblocks) constituting the encoded screen.
[0133]
As shown in the equation (10), the hybrid coding block allocation code amount TMIs the encoded screen allocation code amount T given from the buffer control unit 25PIs divided by the number of hybrid coding blocks (macroblocks).
[0134]
According to this, the encoded screen allocation code amount T given from the buffer control unit 25.PIncrease / decrease in the hybrid coding block allocation code amount TMTherefore, even when the encoding bit rate is lowered, the optimum encoding mode is selected, and the image quality deterioration of the encoded image data can be suppressed.
[0135]
(Regarding the effect of the image encoding device)
Finally, the remarkable effects confirmed by the image encoding device 1 as a result of performing the encoding simulation on the image encoding device 1 and TM5 described in the paragraph of the prior art will be described. The configuration of the buffer control unit 25 is the same as that of TM5 (encoder, see the description of the prior art).
[0136]
For the ITE high-definition standard moving images “European Market”, “Whole Show”, and “Green Leaves”, the encoding bit rate in the image encoding device 1 is 11, 15 Mbps, and the encoding bit rate in TM5 is 11, 15, 22 Mbps. PSNR (Peak Signal to Noise Ratio) was compared.
[0137]
Then, as a result of comparison with TM5 of the same bit rate, improvement in image quality of about 1 to 3 dB can be confirmed in any image (scene), and the PSNR when the encoding bit rate of the image encoding device 1 is 15 Mbps is It was confirmed that the PSNR was a TM5 encoding bit rate of 22 Mbps or more.
[0138]
In addition, the viewer who has viewed the bitstream encoded by the image encoding device 1 visually improves the resolution in all images (scenes), and in particular, the image quality improvement effect is high for fast moving images. It was confirmed.
[0139]
Further, for a bitstream encoded at 15 Mbps, when comparing the ratio between the transform coefficient code amount and the motion vector code amount in the image encoding device 1 and the ratio between the transform coefficient code amount and the motion vector code amount in TM5, In any image (scene), the motion vector code amount is reduced to 1/5 to 1/6, it can be confirmed that the transform coefficient code amount is increased, and a large amount of code amount is assigned to the transform coefficient. It was confirmed that the image quality was improved.
[0140]
As mentioned above, although this invention was demonstrated based on one Embodiment, this invention is not limited to this.
[0141]
For example, it can be regarded as an image encoding method in which the processing of each component of the image encoding device 1 is regarded as one process. The processing of each component of the image encoding device 1 can be regarded as an image encoding program described in a general-purpose computer language. In these cases, the same effects as those of the image encoding device 1 can be obtained. Further, in the case of an image encoding program, the program is distributed to a network or stored in a storage medium that can store the program. It is also possible to make it.
[0142]
  Claims 1, 3,4According to the described invention, the error value at the time of encoding the image data and the transform coefficient allocation code amount allocated to the transform coefficient are calculated. An evaluation value is calculated based on the error value and the transform coefficient allocation code amount, an encoding mode based on the evaluation value is selected, and image data is encoded using the selected encoding mode. For this reason, since the transform coefficient allocation code amount changes as the coding bit rate increases / decreases, the optimum coding mode is selected even when the coding bit rate is low, and image quality deterioration of the coded image data is suppressed. be able to.
[0143]
  Also,Claim1, 3, 4According to the described invention, the image data is divided into a predetermined size.Included in hybrid transform blockObtain the variance for each transform block and configure a hybrid coding blockconversionThe average of the block variance isIntra coding modeSince this error value is used and an optimal encoding mode is selected, image quality deterioration of encoded image data can be suppressed.
[0144]
  Also,Claim1, 3, 4According to the described invention, the mean square error obtained by averaging the value obtained by squaring the error between the input pixel and the reference pixel by the hybrid coding block is obtained.In inter coding modeBy using the error value, it is possible to compare the superiority and inferiority in the same dimension as the energy on the frequency in transform coding using orthogonal transform, and this error value is used to select the optimum coding mode. It is possible to suppress image quality deterioration of the converted image data.
[0145]
  Also,Claim1, 3, 4According to the described invention, the average absolute value error obtained by averaging the absolute value of the error between the input pixel and the reference pixel by the hybrid coding block is calculated.In inter coding modeBy using the error value, it is possible to reduce the amount of calculation in the prediction error value calculation means, and since this error value is used and the optimum encoding mode is selected, the image quality of the encoded image data is deteriorated. Can be suppressed.
[0146]
  Also,Claim1, 3, 4According to the described invention, the accuracy is improved by the cross-correlation coefficient obtained by comparing the input pixel and the reference pixel and calculating the correlation coefficient.In inter coding modeAn error value can be obtained, and since this error value is used and an optimal encoding mode is selected, image quality deterioration of encoded image data can be suppressed.
[0147]
  Claim2According to the described invention, the allocated code amount of the hybrid coding block is the code amount calculated by the number of hybrid coding blocks constituting the screen included in the image data. Since the allocated code amount of the encoded block also increases / decreases, even when the encoding bit rate is lowered, the optimal encoding mode is selected, and deterioration of the image quality of the encoded image data can be suppressed.
[Brief description of the drawings]
FIG. 1 is a block diagram of an image encoding apparatus according to an embodiment of the present invention.
FIG. 2 is a flowchart illustrating an operation of the image encoding device.
FIG. 3 is a flowchart illustrating an operation of an encoding mode determination unit.
FIG. 4 is a diagram for explaining a method for determining an encoding mode.
FIG. 5 is a diagram illustrating a calculation method of a prediction error value of an intra macroblock.
[Fig. 6] Fig. 6 is a diagram for describing a method for calculating a transform coefficient allocation code amount of an intra macroblock.
FIG. 7 is a diagram for explaining a calculation method (mean square error) of a prediction error value of an inter macroblock.
FIG. 8 is a diagram illustrating a calculation method (average absolute value error) of a prediction error value of an inter macroblock.
FIG. 9 is a diagram illustrating a calculation method (cross-correlation coefficient) of a prediction error value of an inter macroblock.
[Fig. 10] Fig. 10 is a diagram for describing a method of calculating a transform coefficient allocation code amount of an inter macroblock.
FIG. 11 is a diagram for explaining a FPFD determination method (entire encoding screen).
FIG. 12 is a diagram for explaining a FPFD determination method (hybrid coding block);
FIG. 13 is a diagram for explaining a method of calculating a hybrid coding block (macroblock) allocation code amount.
FIG. 14 is a block diagram of a conventional image encoding device.
[Explanation of symbols]
1 Image encoding device
3 Coding mode decision unit
3a Prediction error value calculation means
3b Transform coefficient allocation code amount calculation means
3c Coding mode / motion vector generating means
3d hybrid coding block allocation code amount calculation means
3e Coding efficiency evaluation value calculation means
3f encoding mode selection means
5 Motion compensation prediction unit
7 Subtractor
9 DCT section
11 Quantizer
13 Inverse quantizer
15 IDCT section
17 Adder
19 frame memory
21 Variable length code part
23 Buffer
25 Buffer controller

Claims (4)

動きベクトルによる動き補償予測を用いた予測符号化と直交変換を用いた変換符号化とを組み合わせたハイブリッド符号化によって、画像データを符号化する画像符号化装置であって、
前記予測符号化によって前記画像データを符号化した際の誤差値として、前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、イントラ符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックに含まれる変換ブロックの入力画素の分散の平均により演算し、インター符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックの入力画素と当該ブロックの参照画素との平均二乗誤差、平均絶対値誤差、又は、相互相関係数により演算する予測誤差値演算手段と、
前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、前記イントラ符号化モードにおける変換係数割当符号量 C1 を、前記ハイブリッド符号化する際のハイブリッド符号化ブロックに割り当てられるハイブリッド符号化ブロック割当符号量から、前記イントラ符号化モードの発生符号量と、当該ハイブリッド符号化ブロックに含まれる変換ブロックの直流係数の発生符号量の総和とを減算することで求め、前記インター符号化モードにおける変換係数割当符号量T C2 を、前記ハイブリッド符号化ブロック割当符号量から、前記インター符号化モードの発生符号量と、前記動きベクトルの発生符号量とを減算することで求める変換係数割当符号量演算手段と、
前記イントラ符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C1 との積を演算し、前記インター符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C2 との積を演算することで、符号化効率を示す評価値を求める符号化効率評価値演算手段と、
この符号化効率評価値演算手段で演算された評価値が最大となる符号化モードを選択する符号化モード選択手段と、
この符号化モード選択手段で選択した符号化モードにより、前記画像データを符号化する符号化手段と、
を備えることを特徴とする画像符号化装置。
An image encoding device that encodes image data by hybrid encoding combining prediction encoding using motion compensated prediction based on motion vectors and transform encoding using orthogonal transform,
Examples error value when encoding the image data by predictive coding, hybrid coding blocks obtained by dividing the image data into a predetermined size, the error value D 1 in the intra-coding mode, the hybrid coding was calculated by the average of the variance of the input pixels of the transformation block included in the block, the error value D 2 in the inter coding mode, the mean square error between the reference pixel of the input pixel and the block of the hybrid coding blocks, the average absolute A prediction error value calculation means for calculating a value error or a cross-correlation coefficient;
Wherein the hybrid coding blocks obtained by dividing the image data into a predetermined size, the intra transform coefficients assigned code amount T C1 in the coding mode, the hybrid coding hybrid coding blocks allocated to hybrid coding blocks when reduction Obtained by subtracting the generated code amount of the intra coding mode and the sum of the generated code amounts of the DC coefficients of the transform blocks included in the hybrid coding block from the allocated code amount, and converting in the inter coding mode Transform coefficient allocation code amount calculation means for obtaining the coefficient allocation code amount T C2 by subtracting the generated code amount of the inter coding mode and the generated code amount of the motion vector from the hybrid encoded block allocation code amount When,
As the evaluation value E 1 indicating the coding efficiency in the intra coding mode, the reciprocal number of the error value D 1 calculated by the prediction error value calculation unit and the transform coefficient allocation code amount calculated by the transform coefficient allocation code amount calculation unit The product of T C1 is calculated, and the evaluation value E 2 indicating the coding efficiency in the inter coding mode is used as the evaluation value E 2 , the reciprocal of the error value D 2 calculated by the prediction error value calculation means, and the transform coefficient allocation code amount calculation Coding efficiency evaluation value calculation means for calculating an evaluation value indicating coding efficiency by calculating a product of the transform coefficient allocation code amount TC2 calculated by the means;
Encoding mode selection means for selecting an encoding mode in which the evaluation value calculated by the encoding efficiency evaluation value calculation means is maximum;
Encoding means for encoding the image data according to the encoding mode selected by the encoding mode selection means;
An image encoding device comprising:
前記符号化手段は、前記画像データに含まれる画面を符号化する際に割り当てられる画面割当符号量を、前記画面を構成するハイブリッド符号化ブロック数で除算することで、前記ハイブリッド符号化する際のハイブリッド符号化ブロックの割当符号量を求めること
を特徴とする請求項1に記載の画像符号化装置。
The encoding unit is configured to divide a screen allocation code amount allocated when encoding a screen included in the image data by the number of hybrid encoding blocks constituting the screen, thereby performing the hybrid encoding. The image coding apparatus according to claim 1, wherein an allocated code amount of the hybrid coding block is obtained.
符号化済みの画素に基づいて符号化対象画素を予測する予測符号化と、前記符号化対象画素からなる符号化対象画像が連続する画像信号を変換して得られる変換係数を量子化し、可変長符号化する変換符号化とを組み合わせたハイブリッド符号化によって、画像データを符号化する画像符号化方法であって、
前記予測符号化によって前記画像データを符号化した際の誤差値として、前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、イントラ符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックに含まれる変換ブロックの入力画素の分散の平均により演算し、インター符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックの入力画素と当該ブロックの参照画素との平均二乗誤差、平均絶対値誤差、又は、相互相関係数により演算する予測誤差値演算ステップと、
前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、前記イントラ符号化モードにおける変換係数割当符号量 C1 を、前記ハイブリッド符号化する際のハイブリッド符号化ブロックに割り当てられるハイブリッド符号化ブロック割当符号量から、前記イントラ符号化モードの発生符号量と、当該ハイブリッド符号化ブロックに含まれる変換ブロックの直流係数の発生符号量の総和とを減算することで求め、前記インター符号化モードにおける変換係数割当符号量T C2 を、前記ハイブリッド符号化ブロック割当符号量から、前記インター符号化モードの発生符号量と、前記動きベクトルの発生符号量とを減算することで求める変換係数割当符号量演算ステップと、
前記イントラ符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C1 との積を演算し、前記インター符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C2 との積を演算することで、符号化効率を示す評価値を求める符号化効率評価値演算ステップと、
この符号化効率評価値演算ステップにおいて演算された評価値が最大となる符号化モードを選択して、選択した符号化モードによって前記画像データを符号化する符号化ステップと、
を含むことを特徴とする画像符号化方法。
Predictive coding for predicting the encoding target pixel based on the encoded pixels, and quantizing a conversion coefficient obtained by converting an image signal in which the encoding target image composed of the encoding target pixels is continuous, variable length An image encoding method for encoding image data by hybrid encoding combined with transform encoding for encoding,
For the hybrid coding block obtained by dividing the image data into a predetermined size, the error value D 1 in the intra coding mode is used as the error value when the image data is coded by the predictive coding. was calculated by the average of the variance of the input pixels of the transformation block included in the block, the error value D 2 in the inter coding mode, the mean square error between the reference pixel of the input pixel and the block of the hybrid coding blocks, the average absolute A prediction error value calculation step for calculating by a value error or a cross-correlation coefficient;
Wherein the hybrid coding blocks obtained by dividing the image data into a predetermined size, the intra transform coefficients assigned code amount T C1 in the coding mode, the hybrid coding hybrid coding blocks allocated to hybrid coding blocks when reduction The conversion in the inter coding mode is obtained by subtracting the generated code quantity in the intra coding mode and the sum of the generated code quantities of the DC coefficients of the transform blocks included in the hybrid coding block from the allocated code amount. the coefficients assigned code amount T C2, from the hybrid coding block allocated code quantity, the generated code amount of the inter coding mode, the transform coefficients assigned code amount calculating step of obtaining by subtracting the amount of code generated for the motion vector When,
As the evaluation value E 1 indicating the coding efficiency in the intra coding mode, the reciprocal of the error value D 1 calculated by the prediction error value calculating unit and the transform coefficient allocation code amount calculated by the transform coefficient allocation code amount calculating unit The product of T C1 is calculated, and the evaluation value E 2 indicating the coding efficiency in the inter coding mode is used as the reciprocal of the error value D 2 calculated by the prediction error value calculation means, and the conversion coefficient allocation code amount calculation A coding efficiency evaluation value calculating step for calculating an evaluation value indicating the coding efficiency by calculating a product of the transform coefficient allocation code amount T C2 calculated by the means ;
An encoding step of selecting an encoding mode in which the evaluation value calculated in the encoding efficiency evaluation value calculating step is maximum, and encoding the image data by the selected encoding mode;
An image encoding method comprising:
動きベクトルによる動き補償予測を用いた予測符号化と直交変換を用いた変換符号化とを組み合わせたハイブリッド符号化によって、画像データを符号化するために、コンピュータを、
前記予測符号化によって前記画像データを符号化した際の誤差値として、前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、イントラ符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックに含まれる変換ブロックの入力画素の分散の平均により演算し、インター符号化モードにおける誤差値D を、前記ハイブリッド符号化ブロックの入力画素と当該ブロックの参照画素との平均二乗誤差、平均絶対値誤差、又は、相互相関係数により演算する予測誤差値演算手段、
前記画像データを所定の大きさに分割したハイブリッド符号化ブロックについて、前記イントラ符号化モードにおける変換係数割当符号量 C1 を、前記ハイブリッド符号化する際のハイブリッド符号化ブロックに割り当てられるハイブリッド符号化ブロック割当符号量から、前記イントラ符号化モードの発生符号量と、当該ハイブリッド符号化ブロックに含まれる変換ブロックの直流係数の発生符号量の総和とを減算することで求め、前記インター符号化モードにおける変換係数割当符号量T C2 を、前記ハイブリッド符号化ブロック割当符号量から、前記インター符号化モードの発生符号量と、前記動きベクトルの発生符号量とを減算することで求める変換係数割当符号量演算手段、
前記イントラ符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C1 との積を演算し、前記インター符号化モードにおける符号化効率を示す評価値E として、前記予測誤差値演算手段で演算した誤差値D の逆数と、前記変換係数割当符号量演算手段で演算した変換係数割当符号量T C2 との積を演算することで、符号化効率を示す評価値を求める符号化効率評価値演算手段、
この符号化効率評価値演算手段で演算された評価値が最大となる符号化モードを選択する符号化モード選択手段、
この符号化モード選択手段で選択した符号化モードにより、前記画像データを符号化する符号化手段、
として機能させることを特徴とする画像符号化プログラム。
In order to encode image data by hybrid encoding combining predictive encoding using motion compensated prediction with motion vectors and transform encoding using orthogonal transform,
For the hybrid coding block obtained by dividing the image data into a predetermined size, the error value D 1 in the intra coding mode is used as the error value when the image data is coded by the predictive coding. was calculated by the average of the variance of the input pixels of the transformation block included in the block, the error value D 2 in the inter coding mode, the mean square error between the reference pixel of the input pixel and the block of the hybrid coding blocks, the average absolute Prediction error value calculation means for calculating by value error or cross-correlation coefficient,
Wherein the hybrid coding blocks obtained by dividing the image data into a predetermined size, the intra transform coefficients assigned code amount T C1 in the coding mode, the hybrid coding hybrid coding blocks allocated to hybrid coding blocks when reduction The conversion in the inter coding mode is obtained by subtracting the generated code quantity in the intra coding mode and the sum of the generated code quantities of the DC coefficients of the transform blocks included in the hybrid coding block from the allocated code amount. Transform coefficient allocation code amount calculation means for obtaining the coefficient allocation code amount T C2 by subtracting the generated code amount of the inter coding mode and the generated code amount of the motion vector from the hybrid encoded block allocation code amount ,
As the evaluation value E 1 indicating the coding efficiency in the intra coding mode, the reciprocal of the error value D 1 calculated by the prediction error value calculating unit and the transform coefficient allocation code amount calculated by the transform coefficient allocation code amount calculating unit The product of T C1 is calculated, and the evaluation value E 2 indicating the coding efficiency in the inter coding mode is used as the reciprocal of the error value D 2 calculated by the prediction error value calculation means, and the conversion coefficient allocation code amount calculation Coding efficiency evaluation value calculating means for calculating an evaluation value indicating the coding efficiency by calculating a product of the transform coefficient allocation code amount T C2 calculated by the means;
An encoding mode selecting means for selecting an encoding mode in which the evaluation value calculated by the encoding efficiency evaluation value calculating means is maximized;
Encoding means for encoding the image data according to the encoding mode selected by the encoding mode selection means;
An image encoding program that functions as a computer program.
JP2002326288A 2002-11-11 2002-11-11 Image coding apparatus, image coding method, and image coding program Expired - Fee Related JP4243472B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002326288A JP4243472B2 (en) 2002-11-11 2002-11-11 Image coding apparatus, image coding method, and image coding program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002326288A JP4243472B2 (en) 2002-11-11 2002-11-11 Image coding apparatus, image coding method, and image coding program

Publications (2)

Publication Number Publication Date
JP2004165751A JP2004165751A (en) 2004-06-10
JP4243472B2 true JP4243472B2 (en) 2009-03-25

Family

ID=32805232

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002326288A Expired - Fee Related JP4243472B2 (en) 2002-11-11 2002-11-11 Image coding apparatus, image coding method, and image coding program

Country Status (1)

Country Link
JP (1) JP4243472B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4781816B2 (en) * 2005-12-28 2011-09-28 パナソニック株式会社 Image coding apparatus and image coding method

Also Published As

Publication number Publication date
JP2004165751A (en) 2004-06-10

Similar Documents

Publication Publication Date Title
JP6667609B2 (en) Image encoding device, image encoding method, image decoding device, and image decoding method
JP4193406B2 (en) Video data conversion apparatus and video data conversion method
JP4391809B2 (en) System and method for adaptively encoding a sequence of images
US8396311B2 (en) Image encoding apparatus, image encoding method, and image encoding program
US20070098067A1 (en) Method and apparatus for video encoding/decoding
WO2012176381A1 (en) Moving image encoding apparatus, moving image decoding apparatus, moving image encoding method and moving image decoding method
JPWO2010137323A1 (en) Video encoding apparatus, video decoding apparatus, video encoding method, and video decoding method
US20060198439A1 (en) Method and system for mode decision in a video encoder
KR20140089486A (en) Motion compensation method and motion compensation apparatus for encoding and decoding of scalable video
KR20070090700A (en) Method of and apparatus for video intraprediction encoding/decoding
US20060239347A1 (en) Method and system for scene change detection in a video encoder
JP2011525094A (en) Rate control model adaptation based on slice dependency for video coding
KR101614828B1 (en) Method, device, and program for coding and decoding of images
JP4391810B2 (en) System and method for adaptively encoding a sequence of images
US20160373739A1 (en) Intra/inter decisions using stillness criteria and information from previous pictures
JP7343817B2 (en) Encoding device, encoding method, and encoding program
WO2012176387A1 (en) Video encoding device, video decoding device, video encoding method and video decoding method
WO2013065678A1 (en) Dynamic image encoding device, dynamic image decoding device, method for encoding dynamic image and method for decoding dynamic image
JP2011091772A (en) Image encoder
KR100807330B1 (en) Method for skipping intra macroblock mode of h.264/avc encoder
KR101086724B1 (en) ?? Deciding Method of H.264/AVC Encoder using Complexity of Frame, and H.264/AVC Encoder implementing the same
JP3480067B2 (en) Image coding apparatus and method
JP4243472B2 (en) Image coding apparatus, image coding method, and image coding program
JP5136470B2 (en) Moving picture coding apparatus and moving picture coding method
JP4243286B2 (en) Encoding method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050606

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071011

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071024

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080916

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081117

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20081209

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

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130109

Year of fee payment: 4

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20140109

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees