JP2004297696A - Video signal encoder - Google Patents

Video signal encoder Download PDF

Info

Publication number
JP2004297696A
JP2004297696A JP2003090582A JP2003090582A JP2004297696A JP 2004297696 A JP2004297696 A JP 2004297696A JP 2003090582 A JP2003090582 A JP 2003090582A JP 2003090582 A JP2003090582 A JP 2003090582A JP 2004297696 A JP2004297696 A JP 2004297696A
Authority
JP
Japan
Prior art keywords
quantization parameter
encoding
unit
code amount
video signal
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.)
Pending
Application number
JP2003090582A
Other languages
Japanese (ja)
Inventor
Mari Yasuda
真理 安田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2003090582A priority Critical patent/JP2004297696A/en
Publication of JP2004297696A publication Critical patent/JP2004297696A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To improve the quality of a video reproduced by coded data by flexibly controlling generation of codes depending on situations when encoding video signals. <P>SOLUTION: A video signal encoder 1 is provided with an encoding unit 10 generating the coded data by an encoding operation including a quantization operation in which the video signals are quantized in processing unit blocks, a buffer 30 for temporarily storing the coded data and a code amount control unit 40 for controlling a quantization parameter used for the quantizing operation in the encoding unit 10. The code amount control unit 40 determines the quantization parameter QPn+1 used for the next quantization operation based on an accumulated code amount BF in the buffer 30 using a judgement standard indicating a relation between the accumulated code amount BF in the buffer 30 and an increase/decrease value R of the quantization parameter. A judgement unit 43 in the quantization amount control unit 40 sets the judgement standard variable in accordance with the present quantization parameter QPn. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、映像信号を符号化する技術に関するものであり、特に、符号化処理に用いる量子化パラメータを制御して発生符号量を調整する映像信号符号化装置に関するものである。
【0002】
【従来の技術】
従来より、映像信号を符号化する映像信号符号化装置において、符号化処理に用いる量子化パラメータを制御することによって、符号化処理にて得られる映像信号の符号量(以下、発生符号量という)を調整する技術が知られている。この種の映像信号符号化装置は、映像信号を符号化する符号化部と、符号化された映像信号を格納して所定の容量ごとに出力するバッファと、符号化部の量子化パラメータを制御する制御部とを備えている。
【0003】
符号化部には、複数のフレームからなる動画を表す映像信号が入力される。符号化部は、各フレームを複数の処理単位ブロックに分割して、処理単位ブロックごとに映像信号を符号化して符号データを生成する。この符号化処理には、量子化パラメータを用いて映像信号を量子化する量子化処理が含まれている。
【0004】
符号化部は、複数のフレームに対して所定の間隔でフレーム内符号化を行なうとともに、フレーム内符号化される2つのフレームの間ではフレーム間符号化を行なう。ここで、フレーム内符号化とは、対象とするフレームのみを用いた符号化である。また、フレーム間符号化とは、フレーム間の相互の関係を用いた符号化である。一般的には、フレーム内符号化にて生成された符号データの方がフレーム間符号化にて生成された符号データより符号量が大きい。
【0005】
バッファは、符号データを順次蓄積していくとともに、所定のタイミングおよび所定のビットレートで、蓄積した符号データ出力する。ここで、バッファから一度に出力できる容量は、上記のビットレートに応じて決まっている。そこで、バッファ内に蓄積された映像信号の符号量が、一度に出力できるデータ容量よりも小さいときには、一度の出力でバッファ内のすべての信号が出力される。一方、バッファ内に蓄積された符号量が、一度に出力できるデータ容量よりも大きいときには、すべてのデータを出力できずに、出力後にある程度のデータが残る。残ったデータは次の出力タイミングで出力される。
【0006】
ここで、映像信号の符号化処理では、同じ画素数の処理単位ブロックを符号化したときにも、信号の内容によって符号化処理により発生する符号量が異なる。これに対して、符号化処理によって発生する符号量は、符号化処理に用いる量子化パラメータの増減によって変化させることができる。そこで、制御部は、量子化パラメータを増減させることにより、バッファに蓄積される符号量を調整する。
【0007】
このために、制御部は、符号化処理中に、バッファに蓄積された符号量(以下、符号蓄積量という)とその時点での目標符号量との差分をとり、その差分に応じて符号化部にて用いる量子化パラメータを増減させる。具体的には、制御部は、バッファ内の符号蓄積量が目標符号量よりも大きいときは、量子化パラメータを小さくして発生符号量を増大させ、逆に、符号蓄積量が目標符号量よりも小さいときは、量子化パラメータを大きくして発生符号量を抑える。
【0008】
上記のような映像信号符号化装置は、例えば特許文献1に記載されている。
【0009】
【特許文献1】
特開2001−169281号公報(第7−11頁、第5図)
【0010】
【発明が解決しようとする課題】
しかしながら、従来の映像信号符号化装置では、バッファの符号蓄積量が目標符号量に対して低くなったときに、量子化パラメータを小さくしても、発生符号量を増加させるのに時間がかかってしまう。このことによって、目標符号量に対してバッファの空き容量に余裕が生じて発生符号量を増加させてもよい状況でも、その空き容量の余裕を有効に活用して画質を向上させることができない事態が生じる。
【0011】
また、上述のように、フレーム内符号化にて発生する符号量はフレーム間符号化により発生する符号量よりも大きい。そして、バッファから1回の出力で出力できるデータ量は、上記のように、決まっている。そこで、フレーム内符号化の時点では、バッファ内の符号蓄積量をなるべく小さくしておくことが望ましい。そのためには、フレーム内符号化の前で発生符号量を抑える必要がある。しかし、発生符号量を抑えれば、その分だけ画質が低下してしまう。
【0012】
本発明は、映像信号を符号化する際の発生符号量を状況に応じて柔軟にコントロールすることにより、符号化された映像信号の画質を向上させることを目的とする。
【0013】
【課題を解決するための手段】
本発明の映像信号符号化装置は、映像信号を所定の処理単位ごとに量子化パラメータを用いて量子化することによって符号化する符号化手段と、前記符号化手段にて符号化された映像信号を蓄積するバッファと、前記バッファに蓄積されたデータの容量と量子化パラメータの増減値との関係を表す量子化パラメータ増減基準を用いて、前記バッファに蓄積されたデータの容量に基づいて量子化パラメータを決定する量子化パラメータ決定手段と、前記処理単位のデータに対して用いた量子化パラメータに応じて、前記処理単位の後の処理単位のデータに対して用いる量子化パラメータを決定するための量子化パラメータ増減基準を可変に設定する基準変更手段とを備えている。
【0014】
この構成により、ある処理単位のデータの符号化処理に用いた量子化パラメータに基づいて、その後の処理単位のデータに用いる量子化パラメータの増減基準が設定されるので、適切な量子化パラメータを設定でき、符号化処理にて発生する符号量を柔軟にコントロールすることができる。なお、上記の映像信号符号化装置において、上記の各手段はすべての処理単位のデータに対して機能しなければならないものではなく、後述するように、特定の処理単位のデータに対しては、他の手段が機能するように構成されてもよい。
【0015】
また、上記の映像信号符号化装置では、前記基準変更手段は、前記処理単位のデータに対して用いた量子化パラメータが所定の閾値よりも高いときは、前記量子化パラメータが前記閾値より低いときよりも、量子化パラメータの減少傾向が強い量子化パラメータ増減基準を設定する。
【0016】
この構成により、量子化パラメータが高く設定されていることによって発生符号量が抑えられており、かつバッファの空き容量に余裕が生じて発生符号量を増加させてもよいときには、量子化パラメータを速く減少させることができるので、バッファの空き容量の余裕を有効に活用して、符号データにより再現される映像の画質を向上させることができる。
【0017】
また、上記の映像信号符号化装置において、前記量子化パラメータ決定手段は、前記量子化パラメータ増減基準に従って量子化パラメータを算出する量子化パラメータ算出手段と、前記量子化パラメータ算出手段にて算出された量子化パラメータを用いて前記処理単位のデータを量子化したときの発生符号量を予測する符号量予測手段と、前記符号量予測手段にて予測された発生符号量に基づいて、前記量子化パラメータ算出手段にて算出された量子化パラメータを採用するか否かを判定する採用判定手段とを有し、前記採用判定手段にて採用すると判定された量子化パラメータを前記符号化手段にて用いる量子化パラメータとして決定する。
【0018】
この構成により、採用判定手段にて発生符号量の予測に基づく採否の判定が行なわれた上で量子化パラメータが決定されるので、量子化パラメータの増減による発生符号量の過度の変化を防止することができる。
【0019】
また、上記の映像信号符号化装置において、前記符号化手段は、複数のフレームからなる動画を表す映像信号をフレーム内符号化およびフレーム間符号化によって符号化し、前記基準変更手段は、フレーム間符号化される処理単位のデータに対しては、次のフレーム内符号化までの符号化の回数に応じて前記量子化パラメータ増減基準を設定する。
【0020】
この構成により、フレーム間符号化される処理単位のデータについては、次のフレーム内符号化までの符号化の回数に応じて量子化パラメータ増減基準が設定されるので、フレーム間の相関関係を用いて動画を符号化する場合に、バッファの空き容量を有効に活用して、効率のよい符号化処理を実現できる。なお、次のフレーム内符号化までの符号化の回数として、次のフレーム内符号化までのフレーム数がカウントされてもよいし、次のフレーム内符号化までに処理すべき処理単位の数がカウントされてもよい。
【0021】
本発明の他の態様の映像信号符号化装置は、複数のフレームからなる動画を表す映像信号を所定の処理単位ごとに量子化パラメータを用いて量子化することによって、前記複数のフレームをフレーム内符号化およびフレーム間符号化によって符号化する符号化手段と、前記符号化手段にて符号化された映像信号を格納するバッファと、前記バッファに蓄積されたデータの容量と量子化パラメータの増減値との関係を表す量子化パラメータ増減基準を用いて、前記バッファに蓄積されたデータの容量に基づいて量子化パラメータを決定する量子化パラメータ決定手段と、前記符号化手段にてフレーム間符号化される処理単位のデータに対しては、次のフレーム内符号化までの符号化の回数に応じて前記量子化パラメータ増減基準を可変に設定する基準変更手段とを備えている。
【0022】
この構成により、フレーム間符号化される処理単位のデータについては、次のフレーム内符号化までの符号化の回数に応じて量子化パラメータ増減基準が設定されるので、フレーム間の相関関係を用いて動画を符号化する場合に、バッファの空き容量を有効に活用して、効率のよい符号化処理を実現できる。
【0023】
また、上記の映像信号符号化装置において、前記基準変更手段は、前記フレーム内符号化の直前の処理単位のデータに対しては、他の処理単位のデータよりも量子化パラメータの増加傾向が強い量子化パラメータ増減基準を設定する。
【0024】
この構成により、フレーム内符号化の直前では、他の処理単位のデータよりも量子化パラメータの増加傾向が強い量子化パラメータ増減基準が設定されるので、フレーム内符号化の直前で急速に量子化パラメータを増加させて、発生符号量を減少させることができる。このことによって、フレーム内符号化されるフレームに対しては十分な符号量を発生させることができるとともに、フレーム間符号化されるフレームに対しては、より多くの処理単位に対して発生符号量を多くした符号化が可能となり、符号データにより再現される映像の画質を向上させることができる。
【0025】
本発明のさらに他の態様の映像信号符号化装置は、映像信号を所定の処理単位ごとに量子化パラメータを用いて量子化することによって、前記映像信号を符号化する符号化手段と、前記符号化手段にて符号化された映像信号を格納するバッファと、前記バッファに蓄積されたデータの容量と量子化パラメータの増減値との関係を表す量子化パラメータ増減基準を用いて、前記バッファに蓄積されたデータの容量に基づいて量子化パラメータを決定する量子化パラメータ決定手段と、前記処理単位の後の処理単位のデータに対して用いる量子化パラメータを決定するための量子化パラメータ増減基準を可変に設定する基準変更手段とを備えている。
【0026】
この構成により、量子化パラメータの増減基準が可変に設定されるので、発生符号量を状況に応じて柔軟にコントロールすることにより、符号データにより再現される映像の画質を向上させることができる。
【0027】
また、本発明の特徴を備えた映像信号符号化方法、その映像信号符号化方法をコンピュータに実行させるプログラム、およびそのプログラムを格納した記録媒体によっても上記の課題が解決される。
【0028】
【発明の実施の形態】
以下、本発明の実施の形態について、図面を用いて説明する。
【0029】
(第1の実施の形態)
図1および図2は、第1の実施の形態の映像信号符号化装置1の構成を示すブロック図である。第1の実施の形態の映像信号符号化装置1は、映像信号を符号化して圧縮する符号化部10、符号化された映像信号を一時記憶するバッファ30、および符号化部10にて発生する符号量を制御する符号量制御部40を備えている。図1では、符号量制御部40の構成が詳しく説明されており、図2では、符号化部10の構成が詳しく説明されている。以下では、まず、図2を用いて映像信号符号化装置1の全体の構成および符号化部10の構成を説明し、その後に図1を参照して符号量制御部40の構成を説明する。
【0030】
図2は、上述したように、符号化部10の構成が詳しく示された映像信号符号化装置1の構成を示すブロック図である。図2に示すように、映像信号符号化装置1は、符号化部10、バッファ30および符号量制御部40を備えている。
【0031】
符号化部10は、分割部11、減算部12、DCT部13、量子化部14およびVLC部15を備えている。分割部11は、撮像素子などによって得られた動画を示す映像信号を取り込む。映像信号は、複数のフレームからなっている。分割部11には、例えば1秒間に30フレームの画像が入力される。分割部11は、入力された各フレームの画像を処理単位ブロックに分割して、処理単位ブロックごとの画像を示す画像データを生成する。分割部11は、例えば、1フレームの画像を横方向に3等分し、縦方向に5等分して、それぞれ大きさの等しい15の処理単位ブロックに分割する。なお、この処理単位ブロックが本発明の処理単位に相当するが、本発明の処理単位は、上記のように15分割されたブロックより大きくても小さくてもよく、さらに、1フレームが処理単位とされてもよい。
【0032】
分割部11より出力された処理単位ブロックは、そのブロックがフレーム間符号化される場合には、減算部12に入力され、そのブロックがフレーム内符号化されるときには、DCT部13に入力される。
【0033】
減算部12は、フレーム間符号化すべき処理単位ブロックの画像データを取り込む。そして、減算部12は、その処理単位ブロックの画像データから後述する予測参照画像データを差し引いて予測誤差データを算出する。DCT部13は、分割部11より出力された処理単位ブロックの画像データおよび減算部12より出力された予測誤差データに対して2次元離散コサイン変換を行なう。
【0034】
量子化部14は、DCT部13にて2次元離散コサイン変換された処理単位ブロックの画像データおよび予測誤差データを量子化する。ここで、量子化部14は、量子化パラメータを用いて量子化処理を行なう。量子化パラメータとは、量子化幅、すなわち量子化の粗さを示すパラメータである。量子化パラメータが大きいと、符号データの容量、すなわち発生符号量が少なくなり、逆に、量子化パラメータが小さいと、発生符号量は多くなる。VLC部15は、量子化された処理単位ブロックの画像データおよび予測誤差データを可変長変換して、符号データを生成する。符号データは、バッファ30に出力される。
【0035】
符号化部10は、さらに、逆量子化部16、逆DCT部17、加算部18、メモリ部19、動き検出部20、動き補償部21および動き予測部22を備えている。逆量子化部16は、量子化部14にて量子化された画像データおよび予測誤差データに対して逆量子化を施す。逆DCT部17は、逆量子化部16で逆量子化された処理単位ブロックのデータに対して2次元逆離散コサイン変換を施して予測誤差データまたは再構成画像データを生成する。加算器18は、逆DCT部17で作成された予測誤差データと動き補償部21で得られた予測参照画像データを加算して、再構成画像データを生成する。メモリ部19は、加算器18または逆DCT部17にて生成された再構成画像データを記憶する。
【0036】
動き検出部20は、メモリ部19に記憶された再構成画像データを取り込む。動き検出部20は、分割部11から入力された非圧縮の処理単位ブロックの画像データから再構成画像データを比較することにより、動きベクトルデータを検出する。動き補償部21は、動き検出部20にて検出された動きベクトルデータをもとに、再構成画像データから予測参照画像データを取り出す。この予測参照画像データは、上述のように、減算部12にて用いられる。すなわち、減算部12は、非圧縮の処理単位ブロックの画像データから動き補償部21で生成された予測参照画像データを差し引くことにより、予測誤差データを算出する。動き予測部22は、予測動きベクトルデータを算出し、動き検出部20にて検出された動きベクトルデータから予測動きベクトルデータを差し引いて動きベクトル差分データを算出する。
【0037】
上記の構成によって、フレーム内符号化されるフレームの画像データは、分割部11で分割された処理単位ブロックに分割されて、DCT部13、量子化部14およびVLC部15にて処理を施され、符号データとしてバッファ30に出力される。また、フレーム間符号化されるフレームの画像データは、分割部11で処理単位ブロックに分割されて、減算部12に入力される。減算部12では、フレーム間符号化される処理単位ブロックの画像データから予測参照画像データを差し引くことにより予測誤差データを算出する。そして予測誤差データは、DCT部13、量子化部14およびVLC部15での処理を経て、符号データとしてバッファ30に出力される。また、予測誤差データは、量子化部14にて量子化された後に予測参照画像データを生成するために用いられる。
【0038】
上記のような映像信号の符号化処理において、量子化部14にて用いられる量子化パラメータは、符号量制御部40によって制御される。量子化パラメータが制御されることによって、符号化部10から出力される符号データの符号量が制御される。符号量制御部40は、バッファ30の使用状況に応じて、バッファ30の符号蓄積量が目標とする値になるように量子化パラメータを制御する。
【0039】
図1は、符号量制御部40の構成が示された映像信号符号化装置1のブロック図である。符号量制御部40は、目標符号量算出部41、差分算出部42、判定部43、量子化パラメータ算出部44、符号量予測部45および量子化パラメータ決定部46を備えている。
【0040】
目標符号量算出部41は、符号化部10にて処理単位ブロックの画像データが符号化されるごとに、その時点でバッファ30に蓄積されているべき目標符号量TBを算出する。目標符号量算出部41は、フレームレートFR、ビットレートBRを用いて、式(1)によって目標符号量TBを算出する。
【数1】
目標符号量TB=(ビットレートBR/フレームレートFR)×(ブロック番号BN/総ブロック数TN) ・・・(1)
【0041】
ここで、ブロック番号BNは、1フレーム中の圧縮処理が終了した処理単位ブロックの数を示し、総ブロック数TNは、1フレームに含まれる処理単位ブロックの総数を示す。すなわち、目標符号量TBは、1フレーム分のすべての処理単位ブロックを処理したときにバッファ30に蓄積されているべき符号量(ビットレートBR/フレームレートFR)に対して、1フレームの総ブロック数に対する圧縮処理が済んだブロックまでの割合(ブロック番号BN/総ブロック数TN)を掛けた値である。
【0042】
差分算出部42は、バッファ30の符号蓄積量BFと目標符号量TBとの差分Nを算出する。判定部43には、バッファ30の符号蓄積量BFと量子化パラメータの増減値Rとの関係をブロック番号BNごとに規定した増減値の判定基準が記憶されている。判定基準は、符号蓄積量BFと目標符号量TBとの差分Nがプラスのときには、増減値Rがゼロもしくはプラスになるように、また、差分Nがマイナスのときには、増減値Rがゼロもしくはマイナスになるように、差分Nと増減値Rとの関係を規定している。また、この判定基準では、差分Nが大きいほど量子化パラメータの増減値Rも大きくなる。
【0043】
判定部43は、この判定基準に従って、各ブロック番号BNについてバッファ30の符号蓄積量がそのブロック番号BNに対応する目標符号量TBよりも多いときは、量子化パラメータを増加させる。これによって、発生符号量が減少して、符号蓄積量BFが目標符号量TBに近づけられる。一方、判定部43は、符号蓄積量が目標符号量よりも少ないときは、判定基準に従って、量子化パラメータを減少させる。これによって、発生符号量が増加して、符号蓄積量BFが目標符号量TBに近づけられる。
【0044】
このように、判定部43は、バッファ30の符号蓄積量BFに基づいて、量子化パラメータを増減させることにより、符号蓄積量BFが目標符号量TBに近づくように制御する。ただし、符号蓄積量BFと目標符号量TBとの差分Nが同じであって量子化パラメータに同じ増減値Rを加算したとしても、量子化パラメータが既に大きな値に設定されていて発生符号量が増加傾向にあるのか、量子化パラメータが小さく設定されていて発生符号量が減少傾向にあるのかによって、符号蓄積量BFが目標符号量TBに近づくまでの速度、すなわち符号蓄積量BFが目標符号量TBに近づくまでに要する処理単位ブロック数は異なる。例えば、既に量子化パラメータが大きく設定されて、発生符号量が少なく抑えられているときに、符号蓄積量BFが目標符号量TBに満たなくなった場合には、直ちに発生符号量を増加させて目標符号量TBに到達させることが望まれる。したがって、符号蓄積量BFをより早く目標符号量TBに到達させるためには、符号蓄積量BFと目標符号量TBとの差分Nだけでなく、発生符号量が増加する状態にあるのか減少する状態にあるのかを考慮して、量子化パラメータを制御することが望ましい。
【0045】
そこで、判定部43は、上記のような判定基準であって量子化パラメータの減少傾向または増加傾向の強弱が互いに異なる複数の判定基準を記憶している。本実施の形態では、判定部43に2種類の判定基準が記憶されている。そして、判定部43は、発生符号量が増加する状態にあるか減少する状態にあるかに応じて、処理単位ブロックの処理ごとに、この2つの判定基準のいずれを用いるかを決定し、決定された判定基準に従って量子化パラメータの増減値Rを算出する。この判定基準は、本発明の量子化パラメータ増減基準に相当する。以下では、まず判定部43に記憶されている複数の判定基準を説明し、その後に、いずれの判定基準を採用するかの決定を説明する。
【0046】
図3および図4は、判定部43に記憶されている判定基準を示すグラフである。図3および図4には、横軸が符号化部10にて符号化処理が済んだ処理単位ブロックのブロック番号BNであって、縦軸がバッファ30の符号蓄積量BFであるグラフが示されている。これらのグラフには、目標符号量TBが示されている。目標符号量TBは、上述のように、式(1)によって定義される量であるので、図3および図4に示すように、符号化済処理単位ブロックが大きいほど、すなわち、符号化処理が進むほど目標符号量TBも増加していく。図3および図4のグラフには、目標符号量TBの推移を示す直線と平行な線によって、各増減値(−2〜+2)が割り当てられた複数の領域に区分けされている。
【0047】
図3と図4とを比較すると、図3に示す判定基準は、各増減値の領域が図4の判定基準に比べて高く設定されており、図4の判定基準と比べて、量子化パラメータの減少傾向が強い判定基準である。逆に、図4に示す判定基準は、図3の判定基準よりは量子化パラメータの増加傾向が強い。すなわち、図3の判定基準の各増減値の領域の方が図4の判定基準のそれらに比べて符号蓄積量が大きい位置にある。このことにより、ある処理単位ブロックを処理した時点での符号蓄積量が同じであったとしても、図3の判定基準を用いる場合と図4の判定基準を用いる場合とでは、図3の判定基準を用いた方が量子化パラメータの増加量が少ない(または、減少量が多い)ことがある。
【0048】
例えば、図3の判定基準では、増減値0の領域と増減値−1の領域とが目標符号量TBの推移を示す直線によって区分けされており、バッファ30の符号蓄積量BFが目標符号量TBを下回ると、直ちに増減値Rがマイナスになる。これに対して、図4の判定基準では、増減値0の領域が目標符号量TBの推移を示す直線を含んでおり、バッファ30の符号蓄積量BFが目標符号量TBを下回っても、差分Nが小さいときには、増減値Rはゼロになる。また、図3の判定基準では、符号蓄積量BFが相当に目標符号量TBを上回らない限り、量子化パラメータの増減値Rはプラスにはならないのに対して、図4の判定基準では、符号蓄積量BFが目標符号量TBを上回る場合に、図3の判定基準よりも小さい差分で+1の領域に達する。
【0049】
図3および図4に示した判定基準は、数式によって表現することができる。すなわち、各増減値Rに対応する領域は、以下の判定式によって表される。
【数2】
増減値+2の領域:BF−TB>PB×n1 ・・・(2)
【数3】
増減値+1の領域:PB×n1≧BF−TB>PB×n2 ・・・(3)
【数4】
増減値0の領域:PB×n2≧BF−TB>PB×n3 ・・・(4)
【数5】
増減値−1の領域:PB×n3≧BF−TB>PB×n4 ・・・(5)
【数6】
増減値−2の領域:PB×n4≧BF−TB ・・・(6)
ここで、n1〜n4は、増減値の境界を決定する係数であって、n4<n3≦0<n2<n1である。n1〜n4が大きいほど、各増減値の領域は、符号蓄積量が高い位置に設定さる。また、式(2)〜(6)において、BFは符号蓄積量、TBは目標符号量であり、PBは1つの処理単位ブロックに対する目標発生符号量であって式(7)により求められる値である。
【数7】
目標発生符号量PB=(ビットレートBR/フレームレートFR)×(1処理単位ブロックの画素数/1フレームの画素数)・・・(7)
【0050】
図3に対応する式(2)〜(6)のn1〜n4の各々は、図4に対応する式(2)〜(6)のn1〜n4の各々よりも大きい。このことは、図3に対応する判定基準式では、図4に対応する判定基準式と比べて、量子化パラメータの減少傾向が強いことを意味している。
【0051】
判定部43は、判定基準として、上記の式(2)〜(6)とn1〜n4の値の組み合わせの情報を含むテーブルとを記憶している。図3および図4のそれぞれに対応するテーブルは、例えば、以下のTable1およびTable2である。
Table1:
n1=13
n2=10
n3=−2
n4=−3
Table2:
n1=7
n2=5
n3=−3
n4=−5
【0052】
判定部43は、上述したように、符号化部10にて1処理単位ブロックを処理するごとに、上記のいずれの判定基準を採用するかを決定する。本実施の形態では、判定部43は、いずれの判定基準を採用するかを決定するために、量子化パラメータ算出部44から判定基準を採用する時点で最後に用いられた量子化パラメータ(以下、現量子化パラメータQPnという)を取得する。このとき、判定部43は、本発明の基準変更手段として機能する。
【0053】
上述したように、図3に示した判定基準の方が図4に示した判定基準よりも量子化パラメータの減少傾向が強い。したがって、図3に示した判定基準を用いて量子化パラメータの増減値Rを決定した方が、発生符号量は増加しやすくなる。特に、既に量子化パラメータが大きく設定されて、発生符号量が少なく抑えられているときに、符号蓄積量BFが目標符号量TBに満たなくなった場合には、直ちに発生符号量を増加させて符号蓄積量BFを目標符号量TBに到達させることが望まれる。そこで、判定部43は、現量子化パラメータQPnが所定の閾値mより大きいときには、より早く発生符号量を増加させるために、図3に示した、比較的量子化パラメータの減少傾向が強い判定基準を採用する。これとは逆に、現量子化パラメータQPnが閾値mよりも小さいときには、図4に示した判定基準を採用する。なお、現量子化パラメータQPnが閾値mと等しい場合には、図3および図4のいずれの判定基準を用いてもよく、装置を設計する段階においていずれかを適宜に決めればよい。
【0054】
なお、上記の例では、判定部43は、2つの判定基準を記憶しており、量子化パラメータの大きさに基づいていずれかの判定基準を採用したが、これに限られない。すなわち、判定部43は、量子化パラメータの減少傾向または増加傾向が互いに異なる3つ以上の判定基準を記憶してもよい。この場合には、現量子化パラメータQPnの閾値は判定基準の数に応じて複数設定されて、現量子化パラメータQPnの大きさに応じて適当な判定基準が決定される。
【0055】
さらに、上記の例では、複数の判定基準は、あらかじめ設定された状態で判定部43に記憶されていたが、これに限られない。例えば、現量子化パラメータQPnの大きさに応じて上記の判定式のn1〜n4の値を変化させてもよい。この場合には、判定部43は、現量子化パラメータが増加するとn1〜n4をそれぞれ単調増加させる複数の関数を記憶しており、これらの関数に現量子化パラメータQPnを代入することによりn1〜n4をそれぞれ算出する。
【0056】
また、上記の例では、増減値は、−2〜+2の範囲で設定されたが、増減値の範囲はこの範囲より広くても狭くてもよい。上記の式(2)〜(6)は、増減値の範囲に対応させて適宜に設定すればよい。
【0057】
図1に戻って、量子化パラメータ算出部44は、判定部43にて求められた増減値Rを現量子化パラメータQPnに加算することにより、新たな量子化パラメータを算出する。
【0058】
ここで、本実施の形態では、上記のように、現量子化パラメータQPnの大きさに応じて量子化パラメータの判定基準を可変に設定するので、発生符号量を柔軟に制御できる。ただし、量子化パラメータの大きさと発生符号量との対応関係は常に一定ではなく、量子化パラメータが同じ大きさであっても画像の内容によって発生符号量が異なる。そこで、発生符号量を考慮して符号蓄積量BFを調整するために、本実施の形態の符号量制御部40は、符号量予測部45および量子化パラメータ決定部46を備えている。この構成によって、符号量制御部40では、量子化パラメータ算出部44にて算出された量子化パラメータをそのまま採用するのではなく、その量子化パラメータを用いて符号化処理をした場合の符号蓄積量BFを予測した上で次の処理単位ブロックに対して用いる量子化パラメータQPn+1を決定する。
【0059】
このために、符号量予測部45は、既に処理済の処理単位ブロックにおける量子化パラメータの大きさと発生符号量との関係に基づいて、量子化パラメータ算出部44で算出された量子化パラメータを用いたときの発生符号量を予測する(以下、予測された発生符号量を予測発生符号量Xという)。符号予測部45は、以前のいくつかの処理単位ブロックの処理における量子化パラメータと符号蓄積量との推移により、発生符号量を予測する。例えば、量子化パラメータ算出部44にて量子化パラメータ=9と算出された場合には、過去に同じ量子化パラメータ(=9)を用いたときの発生符号量の平均値が予測発生符号量Xとされる。
【0060】
そして、量子化パラメータ決定部46は、符号量予測部45で算出した予測発生符号量Xを取り込んで、その予測発生符号量Xを実際にバッファ30に蓄積されている符号蓄積量BFに加算した予測符号蓄積量(X+BF)を算出し、その予測符号蓄積量(X+BF)を目標符号量TBと比較する。この比較の結果、予測符号蓄積量(X+BF)の目標符号量TBに対する超過が所定の閾値sを越えない場合には、量子化パラメータ決定部46は、量子化パラメータ算出部44にて算出された量子化パラメータを採用する。そして、予測符号蓄積量(X+BF)の目標符号量TBに対する超過が閾値sを越える場合には、量子化パラメータ決定部46は、量子化パラメータを増減させることなく、現量子化パラメータQPnを採用する。
【0061】
このために、量子化パラメータ決定部46には、あらかじめ所定の閾値sが記憶されている。量子化パラメータ決定部46は、下記の式(8)を満たすときは、量子化パラメータ算出部44で算出された量子化パラメータを次の量子化パラメータQPn+1として決定し、下記の式(9)を満たすときは、現量子化パラメータQPnを次の量子化パラメータQPn+1として決定する。
【数8】
(X+BF)−TB>s ・・・(8)
【数9】
(X+BF)−TB≦s ・・・(9)
【0062】
ここで、量子化パラメータ算出部44、符号量予測部45および量子化パラメータ決定部46によって本発明の量子化パラメータ決定手段が構成される。また、量子化パラメータ算出部44は、本発明の量子化パラメータ算出手段に相当し、符号量予測部45は、本発明の符号量予測手段に相当し、量子化パラメータ決定部46は、本発明の採用判定手段に相当する。ただし、符号量予測部45および量子化パラメータ決定部46は、本発明の量子化パラメータ決定手段に必須の構成ではなく、符号量を予測することなく量子化パラメータ算出部44にて算出された量子化パラメータを次の量子化パラメータQPn+1として採用したとしても、本発明の効果が奏される。
【0063】
図5は、上記の映像信号符号化装置1にて実行される符号量制御処理を示すフローチャートである。符号量制御処理では、まず、目標符号量算出部41が、上記の式(7)によって、1処理単位ブロックの目標発生符号量PBを算出する(ステップ501)。目標符号量算出部41は、続いて、上記の式(1)によって、圧縮処理が終了した処理単位ブロックまでの目標符号量TBを算出する(ステップ502)。次に、差分算出部42および量子化パラメータ決定部46にバッファ30の符号蓄積量BFが入力される(ステップ503)。そして、差分算出部42は、目標符号量算出部41にて算出された目標符号量PBとバッファ30より入力された符号蓄積量BFとの差分Nを算出する(ステップ504)。
【0064】
判定部43は、現量子化パラメータQPnが閾値mより大きいか否かを判断する(ステップ505)。ステップ505にて、現量子化パラメータQPnが閾値mより大きいと判断されたときには、判定部43に記憶されたテーブルのうちのTable1からn1〜n4を読み出して設定する(ステップ506)。一方、ステップ505にて、現量子化パラメータQPnが閾値m以下であると判断されたときは、判定部43に記憶されたテーブルのうちのTable2からn1〜n4を読み出して設定する(ステップ507)。
【0065】
ステップ506またはステップ507にてn1〜n4が設定されると、判定部43は、n1〜n4が設定された式(2)〜(4)を用いて、差分Nがいずれの領域に属するかを判断し、その領域に対応する増減値Rを求める(ステップ508)。量子化パラメータ算出部44は、ステップ508にて求めた増減値Rを現量子化パラメータQPnに加算して新たな量子化パラメータを算出する(ステップ509)。符号量予測部45は、ステップ509にて算出された量子化パラメータを採用した際の予測発生符号量Xを算出する(ステップ510)。
【0066】
量子化パラメータ決定部46は、ステップ510にて算出された予測発生符号量Xと、ステップ503にて入力された符号蓄積量BFと、ステップ502にて算出された目標符号量TBとを用いて、式(8)および式(9)に従って次の量子化パラメータQpn+1を決定する(ステップ511)。そして、すべての処理単位ブロックの処理が終了したときには(ステップ512にてYES)、符号量制御処理を終了し、すべての処理単位ブロックの処理が終了していなければ(ステップ512でNO)ステップ502に戻り、ステップ502〜ステップ511の処理を繰り返す。
【0067】
以上説明したように、第1の実施の形態の映像信号符号化装置1によれば、現量子化パラメータQPnに基づいて、次の処理単位ブロックに用いる量子化パラメータQPn+1を算出するための判定基準が設定されるので、バッファの使用状況に応じて、適切な量子化パラメータQPn+1を設定できる。これによって、バッファの使用状況に応じて、符号化処理にて発生する符号量を柔軟にコントロールすることができる。
【0068】
また、現量子化パラメータQPnが高く設定されていることによって発生符号量が低く抑えられており、かつ、バッファ30の空き容量に余裕が生じて発生符号量を増加させてもよいときに、量子化パラメータを速く減少させることができるので、バッファ30の空き容量の余裕を有効に活用して符号データにより再現される映像の画質を向上させることができる。
【0069】
さらに、量子化パラメータ算出部44にて算出された新たな量子化パラメータに対して、量子化パラメータ決定部46にて予測発生符号量Xに基づく採否の判定が行なわれた上で次の量子化パラメータQPn+1が決定されるので、量子化パラメータの増減による発生符号量の過度の変化を防止することができる。
【0070】
(第2の実施の形態)
図6は、第2の実施の形態の映像信号符号化装置2の構成を示すブロック図である。映像信号符号化装置2は、第1の実施の形態の映像信号符号化装置と同様に、符号化部10、バッファ30および符号量制御部40を備えている。符号化部10の構成は、第1の実施の形態の符号化部の構成と同様である。符号量制御部40は、第1の実施の形態と同様に、目標符号量算出部41、差分算出部42、判定部43および量子化パラメータ算出部44を備えている。
【0071】
上述のように、符号化部10は、複数のフレームに対してあらかじめ設定された一定の間隔でフレーム内符号化を施すとともに、フレーム内符号化の間のフレームに対してはフレーム間符号化を施す。そして、一般的にはフレーム内符号化により発生する符号量は、フレーム間符号化により発生する符号量よりも大きい。したがって、フレーム内符号化処理の直前のバッファ30の出力後には、バッファ30に残留している符号蓄積量をなるべく小さくしておくことが望ましく、ゼロにしておくことが最も望ましい。そのためには、フレーム内符号化処理の前では、バッファ30の符号蓄積量が、一度の出力で出力できる符号量よりも大きくならないように制御する必要がある。
【0072】
そこで、本実施の形態では、目標符号量算出部41は、通常のフレーム間符号化を行なうフレームに対しては、上記の式(1)を用いて目標符号量TBを算出するとともに、フレーム内符号化すべきフレームが近くなると、発生符号量を低く抑えるために、下記の式(10)を用いて目標符号量TBを低くする。
【数10】
目標符号量TB=(ビットレートBR/フレームレートFR)×(ブロック番号BN/総ブロック数TN)×α ・・・(10)
ここで、αは、α<1を満たす係数である。
【0073】
また、フレーム内符号化処理では、目標符号量算出部41は、発生符号量を多くするために、目標符号量TBを大きくする。この場合には、下記の式(11)を用いて目標符号量TBが算出される。
【数11】
目標符号量TB=(ビットレートBR/フレームレートFR)×(ブロック番号BN/総ブロック数TN)×β ・・・(11)
ここで、βは、β>1を満たす係数である。
【0074】
式(10)を用いて説明したように、フレーム内符号化の前に目標符号量TBを低く設定することによって、発生符号量が処理単位ブロックごとに減少していき、またバッファ30からの出力後にバッファ30に残留する符号蓄積量BFがフレームの処理ごとに減少していく。そして、フレーム内符号化処理にて式(11)を用いて目標符号量を高く設定することにより、十分な符号量を発生させてフレーム内符号化されたフレームの画質を高くすることができる。
【0075】
しかしながら、単に目標符号量を下げるだけでは、以下に説明するように、バッファの符号蓄積量BFの低下に時間がかかるという問題がある。バッファ30の符号蓄積量BFは、所定のステップ幅(+2〜−2)で量子化パラメータを増減させることにより制御されるので、符号蓄積量BFが十分に減少するまでには、相当数の処理単位ブロックの符号化処理および出力処理を行なわなければならない。したがって、フレーム内符号化処理の時点でバッファ30の符号蓄積量BFをゼロにしておくためには、フレーム内符号化処理の相当前から、式(10)を用いて目標符号量TBを低くした状態で符号化処理を行なわなければならない。そして、目標符号量TBを低く設定した状態で処理される処理単位ブロックが多いと、その分画質が低下してしまう。
【0076】
そこで、本実施の形態では、フレーム内符号化に向けてバッファ30の符号蓄積量BFを十分に減らすまでの符号化処理の回数(すなわち、処理単位ブロック数)を極力少なくして、目標符号量TBを高くした状態でのフレーム間符号化処理を極力多く行なうことによって画質の維持を図るために、符号量制御部40は、以下のように構成されている。
【0077】
すなわち、判定部43には、第1の実施の形態と同様に、図3および図4に示した2つの量子化パラメータの増減値の判定基準を記憶しているほかに、量子化パラメータの増加傾向が強い判定基準を記憶している。そして、通常のフレーム間符号化処理では、第1の実施の形態と同様にして図3および図4に示した2つの判定基準のいずれかを選択するとともに、フレーム内符号化処理の直前の所定数のフレームに対しては、量子化パラメータの増加傾向が強い判定基準を採用する。すなわち、目標符号量算出部41がフレーム内符号化処理の直前にて発生符号量を低く抑えるために目標符号量TBを低く設定したときに、判定部43も量子化パラメータの判定基準も増加傾向の強いものに変更して、発生符号量を急速に減少させる。
【0078】
このような処理を行なうために、本実施の形態の映像信号符号化装置2では、図6に示すように、第1の実施の形態の符号量制御部の構成に加えて、さらに、カウンタ47および減算部48を備えている。カウンタ47は、符号化部10が1フレームの画像データを処理するごとにカウント値を更新し、フレーム内符号化のタイミングでカウント値をリセットする。減算部48は、フレーム内符号化されるフレーム間のフレーム数からカウンタ47のカウント値を減算して、次のフレーム内符号化処理までのフレーム数を算出する。
【0079】
符号化部10は、例えば15フレームをフレーム間符号化するごとに1フレームをフレーム内符号化する。そして、減算部48には、フレーム内符号化されるフレーム間のフレーム数である数値15が記憶されており、カウンタ47から得られたカウント値を15から減算することにより、フレーム内符号化までのフレーム数を算出する。減算部48での減算の結果、残りフレーム数が所定の数になると、目標符号量算出部41は、式(10)を用いて目標符号量TBを低くし、判定部43は、量子化パラメータの増加傾向が強い判定基準を用いて量子化パラメータの増減値Rを算出する。また、フレーム内符号化処理では、目標符号量算出部41は、式(11)を用いて目標符号量TBを算出する。これにより、フレーム内符号化処理において十分な符号量を発生させることができる。
【0080】
そして、判定部43は、増減値Rを量子化パラメータ算出部44に出力する。量子化パラメータ算出部44は、現量子化パラメータQPnに増減値Rを加算して新たな量子化パラメータを算出する。符号化部10では、量子化パラメータ算出部で算出された量子化パラメータを次の処理単位ブロックの量子化パラメータQPn+1とする。本実施の形態では、この量子化パラメータ算出部44が本発明の量子化パラメータ決定手段に相当する。
【0081】
図7は、フレーム内符号化の直前に採用される判定基準を示すグラフである。図7に示される判定基準は、図3および図4に示される判定基準、すなわち、通常のフレーム間符号化処理にて用いられる判定基準と比較して、量子化パラメータの増加傾向が強い。図7の判定基準では、各増減値の領域は、図3や図4の判定基準よりも符号量が小さい位置に位置している。図7に示すように、この判定基準に従えば、バッファ30の符号蓄積量BFが目標符号量TBを越えると、直ちに量子化パラメータが増加(+1)される。
【0082】
また、図7の判定基準では、各増減値の領域は、式(10)にて算出される目標符号量TBの推移を示す直線と平行な境界線によって区分けされている。式(10)では、式(1)と比較して処理済ブロック数に対する目標符号量TBの増加が緩やかである。そして、図7の判定基準の各境界線も、式(10)を示す直線と平行であるので、その傾きが緩やかである。
【0083】
図8は、処理が終了した処理単位ブロック数とバッファ30の符号蓄積量BFとの関係を示すグラフである。図8は、フレーム内符号化の直前の2フレームに対して目標符号量TBを低く設定したフレーム間符号化処理を行なう例を示している。
【0084】
カウンタ47は、1フレームの処理ごとにカウント値を加算していく。減算部48では、1フレームの処理ごとに、フレーム間符号化するフレーム数である15からカウンタ47でのカウント値を減算する。減算した結果が2より大きい場合、すなわち通常のフレーム間符号化処理では、目標符号量算出部41は、式(1)を用いて目標符号量TBを算出する。これにより、図8に示すように、1フレーム分の目標符号量は、バッファ30が一度に出力できる符号量になる(符号量b)。
【0085】
減算部48にて、フレーム内符号化までのフレーム数が残り2フレームになると、目標符号量算出部41は、式(10)を用いて目標符号量TBを算出する。これにより、1フレーム分の目標符号量が低くなる(符号量c)。目標符号量TBが低くなると、バッファ30の符号蓄積量BFが目標符号量TBを越えるこことなる。これにより、量子化パラメータは処理単位ブロックごとに増加していき、それに伴って発生符号量は減少していく。判定部43は、この2フレームに対しては、図7に示した判定基準を用いて量子化パラメータの増減値を算出する。これにより、処理単位ごとの発生符号量は、急速に減少していく。そして、2フレームを処理する間にバッファ30の符号蓄積量BFが十分に減少し、フレーム内符号化の直前の最後のフレームを出力した後には、バッファ30に残留した符号蓄積量BFはゼロになる。
【0086】
減算部48にてフレーム内符号化までのフレーム数がゼロになると、符号化部10は、次のフレームの画像データをフレーム内符号化する。このとき、目標符号量算出部41は、式(11)を用いて目標符号量TBを算出する。これにより、1フレーム分の目標符号量が高くなる(符号量a)。なお、式(1)、式(10)および式(11)から明らかなように、1フレーム分の目標符号量a、bおよびcは、a=β×b、c=α×bの関係にある。
【0087】
このように、バッファ30の符号蓄積量BFを減少させるために図7に示した判定基準を用いれば、目標符号量TBを低く設定した符号化処理は、フレーム内符号化の直前の2フレームのみでよくなり、目標符号量TBを高くした状態でのフレーム間符号化処理をより多く行なうことができる。これにより、フレーム間符号化処理にて生成される符号データの画質低下を軽減できるとともに、フレーム内符号化処理では、十分な符号量を発生させることができる。
【0088】
なお、上記の例では、フレーム内符号化するフレームの直前の2フレームに対して、量子化パラメータの増加傾向が強い判定基準を用いたが、判定基準の切替えは処理単位ブロックの単位で行なってもよい。すなわち、カウンタ47は、フレーム数をカウントしても処理単位ブロックをカウントしてもよい。いずれにしても、フレーム内符号化処理の直前の所定回数の符号化処理に対して、量子化パラメータの増加傾向が強い判定基準を用いればよい。カウンタ47が処理単位ブロックをカウントする場合には、減算部48は、フレーム内符号化されるフレーム間のフレーム数に1フレーム当たりの処理単位ブロックの分割数を掛けた値(上記の例では、15フレーム×15ブロック=225ブロック)を記憶する。
【0089】
以上説明したように、第2の実施の形態の映像信号符号化装置2によれば、フレーム間符号化される処理単位ブロックの画像データに対しては、次のフレーム内符号化までの符号化の回数に応じて判定基準を設定されるので、フレーム間符号化処理をする場合に、バッファの空き容量を有効に活用した効率のよい符号化処理を実現できる。
【0090】
なお、上記の例では、通常のフレーム間符号化処理において、第1の実施の形態と同様にして、複数の判定基準を用いて量子化パラメータの増減値を算出したが、第2の実施の形態では、通常のフレーム間符号化処理の間は他の方法にて量子化パラメータの制御を実行してもよい。ただし、上記の例のように、通常のフレーム間符号化処理にて、複数の判定基準を用い、符号蓄積量が常に目標符号量を上回るように量子化パラメータが制御されるときには、フレーム内符号化処理の直前にて急速に量子化パラメータを減少させることにより画質の劣化を軽減できるという効果が顕著になる。
【0091】
また、図6に示した映像信号符号化装置2は、第1の実施の形態の映像信号符号化装置1のように符号量予測部および量子化パラメータ決定部を備えていないが、本実施の形態でも第1の実施の形態と同様に、符号量予測部および量子化パラメータ決定部を設けて、量子化パラメータ44にて算出された量子化パラメータを用いた際の発生符号量を予測した上で、最終的に次の量子化パラメータを決定してもよいことは勿論である。
【0092】
【発明の効果】
以上説明したように、本発明は、量子化パラメータの増減基準を可変に設定することにより、種々の状況に応じて発生符号量を柔軟にコントロールし、出力される映像信号の画質を向上させることができるというすぐれた効果を有する映像信号処理装置を提供することができる。
【図面の簡単な説明】
【図1】第1の実施の形態の映像信号処理装置の構成を示すブロック図
【図2】第1の実施の形態の映像信号処理装置の構成を示すブロック図
【図3】第1の実施の形態の判定基準(減少傾向:強)を示すグラフ
【図4】第1の実施の形態の判定基準(減少傾向:弱)を示すグラフ
【図5】第1の実施の形態の符号量制御処理を示すフローチャート
【図6】第2の実施の形態の映像信号処理装置の構成を示すブロック図
【図7】第2の実施の形態の判定基準(増加傾向:強)を示すグラフ
【図8】第2の実施の形態の処理済ブロック数と符号蓄積量との関係を示すグラフ
【符号の説明】
10 符号化部
11 分割部
14 量子化部
30 バッファ
40 符号量制御部
41 目標符号量算出部
42 差分算出部
43 判定部
44 量子化パラメータ算出部
45 符号量予測部
46 量子化パラメータ決定部
47 カウンタ
48 減算部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a technique for encoding a video signal, and more particularly to a video signal encoding apparatus that controls a quantization parameter used for encoding processing to adjust a generated code amount.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, in a video signal encoding apparatus that encodes a video signal, the amount of code of a video signal obtained by the encoding process (hereinafter, referred to as generated code amount) is controlled by controlling a quantization parameter used in the encoding process. Techniques for adjusting the temperature are known. This type of video signal encoding apparatus controls an encoding unit that encodes the video signal, a buffer that stores the encoded video signal and outputs the encoded video signal for each predetermined capacity, and a quantization parameter of the encoding unit. And a control unit that performs the control.
[0003]
A video signal representing a moving image including a plurality of frames is input to the encoding unit. The encoding unit divides each frame into a plurality of processing unit blocks, encodes a video signal for each processing unit block, and generates encoded data. The encoding process includes a quantization process for quantizing a video signal using a quantization parameter.
[0004]
The encoding unit performs intra-frame encoding on a plurality of frames at predetermined intervals, and performs inter-frame encoding between two frames to be intra-frame encoded. Here, the intra-frame encoding is encoding using only a target frame. Further, the inter-frame coding is coding using a mutual relationship between frames. Generally, the code amount of code data generated by intra-frame coding is larger than that of code data generated by inter-frame coding.
[0005]
The buffer sequentially accumulates the encoded data and outputs the accumulated encoded data at a predetermined timing and a predetermined bit rate. Here, the capacity that can be output from the buffer at one time is determined according to the above-mentioned bit rate. Therefore, when the code amount of the video signal accumulated in the buffer is smaller than the data capacity that can be output at one time, all the signals in the buffer are output by one output. On the other hand, when the code amount stored in the buffer is larger than the data capacity that can be output at one time, not all data can be output, and some data remains after output. The remaining data is output at the next output timing.
[0006]
Here, in the encoding process of the video signal, even when the processing unit blocks having the same number of pixels are encoded, the amount of code generated by the encoding process differs depending on the content of the signal. On the other hand, the code amount generated by the encoding process can be changed by increasing or decreasing the quantization parameter used for the encoding process. Therefore, the control unit adjusts the code amount stored in the buffer by increasing or decreasing the quantization parameter.
[0007]
For this purpose, during the encoding process, the control unit calculates a difference between the code amount stored in the buffer (hereinafter, referred to as a code storage amount) and a target code amount at that time, and performs encoding in accordance with the difference. The quantization parameter used in the section is increased or decreased. Specifically, when the code storage amount in the buffer is larger than the target code amount, the control unit decreases the quantization parameter to increase the generated code amount, and conversely, the code storage amount becomes larger than the target code amount. Is smaller, the quantization parameter is increased to suppress the generated code amount.
[0008]
The video signal encoding device as described above is described in, for example, Patent Document 1.
[0009]
[Patent Document 1]
JP 2001-169281 A (Pages 7-11, FIG. 5)
[0010]
[Problems to be solved by the invention]
However, in the conventional video signal encoding device, when the code storage amount of the buffer is lower than the target code amount, even if the quantization parameter is reduced, it takes time to increase the generated code amount. I will. As a result, even in a situation where there is a margin in the free space of the buffer with respect to the target code amount and the generated code amount may be increased, the image quality cannot be improved by effectively utilizing the spare space amount. Occurs.
[0011]
Further, as described above, the code amount generated by intra-frame coding is larger than the code amount generated by inter-frame coding. The amount of data that can be output from the buffer in one output is determined as described above. Therefore, at the time of intra-frame encoding, it is desirable to reduce the code accumulation amount in the buffer as much as possible. For that purpose, it is necessary to suppress the amount of generated codes before the intra-frame encoding. However, if the generated code amount is suppressed, the image quality is reduced accordingly.
[0012]
An object of the present invention is to improve the image quality of an encoded video signal by flexibly controlling the amount of generated code when encoding the video signal according to the situation.
[0013]
[Means for Solving the Problems]
A video signal encoding apparatus according to the present invention includes: an encoding unit that encodes a video signal by quantizing the video signal using a quantization parameter for each predetermined processing unit; and a video signal encoded by the encoding unit. And a quantization parameter increase / decrease criterion representing a relationship between the capacity of the data accumulated in the buffer and the increase / decrease value of the quantization parameter, and quantizing based on the capacity of the data accumulated in the buffer. A quantization parameter determining means for determining a parameter, and a quantization parameter for determining a quantization parameter to be used for data of the processing unit after the processing unit in accordance with the quantization parameter used for the data of the processing unit. Reference changing means for variably setting the quantization parameter increase / decrease reference.
[0014]
According to this configuration, based on the quantization parameter used for the encoding process of the data of a certain processing unit, the increase / decrease standard of the quantization parameter used for the data of the subsequent processing unit is set, so that an appropriate quantization parameter is set. It is possible to flexibly control the amount of code generated in the encoding process. Note that, in the above-described video signal encoding device, each of the above units does not have to function for data of all processing units, and as described later, for data of a specific processing unit, Other means may be configured to function.
[0015]
In the video signal encoding apparatus, the reference changing unit may be configured such that when the quantization parameter used for the data of the processing unit is higher than a predetermined threshold, the quantization parameter is lower than the threshold. A quantization parameter increase / decrease criterion in which the quantization parameter tends to decrease more strongly is set.
[0016]
With this configuration, when the quantization parameter is set to a high value, the generated code amount is suppressed, and when there is a margin in the free space of the buffer and the generated code amount may be increased, the quantization parameter may be increased. Since it can be reduced, it is possible to improve the image quality of the video reproduced by the code data by effectively utilizing the free space of the buffer.
[0017]
In the video signal encoding apparatus, the quantization parameter determination unit may include a quantization parameter calculation unit that calculates a quantization parameter according to the quantization parameter increase / decrease criterion, and the quantization parameter calculation unit may calculate the quantization parameter. Code amount prediction means for predicting the generated code amount when the data of the processing unit is quantized using a quantization parameter; and the quantization parameter based on the generated code amount predicted by the code amount prediction means. An adoption determining means for determining whether or not to employ the quantization parameter calculated by the calculating means, wherein the quantization parameter determined to be employed by the adoption determining means is used by the quantization means used in the encoding means. Is determined as a parameter.
[0018]
According to this configuration, since the quantization parameter is determined after the adoption determination unit determines the adoption based on the prediction of the generated code amount, an excessive change in the generated code amount due to an increase or decrease in the quantization parameter is prevented. be able to.
[0019]
In the video signal encoding apparatus, the encoding unit encodes a video signal representing a moving image including a plurality of frames by intra-frame encoding and inter-frame encoding, and the reference changing unit includes an inter-frame encoding unit. For the data of the processing unit to be converted, the quantization parameter increase / decrease criterion is set according to the number of times of encoding until the next intra-frame encoding.
[0020]
With this configuration, the quantization parameter increase / decrease criterion is set for the data of the processing unit to be inter-coded according to the number of times of encoding until the next intra-frame encoding. When encoding moving images, efficient encoding processing can be realized by effectively utilizing the free space of the buffer. In addition, as the number of times of encoding until the next intra-frame encoding, the number of frames until the next intra-frame encoding may be counted, or the number of processing units to be processed until the next intra-frame encoding is performed. It may be counted.
[0021]
A video signal encoding apparatus according to another aspect of the present invention quantizes a video signal representing a moving image composed of a plurality of frames using a quantization parameter for each predetermined processing unit, so that the plurality of frames are included in a frame. Coding means for coding by coding and inter-frame coding; a buffer for storing the video signal coded by the coding means; a capacity of data stored in the buffer and an increase / decrease value of a quantization parameter And a quantization parameter determining unit that determines a quantization parameter based on a capacity of data stored in the buffer, using a quantization parameter increase / decrease criterion representing a relationship with the encoding unit. For data of a processing unit to be processed, the quantization parameter increase / decrease criterion is variably set according to the number of times of encoding until the next intra-frame encoding. And a reference change means.
[0022]
With this configuration, the quantization parameter increase / decrease criterion is set for the data of the processing unit to be inter-coded according to the number of times of encoding until the next intra-frame encoding. When encoding moving images, efficient encoding processing can be realized by effectively utilizing the free space of the buffer.
[0023]
Further, in the video signal encoding apparatus, the reference changing unit has a stronger tendency to increase the quantization parameter for data of a processing unit immediately before the intra-frame coding than for data of another processing unit. Set the quantization parameter increase / decrease criterion.
[0024]
With this configuration, immediately before the intra-frame encoding, a quantization parameter increase / decrease criterion in which the quantization parameter increase tendency is stronger than that of the data of other processing units is set, so that the quantization is rapidly performed immediately before the intra-frame encoding. By increasing the parameter, it is possible to reduce the generated code amount. As a result, a sufficient code amount can be generated for an intra-coded frame, and a generated code amount can be generated for a larger number of processing units for an inter-coded frame. Is possible, and the image quality of the video reproduced by the code data can be improved.
[0025]
A video signal encoding apparatus according to still another aspect of the present invention includes encoding means for encoding the video signal by quantizing the video signal using a quantization parameter for each predetermined processing unit; A buffer for storing the video signal encoded by the quantization means, and a quantization parameter increase / decrease criterion representing a relationship between a capacity of the data accumulated in the buffer and an increase / decrease value of the quantization parameter. Quantization parameter determining means for determining a quantization parameter based on the capacity of the processed data, and a quantization parameter increase / decrease criterion for determining a quantization parameter to be used for data of a processing unit after the processing unit. Criterion changing means for setting the criterion.
[0026]
According to this configuration, since the increase / decrease criterion of the quantization parameter is variably set, the quality of the video reproduced by the code data can be improved by flexibly controlling the generated code amount according to the situation.
[0027]
Further, the above-mentioned problems can be solved by a video signal encoding method having the features of the present invention, a program for causing a computer to execute the video signal encoding method, and a recording medium storing the program.
[0028]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0029]
(First Embodiment)
FIG. 1 and FIG. 2 are block diagrams showing the configuration of the video signal encoding device 1 according to the first embodiment. The video signal encoding device 1 according to the first embodiment is generated by an encoding unit 10 that encodes and compresses a video signal, a buffer 30 that temporarily stores an encoded video signal, and an encoding unit 10. A code amount control unit 40 for controlling the code amount is provided. FIG. 1 illustrates the configuration of the code amount control unit 40 in detail, and FIG. 2 illustrates the configuration of the encoding unit 10 in detail. Hereinafter, first, the overall configuration of the video signal encoding device 1 and the configuration of the encoding unit 10 will be described with reference to FIG. 2, and then the configuration of the code amount control unit 40 will be described with reference to FIG.
[0030]
FIG. 2 is a block diagram illustrating the configuration of the video signal encoding device 1 in which the configuration of the encoding unit 10 is described in detail as described above. As shown in FIG. 2, the video signal encoding device 1 includes an encoding unit 10, a buffer 30, and a code amount control unit 40.
[0031]
The encoding unit 10 includes a division unit 11, a subtraction unit 12, a DCT unit 13, a quantization unit 14, and a VLC unit 15. The dividing unit 11 captures a video signal indicating a moving image obtained by an image sensor or the like. The video signal is composed of a plurality of frames. For example, 30 frames of images are input to the dividing unit 11 per second. The division unit 11 divides the input image of each frame into processing unit blocks, and generates image data indicating an image for each processing unit block. The dividing unit 11 divides, for example, one frame image into three equal parts in the horizontal direction and five equal parts in the vertical direction, and divides the image into 15 processing unit blocks having the same size. Note that this processing unit block corresponds to the processing unit of the present invention, but the processing unit of the present invention may be larger or smaller than the 15-divided block as described above, and one frame is a processing unit. May be done.
[0032]
The processing unit block output from the division unit 11 is input to the subtraction unit 12 when the block is inter-coded, and is input to the DCT unit 13 when the block is intra-coded. .
[0033]
The subtraction unit 12 captures image data of a processing unit block to be subjected to inter-frame encoding. Then, the subtraction unit 12 calculates prediction error data by subtracting prediction reference image data described later from the image data of the processing unit block. The DCT unit 13 performs a two-dimensional discrete cosine transform on the image data of the processing unit block output from the division unit 11 and the prediction error data output from the subtraction unit 12.
[0034]
The quantization unit 14 quantizes the image data and the prediction error data of the processing unit block subjected to the two-dimensional discrete cosine transform by the DCT unit 13. Here, the quantization unit 14 performs a quantization process using the quantization parameter. The quantization parameter is a parameter indicating the quantization width, that is, the roughness of the quantization. When the quantization parameter is large, the capacity of the code data, that is, the generated code amount decreases, and conversely, when the quantization parameter is small, the generated code amount increases. The VLC unit 15 performs variable-length conversion on the quantized image data and prediction error data of the processing unit block to generate code data. The code data is output to the buffer 30.
[0035]
The encoding unit 10 further includes an inverse quantization unit 16, an inverse DCT unit 17, an addition unit 18, a memory unit 19, a motion detection unit 20, a motion compensation unit 21, and a motion prediction unit 22. The inverse quantization unit 16 performs inverse quantization on the image data and the prediction error data quantized by the quantization unit 14. The inverse DCT unit 17 performs two-dimensional inverse discrete cosine transform on the data of the processing unit block inversely quantized by the inverse quantization unit 16 to generate prediction error data or reconstructed image data. The adder 18 adds the prediction error data created by the inverse DCT unit 17 and the prediction reference image data obtained by the motion compensation unit 21 to generate reconstructed image data. The memory unit 19 stores the reconstructed image data generated by the adder 18 or the inverse DCT unit 17.
[0036]
The motion detecting section 20 takes in the reconstructed image data stored in the memory section 19. The motion detection unit 20 detects motion vector data by comparing reconstructed image data from image data of an uncompressed processing unit block input from the division unit 11. The motion compensator 21 extracts predicted reference image data from the reconstructed image data based on the motion vector data detected by the motion detector 20. This predicted reference image data is used in the subtraction unit 12 as described above. That is, the subtraction unit 12 calculates prediction error data by subtracting the prediction reference image data generated by the motion compensation unit 21 from the image data of the uncompressed processing unit block. The motion prediction unit 22 calculates predicted motion vector data, and subtracts predicted motion vector data from the motion vector data detected by the motion detection unit 20 to calculate motion vector difference data.
[0037]
With the above configuration, the image data of the frame to be intra-coded is divided into the processing unit blocks divided by the division unit 11, and the processing is performed by the DCT unit 13, the quantization unit 14, and the VLC unit 15. , Are output to the buffer 30 as code data. Further, image data of a frame to be subjected to inter-frame encoding is divided into processing unit blocks by the division unit 11 and input to the subtraction unit 12. The subtraction unit 12 calculates prediction error data by subtracting the prediction reference image data from the image data of the processing unit block to be coded between frames. Then, the prediction error data is output to the buffer 30 as code data through the processing in the DCT unit 13, the quantization unit 14, and the VLC unit 15. The prediction error data is used to generate predicted reference image data after being quantized by the quantization unit 14.
[0038]
In the encoding process of the video signal as described above, the quantization parameter used in the quantization unit 14 is controlled by the code amount control unit 40. By controlling the quantization parameter, the code amount of the code data output from the coding unit 10 is controlled. The code amount control unit 40 controls the quantization parameter according to the use state of the buffer 30 so that the code storage amount of the buffer 30 becomes a target value.
[0039]
FIG. 1 is a block diagram of the video signal encoding device 1 showing the configuration of the code amount control unit 40. The code amount control unit 40 includes a target code amount calculation unit 41, a difference calculation unit 42, a determination unit 43, a quantization parameter calculation unit 44, a code amount prediction unit 45, and a quantization parameter determination unit 46.
[0040]
Each time the encoding unit 10 encodes the image data of the processing unit block, the target code amount calculation unit 41 calculates a target code amount TB that should be stored in the buffer 30 at that time. The target code amount calculation unit 41 calculates the target code amount TB by using Expression (1) using the frame rate FR and the bit rate BR.
(Equation 1)
Target code amount TB = (bit rate BR / frame rate FR) × (block number BN / total number of blocks TN) (1)
[0041]
Here, the block number BN indicates the number of processing unit blocks for which compression processing has been completed in one frame, and the total block number TN indicates the total number of processing unit blocks included in one frame. That is, the target code amount TB is equal to the total block size of one frame with respect to the code amount (bit rate BR / frame rate FR) that should be stored in the buffer 30 when all the processing unit blocks for one frame are processed. This is a value obtained by multiplying the number by the ratio up to the block after the compression processing (block number BN / total number of blocks TN).
[0042]
The difference calculator 42 calculates a difference N between the code accumulation amount BF of the buffer 30 and the target code amount TB. The determination unit 43 stores a determination criterion for an increase / decrease value that defines the relationship between the code accumulation amount BF of the buffer 30 and the increase / decrease value R of the quantization parameter for each block number BN. The criterion is that when the difference N between the code accumulation amount BF and the target code amount TB is plus, the increase / decrease value R is zero or plus, and when the difference N is minus, the increase / decrease value R is zero or minus. Thus, the relationship between the difference N and the increase / decrease value R is defined. In this determination criterion, the larger or smaller the difference N, the larger the increase / decrease value R of the quantization parameter.
[0043]
According to this determination criterion, the determination unit 43 increases the quantization parameter when the code storage amount of the buffer 30 for each block number BN is larger than the target code amount TB corresponding to the block number BN. As a result, the generated code amount decreases, and the code storage amount BF approaches the target code amount TB. On the other hand, when the code storage amount is smaller than the target code amount, the determination unit 43 reduces the quantization parameter according to the determination criterion. As a result, the generated code amount increases, and the code storage amount BF approaches the target code amount TB.
[0044]
As described above, the determination unit 43 controls the code storage amount BF to approach the target code amount TB by increasing or decreasing the quantization parameter based on the code storage amount BF of the buffer 30. However, even if the difference N between the code storage amount BF and the target code amount TB is the same and the same increase / decrease value R is added to the quantization parameter, the quantization code has already been set to a large value and the generated code amount is small. The speed at which the code storage amount BF approaches the target code amount TB, that is, the code storage amount BF is equal to the target code amount, depending on whether the code amount is increasing or the quantization parameter is set to be small and the generated code amount is decreasing. The number of processing unit blocks required to approach TB differs. For example, when the quantization parameter is already set to a large value and the generated code amount is suppressed to a small value, if the code storage amount BF becomes less than the target code amount TB, the generated code amount is immediately increased and the target code amount is increased. It is desired to reach the code amount TB. Therefore, in order to make the code storage amount BF reach the target code amount TB earlier, not only the difference N between the code storage amount BF and the target code amount TB, but also a state where the generated code amount is increasing or decreasing. It is desirable to control the quantization parameter in consideration of the above.
[0045]
Therefore, the determination unit 43 stores a plurality of determination criteria as described above, in which the magnitude of the decreasing tendency or the increasing tendency of the quantization parameter is different from each other. In the present embodiment, the determination unit 43 stores two types of determination criteria. Then, the determining unit 43 determines which of these two criteria is to be used for each processing of the processing unit block according to whether the generated code amount is in a state of increasing or a state of decreasing. The increase / decrease value R of the quantization parameter is calculated according to the determined criterion. This criterion corresponds to the quantization parameter increase / decrease criterion of the present invention. In the following, a plurality of criteria stored in the determination unit 43 will be described first, and then a determination of which one of the criteria will be used will be described.
[0046]
FIG. 3 and FIG. 4 are graphs showing the determination criteria stored in the determination unit 43. FIGS. 3 and 4 show graphs in which the horizontal axis is the block number BN of the processing unit block that has been subjected to the encoding processing by the encoding unit 10 and the vertical axis is the code accumulation amount BF of the buffer 30. ing. These graphs show the target code amount TB. As described above, the target code amount TB is an amount defined by the equation (1). Therefore, as shown in FIGS. 3 and 4, the larger the coded processing unit block, that is, the more the coding process is performed. The target code amount TB also increases as it proceeds. In the graphs of FIGS. 3 and 4, each of the increase / decrease values (−2 to +2) is divided into a plurality of regions by a line parallel to a straight line indicating the transition of the target code amount TB.
[0047]
When comparing FIG. 3 with FIG. 4, the determination criterion shown in FIG. 3 is set such that the area of each increase / decrease value is set higher than the determination criterion of FIG. Is a strong determination criterion. Conversely, the criterion shown in FIG. 4 has a stronger tendency to increase the quantization parameter than the criterion shown in FIG. That is, the area of each increase / decrease value of the criterion in FIG. 3 is located at a position where the code accumulation amount is larger than those of the criterion in FIG. Accordingly, even if the code accumulation amount at the time when a certain processing unit block is processed is the same, the case where the determination criterion of FIG. 3 is used and the case where the determination criterion of FIG. In some cases, the amount of increase in the quantization parameter is smaller (or the amount of decrease is larger) when is used.
[0048]
For example, in the determination criterion in FIG. 3, the area of the increase / decrease value of 0 and the area of the increase / decrease value of -1 are separated by a straight line indicating the transition of the target code amount TB, and the code accumulation amount BF of the buffer 30 is determined by the target code amount TB Immediately below, the increase / decrease value R immediately becomes negative. On the other hand, according to the determination criterion in FIG. 4, the area of the increase / decrease value 0 includes a straight line indicating the transition of the target code amount TB, and even if the code accumulation amount BF of the buffer 30 falls below the target code amount TB, the difference When N is small, the increase / decrease value R becomes zero. In addition, according to the criterion in FIG. 3, the increase / decrease value R of the quantization parameter does not become positive unless the code storage amount BF significantly exceeds the target code amount TB. When the accumulated amount BF exceeds the target code amount TB, the region reaches +1 with a difference smaller than the criterion in FIG.
[0049]
The criteria shown in FIGS. 3 and 4 can be expressed by mathematical expressions. That is, the area corresponding to each increase / decrease value R is represented by the following determination formula.
(Equation 2)
Area of increase / decrease value + 2: BF−TB> PB × n1 (2)
[Equation 3]
Area of increase / decrease value +1: PB × n1 ≧ BF−TB> PB × n2 (3)
(Equation 4)
Area of increase / decrease value 0: PB × n2 ≧ BF−TB> PB × n3 (4)
(Equation 5)
Area of increase / decrease value −1: PB × n3 ≧ BF−TB> PB × n4 (5)
(Equation 6)
Area of increase / decrease value-2: PB × n4 ≧ BF-TB (6)
Here, n1 to n4 are coefficients for determining the boundary of the increase / decrease value, and satisfy n4 <n3 ≦ 0 <n2 <n1. As n1 to n4 are larger, the area of each increase / decrease value is set to a position where the code accumulation amount is higher. In equations (2) to (6), BF is the code storage amount, TB is the target code amount, and PB is the target generated code amount for one processing unit block, which is a value obtained by expression (7). is there.
(Equation 7)
Target generated code amount PB = (bit rate BR / frame rate FR) × (number of pixels in one processing unit block / number of pixels in one frame) (7)
[0050]
Each of n1 to n4 in equations (2) to (6) corresponding to FIG. 3 is larger than each of n1 to n4 in equations (2) to (6) corresponding to FIG. This means that the criterion equation corresponding to FIG. 3 has a stronger tendency to decrease the quantization parameter than the criterion equation corresponding to FIG.
[0051]
The determination unit 43 stores, as a determination criterion, a table including information on combinations of the above equations (2) to (6) and values of n1 to n4. Tables respectively corresponding to FIGS. 3 and 4 are, for example, the following Table1 and Table2.
Table1:
n1 = 13
n2 = 10
n3 = -2
n4 = -3
Table2:
n1 = 7
n2 = 5
n3 = -3
n4 = -5
[0052]
As described above, each time the encoding unit 10 processes one processing unit block, the determination unit 43 determines which of the above determination criteria is to be adopted. In the present embodiment, in order to determine which criterion is to be used, the determination unit 43 determines which quantization criterion is to be used by the quantization parameter calculation unit 44 at the time of adopting the criterion (hereinafter, the following) Current quantization parameter QPn). At this time, the determination unit 43 functions as a reference changing unit of the present invention.
[0053]
As described above, the criterion shown in FIG. 3 has a stronger tendency to decrease the quantization parameter than the criterion shown in FIG. Therefore, when the increase / decrease value R of the quantization parameter is determined using the determination criterion shown in FIG. 3, the amount of generated code is more likely to increase. In particular, when the quantization parameter is already set to a large value and the generated code amount is suppressed to a small value, if the code storage amount BF becomes less than the target code amount TB, the generated code amount is immediately increased and the code amount is increased. It is desired that the accumulated amount BF reaches the target code amount TB. Therefore, when the current quantization parameter QPn is larger than the predetermined threshold value m, the determination unit 43 determines the determination criterion shown in FIG. Is adopted. Conversely, when the current quantization parameter QPn is smaller than the threshold value m, the criterion shown in FIG. 4 is adopted. When the current quantization parameter QPn is equal to the threshold value m, any one of the determination criteria shown in FIG. 3 and FIG. 4 may be used, and any one may be appropriately determined at the stage of designing the apparatus.
[0054]
In the above example, the determination unit 43 stores two determination criteria, and employs one of the determination criteria based on the magnitude of the quantization parameter. However, the present invention is not limited to this. That is, the determination unit 43 may store three or more determination criteria in which the decreasing tendency or increasing tendency of the quantization parameter is different from each other. In this case, a plurality of threshold values of the current quantization parameter QPn are set according to the number of determination criteria, and an appropriate determination criterion is determined according to the magnitude of the current quantization parameter QPn.
[0055]
Furthermore, in the above example, the plurality of determination criteria are stored in the determination unit 43 in a preset state, but the present invention is not limited to this. For example, the values of n1 to n4 in the above determination formula may be changed according to the magnitude of the current quantization parameter QPn. In this case, the determination unit 43 stores a plurality of functions that monotonically increase n1 to n4 when the current quantization parameter increases, and substitutes the current quantization parameter QPn for these functions to obtain n1 to n4. n4 is calculated respectively.
[0056]
Further, in the above example, the increase / decrease value is set in the range of −2 to +2, but the range of the increase / decrease value may be wider or narrower than this range. The above equations (2) to (6) may be appropriately set in accordance with the range of the increase / decrease value.
[0057]
Returning to FIG. 1, the quantization parameter calculation unit 44 calculates a new quantization parameter by adding the increase / decrease value R obtained by the determination unit 43 to the current quantization parameter QPn.
[0058]
Here, in the present embodiment, as described above, the criterion for determining the quantization parameter is variably set according to the magnitude of the current quantization parameter QPn, so that the generated code amount can be flexibly controlled. However, the correspondence between the size of the quantization parameter and the generated code amount is not always constant, and the generated code amount differs depending on the content of the image even if the quantization parameter has the same size. Therefore, in order to adjust the code accumulation amount BF in consideration of the generated code amount, the code amount control unit 40 of the present embodiment includes a code amount prediction unit 45 and a quantization parameter determination unit 46. With this configuration, the code amount control unit 40 does not use the quantization parameter calculated by the quantization parameter calculation unit 44 as it is, but stores the code storage amount when the coding process is performed using the quantization parameter. After predicting the BF, the quantization parameter QPn + 1 to be used for the next processing unit block is determined.
[0059]
To this end, the code amount prediction unit 45 uses the quantization parameter calculated by the quantization parameter calculation unit 44 based on the relationship between the size of the quantization parameter in the already processed processing unit block and the generated code amount. The generated code amount at the time of occurrence is predicted (hereinafter, the predicted generated code amount is referred to as a predicted generated code amount X). The code prediction unit 45 predicts a generated code amount based on transitions of a quantization parameter and a code storage amount in some previous processing unit blocks. For example, when the quantization parameter calculating section 44 calculates the quantization parameter = 9, the average value of the generated code amount when the same quantization parameter (= 9) is used in the past is the predicted generated code amount X. It is said.
[0060]
Then, the quantization parameter determination unit 46 takes in the predicted generated code amount X calculated by the code amount prediction unit 45, and adds the predicted generated code amount X to the code storage amount BF actually stored in the buffer 30. The predicted code storage amount (X + BF) is calculated, and the predicted code storage amount (X + BF) is compared with the target code amount TB. As a result of this comparison, if the predicted code storage amount (X + BF) does not exceed the target code amount TB by more than the predetermined threshold value s, the quantization parameter determination unit 46 calculates the quantization parameter calculation unit 44. Adopt quantization parameters. If the predicted code storage amount (X + BF) exceeds the target code amount TB by more than the threshold s, the quantization parameter determination unit 46 adopts the current quantization parameter QPn without increasing or decreasing the quantization parameter. .
[0061]
For this purpose, a predetermined threshold value s is stored in the quantization parameter determination unit 46 in advance. When the following equation (8) is satisfied, the quantization parameter determination section 46 determines the quantization parameter calculated by the quantization parameter calculation section 44 as the next quantization parameter QPn + 1, and calculates the following equation (9). If so, the current quantization parameter QPn is determined as the next quantization parameter QPn + 1.
(Equation 8)
(X + BF) -TB> s (8)
(Equation 9)
(X + BF) −TB ≦ s (9)
[0062]
Here, the quantization parameter calculation unit 44, the code amount prediction unit 45, and the quantization parameter determination unit 46 constitute a quantization parameter determination unit of the present invention. The quantization parameter calculator 44 corresponds to the quantization parameter calculator of the present invention, the code amount predictor 45 corresponds to the code amount predictor of the present invention, and the quantization parameter determiner 46 corresponds to the present invention. Corresponds to the adoption determination means. However, the code amount prediction unit 45 and the quantization parameter determination unit 46 are not indispensable components of the quantization parameter determination unit of the present invention, and the quantization amount calculated by the quantization parameter calculation unit 44 without predicting the code amount. Even if the quantization parameter is adopted as the next quantization parameter QPn + 1, the effect of the present invention is achieved.
[0063]
FIG. 5 is a flowchart illustrating a code amount control process performed by the video signal encoding device 1 described above. In the code amount control process, first, the target code amount calculation unit 41 calculates the target generated code amount PB of one processing unit block by the above equation (7) (step 501). Subsequently, the target code amount calculation unit 41 calculates a target code amount TB up to the processing unit block after the compression processing is completed, using the above equation (1) (step 502). Next, the code accumulation amount BF of the buffer 30 is input to the difference calculation unit 42 and the quantization parameter determination unit 46 (Step 503). Then, the difference calculator 42 calculates a difference N between the target code amount PB calculated by the target code amount calculator 41 and the code storage amount BF input from the buffer 30 (step 504).
[0064]
The determining unit 43 determines whether or not the current quantization parameter QPn is larger than a threshold value m (Step 505). When it is determined in step 505 that the current quantization parameter QPn is larger than the threshold value m, the tables n1 to n4 in the table stored in the determination unit 43 are read and set (step 506). On the other hand, when it is determined in step 505 that the current quantization parameter QPn is equal to or smaller than the threshold value m, n1 to n4 are read from Table2 in the table stored in the determination unit 43 and set (step 507). .
[0065]
When n1 to n4 are set in step 506 or step 507, the determination unit 43 determines which region the difference N belongs to using equations (2) to (4) in which n1 to n4 are set. Judgment is made and the increase / decrease value R corresponding to the area is obtained (step 508). The quantization parameter calculation unit 44 calculates a new quantization parameter by adding the increase / decrease value R obtained in step 508 to the current quantization parameter QPn (step 509). The code amount prediction unit 45 calculates a predicted generated code amount X when the quantization parameter calculated in step 509 is adopted (step 510).
[0066]
The quantization parameter determination unit 46 uses the predicted generated code amount X calculated in step 510, the code storage amount BF input in step 503, and the target code amount TB calculated in step 502. , And the following quantization parameter Qpn + 1 is determined according to the equations (8) and (9) (step 511). Then, when the processing of all the processing unit blocks is completed (YES in step 512), the code amount control processing is completed, and when the processing of all the processing unit blocks is not completed (NO in step 512), step 502 is performed. And the processing of Steps 502 to 511 is repeated.
[0067]
As described above, according to the video signal encoding device 1 of the first embodiment, the determination criterion for calculating the quantization parameter QPn + 1 used for the next processing unit block based on the current quantization parameter QPn. Is set, an appropriate quantization parameter QPn + 1 can be set according to the use state of the buffer. This makes it possible to flexibly control the amount of code generated in the encoding process according to the use state of the buffer.
[0068]
Further, when the current quantization parameter QPn is set to be high, the generated code amount is suppressed low, and when there is a margin in the free space of the buffer 30 and the generated code amount may be increased, Since the parameterization can be reduced quickly, the image quality of the video reproduced by the code data can be improved by effectively utilizing the free space of the buffer 30.
[0069]
Further, the quantization parameter determination unit 46 determines whether or not to adopt the new quantization parameter calculated by the quantization parameter calculation unit 44 based on the predicted generated code amount X, and then performs the next quantization. Since the parameter QPn + 1 is determined, it is possible to prevent the generated code amount from excessively changing due to an increase or decrease in the quantization parameter.
[0070]
(Second embodiment)
FIG. 6 is a block diagram illustrating a configuration of the video signal encoding device 2 according to the second embodiment. The video signal encoding device 2 includes an encoding unit 10, a buffer 30, and a code amount control unit 40, like the video signal encoding device according to the first embodiment. The configuration of the encoding unit 10 is the same as the configuration of the encoding unit of the first embodiment. The code amount control unit 40 includes a target code amount calculation unit 41, a difference calculation unit 42, a determination unit 43, and a quantization parameter calculation unit 44, as in the first embodiment.
[0071]
As described above, the encoding unit 10 performs the intra-frame encoding on a plurality of frames at a predetermined fixed interval, and performs the inter-frame encoding on the frames during the intra-frame encoding. Apply. In general, the code amount generated by intra-frame coding is larger than the code amount generated by inter-frame coding. Therefore, after the output of the buffer 30 immediately before the intra-frame encoding process, it is desirable to reduce the code accumulation amount remaining in the buffer 30 as much as possible, and most desirably to zero. Therefore, before the intra-frame encoding process, it is necessary to control so that the code accumulation amount of the buffer 30 does not become larger than the code amount that can be output by one output.
[0072]
Therefore, in the present embodiment, the target code amount calculation unit 41 calculates the target code amount TB using the above equation (1) for a frame on which normal inter-frame coding is performed, When the frame to be encoded is near, the target code amount TB is reduced using the following equation (10) in order to reduce the generated code amount.
(Equation 10)
Target code amount TB = (bit rate BR / frame rate FR) × (block number BN / total number of blocks TN) × α (10)
Here, α is a coefficient satisfying α <1.
[0073]
Further, in the intra-frame encoding process, the target code amount calculation unit 41 increases the target code amount TB in order to increase the generated code amount. In this case, the target code amount TB is calculated using the following equation (11).
[Equation 11]
Target code amount TB = (bit rate BR / frame rate FR) × (block number BN / total number of blocks TN) × β (11)
Here, β is a coefficient satisfying β> 1.
[0074]
As described using equation (10), by setting the target code amount TB low before intra-frame encoding, the generated code amount decreases for each processing unit block, and the output from the buffer 30 is reduced. The code accumulation amount BF remaining in the buffer 30 later decreases with each frame processing. Then, by setting the target code amount high using the equation (11) in the intra-frame encoding process, a sufficient code amount can be generated and the image quality of the intra-coded frame can be increased.
[0075]
However, simply lowering the target code amount has a problem that it takes time to reduce the code storage amount BF of the buffer, as described below. Since the code accumulation amount BF of the buffer 30 is controlled by increasing or decreasing the quantization parameter with a predetermined step width (+2 to -2), a considerable number of processes are performed until the code accumulation amount BF is sufficiently reduced. The encoding process and the output process of the unit block must be performed. Therefore, in order to keep the code accumulation amount BF of the buffer 30 to zero at the time of the intra-frame encoding process, the target code amount TB is reduced using the equation (10) long before the intra-frame encoding process. The encoding process must be performed in the state. If the number of processing unit blocks processed in a state where the target code amount TB is set to be low is large, the image quality is reduced accordingly.
[0076]
Therefore, in the present embodiment, the number of encoding processes (that is, the number of processing unit blocks) until the code accumulation amount BF of the buffer 30 is sufficiently reduced for intra-frame encoding is minimized, and the target code amount is reduced. The code amount control unit 40 is configured as follows in order to maintain image quality by performing inter-frame encoding processing as much as possible with a high TB.
[0077]
That is, similarly to the first embodiment, the determination unit 43 stores the determination criterion of the increase / decrease value of the two quantization parameters shown in FIGS. A judgment criterion having a strong tendency is stored. Then, in the normal inter-frame encoding process, one of the two criteria shown in FIGS. 3 and 4 is selected in the same manner as in the first embodiment, and a predetermined immediately before the intra-frame encoding process is performed. For a number of frames, a criterion in which the quantization parameter tends to increase is adopted. That is, when the target code amount calculation unit 41 sets the target code amount TB low in order to suppress the generated code amount immediately before the intra-frame encoding processing, the determination unit 43 also increases the determination criterion of the quantization parameter. , And the generated code amount is rapidly reduced.
[0078]
In order to perform such processing, the video signal encoding device 2 of the present embodiment further includes a counter 47 in addition to the configuration of the code amount control unit of the first embodiment, as shown in FIG. And a subtraction unit 48. The counter 47 updates the count value each time the encoding unit 10 processes one frame of image data, and resets the count value at the timing of intra-frame encoding. The subtractor 48 subtracts the count value of the counter 47 from the number of frames between frames to be intra-coded, and calculates the number of frames until the next intra-frame encoding process.
[0079]
The encoding unit 10 intra-frame encodes one frame every time, for example, every 15 frames are inter-frame encoded. The subtraction unit 48 stores a numerical value 15, which is the number of frames between frames to be intra-coded, and subtracts the count value obtained from the counter 47 from 15 to obtain a value up to intra-frame encoding. Is calculated. When the number of remaining frames reaches a predetermined number as a result of the subtraction performed by the subtraction unit 48, the target code amount calculation unit 41 reduces the target code amount TB using Expression (10), and the determination unit 43 sets the quantization parameter The increase / decrease value R of the quantization parameter is calculated by using a determination criterion in which the increase tendency is strong. Further, in the intra-frame encoding process, the target code amount calculation unit 41 calculates the target code amount TB using Expression (11). As a result, a sufficient code amount can be generated in the intra-frame encoding process.
[0080]
Then, the determination unit 43 outputs the increase / decrease value R to the quantization parameter calculation unit 44. The quantization parameter calculation unit 44 calculates a new quantization parameter by adding the increase / decrease value R to the current quantization parameter QPn. The encoding unit 10 sets the quantization parameter calculated by the quantization parameter calculation unit as the quantization parameter QPn + 1 of the next processing unit block. In the present embodiment, the quantization parameter calculation unit 44 corresponds to a quantization parameter determination unit of the present invention.
[0081]
FIG. 7 is a graph showing a criterion adopted immediately before intra-frame encoding. The criterion shown in FIG. 7 has a stronger tendency to increase the quantization parameter than the criterion shown in FIGS. 3 and 4, that is, the criterion used in the normal inter-frame encoding process. According to the criterion of FIG. 7, the area of each increase / decrease value is located at a position where the code amount is smaller than the criterion of FIGS. As shown in FIG. 7, according to this criterion, when the code accumulation amount BF of the buffer 30 exceeds the target code amount TB, the quantization parameter is immediately increased (+1).
[0082]
In addition, according to the determination criterion in FIG. 7, the area of each increase / decrease value is divided by a boundary line parallel to a straight line indicating a transition of the target code amount TB calculated by Expression (10). In the expression (10), the increase in the target code amount TB with respect to the number of processed blocks is slower than in the expression (1). Further, since each boundary line of the determination criterion in FIG. 7 is also parallel to the straight line indicating the equation (10), the inclination is gentle.
[0083]
FIG. 8 is a graph showing the relationship between the number of processing unit blocks for which processing has been completed and the code accumulation amount BF of the buffer 30. FIG. 8 shows an example in which an inter-frame encoding process in which the target code amount TB is set low is performed on two frames immediately before intra-frame encoding.
[0084]
The counter 47 adds a count value for each processing of one frame. The subtraction unit 48 subtracts the count value of the counter 47 from 15 which is the number of frames to be inter-coded, for each processing of one frame. When the result of the subtraction is larger than 2, that is, in the normal inter-frame encoding process, the target code amount calculation unit 41 calculates the target code amount TB using Expression (1). As a result, as shown in FIG. 8, the target code amount for one frame becomes the code amount that the buffer 30 can output at one time (code amount b).
[0085]
When the number of frames until the intra-frame encoding becomes two remaining frames in the subtraction unit 48, the target code amount calculation unit 41 calculates the target code amount TB using Expression (10). This reduces the target code amount for one frame (code amount c). When the target code amount TB decreases, the code storage amount BF of the buffer 30 exceeds the target code amount TB. As a result, the quantization parameter increases for each processing unit block, and the generated code amount decreases accordingly. The determination unit 43 calculates the increase / decrease value of the quantization parameter for the two frames using the determination criterion shown in FIG. As a result, the generated code amount for each processing unit rapidly decreases. During the processing of two frames, the code accumulation amount BF of the buffer 30 is sufficiently reduced, and after outputting the last frame immediately before the intra-frame encoding, the code accumulation amount BF remaining in the buffer 30 becomes zero. Become.
[0086]
When the number of frames up to the intra-frame encoding in the subtraction unit 48 becomes zero, the encoding unit 10 intra-frame encodes the image data of the next frame. At this time, the target code amount calculation unit 41 calculates the target code amount TB using Expression (11). As a result, the target code amount for one frame is increased (code amount a). Note that, as is clear from the equations (1), (10) and (11), the target code amounts a, b and c for one frame are represented by a = β × b and c = α × b. is there.
[0087]
As described above, if the determination criterion shown in FIG. 7 is used to reduce the code accumulation amount BF of the buffer 30, the encoding process in which the target code amount TB is set low is performed only for two frames immediately before the intra-frame encoding. , And more interframe coding processing can be performed with the target code amount TB set high. As a result, it is possible to reduce a decrease in the image quality of the coded data generated in the inter-frame coding process, and to generate a sufficient code amount in the intra-frame coding process.
[0088]
In the above example, the criterion in which the quantization parameter has a strong tendency to increase is used for two frames immediately before the frame to be intra-coded, but the criterion is switched in units of processing unit blocks. Is also good. That is, the counter 47 may count the number of frames or the processing unit block. In any case, it is sufficient to use a determination criterion that tends to increase the quantization parameter for a predetermined number of times of encoding processing immediately before the intra-frame encoding processing. When the counter 47 counts the processing unit blocks, the subtracting unit 48 multiplies the number of frames between frames to be intra-coded by the number of divisions of the processing unit blocks per frame (in the above example, 15 frames × 15 blocks = 225 blocks).
[0089]
As described above, according to the video signal encoding device 2 of the second embodiment, the encoding up to the next intra-frame encoding is performed on the image data of the processing unit block to be inter-frame encoded. Since the criterion is set in accordance with the number of times, when performing inter-frame coding processing, efficient coding processing that effectively utilizes the free space of the buffer can be realized.
[0090]
In the above example, in a normal inter-frame encoding process, the increase / decrease value of the quantization parameter is calculated using a plurality of determination criteria in the same manner as in the first embodiment. In the embodiment, the control of the quantization parameter may be executed by another method during the normal inter-frame encoding process. However, as in the above example, when the quantization parameter is controlled so that the code storage amount always exceeds the target code amount by using a plurality of determination criteria in the normal inter-frame coding process, the intra-frame coding is performed. The effect that the deterioration of the image quality can be reduced by rapidly reducing the quantization parameter immediately before the quantization processing becomes remarkable.
[0091]
The video signal encoding device 2 illustrated in FIG. 6 does not include the code amount prediction unit and the quantization parameter determination unit unlike the video signal encoding device 1 according to the first embodiment. As in the first embodiment, a code amount predicting unit and a quantization parameter determining unit are provided in the embodiment to predict the generated code amount when the quantization parameter calculated by the quantization parameter 44 is used. It goes without saying that the next quantization parameter may be finally determined.
[0092]
【The invention's effect】
As described above, the present invention is to flexibly control the amount of generated code according to various situations by variably setting the increase / decrease criterion of the quantization parameter, and to improve the image quality of the output video signal. Thus, a video signal processing device having an excellent effect that the video signal processing can be performed can be provided.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of a video signal processing device according to a first embodiment.
FIG. 2 is a block diagram illustrating a configuration of a video signal processing device according to the first embodiment;
FIG. 3 is a graph showing a criterion (decreasing tendency: strong) according to the first embodiment;
FIG. 4 is a graph showing a criterion (decreasing tendency: weak) according to the first embodiment;
FIG. 5 is a flowchart illustrating a code amount control process according to the first embodiment;
FIG. 6 is a block diagram illustrating a configuration of a video signal processing device according to a second embodiment;
FIG. 7 is a graph showing a criterion (increase tendency: strong) according to the second embodiment;
FIG. 8 is a graph showing the relationship between the number of processed blocks and the code storage amount according to the second embodiment;
[Explanation of symbols]
10 Encoding unit
11 Division
14 Quantization unit
30 buffers
40 code amount control unit
41 Target code amount calculation unit
42 Difference calculator
43 Judgment unit
44 Quantization parameter calculator
45 Code amount prediction unit
46 Quantization parameter determination unit
47 counter
48 Subtraction unit

Claims (7)

映像信号を所定の処理単位ごとに量子化パラメータを用いて量子化することによって符号化する符号化手段と、
前記符号化手段にて符号化された映像信号を蓄積するバッファと、
前記バッファに蓄積されたデータの容量と量子化パラメータの増減値との関係を表す量子化パラメータ増減基準を用いて、前記バッファに蓄積されたデータの容量に基づいて量子化パラメータを決定する量子化パラメータ決定手段と、
前記処理単位のデータに対して用いた量子化パラメータに応じて、前記処理単位の後の処理単位のデータに対して用いる量子化パラメータを決定するための量子化パラメータ増減基準を可変に設定する基準変更手段と、
を備えたことを特徴とする映像信号符号化装置。
Encoding means for encoding by quantizing the video signal using a quantization parameter for each predetermined processing unit,
A buffer for storing the video signal encoded by the encoding means,
Using a quantization parameter increase / decrease criterion representing the relationship between the amount of data stored in the buffer and the increase / decrease value of the quantization parameter, quantization that determines a quantization parameter based on the amount of data stored in the buffer Parameter determining means;
A criterion for variably setting a quantization parameter increase / decrease criterion for determining a quantization parameter to be used for data of a processing unit after the processing unit according to the quantization parameter used for the data of the processing unit. Change means;
A video signal encoding device comprising:
前記基準変更手段は、前記処理単位のデータに対して用いた量子化パラメータが所定の閾値よりも高いときは、前記量子化パラメータが前記閾値より低いときよりも、量子化パラメータの減少傾向が強い量子化パラメータ増減基準を設定することを特徴とする請求項1に記載の映像信号符号化装置。When the quantization parameter used for the data of the processing unit is higher than a predetermined threshold, the criterion changing unit has a stronger tendency to decrease the quantization parameter than when the quantization parameter is lower than the threshold. The video signal encoding device according to claim 1, wherein a quantization parameter increase / decrease criterion is set. 前記量子化パラメータ決定手段は、
前記量子化パラメータ増減基準に従って量子化パラメータを算出する量子化パラメータ算出手段と、
前記量子化パラメータ算出手段にて算出された量子化パラメータを用いて前記処理単位のデータを量子化したときの発生符号量を予測する符号量予測手段と、
前記符号量予測手段にて予測された発生符号量に基づいて、前記量子化パラメータ算出手段にて算出された量子化パラメータを採用するか否かを判定する採用判定手段とを有し、
前記採用判定手段にて採用すると判定された量子化パラメータを前記符号化手段にて用いる量子化パラメータとして決定することを特徴とする請求項1または2に記載の映像信号符号化装置。
The quantization parameter determination means,
Quantization parameter calculation means for calculating a quantization parameter according to the quantization parameter increase / decrease criterion,
Code amount prediction means for predicting the generated code amount when quantizing the data of the processing unit using the quantization parameter calculated by the quantization parameter calculation means,
Based on the generated code amount predicted by the code amount prediction unit, and an adoption determination unit that determines whether to employ the quantization parameter calculated by the quantization parameter calculation unit,
The video signal encoding device according to claim 1, wherein the quantization parameter determined to be adopted by the adoption determination unit is determined as a quantization parameter used by the encoding unit.
前記符号化手段は、複数のフレームからなる動画を表す映像信号をフレーム内符号化およびフレーム間符号化によって符号化し、
前記基準変更手段は、フレーム間符号化される処理単位のデータに対しては、次のフレーム内符号化までの符号化の回数に応じて前記量子化パラメータ増減基準を設定することを特徴とする請求項1〜3のいずれかに記載の映像信号符号化装置。
The encoding means encodes a video signal representing a moving image composed of a plurality of frames by intra-frame encoding and inter-frame encoding,
The criterion changing means sets the quantization parameter increase / decrease criterion for data in a processing unit to be inter-frame coded according to the number of times of coding until the next intra-frame coding. The video signal encoding device according to claim 1.
複数のフレームからなる動画を表す映像信号を所定の処理単位ごとに量子化パラメータを用いて量子化することによって、前記複数のフレームをフレーム内符号化およびフレーム間符号化によって符号化する符号化手段と、
前記符号化手段にて符号化された映像信号を格納するバッファと、
前記バッファに蓄積されたデータの容量と量子化パラメータの増減値との関係を表す量子化パラメータ増減基準を用いて、前記バッファに蓄積されたデータの容量に基づいて量子化パラメータを決定する量子化パラメータ決定手段と、
前記符号化手段にてフレーム間符号化される処理単位のデータに対しては、次のフレーム内符号化までの符号化の回数に応じて前記量子化パラメータ増減基準を可変に設定する基準変更手段と、
を備えたことを特徴とする映像信号符号化装置。
Encoding means for encoding a plurality of frames by intra-frame encoding and inter-frame encoding by quantizing a video signal representing a moving image composed of a plurality of frames using a quantization parameter for each predetermined processing unit When,
A buffer for storing the video signal encoded by the encoding means,
Using a quantization parameter increase / decrease criterion representing the relationship between the amount of data stored in the buffer and the increase / decrease value of the quantization parameter, quantization that determines a quantization parameter based on the amount of data stored in the buffer Parameter determining means;
A reference changing means for variably setting the quantization parameter increase / decrease criterion according to the number of times of encoding until the next intra-frame encoding for data of a processing unit which is inter-coded by the encoding means. When,
A video signal encoding device comprising:
前記基準変更手段は、前記フレーム内符号化の直前の処理単位のデータに対しては、他の処理単位のデータよりも量子化パラメータの増加傾向が強い量子化パラメータ増減基準を設定することを特徴とする請求項5に記載の映像信号符号化装置。The reference changing unit sets a quantization parameter increase / decrease criterion in which a quantization parameter increase tendency is stronger for data of a processing unit immediately before the intra-frame encoding than data of another processing unit. The video signal encoding device according to claim 5, wherein 映像信号を所定の処理単位ごとに量子化パラメータを用いて量子化することによって、前記映像信号を符号化する符号化手段と、
前記符号化手段にて符号化された映像信号を格納するバッファと、
前記バッファに蓄積されたデータの容量と量子化パラメータの増減値との関係を表す量子化パラメータ増減基準を用いて、前記バッファに蓄積されたデータの容量に基づいて量子化パラメータを決定する量子化パラメータ決定手段と、
前記処理単位の後の処理単位のデータに対して用いる量子化パラメータを決定するための量子化パラメータ増減基準を可変に設定する基準変更手段と、
を備えたことを特徴とする映像信号符号化装置。
Encoding means for encoding the video signal by quantizing the video signal using a quantization parameter for each predetermined processing unit,
A buffer for storing the video signal encoded by the encoding means,
Using a quantization parameter increase / decrease criterion representing the relationship between the amount of data stored in the buffer and the increase / decrease value of the quantization parameter, quantization that determines a quantization parameter based on the amount of data stored in the buffer Parameter determining means;
Reference changing means for variably setting a quantization parameter increase / decrease criterion for determining a quantization parameter used for data of a processing unit after the processing unit,
A video signal encoding device comprising:
JP2003090582A 2003-03-28 2003-03-28 Video signal encoder Pending JP2004297696A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003090582A JP2004297696A (en) 2003-03-28 2003-03-28 Video signal encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003090582A JP2004297696A (en) 2003-03-28 2003-03-28 Video signal encoder

Publications (1)

Publication Number Publication Date
JP2004297696A true JP2004297696A (en) 2004-10-21

Family

ID=33404172

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003090582A Pending JP2004297696A (en) 2003-03-28 2003-03-28 Video signal encoder

Country Status (1)

Country Link
JP (1) JP2004297696A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009278390A (en) * 2008-05-15 2009-11-26 Kyocera Mita Corp Image compression apparatus and program
JP2011071778A (en) * 2009-09-25 2011-04-07 Mega Chips Corp Image processing apparatus
JP2011217085A (en) * 2010-03-31 2011-10-27 Mega Chips Corp Image encoding device
JP5472106B2 (en) * 2008-06-27 2014-04-16 ソニー株式会社 Image processing apparatus and image processing method
JP2014082772A (en) * 2013-12-05 2014-05-08 Mega Chips Corp Image encoder

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009278390A (en) * 2008-05-15 2009-11-26 Kyocera Mita Corp Image compression apparatus and program
JP5472106B2 (en) * 2008-06-27 2014-04-16 ソニー株式会社 Image processing apparatus and image processing method
JP2011071778A (en) * 2009-09-25 2011-04-07 Mega Chips Corp Image processing apparatus
JP2011217085A (en) * 2010-03-31 2011-10-27 Mega Chips Corp Image encoding device
JP2014082772A (en) * 2013-12-05 2014-05-08 Mega Chips Corp Image encoder

Similar Documents

Publication Publication Date Title
JP3954656B2 (en) Image coding apparatus and method
US7688234B2 (en) Coding apparatus, coding method, program for executing the method, and recording medium storing the program
JP4820191B2 (en) Moving picture coding apparatus and program
US20090067738A1 (en) Image coding apparatus and image coding method
JP3755155B2 (en) Image encoding device
JP4221655B2 (en) Encoding apparatus, encoding method, program, and recording medium
JP4485996B2 (en) Image encoding apparatus and image encoding program
JP3757088B2 (en) Moving picture coding apparatus and method
JP4179917B2 (en) Video encoding apparatus and method
JP2004297696A (en) Video signal encoder
JPH07264595A (en) Source coding method of picture
JP4492777B2 (en) Video encoding device
JP2008252225A (en) Motion picture encoding device and method
JP2005340896A (en) Motion picture encoder
JP2002010270A (en) Device and method for coding images
JP2005045736A (en) Method and device for encoding image signal, encoding controller, and program
JP5006763B2 (en) Image encoding apparatus, control method therefor, and computer program
JP2009296040A (en) Transcoder
KR100744435B1 (en) An improved early detection of all-zero dct coefficients for fast video encoding
JP2005303555A (en) Moving image encoding apparatus and its method
JP3200518B2 (en) Image signal encoding device
JP2009118097A (en) Image encoder, its control method, and computer program
JP4394558B2 (en) Image processing apparatus, image processing method, and image processing program
JPH09327023A (en) Intra-frame/inter-frame coding changeover method and image coding device
JP4127006B2 (en) Image signal encoding apparatus and encoding method