JP4560694B2 - Encoding apparatus and method thereof - Google Patents
Encoding apparatus and method thereof Download PDFInfo
- Publication number
- JP4560694B2 JP4560694B2 JP2000142564A JP2000142564A JP4560694B2 JP 4560694 B2 JP4560694 B2 JP 4560694B2 JP 2000142564 A JP2000142564 A JP 2000142564A JP 2000142564 A JP2000142564 A JP 2000142564A JP 4560694 B2 JP4560694 B2 JP 4560694B2
- Authority
- JP
- Japan
- Prior art keywords
- quantization
- coefficient
- encoding
- bit
- discrete cosine
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は符号化装置及びその方法に関し、例えば動画像データを圧縮符号化するエンコーダ及びその圧縮符号化された動画像データを復号化するデコーダに適用して好適なものである。
【0002】
【従来の技術】
従来、この種の符号化装置や復号化装置が設けられたシステムとして、例えば、テレビ会議システムやテレビ電話システム等のような動画像データを遠隔地に伝送するシステムがある。
【0003】
そして、かかるシステムにおいては、伝送路を効率良く利用して動画像データを伝送するために、フレーム単位の画像のライン相関やフレーム間相関を利用して動画像データを順次フレーム単位で圧縮符号化している。
【0004】
ここで、動画像データを高能率符号化する圧縮符号化方式の代表的なものとしては、MPEG2(Moving Picture Experts Group 2:蓄積用動画像符号化)方式がある。
【0005】
このMPEG2方式は、ISO−IEC/JTC1/SC2/WG11(International Organization for Standardization−International Electrotechnical Commission/Joint Technical Committee 1/Sub Committee 2/Working Group11)において議論され、標準案として提案されたものであり、動き補償予測符号化とDCT(Discrete Cosine Transform:離散コサイン変換)符号化とを組み合わせたハイブリッド方式が採用されている。
【0006】
また、MPEG2方式では、様々なアプリケーションや機能に対応するために、いくつかのプロファイル及びレベルが定義されており、その最も基本となるものは、メインプロファイルメインレベル(MP@ML:Main Profile at Main Level)である。
【0007】
ここで、MPEG2方式におけるメインプロファイルメインレベルを適用したエンコーダとしては、例えば、図24に示すように構成されたものがある。
【0008】
すなわち、図24に示すエンコーダ1においては、外部から供給される圧縮符号化対象の動画像データを順次フレーム単位でフレームメモリ2に取り込み、当該取り込んだフレーム単位の画像データ(以下、これをフレーム画像データと呼ぶ)を一時記憶する。
【0009】
この場合、フレームメモリ2に供給されるフレーム画像データは、MPEG2方式に従って輝度成分と2つの色差成分とから構成され、それぞれの画素値のビット精度(すなわち、色の階調の精度)として8ビットの精度をもった8ビット画像のみが供給可能なものとして定義されている。
【0010】
因みに、フレーム画像データにおいて、8ビットの精度をもつということは、輝度成分と2つの色差成分とのそれぞれの値(すなわち、色の階調)の取り得る範囲が0〜225(256階調)ということになる。
【0011】
動きベクトル検出器3は、フレームメモリ2に記憶されたフレーム画像データを、例えば、16画素×16ライン等で構成されるマクロブロック単位で読み出し、当該読み出したマクロブロックのデータ(以下、これをマクロブロックデータと呼ぶ)の動きベクトルを検出する。
【0012】
ここで、動きベクトル検出器3においては、各フレーム画像データを、I(Intra)ピクチャ(フレーム内符号化画像)、P(Predictive)ピクチャ(前方予測符号化画像)又はB(Bidirectionally predictive)ピクチャ(両方向予測符号化画像)のうちのいずれかとして処理する。
【0013】
因みに、動きベクトル検出器3においては、シーケンシャルに入力される各フレーム画像データを、Iピクチャ、Pピクチャ、Bピクチャのうちのいずれのピクチャとして処理するかが、例えば、予め定められている(例えば、連続するフレーム画像データがIピクチャ,Bピクチャ,Pピクチャ,Bピクチャ,Pピクチャ,……,Bピクチャ,Pピクチャの並びとして処理される)。
【0014】
実際上、動きベクトル検出器3は、フレームメモリ2に記憶されたフレーム画像データの中の、予め定められた所定の参照用のフレーム画像データ(以下、これを参照フレーム画像データと呼ぶ)を参照し、その参照フレーム画像データと、現在、圧縮符号化対象となっているフレーム画像データの16画素×16ラインのマクロブロックデータとをパターンマッチング(ブロックマッチング)することにより、そのマクロブロックデータの動きベクトルを検出する。
【0015】
ここで、MPEG方式(MPEG1方式及びMPEG2方式)においては、マクロブロックデータの符号化モードとして、イントラ符号化(フレーム内符号化)モード、前方予測符号化モード、後方予測符号化モード、両方向予測符号化モードの4種類が規定されている。
【0016】
そして、Iピクチャのマクロブロックデータはイントラ符号化モードに従いイントラ符号化される。また、Pピクチャのマクロブロックデータはイントラ符号化モード又は前方予測符号化モードのいずれかに従いイントラ符号化又は前方予測符号化される。
【0017】
さらに、Bピクチャのマクロブロックデータはイントラ符号化モード、前方予測符号化モード、後方予測符号化モード又は両方向予測符号化モードのいずれかに従いイントラ符号化、前方予測符号化、後方予測符号化又は両方向予測符号化される。因みに、これら符号化モードは同一のフレーム画像データ内であっても、マクロブロックデータ単位で選択し得るように規定されている。
【0018】
このため、動きベクトル検出器3は、Iピクチャのマクロブロックデータについては符号化モードをイントラ符号化モードに設定し、そのマクロブロックデータの動きベクトルは検出せずに、イントラ符号化モードに設定したことを表す符号化モード情報を可変長符号化(VLC:Variable Length Coding)器4及び動き補償器5に送出する。
【0019】
また、動きベクトル検出器3は、Pピクチャのマクロブロックデータについては前方予測を行うことにより当該マクロブロックデータの動きベクトルを検出すると共に、その前方予測を行うことにより生じる予測誤差と、圧縮符号化対象のマクロブロックデータ(Pピクチャのマクロブロックデータ)の例えば分散とを比較する。
【0020】
そして、動きベクトル検出器3は、その比較の結果、マクロブロックデータの分散の方が予測誤差よりも小さいときには、符号化モードをイントラ符号化モードに設定して、これを表す符号化モード情報を可変長符号化器4及び動き補償器5に送出する。
【0021】
これに対して、動きベクトル検出器3は、マクロブロックデータの分散よりも予測誤差の方が小さいときには、符号化モードを前方予測符号化モードに設定し、当該設定した前方符号化モードを表す符号化モード情報を、検出した動きベクトルと共に可変長符号化器4及び動き補償器5に送出する。
【0022】
さらに、動きベクトル検出器3は、Bピクチャのマクロブロックデータについては、前方予測、後方予測及び両方向予測を行うことによりこれら前方予測、後方予測及び両方向予測毎にマクロブロックデータの動きベクトルを検出する。
【0023】
この場合、動きベクトル検出器3は、前方予測、後方予測及び両方向予測によって生じた予測誤差のなかから最小の予測誤差(以下、これを最小予測誤差と呼ぶ)を検出し、当該検出した最小予測誤差と、圧縮符号化対象のマクロブロックデータ(Bピクチャのマクロブロックデータ)の、例えば分散とを比較する。
【0024】
そして、動きベクトル検出器3は、その比較の結果、マクロブロックデータの分散の方が最小予測誤差よりも小さいときには、符号化モードをイントラ符号化モードに設定して、これを表す符号化モード情報を可変長符号化器4及び動き補償器5に送出する。
【0025】
これに対して、動きベクトル検出器3は、マクロブロックデータの分散よりも最小予測誤差の方が小さいときには、符号化モードをその最小予測誤差が得られた前方予測、後方予測及び両方向予測に応じた前方予測符号化モード、後方予測符号化モード又は両方向予測符号化モードに設定し、当該設定した前方予測符号化モード、後方予測符号化モード又は両方向予測符号化モードを表す符号化モード情報を、対応する動きベクトルと共に可変長符号化器4及び動き補償器5に送出する。
【0026】
動き補償器5は、動きベクトル検出器3から与えられる符号化モード情報及び動きベクトルに基づいて、フレームメモリ6からこれに記憶されている、圧縮符号化され、かつすでに局所復号化されたフレーム画像データ(以下、これを局所復号化フレーム画像データと呼ぶ)を読み出し、当該読み出した局所復号化フレーム画像データをマクロブロックデータの予測用のフレーム画像データ(以下、これを予測フレーム画像データと呼ぶ)として演算器7及び8に送出する。
【0027】
演算器7は、動きベクトル検出器3がフレームメモリ2から読み出したマクロブロックデータと同一のマクロブロックデータをそのフレームメモリ2から読み出し、当該読み出したマクロブロックデータと、動き補償器5から与えられた予測フレーム画像データ内の対応するマクロブロックデータとの差分値を算出し、これを差分値データとしてDCT器9に送出する。
【0028】
因みに、演算器7から得られる出力画像(DCT器9への入力画像)の画素値のビット精度は、対応するマクロブロックデータ同士の差分値であるため8ビットから1ビット増えて9ビットとなり、その値の取り得る範囲は−255〜+255となる。
【0029】
一方、動き補償器5は、動きベクトル検出器3から符号化モード情報のみが与えられたとき、符号化モードがイントラ符号化モードであるため、予測フレーム画像データを送出しない。
【0030】
従って、演算器7(演算器8も同様)は、このとき、特に処理を行わずにフレームメモリ2から読み出したマクロブロックデータをそのまま差分値データとしてDCT器9に送出する。
【0031】
DCT器9は、演算器7から与えられた差分値データに対して離散コサイン変換処理(以下、これをDCT処理と呼ぶ)を施し、その結果得られた離散コサイン変換係数(以下、これをDCT係数と呼ぶ)を量子化器10に送出する。
【0032】
因みに、DCT器9においては、MPEG方式の規定に従い16画素×16ラインからなるマクロブロックデータを、さらに8画素×8ラインからなるブロックに再分割し、これら8画素×8ラインのブロックのデータに対してDCT処理を行う。
【0033】
また、DCT器9においては、MPEG方式の規定に従い、差分値データにDCT処理を施すことにより、その差分値データの9ビットの精度を3ビット増加させた12ビットの精度のDCT係数を量子化器10に送出している。因みに、かかるDCT係数の値の取り得る範囲は−2048〜+2047となる。
【0034】
量子化器10は、バッファ11から与えられるデータ蓄積量(バッファ11に記憶されているデータの量)に対応して(バッファフィードバック)量子化スケールを設定し、当該設定した量子化スケールに基づいて、DCT器9から与えられたDCT係数を量子化する。因みに、量子化器10は、DCT係数を量子化した結果生じる端数に対しては、例えば4捨5入といった丸め処理を施して整数化する。
【0035】
ここで、量子化器10においては、量子化スケールの値を決める際、線形量子化と非線型量子化との2つの方法がある。
【0036】
図25に示すように、量子化器10においては、線形量子化を実行する場合、量子化スケールコードに対してその2倍の値を量子化スケールの値として用いるようにする。また、量子化器10においては、非線型量子化を実行する場合、量子化スケールコードに対して非線型な量子化スケールの値を用いている。
【0037】
すなわち、線形量子化において、量子化スケールコードと、量子化スケールの値とをグラフ化すると、図26に示すようになり、これら量子化スケールコードと量子化スケールの値との関係は、量子化スケールコードをqscとし、量子化スケールをqsとすると、(1)式
【0038】
【数1】
【0039】
で表すことができる。
【0040】
また、非線形量子化において、量子化スケールコードと量子化スケールの値との関係をグラフ化すると、図27に示すようになり、上述した(1)式と同様に量子化スケールコードをqscとし、量子化スケールをqsとすると、これら量子化スケールコードと量子化スケールの値との関係は、(2)式
【0041】
【数2】
【0042】
で表される。
【0043】
そして、非線形量子化においては、MPEG2方式の規定に従って量子化スケールコードを5ビットで表すため、その量子化スケールコードの上位2ビットからなる値をkとし、残りの下位3ビットからなる値をjとすると、上述した(2)式を(3)式
【0044】
【数3】
【0045】
に代えて表すこともできる。因みに、kの値の取り得る範囲は0〜3であり、jの値の取り得る範囲は0〜7である。また、この(3)式では、k=j=0は禁止されている。
【0046】
ところで、量子化器10(図24)においては、量子化スケールの値を直接指定するわけではなく、MPEG2方式の規定に従い、量子化スケールコードを指定し、線形量子化と、非線型量子化とのいずれを用いるのかに応じて、対応する(1)式、(2)式又は(3)式からその指定した量子化スケールコードに対応する量子化スケールの値を算出する。
【0047】
因みに、量子化器10においては、MPEG2方式の規定に従い線形量子化と非線形量子化とのいずれを用いるかをピクチャ単位で設定し得るようになされている。
【0048】
また、量子化器10においては、MPEG2方式の規定に従って量子化スケールコードを5ビットで表すため、その量子化スケールコードの値の取り得る範囲が1〜31(0は禁止されている)となり、線形量子化を用いたときに量子化スケールの値の取り得る範囲は2〜62となる(図25)。
【0049】
そして、量子化器10においては、線形量子化を実行してDCT係数を量子化すると、その結果得られる量子化係数の値の取り得る範囲が、2の値の量子化スケールで−1024〜+1023となり、また、62の値の量子化スケールでは−33〜+33となる。
【0050】
ところで、量子化器10においては、量子化に用いた量子化スケールの値が比較的小さいと、その量子化の結果、値の比較的大きい量子化係数を送出するため、これに伴い可変長符号化器4において生成される符号の量が比較的多くなり、ビットレートが上がる。
【0051】
これに対して、量子化器10においては、量子化に用いた量子化スケールの値が比較的大きいと、その量子化の結果、値の比較的小さい量子化係数を送出するため、これに伴い可変長符号化器4において生成される符号の量が比較的少なくなり、ビットレートは小さくなる。このように、量子化スケールの値は、符号化後のビットレートに直接関わっている。
【0052】
そして、量子化器10においては、図25からも明らかなように、線形量子化を用いると、量子化スケールの値として偶数の値しか用いることができないため、ビットレートを比較的高くしたいとき、すなわち、比較的小さい値の量子化スケールコードを指定するときにはビットレートを細かく調節し難くなる。
【0053】
これとは逆に、量子化器10においては、ビットレートを極端に下げたいときには、最高で62という値の量子化スケールまでしか用いることができないため、ビットレートを極端には下げられない。
【0054】
そこで、MPEG2方式では、量子化の際に線形量子化に加えて非線形量子化をも用いることができるように規定されており、量子化器10においては、図25からも明らかなように、非線型量子化を実行する際、量子化スケールコードの値の小さい範囲(1〜8)では奇数の値の量子化スケールを用いることができるため、ビットレートをより細かく調節することができる。
【0055】
また、量子化器10においては、非線型量子化を実行する場合、量子化スケールコードの最大値31に対応させて112の値の量子化スケールを用いることができるため、線形量子化を実行する場合に比べて、ビットレートをより低することができる。
【0056】
因みに、量子化器10においては、非線型量子化を実行してDCT係数を量子化すると、その結果得られる量子化係数の値の取り得る範囲が量子化スケールコードの値を1に指定したとき−2048〜+2047となり、DCT係数を量子化せずにそのまま可変長符号化器4に送出して符号化することと等価となる。
【0057】
一方、量子化器10においては、非線型量子化を実行して31の値の量子化スケールコードを指定したときには、量子化係数の値の取り得る範囲が−18〜+18となり、MPEG2方式で規定されている符号化後の画質の最低レベルを確保するようになされている。
【0058】
ただし、量子化器10においては、上述した線形量子化と、非線形量子化とを用いるのは、動きベクトル検出器3で設定された符号化モードがイントラ符号化モードのときのマクロブロックデータのDCT係数の直流成分を除いた全ての交流成分に対してと、イントラ符号化モードのマクロブロックデータのDCT係数全てに対してである。
【0059】
因みに、量子化器10においては、イントラ符号化モードにおけるマクロブロックデータのDCT係数の直流成分に対してはピクチャ単位で指定されたイントラ符号化モードにおけるDCT係数の直流成分の量子化後のビット精度(量子化係数ビット精度)に応じて別途量子化する。
【0060】
なお、イントラ符号化モードにおけるDCT係数の直流成分の量子化係数ビット精度としては、11ビット、10ビット、9ビット、8ビットのいずれかがピクチャ単位で決められており、量子化係数ビット精度が11ビットのときは、DCT器9から与えられるDCT係数の直流成分を量子化器10において量子化せずにそのまま可変長符号化器4に送出して符号化することと等価となる。
【0061】
これは、MPEG2方式で規定されているDCT係数のビット精度をこれまで12ビットと記述してきたが、DCT係数の直流成分は負値は取らず符号ビットが不要なため、実質11ビットで表現が可能だからである。
【0062】
そして、量子化器10においては、これら11ビット、10ビット、9ビット、8ビットの量子化係数ビット精度にそれぞれに対応する直流成分の量子化スケールの値が1,2,4,8となり、この量子化スケールを用いてイントラ符号化モードにおけるDCT係数の直流成分に対して線形量子化を行う。因みに、量子化器10においては、イントラ符号化モードにおけるDCT係数の直流成分に対して量子化を行った結果、端数が生じると、これに例えば4捨5入といった丸め処理を施して整数化する。
【0063】
このようにして、量子化器10は、DCT係数を量子化すると、その結果得られた量子化係数を、量子化に用いた量子化スケールの値と共に、可変長符号化器4に送出する。
【0064】
可変長符号化器4は、量子化器10から与えられた量子化係数を、例えばハフマン符号等の可変長符号に変換し、バッファ11に送出する。
【0065】
ここで、MPEG2方式によって規定されている量子化係数の可変長符号化方式を説明すると、可変長符号化器4は、量子化器10から与えられた量子化係数をジグザグスキャニングして1次元情報に変換し、その1次元情報の低域係数から順次ゼロラン長+レベル値のシンボル列に変換してそのシンボルそれぞれを低域から順に予め用意している可変長符号テーブルを参照して符号化する。
【0066】
ところで、可変長符号化器4においては、全てのシンボルに対する可変長符号テーブルを予め用意しているわけではなく、出現頻度の低いシンボルに対しては可変長符号テーブルのエスケープコードを割り当て、このエスケープコードを割り当てたたシンボルに対しては、ゼロラン長とレベル値とを固定長符号として符号化する。
【0067】
因みに、可変長符号化器4においては、ゼロラン長に対する固定長符号長を6ビットとし、レベル値に対する固定長符号長を12ビットとしており、これは、ゼロラン長の最大値が63であり、レベル値の範囲がDCT係数の範囲となる−2048〜+2047(12ビット精度)であるからである。
【0068】
また、可変長符号化器4は、量子化器10から与えられる量子化スケールと、動きベクトル検出器3から与えられる符号化モード情報(イントラ符号化(フレーム内符号化)モード、前方予測符号化モード、後方予測符号化モード、又は両方向予測符号化モードのうちのいずれが設定されたかを示す情報)及び動きベクトルも可変長符号化し、得られた符号化データをバッファ11に送出する。
【0069】
バッファ11は、可変長符号化器4から与えられた符号化データを一時蓄積することにより、そのデータ量を平滑化し、符号化ビットストリームとして、例えば、伝送路に出力し、又は記録媒体に記録する。
【0070】
また、バッファ11は、そのデータ蓄積量を量子化器10に送出しており、量子化器10は、このバッファ11から与えられるデータ蓄積量に基づいて量子化スケールを設定する。
【0071】
すなわち、量子化器10は、バッファ11がオーバーフローしそうなときには量子化スケールを比較的大きくして量子化係数のデータ量を低下させ、バッファ11がアンダーフローしそうなときには、量子化スケールを比較的小さくして量子化係数のデータ量を増大させる。このようにして、量子化器10は、バッファ11のオーバフローとアンダフローを未然に防止し得るようになされている。
【0072】
ところで、量子化器10は、量子化係数と量子化スケールとを可変長符号化器4に加えて逆量子化器12にも送出する。
【0073】
逆量子化器12は、量子化器10から与えられる量子化係数を、同様に量子化器10から与えられる量子化スケールに従って逆量子化することによりその量子化係数をDCT係数に変換し、そのDCT係数をIDCT(Inverse Discrete Cosine Transform)器13に送出する。
【0074】
IDCT器13は、逆量子化器12から与えられるDCT係数を逆DCT処理し、得られたデータ(予測残差(差分値データ))を演算器8に送出する。
【0075】
演算器8には、上述したように動き補償器5から演算器7に送出される予測フレーム画像データと同一の予測フレーム画像データが与えられており、IDCT器13から与えられるデータ(予測残差(差分値データ))を、予測フレーム画像データに加算することにより元のフレーム画像データを局所復号化し、得られた局所復号化フレーム画像データをフレームメモリ6に送出して一時記憶させる。
【0076】
因みに、演算器8は、符号化モードがイントラ符号化モードに設定されている場合、IDCT器13から与えられるデータをそのまま局所復号化フレーム画像データとしてフレームメモリ6に送出して一時記憶させる。
【0077】
なお、演算器8は、このようにして、フレームメモリ6に局所復号化フレーム画像データを更新するように一時記憶し、この結果、フレーム全面に渡って復号化したフレーム画像データ(以下、これを復号化フレーム画像データと呼ぶ)を構築する。そして、その復号化フレーム画像データは、後述するデコーダにおいて得られる復号化フレーム画像データと同一のものである。
【0078】
また、フレームメモリ6に構築された復号化フレーム画像データは、その後、インター符号化(前方予測符号化、後方予測符号化、両方向予測符号化)されるフレーム画像データに対する参照フレーム画像データとして用いられる。
【0079】
次いで、図24について上述したエンコーダ1から与えられる符号化データを復号化し得る、MPEG2方式のメインプロファイルメインレベルが適用されたデコーダとしては、図28に示すように構成されたものがある。
【0080】
この図28に示すように、デコーダ20においては、伝送路を介して伝送されて受信装置(図示せず)によって受信された符号化ビットストリーム、又は記録媒体から再生装置(図示せず)によって再生された符号化ビットストリームをバッファ21に取り込んで一時記憶する。
【0081】
可変長復号化(IVLC:Inverse Variable LengthCoding)器22は、バッファ21からこれに記憶された符号化ビットストリームを所定単位の符号化データとして読み出し、当該読み出した符号化データを可変長復号化することにより当該符号化データをマクロブロック単位で動きベクトル、符号化モード情報、量子化スケール及び量子化係数に分離する。
【0082】
そして、可変長復号化器22は、マクロブロック単位で分離した動きベクトル、符号化モード情報、量子化スケール及び量子化係数のうちの動きベクトル及び符号化モード情報を動き補償器23に送出し、量子化スケール及びマクロブロックの量子化係数を逆量子化器24に送出する。
【0083】
逆量子化器24は、可変長復号化器22から与えられるマクロブロック単位の量子化係数を、同様に可変長復号化器22から与えられる量子化スケールに従って逆量子化し、得られたDCT係数をIDCT器25に送出する。
【0084】
IDCT器25は、逆量子化器24から与えられるマクロブロック単位のDCT係数を逆DCT処理し、得られたデータ(予測残差(差分値データ))を演算器26に送出する。
【0085】
また、動き補償器23は、基本的には図24について上述したエンコーダ1の動き補償器5と同様に動作し、このとき、可変長復号化器22から与えられる動きベクトル及び符号化モード情報に基づいて、フレームメモリ27からこれに記憶されている、すでに復号化されている復号化フレーム画像データを読み出し、当該読み出した復号化フレーム画像データを予測フレーム画像データとして演算器26に送出する。
【0086】
従って、演算器26は、IDCT器25から与えられるデータ(予測残差(差分値))と、動き補償器23から与えられる対応する予測フレーム画像データとを加算することにより復号化フレーム画像データを生成し、これをフレームメモリ27に送出して記憶させると共に、その元のフレーム画像の連続する再生画像データとして、例えば、所定のディスプレイに送出することにより当該ディスプレイにその再生画像データに基づく動画像を表示させる。
【0087】
因みに、演算器26は、IDCT器25から与えられるデータがイントラ符号化されたものであるときには、そのデータをそのまま復号化フレーム画像データとしてフレームメモリ27に送出して記憶させる。また、フレームメモリ27は、記憶した復号化フレーム画像データを、その後復号化されるマクロブロック単位の符号化データに対する参照フレーム画像データとして用いられる。
【0088】
なお、MPEG1及びMPEG2方式においては、Bピクチャを参照フレーム画像データとしては用いないため、エンコーダ1(図24)及びデコーダ20(図28)において、それぞれフレームメモリ6(図24)及び27(図28)に記憶しないように規定されている。
【0089】
【発明が解決しようとする課題】
ところで、図24及び図28について上述したエンコーダ1及びデコーダ20は、MPEG2方式の規格に準拠したものである。そして、現在、MPEG2方式に代わる新たな圧縮符号化方式として、ISO−IEC/JTC1/SC29/WG11により、画像をこれを構成する物体などのオブジェクトであるビデオオブジェクト単位で圧縮符号化するMPEG4と呼ばれる圧縮符号化方式の標準化作業が進められている。
【0090】
すなわち、MPEG2方式においては、8ビットの精度の入力画像のみを圧縮符号化するように規定されており、その8ビットの精度の画像を家庭等で利用する場合には実用上十分な画質で表現することができる。
【0091】
ところが、MPEG2方式においては、放送局や映像作成等のプロフェッショナルな現場での利用や、今後普及するディジタルシネマ等といった分野での利用に対しては、例えば、放送局では10ビット以上の精度の画質が要求され、ディジタルシネマでは最高で14ビットの精度が要求されているように、画像に8ビットよりも高いビット精度の画質が要求されているために対応し難くなっている。
【0092】
このため、最近では、MPEG4方式により入力画像の精度を8ビットだけではなく、それ以上の、10ビット、12ビット、14ビットの精度等のNビット精度の画像データを入力して圧縮符号化及び復号化することにより、より高い精度の画質を有する動画像を提供することが考えられている。
【0093】
ところが、MPEG4方式を適用したエンコーダ及びデコーダにおいては、入力画像の精度を8ビットからNビットに拡張し得るものの、そのエンコーダにおける量子化器及び可変長符号化器の構成と、デコーダにおける逆量子化器及び可変長復号化器の構成とが入力画像のNビットの精度に応じた高精度のデータを得るようには拡張されていないため、放送局やディジタルシネマといった非常に高画質な画像が要求される分野で利用するには、未だ不十分な問題があった。
【0094】
本発明は以上の点を考慮してなされたもので、入力画像の画質とほぼ同等の画質の画像を得ることのできる符号化装置及びその方法を提案しようとするものである。
【0096】
【課題を解決するための手段】
かかる課題を解決するため本発明においては、入力ビット精度の入力画像データと、予測データとの差分値を演算して離散コサイン変換処理の対象となる差分値データを生成し、当該生成した差分値データを、離散コサイン変換処理する際の演算ビット精度に応じて離散コサイン変換処理して、離散コサイン変換係数を生成し、演算ビット精度の増加に応じて量子化スケールコードのビット長を増加させることにより量子化スケールの範囲を変更し、当該範囲を変更した量子化スケールを用いて、離散コサイン変換係数を量子化して量子化係数を生成するようにした。
【0097】
従って、入力画像データを圧縮符号化するときに、その画質が劣化することを大幅に低減させることができる。
【0098】
また、本発明においては、量子化係数を圧縮符号化する際、上記入力ビット精度、演算ビット精度、及び範囲を変更した量子化スケールのうちの少なくとも1つ以上に基づいて複数種類の可変長符号化テーブルから可変長符号化テーブルを選定し、当該選定した可変長符号化テーブルを用いて量子化係数を圧縮符号化するようにした。
【0099】
従って、入力画像データを圧縮符号化するときに、その画質が劣化することをほぼ確実に防止することができる。
【0104】
【発明の実施の形態】
以下図面について、本発明の一実施の形態を詳述する
【0105】
(1)原理
現在、MPEG4方式が適用されたエンコーダにおいては、供給される入力画像のビット精度(色の階調)を8ビット精度よりも高精度にし得るものの、その精度のビット数をNとすると、DCT器に入力される差分値データ(すなわち、演算器の出力データ)のビット精度がN+1ビットであるとき、当該DCT器から得られるDCT係数のビット精度はそのN+1ビットから3ビット増えてN+4ビットの精度となるように規定されている。
【0106】
そして、エンコーダにおいては、DCT係数のビット精度によって、圧縮符号化後(量子化後)の動画像の画質の限界が決まるため、入力画像のビット精度に応じて圧縮符号化後の動画像の画質を高精度にするには、DCT器から得られるDCT係数のビット精度を拡張させる必要がある。
【0107】
従って、本発明によるエンコーダにおいては、DCT演算によって増加する精度のビット数をαとし、DCT器から得られるDCT係数のビット精度をN+1+αビットとして、圧縮符号化後の動画像に対して要求される画質に応じてそのαの値を任意に設定し得るようになされている。因みに、MPEG4方式においては、そのαが3として固定されている。
【0108】
そして、本発明においては、エンコーダにおいて、Nビットの精度の入力画像を入力し得ると共に、αを任意に設定し得るようにしてDCT器から得られるDCT係数のビット精度をN+4ビットからN+1+αビットに拡張する分、DCT器の後段に設けられた量子化器及び可変長符号化器の構成と、当該エンコーダと対になるデコーダの逆量子化器及び逆可変長符号化器の構成とを、そのビット精度に応じて拡張するようにした。
【0109】
実際上、本発明においては、任意のNビット精度の入力画像に対する任意のN+1+αビット精度のDCT係数に適用する量子化方式を、MPEG2方式で規定されている線形量子化方式及び非線形量子化方式を拡張して実現している。
【0110】
また、本発明においては、任意のNビット精度の入力画像における、マクロブロックデータの符号化モードがイントラ符号化モードのときには、N+αビット精度のDCT係数の直流成分に適用する量子化方式を、MPEG2方式で規定されているイントラ符号化モードのDCT係数の直流成分の量子化方式を拡張して実現する。
【0111】
因みに、本発明においては、量子化方式の拡張にあたり、MPEG2方式の量子化方式と互換性をもたせ、N=8、α=3の条件の元ではMPEG2の量子化方式と同一になるようにした。
【0112】
また、比較的高いビットレートの場合においても、比較的細かくビットレートを調節し得るように、量子化スケールコードの値が比較的小さい範囲では、量子化スケールの刻み幅を細かくした。
【0113】
さらに、Nやαの値がどんなに大きくなっても、MPEG2方式のN=8、α=3の場合と同等のビットレートまで圧縮符号化が可能となるように、Nやαの値によらずに、量子化スケールの最大値を用いたときに量子化係数の取り得る値の範囲が同等となるようにした。
【0114】
このようにして、本発明においては、高精度の入力画像を処理して、高画質な画像を得るような場合でも、エンコーダ及びデコーダにおいて、処理に不具合が生じることを防止し得るようになされている。
【0115】
ところで、現在、MPEG4方式が適用されたエンコーダにおいては、N+4ビットの精度のDCT係数を量子化器で量子化し、得られた量子化係数に対して可変長符号化器において単一の可変長符号化テーブルを用いて可変長符号化を行うように規定されているものの、量子化係数の出現確立の統計的性質が入力画像のビット精度を表すNに応じて変わるため、設定し得る全ての入力画像のビット精度(N)に対して同一の可変長符号化テーブルを用いるのは圧縮符号化の効率上適切とは言えない。
【0116】
また、DCT係数のビット精度を拡張してN+1+αビットとすると、量子化係数の出現確立の統計的性質がαに応じても変わるため、設定し得る全てのαに対しても同一の可変長符号化テーブルを用いるのは圧縮符号化の効率上適切とは言えない。
【0117】
さらに、DCT係数のビット精度を拡張してN+1+αビットとすると、これに応じて量子化スケールも拡張する必要があるものの、量子化係数の出現確立の統計的性質がその量子化スケールに応じても変わるため、全ての量子化スケールに対して同一の可変長符号化テーブルを用いることも圧縮符号化の効率上適切とは言えない。
【0118】
従って、本発明においては、可変長符号化器において、入力画像のビット精度やDCT係数のビット精度、量子化スケール(すなわち量子化係数ビット精度)に応じて適切な可変長符号化テーブルを切り換えて用いることができるように、複数種類の可変長符号化テーブルをもたせて拡張するようにした。
【0119】
これにより、本発明においては、任意の入力画像のビット精度における任意のビット精度のDCT係数の量子化係数に適用される可変長符号化テーブルを、入力画像のビット精度やDCT係数のビット精度、量子化係数の取り得る範囲(すなわち、量子化スケールの値)に応じて適切なものを選択し得るようにし、かくして、可変長符号化テーブルを選択できない場合に比べて、より効率良く圧縮符号化し得るようになされている。
【0120】
(2)本実施の形態によるエンコーダの構成
図1において、30は全体として本発明を適用したエンコーダを示し、外部から供給される入力画像の画像データをフレームメモリ31に取り込み、当該フレームメモリ31にその画像データをVOP(Video Object Plane:ビデオオブジェクトプレーン)として記憶する。
【0121】
ここで、図2に示すように、VOPは、形状情報をもったピクチャであり、その形状情報をあらわすデータと、VOPのサイズデータFSZ_Bと、フレームにおけるそのVOPの位置を表すオフセットデータFPOS_Bと、VOPの画像データを表すテクスチャーデータとからなる。
【0122】
因みに、本発明においては、そのVOPに対して形状情報を無視してもかまわないため、当該VOPをMPEG2方式等で規定されているピクチャと同じものとして考える。
【0123】
また、このエンコーダ30においては、フレームメモリ31に記憶される画像データの画素値の精度(色の階調)を表すビット数をNとし、当該画素値の取り得る範囲が0〜2N−1となる。そして、Nの取り得る値としては、通常利用される値として、8、10、12、14といった値があるが、本発明では任意の正の整数値を取り得るようになされている。
【0124】
そして、動きベクトル検出器32(図1)は、フレームメモリ31に記憶されたVOPに対してマクロブロック単位で動きベクトルを検出する。
【0125】
ここで、VOPは、時刻(ピクチャ)によって、大きさや位置が変化するため、その動きベクトルの検出にあたっては、その検出のための基準となる絶対座標系を設定し、その絶対座標系における動きを検出する必要がある。
【0126】
従って、動きベクトル検出器32は、フレーム座標系を基準となる絶対座標系とし、サイズデータFSZ_B及びオフセットデータFPOS_Bに基づいて、その絶対座標系に符号化対象のVOPと、参照フレーム画像データとするVOPとを配置し、動きベクトルを検出する。
【0127】
因みに、動きベクトル検出器32は、検出した動きベクトル(MV)を符号化モード情報と共に形状情報符号化器50、可変長符号化器36及び動き補償器42、量子化器35及び逆量子化器38に送出する。また、動き補償を行う場合においても、やはり上述した様に基準となる絶対座標系における動きベクトルを検出する必要があるため、動き補償器42には、サイズデータFSZ_B及びオフセットデータFPOS_Bが供給されている。
【0128】
演算器33には、図24について上述したエンコーダ1(図24)の演算器7(図24)と同様に、動きベクトル検出器32がフレームメモリ31から読み出したフレーム画像データにおけるものと同一のマクロブロックデータが供給されており、そのマクロブロックデータと動き補償器42から与えられる予測フレーム画像データとの差分を演算し、得られた差分値を差分値データとしてDCT器34に送出する。
【0129】
ここで、演算器33は、フレームメモリ31から読み出したマクロブロックデータと、動き補償器42から与えられる対応する予測フレーム画像データとの差分を演算して差分値データを生成することにより、その差分値データの取り得る範囲を−(2N−1)〜2N−1のように、入力画像の画素値の取り得る範囲の2倍にすることができる。
【0130】
従って、演算器33は、DCT器34に送出する差分値データのビット精度を、入力画像の画素値のビット精度よりも1ビット増加させたN+1ビットの精度とすることができる。
【0131】
動き補償器42は、図24について上述したエンコーダ1(図24)の動き補償器5(図24)と同様にして、符号化モード情報がイントラ符号化モードであるときには、演算器33及び40に予測フレーム画像データを送出しない。従って、演算器33(演算器40も同様)は、このとき特に処理を行わずにフレームメモリ31から読み出したマクロブロックデータをそのままDCT器34に送出する。
【0132】
DCT器34は、演算器33から与えられる差分値データに対して8画素×8ラインからなるブロック単位でDCT処理を施し、得られたDCT係数を量子化器35に送出する。
【0133】
ここで、DCT器34から得られるDCT係数、すなわち量子化器35への入力値のビット精度はN+1ビットからαビット増加したN+1+αビットとなり、そのDCT係数の値の取り得る範囲は−2N+α〜2N+α−1である。因みに、従来のMPEG2方式においては、そのDCT係数におけるαを3と規定しているが、本発明では、そのαとして任意の正の整数値を適用し得るようになされている。
【0134】
量子化器35は、図24について上述したエンコーダ1(図24)の量子化器10(図24)と同様に、DCT器34から与えられるDCT係数を量子化し、得られた量子化係数を可変長符号化器36及び逆量子化器38に送出する。
【0135】
実際上、量子化器35においては、図24について上述した量子化器10のような、MPEG2方式の規定に従った8ビット精度の入力画像から得られる12ビット精度のDCT係数に対する線形量子化と非線形量子化とを、Nビット精度の入力画像から得られるN+1+αビット精度のDCT係数に対する線形量子化と、非線形量子化とに拡張している。
【0136】
まず、図24について上述した量子化器10においては、MPEG2方式に従って12ビット精度のDCT係数に対して5ビット長(1〜31)の量子化スケールコードを割り当てているのに対して、量子化器35においては、DCT係数のビット精度の増減に応じて量子化スケールコードのビット長も増減させる。
【0137】
すなわち、量子化器35においては、例えば、8ビット精度の入力画像に対し、α=5とした場合、MPEG2方式におけるα=3よりもDCT係数のビット精度が2ビット多くなっているため、量子化スケールコードのビット長も2ビット多くし7ビットとする。因みに、このとき、量子化スケールコードの取り得る範囲は1〜127となる。
【0138】
また、量子化器35は、例えば、12ビット精度の入力画像に対してα=6とした場合、MPEG2方式における入力ビット精度よりもNが4ビット増加し、かつ、MPEG2方式におけるα=3よりもDCT係数のビット精度が3ビット増加して合わせて7ビットの増加となるため、量子化スケールコードのビット長を7ビット多くした12ビットとする。因みに、このとき、量子化スケールコードの取り得る値の範囲は1〜4095となる。
【0139】
そして、量子化器35における量子化スケールコードのビット長の可変を一般化すると、任意のNとαに対して、その量子化スケールコードのビット長はN+α−6となり、その値の取り得る範囲は1〜2N+α−6−1となる。
【0140】
因みに、DCT係数のビット精度が12ビットよりも小さくなったときには、量子化スケールコードのビット長も5ビットより短くなる。
【0141】
次いで、量子化器35において、ビット数の決定した量子化スケールコードを量子化スケールにマッピングする方法、すなわち、線形量子化と非線形量子化の方法について以下に説明する。
【0142】
量子化器35においては、線形量子化を実行する場合、MPEG2方式の規定と同様に、量子化スケールコードを2倍にして量子化スケールを得ており、その線形量子化に用いる量子化スケールの値は単純に上に延びることになる。
【0143】
そして、量子化器35においては、その線形量子化を実行することにより得られるDCT係数のビット精度、当該DCT係数の最大値、量子化スケールコードの範囲、量子化スケールの範囲及び量子化後の量子化係数の最大値の範囲の例は以下のようになる。
【0144】
すなわち、N=8、α=3(MPEG2方式と同様)の条件では、DCT係数の精度が12ビットとなり、DCT係数の最大値が2047、量子化スケールコードの範囲が1〜31、量子化スケールの範囲が2〜62、量子化係数の最大値の範囲が33〜1023となる。
【0145】
また、N=8、α=6の条件では、DCT係数の精度が15ビットとなり、DCT係数の最大値が16383、量子化スケールコードの範囲が1〜255、量子化スケールの範囲が2〜510、量子化係数の最大値の範囲が33〜8191となる。
【0146】
さらに、N=12、α=6の条件では、DCT係数の精度が19ビットとなり、DCT係数の最大値が262143、量子化スケールコードの範囲が1〜4095、量子化スケールの範囲が2〜8190、量子化係数の最大値の範囲が33〜131071となる。
【0147】
そして、これを一般化すると、N、αの条件では、DCT係数の精度がN+1+αビットとなり、DCT係数の最大値が2N+α−1、量子化スケールコードの範囲が1〜2N+α−6−1、量子化スケールの範囲が2〜2N+α−5−2、量子化係数の最大値の範囲が33〜2N+α−1−1となる。
【0148】
このようにして、量子化器35においては、線形量子化を拡張した場合、MPEG2方式の線形符号化方式と互換性をもち、かつ、Nやαの値によらずに量子化スケールの最大値を用いたときに、そのMPEG2方式と同等のビットレートまで圧縮符号化が可能であることが明らかである。
【0149】
因みに、一般化した線形量子化の方式は、量子化スケールコードをqscとし、量子化スケールをqsとすると、(4)式
【0150】
【数4】
【0151】
で表される。
【0152】
一方、量子化器35においては、線形量子化を実行する場合、量子化スケールコードの増加によって量子化スケールの値を単純に上に伸ばしたが、非線形量子化を実行する場合には、拡張の仕方を正しく定義しないと、実現し得るビットレートやMPEG2方式の非線形量子化との互換性を保てなくなることがある。
【0153】
従って、この量子化器35においては、所望するビットレートを実現し、かつMPEG2方式の非線形量子化との互換性を保つという目的を満たすように非線形量子化方式を拡張している。
【0154】
すなわち、量子化器35においては、非線形量子化を実行する場合、量子化スケールコードのビット長の増加に従って、図26について上述したMPEG2方式における12ビット精度のDCT係数の生成に用いられる非線形量子化カーブの刻み幅を等間隔に細かくする。
【0155】
例えば、量子化器35においては、DCT係数のビット精度が13ビットになったときは、図3に示すように、量子化スケールコードの刻み幅を21=2つに分けて細かくする。
【0156】
これにより、量子化器35においては、量子化スケールコードの刻みの数を2倍にしたものに+21−1を加算して63個とし、小さいほうから順に小さい量子化スケールコードを割り当てると共に、量子化スケール軸上の値を2倍にする。
【0157】
かくして、量子化器35においては、新しい量子化スケールコードに対応した量子化スケールが13ビット精度のDCT係数に対する非線形量子化における量子化スケールとなる。
【0158】
また、量子化器35においては、例えば、DCT係数のビット精度が14ビット精度となったときは、図4に示す様に量子化スケールコードの刻み幅を22=4つに分けて細かくする。
【0159】
これにより、量子化器35においては、量子化スケールコードの刻みの数を4倍したものに+22−1を加算して127個とし、小さいほうから順に小さい量子化スケールコードを割り当てると共に、量子化スケール軸上の値を4倍にする。
【0160】
かくして、量子化器35においては、新しい量子化スケールコードに対応した量子化スケールが14ビット精度のDCT係数に対する非線形量子化における量子化スケールとなる。
【0161】
そして、量子化器35においては、その非線形量子化の定義を一般化すると、DCT係数のビット精度がN+1+αビット精度となった場合は、図5に示すように、量子化スケールコードの刻みを2N+α−11個に等間隔に分けて細かくする。
【0162】
これにより、量子化器35においては、量子化スケールコードの刻みの数を2N+α−11倍+2N+α−11−1の(2N+α−6−1)個とし、小さいほうから順に小さい量子化スケールコードを割り当てると共に、量子化スケール軸上の値を2N+α−11倍にする。
【0163】
因みに、刻みの数に2N+α−11−1を加えているが、これは刻みの総数を(2N+α−6−1)個にするためであり、この加えられた刻みは、量子化スケールコードの最大値方向に付け加えられる。
【0164】
かくして、量子化器35においては、新しい量子化スケールコードに対応した量子化スケールがN+1+αビット精度のDCT係数に対する非線形量子化における量子化スケールとなる。
【0165】
ところで、量子化器35においては、DCT係数のビット精度が12ビットよりも小さくなったときには、その分だけ図26について上述した量子化スケールコードの刻みを統合する。
【0166】
すなわち、DCT係数のビット精度が11ビットのときには、量子化スケールコードが4ビット長となり、図26について上述した量子化スケールコードの刻みのうち、隣り合う2つずつを統合すれば良い。また、DCT係数のビット精度が10ビットの場合には、量子化スケールコードは3ビット長となり、図26について上述した量子化スケールコードの刻みのうち、隣り合う4つずつを統合すれば良い。
【0167】
そして、量子化器35においては、その非線形量子化を実行することにより得られるDCT係数のビット精度、当該DCT係数の最大値、量子化スケールコードの範囲、量子化スケールの範囲及び量子化後の量子化係数の最大値の範囲の例は以下のようになる。
【0168】
すなわち、N=8、α=3(MPEG2方式と同様)の条件では、DCT係数の精度が12ビットとなり、DCT係数の最大値が2047、量子化スケールコードの範囲が1〜31、量子化スケールの範囲が1〜112、量子化係数の最大値の範囲が18〜2047となる。
【0169】
また、N=8、α=6の条件では、DCT係数の精度が15ビットとなり、DCT係数の最大値が16383、量子化スケールコードの範囲が1〜255、量子化スケールの範囲が1〜952、量子化係数の最大値の範囲が18〜16383となる。
【0170】
さらに、N=12、α=6の条件では、DCT係数の精度が19ビットとなり、DCT係数の最大値が262143、量子化スケールコードの範囲が1〜4095、量子化スケールの範囲が1〜15352、量子化係数の最大値の範囲が18〜262143となる。
【0171】
そして、これを一般化すると、N、αの条件では、DCT係数の精度がN+1+αビットとなり、DCT係数の最大値が2N+α−1、量子化スケールコードの範囲が1〜2N+α−6−1、量子化スケールの範囲が1〜120×2N+α−11−8、量子化係数の最大値の範囲が18〜2N+α−1となる。
【0172】
このようにして、量子化器35においては、非線形量子化を拡張した場合、MPEG2方式の非線形符号化方式と互換性をもち、かつ、比較的高いビットレートの場合において量子化スケールの刻み幅を細かく取ることができ、さらに、Nやαの値によらずに量子化スケールの最大値を用いたときに、そのMPEG2方式と同等のビットレートまで圧縮符号化が可能であることが明らかである。
【0173】
因みに、一般化した非線形量子化の方式は、量子化スケールコードをqscとし、量子化に実際に用いられる量子化スケールをqsとすると、(5)式
【0174】
【数5】
【0175】
で表される。
【0176】
また、量子化器35においては、量子化スケールコードをN+α−6ビットで表すため、その上位2ビットからなる値をk、残りのN+α−8ビットからなる値をjとすると、上述した(5)式を(6)式
【0177】
【数6】
【0178】
に変えて表すことができる。因みに、kの値の取り得る範囲は0〜3であり、jの値の取り得る範囲は0〜2N+α−8−1である。そして、k=j=0は禁止されている。
【0179】
ところで、量子化器35においては、マクロブロックデータの符号化モードがイントラ符号化モードに設定された場合、DCT係数の直流成分に対しては、MPEG2方式に従った8ビット精度の入力画像から得られる12ビット精度のDCT係数の直流成分を量子化した後のビット精度の規定を、Nビット精度の入力画像から得られるN+1+αビット精度のDCT係数の直流成分を量子化した後のビット精度の規定に拡張する。
【0180】
すなわち、量子化器35においては、量子化係数のビット精度を拡張する際、MPEG2方式に従うと11ビット精度のDCT係数の直流成分に対して11ビット、10ビット、9ビット、8ビット精度の4種類の量子化係数をピクチャ単位で選択することができた。
【0181】
そして、量子化器35においては、それぞれのビット精度において量子化係数の取り得る範囲が0〜2047、0〜1023、0〜511、0〜255となり、DCT係数のビット精度の増減に応じて直流成分の量子化係数のビット精度の種類も増減させる。
【0182】
この場合、量子化器35においては、例えば、8ビット精度の入力画像に対してα=5とした場合、MPEG2方式におけるα=3よりもDCT係数のビット精度が2ビット多くなっているため、量子化係数のビット精度の種類も、ビット精度が増える方向に2つ増やして、13ビット、12ビット、11ビット、10ビット、9ビット、8ビットとする。
【0183】
そして、量子化器35においては、それぞれのビット精度で量子化係数の取り得る範囲が0〜8191、0〜4095、0〜2047、0〜1023、0〜511、0〜255となる。すなわち、これは、量子化器35からDCT係数をそのまま量子化係数として可変長符号化器36に送出することもできるし、DCT係数のビット精度が増加してもMPEG2方式と同程度のビットレート(量子化係数が8ビットの精度)まで圧縮符号化が可能であることを表している。
【0184】
また、量子化器35においては、例えば、12ビット精度の入力画像に対してα=6とした場合、MPEG2方式における入力画像のビット精度よりも4ビット増加し、かつ、MPEG2方式におけるα=3よりもDCT係数のビット精度が3ビット増加して合わせて7ビットとの増加となるため、量子化係数のビット精度の種類も、ビット精度が増える方向に7つ増やして、18ビット、17ビット、16ビット、15ビット、14ビット、13ビット、12ビット、11ビット、10ビット、9ビット、8ビットとする。
【0185】
そして、量子化器35においては、それぞれのビット精度で量子化係数の取り得る範囲が、0〜262143、0〜131071、0〜65535、0〜32767、0〜16383、0〜8191、0〜4095、0〜2047、0〜1023、0〜511、0〜255となる。すなわち、これは量子化器35からDCT係数をそのまま量子化係数として可変長符号化器36に送出することもできるし、DCT係数のビット精度が増加してもMPEG2方式と同程度のビットレート(量子化係数が8ビットの精度)まで圧縮符号化が可能であることを表している。
【0186】
ところで、量子化器35においては、そのDCT係数の直流成分の量子化精度を一般化すると、Nビット精度の入力画像に対してDCT係数の直流成分のビット精度をN+αビット(符号ビットを含めるとN+1+αビット精度)とした場合、量子化係数のビット精度の種類をN+αビット、N+α−1ビット、N+α−2ビット、……、9ビット、8ビットとする。
【0187】
そして、量子化器35においては、それぞれのビット精度で量子化係数の取り得る範囲が0〜2N+α−1、0〜2N+α−1−1、0〜2N+α−2−1、……、0〜511、0〜255となる。
【0188】
すなわち、これは量子化器35からDCT係数をそのまま量子化係数として可変長符号化器36に送出することもできるし、DCT係数のビット精度が増加してもMPEG2方式と同程度のビットレート(量子化係数が8ビットの精度)まで圧縮符号化が可能であることを表している。
【0189】
このようにして、量子化器35においては、DCT係数の直流成分を量子化方式を拡張した場合、MPEG2方式によるDCT係数の直流成分の量子化方式と互換性をもち、かつ、Nやαの値によらずに量子化係数精度の最小値を用いたときにそのMPEG2方式と同等のビットレートまで圧縮符号化が可能であることが明らかである。なお、このとき量子化器35においては、比較的高いビットレートの場合において量子化スケールの刻み幅を細かくするような考慮は必要はない。
【0190】
ところで、逆量子化器38(図1)は、量子化器35から与えられる8画素×8ラインのブロック単位で量子化されたDCT係数(すなわち、量子化係数)を逆量子化し、IDCT器39に送出する。
【0191】
ここで、逆量子化器38は、量子化係数を逆量子化する際、上述した量子化器35と同様の値でなる量子化スケールコードを用い、かつ、量子化器35と同様の線形量子化及び非線形量子化のうちの同じ方式を用いて量子化スケールを算出し、当該算出した量子化スケールを用いて逆量子化を行う。
【0192】
また、マクロブロックの予測モードがイントラ符号化モードの場合におけるDCT直流係数の逆量子化方式は、上記DCT直流係数の量子化方式の逆を実行する。
【0193】
IDCT器39は、図24のIDCT器39と同様に動作し、逆量子化器38より逆量子化されたDCT係数を、IDCT処理して演算器40に出力する。
【0194】
演算器40には、IDCT器39の出力データの他、動き補償器42から、演算器33に供給されている予測画像と同一のデータが供給されている。演算器40は、IDCT器39の出力データ(予測残差(差分データ))と、動き補償器42からの予測画像データとを加算することで、元のフレーム画像データを局所復号し、得られた局所復号フレーム画像データ(局所復号画像データ)をテクスチャ(texture )情報としてパディング(padding )処理器51に送出する。
【0195】
ただし、演算器40は、予測モードがイントラ符号化である場合には、IDCT器39から与えられる出力データをそのまま局所復号フレーム画像データでなるテクスチャ情報としてパディング処理器51に送出する。
【0196】
一方、形状情報符号化器50には、外部から形状信号(キー信号)、サイズデータFSZ_B、オフセットデータFPOS_Bが供給されると共に、動きベクトル検出器32から動きベクトルと符号化モード情報が与えられる。
【0197】
そして、形状情報符号化器50は、MPEG4方式の規定に従い、形状情報の符号化を行い、当該符号化した形状情報を形状情報復号化器52及び可変長符号化器36に送出する。
【0198】
形状情報復号化器52は、形状情報符号化器50から与えられる符号化されている形状情報の局所復号化を行い、そのデータをパディング処理器51及び可変長符号化器36に送出する。
【0199】
パディング処理器51は、MPEG4方式の規定に従い、テクスチャ情報に対してパディング処理を行い、当該パディングしたテクスチャ情報をフレームメモリ41に送出して記憶する。
【0200】
これにより、フレームメモリ41に記憶されたテクスチャ情報は、その後、インター符号化(前方向予測符号化、後方向予測符号化、両方向予測符号化)される画像に対する予測フレーム画像データとして用いられる。
【0201】
すなわち、動き補償器42は、フレームメモリ41に記憶された画像データを、前方向予測に用いる画像、または後方向予測に用いる画像データとして、出力することになる。
一方、動き補償器42は、動き補償参照画像指示信号により指定される画像(フレームメモリ41に記憶されている局所復号された画像でなるテクスチャ情報)に対して、動きベクトル検出器32から与えられる符号化モード情報及び動きベクトルに基づいて動き補償を施すことにより予測フレーム画像データを生成し、これを演算器33及び40に送出する。
【0202】
すなわち、動き補償器42は、前方予測符号化モード、後方予測符号化モード及び両方向予測符号化モードの時のみ、フレームメモリ41の読み出しアドレスを、演算器33に対して現在出力しているブロックの位置に対応する位置から動きベクトルに対応する分だけずらし、当該フレームメモリ41から前方向予測符号化又は後方向予測符号化に用いる対応する予測フレーム画像データを読み出す。
【0203】
そして、動き補償器42は、その予測フレーム画像データを演算器33及び40に送出する。
【0204】
因みに、動き補償器42は、両方向予測符号化モードの時は、前方予測符号化と後方予測符号化に用いる予測フレーム画像データの両方を読み出し、例えば、その読み出した予測フレーム画像データの平均値を予測データとして演算器33及び40に送出する。
【0205】
これにより、演算器33は、フレームメモリ31から読み出した所定ブロック(マクロブロック)単位のフレーム画像データから、動き補償器42から与えられる対応する予測画像データを減算し、かくして、差分値データを生成する。
【0206】
また、演算器40は、前方予測符号化モード、後方予測符号化モード及び両方向予測符号化モードの場合、動き補償器42から与えられる予測フレーム画像データに加えて、予測フレーム画像データによって差分化された差分値データが逆DCT器39から与えられる。
【0207】
従って、演算器40は、その差分値データを動き補償器42から与えられる予測フレーム画像データに加算し、これにより局所復号を行い、テクスチャ情報を生成する。
【0208】
因みに、このテクスチャ情報は、局所復号化フレーム画像データであり、後述するデコーダで復号化して得られる画像データと全く同一のデータであり、上述したように、次ぎの処理画像に対して、前方予測符号化モード、後方予測符号化モード及び両方向予測符号化モードを行う時に用いる予測フレーム画像データとしてフレームメモリ41に記憶される。
【0209】
また、演算器40は、符号化モードがイントラ符号化モードである場合、画像データそのものが逆DCT器39から与えられるため、その画像データをそのままテクスチャ情報としてパディング処理器51に送出する。
【0210】
一方、可変長符号化器36は、量子化係数、量子化スケールコード、動きベクトル及び符号化モード情報が与えられると共に、サイズデータFSZ_B及びオフセットデータFPOS_Bも与えられる。従って、可変長符号化器36は、これらのデータ全てを可変長符号化する。
【0211】
ここで、可変長符号化器36の構成を、量子化係数の可変長符号化方式に基づいて以下に説明する。
【0212】
MPEG2方式においては、8ビット精度の入力画像に対する12ビット精度のDCT係数に対して、単一の可変長符号化テーブル(可変長符号コードの組み合わせ)を用いて符号化を行うように規定されている。
【0213】
また、可変長符号化器36に与えられる量子化係数の値(もしくは値の組み合わせ)が可変長符号化テーブルで定義されている値(もしくは値の組み合わせ)の範囲外であるときには、その可変長符号化テーブルで定義されているエスケープコードを用いてその値(もしくは値の組み合わせ)を固定長符号として処理する。すなわち、このエスケープコードは比較的出現確立の低い量子化係数の値(もしくは値の組み合わせ)であり、可変長符号化するよりも固定長符号化した方が良いからである。
【0214】
ここで、可変長符号化器36においては、そのMPEG2方式の機能を拡張しており、Nビット精度の入力画像から得られたN+1+αビット精度のDCT係数が量子化され、その結果得られた量子化係数を可変長符号化している。
【0215】
また、可変長符号化器36においては、エスケープコードが用いられた場合に付加される固定長符号に対しても、その長さを入力画像のビット精度やDCT係数のビット精度に応じて変化させるようになされている。これに加えて、量子化スケールの値に応じてもその符号化方式を変更し得るようになされている。
【0216】
まず、可変長符号化器36においては、入力画像のビット精度に応じて可変長符号化テーブルを変更する場合について説明する。これは、入力ビット精度に応じて量子化係数の出現確立の統計的性質も変わることに対処し、かつ、その出現確立からエスケープコードで扱う値の範囲を変更して画質の劣化を未然に防止するものである。
【0217】
ここで、図6は、可変長符号化器36において、入力画像のビット精度に応じて可変長符号化テーブルを変更し得る構成を示すものであり、本来、可変長符号化器36の内部のメモリに格納されている複数種類の可変長符号化テーブルを説明を簡易化するために、その可変長符号化器36の外部に描いて示している。
【0218】
可変長符号化器36においては、例えば、DCT器34の出力であるDCT係数の精度がα=3に固定された場合を考えると、入力画像の画素のビット精度Nに対するDCT係数のビット精度がN+4となり、そのN+4ビット精度のDCT係数が量子化器35において量子化されることにより得られた量子化係数が与えられる。
【0219】
この場合、可変長符号化器36においては、予め入力画像の画素のビット精度に適した複数種類の可変長符号化テーブルを内部のメモリに格納されており、入力画像の画素のビット精度Nの値によって、量子化係数に適用する可変長符号化テーブルとエスケープコードに続く固定長符号の長さを変え得るようになされている。
【0220】
これにより、可変長符号化器36においては、入力ビット精度の変化に応じて変わる量子化係数の出現確立の統計的性質に適確に対応してその量子化係数を圧縮符号化することができ、かくして、符号化処理により画質が劣化することを未然に防止し得るようになされている。
【0221】
また、可変長符号化器36においては、このとき、量子化係数のレベル値の取り得る範囲が−2N+3〜2N+3−1であり、レベル値を表すための固定長符号長がN+4ビットあれば必要十分であるため、Nの値に応じて固定長符号の長さを変えることで固定長符号に無駄なビットを充てなくてすむようにし、かくして、画質の劣化を未然に防止し得るようになされている。
【0222】
因みに、図6は、α=3の場合の例を示したが、α=aに対してもレベル値を表すための固定長符号長はN+1+aビットあれば必要十分である。
【0223】
すなわち、エンコーダ30において、例えばN=8ビット、10ビット、12ビットの3種類の画素ビット精度の入力画像を扱え、かつα=6であった場合、可変長符号化器36においては、3種類(それぞれN=8、10、12用)の可変長符号化テーブルを持ち、かつ、レベル値を表すための固定長符号長を15、17、19とすればよい。
【0224】
次いで、可変長符号化器36においては、入力画像の画素のビット精度をN=nとし、n+1+αビット精度のDCT係数を符号化する際の可変長符号化テーブルをαの値に応じて変更する場合について説明する。これは、DCT係数のビット精度に応じて量子化係数の出現確立及び統計的性質が変わることに対処し、かつ、その出現確立からエスケープコードで扱う値の範囲を変更して画質の劣化を未然に防止するものである。
【0225】
ここで、図7は、可変長符号化器36において、DCT係数のビット精度のαに応じて可変長符号化テーブルを変更し得る構成を示すものであり、本来、可変長符号化器36の内部のメモリに格納されている複数種類の可変長符号化テーブルを説明を簡易化するために、その可変長符号化器36の外部に描いて示している。
【0226】
可変長符号化器36においては、例えば、入力画像の画素のビット精度をN=8に固定した場合を考えると、DCT係数のビット精度は9+αとなり、その9+αビット精度のDCT係数が量子化器35において量子化されることにより得られた量子化係数が与えられる。
【0227】
この場合、可変長符号化器36は、DCT器34から出力されるDCT係数のビット精度、この場合は、αの値によって、量子化係数に適用する可変長符号化テーブルと、エスケープコードに続く固定長符号のレベル値の長さを変えるようになされている。
【0228】
すなわち、可変長符号化器36は、可変長符号化テーブルとして、DCT係数ビット精度に適したものを予め内部のメモリに格納しており、DCT係数のビット精度αに基づいて、量子化係数に適用する可変長符号化テーブルとエスケープコードに続く固定長符号の長さとを変え得るようになされている。
【0229】
これにより、可変長符号化器36においては、DCT係数ビット精度の変化で変わる量子化係数の出現確立及び統計的性質に適確に対応してその量子化係数を圧縮符号化することができ、かくして、符号化処理により画質が劣化することを未然に防止し得るようになされている。
【0230】
また、可変長符号化器36においては、量子化係数のレベル値の取り得る範囲が−28+α〜28+α−1であるため、レベル値を表すための固定長符号長が9+αビットあれば必要十分であり、αの値に応じて固定長符号の長さを変えることで固定長符号に無駄なビットを充てなくてすむようにし、かくして、画質の劣化を未然に防止し得るようになされている。
【0231】
因みに、図7は、N=8の場合の例を示したが、N=nに対してもレベルを表すための固定長符号長はn+1+αビットあれば必要十分である。
【0232】
すなわち、エンコーダ30においては、N=10であり、例えばα=3、4、5の3種類のDCT係数のビット精度の入力画像を扱えるとした場合、可変長符号化器36において、3種類(それぞれα=3、4、5用)の可変長符号化テーブルを持ち、かつ、レベル値を表すための固定長符号長を14、15、16とすればよい。
【0233】
ここで、図6及び図7について上述した可変長符号化器36においては、個別の入力画像の画素のビット精度NとDCT係数のビット精度αの値にそれぞれ応じて可変長符号化テーブルと、量子化係数のレベル値を表す固定長符号長を適宜切り換える場合について説明したが、この2つの可変長符号化方式を組み合わせることも可能である。
【0234】
すなわち、図8は、説明を簡易化するために、複数種類の可変長符号化テーブルを可変長符号化器36の外部に描いて示したものであるが、かかる可変長符号化器36においては、入力画像の画素のビット精度NとDCT係数のビット精度αの両方を考慮して可変長符号化テーブルと、固定長符号長を適宜切り換えるようになされている。因みに、この可変長符号化器36における固定長符号長はN+1+αとなる。
【0235】
ところで、可変長符号化器36においては、入力画像の画素のビット精度をN=nとし、かつ、α=aにおけるDCT係数のビット精度をn+1+aとして、DCT係数を量子化するときに用いた量子化スケールの値に応じて、その量子化によって得られた量子化係数を可変長符号化するための可変長符号化テーブルと、レベル値の固定長符号長を変更する場合について説明する。これは、量子化スケールの値に応じて量子化係数の出現確立の統計的性質が変わることに対処し、かつ、その出現確立からエスケープコードで扱う値の範囲を変更して画質が劣化することを未然に防止するものである。
【0236】
ここで、図9は、可変長符号化器36において、量子化スケールの値に応じて可変長符号化テーブルを変更し得る構成を示すものであり、本来、可変長符号化器36の内部のメモリに格納されている複数種類の可変長符号化テーブルを説明を簡易化するために、その可変長符号化器36の外部に描いて示している。
【0237】
可変長符号化器36においては、例えば、入力画像の画素のビット精度をN=8とし、α=3に固定した場合を考えると、DCT係数のビット精度は12となり、その12ビット精度のDCT係数が量子化器35において量子化されることにより得られた量子化係数が与えられる。
【0238】
そして、可変長符号化器36においては、量子化器35への入力であるDCT係数の値の取り得る範囲が−2048〜+2047であり、このとき、量子化スケールが1の場合には、量子化係数の値の取り得る範囲が−2048〜+2047であり、量子化スケールが1の場合の量子化係数のビット精度は12ビットとなる。
【0239】
また、可変長符号化器36においては、量子化スケールが2の場合、量子化係数の取り得る範囲が−1024〜+1023であり、量子化係数のビット精度が11ビットとなる。さらに、可変長符号化器36においては、量子化スケールが4の場合、量子化係数の取り得る範囲が−512〜+511であり、量子化係数のビット精度が10ビットとなる。
【0240】
図10に、量子化スケールの値による量子化係数のビット精度を示す。この場合、量子化スケールにおいては、そのグループ毎にそれぞれに異なる可変長符号化テーブルとレベル値の固定長符号長が割り当てられており、可変長符号化器36は与えられた量子化スケールの値に応じて対応する可変長符号化テーブルと、エスケープコードの場合のレベル値の固定長符号長を切り換える。因みに、レベル値の固定長符号長は図10の量子化係数ビット精度の値と同じである。
【0241】
ところで、図9は、量子化スケールに基づいて可変長符号化テーブルを切り換える可変長符号化器36を示したが、図11に示すように、これに加えて、図6及び図7について上述した入力画像の画素のビット精度NとDCT係数のビット精度αをも用いて可変長符号化テーブルと、量子化係数のレベル値を表す固定長符号長を適宜切り換えることもできる。
【0242】
因みに、図11においては、可変長符号化器36の内部に格納されている各種可変長符号化テーブルをその可変長符号化器36の外部に描いて説明を簡略化している。
【0243】
また、可変長符号化器36においては、入力画像の画素のビット精度N、DCT係数のビット精度α、量子化スケールのうちの少なくとも1つ以上を用いて可変長符号化テーブルと、量子化係数のレベル値を表す固定長符号長を適宜切り換えることもできる。
【0244】
また、可変長符号化器36においては、Iピクチャ、Pピクチャ、Bピクチャ(I−VOP、P−VOP、B−VOP)のマクロブロックデータについて、スキップマクロブロックとするかどうかを決定し、その決定結果を示すフラグを設定し、そのフラグも可変長符号化して伝送する。
【0245】
因みに、エンコーダ30においては、各ブロック毎にそのDCT係数の符号化を行うが、形状情報復号化器52から出力される形状情報によりオブジェクトの外側にそのブロックがあると判断されたときには、DCT係数の符号化を行わない。
【0246】
(3)本実施の形態によるデコーダの構成
一方、図12において、100は本発明を適用したデコーダを示し、図1について上述したエンコーダ30(図1)から伝送路又は記録媒体等を介して供給される符号化ビットストリームを復号化するようになされている。
【0247】
このデコーダ100においては、エンコーダ30から伝送され、所定の受信装置(図示せず)で受信された符号化ビットストリーム、又は、エンコーダ30により記録媒体に記録され、所定の再生装置(図示せず)によってその記録媒体から再生された符号化ビットストリームをバッファ101に取り込んで一時記憶する。
【0248】
可変長復号化器102は、後段におけるブロックの処理状態に対応して、バッファ101から符号化ビットストリームを適宜読み出し、その符号化ビットストリームを可変長復号することにより、量子化係数、動きベクトル、符号化モード情報、量子化スケールコード、サイズデータFSZ_B、オフセットデータFPOS_B等を分離する。
【0249】
そして、可変長復号化器102は、量子化係数、量子化スケールコード、動きベクトル及び符号化モード情報を逆量子化器103に送出すると共に、動きベクトル、符号化モード情報、サイズデータFSZ_B及びオフセットデータFPOS_Bを動き補償器107に送出し、形状情報を形状情報復号化器110に送出する。
【0250】
逆量子化器103、IDCT器104、演算器105、フレームメモリ106、形状復号化器110、パディング処理器108、動き補償器107は、図1について上述したエンコーダ30の逆量子化器38(図1)、IDCT器39(図1)、演算器40(図1)、フレームメモリ41(図1)、形状情報復号化器52(図1)、パディング処理器51(図1)、動き補償器42(図1)とそれぞれ同様の処理を実行する。
【0251】
形状情報復号化器110は、可変長復号化器102から与えられる符号化された形状情報を復号化し、当該復号化した形状情報をパディング処理器108に送出する。
【0252】
逆量子化器103は、可変長復号化器102から与えられる量子化スケールコードとピクチャ毎に設定される量子化スケールタイプ(線形量子化及び非線形量子化)とに基づいて、同様に可変長復号化器102から与えられる量子化係数を逆量子化し、得られたDCT係数をIDCT器104に送出する。
【0253】
IDCT器104は、逆量子化器103か与えられたDCT係数をIDCT処理し、得られたデータを演算器105に供給する。
【0254】
演算器105は、フレーム間予測が行われているときには動き補償器107からの出力とIDCT器104の出力とを1画素単位で加算し、得られた加算結果をテクスチャ情報としてパディング処理器108に送出すると共に、外部に出力する。また、演算器105は、フレーム内予測(イントラ符号化)が行われてるときには、特に動作しない。
【0255】
パディング処理器108は、形状情報復号化器110から与えられた形状情報に基づいて、演算器105から与えられるテクスチャ情報に対してパディング処理を行い、当該パディング処理したテクスチャ情報をフレームメモリ106に送出して記憶する。
【0256】
フレームメモリ106に記憶されているテクスチャ情報は、動き補償器107により適宜読み出され、演算器105に送出され、この後、図1について上述したフレームメモリ41及び動き補償器42の同様に動作する。
【0257】
ここで、エンコーダ30及びデコーダ100にMPEG4方式の規格を適用した場合について以下に説明する。
【0258】
まず、エンコーダ30の量子化器35及び逆量子化器38と、デコーダ100の逆量子化器103について説明する。
【0259】
図13はMPEG4方式のシンタックスのうちの、VOL(Video Object Layer)のシンタックスを示し、VOLは、符号化ビットストリーム内に格納された符号化されたビデオ情報全てに関わる情報が記述されているレイヤである。そして、このシンタックスのうち、入力画像の画素のビット精度を指定するフラグとしては、bits_per_pixelが準備されている。
【0260】
そして、本発明においては、DCT係数のビット精度を指定するフラグとして、dct_precisionを準備し、これにαの値を記述する。すなわち、DCT係数のビット精度はbits_per_pixel+1+dct_precisionビットとなる。
【0261】
また、本発明においては、そのビット精度に応じて、図14に示すVOPレイヤ(各VOP毎の情報を記述)及び図15に示す各マクロブロック毎の情報を記述しているマクロブロックレイヤ(Macroblock Layer))のシンタックスにおいて、量子化スケールコードを示すフラグとして、quantizer_scale_codeを設け、このフラグを用いて量子化スケールのビット長を変更する。
【0262】
すなわち、VOLシンタックスのbits_per_pixelとdct_percisionの値に応じて、quantizer_scale_codeのビット長をbits_per_pixel+dct_precision−6とする。因みに、MPEG2方式においては、bits_per_pixelとdct_precisionがそれぞれ8と3であり、quantizer_scale_codeのビット長が5であるものの、本発明においては、quantizer_scale_codeのビット長は5となり、MPEG2方式と互換性を持っている。
【0263】
そして、エンコーダ30及びデコーダ100においては、これらシンタックスに従い、bits_per_pixel、dct_precision及びquantizer_scale_codeが指定されて、次に、マクロブロックデータの量子化及び逆量子化を行う。
【0264】
ここでまず、量子化器35においては、線形量子化を用いる場合、(7)式
【0265】
【数7】
【0266】
で表される量子化スケールコードquantizer_scale_codeから量子化スケールquantizer_scaleを計算する。
【0267】
また、量子化器35は、非線形量子化を用いる場合、(8)式
【0268】
【数8】
【0269】
で表される量子化スケールコードquantizer_scale_codeから量子化スケールquantizer_scaleを計算する。
【0270】
因みに、エンコーダ30及びデコーダ100においては、符号化対象のピクチャに対して線形量子化を適用するか、非線形量子化を適用するかを、図14に示すVOPシンタックスのquant_scale_typeと呼ばれるフラグの値により、どちらの量子化タイプを用いるかを指定する。かくして、量子化器35は、指定された量子化タイプを用いて計算した量子化スケールquantizer_scaleを用いて量子化を行うことができる。
【0271】
ただし、マクロブロックの符号化モードがイントラ符号化モードのときには、DCT係数の直流成分に対して異なる量子化方式を用いる。
【0272】
実際上、DCT係数の直流成分の量子化スケールdc_scalerは、以下の手順で導き出すことができる。
【0273】
すなわち、DCT係数の直流成分のビット精度がbits_per_pixel+dct_precisionであるときには、量子化係数のビット精度として、図16に示すビット精度の中からピクチャ単位で指定することが可能であり、それを例えば、ユーザ等が図14に示すVOPシンタックスのintra_dc_precisionと呼ばれるフラグで指定する。
【0274】
そして、量子化器35は、intra_dc_precisionにより、量子化係数のビット精度が指定されると、図16に示すビット精度と、量子化スケールとの関係から対応する量子化スケールdc_scalerを算出し、これをイントラ符号化モードのときのDCT係数の直流成分の量子化に用いる。
【0275】
次いで、逆量子化器38及び103は、上述した量子化器35と同様に、量子化スケールコードquantizer_scale_codeから量子化スケールquantizer_scaleを計算することにより、その量子化スケールquantizer_scaleを用いて逆量子化を行う。
【0276】
ただし、逆量子化器38及び103は、マクロブロックデータの符号化モードがイントラ符号化モードの場合には、DCT係数の直流成分に対しては、異なる逆量子化方式を用いるが、その方法は図16に示したintra_dc_precisionをもとに量子化スケールdc_scalerを求め、それを用いて逆量子化を行う。
【0277】
このようにして、逆量子化器38及び103は、量子化スケールdc_scaleを計算して逆量子化に用いることにより、DCT係数の直流成分の逆量子化を行うことができる。
【0278】
次に、本発明における可変長符号化器36及び可変長復号化器102について説明する。
【0279】
図17はMPEG4方式のシンタックスのうちの、ブロックレイヤ(Block Layer)を示し、現行のMPEG4方式においては、入力画像のビット精度bits_per_pixelとは無関係に、このブッロクシンタックスのDCT Coefficientを表すシンボルを符号化するのに、単一の可変長符号化テーブルを用いる。
【0280】
ここで、その可変長符号化方式は、符号化対象の所定ブロック内の最終コード(LAST)と、当該ブロック内の連続する0の個数(RUN)と、ブロック内の非0係数の値(LEVEL)との3種類のデータから3D可変長符号化を行うようになされている。因みに、現行のMPEG4方式ではdct_precisionは3で固定されている。
【0281】
すなわち、可変長符号化器36は、3D可変長符号化を行う場合、図18〜図20に示す可変長符号化テーブルを用いる。
【0282】
また、現行のMPEG4方式においては、入力画像のビット精度bits_per_pixelとは無関係に、ブロックの可変長符号化の際にエスケープコードが選択されたときには、図21に示すようにレベル値、ラン長を固定長符号を用いて符号化するが、このレベル値を符号化するビット長もbits_per_pixelとは無関係に固定されており、その長さは12ビットである。
【0283】
これは本発明のbits_pre_pixel=8,dct_precision=3の場合におけるDCT係数のビット精度であるので、8ビット精度入力よりもビット精度の高い入力画像に対しては、十分な値とは言えない。
【0284】
従って、可変長符号化器36においては、図22に示すように、bits_per_pixelとdct_precisionとquantizer_scaleの値に応じて、可変長符号化テーブルを切り換えるようになされている。
【0285】
因みに、図22は、例えば、bits_per_pixel=8、10、12、dct_precision=5が選択できる場合を示してあり、VLCt_0〜20は図18〜図20に示すような可変長符号化テーブルであり、全て異なるテーブルとすることが可能である。
【0286】
また、可変長符号化器36においては、レベル値を示す、固定長符号のビット長も、bits_per_pixelとdct_precisionとquantizer_scaleの値に応じて、切り換えることが可能であり、その長さは図23に示す通りである。この例も、bits_per_pixel=8、10、12、dct_precision=5が選択できる場合を示してある。
【0287】
これに対して、可変長復号化器102においては、可変長符号化器36おける可変長符号化と同様に、bits_per_pixelとdct_precisionとquantizer_scaleの値に応じて、可変長符号化テーブルとエスケープコード発生時におけるレベル値のビット長を切り換えることにより、可変長復号化を行う。
【0288】
(4)本実施の形態の動作及び効果
以上の構成において、エンコーダ30では、任意に設定されたビット精度Nの入力画像を取り込むことができると共に、DCT係数のビット精度αを任意に設定し得るようにし、当該入力画像のフレーム画像データからマクロブロック単位で動きベクトル等を用いて差分値データを生成すると、当該生成した差分値データをDCT処理して設定されたビット精度αのDCT係数を生成する。
【0289】
そして、エンコーダ30では、そのDCT係数を、任意に設定された入力画像のビット精度N及びDCT係数のビット精度αとに基づいて拡張した量子化スケールを用いて量子化し、得られた量子化係数を、任意に設定された入力画像のビット精度N、DCT係数のビット精度α及び量子化に用いた量子化スケールの値のうちの少なくともいずれか1つに基づいて選定した可変長符号化テーブルを用いて可変長符号化する。
【0290】
また、エンコーダ30では、このとき、量子化係数の値が選定した可変長符号化テーブルで定義されている値の範囲外であるときには、その可変長符号化テーブルで定義されているエスケープコードを用いてその量子化係数を固定長符号として処理する。
【0291】
一方、デコーダ100では、エンコーダ30から与えられた符号化ビットストリームを、任意に設定された入力画像のビット精度N及びDCT係数のビット精度αと、当該ビット精度N及びαに基づいて拡張した量子化スケールとのうちの少なくとも1つに基づいて選定した可変長符号化テーブルを用いて復号化して各種データと共に量子化係数を分離する。
【0292】
そして、デコーダ100では、その量子化係数を、任意に設定した入力画像のビット精度N及びDCT係数のビット精度αとに基づいて拡張した量子化スケールを用いて逆量子化し、当該設定されたビット精度αのDCT係数を生成し、当該DCT係数にIDCT処理するようにして、この後、復号化したフレーム画像データを得るようにした。
【0293】
従って、エンコーダ30及びデコーダ100では、量子化及び逆量子化を行う際に、任意に設定されたDCT係数のビット精度αに応じて、そのビット精度αに対して適切で、かつ、MPEG2方式と互換性を持つ線形量子化及び非線形量子化を行うことができる。
【0294】
また、エンコーダ30及びデコーダ100では、可変長符号化及び可変長復号化を行う際に、設定されたDCT係数のビット精度αと量子化スケールに対して、適切な可変長符号化テーブルとエスケープコードに続くレベル値のビット長とを選択することができる。
【0295】
この結果、エンコーダ30及びデコーダ100では、入力画像を圧縮符号化するときに、当該入力画像の画質が劣化することを未然に防止することができると共に、符号化した入力画像を復号化するときにもその画質が劣化することを未然に防止することができる。
【0296】
以上の構成によれば、任意に設定されたビット精度Nの入力画像を取り込み、かつDCT係数のビット精度αを任意に設定し得るようにし、そのDCT係数を当該入力画像のビット精度Nと、DCT係数のビット精度αとに基づいて拡張した量子化スケールを用いて量子化し、得られた量子化係数を、その入力画像のビット精度N、DCT係数のビット精度α及び量子化に用いた量子化スケールの値のうちの少なくともいずれか1つに基づいて選定した可変長符号化テーブルを用いて可変長符号化するようにしたことにより、入力画像を圧縮符号化するときに、当該入力画像の画質が劣化することを未然に防止し得るエンコーダを実現することができる。
【0297】
また、任意に設定されたビット精度Nの入力画像を取り込み、かつDCT係数のビット精度αを任意に設定し得るようにし、符号化ビットストリームを当該入力画像のビット精度N及びDCT係数のビット精度αと、これらビット精度N及びαに基づいて拡張した量子化スケールとのうちの少なくともいずれか1つに基づいて選定した可変長符号化テーブルを用いて可変長復号化し、得られた量子化係数をその入力画像のビット精度N及びDCT係数のビット精度αに基づいて拡張した量子化スケールを用いて逆量子化するようにしたことにより、圧縮符号化された入力画像を復号化するときに、当該入力画像の画質が劣化することを未然に防止し得るデコーダを実現することができる。
【0298】
従って、本実施の形態によれば、入力画像の圧縮符号化時及び復号化時に画質が劣化することを未然に防止し、かくして、入力画像を圧縮符号化した後、復号化して得られる画像の画質を入力画像の画質とほぼ同等にすることができるエンコーダ及びデコーダを実現することができる。
【0299】
(5)他の実施の形態
なお、上述の実施の形態においては、bits_per_pixel=8、10、12、dct_precision=5が選択できるようにした場合について述べたが、本発明はこれに限らず、その他の組み合わせも可能であり、一方か両方をある値に固定することも可能である。これはそのシステムの利用目的に応じて選択されるべきであるが、本発明は、このようなシステムのいずれにも適応可能である。
【0300】
また、上述の実施の形態においては、エンコーダ30において、ビット精度に応じた量子化及び可変長符号化を実行するようにした場合について述べたが、本発明はこれに限らず、エンコーダにおいて、ビット精度に応じた量子化及び可変長符号化のうちのいずれか一方を実行するようにしても良く、この場合でも、画質の劣化を未然に防止することができる。
【0301】
さらに、上述の実施の形態においては、デコーダ100において、ビット精度に応じた量子化及び可変長符号化を実行するようにした場合について述べたが、本発明はこれに限らず、デコーダにおいて、ビット精度に応じた量子化及び可変長符号化のうちのいずれか一方を実行するようにしても良く、この場合でも、画質の劣化を未然に防止することができる。
【0302】
【発明の効果】
上述のように本発明によれば、入力ビット精度の入力画像データと、予測データとの差分値を演算して離散コサイン変換処理の対象となる差分値データを生成し、当該生成した差分値データを、離散コサイン変換処理する際の演算ビット精度に応じて離散コサイン変換処理して、離散コサイン変換係数を生成し、演算ビット精度の増加に応じて量子化スケールコードのビット長を増加させることにより量子化スケールの範囲を変更し、当該範囲を変更した量子化スケールを用いて、離散コサイン変換係数を量子化して量子化係数を生成するようにしたことにより、入力画像データを圧縮符号化するときに、その画質が劣化することを大幅に低減させることができる。
【0303】
また、量子化係数を圧縮符号化する際、上記入力ビット精度、演算ビット精度、及び範囲を変更した量子化スケールのうちの少なくとも1つ以上に基づいて複数種類の可変長符号化テーブルから可変長符号化テーブルを選定し、当該選定した可変長符号化テーブルを用いて量子化係数を圧縮符号化するようにしたことにより、入力画像データを圧縮符号化するときに、その画質が劣化することをほぼ確実に防止することができる。
【0306】
従って、このように、画質の劣化を防止し得る符号化装置によれば、入力画像を圧縮符号化した後、復号化して生成した画像の画質を入力画像の画質とほぼ同等にすることができる。
【0307】
そして、あらゆる入力ビット精度の入力画像を圧縮符号化する際に、要求される画質に応じて離散コサイン変換係数の演算ビット精度を可変にすることを可能にする量子化方式、可変長符号化方式を提供することができる。
【図面の簡単な説明】
【図1】本発明によるエンコーダの構成の一実施の形態を示すブロック図である。
【図2】VOPの構成を示す略線図である。
【図3】DCT係数のビット精度の変化に対する量子化区間の分割の説明に供する略線図である。
【図4】DCT係数のビット精度の変化に対する量子化区間の分割の説明に供する略線図である。
【図5】DCT係数のビット精度がN+1+αビットの場合における量子化スケールコードと量子化スケールとの関係の説明に供する略線図である。
【図6】入力画像の画素のビット精度に応じた可変長符号化テーブルの切り換えの説明に供するブロック図である。
【図7】DCT係数に応じた可変長符号化テーブルの切り換えの説明に供するブロック図である。
【図8】入力画像の画素のビット精度と、DCT係数とに応じた可変長符号化テーブルの切り換えの説明に供するブロック図である。
【図9】量子化スケールに応じた可変長符号化テーブルの切り換えの説明に供するブロック図である。
【図10】量子化スケールと量子化係数のビット精度との関係の説明に供する略線図である。
【図11】入力画像の画素のビット精度と、DCT係数と、量子化スケールとの組み合わせに応じた可変長符号化テーブルの切り換えの説明に供するブロック図である。
【図12】本発明によるデコーダの構成の一実施の形態を示すブロック図である。
【図13】VOLのシンタックスを示す略線図である。
【図14】VOPレイヤを示す略線図である。
【図15】マクロブロックレイヤを示す略線図である。
【図16】DCT係数の直流成分の量子化係数精度と量子化スケールの関係の説明に供する略線図である。
【図17】ブロックレイヤのシンタックスを示す略線図である。
【図18】3D可変長符号化に用いる可変長符号化テーブルを示す略線図である。
【図19】3D可変長符号化に用いる可変長符号化テーブルを示す略線図である。
【図20】3D可変長符号化に用いる可変長符号化テーブルを示す略線図である。
【図21】レベル長とラン長の符号化の説明に供する略線図である。
【図22】bits_per_pixelとdct_precisionとquantizer_scaleとによる可変長符号化テーブルの切り換えの説明に供する略線図である。
【図23】bits_per_pixelとdct_precisionとquantizer_scaleとによるレベル値の固定長符号長の切り換えの説明に供する略線図である。
【図24】MPEG2方式を適用したエンコーダの構成を示すブロック図である。
【図25】MPEG2方式の線形・非線形量子化方式の説明に供する略線図である。
【図26】MPEG2方式における量子化スケールコードと量子化スケールとの関係を示す略線図である。
【図27】MPEG2方式における量子化スケールコードと量子化スケールとの関係を示す略線図である。
【図28】MPEG2方式を適用したデコーダの構成を示すブロック図である。
【符号の説明】
30……エンコーダ、31……フレームメモリ、34……DCT器、35……量子化器、36……可変長符号化器、38、103……逆量子化器、39、104……IDCT器、100……デコーダ、102……可変長復号化器。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an encoding apparatus and its one To the law For example, the present invention is suitable for application to an encoder that compresses and encodes moving image data and a decoder that decodes the compressed and encoded moving image data.
[0002]
[Prior art]
Conventionally, as a system provided with this type of encoding device and decoding device, there is a system for transmitting moving image data to a remote place such as a video conference system or a video phone system.
[0003]
In such a system, in order to transmit moving image data efficiently using a transmission path, the moving image data is sequentially compressed and encoded in units of frames using line correlation or inter-frame correlation of images in units of frames. ing.
[0004]
Here, a representative example of a compression encoding method for efficiently encoding moving image data is an MPEG2 (Moving Picture Experts Group 2: moving image encoding for storage) method.
[0005]
This MPEG2 system is ISO-IEC / JTC1 / SC2 / WG11 (International Organization for Standardization-International Electrotechnical Commission / Joint Technical Committee 1 /
[0006]
Also, in the MPEG2 system, several profiles and levels are defined to cope with various applications and functions, and the most basic one is a main profile main level (MP @ ML: Main Profile at Main). Level).
[0007]
Here, as an encoder to which the main profile main level in the MPEG2 system is applied, for example, there is an encoder configured as shown in FIG.
[0008]
That is, in the
[0009]
In this case, the frame image data supplied to the
[0010]
Incidentally, in the frame image data, having an 8-bit accuracy means that the range of possible values (that is, color gradations) of the luminance component and the two color difference components is 0 to 225 (256 gradations). It turns out that.
[0011]
The
[0012]
Here, in the
[0013]
Incidentally, in the
[0014]
In practice, the
[0015]
Here, in the MPEG system (MPEG1 system and MPEG2 system), as an encoding mode of macroblock data, an intra encoding (intraframe encoding) mode, a forward predictive encoding mode, a backward predictive encoding mode, and a bidirectional predictive code are used. Four types of conversion modes are defined.
[0016]
The macroblock data of the I picture is intra-coded according to the intra-coding mode. Further, the macroblock data of the P picture is intra-coded or forward-predicted coded according to either the intra-coding mode or the forward-predictive coding mode.
[0017]
Furthermore, the macroblock data of the B picture is an intra coding mode, a forward prediction coding mode, a backward prediction coding mode, or both. For Intra coding, forward prediction coding, backward prediction coding, or bidirectional prediction coding is performed according to one of the prediction coding modes. Incidentally, these encoding modes are defined so that they can be selected in units of macroblock data even in the same frame image data.
[0018]
For this reason, the
[0019]
In addition, the
[0020]
Then, as a result of the comparison, when the variance of the macroblock data is smaller than the prediction error, the
[0021]
On the other hand, when the prediction error is smaller than the variance of the macroblock data, the
[0022]
Further, the
[0023]
In this case, the
[0024]
Then, as a result of the comparison, when the variance of the macroblock data is smaller than the minimum prediction error, the
[0025]
On the other hand, when the minimum prediction error is smaller than the variance of the macroblock data, the
[0026]
The
[0027]
The
[0028]
Incidentally, the bit accuracy of the pixel value of the output image (input image to the DCT unit 9) obtained from the
[0029]
On the other hand, when only the coding mode information is given from the
[0030]
Therefore, at this time, the arithmetic unit 7 (the same applies to the arithmetic unit 8) sends the macroblock data read from the
[0031]
The
[0032]
Incidentally, in the
[0033]
Further, the
[0034]
The
[0035]
Here, in the
[0036]
As shown in FIG. 25, in the
[0037]
That is, in the linear quantization, when the quantization scale code and the value of the quantization scale are graphed, the result is as shown in FIG. 26. The relationship between the quantization scale code and the value of the quantization scale is expressed by the quantization. When the scale code is qsc and the quantization scale is qs, the equation (1)
[0038]
[Expression 1]
[0039]
Can be expressed as
[0040]
Further, in the non-linear quantization, when the relationship between the quantization scale code and the value of the quantization scale is graphed, as shown in FIG. 27, the quantization scale code is set to qsc as in the above equation (1), When the quantization scale is qs, the relationship between the quantization scale code and the value of the quantization scale is expressed by equation (2).
[0041]
[Expression 2]
[0042]
It is represented by
[0043]
In the non-linear quantization, the quantization scale code is expressed by 5 bits in accordance with the MPEG2 standard, so that the value consisting of the upper 2 bits of the quantization scale code is k, and the value consisting of the remaining lower 3 bits is j Then, the above equation (2) is replaced with equation (3).
[0044]
[Equation 3]
[0045]
It can also be expressed instead of. Incidentally, the possible range of the value of k is 0-3, and the possible range of the value of j is 0-7. Further, in this equation (3), k = j = 0 is prohibited.
[0046]
By the way, in the quantizer 10 (FIG. 24), the quantization scale value is not directly specified, but the quantization scale code is specified in accordance with the MPEG2 standard, and linear quantization, nonlinear quantization, The quantization scale value corresponding to the designated quantization scale code is calculated from the corresponding expression (1), expression (2), or expression (3).
[0047]
Incidentally, in the
[0048]
In the
[0049]
In the
[0050]
By the way, in the
[0051]
On the other hand, in the
[0052]
In the
[0053]
On the other hand, in the
[0054]
Therefore, in the MPEG2 system, it is specified that nonlinear quantization can be used in addition to linear quantization at the time of quantization. In the
[0055]
Also, in the
[0056]
Incidentally, in the
[0057]
On the other hand, in the
[0058]
However, the
[0059]
Incidentally, in the
[0060]
As the quantization coefficient bit precision of the DC component of the DCT coefficient in the intra coding mode, any one of 11 bits, 10 bits, 9 bits, and 8 bits is determined in units of pictures, and the quantization coefficient bit precision is In the case of 11 bits, the DC component of the DCT coefficient given from the
[0061]
This describes the bit precision of the DCT coefficient defined in the MPEG2 system as 12 bits so far. However, since the DC component of the DCT coefficient does not take a negative value and does not require a sign bit, it can be expressed in substantially 11 bits. Because it is possible.
[0062]
In the
[0063]
In this way, when the
[0064]
The
[0065]
Here, the variable-length coding method for quantized coefficients defined by the MPEG2 system will be described. The variable-
[0066]
By the way, the
[0067]
Incidentally, in the
[0068]
The
[0069]
The
[0070]
Further, the
[0071]
That is, the
[0072]
By the way, the
[0073]
The
[0074]
The
[0075]
As described above, the
[0076]
Incidentally, when the encoding mode is set to the intra encoding mode, the
[0077]
In this way, the
[0078]
The decoded frame image data constructed in the
[0079]
Next, as a decoder to which the main profile main level of the MPEG2 system, which can decode the encoded data given from the
[0080]
As shown in FIG. 28, in the
[0081]
A variable length decoding (IVLC: Inverse Variable Length Coding)
[0082]
Then, the
[0083]
The
[0084]
The
[0085]
The
[0086]
Therefore, the
[0087]
Incidentally, when the data supplied from the
[0088]
In the MPEG1 and MPEG2 systems, the B picture is not used as the reference frame image data. Therefore, in the encoder 1 (FIG. 24) and the decoder 20 (FIG. 28), the frame memories 6 (FIG. 24) and 27 (FIG. 28), respectively. ) Is not stored.
[0089]
[Problems to be solved by the invention]
Incidentally, the
[0090]
That is, in the MPEG2 system, it is stipulated that only an 8-bit precision input image is compressed and encoded. When the 8-bit precision image is used at home or the like, it is expressed with a practically sufficient image quality. can do.
[0091]
However, in the MPEG2 system, for use in a professional field such as a broadcasting station or video production, or in a field such as a digital cinema that will become widespread in the future, for example, an image quality with an accuracy of 10 bits or more is used in a broadcasting station. As the digital cinema demands the maximum 14-bit accuracy, it is difficult to cope with the image because the image quality is required to be higher than 8 bits.
[0092]
For this reason, recently, not only the accuracy of the input image is 8 bits by the MPEG4 system, but also the image data of N-bit accuracy such as 10-bit, 12-bit, 14-bit accuracy or the like is inputted and compressed and encoded. It is considered to provide a moving image having higher accuracy image quality by decoding.
[0093]
However, in the encoder and decoder to which the MPEG4 system is applied, although the accuracy of the input image can be expanded from 8 bits to N bits, the configuration of the quantizer and variable length encoder in the encoder and the inverse quantization in the decoder And the structure of the variable-length decoder are not extended to obtain high-precision data according to the N-bit precision of the input image, so a very high-quality image such as a broadcasting station or digital cinema is required. There were still insufficient problems to use it in the field.
[0094]
The present invention has been made in consideration of the above points, and an encoding apparatus capable of obtaining an image having an image quality substantially equivalent to the image quality of an input image and the method thereof The law It is what we are going to propose.
[0096]
[Means for Solving the Problems]
In order to solve this problem, in the present invention, , Enter Force bit precision of Input image data And the difference value between the prediction data and Discrete cosine transform processing of Target Become Generate difference value data, and the generated difference value data , Operations for discrete cosine transform processing Discrete cosine transform processing according to bit precision And Generate discrete cosine transform coefficients, Calculation Bit precision By increasing the bit length of the quantization scale code as it increases Quantization scale Change the range of Concerned Change range The quantized scale , Quantize discrete cosine transform coefficients to produce quantized coefficients Complete It was to so.
[0097]
Therefore, it is possible to greatly reduce the deterioration of the image quality when the input image data is compression-encoded.
[0098]
In the present invention, when the quantization coefficient is compression-encoded, the input bit precision described above, Calculation Bit precision , as well as Changed range At least one of the quantization scales more than Based on multiple types of variable length coding table Possible A variable length coding table is selected, and the quantized coefficients are compression-coded using the selected variable length coding table.
[0099]
Therefore, when the input image data is compression-encoded, it is possible to almost certainly prevent the image quality from deteriorating.
[0104]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
[0105]
(1) Principle
Currently, in an encoder to which the MPEG4 system is applied, although the bit accuracy (color gradation) of the supplied input image can be made higher than 8-bit accuracy, The spirit of Assuming that the number of bits is N, when the bit accuracy of the difference value data (that is, the output data of the arithmetic unit) input to the DCT unit is N + 1 bits, the bit accuracy of the DCT coefficient obtained from the DCT unit is It is specified to be an accuracy of N + 4 bits by increasing 3 bits from N + 1 bits.
[0106]
In the encoder, since the limit of the image quality of the moving image after compression encoding (after quantization) is determined by the bit accuracy of the DCT coefficient, the image quality of the moving image after compression encoding is determined according to the bit accuracy of the input image. In order to achieve high accuracy, it is necessary to expand the bit accuracy of the DCT coefficient obtained from the DCT unit.
[0107]
Therefore, in the encoder according to the present invention, the number of bits increased by the DCT operation is α, and the bit accuracy of the DCT coefficient obtained from the DCT unit is N + 1 + α bits. The value of α can be arbitrarily set according to the image quality. Incidentally, in the MPEG4 system, α is fixed as 3.
[0108]
In the present invention, the encoder can input an input image with N-bit accuracy, and the bit accuracy of the DCT coefficient obtained from the DCT unit can be set arbitrarily so that α can be arbitrarily set, from N + 4 bits to N + 1 + α bits. The configuration of the quantizer and variable length encoder provided in the subsequent stage of the DCT unit and the configuration of the inverse quantizer and inverse variable length encoder of the decoder paired with the encoder Extended according to bit precision.
[0109]
In practice, in the present invention, a quantization method applied to an arbitrary N + 1 + α-bit precision DCT coefficient for an input image with an arbitrary N-bit accuracy is a linear quantization method or a nonlinear quantization method defined by the MPEG2 method. It is realized by expanding.
[0110]
Also, in the present invention, when the encoding mode of macroblock data in an arbitrary N-bit precision input image is the intra coding mode, the quantization method applied to the DC component of the DCT coefficient with N + α-bit precision is MPEG2. This is realized by extending the quantization method of the DC component of the DCT coefficient of the intra coding mode defined in the method.
[0111]
By the way, in the present invention, the expansion of the quantization method is made compatible with the quantization method of the MPEG2 method so that it is the same as the MPEG2 quantization method under the conditions of N = 8 and α = 3. .
[0112]
Further, in order to adjust the bit rate relatively finely even in the case of a relatively high bit rate, the step size of the quantization scale is reduced in a range where the value of the quantization scale code is relatively small.
[0113]
Furthermore, regardless of the value of N or α, no matter how large the value of N or α, the compression encoding can be performed up to the bit rate equivalent to N = 8 and α = 3 in the MPEG2 system. In addition, when the maximum value of the quantization scale is used, the range of values that the quantization coefficient can take is made equal.
[0114]
In this way, in the present invention, even when a high-precision input image is processed to obtain a high-quality image, it is possible to prevent the encoder and the decoder from causing problems in processing. Yes.
[0115]
By the way, in an encoder to which the MPEG4 system is applied at present, a DCT coefficient with N + 4 bits precision is quantized by a quantizer, and a single variable length code is obtained by the variable length encoder for the obtained quantized coefficient. Although it is specified that variable length coding is performed using a quantization table, since the statistical property of establishment of the occurrence of a quantized coefficient varies depending on N representing the bit accuracy of the input image, all input that can be set Using the same variable length coding table for the bit accuracy (N) of the image is not appropriate in terms of compression coding efficiency.
[0116]
Further, if the bit precision of the DCT coefficient is expanded to N + 1 + α bits, the statistical property of establishment of the quantization coefficient changes depending on α, and therefore the same variable length code is set for all α that can be set. The use of a conversion table is not appropriate in terms of compression encoding efficiency.
[0117]
Furthermore, if the bit precision of the DCT coefficient is expanded to N + 1 + α bits, the quantization scale needs to be expanded accordingly. However, even if the statistical nature of the occurrence of the quantization coefficient depends on the quantization scale, Therefore, using the same variable length coding table for all quantization scales is not appropriate for the efficiency of compression coding.
[0118]
Therefore, in the present invention, the variable length encoder switches the appropriate variable length coding table according to the bit accuracy of the input image, the bit accuracy of the DCT coefficient, and the quantization scale (that is, the quantization coefficient bit accuracy). In order to be able to use it, it was extended with a plurality of types of variable length coding tables.
[0119]
Thereby, in the present invention, the variable length coding table applied to the quantization coefficient of the DCT coefficient of arbitrary bit precision in the bit precision of the arbitrary input image is converted into the bit precision of the input image and the bit precision of the DCT coefficient, It is possible to select an appropriate one according to the range that the quantization coefficient can take (that is, the value of the quantization scale). Thus, compression encoding can be performed more efficiently than when a variable-length encoding table cannot be selected. Has been made to get.
[0120]
(2) Configuration of encoder according to this embodiment
In FIG. 1,
[0121]
Here, as shown in FIG. 2, the VOP is a picture having shape information, data representing the shape information, size data FSZ_B of the VOP, offset data FPOS_B representing the position of the VOP in the frame, It consists of texture data representing VOP image data.
[0122]
Incidentally, in the present invention, since the shape information may be ignored for the VOP, the VOP is considered to be the same as a picture defined by the MPEG2 system or the like.
[0123]
In the
[0124]
Then, the motion vector detector 32 (FIG. 1) detects a motion vector for each macroblock with respect to the VOP stored in the
[0125]
Here, since the size and position of the VOP change depending on the time (picture), when detecting the motion vector, an absolute coordinate system serving as a reference for the detection is set, and the motion in the absolute coordinate system is determined. It needs to be detected.
[0126]
Therefore, the
[0127]
Incidentally, the
[0128]
The
[0129]
Here, the
[0130]
Therefore, the
[0131]
Similarly to the motion compensator 5 (FIG. 24) of the encoder 1 (FIG. 24) described above with reference to FIG. 24, the
[0132]
The
[0133]
Here, the DCT coefficient obtained from the
[0134]
The
[0135]
In practice, the
[0136]
First, in the
[0137]
That is, in the
[0138]
For example, when α = 6 is set for an input image with 12-bit precision, the
[0139]
When the variable of the bit length of the quantization scale code in the
[0140]
Incidentally, when the bit precision of the DCT coefficient becomes smaller than 12 bits, the bit length of the quantization scale code becomes shorter than 5 bits.
[0141]
Next, a method for mapping the quantization scale code whose number of bits has been determined to the quantization scale in the
[0142]
In the
[0143]
In the
[0144]
That is, under the conditions of N = 8 and α = 3 (similar to the MPEG2 system), the accuracy of the DCT coefficient is 12 bits, the maximum value of the DCT coefficient is 2047, the quantization scale code range is 1 to 31, and the quantization scale. Is 2 to 62, and the range of the maximum value of the quantization coefficient is 33 to 1023.
[0145]
Under the conditions of N = 8 and α = 6, the accuracy of the DCT coefficient is 15 bits, the maximum value of the DCT coefficient is 16383, the quantization scale code range is 1 to 255, and the quantization scale range is 2 to 510. The range of the maximum value of the quantization coefficient is 33-8191.
[0146]
Further, under the conditions of N = 12, α = 6, the accuracy of the DCT coefficient is 19 bits, the maximum value of the DCT coefficient is 262143, the range of the quantization scale code is 1 to 4095, and the range of the quantization scale is 2 to 8190. The range of the maximum value of the quantization coefficient is 33 to 131071.
[0147]
When this is generalized, under the conditions of N and α, the accuracy of the DCT coefficient is N + 1 + α bits, the maximum value of the DCT coefficient is 2N + α-1, the range of the quantization scale code is 1 to 2N + α-6-1, the quantum The range of the quantization scale is 2 to 2N + α-5-2, and the range of the maximum value of the quantization coefficient is 33 to 2N + α-1-1.
[0148]
In this way, in the
[0149]
By the way, the generalized linear quantization method has the following equation (4) when the quantization scale code is qsc and the quantization scale is qs.
[0150]
[Expression 4]
[0151]
It is represented by
[0152]
On the other hand, in the
[0153]
Therefore, in this
[0154]
That is, in the
[0155]
For example, in the
[0156]
Thereby, in the
[0157]
Thus, in the
[0158]
Further, in the
[0159]
Thereby, in the
[0160]
Thus, in the
[0161]
In the
[0162]
Thereby, in the
[0163]
Incidentally, 2N + α-11-1 is added to the number of steps, but this is to make the total number of steps (2N + α-6-1), and this added step is the maximum of the quantization scale code. Added in the value direction.
[0164]
Thus, in the
[0165]
Incidentally, in the
[0166]
That is, when the bit accuracy of the DCT coefficient is 11 bits, the quantization scale code has a length of 4 bits, and two adjacent ones of the quantization scale code steps described above with reference to FIG. 26 may be integrated. Further, when the bit accuracy of the DCT coefficient is 10 bits, the quantization scale code is 3 bits long, and it is only necessary to integrate four adjacent ones of the quantization scale code steps described above with reference to FIG.
[0167]
In the
[0168]
That is, under the conditions of N = 8 and α = 3 (similar to the MPEG2 system), the accuracy of the DCT coefficient is 12 bits, the maximum value of the DCT coefficient is 2047, the quantization scale code range is 1 to 31, and the quantization scale. 1 to 112, and the range of the maximum value of the quantization coefficient is 18 to 2047.
[0169]
Under the conditions of N = 8 and α = 6, the precision of the DCT coefficient is 15 bits, the maximum value of the DCT coefficient is 16383, the quantization scale code range is 1 to 255, and the quantization scale range is 1 to 952. The range of the maximum value of the quantization coefficient is 18 to 16383.
[0170]
Further, under the conditions of N = 12, α = 6, the accuracy of the DCT coefficient is 19 bits, the maximum value of the DCT coefficient is 262143, the range of the quantization scale code is 1 to 4095, and the range of the quantization scale is 1 to 15352. The range of the maximum value of the quantization coefficient is 18 to 262143.
[0171]
When this is generalized, under the conditions of N and α, the accuracy of the DCT coefficient is N + 1 + α bits, the maximum value of the DCT coefficient is 2N + α-1, the range of the quantization scale code is 1 to 2N + α-6-1, the quantum The range of the quantization scale is 1 to 120 × 2N + α-11-8, and the range of the maximum value of the quantization coefficient is 18 to 2N + α-1.
[0172]
In this way, in the
[0173]
Incidentally, the generalized non-linear quantization method has the following equation (5) when the quantization scale code is qsc and the quantization scale actually used for quantization is qs.
[0174]
[Equation 5]
[0175]
It is represented by
[0176]
In the
[0177]
[Formula 6]
[0178]
Can be expressed as Incidentally, the possible range of the value of k is 0-3, and the possible range of the value of j is 0-2N + α-8-1. And k = j = 0 is prohibited.
[0179]
By the way, in the
[0180]
That is, in the
[0181]
In the
[0182]
In this case, in the
[0183]
And in the
[0184]
In the
[0185]
In the
[0186]
By the way, in the
[0187]
In the
[0188]
That is, it is possible to send the DCT coefficient directly from the
[0189]
In this way, in the
[0190]
Incidentally, the inverse quantizer 38 (FIG. 1) inversely quantizes the DCT coefficient (that is, the quantized coefficient) quantized in units of blocks of 8 pixels × 8 lines provided from the
[0191]
Here, when the quantization coefficient is inversely quantized, the
[0192]
Also, the DCT DC coefficient inverse quantization method when the macroblock prediction mode is the intra coding mode performs the reverse of the DCT DC coefficient quantization method.
[0193]
The
[0194]
In addition to the output data of the
[0195]
However, when the prediction mode is intra coding, the
[0196]
On the other hand, a shape signal (key signal), size data FSZ_B, and offset data FPOS_B are supplied to the
[0197]
Then, the
[0198]
The
[0199]
The
[0200]
Thus, the texture information stored in the
[0201]
That is, the
On the other hand, the
[0202]
That is, the
[0203]
Then, the
[0204]
Incidentally, in the bidirectional predictive coding mode, the
[0205]
As a result, the
[0206]
In addition, in the forward predictive coding mode, the backward predictive coding mode, and the bidirectional predictive coding mode, the
[0207]
Therefore, the
[0208]
Incidentally, this texture information is locally decoded frame image data, which is exactly the same as the image data obtained by decoding with a decoder described later. As described above, the forward prediction is performed for the next processed image. It is stored in the
[0209]
In addition, when the encoding mode is the intra encoding mode, the
[0210]
On the other hand, the
[0211]
Here, the configuration of the variable-
[0212]
In the MPEG2 system, it is defined that a 12-bit precision DCT coefficient for an 8-bit precision input image is encoded using a single variable-length coding table (combination of variable-length code codes). Yes.
[0213]
Also, when the value (or combination of values) of the quantization coefficient given to the
[0214]
Here, in the
[0215]
In the
[0216]
First, the case where the
[0217]
Here, FIG. 6 shows a configuration in which the variable length coding table can be changed in the
[0218]
In the
[0219]
In this case, in the
[0220]
As a result, the
[0221]
Further, in the
[0222]
Incidentally, FIG. 6 shows an example in which α = 3, but it is necessary and sufficient if the fixed length code length for expressing the level value is N + 1 + a bits even for α = a.
[0223]
That is, when the
[0224]
Next, in the
[0225]
Here, FIG. 7 shows a configuration in which the variable length encoding table can be changed in accordance with the bit accuracy α of the DCT coefficient in the
[0226]
In the
[0227]
In this case, the
[0228]
That is, the
[0229]
Thereby, in the
[0230]
In the
[0231]
Incidentally, FIG. 7 shows an example in the case of N = 8, but it is necessary and sufficient that the fixed length code length for representing the level is n + 1 + α bits even for N = n.
[0232]
That is, in the
[0233]
Here, in the
[0234]
That is, FIG. 8 shows a plurality of types of variable length coding tables drawn outside the
[0235]
By the way, in the
[0236]
Here, FIG. 9 shows a configuration in which the variable length encoding table can be changed in accordance with the value of the quantization scale in the
[0237]
In the variable-
[0238]
In the
[0239]
In the
[0240]
FIG. 10 shows the bit accuracy of the quantization coefficient based on the value of the quantization scale. In this case, in the quantization scale, different variable-length coding tables and fixed-length code lengths of level values are assigned to the respective groups, and the variable-
[0241]
FIG. 9 shows the
[0242]
In FIG. 11, various variable length coding tables stored inside the
[0243]
Further, the
[0244]
Further, the
[0245]
Incidentally, in the
[0246]
(3) Configuration of decoder according to this embodiment
On the other hand, in FIG. 12,
[0247]
In this
[0248]
The
[0249]
Then, the
[0250]
The
[0251]
The shape information decoder 110 decodes the encoded shape information given from the
[0252]
Inverse quantum Conversion The
[0253]
The
[0254]
The
[0255]
Based on the shape information given from the shape information decoder 110, the
[0256]
The texture information stored in the
[0257]
Here, a case where the MPEG4 standard is applied to the
[0258]
First, the
[0259]
FIG. 13 shows the VOL (Video Object Layer) syntax in the MPEG4 syntax, where VOL describes information related to all the encoded video information stored in the encoded bitstream. Layer. In this syntax, bits_per_pixel is prepared as a flag for specifying the bit precision of the pixel of the input image.
[0260]
In the present invention, dct_precise is prepared as a flag for specifying the bit precision of the DCT coefficient, and the value of α is described therein. That is, the bit precision of the DCT coefficient is bits_per_pixel + 1 + dct_precise bits.
[0261]
In the present invention, according to the bit precision, the VOP layer shown in FIG. 14 (describes information for each VOP) and the macroblock layer (Macroblock layer) describing information for each macroblock shown in FIG. In the syntax of Layer)), a quantizer_scale_code is provided as a flag indicating a quantization scale code, and the bit length of the quantization scale is changed using this flag.
[0262]
That is, the bit length of the quantizer_scale_code is set to bits_per_pixel + dct_precise-6 according to the values of bits_per_pixel and dct_perition of the VOL syntax. Incidentally, in the MPEG2 system, bits_per_pixel and dct_precise are 8 and 3, respectively, and the bit length of the quantizer_scale_code is 5, but in the present invention, the bit length of the quantizer_scale_code is 5 and is compatible with the MPEG2 system. .
[0263]
In the
[0264]
First, in the
[0265]
[Expression 7]
[0266]
The quantization scale quantizer_scale is calculated from the quantization scale code quantizer_scale_code represented by
[0267]
Further, the
[0268]
[Equation 8]
[0269]
The quantization scale quantizer_scale is calculated from the quantization scale code quantizer_scale_code represented by
[0270]
Incidentally, in the
[0271]
However, when the macroblock coding mode is the intra coding mode, a different quantization method is used for the DC component of the DCT coefficient.
[0272]
In practice, the quantization scale dc_scaler of the DC component of the DCT coefficient can be derived by the following procedure.
[0273]
That is, when the bit precision of the DC component of the DCT coefficient is bits_per_pixel + dct_precise, it is possible to specify the bit precision of the quantization coefficient in units of pictures from the bit precision shown in FIG. Is specified by a flag called intra_dc_precise of the VOP syntax shown in FIG.
[0274]
Then, when the bit precision of the quantization coefficient is designated by intra_dc_precise, the
[0275]
Next, the
[0276]
However, when the coding mode of the macroblock data is the intra coding mode, the inverse quantizers 38 and 103 use different inverse quantization methods for the DC component of the DCT coefficient. A quantization scale dc_scaler is obtained based on the intra_dc_precise shown in FIG. 16, and inverse quantization is performed using it.
[0277]
In this way, the inverse quantizers 38 and 103 can perform inverse quantization of the DC component of the DCT coefficient by calculating the quantization scale dc_scale and using it for inverse quantization.
[0278]
Next, the
[0279]
FIG. 17 shows a block layer (Block Layer) in the syntax of the MPEG4 system. In the current MPEG4 system, a symbol representing the DCT Coefficient of this block syntax is used regardless of the bit precision bits_per_pixel of the input image. A single variable length encoding table is used for encoding.
[0280]
Here, the variable-length coding method includes a final code (LAST) in a predetermined block to be encoded, the number of consecutive zeros (RUN) in the block, and a value of a non-zero coefficient (LEVEL) in the block. 3D variable length encoding is performed from the three types of data. Incidentally, in the current MPEG4 system, dct_precise is fixed at 3.
[0281]
That is, the
[0282]
Further, in the current MPEG4 system, regardless of the bit precision bits_per_pixel of the input image, when an escape code is selected during variable length coding of a block, the level value and run length are fixed as shown in FIG. Encoding is performed using a long code, but the bit length for encoding the level value is also fixed irrespective of bits_per_pixel, and the length is 12 bits.
[0283]
This is the bit accuracy of the DCT coefficient in the case of bits_pre_pixel = 8 and dct_precision = 3 of the present invention, and thus cannot be said to be a sufficient value for an input image having a bit accuracy higher than that of an 8-bit accuracy input.
[0284]
Therefore, in the
[0285]
Incidentally, for example, FIG. 22 shows a case where bits_per_pixel = 8, 10, 12, and dct_precise = 5 can be selected, and VLCt_0 to 20 are variable length coding tables as shown in FIGS. Different tables are possible.
[0286]
In the variable-
[0287]
On the other hand, in the
[0288]
(4) Operation and effect of the present embodiment
In the above configuration, the
[0289]
Then, the
[0290]
At this time, the
[0291]
On the other hand, the
[0292]
In the
[0293]
Therefore, the
[0294]
Further, in the
[0295]
As a result, the
[0296]
According to the above configuration, an input image with arbitrarily set bit accuracy N can be captured, and the bit accuracy α of the DCT coefficient can be arbitrarily set, and the DCT coefficient is set to the bit accuracy N of the input image, Quantization is performed using the quantization scale expanded based on the bit accuracy α of the DCT coefficient, and the obtained quantization coefficient is converted into the bit accuracy N of the input image, the bit accuracy α of the DCT coefficient, and the quantum used for the quantization. Since the variable length coding is performed using the variable length coding table selected based on at least one of the values of the conversion scale, when the input image is compressed and encoded, An encoder that can prevent deterioration in image quality can be realized.
[0297]
In addition, an input image with arbitrarily set bit precision N can be taken in, and the bit precision α of the DCT coefficient can be arbitrarily set, and the bit precision N of the input image and the bit precision of the DCT coefficient of the encoded bit stream can be set. Quantization coefficient obtained by variable length decoding using a variable length coding table selected based on at least one of α and a quantization scale expanded based on bit precision N and α Is decoded using a quantization scale expanded based on the bit accuracy N of the input image and the bit accuracy α of the DCT coefficient, so that when the compression-encoded input image is decoded, It is possible to realize a decoder that can prevent the image quality of the input image from deteriorating.
[0298]
Therefore, according to the present embodiment, it is possible to prevent the image quality from being deteriorated during compression encoding and decoding of the input image. Thus, after compressing and encoding the input image, the image obtained by decoding is decoded. It is possible to realize an encoder and a decoder that can make the image quality substantially equal to the image quality of the input image.
[0299]
(5) Other embodiments
In the above-described embodiment, the case where bits_per_pixel = 8, 10, 12, and dct_precise = 5 can be selected has been described. However, the present invention is not limited to this, and other combinations are possible. It is also possible to fix both to a certain value. This should be selected according to the purpose of use of the system, but the present invention is applicable to any such system.
[0300]
In the above-described embodiment, the
[0301]
Furthermore, in the above-described embodiment, the case where the
[0302]
【The invention's effect】
As mentioned above, according to the present invention , Enter Force bit precision of Input image data And the difference value between the prediction data and Discrete cosine transform processing of Target Become Generate difference value data, and the generated difference value data , Operations for discrete cosine transform processing Discrete cosine transform processing according to bit precision And Generate discrete cosine transform coefficients, Calculation Bit precision By increasing the bit length of the quantization scale code as it increases Quantization scale Change the range of Concerned Change range The quantized scale , Quantize discrete cosine transform coefficients to produce quantized coefficients Complete By doing so, it is possible to greatly reduce the deterioration of the image quality when the input image data is compression-encoded.
[0303]
In addition, when compressing and encoding the quantized coefficient, the input bit precision described above, Calculation Bit precision , as well as Changed range At least one of the quantization scales more than Based on multiple types of variable length coding table Possible Since the variable length coding table is selected and the quantization coefficient is compression-coded using the selected variable length coding table, the image quality deteriorates when the input image data is compression-coded. This can be almost certainly prevented.
[0306]
Therefore, in this way, an encoding device that can prevent deterioration of image quality. In place According to the input image The After compression encoding, the image quality of the image generated by decoding can be made substantially equal to the image quality of the input image.
[0307]
When compressing and encoding an input image with any input bit precision, the discrete cosine transform coefficient is set according to the required image quality. Calculation It is possible to provide a quantization method and a variable-length coding method that can change the bit precision.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of a configuration of an encoder according to the present invention.
FIG. 2 is a schematic diagram illustrating a configuration of a VOP.
FIG. 3 is a schematic diagram for explaining the division of a quantization interval with respect to a change in the bit precision of a DCT coefficient.
FIG. 4 is a schematic diagram for explaining the division of a quantization interval with respect to a change in the bit precision of a DCT coefficient.
FIG. 5 is a schematic diagram for explaining the relationship between a quantization scale code and a quantization scale when the bit accuracy of a DCT coefficient is N + 1 + α bits;
FIG. 6 is a block diagram for explaining switching of a variable-length coding table according to the bit accuracy of a pixel of an input image.
FIG. 7 is a block diagram for explaining switching of a variable-length coding table according to a DCT coefficient.
FIG. 8 is a block diagram for explaining switching of a variable-length coding table according to the bit accuracy of pixels of an input image and DCT coefficients.
FIG. 9 is a block diagram for explaining switching of a variable-length coding table according to a quantization scale.
FIG. 10 is a schematic diagram for explaining a relationship between a quantization scale and a bit accuracy of a quantization coefficient.
FIG. 11 is a block diagram for explaining switching of a variable-length coding table according to a combination of a bit accuracy of a pixel of an input image, a DCT coefficient, and a quantization scale.
FIG. 12 is a block diagram showing an embodiment of a decoder configuration according to the present invention.
FIG. 13 is a schematic diagram showing the syntax of VOL.
FIG. 14 is a schematic diagram illustrating a VOP layer.
FIG. 15 is a schematic diagram illustrating a macroblock layer.
FIG. 16 is a schematic diagram for explaining the relationship between the quantization coefficient accuracy of the DC component of the DCT coefficient and the quantization scale;
FIG. 17 is a schematic diagram illustrating a syntax of a block layer.
FIG. 18 is a schematic diagram illustrating a variable-length coding table used for 3D variable-length coding.
FIG. 19 is a schematic diagram illustrating a variable-length coding table used for 3D variable-length coding.
FIG. 20 is a schematic diagram illustrating a variable-length coding table used for 3D variable-length coding.
FIG. 21 is a schematic diagram for describing encoding of a level length and a run length.
FIG. 22 is a schematic diagram for explaining switching of a variable-length coding table by bits_per_pixel, dct_precise, and quantizer_scale.
FIG. 23 is a schematic diagram for explaining switching of a fixed length code length of a level value by bits_per_pixel, dct_precise, and quantizer_scale.
FIG. 24 is a block diagram showing a configuration of an encoder to which the MPEG2 system is applied.
FIG. 25 is a schematic diagram for explaining an MPEG2 linear / nonlinear quantization method;
FIG. 26 is a schematic diagram illustrating a relationship between a quantization scale code and a quantization scale in the MPEG2 system.
FIG. 27 is a schematic diagram illustrating a relationship between a quantization scale code and a quantization scale in the MPEG2 system.
FIG. 28 is a block diagram showing a configuration of a decoder to which the MPEG2 system is applied.
[Explanation of symbols]
30 ... Encoder, 31 ... Frame memory, 34 ... DCT device, 35 ... Quantizer, 36 ... Variable length encoder, 38, 103 ... Inverse quantizer, 39,104 ... IDCT device , 100... Decoder, 102... Variable length decoder.
Claims (26)
上記差分値データ生成手段により生成された上記差分値データを、離散コサイン変換処理する際の演算ビット精度に応じて離散コサイン変換処理して、離散コサイン変換係数を生成する離散コサイン変換係数生成手段と、
上記演算ビット精度の増加に応じて量子化スケールコードのビット長を増加させることにより量子化スケールの範囲を変更し、当該範囲を変更した量子化スケールを用いて、上記離散コサイン変換係数を量子化して量子化係数を生成する量子化係数生成手段と
を具える符号化装置。Differential value data generation means for calculating a differential value between input image data of input bit accuracy and prediction data and generating differential value data to be subjected to discrete cosine transform processing;
Discrete cosine transform coefficient generating means for generating a discrete cosine transform coefficient by subjecting the difference value data generated by the difference value data generating means to discrete cosine transform processing in accordance with an arithmetic bit accuracy when performing discrete cosine transform processing; ,
The range of the quantization scale is changed by increasing the bit length of the quantization scale code according to the increase of the arithmetic bit precision, and the discrete cosine transform coefficient is quantized using the quantization scale in which the range is changed. And a quantized coefficient generating means for generating quantized coefficients.
N+α−6 (演算ビット精度:α=3+A)
により算出する
請求項1に記載の符号化装置。 The arithmetic bit precision is the number of bits increased by the discrete cosine transform, the input bit precision N, over SL arithmetic bit precision alpha, the number of bits increment from the number specified bits in the arithmetic bit precision In the case of A , the bit length of the quantization scale code is expressed by the following equation: N + α-6 (arithmetic bit accuracy: α = 3 + A)
The encoding device according to claim 1, calculated by:
請求項2に記載の符号化装置。 Upper SL bits of the increment from the prescribed number of bits in the arithmetic-bit accuracy, the coding apparatus of claim 2 wherein A = 3.
上記量子化スケールの範囲を、符号化規格で規定された量子化スケールの範囲に対して変更する
請求項3に記載の符号化装置。The quantization coefficient generation means includes
The encoding apparatus according to claim 3, wherein the quantization scale range is changed with respect to a quantization scale range defined by an encoding standard.
MPEG2(Moving Picture Experts Group 2)である
請求項4に記載の符号化装置。The encoding standard is
The encoding apparatus according to claim 4, which is MPEG2 (Moving Picture Experts Group 2).
上記入力ビット精度の増加に応じて、上記量子化スケールコードのビット長を増加させる
請求項5に記載の符号化装置。The quantization coefficient generation means includes
The encoding apparatus according to claim 5, wherein the bit length of the quantization scale code is increased in accordance with the increase in the input bit accuracy.
非線形量子化を行う場合に、上記離散コサイン変換係数の生成に用いる非線形量子化カーブの刻み幅を細かくする
請求項6に記載の符号化装置。The quantization coefficient generation means includes
The encoding apparatus according to claim 6, wherein when performing nonlinear quantization, the step size of the nonlinear quantization curve used for generating the discrete cosine transform coefficient is made fine.
を具える請求項7に記載の符号化装置。The encoding device according to claim 7, further comprising: an encoding unit that compresses and encodes the quantized coefficient generated by the quantized coefficient generating unit to generate a bitstream.
上記ビット長を変更した上記量子化スケールコードを、上記ビットストリームに記述する
請求項8に記載の符号化装置。The encoding means is
The encoding apparatus according to claim 8, wherein the quantization scale code with the bit length changed is described in the bit stream.
上記変更された上記演算ビット精度を、上記ビットストリームに記述する
請求項9に記載の符号化装置。The encoding means is
The encoding device according to claim 9, wherein the changed arithmetic bit precision is described in the bit stream.
を具え、
上記符号化手段は、
予め複数種類の上記可変長符号化テーブルを保持し、上記入力ビット精度、上記演算ビット精度、及び上記範囲が変更された量子化スケールのうちの少なくとも1つ以上に基づいて各上記可変長符号化テーブルから当該可変長符号化テーブルを選定し、当該選定した上記可変長符号化テーブルを用いて上記量子化係数を圧縮符号化する
請求項1に記載の符号化装置。Coding means for compressing and coding the quantized coefficient using a predetermined variable length coding table;
The encoding means is
A plurality of types of the variable length coding tables are held in advance, and each of the variable length codings is based on at least one of the input bit accuracy, the arithmetic bit accuracy, and the quantization scale whose range is changed. The encoding apparatus according to claim 1, wherein the variable length encoding table is selected from a table, and the quantization coefficient is compression encoded using the selected variable length encoding table.
上記量子化係数が、上記選定した上記可変長符号化テーブルで規定された範囲外のとき、当該選定した上記可変長符号化テーブルで定義されているエスケープコードに基づいて、上記量子化係数を固定長符号化する
請求項11に記載の符号化装置。The encoding means is
When the quantization coefficient is outside the range defined by the selected variable-length coding table, the quantization coefficient is fixed based on the escape code defined by the selected variable-length coding table. The encoding device according to claim 11, which performs long encoding.
上記差分値データ生成手段により生成された上記差分値データを、離散コサイン変換処理する際の演算ビット精度に応じて離散コサイン変換処理して、離散コサイン変換係数を生成する離散コサイン変換係数生成手段と、
上記離散コサイン変換係数生成手段により生成された上記離散コサイン変換係数を、所定の量子化スケールを用いて量子化して量子化係数を生成する量子化係数生成手段と、
予め複数種類の可変長符号化テーブルを保持し、上記入力ビット精度及び上記演算ビット精度のうちの少なくとも1つ以上に基づいて各上記可変長符号化テーブルから当該可変長符号化テーブルを選定し、当該選定した上記可変長符号化テーブルを用いて上記量子化係数を圧縮符号化する符号化手段と
を具える符号化装置。Differential value data generation means for calculating a differential value between input image data of input bit accuracy and prediction data and generating differential value data to be subjected to discrete cosine transform processing;
Discrete cosine transform coefficient generating means for generating a discrete cosine transform coefficient by subjecting the difference value data generated by the difference value data generating means to discrete cosine transform processing in accordance with an arithmetic bit accuracy when performing discrete cosine transform processing; ,
Quantized coefficient generating means for quantizing the discrete cosine transform coefficient generated by the discrete cosine transform coefficient generating means using a predetermined quantization scale to generate a quantized coefficient;
Holding a plurality of types of variable length coding tables in advance, selecting the variable length coding table from each of the variable length coding tables based on at least one of the input bit precision and the arithmetic bit precision, An encoding device comprising: encoding means for compressing and encoding the quantization coefficient using the selected variable-length encoding table.
上記演算ビット精度の増加に応じて量子化スケールコードのビット長を増加させることにより量子化スケールの範囲を変更し、当該範囲を変更した量子化スケールを用いて、上記離散コサイン変換係数を量子化して上記量子化係数を生成する
請求項13に記載の符号化装置。The quantization coefficient generation means includes
The range of the quantization scale is changed by increasing the bit length of the quantization scale code according to the increase of the arithmetic bit precision, and the discrete cosine transform coefficient is quantized using the quantization scale in which the range is changed. The encoding device according to claim 13, wherein the quantization coefficient is generated.
N+α−6 (演算ビット精度:α=3+A)
により算出する
請求項14に記載の符号化装置。 The arithmetic bit precision is the number of bits increased by the discrete cosine transform, the input bit precision N, over SL arithmetic bit precision alpha, the number of bits increment from the number specified bits in the arithmetic bit precision In the case of A , the bit length of the quantization scale code is expressed by the following equation: N + α-6 (arithmetic bit accuracy: α = 3 + A)
The encoding device according to claim 14, calculated by:
請求項15に記載の符号化装置。 Upper SL bits of the increment from the prescribed number of bits in the arithmetic-bit accuracy, the coding apparatus according to claim 15 which is A = 3.
上記量子化スケールの範囲を、符号化規格で規定された量子化スケールの範囲に対して変更する
請求項16に記載の符号化装置。The quantization coefficient generation means includes
The encoding apparatus according to claim 16, wherein the quantization scale range is changed with respect to a quantization scale range defined by an encoding standard.
MPEG2(Moving Picture Experts Group 2)である
請求項17に記載の符号化装置。The encoding standard is
The encoding device according to claim 17, which is MPEG2 (Moving Picture Experts Group 2).
上記入力ビット精度の増加に応じて、上記量子化スケールコードのビット長を増加させる
請求項18に記載の符号化装置。The quantization coefficient generation means includes
The encoding apparatus according to claim 18, wherein the bit length of the quantization scale code is increased in accordance with an increase in the input bit precision.
非線形量子化を行う場合に、上記離散コサイン変換係数の生成に用いる非線形量子化カーブの刻み幅を細かくする
請求項19に記載の符号化装置。The quantization coefficient generation means includes
The encoding apparatus according to claim 19, wherein when performing nonlinear quantization, the step size of the nonlinear quantization curve used for generating the discrete cosine transform coefficient is made fine.
上記量子化係数生成手段により生成された上記量子化係数を圧縮符号化してビットストリームを生成し、当該ビットストリームに、上記ビット長を変更した上記量子化スケールコードを記述する
請求項20に記載の符号化装置。The encoding means is
21. The quantization scale code with the bit length changed is described in the bit stream by compressing and encoding the quantization coefficient generated by the quantization coefficient generation unit. Encoding device.
上記変更された上記演算ビット精度を、上記ビットストリームに記述する
請求項21に記載の符号化装置。The encoding means is
The encoding device according to claim 21, wherein the changed arithmetic bit precision is described in the bit stream.
上記入力ビット精度、上記演算ビット精度、及び上記範囲が変更された量子化スケールのうちの少なくとも1つ以上に基づいて各上記可変長符号化テーブルから当該可変長符号化テーブルを選定し、当該選定した上記可変長符号化テーブルを用いて上記量子化係数を圧縮符号化する
請求項22に記載の符号化装置。The encoding means is
The variable length coding table is selected from each of the variable length coding tables based on at least one of the input bit precision, the arithmetic bit precision, and the quantization scale whose range is changed, and the selection The encoding apparatus according to claim 22, wherein the quantization coefficient is compression-encoded using the variable length encoding table.
上記量子化係数が、上記選定した上記可変長符号化テーブルで規定された範囲外のとき、当該選定した上記可変長符号化テーブルで定義されているエスケープコードに基づいて、上記量子化係数を固定長符号化する
請求項23に記載の符号化装置。The encoding means is
When the quantization coefficient is outside the range defined by the selected variable length coding table, the quantization coefficient is fixed based on the escape code defined by the selected variable length coding table. The encoding device according to claim 23, which performs long encoding.
上記差分値データを、離散コサイン変換処理する際の演算ビット精度に応じて離散コサイン変換処理して、離散コサイン変換係数を生成する離散コサイン変換係数生成ステップと、
上記演算ビット精度の増加に応じて量子化スケールコードのビット長を増加させることにより量子化スケールの範囲を変更し、当該範囲を変更した量子化スケールを用いて、上記離散コサイン変換係数を量子化して量子化係数を生成する量子化係数生成ステップと
を具える符号化方法。A difference value data generation step for calculating a difference value between input image data of input bit accuracy and prediction data and generating difference value data to be subjected to discrete cosine transform processing;
A discrete cosine transform coefficient generating step for generating a discrete cosine transform coefficient by performing a discrete cosine transform process on the difference value data in accordance with an arithmetic bit accuracy when the discrete cosine transform process is performed;
The range of the quantization scale is changed by increasing the bit length of the quantization scale code according to the increase of the arithmetic bit precision, and the discrete cosine transform coefficient is quantized using the quantization scale in which the range is changed. And a quantization coefficient generation step for generating a quantization coefficient.
上記差分値データを、離散コサイン変換処理する際の演算ビット精度に応じて離散コサイン変換処理して、離散コサイン変換係数を生成する離散コサイン変換係数生成ステップと、
上記離散コサイン変換係数を所定の量子化スケールを用いて量子化して量子化係数を生成する量子化係数生成ステップと、
予め保持している複数種類の可変長符号化テーブルから、上記入力ビット精度及び上記演算ビット精度のうちの少なくとも1つ以上に基づいて上記可変長符号化テーブルを選定し、当該選定した上記可変長符号化テーブルを用いて上記量子化係数を圧縮符号化する符号化ステップと
を具える符号化方法。A difference value data generation step for calculating a difference value between input image data of input bit accuracy and prediction data and generating difference value data to be subjected to discrete cosine transform processing;
A discrete cosine transform coefficient generating step for generating a discrete cosine transform coefficient by performing a discrete cosine transform process on the difference value data in accordance with an arithmetic bit accuracy when the discrete cosine transform process is performed;
A quantization coefficient generating step for generating a quantization coefficient by quantizing the discrete cosine transform coefficient using a predetermined quantization scale;
The variable length coding table is selected based on at least one of the input bit precision and the arithmetic bit precision from a plurality of types of variable length coding tables held in advance, and the selected variable length is selected. An encoding method comprising: an encoding step of compressing and encoding the quantization coefficient using an encoding table.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2000142564A JP4560694B2 (en) | 2000-04-05 | 2000-04-05 | Encoding apparatus and method thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2000142564A JP4560694B2 (en) | 2000-04-05 | 2000-04-05 | Encoding apparatus and method thereof |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2009115021A Division JP4697561B2 (en) | 2009-05-11 | 2009-05-11 | Decoding device and method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2001292450A JP2001292450A (en) | 2001-10-19 |
| JP4560694B2 true JP4560694B2 (en) | 2010-10-13 |
Family
ID=18649501
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2000142564A Expired - Lifetime JP4560694B2 (en) | 2000-04-05 | 2000-04-05 | Encoding apparatus and method thereof |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4560694B2 (en) |
Families Citing this family (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6882685B2 (en) | 2001-09-18 | 2005-04-19 | Microsoft Corporation | Block transform and quantization for image and video coding |
| US6690307B2 (en) * | 2002-01-22 | 2004-02-10 | Nokia Corporation | Adaptive variable length coding of digital video |
| JP4617644B2 (en) | 2003-07-18 | 2011-01-26 | ソニー株式会社 | Encoding apparatus and method |
| JP2006217578A (en) * | 2005-01-05 | 2006-08-17 | Seiko Epson Corp | Image forming apparatus and driver program thereof |
| US20070290899A1 (en) * | 2006-06-19 | 2007-12-20 | Donald Martin Monro | Data coding |
| US8942289B2 (en) | 2007-02-21 | 2015-01-27 | Microsoft Corporation | Computational complexity and precision control in transform-based digital media codec |
| EP2136566A4 (en) * | 2007-04-16 | 2012-07-18 | Toshiba Kk | Image encoding and image decoding method and device |
| JP5321895B2 (en) * | 2009-05-27 | 2013-10-23 | ソニー株式会社 | Information processing apparatus and method |
| JP4924708B2 (en) * | 2009-12-28 | 2012-04-25 | ソニー株式会社 | Decoding apparatus and method |
| JP4983907B2 (en) * | 2009-12-28 | 2012-07-25 | ソニー株式会社 | Encoding apparatus and method |
| JP4983908B2 (en) * | 2009-12-28 | 2012-07-25 | ソニー株式会社 | Decoding apparatus and method |
| JP2013098874A (en) * | 2011-11-02 | 2013-05-20 | Sony Corp | Image processing apparatus and method |
| JP5375937B2 (en) * | 2011-12-14 | 2013-12-25 | ソニー株式会社 | Encoding apparatus and method |
| JP5375938B2 (en) * | 2011-12-14 | 2013-12-25 | ソニー株式会社 | Decoding apparatus and method |
| JP7346837B2 (en) * | 2019-02-06 | 2023-09-20 | 株式会社リコー | Encoding device, decoding device, encoding method, decoding method, encoding program, and decoding program |
| US20220215265A1 (en) * | 2021-01-04 | 2022-07-07 | Tencent America LLC | Method and apparatus for end-to-end task-oriented latent compression with deep reinforcement learning |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2839358B2 (en) * | 1990-11-13 | 1998-12-16 | 松下電器産業株式会社 | Encoding device and method |
| JPH06105296A (en) * | 1992-09-18 | 1994-04-15 | Sony Corp | Variable length encoding and decoding method |
| JP3348310B2 (en) * | 1992-09-28 | 2002-11-20 | ソニー株式会社 | Moving picture coding method and moving picture coding apparatus |
| JP3532963B2 (en) * | 1994-05-31 | 2004-05-31 | ペンタックス株式会社 | Image compression device |
| JP2000023195A (en) * | 1998-06-26 | 2000-01-21 | Sony Corp | Image encoding device and method, image decoding device and method and encoded data providing medium |
-
2000
- 2000-04-05 JP JP2000142564A patent/JP4560694B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JP2001292450A (en) | 2001-10-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6856701B2 (en) | Method and system for context-based adaptive binary arithmetic coding | |
| KR101106086B1 (en) | Encoding apparatus and encoding method | |
| JP4560694B2 (en) | Encoding apparatus and method thereof | |
| US20100061449A1 (en) | Programmable quantization dead zone and threshold for standard-based h.264 and/or vc1 video encoding | |
| US6956899B2 (en) | Precise bit control apparatus with look-ahead for MPEG encoding | |
| JPH08256341A (en) | Image signal coding method, image signal coder, image signal recording medium and image signal decoder | |
| JP2004336369A (en) | Moving picture coding apparatus, moving picture decoding apparatus, moving picture coding method, moving picture decoding method, moving picture coding program, and moving picture decoding program | |
| JPH05276502A (en) | Apparatus and method for processing fields in a video data compression system | |
| JPH05115061A (en) | Motion vector coder and decoder | |
| JP4254147B2 (en) | Image information encoding method and apparatus, program, and recording medium | |
| JPH06189290A (en) | Video signal coding apparatus using 1D / 2D DCT | |
| JP2000023195A (en) | Image encoding device and method, image decoding device and method and encoded data providing medium | |
| JP2000324498A (en) | Animation encoding device | |
| JP4697561B2 (en) | Decoding device and method | |
| JP3599942B2 (en) | Moving picture coding method and moving picture coding apparatus | |
| JP4924744B2 (en) | Decoding device and method | |
| JP2001309384A (en) | Picture compressor | |
| KR100566290B1 (en) | Image Scanning Method Using Scan Table and Discrete Cosine Converter | |
| KR100366382B1 (en) | Apparatus and method for coding moving picture | |
| JP4924743B2 (en) | Decoding device and method | |
| JP2002262293A (en) | Moving image decoder and moving image decoding method | |
| JP2002344973A (en) | Method for converting size of image coding data, transmission method for image coding data and image coding data size converter | |
| JP3800965B2 (en) | Data rate converter | |
| JP2001148852A (en) | Image information converter and image information conversion method | |
| JP4238408B2 (en) | Image compression device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070307 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20090224 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090312 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090511 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20091105 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091218 |
|
| 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: 20100701 |
|
| 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: 20100714 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130806 Year of fee payment: 3 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 4560694 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130806 Year of fee payment: 3 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| EXPY | Cancellation because of completion of term |