JP3976975B2 - Image processing apparatus and method, and storage medium - Google Patents

Image processing apparatus and method, and storage medium Download PDF

Info

Publication number
JP3976975B2
JP3976975B2 JP36525399A JP36525399A JP3976975B2 JP 3976975 B2 JP3976975 B2 JP 3976975B2 JP 36525399 A JP36525399 A JP 36525399A JP 36525399 A JP36525399 A JP 36525399A JP 3976975 B2 JP3976975 B2 JP 3976975B2
Authority
JP
Japan
Prior art keywords
frame
mode
encoding
encoding mode
frames
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
JP36525399A
Other languages
Japanese (ja)
Other versions
JP2001186523A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP36525399A priority Critical patent/JP3976975B2/en
Publication of JP2001186523A publication Critical patent/JP2001186523A/en
Application granted granted Critical
Publication of JP3976975B2 publication Critical patent/JP3976975B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、画像データを符号化或は/及び復号化するための画像処理装置及びその方法と記憶媒体に関するものである。
【0002】
【従来の技術】
従来より、動画像の符号化方式としてフレーム(画面)内符号化方式であるMotion JPEGやDigital Video等の符号化方式や、フレーム(画面)間予測符号化を用いたH.261、H.263、MPEG−1、MPEG−2等の符号化方式が知られている。前者のフレーム内符号化方式は、フレーム単位で独立に符号化するもので、フレームの管理がし易いため、動画像の編集や特殊再生が必要な装置に最適である。また後者のフレーム間符号化方式は、フレーム間予測を用いるため符号化効率が高いという特徴を持っている。
【0003】
【発明が解決しようとする課題】
一般の電話回線や無線による動画像の伝送では、ノイズや電波障害による誤りが発生する。フレーム内符号化のみを用いる方式では、誤りが発生してもその影響は各フレーム単位で閉じており、他のフレームに伝播することはない。しかしながら、フレーム内符号化のみでは符号化効率が低いため、電話線等では高解像度の動画像の伝送は難しい。また一方、フレーム間予測を用いる符号化では、ノイズなどによる誤った画像データを用いて予測フレームを復号するため、誤りが他のフレームにも伝播し、画質の劣化を長時間に亙って発生させてしまうという欠点がある。
【0004】
本発明は上記従来例に鑑みてなされたもので、誤りが発生しても発生する画質の劣化を抑制するとともに、高い符号化効率を維持できる画像処理装置及びその方法と記憶媒体を提供することを目的とする。
【0005】
また本発明の目的は、画像データの複数のフレームの各ブロックが、一定の間隔で必ず画面内符号化されるようにして、画面内符号化を行うフレーム間隔よりも短い周期で画面内符号化するブロックが存在するようにして、画面間符号化の伝送誤りによる画質の劣化の伝播を抑えることができる画像処理装置及びその方法と記憶媒体を提供することにある。
【0006】
【課題を解決するための手段】
上記目的を達成するために本発明の画像処理装置は以下のような構成を備える。即ち、 複数のフレームの画像情報を入力する入力手段と、
前記入力手段によって入力された複数のフレームのそれぞれをブロックに分割する分割手段と、
前記分割手段で得られた各ブロックを画面内符号化モード又は画面間符号化モードで符号化する符号化手段と、
前記複数のフレームにおいて一定数のフレーム間隔で位置するフレームIの符号化モードを前記画面内符号化モードに設定し、それ以外のフレームPの符号化モードを前記画面内符号化モード又は前記画面間符号化モードに選択的に設定する符号化モード設定手段と、
連続する複数のフレームPに周期的に割当てられる複数種類のモードパターンを記憶する記憶手段と、
前記記憶手段に記憶された前記モードパターンを示す情報を前記符号化した複数のフレームに多重化して出力する出力手段とを有し、
前記符号化モード設定手段は、前記モードパターンに基づいて各フレームPの符号化モードを設定し、前記複数種類のモードパターンのそれぞれは、1つのフレームPを構成する複数のブロックの夫々が前記画面内符号化モードを行うべきか前記画面間符号化モードを行うべきかを示す情報を含むことを特徴とする。
【0007】
上記目的を達成するために本発明の画像処理装置は以下のような構成を備える。即ち、
複数のフレームの画像情報において、一定数のフレーム間隔で位置するフレームIが画面内符号化モードで符号化され、それ以外のフレームPの各ブロックが画面内符号化モード又は画面間符号化モードを選択的に用いて符号化されており、符号化されたフレームPのそれぞれのブロックが連続する複数のフレームPに周期的に割当てられる複数種類のモードパターンに基づいて画面内符号化モード又は画面間符号化モードで符号化された複数のフレームと、当該フレームPに対応するモードパターンとを入力する入力手段と、
前記符号化された複数のフレームのヘッダに記録されている各ブロックの符号化モードと前記対応するモードパターンとを比較することにより符号化モードの誤りを判定する判定手段と、
前記判定手段から通知された判定結果に基づいて前記符号化モードの誤りを補正し、前記符号化された複数のフレームを復号化する復号化手段と、を有することを特徴とする。
【0008】
又上記目的を達成するために本発明の画像処理方法は以下のような工程を備える。即ち、
複数のフレームの画像情報を入力する入力工程と、
前記入力された複数のフレームのそれぞれをブロックに分割する分割工程と、
前記分割工程で得られた各ブロックを画面内符号化モード又は画面間符号化モードで符号化する符号化工程と、
前記複数のフレームにおいて一定数のフレーム間隔で位置するフレームIの符号化モードを前記画面内符号化モードに設定し、それ以外のフレームPの符号化モードを前記画面内符号化モード又は画面間符号化モードに選択的に設定する符号化モード設定工程と、
連続する複数のフレームPに周期的に割当てられる複数種類のモードパターンを記憶する記憶工程と、
前記記憶工程で記憶された前記モードパターンを示す情報を前記符号化した複数のフレームに多重化して出力する出力工程とを有し、
記符号化モード設定工程は、前記モードパターンに基づいて各フレームPの符号化モードを設定し、前記複数種類のモードパターンのそれぞれは、1つのフレームPを構成する複数のブロックの夫々が前記画面内符号化モードを行うべきか前記画面間符号化モードを行うべきかを示す情報を含むことを特徴とする。
【0009】
又上記目的を達成するために本発明の画像処理方法は以下のような工程を備える。即ち、
複数のフレームの画像情報において、一定数のフレーム間隔で位置するフレームIが画面内符号化モードで符号化され、それ以外のフレームPの各ブロックが画面内符号化モード又は画面間符号化モードを選択的に用いて符号化されており、符号化されたフレームPのそれぞれのブロックが連続する複数のフレームPに周期的に割当てられる複数種類のモードパターンに基づいて画面内符号化モード又は画面間符号化モードで符号化された複数のフレームと、当該フレームPに対応するモードパターンとを入力する入力工程と、
前記符号化された複数のフレームのヘッダに記録されている各ブロックの符号化モードと前記モードパターンとを比較することにより符号化モードの誤りを判定する判定工程と、
前記判定工程から通知された判定結果に基づいて符号化モードの誤りを補正し、前記符号化された複数のフレームを復号化する復号化工程と、を有することを特徴とする。
【0010】
【発明の実施の形態】
以下、添付図面を参照して本発明の好適な実施の形態を詳細に説明する。
【0011】
[実施の形態1]
図1は、本発明の実施の形態1に係る画像符号化装置の構成を示すブロック図である。本実施の形態では、動画像の符号化方式としてH.263符号化方式を用いた場合について説明する。また、説明を容易にするために画像サイズをQCIF(176×144)として説明するが、本発明はこれらに限定されるものではない。
【0012】
図1において、100は入力端子で、符号化する動画像データを入力するための端子である。101はフレームメモリで、入力した動画像データをフレーム単位で格納し、フレーム単位のデータが格納されると、それを通知する信号201を出力している。102はブロック切り出し器で、フレームメモリ101から符号化単位であるブロック単位に動画像データを読み出して、後続の差分器105及び動き補償器104に出力する。またブロックを切り出したことを示す信号202を符号化モード設定部114に出力している。本実施の形態1では、H.263符号化方式を例に説明しているので、符号化単位であるブロックはマクロブロックに対応している。103はフレームメモリで、復号された画像データをフレーム単位で格納する。104は動き補償器で、フレームメモリ103の内容とブロック切り出し器102から出力されるブロック単位の動画像データとに基づいて動き補償を行って符号化するモードを決定し、その予測画像データを出力する。また、この動き補償を行った場合には、その動きベクトルも出力する。
【0013】
105は差分器で、ブロック切り出し器102から出力されるブロック単位の動画像データと、動き補償器104からの予測画像データとを基に画素単位で差分を算出して予測誤差を求める。106はDCT器で、差分器105で求められた予測誤差又は画素値をDCT変換する。107は量子化器で、DCT器106で得られたDCT係数を量子化する。108はハフマン符号化器で、量子化器107で得られた量子化結果にハフマン符号を割り当てる。109は逆量子化器で、量子化器107の出力を逆量子化してDCT係数を求める。110は逆DCT器で、逆量子化器109で逆量子化されたDCT係数を逆変換して予測誤差に相当するデータを出力する。111は加算器で、動き補償器104からの予測画像データと、逆DCT器110からの予測誤差とを画素単位で加算する。
【0014】
112は動きベクトル符号化器で、動き補償器104からの動きベクトル203を入力して符号化する。113はヘッダ符号化器で、フレーム単位のヘッダやマクロブロック単位のヘッダを生成して符号化する。このヘッダにはH.263符号化方式に従って、フレームのスタートコード、フレームの符号化モード、マクロブロックの符号化モード等の符号化データが含まれる。114は符号化モード設定部で、フレームの符号化モード、マクロブロックの符号化モード等を決定する。この符号化モード設定部114は図3を参照して詳しく説明する。115はモードパターンメモリで、フレーム内のマクロブロックの符号化モードに関する情報を格納する。この詳細は後述する。116は多重化器で、ハフマン符号化器108、動きベクトル符号化器112、ヘッダ符号化器113の出力をH.263符号化方式の符号書式に従って多重化する。117は多重化された符号化データを出力する端子である。
【0015】
このような構成において、動作に先立って各部の初期化が行われる。符号化モード設定部114は、入力される動画像データにおいて、先頭のフレームに対してフレーム内符号化を行うフレームとして設定し、132フレーム毎にフレーム内符号化を行うフレームとして設定する。そして、それ以外のフレームについては、直前のフレームを参照フレームとするフレーム間符号化を行うように符号化モードを設定する。
【0016】
図3は、この符号化モード設定部114の詳細な構成を示すブロック図である。
【0017】
図3において、入力端子150は、フレームメモリ101からのフレーム単位でデータが格納された事を通知する信号201を入力する。151はフレームカウンタで、信号201に従って、処理するフレームの枚数をカウントし、このカウンタ151には初期化時に“0”がセットされる。152はフレームモード設定器で、前述の通り、最初のフレームと132フレーム毎のフレームをフレーム内符号化するフレームとするフレームモードを設定する。出力端子153は、そのフレームモードを示す信号204をヘッダ符号化器113に出力する端子である。入力端子154は、ブロック切り出し器102からブロックを切り出したことを通知する信号202を入力する端子である。155はブロックカウンタで、フレームの先頭からのブロック数をカウントしており、このブロックカウンタ155はフレームの先頭で“0”にリセットされる。156はアドレス発生器で、モードパターンメモリ115のメモリ上のアドレスを算出し、出力端子157を介してモードパターンメモリ115に出力している。入力端子158は、モードパターンメモリ115からモード信号205を入力する端子である。ラッチ159は、入力端子158からのモード信号205をラッチし、フレームモード設定器152と入力端子154からの信号204,202によって出力する。
【0018】
このような構成において、端子150から入力された信号201はフレームカウンタ151に入力されてカウントされる。このフレームカウンタ151によりカウントされた値はフレームモード設定器152に供給される。フレームモード設定器152は、そのカウント値を“132”で割った値の余りが“1”である場合はフレーム内符号化を行うモードとして、出力端子153からフレームの符号化モードを示す符号化モード信号204を出力する。またそうでない場合は、フレーム間符号化を行うモードを示すフレームの符号化モード信号204を出力端子153から出力する。
【0019】
ここでフレーム内符号化を行うフレームの場合は以下のように動作する。
【0020】
フレームモード設定器152からフレーム内符号化を行うことが指示されると、ラッチ159は常にマクロブロックがフレーム内符号化を行うように値を書き込む。そして、ブロック切り出し器102からのブロック切り出し信号202に従って、フレーム内符号化を行う信号206を端子160から動き補償器104に出力する。この時、ブロックカウンタ155はブロック数のカウントは行わない。またアドレス発生器156も動作しない。
【0021】
フレーム間符号化を行うフレームの場合は以下のように動作する。
【0022】
フレームの処理を行う前にブロックカウンタ155を“0”にリセットする。ブロック切り出し器102からのブロックの切り出し信号202が入力される度、ブロックカウンタ155はカウントを行う。このブロックカウンタ155によるカウント値はアドレス発生器156に入力される。また、アドレス発生器156は、フレームカウンタ151からもフレームのカウント値を入力する。このようにしてアドレス発生器156は、モードパターンメモリ115からモード値を読み出すアドレスを発生している。
【0023】
図2(b)〜(i)は、モードパターンメモリ115に格納されているパターンの一例を示す図である。
【0024】
図2において、QCIFの画像を例にとっており、各マス目はマクロブロックを表している。図中の黒のマス目は、該当するマクロブロックを動き補償器104における判定に関わらず、常にフレーム内符号化を行うように指示するマクロブロックの位置を表している。ここで、あるフレームにおけるフレームカウンタ151の計数値が“8”で割り切れれば図2(b)のパターンを、余りが“1”であれば(c)のパターンを、余りが“2”であれば(d)のパターンを、余りが“3”であれば(e)のパターンを、余りが“4”であれば(f)のパターンを、余りが“5”であれば(g)のパターンを、余りが“6”であれば(h)のパターンを、そして、余りが“7”であれば(i)のパターンをそれぞれ選択する。
【0025】
これは図2(a)に示した太枠の中で、8フレーム単位で、必ず各ブロックがフレーム内符号化されることを表している。即ち、ブロックカウンタ155の計数値に従って、該当するマクロブロックに対応する位置のマス目が白であれば動き補償器104で判定されたモードで、黒であれば必ずフレーム内符号化で符号化するモードとなるようにモード信号206を出力する。
【0026】
アドレス発生器156で指定されたマクロブロックのモード信号がモードパターンメモリ115から読み出され、端子158を介して入力され、ラッチ159を介して端子160から動き補償器104に出力される。
【0027】
再び図1に戻って、図1の動作を説明する。
【0028】
端子100から動画像データが逐次入力されると、その入力された動画像データはフレームメモリ101に格納される。フレームメモリ101に1フレーム分の画像データが蓄積されると、その1フレームの画像データが格納されたことを信号201により符号化モード設定部114に通知する。符号化モード設定部114は、これにより、フレームメモリ101に蓄積された1フレームの画像データに対して、フレーム内符号化をするか、或はフレーム間符号化するかを決定する。
【0029】
まず、フレーム内符号化を行う場合について述べる。
【0030】
ブロック切り出し器102は、フレームメモリ101からマクロブロック単位の画像データを切り出し、動き補償器104と差分器105に入力する。この際、動き補償器104は、マクロブロックに対して動き補償を行わず、マクロブロックの符号化モードとしてフレーム内符号化モードを出力し、差分器105、加算器111には全ての画素値に対して“0”を出力する。
【0031】
ブロック切り出し器102で切り出されたマクロブロックのデータは、差分器105で“0”が引かれ、そのままDCT器106に入力されてDCT変換され、そのDCT係数は量子化器107で量子化され、ハフマン符号化器108と逆量子化器109に入力される。ハフマン符号化器108は、H.263符号化方式で決められているハフマン符号を量子化結果に対して割り当て、多重化器116に出力する。
【0032】
また、逆量子化器109に入力された量子化結果は逆量子化され、DCT変換係数となり、逆DCT器110で予測誤差に変換される。この予測誤差(画素値)に加算器111で“0”が加えられ、フレームメモリ103の所定の位置に格納される。
【0033】
このとき動き補償器104はフレーム内符号化モードで動作しているので、動きベクトル符号化器112は動作しない。またヘッダ符号化器113は、フレームのスタートコード、フレーム内符号化を行ったことを示すフレームの符号化モード、および各マクロブロックの符号化モード等を符号化して多重化器116に出力する。多重化器116は、H.263符号化方式で決められている順に各符号化データを多重化して出力端子117から出力する。
【0034】
次に、フレーム間符号化を行う場合について述べる。
【0035】
ブロック切り出し器102は、フレームメモリ101からマクロブロック単位のデータを切り出し、動き補償器104と差分器105に入力する。動き補償器104は、符号化モード設定部114からの信号206により、該当するマクロブロックが必ずフレーム内符号化を行うマクロブロックか否かを判定し、フレーム内符号化を行うマクロブロックであれば動き補償を行わず、マクロブロックの符号化モードとしてフレーム内符号化モードをヘッダ符号化器113に出力し、差分器105、加算器111には全ての画素値に対して“0”を出力する。
【0036】
これに対し、必ずフレーム内符号化を行わない場合では、動き補償器104はマクロブロックに対して動き補償を行って予測誤差を求め、ブロックのデータを比較してマクロブロック単位にフレーム内符号化を行うか、フレーム間符号化を行うかを判定する。フレーム内符号化を行う場合は、マクロブロックの符号化モードとしてフレーム内符号化モードをヘッダ符号化器113に出力し、差分器105、加算器111には全ての画素値に対して“0”を出力する。
【0037】
一方、フレーム間符号化する場合は、マクロブロックの符号化モードとしてフレーム間符号化モードをヘッダ符号化器113に出力し、差分器105、加算器111には各予測画像データを出力する。更に、その際の動きベクトルは、動きベクトル符号化器112に出力される。動きベクトル符号化器112は、この動きベクトルを符号化して多重化器116に出力する。
【0038】
ブロック切り出し器102で切り出されたマクロブロックのデータは、差分器105で“0”又は予測値が引かれ、DCT器106に入力されてDCT変換され、そのDCT係数は量子化器107で量子化されてハフマン符号化器108と逆量子化器109に入力される。ハフマン符号化器108は、H.263符号化方式で決められているハフマン符号を量子化結果に対して割り当てて多重化器116に出力する。
【0039】
また逆量子化器109に入力された量子化結果は逆量子化されてDCT変換係数となり、逆DCT器110で画素値に変換される。この画素値に加算器111で“0”又は予測値が加えられ、フレームメモリ103の所定の位置に格納される。
【0040】
ヘッダ符号化器113は、フレームのスタートコード、フレーム間符号化を行ったことを示すフレームの符号化モード、及び各マクロブロックの符号化モード等を符号化して多重化器116に出力する。多重化器116は、H.263符号化方式で決められている順に各符号化データを多重化し、端子117から出力する。
【0041】
このような一連の選択動作により、各マクロブロックが、一定の間隔(図2の例では8フレーム毎)で必ずフレーム内符号化を行うように、各ブロックの符号化モードを容易に決定することができる。そして、実際のフレーム内符号化を行うフレーム間隔よりも短い周期で、かつ符号量を極端に増やさずに、フレーム間符号化の伝送誤りによる劣化の伝播を抑えることが可能になる。また、得られた符号化データは標準方式に完全に準拠できており、復号側に特別な構成を必要としない。
【0042】
図4は、本発明の実施の形態1に係る画像符号化装置の符号化モード設定部114による符号化モードの設定方法を説明するフローチャートである。
【0043】
まずステップS1で、動画像データを端子100からフレーム単位で入力し、その入力したフレーム数をカウントする。ステップS2では、その入力したフレームを複数のブロック(マクロブロック)に分割して、各マクロブロック毎に切り出して入力する。次にステップS3に進み、その入力したフレームが先頭フレームか、或は132番目毎に出現するフレームかを判断する。そうであればステップS4に進み、そのフレームの画像データの符号化モードをフレーム内符号化モードに設定する。
【0044】
一方、ステップS3で、先頭或は132番目毎のフレームでない時、即ち、無条件にフレーム内符号化モードで符号化するフレームでない時はステップS5に進み、ステップS5で、そのフレームが何番目のフレームであるかをみる。具体的には、そのフレーム数のカウント値を“8”で割り、その余りに基づいてモードパターンメモリ115にアクセスして、そのメモリ115に記憶されているモードパターンデータ(図2参照)を読み出す(ステップS6)。
【0045】
次にステップS7で、その読み出したパターンデータに基づいて処理を行うマクロブロックが黒(1)又は白(0)であるかを調べ、黒であればステップS9に進み、そのブロックの符号化モードをフレーム内符号化モードに設定する。一方、白であればステップS10に進み、そのブロックの符号化モードをフレーム間符号化モードに設定する。
【0046】
ここでフレーム内符号化モードの場合には、動き補償器104は差分器105、加算器111に“0”を出力し、動きベクトル符号化器112による動作を停止させ、ヘッダ符号化器113にはフレーム内符号化であることを通知する。
【0047】
また、フレーム間符号化モードの場合には、動き補償器104は差分器105、加算器111に予測誤差を出力し、動きベクトルを動きベクトル符号化器112に出力し、ヘッダ符号化器113にはフレーム間符号化であることを通知する。そして、加算器111から出力される復号画像データをフレームメモリ103に記憶しておき、そのフレームメモリ103の内容を基に、次のフレームの対応するマクロブロックを予測するとともに、差分がより小さくなる位置(動きベクトル)を求めて、動き補償フレーム間予測を行っているのは前述した通りである。
【0048】
なお、本実施の形態1において、動画像の符号化方式をH.263としたが他の符号化方式でももちろん構わない。
【0049】
また、フレームメモリの構成等は処理速度等に応じて適宜変更可能である。
【0050】
ブロック群としてGOBを単位としても構わないし、GOBに跨るような構成でも、もちろん構わない。
【0051】
又上述の実施の形態では、直交変換にDCT変換を用いて説明したがこれに限定されず、例えばウェーブレット(Wavelet)変換等を用いても、もちろん構わない。
【0052】
[実施の形態2]
図5は、本発明の実施の形態2に係る画像符号化装置の構成を示すブロック図である。なお、前述の実施の形態1と同様の構成要素については同一番号を付して、それらの詳細な説明は省略する。
【0053】
201はモードパターンメモリで、前述の実施の形態1のモードパターンメモリ115とは、その記憶内容と出力先が異なる。202はヘッダ符号化器で、前述の実施の形態1のヘッダ符号化器113に、パターンメモリ201の内容を符号化して出力する機能が付加されている。203は多重化器で、パターンメモリ201の内容を表す符号化データを多重化する機能が付加されている。
【0054】
本実施の形態2においては、前述の実施の形態1と同様に、H.263符号化方式を例にとって説明する。
【0055】
この符号化に先駆けて、モードパターンメモリ201の内容をヘッダ符号化器202で符号化する。
【0056】
この実施の形態2に係るモードパターンメモリ201の内容を図6に示す。
【0057】
図6(a)において、フレームを分割した各マス目には、(1)から(13)までの数字が記されており、それぞれが周期的にフレーム内符号化するマクロブロックのグループとなっている。例えば、(1)が記されたマクロブロックは、フレーム間符号化を行うフレームにおいて、8フレームで必ずフレーム内符号化モードで符号化される。以下、(2)〜(12)までのブロックについても同様である。尚、(13)が記されたブロックは3つしかないので、これらは3フレーム周期でフレーム内符号化されることになる。その様子が実施の形態1の図2と同様に図6(b)〜(i)で示されている。
【0058】
ヘッダ符号化器202はまず、フレーム内符号化を必ず行うマクロブロック(黒)を“1”とし、そうでないマクロブロック(白)を“0”として、マクロブロックの配置順にそれぞれのフレーム毎にランレングス符号化を行う。これらの符号化データは、先頭フレームのH.263符号化方式の予備挿入情報(PEI)およびスペア情報(PSPARE)として挿入され、多重化器203で所定の書式に従って多重化される。
【0059】
この実施の形態2に係る動画像データの符号化は、前述の実施の形態1と同様にして行われる。即ち、フレーム内符号化を行うフレームについては通常のフレーム内符号化を行い、フレーム間符号化を行うフレームでは、符号化モード設定器114が、フレームのカウント値とブロックのカウント値からモードパターンメモリ201を参照し、符号化対象であるマクロブロックがフレーム内符号化をすべきかどうかを判定し、必ずフレーム内符号化を行わない場合は、動き補償器104の判定に基づいて、その符号化対象のマクロブロックの符号化モードを決定する。こうして各符号化モードで符号化されたデータは、多重化器203で多重化され、端子117から出力される。
【0060】
以上説明したように本実施の形態2によれば、復号側に、フレーム内符号化を行ったマクロブロックの位置を知らせることができる。これによって、伝送路の誤りによる劣化が生じる場合でも、誤りの伝播を断ち切ることができるフレーム内符号化モードにより符号化されたマクロブロックの位置を知ることができ、誤りの検出や誤りによる劣化の補正を容易にできる効果がある。
【0061】
又、図6のようなパターンデータの構成にすることにより、フレーム内符号化を必ず行うマクロブロックのブロック群をランダムに配置させることができ、フレーム内符号化が行われるブロックの周期を目立たせなくできるという効果がある。
【0062】
また、1フレーム内で、フレーム内符号化モードで符号化するマクロブロックが適宜存在することにより、MPEG−1,2,4等の符号化方式においても、フレーム内符号化フレームの間隔を広げることができるため符号化効率を悪化させることはない。
【0063】
[実施の形態3]
図7は、本発明の実施の形態3に係る画像復号装置の構成を示すブロック図である。
【0064】
図7において、300は符号化データを入力する端子であり、301は分離器で、各符号化データを後段の各復号器に渡すために分離している。ここで端子300から入力される符号化データは、前述の実施の形態2の符号化装置で生成され、伝送路上で誤りが生じる可能性のある伝送路を経て入力されたものを例にとって説明する。分離器301の動作は、前述の実施の形態2における多重化器203の逆の動作である。
【0065】
302はヘッダ復号器で、フレーム単位のヘッダやマクロブロック単位のヘッダを復号する。このヘッダ復号器302の動作は、前述の実施の形態2におけるヘッダ符号化器202の逆の動作である。303はモードパターンメモリ、304は符号化モード判定器である。これらは実施の形態2におけるモードパターンメモリ201、符号化モード設定部114と同様に動作する。
【0066】
305は誤り判定器で、符号化データの誤りを検出する。306は動きベクトルの復号を行う動きベクトル復号器、309はハフマン符号を復号し、量子化されたDCT係数を獲得するハフマン復号器である。これらは前述の実施の形態2における動きベクトル符号化器112、ハフマン符号化器108と逆の動作をする。
【0067】
307,314はフレームメモリで、復号した画像を格納する。308は動き補償器で、復号された動きベクトルを用いてフレームメモリ307からマクロブロック単位の予測画像を生成する。310は逆量子化器で、ハフマン復号されたコードに対して逆量子化を行ってDCT係数を獲得する、311は逆DCT器で、DCT係数から画素値または予測誤差値を獲得する。312は加算器で、予測画像と復号された予測誤差とを加算する。313は誤り補正器で、誤り判定器305で検出された誤りに従って画像データを補正する。315は再生された復号画像を出力する出力端子である。
【0068】
このような構成において、まず動作に先立って各部の初期化が行われる。端子300を介して入力された符号化データは分離器301に入力される。この分離器301は、フレーム及びマクロブロックのヘッダに関する符号化データや、図5のモードパターンメモリ201の内容を符号化した符号化データをヘッダ復号器302に出力し、動きベクトルに関する符号化データを動きベクトル復号器306に出力し、ハフマン符号化データをハフマン復号器309にそれぞれ分離して出力する。
【0069】
ヘッダ復号器302は、分離器301から入力された符号化データを復号し、各フレーム、マクロブロックの各ヘッダ、フレーム内符号化したマクロブロックのフレーム周期とその位置を復号する。この復号結果に基づき、モードパターンメモリ303にそれらのパターンを格納する。このパターンは、例えば前述の図6に示すようなパターンである。
【0070】
各フレームの復号の際には、ヘッダ復号器302はフレームのヘッダを復号し、そのフレームがフレーム内符号化モード/フレーム間符号化モードのいずれで符号化されたかを復号によって知る。
【0071】
ここで、そのフレームがフレーム内符号化されている場合は、そのフレームの各マクロブロックはフレーム内符号化されているため、動きベクトル復号器306は動作せず、動き補償器308も各画素値に対して常に“0”を加算器312に出力する。またハフマン復号器309は、入力された符号化データを復号し、量子化されたDCT係数を獲得する。このハフマン復号時に誤りが検出された場合は、その情報を誤り補正器313に出力する。例えば、復号した結果、DCT変換係数が64個以上出現したとか、存在しない符号を復号しようとした場合などが、この誤りの検出に該当する。この場合、次のGOBの先頭まで復号を中断し、符号化データをスキップしたことを誤り補正器313に通知する。
【0072】
一方、誤りがない場合は、量子化されたDCT係数は逆量子化器310で逆量子化された後、逆DCT器311で画素値に変換される。こうして得られた画素値は加算器312で“0”が加えられ、誤り補正器313に入力される。誤り補正器313は、誤りが有ればスキップしたマクロブロックのデータを前フレームのマクロブロックの値で代用すべくフレームメモリ307から読み出して補正する。一方、誤りがない場合はそのまま入力を出力する。こうして誤り補正器313から出力された画素データは、フレームメモリ314とフレームメモリ307の所定の位置に格納され、フレームメモリ314の内容は端子315を介して出力される。
【0073】
ここで、そのフレームがフレーム間符号化モードで符号化されていた場合は、最初に符号化モード判定器304は、復号するフレームが先頭から何番目のフレームのフレーム間符号化フレームであるかを、フレーム数のカウント値に基づいて検知する。更に、最初にフレームのヘッダ情報に含まれていたフレーム内符号化マクロブロックの出現する周期と比較し、モードパターンメモリ303から、復号するフレームのフレーム内符号化されたマクロブロックの位置を読み込む。符号化モード判定器304は、復号するマクロブロックの位置をマクロブロックのカウント値によって検知し、そのマクロブロックがフレーム内符号化されたマクロブロックか否かを誤り判定器305に入力する。
【0074】
ヘッダ復号器302は、各マクロブロックのヘッダを復号しており、復号されたマクロブロックの符号化モードは、誤り判定器305に入力される。誤り判定器305は、そのマクロブロックがフレーム内符号化されるべきマクロブロックであった場合には、マクロブロックがフレーム内符号化されているかどうかを比較し、フレーム内符号化されていなかった場合には誤りである旨を、誤り補正器313とハフマン復号器309、ヘッダ復号器302のそれぞれに通知する。
【0075】
ヘッダ復号器302、ハフマン復号器309はそのまま復号を続けるが、次のGOBの先頭が復号されるまで誤り補正器313は、その復号した画像データを蓄積する。フレーム内符号化されるべきマクロブロックとGOBまでのマクロブロックの数を計数し、その計数した数だけ戻った前のマクロブロックがフレーム内符号化されているかを判定する。これらマクロブロックがフレーム内符号化モードであれば、フレーム内符号化されるべきマクロブロックであったとして、再生した画像データをフレームメモリ307,314の該当位置に格納する。これはマクロブロックのカウント値に誤りが生じたと判断できるためである。
【0076】
また誤り判定器305が誤りを検出しない場合、フレーム内符号化モードで符号化されたマクロブロックであれば、動きベクトル復号器306を動作させず、動き補償器308も各画素値に対して常に“0”を加算器312に出力する。一方、動き補償を行って符号化されたマクロブロックであれば、動きベクトル復号器306を動作させ、その復号した動きベクトルを動き補償器308に入力し、フレームメモリ307から動き補償による予測画素値を生成して加算器312に出力する。
【0077】
またハフマン復号器309は、入力された符号化データを復号し、量子化されたDCT係数を獲得する。このハフマン復号時に誤りが検出された場合は、その情報を誤り補正器313に出力し、フレーム内符号化の時の誤り補正と同様に補正する。一方、誤りがない場合は、その量子化されたDCT係数は逆量子化器310で逆量子化され、逆DCT器311で画素値に変換される。こうして得られた画素値は、フレーム内符号化モードあれば加算器312で“0”を、そうでなければ加算器312で予測画素値が加えられる。こうして誤り補正器313から出力された画素のデータは、フレームメモリ314とフレームメモリ307の所定の位置に格納され、フレームメモリ314の内容は端子315を介して、復号された画像データとして出力される。
【0078】
図8は、本発明の実施の形態3に係る画像復号化装置における復号化処理を説明するフローチャートである。
【0079】
まずステップS21で、端子300より符号データを入力し、その入力した符号を分離器301で、ヘッダ、動きベクトル及びハフマンコード部分に分離する。ステップS22では、その復号したフレーム及びブロックのヘッダを解析して符号化モード判定器304に通知するとともに、フレーム間符号化の場合には動きベクトル復号器306、動き補償器308の動作をイネーブルにする。次にステップS23に進み、符号化されて送られてくるモードパターンデータを復号してモードパターンメモリ303に格納する。
【0080】
ステップS24では、そのフレームがフレーム内符号化されたフレームかどうかを調べ、そうであればステップS25に進み、その入力したフレームをフレーム内復号化処理により復号する。この場合には、動きベクトル復号器306、動き補償器308の動作をディスイネーブルにする。
【0081】
ステップS24でフレーム内符号化でない時はステップS26に進み、そのフレームが何番目のフレームかどうかを調べる。ステップS27で、先頭或は132番目毎のフレームであるかどうかを調べ、そうであればステップS33に進み、本来フレーム内符号化されるべきフレームがフレーム間符号化されていたことになるため、誤り判定器305に誤りである旨を通知し、ステップS34で、誤り補正器313による誤り補正を行う。
【0082】
またステップS27でフレーム内符号化されるべきフレームでなかった場合はステップS28に進み、復号対象のブロックがフレーム内符号化されたブロックかどうかを、カウントしたブロック数(そのフレーム内における受信ブロック数)とステップS23でモードパターンメモリ303に記憶されたパターンデータとに基づいて判断する。ここでフレーム内符号化されるべきブロックであればステップS31に進み、そのブロックがフレーム内符号化されているかどうかを調べ、そうでない時はステップS33のエラー処理に進むが、フレーム内符号化されている時はステップS32に進み、ステップS25と同様にして、フレーム内符号化コードの復号処理を実行する。
【0083】
またステップS28で、フレーム内符号化されるべきブロックでないと判定されるとステップS29に進み、その動きベクトルの復号、動き補償(ステップS30)等を行って、そのブロックを復号する。
【0084】
以上説明したように本実施の形態3によれば、復号側で、フレーム内符号化されるべきマクロブロックの位置を知ることによって、フレーム内符号化されたデータかどうかにより伝送路の誤りを検知することが出来る。これに基づき、誤りによる画像劣化の補正を容易にでき、かつ画質の劣化を抑制することも可能になる。
【0085】
また本実施の形態3では、前述の実施の形態2で生成された符号を用いて説明を行ったが、前述の実施の形態1のモードパターンメモリ115と同じ内容をモードパターンメモリ303に予め格納しておけば同様の動作を行わせることができることはいうまでもない。
【0086】
<その他の実施の形態>
以上の説明では、マクロブロック群の構成、実施の形態2の符号化モード設定器114におけるモード設定方法(モードパターンメモリ201の構成)を符号化データとともに伝送する方式について説明したが、本発明はこれに限定されず、事前に誤りのない伝送路又は誤り耐性が強い方式を用いて伝送することも可能であり、限られた端末では、これらを予め個々の機器に格納しておくことももちろん可能である。
【0087】
また、ブロック群の構成はこれらに限定されるものでなく、フレーム内符号化されるべきマクロブロックを数が一定のブロック群とせず、例えば図9に示すような分布を持っていても良い。図9の例では、TV電話等で中心に人がくることが多いことを考慮して、その略中心部分において、フレーム内符号化されるべきマクロブロックの周期を短くするために、少ない数のマクロブロックでブロック群を形成している。又逆に、画面の周辺ほど多い数のマクロブロックでブロック群を構成することにより、全体として符号化データ量を減少させつつ、画像の重要な部分での誤り伝播を積極的に抑制することも可能である。
【0088】
本実施の形態では、H.263符号化方式を例にとって説明を行ったが、その他の動き補償を行う符号化方式、例えば、MPEG−1,2,4であっても構わないし、任意形状のオブジェクトを対象としてももちろん構わない。
【0089】
更に本実施の形態では、動きベクトルを用いたフレーム間予測符号化について説明したが、本発明はこれに限定されない。例えばフラクタルをフレーム間で用いる方法等に応用しても良い。
【0090】
又、図10に示す他の実施の形態の画像符号化装置で示すように、フレームメモリ401を追加することによって、MPEG符号化方式や、H.263のオプションにある両方向予測フレーム間符号化フレームにも同様に対応できる。
【0091】
図10において、動き補償器402は、フレーム内符号化/フレーム間符号化に加えて、両方向予測の符号化モードを判定に加えたものである。動きベクトル符号化器403は両方向の動きベクトルを符号化し、ヘッダ符号化器404は、マクロブロックの符号化モードに両方向予測符号化のモードを符号化する。
【0092】
またモードパターンメモリ406のように、端子405を介して外部から適宜その内容を更新しても良く、例えば、前述の図2に示すパターンから図5に示すパターンに変更しても良い。その場合は、前述の実施の形態2において、先頭フレームでのモードパターンメモリを内容を符号化するのと同様に、更新時のフレームの先頭でモードパターンメモリの内容を符号化することも可能である。
【0093】
また本実施の形態では、フレームという言葉を用いているが、これは1画面を示すものであり、数フィールドで構成されたものをフレームとする場合は、フィールドに相当する。
【0094】
また、本実施の形態の各部または全部の機能をソフトウェアで記述し、CPU等の演算装置によって処理しても、もちろん構わない。
【0095】
また本実施の形態では、フレームを単位として説明したが、MPEG−2方式のようにそれぞれをフィールドに対応させてももちろん構わない。
【0096】
なお本発明は、複数の機器(例えばホストコンピュータ、インターフェース機器、リーダ、プリンタなど)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機、ファクシミリ装置など)に適用してもよい。
【0097】
また本発明の目的は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体(または記録媒体)を、システム或は装置に供給し、そのシステム或は装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行することによっても達成される。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。また、コンピュータが読み出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれる。
【0098】
更に、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張カードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれる。
【0099】
以上説明したように本実施の形態によれば、フレーム内符号化フレームの周期よりも短い間隔で、フレーム内符号化するマクロブロックを挿入することによって、符号化効率を低下させることなく、伝送路での誤りによる画質の劣化を抑制することができる。
【0100】
又本実施の形態によれば、符号化効率をあまり低下させることなく、フレーム間予測符号化を行うフレームにおいてもフレーム内符号化するブロックを挿入することにより、エラーの伝播を最小限に抑えることができる。
【0101】
また本実施の形態によれば、マクロブロック群の構成、符号化モード設定器におけるモード設定方法をも符号化データとともに復号側に伝送することにより、復号側においてフレーム内符号化のブロックの位置を予め知ることができ、これにより伝送エラーの検知にも役立たせることができる。
【0102】
又本実施の形態によれば、復号側において、フレーム内符号化ブロックの位置情報と復号データとの照合に基づいて伝送誤りを検出し、その検出結果に基づいて、伝送画像の劣化を抑えることができる。
【0103】
【発明の効果】
以上説明したように本発明によれば、画像データの複数のフレームの各ブロックが、一定の間隔で必ず画面内符号化されるようにできる。そして、画面内符号化を行うフレーム間隔よりも短い周期で画面内符号化するブロックが存在するため、符号量を極端に増やさずに、画面間符号化の伝送誤りによる画質の劣化の伝播を抑えることが可能になる。
【0104】
又本発明によれば、フレームPの各ブロックの符号化モードを、複数のフレームの符号化データとともに復号側に伝送することにより、復号側において画面内符号化されたブロックの位置を予め知ることができる。これにより伝送エラーの検知にも役立たせることができる。
【図面の簡単な説明】
【図1】本発明の実施の形態1に係る画像符号化装置の主要構成を示すブロック図である。
【図2】本発明の実施の形態1に係るフレーム内符号化されるべきマクロブロックの配置の一例を示す図である。
【図3】本発明の実施の形態1に係る符号化モード設定部の構成を示すブロック図である。
【図4】本発明の実施の形態1に係る符号化モード設定部によるモード設定処理を示すフローチャートである。
【図5】本発明の第2実施の形態に係る画像符号化装置の主要構成を示すブロック図である。
【図6】本実施の形態2に係るフレーム内符号化すべきマクロブロックの配置の一例を示す図である。
【図7】本発明の実施の形態3に係る画像復号装置の主要構成を示すブロック図である。
【図8】本発明の実施の形態3に係る画像復号装置における復号処理を示すフローチャートである。
【図9】本発明の他の実施の形態に係るフレーム内符号化すべきマクロブロックの配置例を示す図である。
【図10】本発明のその他の実施の形態に係る画像符号化装置の主要構成を示すブロック図である。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus and method for encoding and / or decoding image data, and a storage medium.
[0002]
[Prior art]
Conventionally, as a moving image encoding method, an encoding method such as Motion JPEG or Digital Video, which is an intra-frame (screen) encoding method, or H.264 using inter-frame (screen) predictive encoding is used. 261, H.H. Coding schemes such as H.263, MPEG-1 and MPEG-2 are known. The former intra-frame coding method is an independent coding method in units of frames, and is easy to manage frames, so that it is most suitable for an apparatus that requires editing of moving images and special reproduction. The latter interframe coding scheme has a feature that coding efficiency is high because interframe prediction is used.
[0003]
[Problems to be solved by the invention]
In transmission of moving images over a general telephone line or wirelessly, errors due to noise or radio wave interference occur. In the method using only intra-frame coding, even if an error occurs, the influence is closed for each frame and does not propagate to other frames. However, since only the intra-frame coding has low coding efficiency, it is difficult to transmit a high-resolution moving image over a telephone line or the like. On the other hand, in encoding using inter-frame prediction, a prediction frame is decoded using erroneous image data due to noise or the like, so that the error is propagated to other frames, resulting in degradation of image quality over a long period of time. There is a disadvantage of letting it.
[0004]
The present invention has been made in view of the above conventional example, and provides an image processing apparatus and method and storage medium capable of suppressing deterioration in image quality that occurs even if an error occurs and maintaining high coding efficiency. With the goal.
[0005]
  It is another object of the present invention to ensure that each block of a plurality of frames of image data is always intra-coded at regular intervals, so that intra-frame coding is performed at a cycle shorter than the frame interval for performing intra-frame coding. It is an object of the present invention to provide an image processing apparatus, a method thereof, and a storage medium that can suppress the propagation of image quality degradation due to transmission errors in inter-frame coding.
[0006]
[Means for Solving the Problems]
  In order to achieve the above object, the image processing apparatus of the present invention comprises the following arrangement. That is,An input means for inputting image information of a plurality of frames;
  Dividing means for dividing each of the plurality of frames input by the input means into blocks;
  Encoding means for encoding each block obtained by the dividing means in an intra-picture coding mode or an inter-picture coding mode;
  The encoding mode of frame I located at a certain number of frame intervals in the plurality of frames is set to the intra-screen encoding mode, and the encoding mode of other frames P is set to the intra-screen encoding mode or the inter-screen encoding mode. Encoding mode setting means for selectively setting the encoding mode;
  Storage means for storing a plurality of types of mode patterns periodically assigned to a plurality of successive frames P;
  Output means for multiplexing and outputting information indicating the mode pattern stored in the storage means to the plurality of encoded frames;
  The encoding mode setting means sets the encoding mode of each frame P based on the mode pattern, and each of the plurality of types of mode patterns includes a plurality of blocks that constitute one frame P in the screen. Information including whether to perform the inner coding mode or the inter-screen coding mode is included.
[0007]
  In order to achieve the above object, the image processing apparatus of the present invention comprises the following arrangement. That is,
  In the image information of a plurality of frames, the frame I positioned at a fixed number of frame intervals is encoded in the intra-frame encoding mode, and each block of the other frame P is set in the intra-screen encoding mode or the inter-screen encoding mode. Intra-screen encoding mode or inter-screen based on a plurality of types of mode patterns that are selectively used and encoded, and each block of the encoded frame P is periodically assigned to a plurality of consecutive frames P Input means for inputting a plurality of frames encoded in the encoding mode and a mode pattern corresponding to the frame P;
  Determining means for determining an error in the encoding mode by comparing the encoding mode of each block recorded in the header of the plurality of encoded frames and the corresponding mode pattern;
  Decoding means for correcting an error in the encoding mode based on the determination result notified from the determination means and decoding the plurality of encoded frames.
[0008]
  In order to achieve the above object, the image processing method of the present invention includes the following steps. That is,
  An input process for inputting image information of a plurality of frames;
  A dividing step of dividing each of the plurality of inputted frames into blocks;
  An encoding step of encoding each block obtained in the dividing step in an intra-screen encoding mode or an inter-screen encoding mode;
  The encoding mode of frame I positioned at a certain number of frame intervals in the plurality of frames is set to the intra-screen encoding mode, and the encoding mode of other frames P is set to the intra-screen encoding mode or the inter-screen encoding An encoding mode setting step for selectively setting the encoding mode;
  A storage step of storing a plurality of types of mode patterns periodically assigned to a plurality of successive frames P;
  An output step of multiplexing and outputting the information indicating the mode pattern stored in the storage step to the plurality of encoded frames;
  in frontThe encoding mode setting step sets the encoding mode of each frame P based on the mode pattern, and each of the plurality of types of mode patterns includes a plurality of blocks constituting one frame P in the screen. Information including whether to perform the inner coding mode or the inter-screen coding mode is included.
[0009]
  In order to achieve the above object, the image processing method of the present invention includes the following steps. That is,
  In the image information of a plurality of frames, the frame I positioned at a fixed number of frame intervals is encoded in the intra-frame encoding mode, and each block of the other frame P is set in the intra-screen encoding mode or the inter-screen encoding mode. Intra-screen encoding mode or inter-screen based on a plurality of types of mode patterns that are selectively used and encoded, and each block of the encoded frame P is periodically assigned to a plurality of consecutive frames P An input step of inputting a plurality of frames encoded in the encoding mode and a mode pattern corresponding to the frame P;
  A determination step of determining an error in an encoding mode by comparing an encoding mode of each block recorded in a header of the plurality of encoded frames and the mode pattern;
  And a decoding step of correcting an encoding mode error based on the determination result notified from the determination step and decoding the plurality of encoded frames.
[0010]
DETAILED DESCRIPTION OF THE INVENTION
Preferred embodiments of the present invention will be described below in detail with reference to the accompanying drawings.
[0011]
[Embodiment 1]
FIG. 1 is a block diagram showing a configuration of an image coding apparatus according to Embodiment 1 of the present invention. In the present embodiment, H.264 is used as a moving image encoding method. A case where the H.263 encoding method is used will be described. For ease of explanation, the image size is described as QCIF (176 × 144), but the present invention is not limited to these.
[0012]
In FIG. 1, reference numeral 100 denotes an input terminal, which is a terminal for inputting moving image data to be encoded. Reference numeral 101 denotes a frame memory, which stores the input moving image data in units of frames, and outputs a signal 201 for notifying that data is stored in units of frames. A block extractor 102 reads out moving image data from the frame memory 101 in units of blocks that are encoding units, and outputs them to the subsequent subtractor 105 and motion compensator 104. A signal 202 indicating that the block has been cut out is output to the encoding mode setting unit 114. In the first embodiment, H.264 is used. Since the H.263 coding method is described as an example, a block that is a coding unit corresponds to a macro block. A frame memory 103 stores the decoded image data in units of frames. A motion compensator 104 determines a mode for encoding by performing motion compensation based on the contents of the frame memory 103 and the moving image data in units of blocks output from the block cutout unit 102, and outputs the predicted image data. To do. When this motion compensation is performed, the motion vector is also output.
[0013]
A subtractor 105 calculates a difference in units of pixels based on block-unit moving image data output from the block cutout unit 102 and prediction image data from the motion compensator 104 to obtain a prediction error. A DCT unit 106 DCT-transforms the prediction error or pixel value obtained by the difference unit 105. Reference numeral 107 denotes a quantizer that quantizes the DCT coefficient obtained by the DCT unit 106. A Huffman encoder 108 assigns a Huffman code to the quantization result obtained by the quantizer 107. Reference numeral 109 denotes an inverse quantizer, which dequantizes the output of the quantizer 107 to obtain a DCT coefficient. Reference numeral 110 denotes an inverse DCT, which inversely transforms the DCT coefficient inversely quantized by the inverse quantizer 109 and outputs data corresponding to a prediction error. An adder 111 adds the predicted image data from the motion compensator 104 and the prediction error from the inverse DCT unit 110 in units of pixels.
[0014]
Reference numeral 112 denotes a motion vector encoder which inputs and encodes the motion vector 203 from the motion compensator 104. Reference numeral 113 denotes a header encoder that generates and encodes a frame-based header or a macroblock-based header. This header contains H.264. According to the H.263 coding method, encoded data such as a frame start code, a frame encoding mode, and a macroblock encoding mode are included. An encoding mode setting unit 114 determines a frame encoding mode, a macroblock encoding mode, and the like. The encoding mode setting unit 114 will be described in detail with reference to FIG. Reference numeral 115 denotes a mode pattern memory which stores information on the encoding mode of the macroblock in the frame. Details of this will be described later. Reference numeral 116 denotes a multiplexer, which outputs the outputs of the Huffman encoder 108, the motion vector encoder 112, and the header encoder 113 to H.264. Multiplexing is performed according to the code format of the H.263 coding method. Reference numeral 117 denotes a terminal for outputting multiplexed encoded data.
[0015]
In such a configuration, each unit is initialized prior to the operation. The encoding mode setting unit 114 sets the leading frame in the input moving image data as a frame to be subjected to intraframe encoding, and sets the frame to be subjected to intraframe encoding every 132 frames. For other frames, the encoding mode is set so as to perform interframe encoding using the immediately preceding frame as a reference frame.
[0016]
FIG. 3 is a block diagram showing a detailed configuration of the encoding mode setting unit 114.
[0017]
In FIG. 3, an input terminal 150 receives a signal 201 for notifying that data is stored in units of frames from the frame memory 101. Reference numeral 151 denotes a frame counter, which counts the number of frames to be processed in accordance with the signal 201. This counter 151 is set to “0” at initialization. A frame mode setting unit 152 sets the frame mode in which the first frame and every 132th frame are frames to be intra-coded as described above. The output terminal 153 is a terminal that outputs a signal 204 indicating the frame mode to the header encoder 113. The input terminal 154 is a terminal for inputting a signal 202 for notifying that a block has been cut out from the block cutout unit 102. A block counter 155 counts the number of blocks from the head of the frame. The block counter 155 is reset to “0” at the head of the frame. An address generator 156 calculates an address on the mode pattern memory 115 and outputs it to the mode pattern memory 115 via the output terminal 157. The input terminal 158 is a terminal for inputting the mode signal 205 from the mode pattern memory 115. The latch 159 latches the mode signal 205 from the input terminal 158, and outputs it based on the signals 204 and 202 from the frame mode setting unit 152 and the input terminal 154.
[0018]
In such a configuration, the signal 201 input from the terminal 150 is input to the frame counter 151 and counted. The value counted by the frame counter 151 is supplied to the frame mode setting unit 152. When the remainder of the value obtained by dividing the count value by “132” is “1”, the frame mode setting unit 152 sets the encoding mode of the frame from the output terminal 153 as the mode for performing the intra-frame encoding. A mode signal 204 is output. Otherwise, a frame coding mode signal 204 indicating a mode for performing interframe coding is output from the output terminal 153.
[0019]
Here, in the case of a frame for which intraframe encoding is performed, the operation is as follows.
[0020]
When instructed to perform intraframe coding from the frame mode setting unit 152, the latch 159 always writes a value so that the macroblock performs intraframe coding. Then, in accordance with the block cutout signal 202 from the block cutout device 102, a signal 206 for performing intraframe coding is output from the terminal 160 to the motion compensator 104. At this time, the block counter 155 does not count the number of blocks. Also, the address generator 156 does not operate.
[0021]
In the case of a frame for performing interframe coding, the operation is as follows.
[0022]
The block counter 155 is reset to “0” before processing the frame. Each time the block cutout signal 202 is input from the block cutout unit 102, the block counter 155 counts. The count value by the block counter 155 is input to the address generator 156. The address generator 156 also receives the frame count value from the frame counter 151. In this way, the address generator 156 generates an address for reading the mode value from the mode pattern memory 115.
[0023]
2B to 2I are diagrams showing an example of patterns stored in the mode pattern memory 115. FIG.
[0024]
In FIG. 2, a QCIF image is taken as an example, and each square represents a macroblock. Black squares in the figure represent the positions of macroblocks that instruct the corresponding macroblocks to always perform intraframe coding regardless of the determination by the motion compensator 104. Here, if the count value of the frame counter 151 in a certain frame is divisible by “8”, the pattern of FIG. 2B is obtained. If the remainder is “1”, the pattern of (c) is obtained, and the remainder is “2”. If there is a pattern of (d), if the remainder is “3”, the pattern of (e), if the remainder is “4”, the pattern of (f), if the remainder is “5” (g) If the remainder is “6”, the pattern (h) is selected, and if the remainder is “7”, the pattern (i) is selected.
[0025]
This indicates that each block is always intra-frame encoded in units of 8 frames in the thick frame shown in FIG. That is, according to the count value of the block counter 155, if the cell corresponding to the corresponding macroblock is white, the mode determined by the motion compensator 104 is used. A mode signal 206 is output so as to be in the mode.
[0026]
The mode signal of the macro block designated by the address generator 156 is read from the mode pattern memory 115, inputted via the terminal 158, and outputted from the terminal 160 to the motion compensator 104 via the latch 159.
[0027]
Returning to FIG. 1 again, the operation of FIG. 1 will be described.
[0028]
When moving image data is sequentially input from the terminal 100, the input moving image data is stored in the frame memory 101. When image data for one frame is accumulated in the frame memory 101, the encoding mode setting unit 114 is notified by the signal 201 that the image data of one frame has been stored. Thus, the encoding mode setting unit 114 determines whether to perform intraframe encoding or interframe encoding for one frame of image data stored in the frame memory 101.
[0029]
First, a case where intra-frame coding is performed will be described.
[0030]
The block cutout unit 102 extracts image data in units of macroblocks from the frame memory 101 and inputs them to the motion compensator 104 and the difference unit 105. At this time, the motion compensator 104 does not perform motion compensation on the macroblock, but outputs the intraframe coding mode as the macroblock coding mode, and the difference unit 105 and the adder 111 set all pixel values. In contrast, “0” is output.
[0031]
The data of the macroblock cut out by the block cutout unit 102 is subtracted by “0” by the difference unit 105 and is input to the DCT unit 106 as it is and DCT transformed, and the DCT coefficient is quantized by the quantizer 107. The result is input to the Huffman encoder 108 and the inverse quantizer 109. The Huffman encoder 108 is an H.264 encoder. A Huffman code determined by the H.263 coding method is assigned to the quantization result and output to the multiplexer 116.
[0032]
Also, the quantization result input to the inverse quantizer 109 is inversely quantized to become a DCT transform coefficient, which is converted to a prediction error by the inverse DCT device 110. “0” is added to the prediction error (pixel value) by the adder 111 and stored in a predetermined position in the frame memory 103.
[0033]
At this time, since the motion compensator 104 operates in the intra-frame encoding mode, the motion vector encoder 112 does not operate. The header encoder 113 encodes the frame start code, the frame encoding mode indicating that intra-frame encoding has been performed, the encoding mode of each macroblock, and the like, and outputs the result to the multiplexer 116. Multiplexer 116 is connected to H.264. The encoded data are multiplexed and output from the output terminal 117 in the order determined by the H.263 encoding method.
[0034]
Next, a case where interframe coding is performed will be described.
[0035]
The block extractor 102 extracts macroblock unit data from the frame memory 101 and inputs the data to the motion compensator 104 and the differencer 105. The motion compensator 104 determines whether or not the corresponding macroblock is a macroblock for which intraframe coding is performed, based on the signal 206 from the coding mode setting unit 114, and if it is a macroblock that performs intraframe coding. Without performing motion compensation, the intra-frame coding mode is output to the header encoder 113 as the macroblock encoding mode, and “0” is output to the difference unit 105 and the adder 111 for all pixel values. .
[0036]
On the other hand, when the intra-frame coding is not necessarily performed, the motion compensator 104 performs motion compensation on the macro block to obtain a prediction error, compares the block data, and performs intra-frame coding on a macro block basis. Or whether to perform interframe coding. In the case of performing intraframe encoding, the intraframe encoding mode is output to the header encoder 113 as the macroblock encoding mode, and the subtractor 105 and the adder 111 receive “0” for all pixel values. Is output.
[0037]
On the other hand, when performing inter-frame encoding, the inter-frame encoding mode is output to the header encoder 113 as the macroblock encoding mode, and each prediction image data is output to the differentiator 105 and the adder 111. Further, the motion vector at that time is output to the motion vector encoder 112. The motion vector encoder 112 encodes this motion vector and outputs it to the multiplexer 116.
[0038]
The macro block data cut out by the block cutout unit 102 is subtracted from “0” or a predicted value by the difference unit 105, input to the DCT unit 106 and DCT transformed, and the DCT coefficient is quantized by the quantizer 107. And input to the Huffman encoder 108 and the inverse quantizer 109. The Huffman encoder 108 is an H.264 encoder. A Huffman code determined by the H.263 coding method is assigned to the quantization result and output to the multiplexer 116.
[0039]
Further, the quantization result input to the inverse quantizer 109 is inversely quantized to become a DCT transform coefficient, and is converted into a pixel value by the inverse DCT device 110. This pixel value is added with “0” or a predicted value by the adder 111 and stored in a predetermined position in the frame memory 103.
[0040]
The header encoder 113 encodes the frame start code, the frame encoding mode indicating that inter-frame encoding has been performed, the encoding mode of each macroblock, and the like, and outputs the result to the multiplexer 116. Multiplexer 116 is connected to H.264. Each encoded data is multiplexed in the order determined by the H.263 encoding method and output from the terminal 117.
[0041]
By such a series of selection operations, the encoding mode of each block can be easily determined so that each macroblock always performs intra-frame encoding at regular intervals (every 8 frames in the example of FIG. 2). Can do. In addition, it is possible to suppress the propagation of deterioration due to transmission errors in inter-frame coding at a cycle shorter than the frame interval for performing actual intra-frame coding and without significantly increasing the code amount. Further, the obtained encoded data is completely compliant with the standard system, and no special configuration is required on the decoding side.
[0042]
FIG. 4 is a flowchart for explaining a coding mode setting method by the coding mode setting unit 114 of the image coding apparatus according to Embodiment 1 of the present invention.
[0043]
First, in step S1, moving image data is input from the terminal 100 in units of frames, and the number of input frames is counted. In step S2, the input frame is divided into a plurality of blocks (macro blocks), and each macro block is cut out and input. In step S3, it is determined whether the input frame is the first frame or a frame that appears every 132nd frame. If so, the process proceeds to step S4, and the encoding mode of the image data of the frame is set to the intra-frame encoding mode.
[0044]
On the other hand, when it is not the first frame or every 132nd frame at step S3, that is, when it is not a frame that is unconditionally encoded in the intraframe encoding mode, the process proceeds to step S5. See if it is a frame. Specifically, the count value of the number of frames is divided by “8”, the mode pattern memory 115 is accessed based on the remainder, and the mode pattern data (see FIG. 2) stored in the memory 115 is read (see FIG. 2). Step S6).
[0045]
In step S7, it is checked whether the macroblock to be processed is black (1) or white (0) based on the read pattern data. If it is black, the process proceeds to step S9, and the coding mode of the block is determined. Is set to the intra-frame coding mode. On the other hand, if it is white, the process proceeds to step S10, and the coding mode of the block is set to the interframe coding mode.
[0046]
Here, in the case of the intraframe coding mode, the motion compensator 104 outputs “0” to the differentiator 105 and the adder 111, stops the operation of the motion vector encoder 112, and causes the header encoder 113 to Informs that it is intra-frame coding.
[0047]
In the case of the interframe coding mode, the motion compensator 104 outputs a prediction error to the difference unit 105 and the adder 111, outputs a motion vector to the motion vector encoder 112, and outputs to the header encoder 113. Informs that it is interframe coding. Then, the decoded image data output from the adder 111 is stored in the frame memory 103, the corresponding macroblock of the next frame is predicted based on the contents of the frame memory 103, and the difference becomes smaller. As described above, the position (motion vector) is obtained and the motion compensation interframe prediction is performed.
[0048]
In the first embodiment, the video encoding method is H.264. Of course, other encoding methods may be used.
[0049]
The configuration of the frame memory can be changed as appropriate according to the processing speed.
[0050]
As a block group, GOB may be used as a unit, and of course, a configuration straddling GOB may be used.
[0051]
In the above-described embodiment, the DCT transform is used for the orthogonal transform. However, the present invention is not limited to this. For example, a wavelet transform or the like may be used.
[0052]
[Embodiment 2]
FIG. 5 is a block diagram showing the configuration of the image coding apparatus according to Embodiment 2 of the present invention. In addition, the same number is attached | subjected about the component similar to above-mentioned Embodiment 1, and those detailed description is abbreviate | omitted.
[0053]
Reference numeral 201 denotes a mode pattern memory, which is different from the mode pattern memory 115 of the first embodiment in the storage contents and the output destination. Reference numeral 202 denotes a header encoder, to which the function of encoding and outputting the contents of the pattern memory 201 is added to the header encoder 113 of the first embodiment. A multiplexer 203 is added with a function of multiplexing encoded data representing the contents of the pattern memory 201.
[0054]
In the second embodiment, as in the first embodiment described above, H.264 is used. A description will be given taking the H.263 coding method as an example.
[0055]
Prior to this encoding, the contents of the mode pattern memory 201 are encoded by the header encoder 202.
[0056]
The contents of the mode pattern memory 201 according to the second embodiment are shown in FIG.
[0057]
In FIG. 6 (a), the numbers from (1) to (13) are written in each square obtained by dividing the frame, and each of them is a group of macroblocks that are periodically intra-coded. Yes. For example, a macroblock marked with (1) is always coded in an intraframe coding mode with 8 frames in a frame to be subjected to interframe coding. The same applies to the blocks (2) to (12) below. Since there are only three blocks marked with (13), they are intra-frame encoded with a period of 3 frames. The situation is shown in FIGS. 6B to 6I as in FIG. 2 of the first embodiment.
[0058]
First, the header encoder 202 sets a macroblock (black) for which intra-frame encoding is always performed to “1”, and sets a macroblock (white) other than that to “0”, and runs each frame in the order in which the macroblocks are arranged. Perform length coding. These encoded data are stored in the H.264 of the first frame. It is inserted as preliminary insertion information (PEI) and spare information (PSPARE) of the H.263 coding system, and multiplexed by the multiplexer 203 according to a predetermined format.
[0059]
The encoding of the moving image data according to the second embodiment is performed in the same manner as in the first embodiment. That is, normal intra-frame coding is performed for a frame to be subjected to intra-frame coding, and in a frame to be subjected to inter-frame coding, the coding mode setting unit 114 determines the mode pattern memory from the frame count value and the block count value. 201, it is determined whether or not the macroblock to be encoded should be subjected to intraframe encoding. When the intraframe encoding is not necessarily performed, the encoding target is determined based on the determination of the motion compensator 104. The encoding mode of the macroblock is determined. The data encoded in each encoding mode in this manner is multiplexed by the multiplexer 203 and output from the terminal 117.
[0060]
As described above, according to the second embodiment, it is possible to notify the decoding side of the position of the macroblock subjected to intraframe coding. This makes it possible to know the position of the macroblock coded by the intraframe coding mode that can cut off the propagation of errors even when degradation due to transmission path errors occurs. There is an effect that correction can be made easily.
[0061]
Further, by adopting the pattern data configuration as shown in FIG. 6, it is possible to randomly arrange a block group of macroblocks for which intraframe coding is always performed, and to make the period of the block in which intraframe coding is performed conspicuous. There is an effect that can be eliminated.
[0062]
In addition, the macroblock to be encoded in the intraframe encoding mode is appropriately present in one frame, thereby widening the interval between the intraframe encoded frames even in the encoding schemes such as MPEG-1, 2, 4 and the like. Therefore, the encoding efficiency is not deteriorated.
[0063]
[Embodiment 3]
FIG. 7 is a block diagram showing the configuration of the image decoding apparatus according to Embodiment 3 of the present invention.
[0064]
In FIG. 7, 300 is a terminal for inputting encoded data, 301 is a separator, and each encoded data is separated for passing to each subsequent decoder. Here, the encoded data input from the terminal 300 will be described with reference to an example in which the encoded data is generated by the encoding apparatus according to the second embodiment and input via a transmission path that may cause an error on the transmission path. . The operation of separator 301 is the reverse operation of multiplexer 203 in the second embodiment.
[0065]
Reference numeral 302 denotes a header decoder that decodes a header in frame units or a header in macroblock units. The operation of the header decoder 302 is the reverse operation of the header encoder 202 in the second embodiment. Reference numeral 303 denotes a mode pattern memory, and 304 denotes an encoding mode determination unit. These operate in the same manner as the mode pattern memory 201 and the encoding mode setting unit 114 in the second embodiment.
[0066]
Reference numeral 305 denotes an error determiner that detects an error in the encoded data. Reference numeral 306 denotes a motion vector decoder that decodes a motion vector, and reference numeral 309 denotes a Huffman decoder that decodes a Huffman code and obtains a quantized DCT coefficient. These operate in reverse to the motion vector encoder 112 and the Huffman encoder 108 in the second embodiment.
[0067]
Reference numerals 307 and 314 denote frame memories for storing decoded images. A motion compensator 308 generates a predicted image in units of macroblocks from the frame memory 307 using the decoded motion vector. Reference numeral 310 denotes an inverse quantizer that performs inverse quantization on the Huffman-decoded code to obtain DCT coefficients, and reference numeral 311 denotes an inverse DCT apparatus that obtains a pixel value or a prediction error value from the DCT coefficients. Reference numeral 312 denotes an adder that adds the predicted image and the decoded prediction error. Reference numeral 313 denotes an error corrector that corrects image data in accordance with the error detected by the error determiner 305. Reference numeral 315 denotes an output terminal for outputting the reproduced decoded image.
[0068]
In such a configuration, first, each part is initialized prior to the operation. The encoded data input via the terminal 300 is input to the separator 301. This separator 301 outputs the encoded data related to the header of the frame and macroblock and the encoded data obtained by encoding the contents of the mode pattern memory 201 of FIG. 5 to the header decoder 302, and the encoded data related to the motion vector is output. The data is output to the motion vector decoder 306, and the Huffman encoded data is separated and output to the Huffman decoder 309, respectively.
[0069]
The header decoder 302 decodes the encoded data input from the separator 301, and decodes each frame, each header of the macroblock, and the frame period and position of the intrablock encoded macroblock. Based on the decoding result, these patterns are stored in the mode pattern memory 303. This pattern is, for example, a pattern as shown in FIG.
[0070]
At the time of decoding each frame, the header decoder 302 decodes the header of the frame and knows by decoding whether the frame is encoded in the intra-frame encoding mode or the inter-frame encoding mode.
[0071]
Here, when the frame is intra-frame encoded, since each macroblock of the frame is intra-frame encoded, the motion vector decoder 306 does not operate, and the motion compensator 308 also has each pixel value. In contrast, “0” is always output to the adder 312. The Huffman decoder 309 decodes input encoded data and obtains quantized DCT coefficients. If an error is detected during the Huffman decoding, the information is output to the error corrector 313. For example, the case where 64 or more DCT transform coefficients appear as a result of decoding, or a case where an attempt is made to decode a nonexistent code corresponds to this error detection. In this case, decoding is interrupted to the beginning of the next GOB, and the error corrector 313 is notified that the encoded data has been skipped.
[0072]
On the other hand, when there is no error, the quantized DCT coefficient is inversely quantized by the inverse quantizer 310 and then converted into a pixel value by the inverse DCT 311. The pixel value thus obtained is added with “0” by the adder 312 and input to the error corrector 313. The error corrector 313 reads and corrects the skipped macroblock data from the frame memory 307 to substitute the macroblock value of the previous frame if there is an error. On the other hand, if there is no error, the input is output as it is. The pixel data output from the error corrector 313 is stored in predetermined positions in the frame memory 314 and the frame memory 307, and the contents of the frame memory 314 are output via the terminal 315.
[0073]
Here, when the frame is encoded in the inter-frame encoding mode, the encoding mode determination unit 304 first determines how many frames from the beginning of the frame to be decoded are the inter-frame encoding frame. Detecting based on the count value of the number of frames. Furthermore, the position of the intra-coded macroblock of the frame to be decoded is read from the mode pattern memory 303 by comparison with the period in which the intra-coded macroblock appears first in the frame header information. The encoding mode determination unit 304 detects the position of the macroblock to be decoded based on the count value of the macroblock, and inputs to the error determination unit 305 whether or not the macroblock is an intraframe encoded macroblock.
[0074]
The header decoder 302 decodes the header of each macroblock, and the decoding mode of the decoded macroblock is input to the error determiner 305. If the macroblock is a macroblock to be intraframe encoded, the error determiner 305 compares whether or not the macroblock is intraframe encoded. If the macroblock is not intraframe encoded, Is notified to the error corrector 313, the Huffman decoder 309, and the header decoder 302.
[0075]
The header decoder 302 and the Huffman decoder 309 continue decoding, but the error corrector 313 stores the decoded image data until the head of the next GOB is decoded. The number of macroblocks to be intra-coded and the number of macroblocks up to GOB are counted, and it is determined whether the previous macroblock returned by the counted number is intra-coded. If these macroblocks are in the intraframe encoding mode, the reproduced image data is stored in the corresponding positions in the frame memories 307 and 314, assuming that the macroblock is to be intraframe encoded. This is because it can be determined that an error has occurred in the count value of the macroblock.
[0076]
If the error determiner 305 does not detect an error, the motion vector decoder 306 is not operated if the macroblock is encoded in the intraframe encoding mode, and the motion compensator 308 is always applied to each pixel value. “0” is output to the adder 312. On the other hand, if the macro block is encoded by performing motion compensation, the motion vector decoder 306 is operated, the decoded motion vector is input to the motion compensator 308, and the predicted pixel value by motion compensation is received from the frame memory 307. And output to the adder 312.
[0077]
The Huffman decoder 309 decodes input encoded data and obtains quantized DCT coefficients. If an error is detected during the Huffman decoding, the information is output to the error corrector 313 and corrected in the same manner as the error correction at the time of intraframe coding. On the other hand, when there is no error, the quantized DCT coefficient is inversely quantized by the inverse quantizer 310 and converted to a pixel value by the inverse DCT 311. The pixel value thus obtained is added with “0” by the adder 312 if it is in the intra-frame coding mode, and is added by the adder 312 if not. The pixel data output from the error corrector 313 is stored in predetermined positions in the frame memory 314 and the frame memory 307, and the contents of the frame memory 314 are output as decoded image data via the terminal 315. .
[0078]
FIG. 8 is a flowchart for explaining the decoding process in the image decoding apparatus according to Embodiment 3 of the present invention.
[0079]
First, in step S21, code data is input from a terminal 300, and the input code is separated into a header, a motion vector, and a Huffman code portion by a separator 301. In step S22, the decoded frame and block headers are analyzed and notified to the encoding mode determination unit 304. In the case of inter-frame encoding, the operations of the motion vector decoder 306 and the motion compensator 308 are enabled. To do. In step S 23, the encoded mode pattern data is decoded and stored in the mode pattern memory 303.
[0080]
In step S24, it is checked whether the frame is an intra-frame encoded frame. If so, the process proceeds to step S25, and the input frame is decoded by an intra-frame decoding process. In this case, the operations of the motion vector decoder 306 and the motion compensator 308 are disabled.
[0081]
When it is not intra-frame coding in step S24, the process proceeds to step S26, and it is checked what number the frame is. In step S27, it is checked whether it is the first frame or every 132nd frame, and if so, the process proceeds to step S33, and the frame that should be intra-frame encoded has been inter-frame encoded. The error determiner 305 is notified of the error, and error correction by the error corrector 313 is performed in step S34.
[0082]
If it is determined in step S27 that the frame is not to be intraframe-encoded, the process proceeds to step S28 to determine whether the block to be decoded is an intraframe-encoded block or not (the number of received blocks in the frame). ) And the pattern data stored in the mode pattern memory 303 in step S23. If the block is to be intra-frame encoded, the process proceeds to step S31 to check whether or not the block is intra-frame encoded. If not, the process proceeds to error processing of step S33. If YES in step S32, the flow advances to step S32 to execute the decoding process of the intra-frame encoded code in the same manner as in step S25.
[0083]
If it is determined in step S28 that the block is not to be intraframe-encoded, the process proceeds to step S29, where the motion vector is decoded and motion compensation (step S30) is performed to decode the block.
[0084]
As described above, according to the third embodiment, on the decoding side, by detecting the position of a macroblock to be intra-coded, an error in the transmission path is detected depending on whether the data is intra-coded. I can do it. Based on this, it is possible to easily correct image degradation due to an error and to suppress degradation of image quality.
[0085]
In the third embodiment, the description has been made using the code generated in the second embodiment, but the same contents as the mode pattern memory 115 in the first embodiment are stored in the mode pattern memory 303 in advance. Needless to say, similar operations can be performed.
[0086]
<Other embodiments>
In the above description, the configuration of the macroblock group and the mode for transmitting the mode setting method (configuration of the mode pattern memory 201) in the encoding mode setting unit 114 of Embodiment 2 together with the encoded data have been described. It is not limited to this, and it is also possible to transmit in advance using an error-free transmission line or a method with strong error tolerance. Of course, in a limited terminal, these may be stored in advance in individual devices. Is possible.
[0087]
The configuration of the block group is not limited to these, and the macroblock to be intra-coded may not have a fixed number of block groups, and may have a distribution as shown in FIG. 9, for example. In the example of FIG. 9, in consideration of the fact that a person often comes to the center in a TV phone or the like, in order to shorten the period of the macroblock to be intra-frame encoded in the substantially central portion, a small number of A block group is formed by macroblocks. Conversely, by constructing a block group with a larger number of macroblocks at the periphery of the screen, it is possible to actively suppress error propagation in important parts of the image while reducing the amount of encoded data as a whole. Is possible.
[0088]
In the present embodiment, H.264. The H.263 encoding method has been described as an example, but other encoding methods for motion compensation, for example, MPEG-1, 2, 4 may be used, and it is of course possible to target an object having an arbitrary shape. .
[0089]
Furthermore, in the present embodiment, the inter-frame prediction encoding using the motion vector has been described, but the present invention is not limited to this. For example, you may apply to the method of using a fractal between frames.
[0090]
Further, as shown in the image encoding apparatus of another embodiment shown in FIG. The same can be applied to the bi-directional prediction inter-frame encoded frame in the H.263 option.
[0091]
In FIG. 10, a motion compensator 402 is obtained by adding a bi-directional prediction coding mode to determination in addition to intra-frame coding / inter-frame coding. The motion vector encoder 403 encodes the bidirectional motion vector, and the header encoder 404 encodes the bidirectional predictive encoding mode into the macroblock encoding mode.
[0092]
Further, as in the mode pattern memory 406, the contents may be appropriately updated from the outside via the terminal 405. For example, the pattern shown in FIG. 2 may be changed to the pattern shown in FIG. In that case, in Embodiment 2 described above, it is also possible to encode the contents of the mode pattern memory at the beginning of the frame at the time of updating in the same manner as the contents of the mode pattern memory at the beginning frame are encoded. is there.
[0093]
In the present embodiment, the term “frame” is used, which indicates one screen, and when a frame composed of several fields is used as a frame, it corresponds to a field.
[0094]
Of course, each part or all of the functions of this embodiment may be described by software and processed by an arithmetic device such as a CPU.
[0095]
In this embodiment, the frame is described as a unit. However, it is of course possible to make each correspond to a field as in the MPEG-2 system.
[0096]
Note that the present invention can be applied to a system (for example, a copier, a facsimile machine, etc.) composed of a single device even if it is applied to a system composed of a plurality of devices (for example, a host computer, interface device, reader, printer). May be.
[0097]
Another object of the present invention is to supply a storage medium (or recording medium) in which a program code of software for realizing the functions of the above-described embodiments is recorded to a system or apparatus, and the computer (or CPU) of the system or apparatus. Or MPU) can also be achieved by reading and executing the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the program code constitutes the present invention. Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an operating system (OS) running on the computer based on the instruction of the program code. A case where part or all of the actual processing is performed and the functions of the above-described embodiments are realized by the processing is also included.
[0098]
Further, after the program code read from the storage medium is written in a memory provided in a function expansion card inserted into the computer or a function expansion unit connected to the computer, the function is determined based on the instruction of the program code. This includes a case where the CPU or the like provided in the expansion card or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.
[0099]
As described above, according to the present embodiment, by inserting macroblocks for intraframe encoding at intervals shorter than the period of intraframe encoded frames, the transmission path can be reduced without reducing encoding efficiency. It is possible to suppress degradation of image quality due to errors in
[0100]
In addition, according to the present embodiment, error propagation is minimized by inserting a block to be intra-coded even in a frame for which inter-frame predictive coding is performed without significantly reducing the coding efficiency. Can do.
[0101]
Further, according to the present embodiment, the configuration of the macroblock group and the mode setting method in the encoding mode setting device are also transmitted to the decoding side together with the encoded data, so that the position of the intra-frame encoding block is determined on the decoding side. This can be known in advance, and can also be used for detecting transmission errors.
[0102]
Further, according to the present embodiment, on the decoding side, a transmission error is detected based on the collation between the position information of the intra-frame coded block and the decoded data, and the deterioration of the transmission image is suppressed based on the detection result. Can do.
[0103]
【The invention's effect】
  As described above, according to the present invention,Each block of a plurality of frames of image data can be surely subjected to intra-picture encoding at a constant interval. Since there are blocks that perform intra-frame coding with a period shorter than the frame interval for performing intra-frame coding, the propagation of image quality degradation due to transmission errors in inter-frame coding is suppressed without extremely increasing the code amount. It becomes possible.
[0104]
  Also according to the invention,By transmitting the encoding mode of each block of the frame P to the decoding side together with the encoded data of a plurality of frames, the position of the block that has been intra-encoded on the decoding side can be known in advance. This can also be useful for detecting transmission errors.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a main configuration of an image coding apparatus according to Embodiment 1 of the present invention.
FIG. 2 is a diagram showing an example of an arrangement of macroblocks to be intra-frame encoded according to Embodiment 1 of the present invention.
FIG. 3 is a block diagram showing a configuration of a coding mode setting unit according to Embodiment 1 of the present invention.
FIG. 4 is a flowchart showing mode setting processing by an encoding mode setting unit according to Embodiment 1 of the present invention.
FIG. 5 is a block diagram showing a main configuration of an image coding apparatus according to a second embodiment of the present invention.
[Fig. 6] Fig. 6 is a diagram illustrating an example of an arrangement of macroblocks to be subjected to intraframe coding according to the second embodiment.
FIG. 7 is a block diagram showing the main configuration of an image decoding apparatus according to Embodiment 3 of the present invention.
FIG. 8 is a flowchart showing decoding processing in the image decoding apparatus according to Embodiment 3 of the present invention.
FIG. 9 is a diagram illustrating an arrangement example of macroblocks to be intra-coded according to another embodiment of the present invention.
FIG. 10 is a block diagram showing a main configuration of an image encoding device according to another embodiment of the present invention.

Claims (8)

複数のフレームの画像情報を入力する入力手段と、
前記入力手段によって入力された複数のフレームのそれぞれをブロックに分割する分割手段と、
前記分割手段で得られた各ブロックを画面内符号化モード又は画面間符号化モードで符号化する符号化手段と、
前記複数のフレームにおいて一定数のフレーム間隔で位置するフレームIの符号化モードを前記画面内符号化モードに設定し、それ以外のフレームPの符号化モードを前記画面内符号化モード又は前記画面間符号化モードに選択的に設定する符号化モード設定手段と
連続する複数のフレームPに周期的に割当てられる複数種類のモードパターンを記憶する記憶手段と、
前記記憶手段に記憶された前記モードパターンを示す情報を前記符号化した複数のフレームに多重化して出力する出力手段とを有し、
前記符号化モード設定手段は、前記モードパターンに基づいて各フレームPの符号化モードを設定し、前記複数種類のモードパターンのそれぞれは、1つのフレームPを構成する複数のブロックの夫々が前記画面内符号化モードを行うべきか前記画面間符号化モードを行うべきかを示す情報を含むことを特徴とする画像処理装置。
An input means for inputting image information of a plurality of frames;
Dividing means for dividing each of the plurality of frames input by the input means into blocks;
Encoding means for encoding each block obtained by the dividing means in an intra-picture coding mode or an inter-picture coding mode;
The encoding mode of frame I positioned at a fixed number of frame intervals in the plurality of frames is set to the intra-screen encoding mode, and the encoding mode of other frames P is set to the intra-screen encoding mode or between the screens Encoding mode setting means for selectively setting the encoding mode ;
Storage means for storing a plurality of types of mode patterns periodically assigned to a plurality of successive frames P;
Output means for multiplexing and outputting information indicating the mode pattern stored in the storage means to the plurality of encoded frames ;
The encoding mode setting means, on the basis of the mode pattern sets an encoding mode of each frame P, wherein each of the plurality of types of mode pattern, one of a plurality of blocks constituting the frame P each said screen An image processing apparatus comprising: information indicating whether to perform an inner coding mode or the inter-screen coding mode.
前記符号化手段は、MPEG規格に準拠した符号化処理を行うことを特徴とする請求項1に記載の画像処理装置。The image processing apparatus according to claim 1, wherein the encoding unit performs an encoding process compliant with the MPEG standard. 複数のフレームの画像情報において、一定数のフレーム間隔で位置するフレームIが画面内符号化モードで符号化され、それ以外のフレームPの各ブロックが画面内符号化モード又は画面間符号化モードを選択的に用いて符号化されており、符号化されたフレームPのそれぞれのブロックが連続する複数のフレームPに周期的に割当てられる複数種類のモードパターンに基づいて画面内符号化モード又は画面間符号化モードで符号化された複数のフレームと、当該フレームPに対応するモードパターンとを入力する入力手段と、
前記符号化された複数のフレームのヘッダに記録されている各ブロックの符号化モードと前記対応するモードパターンとを比較することにより符号化モードの誤りを判定する判定手段と、
前記判定手段から通知された判定結果に基づいて前記符号化モードの誤りを補正し、前記符号化された複数のフレームを復号化する復号化手段と、
を有することを特徴とする画像処理装置。
In the image information of a plurality of frames, the frame I positioned at a fixed number of frame intervals is encoded in the intra-frame encoding mode, and each block of the other frame P is set in the intra-screen encoding mode or the inter-screen encoding mode. Intra-screen encoding mode or inter-screen based on a plurality of types of mode patterns that are selectively used and encoded, and each block of the encoded frame P is periodically assigned to a plurality of consecutive frames P Input means for inputting a plurality of frames encoded in the encoding mode and a mode pattern corresponding to the frame P;
Determining means for determining an error in the encoding mode by comparing the encoding mode of each block recorded in the header of the plurality of encoded frames and the corresponding mode pattern;
Decoding means for correcting an error in the encoding mode based on the determination result notified from the determination means and decoding the plurality of encoded frames;
An image processing apparatus comprising:
前記モードパターンは、前記符号化された複数のフレームに含まれる情報を復号することで得られることを特徴とする請求項に記載の画像処理装置。The image processing apparatus according to claim 3 , wherein the mode pattern is obtained by decoding information included in the plurality of encoded frames. 複数のフレームの画像情報を入力する入力工程と、
前記入力された複数のフレームのそれぞれをブロックに分割する分割工程と、
前記分割工程で得られた各ブロックを画面内符号化モード又は画面間符号化モードで符号化する符号化工程と、
前記複数のフレームにおいて一定数のフレーム間隔で位置するフレームIの符号化モードを前記画面内符号化モードに設定し、それ以外のフレームPの符号化モードを前記画面内符号化モード又は画面間符号化モードに選択的に設定する符号化モード設定工程と
連続する複数のフレームPに周期的に割当てられる複数種類のモードパターンを記憶する記憶工程と、
前記記憶工程で記憶された前記モードパターンを示す情報を前記符号化した複数のフレームに多重化して出力する出力工程とを有し、
前記符号化モード設定工程は、前記モードパターンに基づいて各フレームPの符号化モードを設定し、前記複数種類のモードパターンのそれぞれは、1つのフレームPを構成する複数のブロックの夫々が前記画面内符号化モードを行うべきか前記画面間符号化モードを行うべきかを示す情報を含むことを特徴とする画像処理方法。
An input process for inputting image information of a plurality of frames;
A dividing step of dividing each of the plurality of inputted frames into blocks;
An encoding step of encoding each block obtained in the dividing step in an intra-screen encoding mode or an inter-screen encoding mode;
The encoding mode of frame I positioned at a certain number of frame intervals in the plurality of frames is set to the intra-screen encoding mode, and the encoding mode of other frames P is set to the intra-screen encoding mode or inter-screen encoding An encoding mode setting step for selectively setting the encoding mode ;
A storage step of storing a plurality of types of mode patterns periodically assigned to a plurality of successive frames P;
An output step of multiplexing and outputting the information indicating the mode pattern stored in the storage step to the plurality of encoded frames ;
The encoding mode setting step, on the basis of the mode pattern sets an encoding mode of each frame P, wherein each of the plurality of types of mode pattern, one of a plurality of blocks constituting the frame P each said screen An image processing method comprising: information indicating whether to perform an inner coding mode or the inter-screen coding mode.
請求項に記載の画像処理方法を、コンピュータに実行させる制御プログラムを記憶したことを特徴とするコンピュータにより読取り可能な記憶媒体。The image processing method according to claim 5, readable storage medium by a computer, characterized in that storing a control program Ru cause the computer to execute. 複数のフレームの画像情報において、一定数のフレーム間隔で位置するフレームIが画面内符号化モードで符号化され、それ以外のフレームPの各ブロックが画面内符号化モード又は画面間符号化モードを選択的に用いて符号化されており、符号化されたフレームPのそれぞれのブロックが連続する複数のフレームPに周期的に割当てられる複数種類のモードパターンに基づいて画面内符号化モード又は画面間符号化モードで符号化された複数のフレームと、当該フレームPに対応するモードパターンとを入力する入力工程と、
前記符号化された複数のフレームのヘッダに記録されている各ブロックの符号化モードと前記モードパターンとを比較することにより符号化モードの誤りを判定する判定工程と、
前記判定工程から通知された判定結果に基づいて符号化モードの誤りを補正し、前記符号化された複数のフレームを復号化する復号化工程と、
を有することを特徴とする画像処理方法。
In the image information of a plurality of frames, the frame I positioned at a fixed number of frame intervals is encoded in the intra-frame encoding mode, and each block of the other frame P is set in the intra-screen encoding mode or the inter-screen encoding mode. Intra-screen encoding mode or inter-screen based on a plurality of types of mode patterns that are selectively used and encoded, and each block of the encoded frame P is periodically assigned to a plurality of consecutive frames P An input step of inputting a plurality of frames encoded in the encoding mode and a mode pattern corresponding to the frame P;
A determination step of determining an error in an encoding mode by comparing an encoding mode of each block recorded in a header of the plurality of encoded frames and the mode pattern;
A decoding step of correcting an error in the encoding mode based on the determination result notified from the determination step, and decoding the plurality of encoded frames;
An image processing method comprising:
請求項に記載の画像処理方法を、コンピュータに実行させる制御プログラムを記憶したことを特徴とするコンピュータにより読取り可能な記憶媒体。Image processing method, a storage medium readable by a computer, characterized in that storing a control program Ru cause the computer to execute according to claim 7.
JP36525399A 1999-12-22 1999-12-22 Image processing apparatus and method, and storage medium Expired - Fee Related JP3976975B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP36525399A JP3976975B2 (en) 1999-12-22 1999-12-22 Image processing apparatus and method, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP36525399A JP3976975B2 (en) 1999-12-22 1999-12-22 Image processing apparatus and method, and storage medium

Publications (2)

Publication Number Publication Date
JP2001186523A JP2001186523A (en) 2001-07-06
JP3976975B2 true JP3976975B2 (en) 2007-09-19

Family

ID=18483811

Family Applications (1)

Application Number Title Priority Date Filing Date
JP36525399A Expired - Fee Related JP3976975B2 (en) 1999-12-22 1999-12-22 Image processing apparatus and method, and storage medium

Country Status (1)

Country Link
JP (1) JP3976975B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100581238C (en) * 2001-08-23 2010-01-13 宝利通公司 System and method for video error concealment
JP3934568B2 (en) 2003-03-04 2007-06-20 松下電器産業株式会社 Video coding method and apparatus
JP5570846B2 (en) * 2010-03-04 2014-08-13 株式会社メガチップス Image encoding device

Also Published As

Publication number Publication date
JP2001186523A (en) 2001-07-06

Similar Documents

Publication Publication Date Title
KR100927510B1 (en) Variable length coding method, variable length coding apparatus and storage medium
AU2002353749B2 (en) Global motion compensation for video pictures
JP3630474B2 (en) Moving picture transmission system and moving picture transmission apparatus
KR100564896B1 (en) Image coding method and apparatus, and storage medium
US6081551A (en) Image coding and decoding apparatus and methods thereof
US8428147B2 (en) Method and apparatus for detection and concealment of reference and non-reference video frames
US5706053A (en) Compressed motion video code processor
JP2001285876A (en) Image encoding device, its method, video camera, image recording device and image transmitting device
US6907071B2 (en) Selective prediction for intra-coding video data block
JPH0818979A (en) Image processor
JP3976975B2 (en) Image processing apparatus and method, and storage medium
JP4357560B2 (en) Moving picture coding apparatus, moving picture coding method, and moving picture coding program
JP3245496B2 (en) Image encoding method, image encoding circuit, image encoding device, and playback device
JP2010035025A (en) Encoding device and method therefor
US20080212886A1 (en) Image processing method, image processing apparatus and image pickup apparatus using the same
JP2887177B2 (en) Method and apparatus for decoding moving image compression code
JPH11341521A (en) Coder for stereoscopic moving image
AU2007219272B2 (en) Global motion compensation for video pictures
KR100312418B1 (en) Intra mode code selection method in video coder
KR100657274B1 (en) Intra prediction method and video processing apparatus thereof
JP2005124241A (en) Reencoding apparatus and method, decoding apparatus and method, encoding apparatus and method, and transmission apparatus and method
JP2002330441A (en) Encoding method, program for encoding method, recording medium for recording program for encoding method and encoder
JP2004007736A (en) Device and method for decoding image
KR20050089454A (en) Error concealment method in decoding motion picture
JP2007151163A (en) Image decoding method and apparatus

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060404

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060410

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060609

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070109

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070308

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070620

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

Free format text: PAYMENT UNTIL: 20100629

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110629

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120629

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120629

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130629

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees