JP3617253B2 - Image coding apparatus and method - Google Patents

Image coding apparatus and method Download PDF

Info

Publication number
JP3617253B2
JP3617253B2 JP14549997A JP14549997A JP3617253B2 JP 3617253 B2 JP3617253 B2 JP 3617253B2 JP 14549997 A JP14549997 A JP 14549997A JP 14549997 A JP14549997 A JP 14549997A JP 3617253 B2 JP3617253 B2 JP 3617253B2
Authority
JP
Japan
Prior art keywords
block
image
encoding
quantization
coefficient
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
Application number
JP14549997A
Other languages
Japanese (ja)
Other versions
JPH10336656A (en
Inventor
一弘 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP14549997A priority Critical patent/JP3617253B2/en
Publication of JPH10336656A publication Critical patent/JPH10336656A/en
Application granted granted Critical
Publication of JP3617253B2 publication Critical patent/JP3617253B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、画像符号化装置よび方法に関し、とくに符号化の過程で発生するブロックノイズを復号する前に検出できるようにするものである。
【0002】
【従来の技術】
連続調の画像を高能率に符号化する方式として、直交変換符号化方式が広く利用されている。とりわけ、直交変換に離散コサイン変換(Discrete Cosine Transform,以下DCTと記す)を用いたアルゴリズムは、静止画像符号化の国際標準であるJPEG(Joint Photographic ExpertGroup)にも採用されている。
【0003】
図16は、JPEGベースラインシステムと呼ばれるJPEGの基本アルゴリズムの構成を説明するブロック図である。
【0004】
図において、100は画像が入力される入力端子、200は入力された画像を8×8画素の矩形領域である画素ブロックに分割するブロック分割部、300は画素ブロック単位にDCTを施し、変換係数を出力するDCT変換部、400は変換係数をそれぞれの周波数ごとに設定された量子化ステップ幅を用いて線形量子化して量子化係数を出力する量子化部、500は量子化係数を所定の手順で可変長符号化して符号データを出力する可変長符号化部、600は符号データを出力する出力端子である。
【0005】
図17は、可変長符号化部500の構成を説明するブロック図である。図17において、101は量子化係数が入力される入力端子、501は量子化係数を図10に示す順序に並べ換え(ジグザグスキャン)、DC(直流)成分とAC(交流)成分を個別に出力するスキャン変換部、502はDC成分を1画素ブロックの処理時間の間遅延するブロック遅延部、503はDC成分より1つ前のブロックのDC成分を減算してDC成分の差分を出力する減算器、504は入力されるDC成分の差分を図6に示すような絶対値によるグループ分けをしてグループ番号SSSSと差分がグループ内のどの数値かを示す付加ビットを出力するグループ化部、505は図8(a)に示すような1次元のハフマン符号表を用いてDC成分のグループ番号SSSSを可変長符号してDCハフマン符号を出力する1次元ハフマン符号化部である。
【0006】
一方、507は入力されるAC成分が零であるか非零であるかを判定してAC成分の出力先を切り替える零判定部、508は零係数の連続する長さを係数してランレングスNNNNを出力するランレングスカウンタ、509は、DC成分の場合と同様に非零の交流係数の大きさを図7の表にしたがってグループ判定し、グループ番号SSSSと交流係数がグループ内のどの数値かを示す付加ビットを出力するグループ化部、510はランレングスNNNNとグループ番号SSSSの組合せを図8(b)の2次元ハフマン符号表を用いて符号化し、ACハフマン符号を出力する2次元ハフマン符号化部、506は、DCハフマン符号と、ACハフマン符号とDC成分とAC成分のそれぞれの付加ビットを多重化して符号データを出力する多重化部、600は符号データが出力される出力端子である。
【0007】
以下、図16にしたがってJPEGベースラインシステムの動作を説明する。図16において、入力端子100から入力された画像は、ブロック分割部200によって8×8画素の矩形領域である画素ブロックに分割される。図5(a)に画素ブロックの1例を示す。画素ブロックは、DCT変換部300においてDCTが施され、8×8のマトリクスとして変換係数が得られる。変換係数は、画素ブロック内に含まれる2次元周波数成分の電力に相当する情報である。
【0008】
図4は、変換係数の各要素と周波数との対応を示す図である。マトリクス内の最も左上にある要素がDC成分と呼ばれ、画素ブロック内の平均値に相当する。他の要素はAC成分と呼ばれ、右のものほど水平方向の、また、下のものほど垂直方向の高い周波数に対応している。図5(b)は、図5(a)の画素ブロックにDCTを施して得られる変換行列である。
【0009】
続いて量子化部400では、変換係数が各要素ごとに定められた量子化特性で線形に量子化される。
【0010】
図13は、線形量子化を説明する図であり、入力を量子化幅Qで量子化し、間隔Qで配置された離散的な出力が得られることを示している。JPEGでの量子化特性は、例えば図5(c)に示すマトリクスとして与えられ、これらの値で対応する位置の変換係数を除算して丸めることで量子化する。図5(d)は、図5(b)の変換係数を図5(c)の量子化マトリクスで量子化して得られた量子化後の係数である。
【0011】
可変長符号化部500では、図5(d)の量子化係数が可変長符号化され、出力端子600に符号データが出力される。
【0012】
以下、図17にしたがって可変長符号化部500の動作について説明する。
【0013】
スキャン変換部501は、入力される量子化係数の交流係数を、図10に示す順序で1次元化して出力する。DC成分は、何も処理されずにそのまま出力される。
【0014】
ブロック遅延部502は、1画素ブロックが符号化される期間、DC成分を記憶する。
【0015】
減算器503では、現在の画素ブロックのDC成分と、ブロック遅延部502に記憶された1つ前のDC成分との差分が計算される。
【0016】
グループ化部504では、図6のようにDC成分の差分を絶対値の大きさでグループ分けし、グループ番号と差分がグループ内のどの数値かを示す付加ビットを出力する。
【0017】
1次元ハフマン符号化部505は、図8(a)の1次元ハフマン符号表によってグループ番号に対応するDCハフマン符号を出力する。DCハフマン符号は付加ビットとともに多重化部506に入力される。
【0018】
一方、スキャン変換部501から出力されたAC成分は、零判定部507において零であるか非零であるかによって出力先が切り替えられる。
【0019】
零と判定されたAC成分は、ランレングスカウンタ508において、非零のAC成分が現れるまで零のAC成分の連続する長さが計数され、ランレングスが出力される。
【0020】
グループ化部509では、DC成分と同様に図7のように非零のAC成分のグループが決定され、グループ番号とAC成分がグループ内のどの数値かを示す付加ビットが出力される。
【0021】
2次元ハフマン符号化部510は、図9に示されるように、ランレングスとグループ番号の組合せで構成される2次元のハフマン符号表で符号化される。表の各要素には、図8(b)のようなACハフマン符号が割当てられている。ランレングスとグループ番号の組合せに対応するACハフマン符号が出力され、グループ化部509の出力する付加ビットとともに多重化部506に出力される。
【0022】
図11(a)は、図4(d)の量子化係数のDC成分ハフマン符号と付加ビットを表している。同様に図11(b)は、AC成分ハフマン符号と付加ビットを表し、図11(c)は、多重化部506より得られる符号データを表している。
【0023】
以上の手順で、JPEGベースラインシステムによる画像の符号化が完了する。
【0024】
一般に、変換符号化方式では、復号された画像が元の画像と同じにならない非可逆符号化である。これは、量子化の過程で情報が失われるためであり、圧縮率を高くしていくとブロックノイズなどのノイズが発生することが知られている。
【0025】
図12は、ブロックノイズを説明する図である。ブロックノイズの発生は以下のように説明することができる。変換符号化方式では、画素ブロックごとに符号化されるので、粗い量子化ですべてのAC成分が零に量子化されると、平均値だけのブロックが復号されることになる。これが周囲の画素ブロックの平均値と段差をもって接続されるためにブロック境界が目立つようになるためである。
【0026】
ブロックノイズは、画素の振幅変化の激しい領域ではそれほど目立たないが、階調変化の緩やかな領域では、矩形の階段上の階調変化となるため、大きな画質劣化の原因となることが知られている。
【0027】
こうしたブロックノイズの改善手法についてはこれまでに様々な検討がなされている。
【0028】
符号化側の改善手法としては、例えば、特開平4−220083号公報の手法は、DC成分のみのブロックをブロックノイズとして検出する手段を備え、検出した場合は1ビットのフラグを付加し、復号の際にこのブロックに平滑化処理を施すものである。
【0029】
また、特開平5−328329号公報では、符号化の際に、画素ブロックの平坦度とAC成分に対応して量子化特性を切り替える。
【0030】
特開平7−50758号公報では、単一色の原稿を読み込む場合に読取誤差による濃度変動で発生するブロック歪を検出し、周辺ブロックとの段差を平滑化する。さらにAC係数の絶対値が全て所定値以下の場合、AC係数を全て零にして符号化するものである。
【0031】
復号側の改善手法としては、特開平5−63997号公報では、復号の際にブロックごとの変換係数の分布によってノイズ除去フィルタの特性を決定するものである。DC成分のみのブロックが連続する場合、ブロックのDC成分の差が量子化ステップ以下の時だけノイズを除去するというものである。
【0032】
【発明が解決しようとする課題】
従来の技術における、ブロックノイズの検出フラグや可変量子化を用いた手法は、これらの機能を備えた特定の端末間でのみ実現可能であり、JPEGベースラインアルゴリズムを使用した画像伝送、例えば、カラーファクシミリなどの不特定多数の受信端末を想定するアプリケーションには適用できないという問題があった。
【0033】
また、従来の技術における、送信時の画像の補正処理や復号後の適応フィルタを用いた手法では、復号画像の画質改善を目的としたものであり、必ずしも原画像に忠実な画像が再現されるとは限らなかった。
【0034】
このため、原稿や用途によっては、送信側で符号化された画像を一旦復号して操作者が画質を確認し、ブロックノイズが発生している場合はより高画質なパラメータで再符号化して伝送することが最も確実な方法として考えられるが、人手を要することが問題となる。
【0035】
これらの問題は、そもそも符号化アルゴリズムにブロックノイズの発生を検出する機能を持たないことに起因すると考えられる。
【0036】
このため、本発明では、ブロック歪みの発生しない符号化を実現するために、ブロックノイズを検出機能を有する画像の符号化装置及び方法を提供することを目的としている。
【0037】
また、従来技術では、ブロックノイズの検出には、
(1)画素ブロック内の変換係数が量子化されてDC成分のみとなり、平均値のみが復号される画素ブロックを検出すること。
(2)画素ブロックの平均値が、周辺の画素ブロックの平均値と段差をもって隣接していること。
の二つの条件のいずれか、または両方を利用したものが多いが、これらを検出するための新たな回路を必要としたり、演算量が増加するという問題があった。
【0038】
本発明においては、JPEGベースラインシステムに代表される変換符号化の過程で得られる情報を用いてブロックノイズを検出することを第2の目的としている。
【0039】
【課題を解決するための手段】
上記課題を解決するために、本発明の請求項1に記載の画像の符号化装置は、画像を分割してN×M(N,Mは正整数)画素の矩形領域である画素ブロックを得る分割手段と、前記画素ブロックに直交変換を施して変換係数を得る変換手段と、前記変換係数を所定の量子化特性で量子化して量子化係数を得る量子化手段と、前記量子化係数のDC(直流)成分を直前の画素ブロックのDC成分との間の差分により可変長符号化し、前記量子化係数のAC(交流)成分を、零となるAC係数の連続する長さと、これに続く非零のAC係数の大きさの組合せにより可変長符号化する2次元可変長符号化手段とを備えており、特に、前記差分の値が+1または−1であることを検出して第1の検出信号を出力する第1の検出手段と、前記AC係数の連続する長さの値がN×M−1であることを検出して第2の検出信号を出力する第2の検出手段と、前記第1の検出信号と前記第2の検出信号の論理積をブロックごとの検出結果として出力する判定手段とを備え、前記ブロックごとの検出結果に基づいて、粗い量子化特性が設定されている場合には細かな量子化特性となるように、また細かな量子化特性が設定されている場合には粗い量子化特性となるように、前記量子化特性を変更した再符号化を実行することを特徴とする。
【0040】
この構成においては、従前の符号化の過程で生成される情報に基づいてブロックノイズを検出することができる。
【0041】
また、本発明の請求項2に記載の画像の符号化装置は、請求項1に記載の画像の符号化装置において、直前の画素ブロックでの前記第2の検出信号を記憶する記憶手段を備え、前記第1の検出信号と前記第2の検出信号と前記記憶手段に記憶された内容の論理積をブロックごとの検出結果として出力する判定手段と、を備え、前記ブロックごとの検出結果に基づいて、前記量子化特性を変更した再符号化の実行を決定することを特徴とする。
【0044】
また、本発明の請求項に記載の画像の符号化装置は、請求項1または2に記載の画像の符号化装置において、前記判定手段がAND素子であることを特徴とする。
【0045】
また、本発明の請求項に記載の画像の符号化装置は、請求項1または2に記載の画像の符号化装置において、前記直交変換が離散コサイン変換であることを特徴とする。
【0046】
また、本発明の請求項に記載の画像の符号化装置は、請求項1または2に記載の画像の符号化装置において、前記画素ブロックが8×8画素で構成されることを特徴とする。
【0047】
また、本発明の請求項に記載の画像の符号化装置は、請求項1または2に記載の画像の符号化装置において、前記第2の検出手段が前記AC係数の連続する長さの値がN×M−1であることを検出する代わりに、前記2次元可変長符号化手段が1の画素ブロックについてEOB(End Of Block)符号のみ出力することを検出して第2の検出信号を出力することを特徴とする。
【0048】
また、本発明の請求項に記載の画像の符号化装置は、請求項1または2に記載の画像の符号化装置において、前記ブロックごとの検出結果を計数する計数手段を備え、前記画像の符号化動作が完了した時に、前記計数手段の計数結果の、前記画像の全画素数、もしくは、前記画像に含まれるすべての画素ブロックの数に対する比率を求め、前記計数結果が所定の比率以上となる場合に前記量子化特性を変更した再符号化を実行することを特徴とする。
【0049】
また、本発明の請求項に記載の画像の符号化装置は、請求項1または2に記載の画像の符号化装置において、前記量子化手段におけるDC成分の量子化閾値が所定の値よりも小さい場合には、前記量子化特性を変更した再符号化を実行しないことを特徴とする。
【0050】
また、本発明の請求項に記載の画像の符号化装置は、請求項に記載の画像の符号化装置において、前記所定の値が、復号された画像を出力する出力手段の階調再現特性に応じて決定されることを特徴とする。
【0051】
また、本発明の請求項10に記載の画像符号化方法は、画像を分割してN×M(N,Mは正整数)画素の矩形領域である画素ブロックを得、前記画素ブロックに直交変換を施して変換係数を求め、前記変換係数を所定の量子化特性で量子化して量子化係数を得、前記量子化係数のDC(直流)成分を直前の画素ブロックのDC成分との間の差分により可変長符号化し、前記量子化係数のAC(交流)成分を、零となるAC係数の連続する長さと、これに続く非零のAC係数の大きさの組合せにより可変長符号化するものであり、とくに、前記差分の値が+1または−1であることを検出して第1のフラグをセットし、前記AC係数の連続する長さの値がN×M−1であることを検出して第2のフラグをセットし、前記第1のフラグと前記第2のフラグとの論理積からブロックごとの検出結果を求め、前記ブロックごとの検出結果に基づいて、粗い量子化特性が設定されている場合には細かな量子化特性となるように、また細かな量子化特性が設定されている場合には粗い量子化特性となるように、前記量子化特性を変更した再符号化を実行することを特徴とする。
【0052】
この構成においても、従前の符号化の過程で生成される情報に基づいてブロックノイズを検出することができる。
【0053】
また、請求項11に記載の画像符号化方法は、請求項10に記載の画像符号化方法において、直前の画素ブロックでの前記第2のフラグの値を第3のフラグにセットし、前記第1のフラグと前記第2のフラグと前記3のフラグとの論理積からブロックごとの検出結果を求め、前記ブロックごとの検出結果に基づいて、前記量子化特性を変更した再符号化を実行することを特徴とする。
【0054】
【発明の実施の形態】
以下、本発明について詳細に説明する。
【0055】
本発明のブロックノイズの検出機能を有する画像の符号化装置及び方法では、符号化の過程で得られる情報に基づいてブロックノイズを検出するものであり、より詳細には、この符号化過程の情報により、(1)平均値だけの画素ブロックの検出、(2)周辺ブロックとの段差の検出を行うものである。
【0056】
以下、それぞれの検出方法について説明する。
【0057】
平均値だけの画素ブロックは、全てのAC成分が零であるかどうかで判定する。図17に示される従来技術の可変長符号化部500においては、ランレングスカウンタ508で零のAC成分のランレングスを計数しているので、ランレングスカウンタ508から出力されるランレングスが63であれば全てのAC成分が零であることがわかる。
【0058】
一方、周辺画素ブロックとの段差は、DC成分の差分のグループ番号から判定することができる。
【0059】
ブロックノイズが問題となる緩やかな階調変化を持つ画像領域では、連続する画素ブロックにDCTを施し、量子化して得られるDC成分は、同一のレベルか隣合うレベルに量子化される。隣合うレベルに量子化された場合には、レベル間の差、すなわち量子化のステップ幅が量子化誤差となり、復号された画素ブロックの境界に段差が発生する。
【0060】
もともとの画素ブロックの境界にエッジが重なっていた場合には、エッジをはさむ画素ブロックのDC成分は、必ずしも隣り合うレベルに量子化されるとは限らない。
【0061】
このため、連続する画素ブロック間のDC成分の差が+1または−1の場合をブロックノイズ発生の条件とみなすことができる。これは、図6によれば、グループ番号が1となることを検出することにほかならない。
【0062】
図17に示される従来技術の可変長符号化部500においては、グループ化部504から出力されるグループ番号が1である場合、現在の画素ブロックを復号した時に、左隣の画素ブロックとの境界に段差が発生する可能性があるとみなすことができる。
【0063】
以上述べてきたように、本発明ではこれらの2つのブロックノイズ検出方法を併用することで原稿中の緩やかな階調変化を持つ画像領域に発生するブロックノイズを検出するものである。
【0064】
以下、本発明の実施例について説明する。
[第1の実施例]
図1は、本発明の第1の実施例を全体として示すものであり、この図において、図16に対応する個所には対応する符号を付して詳細な説明を省略する。図1においては、可変長符号化部500によりブロックノイズの検出を行い、この検出結果を量子化部400にフィードバックし量子化特性を適合化するようにしている。
【0065】
つぎに、可変長符号化部500によるブロックノイズの検出について説明する。図2はこの実施例の可変長符号化部500を示すものであり、この図において図11と対応する個所には対応する符号を付して詳細な説明を省略する。
【0066】
図において、511はグループ化部504の出力するグループ番号SSSSから特定のグループ番号を検出して検出信号を出力するグループ番号検出部、512はランレングスカウンタ508の出力するランレングスNNNNから特定のランレングスを検出して検出信号を出力するランレングス検出部、513はグループ番号検出部511とランレングス検出部512の出力するそれぞれの検出信号の論理積をブロックノイズ検出信号として出力するAND、601はブロックノイズ検出信号が出力される出力端子である。
【0067】
グループ番号検出部511は、直前のブロックとのDC成分の差分が+1または−1となる場合、すなわちグループ化部504の出力するグループ番号が1となる場合を検出し、1ビットの検出信号をAND513に出力する。
【0068】
また、ランレングス検出部512は、ランレングスカウンタ508の出力するランレングスが63の場合を検出し、検出を示す1ビットの検出信号をAND513に出力する。
【0069】
AND513は、グループ番号検出部511とランレングス検出部512の検出信号の論理積をブロックノイズ検出情報として出力端子601に出力する。
【0070】
本発明の第1の実施例においてブロックノイズが出力端子601より検出された場合は、量子化部400の量子化特性を変更して再符号化する。量子化特性の変更については、あらかじめ粗い量子化特性が設定されている場合は細かな量子化特性となるように、または、あらかじめ細かな量子化特性が設定されている場合は粗い量子化特性になるよう変更していく。
【0071】
再符号化の実行の決定は、ただ1度のブロックノイズの検出によって行ってもよいし、ブロックノイズ検出信号を図示されない計数手段によって計数し、計数結果を画像の総画素数、または総画素ブロック数と比較し、ブロックノイズが予め定められた比率以上発生していることでを決定してもよい。
【0072】
以上の構成、および動作により、本発明の第1の実施例の画像の符号化装置によって画像の符号化中に発生するブロックノイズを検出することができる。
【0073】
[第2の実施例]
つぎに本発明の第2の実施例について説明する。先に説明した第1の実施例では、直前の画素ブロックが平均値のみのブロックであるかどうかについては考慮されていなかった。このため、ブロックノイズの比較的目立たないエッジ領域と緩やかな階調の境界、例えばエッジの含まれる画素ブロックに平坦な画素ブロックが続くような場合についてもブロックノイズが検出されていた。
【0074】
一方、検出範囲を緩やかな階調領域に制限する場合には、直前の画素ブロックも平均値のみの画素ブロックである条件を追加すればよい。
【0075】
つまり、平均値のみとなる画素ブロックが連続し、その境界にDC成分の量子化幅に相当する段差が発生する場合のみをブロックノイズとして検出する。
【0076】
以下、図3にもとづいて、本発明の第2の実施例の構成について説明する。なお、図11に示す従来技術、または、図2に示される本発明の第1の実施例と同一の構成については、同一番号を付して説明を省略する。
【0077】
図において、514は1つ前の画素ブロックについて特定のランレングスが検出されたことを示す検出情報を記憶する記憶部であり、515はグループ番号検出部511とランレングス検出部512の出力する検出信号と、記憶部514に記憶された検出情報の論理積をブロックノイズ検出信号として出力するANDである。
【0078】
ランレングス検出部512の出力する検出信号は、AND515に出力されるとともに、記憶部514で1画素ブロックの符号化に要する期間遅延される。この検出情報は、次のブロックにおけるグループ番号検出部511とランレングス検出部512の出力する検出信号とともにAND515に入力され、これらの論理積がブロックノイズ検出信号として出力される。
【0079】
以上の構成、および動作により、本発明の第2の実施例の画像の符号化装置によって画像の符号化中に発生するブロックノイズを検出することができる。
【0080】
なお、JPEGの仕様では、ランレングスが63の場合は、2次元ハフマン符号化部510は、EOB(End of Block:ブロック終端)符号を出力ことになっている。このため、上記実施例において、2次元ハフマン符号化部510が1つの画素ブロックにつきEOB符号だけを出力する場合を検出して、全てのAC成分が零となると判断するよう構成してもよい。
【0081】
また、上記実施例では、JPEGと同様に8×8画素の画素ブロックを前提としているので全AC係数が零の場合のランレングスとして63を検出しているが、この値に限定するものではない。例えば、N×M(N,Mは正整数)の画素ブロックを使用する場合は、変換係数の数(N×M)からDC成分を除いた(N×M−1)のランレングスを検出すればよい。
【0082】
また、画像の最も左端に位置する画素ブロックについては、直前のブロックは1つ上のブロックラインの最も右に位置するブロックであるので、ブロックノイズの検出処理から除外するものとする。
【0083】
また、DC成分の量子化幅が比較的小さく、ブロックノイズが発生しても視覚上の問題とならない場合もあるので、DC成分の量子化幅が所定の値よりも小さい場合は、ブロックノイズ検出機能を停止する、あるいはブロックノイズ検出信号を無効化するようにしてもよい。また、この所定の値とは、ディスプレイやプリンタ等の復号画像が出力される出力機器の再現特性に応じて決定される。
【0084】
次に本発明の第1の符号化方法について説明する。図14は、符号化方法の手順について示すフローチャートである。
[S1] 入力画像から8×8画素ブロックを切り出す。
[S2] 画素ブロックにDCTを施して変換係数を求める。
[S3] 変換係数を量子化して量子化係数を求める。
[S4] 量子化係数をジグザグスキャン順に1次元化する。
[S5] 量子化係数がDC成分の場合はステップS6、AC成分の場合はステップS11に分岐する。
[S6] 1つ前のブロックのDC成分との差分を計算する。
[S7] 差分を図6にしたがってグループ化してグループ番号と付加ビットを求める。
[S8] グループ番号が1の場合はステップS9に分岐する。
[S9] グループ番号1の検出を示すフラグ1をセットする。
[S10] グループ番号をハフマン符号化してDCハフマン符号を求める。
[S11] AC成分が零であるかを判定し、零の場合はステップS12、非零の場合はステップS14に分岐する。
[S12] 零のAC成分のランレングスをカウントする。
[S13] ランレングスが63の場合はステップS15に分岐する。
[S14] AC成分を図7にしたがってグループ化してグループ番号と付加ビットを求める。
[S15] ランレングス63の検出を示すフラグ2をセットする。
[S16] ランレングスとグループ番号の組合せを2次元ハフマン符号を求める。
[S17] DCハフマン符号,ACハフマン符号,双方の付加ビットを多重化して符号データを出力する。
[S18] フラグ1とフラグ2がセットされている場合はステップS19に分岐する。
[S19] ブロックノイズ検出フラグをセットする。
【0085】
次に本発明の第2の符号化方法について説明する。図15は、符号化方法の手順について示すフローチャートである。ステップS1からS17までは第1の符号化方法の手順と同じであるので同一番号を付して説明を省略する。以下、ステップS18以降を説明する。
[S18] フラグ1とフラグ2とフラグ3がセットされている場合はステップS19に分岐する。
[S19] ブロックノイズ検出フラグをセットする。
[S20] フラグ2がセットされている場合はステップS21に分岐する。
[S21] フラグ3をセットする。
【0086】
【発明の効果】
以上述べてきたように、本発明では、ブロックノイズを検出は、DC成分の差分や、零となるAC成分のランレングスといった従来技術の符号化動作の過程で求められる情報に基づくため、従来の画像の符号化装置に対して、グループ番号検出部510、ラン検出部511、およびAND513の追加することで実現できる。このため、回路規模の制限されるLSIや、ノイズ検出処理の追加で性能が低下しやすいソフトウエアなどへの実装に適している。
【0087】
また、JPEGでは、符号量が原稿の内容によって変動するために、符号量を一定値に制御するための手法が種々考案されている。例えば、量子化マトリクスに一定値a(a>0の実数)を乗じて量子化特性を変更し、発生する符号量とaの関係から目標符号量となるaをニュートン・ラプソン法などの収束演算により決定する手法がある。この場合、画質は考慮されていないために、目標符号量にはなるもののブロックノイズを多く含む画像が復号されることがある。このような場合に本発明を適用することにより、ブロックノイズを回避しながら符号量を制御することが可能となる。
【図面の簡単な説明】
【図1】本発明の第1の実施例の全体的な構成を示すブロック図である。
【図2】本発明の第1の実施例の要部構成図である。
【図3】本発明の第2の実施例の構成図である。
【図4】変換係数を説明する図である。
【図5】符号化の例を説明する図である。
【図6】DC成分のグループ化を説明する図である。
【図7】AC成分のグループ化を説明する図である。
【図8】ハフマン符号表を説明する図である。
【図9】AC成分の2次元ハフマン符号表を説明する図である。
【図10】ジグザグスキャンによる1次元化を説明するである。
【図11】可変長符号化の例を説明する図である。
【図12】ブロックノイズの説明図である。
【図13】線形量子化の説明図である。
【図14】本発明の第1の符号化方法の手順について説明するフローチャート
【図15】本発明の第2の符号化方法の手順について説明するフローチャート
【図16】従来技術の概略の構成図である。
【図17】従来技術における可変長符号化回路の構成図である。
【符号の説明】
100,101 入力端子
200 ブロック分割部
300 DCT変換部
400 量子化部
500 可変長符号化部
600 出力端子
601 ブロックノイズ検出信号出力端子
501 スキャン変換部
502 ブロック遅延部
503 減算器
504 グループ化部
505 1次元ハフマン符号化部
506 多重化部
507 零判定部
508 ランレングスカウンタ
509 グループ化部
510 2次元ハフマン符号化部
511 グループ番号検出部
512 ラン検出部
513 AND
514 記憶部
515 AND
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image encoding apparatus and method, and more particularly, to enable detection of block noise generated in an encoding process before decoding.
[0002]
[Prior art]
As a method for encoding continuous tone images with high efficiency, an orthogonal transform coding method is widely used. In particular, an algorithm using a discrete cosine transform (hereinafter referred to as DCT) for orthogonal transform is also adopted in JPEG (Joint Photographic Expert Group), which is an international standard for still image coding.
[0003]
FIG. 16 is a block diagram illustrating a configuration of a basic algorithm of JPEG called a JPEG baseline system.
[0004]
In the figure, 100 is an input terminal to which an image is input, 200 is a block dividing unit that divides the input image into pixel blocks that are rectangular areas of 8 × 8 pixels, 300 is subjected to DCT for each pixel block, and conversion coefficients DCT transform unit 400 outputs a quantized coefficient by linearly quantizing the transform coefficient using a quantization step width set for each frequency, and 500 outputs a quantized coefficient. Reference numeral 600 denotes a variable length coding unit that performs variable length coding and outputs code data. Reference numeral 600 denotes an output terminal that outputs code data.
[0005]
FIG. 17 is a block diagram illustrating the configuration of the variable length coding unit 500. In FIG. 17, 101 is an input terminal to which quantization coefficients are input, 501 is rearranged in the order shown in FIG. 10 (zigzag scan), and outputs DC (direct current) components and AC (alternating current) components individually. Scan conversion unit, 502 is a block delay unit that delays the DC component during the processing time of one pixel block, 503 is a subtractor that subtracts the DC component of the block immediately before the DC component and outputs the difference of the DC component, Reference numeral 504 denotes a grouping unit for grouping the difference between the input DC components by absolute values as shown in FIG. 6 and outputting an additional bit indicating the group number SSSS and the numerical value within the group, and 505 is a diagram. A one-dimensional Huffman code that outputs a DC Huffman code by variable-length-coding the DC component group number SSSS using a one-dimensional Huffman code table as shown in FIG. It is a unit.
[0006]
On the other hand, 507 is a zero determination unit that determines whether the input AC component is zero or non-zero and switches the output destination of the AC component. 508 is a run length NNNN that is obtained by multiplying the continuous length of zero coefficients. The run length counter 509 outputs a group of non-zero AC coefficients according to the table of FIG. 7 as in the case of the DC component, and determines the group number SSSS and the AC coefficient in the group. A grouping unit that outputs additional bits to be indicated, and 510 is a two-dimensional Huffman coding that encodes a combination of the run length NNNN and the group number SSSS using the two-dimensional Huffman code table of FIG. 8B and outputs an AC Huffman code Unit 506 multiplexes a DC Huffman code, an AC Huffman code, an additional bit of each of the DC component and the AC component, and outputs code data , 600 is an output terminal of the code data is output.
[0007]
The operation of the JPEG baseline system will be described below with reference to FIG. In FIG. 16, an image input from the input terminal 100 is divided by the block dividing unit 200 into pixel blocks that are rectangular regions of 8 × 8 pixels. FIG. 5A shows an example of a pixel block. The pixel block is subjected to DCT in the DCT conversion unit 300, and conversion coefficients are obtained as an 8 × 8 matrix. The conversion coefficient is information corresponding to the power of the two-dimensional frequency component included in the pixel block.
[0008]
FIG. 4 is a diagram showing the correspondence between each element of the transform coefficient and the frequency. The element at the upper left in the matrix is called a DC component and corresponds to the average value in the pixel block. The other element is called an AC component, and the right component corresponds to a higher frequency in the horizontal direction and the lower component corresponds to a higher frequency in the vertical direction. FIG. 5B is a transformation matrix obtained by applying DCT to the pixel block of FIG.
[0009]
Subsequently, in the quantization unit 400, the transform coefficient is linearly quantized with the quantization characteristic determined for each element.
[0010]
FIG. 13 is a diagram for explaining linear quantization, and shows that the input is quantized with the quantization width Q, and discrete outputs arranged at the interval Q are obtained. The quantization characteristics in JPEG are given, for example, as a matrix shown in FIG. 5C, and quantization is performed by dividing and rounding the conversion coefficient at the corresponding position by these values. FIG. 5D is a quantized coefficient obtained by quantizing the transform coefficient of FIG. 5B with the quantization matrix of FIG.
[0011]
In the variable length coding unit 500, the quantization coefficient in FIG. 5D is variable length coded, and the code data is output to the output terminal 600.
[0012]
Hereinafter, the operation of the variable length coding unit 500 will be described with reference to FIG.
[0013]
The scan conversion unit 501 makes the AC coefficient of the input quantization coefficient one-dimensional in the order shown in FIG. 10 and outputs it. The DC component is output as it is without being processed.
[0014]
The block delay unit 502 stores a DC component during a period in which one pixel block is encoded.
[0015]
The subtracter 503 calculates the difference between the DC component of the current pixel block and the previous DC component stored in the block delay unit 502.
[0016]
As shown in FIG. 6, the grouping unit 504 groups the DC component differences by the magnitude of the absolute value, and outputs an additional bit indicating the group number and the numerical value within the group.
[0017]
The one-dimensional Huffman encoding unit 505 outputs a DC Huffman code corresponding to the group number according to the one-dimensional Huffman code table of FIG. The DC Huffman code is input to the multiplexing unit 506 along with the additional bits.
[0018]
On the other hand, the output destination of the AC component output from the scan conversion unit 501 is switched by the zero determination unit 507 depending on whether it is zero or non-zero.
[0019]
For the AC component determined to be zero, the run length counter 508 counts the continuous length of the zero AC component until a non-zero AC component appears, and outputs the run length.
[0020]
The grouping unit 509 determines a group of non-zero AC components as in the case of the DC component as shown in FIG. 7, and outputs an additional bit indicating the group number and which numerical value the AC component is in the group.
[0021]
As shown in FIG. 9, the two-dimensional Huffman encoding unit 510 performs encoding using a two-dimensional Huffman code table configured by a combination of run lengths and group numbers. Each element in the table is assigned an AC Huffman code as shown in FIG. An AC Huffman code corresponding to the combination of the run length and the group number is output and output to the multiplexing unit 506 along with the additional bits output from the grouping unit 509.
[0022]
FIG. 11A shows a DC component Huffman code and additional bits of the quantization coefficient of FIG. Similarly, FIG. 11B shows an AC component Huffman code and additional bits, and FIG. 11C shows code data obtained from the multiplexing unit 506.
[0023]
With the above procedure, image encoding by the JPEG baseline system is completed.
[0024]
In general, transform coding is lossy coding in which a decoded image does not become the same as the original image. This is because information is lost in the process of quantization, and it is known that noise such as block noise occurs when the compression rate is increased.
[0025]
FIG. 12 is a diagram for explaining block noise. Generation of block noise can be explained as follows. In the transform coding method, since coding is performed for each pixel block, if all AC components are quantized to zero by rough quantization, a block having only an average value is decoded. This is because block boundaries become conspicuous because they are connected with an average value of the surrounding pixel blocks and a step.
[0026]
Block noise is not so noticeable in areas where the pixel amplitude changes drastically, but in areas where the gradation changes slowly, the gradation changes on a rectangular staircase, which is known to cause significant image quality degradation. Yes.
[0027]
Various studies have so far been made on such block noise improvement techniques.
[0028]
As an improvement method on the encoding side, for example, the method disclosed in Japanese Patent Laid-Open No. 4-220083 includes means for detecting a block having only a DC component as block noise, and if detected, a 1-bit flag is added and decoded. In this case, the block is subjected to a smoothing process.
[0029]
Japanese Patent Laid-Open No. 5-328329 switches the quantization characteristic in accordance with the flatness of the pixel block and the AC component at the time of encoding.
[0030]
In Japanese Patent Application Laid-Open No. 7-50758, when a single color document is read, block distortion caused by density fluctuation due to reading error is detected, and a step with a peripheral block is smoothed. Furthermore, when the absolute values of the AC coefficients are all equal to or less than a predetermined value, encoding is performed with all AC coefficients set to zero.
[0031]
As an improvement method on the decoding side, Japanese Patent Laid-Open No. 5-63997 determines the characteristics of the noise removal filter based on the distribution of transform coefficients for each block at the time of decoding. When blocks having only DC components are continuous, noise is removed only when the difference between the DC components of the blocks is equal to or smaller than the quantization step.
[0032]
[Problems to be solved by the invention]
The technique using the block noise detection flag and variable quantization in the prior art can be realized only between specific terminals having these functions, and image transmission using the JPEG baseline algorithm, for example, color There is a problem that it cannot be applied to an application that assumes an unspecified number of receiving terminals such as a facsimile.
[0033]
Further, the conventional technique using the image correction processing at the time of transmission and the adaptive filter after decoding is intended to improve the image quality of the decoded image, and an image faithful to the original image is not necessarily reproduced. Not always.
[0034]
For this reason, depending on the document and application, the image encoded on the transmission side is once decoded and the operator confirms the image quality. If block noise occurs, the image is re-encoded and transmitted with higher image quality parameters. Although it is considered as the most reliable method, human labor is a problem.
[0035]
These problems can be attributed to the fact that the encoding algorithm does not have a function of detecting the occurrence of block noise.
[0036]
Therefore, an object of the present invention is to provide an image encoding apparatus and method having a block noise detection function in order to realize encoding that does not cause block distortion.
[0037]
In addition, in the prior art, for block noise detection,
(1) Detecting a pixel block in which the transform coefficient in the pixel block is quantized to have only a DC component and only the average value is decoded.
(2) The average value of the pixel block is adjacent to the average value of the surrounding pixel blocks with a step.
In many cases, one or both of the above two conditions are used, but there is a problem that a new circuit is required to detect them or the amount of calculation increases.
[0038]
A second object of the present invention is to detect block noise using information obtained in the process of transform coding represented by the JPEG baseline system.
[0039]
[Means for Solving the Problems]
In order to solve the above problems, an image encoding apparatus according to claim 1 of the present invention divides an image to obtain a pixel block which is a rectangular area of N × M (N and M are positive integers) pixels. A dividing means; a transforming means for performing orthogonal transform on the pixel block to obtain transform coefficients; a quantizing means for quantizing the transform coefficients with a predetermined quantization characteristic to obtain quantized coefficients; and a DC of the quantized coefficients The (direct current) component is variable-length-encoded using the difference between the DC component of the immediately preceding pixel block, and the AC (alternating current) component of the quantization coefficient is set to a continuous length of the AC coefficient that is zero and the non-interval that follows this. Two-dimensional variable length encoding means for variable length encoding by a combination of zero AC coefficient magnitudes, The value is +1 or -1. Detecting a first detection signal and outputting a first detection signal; and a continuous length of the AC coefficient The value is NxM-1. And a second detection means for outputting a second detection signal and a determination means for outputting a logical product of the first detection signal and the second detection signal as a detection result for each block, Based on the detection results for each block, When a coarse quantization characteristic is set, it becomes a fine quantization characteristic, and when a fine quantization characteristic is set, it becomes a coarse quantization characteristic. Re-encoding with the quantization characteristic changed is performed.
[0040]
In this configuration, block noise can be detected based on information generated in a conventional encoding process.
[0041]
An image encoding apparatus according to claim 2 of the present invention is the image encoding apparatus according to claim 1, further comprising storage means for storing the second detection signal in the immediately preceding pixel block. Determining means for outputting a logical product of the first detection signal, the second detection signal, and the contents stored in the storage means as a detection result for each block, and based on the detection result for each block Then, the execution of re-encoding with the quantization characteristic changed is determined.
[0044]
Further, the claims of the present invention 3 The image encoding device according to claim 1 is characterized in that in the image encoding device according to claim 1 or 2, the determination means is an AND element.
[0045]
Further, the claims of the present invention 4 The image encoding device according to claim 1 is characterized in that, in the image encoding device according to claim 1 or 2, the orthogonal transform is a discrete cosine transform.
[0046]
Further, the claims of the present invention 5 The image encoding device according to claim 1 is characterized in that, in the image encoding device according to claim 1 or 2, the pixel block is composed of 8 × 8 pixels.
[0047]
Further, the claims of the present invention 6 The image encoding device according to claim 1, wherein the second detection unit has a length of continuous AC coefficients. The value is NxM-1. Instead of detecting the two-dimensional variable length encoding means Output only EOB (End Of Block) code for pixel block with 1 And a second detection signal is output.
[0048]
Further, the claims of the present invention 7 The image encoding device according to claim 1, further comprising a counting unit that counts the detection results for each block in the image encoding device according to claim 1, and when the image encoding operation is completed, Counting result of the counting means of, The total number of pixels of the image or included in the image Find the ratio to the number of all pixel blocks When the counting result is equal to or greater than a predetermined ratio, re-encoding is performed with the quantization characteristic changed.
[0049]
Further, the claims of the present invention 8 An image encoding device according to claim 1 is the image encoding device according to claim 1 or 2, wherein the quantization means includes: D When the quantization threshold of the C component is smaller than a predetermined value, re-encoding with the quantization characteristic changed is not executed.
[0050]
Further, the claims of the present invention 9 An image encoding device according to claim 1 is provided. 8 In the image encoding device described in (1), the predetermined value is determined according to a gradation reproduction characteristic of an output unit that outputs a decoded image.
[0051]
Further, the claims of the present invention 10 The image coding method described in the above section divides an image to obtain a pixel block that is a rectangular area of N × M (N and M are positive integers) pixels, performs orthogonal transformation on the pixel block to obtain a transform coefficient, The transform coefficient is quantized with a predetermined quantization characteristic to obtain a quantized coefficient, and a DC (direct current) component of the quantized coefficient is variable-length-encoded according to a difference between the DC component of the immediately preceding pixel block, and the quantum The AC (alternating current) component of the conversion coefficient is variable-length encoded by a combination of the continuous length of the AC coefficient that becomes zero and the subsequent non-zero AC coefficient, and in particular, The value is +1 or -1. Is detected, the first flag is set, and the AC coefficient has a continuous length. The value is NxM-1. Is detected and the second flag is set, and the first flag and the second flag are set. AND with Based on the detection result for each block, obtain the detection result for each block from When a coarse quantization characteristic is set, it becomes a fine quantization characteristic, and when a fine quantization characteristic is set, it becomes a coarse quantization characteristic. Re-encoding with the quantization characteristic changed is performed.
[0052]
Even in this configuration, it is possible to detect block noise based on information generated in a conventional encoding process.
[0053]
Claims 11 The image encoding method described in claim 10 In the image encoding method according to claim 1, the value of the second flag in the immediately preceding pixel block is set in a third flag, and the first flag, the second flag, and the third flag are set. AND with Then, a detection result for each block is obtained, and based on the detection result for each block, re-encoding with the quantization characteristic changed is executed.
[0054]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, the present invention will be described in detail.
[0055]
In the image coding apparatus and method having the block noise detection function of the present invention, block noise is detected based on information obtained in the coding process, and more specifically, information on this coding process. Thus, (1) detection of a pixel block having only an average value and (2) detection of a step with respect to surrounding blocks are performed.
[0056]
Hereinafter, each detection method will be described.
[0057]
A pixel block having only an average value is determined based on whether or not all AC components are zero. In the conventional variable length coding unit 500 shown in FIG. 17, the run length counter 508 counts the run length of the zero AC component, so that the run length output from the run length counter 508 is 63. It can be seen that all AC components are zero.
[0058]
On the other hand, the level difference with the surrounding pixel block can be determined from the group number of the difference of the DC component.
[0059]
In an image region having a gradual gradation change in which block noise is a problem, DC components obtained by applying DCT to a continuous pixel block and quantizing are quantized to the same level or adjacent levels. When quantization is performed on adjacent levels, a difference between levels, that is, a quantization step width becomes a quantization error, and a step is generated at the boundary between decoded pixel blocks.
[0060]
In the case where an edge overlaps the boundary of the original pixel block, the DC component of the pixel block sandwiching the edge is not necessarily quantized to adjacent levels.
[0061]
For this reason, a case where the difference in DC component between consecutive pixel blocks is +1 or −1 can be regarded as a condition for generating block noise. According to FIG. 6, this is nothing but detecting that the group number is 1.
[0062]
In the conventional variable length coding unit 500 shown in FIG. 17, when the group number output from the grouping unit 504 is 1, when the current pixel block is decoded, the boundary with the adjacent pixel block on the left It can be considered that there is a possibility that a step will occur.
[0063]
As described above, according to the present invention, block noise generated in an image area having a gradual gradation change in a document is detected by using these two block noise detection methods in combination.
[0064]
Examples of the present invention will be described below.
[First embodiment]
FIG. 1 shows the first embodiment of the present invention as a whole. In this figure, portions corresponding to those in FIG. In FIG. 1, block noise is detected by a variable length coding unit 500, and the detection result is fed back to the quantization unit 400 to adapt the quantization characteristics.
[0065]
Next, detection of block noise by the variable length coding unit 500 will be described. FIG. 2 shows a variable-length encoding unit 500 of this embodiment. In this figure, portions corresponding to those in FIG.
[0066]
In the figure, reference numeral 511 denotes a group number detection unit that detects a specific group number from the group number SSSS output from the grouping unit 504 and outputs a detection signal. 512 denotes a specific run from the run length NNNN output from the run length counter 508. A run length detection unit 513 that detects the length and outputs a detection signal AND 513 outputs the logical product of the detection signals output from the group number detection unit 511 and the run length detection unit 512 as a block noise detection signal, 601 An output terminal for outputting a block noise detection signal.
[0067]
The group number detection unit 511 detects the case where the DC component difference from the immediately preceding block is +1 or −1, that is, the case where the group number output by the grouping unit 504 is 1, and detects a 1-bit detection signal. Output to AND513.
[0068]
The run length detection unit 512 detects a case where the run length output by the run length counter 508 is 63, and outputs a 1-bit detection signal indicating the detection to the AND 513.
[0069]
The AND 513 outputs the logical product of the detection signals of the group number detection unit 511 and the run length detection unit 512 to the output terminal 601 as block noise detection information.
[0070]
In the first embodiment of the present invention, when block noise is detected from the output terminal 601, the quantization characteristic of the quantization unit 400 is changed and re-encoding is performed. When changing the quantization characteristics, if coarse quantization characteristics are set in advance, the quantization characteristics will be finer, or fine quantization characteristics will be set in advance. Sex If it is set, it is changed so as to obtain a rough quantization characteristic.
[0071]
The decision to execute the re-encoding may be performed by detecting the block noise only once, or the block noise detection signal is counted by a counting unit (not shown), and the counting result is the total number of pixels of the image or the total pixel block. In comparison with the number, it may be determined that the block noise is generated in a predetermined ratio or more.
[0072]
With the above configuration and operation, block noise generated during image coding can be detected by the image coding apparatus according to the first embodiment of the present invention.
[0073]
[Second Embodiment]
Next, a second embodiment of the present invention will be described. In the first embodiment described above, it has not been considered whether the immediately preceding pixel block is a block having only an average value. For this reason, block noise is detected even in the case where a flat pixel block continues to a boundary between an edge region where block noise is relatively inconspicuous and a gentle gradation, for example, a pixel block including an edge.
[0074]
On the other hand, when the detection range is limited to a gradual gradation region, a condition may be added in which the immediately preceding pixel block is a pixel block having only an average value.
[0075]
That is, only when the pixel blocks having only the average value are continuous and a step corresponding to the quantization width of the DC component occurs at the boundary, the block noise is detected.
[0076]
The configuration of the second embodiment of the present invention will be described below with reference to FIG. In addition, about the same structure as the prior art shown in FIG. 11, or the 1st Example of this invention shown in FIG. 2, the same number is attached | subjected and description is abbreviate | omitted.
[0077]
In the figure, reference numeral 514 denotes a storage unit that stores detection information indicating that a specific run length has been detected for the previous pixel block, and reference numeral 515 denotes a detection output from the group number detection unit 511 and the run length detection unit 512. This is an AND that outputs a logical product of the signal and detection information stored in the storage unit 514 as a block noise detection signal.
[0078]
The detection signal output from the run length detection unit 512 is output to the AND 515 and delayed for a period required for encoding one pixel block in the storage unit 514. This detection information is input to the AND 515 together with the detection signals output from the group number detection unit 511 and the run length detection unit 512 in the next block, and the logical product of these is output as a block noise detection signal.
[0079]
With the configuration and operation described above, block noise generated during image encoding can be detected by the image encoding apparatus according to the second embodiment of the present invention.
[0080]
In the JPEG specification, when the run length is 63, the two-dimensional Huffman coding unit 510 outputs an EOB (End of Block) code. For this reason, in the above embodiment, the case where the two-dimensional Huffman encoding unit 510 outputs only the EOB code per pixel block may be detected to determine that all AC components are zero.
[0081]
In the above embodiment, since a pixel block of 8 × 8 pixels is assumed as in the case of JPEG, 63 is detected as a run length when all AC coefficients are zero. However, the present invention is not limited to this value. . For example, when N × M (N and M are positive integers) pixel blocks are used, a run length of (N × M−1) obtained by removing the DC component from the number of transform coefficients (N × M) is detected. That's fine.
[0082]
In addition, the pixel block located at the leftmost end of the image is excluded from the block noise detection process because the immediately preceding block is the block located at the rightmost position in the block line one level above.
[0083]
In addition, since the quantization width of the DC component is relatively small and even if block noise occurs, it may not cause a visual problem. Therefore, if the quantization width of the DC component is smaller than a predetermined value, block noise detection is performed. The function may be stopped or the block noise detection signal may be invalidated. The predetermined value is determined according to reproduction characteristics of an output device such as a display or a printer that outputs a decoded image.
[0084]
Next, the first encoding method of the present invention will be described. FIG. 14 is a flowchart showing the procedure of the encoding method.
[S1] An 8 × 8 pixel block is cut out from the input image.
[S2] DCT is applied to the pixel block to obtain a conversion coefficient.
[S3] The transform coefficient is quantized to obtain a quantized coefficient.
[S4] One-dimensionalize the quantized coefficients in zigzag scan order.
[S5] If the quantization coefficient is a DC component, the process branches to step S6, and if it is an AC component, the process branches to step S11.
[S6] The difference from the DC component of the previous block is calculated.
[S7] The differences are grouped according to FIG. 6 to obtain a group number and additional bits.
[S8] If the group number is 1, the process branches to step S9.
[S9] A flag 1 indicating detection of group number 1 is set.
[S10] The group number is Huffman coded to obtain a DC Huffman code.
[S11] It is determined whether the AC component is zero. If it is zero, the process branches to step S12.
[S12] The run length of zero AC component is counted.
[S13] If the run length is 63, the process branches to step S15.
[S14] AC components are grouped according to FIG. 7 to obtain a group number and additional bits.
[S15] The flag 2 indicating the detection of the run length 63 is set.
[S16] A two-dimensional Huffman code is obtained for the combination of run length and group number.
[S17] The DC Huffman code, the AC Huffman code, and additional bits of both are multiplexed to output code data.
[S18] If flag 1 and flag 2 are set, the process branches to step S19.
[S19] A block noise detection flag is set.
[0085]
Next, the second encoding method of the present invention will be described. FIG. 15 is a flowchart showing the procedure of the encoding method. Steps S1 to S17 are the same as the procedure of the first encoding method, so the same numbers are assigned and description thereof is omitted. Hereinafter, step S18 and subsequent steps will be described.
[S18] If flag 1, flag 2, and flag 3 are set, the process branches to step S19.
[S19] A block noise detection flag is set.
[S20] If flag 2 is set, the process branches to step S21.
[S21] Flag 3 is set.
[0086]
【The invention's effect】
As described above, in the present invention, block noise detection is based on information obtained in the process of the conventional encoding operation such as the difference between DC components and the run length of AC components that become zero. This can be realized by adding a group number detection unit 510, a run detection unit 511, and an AND 513 to the image encoding device. Therefore, it is suitable for mounting on an LSI whose circuit scale is limited or software whose performance is likely to deteriorate due to the addition of noise detection processing.
[0087]
In JPEG, since the code amount varies depending on the contents of the document, various methods for controlling the code amount to a constant value have been devised. For example, the quantization characteristic is changed by multiplying the quantization matrix by a constant value a (a> 0 real number), and a target code amount is converted from the relationship between the generated code amount and a to a convergence operation such as Newton-Raphson method. There is a method to decide by. In this case, since the image quality is not taken into consideration, an image including a large amount of block noise may be decoded although it is the target code amount. By applying the present invention in such a case, it is possible to control the code amount while avoiding block noise.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an overall configuration of a first embodiment of the present invention.
FIG. 2 is a block diagram showing the main part of a first embodiment of the present invention.
FIG. 3 is a block diagram of a second embodiment of the present invention.
FIG. 4 is a diagram illustrating conversion coefficients.
FIG. 5 is a diagram illustrating an example of encoding.
FIG. 6 is a diagram illustrating grouping of DC components.
FIG. 7 is a diagram illustrating grouping of AC components.
FIG. 8 is a diagram illustrating a Huffman code table.
FIG. 9 is a diagram illustrating a two-dimensional Huffman code table for AC components.
FIG. 10 illustrates one-dimensionalization by zigzag scanning.
FIG. 11 is a diagram illustrating an example of variable length coding.
FIG. 12 is an explanatory diagram of block noise.
FIG. 13 is an explanatory diagram of linear quantization.
FIG. 14 is a flowchart for explaining the procedure of the first encoding method of the present invention.
FIG. 15 is a flowchart for explaining the procedure of the second encoding method of the present invention.
FIG. 16 is a schematic configuration diagram of the prior art.
FIG. 17 is a configuration diagram of a variable length coding circuit in the prior art.
[Explanation of symbols]
100, 101 input terminals
200 block division
300 DCT converter
400 Quantizer
500 Variable length coding unit
600 output terminals
601 Block noise detection signal output terminal
501 Scan converter
502 Block delay unit
503 subtractor
504 Grouping Department
505 One-dimensional Huffman encoding unit
506 Multiplexer
507 Zero judgment unit
508 Run length counter
509 Grouping Department
510 Two-dimensional Huffman encoder
511 Group number detector
512 run detector
513 AND
514 storage unit
515 AND

Claims (11)

画像を分割してN×M(N,Mは正整数)画素の矩形領域である画素ブロックを得る分割手段と、前記画素ブロックに直交変換を施して変換係数を得る変換手段と、前記変換係数を所定の量子化特性で量子化して量子化係数を得る量子化手段と、前記量子化係数のDC(直流)成分を直前の画素ブロックのDC成分との間の差分により可変長符号化し、前記量子化係数のAC(交流)成分を零となるAC係数の連続する長さと、これに続く非零のAC係数の大きさの組合せとして可変長符号化する2次元可変長符号化手段とを備えた画像の符号化装置において、
前記差分の値が+1または−1であることを検出して第1の検出信号を出力する第1の検出手段と、
前記AC係数の連続する長さの値がN×M−1であることを検出して第2の検出信号を出力する第2の検出手段と、
前記第1の検出信号と前記第2の検出信号との論理積をブロックごとの検出結果として出力する判定手段とを有し、
前記ブロックごとの検出結果に基づいて、粗い量子化特性が設定されている場合には細かな量子化特性となるように、また細かな量子化特性が設定されている場合には粗い量子化特性となるように、前記量子化特性を変更した再符号化を実行することを特徴とする画像符号化装置。
Dividing means for dividing an image to obtain a pixel block that is a rectangular area of N × M (N and M are positive integers) pixels, transforming means for performing orthogonal transformation on the pixel block to obtain transform coefficients, and the transform coefficients Quantizing means that obtains a quantized coefficient by quantizing with a predetermined quantization characteristic, and variable length coding the DC (direct current) component of the quantized coefficient by the difference between the DC component of the immediately preceding pixel block, A two-dimensional variable length encoding means for performing variable length encoding as a combination of a continuous length of an AC coefficient in which an AC (alternating current) component of a quantized coefficient is zero and a subsequent nonzero AC coefficient size; In an image encoding apparatus,
First detection means for detecting that the value of the difference is +1 or -1 and outputting a first detection signal;
Second detection means for detecting that the continuous length value of the AC coefficient is N × M−1 and outputting a second detection signal;
Determining means for outputting a logical product of the first detection signal and the second detection signal as a detection result for each block;
Based on the detection result for each block, the coarse quantization characteristic is set when the coarse quantization characteristic is set , and the coarse quantization characteristic is set when the fine quantization characteristic is set. and so as, in the image coding apparatus and executes the re-encoded for changing the quantization characteristics.
請求項1に記載の画像符号化装置において、直前の画素ブロックでの前記第2の検出信号を記憶する記憶手段と、前記第1の検出信号と前記第2の検出信号と前記記憶手段に記憶された内容の論理積をブロックごとの検出結果として出力する判定手段とを備え、前記ブロックごとの検出結果に基づいて、前記量子化特性を変更した再符号化の実行を決定することを特徴とする画像符号化装置。2. The image encoding apparatus according to claim 1, wherein the second detection signal in the immediately preceding pixel block is stored in the storage unit, the first detection signal, the second detection signal, and the storage unit. Determining means for outputting a logical product of the obtained contents as a detection result for each block, and determining execution of re-encoding with the quantization characteristic changed based on the detection result for each block, An image encoding device. 前記判定手段がAND素子であることを特徴とする請求項1または2に記載の画像符号化装置。The image coding apparatus according to claim 1, wherein the determination unit is an AND element. 前記直交変換とは、離散コサイン変換であることを特徴とする請求項1または2に記載の画像符号化装置。The image encoding apparatus according to claim 1, wherein the orthogonal transform is a discrete cosine transform. 前記画素ブロックが8×8画素で構成されることを特徴とする請求項1または2に記載の画像符号化装置。The image coding apparatus according to claim 1, wherein the pixel block is configured by 8 × 8 pixels. 前記第2の検出手段において、前記AC係数の連続する長さの値がN×M−1であることを検出する代わりに、前記2次元可変長符号化手段が1の画素ブロックについてEOB(End Of Block)符号のみ出力することを検出して第2の検出信号を出力することを特徴とする請求項1または2に記載の画像符号化装置。Instead of detecting that the continuous length value of the AC coefficient is N × M−1 in the second detection means, the two-dimensional variable length encoding means performs EOB (End on one pixel block. The image coding apparatus according to claim 1 or 2, wherein the output of only the (Of Block) code is detected and the second detection signal is output. 前記ブロックごとの検出結果を計数する計数手段を備え、前記画像の符号化動作が完了した時に、前記計数手段の計数結果の、前記画像の全画素数、もしくは、前記画像に含まれるすべての画素ブロックの数に対する比率を求め、前記計数結果が所定の比率以上となる場合に前記量子化特性を変更した再符号化を実行することを特徴とする請求項1または2に記載の画像符号化装置。A counting unit that counts the detection result for each block, and when the encoding operation of the image is completed , the total number of pixels of the image or all the pixels included in the image of the counting result of the counting unit; 3. The image encoding device according to claim 1, wherein a ratio with respect to the number of blocks is obtained , and re-encoding is performed by changing the quantization characteristic when the counting result is equal to or greater than a predetermined ratio. 4. . 前記量子化手段におけるDC成分の量子化閾値が所定の値よりも小さい場合には、前記量子化特性を変更した再符号化を実行しないことを特徴とする請求項1または2に記載の画像符号化装置。If quantization threshold D C components that put in the quantization means is smaller than a predetermined value, according to claim 1 or 2 characterized in that it does not perform the re-encoding changing the quantization characteristics Image coding apparatus. 前記所定の値とは、復号された画像を出力する出力手段の階調再現特性に応じて決定されることを特徴とする請求項に記載の画像符号化装置。9. The image encoding apparatus according to claim 8 , wherein the predetermined value is determined according to a gradation reproduction characteristic of an output unit that outputs a decoded image. 画像を分割してN×M(N,Mは正整数)画素の矩形領域である画素ブロックを得、前記画素ブロックに直交変換を施して変換係数を求め、前記変換係数を所定の量子化特性で量子化して量子化係数を得、前記量子化係数のDC(直流)成分を直前の画素ブロックのDC成分との間の差分により可変長符号化し、前記量子化係数のAC(交流)成分を、零となるAC係数の連続する長さと、これに続く非零のAC係数の大きさの組合せにより可変長符号化する画像符号化方法において、
前記差分の値が+1または−1であることを検出して第1のフラグをセットし、前記AC係数の連続する長さの値がN×M−1であることを検出して第2のフラグをセットし、前記第1のフラグと前記第2のフラグとの論理積からブロックごとの検出結果を求め、前記ブロックごとの検出結果に基づいて、粗い量子化特性が設定されている場合には細かな量子化特性となるように、また細かな量子化特性が設定されている場合には粗い量子化特性となるように、前記量子化特性を変更した再符号化を実行することを特徴とする画像符号化方法。
The image is divided to obtain a pixel block that is a rectangular area of N × M (N and M are positive integers) pixels, orthogonal transformation is performed on the pixel block to obtain a transform coefficient, and the transform coefficient is determined with a predetermined quantization characteristic. The quantized coefficient is obtained by quantization with a variable length coding of a DC (direct current) component of the quantized coefficient by a difference between the DC component of the immediately preceding pixel block, and an AC (alternating current) component of the quantized coefficient is obtained. In the image encoding method for performing variable length encoding by a combination of the continuous length of the AC coefficient that becomes zero and the size of the subsequent non-zero AC coefficient,
The first flag is set by detecting that the difference value is +1 or −1, and the second value is detected by detecting that the continuous length value of the AC coefficient is N × M−1 . When a flag is set, a detection result for each block is obtained from a logical product of the first flag and the second flag, and a rough quantization characteristic is set based on the detection result for each block Re-encoding is performed to change the quantization characteristic so that the quantization characteristic is fine, and if the fine quantization characteristic is set, the quantization characteristic is coarse. An image encoding method.
請求項10に記載の画像符号化方法において、直前の画素ブロックでの前記第2のフラグの値を第3のフラグにセットし、前記第1のフラグと前記第2のフラグと前記3のフラグとの論理積からブロックごとの検出結果を求め、前記ブロックごとの検出結果に基づいて、前記量子化特性を変更した再符号化を実行する、ことを特徴とする画像符号化方法。11. The image encoding method according to claim 10 , wherein a value of the second flag in the immediately preceding pixel block is set to a third flag, and the first flag, the second flag, and the third flag are set. An image encoding method characterized in that a detection result for each block is obtained from a logical product of and the re-encoding with the quantization characteristic changed is executed based on the detection result for each block.
JP14549997A 1997-06-03 1997-06-03 Image coding apparatus and method Expired - Fee Related JP3617253B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14549997A JP3617253B2 (en) 1997-06-03 1997-06-03 Image coding apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14549997A JP3617253B2 (en) 1997-06-03 1997-06-03 Image coding apparatus and method

Publications (2)

Publication Number Publication Date
JPH10336656A JPH10336656A (en) 1998-12-18
JP3617253B2 true JP3617253B2 (en) 2005-02-02

Family

ID=15386683

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14549997A Expired - Fee Related JP3617253B2 (en) 1997-06-03 1997-06-03 Image coding apparatus and method

Country Status (1)

Country Link
JP (1) JP3617253B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8503536B2 (en) * 2006-04-07 2013-08-06 Microsoft Corporation Quantization adjustments for DC shift artifacts
US8711925B2 (en) 2006-05-05 2014-04-29 Microsoft Corporation Flexible quantization
JP4817246B2 (en) * 2006-07-31 2011-11-16 Kddi株式会社 Objective video quality evaluation system
US8897359B2 (en) 2008-06-03 2014-11-25 Microsoft Corporation Adaptive quantization for enhancement layer video coding

Also Published As

Publication number Publication date
JPH10336656A (en) 1998-12-18

Similar Documents

Publication Publication Date Title
KR100234316B1 (en) Signal adaptive filter for reducing ringing noise and signal adaptive filering method thereof
EP0723375B1 (en) Post-processing device and method for eliminating blocking artifacts from decompressed images
US5367385A (en) Method and apparatus for processing block coded image data to reduce boundary artifacts between adjacent image blocks
KR0184905B1 (en) Code amount control device and encoding apparatus using the same
KR960010392B1 (en) Video signal coding and decoding system using adaptable quantization
KR0141082B1 (en) Apparatus for coding image signal with adaptive edge part
KR100962152B1 (en) Selective chrominance decimation for digital images
JPH09322176A (en) Encoding mode selecting method, moving image encoding device, encoding method, recording method and transmitting method
JPH08242378A (en) Method for efficiently and repeatedly decompressing standardadct compressed image
EP0734166A2 (en) Apparatus for encoding an image signal having a still object
JPH05505080A (en) Method and apparatus for processing digital image sequences
JP3617253B2 (en) Image coding apparatus and method
JP2901656B2 (en) Image coding device
JP3211989B2 (en) Orthogonal transform encoding device and decoding device
JP2647272B2 (en) Transmission rate control method in image coding
JPH0522709A (en) Image signal decoder
JP3199786B2 (en) Image processing device
JP2668900B2 (en) High efficiency coding device
JP2891251B2 (en) Image encoding device and image decoding device
JP3200073B2 (en) Image processing device
JP2926638B2 (en) Loop filter and loop filtering method
JP3337699B2 (en) Image processing apparatus and method
JP3016805B2 (en) Image data compression method
JP2605351B2 (en) High efficiency coding method and apparatus
JPH05344345A (en) Image processing method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040525

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040723

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040726

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: 20041019

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041101

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20071119

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20081119

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091119

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101119

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees