[go: up one dir, main page]

JP4041245B2 - Image encoding device - Google Patents

Image encoding device Download PDF

Info

Publication number
JP4041245B2
JP4041245B2 JP13478499A JP13478499A JP4041245B2 JP 4041245 B2 JP4041245 B2 JP 4041245B2 JP 13478499 A JP13478499 A JP 13478499A JP 13478499 A JP13478499 A JP 13478499A JP 4041245 B2 JP4041245 B2 JP 4041245B2
Authority
JP
Japan
Prior art keywords
coefficient
image
allowable number
mcu
code
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
JP13478499A
Other languages
Japanese (ja)
Other versions
JP2000333172A (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.)
Kyocera Corp
Original Assignee
Kyocera 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 Kyocera Corp filed Critical Kyocera Corp
Priority to JP13478499A priority Critical patent/JP4041245B2/en
Publication of JP2000333172A publication Critical patent/JP2000333172A/en
Application granted granted Critical
Publication of JP4041245B2 publication Critical patent/JP4041245B2/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)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は画像データを圧縮符号化する画像符号化装置に関し、特に出力符号量に制限がある場合に画質をなるべく良好に保ちながら符号量を制限内に収める画像符号化装置に関する。
【0002】
【従来の技術】
従来離散コサイン変換を利用した画像の圧縮符号化方法の規格としてJPEGが知られている。これは画像データをブロックごとに離散コサイン変換し、変換値を量子化する方式である。変換符号化に分類される離散コサイン変換は画像データを空間周波数領域へ変換する公知の変換方式であり、画像データに対しては情報エントロピーを減少させる性能が高いことから広く使用されている。
【0003】
離散コサイン変換と量子化によって画像は非可逆な歪を受け、情報エントロピーが減少する。離散コサイン変換とJPEGの量子化は動作上は一体であるので、まとめて変換符号化部とみなせる。これより後さらにエントロピー符号化が施される。エントロピー符号化は出力符号が情報エントロピーに近づくように符号化するものであり、符号化による歪は導入されない。これを実施する部分は係数符号化部である。
【0004】
係数符号化部では、量子化して得られた係数のうち直流係数は前のブロックの直流係数値との差分を求め差分値をハフマン符号化する。一方交流係数はジグザグ順にスキャンして零の個数と零でない係数の組み合わせとして二次元ハフマン符号化する。離散コサイン変換と量子化はともに交流係数において零の出現頻度を多くするので、零の連続する個数と零でない係数の組み合わせに対してハフマン符号を割り当てている。このため係数符号化部は零でない係数を発見するか、ブロックの終わりに達すると符号を出力する。JPEGに従って圧縮された画像は劣化を伴うが、量子化に使用する量子化テーブルを適切に設定することにより主観評価値を良好に保ったまま大幅なデータ圧縮が可能である。
【0005】
また時々刻々変化する画像を伝送する画像通信を目的とした、TV会議用の動画像コーデックが従来知られている。動画像コーデックは圧縮率が高く優れているが、専用のLSIが必要な上に高速なクロックで動作させる必要があり、消費電力が大きくなってしまう。携帯通信機器のように消費電力を極力抑える必要がある機器においては、動画像コーデックではなくJPEGコーデックを用いて画像伝送を行うことができる。JPEGの処理方法は動画像コーデックに比べて簡易であり、専用のLSIを使わずにCPUとソフトウエアで実現することも可能である。動画像コーデックの演算量が大きくなる理由の一つは、フレーム間差分を符号化して伝送するためであり、このとき符号化器側ではローカルデコーダを用いて、相手が復号したものと同じ画像を生成しなけばならないことにある。これに対しJPEGコーデックを用いてフレーム間差分を利用しなければ要求される演算性能を低くし、このため消費電力も抑えられるというメリットがある。
【0006】
しかしJPEG符号化器では動画像コーデックほどの圧縮率が達成できないため、画像サイズ、画質、フレームレートなどを犠牲にして発生符号量を低減させる必要にせまられる。
【0007】
従来符号量を制御する画像符号化装置として、特許公報第2647272号の画像符号化における伝送レート制御方式が知られており、これを図7に示してある。これによると単位時間当たりの平均符号量と瞬時符号量がレート計算回路205で計算され、VLC制御回路204に通知され、VLC制御回路204はそれらのレートが設定値を超えると、VLC部203を制御して、途中までの係数の符号を送り、強制的に残りの係数の符号を送らないようにする。これによって符号量の制御が実現される。またこの際に量子化器202の特性を変更しないため、復号側では符号量制御がされているかどうかに配慮する必要がなく、汎用的で簡易な復号器を用いることができるという長所がある。また係数の零置換は高周波数側の係数から行われるため、符号量が制限された場合でも画質が大きくは損なわれないという長所がある。
【0008】
また従来、ブロックの画像内での位置に応じて量子化器を制御して、重要な部分を精度よく、重要でない部分の情報を削減して符号化する画像符号化装置が特許公開平4−247789の符号化装置および復号化装置として知られている。
【0009】
【発明が解決しようとする課題】
しかしながら従来の特許公報第2647272号の符号量を制御する画像符号化装置においては、画像における位置を考慮して画質に差を設けた符号量制御ができないという問題がある。画像の中で重要な部分はたいてい中央付近であり、周辺ほど重要性は少ない。画質を犠牲にして符号量を削減する必要が生じた場合には、周辺部の画質劣化は許容できるが、中央部の画質劣化は避けるべきである。このため画像の中央部に位置するブロックには多くの符号量を割り当て、画像の周辺に位置するブロックには少ない符号量を割り当てることが望ましいが、従来の画像符号化装置ではできなかった。この理由は、従来の装置においてブロックの係数を切り捨てる判定基準はブロックの画像における位置を考慮していないからである。
【0010】
これに対してブロックの位置に応じて量子化器を制御する従来の特許公開平4−247789の画像符号化装置はこの問題を克服しているが、復号器が符号化器に対応した専用のものでなければならず、広く普及しているJPEG復号器を用いることができず、画像の伝送は可能であるが、伝送した画像を他の用途に利用したり、電子メールに添付する際にはJPEG符号化器で圧縮しなおさなければならないという問題がある。さらにこの画像符号化装置はブロックの位置に応じて重み付けを変えることはできるが、発生符号量を一定の制限内に収めるという符号量制御の機能がない。つまり個々のブロックの符号量のバランスは制御できるけれども、それらを合計した総符号量を制御できないという問題があった。
【0011】
【課題を解決するための手段】
上記の問題を解決するために請求項1記載の画像符号化装置は、画像データをブロックごとに離散コサイン変換し量子化して係数を出力する変換符号化手段と、該変換符号化手段が出力する係数を符号化する係数符号化手段とからなる画像符号化装置において、
前記係数符号化手段の符号出力の許容回数を記憶する許容回数記憶手段と、
画像データの画像における位置に応じて前記許容回数記憶手段の記憶する許容回数を増加させる空間的許容回数増加手段と、
画像データの画像における位置に応じて係数の閾値を指定する空間的閾値指定手段と、を備え、
前記係数符号化手段は、前記変換符号化手段が出力する係数の空間周波数を前記空間的閾値指定手段が指定する閾値と比較し、前記係数の空間周波数が前記閾値より低いときは係数を符号化して符号を出力し、前記許容回数記憶手段の記憶する許容回数が正ならばその係数を符号化して符号を出力し、許容回数が正でなければその係数を零として扱うことにより符号を出力せず、
更に、前記係数符号化手段が符号を出力した場合、出力した前記符号の個数だけ前記許容回数記憶手段が記憶している許容回数を減少させるよう制御することを特徴とする。
【0012】
【発明の実施の形態】
以下、本発明の実施の形態を図面に基づいて説明する。図1は本発明の好適な実施の形態を示すブロック図である。さらに図2はその動作の手順を示すフローチャートである。
【0013】
本発明の画像符号化装置ではMCU(Minimum Coded Unit)の画像における位置をもとにして動作をする。MCUとは複数のブロックを含んだ符号化単位であり、その中には輝度成分のブロックと色差成分のブロックが含まれ、カラー画像としての最小の符号化単位である。画像符号化装置がMCUを処理する順番は一定しているため、MCUに通し番号を定めて、これをMCUカウンタで数えることによりMCUの位置を特定することができる。各処理部にはMCUカウンタの値を通知されることによりMCUの画像における位置に応じた処理を行うことができる。
【0014】
図2で処理を開始するとまず処理S01においてMCUを指定するMCUカウンタを0 に初期化し、許容回数記憶手段105を0 に初期化する。
【0015】
続く処理S02は画像を構成する全てのMCUを処理し終えたかを調べる判定処理である。判定結果がYesのとき1画像分の処理は終わりである。判定結果がNoのとき処理S03へ進む。
【0016】
処理S03ではMCUカウンタの値を空間的許容回数増加手段104に通知する。空間的許容回数増加手段104は許容回数の増分値をMCUの番号に対応させて記憶している。空間的許容回数増加手段104は処理S03において通知を受けると、この記憶値を用いて許容回数記憶手段105の記憶値を増加させ更新する。さらにMCUカウンタの値は空間的閾値指定手段103へも通知される。空間的閾値指定手段103はそのMCUの画像における位置に応じて閾値を設定する。
【0017】
続いて処理S04において、MCUカウンタで指定されたMCUの画像データは8×8画素のブロック単位で、変換符号化部101に入力される。ひとつのMCUには複数のブロックが存在しており、ブロックごとに順に処理される。変換符号化部101は入力されたブロックに対して処理S04において二次元離散コサイン変換を実行し、さらに量子化を実行する。JPEGに適合する量子化は離散コサイン変換された係数値に量子化ステップの逆数を乗算し、四捨五入によって整数化する処理である。量子化の動作は乗算であるから、乗算を大量に実行する離散コサイン変換と一体化し、両者を変換符号化部101としている。
【0018】
量子化テーブルには、入力される画像の性質や画像符号化装置が出力する画像の画質や符号量に応じて、量子化ステップサイズをあらかじめ設定しておく。公知のように離散コサイン変換によって出力される8×8の係数ブロックは空間周波数領域上の係数であり、各係数のブロックにおける位置と空間周波数とが1対1に対応している。量子化ステップサイズは低周波数側の係数では小さく、高周波数側の係数では大きくすることにより、低周波数側の係数には多くの情報量を割り当て、高周波数側の係数には少ない情報量を割り当てることができる。また量子化テーブルは、データブロックが画像の輝度成分であるか色差成分であるかに応じて切り替えることができ、統計的な性質の異なる色成分ごとに適した量子化ステップを指定することができる。
【0019】
処理S05において、変換符号化部101が出力する係数は係数符号化部102に入力される。係数符号化部102は量子化された8×8の係数ブロックを入力とし、これをエントロピー符号化する。
【0020】
MCUに含まれる複数のブロックの処理を終えたら処理S06に移り、MCUカウンタはインクリメントされ、判定処理S02へ戻る。
【0021】
次に、本発明の特徴である空間的な位置を考慮した符号量制御が実行されるのは係数符号化部102である。図3はその動作を示すフローチャートであり、これをもとにして説明する。
【0022】
係数ブロックの入力を受けた係数符号化部102は処理S11において直流係数を符号化し符号を出力する。直流係数は同じ色成分の前の直流係数との差分を求め、差分値をそれが属するレベル値とそのレベル内での残りビットとに分解し、レベル値をハフマン符号化し、続いて残りビットを添付する。
【0023】
係数符号化部102が交流係数を符号化するときは、低周波数から高周波数への順にブロックをジグザグにスキャンし、値が零の係数の数を数えながら零でない係数を探す。
【0024】
ここでジグザグスキャンの順序を図4に示す。図4は変換符号化部101が離散コサイン変換と量子化を実行した結果である8×8の係数ブロックと、これをジグザグスキャンする順番を示しており、ブロックの左ほど、また上ほど空間周波数が低くなっている。係数符号化部102は図4において番号1から番号63の順に係数をスキャンし零であるか零でないかを調べる。ただし番号0の係数は直流係数なのでジグザグスキャンは行わない。
【0025】
図3の処理S12はジグザグスキャンをはじめる準備処理であり、係数を指定するカウンタを1 に初期化し、零係数の数を数えるカウンタを0 に初期化する。
【0026】
処理S13はブロックのジグザグスキャンが終了したかどうかを調べる判定処理である。これは係数を指定するカウンタが64未満であるかどうかを調べ、結果がYesなら処理S14へ進み、結果がNoなら処理S19へ進む。
【0027】
処理S14はカウンタが指定する係数が0であるかを調べる判定処理である。結果がYesであればその係数は0であるので処理S21へ進み、Noであれば処理S15へ進む。
【0028】
処理S15はその係数の空間周波数が空間的閾値指定手段103が指定する閾値と比較して低周波数側であるかどうかを調べる判定処理である。処理S15ではその係数の位置を指定するカウンタ値を空間的閾値指定手段103の指定する閾値と比較し、カウンタ値が閾値未満であるかどうかを調べる。結果がYesの場合には処理S16へ進み、Noの場合は処理S18へ進む。空間的閾値指定手段103はMCUカウンタ値に基づいて閾値を変化させる。MCUカウンタが画像の中央付近を指定している場合は画質を重視するために閾値は64に設定される。閾値が64に指定されると零でない係数は全て閾値未満と判定され処理S16において符号化され符号が出力される。これに対してMCUカウンタが画像の周辺を指定している場合には閾値は15に設定される。これによって、係数カウンタが1から14の間に零でない係数が存在した場合に、零に置換されず処理S16で符号化されることが保証される。
【0029】
このように画質を重視しない周辺のMCUであっても低周波数側の係数を符号量制御の対象から外すのは、低周波数側の係数を零置換すると復号画像における影響が大きいためである。これに対して高周波数側の係数は零置換しても影響が比較的小さいため符号量制御を実行する際には係数を削除する。また空間的閾値指定手段103が通知されたMCUの画像における位置に応じて閾値を変化させるのは、画像中央付近に位置する画像データブロックに対しては符号量制御を無効にして画質を保証し、画像周辺に位置するブロックに対しては画質の低下を許して符号量制御を有効にするためである。
【0030】
処理S16において係数符号化部102は符号化を実行して符号を出力し、許容回数記憶手段105を出力した符号の個数だけデクリメントする。符号化は次のように行う。零係数の数が16以上の間はZRL符号を出力し零係数の数から16を引く動作を繰り返す。ZRLとはZero Run Length のことで、符号シンボルの一つとして二次元ハフマン符号のテーブルの中に存在するものである。零の係数の数が16未満になったならば、符号化すべき零でない係数をその係数が属するレベル値とそのレベル内での残りビットとに分解し、零の係数の数と零でない係数のレベル値との組を二次元ハフマン符号化し、続いて残りビットを添付する。ZRL符号と二次元ハフマン符号との双方とも符号出力の度に許容回数記憶手段105を1 個デクリメントする。符号を出力した後、処理S16においてさらに零係数のカウンタを0 に初期化する。この後処理S17へ進む。
【0031】
処理S17では係数の位置を指定するカウンタをインクリメントして判定処理S13へ戻る。
【0032】
全ての交流係数のジグザグスキャンを終えた場合、判定処理S13から処理S19に至る。処理S19は零係数の数が0 個であるかを調べる判定処理である。判定結果がYesであればそのブロックに対する符号化処理は終了する。結果がNoであればEOB符号を出力し、許容回数記憶手段105を1 個デクリメントする。EOBとは、End Of Blockのことで、符号シンボルの一つとして二次元ハフマン符号のテーブルの中に存在するものである。
【0033】
係数符号化部102が二次元ハフマン符号を出力するのは、零でない交流係数を符号化する場合、ZRLを出力する場合、EOBを出力する場合、のいずれかである。ブロックの最後に交流係数が出現することはまれであるので、多くの場合ブロックの最後にはEOB符号が出力される。本発明では係数符号化部の符号出力の回数と符号量との相関が高いことを利用しており、符号出力の回数を測定し、これが許容回数内に収まるように符号出力の回数を制御するものである。本実施の形態では符号出力の回数を数える際にZRLやEOBを含めることにするが、これらを含めずに数えるような画像符号化装置を作成してもよい。
【0034】
本発明において符号量制御が働いて実際に削減動作が実行されるのは処理S18である。処理S18は許容回数記憶手段105の記憶する値が正であるか調べる判定処理である。判定結果がYesであれば処理S16に進んで符号を出力する。Noの場合は処理S21へ進む。処理S21は値が零の係数の数を数えるカウンタを1 個インクリメントする処理であり、その後処理S17へ進む。処理S18から処理S21へ進むときに、量子化時点では零でなかった係数が零として処理されることになるのである。
【0035】
次に画像における位置に応じて画質を変えながら符号量制御を実現する方法について説明する。図5には画像110と画像110を構成するMCUが示されている。MCUのサイズは横16画素、縦16画素であり、輝度成分のブロックが4 個と色差成分のブロックが2個含まれている。画像110の横方向には6個のMCU、縦方向には7個のMCUが並び、計42個のMCUで構成されている。横のインデクスと縦のインデクスの組でMCUを指定することにすると、(0,0 )のMCUはMCU111であり、(5,0 )のMCUはMCU116である。MCUカウンタとしては、縦のインデクス×6 +横のインデクスを用いることにより、一つのカウンタ値でMCUの画像における位置を指定することができる。図5において画像110の中央付近に位置するMCU118などは実線で描かれ、画像110の周辺に位置するMCU111からMCU117などは点線で示されているが、これは点線で示されたMCUは周辺に位置するため重要度が低く、実線で示されたMCUは中央に位置するため重要度が高く、画質の優先度に差を設けていることを表している。
【0036】
本発明の符号化装置は空間的許容回数増加手段104の動作によって、空間的な符号量配分を制御しており、図2の処理S03において許容回数記憶手段105の記憶値をいくつ増加させるかを対象とする画像サイズと符号量に合わせて設計しなければならない。
【0037】
まず二次元ハフマン符号を画像全体で何個出力してよいか、全体の許容回数を予め決める。符号化結果において画像の符号量と符号化された二次元ハフマン符号の数とは強い相関があるため、対象とする標準的な画像について目標符号量内で符号化できる量子化テーブルを試行錯誤によって求め、このとき画像全体で出力される二次元ハフマン符号の数を測定し、これをNi とする。
【0038】
次に求めたNi を総MCU数で割り、MCUの1 個あたりの二次元ハフマン符号の数を求めこれをNm とする。ここではMCUの1 個あたりの二次元ハフマン符号出力Nm を40個に設定する。これはMCUあたりの目標符号量を約17 bitに設定し、量子化テーブルを選択した結果の数字である。
【0039】
ブロックの画像における空間的位置に応じて符号量の配分を行うために、空間的許容回数増加手段104はMCUの画像における位置に応じて許容回数増加値を記憶しており、MCUの画像における位置が入力されると許容回数増加値を読み出して許容回数記憶手段105の記憶値に加算し更新する。
【0040】
各MCUに対する許容回数の増加値を図6に示す。図6は画像110を構成する各MCUの位置に許容回数の増加値を示したもので、空間的許容回数増加手段104はこの値をテーブルに記憶しておく。
【0041】
まずMCU111に対して符号化を行うが、MCUの位置は(0,0 )であり、この位置を表すMCUカウンタの値が図2の処理S03において空間的許容回数増加手段104へ通知され、許容回数増加手段104はテーブルの(0,0 )の位置を参照し、許容回数記憶手段105の記憶値を40増加させる。これはNm が40であることからMCU1個分の割り当てを行うことを意味し、40個の符号を出力するまでは符号量制御が働かない。係数符号化部102はMCU111の係数を符号化し、二次元ハフマン符号を出力するたびに、許容回数記憶手段105の記憶値を1 だけ減少させる。
【0042】
MCU111は周辺に位置しており、空間的閾値指定手段103は閾値を小さく設定しているので、出力される符号が多い場合には許容回数記憶手段105の記憶値が正でなくなり、係数符号化部102は閾値以上の高周波数側の係数を零とみなして符号出力を制限するようになる。
【0043】
MCU111の符号化が終わると次に(0,1 )の位置にあるMCU112を符号化する前に、空間的許容回数増加手段104は許容回数記憶手段105の記憶値を240増加させる。これはMCUの6個分すなわち、6Nm 個の許容回数であり、(0,1 )の位置にあるMCU112から、(1,0 )の位置にあるMCU117までを符号化するための割り当てである。以後MCU113からMCU117までの符号化に際しての許容回数増加値は0に設定する。これらの増加値は空間的許容回数増加手段104の中のテーブルに記憶される。
【0044】
MCU112から順に符号化していくと、先に符号化されるMCUには許容回数が多くあるため、符号出力制限を受けることなく全ての係数が符号化される。このため先に符号化されるMCUが多くの係数を出力すると、後で符号化されるMCUでは許容回数記憶手段105の値が正でなくなり高周波数側係数の出力が制限されやすくなる。とくに位置(1,0 )のMCU117と、位置(0,6 )のMCU116において出力制限が発生しやすいため、画像の周辺の画質が低下する。一方位置(0,1 )のMCU112やその後続のMCU113などにおいては、許容回数記憶手段105の値が豊富にあるため、符号の出力制限は発生せず、その画質は量子化テーブルで量子化したとおりの画質になる。
【0045】
同様に図6に示すように、j を1から5までの整数として位置(1,j )におけるMCUに対する許容回数増加値を以降のMCUの分を含めて240に設定し、他のMCUに対する許容回数増加値を0に設定する。これによって位置(1,j )のMCUは常に良好な画質が保証され、位置(0,j+1 )や位置(5,j )にあるMCUの画質は低下しやすくなる。j が6のときも同様に図6に示すように位置(1,6 )にあるMCUを符号化する前に、空間的許容回数増加手段104は許容回数記憶手段105の記憶値を200増加させる。これは5個分すなわち5Nm 個の許容数である。
【0046】
画像中央付近に位置するMCU、例えば図5のMCU118については、画質劣化を避けるために係数符号化部102による符号の出力制限を行わない。これは空間的閾値指定手段103が指定する閾値を画像データの画像における位置に応じて変化させることによって実現する。8×8の係数ブロックは図4に示す順番でジグザグスキャンされるので、係数の空間周波数は横と縦のインデクスの和が一定になるようなバンドに区分することができる。よって空間的閾値指定手段103は図4のジグザグスキャンの順番における閾値を通知し、これによって係数符号化部102は係数の空間周波数を判定する。
【0047】
そこで図5で点線で示される周辺のMCUにおいては、空間的閾値指定手段103は閾値として15を通知する。係数の空間周波数が15未満の係数とは、図4において番号が1から14までの14個の交流係数のことであり、係数の横と縦のインデクスの和が5未満であれば低周波数側と判定していることになる。係数符号化部102は図3の判定処理S14で零でない係数を見つけると、判定処理S15でその係数の位置を表すカウンタが閾値未満かどうか調べ、結果がYesであれば符号を出力し、Noであれば判定処理S18において許容回数記憶手段105の値が正であるかを調べ、結果がYesであれば処理S17で符号を出力し、Noであればその係数の二次元ハフマン符号の出力を制限する。
【0048】
一方図5で実線で示されるMCUが処理される際、図2の処理S03でMCUカウンタの値が空間的閾値指定手段103に通知されると閾値は64に設定される。これにより全ての交流係数は判定処理S15において閾値未満と判定されることになり、係数符号化部102は符号の出力制限を実行しない。つまり判定処理S14において見つけた零でない係数全てが処理S16において符号化され、許容回数記憶手段105の記憶値は符号の出力のたびにデクリメントされる。これによって画像中央付近の画質を良好に保ちながら、画像周辺部の画質と符号量の制御を実現する画像符号化装置が得られる。
【0049】
なお本実施の形態では空間的許容回数増加手段104はテーブルに許容回数の増加値を記憶しておき、テーブルを参照して許容回数記憶手段105の値を更新しているが、他の方法を用いることもできる。例えばMCUのアドレスをもとに演算によって増加値を求めて許容回数記憶手段105の値を更新してもよい。またこのプログラムには、過去の符号の発生状況を反映させて、次のMCUにおいて必要となる許容回数増加値を予測し、許容回数の不足による画質劣化を近傍のMCUに分散させるような適応的な制御を実行することもできる。
【0050】
さらにまた本実施の形態ではMCUを単位として、MCUの符号化の前に許容回数記憶手段105の値を更新するように、空間的許容回数増加手段104を動作させているが、ブロックの位置を入力し、より細かくブロック単位で空間的許容回数増加手段104を動作させることもできる。
【0051】
【発明の効果】
本発明の画像符号化装置によれば次のような効果が得られる。一定の符号量内に収めるために符号量制御を実行しながら、画像における位置に応じて画質を制御することができる。とくに画質劣化が画像周辺部において発生し、画像中央部においては一定の画質が保証され、画像において重要な中央部の情報を劣化させることがない。また出力される符号は国際標準のJPEG復号器でデコードすることができ、専用の復号器を必要とせず、普及している様々なJPEG復号器を利用することができ、システムの自由度を大きくしかつ復号器の製作コストを削減できる。さらに出力された符号はフォーマット変換をすることなく様々な用途に再利用が可能である。
【図面の簡単な説明】
【図1】本発明による画像符号化装置のブロック図。
【図2】本発明の画像符号化装置の動作を表すフローチャート。
【図3】本発明における係数符号化部がブロックを符号化する動作を表すフローチャート。
【図4】8x8の係数ブロックのジグザグスキャンの順番を示す図。
【図5】画像を構成するMCUのうち周辺部に位置するMCUと中央部に位置するMCUを示す図。
【図6】各MCUを符号化する前に空間的許容回数増加手段が増加させる許容回数の増加値をMCUの位置に対応させて示した図。
【図7】従来の画像符号化装置のブロック図。
【符号の説明】
101:変換符号化部
102:係数符号化部
103:空間的閾値指定手段
104:空間的許容回数増加手段
105:許容回数記憶手段
110:画像
111〜118:MCU
201:DCT演算部
202:量子化部
203:VLC部
204:VLC制御回路
205:レート計算回路
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image encoding apparatus that compresses and encodes image data, and more particularly to an image encoding apparatus that keeps the code amount within the limit while keeping the image quality as good as possible when the output code amount is limited.
[0002]
[Prior art]
Conventionally, JPEG is known as a standard of an image compression encoding method using discrete cosine transform. In this method, image data is subjected to discrete cosine transform for each block, and the transform value is quantized. Discrete cosine transform classified as transform coding is a well-known transform method for transforming image data into the spatial frequency domain, and is widely used for image data because of its high ability to reduce information entropy.
[0003]
Discrete cosine transform and quantization causes the image to undergo irreversible distortion and reduce information entropy. Since the discrete cosine transform and JPEG quantization are integrated in operation, they can be collectively regarded as a transform coding unit. After this, entropy coding is further performed. Entropy encoding is performed so that the output code approaches information entropy, and distortion due to encoding is not introduced. The part that implements this is a coefficient encoding unit.
[0004]
In the coefficient encoding unit, among the coefficients obtained by quantization, the DC coefficient is obtained as a difference from the DC coefficient value of the previous block, and the difference value is Huffman encoded. On the other hand, AC coefficients are scanned in a zigzag order and are two-dimensionally Huffman encoded as a combination of the number of zeros and non-zero coefficients. Since both the discrete cosine transform and the quantization increase the appearance frequency of zero in the AC coefficient, a Huffman code is assigned to a combination of a continuous number of zeros and a non-zero coefficient. Therefore, the coefficient encoding unit finds a non-zero coefficient or outputs a code when the end of the block is reached. Although an image compressed according to JPEG is accompanied by deterioration, by appropriately setting a quantization table used for quantization, significant data compression is possible while maintaining a good subjective evaluation value.
[0005]
Conventionally, a video conference codec for video conferencing is known for the purpose of image communication for transmitting images that change from moment to moment. A moving image codec has a high compression rate and is excellent, but requires a dedicated LSI and must be operated with a high-speed clock, resulting in an increase in power consumption. In a device that needs to reduce power consumption as much as possible, such as a portable communication device, image transmission can be performed using a JPEG codec instead of a moving image codec. The JPEG processing method is simpler than a moving image codec, and can be realized by a CPU and software without using a dedicated LSI. One of the reasons why the amount of calculation of the moving image codec is large is that the difference between frames is encoded and transmitted. At this time, the encoder uses a local decoder to display the same image as that decoded by the other party. It must be generated. On the other hand, if the JPEG codec is not used and the inter-frame difference is not used, the required calculation performance is lowered, and there is an advantage that power consumption can be suppressed.
[0006]
However, since the JPEG encoder cannot achieve a compression rate as high as that of a moving image codec, it is necessary to reduce the amount of generated code at the expense of image size, image quality, frame rate, and the like.
[0007]
As a conventional image coding apparatus for controlling the code amount, a transmission rate control method in image coding of Japanese Patent No. 2647272 is known, which is shown in FIG. According to this, the average code amount and the instantaneous code amount per unit time are calculated by the rate calculation circuit 205 and notified to the VLC control circuit 204. When these rates exceed the set values, the VLC control circuit 204 The code of the coefficients up to the middle is sent, and the sign of the remaining coefficients is not forcibly sent. Thereby, control of the code amount is realized. At this time, since the characteristics of the quantizer 202 are not changed, there is no need to consider whether or not the code amount is controlled on the decoding side, and there is an advantage that a general-purpose and simple decoder can be used. In addition, since the coefficient zero replacement is performed from a coefficient on the high frequency side, there is an advantage that the image quality is not greatly impaired even when the code amount is limited.
[0008]
Conventionally, an image coding apparatus that performs coding by controlling a quantizer in accordance with the position of a block in an image to reduce important portions with high accuracy and reduce information on unimportant portions has been disclosed in Japanese Patent Application Laid-Open No. Hei 4- It is known as a 247789 encoder and decoder.
[0009]
[Problems to be solved by the invention]
However, in the conventional image coding apparatus that controls the code amount of Japanese Patent Publication No. 2647272, there is a problem that the code amount control with a difference in image quality cannot be performed in consideration of the position in the image. The important part of the image is usually near the center and less important as the periphery. When it is necessary to reduce the amount of code at the expense of image quality, the image quality deterioration in the peripheral portion can be tolerated, but the image quality deterioration in the central portion should be avoided. For this reason, it is desirable to allocate a large amount of code to the block located at the center of the image and assign a small amount of code to the block located around the image, but this has not been possible with the conventional image coding apparatus. The reason for this is that in the conventional apparatus, the criterion for truncating the block coefficient does not consider the position of the block in the image.
[0010]
On the other hand, the conventional image coding apparatus disclosed in Japanese Patent Laid-Open No. 4-247789 which controls the quantizer according to the position of the block overcomes this problem, but the decoder has a dedicated decoder corresponding to the encoder. The JPEG decoder that is widely used cannot be used and the image can be transmitted. However, when the transmitted image is used for other purposes or attached to an e-mail. Has the problem that it must be recompressed with a JPEG encoder. Further, although this image coding apparatus can change the weighting according to the block position, it does not have a code amount control function for keeping the generated code amount within a certain limit. That is, although the balance of the code amount of each block can be controlled, there is a problem that the total code amount obtained by adding them can not be controlled.
[0011]
[Means for Solving the Problems]
In order to solve the above problem, an image coding apparatus according to claim 1 is a transform coding means for discrete cosine transforming and quantizing image data for each block and outputting coefficients, and the transform coding means outputs In an image encoding device comprising coefficient encoding means for encoding a coefficient,
An allowable number storage means for storing the allowable number of code outputs of the coefficient encoding means;
Spatial allowable number increase means for increasing the allowable number of times stored in the allowable number storage means according to the position of the image data in the image;
Spatial threshold value specifying means for specifying a threshold value of the coefficient according to the position of the image data in the image,
The coefficient encoding means compares the spatial frequency of the coefficient output from the transform encoding means with the threshold specified by the spatial threshold specifying means, and encodes the coefficient when the spatial frequency of the coefficient is lower than the threshold. If the allowable number stored in the allowable number storage means is positive, the coefficient is encoded and the code is output.If the allowable number is not positive, the coefficient is output as zero. Without
Further, when the coefficient encoding means outputs a code, the allowable number of times stored in the allowable number storage means is controlled to be decreased by the number of the outputted codes.
[0012]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a preferred embodiment of the present invention. FIG. 2 is a flowchart showing the procedure of the operation.
[0013]
The image coding apparatus of the present invention operates based on the position of an MCU (Minimum Coded Unit) image. The MCU is an encoding unit including a plurality of blocks, and includes a luminance component block and a color difference component block, and is the minimum encoding unit as a color image. Since the order in which the image coding apparatus processes the MCU is fixed, the serial number is determined for the MCU, and the MCU position can be specified by counting this with the MCU counter. Each processing unit is notified of the value of the MCU counter, so that processing according to the position of the MCU in the image can be performed.
[0014]
When the processing is started in FIG. 2, first, an MCU counter for designating an MCU is initialized to 0 and an allowable number storage means 105 is initialized to 0 in processing S01.
[0015]
A subsequent process S02 is a determination process for checking whether all the MCUs constituting the image have been processed. When the determination result is Yes, the processing for one image is completed. When the determination result is No, the process proceeds to step S03.
[0016]
In step S03, the value of the MCU counter is notified to the spatial allowable number increase means 104. Spatial allowable number increase means 104 stores the increment value of the allowable number corresponding to the MCU number. When receiving the notification in step S03, the spatial allowable number increase means 104 increases and updates the stored value of the allowable number storage means 105 using this stored value. Further, the value of the MCU counter is also notified to the spatial threshold value specifying means 103. The spatial threshold designating unit 103 sets a threshold according to the position of the MCU in the image.
[0017]
Subsequently, in process S04, the image data of the MCU specified by the MCU counter is input to the transform coding unit 101 in units of 8 × 8 pixel blocks. A single MCU has a plurality of blocks, and the blocks are processed in order. In step S04, the transform coding unit 101 performs two-dimensional discrete cosine transform on the input block, and further performs quantization. Quantization conforming to JPEG is a process of multiplying a coefficient value obtained by discrete cosine transform by an inverse number of a quantization step and rounding to an integer. Since the quantization operation is multiplication, it is integrated with discrete cosine transform that executes a large amount of multiplication, and both are used as transform coding section 101.
[0018]
In the quantization table, a quantization step size is set in advance according to the properties of the input image and the image quality and code amount of the image output from the image encoding apparatus. As is well known, an 8 × 8 coefficient block output by discrete cosine transform is a coefficient in the spatial frequency domain, and the position of each coefficient in the block and the spatial frequency have a one-to-one correspondence. The quantization step size is small for the low frequency side coefficient and large for the high frequency side coefficient, so that a large amount of information is allocated to the low frequency side coefficient and a small amount of information is allocated to the high frequency side coefficient. be able to. The quantization table can be switched depending on whether the data block is a luminance component or a color difference component of the image, and a quantization step suitable for each color component having a different statistical property can be designated. .
[0019]
In the process S05, the coefficient output from the transform encoding unit 101 is input to the coefficient encoding unit 102. The coefficient encoding unit 102 receives the quantized 8 × 8 coefficient block and performs entropy encoding on this.
[0020]
When processing of a plurality of blocks included in the MCU is completed, the process proceeds to process S06, the MCU counter is incremented, and the process returns to the determination process S02.
[0021]
Next, it is the coefficient encoding unit 102 that performs code amount control in consideration of the spatial position, which is a feature of the present invention. FIG. 3 is a flowchart showing the operation, which will be described based on this.
[0022]
In response to the input of the coefficient block, the coefficient encoding unit 102 encodes the DC coefficient and outputs a code in step S11. For the DC coefficient, the difference from the previous DC coefficient of the same color component is obtained, the difference value is decomposed into the level value to which it belongs and the remaining bits within that level, the level value is Huffman encoded, and then the remaining bits are Attach.
[0023]
When the coefficient encoding unit 102 encodes the AC coefficient, the blocks are scanned zigzag in order from the low frequency to the high frequency, and the coefficient that is not zero is searched for while counting the number of coefficients having the value zero.
[0024]
Here, the order of zigzag scanning is shown in FIG. FIG. 4 shows an 8 × 8 coefficient block that is a result of the transform coding unit 101 performing discrete cosine transform and quantization, and the order in which the block is zigzag scanned. Is low. The coefficient encoding unit 102 scans the coefficients in the order of number 1 to number 63 in FIG. 4 to check whether they are zero or not. However, since the coefficient of number 0 is a DC coefficient, zigzag scanning is not performed.
[0025]
Process S12 in FIG. 3 is a preparatory process for starting a zigzag scan. A counter for specifying a coefficient is initialized to 1, and a counter for counting the number of zero coefficients is initialized to 0.
[0026]
The process S13 is a determination process for checking whether the zigzag scan of the block has been completed. This checks whether the counter specifying the coefficient is less than 64. If the result is Yes, the process proceeds to step S14. If the result is No, the process proceeds to step S19.
[0027]
The process S14 is a determination process for checking whether the coefficient designated by the counter is 0. If the result is Yes, the coefficient is 0 and the process proceeds to step S21. If the result is No, the process proceeds to step S15.
[0028]
Process S15 is a determination process for checking whether the spatial frequency of the coefficient is on the low frequency side as compared with the threshold value specified by the spatial threshold value specifying means 103. In process S15, the counter value specifying the position of the coefficient is compared with the threshold value specified by the spatial threshold value specifying means 103, and it is checked whether the counter value is less than the threshold value. If the result is Yes, the process proceeds to step S16, and if the result is No, the process proceeds to step S18. The spatial threshold designating unit 103 changes the threshold based on the MCU counter value. When the MCU counter designates the vicinity of the center of the image, the threshold value is set to 64 in order to emphasize the image quality. When the threshold value is designated as 64, all non-zero coefficients are determined to be less than the threshold value, and are encoded and output in step S16. On the other hand, when the MCU counter designates the periphery of the image, the threshold is set to 15. As a result, when there is a non-zero coefficient between 1 and 14 in the coefficient counter, it is guaranteed that the coefficient counter is not replaced with zero and is encoded in step S16.
[0029]
The reason why the low frequency side coefficient is excluded from the code amount control target even in the peripheral MCU that does not place importance on the image quality is that if the low frequency side coefficient is zero-substituted, the influence on the decoded image is large. On the other hand, the coefficient on the high frequency side has a relatively small effect even if zero substitution is performed, and therefore, the coefficient is deleted when executing the code amount control. In addition, the threshold value is changed according to the position of the MCU image notified by the spatial threshold value designating means 103 for the image data block located near the center of the image to invalidate the code amount control and guarantee the image quality. This is because the code amount control is enabled for the blocks located in the periphery of the image while allowing the image quality to deteriorate.
[0030]
In step S16, the coefficient encoding unit 102 executes encoding and outputs a code, and decrements the number of codes output from the allowable number storage means 105. Encoding is performed as follows. While the number of zero coefficients is 16 or more, the ZRL code is output and the operation of subtracting 16 from the number of zero coefficients is repeated. ZRL is Zero Run Length, which exists as one of the code symbols in the two-dimensional Huffman code table. If the number of zero coefficients is less than 16, the non-zero coefficient to be encoded is decomposed into the level value to which the coefficient belongs and the remaining bits within that level, and the number of zero coefficients and the non-zero coefficient The pair with the level value is two-dimensionally Huffman encoded, and then the remaining bits are attached. Both the ZRL code and the two-dimensional Huffman code decrement the allowable number storage means 105 for each code output. After outputting the code, a zero coefficient counter is further initialized to 0 in step S16. Thereafter, the process proceeds to S17.
[0031]
In the process S17, the counter for designating the coefficient position is incremented and the process returns to the determination process S13.
[0032]
When the zigzag scan of all the AC coefficients is completed, the process proceeds from the determination process S13 to the process S19. Process S19 is a determination process for checking whether the number of zero coefficients is zero. If the determination result is Yes, the encoding process for the block ends. If the result is No, an EOB code is output and the allowable number storage means 105 is decremented by one. The EOB is an end of block, and is present in the two-dimensional Huffman code table as one of the code symbols.
[0033]
The coefficient encoding unit 102 outputs the two-dimensional Huffman code when encoding a non-zero AC coefficient, when outputting ZRL, or when outputting EOB. Since an AC coefficient rarely appears at the end of a block, an EOB code is output at the end of the block in many cases. In the present invention, the fact that the correlation between the number of code outputs of the coefficient coding unit and the code amount is high is used, the number of code outputs is measured, and the number of code outputs is controlled so that this is within the allowable number. Is. In the present embodiment, ZRL and EOB are included when counting the number of code outputs, but an image encoding device that counts without including these may be created.
[0034]
In the present invention, the code amount control works and the actual reduction operation is executed in step S18. Process S18 is a determination process for checking whether the value stored in the allowable number storage means 105 is positive. If a determination result is Yes, it will progress to process S16 and will output a code | symbol. In No, it progresses to process S21. Process S21 is a process of incrementing the counter for counting the number of zero-valued coefficients by one, and then proceeds to process S17. When the process proceeds from the process S18 to the process S21, the coefficient that was not zero at the time of quantization is processed as zero.
[0035]
Next, a method for realizing the code amount control while changing the image quality according to the position in the image will be described. FIG. 5 shows an image 110 and MCUs constituting the image 110. The size of the MCU is 16 pixels horizontally and 16 pixels vertically, and includes four luminance component blocks and two color difference component blocks. Six MCUs are arranged in the horizontal direction of the image 110, and seven MCUs are arranged in the vertical direction. If the MCU is specified by a set of a horizontal index and a vertical index, the MCU of (0, 0) is the MCU 111, and the MCU of (5, 0) is the MCU 116. By using a vertical index × 6 + horizontal index as the MCU counter, the position of the MCU in the image can be specified by one counter value. In FIG. 5, the MCU 118 and the like located near the center of the image 110 are drawn by solid lines, and the MCU 111 to MCU 117 and the like located around the image 110 are indicated by dotted lines. The importance is low because it is located, and the MCU indicated by the solid line is high in importance because it is located in the center, indicating that there is a difference in the priority of image quality.
[0036]
The encoding apparatus of the present invention controls the spatial code amount distribution by the operation of the spatial allowable number increase means 104, and how many values to be stored in the allowable number storage means 105 are increased in step S03 in FIG. It must be designed according to the target image size and code amount.
[0037]
First, the total allowable number is determined in advance how many two-dimensional Huffman codes can be output for the entire image. Since there is a strong correlation between the code amount of the image and the number of encoded 2D Huffman codes in the encoding result, a quantization table that can be encoded within the target code amount for the target standard image is obtained by trial and error. At this time, the number of two-dimensional Huffman codes output in the entire image is measured, and this is defined as Ni.
[0038]
Next, the obtained Ni is divided by the total number of MCUs, and the number of two-dimensional Huffman codes per MCU is obtained, and this is defined as Nm. Here, 40 two-dimensional Huffman code outputs Nm per MCU are set. This is a number obtained as a result of selecting a quantization table by setting the target code amount per MCU to about 17 bits.
[0039]
In order to distribute the code amount according to the spatial position in the image of the block, the spatial allowable number increase means 104 stores the allowable number increase value according to the position in the MCU image, and the position in the MCU image. Is input, the allowable number increase value is read and added to the stored value of the allowable number storage means 105 to be updated.
[0040]
FIG. 6 shows an increase value of the allowable number for each MCU. FIG. 6 shows an increase value of the allowable number at the position of each MCU constituting the image 110, and the spatial allowable number increase means 104 stores this value in a table.
[0041]
First, encoding is performed on the MCU 111, and the position of the MCU is (0, 0), and the value of the MCU counter representing this position is notified to the spatial allowable number increasing means 104 in step S03 in FIG. The number increase means 104 refers to the position of (0,0) in the table and increases the stored value of the allowable number storage means 105 by 40. This means that since Nm is 40, one MCU is allocated, and code amount control does not work until 40 codes are output. The coefficient encoding unit 102 encodes the coefficient of the MCU 111 and decreases the value stored in the allowable number storage unit 105 by 1 each time a two-dimensional Huffman code is output.
[0042]
Since the MCU 111 is located in the vicinity, and the spatial threshold value specifying unit 103 sets a small threshold value, when the number of codes to be output is large, the stored value of the allowable number storage unit 105 is not positive, and the coefficient encoding is performed. The unit 102 regards the high frequency side coefficient equal to or higher than the threshold as zero and limits the code output.
[0043]
When encoding of the MCU 111 is completed, the spatial allowable number increasing means 104 increases the stored value of the allowable number storage means 105 by 240 before encoding the MCU 112 at the position (0, 1) next. This is an allowable number of 6 MCUs, that is, 6Nm, and is an allocation for encoding from the MCU 112 at the (0,1) position to the MCU 117 at the (1,0) position. Thereafter, the allowable number increase value at the time of encoding from MCU 113 to MCU 117 is set to zero. These increased values are stored in a table in the spatial allowable number increasing means 104.
[0044]
If encoding is performed in order from the MCU 112, since the number of allowable times is large in the previously encoded MCU, all coefficients are encoded without being limited in code output. For this reason, if the MCU that is encoded earlier outputs many coefficients, the value of the allowable number storage means 105 is not positive in the MCU that is encoded later, and the output of the high frequency side coefficient is likely to be limited. In particular, output restriction is likely to occur in the MCU 117 at the position (1,0) and the MCU 116 at the position (0,6), so that the image quality around the image is degraded. On the other hand, in the MCU 112 at the position (0, 1), the subsequent MCU 113, and the like, there are abundant values in the allowable number storage means 105, so there is no code output limitation, and the image quality is quantized by the quantization table. The image quality will be as shown.
[0045]
Similarly, as shown in FIG. 6, j is an integer from 1 to 5, and the allowable number increase value for the MCU at the position (1, j) is set to 240 including the subsequent MCUs, and the allowable values for other MCUs are set. Set the increment value to 0. As a result, the MCU at the position (1, j) always guarantees good image quality, and the image quality of the MCU at the position (0, j + 1) and the position (5, j) tends to deteriorate. Similarly, when j is 6, before encoding the MCU located at the position (1,6) as shown in FIG. 6, the spatial allowable number increase means 104 increases the stored value of the allowable number storage means 105 by 200. . This is an allowable number of 5 or 5Nm.
[0046]
For the MCU located near the center of the image, for example, the MCU 118 in FIG. 5, the code output by the coefficient encoding unit 102 is not limited in order to avoid image quality degradation. This is realized by changing the threshold specified by the spatial threshold specifying means 103 in accordance with the position of the image data in the image. Since the 8 × 8 coefficient block is zigzag scanned in the order shown in FIG. 4, the spatial frequency of the coefficient can be divided into bands in which the sum of the horizontal and vertical indexes is constant. Therefore, the spatial threshold designation unit 103 notifies the threshold in the zigzag scan order of FIG. 4, and the coefficient encoding unit 102 thereby determines the spatial frequency of the coefficient.
[0047]
Therefore, in the peripheral MCU indicated by the dotted line in FIG. 5, the spatial threshold value specifying means 103 notifies 15 as the threshold value. The coefficient whose spatial frequency is less than 15 is the 14 AC coefficients numbered 1 to 14 in FIG. 4. If the sum of the horizontal and vertical indices of the coefficient is less than 5, the low frequency side It will be judged. When the coefficient encoding unit 102 finds a non-zero coefficient in the determination process S14 of FIG. 3, the coefficient encoding unit 102 checks whether the counter representing the position of the coefficient is less than the threshold value in the determination process S15, and outputs a code if the result is Yes. If so, it is checked in the determination process S18 whether the value of the allowable number storage means 105 is positive. If the result is Yes, the code is output in the process S17, and if it is No, the output of the two-dimensional Huffman code of the coefficient is output. Restrict.
[0048]
On the other hand, when the MCU indicated by the solid line in FIG. 5 is processed, the threshold value is set to 64 when the value of the MCU counter is notified to the spatial threshold value specifying means 103 in step S03 of FIG. As a result, all AC coefficients are determined to be less than the threshold value in the determination process S15, and the coefficient encoding unit 102 does not perform code output restriction. That is, all the non-zero coefficients found in the determination process S14 are encoded in the process S16, and the stored value in the allowable number storage unit 105 is decremented each time a code is output. As a result, it is possible to obtain an image encoding device that can control the image quality and code amount of the peripheral portion of the image while maintaining the image quality near the center of the image.
[0049]
In this embodiment, the spatial allowable number increase means 104 stores the increase value of the allowable number in the table and updates the value of the allowable number storage means 105 with reference to the table. It can also be used. For example, an increase value may be obtained by calculation based on the MCU address, and the value in the allowable number storage means 105 may be updated. In addition, this program reflects the past code generation situation, predicts an allowable increase in the number of times required in the next MCU, and adaptively disperses image quality degradation due to insufficient allowable numbers to neighboring MCUs. It is also possible to execute various controls.
[0050]
Furthermore, in the present embodiment, the spatial allowable number increasing means 104 is operated so that the value of the allowable number storage means 105 is updated before encoding the MCU in units of MCUs. It is also possible to input and operate the spatial allowable number increasing means 104 more finely in units of blocks.
[0051]
【The invention's effect】
According to the image coding apparatus of the present invention, the following effects can be obtained. The image quality can be controlled according to the position in the image while executing the code amount control so as to be within a certain code amount. In particular, image quality degradation occurs in the peripheral portion of the image, and a constant image quality is guaranteed in the central portion of the image, and information in the central portion that is important in the image is not degraded. In addition, the output code can be decoded by an international standard JPEG decoder, no dedicated decoder is required, and various popular JPEG decoders can be used, increasing the degree of freedom of the system. In addition, the production cost of the decoder can be reduced. Furthermore, the output code can be reused for various purposes without format conversion.
[Brief description of the drawings]
FIG. 1 is a block diagram of an image encoding apparatus according to the present invention.
FIG. 2 is a flowchart showing the operation of the image coding apparatus according to the present invention.
FIG. 3 is a flowchart showing an operation of coding a block by a coefficient coding unit according to the present invention.
FIG. 4 is a diagram showing the order of zigzag scanning of an 8 × 8 coefficient block.
FIG. 5 is a diagram showing MCUs located in a peripheral part and MCUs located in a central part among MCUs constituting an image;
FIG. 6 is a diagram showing an increase value of the allowable number that is increased by the spatial allowable number increase means before encoding each MCU in correspondence with the position of the MCU.
FIG. 7 is a block diagram of a conventional image encoding device.
[Explanation of symbols]
101: Transform coding unit
102: Coefficient encoding unit
103: Spatial threshold designation means
104: Means for increasing the allowable number of times of space
105: Permissible number storage means
110: Image
111-118: MCU
201: DCT calculation unit
202: Quantization unit
203: VLC section
204: VLC control circuit
205: Rate calculation circuit

Claims (1)

画像データをブロックごとに離散コサイン変換し量子化して係数を出力する変換符号化手段と、該変換符号化手段が出力する係数を符号化する係数符号化手段とからなる画像符号化装置において、
前記係数符号化手段の符号出力の許容回数を記憶する許容回数記憶手段と、
画像データの画像における位置に応じて前記許容回数記憶手段の記憶する許容回数を増加させる空間的許容回数増加手段と、
画像データの画像における位置に応じて係数の閾値を指定する空間的閾値指定手段と、
を備え、
前記係数符号化手段は、前記変換符号化手段が出力する係数のジグザグスキャン順の位置を表すカウンタ値を前記空間的閾値指定手段が指定する閾値と比較し、前記カウンタ値が前記閾値より低いときは係数を符号化して符号を出力し、前記許容回数記憶手段の記憶する許容回数が正ならばその係数を符号化して符号を出力し、許容回数が正でなければその係数を零として扱うことにより符号を出力せず、
更に、前記係数符号化手段が符号を出力した場合、出力した前記符号の個数だけ前記許容回数記憶手段が記憶している許容回数を減少させるよう制御することを特徴とする画像符号化装置。
In an image coding apparatus comprising transform coding means for discrete cosine transform and quantizing image data for each block and outputting coefficients, and coefficient coding means for coding coefficients output by the transform coding means,
An allowable number storage means for storing the allowable number of code outputs of the coefficient encoding means;
Spatial allowable number increase means for increasing the allowable number of times stored in the allowable number storage means according to the position of the image data in the image;
Spatial threshold value specifying means for specifying a threshold value of a coefficient according to the position of the image data in the image;
With
The coefficient encoding unit compares a counter value indicating the position of the coefficient output by the transform encoding unit in the zigzag scan order with a threshold value specified by the spatial threshold value specifying unit, and when the counter value is lower than the threshold value Encodes the coefficient and outputs the code. If the allowable number stored in the allowable number storage means is positive, the coefficient is encoded and the code is output. If the allowable number is not positive, the coefficient is treated as zero. Does not output the sign,
Further, when the coefficient encoding means outputs a code, the image encoding apparatus controls to reduce the allowable number of times stored in the allowable number storage means by the number of the outputted codes.
JP13478499A 1999-05-14 1999-05-14 Image encoding device Expired - Fee Related JP4041245B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13478499A JP4041245B2 (en) 1999-05-14 1999-05-14 Image encoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13478499A JP4041245B2 (en) 1999-05-14 1999-05-14 Image encoding device

Publications (2)

Publication Number Publication Date
JP2000333172A JP2000333172A (en) 2000-11-30
JP4041245B2 true JP4041245B2 (en) 2008-01-30

Family

ID=15136483

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13478499A Expired - Fee Related JP4041245B2 (en) 1999-05-14 1999-05-14 Image encoding device

Country Status (1)

Country Link
JP (1) JP4041245B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7747095B2 (en) 2004-10-08 2010-06-29 Nvidia Corporation Methods and systems for rate control in image compression
US8977064B2 (en) 2008-02-13 2015-03-10 Qualcomm Incorporated Rotational transcoding for JPEG or other coding standards

Also Published As

Publication number Publication date
JP2000333172A (en) 2000-11-30

Similar Documents

Publication Publication Date Title
EP1397006B1 (en) Quantization matrix for still and moving picture coding
JP5107495B2 (en) Quality-based image compression
JP4927888B2 (en) Lossless intraframe coding using Golomb-Rice
US8644394B2 (en) Deblocking filter
EP1834487B1 (en) Method for improved entropy coding
US7729423B2 (en) Fixed bit rate, intraframe compression and decompression of video
US7010170B2 (en) Image coding device and method
CN1549988A (en) Apparatus and method for encoding digital image data in a lossless manner
WO2010041488A1 (en) Dynamic image encoding device
CN1347621A (en) Reducing 'blocking picture' effects
US6205254B1 (en) Image coding apparatus and method, and image decoding apparatus and method
JP2891773B2 (en) Method and apparatus for processing digital image sequences
JP2003230142A (en) Image information encoding method and apparatus, and program and recording medium
JP4041245B2 (en) Image encoding device
EP1629675B1 (en) Fixed bit rate, intraframe compression and decompression of video
JP2908459B2 (en) Image coding method
Kobayashi et al. Lossless compression for RGB color still images
JP2002209111A (en) Image encoding apparatus, image communication system, and program recording medium
KR100236526B1 (en) Adaptive Discrete Cosine Transform Coding Method and Apparatus
KR100923029B1 (en) How to recompress video frames
JPH0730889A (en) Image data encoder
JPH05328137A (en) Data compressing device
HK1070452B (en) An apparatus and method for encoding digital image data in a lossless manner
HK1101529A (en) An apparatus and method for encoding digital image data in a lossless manner
JPH1198025A (en) Data compression apparatus and data compression method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051007

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070725

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070731

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071001

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071109

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

Free format text: PAYMENT UNTIL: 20101116

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20101116

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121116

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees