JP4269405B2 - Encoding apparatus and method - Google Patents
Encoding apparatus and method Download PDFInfo
- Publication number
- JP4269405B2 JP4269405B2 JP10842999A JP10842999A JP4269405B2 JP 4269405 B2 JP4269405 B2 JP 4269405B2 JP 10842999 A JP10842999 A JP 10842999A JP 10842999 A JP10842999 A JP 10842999A JP 4269405 B2 JP4269405 B2 JP 4269405B2
- Authority
- JP
- Japan
- Prior art keywords
- motion vector
- quantization
- encoding
- input image
- value
- 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
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Description
【0001】
【発明の属する技術分野】
この発明は、MPEG方式により画像を圧縮符号化するMPEGエンコーダに用いて好適な符号化装置及び方法に関する。
【0002】
【従来の技術】
ディジタル衛星放送では、画像の圧縮方式として、MPEG2方式が用いられている。MPEG2方式では、動きベクトルを用いた動き補償予測符号化が行われている。すなわち、MPEG2方式では、I(Intra )ピクチャと、P(Predicti)ピクチャと、B(Bidirectionally Predictive)ピクチャと呼ばれる3種類の画面が送られる。Iピクチャでは、同一画面(フレーム又はフィールド)の画素を使ってDCT符号化が行なわれる。Pピクチャでは、既に符号化されたIピクチャ又はPピクチャを参照して動きベトルを検出し、動き補償予測を用いたDCT符号化が行なわれる。Bピクチャでは、その前後のIピクチャ又はPピクチャを参照して、動き予測を用いたDCT符号化が行なわれる。
【0003】
【発明が解決しようとする課題】
このように、MPEG2方式では、動き補償予測符号化が行われ、Iピクチャ叉はBピクチャでは、既に符号化されたIピクチャ又はPピクチャを参照して、動きベクトルを検出して、符号化が行われる。このような動き補償予測符号化を行なうと、符号量が下がり、効率的な圧縮処理が行なえる。
【0004】
ところが、動き補償予測符号化を行う場合、動きベクトルの信頼性が重要である。動きベクトルの信頼性が低いと、参照ピクチャと現ピクチャとの相関が弱くなり、符号量を下げると、画質が劣化してしまう。
【0005】
動きベクトルの信頼性が低い場合としては、画面の終端付近のマクロブロックで動きベクトルが検出された場合や、入力画像の符号化の難しさが大きい所で動きベクトルが検出された場合が考えられる。
【0006】
すなわち、動きベクトルは、処理の対象となる現画面のブロックに対して、参照画面の同位置を基点としてそのブロックと大きさの等しいブロックを抽出し、所定の探索範囲内でこのブロックを動かしながら、現画面のブロックの各画素と参照画面のブロックの各画素との差分の絶対値和を求め、この値が最小となるブロックを検出するようなブロックマッチングにより求められる。
【0007】
このようなブロックマッチングの処理では、画面の中央付近では、探索範囲が画面内に収まるため、動きベクトルの信頼性は高い。ところが、画面の終端に近いエリアでは、探索範囲が画面の外に来るため、動きベクトルの信頼性が低下すると考えられる。
【0008】
また、絵柄が複雑で、動きの激しい場合には、現フレームのブロックの各画素と参照フレームのブロックの各画素との差分の絶対値和が著しく小さくなるようなブロックは求まりにくい。このため、絵柄が複雑で、動きの激しく、符号化が難しい所で検出された動きベクトルは、信頼性が低下すると考えられる。
【0009】
このように、動きベクトルを用いて動き補償を行なって符号化を行なう場合には、動きベクトルの信頼性が低いと、その部分で画質の劣化が生じる。
【0010】
したがって、この発明の目的は、動きベクトルの信頼性が低い部分での画質の劣化を防止するようにした符号化装置及び方法を提供することにある。
【0011】
【課題を解決するための手段】
この発明は、入力画像と参照画像との間の動きベクトルを求める動きベクトル検出手段と、
動きベトル検出手段で求められた動きベクトルに基づいて動き補償を行なって参照画像と入力画像との差分を直交変換する直交変換手段と、
直交変換手段の出力を量子化する量子化手段と、
入力画像の難しさが所定値を越える場合には、動きベクトル検出手段により検出された動きベトクルの信頼性が低いとして、量子化手段の量子化値を小さくする量子化値制御手段と
を備え、
入力画像の難しさは、直近の符号化時平均量子化値である符号化装置である。
【0012】
この発明では、量子化値制御手段は、入力画像の終端付近に位置するマクロブロックを対象として、動きベトクルの信頼性が低いとして、量子化手段の量子化値を小さくする。
【0013】
この発明では、量子化値制御手段は、入力画像の終端からの距離を複数に分割し、入力画像の終端からの距離に応じて、量子化手段の量子化値を段階的に変更する。
【0014】
この発明では、量子化値制御手段は、画面内符号化を行なうマクロブロックを対象として、動きベクトルの信頼度に係わらず、量子化値を変更しない。
【0017】
この発明では、量子化値制御手段は、入力画像の符号化の難しさを示す指標を複数の閾値と比較し、閾値に応じて、量子化手段の量子化値を段階的に変更する。
【0019】
画面の終端付近のマクロブロックでは、探索範囲が画面の外に来るため、動きベクトルの信頼性が低下すると考えられる。このため、画面の終端の付近のマクロブロックで、動きベクトルの信頼性が低下すると考えられる部分では、量子化値が下げられ、符号量が増加される。これにより、画面の終端付近の動きベクトルの信頼性が低下する部分の画質劣化が補償される。
【0020】
また、入力画像の符号化の難しさが大きい所では、動きベクトルの信頼性が低下すると考えられる。入力画像の符号化の難しさが大きい所は、絵柄が複雑で動きの大きい所であり、これは、直近の量子化値から判断できる。このため、直近の平均量子化値が所定値以上で、動きベクトルの信頼性が低下すると考えられる部分では、量子化値が下げられ、符号量が増加される。これにより、画面の終端付近の動きベクトルの信頼性が低下する部分の画質劣化が補償される。
【0021】
【発明の実施の形態】
以下、この発明の実施の形態について図面を参照して説明する。図1は、この発明が適用されたMPEG2方式のエンコーダの構成の一例を示すものである。この発明が適用されたMPEG2方式のエンコーダの一例では、画面の終端のマクロブロックは動きベクトルの信頼性が低いと考えられることから、画面の終端のマクロブロックでは、量子化値を下げて、動きベクトルの信頼性の低下による画質の劣化を補償するようにしている。
【0022】
図1において、入力端子1に、輝度信号Yと、色差信号Cb、Crからなるコンポーネントディジタルビデオ信号が供給される。入力端子1からのディジタルビデオ信号は、フレームメモリ2に一旦蓄積される。このフレームメモリ2は、少なくとも、現画面と、過去の参照画面と、未来の参照画面との3フレーム分の画像を蓄積できる容量を有している。
【0023】
フレームメモリ2に蓄積されたデータを用いて、動きベクトル検出回路3で、参照画面と現画面との間の動きベクトルが求められる。動きベクトルは、マクロブロックを単位として求められる。すなわち、動きベクトルは、処理の対象となる現画面(フレーム叉はフィールド)のブロックに対して、参照画面の同位置を基点としてそのブロックと大きさの等しいブロックを抽出し、所定の探索範囲内でこのブロックを動かしながら、現画面のブロックの各画素と参照画面のブロックの各画素との差分の絶対値和を求め、この値が最小となるブロックを検出するようなブロックマッチングにより求められる。
【0024】
動きベクトル検出回路3で求められた動きベクトルMVは、可変長符号化回路8、動き補償回路15に供給される。
【0025】
また、動きベクトル検出回路3で動きベクトルを求める際に得られる残差情報eは、モード設定回路4に供給される。更に、動きベクトル検出回路3で動きベクトルを求める際のマクロブロックの位置情報が終端マクロブロック検出回路21に供給される。終端マクロブロック検出回路21で、画面上の終端の位置にあるマクロブロックを求めているか否かが判断される。
【0026】
Iピクチャでは、スイッチ回路5は、モード設定回路4からのモード設定信号により、符号化モードに応じて切り換えられる。すなわち、スイッチ回路5は、フレーム内符号化モード(イントラ符号化)のときには、端子5A側に設定され、順方向予測符号化モードのときには、端子5B側に設定され、双方向予測符号化モードのときには、端子5C側に設定される。なお、PピクチャやBピクチャの場合にも、イントラ符号化の方が符号量が減る場合には、フレーム内符号化モードに設定される。
【0027】
先ず、Iピクチャを伝送するときについて説明する。Iピクチャを伝送するときには、フレーム内予測符号化が行なわれる。このときには、スイッチ回路5は、端子5A側に設定される。そして、フレームメモリ2からは、現フレームの画像データが出力される。この現フレームの画像データは、スイッチ回路5を介して、DCT回路6に供給される。
【0028】
DCT回路6で、(8×8)を1ブロックとして、時間領域のビデオ信号がDCT変換され、周波数領域のスペクトラムデータに変換され。このスペクトラムデータは、所謂ジグザグスキャンにより、直流分の成分から順に読み出される。DCT変換回路6の出力が量子化回路7に供給される。
【0029】
量子化回路7には、量子化制御回路22から量子化値が供給される。量子化制御回路22には、送信バッファ9から出力ビットレートの情報が供給される。
【0030】
量子化回路7で、量子化制御回路22からの量子化値に応じて、DCT変化回路6からのスペクトラムデータが量子化される。これにより、出力されるビットストリームのビットレートが一定に保たれる。
【0031】
量子化回路7の出力は、可変長符号化回路8に供給されると共に、逆量子化回路10に供給される。可変長符号化回路8で、量子化回路7からのスペクトラムデータは、動きベクトルと、量子化スケールと、予測モードと共に、可変長符号化される。
【0032】
可変長符号化回路8からは、符号化されたビットストリームか出力される。このビットストリームは、送信バッファ9に一旦蓄積される。送信バッファ9からは、要求されるビットレートに応じてデータストリームが読み出され、出力端子11から、ビットストリームが出力される。
【0033】
また、量子化回路7の出力が逆量子化回路10に供給される。逆量子化回路10の出力がIDCT回路12に供給される。Iピクチャの場合には、フレーム内の画素でDCT変換が行なわれるため、逆量子化回路10及びIDCT回路12により、元の画面が形成される。この1画面分のディジタルビデオデータは、加算回路13を介して、フレームメモリ14に供給される。このフレームメモリ14に蓄積されたデータが次のPピクチャ又はBピクチャでの参照フレームのデータとされる。
【0034】
次に、Pピクチャを伝送するときについて説明する。Pピクチャを伝送するときには、参照フレームとの間で順方向予測符号化が行なわれる。このときには、スイッチ回路5は、端子5B側に設定される。フレームメモリ2からは、現フレームのディジタルビデオ信号が出力される。このフレームメモリ2の出力は、減算回路6に供給される。
【0035】
フレームメモリ14には、参照フレームのデータが蓄積されている。この参照フレームのデータは、動き補償回路15により、動き補償され、減算回路6に供給される。減算回路6で、現フレームのデータと、動き補償された参照フレームのデータとの差分が求められる。この現フレームのデータと、参照フレームのデータとの差分データがスイッチ回路5を介して、DCT回路6に供給される。
【0036】
DCT回路6により、参照フレームのデータと現フレームのデータとの差分データがDCT変換され、スペクトラムデータに変換される。DCT変換回路6の出力が量子化回路7に供給される。量子化回路7で、DCT変化回路6からのスペクトラムデータが量子化される。
【0037】
量子化回路7には、量子化制御回路22から量子化値が供給される。量子化制御回路22には、送信バッファ9から出力ビットレートの情報が供給される。また、量子化制御回路22には、終端マクロブロック検出回路21の出力が供給される。
【0038】
量子化回路7で、量子化制御回路22からの量子化値に応じて、DCT変化回路6からのスペクトラムデータが量子化される。これにより、出力されるビットストリームのビットレートが一定に保たれる。また、画面の終端のマクロブロックでは、量子化値が下げられる。これにより、動きベクトルの信頼性の低下による画質の劣化が補償される。
【0039】
量子化回路7の出力は、可変長符号化回路8に供給されると共に、逆量子化回路10に供給される。可変長符号化回路8で、量子化回路7からのスペクトラムデータは、動きベクトルと、量子化スケールと、予測モードと共に、可変長符号化される。
【0040】
可変長符号化回路8からは、符号化されたビットストリームか出力される。このビットストリームは、送信バッファ9に一旦蓄積される。送信バッファ9からは、要求されるビットレートに応じてデータストリームが読み出され、出力端子11から、ビットストリームが出力される。
【0041】
また、量子化回路7の出力が逆量子化回路10に供給される。逆量子化回路10の出力がIDCT回路12に供給される。Pピクチャの場合には、参照フレームのデータと現画面のデータとの差分がDCT変換されるため、逆量子化回路10及びIDCT回路12により、参照フレームのデータと現画面のデータとの差分が得られる。この差分データが加算回路13に供給される。
【0042】
加算回路13には、フレームメモリ14から、動き補償回路15を介して、それまでの参照画面のデータが供給される。加算回路13で、それまでの参照画面のデータに差分データが加算される。この加算回路13の出力が次の参照フレームのデータとしてフレームメモリ14に蓄積される。
【0043】
次に、Bピクチャを伝送するときについて説明する。Bピクチャを伝送するときには、過去の参照フレームと、未来の参照フレームとを使って、両方向予測符号化が行なわれる。このときには、スイッチ回路5は、端子5C側に設定される。フレームメモリ2からは、現フレームのディジタルビデオ信号が出力される。このバッファメモリ2の出力は、減算回路7に供給される。
【0044】
フレームメモリ4には、過去参照フレームと、未来の参照フレームのデータが蓄積されている。この両方の参照フレームのデータは、動き補償回路5により、動き補償され、減算回路7に供給される。減算回路7で、現フレームのデータと、動き補償された過去及び未来の参照フレームのデータとの差分が求められる。この現フレームのデータと、過去及び未来の参照フレームのデータとの差分データがスイッチ回路5を介して、DCT回路6に供給される。
【0045】
DCT回路6により、過去及び未来の参照フレームのデータと、現フレームのデータとの差分データがDCT変換され、スペクトラムデータに変換される。DCT変換回路6の出力が量子化回路7に供給される。量子化回路7で、DCT変化回路6からのスペクトラムデータが量子化される。
【0046】
量子化回路7には、量子化制御回路22から量子化値が供給される。量子化制御回路22には、送信バッファ9から出力ビットレートの情報が供給される。また、量子化制御回路22には、終端マクロブロック検出回路21の出力が供給される。
【0047】
量子化回路7で、量子化制御回路22からの量子化値に応じて、DCT変化回路6からのスペクトラムデータが量子化される。これにより、出力されるビットストリームのビットレートが一定に保たれる。また、画面の終端のマクロブロックでは、量子化値が下げられる。これにより、動きベクトルの信頼性の低下による画質の劣化が補償される。
【0048】
量子化回路7の出力は、可変長符号化回路8に供給されると共に、逆量子化回路10に供給される。可変長符号化回路8で、量子化回路7からのスペクトラムデータは、動きベクトルと、量子化スケールと、予測モードと共に、可変長符号化される。
【0049】
可変長符号化回路8からは、符号化されたビットストリームか出力される。このビットストリームは、送信バッファ9に一旦蓄積される。送信バッファ9からは、要求されるビットレートに応じてデータストリームが読み出され、出力端子11から、ビットストリームが出力される。
【0050】
このように、この発明が適用されたMPEG2方式のエンコーダの一例では、終端マクロブロック検出回路21が設けられており、画面の終端のマクロブロックで動きベクトルが検出されているか否かが検出され、画面の終端のマクロブロックを検出しているときと、それ以外のときとで、量子化回路7に対する量子化値が切り替えられる。これにより、画面の終端付近の動きベクトルの信頼性の低い所での画質の劣化が防止できる。
【0051】
すなわち、図2Aに示すように、画面の中央付近のマクロブロックを検出しているときには、探索範囲SAは、画面内に収まる。このため、ブロックがBLK1とブロックBLK2とがマッチングブロックであったときには、このマッチングブロックが正しく検出され、動きベクトルV1が正しく求められる。
【0052】
これに対して、図2Bに示すように、画面の終端の付近のマクロブロックを検出しているときには、探索範囲SAが画面の外に来る。このため、ブロックBLK3とブロックBLK4とがマッチングブロックであったとしても、ブロックBLK3が画面の外に来るため、正しい動きベクトルV2を検出できない。
【0053】
このように、画面の中央付近のマクロブロックでの動きベクトルの信頼性に比べて、画面の終端の付近のマクロブロックでの動きベクトルの信頼性は低い。このため、画面の終端の付近では画質劣化が生じる。
【0054】
そこで、この例では、Bピクチャ叉はPピクチャで符号化を行う場合に、マクロブロックの終端では、量子化値が小さくされる。すなわち、図3は1画面のマクロブロックを示し、1画面のマクロブロックの中で、斜線で示すようなマクロブロックの終端のエリアAR1では、量子値が小さくなるように、量子化制御回路22が制御される。これにより、動きベクトルの信頼性の低下による画質低下が補償される。
【0055】
図4は、このときの量子化処理を示すフローチャートである。図4において、ピクチャタイプ毎にターゲットビット数が決定される(ステップS1)。処理しているj番目のマクロブロックに対する量子化値Qjが決定される(ステップS2)。この処理しているj番目のマクロブロックが画面の終端に位置しているか否かが判断される(ステップS3)。
【0056】
j番目のマクロブロックが画面の終端に位置していなければ、量子化値の変更は行なわれず、ステップS2で決定された量子化値Qjで量子化処理が行なわれる(ステップS4)。
【0057】
j番目のマクロブロックが画面の終端に位置しているなら、ステップS2で決定された量子化値Qjに対して、例えば、0.5が乗じられる(ステップS5)。この0.5Qjで、量子化処理が行なわれる(ステップS4)。
【0058】
ステップS4で量子化処理が行なわれたら、1フレーム分のマクロブロックを処理したか否かが判断される(ステップS6)。1フレーム分のマクロブロックを処理していなければ、ステップS2にリターンされ、上述の処理が繰り返される。1フレーム分のマクロブロックを処理したら、量子化処理が終了される。
【0059】
このように、この例では、画面の終端のマクロブロックでは、量子化値Qjに対して0.5が乗じられ、量子化値が小さくされる。このように、画面の終端のマクロブロックの量子化値が小さくされるため、動きベクトルの信頼性の低下による画質の劣化が補償される。
【0060】
ところで、PピクチャやBピクチャでも、フレーム内で符号化する方が符号量が減る場合には、フレーム内符号化処理(イントラ符号化)が行われる。イントラ処理をする場合には、動きベクトルは不要なので、j番目のマクロブロックが画面の終端にあっても、画質の劣化は起こらず、量子化値を変更する必要はない。
【0061】
図5は、このようなイントラ処理が行われる場合を考慮した例を示すフローチャートである。図5において、ピクチャタイプ毎にターゲットビット数が決定される(ステップS11)。処理しているj番目のマクロブロックに対する量子化値Qjが決定される(ステップS12)。
【0062】
j番目のマクロブロックがイントラ符号化処理のマクロブロックであるか否かが判断される(ステップS13)。j番目のマクロブロックがイントラ符号化処理のマクロブロックなら、量子化値の変更は行なわれず、ステップS12で決定された量子化値Qjで量子化処理が行なわれる(ステップS14)。
【0063】
ステップS13で、j番目のマクロブロックがイントラ符号化処理のマクロブロックでなければ、j番目のマクロブロックが画面の終端のマクロブロックか否かが判断される(ステップS15)。
【0064】
j番目のマクロブロックが画面の終端のマクロブロックでなければ、量子化値の変更は行なわれず、ステップS12で決定された量子化値Qjで量子化処理が行なわれる(ステップS14)。
【0065】
j番目のマクロブロックが画面の終端のマクロブロックなら、ステップS12で決定された量子化値Qjに対して、例えば、0.5が乗じられる(ステップS16)。この0.5Qjで、量子化処理が行なわれる(ステップS14)。
【0066】
ステップS14で量子化処理が行なわれたら、1フレーム分のマクロブロックを処理したか否かが判断される(ステップS17)。1フレーム分のマクロブロックを処理していなければ、ステップS12にリターンされ、上述の処理が繰り返される。1フレーム分のマクロブロックを処理したら、量子化処理が終了される。
【0067】
図6は、動きベクトルの信頼性の低下による画質劣化を補償するための量子化値設定処理の他の例を示すものである
前述の例では、図3におけるマクロブロックの終端のエリアAR1で量子値を0.5にすることで、動きベクトルの信頼性の低下による画質劣化を防止するようにしているが、この例では、更に、図7に示す終端のエリアAR11と終端から2番目のエリアAR12とを検出している。そして、終端から2番目のエリアAR12でマクロブロックを検出しているときには、量子化値が小さくされ、終端のエリアAR11でマクロブロックを検出しているときは、更に、量子化値を小さくするようにしている。
【0068】
図6において、ピクチャタイプ毎にターゲットビット数が決定される(ステップS21)。処理しているj番目のマクロブロックに対する量子化値Qjが決定される(ステップS22)。
【0069】
この処理しているj番目のマクロブロックが画面の端から3マクロブロック以内に位置しているか否かが判断される(ステップS23)。処理しているj番目のマクロブロックが画面の端から3マクロブロック以内なら、画面の終端に位置しているか否かが判断される(ステップS24)。画面の終端に位置していなければ、画面の終端から2マクロブロック目に位置しているか否かが判断される(ステップS25)。
【0070】
ステップS23で、処理しているj番目のマクロブロックが画面の終端から3マクロブロック以内に位置していないと判断されたときには、量子化値の変更は行なわれず、ステップS22で決定された量子化値Qjで量子化処理が行なわれる(ステップS26)。
【0071】
ステップS24で、処理しているj番目のマクロブロックが画面の終端に位置していると判断されたら、ステップS22で決定された量子化値Qjに対して、例えば、0.5が乗じられる(ステップS27)。ステップS26で、この変更された量子化値0.5Qjで、量子化処理が行なわれる。
【0072】
ステップS25で、処理しているj番目のマクロブロックが画面の終端から2マクロブロック目に位置していると判断されたら、ステップS22で決定された量子化値Qjに対して、例えば、0.75が乗じられる(ステップS28)。ステップS26で、この変更された量子化値0.75Qjで、量子化処理が行なわれる。
【0073】
ステップS25で、処理しているj番目のマクロブロックが画面の終端から2マクロブロック目に位置していないと判断されたら、ステップS22で決定された量子化値Qjに対して、例えば、0.9が乗じられる(ステップS29)。ステップS26で、この変更された量子化値0.9Qjで、量子化処理が行なわれる。
【0074】
ステップS26で量子化処理が行なわれたら、1フレーム分のマクロブロックを処理したか否かが判断される(ステップS30)。1フレーム分のマクロブロックを処理していなければ、ステップS22にリターンされ、上述の処理が繰り返される。1フレーム分のマクロブロックを処理したら、量子化処理が終了される。
【0075】
なお、上述の例では、画面の終端のマクロブロックの位置にあるか否かと、画面の終端から2番目マクロブロックの位置にあるか否かとを検出しているが、さらに、画面の終端から3番目、4番目、…のマクロブロックにあるか否か検出して、量子化値を切り替えるようにしてもよい。
【0076】
また、勿論、図4に示した例と同様に、j番目のマクロブロックがイントラ処理されるものであったら、画面の終端や終端から2番目にあるか否かにかかかわらず、量子化値を変更しないようにしても良い。
【0077】
図8は、動きベクトルの信頼性の低下による画質劣化を補償するための量子化値設定処理のさらに他の例を示すものである
上述までの例では、画面の終端付近のマクロブロックでは、動きベクトルの信頼性が低いとして、画面の終端に付近のマクロブロックでは、量子化値を小さくして、動きベクトルの信頼性の低下による画質劣化を補償するようにしている。
【0078】
ところが、動きベクトルの信頼性が低下するのは、画面の終端のマクロブロックの場合だけではない。入力画像の難しさ、すなわち、絵柄が複雑で動きが激しい場合にも、動きベクトルの信頼性が低下する。
【0079】
そこで、この例は、入力画像の難しさが大きい場合には、量子化値を下げて、動きベクトルの信頼性の低下による画質劣化を補償するようにしている。
【0080】
入力画像の難しさが大きいか否かの指標として、この例では、直近のPピクチャ符号化時平均量子化値とBピクチャ符号化時平均量子化値との和が用いられる。
【0081】
図8において、ピクチャタイプ毎にターゲットビット数が決定される(ステップS31)。処理しているj番目のマクロブロックに対する量子化値Qjが決定される(ステップS32)。
【0082】
直近Pピクチャ符号化時平均量子化値Qpと、直近Bピクチャ符号化時平均量子化値Qbとの和が例えば60より小さいか否かが判断される(ステップS33)。この直近Pピクチャ符号化時平均量子化値Qpと直近Bピクチャ符号化時平均量子化値Qbとの和が例えば60より小さければ、入力画像の難しさは低く、動きベクトルの信頼性は高いとして、量子化値の変更は行なわれず、ステップS32で決定された量子化値Qjで量子化処理が行なわれる(ステップS34)。
【0083】
ステップS33で、直近Pピクチャ符号化時平均量子化値Qpと、直近Bピクチャ符号化時平均量子化値Qbとの和が例えば60より小さくなければ、直近Bピクチャ符号化時平均量子化値Qbとの和が例えば80より小さいか否かが判断される(ステップS35)。
【0084】
直近Pピクチャ符号化時平均量子化値Qpと、直近Bピクチャ符号化時平均量子化値Qbとの和が例えば80より小さければ、ステップS32で決定された量子化値Qjに対して、例えば、0.75が乗じられる(ステップS36)。この0.75Qjで、量子化処理が行なわれる(ステップS34)。
【0085】
ステップS35で、直近Pピクチャ符号化時平均量子化値Qpと、直近Bピクチャ符号化時平均量子化値Qbとの和が例えば80より小さくなければ、ステップS32で決定された量子化値Qjに対して、例えば、0.5が乗じられる(ステップS37)。この0.5Qjで、量子化処理が行なわれる。
【0086】
ステップS34で量子化処理が行なわれたら、1フレーム分のマクロブロックを処理したか否かが判断される(ステップS38)。1フレーム分のマクロブロックを処理していなければ、ステップS32にリターンされ、上述の処理が繰り返される。1フレーム分のマクロブロックを処理したら、量子化処理が終了される。
【0087】
このように、この例では、直近Pピクチャ符号化時平均量子化値Qpと、直近Bピクチャ符号化時平均量子化値Qbとの和が例えば60より大きいときには、入力画像は難しいとして、ステップS32で決定された量子化値Qjに対して例えば0.75が乗じられ、直近Pピクチャ符号化時平均量子化値Qpと、直近Bピクチャ符号化時平均量子化値Qbとの和が例えば80のより大きいときには、さらに難しいとして、ステップS12で決定された量子化値Qjに対して例えば、0.5が乗じられる。これにより、動きベクトルの信頼性の低下による画質の劣化が補償される。
【0088】
なお、上述の例では、入力画像の難しさの指標として、直近Pピクチャ符号化時平均量子化値Qpと直近Bピクチャ符号化時平均量子化値Qbとの和を用いたが、他の指標を用いることもできる。例えば、直近Pピクチャ符号化時平均量子化値Qp又は直近Bピクチャ符号化時平均量子化値Qbを、入力画像の難しさの指標として用いるようにしても良い。
【0089】
また、この例では、入力画像の難しさの指標として用いた直近Pピクチャ符号化時平均量子化値Qpと直近Bピクチャ符号化時平均量子化値Qbとの和に対して、2つの閾値を用いて、量子化値を設定しているが、1つの閾値でも良く、或いは、更に、複数の閾値を設定するようにしても良い。
【0090】
また、勿論、図4に示した例と同様に、j番目のマクロブロックがイントラ符号化処理されるものであったら、直近Pピクチャ符号化時平均量子化値Qpと直近Bピクチャ符号化時平均量子化値Qbとの和の値にかかかわらず、量子化値を変更しないようにしても良い。
【0091】
また、画面の終端付近にマクロブロックがあるか否かの情報と、入力画像の難しさの情報とを組み合わせて、量子化値を決定するようにしても良い。すなわち、図4叉は図5で示した処理と、図7で示した処理とを組み合わせて、量子化値を設定するようにしても良い。
【0092】
また、上述の例では、MPEG2方式のエンコード処理について説明したが、この発明は、MPEG2方式に限定されず、MPEG1方式や動き補償予測符号化を行なう他の方式でも同様に適用できる。
【0093】
【発明の効果】
この発明によれば、画面の終端の付近のマクロブロックで、動きベクトルの信頼性が低下すると考えられる部分では、量子化値が下げられ、符号量が増加される。これにより、画面の終端付近の動きベクトルの信頼性が低下する部分の画質劣化が補償される。
【0094】
また、この発明によれば、直近の平均量子化値が所定値以上で、画像の符号化の難しさが大きく、動きベクトルの信頼性が低下すると考えられる部分では、量子化値が下げられ、符号量が増加される。これにより、画面の終端付近の動きベクトルの信頼性が低下する部分の画質劣化が補償される。
【図面の簡単な説明】
【図1】この発明が適用された動きMPEG2エンコーダの一例のブロック図である。
【図2】動きベトクルの信頼性を説明するための略線図である。
【図3】この発明が適用された動きMPEG2エンコーダの一例の説明に用いる略線図である。
【図4】この発明が適用された動きMPEG2エンコーダの一例の説明に用いるフローチャートである。
【図5】この発明が適用された動きMPEG2エンコーダの他の例の説明に用いるフローチャートである。
【図6】この発明が適用された動きMPEG2エンコーダの更に他の例の説明に用いるフローチャートである。
【図7】この発明が適用された動きMPEG2エンコーダの更に他の例の説明に用いる略線図である。
【図8】この発明が適用された動きMPEG2エンコーダの更に他の例の説明に用いるフローチャートである。
【符号の説明】
3・・・動きベクトル検出回路、7・・・量子化回路、21・・・終端マクロブロック検出回路、22・・・量子化制御回路[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an encoding apparatus and method suitable for use in an MPEG encoder that compresses and encodes an image by the MPEG method.
[0002]
[Prior art]
In digital satellite broadcasting, the MPEG2 system is used as an image compression system. In the MPEG2 system, motion compensation predictive coding using a motion vector is performed. That is, in the MPEG2 system, three types of screens called I (Intra) picture, P (Predicti) picture, and B (Bidirectionally Predictive) picture are sent. In an I picture, DCT encoding is performed using pixels on the same screen (frame or field). In a P picture, a motion battle is detected with reference to an already encoded I picture or P picture, and DCT encoding using motion compensated prediction is performed. In the B picture, DCT encoding using motion prediction is performed with reference to the preceding and subsequent I or P pictures.
[0003]
[Problems to be solved by the invention]
As described above, in the MPEG2 system, motion compensation predictive encoding is performed, and in an I picture or B picture, a motion vector is detected by referring to an already encoded I picture or P picture, and encoding is performed. Done. When such motion compensation predictive coding is performed, the amount of codes is reduced, and efficient compression processing can be performed.
[0004]
However, when performing motion compensation predictive coding, the reliability of the motion vector is important. If the reliability of the motion vector is low, the correlation between the reference picture and the current picture becomes weak, and if the code amount is lowered, the image quality is deteriorated.
[0005]
Possible cases where the reliability of the motion vector is low include a case where a motion vector is detected in a macroblock near the end of the screen, or a case where a motion vector is detected where the input image is difficult to encode. .
[0006]
That is, the motion vector extracts a block having the same size as that of the block of the current screen to be processed from the same position on the reference screen as a base point, and moves this block within a predetermined search range. Then, the absolute value sum of the difference between each pixel of the block on the current screen and each pixel of the block on the reference screen is obtained, and this is obtained by block matching such that the block having the minimum value is detected.
[0007]
In such block matching processing, since the search range is within the screen near the center of the screen, the reliability of the motion vector is high. However, in the area close to the end of the screen, the search range is outside the screen, so that the reliability of the motion vector is considered to decrease.
[0008]
Further, when the pattern is complex and the motion is intense, it is difficult to find a block in which the sum of absolute values of differences between each pixel of the current frame block and each pixel of the reference frame block is extremely small. For this reason, it is considered that the reliability of a motion vector detected in a place where the pattern is complicated, the motion is intense, and the encoding is difficult is reduced.
[0009]
As described above, when encoding is performed by performing motion compensation using a motion vector, if the reliability of the motion vector is low, image quality deteriorates at that portion.
[0010]
Accordingly, an object of the present invention is to provide an encoding apparatus and method which prevent deterioration of image quality in a portion where the reliability of a motion vector is low.
[0011]
[Means for Solving the Problems]
This invention Motion vector detecting means for obtaining a motion vector between the input image and the reference image;
Orthogonal transform means for performing motion compensation based on the motion vector obtained by the motion vector detection means to orthogonally transform the difference between the reference image and the input image;
Quantization means for quantizing the output of the orthogonal transform means;
If the difficulty of the input image exceeds a predetermined value, the quantized value control means for reducing the quantized value of the quantizing means, assuming that the reliability of the motion vector detected by the motion vector detecting means is low;
With
The difficulty of the input image is an encoding device that is an average quantization value at the time of the latest encoding.
[0012]
In this invention, the quantization value control means is a macroblock located near the end of the input image. For The quantization value of the quantization means is assumed to be unreliable. Make smaller .
[0013]
In the present invention, the quantized value control means divides the distance from the end of the input image into a plurality of pieces, and changes the quantized value of the quantizing means stepwise in accordance with the distance from the end of the input image.
[0014]
In this invention, the quantized value control means is a macroblock that performs intra-screen coding. For The quantization value is not changed regardless of the reliability of the motion vector.
[0017]
In this invention, the quantization value control means compares an index indicating the difficulty of encoding the input image with a plurality of threshold values, and changes the quantization value of the quantization means stepwise in accordance with the threshold values.
[0019]
In the macro block near the end of the screen, the search range is outside the screen, so that the reliability of the motion vector is considered to decrease. For this reason, in the macro block near the end of the screen, the quantization value is lowered and the code amount is increased in the portion where the reliability of the motion vector is considered to be lowered. This compensates for image quality degradation in a portion where the reliability of the motion vector near the end of the screen is reduced.
[0020]
Further, it is considered that the reliability of the motion vector is lowered where the difficulty of encoding the input image is great. Where the difficulty of encoding the input image is large, the pattern is complicated and the movement is large, and this can be judged from the latest quantized value. For this reason, in the portion where the latest average quantized value is equal to or greater than the predetermined value and the reliability of the motion vector is considered to be lowered, the quantized value is lowered and the code amount is increased. This compensates for image quality degradation in a portion where the reliability of the motion vector near the end of the screen is reduced.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows an example of the configuration of an MPEG-2 encoder to which the present invention is applied. In an example of an MPEG2 system encoder to which the present invention is applied, since the macroblock at the end of the screen is considered to have low motion vector reliability, the macroblock at the end of the screen has a lower quantized value to reduce motion. Compensation for image quality deterioration due to a decrease in vector reliability is made.
[0022]
In FIG. 1, a component digital video signal including a luminance signal Y and color difference signals Cb and Cr is supplied to an
[0023]
Using the data stored in the
[0024]
The motion vector MV obtained by the motion
[0025]
Further, residual information e obtained when the motion
[0026]
In the I picture, the
[0027]
First, a case where an I picture is transmitted will be described. When transmitting an I picture, intra-frame predictive coding is performed. At this time, the
[0028]
The DCT circuit 6 converts (8 × 8) into one block, and the time-domain video signal is DCT-converted and converted into spectrum data in the frequency domain. This spectrum data is read out in order from the DC component by so-called zigzag scanning. The output of the DCT conversion circuit 6 is supplied to the quantization circuit 7.
[0029]
The quantization value is supplied to the quantization circuit 7 from the
[0030]
In the quantization circuit 7, the spectrum data from the DCT changing circuit 6 is quantized according to the quantization value from the
[0031]
The output of the quantization circuit 7 is supplied to the variable length coding circuit 8 and also to the
[0032]
From the variable length coding circuit 8, the coded bit stream is output. This bit stream is temporarily stored in the
[0033]
Further, the output of the quantization circuit 7 is supplied to the
[0034]
Next, a case where a P picture is transmitted will be described. When transmitting a P picture, forward predictive coding is performed with respect to the reference frame. At this time, the
[0035]
The
[0036]
The DCT circuit 6 performs DCT conversion on the difference data between the reference frame data and the current frame data, and converts it into spectrum data. The output of the DCT conversion circuit 6 is supplied to the quantization circuit 7. The quantizing circuit 7 quantizes the spectrum data from the DCT changing circuit 6.
[0037]
The quantization value is supplied to the quantization circuit 7 from the
[0038]
In the quantization circuit 7, the spectrum data from the DCT changing circuit 6 is quantized according to the quantization value from the
[0039]
The output of the quantization circuit 7 is supplied to the variable length coding circuit 8 and also to the
[0040]
From the variable length coding circuit 8, the coded bit stream is output. This bit stream is temporarily stored in the
[0041]
Further, the output of the quantization circuit 7 is supplied to the
[0042]
The reference screen data up to that point is supplied from the
[0043]
Next, a case where a B picture is transmitted will be described. When transmitting a B picture, bidirectional prediction encoding is performed using a past reference frame and a future reference frame. At this time, the
[0044]
The frame memory 4 stores data of past reference frames and future reference frames. The data of both reference frames are motion compensated by the
[0045]
The DCT circuit 6 performs DCT conversion on the difference data between the data of the past and future reference frames and the data of the current frame, and converts the data into spectrum data. The output of the DCT conversion circuit 6 is supplied to the quantization circuit 7. The quantizing circuit 7 quantizes the spectrum data from the DCT changing circuit 6.
[0046]
The quantization value is supplied to the quantization circuit 7 from the
[0047]
In the quantization circuit 7, the spectrum data from the DCT changing circuit 6 is quantized according to the quantization value from the
[0048]
The output of the quantization circuit 7 is supplied to the variable length coding circuit 8 and also to the
[0049]
From the variable length coding circuit 8, the coded bit stream is output. This bit stream is temporarily stored in the
[0050]
Thus, in the example of the MPEG2 system encoder to which the present invention is applied, the termination
[0051]
That is, as shown in FIG. 2A, when a macro block near the center of the screen is detected, the search range SA is within the screen. For this reason, when the block BLK1 and the block BLK2 are matching blocks, the matching block is correctly detected and the motion vector V1 is correctly obtained.
[0052]
On the other hand, as shown in FIG. 2B, when a macroblock near the end of the screen is detected, the search range SA is outside the screen. For this reason, even if the block BLK3 and the block BLK4 are matching blocks, the correct motion vector V2 cannot be detected because the block BLK3 comes outside the screen.
[0053]
Thus, the reliability of the motion vector in the macro block near the end of the screen is lower than the reliability of the motion vector in the macro block near the center of the screen. For this reason, image quality degradation occurs near the end of the screen.
[0054]
Therefore, in this example, when encoding is performed using a B picture or a P picture, the quantization value is reduced at the end of the macroblock. That is, FIG. 3 shows a macroblock of one screen. In the macroblock of one screen, in the area AR1 at the end of the macroblock as shown by diagonal lines, the
[0055]
FIG. 4 is a flowchart showing the quantization process at this time. In FIG. 4, the number of target bits is determined for each picture type (step S1). A quantization value Qj for the j-th macroblock being processed is determined (step S2). It is determined whether or not the j-th macroblock being processed is located at the end of the screen (step S3).
[0056]
If the j-th macroblock is not located at the end of the screen, the quantization value is not changed, and the quantization process is performed with the quantization value Qj determined in step S2 (step S4).
[0057]
If the j-th macroblock is located at the end of the screen, for example, 0.5 is multiplied to the quantized value Qj determined in step S2 (step S5). Quantization processing is performed with this 0.5Qj (step S4).
[0058]
When the quantization process is performed in step S4, it is determined whether or not a macro block for one frame has been processed (step S6). If the macro block for one frame is not processed, the process returns to step S2 and the above-described processing is repeated. When the macroblock for one frame is processed, the quantization process is terminated.
[0059]
Thus, in this example, in the macroblock at the end of the screen, the quantized value Qj is multiplied by 0.5 to reduce the quantized value. In this way, since the quantized value of the macroblock at the end of the screen is reduced, the deterioration of the image quality due to the decrease in the reliability of the motion vector is compensated.
[0060]
By the way, even in the case of a P picture or a B picture, when the code amount is reduced by encoding within a frame, an intra-frame encoding process (intra encoding) is performed. When intra processing is performed, since no motion vector is required, even when the j-th macroblock is at the end of the screen, the image quality does not deteriorate, and there is no need to change the quantization value.
[0061]
FIG. 5 is a flowchart showing an example in consideration of the case where such intra processing is performed. In FIG. 5, the number of target bits is determined for each picture type (step S11). A quantization value Qj for the j-th macroblock being processed is determined (step S12).
[0062]
It is determined whether or not the j-th macroblock is a macroblock for intra coding processing (step S13). If the j-th macroblock is a macroblock for intra coding processing, the quantization value is not changed, and the quantization processing is performed with the quantization value Qj determined in step S12 (step S14).
[0063]
If it is determined in step S13 that the jth macroblock is not a macroblock for intra coding processing, it is determined whether the jth macroblock is a macroblock at the end of the screen (step S15).
[0064]
If the j-th macroblock is not the macroblock at the end of the screen, the quantization value is not changed, and the quantization process is performed with the quantization value Qj determined in step S12 (step S14).
[0065]
If the j-th macroblock is the macroblock at the end of the screen, for example, 0.5 is multiplied to the quantized value Qj determined in step S12 (step S16). With this 0.5Qj, the quantization process is performed (step S14).
[0066]
When the quantization process is performed in step S14, it is determined whether or not a macro block for one frame has been processed (step S17). If the macroblock for one frame is not processed, the process returns to step S12 and the above-described processing is repeated. When the macroblock for one frame is processed, the quantization process is terminated.
[0067]
FIG. 6 shows another example of a quantization value setting process for compensating for image quality deterioration due to a decrease in the reliability of the motion vector.
In the above-described example, the quantum value is set to 0.5 in the area AR1 at the end of the macroblock in FIG. 3 so as to prevent image quality deterioration due to a decrease in the reliability of the motion vector. In this example, Furthermore, the terminal area AR11 and the second area AR12 from the terminal end shown in FIG. 7 are detected. When the macro block is detected in the second area AR12 from the end, the quantized value is decreased. When the macro block is detected in the end area AR11, the quantized value is further decreased. I have to.
[0068]
In FIG. 6, the number of target bits is determined for each picture type (step S21). A quantization value Qj for the j-th macroblock being processed is determined (step S22).
[0069]
It is determined whether or not the j-th macroblock being processed is located within 3 macroblocks from the edge of the screen (step S23). If the jth macroblock being processed is within 3 macroblocks from the edge of the screen, it is determined whether or not it is positioned at the end of the screen (step S24). If it is not located at the end of the screen, it is determined whether or not it is located at the second macroblock from the end of the screen (step S25).
[0070]
If it is determined in step S23 that the j-th macroblock being processed is not located within 3 macroblocks from the end of the screen, the quantization value is not changed, and the quantization determined in step S22 is performed. Quantization processing is performed with the value Qj (step S26).
[0071]
If it is determined in step S24 that the j-th macroblock being processed is located at the end of the screen, the quantized value Qj determined in step S22 is multiplied by, for example, 0.5 ( Step S27). In step S26, a quantization process is performed with the changed quantization value 0.5Qj.
[0072]
If it is determined in step S25 that the j-th macroblock being processed is located at the second macroblock from the end of the screen, the quantization value Qj determined in step S22 is, for example, 0. 75 is multiplied (step S28). In step S26, quantization processing is performed with the changed quantization value 0.75Qj.
[0073]
If it is determined in step S25 that the j-th macroblock being processed is not located at the second macroblock from the end of the screen, the quantization value Qj determined in step S22 is, for example, 0. 9 is multiplied (step S29). In step S26, a quantization process is performed with the changed quantization value 0.9Qj.
[0074]
When the quantization process is performed in step S26, it is determined whether or not a macro block for one frame has been processed (step S30). If the macro block for one frame is not processed, the process returns to step S22 and the above-described processing is repeated. When the macroblock for one frame is processed, the quantization process is terminated.
[0075]
In the above example, it is detected whether or not it is at the position of the macroblock at the end of the screen and whether or not it is at the position of the second macroblock from the end of the screen. The quantized value may be switched by detecting whether or not it is in the fourth, fourth,... Macroblock.
[0076]
Of course, as in the example shown in FIG. 4, if the j-th macroblock is to be intra-processed, the quantized value is used regardless of whether it is the second from the end of the screen or the end. May not be changed.
[0077]
FIG. 8 shows still another example of the quantization value setting process for compensating for the image quality deterioration due to the decrease in the reliability of the motion vector.
In the above examples, the macro block near the end of the screen has low motion vector reliability. However, the macro block near the end of the screen has a smaller quantized value, resulting in a decrease in motion vector reliability. The image quality is compensated for.
[0078]
However, it is not only in the case of the macroblock at the end of the screen that the reliability of the motion vector decreases. Even when the input image is difficult, that is, when the pattern is complex and the motion is intense, the reliability of the motion vector is lowered.
[0079]
Therefore, in this example, when the difficulty of the input image is large, the quantization value is lowered to compensate for the image quality deterioration due to the decrease in the reliability of the motion vector.
[0080]
In this example, the sum of the most recent P picture encoding average quantization value and the B picture encoding average quantization value is used as an index as to whether or not the difficulty of the input image is large.
[0081]
In FIG. 8, the number of target bits is determined for each picture type (step S31). The quantization value Qj for the jth macroblock being processed is determined (step S32).
[0082]
It is determined whether or not the sum of the average quantization value Qp at the time of encoding the latest P picture and the average quantization value Qb at the time of encoding the latest B picture is smaller than 60 (step S33). If the sum of the average quantization value Qp at the time of encoding the latest P picture and the average quantization value Qb at the time of encoding the latest B picture is smaller than 60, for example, the difficulty of the input image is low and the reliability of the motion vector is high. The quantization value is not changed, and the quantization process is performed with the quantization value Qj determined in step S32 (step S34).
[0083]
In step S33, if the sum of the average quantization value Qp for the latest P picture encoding and the average quantization value Qb for the latest B picture encoding is not smaller than 60, for example, the average quantization value Qb for the latest B picture encoding It is determined whether or not the sum is less than 80, for example (step S35).
[0084]
If the sum of the average quantization value Qp at the time of the latest P picture encoding and the average quantization value Qb at the time of the latest B picture encoding is smaller than 80, for example, for the quantization value Qj determined in step S32, for example, 0.75 is multiplied (step S36). Quantization processing is performed at 0.75Qj (step S34).
[0085]
In step S35, if the sum of the average quantization value Qp for the latest P picture encoding and the average quantization value Qb for the latest B picture encoding is not smaller than 80, for example, the quantization value Qj determined in step S32 is set. On the other hand, for example, 0.5 is multiplied (step S37). With this 0.5Qj, a quantization process is performed.
[0086]
When the quantization process is performed in step S34, it is determined whether or not a macro block for one frame has been processed (step S38). If the macroblock for one frame is not processed, the process returns to step S32 and the above-described processing is repeated. When the macroblock for one frame is processed, the quantization process is terminated.
[0087]
Thus, in this example, when the sum of the average quantization value Qp at the time of the latest P picture encoding and the average quantization value Qb at the time of the latest B picture encoding is larger than 60, for example, the input image is difficult, and step S32 For example, 0.75 is multiplied by the quantized value Qj determined in (5), and the sum of the average quantized value Qp at the time of encoding the latest P picture and the average quantized value Qb at the time of encoding the latest B picture is 80, for example. When it is larger, it is further difficult to multiply the quantized value Qj determined in step S12 by, for example, 0.5. As a result, image quality degradation due to a decrease in the reliability of the motion vector is compensated.
[0088]
In the above-described example, the sum of the average quantization value Qp at the time of the latest P picture encoding and the average quantization value Qb at the time of the latest B picture encoding is used as an index of difficulty of the input image. Can also be used. For example, the average quantization value Qp when encoding the latest P picture or the average quantization value Qb when encoding the latest B picture may be used as an index of difficulty of the input image.
[0089]
Further, in this example, two thresholds are set for the sum of the average quantization value Qp at the time of nearest P picture coding and the average quantization value Qb at the time of nearest B picture coding used as an index of difficulty of the input image. The quantized value is set by using a single threshold value, or a plurality of threshold values may be set.
[0090]
Of course, as in the example shown in FIG. 4, if the j-th macroblock is to be intra-coded, the average quantization value Qp at the time of the latest P picture coding and the average at the time of the latest B picture coding Regardless of the sum of the quantization value Qb, the quantization value may not be changed.
[0091]
Alternatively, the quantization value may be determined by combining information indicating whether there is a macroblock near the end of the screen and information on the difficulty of the input image. That is, the quantized value may be set by combining the process shown in FIG. 4 or 5 and the process shown in FIG.
[0092]
In the above example, the MPEG2 system encoding process has been described. However, the present invention is not limited to the MPEG2 system, and can be similarly applied to the MPEG1 system and other systems that perform motion compensation predictive coding.
[0093]
【The invention's effect】
According to the present invention, in the macro block near the end of the screen, the quantization value is lowered and the code amount is increased in the portion where the reliability of the motion vector is considered to be lowered. This compensates for image quality degradation in a portion where the reliability of the motion vector near the end of the screen is reduced.
[0094]
In addition, according to the present invention, the quantization value is lowered in a portion where the most recent average quantization value is equal to or greater than a predetermined value, the image encoding is difficult, and the reliability of the motion vector is considered to be reduced. The code amount is increased. This compensates for image quality degradation in a portion where the reliability of the motion vector near the end of the screen is reduced.
[Brief description of the drawings]
FIG. 1 is a block diagram of an example of a motion MPEG2 encoder to which the present invention is applied.
FIG. 2 is a schematic diagram for explaining the reliability of a motion vehicle.
FIG. 3 is a schematic diagram used for explaining an example of a motion MPEG2 encoder to which the present invention is applied;
FIG. 4 is a flowchart used for explaining an example of a motion MPEG2 encoder to which the present invention is applied;
FIG. 5 is a flowchart used to describe another example of a motion MPEG2 encoder to which the present invention is applied;
FIG. 6 is a flowchart used to describe still another example of the motion MPEG2 encoder to which the present invention is applied;
FIG. 7 is a schematic diagram used for explaining still another example of the motion MPEG2 encoder to which the present invention is applied;
FIG. 8 is a flowchart used to describe still another example of the motion MPEG2 encoder to which the present invention is applied;
[Explanation of symbols]
DESCRIPTION OF
Claims (7)
上記動きベトル検出手段で求められた動きベクトルに基づいて動き補償を行なって上記参照画像と上記入力画像との差分を直交変換する直交変換手段と、
上記直交変換手段の出力を量子化する量子化手段と、
上記入力画像の難しさが所定値を越える場合には、上記動きベクトル検出手段により検出された動きベトクルの信頼性が低いとして、上記量子化手段の量子化値を小さくする量子化値制御手段と
を備え、
上記入力画像の難しさは、直近の符号化時平均量子化値である符号化装置。Motion vector detecting means for obtaining a motion vector between the input image and the reference image;
Orthogonal transform means for performing motion compensation based on the motion vector obtained by the motion vector detection means and orthogonally transforming the difference between the reference image and the input image;
Quantization means for quantizing the output of the orthogonal transform means;
When the difficulty of the input image exceeds a predetermined value, it is determined that the reliability of the motion vector detected by the motion vector detection unit is low, and a quantization value control unit that decreases the quantization value of the quantization unit; With
The difficulty of the said input image is the encoding apparatus which is the average quantization value at the time of the last encoding.
請求項1に記載の符号化装置。The quantized value control means reduces the quantized value of the quantizing means for a macroblock located near the end of the input image, assuming that the motion vector has low reliability. Encoding device.
請求項2に記載の符号化装置。The quantized value control means divides the distance from the end of the input image into a plurality, and changes the quantized value of the quantizing means stepwise according to the distance from the end of the input image. 2. The encoding device according to 2.
請求項1に記載の符号化装置。The encoding apparatus according to claim 1, wherein the quantized value control means does not change the quantized value for the macroblock that performs the intra-picture encoding, regardless of the reliability of the motion vector.
請求項1に記載の符号化装置。The quantized value control means compares an index indicating difficulty in encoding the input image with a plurality of threshold values, and changes the quantized value of the quantizing means stepwise according to the threshold values. The encoding device according to 1.
求められた動きベクトルに基づいて動き補償を行なって上記参照画像と上記入力画像との差分を直交変換し、
上記入力画像の難しさが所定値を越える場合には、求められた動きベトクルの信頼性が低いとして、量子化値を小さくし、上記直交変換された出力を量子化し、
上記入力画像の難しさは、直近の符号化時平均量子化値である符号化方法。Find the motion vector between the input image and the reference image,
Performing motion compensation based on the obtained motion vector to orthogonally transform the difference between the reference image and the input image,
When the difficulty of the input image exceeds a predetermined value, the reliability of the obtained motion vector is low, the quantization value is reduced, and the orthogonally transformed output is quantized.
The difficulty of the said input image is the encoding method which is the average quantization value at the time of the last encoding.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10842999A JP4269405B2 (en) | 1999-04-15 | 1999-04-15 | Encoding apparatus and method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10842999A JP4269405B2 (en) | 1999-04-15 | 1999-04-15 | Encoding apparatus and method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000308063A JP2000308063A (en) | 2000-11-02 |
| JP4269405B2 true JP4269405B2 (en) | 2009-05-27 |
Family
ID=14484560
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10842999A Expired - Fee Related JP4269405B2 (en) | 1999-04-15 | 1999-04-15 | Encoding apparatus and method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4269405B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4788971B2 (en) * | 2007-03-22 | 2011-10-05 | 日本電気株式会社 | Video compression encoding apparatus, method and program thereof |
-
1999
- 1999-04-15 JP JP10842999A patent/JP4269405B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2000308063A (en) | 2000-11-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10148966B2 (en) | Video encoding method and apparatus, and video decoding apparatus | |
| EP1065883B1 (en) | Image predictive decoding method | |
| US5500689A (en) | System for detecting a video signal image intensity gradient | |
| US20050175101A1 (en) | Apparatus and method for video communication | |
| KR19980080602A (en) | Method and apparatus for encoding video signal, and method and apparatus for decoding video signal | |
| JPH10336672A (en) | Encoding system converter and motion vector detection method therefor | |
| JP3599942B2 (en) | Moving picture coding method and moving picture coding apparatus | |
| KR100364748B1 (en) | Apparatus for transcoding video | |
| EP1838108A1 (en) | Processing video data at a target rate | |
| JP4269405B2 (en) | Encoding apparatus and method | |
| KR970003100B1 (en) | Video encoding method to adaptively select forced intra mode | |
| KR20090037288A (en) | Real-time scene change detection method for video coded data rate control, video call quality improvement method, and video call system | |
| JP3207095B2 (en) | Motion compensation inter-frame / intra-frame coding apparatus | |
| JP3382292B2 (en) | Image encoding apparatus and method | |
| JPH0984024A (en) | Video signal encoder | |
| KR100242653B1 (en) | In-frame encoding method and apparatus | |
| JP2002209213A (en) | MOTION VECTOR DETECTION METHOD AND DEVICE, AND IMAGE ENCODING DEVICE | |
| KR100207396B1 (en) | Method for preventing error in encoder | |
| KR0157467B1 (en) | Moving image encoding method and device | |
| JP4359273B2 (en) | Coding mode selection method | |
| JP2004140794A (en) | Image encoding method and image encoding device | |
| KR0162204B1 (en) | Image data analysis device of moving picture coding system | |
| JP3617652B2 (en) | Image coding apparatus and image coding method | |
| KR100238087B1 (en) | Intrablock insertion method and video encoding device using same | |
| JP4353928B2 (en) | Data compression method, recording method, and transmission method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060125 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070912 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20071002 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20071106 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080812 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081010 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20081104 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081113 |
|
| A911 | Transfer of reconsideration by examiner before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20081225 |
|
| 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: 20090203 |
|
| 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: 20090216 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120306 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120306 Year of fee payment: 3 |
|
| LAPS | Cancellation because of no payment of annual fees |