JP3965528B2 - Encoding device and encoding method - Google Patents
Encoding device and encoding method Download PDFInfo
- Publication number
- JP3965528B2 JP3965528B2 JP35151096A JP35151096A JP3965528B2 JP 3965528 B2 JP3965528 B2 JP 3965528B2 JP 35151096 A JP35151096 A JP 35151096A JP 35151096 A JP35151096 A JP 35151096A JP 3965528 B2 JP3965528 B2 JP 3965528B2
- Authority
- JP
- Japan
- Prior art keywords
- image information
- coefficient
- original image
- value
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、符号化装置、符号化方法に関し、特に、もとの情報と所定の係数との間で積和演算を行い、情報を圧縮する符号化装置、符号化方法に関する。
【0002】
【従来の技術】
従来、例えば、画像データから所定の割合で画素を間引くことにより情報量を圧縮する場合、サブサンプリングフィルタにより前処理が実行された後に、所定の画素が間引かれていた。
【0003】
このような処理において、前述のサブサンプリングフィルタとしては、ナイキストの条件(サンプリング定理)を満たす、固定係数のフィルタが用いられていた。
【0004】
【発明が解決しようとする課題】
しかしながら、このような固定係数のフィルタは、処理しようとする画像の種類に拘わらず特性が不変であるので、画像の種類によっては特性が必ずしも最適ではない場合があるという課題があった。
【0005】
また、圧縮された画像を復号化する場合において使用される予測フィルタも、固定係数フィルタが使用されていた。従って、予測フィルタにおいても、前述の場合と同様の課題があった。
【0006】
本発明は、以上のような状況に鑑みてなされたものであり、例えば、画像データから所定の画素を間引くことにより圧縮処理し、予測フィルタによりもとの画像を伸長処理する場合において、最適なサブサンプリングフィルタおよび予測フィルタを提供することを目的とする。
【0007】
【課題を解決するための手段】
請求項1に記載の符号化装置は、もとの画像情報に含まれる複数画素の画素値に対して第1の係数を積和演算し、もとの画像情報の画素を間引くことによって間引き後の画像情報を求める演算手段と、第1の係数を算出する算出手段と、演算手段により得られたデータを出力する出力手段とを備え、算出手段は、学習用のもとの画像情報が準備されているとき、復号化処理において用いられた第2の係数と、学習用のもとの画像情報とを参照して、もとの画像情報に含まれる複数画素の画素値に対して所定の係数を積和演算し、学習用のもとの画像情報の画素を間引くことによって得られた符号化後の画像情報から第2の係数に基づいて復号された画像情報と、符号化前の学習用のもとの画像情報の差を最小にするその所定の係数を第1の係数の最適値として算出することを特徴とする。
【0008】
請求項4に記載の符号化方法は、もとの画像情報に含まれる複数画素の画素値に対して第1の係数を積和演算し、もとの画像情報の画素を間引くことによって間引き後の画像情報を求める演算ステップと、第1の係数を算出する算出ステップと、演算ステップにより得られたデータを出力する出力ステップとを備え、算出ステップは、学習用のもとの画像情報が準備されているとき、復号化処理において用いられた第2の係数と、学習用のもとの画像情報とを参照して、もとの画像情報に含まれる複数画素の画素値に対して所定の係数を積和演算し、学習用のもとの画像情報の画素を間引くことによって得られた符号化後の画像情報から第2の係数に基づいて復号された画像情報と、符号化前の学習用のもとの画像情報の差を最小にするその所定の係数を前記第1の係数の最適値として算出することを特徴とする。
【0013】
請求項1に記載の符号化装置においては、もとの画像情報に含まれる複数画素の画素値に対して第1の係数を積和演算し、もとの画像情報の画素を間引くことによって間引き後の画像情報を演算手段が求め、第1の係数を算出手段が算出し、演算手段により得られたデータを出力手段が出力し、算出手段は、学習用のもとの画像情報が準備されているとき、復号化処理において用いられた第2の係数と、学習用のもとの画像情報とを参照して、もとの画像情報に含まれる複数画素の画素値に対して所定の係数を積和演算し、学習用のもとの画像情報の画素を間引くことによって得られた符号化後の画像情報から第2の係数に基づいて復号された画像情報と、符号化前の学習用のもとの画像情報の差を最小にするその所定の係数を第1の係数の最適値として算出する。
【0014】
請求項4に記載の符号化方法においては、もとの画像情報に含まれる複数画素の画素値に対して第1の係数を積和演算し、もとの画像情報の画素を間引くことによって間引き後の画像情報を演算ステップが求め、第1の係数を算出ステップが算出し、演算ステップにより得られたデータを出力ステップが出力し、算出ステップは、学習用のもとの画像情報が準備されているとき、復号化処理において用いられた第2の係数と、学習用のもとの画像情報とを参照して、もとの画像情報に含まれる複数画素の画素値に対して所定の係数を積和演算し、学習用のもとの画像情報の画素を間引くことによって得られた符号化後の画像情報から第2の係数に基づいて復号された画像情報と、符号化前の学習用のもとの画像情報の差を最小にするその所定の係数を前記第1の係数の最適値として算出する。
【0019】
【発明の実施の形態】
図1は、本発明の一実施の形態の構成例を示すブロック図である。この図において、エンコーダ1は、原画をプリフィルタ処理をした後、画素を間引きし、データ量を1/9に圧縮するようになされている。プリフィルタ係数格納回路2は、プリフィルタ係数生成回路3(算出手段、第1の算出手段)から出力されるプリフィルタ係数を格納するようになされている。プリフィルタ係数生成回路3は、原画と予測フィルタ係数格納回路5からの出力を参照して、プリフィルタ係数を生成し、プリフィルタ係数格納回路2に供給する。
【0020】
デコーダ4は、エンコーダ1により圧縮された画像に対して、予測フィルタ処理を行うことにより、もとの画像に復号化(伸長)する処理を行うようになされている。予測フィルタ係数格納回路5は、予測フィルタ係数生成回路6(算出手段、第2の算出手段)より供給される予測フィルタ係数を格納するようになされている。予測フィルタ係数生成回路6は、原画と圧縮画像とを参照して予測フィルタ係数を生成し、予測フィルタ係数格納回路5に供給するようになされている。
【0021】
図2は、エンコーダ1の詳細な構成例を示している。この図において、ブロック化回路1aは、シリアルデータとして入力される画像データをブロック化する処理を行うようになされている。プリフィルタ回路1b(演算手段、第1の演算手段)は、ブロック化された画像データを32種類のクラスに分類するとともに、プリフィルタ係数格納回路2から供給されるプリフィルタ係数と画像データとの間で積和演算を行い、得られたデータをコード化回路1d(出力手段、付加手段、送信手段)に出力する。
【0022】
付加コード生成回路1c(第2の算出手段)は、ブロック化された画像データの中心画素と、その周囲の4画素の間で所定の演算を行い、得られた付加コードをコード化回路1dに対して出力する。
【0023】
コード化回路1dは、プリフィルタ回路1bから出力されるデータを上位4ビットとし、また、付加コード生成回路1cから出力されるデータを下位4ビットとして連接し、1個のデータ(8ビットデータ)として出力するようになされている。
【0024】
次に、本実施の形態の動作について説明する。なお、本発明は、プリフィルタおよび予測フィルタ係数の決定方法を特徴としているが、その前段階として、本実施の形態による画像データの圧縮および伸長処理について説明する。
【0025】
いま、図3に示すような画像データがブロック化回路1aに対して入力されたとする。即ち、ライン#1乃至#6に示すような順序で、1ラインずつ画像データが入力されたとすると、ブロック化回路1aは、このような入力データを内蔵されているメモリに記憶させ、所定量のデータが記憶されたところで、図中破線で示すようなブロック@1乃至@6を形成し、各ブロック(図4参照)をプリフィルタ回路1bに対して順に出力する。
【0026】
なお、図2では説明を簡単にするために、画素の数を減らしてあるが、実際の画像は、例えば、縦横それぞれ数百乃至数千ドット程度の画素により構成されている。
【0027】
プリフィルタ回路1bは、図5に示すような構成とされている。この図において、クラス分類回路1b−1は、入力された9画素のデータのうち図6に示す5画素に注目し、その5画素のパターンに応じて入力データを32種類のクラスに分類し、そのクラスを示す値を出力する。
【0028】
即ち、図3に示す破線で囲まれた領域内の9画素を、図4に示すように、左上から順にx0乃至x8とする。このようなブロックが入力されると、クラス分類回路1b−1は、画素x4を中心として、その上下左右の画素(x1,x3,x5,x7)(図6参照)に注目して、その5つの画素をそのパターンに応じて32個のクラスに分類する。
【0029】
図7は、クラス分類処理の一例を説明するフローチャートである。この処理が実行されると、ステップS1では、一次元配列x[]の第0番目乃至第4番目に、画素x1,x3,x4,x5,x7の画素値が、それぞれ格納される。
【0030】
ステップS2では、x1,x3,x4,x5,x7(以下、代表画素という)の中で最大の値が変数maxに代入される。続くステップS3では、代表画素の中で最小の値が変数minに代入される。そして、ステップS4では、(max−min+1)の値が、変数drに代入される。
【0031】
ステップS5では、変数drの値が1であるか否かが判定される。その結果、変数drの値が1である(YES)と判定された場合には、ステップS6に進み、変数iに0が代入された後、処理を終了する(エンド)。また、変数drの値が1ではない(NO)と判定された場合には、ステップS7に進む。
【0032】
ステップS7では、変数jが0に初期設定され、ステップS8に進む。ステップS8では、以下に示す式で得られた値が変数wに代入される。なお、wは実数であり、浮動小数点により計算される。
【0033】
2(x[j]−min+0.5)/dr ・・・(1)
【0034】
次のステップS9では、ステップS8で計算された変数wの値が0よりも小さいか否かが判定される。その結果、変数wの値が0よりも小さい(w<0:YES)と判定された場合は、ステップS10に進み、配列z[j]に0が代入され、ステップS14に進む。また、変数wの値が0以上である(w≧0:NO)と判定された場合には、ステップS11に進む。ステップS11では、変数wの値が、1よりも大きいか否かが判定され、その結果、変数wの値が1よりも大きい(w>1:YES)と判定された場合には、ステップS12に進み、配列z[j]に値1が代入される。また、ステップS11において、変数wの値が1以下である(w≦1:NO)と判定された場合には、ステップS13に進み、変数wの値の小数点以下を切り捨てた整数値が代入される。
【0035】
そして、ステップS14では、変数jの値が1だけインクリメントされ、ステップS15に進む。ステップS15では、変数jの値が5よりも小さいか否かが判定される。その結果、変数jの値が5より小さい(j<5:YES)と判定された場合は、ステップS7に戻り、前述と同様の処理が繰り返され、また、変数jの値が5以上である(j≧5:NO)と判定された場合には、ステップS16に進む。
【0036】
ステップS16では、以下に示す式により得られた値が変数iに代入され、処理を終了する(エンド)。
【0037】
z[0]×1+z[1]×2+z[2]×4+z[3]×8+z[4]×16・・・(2)
【0038】
即ち、配列z[]の第0番目乃至第4番目の要素は、第0ビット(LSB)乃至第4ビット(MSB)として、クラスコードを格納する変数iに代入される。そして、処理を終了する(エンド)。
【0039】
以上のようにして生成されたクラスコードiは、フィルタ回路1b−2に供給される。
【0040】
フィルタ回路1b−2は、プリフィルタ係数格納回路2から、クラスコードiに対応するプリフィルタ係数を読み出す。そして、フィルタ回路1b−2は、得られたプリフィルタ係数を用いて、ブロック化回路1aより出力される画素データに対して、フィルタ処理を施す。即ち、フィルタ回路1b−2は、図8に示すように、9個の画素x0乃至x8の画素値に対して、プリフィルタ係数格納回路2から供給されたプリフィルタ係数ai0乃至ai8を乗算し、プリフィルタ後の画素値y4を得る。なお、以上の演算は、以下のように表すことができる。ここで、iはクラスコードである。なお、プリフィルタ係数生成回路3におけるプリフィルタ係数の生成方法については後述する。
【0041】
【0042】
このようにして得られた画素値y4は、コード化回路1dに供給される。
【0043】
ブロック化回路1aから出力されたデータは、付加コード生成回路1cに対しても供給される。図9は、付加コード生成回路1cにおいて実行される処理の一例を説明するフローチャートである。
【0044】
この処理が実行されると、ステップS20において、一次元配列x[]の第0番目乃至第3番目に、画素x1,x3,x5,x7の画素値が代入される。そして、ステップS21では、変数jが0に初期設定される。
【0045】
続くステップS22では、配列x[]の第j番目の要素(x[j])から中心画素x4の値を減算し、更に値16を減算して得られた値が、変数wに代入される。
【0046】
そして、ステップS23では、ステップS22で得られたwの値が0よりも大きいか否かが判定される。その結果、変数wの値が0よりも大きい(w>0:YES)と判定された場合には、ステップS24に進む。また、逆に、変数wの値が0以下である(w≦0:NO)と判定された場合には、ステップS25に進む。
【0047】
ステップS24では、一次元配列k[]の第j番目(k[j])に1が代入され、また、ステップS25では、一次元配列k[]の第j番目(k[j])に0が代入される。そして、ステップS26に進むことになる。
【0048】
従って、画素x1(または、x3,x5,x7)の画素値が中心画素x4の画素値に値16を加算した値よりも大きい場合(x1>x4+16)には、配列k[]に1が代入され、また、画素x1(または、x3,x5,x7)の画素値が中心画素x4の画素値に値16を加算した値以下である場合(x1≦x4+16)には、配列k[]に0が代入されることになる。即ち、中心画素とその周辺の画素の画素値の大小関係に応じて1または0とされる付加コード(非線形コード)が生成されることになる。
【0049】
ステップS26では、変数jの値が1だけインクリメントされ、ステップS27に進む。ステップS27では、変数jの値が、4よりも小さいか否かが判定される。その結果、変数jの値が4より小さい(j<4:YES)と判定された場合は、ステップS22に戻り、前述の場合と同様の処理が繰り返される。また、変数jの値が4以上である(j≧4:NO)と判定された場合には処理を終了する(エンド)。
【0050】
以上の処理により得られた付加コードは、コード化回路1dに供給される。
【0051】
コード化回路1dは、プリフィルタ回路1bから供給された画素値y4と、付加コード生成回路1cから供給された付加コードに対して所定の演算を施し、得られたデータを圧縮画像データとして出力する。即ち、コード化回路1dは、以下に示す演算を実行する。
【0052】
d12=(240&y4)|(k[3],k[2],k[1],k[0]) ・・・(4)
【0053】
なお、d12は出力データを示している。また、&は論理積を示し、|は論理和を示している。更に、( ,,,)は、連接を表している。即ち、(a,b)の場合では、変数aが上位ビット、変数bが下位ビットとして、1まとめのデータとされることを示している。
【0054】
このような演算によれば、最初の()内の演算により、画素値y4の上位4ビットが抽出され(240は、2進法では11110000である)、次の()内の演算により、付加コードが4ビットのデータに変換される。そして、これらの()の論理和を演算することにより、上位4ビットと下位4ビットとが重畳されることになる。
【0055】
図10は、図1に示すデコーダ4の詳細な構成例を示すブロック図である。
【0056】
この図に示すように、デコーダ4は、ブロック化回路4a(受信手段)、デコード回路4b、予測フィルタ回路4c(演算手段、第2の演算手段)、および、非ブロック化回路4d(出力手段)により構成されている。
【0057】
ブロック化回路4aは、入力されたデータをブロック化するようになされている。デコード回路4bは、ブロック化回路4aによりブロック化されたデータに対してデコード処理を施す。予測フィルタ係数格納回路5は、予測フィルタ係数生成回路6により生成された予測フィルタ係数を格納するようになされている。予測フィルタ回路4cは、予測フィルタ係数格納回路5から供給される係数に応じて、デコード回路4bから出力されるデータに対してフィルタリング処理を施す。非ブロック化回路4dは、予測フィルタ回路4cからの出力信号をもとの画像信号(シリアル信号)に変換するようになされている。
【0058】
なお、予測フィルタ係数生成回路6における予測フィルタ係数の生成方法に関しては後述する。
【0059】
次に、デコーダ4の動作について説明する。
【0060】
図11は、ブロック化回路4aの動作を説明する図である。画像データ(圧縮処理が施されているデータ)は、ライン#1乃至#6に示す順序で、ブロック化回路4aに入力される。なお、この図において、破線で示す丸は、圧縮により間引かれた画素を示しており、実線で示す丸は圧縮後に残った画素を示している。
【0061】
ブロック化回路4aは、ライン#1乃至#6の順に入力された画素データを図示せぬメモリに記憶させ、所定量のデータが記憶されたところで、ブロック@1乃至@6を形成し、各ブロックのデータをデコード回路4bに対して順に出力する。
【0062】
図12は、デコード回路4bにおいて実行される処理の一例を示している。この処理が実行されると、ステップS40において、変数jが1に初期設定され、ステップS41に進む。ステップS41では、以下の演算が実行される。即ち、図11に示す圧縮後に残った実線領域内の画素を左上から順に、d0乃至d24とすると、k[j]は、d12を用いて以下のように表すことができる。
【0063】
k[j]=(d12&2j)/2j ・・・(5)
【0064】
ここで、d12は、入力データを示している。また、&は前述のように論理積を示している。例えば、j=0の場合では、d12と1(=20)の論理積が演算され、得られた値が1(=20)で除算され、配列k[0]に代入される。即ち、j=0では、d12の最下位ビットに格納されている付加コードの最下位ビット(k1)が取り出されることになる。j=1,2,3では、最下位ビットから第1乃至第3ビット目の情報(k3,k5,k7)が取り出される。
【0065】
続くステップS42では、変数jの値が1だけインクリメントされ、ステップS43において、変数jの値が4よりも小さいか否かが判定される。その結果、変数jの値が4よりも小さい(YES)と判定された場合は、ステップS41に戻り、前述の場合と同様の処理が繰り返されることになる。また、変数jの値が4以上である(NO)と判定された場合には、ステップS44に進む。
【0066】
以上の繰り返し処理の結果、j=1では、入力データd12からk3が抽出され、以下、j=2ではk5、j=3ではk7が順次抽出され、それぞれ、k[1],k[2],k[3]に格納されることになる。
【0067】
ステップS44では、変数jが0に再設定される。そして、ステップS45に進み、配列kの第j番目の要素(k[j])の値が1であるか否かが判定される。その結果、k[j]が0である(NO)と判定された場合は、ステップS47に進み、配列y’[]の第j番目(y’[j])に、0が代入された後、ステップS48に進む。一方、k[j]=1である(YES)と判定された場合には、ステップS46に進み、以下の演算が実行される。
【0068】
y’[j]=240&d12−16 ・・・(6)
【0069】
即ち、入力データd12の上位4ビットには、プリフィルタ後の画素値(y4)が格納されているので、d12と240の論理積を演算することにより、y4が抽出され、得られた値に16を加算した値が、配列y’の第j番目の要素(y’[j])として格納される。
【0070】
ステップS48では、変数jの値が1だけインクリメントされ、ステップS49に進み、変数jの値が4よりも小さいか否かが判定される。その結果、変数jの値が4よりも小さい(YES)と判定された場合には、ステップS45に戻り、前述の場合と同様の処理が繰り返される。また、変数jの値が4以上である(NO)と判定された場合には、ステップS50に進む。
【0071】
ステップS50では、以下の処理が実行される。
【0072】
k1=k[0] ・・・(7)
k3=k[1] ・・・(8)
k5=k[2] ・・・(9)
k7=k[3] ・・・(10)
【0073】
即ち、配列kの第0乃至第3番目の要素が、変数k1,k3,k5,k7にそれぞれ代入される。
【0074】
そして、ステップS50の処理が終了すると、ステップS51に進み、以下の式に示す処理が実行される。
【0075】
y1’=y’[0] ・・・(11)
y3’=y’[1] ・・・(12)
y4’=d12 ・・・(13)
y5’=y’[2] ・・・(14)
y7’=y’[3] ・・・(15)
【0076】
即ち、配列y’の第0番目乃至第3番目の要素が、変数y1’,y3’,y5’,y7’にそれぞれ代入されるとともに、入力データd12の値がy4’に代入される。そして、これらの変数に代入された値が、予測フィルタ回路4cに出力され、処理を終了する(エンド)。
【0077】
以上の処理により、図13に示すように、入力されたデータd12より、代表画素の値(y1’,y3’,y4’,y5’,y7’)と、付加コード(k1,k3,k5,k7)とを得る。
【0078】
図14は、予測フィルタ回路4cの構成例を示している。この図に示すように、予測フィルタ回路4cは、クラス分類回路4c−1およびフィルタ回路4c−2により構成されている。クラス分類回路4c−1は、付加コードと1ブロック分の画素とから、クラスコードを生成して、フィルタ回路4c−2に供給する。フィルタ回路4c−2は、クラスコードに対応する係数を、予測フィルタ係数格納回路5から読み出し、入力データとの間で所定の処理を行うことで、元の画素データを再生するようになされている。
【0079】
図15は、クラス分類回路4c−1が実行する処理の一例を示す図である。この処理が実行されると、ステップS60において、変数maxに、図16に示す、d7,d11,d12,d13,d17の中で、最大の値が選択されて代入される。続くステップS61では、d7,d11,d12,d13,d17の中で、最小の値が選択されて変数minに代入される。
【0080】
ステップS62では、変数drに値(max−min+1)が代入される。そして、ステップS63に進み、変数drの値が1であるか否かが判定される。その結果、変数drの値が1である(YES)と判定された場合には、ステップS66に進み、変数z12に0が代入されてステップS70に進む。また、変数drの値が0である(NO)と判定された場合には、ステップS64に進む。
【0081】
ステップS64では、以下の演算が実行される。
【0082】
w=2(d12−min+0.5)/dr ・・・(16)
【0083】
そして、続くステップS65では、ステップS64で得られたwの値が、0よりも小さいか否かが判定される。その結果、wの値が0よりも小さい(YES)と判定された場合は、ステップS66に進み、変数z12に値0が代入され、ステップS70に進む。また、wの値が0以上である(NO)と判定された場合には、ステップS67に進み、変数wの値が1よりも大きいか否かが判定される。その結果、変数wの値が1よりも大きい(YES)と判定された場合には、ステップS68に進み、変数z12に値1が代入され、ステップS70に進む。また、変数wの値が1以下である(NO)と判定された場合には、ステップS69に進み、変数wの値の小数点以下を切り捨てた整数値が変数z12に代入される。
【0084】
ステップS70では、以下の計算が実行される。
【0085】
i=(k7,k5,z12,k3,k1) ・・・(17)
【0086】
なお、ここで、( ,,,,)は、連接を表しており、()内の変数をそれぞれ1ビットとみなして順に結合して形成される2進数が変数iに代入される。そして、以上の演算が終了すると、得られた変数iの値がクラスコードとして出力され、処理を終了する(エンド)。
【0087】
以上のような処理により、クラス分類回路4c−1がクラスコードiを生成すると、得られたクラスコードiは、フィルタ回路4c−2に供給される。フィルタ回路4c−2は、クラスコードiに対応するフィルタ係数を、予測フィルタ係数格納回路5から読み出す。
【0088】
予測フィルタ係数格納回路5は、予測フィルタ係数生成回路6により生成された、クラスコードiに対応する予測フィルタ係数係数bij0乃至bij24およびcij1,cij3,cij5,cij7を、フィルタ回路4c−2に供給する。なお、これらの予測フィルタ係数は、図17に示すように、復号化しようとする部分の代表画素に対応する係数cij1,cij3,cij5,cij7と、25画素からなるブロックのそれぞれの画素に対応する係数bij0乃至bij24から構成されている。
【0089】
フィルタ回路4c−2は、以上の予測フィルタ係数と、デコード回路4bにより得られたy1’,y3’,y5’,y7’と、1ブロック分の画素データd0乃至d24の間で演算を行い、図17に示す、デコード後のデータであるx0’乃至x8’を得る。
【0092】
以上のような処理により得られたブロックデータは、非ブロック化回路4dに供給されることになる。
【0093】
非ブロック化回路4dでは、予測フィルタ回路4cより出力されたブロックデータ@1乃至@6が、内蔵されているメモリに記憶され、図18に示すように、ライン#1乃至#6の順序で、1ライン毎に順次読み出されて出力される。
【0094】
次に、図19を参照して、図1に示す実施の形態のプリフィルタ係数生成回路3と予測フィルタ係数生成回路6における、プリフィルタ係数と、予測フィルタ係数の生成方法について説明する。
【0095】
図19は、プリフィルタ係数と予測フィルタ係数を生成する処理を説明するフローチャートである。いま、学習用のサンプルとして、n種類の画像(原画)が準備されており、その原画に基づいて、係数が生成されるものとする。
【0096】
図19の処理が実行されると、ステップS100において、プリフィルタ係数生成回路3にプリフィルタ係数の初期値(初期プリフィルタ係数)が設定される。
【0097】
例えば、初期係数として、以下のような値を用いることができる。
【0098】
111
111
111
【0099】
そして、ステップS101では、以上のような初期プリフィルタ係数を用いて、エンコーダ1において、前述のような、原画の圧縮処理が実行され、1/9に圧縮された画像が生成される。
【0100】
続くステップS102では、予測フィルタ係数の学習が行われる。即ち、学習用の原画と、デコーダ4から出力されるデコード画像との間で、最小2乗法に基づく計算がなされ、予測フィルタ係数が決定されることになる。以下にその詳細を説明する。
【0101】
いま、第k番目の原画が圧縮処理されたとすると、その出力の一部は、図20に示すようになる。また、学習用の原画のうち、図20の画素d12kを中心画素とする中心ブロックの画素をx0k乃至x8kとする。このとき、エンコーダ1から出力された画像データをDijとし、また、予測フィルタ係数をBjとすると、これらの間には以下の関係が成立する。なお、iは、フィルタのクラス数を表しており、また、jはモード数を表しており、それぞれ、0≦i≦31,0≦j≦8である。
【0102】
Xj’=DijBj ・・・(19)
【0103】
なお、式(19)は、次のように表わすことができる。
【0104】
【数1】
【0105】
ここで、学習用の原画をXjとすると、予測フィルタ係数は、以下のような条件を満足することが望まれる。なお、minは最小値を意味する。
【0106】
|Xj’−Xj|2 →min ・・・(21)
【0107】
ここで、式(19)を式(21)に代入すると、以下の式を得る。
【0108】
|DijBj−Xj|2→min ・・・(22)
【0109】
制約条件として|Bj|2≦1を課した場合に、式(22)を解くと以下の式を得る。
【0110】
Bij=(DijtDij+αI)-1DijtXj ・・・(23)
【0111】
ここで、tは転置を、また、−1は、逆行列を表している。更に、Iは、n×mの単位行列を表している。
【0112】
図21は、以上に示したような最小2乗法に基づいて、予測フィルタ係数を計算する処理の一例を説明するフローチャートである。
【0113】
この処理が実行されると、ステップS200において、行列(DijtDij)の全ての要素の絶対値の和が計算され、得られた値が変数maxに代入される。続くステップS201では、処理の開始値を格納する変数loop_startが1に初期設定される。続くステップS202では、変数maxの値の対数を取った値の整数部分が、処理の終了値を格納する変数loop_endに格納される。
【0114】
続くステップS203では、自然対数eの変数loop_start乗の値(=exp(loop_start))が計算され、変数αに代入される。
【0115】
ステップS204では、前述の式(23)に従って、予測フィルタの係数Bijが計算されることになる。
【0116】
次のステップS205では、|Bij|2の値が1以下であるか否かが判定される。即ち、予測フィルタ係数のノルムが1以下であるか否かが判定される。その結果、|Bij|2の値が1以下である(YES)と判定された場合には、処理を終了する(エンド)。また、|Bij|2の値が1よりも大きい(NO)と判定された場合にはステップS206に進む。
【0117】
ステップS206では、変数loop_startの値が1だけインクリメントされ、ステップS207に進む。ステップS207では、exp(loop_start)が演算され、得られた値が変数αに代入される。そして、ステップS208に進む。
【0118】
ステップS208では、変数loop_startの値が変数loop_endの値以上であるか否かが判定される。その結果、変数loop_startの値が変数loop_endの値以上である(YES)と判定された場合には、処理を終了する(エンド)。また、変数loop_startの値が変数loop_endの値よりも小さい(NO)と判定された場合には、ステップS204に戻り、前述の場合と同様の処理が繰り返されることになる。
【0119】
以上の処理により、最小2乗法に基づいて、予測フィルタの係数の最適値が算出されることになる。
【0120】
図19に戻って、以上のようにして、予測フィルタ係数が決定されると、ステップS103に進み、デコード(復号化)画像が生成されることになる。この処理は、前述の場合と同様であり、ステップS102において生成された予測フィルタ係数を用いて、エンコーダ1から出力された画像が復号化されることになる。
【0121】
続くステップS104では、原画とデコード画(デコーダ4の出力画像)との間で、以下の式により、SNR(Signal-to-noise Ratio)が計算される。
【0122】
SNR=20log10(255/誤差の標準偏差) ・・・(24)
【0123】
ここで、誤差の標準偏差は、以下の式により求めることができる。
【0124】
【数2】
【0125】
即ち、全画素に亘って、誤差の2乗平均の平方根が求められる。なお、ここで、Nは、全データ(画素)数を示している。
【0126】
SNRが算出されると、ステップS105に進む。そして、SNRの変化量が小さいか、または、処理回数が所定値を超過したか否かが判定される。即ち、前回の処理により得られたSNRと今回の処理により得られたSNRの差が0.05dB以下であるか、または、処理回数が50回を超過したか否かが判定される。その結果、変化量が小さいかまたは所定の処理回数を超過した(YES)と判定された場合は、処理を終了する(エンド)。また、これらの何れも満足していない(NO)と判定された場合には、ステップS106に進む。
【0127】
ステップS106では、プリフィルタ係数の学習が実行される。即ち、図23に示すように、エンコード処理では、第k番目の原画の15×15画素のブロックに対して所定の演算がなされ、5×5画素の圧縮画像が得られることになるが、このとき、中心画素ブロックの値は以下の式により求めることができる。
【0128】
【0129】
この式において、予測フィルタ係数bij0,bij1,bij2,・・・,cij1,cij3,cij5,cij7は、ステップS102の処理において既に決定されているので、既知である。また、付加コードy1’k,y3’k,y5’k,y7’kも既知である。従って、これらの既知の値をもとにして、プリフィルタ係数である、ap0,ap1,ap8,・・・,aq0,aq1,・・・,aq8,・・・を求めることを考える。
【0130】
式(26)において、既知であるcij1×y1’k+cij3×y3’k+cij5×y5’k+cij7×y7’kを左辺に移行し、これを行列式で表すと、以下のようになる。
【0131】
【数3】
【0132】
この式に対して、前述の場合と同様に、2乗最小法を適用することにより、プリフィルタ係数の最適値を求めることができる。即ち、式(27)をX=BAと表すと、以下の式を計算することにより最適値を得る。
【0133】
A=(BtB+αI)-1BtX ・・・(28)
【0134】
具体的には、図21のフローチャートと同様の処理を行うことにより、最適なプリフィルタ係数を求めることができる。
【0135】
図19に戻り、ステップS106の処理が終了し、プリフィルタ係数の最適値が計算されると、ステップS101に戻り、前述の場合と同様の処理が繰り返されることになる。その結果、原画とデコード画とのSNRの変化量が小さくなった場合(値が収束した場合)もしくは、処理回数が所定の回数を超過した場合には処理が終了する(エンド)。
【0136】
以上のような処理によれば、学習用の原画を用いて、予測フィルタとプリフィルタの特性を、画像に合わせて最適化することが可能となるので、画質の劣化を最小限にとどめて圧縮伸長処理することが可能となる。
【0137】
【発明の効果】
請求項1に記載の符号化装置および請求項4に記載の符号化方法によれば、学習用のもとの画像情報が準備されているとき、復号化処理において用いられた第2の係数と、学習用のもとの画像情報とを参照して、もとの画像情報に含まれる複数画素の画素値に対して所定の係数を積和演算し、学習用のもとの画像情報の画素を間引くことによって得られた符号化後の画像情報から第2の係数に基づいて復号された画像情報と、符号化前の学習用のもとの画像情報の差を最小にするその所定の係数を第1の係数の最適値として算出するようにしたので、画像に応じて最適な係数を設定することが可能となる。
【図面の簡単な説明】
【図1】本発明の一実施の形態の構成例を示すブロック図である。
【図2】図1に示すエンコーダの構成例を示すブロック図である。
【図3】図2に示すブロック化回路で実行される処理の一例を説明する図である。
【図4】原画の一例を示す図である。
【図5】図2に示すプリフィルタ回路の詳細な構成例を示すブロック図である。
【図6】中心画素と代表画素を説明する図である。
【図7】図5のクラス分類回路が実行する処理の一例を説明するフローチャートである。
【図8】プリフィルタによる演算処理の様子を説明する図である。
【図9】図2に示す付加コード生成回路が実行する処理の一例を説明するフローチャートである。
【図10】図1に示すデコーダの構成例を示すブロック図である。
【図11】図10に示すブロック化回路の実行する処理の様子を説明する図である。
【図12】図10に示すデコード回路が実行する処理の一例を説明するフローチャートである。
【図13】図10に示すデコード回路が実行する処理の様子を説明する図である。
【図14】図10に示す予測フィルタ回路の詳細な構成例を示すブロック図である。
【図15】図14に示すクラス分類回路が実行する処理の一例を説明するフローチャートである。
【図16】図15の処理において対象となる画素の一例を説明する図である。
【図17】予測フィルタ回路において実行される処理の様子を説明する図である。
【図18】図10に示す非ブロック化回路において実行される処理の様子を説明する図である。
【図19】プリフィルタ係数および予測フィルタ係数の最適値を求める処理の一例を説明するフローチャートである。
【図20】圧縮処理後の画像の一例を説明する図である。
【図21】予測フィルタ係数の最適値を求める処理の一例を説明するフローチャートである。
【図22】原画と復号処理後の画像の一例を説明する図である。
【図23】エンコード処理における、原画とプリフィルタ係数との関係を示す図である。
【符号の説明】
1 エンコーダ, 1a ブロック化回路, 1b プリフィルタ回路(演算手段、第1の演算手段), 1c 付加コード生成回路(第2の算出手段), 1d コード化回路(出力手段、付加手段、送信手段), 2 プリフィルタ係数格納回路, 3 プリフィルタ係数生成回路(算出手段、第1の算出手段),4 デコーダ, 4a ブロック化回路(受信手段), 4b デコード回路, 4c 予測フィルタ回路(演算手段、第2の演算手段), 4d 非ブロック化回路4d, 5 予測フィルタ係数格納回路, 6 予測フィルタ係数生成回路(算出手段、第2の算出手段)[0001]
BACKGROUND OF THE INVENTION
The present invention Encoding device and encoding method In particular, a product-sum operation is performed between the original information and a predetermined coefficient, and the information is Compressing encoding apparatus and encoding method About.
[0002]
[Prior art]
Conventionally, for example, when the amount of information is compressed by thinning pixels from image data at a predetermined ratio, the predetermined pixels are thinned after the pre-processing is executed by the sub-sampling filter.
[0003]
In such a process, a fixed coefficient filter that satisfies the Nyquist condition (sampling theorem) is used as the sub-sampling filter.
[0004]
[Problems to be solved by the invention]
However, such a fixed coefficient filter has the same characteristics regardless of the type of image to be processed, and there is a problem that the characteristics may not be optimal depending on the type of image.
[0005]
In addition, a fixed coefficient filter is also used as a prediction filter used in decoding a compressed image. Therefore, the prediction filter has the same problem as that described above.
[0006]
The present invention has been made in view of the above situation. For example, the present invention is optimal in the case where compression processing is performed by thinning out predetermined pixels from image data and the original image is expanded using a prediction filter. An object is to provide a subsampling filter and a prediction filter.
[0007]
[Means for Solving the Problems]
The encoding device according to
[0008]
The encoding method according to
[0013]
In the encoding device according to
[0014]
In the encoding method according to
[0019]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a block diagram showing a configuration example of an embodiment of the present invention. In this figure, an
[0020]
The
[0021]
FIG. 2 shows a detailed configuration example of the
[0022]
The additional code generation circuit 1c (second calculation means) performs a predetermined operation between the central pixel of the blocked image data and the four surrounding pixels, and sends the obtained additional code to the
[0023]
The
[0024]
Next, the operation of the present embodiment will be described. The present invention is characterized by a method for determining a prefilter and a prediction filter coefficient. As a previous step, the compression and expansion processing of image data according to the present embodiment will be described.
[0025]
Now, assume that image data as shown in FIG. 3 is input to the
[0026]
In FIG. 2, the number of pixels is reduced to simplify the description, but an actual image is composed of pixels of about several hundred to several thousand dots, for example, vertically and horizontally.
[0027]
The
[0028]
That is, nine pixels in the region surrounded by the broken line shown in FIG. 3 are set to x0 to x8 in order from the upper left as shown in FIG. When such a block is input, the
[0029]
FIG. 7 is a flowchart for explaining an example of the class classification process. When this process is executed, in step S1, the pixel values of the pixels x1, x3, x4, x5, and x7 are stored in the 0th to the fourth of the one-dimensional array x [], respectively.
[0030]
In step S2, the maximum value among x1, x3, x4, x5, and x7 (hereinafter referred to as a representative pixel) is assigned to the variable max. In the subsequent step S3, the smallest value among the representative pixels is substituted into the variable min. In step S4, the value (max−min + 1) is substituted into the variable dr.
[0031]
In step S5, it is determined whether or not the value of the variable dr is 1. As a result, if it is determined that the value of the variable dr is 1 (YES), the process proceeds to step S6, and 0 is assigned to the variable i, and then the process ends (END). When it is determined that the value of the variable dr is not 1 (NO), the process proceeds to step S7.
[0032]
In step S7, the variable j is initialized to 0, and the process proceeds to step S8. In step S8, the value obtained by the following equation is substituted into the variable w. Note that w is a real number and is calculated by a floating point.
[0033]
2 (x [j] -min + 0.5) / dr (1)
[0034]
In the next step S9, it is determined whether or not the value of the variable w calculated in step S8 is smaller than zero. As a result, when it is determined that the value of the variable w is smaller than 0 (w <0: YES), the process proceeds to step S10, 0 is substituted into the array z [j], and the process proceeds to step S14. When it is determined that the value of the variable w is 0 or more (w ≧ 0: NO), the process proceeds to step S11. In step S11, it is determined whether or not the value of the variable w is greater than 1. As a result, if it is determined that the value of the variable w is greater than 1 (w> 1: YES), step S12 is performed. The
[0035]
In step S14, the value of the variable j is incremented by 1, and the process proceeds to step S15. In step S15, it is determined whether or not the value of the variable j is smaller than 5. As a result, when it is determined that the value of the variable j is smaller than 5 (j <5: YES), the process returns to step S7, the same processing as described above is repeated, and the value of the variable j is 5 or more. If it is determined that (j ≧ 5: NO), the process proceeds to step S16.
[0036]
In step S16, the value obtained by the following equation is substituted into the variable i, and the process ends (END).
[0037]
z [0] × 1 + z [1] × 2 + z [2] × 4 + z [3] × 8 + z [4] × 16 (2)
[0038]
That is, the 0th to 4th elements of the array z [] are substituted into the variable i for storing the class code as the 0th bit (LSB) to the 4th bit (MSB). Then, the process ends (END).
[0039]
The class code i generated as described above is supplied to the
[0040]
The
[0041]
[0042]
The pixel value y4 obtained in this way is supplied to the
[0043]
The data output from the blocking
[0044]
When this process is executed, in step S20, the pixel values of the pixels x1, x3, x5, and x7 are substituted into the 0th to the third of the one-dimensional array x []. In step S21, variable j is initialized to 0.
[0045]
In the subsequent step S22, the value obtained by subtracting the value of the center pixel x4 from the jth element (x [j]) of the array x [] and further subtracting the
[0046]
In step S23, it is determined whether or not the value of w obtained in step S22 is greater than zero. As a result, when it is determined that the value of the variable w is greater than 0 (w> 0: YES), the process proceeds to step S24. Conversely, if it is determined that the value of the variable w is 0 or less (w ≦ 0: NO), the process proceeds to step S25.
[0047]
In step S24, 1 is assigned to the jth (k [j]) of the one-dimensional array k [], and in step S25, 0 is assigned to the jth (k [j]) of the one-dimensional array k []. Is substituted. Then, the process proceeds to step S26.
[0048]
Therefore, when the pixel value of the pixel x1 (or x3, x5, x7) is larger than the value obtained by adding the
[0049]
In step S26, the value of variable j is incremented by 1, and the process proceeds to step S27. In step S27, it is determined whether the value of the variable j is smaller than 4. As a result, when it is determined that the value of the variable j is smaller than 4 (j <4: YES), the process returns to step S22, and the same process as described above is repeated. If it is determined that the value of the variable j is 4 or more (j ≧ 4: NO), the process is terminated (END).
[0050]
The additional code obtained by the above processing is supplied to the
[0051]
The
[0052]
d12 = (240 & y4) | (k [3], k [2], k [1], k [0]) (4)
[0053]
D12 indicates output data. & Represents a logical product, and | represents a logical sum. Further, (,,) represents a connection. That is, in the case of (a, b), it is indicated that the variable a is the upper bit and the variable b is the lower bit, and the data is collected.
[0054]
According to such an operation, the upper 4 bits of the pixel value y4 are extracted by the first operation in () (240 is 11110000 in the binary system) and added by the next operation in (). The code is converted into 4-bit data. Then, by calculating the logical sum of these (), the upper 4 bits and the lower 4 bits are superimposed.
[0055]
FIG. 10 is a block diagram showing a detailed configuration example of the
[0056]
As shown in this figure, the
[0057]
The blocking circuit 4a is configured to block input data. The
[0058]
A method for generating a prediction filter coefficient in the prediction filter
[0059]
Next, the operation of the
[0060]
FIG. 11 is a diagram for explaining the operation of the blocking circuit 4a. Image data (data subjected to compression processing) is input to the blocking circuit 4a in the order indicated by
[0061]
The blocking circuit 4a stores pixel data input in the order of
[0062]
FIG. 12 shows an example of processing executed in the
[0063]
k [j] = (d12 & 2 j ) / 2 j ... (5)
[0064]
Here, d12 indicates input data. In addition, & indicates a logical product as described above. For example, in the case of j = 0, d12 and 1 (= 2 0 ) Is calculated, and the obtained value is 1 (= 2) 0 ) And assigned to the array k [0]. That is, when j = 0, the least significant bit (k1) of the additional code stored in the least significant bit of d12 is extracted. When j = 1, 2, 3, information (k3, k5, k7) of the first to third bits is extracted from the least significant bit.
[0065]
In the following step S42, the value of the variable j is incremented by 1, and in step S43, it is determined whether or not the value of the variable j is smaller than 4. As a result, when it is determined that the value of the variable j is smaller than 4 (YES), the process returns to step S41, and the same process as described above is repeated. If it is determined that the value of the variable j is 4 or more (NO), the process proceeds to step S44.
[0066]
As a result of the above iterative process, when j = 1, k3 is extracted from the input data d12. Hereinafter, k5 is extracted sequentially when j = 2, and k7 is sequentially extracted when j = 3. K [1] and k [2] respectively. , K [3].
[0067]
In step S44, the variable j is reset to 0. Then, the process proceeds to step S45, where it is determined whether or not the value of the jth element (k [j]) of the array k is 1. As a result, if it is determined that k [j] is 0 (NO), the process proceeds to step S47, and 0 is assigned to the jth (y ′ [j]) of the array y ′ []. The process proceeds to step S48. On the other hand, if it is determined that k [j] = 1 (YES), the process proceeds to step S46, and the following calculation is executed.
[0068]
y ′ [j] = 240 & d12−16 (6)
[0069]
That is, since the pre-filtered pixel value (y4) is stored in the upper 4 bits of the input data d12, y4 is extracted by calculating the logical product of d12 and 240, and the obtained value is converted into the obtained value. A value obtained by adding 16 is stored as the j-th element (y ′ [j]) of the array y ′.
[0070]
In step S48, the value of variable j is incremented by 1, and the process proceeds to step S49 where it is determined whether or not the value of variable j is smaller than 4. As a result, when it is determined that the value of the variable j is smaller than 4 (YES), the process returns to step S45, and the same process as described above is repeated. If it is determined that the value of the variable j is 4 or more (NO), the process proceeds to step S50.
[0071]
In step S50, the following processing is executed.
[0072]
k1 = k [0] (7)
k3 = k [1] (8)
k5 = k [2] (9)
k7 = k [3] (10)
[0073]
That is, the 0th to 3rd elements of the array k are assigned to the variables k1, k3, k5, and k7, respectively.
[0074]
Then, when the process of step S50 is completed, the process proceeds to step S51, and the process shown in the following expression is executed.
[0075]
y1 ′ = y ′ [0] (11)
y3 ′ = y ′ [1] (12)
y4 ′ = d12 (13)
y5 ′ = y ′ [2] (14)
y7 ′ = y ′ [3] (15)
[0076]
That is, the 0th to third elements of the array y ′ are assigned to variables y1 ′, y3 ′, y5 ′, and y7 ′, respectively, and the value of the input data d12 is assigned to y4 ′. Then, the values assigned to these variables are output to the
[0077]
Through the above processing, as shown in FIG. 13, from the input data d12, the representative pixel values (y1 ′, y3 ′, y4 ′, y5 ′, y7 ′) and the additional codes (k1, k3, k5) k7).
[0078]
FIG. 14 shows a configuration example of the
[0079]
FIG. 15 is a diagram illustrating an example of processing executed by the
[0080]
In step S62, a value (max−min + 1) is substituted for the variable dr. In step S63, it is determined whether or not the value of the variable dr is 1. As a result, when it is determined that the value of the variable dr is 1 (YES), the process proceeds to step S66, 0 is substituted into the variable z12, and the process proceeds to step S70. If it is determined that the value of the variable dr is 0 (NO), the process proceeds to step S64.
[0081]
In step S64, the following calculation is executed.
[0082]
w = 2 (d12−min + 0.5) / dr (16)
[0083]
In subsequent step S65, it is determined whether or not the value of w obtained in step S64 is smaller than zero. As a result, when it is determined that the value of w is smaller than 0 (YES), the process proceeds to step S66, the
[0084]
In step S70, the following calculation is executed.
[0085]
i = (k7, k5, z12, k3, k1) (17)
[0086]
Here, (,,,) represents concatenation, and a binary number formed by sequentially combining the variables in () as one bit is substituted into the variable i. When the above calculation is finished, the value of the obtained variable i is output as a class code, and the process is finished (END).
[0087]
When the
[0088]
The prediction filter
[0089]
The
[0092]
The block data obtained by the above processing is supplied to the
[0093]
In the
[0094]
Next, the prefilter coefficient and prediction filter coefficient generation method in the prefilter
[0095]
FIG. 19 is a flowchart for describing processing for generating prefilter coefficients and prediction filter coefficients. Now, n types of images (original images) are prepared as learning samples, and coefficients are generated based on the original images.
[0096]
When the process of FIG. 19 is executed, in step S100, an initial value (initial prefilter coefficient) of the prefilter coefficient is set in the prefilter
[0097]
For example, the following values can be used as the initial coefficient.
[0098]
111
111
111
[0099]
In step S101, using the initial prefilter coefficient as described above, the
[0100]
In subsequent step S102, learning of the prediction filter coefficient is performed. That is, a calculation based on the least square method is performed between the learning original image and the decoded image output from the
[0101]
Now, assuming that the kth original image has been subjected to compression processing, a part of the output is as shown in FIG. Further, in the original image for learning, the pixels in the central block having the pixel d12k in FIG. 20 as the central pixel are set to x0k to x8k. At this time, when the image data output from the
[0102]
Xj ′ = DijBj (19)
[0103]
Equation (19) can be expressed as follows.
[0104]
[Expression 1]
[0105]
Here, when the learning original picture is Xj, it is desirable that the prediction filter coefficients satisfy the following conditions. Note that min means a minimum value.
[0106]
| Xj'-Xj | 2 → min (21)
[0107]
Here, when the equation (19) is substituted into the equation (21), the following equation is obtained.
[0108]
| DijBj-Xj | 2 → min (22)
[0109]
| Bj | 2 When ≦ 1 is imposed, the following equation is obtained when equation (22) is solved.
[0110]
Bij = (Dij t Dij + αI) -1 Dij t Xj (23)
[0111]
Here, t represents transposition and -1 represents an inverse matrix. Further, I represents an n × m unit matrix.
[0112]
FIG. 21 is a flowchart for explaining an example of processing for calculating a prediction filter coefficient based on the least square method as described above.
[0113]
When this process is executed, in step S200, the matrix (Dij t The sum of the absolute values of all elements of Dij) is calculated and the obtained value is substituted into the variable max. In the subsequent step S201, a variable loop_start for storing a process start value is initialized to 1. In the subsequent step S202, the integer part of the logarithm of the value of the variable max is stored in a variable loop_end that stores the end value of the process.
[0114]
In the subsequent step S203, the value of the natural logarithm e raised to the variable loop_start power (= exp (loop_start)) is calculated and substituted into the variable α.
[0115]
In step S204, the coefficient Bij of the prediction filter is calculated according to the above equation (23).
[0116]
In the next step S205, | Bij | 2 It is determined whether the value of is less than or equal to 1. That is, it is determined whether the norm of the prediction filter coefficient is 1 or less. As a result, | Bij | 2 When it is determined that the value of 1 is 1 or less (YES), the process is terminated (END). Also, | Bij | 2 If it is determined that the value of is greater than 1 (NO), the process proceeds to step S206.
[0117]
In step S206, the value of the variable loop_start is incremented by 1, and the process proceeds to step S207. In step S207, exp (loop_start) is calculated, and the obtained value is substituted into the variable α. Then, the process proceeds to step S208.
[0118]
In step S208, it is determined whether or not the value of the variable loop_start is greater than or equal to the value of the variable loop_end. As a result, when it is determined that the value of the variable loop_start is equal to or greater than the value of the variable loop_end (YES), the process is ended (END). If it is determined that the value of the variable loop_start is smaller (NO) than the value of the variable loop_end, the process returns to step S204, and the same processing as described above is repeated.
[0119]
With the above processing, the optimum value of the coefficient of the prediction filter is calculated based on the least square method.
[0120]
Referring back to FIG. 19, when the prediction filter coefficient is determined as described above, the process proceeds to step S103, and a decoded image is generated. This process is the same as described above, and the image output from the
[0121]
In subsequent step S104, an SNR (Signal-to-noise Ratio) is calculated between the original image and the decoded image (the output image of the decoder 4) by the following equation.
[0122]
SNR = 20log Ten (255 / standard deviation of error) (24)
[0123]
Here, the standard deviation of the error can be obtained by the following equation.
[0124]
[Expression 2]
[0125]
That is, the square root of the mean square error is obtained over all pixels. Here, N indicates the total number of data (pixels).
[0126]
When the SNR is calculated, the process proceeds to step S105. Then, it is determined whether the amount of change in SNR is small or whether the number of processing times exceeds a predetermined value. That is, it is determined whether the difference between the SNR obtained by the previous process and the SNR obtained by the current process is 0.05 dB or less, or the number of processes exceeds 50. As a result, when it is determined that the amount of change is small or the predetermined number of processing times has been exceeded (YES), the processing is ended (END). If it is determined that none of these is satisfied (NO), the process proceeds to step S106.
[0127]
In step S106, pre-filter coefficient learning is performed. That is, as shown in FIG. 23, in the encoding process, a predetermined calculation is performed on a 15 × 15 pixel block of the kth original image, and a compressed image of 5 × 5 pixels is obtained. At this time, the value of the central pixel block can be obtained by the following equation.
[0128]
[0129]
In this expression, the prediction filter coefficients bij0, bij1, bij2,..., Cij1, cij3, cij5, cij7 are already determined in the process of step S102, and thus are known. Further, additional codes y1′k, y3′k, y5′k, and y7′k are also known. Therefore, it is considered to obtain pre-filter coefficients ap0, ap1, ap8, ..., aq0, aq1, ..., aq8, ... based on these known values.
[0130]
In Expression (26), the known cij1 * y1'k + cij3 * y3'k + cij5 * y5'k + cij7 * y7'k is shifted to the left side and expressed as a determinant as follows.
[0131]
[Equation 3]
[0132]
By applying the least square method to this equation as in the case described above, the optimum value of the prefilter coefficient can be obtained. That is, when Expression (27) is expressed as X = BA, an optimum value is obtained by calculating the following expression.
[0133]
A = (B t B + αI) -1 B t X (28)
[0134]
Specifically, an optimal prefilter coefficient can be obtained by performing the same processing as in the flowchart of FIG.
[0135]
Returning to FIG. 19, when the process of step S106 is completed and the optimum value of the prefilter coefficient is calculated, the process returns to step S101 and the same process as described above is repeated. As a result, when the amount of change in SNR between the original image and the decoded image becomes small (when the value converges), or when the number of processing times exceeds a predetermined number, the processing ends (END).
[0136]
According to the above processing, it is possible to optimize the characteristics of the prediction filter and the pre-filter according to the image using the learning original image, so that the compression is performed with the least deterioration in image quality. Extension processing can be performed.
[0137]
【The invention's effect】
According to the encoding device according to
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration example of an embodiment of the present invention.
FIG. 2 is a block diagram illustrating a configuration example of an encoder illustrated in FIG.
FIG. 3 is a diagram for explaining an example of processing executed by the blocking circuit shown in FIG. 2;
FIG. 4 is a diagram illustrating an example of an original image.
5 is a block diagram showing a detailed configuration example of the prefilter circuit shown in FIG. 2. FIG.
FIG. 6 is a diagram illustrating a center pixel and a representative pixel.
FIG. 7 is a flowchart illustrating an example of processing executed by the class classification circuit of FIG.
FIG. 8 is a diagram for explaining a state of calculation processing by a pre-filter.
FIG. 9 is a flowchart for explaining an example of processing executed by an additional code generation circuit shown in FIG. 2;
10 is a block diagram showing a configuration example of a decoder shown in FIG. 1. FIG.
FIG. 11 is a diagram for explaining a state of processing executed by the blocking circuit shown in FIG. 10;
12 is a flowchart for explaining an example of processing executed by the decoding circuit shown in FIG.
13 is a diagram for explaining a state of processing executed by the decoding circuit shown in FIG.
14 is a block diagram illustrating a detailed configuration example of a prediction filter circuit illustrated in FIG.
FIG. 15 is a flowchart illustrating an example of processing executed by the class classification circuit shown in FIG. 14;
16 is a diagram illustrating an example of a target pixel in the process of FIG.
FIG. 17 is a diagram illustrating a state of processing executed in a prediction filter circuit.
18 is a diagram for explaining a state of processing executed in the unblocking circuit shown in FIG. 10;
FIG. 19 is a flowchart illustrating an example of processing for obtaining optimum values of prefilter coefficients and prediction filter coefficients.
FIG. 20 is a diagram illustrating an example of an image after compression processing.
FIG. 21 is a flowchart illustrating an example of processing for obtaining an optimum value of a prediction filter coefficient.
FIG. 22 is a diagram illustrating an example of an original image and an image after decoding processing.
FIG. 23 is a diagram illustrating a relationship between an original image and a prefilter coefficient in an encoding process.
[Explanation of symbols]
DESCRIPTION OF
Claims (4)
前記もとの画像情報に含まれる複数画素の画素値に対して第1の係数を積和演算し、前記もとの画像情報の画素を間引くことによって間引き後の画像情報を求める演算手段と、
前記第1の係数を算出する算出手段と、
前記演算手段により得られたデータを出力する出力手段とを備え、
前記算出手段は、学習用の前記もとの画像情報が準備されているとき、復号化処理において用いられた第2の係数と、学習用の前記もとの画像情報とを参照して、前記もとの画像情報に含まれる複数画素の画素値に対して所定の係数を積和演算し、学習用の前記もとの画像情報の画素を間引くことによって得られた符号化後の画像情報から前記第2の係数に基づいて復号された画像情報と、符号化前の学習用の前記もとの画像情報の差を最小にするその所定の係数を前記第1の係数の最適値として算出する
ことを特徴とする符号化装置。In the encoding apparatus that outputs after performing the process of thinning out pixels on the original image information,
A calculating means for multiplying and calculating a first coefficient with respect to pixel values of a plurality of pixels included in the original image information and obtaining image information after thinning by thinning out pixels of the original image information;
Calculating means for calculating the first coefficient;
Output means for outputting the data obtained by the arithmetic means,
When the original image information for learning is prepared, the calculating means refers to the second coefficient used in the decoding process and the original image information for learning, and From the encoded image information obtained by multiplying the pixel values of a plurality of pixels included in the original image information by a product-sum operation and thinning out the pixels of the original image information for learning. The predetermined coefficient that minimizes the difference between the image information decoded based on the second coefficient and the original image information for learning before encoding is calculated as the optimum value of the first coefficient. An encoding apparatus characterized by that.
ことを特徴とする請求項1に記載の符号化装置。The calculation means calculates an optimum value of the first coefficient from the second coefficient used in the decoding process and the original image information for learning using a least square method. The encoding device according to claim 1.
前記第2の算出手段により算出された非線形情報を、前記演算手段の演算結果に対して付加する付加手段とを更に備え、
前記出力手段は、前記付加手段により得られたデータを出力する
ことを特徴とする請求項2に記載の符号化装置。Information obtained by applying a predetermined threshold value to a difference value between a predetermined pixel included in the image information and a pixel value of other pixels located around the predetermined pixel, Represents a magnitude relationship between a pixel and a pixel value of the other pixel, and is used when interpolating the other pixel, and generates data based on the encoded image information corresponding to the predetermined pixel. A second calculating means for calculating nonlinear information;
An addition unit for adding the nonlinear information calculated by the second calculation unit to the calculation result of the calculation unit;
The encoding apparatus according to claim 2, wherein the output means outputs the data obtained by the adding means.
前記もとの画像情報に含まれる複数画素の画素値に対して第1の係数を積和演算し、前記もとの画像情報の画素を間引くことによって間引き後の画像情報を求める演算ステップと、
前記第1の係数を算出する算出ステップと、
前記演算ステップにより得られたデータを出力する出力ステップとを備え、
前記算出ステップは、学習用の前記もとの画像情報が準備されているとき、復号化処理において用いられた第2の係数と、学習用の前記もとの画像情報とを参照して、前記もとの画像情報に含まれる複数画素の画素値に対して所定の係数を積和演算し、学習用の前記もとの画像情報の画素を間引くことによって得られた符号化後の画像情報から前記第2の係数に基づいて復号された画像情報と、符号化前の学習用の前記もとの画像情報の差を最小にするその所定の係数を前記第1の係数の最適値として算出する
ことを特徴とする符号化方法。 In an encoding method for outputting after encoding the original image information by performing pixel thinning processing,
A calculation step of multiplying and calculating a first coefficient with respect to pixel values of a plurality of pixels included in the original image information, and obtaining image information after thinning out by thinning out pixels of the original image information;
A calculating step for calculating the first coefficient;
An output step of outputting the data obtained by the calculation step,
When the original image information for learning is prepared, the calculating step refers to the second coefficient used in the decoding process and the original image information for learning. From the encoded image information obtained by multiplying the pixel values of a plurality of pixels included in the original image information by a product-sum operation and thinning out the pixels of the original image information for learning. The predetermined coefficient that minimizes the difference between the image information decoded based on the second coefficient and the original image information for learning before encoding is calculated as the optimum value of the first coefficient. An encoding method characterized by the above .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP35151096A JP3965528B2 (en) | 1996-12-27 | 1996-12-27 | Encoding device and encoding method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP35151096A JP3965528B2 (en) | 1996-12-27 | 1996-12-27 | Encoding device and encoding method |
Related Child Applications (2)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005322682A Division JP3937442B2 (en) | 2005-11-07 | 2005-11-07 | Encoding device, encoding method, decoding device, and decoding method |
| JP2007029200A Division JP4434215B2 (en) | 2007-02-08 | 2007-02-08 | Decoding device and decoding method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH10191316A JPH10191316A (en) | 1998-07-21 |
| JP3965528B2 true JP3965528B2 (en) | 2007-08-29 |
Family
ID=18417784
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP35151096A Expired - Fee Related JP3965528B2 (en) | 1996-12-27 | 1996-12-27 | Encoding device and encoding method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3965528B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8270466B2 (en) * | 2008-10-03 | 2012-09-18 | Sony Corporation | Adaptive decimation filter |
-
1996
- 1996-12-27 JP JP35151096A patent/JP3965528B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH10191316A (en) | 1998-07-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6031938A (en) | Image encoding apparatus with selective Markov and predictive coding | |
| US5162923A (en) | Method and apparatus for encoding frequency components of image information | |
| US6580834B2 (en) | Method and apparatus for encoding and decoding signals | |
| US6072909A (en) | Image coding devise and image decoding devise using with image disassembly | |
| KR20010053286A (en) | Image coding/decoding method and recorded medium on which program is recorded | |
| JP3965528B2 (en) | Encoding device and encoding method | |
| US6714687B2 (en) | Image encoding/decoding method, apparatus thereof and recording medium in which program therefor is recorded | |
| JP4434215B2 (en) | Decoding device and decoding method | |
| US20250069276A1 (en) | Video processing method and electronic device | |
| CN120263194A (en) | A lossless compression and decompression method and system based on probability model | |
| JP3937442B2 (en) | Encoding device, encoding method, decoding device, and decoding method | |
| JP4174084B2 (en) | Encoding device, encoding method, decoding device, decoding method, transmission / reception device, and transmission / reception method | |
| JP2006033161A (en) | Encoding processing device | |
| US20020039449A1 (en) | Image compression apparatus | |
| JP3653759B2 (en) | Class classification adaptive processor | |
| US6778956B1 (en) | Voice recording-reproducing system and voice recording-reproducing method using the same | |
| JPH08275153A (en) | Image compression device and image decompression device | |
| JPH07123276A (en) | Digital compression encoding method of image signal | |
| JPS6118387B2 (en) | ||
| EP0783230A2 (en) | Transform coding of arbitrarily shaped image segments | |
| JPH0621828A (en) | Vector quantizing decoder | |
| JP2693557B2 (en) | Encoding device | |
| JPH0918877A (en) | Fractal image compression device | |
| Simpson | Interband prediction method for subband image coding | |
| JPH08331389A (en) | Image coding method and apparatus thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050901 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050909 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20051108 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060725 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060905 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20070112 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070208 |
|
| A911 | Transfer of reconsideration by examiner before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20070328 |
|
| 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: 20070502 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070515 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100608 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100608 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110608 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110608 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120608 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120608 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130608 Year of fee payment: 6 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |