JP2004007619A - Image coding apparatus and method therefor - Google Patents

Image coding apparatus and method therefor Download PDF

Info

Publication number
JP2004007619A
JP2004007619A JP2003120626A JP2003120626A JP2004007619A JP 2004007619 A JP2004007619 A JP 2004007619A JP 2003120626 A JP2003120626 A JP 2003120626A JP 2003120626 A JP2003120626 A JP 2003120626A JP 2004007619 A JP2004007619 A JP 2004007619A
Authority
JP
Japan
Prior art keywords
frame
bits
encoding
frame rate
quantization
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.)
Granted
Application number
JP2003120626A
Other languages
Japanese (ja)
Other versions
JP4490046B2 (en
Inventor
Kyoko Uchibayashi
内林 京子
Shinya Sumino
角野 眞也
Takahiro Nishi
西 孝啓
▲たか▼橋 潤
Jun Takahashi
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 JP2003120626A priority Critical patent/JP4490046B2/en
Publication of JP2004007619A publication Critical patent/JP2004007619A/en
Application granted granted Critical
Publication of JP4490046B2 publication Critical patent/JP4490046B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image coding apparatus capable of preventing the impairment of sharpness caused by the sharp decrease of the number of bits which can be assigned and the sudden change of a frame rate, in a case that scenes difficult to be coded are continued. <P>SOLUTION: A deriving part 31 for deriving the frame constellation target number of bits which can be assigned reads out from a memory 36 the total number of bits of frame constellation units to remaining frames, subtracts the generating number of bits used by coding the previous frames and updates, and transmits it to a deriving part 32 for deriving the following frame target number of bits. The deriving part 32 for deriving the following frame target number of bits computes the target number of bits assigned to the following frames based on the remaining frame number in consideration of the received total number of bits and frame rate values Rf. A deriving part 33 for deriving the mean or average frame number of bits computes the mean rate of the number of bits assigned to the former frames. An operation part 34 multiplies the mean rate of the computed number of bits by considered factors, compares this with a target value of the number of bits, and selects a greater one of values and transmits it to a deriving part 35 for a quantization step. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、画像符号化技術及び画像復号化技術に関し、特に可変ビットレート方式や可変フレームレート方式を用いた画像符号化技術に関する。
【0002】
【従来の技術】
従来、MPEG(Moving Picture Expert Group)規格等の画像符号化技術におけるビットレートを制御する方式の一つに可変ビットレート(Variable Bit Rate)方式がある。これは、主に符号化データを蓄積するバッファメモリの容量等の制約や、記録媒体に記録する際の映像記録時間の制約を守るため、符号化される画像の複雑さに伴う局所的なビットレートの変化を許容しつつ、所定の時間長(例えば、1秒間)における発生ビット数を一定内に抑えるという制御方式である。つまり、符号化が困難なシーンにおいては符号化のためのビットを多く発生させ(ビットレートが高くなり)、符号化が容易なシーンでは発生させるビット数を少なくする(ビットレートが低くなる)ことにより、シーンに応じて割り当てるビット数を制御するものである。即ち、一定時間内の発生ビット数を一定に保ちつつ(即ち、バッフメモリ容量の制約や記録時間の制約の範囲で)、高画質な画像を再現できるように符号化を行なおうとするものである(例えば、特許文献1参照)。
【0003】
上記従来の可変ビットレート方式を用いた画像符号化装置について、図32の画像符号化装置100を用いて説明する。この画像符号化装置100は、直交変換部105、量子化部106、可変長符号化部107、逆量子化部108、逆直交変換部109、フレームメモリ102、動き検出部103、動き補償部104及びビットレート制御部110から構成されている。
【0004】
直交変換部105は、受信した被符号化フレーム信号101(画像信号データ)に対して、マクロブロック単位で離散コサイン変換(DCT:Discrete CosineTransform)を行ない、DCT係数を生成して量子化部106に出力する。ここで、I(Intra coded)ピクチャのフレームについては、画面内符号化モードでDCT演算が行われる。P(Predictive coded)ピクチャのフレームについては、時間的に過去に位置するIピクチャ又はPピクチャに基づいて前方向予測符号化モードでDCT演算が行なわれる。B(Bidirectionally)ピクチャのフレームについては、時間的に前後に位置するIピクチャ又はPピクチャに基づいて両方向予測符号化モードでDCT演算が行なわれる。
【0005】
量子化部106は、直交変換部105から入力したDCT係数に対し、マクロブロック毎にビットレート制御部110から受信した量子化ステップ(又は量子化パラメータでもよい。)で量子化を行ない、可変長符号化部107及び逆量子化部108に出力する。可変長符号化部107は、量子化部106から入力した量子化されたDCT係数等について可変長符号化及び多重化を行ない、出力バッファ(図示せず)に出力する。
【0006】
逆量子化部108は、量子化部106から受信した量子化されたDCT係数に対して逆量子化演算を行ない、逆直交変換部109に出力する。逆直交変換部109は、逆量子化部108から入力した逆量子化されたDCT係数に基づいて逆直交変換演算を行なって画像信号データを再現し、フレームメモリ102に出力する。
【0007】
フレームメモリ102は、Iピクチャ又はPピクチャの復号化された画像信号データと動き補償部104で生成された動き補償データとを加算して格納する。動き検出部103は、フレームメモリ102に格納されている参照画像から動きベクトルを検出し、この動きベクトルを表すデータを動き補償部104に出力する。
【0008】
動き補償部104は、Pピクチャ又はBピクチャの符号化のためにフレームメモリ102に格納されている参照画像と動き検出部103から入力した動きベクトルを表すデータに基づいて動き補償データ(参照画像データ)を生成する。ビットレート制御部110は、可変長符号化部107から発生ビット数を受信し、この発生ビット数に基づいて、量子化ステップを決定し、この量子化ステップを量子化部106に送信する。
【0009】
全体制御部140は、例えば、ROMやRAM等を備えるマイクロコンピュータ等であり、画像符号化装置100全体の制御を行なう部分である。全体制御部140は、制御信号等に基づいて、それぞれの処理タイミングの制御等を行なう。
【0010】
図33は、従来の画像符号化装置100におけるビットレート制御部110の機能構成を示すブロック図である。図33に示されるように、ビットレート制御部110は、フレーム群目標ビット数導出部111、次フレーム目標ビット数導出部112及び量子化ステップ導出部113から構成される。
【0011】
フレーム群目標ビット数導出部111は、可変長符号化部107から発生ビット数Nn131を受信して内部のメモリ(図示せず)に格納する。この際、フレーム群目標ビット数導出部111は、発生ビット数Nn131を受信した回数(つまり、符号化を行なったフレームのフレーム数)をカウントする。さらに、フレーム群目標ビット数導出部111は、フレーム群単位で未だ符号化されていないフレームに対する割り当て可能なビット数を算出し、次フレーム目標ビット数導出部112に送信すると共に、実際の符号化によって生じた発生ビット数Nn131を用いて、上記の割り当て可能なビット数を順次更新する。ここで、「フレーム群」とは、所定の時間長に符号化され得るフレームの集まりをいう。
【0012】
次フレーム目標ビット数導出部112は、フレーム群目標ビット数導出部111から受信したフレーム群単位で割り当て可能なビット数に基づいて、次のフレームに割り当てるビット数の目標値を導出し、量子化ステップ導出部113に送信する。上記目標値は、その時点のフレーム群単位で割り当て可能なビット数を残りのフレーム数で除することによって算出する。
【0013】
量子化ステップ導出部113は、次フレーム目標ビット数導出部112から受信した次のフレームに割り当てるビット数の目標値に基づいて、量子化ステップ141(量子化パラメータでもよい。)を算出して量子化部106に出力する。
【0014】
図34は、従来の画像符号化装置100の全体制御部140及びビットレート制御部110における処理の流れを示すフローチャートである。
【0015】
最初に、ビットレート制御部110によって発生ビット数Nn131が受信されると(S1401)、全体制御部140は、次の符号化対象のフレームがフレーム群の先頭か否かを判断する(S1402)。この場合、次のフレームがフレーム群の先頭のフレームの場合は(S1402:Yes)、ビットレート制御部110は、割当可能ビット数Na、割当対象期間Ta及び割当対象フレーム数Ntの初期化を行なう(S1405〜1407)。ここで、”NA”は、フレーム群単位に割り当てるビット数の初期値である。”TA”は、フレーム群全体の期間である。”Rf”は、本画像符号化装置100の符号化のフレームレートである。
【0016】
一方、次のフレームがフレーム群の先頭のフレームでない場合は(S1402:No)、ビットレート制御部110は、割当可能ビット数Na及び割当対象期間Taの更新を行なう(S1403〜1404)。
【0017】
次に、ビットレート制御部110は、割当可能ビット数Naと割当対象フレーム数Ntに基づいて割当ビット数Nbを算出し(S1408)、割当対象フレーム数Ntの更新(デクリメント)を行なう(S1409)。
【0018】
この後、ビットレート制御部110は、符号化するフレームについて間引きが必要か否かを判定し、間引きが必要な場合はその旨を全体制御部140に通知し(S1410:Yes)する。一方、間引きをする必要がない場合は(S1410:No)、量子化ステップを算出して量子化部106に出力する(S1411)。
【0019】
全体制御部140及びビットレート制御部110は、以上の処理を符号化処理が終わるまで繰り返す(S1401〜1412)。
【0020】
図35は、従来のビットレート制御部110における割当ビット数Nbの算出方法の具体例を示した図である。なお、この場合は、便宜上、発生ビット数Nn131と割当ビット数Nbとは、一致するものとする。
【0021】
図35の例では、30[fps]で入力される画像信号データ(被符号化フレーム信号101)に対して、15[fps]のフレームレートで符号化が行なわれ、原則として15フレームで構成されるフレーム群が毎秒1つ生成されることとする。この例では、入力される被符号化フレーム信号101を「入力画像フレーム番号1701」で表し、符号化フレーム信号121を「フレーム群フレーム番号1702」で表している。図35において、フレーム群フレーム番号1702及び発生ビット数Nn131の欄が「×」となっているのは、対応する入力画像フレーム番号1701のフレームについては符号化がされず、「間引き」されたことを表す。
【0022】
さらに、図35において、例えば入力画像フレーム番号「9」(すなわち、フレーム群フレーム番号「5」)に対する発生ビット数Nnは、既に4つのフレームに割り当てられたビット数の合計が1180ビットで、残りのフレーム数が「11」であるため、((3600−1180)/11=220ビット)となる。
【0023】
一方、入力画像フレーム番号「13」(すなわち、フレーム群フレーム番号「6」)に対する発生ビット数は、入力画像フレーム番号「11」が「間引き」されているので、既に割り当てられたビット数の合計が1400ビットで、残りのフレーム数が「9」であるため、小数点以下を切り捨てて((3600−1400)/9=244ビット)となる。
【0024】
なお、図35の入力画像フレーム番号「29」に対応するフレーム群フレーム番号1702の欄に記載されている”(14)”は、入力画像フレーム番号1701が「13」の時点における、最後のフレーム群フレーム番号1702の予想値である。
【0025】
以上のように、従来の画像符号化装置100では、次の符号化対象のフレームにビットを割り当てている。
【0026】
【特許文献1】
特開2001−25015号公報
【0027】
【発明が解決しようとする課題】
しかしながら、上記の従来技術における可変ビットレートを用いた画像符号化装置100においては、符号化が困難な(複雑な)フレームが連続する場合、量子化ステップを大きな値に変えても符号化に伴う発生ビット数が多くなる(この場合は、ビットレートの値が大きくなる)。すると、所定の時間長(1つのフレーム群)における発生ビット数を一定に保とうとするために、符号化が困難なフレームが連続した後のフレームについては、割り当てるビット数が少なくなってしまう。このため、後のフレームについては量子化ステップを大きくして符号化しなければならず、それらのフレームの画質が極端に劣化してしまうという第1の問題がある(この場合の現象としては、ビットレートが著しく小さな値となる)。
【0028】
図36は、上記従来技術の第1の問題を説明するための図である。図36では、フレーム1601からフレーム1602までの15枚のフレームをフレーム群と定義し、フレーム群毎に、目標値として(上記図35に示されるように)3600[ビット]を割り当てることとする。この場合、時刻t1から符号化が困難なシーンが連続し、それらのフレームの符号化に多くのビットが割り当てられた場合は、フレーム群の後半に割り当て得るビット数が少なくなるため、量子化ステップを大きくする必要が出てくるが(これに伴ってビットレートが小さくなる)、量子化ステップを大きな値とした場合は、画質が極端に劣化する。図36においては、「t3−t4」間で量子化ステップが特に大きくなっており、これに伴って画質の劣化が生じていると推測できる。
【0029】
さらに、いよいよ割り当て得るビット数が少なくなり、フレーム群の途中でフレームレートを変化させなければ(すなわち、フレームを間引かなければ)ならなくなった場合は、フレームレートが変化したにも拘らず、1つのフレームに割り当てられるビット数は当初のフレームレートに基づいて決定されるので、フレームレートを下げたにも拘らずビット数を多く割り当てることができず、さらにフレームレートを下げるか、量子化ステップを粗くすることが必要となり、さらなる画質の劣化をきたすという第2の問題点がある。
【0030】
図37は、上記従来技術の第2の問題を説明するための図である。図37の例では、符号化が困難なシーンが連続し、それらのフレームの符号化に多くのビットが割り当てられたため、フレームレートを徐々に下げた結果、フレーム間隔が大きく空いてしまい、結局、動きがぎこちない画像となり、画像としての品質が劣化する様子が示されている。
【0031】
そこで、本発明は、上記課題に鑑みてなされたものであり、符号化が困難なシーンが連続した場合であっても、残りのフレームに割り当て得るビット数が極端に不足することによる画質の劣化を防止すると共に、符号化されるフレームのレートの変化をも考慮しながら高画質の画像のための符号化を可能にする画像符号化装置及びその方法を提供することを目的とする。
【0032】
【課題を解決するための手段】
上記目的を達成するために、本発明に係る画像符号化装置は、フレーム単位で順次入力される画像信号について符号化を行なう画像符号化装置であって、前記符号化を行なう周期を示すフレームレートを受け付けるフレームレート受付手段と、複数のフレームから構成されるフレーム群に全体として割り当て可能な総ビット数を特定する総ビット数特定手段と、前記受け付けられたフレームレートと既に符号化されたフレームのフレーム数とに基づいて、前記フレーム群における未だ符号化されていないフレームのフレーム数を特定するフレーム数特定手段と、前記特定された総ビット数と前記特定されたフレーム数とに基づいて、次に符号化するフレームに割り当てるビット数の目標値を算出する目標ビット数算出手段と、前記算出されたビット数の目標値を用いて、次に符号化するフレームに係る量子化ステップを導出する量子化ステップ導出手段と、前記導出された量子化ステップに基づいて量子化を行ない、当該量子化に基づいて符号化を行なう符号化手段とを備える。
【0033】
これにより、フレーム群において一定のビットレートになるように、フレーム群全体に割り当てられた総ビット数と既に割当済みのビット数に基づいて、次の符号化するフレームに割り当てるべきビット数を計算するので、割り当てられるビット数が局所的に偏ってしまう場合を未然に回避して平均化したビット割り当てが可能となり、最終的に極端な画質の劣化を防止することが可能となる。
【0034】
また、上記目的を達成するために、本発明に係る画像符号化装置は、さらに、前記フレーム群におけるフレームの符号化に伴って割り当てが確定したビット数の平均値を算出する平均値算出手段と、前記算出された、前記ビット数の目標値と前記ビット数の平均値とに対して所定の演算を行なって新たなビット数の目標値を特定する演算手段とを備え、前記量子化ステップ導出手段は、前記演算手段によって特定されたビット数の目標値を用いて量子化ステップを導出することを特徴とする。
【0035】
これにより、受け付けたフレームレートから算出した未だ符号化されていないフレーム数と、フレーム群における割り当て可能なビット数とに基づいて、次に符号化するフレームに割り当てるべきビット数を決定するので、フレームレートの変化に則した符号化が可能となる。
【0036】
また、上記目的を達成するために、本発明に係る画像符号化装置は、さらに、既に符号化されたが未送信のデータを格納する格納手段と、前記格納手段に格納されているデータ量に基づいて、次に符号化するフレーム係るフレームレートを計算するフレームレート計算手段を備え、前記フレームレート受付手段は、前記計算されたフレームレートを受け付けることを特徴とする。
【0037】
これにより、所定の時間長で観測した場合のビットレートを一定に保ちながら、バッファに十分空きがある場合は低い量子化ステップで符号化することで、従来よりも高画質に符号化することができ、かつ複雑なシーンへ移行した場合のフレームレートの急激な低下(多くのフレームが符号化されずスキップされること)を抑制し、従来よりも動きの滑らかな符号化を行なうことが可能となる。
【0038】
なお、上記目的を達成するために、本発明は、上記画像符号化装置の特徴的な手段をステップとする画像符号化方法として実現したり、これらのステップを含むプログラムとして実現したりすることもできる。そして、そのプログラムは、画像符号化装置が備えるROM等に格納しておくだけでなく、CD−ROM等の記録媒体や通信ネットワーク等の伝送媒体を介して流通させることもできる。
【0039】
【発明の実施の形態】
以下、本発明に係る実施の形態について、図面を参照しながら詳細に説明する。なお、以下の説明では、従来技術と共通する構成については同一の符号を付し、その説明は省略する。
【0040】
(実施の形態1)
図1は、実施の形態1に係る画像符号化装置10の機能構成を示すブロック図である。この画像符号化装置10は、所定の時間長(例えば、1秒間)で観測した場合におけるビットレートを一定に保ちながら、局所的なビットレートの変動をも抑えることにより、より高品質な画像の再現のための符号化を可能とする。
【0041】
画像符号化装置10は、フレームメモリ102、動き検出部103、動き補償部104、直交変換部105、量子化部106、可変長符号化部107、逆量子化部108、逆直交変換部109、フレーム間引部20、レート制御部30及び全体制御部40から構成されている。
【0042】
フレーム間引部20は、一定の周期で入力される被符号化フレーム信号101に対し、そのフレームの符号化/非符号化を決定すると共に、その時点のフレームレート値Rf21をレート制御部30に通知する。
【0043】
レート制御部30は、可変長符号化部107から受信した発生ビット数とフレーム間引部20から通知を受けたフレームレート値Rf21とに基づいて、次のフレームの符号化における量子化ステップ(又は量子化パラメータ)を決定し、量子化部106に送信する。
【0044】
全体制御部40は、例えば、ROMやRAM等を備えるマイクロコンピュータであり、画像符号化装置10全体の制御を行なう。より詳細には、全体制御部40は、制御信号(図1の全体制御部40における破線は制御信号線を表している)に基づいて、各部の処理タイミングの制御を行なう。さらに、全体制御部40は、一定の周期で入力される被符号化フレーム信号101のピクチャタイプの識別(Iフレーム、Bフレーム及びPフレームの識別)を行ない、その識別結果をレート制御部30に通知する。
【0045】
図2は、図1におけるレート制御部30の詳細な機能構成を示すブロック図である。レート制御部30は、フレーム群目標ビット数導出部31、次フレーム目標ビット数導出部32、平均フレームビット数導出部33、演算部34、量子化ステップ導出部35及び記憶部36から構成される。
【0046】
フレーム群目標ビット数導出部31は、フレーム群単位で、残りの符号化すべき全てのフレームに割り当て可能な総ビット数の目標値を逐次算出し更新する。より詳細に説明すると、フレーム群目標ビット数導出部31は、可変長符号化部107から発生ビット数Nn131を受信して記憶部36に記憶する。さらに、フレーム群目標ビット数導出部31は、次の符号化すべきフレームからフレーム群の最後のフレームまでに割り当て可能な総ビット数を記憶部36から読み出し、この総ビット数から上記の発生ビット数Nn131を減じ、その値を次フレーム目標ビット数導出部32に送信すると共に記憶部36に格納する。
【0047】
次フレーム目標ビット数導出部32は、フレーム間引部20から受信したフレームレート値Rf21及びフレーム群目標ビット数導出部31から受信した割り当て可能な総ビット数に基づいて、残りの符号化すべきフレームのフレーム数を考慮し、次のフレームに割り当てるビット数の目標値を算出する。
【0048】
平均フレームビット数導出部33は、フレーム間引部20から受信したフレームレート値Rf21及び記憶部36に記憶されている過去のフレームに割り当てられたビット数に基づいて、割り当てられたビット数の平均値を算出する。
【0049】
演算部34は、平均フレームビット数導出部33で算出されたビット数に、所定の係数(例えば、0.8)を乗じたビット数を算出し、これと次フレーム目標ビット数導出部32で算出されたビット数の目標値とを比較し、値の大きい方のビット数を選択する。さらに、演算部34は、選択されたビット数と予め設定されている下限値とを比較し、より大きい値のビット数を選択して(すなわち、下限値を下回らないビット数を選択して)量子化ステップ導出部35に送信する。なお、上記の所定の係数は、「0.8」に限定するものではなく、0より大きく1以下の他の値であってもよい。
【0050】
量子化ステップ導出部35は、演算部34から受信したビット数と発生ビット数が等しくなるように量子化ステップの値を導出する。
【0051】
記憶部36は、可変長符号化部107から受信した各フレームを符号化した結果である発生ビット数Nn131を記憶する。さらに、記憶部36は、フレーム群目標ビット数導出部31の制御に従ってフレーム群目標ビット数を更新する。
【0052】
図3は、画像符号化におけるピクチャタイプ別の発生ビット数の一般的な特徴を示す図である。図3に示されるように、通常、画面内符号化(Iピクチャ)のフレーム(Iフレーム210〜250)における発生ビット数Nnより、画面間符号化(Pピクチャ又はBピクチャ)のフレーム(P又はBフレーム)における発生ビット数Nnの方が少なくなる。従って、Iフレームから次のIフレームまでを1つのフレーム群と定義することによって、他の規則に基づいてフレーム群を定義する場合(例えば、ピクチャタイプと無関係に15フレーム毎にフレーム群を構成させる場合)に比べ、各フレーム群における発生ビット数の偏りを少なくすることができる。なお、図3の例では、便宜上、各フレーム群の符号化に要する時間をTAとし、同一の周期とした。
【0053】
なお、フレーム群の最初のフレームが上記のIフレームであったり、フレーム群の最後のフレームがIフレームであったりすることのみでも、各フレーム群におけるビット数の偏りを少なくする効果が得られ得る。
【0054】
図4は、上記図3で定義したフレーム群の具体例を示した図である。図4に示されるように、フレーム群310は、画面内符号化(I)フレーム210から画面内符号化(I)フレーム220の直前のフレームの15枚のフレームで構成されることとする。同様に、フレーム群220やフレーム群230もそれぞれ15枚のフレームで構成されることとする。この場合、1つのフレーム群に割り当て可能な総ビット数の初期値を予め決定しておく(例えば、3600「ビット]等」。なお、フレーム群の定義の仕方は図4に限定するものではない。
【0055】
図5は、上記図3で定義したフレーム群の変形例である。図5に示されるように、上記図4における2つのフレーム群310、320に相当する第1フレームセットと第2フレームセットからなるフレームの集まりを1つのフレーム群410として定義してもよい。この場合、フレーム群410に割り当て可能な総ビット数の初期値を7200[ビット](第1フレームセット及び第2フレームセットにそれぞれ3600[ビット])とする。
【0056】
図6は、上記図5のように2つのフレームセットでフレーム群を構成することによる効果を説明するための図である。図6(a)は、1つのフレーム群の中に符号化が困難なシーンがあった場合でも、次の第2フレームセットにおける割当可能ビット数を含めて次の被符号化フレームの割当ビット数を決定することができるため、よりビットレートの変化を緩和させることが可能となる。例えば、初期値としてフレーム群410全体で1000ビットを割り当て、第1フレームセットに500ビット、第2フレームセットに500ビット暫定的に割り当てることとする。この後、実際の符号化で第1フレームセットにおいて700ビットを使用したとしても、次のフレーム群420では、初期値として全体で800[ビット](前のフレーム群410の残り分300[ビット]+新規の第2フレームセット分500[ビット])を割り当てるように制御する。
【0057】
図6(b)は、さらに符号化が困難のためフレームレートが変更させなければならない場合であっても、上記図6(a)と同様の方法で、ビットレートが急激に小さな値となる(すなわち、量子化ステップが急激に大きくなる)ことを回避することができる。
【0058】
図7は、画像符号化装置10の全体制御部40及びレート制御部30における処理の流れを示すフローチャートである。
【0059】
最初に、レート制御部30は、可変長符号化部107から発生ビット数Nn131を受信し(S701)、フレーム間引部20からフレームレート値Rf21を受信する(S702)。
【0060】
次に、全体制御部40は、次のフレームがIフレームか否かを識別する(S703)。この場合、次のフレームがIフレームの場合は(S704:Yes)、レート制御部30は、割当可能ビット数Na、割当対象期間Ta及び割当対象フレーム数Ntの初期化を行なう(S708〜S710)。
【0061】
一方、次のフレームがIフレームでない場合(S704:No)、レート制御部30は、割当可能ビット数Na及び割当対象フレーム数Ntの更新を行なう(S705、S706)。さらに、レート制御部30は、割当対象フレーム数Ntの小数点以下を切り捨てて、このNtについて整数化を行なう(S707)。
【0062】
この後、レート制御部30は、割当可能ビット数Na及び割当対象フレーム数Ntに基づいて割当ビット数Nbを算出し(S711)、割当対象期間Taの更新を行なう(S712)。この場合、割当対象期間Taは、フレームレート値Rf21の値が同一のフレーム群の途中で変更した場合にも考慮して更新がなされる。
【0063】
これにより、レート制御部30は、割当ビット数Nbに基づいて量子化ステップを導出し、可変長符号化部107に送信する(S713)。
【0064】
全体制御部40及びレート制御部30は、以上の処理を符号化処理が終わるまで繰り返す(S701〜S714)。
【0065】
図8は、画像符号化装置10を用いて符号化を実行した場合のビットレートの変化を示す一例である。図8に示されるビットレートの変化をみてみると、演算部34における係数(例えば、0.8)のために、従来技術の場合(上記図36)に比べ、割り当て可能なビット数が少なく抑えられるため、ビットレートの変化が鈍化する傾向にある。さらに、図8においては、上記演算部34において、下限値を下回らないビット数が選択され、符号化後のビット数がこのビット数になるように量子化ステップが算出される。さらに、算出された量子化ステップに従って符号化が実行され、発生ビットが決定されるため、ビットレートについても下限値以上の値となっている様子が示されている。
【0066】
図9は、上記図5に示したように、2つのフレームセットで1つのフレーム群を構成した場合のビットレートが変動する様子を示した一例である。図9に示されるように、従来技術(上記図36)ではビットレートの値が著しく小さく(すなわち、量子化ステップが著しく大きく)なった「t3−t4」間においては、ビットレートの値が小さくなることを抑え、画質の劣化を抑制することができたが、第1フレームセットで多くのビット数を使用した影響が、第2フレームセットの最初の部分(「t4−t6」間)に出ている(すなわち、量子化ステップを小さくできずビットレートの値が小さいままの)様子が示されている。
【0067】
図10は、2つのフレームセットで1つのフレーム群を構成し、かつ、フレーム群の途中で符号化のフレームレートが変化した場合におけるビットレートの変化の様子を示した一例である。図10では、フレームレートが15[fps]から7.5[fps]に変化しているが、ビットレートの変化の仕方が上記図8のビットレートと同じである(つまり、図10の場合は、1/2の量子化ステップで符号化を行なって2倍のビット数が発生したために、ビットレートとしては同一になったと想定される場合であり、この場合においても「t3−t4」間で画質の劣化が抑制されている)。
【0068】
図11は、上記図2の演算部34におけるビット数の算出方法の具体例を示した図である。図11の例では、30[fps]で入力される被符号化フレーム信号101に対して、15[fps]のフレームレートで符号化が実施されている。この例においても、上記図37と同様に、入力される被符号化フレーム信号101を「入力画像フレーム番号1701」で表し、符号化フレーム信号121を「フレーム群フレーム番号1102」で表している。図11において、フレーム群フレーム番号1102及び発生ビット数Nn131の欄が「×」となっているのは、対応する入力画像フレーム番号1701のフレームについては符号化がされず、「間引き」されたことを表す。
【0069】
さらに、図11において、例えば入力画像フレーム番号「9」(すなわち、フレーム群フレーム番号「5」)に対する発生ビット数の目標値は、既に割り当てられたビット数の合計が1180[ビット]で、残りのフレーム数は「11」であるため、((3600−1180)/11=220[ビット])となる。また、平均フレームビット数導出部33における過去のフレームにおける発生ビット数の平均値(1180/4=295[ビット])を算出し、演算部34において、発生ビット数の平均値に係数(例えば、0.8)を乗じ、これと上記のビット数の目標値とを比較して値の大きい方を選択する。その結果、フレーム群フレーム番号「5」に対する発生ビット数は、236[ビット]となる。
【0070】
一方、入力画像フレーム番号「13」(すなわち、フレーム群フレーム番号「6」)に対する発生ビット数は、入力画像フレーム番号「11」のフレームについては「間引き」されているため(従って、フレームレート値Rf21が7.5[fps]に変更され)、残りのフレーム数(フレームレート値Rf21を7.5[fps]で計算するので)「5」に基づいて計算する。さらに、計算された値に対して小数点以下を切り捨てるので、(3600−1416)/5=436[ビット]となる。また、平均フレームビット数導出部33における過去のフレームにおける発生ビット数の平均値(1416/5=383[ビット])を算出し、演算部34において、発生ビット数の平均値に係数(例えば、0.8)を乗じ、これと上記ビット数の目標値とを比較して値の大きい方を選択する。その結果、入力画像フレーム番号「13」に対する発生ビット数は、436[ビット]となる。
【0071】
図11と上記従来技術の図35におけるフレーム群フレーム番号「5」及び「6」の発生ビット数Nnを比較してみると、何れも本画像符号化装置10(すなわち、上記図11)における発生ビット数の方が大きな値となっており、より多くのビット数の割り当てができるため、従来より高品質な画像のための符号化が可能であることが明らかである。
【0072】
なお、上記図11の入力画像フレーム番号「29」に対応するフレーム群フレーム番号の欄に2つの数字が記載されているが、”(15)”は、入力画像フレーム番号が「9」の時点における、フレームレートが15[fps]の場合のフレーム群フレーム番号1102の予想値であり、”(10)”は、入力画像フレーム番号が「13」の時点における、フレームレートが7.5[fps]の場合のフレーム群フレーム番号1102の予想値である。
【0073】
なお、上記の実施の形態1では、フレーム間引部20を設け、フレーム間引部20から送信されるフレームレート値Rf21に基づいて、ビットレートの制御を行なうように構成したが、フレームレートの値はフレーム間引部以外から入手してもよい。
【0074】
図12は、上記図1におけるフレーム間引部20を設けず、その他の部署からフレームレート値Rf21の値を入手するように構成した画像符号化装置50の機能構成の一部を示したブロック図である。画像符号化装置50が上記図1の画像符号化装置10と異なる点は、フレーム間引部20がない点と全体制御部40に代えて全体制御部60を備えている点のみである。
【0075】
また、上記実施の形態における量子化ステップは、量子化パラメータと一意に対応するものであるため、当該量子化ステップを量子化パラメータに置き換えて用いることとしてもよい。
【0076】
以上のように、本実施の形態に係る画像符号化装置によれば、符号化のフレームレートの変化に対応させながらより割り当てるビット数を決定するので、画像の符号化が困難か否かに関わらず平均的に良好な画質を確保し、極端に動きがぎこちなくなったり画質が劣悪になったりすることを回避することができる。
【0077】
さらに、上記実施の形態1で示した画像符号化装置によって符号化されたビットストリームは、一般的な画像復号化方法によって復号可能である。また、本実施の形態1による符号化を行なったストリームは画像の複雑さに伴って各フレームの量子化ステップが変動するが、その変動は極端なものではなく、画面内符号化フレームから画面内符号化フレームの直前までのフレームで構成されるフレーム群において、発生ビット数をほぼ一定にすることが可能となる。
【0078】
なお、上記の実施の形態1では、各フレーム群の符号化に要する周期を「TA」として同一としたが、同一とする場合に限るものではなく、各フレーム群の符号化に要する時間が異なっていてもよい。
【0079】
また、上記の実施の形態では、平均フレームビット数導出部で算出されたビット数の平均値にのみ所定の係数(例えば、0.8)を乗じ、これと次フレーム目標ビット数導出部で算出されたビット数の目標値とを比較して値の大きい方のビット数を選択するように構成したが、これら両方に所定の係数を乗じて比較するように構成してもよい。
【0080】
(実施の形態2)
図13は、実施の形態2における画像符号化装置2100の機能構成を示すブロック図である。画像符号化装置2100は、上記実施の形態1の図5に示すように従来の2倍の数のフレームから構成される一かたまりのフレーム群を考慮しながら、量子化ステップやフレームの間引きを制御することにより、急激なビットレートやフレームレートの変動を抑制しつつ、高画質な符号化を可能とする。
【0081】
画像符号化装置2100は、フレーム間引部2101、フレームメモリ102、動き検出部103、動き補償部104、直交変換部105、量子化部106、可変長符号化部107、送信バッファ2108、逆量子化部2109、逆直交変換部2110、差分器2111、加算器2112およびフレームレート制御部2113を備える。
【0082】
フレーム間引部2101は、基準となるフレームレート(例えば、30Hz)で入力される画像信号の各フレームに対して、フレームレート制御部2113から入力される間引き情報に従って間引き処理を行ない、間引きされた画像信号を動き検出部103および差分器2111に出力する。例えば、フレームレート制御部2113からフレーム間引部2101に入力される間引き情報の値が「1」のときは、間引きをしないでそのまま符号化を行なう指示を示し、値が「0」のときは、1フレーム間引きを行なって符号化を行なう指示を示すこととする。つまり、フレーム間引部2101は、間引き情報が「1」のときは、画像信号として入力されたフレームをそのまま被符号化フレームとして動き検出部103および差分器2111に出力する。逆に、間引き情報が「0」のときは、入力されたフレームを間引く(例えば、廃棄する)という処理を行なう。
【0083】
フレームメモリ102は、RAM又はハードディスク等によって実現され、フレーム単位で画像データを保持するための記憶装置である。さらに、フレームメモリ102は、次の画面間予測符号化フレームの参照画像となる参照フレームデータを格納する。動き検出部103は、入力された被符号化フレームが画面間予測符号化を行なうフレームの場合、フレームメモリ102に格納された参照フレームデータを用いて、被符号化フレームの動きを検出する。動き補償部104は、動き検出部103によって検出された動きに対応する動き補償データを生成する。この動き補償データは、参照フレームと被符号化フレームとのブロック間の対応を示す動きベクトル、およびその動きベクトルによって示されるブロック間の画像信号の差分を示すデータである。
【0084】
差分器2111は、被符号化フレームが画面間予測符号化を行なうフレームの場合、被符号化フレームの動きベクトルと動き補償部104とによって生成された動き補償データに基づく動きベクトルとの差分を求める。一方、被符号化フレームが、画面内予測符号化を行なうフレームの場合、差分器2111は、入力された画像信号に対して参照フレームとの差分を求める処理を行わず、画面内で予測を行なった後、直交変換部105に画像信号を出力する。
【0085】
直交変換部105は、動き補償部104において生成された動き補償データをDCT(Discrete Cosine Transform)変換などによって周波数成分を表すデータに直交変換し、その変換結果を量子化部106に出力する。量子化部106は、フレームレート制御部2113から入力される量子化ステップを用いて直交変換されたデータを量子化し、その量子化された結果を可変長符号化部107および逆量子化部2109に出力する。可変長符号化部107は、量子化部106による量子化されたデータを、ハフマン符号などを用いて可変長符号化する。可変長符号化部107で可変長符号化されたデータは、送信バッファ2108に格納され、符号化ビットストリームとして出力される。
【0086】
送信バッファ2108は、RAMなどによって実現されるFIFO(First−InFirst−Out)メモリである。この送信バッファ2108は、例えば、上記実施の形態1の図5に示されるように、複数のフレームから構成されるフレーム群に割り当てられた総ビット数を記憶すると共に、内部のデータ残量または空き容量をモニタしており、可変長符号化されたデータが送信バッファ2108に送信された時点で、即ち1フレーム分の画像信号の符号化が完了した時点で、送信バッファ2108のデータ残量をフレームレート制御部2113に送信する。
【0087】
逆量子化部2109は、予測画像を生成するために量子化部106によって量子化されたデータを逆量子化し、逆直交変換部2110に出力する。逆直交変換部2110は、逆量子化部2109によって逆量子化されたデータを逆直交変換する。加算器2112は、逆直交変換部2110によって逆量子化されたデータと動き補償部104において生成された動き補償データとを加算してフレームメモリ102に出力する。フレームレート制御部2113には、送信バッファ2108から当該送信バッファ2108内のデータ残量が入力される。フレームレート制御部2113は、送信バッファ2108内のデータ残量に応じた量子化ステップを算出して量子化部106に出力すると共に、算出された量子化ステップに応じたフレームレートを計算し、次のフレームを間引くか否かを示す間引き情報を決定してフレーム間引部2101に出力する。ここで、「量子化ステップ」とは、各フレームの周波数成分を量子化する際の基準となる値(幅)であり、例えば「1」から「31」までの自然数(これを「量子化パラメータ」という)によって特定される。この量子化パラメータは、量子化ステップに1対1で対応しており、その数値が大きくなればなるほど、量子化の幅が大きくなるように定義されている。以下では、この量子化パラメータを「量子化ステップ」として説明する。
【0088】
図14は、上記図13におけるフレームレート制御部2113の詳細な機能構成を示すブロック図である。フレームレート制御部2113は、量子化ステップ予測部2201、フレームレート計算部2202、量子化ステップ決定部2203、フレーム数計算部2204および比較器2205を備える。量子化ステップ予測部2201は、送信バッファ2108から入力されたデータ残量に応じて現時点の量子化ステップに対して所定の演算を施し、量子化ステップ予測値を算出してフレームレート計算部2202および量子化ステップ決定部2203に出力する。 量子化ステップ決定部203は、量子化ステップ予測部201から入力された量子化ステップ予測値に最も近い「1」から「31」までの自然数を1つ選択し、選択した自然数を次の量子化ステップに決定する。具体的には、入力された量子化ステップ予測値が小数点以下の値を含む場合には、四捨五入、切捨てまたは切り上げなどの丸め処理を行なう。この場合、その値が「1」未満の場合には「1」を選択し、「31」を超える場合には「31」を選択する。
【0089】
フレームレート計算部2202は、送信バッファ2108から入力されたデータ残量と、量子化ステップ予測部201から入力された量子化ステップ予測値とに基づいて、現在のフレームレートから次の符号化の際における最適フレームレートを計算する。フレーム数計算部204は、比較器205から出力される間引き情報に基づいて、現在のフレームレートを計算する。比較器205は、フレームレート計算部202の出力である最適フレームレートと、フレーム数計算部204の出力である現在のフレームレートとを比較して、最適フレームレートが現在のフレームレートより大きい場合は、間引きしない旨の指示を示す「1」を間引き情報として出力する。一方、最適フレームレートが現在のフレームレートより小さい場合は、間引きを行なう旨の指示を示す「0」を間引き情報として出力する。
【0090】
図15は、上記図14における量子化ステップ予測部201の機能を説明するためのブロック図である。図15(a)は、量子化ステップ予測部201内の量子化ステップ予測方法を図式的に示す図である。図15(b)は、量子化ステップ予測部201に保持されている予測係数テーブル303を示す図である。量子化ステップ予測部201は、図15(a)に示す現在値メモリ2302と、図15(b)に示す予測係数テーブル2303とを保持している。現在値メモリ302は、符号化開始時においては量子化ステップの初期値を保持しており、符号化開始後には量子化ステップ予測部201によって算出された量子化ステップ予測値を保持する。予測係数テーブル303は、送信バッファ2108のデータ残量と予測係数とが対応付けられて格納されており、量子化ステップ予測部201は、送信バッファ2108から入力されるデータ残量に対応する予測係数を現在値メモリ302に保持している現在の量子化ステップ予測値に乗算して、次のフレームの量子化ステップ予測値を算出する。
【0091】
図15(a)および図15(b)に示されるように、予測係数は、送信バッファ2108内のデータ残量が50%以上80%未満では「1.2」に、80%以上90%未満では「1.5」に、90%以上100%以下では「2」というように、送信バッファ2108内の空き容量が少なくなるほど、その値を大きくして符号化されるデータのビット量が低減するように設定される。また、予測係数は、送信バッファ2108のデータ残量が40%以上50%未満では、そのままの量子化ステップを維持するように「1」に設定される。上記とは逆に、予測係数は、送信バッファ2108のデータ残量が30%以上40%未満の場合は「0.8」に、20%以上30%未満の場合は「0.5」に、0%以上20%未満の場合は「0.4」というように設定される。つまり、予測係数は、送信バッファ2108内の空き容量が多くなるほど、符号化されるデータのビット量が大きくなるように(即ち、量子化ステップを小さくして量子化をきめ細かく行ない、画質の品質を高めるように)設定される。
【0092】
例えば、現在値メモリ302内の量子化ステップ予測値が「7.5」で、送信バッファ2108内のデータ残量が75%であったとすると、次のフレームでは、現在値メモリ302内の量子化ステップ予測値「7.5」に予測係数「1.2」が乗算され、そのフレームに対する量子化ステップ予測値は「9」となる。算出された量子化ステップ予測値「9」は、量子化ステップ予測部2201によって現在値メモリ2302に上書きされる。この量子化ステップ予測値「9」は、「1」から「31」までの自然数であるから、量子化ステップ決定部2203によって当該フレームに対する量子化ステップとして決定される。当該フレームが量子化ステップ「9」で量子化された後、さらに次のフレームにおいても送信バッファ2108のデータ残量が70%であった場合は、現在値メモリ2302内の量子化ステップ予測値「9」には予測係数「1.2」が乗算され、次の量子化ステップ予測値は「10.8」となる。量子化ステップ決定部203が小数以下を四捨五入して量子化ステップを決定するとすると、その次のフレームは量子化ステップ「11」で量子化されることになる。このように予測係数を設定することによって、送信バッファ2108内のデータ残量が50%以上になると、量子化ステップが増大するので符号化される画像の画質が徐々に荒くなり、符号化されるデータのビット量を徐々に低減させることができる。一方、送信バッファ2108内のデータ残量が40%未満になると、量子化ステップが減少するのでデータのビット量は徐々に増大するが、符号化される画像の画質を徐々に向上させることができる。
【0093】
図16は、上記図14におけるフレームレート計算部2202の機能を説明するためのブロック図である。フレームレート計算部202は、送信バッファ2108のデータ残量と、量子化ステップ予測値とに基づいて最適フレームレートを計算する部署であり、比較器2401、比較器2402、フレームレートテーブル2403、閾値メモリ2404、閾値メモリ2405および空き容量算出部2406を備える。閾値メモリ2404および閾値メモリ2405は、ラッチ回路またはRAMなどによって実現される。比較器2401には、量子化ステップ予測部2201の出力である量子化ステップ予測値と、閾値メモリ2404に保持されている閾値Bとが入力される。比較器2401は、この2入力を比較し、例えば量子化ステップ予測値が閾値Bを超えると出力D1として「1」を、量子化ステップ予測値が閾値B以下であれば出力D1として「0」を出力する。比較器2402には、空き容量算出部2406において算出された送信バッファ2108の空き容量と、閾値メモリ2405に保持されている閾値Cとが入力される。比較器2402は、この2入力を比較し、例えば送信バッファ2108の空き容量が閾値Cを超えると出力D2として「1」を、空き容量が閾値C以下であれば出力D2として「0」を出力する。フレームレートテーブル2403は、比較器2401の出力D1と、比較器2402の出力D2との組み合わせに対応した最適フレームレートを示すテーブルである。閾値メモリ2404は、予め設定された、量子化ステップ予測値の閾値Bを保持している。閾値メモリ2405は、予め設定された、送信バッファ2108の閾値Cを保持している。空き容量算出部406は、送信バッファ2108の全データ容量と、送信バッファ2108から入力されるデータ残量とに基づいて、送信バッファ2108の現在の空き容量を算出する。
【0094】
具体的には、フレームレート計算部2202は、フレームレートテーブル2403に従って、符号化対象のフレームに対する最適フレームレートを計算する。例えば、送信バッファ2108の空き容量が閾値Cを超え、かつ、量子化ステップ予測値が閾値B以下である場合、すなわち、量子化ステップが小さい値にも拘らず、送信バッファ2108に余裕がある場合、フレームレートが最大になるよう最適フレームレートを(例えば、30Hzに)決定する。逆に、送信バッファ2108の空き容量が閾値C以下で、かつ、量子化ステップ予測値が閾値Bを超える場合、すなわち、量子化ステップが大きくなっているにも拘らず、送信バッファ2108に余裕がない場合、フレームレートが最小になるよう最適フレームレートを、(例えば、10Hz)に決定する。さらに、送信バッファ2108の空き容量と量子化ステップ予測値の何れもが閾値より大きいか、又は何れもが閾値以下の場合、フレームレートが中間の値になるよう、最適フレームレートを決定する。
【0095】
図17は、上記図16におけるフレームレート計算部2202の各入力信号および出力信号の一例を示す図である。図17(a)は、フレームレート計算部2202の出力信号である最適フレームレートを示す図である。図17(b)は、フレームレート計算部202の一方の入力信号である量子化ステップ予測値を示す図である。図17(c)は、フレームレート計算部202の他方の入力信号である送信バッファ2108の空き容量を示す図である。この空き容量は、正確には、入力されたデータ残量から空き容量算出部2406によって算出されたものである。図17(b)の曲線L1は、時間の経過に伴って量子化ステップ予測値が変化する様子を示し、図17(c)の曲線L2は、送信バッファ2108の空き容量の時間変化を示している。図17(b)のように、量子化ステップ予測値が閾値B以下の間、比較器2401は、D1=0を出力し、量子化ステップ予測値が閾値Bを越えると、比較器2401はD1=1を出力する。また、量子化ステップ予測値が再び閾値B以下となると、比較器401はD1=0を出力する。一方、図17(c)のように、送信バッファ2108の空き容量が閾値C以下の間、比較器2402はD2=0を出力し、空き容量が閾値Cを超えると、比較器2402はD2=1を出力する。また、空き容量が再び閾値C以下となると、D2=0を出力する。
【0096】
フレームレート計算部2202が保持するフレームレートテーブル2403には、比較器2401の出力D1の値「0」または「1」と、比較器2402の出力D2の値「0」または「1」との4通りの組み合わせに対応して4種類のフレームレートが記述されている。フレームレート計算部2202は、D1=0(量子化ステップ予測値が小さい)かつD2=0(空き容量が少ない)の間は、図17(a)のように、最適フレームレートとして20Hzを出力する。また、図17(b)および図17(c)に示されるように、曲線L1で示される量子化ステップ予測値の方だけが閾値Bを越えた場合、すなわち、D1=1(量子化ステップ予測値が大きい)かつD2=0(空き容量が少ない)の間は、フレームレート計算部2202は、最適フレームレートとして15Hzを出力する。続いて、量子化ステップ予測値および空き容量の両方ともが閾値を超えると、すなわち、D1=1(量子化ステップ予測値が大きい)かつD2=1(空き容量が多い)の間、フレームレート計算部は、2202は、量子化ステップを小さく制御するために、最適フレームレートとして20Hzを出力する。さらに、量子化ステップ予測値の方だけが閾値B以下となった場合、すなわち、D1=0(量子化ステップ予測値が小さい)かつD2=1(空き容量が多い)の間、フレームレート計算部202は最適フレームレートとして30Hzを出力する。このように、フレームレート計算部202は、量子化ステップ予測値と送信バッファ2108の空き容量とに応じて(ここでは4段階ではあるが)、徐々にフレームレートを増減を行なう。
【0097】
図18は、上記図14に示したフレーム数計算部204の動作を説明するための図である。図18(a)は、比較器2205から出力される間引き情報の一例を示す図である。図18(b)は、フレーム数計算部2204の詳細な構成を示すブロック図である。図18(a)に示すように、フレーム数計算部2204には、比較器2205から出力された間引き情報が30Hzで入力される。この間引き情報は、「0」または「1」の2値信号である。間引き情報の「0」は、当該フレームが間引きされたことを示し、間引き情報の「1」は当該フレームが符号化されたことを示している。図18(b)のフレーム数計算部2204は、比較器2205から出力された間引き情報に基づいて現在のフレームレートを計算し、計算結果を所定の周期(例えば、5Hz)で出力を行なう処理部または回路である。このフレーム数計算部2204は、間引き情報メモリ2601、カウンタ2602および演算器2603を備える。間引き情報メモリ2601は、先入れ先出しで保持するFIFO(first_in first_out)のメモリ装置であり、30Hzで入力される1ビットの間引き情報を現フレームから遡って30フレーム分保持する。カウンタ2602は、所定の周期(例えば、5Hz)で間引き情報メモリ2601内の直近の間引き情報が「1」のフレーム数mと、間引き情報が「0」のフレーム数nとをカウントし、次の周期(例えば、1/5秒後)にmとnの値をリセットする。演算器2603は、上記所定の周期で「m/(m+n)」を計算し、その結果を現フレームレートとして出力する。これにより、フレーム数計算部2204が、例えば1秒間に5回の現フレームレートを計算して出力した場合は、0.2秒毎により適切な量子化ステップを算出することが可能となる。
【0098】
フレームレート制御部2113の比較器2205は、フレーム数計算部2204によって計算された現フレームレートと、フレームレート計算部2202によって計算された最適フレームレートとを比較して、最適フレームレートが現在のフレームレート以上であれば、符号化の指示を示す「1」を間引き情報として出力する。一方、最適フレームレートが現在のフレームレート未満であれば、間引きの指示を示す「0」を間引き情報として出力する。この結果、被符号化フレームのフレームレートは、フレームレート計算部2202によって算出された最適フレームレートに等しくなる。即ち、本画像符号化装置2100は、送信バッファ2108の空き容量に応じて量子化ステップの制御を行なうので、送信バッファ2108の空き容量の時間変化をより緩和して量子化ステップを制御した場合、即ち、量子化ステップ予測値と送信バッファ2108の空き容量とに応じてフレームレートを徐々に増減させて符号化を行なった場合は、急激な画像の劣化を回避することが可能となる。
【0099】
図19は、画像符号化装置2100における入力画像信号と被符号化フレームの概要を説明するための図である。図19(a)は、画像符号化装置2100に入力される画像信号の各フレームを示す図である。図19(a)に示すように、画像符号化装置2100は、上記実施の形態1の図5の場合と同様に、2つのフレームセットで1つのフレーム群2604を構成し、このフレーム群2604を上記量子化ステップやフレームレートを決定する際の1単位とする。図19(b)は、画像符号化装置2100によって符号化された各被符号化フレームを示す図である。
【0100】
図19(a)に示すように、画像符号化装置2100に入力される画像信号には符号化が容易なシーンと符号化が困難なシーンとが含まれており、符号化が容易なシーンでは符号化されたデータの発生ビット量は少なくなる。一方、符号化が困難なシーンでは符号化されたデータの発生ビット量が増加する。例えば、時刻aに符号化が困難なシーンが画像符号化装置2100に入力されたとすると、符号化が困難なシーンの最初のフレームの符号化による発生ビット量が多いために送信バッファ2108の空き容量が少なくなり、量子化ステップ予測部2201ではこの空き容量に応じて量子化ステップ予測値が増大される。例えば、量子化ステップ予測部2201によって予測された量子化ステップ予測値が、直前フレームに対応する量子化ステップ予測値の1.5倍に大きくされる。これにより、次のフレームの符号化による発生ビット量が抑制される。この結果、符号化による発生ビット量は当初の量子化ステップを用いて量子化した場合ほど大きくならず、送信バッファ2108の空き容量も、急激に低下することはない。従って、従来では連続的に大幅なフレーム間引きが必要になる場合であっても、画像符号化装置2100では、より緩やかにフレームレートを低減することができる。
【0101】
それでもなお、上記送信バッファ2108の空き容量が低下して閾値C以下になった場合、フレームレート計算部202は最適フレームレートを1段階低いフレームレートに変更する。例えば、時刻aまで30Hzのフレームレートで符号化していた場合、フレームレート計算部2202は、次のフレームからの最適フレームレートを20Hzに変更する。このように、量子化ステップを大きくし、フレームレートを小さくしても、なおかつ送信バッファ2108の容量に余裕がなく、量子化ステップ予測値がさらに大きくなり、閾値Bを超えた場合、フレームレート計算部2202は、次の最適フレームレートをさらに1段階低いフレームレートに変更する。例えば、時刻bまで20Hzのフレームレートで符号化していた場合、フレームレート計算部2202は次の最適フレームレートを15Hzに変更する。
【0102】
このように、画像符号化装置100は、符号化が困難なシーンが入力された場合でも、符号化による発生ビット量に応じて量子化ステップ予測値を算出すると共に、その量子化ステップ予測値を最適フレームレートに反映することができるので、より穏やかに段階的にフレームレートを低減していくことができる。逆に、入力される画像信号において、例えば、時刻cで、符号化が困難なシーンから符号化が容易なシーンに切り替わった場合にも、まず量子化ステップを小さくすることにより、できるだけ高画質に符号化を行ない、それでもさらに送信バッファに余裕ができた(符号化が容易なシーンである)場合には、フレームレートを1段大きな値に変更するので、より穏やかに段階的にフレームレートを増加することができる。例えば、時刻cにおいて符号化が容易なシーンが入力され、量子化ステップを小さくしてもなお、送信バッファ2108に余裕ができた場合は、時刻dにおいてフレームレートを1段上の20Hzに変更し、時刻eにおいて量子化ステップが十分小さな値になった場合には、フレームレートをもう1段上の30Hzに変更するので、より穏やかにフレームレートを増加することができる。この結果、画像符号化装置100によって符号化された画像信号を復号化装置で復号化した場合、符号化が困難なシーンでも、急激に画像が荒くなったり急激に動きがぎこちなくなったりすることなく動画像を再生することができる。逆に、符号化が容易なシーンに切り替わった場合でも、急激に画像の濃淡が滑らかになったり、急激に動きが滑らかになったりすることなく、人の目に不自然さを感じさせずにより画質の高い画像を再生することができる。
【0103】
以上のように、本実施の形態の画像符号化装置2100によれば、所定の時間長(例えば、1秒間)で観測した場合のビットレートを一定に保ちながら、バッファに十分空きがある場合は低い量子化ステップで符号化することで、従来よりも高画質に符号化することができ、かつ複雑なシーンへ移行した場合のフレームレートの急激な低下(多くのフレームが符号化されずスキップされること)を抑制し、従来よりも動きの滑らかな符号化を行なうことができる。
【0104】
なお、上記の実施の形態において、フレームレート計算部2202は、送信バッファ2108のデータ残量と、量子化ステップ予測部2201の量子化ステップ予測値とを用いて最適フレームレートを計算することとしたが、本発明はこれに限定されず、何れか一方を用いて計算してもよい。また、フレームレート計算部2202は、上記図16に示したフレームレートテーブル2403を用いて、30Hz、20Hz、15Hzおよび10Hzの4段階の最適フレームレートを計算することとしたが、最適フレームレートはこの値に限定されず、また、4段階である必要もない。さらに、このようなフレームレートテーブルを用いて最適フレームレートを計算する必要もなく、例えば、送信バッファの空き容量が閾値C以上である場合は最適フレームレートを現フレームレートの2倍にし、閾値C未満の場合は現フレームレートの1/2倍にするというように計算してもよい。また、もう1つの閾値D(C<D)を設け、送信バッファの空き容量が閾値C以上である場合は最適フレームレートを現フレームレートの2倍にし、閾値D未満の場合は現フレームレートの1/2倍にするというように計算してもよい。このようにすることによって、閾値Cおよび閾値Dのそれぞれの近傍におけるわずかな送信バッファのデータ残量の変化に対して、最適フレームレートがその都度変更されることを防止することができる。また、最適フレームレートは、量子化ステップ予測値の変化に対しても、これと同様の計算を行なって求めてもよい。さらに、最適フレームレートは現フレームレートの1/2倍、2倍といった値に限定されるものではない。以下の実施の形態においても同様である。
【0105】
また、上記の実施の形態においては、量子化ステップ予測部2201は、上記図15に示した予測係数テーブル2303によって量子化ステップ予測値を計算する場合について説明したが、本発明の量子化ステップ予測方法はこれに限定されず、予め定めた関数を用いて計算するとしてもよい。さらに、予測係数テーブル2303内の量子化ステップの予測係数も、「2」「1.5」「1.2」「1」「0.8」「0.5」「0.4」という値に限定されない。以下の実施の形態においても同様である。
【0106】
なお、本実施の形態2のフレーム数計算部2204は、過去1秒間(即ち、30フレーム分)の間引き情報を格納するための間引き情報メモリ2601を備えることとしたが、本発明はこれに限定されない。また、現フレームレートの計算方法も、上記計算方法に限定されず、他の方法を用いてもよい。以下の実施の形態においても同様である。
【0107】
また、上記送信バッファのデータ残量に代えて、平均ビットレートとしてもよい。以下の実施の形態においても同様である。
【0108】
以下では、上記のフレームレート制御部2113の変形例のフレームレート制御部2800、3000及び3400について説明する。なお、以下の変形例では、上記のフレームレート制御部2113同一の構成についてはその説明は省略し、異なる点について重点的に説明することとする。
【0109】
図20は、変形例のフレームレート制御部2800の機能構成を示すブロック図である。フレームレート制御部2800は、量子化ステップ予測部2201、量子化ステップ決定部2203、フレームレート計算部2202、フレーム数計算部2204および比較器2205を備える。フレームレート制御部2800が上記図14に示したフレームレート制御部2113と異なる点は、フレームレート計算部2202に量子化ステップ予測部2201の量子化ステップ予測値が入力される代わりに、量子化ステップ決定部2203によって決定された量子化ステップが入力される点である。
【0110】
図21は、上記図20におけるフレームレート計算部2202の各入力信号および出力信号の一例を示す図である。図21(a)は、フレームレート計算部2202の出力信号である最適フレームレートを示す図である。図21(b)は、フレームレート計算部2202の一方の入力信号である量子化ステップを示す図である。図21(c)は、フレームレート計算部2202の他方の入力信号である送信バッファ2108の空き容量を示す図である。量子化ステップ決定部2203は、量子化ステップ予測部2201において求められた量子化ステップ予測値に基づいて、「1」から「31」までの整数値を決定し、決定した値を量子化ステップとして出力する。従って、図21(b)のように、フレームレート制御部2800に入力される量子化ステップは、量子化ステップ予測値と異なり、最大でも「31」である。
【0111】
このように、フレームレート計算部2202は、量子化ステップ予測値の代わりに、量子化ステップ決定部2203からの出力である量子化ステップに基づいて最適フレームレートを計算することによって、実際の符号化による発生ビット量から大きくかけ離れることなく最適フレームレートを算出することができる。
【0112】
図22は、変形例のフレームレート制御部3000の機能構成を示すブロック図である。フレームレート制御部3000は、量子化ステップ決定部2203で得られた量子化ステップから過去に符号化したフレームの平均量子化ステップを求め、求められた平均量子化ステップからフレームレート計算部2202の最適フレームレートの計算を行ない、量子化ステップ予測部2201、量子化ステップ決定部2203、平均量子化ステップ計算部3001、フレームレート計算部3002、フレーム数計算部2204および比較器2205を備える。平均量子化ステップ計算部3001は、過去1秒間の符号化に用いた量子化ステップの平均値を計算する。フレームレート計算部3002は、平均量子化ステップ計算部3001によって計算された量子化ステップの平均値と、送信バッファ2108の空き容量とから最適フレームレートを計算する。
【0113】
図23は、上記図22における平均量子化ステップ計算部3001の機能を説明するためのブロック図である。平均量子化ステップ計算部3001は、過去に符号化されたフレームについて量子化ステップの平均値の計算を行ない、量子化ステップメモリ3101、間引き情報メモリ3102、加算器3103および除算器3104を備える。量子化ステップメモリ3101は、量子化ステップ決定部2203の出力である量子化ステップの値を現フレームから1秒間遡って30フレーム分、先入れ先出しで保持するFIFOである。間引き情報メモリ3102は、比較器2205から出力される、各フレームに対応する間引き情報(即ち、例えば、1秒間に30フレームある場合は全部で30ビット)を、現フレームから1秒間遡って先入れ先出しで保持するFIFOである。加算器3103は、各フレーム毎に対応する間引き情報と量子化ステップとの乗算した結果を加算して(即ち、過去1秒間に符号化された全てのフレームの量子化ステップを合計し)、除算器3104に出力する。除算器3104は、加算器3103から入力される量子化ステップの合計を、過去1秒間に符号化されたフレームの数で除算して、量子化ステップの平均値を算出する。
【0114】
図24は、上記図22におけるフレームレート計算部3002の機能を説明するためのブロック図である。フレームレート計算部3002は、上記図16に示したフレームレートテーブル2403を保持しており、さらにヒステリシスコンパレータ3201、閾値メモリ3202、ヒステリシスコンパレータ3203、閾値メモリ3204および空き容量算出部2406を備える。ヒステリシスコンパレータ3201は、閾値メモリ3202から閾値α1、β1(β1<α1)が一方の入力端子に入力され、他方の入力端子に入力される平均量子化ステップが閾値α1を超えると、その後、平均量子化ステップが閾値β1以下になるまでD1=1を出力し、平均量子化ステップが閾値β1を超えても閾値α1を超えるまではD1=0を出力する比較器である。閾値メモリ3202は、閾値α1およびβ1を保持するラッチ回路またはメモリである。ヒステリシスコンパレータ3203は、閾値メモリ3204から閾値α2、β2(β2<α2)が一方の入力端子に入力され、他方の入力端子に入力される送信バッファ2108の空き容量がα2を超えるとD2=1を出力し、その後送信バッファ2108の空き容量がβ2以下となるまでD2=1を出力する。閾値メモリ3204は、閾値α2およびβ2を保持するラッチ回路またはメモリである。
【0115】
図25は、上記図22におけるフレームレート計算部3002の各入力信号および出力信号の一例を示す図である。図25(a)は、フレームレート計算部3002の出力信号である最適フレームレートを示す図である。図25(b)は、フレームレート計算部3002の一方の入力信号である平均量子化ステップを示す図である。図25(c)は、フレームレート計算部3002の他方の入力信号である送信バッファ2108の空き容量を示す図である。図25(b)に示すように、平均量子化ステップは「1」から「31」までの値をとるが、必ずしも各フレームの量子化ステップのように自然数ではなく、また、変化の度合いも緩やかで小さくなっている。フレームレート計算部3002が、このように入力されるヒステリシスコンパレータ3201の出力D1およびヒステリシスコンパレータ3203の出力D2の値に基づいて最適フレームレートを計算する方法はすでに説明した通りである。
【0116】
このように、フレームレート制御部3000は、量子化ステップ予測値の代わりに、平均量子化ステップ計算部3001からの出力である平均量子化ステップに基づいてフレームレートを制御することによって、量子化ステップの値が閾値付近で上下した場合に、1フレームごとにフレームレートが変更されてしまうことを防止することができる。
【0117】
なお、上記実施の形態では、平均量子化ステップ計算部3001において、過去1秒間に符号化されたフレームにおける量子化ステップの平均値を計算する実施例について説明したが、本発明はこれに限定されず、過去数秒間または過去数フレーム〜数十フレームについて量子化ステップの平均値を算出することとしてもよい。また、符号化されていないフレームも含めて、一律に過去の量子化ステップの平均値を計算するようにしてもよい。
【0118】
図26は、変形例のフレームレート制御部3400の機能構成を示すブロック図である。フレームレート制御部3400のフレームレート計算部3401は、比較器2401および比較器2402の代わりにヒステリシスコンパレータ3201およびヒステリシスコンパレータ3203を備え、上記実施の形態1におけるフレームレート計算部202と同様に、最適フレームレートを計算するが、さらに、過去1秒間に計算した最適フレームレートの平均値を求め、求めた平均フレームレートを最適フレームレートとする。
フレームレート制御部3400は、量子化ステップ予測部2201、量子化ステップ決定部2203、フレームレート計算部3401、フレームレートメモリ3402、フレーム数計算部2204および比較器2205を備える。フレームレート計算部3401は、ヒステリシスコンパレータ3201の出力D1およびヒステリシスコンパレータ3203の出力D2を入力して、フレームレートテーブル2403の規則(真理値表)に従って最適フレームレートを計算する。さらに、フレームレート計算部3401は、過去の複数の最適フレームレートの計算結果からその平均値を計算する。
【0119】
フレームレートメモリ3402は、フレームレート計算部3401の計算結果である最適フレームレートを、現フレームから1秒間遡った30フレーム分について、先入れ先出しで保持するFIFOである。
【0120】
図27は、上記図26におけるフレームレート計算部3401およびフレームレートメモリ3402の詳細な構成を示すブロック図である。フレームレート計算部3401は、フレームレートテーブル2403を保持しており、さらに、ヒステリシスコンパレータ3201、閾値メモリ3202、ヒステリシスコンパレータ3203、閾値メモリ3204、空き容量算出部2406、加算器3501および除算器3502を備える。フレームレート計算部3401は、入力される画像信号のフレーム毎に、量子化ステップ予測部2201から量子化ステップ予測値が入力されるヒステリシスコンパレータ3201の出力D1と、送信バッファ2108のデータ残量が入力されるヒステリシスコンパレータ3203の出力D2とに基づいて、フレームレートテーブル2403から最適フレームレートを算出し、算出された最適フレームレートを30Hzでフレームレートメモリ3402に出力する。加算器3501は、フレームレートメモリ3402内の各最適フレームレートを加算する。除算器3502は、加算器3501から出力された値を「30」で除算し、フレームレートテーブル2403を参照して、4段階の最適フレームレートの中から除算結果に最も近いフレームレートを平均最適フレームレートとして決定して出力する。この結果、最適フレームレートが、例えば、30Hz→10Hzと変化するような場合にも、平均最適フレームレートは、必ず30Hz→20Hz→15Hz→10Hzのように、中間のフレームレートを経由して順次変化するので、符号化におけるフレームレートの制御を、より滑らかに行なうことができる。
【0121】
図28は、上記図26におけるフレームレート計算部3401の各入力信号および出力信号の一例を示す図である。図28(a)は、フレームレート計算部3401の出力信号である平均最適フレームレートを示す図である。図28(b)は、フレームレート計算部3401の一方の入力信号である量子化ステップ予測値を示す図である。図28(c)は、フレームレート計算部3401の他方の入力信号である送信バッファ2108の空き容量を示す図である。図28(a)に示すように、平均最適フレームレートは、現フレームから1秒間遡って30フレーム分の最適フレームレートが平均化され、その値に最も近い最適フレームレートが選ばれているため、大きなフレームレートの変更が抑制され、その結果、より動きの滑らかな符号化結果を得ることができる。
【0122】
なお、本フレームレート計算部3401は、過去1秒間、30フレーム分の最適フレームレートの平均値を計算すると説明したが、本発明はこれに限定されず、平均値を求める最適フレームレートの範囲は過去何秒間または何フレーム分であってもよい。
【0123】
(実施の形態3)
図29は、実施の形態3における画像符号化装置4100の機能構成を示すブロック図である。画像符号化装置4100は、上記実施の形態1の画像符号化装置10における可変ビットレート方式と上記実施の形態2の画像符号化装置2100における可変フレームレート方式とを用いて、より適切な符号化を実現する。
【0124】
図29に示すように、画像符号化装置4100は、送信バッファ2108、フレームレート制御部4113およびフレーム間引部4116を除いて、上記実施の形態1における画像符号化装置10と同じ機能構成である。なお、以下において、上記実施の形態1又は実施の形態2における機能構成と同じものについては、同一の符番を付し、その説明は省略する。
【0125】
フレームレート制御部4113は、上記実施の形態2の画像符号化装置2100のフレームレート制御部2113の機能のうち、間引き情報を生成する機能のみを有している。
【0126】
フレーム間引部4116は、フレームレート制御部4113から間引き情報を受信してフレームレートを決定し、決定したその時点のフレームレート値をビットレート制御部30に通知する。
【0127】
図30は、上記図29におけるフレームレート制御部4113の詳細な機能構成を示すブロック図である。図30に示すように、フレームレート制御部4113は、上記実施の形態2におけるフレームレート制御部2113(上記図14参照)から量子化ステップ予測部2201および量子化ステップ決定部2203を除いた構成となっている。従って、このフレームレート制御部4113は、送信バッファ2108から入手したデータ残量に基づいて間引き情報のみを生成し、この間引き情報をフレーム間引部4116に送信する。
【0128】
以上のように、本実施の形態に係る画像符号化装置4100により、送信バッファのデータ残量によってフレームレートを制御すると共に、このフレームレートとフレーム群に割り当てられた総ビット数とに基づいて、より好適なビット割り当てを実現することが可能となる。
【0129】
(実施の形態4)
以下の実施の形態では、上記実施の形態1〜3における画像符号化装置の構成を画像符号化プログラムのステップとして実現し、上記画像符号化装置と同等の機能を一般的なコンピュータシステム上で実現するための方策について説明する。
【0130】
図31は、画像符号化プログラムを格納したフレキシブルディスクを用いて、上記実施の形態1〜3の画像符号化装置と同等の機能を一般的なコンピュータシステム上で実現する場合の説明図である。
【0131】
図31(b)は、フレキシブルディスクの正面から見た外観、断面構造及びフレキシブルディスクを示し、図31(a)は、記録媒体本体であるフレキシブルディスクの物理フォーマットの例を示している。
【0132】
フレキシブルディスク1301は、ケース1302に内蔵され、当該ディスクの表面には同心円状に外周から内周に向かって複数のトラックが形成され、各トラックは角度方向に16のセクタに分割されている。従って、前記画像符号化プログラムを格納したフレキシブルディスクでは、前記フレキシブルディスク1301上に割り当てられた領域に、前記画像符号化プログラムとしてのデータが記録されている。
【0133】
また、図31(c)は、フレキシブルディスク1301に前記画像符号化プログラムの記録再生を行なうための装置の構成を示す。前記画像符号化プログラムをフレキシブルディスク1301に記録する場合は、コンピュータシステム1304から画像符号化プログラムのデータをフレキシブルディスクドライブ1303を介して書き込む。また、フレキシブルディスク1301内のプログラムにより前記符号化あるいは復号化装置をコンピュータシステム中に構築する場合は、フレキシブルディスクドライブ1303からプログラムを読み出し、コンピュータシステム1304に転送する。
【0134】
なお、上記の説明ではデータ記録媒体としてフレキシブルディスクを用いて説明を行なったが、光ディスクやICカード、ROMカセット等、プログラムを記録できる媒体を用いることにより、同様に上記画像符号化装置を実現することができる。
【0135】
【発明の効果】
以上のように、本発明に係る画像符号化装置によれば、所定の時間長において一定のビットレートで符号化を行なう場合、フレームの集まりであるフレーム群における発生ビット数の偏りが少なくなるようにフレーム群を構成し、フレーム群における個々のフレームに対して符号化を行なう毎に、次のフレームに割り当てるべきビット数を計算する。さらに、過去のフレームにおける発生ビット数をも参照することで、次のフレームに対して高画質に符号化し得る最適な割当ビット数を導出することができる。つまり、符号化が困難なシーンが連続した場合であっても、その後のシーンに割り当てるビット数が極端に少なくなることを回避し、全体として画像の品質の向上を図ることが可能となる。
【0136】
また、本発明に係る画像符号化装置によれば、符号化されるフレームのレートが変動する(可変フレームレートの)場合においても、符号化を行なう毎にその時点のフレームレートを用いた最適なビット数を導出することが可能となるので、所定の時間長における平均ビットレートを一定に保ちつつ、画質の極端な劣化を回避し得る符号化を可能とする。
【0137】
また、本発明に係る画像符号化装置によって符号化されたビットストリームは一般的な復号化装置で復号が可能であり、特別な処理をまったく行なうことなく、高画質な復号が可能である。
【0138】
さらに、本発明に係る画像符号化装置によれば、現フレームを符号化した結果、発生した符号量に応じて、まず、量子化の幅を調節して各画素の信号解像度を調節することにより次フレームの発生符号量を制御し、量子化幅の調節による発生符号量の制御に応じて、符号化フレームレートを調節することができる。この結果、例えば、量子化幅を大きくすることによって十分、発生符号量が低減したにも拘らずフレーム間引きを発生させ、必要以上に画質を劣化させてしまうという状態の発生を未然に防止して、効率よく符号化による発生符号量を制御することができるという効果がある。
【0139】
また、本発明に係る画像符号化装置は、送信バッファの残留符号量から次符号化フレームの量子化幅を計算することにより、例えば、送信バッファに余裕がある場合(すなわち、符号化が容易なシーン)は量子化幅を小さな値とし、逆に送信バッファに余裕がない場合は量子化幅を大きな値とすることで、十分長い時間でのビットレートを一定に保ち、かつできるだけ高画質な符号化を行なうことができるという効果がある。
【0140】
さらに、本発明に係る画像符号化装置は、計算された量子化幅の予測値が閾値以上の大きな値となった場合(すなわち符号化が困難な複雑なシーンの場合)に符号化フレームレートを小さな値に変更して、フレームの間引き率を増加する。しかし、量子化幅の制御により発生ビット量が抑制されるので、急激なフレームレートの変化が生じない高画質な符号化を行なうことができるという効果がある。
【0141】
また、本発明に係る画像符号化装置によれば、送信バッファの残留符号量によって制御され変動する量子化幅の平均値を用いて符号化フレームレートを制御することによって、現フレームの符号化で極端に符号量が発生し(送信バッファの残留符号量が増加し)次フレームの量子化ステップが大きく制御された場合に、すぐにフレームレートの変更が行われることが抑制され、直後の画像の動きがぎこちなくなることを防止することができる。また同時に、フレームレートの急激な変更が行われることを抑制し、動きの滑らかな符号化を行なうことができるという効果がある。
【図面の簡単な説明】
【図1】実施の形態1における画像符号化装置の機能構成を示すブロック図である。
【図2】図1におけるビットレート制御部の詳細な機能構成を示すブロック図である。
【図3】一般的な画像符号化におけるピクチャタイプ別の発生ビット数の特徴を示す図である。
【図4】図3で定義したフレーム群の具体例である。
【図5】図3で定義したフレーム群の変形例である。
【図6】(a)は、上記図5のように2つのフレームセットでフレーム群を構成することによる効果を説明するための図である。(b)は、上記図5のように2つのフレームセットでフレーム群を構成し、かつ、符号化のフレームレートが変化した場合における効果を説明するための図である。
【図7】実施の形態1における画像符号化装置の全体制御部及びビットレート制御部における処理の流れを示すフローチャートである。
【図8】(a)は、実施の形態1における画像符号化装置を用いて符号化を実行する場合のフレーム群の構成例を示す図である。(b)は、実施の形態1における画像符号化装置を用いて符号化を実行する場合のビットレートの変化を示す一例である。
【図9】(a)は、2つのフレームセットで1つのフレーム群を構成させた場合の各フレームの様子を示した一例である。(b)は、2つのフレームセットで1つのフレーム群を構成させた場合のビットレートの変動の様子を示した一例である。
【図10】(a)は、2つのフレームセットで1つのフレーム群を構成させ、かつ、符号化のフレームレートが変化した場合の各フレームの様子を示した一例である。(b)は、2つのフレームセットで1つのフレーム群を構成させ、かつ、符号化のフレームレートが変化した場合のビットレートの変動の様子を示した一例である。
【図11】演算部におけるビット数の算出方法の具体例を示した図である。
【図12】図1においてフレーム間引部を設けず、その他の部署からフレームレート値Rfの値を入手するように構成した画像符号化装置の機能構成の一部を示したブロック図である。
【図13】実施の形態2に係る画像符号化装置の機能構成を示すブロック図である。
【図14】図13におけるレート制御部の詳細な機能構成を示すブロック図である。
【図15】図14における量子化ステップ予測部の機能を説明するためのブロック図である。
【図16】図14におけるフレームレート計算部の機能を説明するためのブロック図である。
【図17】図16におけるフレームレート計算部の各入力信号および出力信号を示す図である。
【図18】図14におけるフレーム数計算部の動作を説明するための図である。
【図19】画像符号化装置の入力画像信号と被符号化フレームとを示す図である。
【図20】変形例のフレームレート制御部の機能構成を示すブロック図である。
【図21】図20におけるフレームレート計算部の各入力信号および出力信号を示す図である。
【図22】変形例のフレームレート制御部の機能構成を示すブロック図である。
【図23】図22における平均量子化ステップ計算部の構成を示すブロック図である。
【図24】図22におけるフレームレート計算部の機能を説明するためのブロック図である。
【図25】図22におけるフレームレート計算部の各入力信号および出力信号を示す図である。
【図26】変形例のフレームレート制御部の機能構成を示すブロック図である。
【図27】図26におけるフレームレート計算部およびフレームレートメモリの機能を説明するためのブロック図である。
【図28】図26におけるフレームレート計算部の各入力信号および出力信号を示す図である。
【図29】実施の形態3における画像符号化装置の機能構成を示すブロック図である。
【図30】図29の画像符号化装置におけるフレームレート制御部の機能構成を示すブロック図である。
【図31】実施の形態1〜3における画像符号化装置を一般のコンピュータシステムによって実現するためのプログラムを格納し得る記憶媒体を説明するための図である。
【図32】従来の可変ビットレート方式を用いた画像符号化装置の機能構成を示すブロック図である。
【図33】従来の画像符号化装置におけるビットレート制御部の機能構成を示すブロック図である。
【図34】従来の画像符号化装置の全体制御部及びビットレート制御部における処理の流れを示すフローチャートである。
【図35】従来のビットレート制御部における割当ビット数の算出方法の具体例を示した図である。
【図36】(a)は、従来技術の第1の問題を説明するためのフレーム群の構成例である。(b)は、従来技術の第1の問題を説明するためのビットレートの一例である。
【図37】(a)は、従来技術の第2の問題を説明するためのフレーム群の構成例である。(b)は、従来技術の第2の問題を説明するためのビットレートの一例である。
【符号の説明】
10   画像符号化装置
20   フレーム間引部
30   レート制御部
31   フレーム群目標ビット数導出部
32   次フレーム目標ビット数導出部
33   平均フレームビット数導出部
34   演算部
35   量子化ステップ導出部
36   記憶部
40   全体制御部
50   画像符号化装置
60   全体制御部
100   画像符号化装置
101   被符号化フレーム信号
102   フレームメモリ
103   検出部
104   補償部
105   直交変換部
106   量子化部
107   可変長符号化部
108   逆量子化部
109   逆直交変換部
110   ビットレート制御部
111   フレーム群目標ビット数導出部
112   次フレーム目標ビット数導出部
113   量子化ステップ導出部
121   符号化フレーム信号
140   全体制御部
141   量子化ステップ
201   量子化ステップ予測部
202   フレームレート計算部
203   量子化ステップ決定部
204   フレーム数計算部
205   比較器
302   現在値メモリ
303   予測係数テーブル
401   比較器
406   容量算出部
1301   フレキシブルディスク
1302   ケース
1303   フレキシブルディスクドライブ
1304   コンピュータシステム
2100   画像符号化装置
2101   フレーム間引部
2108   送信バッファ
2109   逆量子化部
2110   逆直交変換部
2111   差分器
2112   加算器
2113   フレームレート制御部
2201   量子化ステップ予測部
2202   フレームレート計算部
2203   量子化ステップ決定部
2204   フレーム数計算部
2205   比較器
2302   現在値メモリ
2303   予測係数テーブル
2401   比較器
2402   比較器
2403   フレームレートテーブル
2404   閾値メモリ
2405   閾値メモリ
2406   容量算出部
2601   情報メモリ
2602   カウンタ
2603   演算器
2604   フレーム群
2800   フレームレート制御部
3000   フレームレート制御部
3001   平均量子化ステップ計算部
3002   フレームレート計算部
3101   量子化ステップメモリ
3102   情報メモリ
3103   加算器
3104   除算器
3201   ヒステリシスコンパレータ
3202   閾値メモリ
3203   ヒステリシスコンパレータ
3204   閾値メモリ
3400   フレームレート制御部
3401   フレームレート計算部
3402   フレームレートメモリ
3501   加算器
3502   除算器
4100   画像符号化装置
4113   フレームレート制御部
4116   フレーム間引部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image encoding technique and an image decoding technique, and more particularly, to an image encoding technique using a variable bit rate method or a variable frame rate method.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, a variable bit rate (Variable Bit Rate) method is one of methods for controlling a bit rate in an image coding technique such as the MPEG (Moving Picture Expert Group) standard. This is mainly because of the restriction of the capacity of the buffer memory for storing the encoded data and the restriction of the video recording time when recording on the recording medium, so that local bits associated with the complexity of the image to be encoded are limited. This is a control method in which the number of generated bits in a predetermined time length (for example, one second) is suppressed to a certain value while allowing a change in the rate. That is, in a scene where encoding is difficult, more bits for encoding are generated (bit rate is increased), and in a scene where encoding is easy, the number of generated bits is reduced (bit rate is decreased). Controls the number of bits to be allocated according to the scene. That is, encoding is performed so that a high-quality image can be reproduced while keeping the number of generated bits within a fixed time constant (that is, within the constraints of the buffer memory capacity and the recording time). (For example, see Patent Document 1).
[0003]
An image encoding device using the above-mentioned conventional variable bit rate method will be described with reference to an image encoding device 100 in FIG. The image encoding apparatus 100 includes an orthogonal transform unit 105, a quantization unit 106, a variable length encoding unit 107, an inverse quantization unit 108, an inverse orthogonal transform unit 109, a frame memory 102, a motion detection unit 103, and a motion compensation unit 104. And a bit rate control unit 110.
[0004]
The orthogonal transform unit 105 performs a discrete cosine transform (DCT) on the received encoded frame signal 101 (image signal data) in macroblock units, generates DCT coefficients, and sends the DCT coefficients to the quantization unit 106. Output. Here, for a frame of an I (Intra coded) picture, a DCT operation is performed in the intra-picture coding mode. For a frame of a P (Predictive coded) picture, a DCT operation is performed in a forward prediction coding mode based on an I picture or a P picture located in the past in time. For a B (Bidirectionally) picture frame, a DCT operation is performed in a bidirectional predictive coding mode based on an I picture or a P picture located temporally before and after.
[0005]
The quantization unit 106 quantizes the DCT coefficient input from the orthogonal transformation unit 105 at a quantization step (or a quantization parameter) received from the bit rate control unit 110 for each macroblock, and performs variable length. It outputs to encoding section 107 and inverse quantization section 108. The variable-length coding unit 107 performs variable-length coding and multiplexing on the quantized DCT coefficients and the like input from the quantization unit 106, and outputs the result to an output buffer (not shown).
[0006]
The inverse quantization unit 108 performs an inverse quantization operation on the quantized DCT coefficient received from the quantization unit 106, and outputs the result to the inverse orthogonal transform unit 109. The inverse orthogonal transform unit 109 performs an inverse orthogonal transform operation based on the inversely quantized DCT coefficient input from the inverse quantization unit 108 to reproduce image signal data, and outputs the image signal data to the frame memory 102.
[0007]
The frame memory 102 adds and stores the decoded image signal data of the I picture or the P picture and the motion compensation data generated by the motion compensation unit 104. The motion detection unit 103 detects a motion vector from the reference image stored in the frame memory 102 and outputs data representing the motion vector to the motion compensation unit 104.
[0008]
The motion compensation unit 104 performs motion compensation data (reference image data) based on a reference image stored in the frame memory 102 for encoding a P picture or a B picture and data representing a motion vector input from the motion estimation unit 103. ). The bit rate control unit 110 receives the number of generated bits from the variable length coding unit 107, determines a quantization step based on the number of generated bits, and transmits the quantization step to the quantization unit 106.
[0009]
The overall control unit 140 is, for example, a microcomputer including a ROM, a RAM, and the like, and is a unit that controls the entire image encoding device 100. The overall control unit 140 controls each processing timing based on a control signal and the like.
[0010]
FIG. 33 is a block diagram illustrating a functional configuration of the bit rate control unit 110 in the conventional image encoding device 100. As shown in FIG. 33, the bit rate control unit 110 includes a frame group target bit number deriving unit 111, a next frame target bit number deriving unit 112, and a quantization step deriving unit 113.
[0011]
The frame group target bit number deriving unit 111 receives the generated bit number Nn131 from the variable length coding unit 107 and stores it in an internal memory (not shown). At this time, the frame group target bit number deriving unit 111 counts the number of times the number of generated bits Nn131 has been received (that is, the number of encoded frames). Further, the frame group target bit number deriving unit 111 calculates the number of bits that can be allocated to a frame that has not yet been coded for each frame group, transmits the calculated bit number to the next frame target bit number deriving unit 112, The number of bits that can be allocated is sequentially updated using the number of generated bits Nn131 generated as a result. Here, the “frame group” refers to a group of frames that can be encoded with a predetermined time length.
[0012]
The next frame target bit number deriving unit 112 derives a target value of the number of bits to be allocated to the next frame based on the number of bits that can be allocated for each frame group received from the frame group target bit number deriving unit 111, and performs quantization. This is transmitted to the step derivation unit 113. The target value is calculated by dividing the number of bits that can be allocated for each frame group at that time by the number of remaining frames.
[0013]
The quantization step deriving unit 113 calculates a quantization step 141 (or a quantization parameter) based on the target value of the number of bits to be allocated to the next frame received from the next frame target bit number deriving unit 112 and performs quantization. Output to the conversion unit 106.
[0014]
FIG. 34 is a flowchart showing the flow of processing in the overall control unit 140 and the bit rate control unit 110 of the conventional image encoding device 100.
[0015]
First, when the bit rate control unit 110 receives the number of generated bits Nn131 (S1401), the overall control unit 140 determines whether the next frame to be encoded is the head of the frame group (S1402). In this case, if the next frame is the first frame of the frame group (S1402: Yes), the bit rate control unit 110 initializes the number Na of assignable bits, the assignment target period Ta, and the number Nt of assignment target frames. (S1405 to 1407). Here, “NA” is an initial value of the number of bits to be allocated for each frame group. “TA” is the period of the entire frame group. “Rf” is the frame rate of the encoding of the image encoding device 100.
[0016]
On the other hand, when the next frame is not the first frame of the frame group (S1402: No), the bit rate control unit 110 updates the number Na of assignable bits and the assignment target period Ta (S1403 to 1404).
[0017]
Next, the bit rate control unit 110 calculates the number Nb of bits to be allocated based on the number Na of bits that can be allocated and the number Nt of frames to be allocated (S1408), and updates (decrements) the number Nt of frames to be allocated (S1409). .
[0018]
Thereafter, the bit rate control unit 110 determines whether or not the frame to be coded needs to be decimated. If the decimation is necessary, the bit rate control unit 110 notifies the general control unit 140 of that (S1410: Yes). On the other hand, when it is not necessary to perform the thinning (S1410: No), a quantization step is calculated and output to the quantization unit 106 (S1411).
[0019]
The overall control unit 140 and the bit rate control unit 110 repeat the above processing until the encoding processing ends (S1401 to 1412).
[0020]
FIG. 35 is a diagram showing a specific example of a method of calculating the number of allocated bits Nb in the conventional bit rate control section 110. In this case, for convenience, it is assumed that the number of generated bits Nn131 and the number of allocated bits Nb match.
[0021]
In the example shown in FIG. 35, image signal data (encoded frame signal 101) input at 30 [fps] is encoded at a frame rate of 15 [fps], and is composed of 15 frames in principle. One frame group is generated every second. In this example, the input encoded frame signal 101 is represented by “input image frame number 1701”, and the encoded frame signal 121 is represented by “frame group frame number 1702”. In FIG. 35, the columns of the frame group frame number 1702 and the number of generated bits Nn131 are indicated by “x” because the corresponding frame of the input image frame number 1701 is not coded and is “decimated”. Represents
[0022]
Further, in FIG. 35, for example, the number of generated bits Nn with respect to the input image frame number “9” (that is, the frame group frame number “5”) is 1180 bits in total of the number of bits already allocated to four frames, and Is (11), so ((3600-1180) / 11 = 220 bits).
[0023]
On the other hand, the number of generated bits for the input image frame number “13” (that is, the frame group frame number “6”) is the sum of the already allocated bit numbers because the input image frame number “11” is “decimated”. Is 1400 bits, and the number of remaining frames is “9”, so the fractional part is rounded down to ((3600-1400) / 9 = 244 bits).
[0024]
Note that “(14)” described in the column of the frame group frame number 1702 corresponding to the input image frame number “29” in FIG. 35 is the last frame when the input image frame number 1701 is “13”. This is the expected value of the group frame number 1702.
[0025]
As described above, in the conventional image encoding device 100, bits are assigned to the next encoding target frame.
[0026]
[Patent Document 1]
JP 2001-25015 A
[0027]
[Problems to be solved by the invention]
However, in the image encoding apparatus 100 using the variable bit rate in the above-described conventional technology, when frames that are difficult to encode (complex) continue, even if the quantization step is changed to a large value, the encoding is performed. The number of generated bits increases (in this case, the value of the bit rate increases). Then, in order to keep the number of generated bits in a predetermined time length (one frame group) constant, the number of bits to be assigned to a frame after a series of difficult-to-encode frames decreases. For this reason, there is a first problem that the quantization step must be increased for the subsequent frames, and the image quality of those frames is extremely deteriorated. The rate will be significantly smaller).
[0028]
FIG. 36 is a diagram for explaining the first problem of the above-described conventional technology. In FIG. 36, 15 frames from a frame 1601 to a frame 1602 are defined as a frame group, and 3600 [bits] are assigned to each frame group as a target value (as shown in FIG. 35). In this case, if scenes that are difficult to encode continue from time t1 and a large number of bits are assigned to the encoding of those frames, the number of bits that can be assigned in the latter half of the frame group will decrease, so the quantization step Needs to be increased (the bit rate decreases accordingly), but when the quantization step is set to a large value, the image quality is extremely deteriorated. In FIG. 36, the quantization step is particularly large between “t3 and t4”, and it can be assumed that the image quality is degraded accordingly.
[0029]
Furthermore, when the number of bits that can be finally allocated becomes smaller and the frame rate must be changed in the middle of a frame group (that is, the frames must be thinned out), the number of bits can be increased even though the frame rate has changed. Since the number of bits allocated to one frame is determined based on the initial frame rate, it is not possible to allocate more bits in spite of lowering the frame rate, and further reducing the frame rate or performing a quantization step There is a second problem that it is necessary to make the roughness coarse, which further deteriorates the image quality.
[0030]
FIG. 37 is a diagram for explaining the second problem of the above-described conventional technology. In the example of FIG. 37, scenes that are difficult to encode continue, and many bits are allocated to the encoding of those frames. As a result, the frame rate gradually decreases, resulting in a large frame interval. This shows an image in which the movement is awkward, and the quality of the image is degraded.
[0031]
Therefore, the present invention has been made in view of the above-described problems, and even when a series of difficult-to-encode scenes continues, image quality degradation due to an extremely shortage of bits that can be allocated to the remaining frames. It is an object of the present invention to provide an image encoding apparatus and method capable of performing encoding for a high-quality image while also considering the change in the rate of a frame to be encoded.
[0032]
[Means for Solving the Problems]
In order to achieve the above object, an image encoding apparatus according to the present invention is an image encoding apparatus that encodes image signals sequentially input in frame units, wherein a frame rate indicating a cycle in which the encoding is performed Frame rate receiving means for receiving, a total bit number specifying means for specifying the total number of bits that can be allocated as a whole to a frame group composed of a plurality of frames, and Frame number specifying means for specifying the number of unencoded frames in the frame group based on the number of frames, based on the specified total number of bits and the specified number of frames, Target bit number calculating means for calculating a target value of the number of bits to be allocated to the frame to be encoded, and Using a target value of the number of bits, a quantization step deriving unit that derives a quantization step for a frame to be encoded next, performs quantization based on the derived quantization step, and performs the quantization. Encoding means for performing encoding based on the information.
[0033]
With this, the number of bits to be allocated to the next frame to be encoded is calculated based on the total number of bits allocated to the entire frame group and the number of bits already allocated so that the frame group has a constant bit rate. Therefore, it is possible to avoid the case where the number of allocated bits is locally biased beforehand, and to perform averaged bit allocation, and ultimately to prevent extreme deterioration in image quality.
[0034]
In order to achieve the above object, the image encoding apparatus according to the present invention further includes an average value calculation unit that calculates an average value of the number of bits whose allocation is determined along with encoding of the frames in the frame group. Computing means for performing a predetermined operation on the calculated target value of the number of bits and the average value of the number of bits to specify a new target value of the number of bits, and deriving the quantization step. The means derives the quantization step using the target value of the number of bits specified by the calculating means.
[0035]
Accordingly, the number of bits to be allocated to the next frame to be encoded is determined based on the number of uncoded frames calculated from the received frame rate and the number of bits that can be allocated in the frame group. Coding according to the change in rate becomes possible.
[0036]
Further, in order to achieve the above object, the image encoding apparatus according to the present invention further comprises a storage unit for storing already coded but untransmitted data, and a data amount stored in the storage unit. A frame rate calculation unit for calculating a frame rate for a frame to be encoded next, based on the frame rate, and wherein the frame rate receiving unit receives the calculated frame rate.
[0037]
With this, while maintaining a constant bit rate when observed for a predetermined time length, if there is sufficient space in the buffer, encoding is performed with a low quantization step, so that encoding can be performed with higher image quality than before. It is possible to suppress a sharp decrease in the frame rate (that is, skip many frames without being encoded) when performing a transition to a complicated scene, and to perform encoding with smoother motion than before. Become.
[0038]
In order to achieve the above object, the present invention can be realized as an image coding method having the characteristic means of the image coding apparatus as steps, or as a program including these steps. it can. The program can be distributed not only in a ROM or the like included in the image encoding device but also in a recording medium such as a CD-ROM or a transmission medium such as a communication network.
[0039]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In the following description, the same reference numerals are given to the same components as those of the related art, and the description thereof will be omitted.
[0040]
(Embodiment 1)
FIG. 1 is a block diagram illustrating a functional configuration of an image encoding device 10 according to Embodiment 1. The image coding apparatus 10 suppresses local bit rate fluctuations while maintaining a constant bit rate when observation is performed for a predetermined time length (for example, one second), so that a higher quality image can be obtained. Enables encoding for reproduction.
[0041]
The image encoding device 10 includes a frame memory 102, a motion detection unit 103, a motion compensation unit 104, an orthogonal transformation unit 105, a quantization unit 106, a variable length encoding unit 107, an inverse quantization unit 108, an inverse orthogonal transformation unit 109, It comprises a frame thinning unit 20, a rate control unit 30, and an overall control unit 40.
[0042]
The frame thinning unit 20 determines encoding / non-encoding of the frame for the encoded frame signal 101 input at a constant cycle, and sends the frame rate value Rf21 at that time to the rate control unit 30. Notice.
[0043]
Based on the number of generated bits received from the variable length coding unit 107 and the frame rate value Rf21 notified from the frame thinning unit 20, the rate control unit 30 performs a quantization step (or The quantization parameter is determined and transmitted to the quantization unit 106.
[0044]
The overall control unit 40 is, for example, a microcomputer including a ROM, a RAM, and the like, and controls the entire image encoding device 10. More specifically, the overall control unit 40 controls the processing timing of each unit based on a control signal (the broken line in the overall control unit 40 in FIG. 1 represents a control signal line). Further, the overall control unit 40 identifies a picture type (identification of an I frame, a B frame, and a P frame) of the encoded frame signal 101 input at a constant cycle, and sends the identification result to the rate control unit 30. Notice.
[0045]
FIG. 2 is a block diagram showing a detailed functional configuration of the rate control unit 30 in FIG. The rate control unit 30 includes a frame group target bit number derivation unit 31, a next frame target bit number derivation unit 32, an average frame bit number derivation unit 33, a calculation unit 34, a quantization step derivation unit 35, and a storage unit 36. .
[0046]
The frame group target bit number deriving unit 31 sequentially calculates and updates the target value of the total number of bits that can be allocated to all the remaining frames to be encoded in frame group units. More specifically, the frame group target bit number deriving unit 31 receives the generated bit number Nn131 from the variable length coding unit 107 and stores it in the storage unit 36. Further, the frame group target bit number deriving unit 31 reads out the total number of bits that can be allocated from the next frame to be encoded to the last frame of the frame group from the storage unit 36, and calculates the number of generated bits from the total bit number. Nn 131 is subtracted, and its value is transmitted to the next frame target bit number deriving unit 32 and stored in the storage unit 36.
[0047]
The next frame target bit number deriving unit 32 calculates the remaining frames to be encoded based on the frame rate value Rf21 received from the frame thinning unit 20 and the allocatable total bit number received from the frame group target bit number deriving unit 31. , The target value of the number of bits to be allocated to the next frame is calculated.
[0048]
The average frame bit number deriving unit 33 calculates the average of the number of allocated bits based on the frame rate value Rf21 received from the frame thinning unit 20 and the number of bits allocated to past frames stored in the storage unit 36. Calculate the value.
[0049]
The calculation unit 34 calculates the number of bits obtained by multiplying the number of bits calculated by the average frame bit number derivation unit 33 by a predetermined coefficient (for example, 0.8). The calculated number of bits is compared with a target value, and the larger number of bits is selected. Further, the arithmetic unit 34 compares the selected number of bits with a preset lower limit, and selects a larger number of bits (that is, selects a number of bits not less than the lower limit). This is transmitted to the quantization step deriving unit 35. The above-mentioned predetermined coefficient is not limited to “0.8”, but may be another value larger than 0 and equal to or smaller than 1.
[0050]
The quantization step deriving unit 35 derives a quantization step value such that the number of bits received from the arithmetic unit 34 and the number of generated bits are equal.
[0051]
The storage unit 36 stores the number of generated bits Nn131 as a result of encoding each frame received from the variable length encoding unit 107. Further, the storage unit 36 updates the frame group target bit number under the control of the frame group target bit number deriving unit 31.
[0052]
FIG. 3 is a diagram showing general characteristics of the number of bits generated for each picture type in image coding. As shown in FIG. 3, usually, the frame (P or B picture) of the inter-picture coding (P picture or B picture) is obtained from the number of generated bits Nn in the frame of the intra-picture coding (I picture) (I frames 210 to 250). The number of generated bits Nn in the (B frame) is smaller. Therefore, when a frame group is defined based on another rule by defining a frame group from an I frame to the next I frame as one frame group (for example, a frame group is formed every 15 frames regardless of a picture type). Case), it is possible to reduce the deviation of the number of generated bits in each frame group. In the example of FIG. 3, for the sake of convenience, the time required for encoding each frame group is set to TA and the same period.
[0053]
It should be noted that the effect of reducing the deviation of the number of bits in each frame group can be obtained only by the first frame of the frame group being the above-described I frame or the last frame of the frame group being the I frame. .
[0054]
FIG. 4 is a diagram showing a specific example of the frame group defined in FIG. As shown in FIG. 4, the frame group 310 is composed of fifteen frames from the intra-coded (I) frame 210 to the frame immediately before the intra-coded (I) frame 220. Similarly, the frame group 220 and the frame group 230 are each composed of 15 frames. In this case, an initial value of the total number of bits that can be allocated to one frame group is determined in advance (for example, 3600 “bits” etc.) Note that the method of defining the frame group is not limited to FIG. .
[0055]
FIG. 5 is a modified example of the frame group defined in FIG. As shown in FIG. 5, a group of frames composed of a first frame set and a second frame set corresponding to the two frame groups 310 and 320 in FIG. 4 may be defined as one frame group 410. In this case, the initial value of the total number of bits that can be allocated to the frame group 410 is 7200 [bits] (3600 [bits] for the first frame set and the second frame set, respectively).
[0056]
FIG. 6 is a diagram for explaining an effect obtained by forming a frame group by two frame sets as shown in FIG. FIG. 6A shows the number of bits to be allocated to the next frame to be encoded, including the number of bits that can be allocated in the next second frame set even if there is a scene that is difficult to encode in one frame group. Can be determined, so that a change in bit rate can be further reduced. For example, it is assumed that 1000 bits are allocated to the entire frame group 410 as initial values, 500 bits are temporarily allocated to the first frame set, and 500 bits are temporarily allocated to the second frame set. Thereafter, even if 700 bits are used in the first frame set in actual encoding, the next frame group 420 has an initial value of 800 [bits] as a whole (the remaining 300 [bits] of the previous frame group 410). +500 [bit] for the new second frame set).
[0057]
FIG. 6B shows a case where the bit rate suddenly becomes small in the same manner as in FIG. 6A even when the frame rate has to be changed due to the difficulty in encoding. That is, it is possible to prevent the quantization step from rapidly increasing).
[0058]
FIG. 7 is a flowchart illustrating a flow of processing in the overall control unit 40 and the rate control unit 30 of the image encoding device 10.
[0059]
First, the rate control unit 30 receives the number of generated bits Nn131 from the variable length coding unit 107 (S701), and receives the frame rate value Rf21 from the frame thinning unit 20 (S702).
[0060]
Next, the overall control unit 40 identifies whether or not the next frame is an I frame (S703). In this case, if the next frame is an I frame (S704: Yes), the rate control unit 30 initializes the number Na of assignable bits, the assignment target period Ta, and the number Nt of assignment target frames (S708 to S710). .
[0061]
On the other hand, when the next frame is not an I frame (S704: No), the rate control unit 30 updates the number Na of allocable bits and the number Nt of frames to be allocated (S705, S706). Furthermore, the rate control unit 30 rounds down the decimal portion of the number Nt of allocation target frames and converts this Nt into an integer (S707).
[0062]
Thereafter, the rate control unit 30 calculates the number Nb of bits to be allocated based on the number Na of bits that can be allocated and the number Nt of frames to be allocated (S711), and updates the allocation target period Ta (S712). In this case, the allocation target period Ta is updated in consideration of the case where the value of the frame rate value Rf21 changes in the middle of the same frame group.
[0063]
Thereby, the rate control unit 30 derives a quantization step based on the number of allocated bits Nb, and transmits it to the variable length coding unit 107 (S713).
[0064]
The overall control unit 40 and the rate control unit 30 repeat the above processing until the encoding processing ends (S701 to S714).
[0065]
FIG. 8 is an example illustrating a change in bit rate when encoding is performed using the image encoding device 10. Looking at the change in the bit rate shown in FIG. 8, the number of bits that can be allocated is suppressed to be smaller than in the case of the related art (FIG. 36) due to the coefficient (for example, 0.8) in the arithmetic unit 34. Therefore, the change in the bit rate tends to slow down. Further, in FIG. 8, the arithmetic unit 34 selects the number of bits that does not fall below the lower limit, and calculates the quantization step so that the number of bits after encoding becomes the number of bits. Further, since encoding is performed in accordance with the calculated quantization step and the number of bits to be generated is determined, the bit rate is shown to have a value equal to or greater than the lower limit.
[0066]
FIG. 9 is an example showing how the bit rate changes when one frame group is composed of two frame sets as shown in FIG. As shown in FIG. 9, in the related art (FIG. 36 described above), the bit rate value is small during “t3-t4” when the bit rate value is significantly small (that is, the quantization step is extremely large). Although it was possible to suppress the image quality from deteriorating, the effect of using a large number of bits in the first frame set appeared in the first part of the second frame set (between "t4" and "t6"). (That is, the quantization step cannot be reduced and the value of the bit rate remains small).
[0067]
FIG. 10 is an example showing how the bit rate changes when one frame group is configured by two frame sets and the encoding frame rate changes in the middle of the frame group. In FIG. 10, the frame rate changes from 15 [fps] to 7.5 [fps], but the manner of changing the bit rate is the same as the bit rate of FIG. 8 (that is, in the case of FIG. , 1/2 of the quantization step, the bit rate is assumed to be the same because the number of bits is doubled. In this case as well, the time between "t3-t4" Deterioration of image quality is suppressed).
[0068]
FIG. 11 is a diagram showing a specific example of a method of calculating the number of bits in the arithmetic unit 34 of FIG. In the example of FIG. 11, encoding is performed on the encoded frame signal 101 input at 30 [fps] at a frame rate of 15 [fps]. In this example, similarly to FIG. 37, the input encoded frame signal 101 is represented by “input image frame number 1701”, and the encoded frame signal 121 is represented by “frame group frame number 1102”. In FIG. 11, the columns of the frame group frame number 1102 and the number of generated bits Nn131 are indicated by "x" because the frame of the corresponding input image frame number 1701 is not coded and is "decimated". Represents
[0069]
Further, in FIG. 11, for example, the target value of the number of generated bits for the input image frame number “9” (that is, the frame group frame number “5”) is that the total number of bits already allocated is 1180 [bits] and the remaining Is (11), and thus ((3600-1180) / 11 = 220 [bits]). The average frame bit number deriving unit 33 calculates the average value of the number of generated bits in the past frame (1180/4 = 295 [bits]), and the arithmetic unit 34 adds a coefficient (for example, 0.8), and compares the result with the target value of the number of bits to select the larger value. As a result, the number of generated bits for the frame group frame number “5” is 236 [bits].
[0070]
On the other hand, the number of bits generated for the input image frame number “13” (ie, the frame group frame number “6”) is “decimated” for the frame of the input image frame number “11” (therefore, the frame rate value Rf21 is changed to 7.5 [fps]) and the number of remaining frames is calculated based on “5” (since the frame rate value Rf21 is calculated at 7.5 [fps]). Furthermore, since the calculated value is rounded down to the decimal point, (3600-1416) / 5 = 436 [bits]. The average frame bit number deriving unit 33 calculates the average value of the number of generated bits in the past frame (1416/5 = 383 [bits]), and the arithmetic unit 34 adds a coefficient (for example, 0.8), and compares this with the target value of the number of bits to select the larger value. As a result, the number of generated bits for the input image frame number “13” is 436 [bits].
[0071]
Comparing the number of generated bits Nn of the frame group frame numbers “5” and “6” in FIG. 11 and FIG. 35 of the prior art described above, all of the generated bits in the image encoding apparatus 10 (ie, FIG. Since the number of bits is a larger value and a larger number of bits can be assigned, it is clear that encoding for a higher quality image than before can be performed.
[0072]
Although two numbers are described in the frame group frame number column corresponding to the input image frame number “29” in FIG. 11, “(15)” indicates the time when the input image frame number is “9”. Are the expected values of the frame group frame number 1102 when the frame rate is 15 [fps], and “(10)” indicates that the frame rate at the time when the input image frame number is “13” is 7.5 [fps]. ], The predicted value of the frame group frame number 1102.
[0073]
In the first embodiment, the frame thinning section 20 is provided, and the bit rate is controlled based on the frame rate value Rf21 transmitted from the frame thinning section 20. The value may be obtained from a unit other than the frame thinning unit.
[0074]
FIG. 12 is a block diagram showing a part of the functional configuration of an image encoding device 50 in which the frame thinning unit 20 in FIG. 1 is not provided and the value of the frame rate value Rf21 is obtained from another unit. It is. The image encoding device 50 is different from the image encoding device 10 of FIG. 1 only in that the frame thinning unit 20 is not provided and that an overall control unit 60 is provided instead of the overall control unit 40.
[0075]
Further, since the quantization step in the above embodiment uniquely corresponds to the quantization parameter, the quantization step may be replaced with the quantization parameter.
[0076]
As described above, according to the image coding apparatus according to the present embodiment, the number of bits to be allocated is determined while corresponding to a change in the frame rate of coding. In addition, it is possible to secure a good image quality on average, and to avoid extremely awkward movements and poor image quality.
[0077]
Further, the bit stream encoded by the image encoding device described in the first embodiment can be decoded by a general image decoding method. Also, in the stream that has been encoded according to the first embodiment, the quantization step of each frame varies with the complexity of the image, but the variation is not extreme. It is possible to make the number of generated bits almost constant in a frame group composed of frames immediately before the encoded frame.
[0078]
In the first embodiment, the cycle required for encoding each frame group is assumed to be the same as “TA”. However, the present invention is not limited to the case where the cycle is the same, and the time required for encoding each frame group differs. May be.
[0079]
Further, in the above embodiment, only the average value of the number of bits calculated by the average frame bit number deriving unit is multiplied by a predetermined coefficient (for example, 0.8), and this is multiplied by the next frame target bit number deriving unit. Although the configuration is such that the larger number of bits is selected by comparing with the target value of the set number of bits, it may be configured that both of them are multiplied by a predetermined coefficient and compared.
[0080]
(Embodiment 2)
FIG. 13 is a block diagram illustrating a functional configuration of an image encoding device 2100 according to Embodiment 2. The image coding apparatus 2100 controls the quantization step and the frame thinning while considering a group of frames composed of twice as many frames as the conventional one as shown in FIG. 5 of the first embodiment. By doing so, it is possible to perform high-quality encoding while suppressing sudden fluctuations in the bit rate and the frame rate.
[0081]
The image encoding device 2100 includes a frame thinning unit 2101, a frame memory 102, a motion detecting unit 103, a motion compensating unit 104, an orthogonal transform unit 105, a quantizing unit 106, a variable length encoding unit 107, a transmission buffer 2108, an inverse quantum It comprises a transform unit 2109, an inverse orthogonal transform unit 2110, a differentiator 2111, an adder 2112, and a frame rate control unit 2113.
[0082]
The frame thinning unit 2101 performs a thinning process on each frame of an image signal input at a reference frame rate (for example, 30 Hz) according to the thinning information input from the frame rate control unit 2113, and thins out. The image signal is output to the motion detector 103 and the differentiator 2111. For example, when the value of the thinning-out information input from the frame rate control unit 2113 to the frame thinning-out unit 2101 is “1”, it indicates an instruction to perform encoding without thinning-out, and when the value is “0”, Here, an instruction to perform encoding by performing one-frame thinning is shown. That is, when the thinning information is “1”, the frame thinning unit 2101 outputs the frame input as the image signal to the motion detecting unit 103 and the differentiator 2111 as a frame to be encoded as it is. Conversely, when the thinning information is “0”, a process of thinning out (eg, discarding) the input frame is performed.
[0083]
The frame memory 102 is a storage device that is realized by a RAM, a hard disk, or the like, and that holds image data in frame units. Further, the frame memory 102 stores reference frame data serving as a reference image of the next inter-picture prediction coding frame. When the input encoded frame is a frame on which inter-frame prediction encoding is to be performed, the motion detecting unit 103 detects the motion of the encoded frame using the reference frame data stored in the frame memory 102. The motion compensator 104 generates motion compensation data corresponding to the motion detected by the motion detector 103. The motion compensation data is data indicating a motion vector indicating a correspondence between blocks of a reference frame and a frame to be coded, and a difference of an image signal between blocks indicated by the motion vector.
[0084]
The difference unit 2111 obtains a difference between a motion vector of the encoded frame and a motion vector based on the motion compensation data generated by the motion compensation unit 104 when the encoded frame is a frame on which inter-picture prediction encoding is performed. . On the other hand, if the frame to be encoded is a frame for which intra prediction coding is to be performed, the differentiator 2111 performs prediction within the screen without performing processing for obtaining a difference between the input image signal and the reference frame. After that, an image signal is output to the orthogonal transformation unit 105.
[0085]
The orthogonal transform unit 105 orthogonally transforms the motion compensation data generated by the motion compensating unit 104 into data representing frequency components by DCT (Discrete Cosine Transform) transform or the like, and outputs the transform result to the quantization unit 106. The quantization unit 106 quantizes the orthogonally transformed data using the quantization step input from the frame rate control unit 2113, and sends the quantized result to the variable length coding unit 107 and the inverse quantization unit 2109. Output. The variable-length coding unit 107 performs variable-length coding on the data quantized by the quantization unit 106 using a Huffman code or the like. The data that has been variable-length coded by the variable-length coding unit 107 is stored in the transmission buffer 2108 and output as a coded bit stream.
[0086]
The transmission buffer 2108 is a FIFO (First-InFirst-Out) memory realized by a RAM or the like. This transmission buffer 2108 stores, for example, as shown in FIG. 5 of the first embodiment, the total number of bits allocated to a frame group including a plurality of frames, and also stores the remaining data amount or free space inside the frame group. The capacity is monitored, and when the variable-length coded data is transmitted to the transmission buffer 2108, that is, when the encoding of the image signal for one frame is completed, the remaining amount of data in the transmission buffer 2108 is changed to a frame. The data is transmitted to the rate control unit 2113.
[0087]
The inverse quantization unit 2109 inversely quantizes the data quantized by the quantization unit 106 to generate a predicted image, and outputs the data to the inverse orthogonal transform unit 2110. The inverse orthogonal transform unit 2110 performs an inverse orthogonal transform on the data inversely quantized by the inverse quantization unit 2109. The adder 2112 adds the data dequantized by the inverse orthogonal transform unit 2110 and the motion compensation data generated by the motion compensation unit 104, and outputs the result to the frame memory 102. The frame rate control unit 2113 receives the remaining amount of data in the transmission buffer 2108 from the transmission buffer 2108. The frame rate control unit 2113 calculates a quantization step according to the remaining amount of data in the transmission buffer 2108 and outputs it to the quantization unit 106, and calculates a frame rate according to the calculated quantization step. The thinning-out information indicating whether to thin out the frame is determined and output to the frame thinning unit 2101. Here, the “quantization step” is a value (width) that is a reference when quantizing the frequency component of each frame, and is, for example, a natural number from “1” to “31” (this is a “quantization parameter”). "). The quantization parameters correspond to the quantization steps on a one-to-one basis, and are defined such that the larger the numerical value, the larger the quantization width. Hereinafter, the quantization parameter will be described as a “quantization step”.
[0088]
FIG. 14 is a block diagram showing a detailed functional configuration of the frame rate control unit 2113 in FIG. The frame rate control unit 2113 includes a quantization step prediction unit 2201, a frame rate calculation unit 2202, a quantization step determination unit 2203, a frame number calculation unit 2204, and a comparator 2205. The quantization step prediction unit 2201 performs a predetermined operation on the current quantization step according to the remaining amount of data input from the transmission buffer 2108, calculates a quantization step prediction value, and calculates the frame rate calculation unit 2202 and Output to the quantization step determination unit 2203. The quantization step determination unit 203 selects one natural number from “1” to “31” that is the closest to the quantization step prediction value input from the quantization step prediction unit 201, and converts the selected natural number to the next quantization. Decide on a step. Specifically, when the input quantization step prediction value includes a value below the decimal point, rounding processing such as rounding, rounding down, or rounding up is performed. In this case, if the value is less than "1", "1" is selected, and if it exceeds "31", "31" is selected.
[0089]
The frame rate calculation unit 2202 performs the next encoding based on the current frame rate based on the remaining amount of data input from the transmission buffer 2108 and the quantization step prediction value input from the quantization step prediction unit 201. Calculate the optimal frame rate at. The frame number calculation unit 204 calculates the current frame rate based on the thinning information output from the comparator 205. The comparator 205 compares the optimum frame rate output from the frame rate calculation unit 202 with the current frame rate output from the number-of-frames calculation unit 204. If the optimum frame rate is higher than the current frame rate, Then, "1" indicating an instruction not to thin out is output as thinning information. On the other hand, if the optimum frame rate is smaller than the current frame rate, “0” indicating an instruction to perform thinning is output as thinning information.
[0090]
FIG. 15 is a block diagram for explaining the function of the quantization step prediction unit 201 in FIG. FIG. 15A is a diagram schematically illustrating a quantization step prediction method in the quantization step prediction unit 201. FIG. 15B is a diagram illustrating the prediction coefficient table 303 stored in the quantization step prediction unit 201. The quantization step prediction unit 201 holds a current value memory 2302 shown in FIG. 15A and a prediction coefficient table 2303 shown in FIG. The current value memory 302 holds the initial value of the quantization step at the start of encoding, and holds the quantization step predicted value calculated by the quantization step prediction unit 201 after the start of encoding. The prediction coefficient table 303 stores the data remaining amount of the transmission buffer 2108 and the prediction coefficient in association with each other, and the quantization step prediction unit 201 calculates the prediction coefficient corresponding to the data remaining amount input from the transmission buffer 2108. Is multiplied by the current quantization step prediction value held in the current value memory 302 to calculate the quantization step prediction value of the next frame.
[0091]
As shown in FIGS. 15A and 15B, the prediction coefficient is “1.2” when the remaining amount of data in the transmission buffer 2108 is 50% or more and less than 80%, and is 80% or more and less than 90%. As the free space in the transmission buffer 2108 decreases, the value increases and the bit amount of the data to be encoded decreases. It is set as follows. Further, when the remaining data amount of the transmission buffer 2108 is 40% or more and less than 50%, the prediction coefficient is set to “1” so as to maintain the quantization step as it is. Conversely, the prediction coefficient is “0.8” when the remaining data amount of the transmission buffer 2108 is 30% or more and less than 40%, and “0.5” when the remaining data amount is 20% or more and less than 30%. In the case of 0% or more and less than 20%, it is set as "0.4". In other words, the prediction coefficient is set such that the larger the free space in the transmission buffer 2108, the larger the bit amount of the data to be coded (that is, the quantization step is made smaller and the quantization is finely performed, and the quality of the image quality is improved). To increase).
[0092]
For example, assuming that the predicted value of the quantization step in the current value memory 302 is “7.5” and the remaining amount of data in the transmission buffer 2108 is 75%, the quantization in the current value memory 302 is performed in the next frame. The step prediction value “7.5” is multiplied by the prediction coefficient “1.2”, and the quantization step prediction value for the frame is “9”. The calculated quantization step prediction value “9” is overwritten in the current value memory 2302 by the quantization step prediction unit 2201. Since the quantization step prediction value “9” is a natural number from “1” to “31”, the quantization step determination unit 2203 determines the quantization step as the quantization step for the frame. After the frame is quantized in the quantization step “9”, if the remaining amount of data in the transmission buffer 2108 is 70% even in the next frame, the quantization step prediction value in the current value memory 2302 is “ 9 is multiplied by the prediction coefficient “1.2”, and the next quantization step prediction value is “10.8”. If the quantization step determination unit 203 determines the quantization step by rounding off decimals or less, the next frame is quantized in the quantization step “11”. By setting the prediction coefficient in this manner, when the remaining data amount in the transmission buffer 2108 becomes 50% or more, the quantization step increases, so that the image quality of the image to be encoded gradually becomes coarse and is encoded. The bit amount of data can be gradually reduced. On the other hand, when the remaining amount of data in the transmission buffer 2108 is less than 40%, the quantization step is reduced, so that the data bit amount gradually increases, but the image quality of the image to be encoded can be gradually improved. .
[0093]
FIG. 16 is a block diagram for explaining the function of the frame rate calculation unit 2202 in FIG. The frame rate calculation unit 202 is a unit that calculates an optimum frame rate based on the remaining amount of data in the transmission buffer 2108 and the predicted quantization step value, and includes a comparator 2401, a comparator 2402, a frame rate table 2403, and a threshold memory. 2404, a threshold memory 2405 and a free space calculation unit 2406. The threshold memory 2404 and the threshold memory 2405 are realized by a latch circuit, a RAM, or the like. The comparator 2401 receives the quantization step prediction value output from the quantization step prediction unit 2201 and the threshold value B stored in the threshold value memory 2404. The comparator 2401 compares these two inputs. For example, if the quantization step prediction value exceeds the threshold B, the comparator 2401 outputs “1” as the output D1. If the quantization step prediction value is equal to or smaller than the threshold B, the comparator 2401 outputs “0”. Is output. The free capacity of the transmission buffer 2108 calculated by the free capacity calculation unit 2406 and the threshold C stored in the threshold memory 2405 are input to the comparator 2402. The comparator 2402 compares these two inputs, and outputs “1” as the output D2 when the free space of the transmission buffer 2108 exceeds the threshold C, and outputs “0” as the output D2 when the free space is equal to or less than the threshold C. I do. The frame rate table 2403 is a table indicating an optimal frame rate corresponding to a combination of the output D1 of the comparator 2401 and the output D2 of the comparator 2402. The threshold value memory 2404 holds a threshold value B of a quantization step prediction value set in advance. The threshold memory 2405 holds a preset threshold C of the transmission buffer 2108. The free space calculation unit 406 calculates the current free space of the transmission buffer 2108 based on the total data capacity of the transmission buffer 2108 and the remaining amount of data input from the transmission buffer 2108.
[0094]
Specifically, the frame rate calculation unit 2202 calculates the optimum frame rate for the encoding target frame according to the frame rate table 2403. For example, when the free space of the transmission buffer 2108 exceeds the threshold value C and the predicted quantization step value is equal to or less than the threshold value B, that is, when there is room in the transmission buffer 2108 despite the small quantization step value. , The optimal frame rate is determined (for example, to 30 Hz) so that the frame rate is maximized. Conversely, when the free space of the transmission buffer 2108 is equal to or less than the threshold C and the predicted quantization step value exceeds the threshold B, that is, although the quantization step is large, the transmission buffer 2108 has a margin. If not, the optimal frame rate is determined to be (eg, 10 Hz) so that the frame rate is minimized. Further, when both the free space of the transmission buffer 2108 and the quantization step prediction value are larger than the threshold value or both are smaller than the threshold value, the optimum frame rate is determined so that the frame rate becomes an intermediate value.
[0095]
FIG. 17 is a diagram showing an example of each input signal and output signal of the frame rate calculation unit 2202 in FIG. FIG. 17A is a diagram illustrating an optimum frame rate which is an output signal of the frame rate calculation unit 2202. FIG. 17B is a diagram illustrating a quantization step prediction value that is one input signal of the frame rate calculation unit 202. FIG. 17C is a diagram illustrating the free space of the transmission buffer 2108 which is the other input signal of the frame rate calculation unit 202. This free space is accurately calculated by the free space calculation unit 2406 from the input data remaining amount. A curve L1 in FIG. 17B shows how the predicted value of the quantization step changes over time, and a curve L2 in FIG. 17C shows a time change in the free space of the transmission buffer 2108. I have. As shown in FIG. 17B, the comparator 2401 outputs D1 = 0 while the quantization step prediction value is equal to or smaller than the threshold B, and when the quantization step prediction value exceeds the threshold B, the comparator 2401 outputs D1. = 1 is output. When the predicted value of the quantization step becomes the threshold B or less again, the comparator 401 outputs D1 = 0. On the other hand, as shown in FIG. 17C, while the free space of the transmission buffer 2108 is equal to or smaller than the threshold C, the comparator 2402 outputs D2 = 0, and when the free space exceeds the threshold C, the comparator 2402 outputs D2 = Outputs 1. When the free space falls below the threshold value C again, D2 = 0 is output.
[0096]
The frame rate table 2403 held by the frame rate calculation unit 2202 stores four values of the value “0” or “1” of the output D1 of the comparator 2401 and the value “0” or “1” of the output D2 of the comparator 2402. Four types of frame rates are described corresponding to the combinations. While D1 = 0 (the quantization step predicted value is small) and D2 = 0 (the free space is small), the frame rate calculation unit 2202 outputs 20 Hz as the optimal frame rate as shown in FIG. . Also, as shown in FIGS. 17B and 17C, when only the quantization step prediction value indicated by the curve L1 exceeds the threshold value B, that is, D1 = 1 (quantization step prediction While the value is large and D2 = 0 (the free space is small), the frame rate calculation unit 2202 outputs 15 Hz as the optimum frame rate. Subsequently, when both the quantization step prediction value and the free space exceed the threshold, that is, while D1 = 1 (the quantization step prediction value is large) and D2 = 1 (the free space is large), the frame rate calculation is performed. The unit 2202 outputs 20 Hz as the optimum frame rate in order to control the quantization step to be small. Further, when only the quantization step prediction value is equal to or smaller than the threshold B, that is, while D1 = 0 (the quantization step prediction value is small) and D2 = 1 (the free space is large), the frame rate calculation unit 202 outputs 30 Hz as the optimum frame rate. As described above, the frame rate calculation unit 202 gradually increases or decreases the frame rate according to the quantization step prediction value and the free space of the transmission buffer 2108 (although there are four levels here).
[0097]
FIG. 18 is a diagram for explaining the operation of the frame number calculation unit 204 shown in FIG. FIG. 18A is a diagram illustrating an example of the thinning information output from the comparator 2205. FIG. 18B is a block diagram illustrating a detailed configuration of the frame number calculation unit 2204. As shown in FIG. 18A, the thinning information output from the comparator 2205 is input to the frame number calculation unit 2204 at 30 Hz. The thinning information is a binary signal of “0” or “1”. The thinning information “0” indicates that the frame has been thinned, and the thinning information “1” indicates that the frame has been coded. 18B is a processing unit that calculates the current frame rate based on the thinning information output from the comparator 2205 and outputs the calculation result at a predetermined cycle (for example, 5 Hz). Or a circuit. The frame number calculation unit 2204 includes a thinning information memory 2601, a counter 2602, and a calculator 2603. The thinning information memory 2601 is a FIFO (first_in first_out) memory device that holds first-in first-out, and holds 30 bits of 1-bit thinning information input at 30 Hz, retroactively from the current frame. The counter 2602 counts, at a predetermined cycle (for example, 5 Hz), the number m of frames in which the latest thinning information in the thinning information memory 2601 is “1” and the number n of frames in which the thinning information is “0”. The values of m and n are reset at a period (for example, after 1/5 second). Arithmetic unit 2603 calculates “m / (m + n)” at the above-described predetermined cycle, and outputs the result as the current frame rate. Thus, when the frame number calculation unit 2204 calculates and outputs the current frame rate, for example, five times per second, it is possible to calculate a more appropriate quantization step every 0.2 seconds.
[0098]
The comparator 2205 of the frame rate control unit 2113 compares the current frame rate calculated by the frame number calculation unit 2204 with the optimum frame rate calculated by the frame rate calculation unit 2202, and determines that the optimum frame rate is the current frame. If the rate is equal to or more than the rate, "1" indicating an instruction for encoding is output as thinning information. On the other hand, if the optimum frame rate is less than the current frame rate, “0” indicating a thinning instruction is output as thinning information. As a result, the frame rate of the frame to be encoded becomes equal to the optimum frame rate calculated by the frame rate calculation unit 2202. That is, since the present image encoding device 2100 controls the quantization step according to the free space of the transmission buffer 2108, when the quantization step is controlled by alleviating the time change of the free space of the transmission buffer 2108, That is, when encoding is performed by gradually increasing or decreasing the frame rate in accordance with the predicted quantization step value and the available capacity of the transmission buffer 2108, it is possible to avoid rapid image degradation.
[0099]
FIG. 19 is a diagram for describing an outline of an input image signal and a frame to be encoded in the image encoding device 2100. FIG. 19A is a diagram illustrating each frame of an image signal input to the image encoding device 2100. As shown in FIG. 19A, the image coding apparatus 2100 configures one frame group 2604 with two frame sets as in the case of FIG. One unit is used for determining the quantization step and the frame rate. FIG. 19B is a diagram illustrating each encoded frame encoded by the image encoding device 2100.
[0100]
As shown in FIG. 19A, the image signal input to the image encoding device 2100 includes a scene that is easy to encode and a scene that is difficult to encode. The amount of generated bits of the encoded data is reduced. On the other hand, in a scene where encoding is difficult, the amount of generated bits of encoded data increases. For example, if a scene that is difficult to encode is input to the image encoding device 2100 at the time a, the amount of bits generated by encoding the first frame of the scene that is difficult to encode is large, so that the free space of the transmission buffer 2108 is large. Is reduced, and the quantization step prediction unit 2201 increases the prediction value of the quantization step according to the free space. For example, the quantization step prediction value predicted by the quantization step prediction unit 2201 is increased to 1.5 times the quantization step prediction value corresponding to the immediately preceding frame. Thereby, the amount of bits generated by encoding the next frame is suppressed. As a result, the amount of bits generated by encoding does not become as large as when the quantization is performed using the initial quantization step, and the free space of the transmission buffer 2108 does not suddenly decrease. Therefore, in the related art, even when it is necessary to continuously greatly reduce frames, the image encoding device 2100 can more gradually reduce the frame rate.
[0101]
Nevertheless, if the free space of the transmission buffer 2108 decreases below the threshold value C, the frame rate calculation unit 202 changes the optimal frame rate to a frame rate one step lower. For example, if encoding was performed at a frame rate of 30 Hz until time a, the frame rate calculation unit 2202 changes the optimal frame rate from the next frame to 20 Hz. As described above, even if the quantization step is increased and the frame rate is reduced, the capacity of the transmission buffer 2108 has no margin, and the quantization step prediction value is further increased to exceed the threshold B. The unit 2202 changes the next optimum frame rate to a frame rate one step lower. For example, if encoding was performed at a frame rate of 20 Hz until time b, the frame rate calculation unit 2202 changes the next optimal frame rate to 15 Hz.
[0102]
As described above, even when a scene that is difficult to encode is input, the image encoding device 100 calculates the quantization step prediction value according to the amount of bits generated by encoding, and calculates the quantization step prediction value. Since the frame rate can be reflected on the optimum frame rate, the frame rate can be reduced more gradually and gradually. Conversely, in the input image signal, for example, at time c, even when the scene is switched from a scene that is difficult to encode to a scene that is easy to encode, first, the quantization step is reduced to obtain the highest possible image quality. If the encoding is performed and the transmission buffer still has room (the scene is easy to encode), the frame rate is changed to a larger value by one step, so the frame rate is increased more gently and gradually. can do. For example, when a scene that is easy to encode is input at time c and the transmission buffer 2108 still has a margin even if the quantization step is reduced, the frame rate is changed to one step higher at 20 Hz at time d. If the quantization step has a sufficiently small value at time e, the frame rate is changed to another higher level of 30 Hz, so that the frame rate can be increased more gently. As a result, when an image signal encoded by the image encoding device 100 is decoded by the decoding device, even in a scene that is difficult to encode, the image does not suddenly become rough or suddenly awkward. A moving image can be reproduced. Conversely, even when the scene is switched to an easy-to-encode scene, the image does not suddenly have a smoother shading, or the motion does not suddenly smoother, and the human eyes do not feel unnatural. High quality images can be reproduced.
[0103]
As described above, according to the image encoding apparatus 2100 of the present embodiment, if the buffer has enough free space while keeping the bit rate when observed for a predetermined time length (for example, one second) constant. By encoding with a low quantization step, encoding can be performed with higher image quality than before, and a sharp decrease in the frame rate when a transition to a complex scene occurs (many frames are skipped without being encoded). ) Can be suppressed, and coding with smoother motion than before can be performed.
[0104]
In the above embodiment, the frame rate calculation unit 2202 calculates the optimum frame rate using the remaining amount of data in the transmission buffer 2108 and the quantization step prediction value of the quantization step prediction unit 2201. However, the present invention is not limited to this, and the calculation may be performed using either one. Also, the frame rate calculation unit 2202 calculates the four-stage optimal frame rates of 30 Hz, 20 Hz, 15 Hz, and 10 Hz using the frame rate table 2403 shown in FIG. It is not limited to a value, and there is no need to have four levels. Further, there is no need to calculate the optimum frame rate using such a frame rate table. For example, if the available capacity of the transmission buffer is equal to or larger than the threshold C, the optimum frame rate is set to twice the current frame rate, and the threshold C If it is less than the current frame rate, it may be calculated to be 1 / times the current frame rate. Further, another threshold value D (C <D) is provided. If the available capacity of the transmission buffer is equal to or larger than the threshold value C, the optimum frame rate is set to twice the current frame rate. It may be calculated to be 1/2 times. By doing so, it is possible to prevent the optimum frame rate from being changed each time a slight change in the remaining amount of data in the transmission buffer near each of the threshold C and the threshold D. Further, the optimum frame rate may be obtained by performing the same calculation for a change in the quantization step prediction value. Further, the optimal frame rate is not limited to a value such as 1/2 times or 2 times the current frame rate. The same applies to the following embodiments.
[0105]
Further, in the above embodiment, the case where the quantization step prediction unit 2201 calculates the quantization step prediction value using the prediction coefficient table 2303 shown in FIG. 15 has been described. The method is not limited to this, and may be calculated using a predetermined function. Further, the prediction coefficients of the quantization steps in the prediction coefficient table 2303 are also set to values of “2”, “1.5”, “1.2”, “1”, “0.8”, “0.5”, and “0.4”. Not limited. The same applies to the following embodiments.
[0106]
Although the frame number calculation unit 2204 according to the second embodiment includes the thinning information memory 2601 for storing the thinning information for the past one second (that is, for 30 frames), the present invention is not limited to this. Not done. Also, the calculation method of the current frame rate is not limited to the above calculation method, and another method may be used. The same applies to the following embodiments.
[0107]
Also, an average bit rate may be used instead of the remaining data amount in the transmission buffer. The same applies to the following embodiments.
[0108]
Hereinafter, frame rate control units 2800, 3000, and 3400, which are modifications of the above frame rate control unit 2113, will be described. In the following modified examples, the description of the same configuration as the frame rate control unit 2113 will be omitted, and different points will be mainly described.
[0109]
FIG. 20 is a block diagram illustrating a functional configuration of a frame rate control unit 2800 according to a modification. The frame rate control unit 2800 includes a quantization step prediction unit 2201, a quantization step determination unit 2203, a frame rate calculation unit 2202, a frame number calculation unit 2204, and a comparator 2205. The difference between the frame rate control unit 2800 and the frame rate control unit 2113 shown in FIG. 14 is that instead of the frame rate calculation unit 2202 receiving the quantization step prediction value of the quantization step prediction unit 2201, The point is that the quantization step determined by the determination unit 2203 is input.
[0110]
FIG. 21 is a diagram showing an example of each input signal and output signal of the frame rate calculation unit 2202 in FIG. FIG. 21A is a diagram illustrating an optimum frame rate which is an output signal of the frame rate calculation unit 2202. FIG. 21B is a diagram illustrating a quantization step which is one input signal of the frame rate calculation unit 2202. FIG. 21C is a diagram illustrating the free space of the transmission buffer 2108 which is the other input signal of the frame rate calculation unit 2202. The quantization step determination unit 2203 determines an integer value from “1” to “31” based on the quantization step prediction value obtained by the quantization step prediction unit 2201, and uses the determined value as a quantization step. Output. Therefore, as shown in FIG. 21B, the quantization step input to the frame rate control unit 2800 is "31" at the maximum, unlike the quantization step prediction value.
[0111]
As described above, the frame rate calculation unit 2202 calculates the optimum frame rate based on the quantization step output from the quantization step determination unit 2203 instead of the quantization step prediction value, thereby realizing the actual coding. It is possible to calculate the optimum frame rate without greatly deviating from the amount of generated bits due to.
[0112]
FIG. 22 is a block diagram illustrating a functional configuration of the frame rate control unit 3000 according to the modification. The frame rate control unit 3000 obtains an average quantization step of a previously coded frame from the quantization step obtained by the quantization step determination unit 2203, and determines the optimal quantization step of the frame rate calculation unit 2202 from the obtained average quantization step. It calculates a frame rate, and includes a quantization step prediction unit 2201, a quantization step determination unit 2203, an average quantization step calculation unit 3001, a frame rate calculation unit 3002, a frame number calculation unit 2204, and a comparator 2205. The average quantization step calculator 3001 calculates an average value of quantization steps used for encoding for the past one second. The frame rate calculation unit 3002 calculates an optimum frame rate from the average value of the quantization steps calculated by the average quantization step calculation unit 3001 and the free space of the transmission buffer 2108.
[0113]
FIG. 23 is a block diagram for explaining the function of the average quantization step calculator 3001 in FIG. The average quantization step calculation unit 3001 calculates an average value of quantization steps for frames encoded in the past, and includes a quantization step memory 3101, a thinning information memory 3102, an adder 3103, and a divider 3104. The quantization step memory 3101 is a FIFO that holds the value of the quantization step output from the quantization step determination unit 2203 for 30 frames from the current frame for 1 frame on a first-in first-out basis. The thinning information memory 3102 stores the thinning information (ie, for example, if there are 30 frames per second, a total of 30 bits) output from the comparator 2205 in a first-in first-out manner for one second from the current frame. This is the FIFO to be held. The adder 3103 adds the result obtained by multiplying the corresponding thinning information for each frame by the quantization step (that is, sums the quantization steps of all the frames encoded in the past one second) and divides the result. Output to the unit 3104. The divider 3104 divides the sum of the quantization steps input from the adder 3103 by the number of frames encoded in the past one second to calculate an average value of the quantization steps.
[0114]
FIG. 24 is a block diagram for explaining the function of frame rate calculation section 3002 in FIG. The frame rate calculation unit 3002 holds the frame rate table 2403 shown in FIG. 16 and further includes a hysteresis comparator 3201, a threshold memory 3202, a hysteresis comparator 3203, a threshold memory 3204, and a free space calculation unit 2406. When the thresholds α1 and β1 (β1 <α1) are input to the one input terminal from the threshold memory 3202 and the average quantization step input to the other input terminal exceeds the threshold α1, the hysteresis comparator 3201 determines that the average quantization The comparator outputs D1 = 1 until the quantization step becomes equal to or smaller than the threshold value β1, and outputs D1 = 0 until the average quantization step exceeds the threshold value α1 even if it exceeds the threshold value β1. The threshold memory 3202 is a latch circuit or a memory that holds the thresholds α1 and β1. When the thresholds α2 and β2 (β2 <α2) are input to one input terminal from the threshold memory 3204 and the free space of the transmission buffer 2108 input to the other input terminal exceeds α2, the hysteresis comparator 3203 sets D2 = 1. Then, D2 = 1 is output until the free space of the transmission buffer 2108 becomes equal to or less than β2. The threshold memory 3204 is a latch circuit or a memory that holds the thresholds α2 and β2.
[0115]
FIG. 25 is a diagram showing an example of each input signal and output signal of the frame rate calculation unit 3002 in FIG. FIG. 25A is a diagram illustrating an optimal frame rate which is an output signal of the frame rate calculation unit 3002. FIG. 25B is a diagram illustrating an average quantization step that is one input signal of the frame rate calculation unit 3002. FIG. 25C is a diagram illustrating the free space of the transmission buffer 2108 which is the other input signal of the frame rate calculation unit 3002. As shown in FIG. 25B, the average quantization step takes a value from “1” to “31”, but is not necessarily a natural number as in the quantization step of each frame, and the degree of change is gradual. It is getting smaller. The method by which the frame rate calculation unit 3002 calculates the optimum frame rate based on the values of the output D1 of the hysteresis comparator 3201 and the output D2 of the hysteresis comparator 3203 input as described above is as described above.
[0116]
As described above, the frame rate control unit 3000 controls the frame rate based on the average quantization step output from the average quantization step calculation unit 3001 instead of the quantization step prediction value, thereby enabling the quantization step Can be prevented from being changed for each frame when the value rises or falls near the threshold.
[0117]
Note that, in the above-described embodiment, an example has been described in which the average quantization step calculation unit 3001 calculates the average value of the quantization steps in frames encoded in the past second, but the present invention is not limited to this. Instead, the average value of the quantization step may be calculated for the past several seconds or for the past several frames to several tens of frames. In addition, the average value of past quantization steps may be calculated uniformly, including frames that have not been encoded.
[0118]
FIG. 26 is a block diagram illustrating a functional configuration of a frame rate control unit 3400 according to a modification. The frame rate calculation section 3401 of the frame rate control section 3400 includes a hysteresis comparator 3201 and a hysteresis comparator 3203 in place of the comparator 2401 and the comparator 2402, and, like the frame rate calculation section 202 in the first embodiment, the optimum frame. The rate is calculated. Further, the average value of the optimum frame rates calculated in the past one second is obtained, and the obtained average frame rate is set as the optimum frame rate.
The frame rate control section 3400 includes a quantization step prediction section 2201, a quantization step determination section 2203, a frame rate calculation section 3401, a frame rate memory 3402, a frame number calculation section 2204, and a comparator 2205. The frame rate calculation unit 3401 receives the output D1 of the hysteresis comparator 3201 and the output D2 of the hysteresis comparator 3203, and calculates an optimal frame rate according to the rules (truth table) of the frame rate table 2403. Further, the frame rate calculation unit 3401 calculates an average value of the plurality of past optimum frame rate calculation results.
[0119]
The frame rate memory 3402 is a FIFO that holds an optimum frame rate, which is a calculation result of the frame rate calculation unit 3401, on a first-in, first-out basis for 30 frames that are one second before the current frame.
[0120]
FIG. 27 is a block diagram showing a detailed configuration of the frame rate calculation unit 3401 and the frame rate memory 3402 in FIG. The frame rate calculator 3401 holds a frame rate table 2403, and further includes a hysteresis comparator 3201, a threshold memory 3202, a hysteresis comparator 3203, a threshold memory 3204, a free space calculator 2406, an adder 3501 and a divider 3502. . The frame rate calculation unit 3401 receives, for each frame of the input image signal, the output D1 of the hysteresis comparator 3201 to which the quantization step prediction value is input from the quantization step prediction unit 2201 and the remaining data amount of the transmission buffer 2108. The optimum frame rate is calculated from the frame rate table 2403 based on the output D2 of the hysteresis comparator 3203 and the calculated optimum frame rate is output to the frame rate memory 3402 at 30 Hz. The adder 3501 adds each optimal frame rate in the frame rate memory 3402. The divider 3502 divides the value output from the adder 3501 by “30” and refers to the frame rate table 2403 to determine the frame rate closest to the division result from the four optimal frame rates to the average optimal frame rate. Determined as rate and output. As a result, even when the optimum frame rate changes, for example, from 30 Hz to 10 Hz, the average optimum frame rate always changes via an intermediate frame rate, such as 30 Hz, 20 Hz, 15 Hz, and 10 Hz. Therefore, it is possible to more smoothly control the frame rate in encoding.
[0121]
FIG. 28 is a diagram illustrating an example of each input signal and output signal of the frame rate calculation unit 3401 in FIG. FIG. 28A is a diagram illustrating an average optimum frame rate which is an output signal of the frame rate calculation unit 3401. FIG. 28B is a diagram illustrating a quantization step prediction value that is one input signal of the frame rate calculation unit 3401. FIG. 28C is a diagram illustrating the free space of the transmission buffer 2108 which is the other input signal of the frame rate calculation unit 3401. As shown in FIG. 28 (a), the average optimal frame rate is calculated by averaging the optimal frame rates for 30 frames going back one second from the current frame and selecting the optimal frame rate closest to that value. A large change in the frame rate is suppressed, and as a result, an encoding result with smoother motion can be obtained.
[0122]
It has been described that the present frame rate calculation unit 3401 calculates the average value of the optimum frame rates for 30 frames in the past 1 second, but the present invention is not limited to this, and the range of the optimum frame rate for calculating the average value is as follows. Any number of seconds or frames may be used in the past.
[0123]
(Embodiment 3)
FIG. 29 is a block diagram illustrating a functional configuration of an image encoding device 4100 according to Embodiment 3. The image encoding device 4100 performs more appropriate encoding by using the variable bit rate method in the image encoding device 10 of the first embodiment and the variable frame rate method in the image encoding device 2100 of the second embodiment. To achieve.
[0124]
As illustrated in FIG. 29, the image coding device 4100 has the same functional configuration as the image coding device 10 according to Embodiment 1 except for a transmission buffer 2108, a frame rate control unit 4113, and a frame thinning unit 4116. . In the following, the same components as those in the first embodiment or the second embodiment are denoted by the same reference numerals, and description thereof is omitted.
[0125]
The frame rate control unit 4113 has only the function of generating thinning information among the functions of the frame rate control unit 2113 of the image encoding device 2100 according to the second embodiment.
[0126]
The frame thinning unit 4116 receives the thinning information from the frame rate control unit 4113, determines the frame rate, and notifies the bit rate control unit 30 of the determined frame rate value at that time.
[0127]
FIG. 30 is a block diagram showing a detailed functional configuration of the frame rate control unit 4113 in FIG. 29 described above. As shown in FIG. 30, frame rate control section 4113 has a configuration in which quantization step prediction section 2201 and quantization step determination section 2203 are removed from frame rate control section 2113 (see FIG. 14 above) in the second embodiment. Has become. Therefore, the frame rate control unit 4113 generates only thinning information based on the remaining amount of data obtained from the transmission buffer 2108, and transmits this thinning information to the frame thinning unit 4116.
[0128]
As described above, the image coding apparatus 4100 according to the present embodiment controls the frame rate according to the remaining amount of data in the transmission buffer and, based on this frame rate and the total number of bits allocated to the frame group, More suitable bit allocation can be realized.
[0129]
(Embodiment 4)
In the following embodiment, the configuration of the image encoding device according to the first to third embodiments is realized as a step of an image encoding program, and functions equivalent to those of the image encoding device are implemented on a general computer system. The following describes how to do this.
[0130]
FIG. 31 is an explanatory diagram of a case where functions equivalent to those of the image encoding apparatuses according to the first to third embodiments are realized on a general computer system by using a flexible disk storing an image encoding program.
[0131]
FIG. 31B shows the appearance, cross-sectional structure and flexible disk viewed from the front of the flexible disk, and FIG. 31A shows an example of the physical format of the flexible disk which is the recording medium body.
[0132]
The flexible disk 1301 is built in a case 1302, and a plurality of tracks are formed concentrically on the surface of the disk from the outer circumference to the inner circumference, and each track is divided into 16 sectors in the angular direction. Therefore, in the flexible disk storing the image encoding program, data as the image encoding program is recorded in an area allocated on the flexible disk 1301.
[0133]
FIG. 31C shows a configuration of an apparatus for recording and reproducing the image encoding program on the flexible disk 1301. When recording the image encoding program on the flexible disk 1301, data of the image encoding program is written from the computer system 1304 via the flexible disk drive 1303. If the encoding or decoding device is to be constructed in a computer system using a program in the flexible disk 1301, the program is read from the flexible disk drive 1303 and transferred to the computer system 1304.
[0134]
In the above description, a flexible disk is used as a data recording medium. However, the above-described image encoding apparatus can be realized by using a medium capable of recording a program, such as an optical disk, an IC card, and a ROM cassette. be able to.
[0135]
【The invention's effect】
As described above, according to the image encoding device of the present invention, when encoding is performed at a constant bit rate in a predetermined time length, the deviation of the number of generated bits in a frame group that is a group of frames is reduced. Each time a coding process is performed on an individual frame in the frame group, the number of bits to be allocated to the next frame is calculated. Further, by referring to the number of bits generated in the past frame, it is possible to derive the optimum number of allocated bits that can be encoded with high image quality for the next frame. That is, even when scenes that are difficult to encode continue, it is possible to prevent the number of bits allocated to subsequent scenes from becoming extremely small, and to improve the image quality as a whole.
[0136]
Further, according to the image encoding apparatus of the present invention, even when the rate of a frame to be encoded fluctuates (variable frame rate), each time encoding is performed, an optimal frame rate using the current frame rate is used. Since it is possible to derive the number of bits, it is possible to perform encoding that can avoid extreme degradation of image quality while keeping the average bit rate at a predetermined time length constant.
[0137]
The bit stream encoded by the image encoding device according to the present invention can be decoded by a general decoding device, and high-quality decoding can be performed without performing any special processing.
[0138]
Furthermore, according to the image encoding apparatus of the present invention, as a result of encoding the current frame, first, the width of quantization is adjusted to adjust the signal resolution of each pixel according to the generated code amount. The generated frame rate of the next frame is controlled, and the coding frame rate can be adjusted according to the control of the generated bit rate by adjusting the quantization width. As a result, for example, by increasing the quantization width, it is sufficient to prevent the occurrence of a state in which frame thinning is generated despite the reduced generated code amount and the image quality is deteriorated more than necessary. Thus, there is an effect that the amount of code generated by encoding can be efficiently controlled.
[0139]
Further, the image coding apparatus according to the present invention calculates the quantization width of the next coded frame from the residual code amount of the transmission buffer, for example, when the transmission buffer has room (that is, the coding is easy). Scene), the quantization width is set to a small value. Conversely, if the transmission buffer does not have enough space, the quantization width is set to a large value, so that the bit rate over a sufficiently long time is kept constant, and a code with the highest possible image quality is obtained. There is an effect that conversion can be performed.
[0140]
Furthermore, the image coding apparatus according to the present invention sets the coding frame rate when the calculated predicted value of the quantization width becomes a large value equal to or larger than the threshold value (that is, in the case of a complicated scene in which coding is difficult). Change to a smaller value to increase the frame thinning rate. However, since the amount of generated bits is suppressed by controlling the quantization width, there is an effect that it is possible to perform high-quality encoding without causing a rapid change in the frame rate.
[0141]
According to the image encoding apparatus of the present invention, the encoding frame rate is controlled by using the average value of the quantization width which is controlled and fluctuated by the residual code amount of the transmission buffer, thereby encoding the current frame. When the code amount is extremely generated (the residual code amount of the transmission buffer is increased) and the quantization step of the next frame is controlled to be large, it is suppressed that the frame rate is immediately changed, and the immediately following image is changed. It is possible to prevent the movement from becoming awkward. At the same time, there is an effect that it is possible to suppress a sudden change in the frame rate and perform smooth motion encoding.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a functional configuration of an image encoding device according to Embodiment 1.
FIG. 2 is a block diagram illustrating a detailed functional configuration of a bit rate control unit in FIG. 1;
FIG. 3 is a diagram illustrating characteristics of the number of generated bits for each picture type in general image coding.
FIG. 4 is a specific example of a frame group defined in FIG. 3;
FIG. 5 is a modified example of the frame group defined in FIG. 3;
FIG. 6A is a diagram for explaining an effect obtained by forming a frame group by two frame sets as shown in FIG. 5; FIG. 6B is a diagram for explaining an effect when a frame group is configured by two frame sets as shown in FIG. 5 and the encoding frame rate changes.
FIG. 7 is a flowchart showing a flow of processing in an overall control unit and a bit rate control unit of the image encoding device according to Embodiment 1.
FIG. 8A is a diagram illustrating a configuration example of a frame group when encoding is performed using the image encoding device according to the first embodiment; (B) is an example illustrating a change in a bit rate when encoding is performed using the image encoding device according to Embodiment 1.
FIG. 9A is an example showing a state of each frame when one frame group is configured by two frame sets. (B) is an example showing how the bit rate changes when one frame group is configured by two frame sets.
FIG. 10A is an example showing a state of each frame when one frame group is formed by two frame sets and the encoding frame rate changes. (B) is an example showing how a frame group is composed of two frame sets, and how the bit rate changes when the encoding frame rate changes.
FIG. 11 is a diagram illustrating a specific example of a method of calculating the number of bits in an arithmetic unit.
FIG. 12 is a block diagram showing a part of the functional configuration of an image coding apparatus in which a frame thinning unit is not provided and a frame rate value Rf is obtained from another unit in FIG.
FIG. 13 is a block diagram illustrating a functional configuration of an image encoding device according to Embodiment 2.
FIG. 14 is a block diagram illustrating a detailed functional configuration of a rate control unit in FIG. 13;
FIG. 15 is a block diagram for explaining a function of a quantization step prediction unit in FIG. 14;
16 is a block diagram for explaining a function of a frame rate calculation unit in FIG.
17 is a diagram illustrating input signals and output signals of a frame rate calculation unit in FIG. 16;
18 is a diagram for explaining the operation of the frame number calculation unit in FIG.
FIG. 19 is a diagram illustrating an input image signal and a frame to be encoded of the image encoding device.
FIG. 20 is a block diagram illustrating a functional configuration of a frame rate control unit according to a modification.
21 is a diagram illustrating each input signal and output signal of the frame rate calculation unit in FIG.
FIG. 22 is a block diagram illustrating a functional configuration of a frame rate control unit according to a modification.
FIG. 23 is a block diagram illustrating a configuration of an average quantization step calculator in FIG. 22;
24 is a block diagram for explaining a function of a frame rate calculation unit in FIG.
FIG. 25 is a diagram showing each input signal and output signal of the frame rate calculation unit in FIG. 22.
FIG. 26 is a block diagram illustrating a functional configuration of a frame rate control unit according to a modification.
FIG. 27 is a block diagram for explaining functions of a frame rate calculation unit and a frame rate memory in FIG. 26;
28 is a diagram showing each input signal and output signal of the frame rate calculation unit in FIG. 26.
FIG. 29 is a block diagram illustrating a functional configuration of an image encoding device according to Embodiment 3.
30 is a block diagram illustrating a functional configuration of a frame rate control unit in the image encoding device of FIG. 29.
FIG. 31 is a diagram for describing a storage medium that can store a program for realizing the image encoding device according to the first to third embodiments using a general computer system.
FIG. 32 is a block diagram illustrating a functional configuration of a conventional image encoding device using a variable bit rate method.
FIG. 33 is a block diagram illustrating a functional configuration of a bit rate control unit in a conventional image encoding device.
FIG. 34 is a flowchart showing a flow of processing in a general control unit and a bit rate control unit of a conventional image encoding device.
FIG. 35 is a diagram illustrating a specific example of a method of calculating the number of allocated bits in a conventional bit rate control unit.
FIG. 36 (a) is a configuration example of a frame group for describing a first problem of the related art. (B) is an example of a bit rate for explaining a first problem of the related art.
FIG. 37 (a) is a configuration example of a frame group for describing a second problem of the related art. (B) is an example of a bit rate for explaining a second problem of the related art.
[Explanation of symbols]
10. Image coding device
20 Frame thinning section
30 Rate control unit
31 Frame Group Target Bit Derivation Unit
32nd order frame target bit number deriving unit
33 Average Frame Bit Number Derivation Unit
34 Arithmetic unit
35 Quantization step derivation unit
36 storage unit
40 Overall control unit
50 Image encoding device
60 Overall control unit
100 image encoding device
101 Encoded frame signal
102 frame memory
103 detector
104 Compensation unit
105 orthogonal transform unit
106 Quantization unit
107 Variable length coding unit
108 Inverse quantization unit
109 Inverse orthogonal transform unit
110 Bit rate control unit
111 frame group target bit number deriving unit
112nd frame target bit number derivation unit
113 Quantization step derivation unit
121 coded frame signal
140 Overall control unit
141 quantization step
201 Quantization step prediction unit
202 Frame rate calculator
203 Quantization step determination unit
204 Frame number calculation unit
205 comparator
302 Current value memory
303 prediction coefficient table
401 comparator
406 Capacity calculation unit
1301 Flexible disk
1302 Case
1303 Flexible disk drive
1304 Computer system
2100 Image encoding device
2101 Frame thinning unit
2108 Transmission buffer
2109 Inverse quantization unit
2110 Inverse orthogonal transform unit
2111 Differentiator
2112 Adder
2113 Frame rate control unit
2201 quantization step predictor
2202 Frame rate calculator
2203 quantization step determination unit
2204 Frame number calculator
2205 Comparator
2302 Current value memory
2303 prediction coefficient table
2401 comparator
2402 comparator
2403 Frame rate table
2404 Threshold memory
2405 Threshold memory
2406 Capacity calculation unit
2601 Information memory
2602 counter
2603 arithmetic unit
2604 Frame group
2800 Frame rate control unit
3000 Frame rate control unit
3001 Average quantization step calculator
3002 Frame rate calculator
3101 Quantization step memory
3102 Information memory
3103 Adder
3104 Divider
3201 Hysteresis comparator
3202 threshold memory
3203 Hysteresis comparator
3204 Threshold memory
3400 Frame rate control unit
3401 Frame rate calculator
3402 Frame rate memory
3501 Adder
3502 Divider
4100 Image encoding device
4113 Frame rate control unit
4116 Frame thinning unit

Claims (41)

フレーム単位で順次入力される画像信号について符号化を行なう画像符号化装置であって、
前記符号化を行なう周期を示すフレームレートを受け付けるフレームレート受付手段と、
複数のフレームから構成されるフレーム群に全体として割り当て可能な総ビット数を特定する総ビット数特定手段と、
前記受け付けられたフレームレートと既に符号化されたフレームのフレーム数とに基づいて、前記フレーム群における未だ符号化されていないフレームのフレーム数を特定するフレーム数特定手段と、
前記特定された総ビット数と前記特定されたフレーム数とに基づいて、次に符号化するフレームに割り当てるビット数の目標値を算出する目標ビット数算出手段と、
前記算出されたビット数の目標値を用いて、次に符号化するフレームに係る量子化ステップを導出する量子化ステップ導出手段と、
前記導出された量子化ステップに基づいて量子化を行ない、当該量子化に基づいて符号化を行なう符号化手段と
を備えることを特徴とする画像符号化装置。
An image encoding device that performs encoding on an image signal sequentially input in frame units,
Frame rate receiving means for receiving a frame rate indicating a cycle of performing the encoding,
Total bit number specifying means for specifying the total number of bits that can be allocated to a frame group composed of a plurality of frames as a whole,
Based on the accepted frame rate and the number of already encoded frames, a frame number identification unit that identifies the number of unencoded frames in the frame group,
Based on the specified total number of bits and the specified number of frames, a target bit number calculation unit that calculates a target value of the number of bits to be allocated to the next frame to be encoded,
Using the target value of the calculated number of bits, a quantization step deriving unit that derives a quantization step for a frame to be encoded next,
An image coding apparatus comprising: coding means for performing quantization based on the derived quantization step and performing coding based on the quantization.
前記画像符号化装置は、さらに、
前記フレーム群におけるフレームの符号化に伴って割り当てが確定したビット数の平均値を算出する平均値算出手段と、
前記算出された、前記ビット数の目標値と前記ビット数の平均値とに対して所定の演算を行なって新たなビット数の目標値を特定する演算手段とを備え、
前記量子化ステップ導出手段は、前記演算手段によって特定されたビット数の目標値を用いて量子化ステップを導出する
ことを特徴とする請求項1記載の画像符号化装置。
The image encoding device further includes:
Average value calculation means for calculating the average value of the number of bits determined allocation with the encoding of the frame in the frame group,
Calculating means for performing a predetermined operation on the calculated target value of the number of bits and the average value of the number of bits to specify a new target value of the number of bits,
2. The image encoding apparatus according to claim 1, wherein the quantization step deriving unit derives the quantization step using a target value of the number of bits specified by the arithmetic unit.
前記総ビット数特定手段は、
前記フレーム群の先頭のフレームが所定のフレームの場合は、前記全体として割り当て可能なビット数の初期化を行なう総ビット数初期化部と、
前記全体として割り当て可能なビット数から直前の前記符号化により割り当てが確定したビット数を減じて更新する総ビット数更新部とを備える
ことを特徴とする請求項2記載の画像符号化装置。
The total bit number specifying means,
If the first frame of the frame group is a predetermined frame, a total bit number initialization unit that initializes the number of bits that can be allocated as a whole,
3. The image encoding apparatus according to claim 2, further comprising: a total bit number updating unit that updates the total number of bits by subtracting the number of bits assigned by the immediately preceding encoding from the total number of allocatable bits.
前記フレーム数特定手段は、
前記フレーム群における未だ符号化されていないフレームが符号化に要する期間を特定する対象期間特定部と、
前記フレーム群における一のフレームを符号化する毎に、前記受け付けた第2のフレームレートに基づいて前記符号化に要する期間を減じて更新する期間更新部と、
前記更新された符号化に要する期間と前記受け付けられたフレームレートとに基づいて、前記フレーム数を算出するフレーム数算出部とを備える
ことを特徴とする請求項3記載の画像符号化装置。
The frame number specifying means includes:
A target period identification unit that identifies a period required for encoding a frame that has not yet been encoded in the frame group,
Each time one frame in the frame group is encoded, a period update unit that updates the period required for the encoding by reducing the period based on the received second frame rate,
The image encoding apparatus according to claim 3, further comprising: a frame number calculating unit that calculates the number of frames based on the updated period required for encoding and the accepted frame rate.
前記目標ビット数算出手段は、
前記総ビット数更新部によって更新された総ビット数を前記特定されたフレーム数で除することによって前記ビット数の目標値を算出する
ことを特徴とする請求項4記載の画像符号化装置。
The target bit number calculation means,
The image encoding apparatus according to claim 4, wherein the target value of the number of bits is calculated by dividing the total number of bits updated by the total number of bits updating unit by the specified number of frames.
前記目標ビット数算出手段は、さらに、
前記算出されたビット数の目標値に対して、所定の係数を乗じて新たなビット数の目標値とする
ことを特徴とする請求項5記載の画像符号化装置。
The target bit number calculation means further includes:
6. The image encoding apparatus according to claim 5, wherein the target value of the calculated number of bits is multiplied by a predetermined coefficient to obtain a new target value of the number of bits.
前記演算手段は、
前記算出された、前記ビット数の目標値と前記ビット数の平均値とを比較して大きい方を前記新たなビット数の目標値として特定する
ことを特徴とする請求項5記載の画像符号化装置。
The calculating means includes:
6. The image encoding apparatus according to claim 5, wherein the calculated target value of the number of bits is compared with an average value of the number of bits, and a larger one is specified as the target value of the new number of bits. apparatus.
前記演算手段は、さらに、
予め設定された下限値と前記特定されたビット数の目標値とを比較して大きい方を前記新たなビット数の目標値として特定する
ことを特徴とする請求項7に記載の画像符号化装置。
The calculating means further comprises:
The image coding apparatus according to claim 7, wherein a lower limit set in advance is compared with the target value of the specified number of bits, and a larger one is specified as the target value of the new number of bits. .
前記平均値算出手段は、さらに、
前記算出されたビット数の平均値に対して、所定の係数を乗じて新たなビット数の平均値とする
ことを特徴とする請求項7に記載の画像符号化装置。
The average value calculating means further includes:
The image encoding apparatus according to claim 7, wherein the calculated average value of the number of bits is multiplied by a predetermined coefficient to obtain a new average value of the number of bits.
前記フレーム群は、複数のフレームセットから構成され、一のフレームセットに対して符号化を終えると、未だ符号化されていない新たなフレームセットを順次追加して新たなフレーム群を構成し、
前記フレームセットを構成するフレームは、MPEG規格におけるIピクチャ、Pピクチャ及びBピクチャの何れかであり、かつ、当該フレームセットを構成する各ピクチャの並び方が同じであり、
前記総ビット数特定手段は、さらに、
前記フレーム群における前記一のフレームセットに対する符号化に伴ってビット数の割り当てが確定する毎に、予め他のフレームセットに分配されていたビット数と前記一のフレームセットにおいて確定したビット数との差分を加味して、前記新たなフレーム群に全体として割り当て可能な総ビット数と、個々のフレームセットにおける割り当て可能なビット数とを特定し、
前記フレーム数特定手段は、さらに、
前記受け付けられたフレームレートと既に符号化されたフレームのフレーム数とに基づいて、前記他のフレームセットにおける未だ符号化されていないフレームのフレーム数を特定し、
前記目標ビット数算出手段は、さらに、
前記他のフレームセットに割り当て可能なビット数と前記特定されたフレーム数とに基づいて、次に符号化するフレームに割り当てるビット数の目標値を算出する
ことを特徴とする請求項1記載の画像符号化装置。
The frame group is composed of a plurality of frame sets, and when encoding is completed for one frame set, a new frame set not yet encoded is sequentially added to form a new frame group,
The frames constituting the frame set are any of I pictures, P pictures and B pictures in the MPEG standard, and the arrangement of the pictures constituting the frame set is the same,
The total bit number specifying means further includes:
Each time the assignment of the number of bits is determined along with the encoding for the one frame set in the frame group, the number of bits previously distributed to another frame set and the number of bits determined in the one frame set are determined. In consideration of the difference, the total number of bits that can be allocated as a whole to the new frame group and the number of bits that can be allocated in each frame set are specified,
The frame number specifying means further includes:
Based on the accepted frame rate and the number of already encoded frames, determine the number of unencoded frames in the other frame set,
The target bit number calculation means further includes:
2. The image according to claim 1, wherein a target value of the number of bits to be allocated to the next frame to be encoded is calculated based on the number of bits that can be allocated to the other frame set and the specified number of frames. Encoding device.
前記フレーム群の最初のフレームは画面内符号化されるフレームである
ことを特徴とする請求項1記載の画像符号化装置。
2. The image encoding apparatus according to claim 1, wherein the first frame of the group of frames is a frame to be intra-coded.
前記フレーム群の最後のフレームは画面内符号化されるフレームの直前のフレームである
ことを特徴とする請求項1記載の画像符号化装置。
The image encoding apparatus according to claim 1, wherein the last frame of the group of frames is a frame immediately before a frame to be intra-coded.
前記フレーム群の最初のフレームは画面内符号化されるフレームであり、最後のフレームは画面内符号化されるフレームの直前のフレームであることを特徴とする請求項1記載の画像符号化装置。2. The image encoding apparatus according to claim 1, wherein a first frame of the frame group is a frame to be intra-coded, and a last frame is a frame immediately before a frame to be intra-coded. 前記画像符号化装置は、さらに、
既に符号化されたが未送信のデータを格納する格納手段と、
前記格納手段に格納されているデータ量に基づいて、次に符号化するフレーム係るフレームレートを計算するフレームレート計算手段を備え、
前記フレームレート受付手段は、前記計算されたフレームレートを受け付ける
ことを特徴とする請求1記載の画像符号化装置。
The image encoding device further includes:
Storage means for storing already encoded but untransmitted data;
Based on the amount of data stored in the storage means, comprises a frame rate calculation means for calculating a frame rate for the next frame to be encoded,
2. The image encoding apparatus according to claim 1, wherein the frame rate receiving unit receives the calculated frame rate.
フレーム単位で順次入力される画像信号に対して符号化を行なう画像符号化方法であって、
前記符号化を行なう周期を示すフレームレートを受け付けるフレームレート受付ステップと、
複数のフレームから構成されるフレーム群に全体として割り当て可能な総ビット数を特定する総ビット数特定ステップと、
前記受け付けられたフレームレートと既に符号化されたフレームのフレーム数とに基づいて、前記フレーム群における未だ符号化されていないフレームのフレーム数を特定するフレーム数特定ステップと、
前記特定された総ビット数と前記特定されたフレーム数とに基づいて、次の符号化するフレームに割り当てるビット数の目標値を算出する目標ビット数算出ステップと、
前記算出されたビット数の目標値を用いて、次に符号化するフレームに係る量子化ステップを導出する量子化ステップ導出ステップと、
前記導出された量子化ステップに基づいて量子化を行ない、当該量子化に基づいて符号化を行なう符号化ステップと
を含むことを特徴とする画像符号化方法。
An image encoding method for encoding an image signal sequentially input in frame units,
A frame rate receiving step of receiving a frame rate indicating a cycle of performing the encoding,
A total bit number specifying step of specifying a total bit number that can be allocated as a whole to a frame group composed of a plurality of frames,
Based on the accepted frame rate and the number of already encoded frames, a frame number identifying step of identifying the number of unencoded frames in the frame group,
Based on the specified total number of bits and the specified number of frames, a target number of bits calculation step of calculating a target value of the number of bits to be allocated to the next frame to be encoded,
Using the target value of the calculated number of bits, a quantization step deriving step of deriving a quantization step for a frame to be encoded next,
An encoding step of performing quantization based on the derived quantization step, and performing encoding based on the quantization.
前記画像符号化方法は、さらに、
前記フレーム群におけるフレームの符号化に伴って割り当てが確定したビット数の平均値を算出する平均値算出ステップと、
前記算出された、前記ビット数の目標値と前記ビット数の平均値とに対して、所定の演算を行なって新たなビット数の目標値として特定する演算ステップとを含み、
前記量子化ステップ算出ステップは、前記演算ステップによって算出されたビット数の目標値を用いて量子化ステップを導出する
ことを特徴とする請求項15記載の画像符号化方法。
The image encoding method further includes:
An average value calculation step of calculating an average value of the number of bits whose allocation has been determined along with encoding of a frame in the frame group,
The calculated, the target value of the number of bits and the average value of the number of bits, performing a predetermined operation to specify as a new target value of the number of bits,
16. The image encoding method according to claim 15, wherein the quantization step calculating step derives a quantization step using a target value of the number of bits calculated in the calculation step.
フレーム単位で入力される画像信号に対して符号化を行なう画像符号化装置のためのプログラムであって、
前記符号化を行なう周期を示すフレームレートを受け付けるフレームレート受付ステップと、
複数のフレームから構成されるフレーム群に全体として割り当て可能な総ビット数を特定する総ビット数特定ステップと、
前記受け付けられたフレームレートと既に符号化されたフレームのフレーム数とに基づいて、前記フレーム群における未だ符号化されていないフレームのフレーム数を特定するフレーム数特定ステップと、
前記特定された総ビット数と前記特定されたフレーム数とに基づいて、次に符号化するフレームに割り当てるビット数の目標値を算出する目標ビット数算出ステップと、
前記算出されたビット数の目標値を用いて、次の符号化するフレームに係る量子化ステップを導出する量子化ステップ導出ステップと、
前記導出された量子化ステップに基づいて量子化を行ない、当該量子化に基づいて符号化を行なう符号化ステップと
を含むことを特徴とするプログラム。
A program for an image encoding device that performs encoding on an image signal input in frame units,
A frame rate receiving step of receiving a frame rate indicating a cycle of performing the encoding,
A total bit number specifying step of specifying a total bit number that can be allocated as a whole to a frame group composed of a plurality of frames,
Based on the accepted frame rate and the number of already encoded frames, a frame number identifying step of identifying the number of unencoded frames in the frame group,
Based on the specified total number of bits and the specified number of frames, a target bit number calculation step of calculating a target value of the number of bits to be allocated to the next frame to be encoded,
Using the target value of the calculated number of bits, a quantization step deriving step of deriving a quantization step for the next frame to be encoded,
A coding step of performing quantization based on the derived quantization step and performing coding based on the quantization.
前記プログラムは、さらに、
前記フレーム群におけるフレームの符号化に伴って割り当てが確定したビット数の平均値を算出する平均値算出ステップと、
前記算出された、前記ビット数の目標値と前記ビット数の平均値とに対して、所定の演算を行なって新たなビット数の目標値として特定する演算ステップとを含み、
前記量子化ステップ算出ステップは、前記演算ステップによって算出されたビット数の目標値を用いて量子化ステップを導出する
ことを特徴とする請求項17記載のプログラム。
The program further comprises:
An average value calculation step of calculating an average value of the number of bits whose allocation has been determined along with encoding of a frame in the frame group,
The calculated, the target value of the number of bits and the average value of the number of bits, performing a predetermined operation to specify as a new target value of the number of bits,
18. The program according to claim 17, wherein the quantization step calculation step derives the quantization step using a target value of the number of bits calculated in the calculation step.
フレーム単位で順次入力される画像信号に対して符号化を行なう画像符号化装置のためのプログラムが記録されたコンピュータが読み取り可能な記録媒体であって、
前記プログラムは、
前記符号化を行なう周期を示すフレームレートを受け付けるフレームレート受付ステップと、
複数のフレームから構成されるフレーム群に全体として割り当て可能な総ビット数を特定する総ビット数特定ステップと、
前記受け付けられたフレームレートと既に符号化されたフレームのフレーム数とに基づいて、前記フレーム群における未だ符号化されていないフレームのフレーム数を特定するフレーム数特定ステップと、
前記特定された総ビット数と前記特定されたフレーム数とに基づいて、次に符号化するフレームに割り当てるビット数の目標値を算出する目標ビット数算出ステップと、
前記算出されたビット数の目標値を用いて、次の符号化するフレームに係る量子化ステップを導出する量子化ステップ導出ステップと、
前記導出された量子化ステップに基づいて量子化を行ない、当該量子化に基づいて符号化を行なう符号化ステップと
を含むことを特徴とする記録媒体。
A computer-readable recording medium in which a program for an image encoding device that performs encoding on an image signal sequentially input in frame units is recorded,
The program is
A frame rate receiving step of receiving a frame rate indicating a cycle of performing the encoding,
A total bit number specifying step of specifying a total bit number that can be allocated as a whole to a frame group composed of a plurality of frames,
Based on the accepted frame rate and the number of already encoded frames, a frame number identifying step of identifying the number of unencoded frames in the frame group,
Based on the specified total number of bits and the specified number of frames, a target bit number calculation step of calculating a target value of the number of bits to be allocated to the next frame to be encoded,
Using the target value of the calculated number of bits, a quantization step deriving step of deriving a quantization step for the next frame to be encoded,
A coding step of performing quantization based on the derived quantization step and performing coding based on the quantization.
フレーム単位で順次入力される画像信号に対して符号化を行なう画像符号化装置のためのプログラムが記録されたコンピュータが読み取り可能な記録媒体であって、
前記プログラムは、
前記符号化を行なう周期を示すフレームレートを受け付けるフレームレート受付ステップと、
複数のフレームから構成されるフレーム群の全体として割り当て可能な総ビット数を特定する総ビット数特定ステップと、
前記受け付けられたフレームレートと既に符号化されたフレームのフレーム数とに基づいて、前記フレーム群における未だ符号化されていないフレームのフレーム数を特定するフレーム数特定ステップと、
前記特定された総ビット数と前記特定されたフレーム数とに基づいて、次に符号化するフレームに割り当てるビット数の目標値を算出する目標ビット数算出ステップと、
前記フレーム群におけるフレームの符号化に伴って割り当てが確定したビット数の平均値を算出する平均値算出ステップと、
前記算出された、前記ビット数の目標値と前記ビット数の平均値とに対して、所定の演算を行なって新たなビット数の目標値として特定する演算ステップと、前記特定されたビット数の目標値を用いて、次に符号化するフレームに係る量子化ステップを導出する量子化ステップ導出ステップと、
前記導出された量子化ステップに基づいて量子化を行ない、当該量子化に基づいて符号化を行なう符号化ステップとを含む
ことを特徴とする記録媒体。
A computer-readable recording medium in which a program for an image encoding device that performs encoding on an image signal sequentially input in frame units is recorded,
The program is
A frame rate receiving step of receiving a frame rate indicating a cycle of performing the encoding,
A total bit number specifying step of specifying a total bit number that can be allocated as a whole of a frame group including a plurality of frames;
Based on the accepted frame rate and the number of already encoded frames, a frame number identifying step of identifying the number of unencoded frames in the frame group,
Based on the specified total number of bits and the specified number of frames, a target bit number calculation step of calculating a target value of the number of bits to be allocated to the next frame to be encoded,
An average value calculation step of calculating an average value of the number of bits whose allocation has been determined along with encoding of a frame in the frame group,
An operation step of performing a predetermined operation on the calculated target value of the number of bits and the average value of the number of bits to specify the target value of the new number of bits; and Using a target value, a quantization step deriving step of deriving a quantization step for a frame to be encoded next,
A coding step of performing quantization based on the derived quantization step and performing coding based on the quantization.
フレーム単位で順次入力される画像信号に対して符号化を行なう画像符号化装置であって、
前記画像信号の周波数成分を前記フレーム毎に量子化し、前記量子化された結果に基づいて符号化する符号化手段と、
複数のフレームから構成されるフレーム群に全体として割り当てられた総ビット数と割り当て済みのビット数とに基づいて、次に符号化するフレームの量子化の幅を計算する量子化幅計算手段と、
前記計算された量子化の幅に基づいて、次に符号化するフレームについて符号化すべき周期を示す符号化フレームレートを計算するフレームレート計算手段と、
前記符号化フレームレートに基づいて、前記符号化手段に入力される前記画像信号の取捨を制御する入力制御手段とを備え、
前記符号化手段は、入力された前記画像信号を前記量子化の幅で量子化する
ことを特徴とする画像符号化装置。
An image encoding device that performs encoding on an image signal sequentially input in frame units,
Encoding means for quantizing the frequency component of the image signal for each frame, and encoding based on the quantized result;
Quantization width calculation means for calculating a quantization width of a frame to be encoded next, based on the total number of bits and the number of bits already allocated to a frame group including a plurality of frames as a whole,
Frame rate calculation means for calculating an encoding frame rate indicating a cycle to be encoded for a frame to be encoded next, based on the calculated quantization width,
Based on the encoding frame rate, comprising an input control means for controlling the discard of the image signal input to the encoding means,
The image encoding apparatus according to claim 1, wherein the encoding unit quantizes the input image signal by the quantization width.
前記画像符号化装置は、さらに、
前記符号化手段によって符号化された符号化データを保持し、保持している前記符号化データを一定量ずつ外部に出力する送信バッファを備え、
前記量子化幅計算手段は、前記送信バッファ内に未出力のまま残留している符号化データのデータ量に基づいて前記量子化の幅を計算する
ことを特徴とする請求項21記載の画像符号化装置。
The image encoding device further includes:
A transmission buffer that holds encoded data encoded by the encoding unit and outputs the retained encoded data to the outside by a fixed amount,
22. The image code according to claim 21, wherein the quantization width calculation means calculates the quantization width based on the amount of encoded data remaining unoutput in the transmission buffer. Device.
前記量子化幅計算手段は、前記符号化によって発生する符号量が所定量を超えると、次に符号化するフレームに係る前記量子化の幅を大きくする
ことを特徴とする請求項22記載の画像符号化装置。
23. The image according to claim 22, wherein the quantization width calculation unit increases the quantization width of a frame to be encoded next when the code amount generated by the encoding exceeds a predetermined amount. Encoding device.
前記量子化幅計算手段は、
前記符号化によって発生する符号量と、所定のしきい値との大小を比較する比較部と、
前記比較の結果、前記発生符号量が前記しきい値を超えると、直前の入力フレームに対して計算された前記量子化の幅に、1より大きい所定の係数を乗算する乗算部と、
前記乗算結果を量子化幅の予測値として、所定の値の範囲から前記予測値に最も近い値を、次に符号化するフレームに係る量子化の幅を決定する量子化幅決定部と
を備えることを特徴とする請求項23記載の画像符号化装置。
The quantization width calculation means,
A comparison unit that compares the amount of code generated by the encoding with a predetermined threshold value;
As a result of the comparison, when the generated code amount exceeds the threshold value, a multiplication unit that multiplies the quantization width calculated for the immediately preceding input frame by a predetermined coefficient greater than 1.
A quantization width determination unit configured to determine a value closest to the prediction value from a predetermined value range as a prediction value of a quantization width using the multiplication result as a prediction value of a quantization width, and a quantization width of a frame to be encoded next. The image encoding device according to claim 23, wherein:
前記量子化幅計算手段は、さらに、前記符号化によって発生する符号量が所定量以下になると前記量子化の幅が小さくなるよう計算する
ことを特徴とする請求項24記載の画像符号化装置。
25. The image coding apparatus according to claim 24, wherein said quantization width calculation means further performs calculation such that when the code amount generated by said coding becomes equal to or less than a predetermined amount, said quantization width becomes smaller.
前記乗算部は、さらに、前記比較の結果、前記発生符号量が前記しきい値以下の場合、直前の入力フレームに対して計算された前記量子化の幅に、1より小さい所定の係数を乗算する
ことを特徴とする請求項25記載の画像符号化装置。
The multiplying unit further multiplies the quantization width calculated for the immediately preceding input frame by a predetermined coefficient smaller than 1 when the generated code amount is equal to or smaller than the threshold value as a result of the comparison. 26. The image encoding apparatus according to claim 25, wherein:
前記乗算部は、さらに、前記比較の結果、前記発生符号量が前記しきい値より大きい場合、直前の入力フレームに対して計算された前記量子化の幅に、1より大きい所定の係数を乗算する
ことを特徴とする請求項25記載の画像符号化装置。
The multiplying unit further multiplies the quantization width calculated for the immediately preceding input frame by a predetermined coefficient greater than 1 when the generated code amount is larger than the threshold value as a result of the comparison. 26. The image encoding apparatus according to claim 25, wherein:
前記量子化幅計算手段は、さらに、
前記符号化によって発生する符号量が多くなるほど、前記量子化の幅を大きくする係数の値を前記発生符号量に対応付けて示した係数表を予め保持している係数表保持部と、
前記係数表に基づいて、直前の入力フレームに対して計算された前記量子化の幅に、前記発生符号量に応じた係数を乗算する第2乗算部とを備え、
前記量子化幅決定部は、前記第2乗算部による乗算結果を量子化幅の予測値として、次に符号化するフレームに係る量子化の幅を決定する
ことを特徴とする請求項24記載の画像符号化装置。
The quantization width calculation means further includes:
A coefficient table holding unit that holds in advance a coefficient table indicating a value of a coefficient that increases the width of the quantization in association with the generated code amount, as the code amount generated by the coding increases,
A second multiplier for multiplying the quantization width calculated for the immediately preceding input frame by a coefficient corresponding to the generated code amount based on the coefficient table,
25. The quantization width determination unit according to claim 24, wherein the quantization width determination unit determines a quantization width of a frame to be encoded next, using a result of the multiplication by the second multiplication unit as a prediction value of the quantization width. Image coding device.
前記量子化幅計算手段は、直近のフレームにおいて量子化に用いられた前記量子化の幅に前記係数を乗算して、次に符号化するフレームに係る量子化の幅を計算する
ことを特徴とする請求項24記載の画像符号化装置。
The quantization width calculation means multiplies the quantization width used for quantization in the most recent frame by the coefficient to calculate a quantization width for a frame to be encoded next. 25. The image encoding device according to claim 24, wherein:
前記フレームレート計算手段は、前記量子化の幅の予測値が所定のしきい値を超えると、次に符号化するフレームに係る符号化フレームレートを大きくする
ことを特徴とする請求項24記載の画像符号化装置。
25. The frame rate calculation unit according to claim 24, wherein when the predicted value of the quantization width exceeds a predetermined threshold value, the frame rate calculation unit increases an encoding frame rate for a frame to be encoded next. Image coding device.
前記フレームレート計算手段は、前記量子化の幅の予測値が前記しきい値を超えると、現在の符号化フレームレートに、1より大きい所定の係数を乗算して、次に符号化するフレームに係る符号化フレームレートとする
ことを特徴とする請求項30記載の画像符号化装置。
When the predicted value of the quantization width exceeds the threshold value, the frame rate calculation unit multiplies the current encoding frame rate by a predetermined coefficient greater than 1 to generate a frame to be encoded next. 31. The image encoding apparatus according to claim 30, wherein said encoding frame rate is set to such an encoding frame rate.
前記フレームレート計算手段は、さらに、前記量子化幅の予測値が前記しきい値以下になると、次に符号化するフレームに係る符号化フレームレートを小さくする
ことを特徴とする請求項30記載の画像符号化装置。
31. The frame rate calculation unit according to claim 30, wherein, when the predicted value of the quantization width is equal to or smaller than the threshold value, the frame rate calculation unit further reduces an encoding frame rate of a frame to be encoded next. Image coding device.
前記フレームレート計算手段は、さらに、前記量子化幅の予測値が前記しきい値以下になると、現在の符号化フレームレートに、1より小さい所定の係数を乗算して、次に符号化するフレームに係る符号化フレームレートとする
ことを特徴とする請求項31記載の画像符号化装置。
When the predicted value of the quantization width is equal to or smaller than the threshold value, the frame rate calculating means further multiplies the current encoding frame rate by a predetermined coefficient smaller than 1 to obtain a frame to be encoded next. 32. The image encoding apparatus according to claim 31, wherein the encoding frame rate is set to:
前記フレームレート計算手段は、決定された前記量子化の幅が所定のしきい値を超えると、次に符号化するフレームに係る符号化フレームレートを大きくし、前記しきい値以下になると、次に符号化するフレームに係る符号化フレームレートを小さくする
ことを特徴とする請求項24記載の画像符号化装置。
When the determined width of the quantization exceeds a predetermined threshold, the frame rate calculation means increases the coding frame rate for the next frame to be coded. 25. The image coding apparatus according to claim 24, wherein a coding frame rate of the frame to be coded is reduced.
前記フレームレート計算手段は、
決定された前記量子化の幅の平均値を計算する量子化幅平均部を備え、
前記フレームレート計算手段は、前記量子化の幅の平均値が所定のしきい値を超えると、次に符号化するフレームに係る符号化フレームレートを大きくし、前記しきい値以下になると、次に符号化するフレームに係る符号化フレームレートを小さくする
ことを特徴とする請求項24記載の画像符号化装置。
The frame rate calculation means,
A quantization width averaging unit that calculates an average value of the determined quantization width,
When the average value of the quantization width exceeds a predetermined threshold, the frame rate calculation means increases the encoding frame rate for the next frame to be encoded. 25. The image coding apparatus according to claim 24, wherein a coding frame rate of a frame to be coded is reduced.
前記フレームレート計算手段は、前記符号化によって発生した符号量が所定のしきい値を超えた場合、さらに、前記計算された符号化フレームレートに1より小さい所定の係数を乗算して、新たに前記計算された符号化フレームレートとする
ことを特徴とする請求項21記載の画像符号化装置。
When the code amount generated by the coding exceeds a predetermined threshold value, the frame rate calculation means further multiplies the calculated coding frame rate by a predetermined coefficient smaller than 1 to newly generate the frame rate. The image coding apparatus according to claim 21, wherein the calculated coding frame rate is used.
前記フレームレート計算手段は、前記符号化によって発生した符号量が所定のしきい値以下の場合、さらに、前記計算された符号化フレームレートに1より大きい所定の係数を乗算して、新たに前記計算された符号化フレームレートとする
ことを特徴とする請求項21記載の画像符号化装置。
When the code amount generated by the encoding is equal to or less than a predetermined threshold, the frame rate calculation unit further multiplies the calculated encoding frame rate by a predetermined coefficient larger than 1 to newly generate 22. The image coding apparatus according to claim 21, wherein the calculated coding frame rate is used.
前記入力制御手段は、さらに、
前記フレームレート計算手段の計算結果である符号化フレームレートの平均値を算出するフレームレート平均部を備え、
前記入力制御手段は、前記フレームレート平均部によって算出された前記平均値に基づいて、前記入力される画像信号の取捨を制御する
ことを特徴とする請求項21記載の画像符号化装置。
The input control means further comprises:
A frame rate averaging unit that calculates an average value of an encoding frame rate that is a calculation result of the frame rate calculation unit,
22. The image encoding apparatus according to claim 21, wherein the input control unit controls discarding of the input image signal based on the average value calculated by the frame rate averaging unit.
フレーム単位の画像信号を符号化する画像符号化装置のためのプログラムであって、
前記画像信号の周波数成分を前記フレーム毎に量子化し、前記量子化された結果に基づいて符号化する符号化ステップと、
前記フレーム群に係る総ビット数と前記割り当て済みのビット数に基づいて、次に符号化すべきフレームの量子化の幅を計算する量子化幅計算ステップと、
前記計算された量子化の幅に基づいて、次に符号化するフレームについて符号化すべき周期を示す符号化フレームレートを計算するフレームレート計算ステップと、
前記符号化フレームレートに基づいて、前記符号化ステップに入力される前記画像信号の取捨を制御する入力制御ステップとを含み、
前記符号化ステップは、入力された前記画像信号を前記量子化の幅で量子化することを特徴とするプログラム。
A program for an image encoding device that encodes an image signal in frame units,
An encoding step of quantizing a frequency component of the image signal for each frame, and encoding based on the quantized result;
A quantization width calculation step of calculating a quantization width of a frame to be encoded next, based on the total number of bits related to the frame group and the number of allocated bits,
A frame rate calculating step of calculating an encoding frame rate indicating a cycle to be encoded for a frame to be encoded next, based on the calculated quantization width;
An input control step of controlling discarding of the image signal input to the encoding step, based on the encoding frame rate,
The program, wherein the encoding step quantizes the input image signal by the quantization width.
フレーム単位の画像信号を符号化する画像符号化装置のためのプログラムを記録したコンピュータ読み取り可能な記録媒体であって、
前記プログラムは、
前記画像信号の周波数成分を前記フレーム毎に量子化し、前記量子化された結果に基づいて符号化する符号化ステップと、
前記フレーム群に係る総ビット数と前記割り当て済みのビット数に基づいて、次に符号化すべきフレームの量子化の幅を計算する量子化幅計算ステップと、
前記計算された量子化の幅に基づいて、次に符号化するフレームについて符号化すべき周期を示す符号化フレームレートを計算するフレームレート計算ステップと、
前記符号化フレームレートに基づいて、前記符号化ステップに入力される前記画像信号の取捨を制御する入力制御ステップとを含み、
前記符号化ステップは、入力された前記画像信号を前記量子化の幅で量子化することを特徴とする記録媒体。
A computer-readable recording medium that records a program for an image encoding device that encodes an image signal in frame units,
The program is
An encoding step of quantizing a frequency component of the image signal for each frame, and encoding based on the quantized result;
A quantization width calculation step of calculating a quantization width of a frame to be encoded next, based on the total number of bits related to the frame group and the number of allocated bits,
A frame rate calculating step of calculating an encoding frame rate indicating a cycle to be encoded for a frame to be encoded next, based on the calculated quantization width;
An input control step of controlling discarding of the image signal input to the encoding step, based on the encoding frame rate,
The recording medium, wherein the encoding step quantizes the input image signal with the quantization width.
フレーム単位の画像信号を符号化する画像符号化方法であって、
前記画像信号の周波数成分を前記フレーム毎に量子化し、前記量子化された結果に基づいて符号化する符号化ステップと、
前記フレーム群に係る総ビット数と前記割り当て済みのビット数に基づいて、次に符号化すべきフレームの量子化の幅を計算する量子化幅計算ステップと、
前記計算された量子化の幅に基づいて、次に符号化するフレームについて符号化すべき周期を示す符号化フレームレートを計算するフレームレート計算ステップと、
前記符号化フレームレートに基づいて、前記符号化ステップに入力される前記画像信号の取捨を制御する入力制御ステップとを含み、
前記符号化ステップは、入力された前記画像信号を前記量子化の幅で量子化することを特徴とする画像符号化方法。
An image encoding method for encoding an image signal in frame units,
An encoding step of quantizing a frequency component of the image signal for each frame, and encoding based on the quantized result;
A quantization width calculation step of calculating a quantization width of a frame to be encoded next, based on the total number of bits related to the frame group and the number of allocated bits,
A frame rate calculating step of calculating an encoding frame rate indicating a cycle to be encoded for a frame to be encoded next, based on the calculated quantization width;
An input control step of controlling discarding of the image signal input to the encoding step, based on the encoding frame rate,
The image encoding method, wherein the encoding step quantizes the input image signal by the quantization width.
JP2003120626A 2002-04-25 2003-04-24 Image coding apparatus and image coding method Expired - Fee Related JP4490046B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003120626A JP4490046B2 (en) 2002-04-25 2003-04-24 Image coding apparatus and image coding method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2002124750 2002-04-25
JP2002124749 2002-04-25
JP2003120626A JP4490046B2 (en) 2002-04-25 2003-04-24 Image coding apparatus and image coding method

Publications (2)

Publication Number Publication Date
JP2004007619A true JP2004007619A (en) 2004-01-08
JP4490046B2 JP4490046B2 (en) 2010-06-23

Family

ID=30449170

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003120626A Expired - Fee Related JP4490046B2 (en) 2002-04-25 2003-04-24 Image coding apparatus and image coding method

Country Status (1)

Country Link
JP (1) JP4490046B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008236333A (en) * 2007-03-20 2008-10-02 Toshiba Corp Video encoder and video encoding method
JP2009141543A (en) * 2007-12-05 2009-06-25 Nec Saitama Ltd Cellular phone terminal and cellular phone terminal control method
US10419663B2 (en) 2016-03-14 2019-09-17 Renesas Electronics Corporation Semiconductor device, encoding control method and camera device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008236333A (en) * 2007-03-20 2008-10-02 Toshiba Corp Video encoder and video encoding method
JP2009141543A (en) * 2007-12-05 2009-06-25 Nec Saitama Ltd Cellular phone terminal and cellular phone terminal control method
US10419663B2 (en) 2016-03-14 2019-09-17 Renesas Electronics Corporation Semiconductor device, encoding control method and camera device

Also Published As

Publication number Publication date
JP4490046B2 (en) 2010-06-23

Similar Documents

Publication Publication Date Title
JP4111351B2 (en) Apparatus and method for optimizing rate control in a coding system
US7072396B2 (en) Motion video signal encoder and encoding method
US6654417B1 (en) One-pass variable bit rate moving pictures encoding
US6697567B1 (en) Dynamic image encoding apparatus
KR0141824B1 (en) Image compressing method &amp; apparatus of variable length
US7065138B2 (en) Video signal quantizing apparatus and method thereof
JP2001510311A (en) Object-based rate control apparatus and method in coding scheme
KR20010021879A (en) Apparatus and method for macroblock based rate control in a coding system
KR20040011100A (en) Advanced method for rate control and apparatus thereof
US7151856B2 (en) Picture coding apparatus and picture coding method
JP2003018603A (en) Method and device for encoding moving image
JP7015183B2 (en) Image coding device and its control method and program
US20080187052A1 (en) Video coding device, video recording device, video coding method, and video coding program
JPWO2005064947A1 (en) Video coding method and apparatus
CN101390389A (en) Method and apparatus for selection of bit budget adjustment in dual pass encoding
KR20000023504A (en) Variable bit rate coding apparatus
US6647060B1 (en) Video compression device and video compression method
JP2004007619A (en) Image coding apparatus and method therefor
JP2004328150A (en) Moving picture coding apparatus and method
JP2000261799A (en) Variable rate moving image encoding device
JPH11196410A (en) Method and device for dynamic picture encoding and dynamic picture signal record medium
JP2000092489A (en) Device and method for image encoding and medium recorded with program
JP3307367B2 (en) Variable transfer rate coding device
JP4007398B2 (en) Quantization control apparatus and method
JPH11234671A (en) Signal processing unit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051212

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090519

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090710

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100302

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100401

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

Free format text: PAYMENT UNTIL: 20130409

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130409

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140409

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees