JP3857820B2 - Image compression apparatus and image expansion apparatus - Google Patents

Image compression apparatus and image expansion apparatus Download PDF

Info

Publication number
JP3857820B2
JP3857820B2 JP24759198A JP24759198A JP3857820B2 JP 3857820 B2 JP3857820 B2 JP 3857820B2 JP 24759198 A JP24759198 A JP 24759198A JP 24759198 A JP24759198 A JP 24759198A JP 3857820 B2 JP3857820 B2 JP 3857820B2
Authority
JP
Japan
Prior art keywords
difference value
value
improved
bit
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP24759198A
Other languages
Japanese (ja)
Other versions
JP2000078410A (en
Inventor
紳聡 阿部
Original Assignee
ペンタックス株式会社
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 ペンタックス株式会社 filed Critical ペンタックス株式会社
Priority to JP24759198A priority Critical patent/JP3857820B2/en
Publication of JP2000078410A publication Critical patent/JP2000078410A/en
Application granted granted Critical
Publication of JP3857820B2 publication Critical patent/JP3857820B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、カラー静止画像を圧縮、伸張処理するための画像圧縮装置および画像伸張装置に関する。
【0002】
【従来の技術】
カラー静止画像を圧縮することによって通信回路を介した画像転送を効率的に行うため、JPEG(Joint Photographic Expert Group )方式と呼ばれる画像圧縮方式が標準化されており、JPEG方式を大きく分けると基本方式(ベースラインプロセス)を代表とする非可逆符号化方式と可逆符号化方式の2つに分類される。後者の可逆符号化方式では、1画面の画像において隣接する画素間に相関関係があることから、符号化(圧縮)対象である画素データを隣接する画素データから予測し、予測した画素データと実際の画素データとの差分値を求め、この差分値を符号化する。符号化された画素データは、復号化され、予測値と差分値に基いて元の画素データに復元され、これにより原画像が復元される。
【0003】
【発明が解決しようとする課題】
このような可逆符号化方式によれば、高解像度の画像に対して歪みを生じさせずに圧縮、伸張処理することができる。しかし、すべての画素データを符号化する必要があるために、直交変換と量子化の実行によりゼロラン(画素データを1列に並べたときの0の値である画素データが連続すること)を作り出す基本方式に比べて画像を効率的に圧縮することができない。
【0004】
本発明は、高解像度の画像に対して画質劣化を生じさせず、かつ効率的に圧縮、伸張処理するための画像圧縮装置および画像伸張装置を得ることを目的としている。
【0005】
【課題を解決するための手段】
本発明の画像圧縮装置は、入力される静止画像に対応した、複数の画素データによって構成される画像データについて、各画素データ毎に、隣接する画素データに基いて予測値を求める予測値生成手段と、予測値と画素データとの差分をとることにより、差分値を求める差分値生成手段と、予測値に対応した差分値のとりうる範囲に基いて改良差分値を生成する改良差分値生成手段と、改良差分値を符号化することにより、圧縮画像データを求める符号化手段とを備え、改良差分値生成手段が、差分値のとりうる範囲のなかで、差分値と正負の符号を反転させた差分値を、差分値のとりうる範囲における差分値の増加もしくは減少方向に対応させて、絶対値の小さい順に並べることにより、改良差分値を求めることを特徴とする。
【0006】
改良差分値生成手段は、絶対値が等しい差分値正負の符号を反転させた差分値を、正の値と負の値が交互に現れるように並べることが望ましい。
【0007】
改良差分値生成手段は、予測値に対応した差分値のとりうる範囲を第1および第2および第3の部分的範囲に分けるとともに、第1の部分的範囲を第4の部分的範囲に置き換え、差分値の存在しない非差分値範囲に存在する数値を第3の部分的範囲に存在する差分値の代わりに使用して、第2の部分的範囲に存在する差分値と非差分値範囲に存在する数値が絶対値の小さい順に交互に並べられた第5の部分的範囲を生成し、第4および第5の部分的範囲に存在するビット列で表される改良差分値を求めることが望ましい。
【0008】
改良差分値生成手段は、第1の部分的範囲における上限の差分値と下限の差分値との絶対値が等しくなるように、差分値のとりうる範囲を第1および第2および第3の部分的範囲に分けることが望ましい。
【0009】
改良差分値生成手段は、非差分値範囲に存在する数値の合計と第3の部分的範囲に存在する差分値の合計とが等しくなるように、差分値のとりうる範囲を第1および第2および第3の部分的範囲に分けることが望ましい。
【0010】
予測値生成手段は、符号化対象の画素データに対し、1つ左隣の画素データを予測値とすることが望ましい。
【0011】
本発明の画像伸張装置は、圧縮画像データを復号化することにより、改良差分値を求める復号化手段と、改良差分値のとりうる範囲と差分値のとりうる範囲を対応させることにより、差分値を復元する手段と、差分値と予測値との差をとることで画素データを順次復元することにより、画像データを復元する手段とを備えたことを特徴とする。
【0012】
予測値は、先に復元された画素データに基いて求められることが望ましい。
【0013】
本発明の画像圧縮装置は、入力される静止画像に対応した、複数の画素データによって構成される画像データについて、各画素データ毎に、隣接する画素データに基いて予測値を求める予測値生成手段と、予測値と画素データとの差分をとることにより、差分値を求める差分値生成手段と、予測値に対応した差分値のとりうる範囲に基いてビット列で表される改良差分値を生成する改良差分値生成手段と、改良差分値のビット列を上位ビット列と下位ビット列の2つに分離し、上位ビット列で表される上位改良差分値と下位ビット列で表される下位改良差分値を求めるビット分離手段と、上位改良差分値を符号化することにより、圧縮画像データを求める符号化手段とを備え、改良差分値生成手段が、差分値のとりうる範囲のなかで、差分値と正負の符号を反転させた差分値を、差分値のとりうる範囲における差分値の増加もしくは減少方向に対応させて、絶対値の小さい順に並べることにより、改良差分値を求めることを特徴とする。
【0014】
ビット分離手段は、改良差分値のビット列を右シフト演算し、右シフト演算により変換される改良差分値のビット列を上位ビット列、右シフト演算により分離される下位ビットを下位ビット列とすることが望ましい。
【0015】
本発明の画像伸張装置は、圧縮画像データを復号化することにより、上位改良差分値を求める復号化手段と、復号化手段により得られた上位改良差分値と入力される下位改良差分値をビット合成することにより、改良差分値を求めるビット合成手段と、改良差分値のとりうる範囲と差分値のとりうる範囲を対応させることにより、差分値を復元する手段と、差分値と予測値との差をとることで前記画素データを順次復元することにより、画像データを復元する手段とを備えたことを特徴とする。
【0016】
ビット合成手段は、上位改良差分値のビット列を左シフト演算し、左シフト演算により空白になるビット部分に下位ビット列を当てはめることにより、改良差分値を求めることが望ましい。
【0017】
本発明の画像圧縮装置は、入力される静止画像に対応し、ビット列で表される画像データに対し、画像データのビット列を2つに分離して上位ビット列で表される上位画像データと下位ビット列で表される下位画像データとを求めるビット分離手段と、複数の画素データから構成される上位画像データについて、各画素データ毎に、隣接する画素データに基いて予測値を求める予測値生成手段と、予測値と画素データとの差分をとることにより、差分値を求める差分値生成手段と、予測値に対応した差分値のとりうる範囲に基いて改良差分値を生成する改良差分値生成手段と、改良差分値を符号化することにより、圧縮画像データを求める符号化手段とを備え、改良差分値生成手段が、差分値のとりうる範囲のなかで、差分値と正負の符号を反転させた差分値を、差分値のとりうる範囲における差分値の増加もしくは減少方向に対応させて、絶対値の小さい順に並べることにより、改良差分値を求めることを特徴とする。
【0018】
ビット分離手段は、画像データのビット列を右シフト演算し、右シフト演算により変換される画像データのビット列を上位ビット列、右シフト演算により分離される下位ビットを前記下位ビット列とすることが望ましい。
【0019】
本発明の画像伸張装置は、圧縮画像データを復号化することにより、前記改良差分値を求める復号化手段と、改良差分値のとりうる範囲と差分値のとりうる範囲を対応させることにより、前記差分値を復元する手段と、差分値と予測値との差をとることで画素データを順次復元することにより、上位画像データを復元する手段と、入力される下位画像データと上位画像データをビット合成することにより、画像データを求めるビット合成手段とを備えたことを特徴とする。
【0020】
ビット合成手段は、上位画像データのビット列を左シフト演算し、左シフト演算により空白になるビット部分に下位ビット列を当てはめることにより、画像データを求めることが望ましい。
【0021】
本発明の画像圧縮装置は、入力される静止画像に対応した、複数の画素データによって構成される画像データについて、各画素データ毎に、隣接する画素データに基いて予測値を求める予測値生成手段と、予測値と画素データとの差分をとることにより、差分値を求める差分値生成手段と、予測値に対応した差分値のとりうる範囲に基いてビット列で表される改良差分値を生成する改良差分値生成手段と、改良差分値が負の値である場合には改良差分値を−1で掛け算して正の値に変換する手段と、はじめから正である、もしくは−1が掛け算されたことにより正の値に変換された改良差分値のビット列を上位ビット列と下位ビット列の2つに分離し、上位ビット列で表される上位改良差分値と下位ビット列で表される下位改良差分値を求めるビット分離手段と、下位改良差分値の下位ビット列に対し、改良差分値が正の値である場合には正の付加符号ビット、改良差分値が負の値である場合には負の付加符号ビットを付加する付加手段と、改良差分値を符号化することにより、圧縮画像データを求める符号化手段とを備え、改良差分値生成手段が、差分値のとりうる範囲のなかで、差分値と正負の符号を反転させた差分値を、差分値のとりうる範囲における差分値の増加もしくは減少方向に対応させて、絶対値の小さい順に並べることにより、改良差分値を求めることを特徴とする。
【0022】
本発明の画像伸張装置は、圧縮画像データを復号化することにより、上位改良差分値を求める復号化手段と、付加符号ビットを除いた下位改良差分値と上位改良差分値をビット合成することにより、改良差分値を求めるビット合成手段と、下位改良差分値に付加されていた付加符号ビットが負の値である場合には、ビット合成手段により得られた改良差分値に−1を掛け算して負の値に変換する手段と、改良差分値のとりうる範囲と差分値のとりうる範囲を対応させることにより、差分値を復元する手段と、差分値と予測値との差をとることで前記画素データを順次復元することにより、画像データを復元する手段と、
を備えたことを特徴とする。
【0023】
【発明の実施の形態】
以下、本発明の実施形態である画像圧縮装置および画像伸張装置について図面を参照して説明する。
図1〜図10は第1の実施形態例である画像圧縮装置および画像伸張装置に関する図であり、図1は、画像圧縮装置のブロック図である。
【0024】
被写体像16( 静止画像)は、レンズ17を介して撮像素子18の受光面上に結像される。撮像素子18の受光面には光電変換素子が配設され、光電変換素子の上面にはレッド(R)、グリーン(G)、ブルー(B)の各色フィルタ要素からなるカラーフィルタが設けられている。各光電変換素子は一つの画素データに対応しており、被写体像は各光電変換素子によって所定の色に対応した電気的な画像信号に変換される。そして画像信号は、A/D変換器( 図示せず)においてアナログ信号からデジタル信号に変換される。
【0025】
デジタル化された画像信号は、信号処理回路(図示せず)において輝度データY、色差データCb、Crに変換されて画像メモリ19に画像データとして記録される。画像メモリ19には、輝度データYおよび色差データCb、Crがそれぞれ独立した領域に格納されており、各メモリ領域は1画像分の記憶容量を有している。輝度データYおよび色差データCb、Crは、画像圧縮装置10に対する入力データである。
【0026】
輝度データYおよび色差データCb、Crの画像データは、1画面において複数のブロックに分割され、ブロック単位で処理される。各ブロックは、8×8個の画素データからなる。
【0027】
輝度データYおよび色差データCb,Crは、画像メモリ19から読み出され、画像圧縮装置10内に送られる。画像圧縮装置10は、予測値生成部11、差分値生成部12、改良差分値生成部13、グループ部14、ハフマン符号化部15から構成されている。輝度データYおよび色差データCb,Crは、画像圧縮装置10内においてそれぞれ別々に圧縮処理される。
【0028】
各ブロックにおける輝度データYおよび色差データCb,Crの画素データに基き、予測値が予測値生成部11において求められる。予測値は、符号化(圧縮)対象である画素データの値を隣接する画素データの値に基いて予測した値である。
【0029】
輝度データYおよび色差データCb,Crの画素データは、差分値生成部12において差分値に変換される。この差分値は、予測値生成部11において得られた予測値から実際の画素データの値が引き算されることにより求められる。
【0030】
輝度データYおよび色差データCb,Crの差分値は、改良差分値生成部13において改良差分値に変換される。改良差分値は、予測値および差分値に基いて算出され、画素データの代わりに符号化の対象とされる。
【0031】
輝度データYおよび色差データCb,Crの改良差分値は、グループ部14においてグループ表Tに基いてグループ分けされ、改良差分値が属するグループのグループ番号とそのグループ番号に対応した付加ビットが求められる。
【0032】
グループ部14において得られたグループ番号に基いてハフマンテーブルHを参照することにより、符号語がハフマン符号化部15において求められる。ハフマン符号化部15ではエントロピー符号化が行われ、ここではエントロピー符号化の一つとしてハフマン符号化が適用される。なお、グループ分けおよびハフマン符号化を、ここでは符号化とする。符号語とグループ部14において得られた付加ビットを組み合わせた圧縮画像データ(符号化データ)が、記録媒体Mに記録される。
【0033】
図2、図3を用いて、1つの画素ブロックに対する圧縮処理について説明する。ここでは、輝度データYの画素データを対象とする。
【0034】
図2では、画素ブロックPと予測値行列Eと差分値行列Hと改良差分値行列KHが8×8のマトリクスで例示されている。各マトリクスの要素は、それぞれ画素値(画素データを以下では画素値とする)Pyx、予測値Eyx、差分値Hyx、改良差分値KHyxと表される。
【0035】
画素値Pyxにおいて、添字yは縦方向の位置を表し、上から0,1,2,・・・7である。また、添字xは横方向の位置を表し、左から0,1,2,・・・7である。例えば、x=1、y=1の場合、画素値Pyx=162である。
【0036】
まず符号化対象の画素値Pyxに隣接する画素値Pyxに基いて予測値Eyxが求められる。予測値Eyxの算出方法は幾つか知られているが、ここでは符号化対象である画素値Pyxの1つ左隣の画素値Pyx-1をそのまま予測値Eyxとする方法(前値予測)により予測値Eyxを求める。ただし、画素ブロックPにおいて最左端の列に位置する画素値Py0に対する予測値Ey0は、1つ左隣の画素ブロックPにおいて最右端の列に位置する画素値Py7から求められる。
【0037】
例えば、符号化対象である画素値P17(=132)の1つ左隣である画素値P16(=14)が予測値E17(=14)となる。
【0038】
次に予測値Eyxとそれに対応する実際の画素値Pyxに基き、画素値Pyxが差分値Hyxに変換される。すなわち、予測値Eyxから画素値Pyxが引き算されて、差分値Hyxが求められる。
【0039】
例えば、予測値E17(=14)から画素値P17=(132)が引き算されることにより、差分値H17(=−118)が求められる。
【0040】
差分値Hyxは、予測値Eyxと画素値Pyxに基いて改良差分値KHyxに変換される。改良差分値KHyxは、−128〜127の範囲のいずれかの値であり、画素値Pyxの代わりに符号化の対象とされる。例えば、差分値H17(=−118)は、改良差分値KH17(=66)に変換される。また、差分値H21(=−1)はそのまま改良差分値KH21(=−1)となる。なお、改良差分値KHyxに関しては後述する。
【0041】
図3では、グループ表TとハフマンテーブルHが示されており、具体的に改良差分値KH17(=66)がグループ分けおよびハフマン符号化されている。
【0042】
改良差分値KHyxは、グループ表Tに基いてグループ分けされる。グループ表Tは、改良差分値KHyxの属するグループを示す欄と、そのグループ番号Cを示す欄と、グループ番号Cに対応した付加ビット数を示す欄から構成されている。
【0043】
例えば、グループ表Tを参照して改良差分値KH17(=66)をグループ分けすると、グループ番号[7]が得られ、付加ビット数は7となる。
【0044】
グループ分けにより得られたグループ番号Cと付加ビット数から、付加ビットが求められる。付加ビットは、改良差分値KHyxが属するグループにおいて改良差分値KHyxの値を特定するために設けられたビットである。
【0045】
グループ番号[7]のグループにおいて66は−127から数えて67番目に大きい数であることから、改良差分値KHyx(=66)に対する付加ビットは−127が2進数「0000000」であることを考慮すれば66の2進数「1000010」である。
【0046】
グループ分けにより得られたグループ番号Cに基いてハフマンテーブルHを参照することにより、符号語が求められる。ハフマンテーブルHは、グループ番号Cを示す欄と、符号長を示す欄と、符号語を示す欄から構成され、改良差分値KHyxのグループ番号Cに対応した符号語を有している。
【0047】
改良差分値KH17(=66)のグループ番号「7」に基いてハフマンテーブルHを参照することにより、改良差分値KH17(=66)の符号語は、「11110」である。
【0048】
この符号語と付加ビットを組み合わせることで符号化データが求まる。改良差分値KH17(=66)の場合、符号語「11110」と付加ビット「1000011」を組み合わせることにより、符号化データ「111101000011」が求められる。
【0049】
このように改良差分値KHyxをグループ分け、ハフマン符号化することで符号化データ、すなわち圧縮画像データが求められる。
【0050】
図4、図5、図6を用いて、改良差分値KHyxについて詳述する。ここでは、輝度データYの改良差分値KHyxを対象とする。
【0051】
図4には、予測値E17(=14)に対する画素値Pyx、差分値Hyx、および改良差分値KHyxのとりうる範囲を載せた表Sが示されている。また図5には、予測値E17(=14)に対する画素値Pyx、差分値Hyx、改良差分値KHyxのとりうる範囲が棒線で表されており、棒線L0は画素値Pyxのとりうる範囲、棒線L1は差分値Hyxのとりうる範囲、棒線L2は改良差分値KHyxのとりうる範囲を示している。
【0052】
輝度データYの画素値Pyxのとりうる範囲は、棒線L0で示されるように0〜255である。一方予測値E17(=14)に対する差分値Hyxのとりうる範囲は、棒線L1で示されるように−241〜14である。従って予測値E17(=14)に対する差分値Hyxは、整数範囲(非差分値範囲)LF(15〜127)には存在しない。
【0053】
棒線L1で示される差分値Hyxが存在する範囲を、部分的範囲(第3の部分的範囲)LC(−241〜−129)、部分的範囲(第2の部分的範囲)LB(−128〜−15)、部分的範囲(第1の部分的範囲)LA(−14〜14)に分ける。整数範囲LFに存在する整数の合計数と部分的範囲LCに存在する差分値 yx の合計数は等しい。また、部分的範囲LAでは、差分値Hyx−14〜14の範囲の値をとる。
【0054】
部分的範囲LCに存在する差分値Hyxの代わりに整数範囲LFに存在する整数が用いられるのが、棒線L2で示された改良差分値KHyxのとりうる範囲である。棒線L2における部分的範囲(第5の部分的範囲)LE(−128〜−15)では、整数範囲LFに存在する整数と部分的範囲LBに存在する差分値Hyxが絶対値の小さい順に交互に並べられている。この部分的範囲LEは表Sにおいて網線で表される。具体的に部分的範囲LEに存在する改良差分値KHyxの一部(−15、15、−16)がそれぞれ(n1、n2、n3)で示されている。
【0055】
この部分的範囲LEにおける改良差分値KHyxの並びは、部分的範囲LBに存在する差分値Hyxとその差分値Hyxに対して正負の符号を反転させた差分値−Hyxを、交互に絶対値が小さい順に並べたものと等しい。
【0056】
棒線L2における部分的範囲(第4の部分的範囲)LD(−14〜14)に存在する改良差分値KHyxは、棒線L1における部分的範囲LAに存在する差分値Hyxと対応している。なお、部分的範囲LA,部分的範囲LDにおける最大値(ここでは14)と最小値(ここでは−14)の絶対値は等しい。
【0057】
棒線L2で示される改良差分値KHyxのとりうる範囲と棒線L1で示される差分値Hyxのとりうる範囲を対応させることにより、差分値Hyxに対応する改良差分値KHyxが求められる。例えば、差分値Hyxが−129である場合、それに対応する改良差分値KHyxは−72である。
【0058】
図4で示されるように、改良差分値KHyxの絶対値の増加方向と、差分値Hyxの増加あるいは減少方向(ここでは減少方向)は対応している。そのため改良差分値KHyxとそれに対応する差分値Hyxをそれぞれ比べてみると、差分値Hyxの絶対値が大きければ大きいほど改良差分値KHyxの絶対値と差分値Hyxの絶対値との差はより大きい。
【0059】
ここで図3で示されたグループ表Tによるグループ分けを取り上げると、改良差分値KHyxは差分値Hyxに比べより小さいグループ番号Cのグループに属し、対応する付加ビットのビット数も少なくなる。また、グループ番号[8]に属する改良差分値KHyxは−128のみとなり付加ビットは必要としない。従って改良差分値KHyxの符号化データのビット数は差分値Hyxに比べ少なくなる。
【0060】
図6には、予測値E17(=14)に対して差分値Hyxである確率分布が示されている。この確率分布は、棒線L1で示される範囲の差分値Hyxの中で実際に差分値Hyxになる確率を表している。横軸は差分値Hyxのとりうる範囲であり、縦軸は実際に差分値Hyxとなる確率である。
【0061】
1画面の画像において隣接する画素間には相関関係があることから、差分値Hyxは0付近の値である確率が高い。従って、差分値Hyxの確率分布曲線はガウス分布曲線Vで表される。
【0062】
部分的範囲LEにおいて改良差分値KHyxは、絶対値が小さい順に正と負が交互に現れるように並べられている。従って改良差分値KH yx の絶対値の増加率(数値が大きくなっていく割合)は、部分的範囲LBにおける差分値Hyxの絶対値の増加率に対して半分の増加率となる。絶対値の小さい差分値Hyxほど実際に符号化対象となる確率が高いことを考慮すれば、絶対値の増加率が抑えられている改良差分値KHyxの符号化データのビット数は、差分値Hyxに比べて少なくなる。
【0063】
このように予測値Eyxと差分値Hyxのとりうる範囲に基いて改良差分値KHyxのとりうる範囲を生成し、差分値Hyxの代わりに改良差分値KHyxを符号化すれば、符号化データに必要とするビット数、すなわち情報量が少なくて済む。
【0064】
色差データCb,Crの改良差分値KHyxも、輝度データYと同じように求められる。ただし、色差データCb,Crの範囲は−128〜127であるため、色差データCb、Crに128が足し算されてから同じように改良差分値KHyxが求められる。
【0065】
図7は、1つの改良差分値行列KHを求める手順を示したフローチャートである。図2、図7を用いて1つの改良差分値行列KHを求める手順を説明する。
【0066】
ステップ101では、添字yが0に設定される。ステップ202では、添字xが0に設定され、求められる改良差分値KHyxが行列の横方向を表す行の中で最も左側に位置する改良差分値KHyxに決定される。求められる改良差分値KHyxが決定されると、ステップ103に移る。そしてステップ103では、予測値Eyxが128以上であるか否かが判定される。
【0067】
ステップ103において予測値Eyxが128以上であると判断されると、ステップ104に移る。ステップ104では、画素値Pyxが(1)式
yx<2×Eyx−255 ・・・・・(1)
を満たすか否かが判定される。画素値Pyxが(1)式を満たすと判断されると、ステップ106に移る。画素値Pyxが(1)式を満たさないと判断されると、ステップ105に移り、改良差分値KHyxが(2)式で求められ、ステップ113に移る。
KHyx=Eyx−Pyx ・・・・・(2)
【0068】
ステップ106では、画素値Pyxが偶数であるか否かが判断される。画素値Pyxが偶数であると判断されるとステップ107に移り、改良差分値KHyxが(3)式で求められる。
KHyx=Pyx/2−128 ・・・・・(3)
画素値Pyxが偶数ではないと判断されるとステップ108に移り、改良差分値KHyxが(4)式で求められる。
KHyx=128−(Pyx+1)/2 ・・・・(4)
改良差分値KHyxが求められると、ステップ113に移る。
【0069】
例えば、予測値E61(=175)に対する画素値P61(=19)は奇数であるから、改良差分値KH61は(4)式より
KH61=128−(19+1)/2=118
である。
【0070】
ステップ103において予測値Eyxが128以上ではないと判断されるとステップ109に移る。ステップ109では、画素値Pyxが(5)式を満たすか否かが判断される。
yx>2×Eyx ・・・・・(5)
画素値Pyxが(5)式を満たすと判断されるとステップ110に移る。画素値Pyxが上式を満たさないと判断されるとステップ105に移り、改良差分値KHyxは(2)式で求められ、ステップ113に移る。
【0071】
ステップ110では、画素値Pyxが偶数であるか否かが判定される。画素値Pyxが偶数でないと判断されるとステップ111に移り、改良差分値KHyxは(6)式で求められる。
KHyx=−(Pyx+1)/2 ・・・・・(6)
画素値Pyxが偶数であると判断されるとステップ112に移り、改良差分値KHyxが(7)式で求められる。
KHyx=Pyx/2 ・・・・・(7)
改良差分値KHyxが求められると、ステップ113に移る。
【0072】
例えば、予測値E17(=14)に対する画素値P17(=132)は偶数であることから、改良差分値KH17は(7)式より
KH17=132/2=66
となる。
【0073】
ステップ113では、添字xに1が加算される。すなわち、求められる改良差分値KHyxが1つ右隣の改良差分値KHyxに決定される。
【0074】
ステップ114では、添字xが8であるか否かが判定される。すなわち、1つ改良差分値KHyxが1つの行においてすべて求められたか否かが判定される。添字xが8であると判断されるとステップ115に移り、添字xが8でないと判断されるとステップ103に戻る。
【0075】
ステップ115では、添字yに1が加算される。すなわち、求められる改良差分値KHyxが1つ下の行の改良差分値KHyxに決定される。
【0076】
ステップ116では、添字yが8であるか否かが判定される。すなわち、改良差分値KHyxがすべて求められたか否か判定される。添字yが8であると判定されると改良差分値行列KHを求める演算は終了する。添字yが8でないと判断されるとステップ102に戻る。なお、1画面におけるすべての画素ブロックPに対してこのような改良差分値行列KHを求める演算が行われる。
【0077】
以上のように圧縮処理において差分値Hyxの代わりに改良差分値KHyxを符号化することにより、画像データを符号化するのに必要な情報量が少なくて済み、画像を効率的に圧縮することができる。
【0078】
図8は、本発明の第1の実施形態を適用した画像伸張装置のブロック図である。この画像圧縮装置では、第1の実施形態における画像圧縮装置によって圧縮された画像データを復元する。
【0079】
圧縮画像データは、記録媒体Mから読み出され、画像伸張装置20に送られる。画像伸張装置20は、ハフマン復号化部21、グループ合成部22、差分値復元部23、画素データ復元部24、予測値生成部25から構成されている。
【0080】
記録媒体Mに記録された輝度データYおよび色差データCb,Crの圧縮画像データは、ハフマン復号化部21において復号化される。すなわち、ハフマンテーブルHを参照することにより、付加ビットを除いた符号化データからグループ番号が求められる。なおハフマン符号化部21では、圧縮画像データに対するエントロピー復号化が行われ、ここではエントロピー復号化の一つであるハフマン復号化が適用される。
【0081】
復号化により得られたグループ番号と付加ビットに基いてグループ表Tを参照することにより、改良差分値KHyxがグループ合成部22において求められる。なお、ハフマン復号化とグループ合成部22において改良差分値を求めることを、ここでは復号化とする。そして輝度データYおよび色差データCb,Crの改良差分値は、差分値復元部23において差分値に変換される。
【0082】
この差分値と予測値生成部25において生成される予測値を用いることにより、画素データが画素データ復元部24において生成される。すなわち、すでに復元された画素データに基いて生成された予測値と差分値との差から画素データが求められる。求められた画素データは予測値生成部25に送られ、次に復元される画素データに対する予測値の算出に用いられる。
【0083】
順次画素データが復元されることにより、輝度データYおよび色差データCb,Crの画像データが復元され、画像データが画像メモリ19に送られる。
【0084】
図9を用いて圧縮画像データの伸張処理について説明する。ここでは、輝度データYの圧縮画像データを対象としている。
【0085】
図9には、改良差分値行列KHと差分値行列Hと予測値行列Eと画素ブロックPが8×8のマトリクスで示されている。各マトリクスの要素は、それぞれ改良差分値KHyx、差分値Hyx、予測値Eyx、画素値Pyxと表される。
【0086】
圧縮画像データは、ハフマンテーブルHとグループ表Tに基いて復号化され、改良差分値KHyxに変換される。
【0087】
。予測値Eyxにおける改良差分値KHyxのとりうる範囲と差分値Hyxのとりうる範囲を対応させることにより、改良差分値KHyxから差分値Hyxが復元される。例えば予測値EyxがE44(=167)のとき、改良差分値KH44(=116)は差分値H44(=144)に復元される。
【0088】
差分値Hyxとそれに対応する予測値Eyxから、画素値Pyxが求められる。すなわち、予測値Eyxから差分値Hyxが引き算されることで、画素値Pyxが求められる。画素値Pyxは、画素ブロックPにおいて1つずつ復元され、復元された画素値Pyxが次に復元される画素値Pyxに対する予測値Eyxとなる。
【0089】
例えば、予測値E44(=167)から差分値H44(=144)が引き算されることにより、画素値P44(=23)が求められる。画素値P44は、次に復元される画素値P45に対する予測値E45(=23)となる。
【0090】
このように順次画素値Pyxが復元されることにより、1つの画素ブロックPが復元される。
【0091】
図10は、改良差分値KHyxと予測値Eyxに基いて画素値Pyxを求める手順を示したフローチャートである。図9、図10を用いて1つの画素ブロックPを求める手順を説明する。
【0092】
ステップ201では、添字yが0に設定される。ステップ202では、添字xが0に設定され、復元される画素値Pyxが行列の横方向を表す行の中で最も左側の画素値Pyxに決定される。復元される画素値Pyxが決定されるとステップ203に移り、予測値Eyxが128以上であるか否かが判定される。
【0093】
ステップ203において、予測値Eyxが128以上であると判断されると、ステップ204に移る。 ステップ204では改良差分値KHyxが(8)式を満たすか否かが判定される。
yx−255≦KHyx≦255−Eyx ・・・・(8)
改良差分値KHyxが(8)式を満たすと判断されると、ステップ205に移り、画素値Pyxが(9)式で求められる。
yx=Eyx−KHyx ・・・・(9)
画素値Pyxが求められると、ステップ213に移る。
【0094】
例えば、改良差分値KH32(=7)に対する予測値E32(=168)は、(8)式を満たすことから、画素値P32は(9)式より
32=168−7=161
となる。
【0095】
ステップ204において(8)式を満たさないと判断されると、ステップ206に移り、改良差分値KHyxが0以上であるか否かが判定される。改良差分値KHyxが0以上であると判定されるとステップ208に移り、画素値Pyxが(10)式で求められる。
yx=255−2×KHyx ・・・・・(10)
改良差分値KHyxが0以上ではない判断されると、ステップ207に移り、画素値Pyxが(11)式で求められる。
yx=KHyx×2+256 ・・・・・(11)
画素値Pyxが求められるとステップ213に移る。
【0096】
ステップ203において予測値Eyxが128以上でないと判断されるとステップ209に移る。ステップ209では、改良差分値KHyxが(12)式を満たすか否かが判定される。
−Eyx≦KHyx≦Eyx ・・・・・(12)
改良差分値Eが(12)式を満たすと判断されるとステップ205に移り、(9)式により画素値Pyxが求められる。改良差分値KHyxが(12)式を満たさないと判断されるとステップ210に移る。
【0097】
ステップ210では、改良差分値KHyxが0以上であるか否かが判断される。改良差分値KHyxが0以上であると判断されると、ステップ212に移り画素値Pyxが(13)式で求められる。
yx=2×KHyx ・・・・・(13)
改良差分値KHyxが0以上でないと判断されるとステップ211に移り画素値Pyxが(14)式で求められる。
yx=−2×KHyx−1 ・・・・・(14)
画素値Pyxが求められると、ステップ213に移る。
【0098】
例えば、予測値E17(=14)に対する改良差分値KH17(=66)は0以上であるから、画素値P17は(13)式より
17=2×66=132
となる。
【0099】
ステップ213では、添字xに1が加算される。すなわち、復元される画素値Pyxが1つ右隣の画素値Pyxに決定される。
【0100】
ステップ214では、添字xが8であるか否かが判定される。すなわち、画素値Pyxが1つの行においてすべて復元されたか否かが判定される。添字xが8であると判断されるとステップ215に移り、添字xが8でないと判断されるとステップ203に戻る。
【0101】
ステップ215では、添字yに1が加算される。すなわち、復元される画素値Pyxが1つ下の行の画素値Pyxに決定される。
【0102】
ステップ216では、添字yが8であるか否かが判定される。すなわち、1つの画素ブロックPにおいて画素値Pyxがすべて復元されたか否かが判定される。添字yが8であると判定されると画素値Pyxを復元する演算は終了する。添字yが8でないと判断されるとステップ202に戻る。なお、1画面におけるすべての改良差分値行列KHyxに対してこのような画素ブロックPを求める演算が行われる。
【0103】
以上のように第1の実施形態によれば、差分値Hyxの代わりに改良差分値KHyxを符号化することにより、圧縮画像データの情報量が少なくて済み、画像を効率的に圧縮することができる。また改良差分値KHyxから画素値Pyxを復元することにより無歪みで画像を伸張することができる。
【0104】
図11〜図18は、第2の実施形態例である画像圧縮装置および画像伸張装置に関する図である。
【0105】
図11は、第2の実施形態例を適用した画像圧縮装置のブロック図である。
【0106】
第1の実施形態と同じように被写体像16の光がレンズ17を介して撮像素子18に結像される。撮像素子18において光電変換により発生した画像信号はA/D変換器および信号処理回路においてそれぞれ処理されて輝度データYおよび色差データCb,Crに変換され、画像データとして画像メモリ19に記録される。輝度データYおよび色差データCb,Crの画像データは画像メモリ19から読み出され、画像圧縮装置30に送られる。画像圧縮装置30は、予測値生成部31、差分値生成部32、改良差分値生成部33、ビット分離部34、グループ部35、ハフマン符号化部36から構成されている。
【0107】
輝度データYおよび色差データCb、Crの画像データは、1画面において複数のブロックに分割され、ブロック単位で処理される。各ブロックは、8×8個の画素データからなる。
【0108】
各ブロックにおける輝度データYおよび色差データCb,Crの画素データに基き、予測値が予測値生成部31において求められる。予測値は、符号化対象である1つの画素データに隣接する画素データに基づいて求められる。
【0109】
輝度データYおよび色差データCb,Crの画素データは、差分値生成部32において差分値に変換される。すなわち、予測値生成部31において得られた予測値から画素データが引き算されることにより、差分値が求められる。
【0110】
輝度データYおよび色差データCb,Crの差分値は、改良差分値生成部33において改良差分値に変換される。
【0111】
輝度データYおよび色差データCb,Crは、画像圧縮装置30内においてビット列で表され、輝度データYおよび色差データCb,Crの改良差分値もビット列で表される。改良差分値のビット列は、ビット分離部34において上位改良差分値のビット列(上位ビット列)と下位改良差分値のビット列(下位ビット列)に分離される。上位改良差分値はグループ部35に送られるが、下位改良差分値は符号化されずに記録媒体Mの下位記録領域M2に記録される。
【0112】
輝度データYおよび色差データCb,Crの上位改良差分値は、グループ部35においてグループ表Tに基いてグループ分けされ、上位改良差分値が属するグループのグループ番号とそれに対応した付加ビットが求められる。
【0113】
グループ部35において得られたグループ番号に基いてハフマンテーブルHを参照することにより、符号語がハフマン符号化部36において求められる。そして、符号語とグループ部35において得られた付加ビットを組み合わせた圧縮画像データが、記録媒体Mの圧縮画像データ記録領域M1に記録される。
【0114】
図12を用いて画素ブロックPに対する圧縮処理を説明する。
【0115】
図12には、改良差分値行列KHと、上位改良差分値行列DHと、下位改良差分値行列DLがそれぞれ8×8のマトリクスで例示されている。各マトリクスの要素は、それぞれ改良差分値KHyx、上位改良差分値DHyx、下位改良差分値DLyxと表される。なお、改良差分値行列KHは、第1の実施形態例の図2で示された改良差分値行列KHであり、画素値Pyxから改良差分値KHyxへの圧縮処理に関しては第1の実施形態と同じであるためここでは省略する。
【0116】
改良差分値KHyxのビット列は、ビット分離により上位ビット列と下位ビット列に分離され、上位ビット列で表される上位改良差分値DHyxと下位ビット列で表される下位改良差分値DLyxが求められる。ここでは、ビット分離されるビット数は1ビットであり、1ビットに対してもビット列として表す。
【0117】
例えば、改良差分値KH01(=6)のビット列は、ビット分離により上位ビット列と下位ビット列に分離され、上位ビット列で表される上位改良差分値DH01(=3)と下位ビット列で表される下位改良差分値DL01(=0)が求められる。ビット分離に関しては後述する。
【0118】
ビット分離により得られた上位改良差分値DHyxは、グループ表およびハフマンテーブルHに基いてグループ分けおよびハフマン符号化される。このとき、上位改良差分値DHyxは改良差分値KHyxに比べ小さい値となる。そのため、ハフマン符号化する前に実行されるジグザグスキャンにより並べられた上位改良差分値KHyxの1次元の列では、ゼロランの出現頻度が増え、ゼロラン長(ゼロランの長さ)が長くなる。したがって、上位改良差分値KHyxに対するグループ分けおよびハフマン符号化により得られる符号化データのビット数は、改良差分値Hyxに比べて少ない。すなわち、符号化データに必要な情報量が少なくて済む。
【0119】
図12、図13を用いて1ビットのビット分離を詳述する。そのため、改良差分値KHyxをビット列で表す。1つの改良差分値KHyxには、通常8ビットが割り当てられるが、ここでは16ビットを割り当てる。改良差分値KHyxは正負の値をとり、16ビットにおいて1ビットが符号ビットとして使用される。
【0120】
図13では、図12の改良差分値KH01(=6)に対するビット分離を示している。改良差分値KH01(=6)は、2進法で表すと「00000110」であり、符号ビットFは正を示す「0」である。16ビットのビット列B0において、2進数「00000110」は右端からの8ビットを使用して表される。「0」である符号ビットFは、ビット列B0の左端にある最上位ビットに置かれる。改良差分値KH01(=6)が正の値であるため、使用されていない7ビットJ0は「0000000」である。
【0121】
ビット分離の実行により、改良差分値KH01(=6)のビット列は、右シフト演算される。右シフト演算とは、ビット列における各ビットを指定されたビット数だけ右に桁移動させる演算である。1ビットの右シフト演算が実行されると、各ビットが右に1つずつ移動させられ、「0」である右端の最下位ビットKは分離される。そして右シフト演算により空白になった左端の最上位ビットには、「0」である符号ビットFが埋められる。
【0122】
このようにして、ビット列B0は右シフト演算により7ビットを使用して2進数「0000011」が表されるビット列B1に変換される。このビット列B1が上位ビット列であり、2進数「「00000011」を10進法で表した値が上位改良差分値DH01の値となる。すなわち、上位改良差分値DH01の値は3である。
【0123】
一方、右シフト演算により分離された最下位ビットKが下位ビット列であり、2進数「0」を10進法で表した値が、下位改良差分値DL01の値である。すなわち、下位改良差分値DL01の値は0である。
【0124】
このように改良差分値KH01(=6)のビット列B0は、ビット分離により上位ビット列であるビット列B1と下位ビット列である最下位ビットKに分離され、上位改良差分値DH01(=3)と下位改良差分値DL01(=0)が求められる。
【0125】
以上のようなビット分離の実行により、改良差分値KHyxのビット列が上位ビット列と下位ビット列に分離され、上位ビット列で表される上位改良差分値DHyxと下位ビット列で表される下位改良差分値DLyxが求められる。
【0126】
負である改良差分値KHyxに対しても同じようにビット分離される。ただし、符号ビットFは負を示す「」であり、使用されない7ビットJ0は「1111111」である。また、2ビット、3ビットのビット分離を実行する場合、2ビット、3ビットの右シフト演算が実行される。
【0127】
図14は、改良差分値KHに対するnビットのビット分離の手順を示したフローチャートである。図12、図14を用いてビット分離のフローチャートを説明する。
【0128】
ステップ301では、添字yが0に設定される。ステップ302では、添字xが0に設定され、行列の横方向を表す行の中で最も左側の改良差分値KHyxがビット分離の対象とされる。改良差分値KH00が(=2)が最初のビット分離の対象である。
【0129】
ステップ303では、改良差分値KHyxに対してnビットのビット分離を実行するためにnビットの右シフト演算が実行され、上位改良差分値DHyxが求められる。
【0130】
例えば1ビットのビット分離の場合、改良差分値KH01(=6)のビット列が1ビット右シフト演算され、上位改良差分値DH01(=3)が求められる。また3ビットのビット分離の場合、改良差分値KH01(=6)のビット列が3ビット右シフト演算され、上位改良差分値DH01(=0)が求められる。
【0131】
ステップ304では、下位改良差分値DLyxが求められる。下位改良差分値DLyxを求める算術式は、(15)式のようになる。
【0132】
DLyx=KHyx−(DHyx×2n ) ・・・・・・(15)
【0133】
例えば1ビットのビット分離の場合、改良差分値KH01(=6)に対する上位改良差分値DH01の値は3であることから、下位改良差分値DL01は、
DL01=6−(3×21 )=0
となる。
【0134】
また3ビットのビット分離の場合、改良差分値KH01(=6)に対する上位改良差分値DH01の値は0であることから、下位改良差分値DL01は、
DL01=6−(0×23 )=6
となる。
【0135】
ステップ305では、添字xに1が加算される。すなわち、1つ右隣の改良差分値KHyxがビット分離の対象とされる。
【0136】
ステップ306では、添字xが8であるか否かが判定される。すなわち、1つの行に対してすべての改良差分値KHyxがビット分離されたか否かが判定される。添字xが8であると判断されるとステップ307に移り、添字xが8でないと判断されるとステップ303に戻る。
【0137】
ステップ307では、添字yに1が加算される。すなわち、1つ下の行の改良差分値KHyxがビット分離の対象とされる。
【0138】
ステップ308では、添字yが8であるか否かが判定される。すなわち、すべての改良差分値KHyxがビット分離されたか否か判定される。添字yが8であると判定されると一連のビット分離は終了する。添字yが8でないと判断されるとステップ302に戻る。
【0139】
このように第2実施形態では第1実施形態と違って改良差分値KHyxを得た後にビット分離を実行して、ビット分離により得られる上位改良差分値を符号化する。圧縮処理においてビット分離を実行することにより、符号化データに必要な情報量が少なくて済むため、画像を効率的に圧縮することができる。
【0140】
図15は、第2の実施形態で適用される画像伸張装置のブロック図である。この画像伸張装置では第2の実施形態における画像圧縮装置によって圧縮された画像データを復元する。
【0141】
輝度データYおよび色差データCb,Crの圧縮画像データは記録媒体Mの圧縮画像データ記録領域M1から読み出され、画像伸張装置40に送られる。画像伸張装置40は、ハフマン復号化部41、グループ合成部42、ビット合成部43、差分値復元部44、画素データ復元部45、予測値生成部46から構成されている。
【0142】
輝度データYおよび色差データCb,Crの圧縮画像データから付加ビットを除いた符号語は、ハフマン復号化部41において復号化される。すなわち、ハフマンテーブルHを参照することにより符号語からグループ番号が求められる。この復号化はハフマン符号化とは逆の作用である。
【0143】
復号化により得られたグループ番号と付加ビットに基いてグループ表Tを参照することにより、上位改良差分値がグループ合成部42において求められる。
【0144】
輝度データYおよび色差データCb、Crの上位改良差分値と記録媒体Mの下位記録領域M2から読み出された下位改良差分値がビット合成部43においてビット合成され、改良差分値が復元される。
【0145】
輝度データYおよび色差データCb,Crの改良差分値は、差分値復元部44において差分値に変換される。この差分値と予測値生成部46において生成される予測値を用いることにより、画素データが画素データ復元部45において生成される。すなわち、すでに復元された画素データに基いて生成された予測値と差分値との差から画素データが求められる。求められた画素データは予測値生成部46に送られ、次に復元される画素データに対する予測値の算出に用いられる。
【0146】
順次画素データが復元されることにより、輝度データYおよび色差データCb,Crの画像データが復元され、画像データは画像メモリ19に送られる。
【0147】
図16を用いて、輝度データYの圧縮画像データに対する伸張処理を説明する。
【0148】
図16には、上位改良差分値行列DHと下位改良差分値行列DLと改良差分値行列KHが8×8のマトリクスで例示されいてる。各マトリクスの要素は、それぞれ上位改良差分値DHyx、下位改良差分値DLyx、改良差分値KHyxと表される。
【0149】
上位改良差分値とそれに対応する下位改良差分値DL yx がビット合成され、改良差分値KHyxが復元される。ビット合成されるビット数は、ここでは1ビットである。
【0150】
例えば、上位改良差分値DH01(=3)と下位改良差分値DL01(=0)がビット合成され、改良差分値KH01(=6)が復元される。ビット合成に関しては、後述する。
【0151】
改良差分値KHから画像データまでの伸張処理に関しては図2で示したように第1の実施形態例と同じであるためここでは省略する。
【0152】
図16、図17を用いて、nビットのビット合成を詳述する。そのため、上位改良差分値DHyxをビット列で表す。
【0153】
図17では、上位改良差分値DH01(=3)と下位改良差分値DL01(=0)に対する1ビットのビット合成を示している。
【0154】
上位改良差分値DH01(=3)は、図13で示したように16ビットのビット列B1で表される。下位改良差分値DL01(=0)は2進数で「0」であり、下位ビット列K1で表される。
【0155】
ビット合成の実行により、上位改良差分値DH01(=3)のビット列B1は、左シフト演算される。左シフト演算は、各ビットを指定されたビット数だけ左に桁移動させる演算である。1ビットの左シフト演算が実行されると、各ビットが左に1つずつ移動させられ、左端の「0」である符号ビットFが分離される。そして左シフト演算によって空白になった右端の最下位ビットには、「0」である下位ビット列K1が当てはめられる。また、左端から2番目の「0」であるビットF0が左端の最上位ビットに移動され、符号ビットFとなる。
【0156】
左シフト演算により、ビット列B1は8ビットを使用して2進数「00000110」が表されるビット列B0に変換される。そして2進数「00000110」を10進法で表した値が改良差分値KH01となる。すなわち、改良差分値KH01の値は6である。
【0157】
このように、上位改良差分値DH01(=3)と下位改良差分値DL01(=0)ビット合成され、改良差分値KH01(=6)が復元される。
【0158】
なお、2ビット、3ビットのビット合成を実行する場合、2ビット、3ビットの左シフト演算が実行される。
【0159】
図18は、上位改良差分値DHyxと下位改良差分値DLyxに対するnビットのビット合成の手順を示したフローチャートである。図16、図18を用いてビット合成のフローチャートを説明する。
【0160】
ステップ401では、縦方向の位置を表すyが0に設定される。ステップ402では、横方向の位置を表す添字xが0に設定され、行列の横方向を表す行の中でもっとも左側の上位改良差分値DHyxと下位改良差分値DLyxがビット合成の対象とされる。上位改良差分値DH00と下位改良差分値DL00が最初のビット合成の対象である。
【0161】
ステップ403では、上位改良差分値DHyxに対してnビットの左シフト演算が実行され、改良差分値KHyxが求められる。改良差分値KHyxを求める算術式は、(16)式のようになる。
【0162】
KHyx=DHyx×2n +DLyx ・・・・・・(16)
【0163】
例えば、1ビットのビット合成の場合、上位改良差分値DH01(=3)と下位改良差分値DL01(=0)に対して改良差分値KH01の値は、
01=3×21 +0=6
となる。
【0164】
例えば、3ビットのビット合成の場合、上位改良差分値DH01(=0)と下位改良差分値DL01(=6)に対して改良差分値KH01の値は
01=0×23 +6=6
となる。
【0165】
ステップ404では、添字xに1が加算される。これによりビット合成される対象の上位改良差分値DHyxと下位改良差分値DLyxが1つ右隣の上位改良差分値DHyxと下位改良差分値DLyxに移される。
【0166】
ステップ405では、添字xが8であるか否かが判定される。すなわち、横方向の1つの行に関して全ての上位改良差分値DHyxと下位改良差分値DLyxがビット合成されたか否かが判定される。添字xが8であると判定されるとステップ406に移る。添字xが8でないと判定されるとステップ403に戻る。
【0167】
ステップ406では、添字jに1が加算される。すなわち、ビット合成される対象の上位改良差分値DHyxと下位改良差分値DLyxが、1つ下の行の上位改良差分値DHyxと下位改良差分値DLyxに移される。
【0168】
ステップ407では、添字yが8であるか否かが判定される。すなわち、全ての上位改良差分値DHyxと下位改良差分値DLyxがビット合成されたか否かが判定される。添字yが8であると判定されると、1つの上位改良差分値行列DHと下位改良差分値行列DLに対するビット合成は終了する。添字yが8でないと判定されると、ステップ402に戻る。
【0169】
以上のように第2の実施形態によれば、ビット分離を実行して改良差分値を上位改良差分値DHyxと下位改良差分値DLyxに分離することにより、符号化データに必要な情報量を少なくすることができる。すなわち、画像を効率的に圧縮することができる。また、ビット合成を実行して上位改良差分値DHyxと下位改良差分値DLyxから改良差分値KHyxを復元することにより、無歪みで画像を復元することができる。
【0170】
図19〜図26は、第3の実施形態である画像圧縮装置および画像伸張装置に関する図である。
【0171】
図19は、第3の実施形態である画像圧縮装置のブロック図である。
【0172】
第1の実施形態と同様に被写体像16の光はレンズ17を介して撮像素子18上に結像され、撮像素子18において光電変換により画像信号が発生する。画像信号はA/D変換器においてアナログ信号からデジタル信号に変換され、また信号処理回路(図示せず)において輝度データYおよび色差データCb,Crに変換される。輝度データYおよび色差データCb,Crは画像データとして画像メモリ19に記録される。
【0173】
輝度データYおよび色差データCb、Crの画像データは、1画面において複数のブロックに分割され、ブロック単位で処理される。各ブロックは、8×8個の画素データからなる。
【0174】
輝度データYおよび色差データCb,Crの画像データは、画像メモリ19から読み出され、画像圧縮装置50に送られる。画像圧縮装置50は、ビット分離部51、予測値生成部52、差分値生成部53、改良差分値生成部54、グループ部55、ハフマン符号化部56から構成されている。
【0175】
2進数のビット列で表される輝度データYおよび色差データCb,Crの画像データは、ビット分離部51において上位画像データと下位画像データに分離される。そして下位画像データは、圧縮処理されずにそのまま記録媒体Mの下位記録領域M2に記録される。
【0176】
各ブロックにおける輝度データYおよび色差データCb,Crの上位画素データに基き、予測値が予測値生成部52において求められる。予測値は、符号化(圧縮)対象である上位画素データの値を隣接する上位画素データを基にして予測した値である。
【0177】
輝度データYおよび色差データCb,Crの上位画素データは、差分値生成部53において差分値に変換される。この差分値は、予測値生成部52において得られた予測値から実際の画素データの値が引き算されることにより求められる。
【0178】
差分値は改良差分値生成部54において改良差分値に変換される。改良差分値は、画素データと予測値に基いて算出され、差分値の代わりに符号化の対象とされる。
【0179】
輝度データYおよび色差データCb,Crの改良差分値は、グループ部55においてグループ表Tに基いてグループ分けされ、改良差分値が属するグループのグループ番号とそのグループ番号に対応した付加ビットが求められる。
【0180】
グループ部55において得られたグループ番号に基いてハフマンテーブルHを参照することにより、符号語がハフマン符号化部56において求められる。そして、符号語とグループ部55において得られた付加ビットを組み合わせた圧縮画像データ(符号化データ)が、記録媒体Mに記録される。
【0181】
図20、図21を用いて1つの画素ブロックに対する圧縮処理を説明する。ただし、輝度データYの画素ブロックを対象とする。
【0182】
図20には、画素ブロックPと、上位画素ブロックPHと、下位画素ブロックPLとがそれぞれ8×8のマトリクスで示されている。各マトリクスの要素は、それぞれ画素値Pyx、上位画素値PHyx、下位画素値PLyxと表される。
【0183】
各画素値Pyxのビット列はビット分離によって上位ビット列と下位ビット列に分離され、上位ビット列で表される上位画素値PHyxと下位ビット列で表される下位画素値PLyxが求められる。ビット分離されるビット数は、ここでは1ビットである。
【0184】
例えば画素値P01(=153)は、ビット分離により上位ビット列と下位ビット列に分離され、上位ビット列で表される上位画素値PH01(=76)と下位ビット列で表される下位画素値PL01(=1)が求められる。
【0185】
図21では、上位画素ブロックPHと予測値行列Eと差分値行列Hと改良差分値行列KHが8×8のマトリクスで例示されている。各マトリクスの要素は、それぞれ上位画素値PHyx、予測値Eyx、差分値Hyx、改良差分値KHyxと表される。
【0186】
第1の実施形態と同じようにように上位画素値PHyxに基いて予測値Eyxが求められる。ここでは符号化対象の上位画素値PHyxの1つ左隣の上位画素値PHyx-1の値が、そのまま予測値Eyxとなる。
【0187】
例えば、符号化対象である上位画素値PH01(=76)の1つ左隣である上位画素値P00(=79)が予測値E01(=79)となる。
【0188】
次に予測値Eyxとそれに対応する実際の上位画素値PHyxに基き、上位画素値PHyxが差分値Hyxに変換される。すなわち、予測値Eから上位画素値Pyxが引き算されて、差分値Hyxが求められる。
【0189】
例えば、予測値E01(=79)から上位画素値P01=(76)が引き算されることにより、差分値H01(=3)が求められる。
【0190】
差分値Hyxは、予測値Eyxと画素値Pyxに基いて改良差分値KHyxに変換される。改良差分値KHyxは、−64〜63の範囲のいずれかの値であり、差分値Hyxの代わりに符号化の対象とされる。例えば、差分値H22(=69)は、改良差分値KH22(=56)に変換される。
【0191】
改良差分値KHは、グループ表TおよびハフマンテーブルHに基いてグループ分けおよびハフマン符号化され、これにより符号化データが求められる。
【0192】
図22は、上位画素ブロックPHに対してnビットのビット分離が実行された場合に1つの改良差分値行列KHを求める手順を示したフローチャートである。図21、図22を用いて改良差分値KHyxを求める手順を説明する。
【0193】
ステップ501では、添字yが0に設定される。ステップ502では、添字xが0に設定され、求められる改良差分値KHyxが行列の横方向を表す行の中で最も左側の改良差分値KHyxに決定される。すなわち、改良差分値KH00(=1)が最初に求められる。求められる改良差分値KHyxが決定されるとステップ503に移り、予測値Eyxの値が27-n 以上であるか否かが判定される。
【0194】
ステップ503において予測値Eyxが27-n 以上であると判断されるとステップ504に移る。ステップ504では、上位画素値PHyxが(17)式
PHyx<2×Eyx−28-n +1 ・・・・・(17)
を満たすか否かが判定される。上位画素値PHyxが(17)式を満たすと判断されると、ステップ506に移る。上位画素値PHyxが(17)式を満たさないと判断された場合、ステップ505移り、改良差分値Hyxが(18)式で求められる。
KHyx=Eyx−PHyx ・・・・・(18)
改良差分値KHyxが求められると、ステップ513に移る。
【0195】
ステップ506では、上位画素値PHyxが偶数であるか否かが判断される。上位画素値PHyxが偶数であると判断されるとステップ507に移り、改良差分値KHyxが(19)式で求められる。
KHyx=PHyx/2−27-n ・・・・・(19)
上位画素値PHyxが偶数ではないと判断されるとステップ508に移り、改良差分値KHyxが(20)式で求められる。
KHyx=27-n −(PHyx+1)/2 ・・・・(20)
改良差分値KHyxが求められると、ステップ513に移る。
【0196】
例えば、1ビットのビット分離により得られた奇数である上位画素値PH22(=15)と予測値E22(=84)に対する改良差分値KHyxは(20)式より、
KH22=26 −(15+1)/2=56
である。
【0197】
ステップ503において予測値Eyxが27-n 以上の値ではないと判断されるとステップ509に移る。ステップ509では、上位画素値PHyxが(21)式を満たすか否かが判定される。
PHyx>2×Eyx ・・・・・(21)
上位画素値PHyxが上式を満たすと判断されるとステップ510に移る。上位画素値PHyxが上式を満たさないと判断されるとステップ505に移り、改良差分値KHyxが(18)式で求められる。改良差分値KHyxが求められるとステップ513に移る。
【0198】
ステップ510では、上位画素値PHyxが偶数であるか否かが判定される。上位画素値PHyxが偶数でないと判断されるとステップ511に移り、改良差分値KHyxが(22)式で求められる。
KHyx=−(PHyx+1)/2 ・・・・・(22)
上位画素値PHyxが偶数であると判断されるとステップ512に移り、改良差分値KHyxが(23)式で求められる。
KHyx=PHyx/2 ・・・・・(23)
改良差分値KHyxが求められると、ステップ513に移る。
【0199】
例えば、1ビットのビット分離により得られた奇数である上位画素値PH45(=81)とそれに対応する予測値E45(=11)に対して、改良差分値KHyxは(22)式より、
KH45=−(81+1)/2=−41
となる。
【0200】
ステップ513では、添字xに1が加算される。すなわち、求められる改良差分値KHyxが1つ右隣の改良差分値KHyxに決定される。
【0201】
ステップ514では、添字xが8であるか否かが判定される。すなわち、1つ改良差分値KHyxが1つの行においてすべて求められたか否かが判定される。添字xが8であると判断されるとステップ515に移り、添字xが8でないと判断されるとステップ503に戻る。
【0202】
ステップ515では、添字yに1が加算される。すなわち、求められる改良差分値KHyxが1つ下の行の改良差分値KHyxに決定される。
【0203】
ステップ516では、添字yが8であるか否かが判定される。すなわち、改良差分値KHyxがすべて求められたか否か判定される。添字yが8であると判定されると改良差分値KHyxを求める計算は終了する。添字yが8でないと判断されるとステップ502に戻る。
【0204】
このように第3の実施形態では、第1の実施形態と異なって画素値Pyxに対してビット分離を実行し、ビット分離によりられた上位画素値PHyxに対して圧縮処理を行う。そして改良差分値KHyxはビット分離を行わないで得られる改良差分値KHyxよりも小さい値となり、ゼロラン長が長くなる。このように圧縮処理において画素値Pyxをビット分離することにより、改良差分値KHyxを符号化するの必要な情報量が少なくて済み、効率的に画像を圧縮することができる。
【0205】
図23は、第3の実施形態例である画像伸張装置のブロック図である。
【0206】
輝度データYおよび色差データCb,Crの圧縮画像データは記録媒体Mの圧縮画像データ記録領域M1から読み出され、画像伸張装置60に送られる。画像伸張装置60は、ハフマン復号化部61、グループ合成部62、差分値復元部63、上位画素データ復元部64、ビット合成部65、予測値生成部66から構成されている。
【0207】
輝度データYおよび色差データCb,Crの圧縮画像データから付加ビットを除いた符号語は、ハフマン復号化部61において復号化される。すなわち、符号語に基いてハフマンテーブルHを参照することによりグループ番号が求められる。この復号化はハフマン符号化とは逆の作用である。
【0208】
復号化により得られたグループ番号と付加ビットに基いてグループ表Tを参照することにより、改良差分値がグループ合成部62において求められる。
【0209】
予測値生成部66において生成される予測値に基き、輝度データYおよび色差データCb,Crの改良差分値は差分値復元部63において差分値に変換される。予測値は、上位画素データ復元部64において復元された上位画素データに基いて求められる。
【0210】
輝度データYおよび色差データCb,Crの差分値と予測値に基いて、上位画素データが上位画素データ復元部64において復元される。復元された上位画素データは予測値生成部66に送られ、次に復元される上位画素データに対する予測値の算出に用いられる。
【0211】
上位画素データが復元されることにより、輝度データYおよび色差データCb,Crの上位画像データが復元される。
【0212】
輝度データYおよび色差データCb、Crの上位画像データと記録媒体Mの下位記録領域M2から読み出された下位画像データがビット合成部65においてビット合成され、画像データが復元される。復元された画像データは、画像メモリ19に送られる。
【0213】
図24、図25を用いて圧縮画像データに対する伸張処理を説明する。圧縮画像データは、ここでは輝度データYを対象としている。
【0214】
図24では、改良差分値行列KH、予測値行列E、差分値行列H、上位画素ブロックPHが8×8のマトリクスで例示されている。各マトリクスの要素は、それぞれ改良差分値KHyx、予測値Eyx,差分値Hyx、上位画素値PHyxと表される。
【0215】
ハフマンテーブルHおよびグループ表Tを参照することにより、圧縮画像データから改良差分値KHyxが求められる。そして予測値Eyxにおける改良差分値KHyxのとりうる範囲と差分値Hyxのとりうる範囲が対応されて差分値Hyxが復元される。
【0216】
差分値Hyxと対応する予測値Eyxから上位画素値PHyxが求められる。すなわち、予測値Eyxから差分値Hyxが引き算されることにより、上位画素値PHyxが求められる。
【0217】
例えば予測値E44(=83)から差分値H44(=72)が引き算されることにより、上位画素値PH44(=11)が復元される。
【0218】
復元された上位画素値PHyxは、次に復元対象となる1つ右隣の上位画素値PHyxを算出するための予測値Eyxとなる。そして順次上位画素値PHyxが復元されることにより、上位画素ブロックPHが復元される。
【0219】
図25には、上位画素ブロックPHと下位画素ブロックPLと画素ブロックPが8×8のマトリクスで例示されている。各マトリクスの要素は、それぞれ上位画素値PHyx、下位画素値PLyx、画素値Pyxと表される。
【0220】
上位画素値PHyxとそれに対応する下位画素値PLyxがビット合成され、画素値Pyxが復元される。ビット合成されるビット数は、ここでは1ビットである。
【0221】
例えば上位画素値PH01(=76)と下位画素値PL01(=1)がビット合成されると、画素値P01(=153)が復元される。
【0222】
このように圧縮画像データが伸張処理され、画像ブロックPが復元される。
【0223】
図26は、nビットのビット分離を実行した場合に上位画素値PHyxを求める手順を示したフローチャートである。図24、図26を用いて上位画素値PHyxを求める手順を説明する。
【0224】
ステップ601では、添字yが0に設定される。ステップ602では、添字xが0に設定され、復元される上位画素値PHyxが行列の横方向を表す行の中で最も左側の上位画素値PHyxに決定される。復元される上位画素値PHyxが決定されるとステップ603に移り、予測値Eyxが27-n 以上であるか否かが判定される。
【0225】
ステップ603において、予測値Eyxが27-n 以上であると判断されると、ステップ604に移る。 ステップ604では改良差分値KHyxが(24)式を満たすか否かが判定される。
yx−28-n +1≦KHyx≦28-n −1−Eyx ・・・(24)
改良差分値KHyxが(24)式を満たすと判断されると、ステップ605に移り、上位画素値PHyxが(25)式で求められる。
PHyx=Eyx−KHyx ・・・・・・(25)
上位画素値PHyxが求められると、ステップ613に移る。
【0226】
例えば、1ビットのビット分離が実行された場合に得られる改良差分値KH03(=3)は、予測値E03(=79)であるとき、
80−27 =−48≦3≦27 −80=48
より(24)式を満たす。よって、上位画素値PH03は(25)式より
PH03=79−3=76
である。
【0227】
ステップ604において改良差分値KHyxが(24)式を満たさないと判断されるとステップ606に移り、改良差分値KHyxが0以上であるか否かが判定される。改良差分値KHyxが0以上であると判定されるとステップ608に移り、上位画素値PHyxが(26)式で求められる。
PHyx=28-n −1−2×KHyx ・・・・・(26)
改良差分値KHyxが0以上ではないと判断されるとステップ607に移り、上位画素値PHyxが(27)式で求められる。
PHyx=KHyx×2+28-n ・・・・・(27)
上位画素値PHyxが求められると、ステップ613に移る。
【0228】
ステップ603において予測値Eyxが27-n 以上でないと判断されるとステップ609に移る。ステップ609では、改良差分値KHyxが(28)式の不等式を満たすか否かが判定される。
−Eyx≦KHyx≦Eyx ・・・・・(28)
改良差分値KHyxが(28)式を満たすと判断されるとステップ605に移り、上位画素値PHyxが(25)式で求められる。改良差分値KHyxが(28)式を満たさないと判断されるとステップ610に移る。
【0229】
ステップ610では、改良差分値KHyxが0以上であるか否かが判定される。改良差分値KHyxが0以上であると判断されるとステップ612に移り、上位画素値PHyxが(29)式で求められる。
PHyx=2×KHyx ・・・・・(29)
改良差分値KHyxが0以上でないと判断されるとステップ611に移り、上位画素値PHyxが(30)式で求められる。
PHyx=−2×KHyx−1 ・・・・・(30)
上位画素値PHyxが求められるとステップ613に移る。
【0230】
ステップ613では、添字xに1が加算される。すなわち、復元される上位画素値PHyxが1つ右隣の上位画素値PHyxに決定される。
【0231】
ステップ614では、添字xが8であるか否かが判定される。すなわち、上位画素値PHyxが1つの行においてすべて復元されたか否かが判定される。添字xが8であると判断されるとステップ615に移り、添字xが8でないと判断されるとステップ603に戻る。
【0232】
ステップ615では、添字yに1が加算される。すなわち、復元される上位画素値PHyxが1つ下の行の上位画素値PHyxに決定される。
【0233】
ステップ616では、添字yが8であるか否かが判定される。すなわち、1つの画素ブロックPにおいて上位画素値PHyxがすべて復元されたか否かが判定される。添字yが8であると判定されると上位画素値Pyxを求める計算は終了する。添字yが8でないと判断されるとステップ602に戻る。
【0234】
以上のように第3の実施形態によれば、画素値Pを上位画素値PHと下位画素値PLにビット分離することにより、符号化データに必要な情報量が少なくなり、画像を効率的に圧縮することができる。また、上位画素値PHと下位画素値PLをビット合成することにより、無歪みで画像を復元することができる。
【0235】
図27〜図34は、第4の実施形態例である画像伸張装置および画像圧縮装置に関する図である。
【0236】
図27では、第4の実施形態例である画像圧縮装置のブロック図が示されている。
【0237】
第1の実施形態と同じように被写体像16の光がレンズ17を介して撮像素子18に結像される。撮像素子18において光電変換により発生した画像信号はA/D変換器および信号処理回路においてそれぞれ処理されて輝度データYおよび色差データCb,Crに変換され、画像データとして画像メモリ19に記録される。輝度データYおよび色差データCb,Crの画像データは画像メモリ19から読み出され、画像圧縮装置70に送られる。画像圧縮装置70は、予測値生成部71、差分値生成部72、改良差分値生成部73、ビット分離部74、グループ部75、ハフマン符号化部76から構成されている。
【0238】
輝度データYおよび色差データCb、Crの画像データは、1画面において複数のブロックに分割され、ブロック単位で処理される。各ブロックは、8×8個の画素データからなる。
【0239】
各ブロックにおける輝度データYおよび色差データCb,Crの画素データに基き、予測値が予測値生成部71において求められる。予測値は、符号化対象である1つの画素データに隣接する画素データに基づいて求められる。
【0240】
輝度データYおよび色差データCb,Crの画素データは、差分値生成部72において差分値に変換される。すなわち、予測値生成部71において得られた予測値から画素データが引き算されることにより、差分値が求められる。
【0241】
輝度データYおよび色差データCb,Crの差分値は、改良差分値生成部73において改良差分値に変換される。
【0242】
輝度データYおよび色差データCb,Crは、画像圧縮装置内70において2進数のビット列で表されており、輝度データYおよび色差データCb,Crの改良差分値も2進数のビット列で表される。改良差分値のビット列は、ビット分離部74においてビット分離され、上位改良差分値のビット列(上位ビット列)と下位改良差分値のビット列(下位ビット列)に分離される。そして下位改良差分値のビット列に対して付加符号ビットが付加されることにより、符号付下位改良差分値が求められる。符号付下位改良差分値は、符号化(圧縮)されずに記録媒体Mの符号付下位記録領域M3に記録される。
【0243】
輝度データYおよび色差データCb,Crの上位改良差分値は、グループ部75においてグループ表Tに基いてグループ分けされ、上位改良差分値が属するグループのグループ番号とそれに対応した付加ビットが求められる。
【0244】
グループ部75において得られたグループ番号に基いてハフマンテーブルHを参照することにより、符号語がハフマン符号化部76において求められる。そして、符号語とグループ部75において得られた付加ビットを組み合わせた圧縮画像データが、記録媒体Mの圧縮画像データ記録領域M1に記録される。
【0245】
図28を用いて画素ブロックPに対する圧縮処理を説明する。
【0246】
図28には、改良差分値行列KHと、上位改良差分値行列DHと下位改良差分値行列DLがそれぞれ8×8のマトリクスで例示されている。各マトリクスの要素は、それぞれ改良差分値KHyx、上位改良差分値DHyx、下位改良差分値DLyxと表される。なお改良差分値行列KHは、第1の実施形態例の図2で示された改良差分値行列KHであり、画素値Pyxから改良差分値KHyxへの圧縮処理に関しては第1の実施形態と同じであるためここでは省略する。
【0247】
各改良差分値KHyxは、ビット分離により上位改良差分値DHyxと下位改良差分値DLyxに分離される。すなわち、改良差分値KHyxのビット列が上位ビット列と下位ビット列に分離され、上位ビット列で表される上位改良差分値DHyxと下位ビット列で表される下位改良差分値DLyxが求められる。このとき、正の値である改良差分値KHyxはそのままビット分離されるが、負の値である改良差分値KHyxは−1が掛け算されて正の値に変換された後ビット分離される。ここでビット分離されるビット数は、1ビットである。
【0248】
例えば、上位改良差分値KH02(=−5)のビット列は、−1が掛け算されて値が5に変換された後に上位ビット列と下位ビット列に分離され、上位ビット列で表される上位改良差分値DH02(=2)と下位ビット列で表される下位改良差分値DL02(=1)が求められる。
【0249】
そして下位改良差分値DLyxの下位ビット列に対し、 付加符号ビットが付加される。このとき、正の値である改良差分値KHyxのビット列がビット分離されたときには正の付加符号ビット(+)、負の値である改良差分値KHyxのビット列がビット分離されたときには負の付加符号ビット(−)が、下位改良差分値DLyxに付加される。正または負の付加符号ビットが付加された下位改良差分値DLyxを符号付下位改良差分値FLyxとして表す。
【0250】
例えば下位改良差分値DL02(=1)のビット列に負の付加符号ビット(−)が付加されることにより、符号付下位改良差分値FL02(=(−)1)が求められる。ただし、符号付下位改良差分値FL02の値が−1であるのではなく、1の値に付加符号ビット(−)が付加されていることを表している。
【0251】
上位改良差分値DHyxはグループ分けおよびハフマン符号化され、これにより圧縮画像データが求められる。
【0252】
図28、29を用いて付加符号ビットを取り入れたビット分離について詳述する。そのため、改良差分値KHyxをビット列で表す。通常改良差分値KHyxには8ビットが割り当てられるが、ここでは16ビットのビット列において8ビット割り当てられていることにする。また、改良差分値KHyxは正負の値をとるため正または負の符号ビットが設けられる。
【0253】
図29では、改良差分値KH02(=−5)に対する1ビットのビット分離を示している。
【0254】
改良差分値KH02(=−5)は、2進法で表すと「11111011」であり、符号ビットFは負を示す「1」である。16ビットのビット列において2進数「11111011」は右端から8ビットを使用して表され、符号ビットFはビット列A0の左端にある最上位ビットに置かれる。なお、使用されていない7ビットJ0は「1111111」である。
【0255】
改良差分値KH02(=−5)は、−1が掛け算されることで値が5に変換され、それによりビット列A0はビット列A1に変換される。ビット列A1において、8ビットを使用して2進数「00000101」が表され、符号ビットFは正を示す「0」である。更に使用されていない7ビットJ0は「0000000」となる。
【0256】
ビット分離の実行により、ビット列A1は右シフト演算される。右シフト演算とは、ビット列の各ビットを指定されたビット数だけ右に桁移動させ演算である。1ビットの右シフト演算が実行されると、各ビットが右に1つずつ移動させられ、「1」である最下位ビットKは分離される。そして右シフト演算により空白になる左端の最上位ビットには「0」である符号ビットFが当てはめられる。
【0257】
このような右シフト演算により、ビット列A1は7ビットを使用して2進数「0000010」が表されるビット列A2に変換される。このビット列A2が上位ビット列であり、2進数「0000010」を10進法で表した値が上位改良差分値DH02の値となる。すなわち、上位改良差分値DH02の値は2である。
【0258】
一方、右シフト演算により分離された最下位ビットKが下位ビット列であり、最下位ビットKの値が下位改良差分値DL02の値となる。2進数「1」は10進法で1であるから、下位改良差分値DL02の値は1である。
【0259】
改良差分値KH02(=−5)が負の値であるため、下位改良差分値DL02(=1)に対して付加符号ビットF(−)が付加され、符号付下位改良差分値FL02(=(−)1)が求められる。付加符号ビットF(−)は、負を示す「1」である。
【0260】
このように改良差分値KH02(=−5)のビット列は、−1が掛け算されて値が5に変換された後ビット分離され、上位ビット列で表される上位改良差分値DH02(=2)と下位ビット列で表される下位量改良差分値DL02(=1)が求められる。そして、下位改良差分値DL02(=1)のビット列に対して負の付加符号ビットF(−)が付加され、符号付下位改良差分値FL02(=(−)1)が求められる。
【0261】
正の値である改良差分値KHyxに対してビット分離を実行する場合、改良差分値KHyxはそのままビット分離される。そしてビット分離により得られる下位改良差分値DLyxに対して正の付加符号ビットF(+)が付加される。付加符号ビットF(+)は、正を示す「0」である。
【0262】
以上のように改良差分値KHyxのビット列は、上位ビット列と下位ビット列に分離され、上位ビット列で表される上位改良差分値DHyxと下位ビット列で表される下位改良差分値DLyxが求められる。そして下位改良差分値DLyxには、付加符号ビットF(+)もしくはF(−)が付加される。
【0263】
なお、2ビット、3ビットのビット分離を実行する場合、2ビット、3ビットの右シフト演算が実行される。
【0264】
図30は、1つの改良差分値行列に対するnビットのビット分離の手順を示すフローチャートである。図28、図30を用いてビット分離のフローチャートを説明する。
【0265】
ステップ701では、添字yが0に設定される。ステップ702では、添字xが0に設定され、行列の横方向を表す行の中で最も左側の改良差分値KHyxがビット分離の対象とされる。最初に改良差分値KH00(=2)がビット分離の対象となる。
【0266】
ステップ703では、改良差分値KHyxの値が0以上であるか否かが判定される。改良差分値KHyxの値が0以上であると判定されると、ステップ704に移り、正の付加符号ビットF(+)が設けられる。改良差分値KHyxの値が0以上でないと判断された場合、ステップ705に移る。
【0267】
ステップ705では、負の付加符号ビットF(−)が設けられる。そしてステップ706では、改良差分値KHyxに−1が掛け算され、改良差分値KHyxは正の値に変換される。
【0268】
ステップ707では、改良差分値KHyxに対してnビットの右シフト演算が実行され、上位改良差分値DHyxが求められる。
【0269】
例えば1ビットのビット分離の場合、改良差分値KH02(=−5)は−1が掛け算されて右シフト演算されることにより、上位改良差分値DH02(=2)が求められる。また3ビットのビット分離の場合、改良差分値KH02(=−5)は−1が掛け算されて右シフト演算されることにより、上位改良差分値DH02(=0)が求められる。
【0270】
ステップ708では、下位改良差分値DLyxが求められる。下位改良差分値DLyxを求める算術式は、(31)式のようになる。
【0271】
DLyx=KHyx−(DHyx×2n )・・・・・・(31)
【0272】
例えば1ビットのビット分離の場合、符号を正にした後の改良差分値KH02(=5)に対して上位改良差分値DH02の値が2であることから、下位改良差分値DL02の値は、
DL02=5−(2×21 )=1
となる。
【0273】
例えば3ビットのビット分離の場合、符号を正にした後の改良差分値KH02(=5)に対して上位改良差分値DH02の値が0がであることから、下位改良差分値DL02の値は、
DL02=5−(0×23 )=5
となる。
【0274】
ステップ709では、下位改良差分値DLyxにステップ704またはステップ705で設けられた付加符号ビットF(+)または付加符号ビットF(−)が付加され、符号付下位量子化DCT係数FLyxが求められる。
【0275】
例えば下位改良差分値DL02(=1)に対し、ステップ705で設けられた付加符号ビットF(−)が付加され、符号付下位改良差分値FL02(=(−)1)が求められる。
【0276】
ステップ710では、添字x に1が加算される。すなわち、1つ右隣の改良差分値KHyxが、ビット分離の対象とされる。
【0277】
ステップ711では、添字xが8であるか否かが判定される。すなわち、横方向の1つの行に対してすべての改良差分値KHyxがビット分離されたか否かが判定される。添字xが8であると判定されるとステップ712に移り、添字xが8でないと判定されるとステップ703に戻る。
【0278】
ステップ712では、添字yに1が加算される。すなわち、1つ下の行の改良差分値KHyxが、ビット分離の対象とされる。
【0279】
ステップ713では、添字y が8であるか否かが判定される。すなわち、すべての改良差分値KHyxがビット分離されたか否かが判定される。添字yが8であると判定されると、改良差分値行列KHに対するビット分離は終了する。添字yが8でないと判定されると、ステップ702に戻る。
【0280】
このように第4の実施形態では、第2の実施形態と異なり負の値である改良差分値KHyxには−1を掛けて正の値に変換した後ビット分離する。このため、改良差分値KHyxが−1のとき、そのままビット分離して得られる上位改良差分値KHyxは−1であるが、−1を掛けてからビット分離して得られる上位改良差分値KHyxは0となる。すなわち、ゼロランの出現頻度が高くなるため、符号化データに必要な情報量が少なくなる。従って画像を効率的に圧縮することができる。
【0281】
図31は、第4の実施形態を適用した画像伸張装置のブロック図である。この画像伸張装置では、第4の実施形態における画像圧縮装置によって圧縮された画像データを復元する。
【0282】
輝度データYおよび色差データCb,Crの圧縮画像データは、記録媒体Mの圧縮画像データ記録領域M1から読み出され、画像伸張装置80に送られる。画像伸張装置80は、ハフマン復号化部81、グループ合成部82、ビット合成部83、差分値復元部84、予測値生成部86、画素データ復元部85から構成されている。
【0283】
輝度データYおよび色差データCb,Crの圧縮画像データから付加ビットを除いた符号語は、ハフマン復号化部81において復号化される。すなわち、ハフマンテーブルHを参照することにより符号語からグループ番号が求められる。この復号化はハフマン符号化とは逆の作用である。
【0284】
復号化により得られたグループ番号と付加ビットに基いてグループ表Tを参照することにより、上位改良差分値がグループ合成部82において求められる。
【0285】
輝度データYおよび色差データCb、Crの上位改良差分値と記録媒体Mの符号付下位記録領域M3から読み出された符号付下位改良差分値から付加符号ビットを取り除いた下位改良差分値がビット合成部83においてビット合成され、これにより改良差分値が復元される。
【0286】
輝度データYおよび色差データCb,Crの改良差分値は、差分値復元部84において差分値に変換される。この差分値と予測値生成部86において生成される予測値を用いることにより、画素データが画素データ復元部85において生成される。すなわち、すでに復元された画素データに基いて生成された予測値と差分値との差から画素データが求められる。求められた画素データは予測値生成部86に送られ、次に復元される画素データに対する予測値の算出に用いられる。
【0287】
順次画素データが復元されることにより、輝度データYおよび色差データCb,Crの画像データが復元され、画像データは画像メモリ19に送られる。
【0288】
図32を用いて圧縮画像データに対する伸張処理を説明する。以下では、輝度データYの圧縮画像データを対象とする。
【0289】
図32には、図28で示された符号付下位改良差分値行列FLと、下位改良差分値行列DLと、上位改良差分値行列DHと、改良差分値行列KHとが8×8のマトリクスで例示されている。各マトリクスの要素は、それぞれ符号付下位改良差分値FLyx、下位改良差分値DLyx、上位改良差分値DHyx、改良差分値KHyxと表される。
【0290】
符号付下位改良差分値FLyxから付加符号ビットを取り除いた下位改良差分値DLyxがビット合成の対象とされる。上位改良差分値DHyxとそれに対応する下位改良差分値DLyxがビット合成されることにより、改良差分値KHyxが復元される。ただし、負の付加符号ビット(−)が付加されていた下位改良差分値DLyxがビット合成の対象である場合、復元される改良差分値KHyxは−1が掛け算され、負の値に変換される。ビット合成されるビット数は、ここでは1ビットである。
【0291】
例えば、 上位改良差分値DH02(=2)と負の付加符号ビット(−)が付加されていた下位改良差分値DL02(=1)がビット合成され、−1が掛け算されることにより、改良差分値KH02(=−5)が復元される。
【0292】
改良差分値KHyxから画素値Pyxまでの伸張処理に関しては図9で示された第1の実施形態と同じであるためここでは省略する。
【0293】
図32、図33を用いて、1ビットのビット合成を詳述する。そのため、上位改良差分値DHyxをビット列で表す。
【0294】
図33では、図32の上位改良差分値DH02(=2)と下位改良差分値DL02(=1)に対する1ビットのビット合成を示している。
【0295】
上位改良差分値DH02(=2)は、16ビットのビット列A2において、7ビットを使用して2進数「0000010」が表される。下位改良差分値DL 02 (=1)は2進数で「1」であり、下位ビット列K1で表される。
【0296】
ビット合成の実行により、上位改良差分値DH02(=2)のビット列A2は左シフト演算される。左シフト演算とは、各ビットを指定されたビット数だけ左に移動させる演算である。1ビットの左シフト演算が実行されると、ビット列A2において各ビットが1つずつ左に移動させられ、左端の「0」である符号ビットFが分離される。そして左シフト演算により空白になった右端の最下位ビットには、「1」である下位ビット列K1が当てはめられる。また、左端から2番目の「0」であるビットF0が左シフト演算により最上位ビットに移動され、符号ビットFとなる。
【0297】
このような左シフト演算により、ビット列A2は8ビットを使用して2進数「00000101」が表されるビット列A1に変換される。2進数「00000101」を10進法で表すと値は5であるが、下位改良差分値DLyx(=1)には負の付加符号ビットF(−)が付加されていたことから、5の値に対して−1が掛け算される。この掛け算によりビット列A1は、最上位ビットには負の符号ビットFが置かれ、8ビットを使用して2進数「11111011」が表されるビット列A0に変換される。そして、2進数「11111011」を10進法で表した値が改良差分値KH02となる。すなわち、負の符号ビットFを考慮すれば改良差分値KH02の値は、−5である。
【0298】
このように、上位改良差分値DH02(=2)と下位改良差分値DL02(=1)がビット合成され、付加符号ビットF(−)に対応して−1が掛け算されることにより、改良差分値KH02(=−5)が復元される。
【0299】
ビット合成の対象である下位改良差分値DLyxに対し正の付加符号ビットF(+)が付加されていた場合、左シフト演算により得られるビット列において表される2進数の値が改良差分値KHyxの値となる。
【0300】
なお、2ビット、3ビットのビット合成を実行する場合、2ビット、3ビットの左シフト演算が実行される。
【0301】
図34は、上位改良差分値行列と下位改良差分値行列に対するnビットのビット合成の手順を示したフローチャートである。図32、図34を用いてビット合成のフローチャートを説明する。
【0302】
ステップ801では、添字yが0に設定される。ステップ802では、添字xが0に設定され、行列の横方向を表す行の中で一番左側の上位改良差分値DHyxと下位改良差分値DLyxがビット合成の対象とされる。上位改良差分値DH00と下位改良差分値DL00が最初のビット合成の対象である。
【0303】
ステップ803では、上位改良差分値DHyxのビット列に対してnビットの左シフト演算が実行され、下位改良差分値DLyxを加えることにより改良差分値KHyxが求められる。改良差分値KHyxを求める算術式は、(32)式のようになる。
【0304】
KHyx=DHyx×2n +DLyx・・・・・(32)
【0305】
例えば1ビットのビット合成を実行する場合、上位改良差分値DH02(=2)と下位改良差分値DL02(=1)に対する改良差分値KH02の値は、
KH02=2×21 +1=5
となる。
【0306】
例えば3ビットのビット合成を実行する場合、上位改良差分値DH02(=0)と下位改良差分値DL02(=5)に対する改良差分値KH02の値は、
KH02=0×23 +5=5
となる。
【0307】
ステップ804では、下位改良差分値DLyxに付加されていた付加符号ビットが正の付加符号ビット(+)であるか否かが判定される。正の付加符号ビット(+)でないと判定されるとステップ805に移り、改良差分値KHyxは−1が掛け算され負の値に変換される。正の付加符号ビット(+)であると判定されると、ステップ806に移る。
【0308】
ステップ806では、添字xに1が加算される。すなわち、1つ右隣の上位改良差分値DHyxと下位改良差分値DLyxがビット合成の対象とされる。
【0309】
ステップ807では、添字xが8であるか否かが判定される。すなわち、1つの行に関してすべての上位改良差分値DHyxと下位改良差分値DLyxがビット合成されたか否かが判定される。添字xが8であると判定されると、ステップ808に移る。添字xが8でないと判定されると、ステップ803に戻る。
【0310】
ステップ808では、添字yに1が加算される。すなわち、1つ下の行の上位改良差分値DHyxと下位改良差分値DLyxがビット合成の対象とされる。
【0311】
ステップ809では、添字yが8であるか否かが判定される。すなわち、すべての上位改良差分値DHyxと下位改良差分値DLyxがビット合成されたか否かが判定される。添字yが8であると判定されると、一連のビット合成は終了する。添字yが8でないと判定されると、ステップ802に戻る。
【0312】
以上のように第4の実施形態によれば、改良差分値KHyxが正である時はそのままで、負である時は正の値に変換してビット分離し、上位改良差分値DHyxと符号付下位改良差分値FLyxを求めることにより、符号化データに必要な情報量を少なくすることができる。また上位改良差分値DHyxと符号付下位改良差分値FLyxに基いてビット合成を実行し、改良差分値KHyxを復元することにより、無歪みで原画像を復元することができる。
【0313】
【発明の効果】
以上のように本発明によれば、高解像度の画像を無歪みで圧縮、伸張することができ、かつ効率的に圧縮することができる。
【図面の簡単な説明】
【図1】第1の実施形態例である画像圧縮装置のブロック図である。
【図2】画素ブロックと予測値行列と差分値行列と改良差分値行列を示した図である。
【図3】グループ表とハフマンテーブルを示した図である。
【図4】予測値が14のときの画素値、差分値、改良差分値のとりうる範囲を示した表である。
【図5】予測値が14のときの画素値、差分値、改良差分値のとりうる範囲を棒線で示した図である。
【図6】予測値に対して実際に差分値となる確率を示した図である。
【図7】改良差分値を求める手順を示したフローチャートである。
【図8】第1の実施形態例である画像伸張装置のブロック図である。
【図9】改良差分値行列と差分値行列と予測値行列と画素ブロックを示した図である。
【図10】画素値を復元する手順を示したフローチャートである。
【図11】第2の実施形態例である画像圧縮装置のブロック図である。
【図12】改良差分値行列と上位改良差分値行列と下位改良差分値行列を示した図である。
【図13】改良差分値のビット分離を示した図である。
【図14】ビット分離の手順を示したフローチャートである。
【図15】第2の実施形態例である画像伸張装置のブロック図である。
【図16】上位改良差分値行列と下位改良差分値行列と改良差分値行列を示した図である。
【図17】上位改良差分値と下位改良差分値に対するビット合成を示した図である。
【図18】ビット合成の手順を示したフローチャートである。
【図19】第3の実施形態例である画像圧縮装置のブロック図である。
【図20】画素ブロックと上位画素ブロックと下位画素ブロックを示した図である。
【図21】上位画素ブロックと予測値行列と差分値行列と改良差分値行列を示した図である。
【図22】改良差分値を求める手順を示したフローチャートである。
【図23】第3の実施形態例である画像伸張装置のブロック図である。
【図24】改良差分値行列と差分値行列と上位画素ブロックと予測値行列を示した図である。
【図25】上位画素ブロックと下位画素ブロックと画素ブロックを示した図である。
【図26】画素値を復元する手順を示したフローチャートである。
【図27】第4の実施形態例である画像伸張装置のブロック図である。
【図28】改良差分値行列と上位改良差分値行列と下位改良差分値行列と符号付下位改良差分値行列を示した図である。
【図29】改良差分値に対するビット分離を示した図である。
【図30】ビット分離の手順を示したフローチャートである。
【図31】第4の実施形態例である画像伸張装置のブロック図である。
【図32】符号付下位改良差分値行列と下位改良差分値行列と上位改良差分値行列と改良差分値行列を示した図である。
【図33】上位改良差分値と下位改良差分値に対するビット合成を示した図である。
【図34】ビット合成の手順を示したフローチャートである。
【符号の説明】
LA 部分的範囲(第1の部分的範囲)
LB 部分的範囲(第2の部分的範囲)
LC 部分的範囲(第3の部分的範囲)
LD 部分的範囲(第4の部分的範囲)
LE 部分的範囲(第5の部分的範囲)
LF 整数範囲(非差分値範囲)
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image compression apparatus and an image expansion apparatus for compressing and expanding a color still image.
[0002]
[Prior art]
An image compression method called JPEG (Joint Photographic Expert Group) method has been standardized in order to efficiently perform image transfer via a communication circuit by compressing a color still image, and the basic method ( It is classified into two types, a lossy encoding method and a lossless encoding method typified by a baseline process. In the latter lossless encoding method, since there is a correlation between adjacent pixels in an image of one screen, the pixel data to be encoded (compressed) is predicted from the adjacent pixel data, and the predicted pixel data and the actual pixel data are actually detected. A difference value with respect to the pixel data is obtained, and the difference value is encoded. The encoded pixel data is decoded and restored to the original pixel data based on the predicted value and the difference value, thereby restoring the original image.
[0003]
[Problems to be solved by the invention]
According to such a lossless encoding method, it is possible to compress and expand a high-resolution image without causing distortion. However, since it is necessary to encode all the pixel data, a zero run (the pixel data having a value of 0 when the pixel data is arranged in one column is continuous) is generated by performing orthogonal transformation and quantization. Compared to the basic method, the image cannot be compressed efficiently.
[0004]
An object of the present invention is to obtain an image compression apparatus and an image expansion apparatus for efficiently compressing and expanding an image with high resolution without causing image quality degradation.
[0005]
[Means for Solving the Problems]
The image compression apparatus according to the present invention provides prediction value generation means for obtaining a prediction value based on adjacent pixel data for each pixel data for image data composed of a plurality of pixel data corresponding to an input still image. And a difference value generating means for obtaining a difference value by taking a difference between the predicted value and the pixel data, and an improved difference value generating means for generating an improved difference value based on a possible range of the difference value corresponding to the predicted value And an encoding means for obtaining compressed image data by encoding the improved difference value, and the improved difference value generating means inverts the difference value and the positive / negative sign within a possible range of the difference value. The improved difference values are obtained by arranging the difference values in ascending order of absolute values in correspondence with the increasing or decreasing direction of the difference value in the range that the difference value can take.
[0006]
ImprovementThe difference value generation means has the same absolute valueDifference valueWhenpositive and negativeIt is desirable to arrange the difference values obtained by inverting the signs of the two so that positive values and negative values appear alternately.
[0007]
The improved difference value generation means divides a possible range of the difference value corresponding to the predicted value into first, second, and third partial ranges, and replaces the first partial range with a fourth partial range. The numerical value existing in the non-difference value range where there is no difference value is used instead of the difference value existing in the third partial range, and the difference value existing in the second partial range and the non-difference value range are used. It is desirable to generate a fifth partial range in which existing numerical values are alternately arranged in ascending order of absolute value, and to obtain an improved differential value represented by a bit string existing in the fourth and fifth partial ranges.
[0008]
The improved difference value generation means sets the range that the difference value can take so that the absolute values of the upper limit difference value and the lower limit difference value in the first partial range are equal to each other. It is desirable to divide the scope.
[0009]
The improved difference value generation means sets the range that the difference value can take so that the sum of the numerical values existing in the non-difference value range is equal to the sum of the difference values existing in the third partial range. And a third partial range is desirable.
[0010]
It is desirable that the predicted value generating means use the pixel data one left adjacent to the encoding target pixel data as the predicted value.
[0011]
The image decompression apparatus of the present invention decodes compressed image data to obtain a difference value by associating a decoding means for obtaining an improved difference value with a range that can be taken by the improved difference value and a range that can be taken by the difference value. And a means for restoring the image data by sequentially restoring the pixel data by taking the difference between the difference value and the predicted value.
[0012]
It is desirable that the predicted value is obtained based on the previously restored pixel data.
[0013]
The image compression apparatus according to the present invention provides prediction value generation means for obtaining a prediction value based on adjacent pixel data for each pixel data for image data composed of a plurality of pixel data corresponding to an input still image. Then, by taking the difference between the predicted value and the pixel data, a difference value generating means for obtaining the difference value, and an improved difference value represented by a bit string is generated based on a possible range of the difference value corresponding to the predicted value. Improved differential value generation means and bit separation for separating a bit string of the improved differential value into two, an upper bit string and a lower bit string, to obtain a higher improved difference value represented by the upper bit string and a lower improved difference value represented by the lower bit string And an encoding means for obtaining compressed image data by encoding the higher-order improved difference value, and the improved difference value generating means has a difference value within a possible range of the difference value. Positive and negative difference values obtained by reversing the sign, corresponding to the increase or decrease direction of the difference value in the range which can be taken of the difference values, by arranging in ascending order of absolute value, and obtains an improved differential value.
[0014]
The bit separation means preferably performs a right shift operation on the bit string of the improved difference value, sets the bit string of the improved difference value converted by the right shift operation as an upper bit string, and sets the lower bits separated by the right shift operation as a lower bit string.
[0015]
The image decompression apparatus of the present invention decodes compressed image data to obtain a higher improvement difference value, a higher improvement difference value obtained by the decoding means, and a lower improvement difference value that is input as a bit. By combining the bit composition means for obtaining the improved difference value, the means for restoring the difference value by associating the possible range of the improved difference value with the possible range of the difference value, and the difference value and the predicted value And a means for restoring the image data by sequentially restoring the pixel data by taking the difference.
[0016]
It is desirable that the bit synthesis unit obtains the improved difference value by performing a left shift operation on the bit string of the upper improved difference value and applying the lower bit string to a bit portion that is left blank by the left shift operation.
[0017]
The image compression apparatus according to the present invention, corresponding to an input still image, separates the bit sequence of the image data into two for the image data represented by the bit sequence, and the upper image data and the lower bit sequence represented by the upper bit sequence Bit separation means for obtaining lower-order image data represented by the following: for the higher-order image data composed of a plurality of pixel data, for each pixel data, prediction value generation means for obtaining a prediction value based on adjacent pixel data; A difference value generating means for obtaining a difference value by taking a difference between the predicted value and the pixel data; and an improved difference value generating means for generating an improved difference value based on a possible range of the difference value corresponding to the predicted value; And an encoding means for obtaining compressed image data by encoding the improved difference value, and the improved difference value generating means converts the difference value and a positive / negative sign within a possible range of the difference value. The difference value obtained by rolling, so as to correspond to the increase or decrease direction of the difference value in the range which can be taken of the difference values, by arranging in ascending order of absolute value, and obtains an improved differential value.
[0018]
The bit separation means preferably performs a right shift operation on the bit string of the image data, the bit string of the image data converted by the right shift operation as the upper bit string, and the lower bit separated by the right shift operation as the lower bit string.
[0019]
The image decompressing apparatus of the present invention decodes compressed image data, and associates the decoding means for obtaining the improved difference value with the range that the improved difference value can take and the range that the difference value can take. Means for restoring the difference value, means for restoring the upper image data by sequentially restoring the pixel data by taking the difference between the difference value and the predicted value, and the input lower image data and the upper image data as bits. A bit synthesizing unit that obtains image data by synthesizing the image data is provided.
[0020]
The bit composition means preferably obtains the image data by performing a left shift operation on the bit sequence of the upper image data and applying the lower bit sequence to a bit portion that becomes blank by the left shift operation.
[0021]
The image compression apparatus according to the present invention provides prediction value generation means for obtaining a prediction value based on adjacent pixel data for each pixel data for image data composed of a plurality of pixel data corresponding to an input still image. Then, by taking the difference between the predicted value and the pixel data, a difference value generating means for obtaining the difference value, and an improved difference value represented by a bit string is generated based on a possible range of the difference value corresponding to the predicted value. Improved difference value generation means, means for multiplying the improved difference value by -1 when the improved difference value is negative, and converting it to a positive value, and positive from the beginning, or multiplied by -1. Thus, the bit string of the improved difference value converted to a positive value is separated into the upper bit string and the lower bit string, and the upper improved difference value represented by the upper bit string and the lower improved difference value represented by the lower bit string are Asking For the bit separator and the lower bit string of the lower improved difference value, a positive additional sign bit if the improved difference value is a positive value, and a negative additional sign bit if the improved difference value is a negative value. And an encoding means for obtaining compressed image data by encoding the improved difference value, and the improved difference value generating means has a difference value and a positive / negative sign within a possible range of the difference value. The improved difference value is obtained by arranging the difference values obtained by inverting the signs of the numbers in ascending order of the absolute values in correspondence with the increasing or decreasing direction of the difference value in the possible range of the difference value.
[0022]
The image decompressing apparatus of the present invention decodes compressed image data to obtain a higher improvement difference value, and performs bit synthesis of the lower improvement difference value and the higher improvement difference value excluding the additional code bit. When the bit combination means for obtaining the improved difference value and the additional sign bit added to the lower-order improved difference value are negative values, the improved difference value obtained by the bit composition means is multiplied by -1. By correlating the means for converting to a negative value, the range that can be taken by the improved difference value and the range that can be taken by the difference value, the means for restoring the difference value, and taking the difference between the difference value and the predicted value Means for restoring image data by sequentially restoring pixel data;
It is provided with.
[0023]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an image compression apparatus and an image expansion apparatus according to embodiments of the present invention will be described with reference to the drawings.
1 to 10 are diagrams relating to an image compression apparatus and an image expansion apparatus according to a first embodiment, and FIG. 1 is a block diagram of the image compression apparatus.
[0024]
The subject image 16 (still image) is formed on the light receiving surface of the image sensor 18 via the lens 17. A photoelectric conversion element is disposed on the light receiving surface of the imaging element 18, and a color filter including red (R), green (G), and blue (B) color filter elements is provided on the upper surface of the photoelectric conversion element. . Each photoelectric conversion element corresponds to one pixel data, and the subject image is converted into an electrical image signal corresponding to a predetermined color by each photoelectric conversion element. The image signal is converted from an analog signal to a digital signal in an A / D converter (not shown).
[0025]
The digitized image signal is converted into luminance data Y and color difference data Cb, Cr by a signal processing circuit (not shown) and recorded in the image memory 19 as image data. In the image memory 19, luminance data Y and color difference data Cb and Cr are stored in independent areas, and each memory area has a storage capacity for one image. The luminance data Y and the color difference data Cb and Cr are input data to the image compression apparatus 10.
[0026]
Image data of luminance data Y and color difference data Cb and Cr is divided into a plurality of blocks on one screen and processed in units of blocks. Each block consists of 8 × 8 pixel data.
[0027]
The luminance data Y and the color difference data Cb and Cr are read from the image memory 19 and sent to the image compression apparatus 10. The image compression apparatus 10 includes a predicted value generation unit 11, a difference value generation unit 12, an improved difference value generation unit 13, a group unit 14, and a Huffman encoding unit 15. The luminance data Y and the color difference data Cb and Cr are individually compressed in the image compression apparatus 10.
[0028]
Based on the pixel data of the luminance data Y and the color difference data Cb and Cr in each block, the predicted value is obtained by the predicted value generation unit 11. The predicted value is a value obtained by predicting the value of pixel data to be encoded (compressed) based on the value of adjacent pixel data.
[0029]
Pixel data of the luminance data Y and the color difference data Cb and Cr is converted into a difference value by the difference value generation unit 12. The difference value is obtained by subtracting the actual pixel data value from the predicted value obtained in the predicted value generation unit 11.
[0030]
The difference value between the luminance data Y and the color difference data Cb and Cr is converted into an improved difference value by the improved difference value generation unit 13. The improved difference value is calculated based on the predicted value and the difference value, and is used as an encoding target instead of the pixel data.
[0031]
The improved difference values of the luminance data Y and the color difference data Cb, Cr are grouped in the group unit 14 based on the group table T, and the group number of the group to which the improved difference value belongs and the additional bits corresponding to the group number are obtained. .
[0032]
By referring to the Huffman table H based on the group number obtained in the group unit 14, a code word is obtained in the Huffman encoding unit 15. The Huffman encoding unit 15 performs entropy encoding. Here, Huffman encoding is applied as one of entropy encoding. Here, grouping and Huffman coding are coding here. Compressed image data (encoded data) obtained by combining the code word and the additional bits obtained in the group unit 14 is recorded on the recording medium M.
[0033]
A compression process for one pixel block will be described with reference to FIGS. Here, pixel data of luminance data Y is targeted.
[0034]
In FIG. 2, the pixel block P, the prediction value matrix E, the difference value matrix H, and the improved difference value matrix KH are illustrated as an 8 × 8 matrix. Each matrix element has a pixel value (pixel data is hereinafter referred to as a pixel value) Pyx, Predicted value Eyx, Difference value Hyx, Improved difference value KHyxIt is expressed.
[0035]
Pixel value Pyx, The subscript y represents the position in the vertical direction, and is 0, 1, 2,... 7 from the top. The subscript x represents the position in the horizontal direction, and is 0, 1, 2,... 7 from the left. For example, when x = 1 and y = 1, the pixel value Pyx= 162.
[0036]
First, the pixel value P to be encodedyxPixel value P adjacent toyxBased on the predicted value EyxIs required. Predicted value EyxThere are several known methods for calculating the pixel value P, but here the pixel value P to be encoded isyxPixel value P next toyx-1Directly as predicted value EyxThe predicted value E by the methodyxAsk for. However, the pixel value P located in the leftmost column in the pixel block Py0Predicted value Ey0Is the pixel value P located in the rightmost column in the pixel block P adjacent to the left by oney7It is requested from.
[0037]
For example, the pixel value P to be encoded17Pixel value P that is one left next to (= 132)16(= 14) is the predicted value E17(= 14).
[0038]
Next, the predicted value EyxAnd the corresponding actual pixel value PyxBased on the pixel value PyxIs the difference value HyxIs converted to That is, the predicted value EyxTo pixel value PyxIs subtracted and the difference value HyxIs required.
[0039]
For example, the predicted value E17(= 14) to pixel value P17= (132) is subtracted to obtain the difference value H17(= -118) is obtained.
[0040]
Difference value HyxIs the predicted value EyxAnd pixel value PyxImproved difference value KH based onyxIs converted to Improved difference value KHyxIs any value in the range of −128 to 127, and the pixel value PyxInstead of. For example, the difference value H17(= −118) is the improved difference value KH17(= 66). Also, the difference value Htwenty one(= -1) is the improved difference value KH as it istwenty one(= -1). The improved difference value KHyxWill be described later.
[0041]
In FIG. 3, a group table T and a Huffman table H are shown. Specifically, the improved difference value KH17(= 66) is grouped and Huffman coded.
[0042]
Improved difference value KHyxAre grouped based on the group table T. Group table T is improved difference value KHyxIs a column indicating the group to which the group belongs, a column indicating the group number C, and a column indicating the number of additional bits corresponding to the group number C.
[0043]
For example, with reference to the group table T, the improved difference value KH17When (= 66) is grouped, a group number [7] is obtained and the number of additional bits is 7.
[0044]
Additional bits are obtained from the group number C obtained by grouping and the number of additional bits. The additional bit is the improved differential value KHyxImproved difference value KH in the group to whichyxThis bit is provided to specify the value of.
[0045]
In the group with the group number [7], 66 is the 67th largest number counted from −127, so the improved difference value KHyxThe additional bit for (= 66) is 66 binary number “1000010” considering that −127 is binary number “0000000”.
[0046]
By referring to the Huffman table H based on the group number C obtained by grouping, a code word is obtained. The Huffman table H is composed of a column indicating a group number C, a column indicating a code length, and a column indicating a code word, and an improved difference value KHyxHave a code word corresponding to the group number C.
[0047]
Improved difference value KH17By referring to the Huffman table H based on the group number “7” of (= 66), the improved difference value KH17The code word of (= 66) is “11110”.
[0048]
Encoded data is obtained by combining this code word and additional bits. Improved difference value KH17In the case of (= 66), the encoded data “111101000011” is obtained by combining the code word “11110” and the additional bit “1000011”.
[0049]
Thus, the improved difference value KHyxAre grouped and Huffman encoded to obtain encoded data, that is, compressed image data.
[0050]
Using FIG. 4, FIG. 5 and FIG.yxWill be described in detail. Here, the improved difference value KH of the luminance data YyxIs targeted.
[0051]
In FIG. 4, the predicted value E17Pixel value P for (= 14)yx, Difference value Hyx, And improved difference value KHyxA table S on which the possible ranges are listed is shown. FIG. 5 also shows the predicted value E.17Pixel value P for (= 14)yx, Difference value Hyx, Improved difference value KHyxThe range that can be taken is represented by a bar line, and the bar line L0 is a pixel value PyxThe range that can be taken, the bar L1 is the difference value HyxThe range that can be taken, the bar L2 is the improved difference value KHyxThe range that can be taken is shown.
[0052]
Pixel value P of luminance data YyxThe range that can be taken is 0 to 255 as indicated by the bar L0. On the other hand, predicted value E17Difference value H with respect to (= 14)yxThe range that can be taken is −241 to 14 as indicated by the bar L1. Therefore, the predicted value E17Difference value H with respect to (= 14)yxDoes not exist in the integer range (non-difference value range) LF (15 to 127).
[0053]
The difference value H indicated by the bar L1yxIs a partial range (third partial range) LC (−241 to −129), partial range (second partial range) LB (−128 to −15), partial range ( The first partial range is divided into LA (-14 to 14). The total number of integers present in the integer range LF and the difference value present in the partial range LCH yx The total number of is equal. In the partial range LA, the difference value HyxBut-14-14Takes a value in the range.
[0054]
Difference value H existing in partial range LCyxInstead of, an integer existing in the integer range LF is used as an improved difference value KH indicated by a bar L2.yxThis is a possible range. In the partial range (fifth partial range) LE (−128 to −15) on the bar L2, the integer existing in the integer range LF and the difference value H existing in the partial range LB.yxAre arranged alternately in ascending order of absolute value. This partial range LE is represented in FIG. Specifically, the improved difference value KH existing in the partial range LEyx(-15, 15, -16) are respectively represented by (n1, n2, n3).
[0055]
Improved difference value KH in this partial range LEyxIs the difference value H existing in the partial range LB.yxAnd its difference value HyxDifference value -H in which positive and negative signs are inverted with respect toyxAre alternately arranged in ascending order of absolute value.
[0056]
Improved difference value KH existing in the partial range (fourth partial range) LD (−14 to 14) in the bar L2yxIs the difference value H existing in the partial range LA in the bar L1yxIt corresponds to. Note that the absolute values of the maximum value (here 14) and the minimum value (here -14) in the partial range LA and partial range LD are equal.
[0057]
Improved difference value KH indicated by bar L2yxAnd the difference value H indicated by the bar L1yxBy matching the possible range of the difference value HyxImproved difference value KH corresponding toyxIs required. For example, the difference value HyxIs -129, the corresponding improved difference value KHyxIs -72.
[0058]
In FIG.As shown, the improved difference value KHyxIncrease direction of absolute value and difference value HyxThe increase or decrease direction (here, the decrease direction) corresponds. Therefore, improved difference value KHyxAnd the corresponding difference value HyxAre compared, the difference value HyxThe larger the absolute value of, the better the improved difference value KHyxAbsolute value and difference value HyxThe difference from the absolute value of is greater.
[0059]
Here, when grouping by the group table T shown in FIG. 3 is taken up, the improved difference value KHyxIs the difference value HyxIt belongs to the group of the smaller group number C compared to the number of corresponding additional bits. Also, the improved difference value KH belonging to the group number [8]yxIs only -128 and does not require additional bits. Therefore, the improved difference value KHyxThe number of bits of the encoded data is the difference value HyxLess than
[0060]
In FIG. 6, the predicted value E17Difference value H with respect to (= 14)yxA probability distribution is shown. This probability distribution is the difference value H in the range indicated by the bar L1.yxActually the difference value HyxRepresents the probability of becoming. The horizontal axis is the difference value HyxThe vertical axis is actually the difference value HyxIs the probability of
[0061]
Since there is a correlation between adjacent pixels in an image of one screen, the difference value HyxHas a high probability of being around 0. Therefore, the difference value HyxThis probability distribution curve is represented by a Gaussian distribution curve V.
[0062]
Improved difference value KH in partial range LEyxAre arranged so that positive and negative appear alternately in ascending order of absolute value. Therefore, the improved difference valueKH yx The increase rate of the absolute value of (the rate at which the numerical value increases) is the difference value H in the partial range LB.yxThe increase rate is half of the increase rate of the absolute value of. Difference value H with small absolute valueyxConsidering that the probability of being actually encoded is higher, the improved differential value KH in which the rate of increase in absolute value is suppressedyxThe number of bits of the encoded data is the difference value HyxLess than
[0063]
Thus, the predicted value EyxAnd difference value HyxImproved difference value KH based on possible rangeyxThe range that can be taken is generated and the difference value HyxImproved difference value KH instead ofyxIs encoded, the number of bits required for the encoded data, that is, the amount of information can be reduced.
[0064]
Improved difference value KH of color difference data Cb, CryxIs obtained in the same manner as the luminance data Y. However, since the range of the color difference data Cb and Cr is -128 to 127, the improved difference value KH is similarly applied after 128 is added to the color difference data Cb and Cr.yxIs required.
[0065]
FIG. 7 is a flowchart showing a procedure for obtaining one improved difference value matrix KH. A procedure for obtaining one improved difference value matrix KH will be described with reference to FIGS.
[0066]
In step 101, the subscript y is set to zero. In step 202, the subscript x is set to 0, and the obtained improved difference value KHyxIs the leftmost improved difference value KH in the row representing the horizontal direction of the matrixyxTo be determined. Required improved difference value KHyxIs determined, step 103 is entered. In step 103, the predicted value EyxIt is determined whether or not is 128 or more.
[0067]
In step 103, the predicted value EyxIs determined to be 128 or more, the process proceeds to step 104. In step 104, the pixel value PyxIs the equation (1)
Pyx<2 x Eyx-255 (1)
It is determined whether or not the above is satisfied. Pixel value PyxWhen it is determined that satisfies the expression (1), the routine proceeds to step 106. Pixel value PyxIs determined not to satisfy the expression (1), the process proceeds to step 105 and the improved difference value KHyxIs obtained by the equation (2), and the process proceeds to step 113.
KHyx= Eyx-Pyx                (2)
[0068]
In step 106, the pixel value PyxIt is determined whether or not is an even number. Pixel value PyxIs determined to be an even number, the process proceeds to step 107, and the improved difference value KHyxIs obtained by equation (3).
KHyx= Pyx/ 2-128 (3)
Pixel value PyxIf it is determined that is not an even number, the process proceeds to step 108 and the improved difference value KHyxIs obtained by equation (4).
KHyx= 128- (Pyx+1) / 2 (4)
Improved difference value KHyxIs obtained, the process proceeds to step 113.
[0069]
For example, the predicted value E61Pixel value P for (= 175)61Since (= 19) is an odd number, the improved difference value KH61Is from equation (4)
KH61= 128- (19 + 1) / 2 = 118
It is.
[0070]
In step 103, the predicted value EyxIf it is determined that is not 128 or more, the routine proceeds to step 109. In step 109, the pixel value PyxIs satisfied whether or not (5) is satisfied.
Pyx> 2 × Eyx                  (5)
Pixel value PyxWhen it is determined that satisfies the expression (5), the process proceeds to step 110. Pixel value PyxIs determined not to satisfy the above expression, the process proceeds to step 105, where the improved difference value KHyxIs obtained by equation (2), and the process proceeds to step 113.
[0071]
In step 110, the pixel value PyxWhether or not is an even number is determined. Pixel value PyxIf it is determined that is not an even number, the process proceeds to step 111 and the improved difference value KHyxIs obtained by equation (6).
KHyx=-(Pyx+1) / 2 (6)
Pixel value PyxIs determined to be an even number, the process proceeds to step 112, and the improved difference value KHyxIs obtained by equation (7).
KHyx= Pyx/ 2 (7)
Improved difference value KHyxIs obtained, the process proceeds to step 113.
[0072]
For example, the predicted value E17Pixel value P for (= 14)17Since (= 132) is an even number, the improved difference value KH17Is from equation (7)
KH17= 132/2 = 66
It becomes.
[0073]
In step 113, 1 is added to the subscript x. That is, the required improved difference value KHyxImproved difference value KH right next toyxTo be determined.
[0074]
In step 114, it is determined whether or not the subscript x is 8. That is, one improved difference value KHyxIs determined in a row. If it is determined that the subscript x is 8, the process proceeds to step 115. If it is determined that the subscript x is not 8, the process returns to step 103.
[0075]
In step 115, 1 is added to the subscript y. That is, the required improved difference value KHyxImproved difference value KH in the row below byyxTo be determined.
[0076]
In step 116, it is determined whether or not the subscript y is 8. That is, the improved difference value KHyxIt is determined whether or not all of them have been obtained. When it is determined that the subscript y is 8, the calculation for obtaining the improved difference value matrix KH ends. If it is determined that the subscript y is not 8, the process returns to step 102. In addition, the calculation which calculates | requires such an improved difference value matrix KH is performed with respect to all the pixel blocks P in 1 screen.
[0077]
As described above, the difference value H in the compression processyxImproved difference value KH instead ofyxBy encoding, the amount of information necessary for encoding image data can be reduced, and the image can be compressed efficiently.
[0078]
FIG. 8 is a block diagram of an image expansion apparatus to which the first embodiment of the present invention is applied. In this image compression apparatus, the image data compressed by the image compression apparatus in the first embodiment is restored.
[0079]
The compressed image data isFrom recording medium MIt is read out and sent to the image expansion device 20. The image expansion device 20 includes a Huffman decoding unit 21, a group synthesis unit 22, a difference value restoration unit 23, a pixel data restoration unit 24, and a predicted value generation unit 25.
[0080]
The Huffman decoding unit 21 decodes the compressed image data of the luminance data Y and the color difference data Cb and Cr recorded on the recording medium M. That is, by referring to the Huffman table H, the group number is obtained from the encoded data excluding the additional bits. Note that the Huffman encoding unit 21 performs entropy decoding on the compressed image data, and here, Huffman decoding, which is one of entropy decoding, is applied.
[0081]
By referring to the group table T based on the group number and additional bits obtained by decoding, the improved difference value KHyxIs obtained by the group composition unit 22. Note that obtaining the improved difference value in the Huffman decoding and group combining unit 22 is herein referred to as decoding. The improved difference value between the luminance data Y and the color difference data Cb and Cr is converted into a difference value by the difference value restoring unit 23.
[0082]
Pixel data is generated in the pixel data restoration unit 24 by using the difference value and the predicted value generated in the predicted value generation unit 25. That is, the pixel data is obtained from the difference between the predicted value generated based on the already restored pixel data and the difference value. The obtained pixel data is sent to the predicted value generation unit 25, and is used to calculate a predicted value for the pixel data to be restored next.
[0083]
By sequentially restoring the pixel data, the image data of the luminance data Y and the color difference data Cb, Cr is restored, and the image data is sent to the image memory 19.
[0084]
The decompression process of the compressed image data will be described with reference to FIG. Here, the compressed image data of luminance data Y is targeted.
[0085]
In FIG. 9, the improved difference value matrix KH, the difference value matrix H, the predicted value matrix E, and the pixel block P are shown as an 8 × 8 matrix. Each matrix element has an improved difference value KH.yx, Difference value Hyx, Predicted value Eyx, Pixel value PyxIt is expressed.
[0086]
The compressed image data is decoded based on the Huffman table H and the group table T, and the improved difference value KHyxIs converted to
[0087]
. Predicted value EyxImproved difference value KH inyxPossible range and difference value HyxBy making the range that can be taken into account, the improved difference value KHyxTo difference value HyxIs restored. For example, predicted value EyxIs E44When (= 167), the improved difference value KH44(= 116) is the difference value H44(= 144).
[0088]
Difference value HyxAnd the corresponding predicted value EyxTo the pixel value PyxIs required. That is, the predicted value EyxTo difference value HyxIs subtracted to obtain the pixel value PyxIs required. Pixel value PyxAre restored one by one in the pixel block P, and the restored pixel value PyxIs the pixel value P to be restored nextyxPredicted value EyxIt becomes.
[0089]
For example, the predicted value E44Difference value H from (= 167)44By subtracting (= 144), the pixel value P44(= 23) is obtained. Pixel value P44Is the pixel value P to be restored next45Predicted value E45(= 23).
[0090]
In this way, the pixel value P sequentiallyyxIs restored, one pixel block P is restored.
[0091]
FIG. 10 shows the improved difference value KHyxAnd predicted value EyxBased on pixel value PyxIt is the flowchart which showed the procedure which calculates | requires. A procedure for obtaining one pixel block P will be described with reference to FIGS.
[0092]
In step 201, the subscript y is set to zero. In step 202, the subscript x is set to 0 and the restored pixel value PyxIs the leftmost pixel value P in the row representing the horizontal direction of the matrixyxTo be determined. Pixel value P to be restoredyxIs determined, the process proceeds to step 203, where the predicted value EyxIt is determined whether or not is 128 or more.
[0093]
In step 203, the predicted value EyxIs determined to be 128 or more, the process proceeds to step 204. In step 204, the improved difference value KHyxWhether or not satisfies the expression (8) is determined.
Eyx-255 ≦ KHyx≦ 255-Eyx      .... (8)
Improved difference value KHyxIs determined to satisfy the expression (8), the process proceeds to step 205 and the pixel value PyxIs obtained by equation (9).
Pyx= Eyx-KHyx                        (9)
Pixel value PyxIs obtained, the process proceeds to step 213.
[0094]
For example, the improved difference value KH32Predicted value E for (= 7)32Since (= 168) satisfies the equation (8), the pixel value P32From equation (9)
P32= 168-7 = 161
It becomes.
[0095]
If it is determined in step 204 that the expression (8) is not satisfied, the process proceeds to step 206 and the improved difference value KH.yxWhether or not is equal to or greater than 0 is determined. Improved difference value KHyxIf it is determined that is greater than or equal to 0, the process moves to step 208 and the pixel value PyxIs obtained by equation (10).
Pyx= 255-2 × KHyx              (10)
Improved difference value KHyxIf it is determined that is not greater than or equal to 0, the process proceeds to step 207 and the pixel value PyxIs obtained by equation (11).
Pyx= KHyx× 2 + 256 (11)
Pixel value PyxIs obtained, the process proceeds to step 213.
[0096]
In step 203, the predicted value EyxIf it is determined that is not 128 or more, the process proceeds to step 209. In step 209, the improved difference value KHyxWhether or not satisfies the expression (12) is determined.
-Eyx≦ KHyx≦ Eyx                  (12)
If it is determined that the improved difference value E satisfies the expression (12), the process proceeds to step 205, and the pixel value P is determined according to the expression (9).yxIs required. Improved difference value KHyxIf it is determined that the expression (12) is not satisfied, the process proceeds to step 210.
[0097]
In step 210, the improved difference value KHyxWhether or not is equal to or greater than 0 is determined. Improved difference value KHyxIs determined to be greater than or equal to 0, the process proceeds to step 212 and the pixel value PyxIs obtained by equation (13).
Pyx= 2 × KHyx                      (13)
Improved difference value KHyxIf it is determined that is not greater than or equal to 0, the process proceeds to step 211 where the pixel value PyxIs obtained by equation (14).
Pyx= -2 × KHyx-1 (14)
Pixel value PyxIs obtained, the process proceeds to step 213.
[0098]
For example, the predicted value E17Improved difference value KH for (= 14)17Since (= 66) is 0 or more, the pixel value P17Is from equation (13)
P17= 2 × 66 = 132
It becomes.
[0099]
In step 213, 1 is added to the subscript x. That is, the restored pixel value PyxIs one pixel value P on the rightyxTo be determined.
[0100]
In step 214, it is determined whether or not the subscript x is 8. That is, the pixel value PyxIt is determined whether or not all have been restored in one row. If it is determined that the subscript x is 8, the process proceeds to step 215. If it is determined that the subscript x is not 8, the process returns to step 203.
[0101]
In step 215, 1 is added to the subscript y. That is, the restored pixel value PyxIs the pixel value P in the next lower rowyxTo be determined.
[0102]
In step 216, it is determined whether or not the subscript y is 8. That is, in one pixel block P, the pixel value PyxIt is determined whether or not all have been restored. If it is determined that the subscript y is 8, the pixel value PyxThe operation for restoring is finished. If it is determined that the subscript y is not 8, the process returns to step 202. All the improved difference value matrix KH in one screenyxIs calculated for such a pixel block P.
[0103]
As described above, according to the first embodiment, the difference value HyxImproved difference value KH instead ofyxBy encoding, the information amount of the compressed image data can be reduced, and the image can be compressed efficiently. Improved difference value KHyxTo pixel value PyxCan be decompressed without distortion.
[0104]
FIGS. 11 to 18 are diagrams relating to an image compression apparatus and an image expansion apparatus according to the second embodiment.
[0105]
FIG. 11 is a block diagram of an image compression apparatus to which the second embodiment is applied.
[0106]
As in the first embodiment, the light of the subject image 16 is formed on the image sensor 18 via the lens 17. Image signals generated by photoelectric conversion in the image sensor 18 are processed by an A / D converter and a signal processing circuit, respectively, and converted into luminance data Y and color difference data Cb and Cr, and recorded in the image memory 19 as image data. Image data of luminance data Y and color difference data Cb, Cr is read from the image memory 19 and sent to the image compression device 30. The image compression apparatus 30 includes a prediction value generation unit 31, a difference value generation unit 32, an improved difference value generation unit 33, a bit separation unit 34, a group unit 35, and a Huffman encoding unit 36.
[0107]
Image data of luminance data Y and color difference data Cb and Cr is divided into a plurality of blocks on one screen and processed in units of blocks. Each block consists of 8 × 8 pixel data.
[0108]
Based on the luminance data Y and the pixel data of the color difference data Cb and Cr in each block, a predicted value is obtained by the predicted value generation unit 31. The predicted value is obtained based on pixel data adjacent to one pixel data to be encoded.
[0109]
Pixel data of the luminance data Y and the color difference data Cb, Cr is converted into a difference value by the difference value generation unit 32. That is, the difference value is obtained by subtracting the pixel data from the predicted value obtained in the predicted value generation unit 31.
[0110]
The difference value between the luminance data Y and the color difference data Cb and Cr is converted into an improved difference value by the improved difference value generation unit 33.
[0111]
The luminance data Y and the color difference data Cb, Cr are represented by a bit string in the image compression device 30, and the improved difference values of the luminance data Y and the color difference data Cb, Cr are also represented by a bit string. The bit string of the improved difference value is separated in the bit separation unit 34 into a bit string (upper bit string) of the higher improved difference value and a bit string (lower bit string) of the lower improved difference value. The upper improvement difference value is sent to the group unit 35, but the lower improvement difference value is recorded in the lower recording area M2 of the recording medium M without being encoded.
[0112]
The upper improvement difference values of the luminance data Y and the color difference data Cb, Cr are grouped on the basis of the group table T in the group unit 35, and the group number of the group to which the higher improvement difference value belongs and the corresponding additional bits are obtained.
[0113]
By referring to the Huffman table H based on the group number obtained in the group unit 35, the code word is obtained in the Huffman encoding unit 36. Then, the compressed image data obtained by combining the code word and the additional bits obtained in the group unit 35 is recorded in the compressed image data recording area M1 of the recording medium M.
[0114]
A compression process for the pixel block P will be described with reference to FIG.
[0115]
In FIG. 12, an improved difference value matrix KH, an upper improved difference value matrix DH, and a lower improved difference value matrix DL are illustrated as 8 × 8 matrices, respectively. Each matrix element has an improved difference value KH.yx, Upper improvement difference value DHyx, Lower improvement difference value DLyxIt is expressed. The improved difference value matrix KH is the improved difference value matrix KH shown in FIG. 2 of the first embodiment, and the pixel value PyxImproved difference value KH fromyxSince the compression process is the same as in the first embodiment, it is omitted here.
[0116]
Improved difference value KHyxAre separated into an upper bit string and a lower bit string by bit separation, and an upper improved differential value DH represented by the upper bit stringyxAnd lower refinement difference value DL represented by lower bit stringyxIs required. Here, the number of bits to be separated is 1 bit, and 1 bit is also represented as a bit string.
[0117]
For example, the improved difference value KH01The bit string of (= 6) is separated into an upper bit string and a lower bit string by bit separation, and an upper improved difference value DH represented by the upper bit string01Lower-order improved difference value DL represented by (= 3) and lower-order bit string01(= 0) is obtained. The bit separation will be described later.
[0118]
Upper improved difference value DH obtained by bit separationyxAre grouped and Huffman encoded based on the group table and Huffman table H. At this time, the upper improvement difference value DHyxIs the improved difference value KHyxThe value is smaller than. Therefore, the higher-order improved difference values KH arranged by the zigzag scan executed before Huffman coding.yxIn the one-dimensional column, the frequency of occurrence of zero runs increases and the zero run length (zero run length) becomes longer. Therefore, the upper improvement difference value KHyxThe number of bits of encoded data obtained by grouping and Huffman encoding for theyxLess than That is, the amount of information required for the encoded data can be reduced.
[0119]
The 1-bit bit separation will be described in detail with reference to FIGS. Therefore, the improved difference value KHyxIs represented by a bit string. One improved difference value KHyxUsually, 8 bits are allocated, but here 16 bits are allocated. Improved difference value KHyxTakes positive and negative values, and 1 bit is used as a sign bit in 16 bits.
[0120]
In FIG. 13, the improved differential value KH of FIG.01Bit separation for (= 6) is shown. Improved difference value KH01(= 6) is “00000110” in binary notation, and the sign bit F is “0” indicating positive. In the 16-bit bit string B0, the binary number “00000110” is represented using 8 bits from the right end. The sign bit F that is “0” is placed in the most significant bit at the left end of the bit string B0. Improved difference value KH01Since (= 6) is a positive value, the unused 7-bit J0 is “0000000”.
[0121]
Improved differential value KH by executing bit separation01The bit string of (= 6) is subjected to a right shift operation. A right shift operation is an operation that shifts each bit in a bit string to the right by a specified number of bits. When a 1-bit right shift operation is performed, each bit is moved one by one to the right, and the least significant bit K at the right end that is “0” is separated. A sign bit F that is “0” is filled in the most significant bit at the left end that has been left blank by the right shift operation.
[0122]
In this way, the bit string B0 is converted into the bit string B1 representing the binary number “0000011” using 7 bits by the right shift operation. This bit string B1 is the upper bit string, and the value representing the binary number “00000011” in decimal notation is the upper improved difference value DH.01It becomes the value of. That is, the upper improvement difference value DH01The value of is 3.
[0123]
On the other hand, the least significant bit K separated by the right shift operation is a low-order bit string, and the value representing the binary number “0” in decimal notation is the lower-order improved difference value DL.01Is the value of That is, the lower refinement difference value DL01The value of is 0.
[0124]
Thus, the improved difference value KH01The bit string B0 of (= 6) is separated into a bit string B1 which is an upper bit string and a least significant bit K which is a lower bit string by bit separation, and the upper improved difference value DH01(= 3) and lower improvement difference value DL01(= 0) is obtained.
[0125]
By executing the bit separation as described above, the improved difference value KHyxAre divided into an upper bit string and a lower bit string, and the upper improved difference value DH represented by the upper bit stringyxAnd lower refinement difference value DL represented by lower bit stringyxIs required.
[0126]
Improved difference value KH that is negativeyxIn the same way, bit separation is performed. However, the sign bit F indicates “1The 7-bit J0 that is not used is “1111111”. When 2-bit and 3-bit bit separation is performed, a 2-bit and 3-bit right shift operation is performed.
[0127]
FIG. 14 is a flowchart showing the n-bit bit separation procedure for the improved difference value KH. A bit separation flowchart will be described with reference to FIGS.
[0128]
In step 301, the subscript y is set to zero. In step 302, the subscript x is set to 0, and the leftmost improved difference value KH in the row representing the horizontal direction of the matrix.yxAre subject to bit separation. Improved difference value KH00(= 2) is the first bit separation target.
[0129]
In step 303, the improved difference value KHyxN-bit right shift operation is performed to perform n-bit bit separation on the higher-order improved difference value DHyxIs required.
[0130]
For example, in the case of 1-bit bit separation, the improved difference value KH01The bit string of (= 6) is shifted right by 1 bit, and the higher-order improved difference value DH01(= 3) is obtained. In the case of 3-bit bit separation, the improved difference value KH01The bit string of (= 6) is 3-bit right shifted, and the higher-order improved difference value DH01(= 0) is obtained.
[0131]
In step 304, the lower refinement difference value DLyxIs required. Lower improvement difference value DLyxAn arithmetic expression for obtaining is as shown in Expression (15).
[0132]
DLyx= KHyx-(DHyx× 2n(15)
[0133]
For example, in the case of 1-bit bit separation, the improved difference value KH01Upper improved difference value DH for (= 6)01Since the value of is 3, the lower level improvement difference value DL01Is
DL01= 6- (3 × 21) = 0
It becomes.
[0134]
In the case of 3-bit bit separation, the improved difference value KH01Upper improved difference value DH for (= 6)01Since the value of is 0, the lower-order improved difference value DL01Is
DL01= 6- (0x2Three) = 6
It becomes.
[0135]
In step 305, 1 is added to the subscript x. That is, the improved difference value KH on the right oneyxAre subject to bit separation.
[0136]
In step 306, it is determined whether or not the subscript x is 8. That is, all the improved difference values KH for one rowyxIt is determined whether or not the bits are separated. If it is determined that the subscript x is 8, the process proceeds to step 307. If it is determined that the subscript x is not 8, the process returns to step 303.
[0137]
In step 307, 1 is added to the subscript y. That is, the improved difference value KH of the next lower rowyxAre subject to bit separation.
[0138]
In step 308, it is determined whether or not the subscript y is 8. That is, all the improved difference values KHyxIs bit-separated. If it is determined that the subscript y is 8, the series of bit separation ends. If it is determined that the subscript y is not 8, the process returns to step 302.
[0139]
Thus, in the second embodiment,,Unlike the first embodiment, the improved difference value KHyxBit separation is performed after obtaining the above, and the higher-order improved difference value obtained by the bit separation is encoded. By performing bit separation in the compression process, the amount of information required for the encoded data can be reduced, and the image can be compressed efficiently.
[0140]
FIG. 15 is a block diagram of an image expansion apparatus applied in the second embodiment. In this image expansion device,The image data compressed by the image compression apparatus in the second embodiment is restored.
[0141]
The compressed image data of the luminance data Y and the color difference data Cb and Cr is read from the compressed image data recording area M1 of the recording medium M and sent to the image expansion device 40. The image decompression apparatus 40 includes a Huffman decoding unit 41, a group synthesis unit 42, a bit synthesis unit 43, a difference value restoration unit 44, a pixel data restoration unit 45, and a predicted value generation unit 46.
[0142]
The codeword obtained by removing the additional bits from the compressed image data of the luminance data Y and the color difference data Cb and Cr is decoded by the Huffman decoding unit 41. That is, the group number is obtained from the code word by referring to the Huffman table H. This decoding is the reverse of Huffman coding.
[0143]
By referring to the group table T based on the group number and additional bits obtained by decoding, the higher-level improved difference value is obtained in the group combining unit 42.
[0144]
The upper improvement difference value of the luminance data Y and the color difference data Cb and Cr and the lower improvement difference value read from the lower recording area M2 of the recording medium M are bit-combined in the bit combining unit 43, and the improved difference value is restored.
[0145]
The improved difference value between the luminance data Y and the color difference data Cb and Cr is converted into a difference value by the difference value restoring unit 44. By using the difference value and the predicted value generated by the predicted value generation unit 46, pixel data is generated by the pixel data restoration unit 45. That is, the pixel data is obtained from the difference between the predicted value generated based on the already restored pixel data and the difference value. The obtained pixel data is sent to the predicted value generation unit 46, and is used to calculate a predicted value for the pixel data to be restored next.
[0146]
By sequentially restoring the pixel data, the image data of the luminance data Y and the color difference data Cb and Cr is restored, and the image data is sent to the image memory 19.
[0147]
A decompression process for the compressed image data of the luminance data Y will be described with reference to FIG.
[0148]
In FIG. 16, the upper improved difference value matrix DH, the lower improved difference value matrix DL, and the improved difference value matrix KH are illustrated as an 8 × 8 matrix. The elements of each matrix are respectively higher improvement difference values DHyx, Lower improvement difference value DLyx, Improved difference value KHyxIt is expressed.
[0149]
Upper improvement difference value and corresponding lower improvement difference valueDL yx Are bit-combined and improved difference value KHyxIs restored. Here, the number of bits to be synthesized is 1 bit.
[0150]
For example, upper improvement difference value DH01(= 3) and lower improvement difference value DL01(= 0) is bit-combined, and the improved difference value KH01(= 6) is restored. The bit composition will be described later.
[0151]
The decompression process from the improved difference value KH to the image data is the same as that of the first embodiment as shown in FIG.
[0152]
The bit composition of n bits will be described in detail with reference to FIGS. Therefore, upper improvement difference value DHyxIs represented by a bit string.
[0153]
In FIG. 17, the higher-order improved difference value DH01(= 3) and lower improvement difference value DL01This shows 1-bit bit composition for (= 0).
[0154]
Upper improvement difference value DH01(= 3) is represented by a 16-bit bit string B1 as shown in FIG. Lower improvement difference value DL01(= 0) is a binary number “0”, and is represented by a lower bit string K1.
[0155]
Due to the execution of bit composition, the higher-order improved difference value DH01The bit string B1 of (= 3) is left-shifted. The left shift operation is an operation that shifts each bit to the left by a specified number of bits. When a 1-bit left shift operation is performed, each bit is moved to the left one by one, and the leftmost “0” sign bit F is separated. Then, the lowermost bit string K1 which is “0” is applied to the least significant bit at the right end which has become blank by the left shift operation. Also, the second bit “0” from the left end, which is “0”, is moved to the most significant bit at the left end and becomes the sign bit F.
[0156]
By the left shift operation, the bit string B1 is converted into a bit string B0 representing the binary number “00000110” using 8 bits. The value representing the binary number “00000110” in decimal notation is the improved difference value KH01It becomes. That is, the improved difference value KH01The value of is 6.
[0157]
Thus, the higher-order improved difference value DH01(= 3) and lower improvement difference value DL01(= 0) bit synthesized and improved difference value KH01(= 6) is restored.
[0158]
When 2-bit and 3-bit bit synthesis is executed, a 2-bit and 3-bit left shift operation is executed.
[0159]
FIG. 18 shows the upper improvement difference value DHyxAnd lower improvement difference value DLyx5 is a flowchart showing a procedure of n-bit bit synthesis for. The bit composition flowchart will be described with reference to FIGS.
[0160]
In step 401, y representing the position in the vertical direction is set to zero. In step 402, the subscript x representing the position in the horizontal direction is set to 0, and the leftmost upper improvement difference value DH in the row representing the horizontal direction of the matrix.yxAnd lower improvement difference value DLyxAre subject to bit synthesis. Upper improvement difference value DH00And lower improvement difference value DL00Is the target of the first bit composition.
[0161]
In step 403, the higher refinement difference value DHyxN-bit left shift operation is performed on the improved difference value KHyxIs required. Improved difference value KHyxAn arithmetic expression for obtaining is as shown in Expression (16).
[0162]
KHyx= DHyx× 2n+ DLyx        (16)
[0163]
For example, in the case of 1-bit bit synthesis, the higher-order improved difference value DH01(= 3) and lower improvement difference value DL01Improved difference value KH with respect to (= 0)01The value of
D01= 3 × 21+ 0 = 6
It becomes.
[0164]
For example, in the case of bit synthesis of 3 bits, the upper improved difference value DH01(= 0) and lower refinement difference value DL01Improved difference value KH for (= 6)01The value of
D01= 0x2Three+ 6 = 6
It becomes.
[0165]
In step 404, 1 is added to the subscript x. As a result, the higher-order improved difference value DH to be bit-synthesizedyxAnd lower improvement difference value DLyxIs the higher-order improved difference value DH on the rightyxAnd lower improvement difference value DLyxMoved to.
[0166]
In step 405, it is determined whether or not the subscript x is 8. That is, all the high-order improved difference values DH for one horizontal rowyxAnd lower improvement difference value DLyxIt is determined whether or not the bits are combined. If it is determined that the subscript x is 8, the process proceeds to step 406. If it is determined that the subscript x is not 8, the process returns to step 403.
[0167]
In step 406, 1 is added to the subscript j. That is, the upper improvement difference value DH to be bit-combinedyxAnd lower improvement difference value DLyxIs the upper improvement difference value DH in the next lower rowyxAnd lower improvement difference value DLyxMoved to.
[0168]
In step 407, it is determined whether or not the subscript y is 8. That is, all the upper improvement difference values DHyxAnd lower improvement difference value DLyxIt is determined whether or not the bits are combined. If it is determined that the subscript y is 8, the bit synthesis for one upper improved difference value matrix DH and lower improved difference value matrix DL ends. If it is determined that the subscript y is not 8, the process returns to step 402.
[0169]
As described above, according to the second embodiment, bit separation is performed to obtain the improved difference value as the higher-order improved difference value DH.yxAnd lower improvement difference value DLyxBy separating them into two, it is possible to reduce the amount of information necessary for the encoded data. That is, the image can be efficiently compressed. Also, bit synthesis is performed to obtain the higher-order improved difference value DHyxAnd lower improvement difference value DLyxImproved difference value KH fromyxBy restoring the image, the image can be restored without distortion.
[0170]
19 to 26 are diagrams relating to an image compression apparatus and an image expansion apparatus according to the third embodiment.
[0171]
FIG. 19 is a block diagram of an image compression apparatus according to the third embodiment.
[0172]
As in the first embodiment, the light of the subject image 16 is formed on the image sensor 18 via the lens 17, and an image signal is generated by photoelectric conversion in the image sensor 18. The image signal is converted from an analog signal into a digital signal by an A / D converter, and converted into luminance data Y and color difference data Cb and Cr by a signal processing circuit (not shown). The luminance data Y and the color difference data Cb and Cr are recorded in the image memory 19 as image data.
[0173]
Image data of luminance data Y and color difference data Cb and Cr is divided into a plurality of blocks on one screen and processed in units of blocks. Each block consists of 8 × 8 pixel data.
[0174]
Image data of luminance data Y and color difference data Cb, Cr is read from the image memory 19 and sent to the image compression apparatus 50. The image compression apparatus 50 includes a bit separation unit 51, a prediction value generation unit 52, a difference value generation unit 53, an improved difference value generation unit 54, a group unit 55, and a Huffman encoding unit 56.
[0175]
The luminance data Y and the color difference data Cb, Cr image data represented by a binary bit string are separated into upper image data and lower image data by the bit separation unit 51. The lower image data is recorded in the lower recording area M2 of the recording medium M without being compressed.
[0176]
A predicted value is determined by the predicted value generation unit 52 based on the upper pixel data of the luminance data Y and the color difference data Cb and Cr in each block. The predicted value is a value obtained by predicting the value of upper pixel data to be encoded (compressed) based on adjacent upper pixel data.
[0177]
The upper pixel data of the luminance data Y and the color difference data Cb and Cr is converted into a difference value by the difference value generation unit 53. The difference value is obtained by subtracting the actual pixel data value from the predicted value obtained in the predicted value generation unit 52.
[0178]
The difference value is converted into an improved difference value by the improved difference value generation unit 54. The improved difference value is calculated based on the pixel data and the predicted value, and is used as an encoding target instead of the difference value.
[0179]
The improved difference values of the luminance data Y and the color difference data Cb, Cr are grouped based on the group table T in the group unit 55, and the group number of the group to which the improved difference value belongs and the additional bits corresponding to the group number are obtained. .
[0180]
By referring to the Huffman table H based on the group number obtained in the group unit 55, the code word is obtained in the Huffman encoding unit 56. Then, compressed image data (encoded data) obtained by combining the code word and the additional bits obtained in the group unit 55 is recorded on the recording medium M.
[0181]
A compression process for one pixel block will be described with reference to FIGS. However, the pixel block of the luminance data Y is targeted.
[0182]
In FIG. 20, the pixel block P, the upper pixel block PH, and the lower pixel block PL are shown in an 8 × 8 matrix. Each matrix element has a pixel value Pyx, Upper pixel value PHyx, Lower pixel value PLyxIt is expressed.
[0183]
Each pixel value PyxAre separated into an upper bit string and a lower bit string by bit separation, and an upper pixel value PH represented by the upper bit stringyxAnd lower pixel value PL represented by lower bit stringyxIs required. Here, the number of bits to be separated is 1 bit.
[0184]
For example, the pixel value P01(= 153) is separated into an upper bit string and a lower bit string by bit separation, and an upper pixel value PH represented by the upper bit string01Lower pixel value PL represented by (= 76) and lower bit string01(= 1) is obtained.
[0185]
In FIG. 21, the upper pixel block PH, the prediction value matrix E, the difference value matrix H, and the improved difference value matrix KH are illustrated as an 8 × 8 matrix. Each matrix element has an upper pixel value PH.yx, Predicted value Eyx, Difference value Hyx, Improved difference value KHyxIt is expressed.
[0186]
As in the first embodiment, the upper pixel value PHyxBased on the predicted value EyxIs required. Here, the upper pixel value PH to be encodedyxThe upper pixel value PH next toyx-1Is the predicted value EyxIt becomes.
[0187]
For example, the upper pixel value PH to be encoded01The upper pixel value P that is one left next to (= 76)00(= 79) is the predicted value E01(= 79).
[0188]
Next, the predicted value EyxAnd the corresponding actual upper pixel value PHyxBased on the upper pixel value PHyxIs the difference value HyxIs converted to That is, the upper pixel value P from the predicted value EyxIs subtracted and the difference value HyxIs required.
[0189]
For example, the predicted value E01(= 79) to upper pixel value P01= (76) is subtracted to obtain the difference value H01(= 3) is obtained.
[0190]
Difference value HyxIs the predicted value EyxAnd pixel value PyxImproved difference value KH based onyxIs converted to Improved difference value KHyxIs any value in the range of −64 to 63, and the difference value HyxInstead of. For example, the difference value Htwenty two(= 69) is the improved difference value KHtwenty two(= 56).
[0191]
The improved difference value KH is grouped and Huffman encoded based on the group table T and the Huffman table H, whereby encoded data is obtained.
[0192]
FIG. 22 is a flowchart showing a procedure for obtaining one improved difference value matrix KH when n-bit bit separation is performed on the upper pixel block PH. Improved difference value KH using FIG. 21 and FIG.yxThe procedure for obtaining is described.
[0193]
In step 501, the subscript y is set to zero. In step 502, the subscript x is set to 0, and the obtained improved difference value KHyxIs the leftmost improved difference value KH in the row representing the horizontal direction of the matrixyxTo be determined. That is, the improved difference value KH00(= 1) is determined first. Required improved difference value KHyxIs determined, the process proceeds to step 503 where the predicted value EyxValue of 27-nIt is determined whether or not this is the case.
[0194]
In step 503, the predicted value Eyx27-nIf it is determined that the above is true, the process proceeds to step 504. In step 504, the upper pixel value PHyx(17)
PHyx<2 x Eyx-28-n+1 (17)
It is determined whether or not the above is satisfied. Upper pixel value PHyxWhen it is determined that satisfies the expression (17), the process proceeds to step 506. Upper pixel value PHyxIs determined not to satisfy the expression (17), the process proceeds to step 505 and the improved difference value HyxIs obtained by equation (18).
KHyx= Eyx-PHyx              (18)
Improved difference value KHyxIs obtained, the process proceeds to step 513.
[0195]
In step 506, the upper pixel value PHyxIt is determined whether or not is an even number. Upper pixel value PHyxIs determined to be an even number, the process moves to step 507, and the improved difference value KHyxIs obtained by equation (19).
KHyx= PHyx/ 2-27-n        (19)
Upper pixel value PHyxIf it is determined that is not an even number, the process moves to step 508, and the improved difference value KHyxIs obtained by the equation (20).
KHyx= 27-n-(PHyx+1) / 2 (20)
Improved difference value KHyxIs obtained, the process proceeds to step 513.
[0196]
For example, the upper pixel value PH that is an odd number obtained by 1-bit bit separationtwenty two(= 15) and predicted value Etwenty twoImproved difference value KH for (= 84)yxIs from equation (20)
KHtwenty two= 26− (15 + 1) / 2 = 56
It is.
[0197]
In step 503, the predicted value Eyx27-nIf it is determined that the value is not the above, the process proceeds to step 509. In step 509, the upper pixel value PHyxIs satisfied whether or not (21) is satisfied.
PHyx> 2 × Eyx                    (21)
Upper pixel value PHyxMoves to step 510. Upper pixel value PHyxIs determined not to satisfy the above equation, the process proceeds to step 505 and the improved difference value KHyxIs obtained by equation (18). Improved difference value KHyxIs obtained, the process proceeds to step 513.
[0198]
In step 510, the upper pixel value PHyxWhether or not is an even number is determined. Upper pixel value PHyxIf it is determined that is not an even number, the process proceeds to step 511 and the improved difference value KHyxIs obtained by equation (22).
KHyx=-(PHyx+1) / 2 (22)
Upper pixel value PHyxIs determined to be an even number, the process proceeds to step 512, and the improved difference value KHyxIs obtained by equation (23).
KHyx= PHyx/ 2 (23)
Improved difference value KHyxIs obtained, the process proceeds to step 513.
[0199]
For example, the upper pixel value PH that is an odd number obtained by 1-bit bit separation45(= 81) and the corresponding predicted value E45(= 11), improved difference value KHyxFrom equation (22)
KH45=-(81 + 1) / 2 = -41
It becomes.
[0200]
In step 513, 1 is added to the subscript x. That is, the required improved difference value KHyxImproved difference value KH right next toyxTo be determined.
[0201]
In step 514, it is determined whether or not the subscript x is 8. That is, one improved difference value KHyxIs determined in a row. If it is determined that the subscript x is 8, the process proceeds to step 515. If it is determined that the subscript x is not 8, the process returns to step 503.
[0202]
In step 515, 1 is added to the subscript y. That is, the required improved difference value KHyxImproved difference value KH in the row below byyxTo be determined.
[0203]
In step 516, it is determined whether or not the subscript y is 8. That is, the improved difference value KHyxIt is determined whether or not all of them have been obtained. If it is determined that the subscript y is 8, the improved difference value KHyxThe calculation for obtaining is finished. If it is determined that the subscript y is not 8, the process returns to step 502.
[0204]
As described above, in the third embodiment, unlike the first embodiment, the pixel value PyxBit separation is performed on theGainUpper pixel value PHyxCompression processing is performed. And improved difference value KHyxIs an improved difference value KH obtained without bit separation.yxAnd the zero run length becomes longer. Thus, in the compression process, the pixel value PyxBy separating the bits, the improved differential value KHyxTo encodeInThe amount of information required is small, and the image can be efficiently compressed.
[0205]
FIG. 23 is a block diagram of an image expansion apparatus according to the third embodiment.
[0206]
The compressed image data of the luminance data Y and the color difference data Cb and Cr is read from the compressed image data recording area M1 of the recording medium M and sent to the image expansion device 60. The image decompression device 60 includes a Huffman decoding unit 61, a group synthesis unit 62, a difference value restoration unit 63, an upper pixel data restoration unit 64, a bit synthesis unit 65, and a predicted value generation unit 66.
[0207]
The codeword obtained by removing the additional bits from the compressed image data of the luminance data Y and the color difference data Cb and Cr is decoded by the Huffman decoding unit 61. That is, the group number is obtained by referring to the Huffman table H based on the code word. This decoding is the reverse of Huffman coding.
[0208]
By referring to the group table T based on the group number and additional bits obtained by decoding, an improved difference value is obtained in the group combining unit 62.
[0209]
Based on the predicted value generated in the predicted value generation unit 66, the improved difference value between the luminance data Y and the color difference data Cb and Cr is converted into a difference value in the difference value restoration unit 63. The predicted value is obtained based on the upper pixel data restored by the upper pixel data restoration unit 64.
[0210]
Based on the difference value and the predicted value between the luminance data Y and the color difference data Cb and Cr, the upper pixel data is restored in the upper pixel data restoration unit 64. The restored upper pixel data is sent to the predicted value generation unit 66 and used to calculate a predicted value for the next restored higher pixel data.
[0211]
By restoring the upper pixel data, the upper image data of the luminance data Y and the color difference data Cb and Cr is restored.
[0212]
The upper image data of the luminance data Y and the color difference data Cb and Cr and the lower image data read from the lower recording area M2 of the recording medium M are bit-combined by the bit composition unit 65, and the image data is restored. The restored image data is sent to the image memory 19.
[0213]
The decompression process for the compressed image data will be described with reference to FIGS. Here, the compressed image data is targeted for the luminance data Y.
[0214]
In FIG. 24, the improved difference value matrix KH, the prediction value matrix E, the difference value matrix H, and the upper pixel block PH are illustrated as an 8 × 8 matrix. Each matrix element has an improved difference value KH.yx, Predicted value Eyx, Difference value Hyx, Upper pixel value PHyxIt is expressed.
[0215]
By referring to the Huffman table H and the group table T, the improved difference value KH is obtained from the compressed image data.yxIs required. And predicted value EyxImproved difference value KH inyxPossible range and difference value HyxThe difference value HyxIs restored.
[0216]
Difference value HyxAnd the corresponding predicted value EyxTo upper pixel value PHyxIs required. That is, the predicted value EyxTo difference value HyxIs subtracted so that the upper pixel value PHyxIs required.
[0217]
For example, predicted value E44Difference value H from (= 83)44By subtracting (= 72), the upper pixel value PH44(= 11) is restored.
[0218]
Reconstructed upper pixel value PHyxIs the next higher-order pixel value PH to be restored nextyxPredicted value E for calculatingyxIt becomes. And sequentially the upper pixel value PHyxIs restored, the upper pixel block PH is restored.
[0219]
In FIG. 25, the upper pixel block PH, the lower pixel block PL, and the pixel block P are illustrated as an 8 × 8 matrix. Each matrix element has an upper pixel value PH.yx, Lower pixel value PLyx, Pixel value PyxIt is expressed.
[0220]
Upper pixel value PHyxAnd the corresponding lower pixel value PLyxAre bit-combined and the pixel value PyxIs restored. Here, the number of bits to be synthesized is 1 bit.
[0221]
For example, the upper pixel value PH01(= 76) and lower pixel value PL01When (= 1) is bit-combined, the pixel value P01(= 153) is restored.
[0222]
In this way, the compressed image data is decompressed, and the image block P is restored.
[0223]
FIG. 26 shows the upper pixel value PH when n-bit bit separation is performed.yxIt is the flowchart which showed the procedure which calculates | requires. 24 and 26, the upper pixel value PHyxThe procedure for obtaining is described.
[0224]
In step 601, the subscript y is set to zero. In step 602, the subscript x is set to 0, and the upper pixel value PH to be restored is restored.yxIs the leftmost upper pixel value PH in the row representing the horizontal direction of the matrixyxTo be determined. Upper pixel value PH to be restoredyxIs determined, the process proceeds to step 603 and the predicted value Eyx27-nIt is determined whether or not this is the case.
[0225]
In step 603, the predicted value Eyx27-nIf it is determined that the above is true, the process proceeds to step 604. In step 604, the improved difference value KHyxWhether or not satisfies the equation (24).
Eyx-28-n+ 1 ≦ KHyx≦ 28-n-1-Eyx  ... (24)
Improved difference value KHyxIs determined to satisfy the expression (24), the process proceeds to step 605, where the upper pixel value PHyxIs obtained by equation (25).
PHyx= Eyx-KHyx                  ・ ・ ・ ・ ・ ・ (25)
Upper pixel value PHyxIs obtained, the process proceeds to step 613.
[0226]
For example, the improved differential value KH obtained when 1-bit bit separation is performed03(= 3) is the predicted value E03(= 79)
80-27= −48 ≦ 3 ≦ 27−80 = 48
(24) is satisfied. Therefore, the upper pixel value PH03Is from equation (25)
PH03= 79-3 = 76
It is.
[0227]
In step 604, the improved difference value KHyxIs determined not to satisfy the equation (24), the process proceeds to step 606, where the improved difference value KHyxWhether or not is equal to or greater than 0 is determined. Improved difference value KHyxIs determined to be greater than or equal to 0, the process proceeds to step 608, where the upper pixel value PHyxIs obtained by equation (26).
PHyx= 28-n-1-2 x KHyx        (26)
Improved difference value KHyxIf it is determined that is not greater than or equal to 0, the process proceeds to step 607, where the upper pixel value PHyxIs obtained by equation (27).
PHyx= KHyx× 2 + 28-n            (27)
Upper pixel value PHyxIs obtained, the process proceeds to step 613.
[0228]
In step 603, the predicted value Eyx27-nIf it is determined that the above is not true, the process proceeds to step 609. In step 609, the improved difference value KHyxWhether or not the inequality of the equation (28) is satisfied.
-Eyx≦ KHyx≦ Eyx                (28)
Improved difference value KHyxIs determined to satisfy the expression (28), the process proceeds to step 605, where the upper pixel value PHyxIs obtained by equation (25). Improved difference value KHyxIs determined not to satisfy the expression (28), the process proceeds to step 610.
[0229]
In step 610, the improved difference value KHyxWhether or not is equal to or greater than 0 is determined. Improved difference value KHyxIs determined to be greater than or equal to 0, the process proceeds to step 612, where the upper pixel value PHyxIs obtained by the equation (29).
PHyx= 2 × KHyx                (29)
Improved difference value KHyxIf it is determined that is not greater than or equal to 0, the process moves to step 611 and the upper pixel value PHyxIs obtained by the equation (30).
PHyx= -2 × KHyx-1 (30)
Upper pixel value PHyxIs obtained, the process proceeds to step 613.
[0230]
In step 613, 1 is added to the subscript x. That is, the restored upper pixel value PHyxIs the next higher pixel value PHyxTo be determined.
[0231]
In step 614, it is determined whether or not the subscript x is 8. That is, the upper pixel value PHyxIt is determined whether or not all have been restored in one row. If it is determined that the subscript x is 8, the process proceeds to step 615. If it is determined that the subscript x is not 8, the process returns to step 603.
[0232]
In step 615, 1 is added to the subscript y. That is, the restored upper pixel value PHyxIs the upper pixel value PH of the next lower rowyxTo be determined.
[0233]
In step 616, it is determined whether or not the subscript y is 8. That is, the upper pixel value PH in one pixel block PyxIt is determined whether or not all have been restored. If it is determined that the subscript y is 8, the upper pixel value PyxThe calculation for obtaining is finished. If it is determined that the subscript y is not 8, the process returns to step 602.
[0234]
As described above, according to the third embodiment, by separating the pixel value P into the upper pixel value PH and the lower pixel value PL, the amount of information necessary for the encoded data is reduced, and the image is efficiently processed. Can be compressed. In addition, an image can be restored without distortion by bit-combining the upper pixel value PH and the lower pixel value PL.
[0235]
27 to 34 are diagrams relating to an image expansion apparatus and an image compression apparatus according to the fourth embodiment.
[0236]
FIG. 27 shows a block diagram of an image compression apparatus according to the fourth embodiment.
[0237]
As in the first embodiment, the light of the subject image 16 is formed on the image sensor 18 via the lens 17. Image signals generated by photoelectric conversion in the image sensor 18 are processed by an A / D converter and a signal processing circuit, respectively, and converted into luminance data Y and color difference data Cb and Cr, and recorded in the image memory 19 as image data. Image data of luminance data Y and color difference data Cb, Cr is read from the image memory 19 and sent to the image compression device 70. The image compression apparatus 70 includes a prediction value generation unit 71, a difference value generation unit 72, an improved difference value generation unit 73, a bit separation unit 74, a group unit 75, and a Huffman encoding unit 76.
[0238]
Image data of luminance data Y and color difference data Cb and Cr is divided into a plurality of blocks on one screen and processed in units of blocks. Each block consists of 8 × 8 pixel data.
[0239]
Based on the pixel data of the luminance data Y and the color difference data Cb and Cr in each block, the predicted value is obtained by the predicted value generation unit 71. The predicted value is obtained based on pixel data adjacent to one pixel data to be encoded.
[0240]
Pixel data of the luminance data Y and the color difference data Cb and Cr is converted into a difference value by the difference value generation unit 72. That is, the difference value is obtained by subtracting the pixel data from the predicted value obtained in the predicted value generation unit 71.
[0241]
The difference value between the luminance data Y and the color difference data Cb and Cr is converted into an improved difference value by the improved difference value generation unit 73.
[0242]
The luminance data Y and the color difference data Cb, Cr are represented by binary bit strings in the image compression apparatus 70, and the improved difference values of the luminance data Y and the color difference data Cb, Cr are also represented by binary bit strings. The bit string of the improved difference value is bit-separated by the bit separation unit 74 and separated into a bit string (upper bit string) of the upper improved difference value and a bit string (lower bit string) of the lower improved difference value. Then, by adding an additional code bit to the bit string of the lower improvement difference value, a signed lower improvement difference value is obtained. The signed lower improvement difference value is recorded in the signed lower recording area M3 of the recording medium M without being encoded (compressed).
[0243]
The higher improvement difference values of the luminance data Y and the color difference data Cb, Cr are grouped based on the group table T in the group unit 75, and the group number of the group to which the higher improvement difference value belongs and the additional bits corresponding thereto are obtained.
[0244]
By referring to the Huffman table H based on the group number obtained in the group unit 75, the code word is obtained in the Huffman encoding unit 76. Then, the compressed image data obtained by combining the code word and the additional bits obtained in the group unit 75 is recorded in the compressed image data recording area M1 of the recording medium M.
[0245]
The compression process for the pixel block P will be described with reference to FIG.
[0246]
In FIG. 28, the improved difference value matrix KH, the upper improved difference value matrix DH, and the lower improved difference value matrix DL are illustrated as 8 × 8 matrices, respectively. Each matrix element has an improved difference value KH.yx, Upper improvement difference value DHyx, Lower improvement difference value DLyxIt is expressed. The improved difference value matrix KH is the improved difference value matrix KH shown in FIG. 2 of the first embodiment, and the pixel value PyxImproved difference value KH fromyxSince the compression process is the same as in the first embodiment, it is omitted here.
[0247]
Each improved difference value KHyxIs a higher-order improved difference value DH due to bit separation.yxAnd lower improvement difference value DLyxSeparated. That is, the improved difference value KHyxAre divided into an upper bit string and a lower bit string, and the upper improved difference value DH represented by the upper bit stringyxAnd lower refinement difference value DL represented by lower bit stringyxIs required. At this time, the improved difference value KH which is a positive valueyxIs bit-separated as it is, but the improved differential value KH which is a negative valueyxIs multiplied by -1 and converted into a positive value, and then separated into bits. Here, the number of bits to be separated is 1 bit.
[0248]
For example, upper improvement difference value KH02The bit string of (= −5) is divided into an upper bit string and a lower bit string after being multiplied by −1 to be converted into a value of 5, and an upper improved difference value DH represented by the upper bit string.02Lower-order improved difference value DL represented by (= 2) and lower-order bit string02(= 1) is obtained.
[0249]
And lower refinement difference value DLyxAn additional code bit is added to the lower bit string of. At this time, the improved difference value KH which is a positive valueyxPositive bit (+) when the bit string is bit-separated, an improved differential value KH that is a negative valueyxWhen the bit string of the bit string is separated, the negative additional sign bit (−)yxTo be added. Lower refinement difference value DL with positive or negative additional sign bit addedyxSigned lower-order improved difference value FLyxRepresent as
[0250]
For example, lower improvement difference value DL02By adding a negative additional sign bit (−) to the bit string of (= 1), a signed lower-order improved difference value FL02(= (−) 1) is obtained. However, signed lower improvement difference value FL02This indicates that the additional code bit (-) is added to the value of 1, not the value of -1.
[0251]
Upper improvement difference value DHyxAre grouped and Huffman encoded, thereby obtaining compressed image data.
[0252]
The bit separation incorporating the additional code bits will be described in detail with reference to FIGS. Therefore, the improved difference value KHyxIs represented by a bit string. Normal improvement difference value KHyxIs assigned 8 bits, but here, 8 bits are assigned in a 16-bit bit string. Also, improved difference value KHyxHas a positive or negative sign bit for taking a positive or negative value.
[0253]
In FIG. 29, the improved difference value KH02It shows 1-bit bit separation for (= -5).
[0254]
Improved difference value KH02(= −5) is “11111011” in binary notation, and the sign bit F is “1” indicating negative. In the 16-bit bit string, the binary number “11111011” is represented using 8 bits from the right end, and the sign bit F is placed in the most significant bit at the left end of the bit string A0. The unused 7-bit J0 is “1111111”.
[0255]
Improved difference value KH02(= −5) is multiplied by −1 to convert the value to 5, thereby converting the bit string A0 to the bit string A1. In the bit string A1, the binary number “00000101” is represented using 8 bits, and the sign bit F is “0” indicating positive. Furthermore, 7-bit J0 which is not used becomes “0000000”.
[0256]
By executing the bit separation, the bit string A1 is shifted to the right. The right shift operation is an operation in which each bit of a bit string is shifted to the right by a specified number of bits. When a 1-bit right shift operation is performed, each bit is moved one by one to the right, and the least significant bit K that is “1” is separated. Then, the sign bit F which is “0” is applied to the most significant bit at the left end which becomes blank by the right shift operation.
[0257]
By such a right shift operation, the bit string A1 is a binary number using 7 bits."000010"Is converted to a bit string A2. This bit string A2 is the upper bit string, and the value representing the binary number “0000010” in decimal notation is the upper improved difference value DH02It becomes the value of. That is, the upper improvement difference value DH02The value of is 2.
[0258]
On the other hand, the least significant bit K separated by the right shift operation is the lower order bit string, and the value of the least significant bit K is the lower order improved difference value DL.02It becomes the value of. Since the binary number “1” is 1 in decimal notation, the lower-order improved difference value DL02The value of is 1.
[0259]
Improved difference value KH02Since (= −5) is a negative value, the lower refinement difference value DL02An additional code bit F (−) is added to (= 1), and a signed lower-order improved difference value FL02(= (−) 1) is obtained. The additional code bit F (−) is “1” indicating negative.
[0260]
Thus, the improved difference value KH02The bit string of (= -5) is bit-separated after being multiplied by -1 and converted to a value of 5, and the higher-order improved difference value DH represented by the higher-order bit string02Lower level improvement difference value DL expressed by (= 2) and lower bit string02(= 1) is obtained. And lower refinement difference value DL02A negative additional sign bit F (−) is added to the bit string of (= 1), and a signed lower-order improved difference value FL02(= (−) 1) is obtained.
[0261]
Improved difference value KH which is a positive valueyxTo perform bit separation on the improved difference value KHyxAre bit separated as they are. And lower refinement difference value DL obtained by bit separationyxIs added with a positive additional sign bit F (+). The additional code bit F (+) is “0” indicating positive.
[0262]
As described above, the improved difference value KHyxAre divided into an upper bit string and a lower bit string, and the upper improved difference value DH represented by the upper bit stringyxAnd lower refinement difference value DL represented by lower bit stringyxIs required. And lower refinement difference value DLyxIs appended with an additional code bit F (+) or F (−).
[0263]
When performing 2-bit and 3-bit separation, a 2-bit and 3-bit right shift operation is performed.
[0264]
FIG. 30 is a flowchart showing a procedure of n-bit bit separation for one improved difference value matrix. A bit separation flowchart will be described with reference to FIGS.
[0265]
In step 701, the subscript y is set to zero. In step 702, the subscript x is set to 0, and the leftmost improved difference value KH in the row representing the horizontal direction of the matrix.yxAre subject to bit separation. First, improved differential value KH00(= 2) is the target of bit separation.
[0266]
In step 703, the improved difference value KHyxIt is determined whether or not the value of is greater than or equal to zero. Improved difference value KHyxIf it is determined that the value of is greater than or equal to 0, the process moves to step 704 where a positive additional sign bit F (+) is provided. Improved difference value KHyxIf it is determined that the value of is not greater than or equal to 0, the process moves to step 705.
[0267]
In step 705, a negative additional sign bit F (-) is provided. In step 706, the improved difference value KHyxIs multiplied by -1, and the improved difference value KHyxIs converted to a positive value.
[0268]
In step 707, the improved difference value KHyxN-bit right shift operation is performed on the higher-order improved difference value DHyxIs required.
[0269]
For example, in the case of 1-bit bit separation, the improved difference value KH02(= −5) is multiplied by −1 and is subjected to a right shift operation.02(= 2) is required. In the case of 3-bit bit separation, the improved difference value KH02(= −5) is multiplied by −1 and is subjected to a right shift operation.02(= 0) is obtained.
[0270]
In step 708, the lower refinement difference value DLyxIs required. Lower improvement difference value DLyxThe arithmetic expression for obtaining is as shown in Expression (31).
[0271]
DLyx= KHyx-(DHyx× 2n) ... (31)
[0272]
For example, in the case of 1-bit bit separation, the improved difference value KH after making the sign positive02(= 5) higher improvement difference value DH02Since the value of 2 is 2, the lower-order improved difference value DL02The value of
DL02= 5- (2 × 21) = 1
It becomes.
[0273]
For example, in the case of bit separation of 3 bits, the improved difference value KH after making the sign positive02(= 5) higher improvement difference value DH02Since the value of 0 is 0, the lower refinement difference value DL02The value of
DL02= 5- (0x2Three) = 5
It becomes.
[0274]
In step 709, the lower refinement difference value DLyxAre added with the additional code bit F (+) or the additional code bit F (−) provided in step 704 or step 705, and the signed lower quantized DCT coefficient FL is added.yxIs required.
[0275]
For example, lower improvement difference value DL02(= 1), the additional sign bit F (−) provided in step 705 is added, and the signed lower-order improved difference value FL02(= (−) 1) is obtained.
[0276]
In step 710, 1 is added to the subscript x. That is, the improved difference value KH on the right oneyxAre subject to bit separation.
[0277]
In step 711, it is determined whether or not the subscript x is 8. That is, all the improved difference values KH for one horizontal rowyxIt is determined whether or not the bits are separated. If it is determined that the subscript x is 8, the process proceeds to step 712. If it is determined that the subscript x is not 8, the process returns to step 703.
[0278]
In step 712, 1 is added to the subscript y. That is, the improved difference value KH of the next lower rowyxAre subject to bit separation.
[0279]
In step 713, it is determined whether or not the subscript y is 8. That is, all the improved difference values KHyxIt is determined whether or not the bits are separated. If it is determined that the subscript y is 8, the bit separation for the improved difference value matrix KH ends. If it is determined that the subscript y is not 8, the process returns to step 702.
[0280]
Thus, in the fourth embodiment, unlike the second embodiment, the improved difference value KH that is a negative value.yxIs multiplied by −1 to be converted into a positive value and then separated into bits. For this reason, the improved difference value KHyxIs −1, the higher-order improved difference value KH obtained by bit separation as it isyxIs a high-order improved differential value KH obtained by multiplying by -1 and then separating bits.yxBecomes 0. That is, since the frequency of occurrence of zero runs increases, the amount of information necessary for encoded data decreases. Therefore, the image can be efficiently compressed.
[0281]
FIG. 31 is a block diagram of an image expansion apparatus to which the fourth embodiment is applied. In this image expansion device, the image data compressed by the image compression device in the fourth embodiment is restored.
[0282]
The compressed image data of the luminance data Y and the color difference data Cb and Cr are read from the compressed image data recording area M1 of the recording medium M and sent to the image expansion device 80. The image expansion device 80 includes a Huffman decoding unit 81, a group synthesis unit 82, a bit synthesis unit 83, a difference value restoration unit 84, a predicted value generation unit 86, and a pixel data restoration unit 85.
[0283]
The code word obtained by removing the additional bits from the compressed image data of the luminance data Y and the color difference data Cb and Cr is decoded by the Huffman decoding unit 81. That is, the group number is obtained from the code word by referring to the Huffman table H. This decoding is the reverse of Huffman coding.
[0284]
By referring to the group table T based on the group number and additional bits obtained by decoding, the higher-level improved difference value is obtained in the group combining unit 82.
[0285]
The upper improvement difference value of the luminance data Y and the color difference data Cb and Cr and the lower improvement difference value obtained by removing the additional code bit from the signed lower improvement difference value read from the signed lower recording area M3 of the recording medium M are bit-combined. Bit synthesis is performed in the unit 83, whereby the improved difference value is restored.
[0286]
The improved difference value between the luminance data Y and the color difference data Cb, Cr is converted into a difference value by the difference value restoring unit 84. Pixel data is generated in the pixel data restoring unit 85 by using the difference value and the predicted value generated in the predicted value generating unit 86. That is, the pixel data is obtained from the difference between the predicted value generated based on the already restored pixel data and the difference value. The obtained pixel data is sent to the predicted value generation unit 86, and is used to calculate a predicted value for the pixel data to be restored next.
[0287]
By sequentially restoring the pixel data, the image data of the luminance data Y and the color difference data Cb and Cr is restored, and the image data is sent to the image memory 19.
[0288]
Decompression processing for compressed image data will be described with reference to FIG. In the following, the compressed image data of the luminance data Y is targeted.
[0289]
In FIG. 32, the signed lower improved difference value matrix FL, lower improved difference value matrix DL, upper improved difference value matrix DH, and improved difference value matrix KH shown in FIG. Illustrated. Each matrix element is a signed lower refinement difference value FL.yx, Lower improvement difference value DLyx, Upper improvement difference value DHyx, Improved difference value KHyxIt is expressed.
[0290]
Signed lower improvement value FLyxLower-order improved difference value DL with additional code bits removed fromyxAre subject to bit synthesis. Upper improvement difference value DHyxAnd the corresponding lower-level improved difference value DLyxIs improved by combining bits with the improved difference value KH.yxIs restored. However, the lower-order improved difference value DL to which the negative additional sign bit (−) was addedyxIs the target of the bit composition, the improved difference value KH to be restoredyxIs multiplied by -1 and converted to a negative value. Here, the number of bits to be synthesized is 1 bit.
[0291]
For example, upper improvement difference value DH02Lower-order improved difference value DL to which (= 2) and a negative additional sign bit (−) are added02(= 1) is bit-combined and multiplied by −1 to obtain an improved difference value KH02(= -5) is restored.
[0292]
Improved difference value KHyxTo pixel value PyxSince the decompression process up to is the same as that of the first embodiment shown in FIG. 9, it is omitted here.
[0293]
The bit synthesis of 1 bit will be described in detail with reference to FIGS. Therefore, upper improvement difference value DHyxIs represented by a bit string.
[0294]
In FIG. 33, the upper improvement difference value DH of FIG.02(= 2) and lower refinement difference value DL02This shows 1-bit bit composition for (= 1).
[0295]
Upper improvement difference value DH02(= 2) represents the binary number “0000010” using 7 bits in the 16-bit bit string A2. Lower improvement difference valueDL 02 (= 1) is “1” in binary and is represented by the lower bit string K1.
[0296]
Due to the execution of bit composition, the higher-order improved difference value DH02The bit string A2 of (= 2) is left-shifted. The left shift operation is an operation for moving each bit to the left by a specified number of bits. When the left shift operation of 1 bit is executed, each bit is moved to the left one by one in the bit string A2, and the leftmost “0” sign bit F is separated. Then, the lower-order bit string K1 which is “1” is applied to the least significant bit at the right end which is left blank by the left shift operation. Further, the second bit “0” from the left end, which is “0”, is moved to the most significant bit by the left shift operation and becomes the sign bit F.
[0297]
By such a left shift operation, the bit string A2 is converted into a bit string A1 representing the binary number “00000101” using 8 bits. When the binary number “00000101” is expressed in decimal notation, the value is 5, but the lower refinement difference value DLyxSince the negative additional sign bit F (−) is added to (= 1), the value of 5 is multiplied by −1. By this multiplication, the bit string A1 is converted into a bit string A0 in which the negative sign bit F is placed in the most significant bit and the binary number “11111011” is represented using 8 bits. The value representing the binary number “11111011” in decimal notation is the improved difference value KH.02It becomes. That is, if the negative sign bit F is considered, the improved difference value KH02The value of is -5.
[0298]
Thus, the higher-order improved difference value DH02(= 2) and lower refinement difference value DL02(= 1) is bit-combined and multiplied by −1 corresponding to the additional code bit F (−), so that the improved difference value KH02(= -5) is restored.
[0299]
Lower refinement difference value DL that is the target of bit compositionyxWhen a positive additional sign bit F (+) is added to the bit number, the binary value represented in the bit string obtained by the left shift operation is the improved difference value KH.yxIt becomes the value of.
[0300]
When 2-bit and 3-bit bit synthesis is executed, a 2-bit and 3-bit left shift operation is executed.
[0301]
FIG. 34 is a flowchart showing a procedure of bit synthesis of n bits for the upper improved difference value matrix and the lower improved difference value matrix. A bit composition flowchart will be described with reference to FIGS. 32 and 34.
[0302]
In step 801, the subscript y is set to zero. In step 802, the subscript x is set to 0, and the leftmost upper improved difference value DH in the row representing the horizontal direction of the matrix.yxAnd lower improvement difference value DLyxAre subject to bit synthesis. Upper improvement difference value DH00And lower improvement difference value DL00Is the target of the first bit composition.
[0303]
In step 803, the upper improvement difference value DHyxAn n-bit left shift operation is performed on the bit string of the lower-order improved difference value DLyxImproved difference value KH by addingyxIs required. Improved difference value KHyxThe arithmetic expression for obtaining is as shown in Expression (32).
[0304]
KHyx= DHyx× 2n+ DLyx... (32)
[0305]
For example, when performing 1-bit bit synthesis, the higher-level improved difference value DH02(= 2) and lower refinement difference value DL02Improved difference value KH with respect to (= 1)02The value of
KH02= 2x21+ 1 = 5
It becomes.
[0306]
For example, when performing 3-bit bit synthesis, the higher-order improved difference value DH02(= 0) and lower refinement difference value DL02Improved difference value KH for (= 5)02The value of
KH02= 0x2Three+ 5 = 5
It becomes.
[0307]
In step 804, the lower refinement difference value DLyxIt is determined whether or not the additional code bit added to is a positive additional code bit (+). If it is determined that it is not a positive additional sign bit (+), the process proceeds to step 805 and the improved difference value KHyxIs multiplied by -1 and converted to a negative value. If it is determined that the bit is a positive additional sign bit (+), the process proceeds to step 806.
[0308]
In step 806, 1 is added to the subscript x. That is, the next higher-level improved difference value DHyxAnd lower improvement difference value DLyxAre subject to bit synthesis.
[0309]
In step 807, it is determined whether or not the subscript x is 8. That is, all the high-order improved difference values DH for one rowyxAnd lower improvement difference value DLyxIt is determined whether or not the bits are combined. If it is determined that the subscript x is 8, the process proceeds to step 808. If it is determined that the subscript x is not 8, the process returns to step 803.
[0310]
In step 808, 1 is added to the subscript y. That is, the upper improvement difference value DH in the next lower rowyxAnd lower improvement difference value DLyxAre subject to bit synthesis.
[0311]
In step 809, it is determined whether or not the subscript y is 8. That is, all the upper improvement difference values DHyxAnd lower improvement difference value DLyxIt is determined whether or not the bits are combined. If it is determined that the subscript y is 8, the series of bit synthesis ends. If it is determined that the subscript y is not 8, the process returns to step 802.
[0312]
As described above, according to the fourth embodiment, the improved difference value KHyxIs positive, when it is negative, it is converted to a positive value and separated into bits, and the higher-order improved difference value DHyxAnd signed lower-order improved difference value FLyxTherefore, the amount of information necessary for the encoded data can be reduced. Also, the upper improvement difference value DHyxAnd signed lower-order improved difference value FLyxBit synthesis based on the improved difference value KHyxBy restoring the original image, the original image can be restored without distortion.
[0313]
【The invention's effect】
As described above, according to the present invention, a high-resolution image can be compressed and expanded without distortion and can be efficiently compressed.
[Brief description of the drawings]
FIG. 1 is a block diagram of an image compression apparatus according to a first embodiment.
FIG. 2 is a diagram illustrating a pixel block, a prediction value matrix, a difference value matrix, and an improved difference value matrix.
FIG. 3 is a diagram showing a group table and a Huffman table.
FIG. 4 is a table showing possible ranges of pixel values, difference values, and improved difference values when the predicted value is 14. FIG.
FIG. 5 is a diagram showing a range that can be taken by a pixel value, a difference value, and an improved difference value when the predicted value is 14, by a bar line;
FIG. 6 is a diagram illustrating a probability that a difference value is actually obtained with respect to a predicted value.
FIG. 7 is a flowchart showing a procedure for obtaining an improved difference value.
FIG. 8 is a block diagram of an image expansion apparatus according to the first embodiment.
FIG. 9 is a diagram illustrating an improved difference value matrix, a difference value matrix, a predicted value matrix, and a pixel block.
FIG. 10 is a flowchart illustrating a procedure for restoring pixel values.
FIG. 11 is a block diagram of an image compression apparatus according to a second embodiment.
FIG. 12 is a diagram showing an improved difference value matrix, an upper improved difference value matrix, and a lower improved difference value matrix.
FIG. 13 is a diagram showing bit separation of an improved difference value.
FIG. 14 is a flowchart showing a procedure of bit separation.
FIG. 15 is a block diagram of an image expansion apparatus according to a second embodiment.
FIG. 16 is a diagram showing an upper improvement difference value matrix, a lower improvement difference value matrix, and an improvement difference value matrix;
FIG. 17 is a diagram showing bit composition for a higher improvement difference value and a lower improvement difference value.
FIG. 18 is a flowchart showing a procedure of bit composition.
FIG. 19 is a block diagram of an image compression apparatus according to a third embodiment.
FIG. 20 is a diagram illustrating a pixel block, an upper pixel block, and a lower pixel block.
FIG. 21 is a diagram illustrating an upper pixel block, a prediction value matrix, a difference value matrix, and an improved difference value matrix.
FIG. 22 is a flowchart showing a procedure for obtaining an improved difference value.
FIG. 23 is a block diagram of an image expansion apparatus according to a third embodiment.
FIG. 24 is a diagram showing an improved difference value matrix, a difference value matrix, an upper pixel block, and a prediction value matrix.
FIG. 25 is a diagram illustrating an upper pixel block, a lower pixel block, and a pixel block.
FIG. 26 is a flowchart illustrating a procedure for restoring pixel values.
FIG. 27 is a block diagram of an image expansion apparatus according to a fourth embodiment.
FIG. 28 is a diagram showing an improved difference value matrix, an upper improved difference value matrix, a lower improved difference value matrix, and a signed lower improved difference value matrix.
FIG. 29 is a diagram showing bit separation for an improved difference value.
FIG. 30 is a flowchart showing a procedure for bit separation.
FIG. 31 is a block diagram of an image expansion apparatus according to a fourth embodiment.
FIG. 32 is a diagram showing a signed lower improved difference value matrix, lower improved difference value matrix, higher improved difference value matrix, and improved difference value matrix;
FIG. 33 is a diagram showing bit composition for a higher improvement difference value and a lower improvement difference value.
FIG. 34 is a flowchart showing a procedure of bit composition.
[Explanation of symbols]
LA partial range (first partial range)
LB partial range (second partial range)
LC partial range (third partial range)
LD partial range (fourth partial range)
LE partial range (fifth partial range)
LF integer range (non-difference value range)

Claims (14)

入力される静止画像に対応した、複数の画素データによって構成される画像データについて、各画素データ毎に、隣接する画素データに基いて予測値を求める予測値生成手段と、
前記予測値と前記画素データの画素値との差分である差分値のとりうる範囲に基づいて定められる改良差分値のとりうる範囲に従い、前記画素値および前記予測値に基づいて改良差分値を生成する改良差分値生成手段と、
前記改良差分値を符号化することにより、圧縮画像データを求める符号化手段と、
前記圧縮画像データを記録媒体に記録する記録手段とを備え、
前記改良差分値のとりうる範囲が、前記画素値のとりうる範囲の中で前記予測値より大きい非差分値の範囲の値に対し、正負の符号を変えるように反転させ、さらに、前記差分値のとりうる範囲の中で絶対値が前記非差分値の部分的範囲と等しい範囲において、前記正負が反転された非差分値の範囲の値と前記部分的範囲の値を、絶対値の小さい順で正負の値が交互に現れるように並べることにより規定され、
前記改良差分値生成手段が、前記予測値に基づいて定められる、前記画素値のとりうる範囲と、前記差分値のとりうる範囲と、前記改良差分値のとりうる範囲との対応関係に従い、前記改良差分値のとりうる範囲の中で、前記画素値に対応する改良差分値を求めることを特徴とする画像圧縮装置。
A prediction value generating means for obtaining a prediction value based on adjacent pixel data for each pixel data for image data composed of a plurality of pixel data corresponding to an input still image;
An improved difference value is generated based on the pixel value and the predicted value in accordance with a possible range of the improved difference value determined based on a possible range of the difference value that is a difference between the predicted value and the pixel value of the pixel data Improved difference value generating means to
Encoding means for obtaining compressed image data by encoding the improved difference value;
Recording means for recording the compressed image data on a recording medium,
The range that the improved difference value can take is inverted so that the sign of the positive / negative is changed with respect to the value of the non-difference value range that is larger than the predicted value within the range that the pixel value can take. In the range where the absolute value is equal to the partial range of the non-difference value in the possible range of Is defined by arranging so that positive and negative values appear alternately in
The improved difference value generation means is determined based on a correspondence relationship between a range that can be taken by the pixel value, a range that can be taken by the difference value, and a range that can be taken by the improved difference value, which is determined based on the predicted value. An image compression apparatus for obtaining an improved difference value corresponding to the pixel value within a possible range of the improved difference value.
前記予測値生成手段が、符号化対象の画素データに対し、1つ左隣の画素データを予測値とすることを特徴とする請求項1に記載の画像圧縮装置。  The image compression apparatus according to claim 1, wherein the prediction value generation unit uses the pixel data adjacent to the left as the prediction value for the pixel data to be encoded. 請求項1に記載された画像圧縮装置によって得られた圧縮画像データを伸張する画像伸張装置であって、
前記記録媒体に記録された前記圧縮画像データを復号化することにより、前記改良差分値を求める復号化手段と、
すでに復元された画像データから求められる予測値から定められる、前記画素値のとりうる範囲と、前記差分値のとりうる範囲と前記改良差分値のとりうる範囲との対応関係に従い、前記改良差分値から対応する画素データを順次復元し、前記画像データを復元する手段
を備えたことを特徴とする画像伸張装置。
An image expansion device for expanding compressed image data obtained by the image compression device according to claim 1,
Decoding means for obtaining the improved difference value by decoding the compressed image data recorded on the recording medium ;
The improved difference value is determined according to a correspondence relationship between a range that can be taken by the pixel value, a range that can be taken by the difference value, and a range that can be taken by the improved difference value, which is determined from a predicted value obtained from image data that has already been restored. the corresponding pixel data sequentially restored from the image decompression apparatus being characterized in that a means for restoring the image data.
前記予測値が、先に復元された前記画素データに基いて求められることを特徴とする請求項に記載の画像伸張装置。The image expansion device according to claim 3 , wherein the predicted value is obtained based on the previously restored pixel data. 入力される静止画像に対応した、複数の画素データによって構成される画像データについて、各画素データ毎に、隣接する画素データに基いて予測値を求める予測値生成手段と、
前記予測値と前記画素データの画素値との差分である差分値のとりうる範囲に基づいて定められる改良差分値のとりうる範囲に従い、前記画素値および前記予測値に基づいて改良差分値を生成する改良差分値生成手段と、
前記改良差分値のビット列を上位ビット列と下位ビット列の2つに分離し、前記上位ビット列で表される上位改良差分値と前記下位ビット列で表される下位改良差分値を求めるビット分離手段と、
前記上位改良差分値を符号化することにより、圧縮画像データを求める符号化手段と、
前記圧縮画像データを記録媒体に記録するとともに、前記下位改良差分値をそのまま前記記録媒体に記録する記録手段とを備え、
前記改良差分値のとりうる範囲が、前記画素値のとりうる範囲の中で前記予測値より大きい非差分値の範囲の値に対し、正負の符号を変えるように反転させ、さらに、前記差分値のとりうる範囲の中で絶対値が前記非差分値の部分的範囲と等しい範囲において、前記正負が反転された非差分値の範囲の値と前記部分的範囲の値を、絶対値の小さい順で正負の値が交互に現れるように並べることにより規定され、
前記改良差分値生成手段が、前記予測値に基づいて定められる、前記画素値のとりうる範囲と、前記差分値のとりうる範囲と、前記改良差分値のとりうる範囲との対応関係に従 い、前記改良差分値のとりうる範囲の中で、前記画素値に対応する改良差分値を求めることを特徴とする画像圧縮装置。
A prediction value generating means for obtaining a prediction value based on adjacent pixel data for each pixel data for image data composed of a plurality of pixel data corresponding to an input still image;
An improved difference value is generated based on the pixel value and the predicted value in accordance with a possible range of the improved difference value determined based on a possible range of the difference value that is a difference between the predicted value and the pixel value of the pixel data Improved difference value generating means to
Bit separation means for separating the bit string of the improved difference value into two, an upper bit string and a lower bit string, and obtaining an upper improved difference value represented by the upper bit string and a lower improved difference value represented by the lower bit string;
Encoding means for obtaining compressed image data by encoding the higher-order improved difference value;
Recording means for recording the compressed image data on a recording medium and recording the lower refinement difference value on the recording medium as it is,
The range that the improved difference value can take is inverted so that the sign of the positive / negative is changed with respect to the value of the non-difference value range that is larger than the predicted value within the range that the pixel value can take. In the range where the absolute value is equal to the partial range of the non-difference value in the possible range of Is defined by arranging so that positive and negative values appear alternately in
The improved differential value generating means is determined on the basis of the predicted value, and the range which can be taken of the pixel values, and ranges which can be taken of the difference values, follow physician as the correlations between the range which can be taken of the improved differential value An image compression apparatus that obtains an improved difference value corresponding to the pixel value within a possible range of the improved difference value.
前記ビット分離手段が、前記改良差分値のビット列を右シフト演算し、前記右シフト演算により変換される前記改良差分値のビット列を上位ビット列、前記右シフト演算により分離される下位ビットを下位ビット列とすることを特徴とする請求項に記載の画像圧縮装置。The bit separation means performs a right shift operation on the bit string of the improved difference value, the bit string of the improved difference value converted by the right shift operation as an upper bit string, and the lower bit separated by the right shift operation as a lower bit string The image compression apparatus according to claim 5 , wherein: 請求項に記載された画像圧縮装置によって得られた圧縮画像データを伸張する画像伸張装置であって、
前記記録媒体に記録された前記圧縮画像データを復号化することにより、前記上位改良差分値を求める復号化手段と、
前記復号化手段により得られた前記上位改良差分値と、前記記録媒体に記録された前記下位改良差分値をビット合成することにより、前記改良差分値を求めるビット合成手段と、
すでに復元された画像データから求められる予測値から定められる、前記画素値のとりうる範囲と、前記差分値のとりうる範囲と前記改良差分値のとりうる範囲との対応関係に従い、前記改良差分値から対応する画素データを順次復元し、前記画像データを復元する手段と
を備えたことを特徴とする画像伸張装置。
An image expansion device for expanding compressed image data obtained by the image compression device according to claim 5 ,
Decoding means for obtaining the upper improvement difference value by decoding the compressed image data recorded on the recording medium ;
A bit synthesizing unit for obtaining the improved difference value by bit-combining the higher-order improved difference value obtained by the decoding unit and the lower-order improved difference value recorded on the recording medium ;
The improved difference value is determined according to a correspondence relationship between a range that can be taken by the pixel value, a range that can be taken by the difference value, and a range that can be taken by the improved difference value, which is determined from a predicted value obtained from image data that has already been restored. Means for sequentially restoring the corresponding pixel data from the image data, and restoring the image data.
前記ビット合成手段が、前記上位改良差分値のビット列を左シフト演算し、前記左シフト演算により空白になるビット部分に前記下位ビット列を当てはめることにより、前記改良差分値を求めることを特徴とする請求項に記載の画像伸張装置。The bit composition means obtains the improved differential value by left-shifting the bit string of the higher-order improved difference value and applying the lower-order bit string to a bit portion that becomes blank by the left shift operation. Item 8. The image expansion device according to Item 7 . 入力される静止画像に対応し、ビット列で表される画像データに対し、前記画像データのビット列を2つに分離して上位ビット列で表される上位画像データと下位ビット列で表される下位画像データを求めるビット分離手段と、
複数の画素データによって構成される前記上位画像データについて、各画素データ毎に、隣接する画素データに基いて予測値を求める予測値生成手段と、
前記予測値と前記画素データの画素値との差分である差分値のとりうる範囲に基づいて定められる改良差分値のとりうる範囲に従い、前記画素値および前記予測値に基づいて改良差分値を生成する改良差分値生成手段と、
前記改良差分値を符号化することにより、圧縮画像データを求める符号化手段と、
前記圧縮画像データおよび前記下位画像データを記録媒体に記録する記録手段とを備え、
前記改良差分値のとりうる範囲が、前記画素値のとりうる範囲の中で前記予測値より大きい非差分値の範囲の値に対し、正負の符号を変えるように反転させ、さらに、前記差分値のとりうる範囲の中で絶対値が前記非差分値の部分的範囲と等しい範囲において、前記正負が反転された非差分値の範囲の値と前記部分的範囲の値を、絶対値の小さい順で正負の値が交互に現れるように並べることにより規定され、
前記改良差分値生成手段が、前記予測値に基づいて定められる、前記画素値のとりうる範囲と、前記差分値のとりうる範囲と、前記改良差分値のとりうる範囲との対応関係に従い、前記改良差分値のとりうる範囲の中で、前記画素値に対応する改良差分値を求めることを特徴とする画像圧縮装置。
Corresponding to the input still image, the image data represented by the bit string is divided into two bit strings of the image data, and the upper image data represented by the upper bit string and the lower image data represented by the lower bit string. Bit separation means for obtaining
For the upper image data composed of a plurality of pixel data, for each pixel data, a predicted value generation means for obtaining a predicted value based on adjacent pixel data;
An improved difference value is generated based on the pixel value and the predicted value in accordance with a possible range of the improved difference value determined based on a possible range of the difference value that is a difference between the predicted value and the pixel value of the pixel data Improved difference value generating means to
Encoding means for obtaining compressed image data by encoding the improved difference value;
Recording means for recording the compressed image data and the lower-order image data on a recording medium ,
The range that the improved difference value can take is inverted so that the sign of the positive / negative is changed with respect to the value of the non-difference value range that is larger than the predicted value within the range that the pixel value can take. In the range where the absolute value is equal to the partial range of the non-difference value in the possible range of Is defined by arranging so that positive and negative values appear alternately in
The improved difference value generation means is determined based on a correspondence relationship between a range that can be taken by the pixel value, a range that can be taken by the difference value, and a range that can be taken by the improved difference value, which is determined based on the predicted value. An image compression apparatus for obtaining an improved difference value corresponding to the pixel value within a possible range of the improved difference value.
前記ビット分離手段が、前記画像データのビット列を右シフト演算し、前記右シフト演算により変換される前記画像データのビット列を上位ビット列、前記右シフト演算により分離される下位ビットを前記下位ビット列とすることを特徴とする請求項に記載の画像圧縮装置。The bit separation means performs a right shift operation on the bit string of the image data, the bit string of the image data converted by the right shift operation is an upper bit string, and the lower bit separated by the right shift operation is the lower bit string The image compression apparatus according to claim 9 . 請求項に記載された画像圧縮装置によって得られた圧縮画像データを伸張する画像伸張装置であって、
前記記録媒体に記録された前記圧縮画像データを復号化することにより、前記改良差分値を求める復号化手段と、
すでに復元された上位画像データから求められる予測値から定められる、前記画素値の とりうる範囲と、前記差分値のとりうる範囲と前記改良差分値のとりうる範囲との対応関係に従い、前記改良差分値から対応する画素データを順次復元し、前記上位画像データを復元する手段と、
前記記録媒体に記録された前記下位画像データと前記上位画像データをビット合成することにより、前記画像データを求めるビット合成手段
を備えたことを特徴とする画像伸張装置。
An image expansion device for expanding compressed image data obtained by the image compression device according to claim 9 , comprising:
Decoding means for obtaining the improved difference value by decoding the compressed image data recorded on the recording medium ;
The improved difference is determined according to a correspondence relationship between a range that can be taken by the pixel value, a range that can be taken by the difference value, and a range that can be taken by the improved difference value, which is determined from a predicted value obtained from the already restored upper image data. Means for sequentially restoring the corresponding pixel data from the value and restoring the upper image data ;
Wherein by the upper image data and recorded the lower image data on the recording medium bit synthesis, image expansion apparatus being characterized in that a bit combining means for obtaining the image data.
前記ビット合成手段が、前記上位画像データのビット列を左シフト演算し、前記左シフト演算により空白になるビット部分に前記下位ビット列を当てはめることにより、前記画像データを求めることを特徴とする請求項11に記載の画像伸張装置。The bit combining means, said upper image a bit string of data left shift operation, by fitting the lower bit string in the bit areas of blank by the left shift operation, claim 11, characterized in that obtaining the image data The image expansion device described in 1. 入力される静止画像に対応した、複数の画素データによって構成される画像データについて、各画素データ毎に、隣接する画素データに基いて予測値を求める予測値生成手段と、
前記予測値と前記画素データの画素値との差分である差分値のとりうる範囲に基づいて定められる改良差分値のとりうる範囲に従い、前記画素値および前記予測値に基づいて改良差分値を生成する改良差分値生成手段と、
前記改良差分値が負の値である場合には前記改良差分値を−1で掛け算して正の値に変換する手段と、
はじめから正である、もしくは−1が掛け算されたことにより正の値に変換された前記改良差分値のビット列を上位ビット列と下位ビット列の2つに分離し、前記上位ビット列で表される上位改良差分値と前記下位ビット列で表される下位改良差分値を求めるビット分離手段と、
前記下位改良差分値の前記下位ビット列に対し、前記改良差分値が正の値である場合には正の付加符号ビット、前記改良差分値が負の値である場合には負の付加符号ビットを付加する付加手段と、
前記上位改良差分値を符号化することにより、圧縮画像データを求める符号化手段と、
前記圧縮画像データと前記正および負の付加符号ビット付きで前記下位改良差分値を記録媒体に記録する記録手段とを備え、
前記改良差分値のとりうる範囲が、前記画素値のとりうる範囲の中で前記予測値より大きい非差分値の範囲の値に対し、正負の符号を変えるように反転させ、さらに、前記差分値のとりうる範囲の中で絶対値が前記非差分値の部分的範囲と等しい範囲において、前記正負が反転された非差分値の範囲の値と前記部分的範囲の値を、絶対値の小さい順で正負の値が交互に現れるように並べることにより規定され、
前記改良差分値生成手段が、前記予測値に基づいて定められる、前記画素値のとりうる範囲と、前記差分値のとりうる範囲と、前記改良差分値のとりうる範囲との対応関係に従い、前記改良差分値のとりうる範囲の中で、前記画素値に対応する改良差分値を求めることを特徴とする画像圧縮装置。
A prediction value generating means for obtaining a prediction value based on adjacent pixel data for each pixel data for image data composed of a plurality of pixel data corresponding to an input still image;
An improved difference value is generated based on the pixel value and the predicted value in accordance with a possible range of the improved difference value determined based on a possible range of the difference value that is a difference between the predicted value and the pixel value of the pixel data Improved difference value generating means to
Means for multiplying the improved difference value by -1 and converting it to a positive value when the improved difference value is a negative value;
A bit string of the improved difference value that is positive from the beginning or converted to a positive value by being multiplied by −1 is separated into an upper bit string and a lower bit string, and an upper improvement represented by the upper bit string A bit separating means for obtaining a lower improvement difference value represented by the difference value and the lower bit string;
For the lower bit string of the lower improvement difference value, a positive additional sign bit if the improvement difference value is a positive value, and a negative additional sign bit if the improvement difference value is a negative value. Additional means to add;
Encoding means for obtaining compressed image data by encoding the higher-order improved difference value;
Recording means for recording the compressed image data and the low-order improved difference value with a positive and negative additional sign bit on a recording medium;
The range that the improved difference value can take is inverted so that the sign of the positive / negative is changed with respect to the value of the non-difference value range that is larger than the predicted value within the range that the pixel value can take. In the range where the absolute value is equal to the partial range of the non-difference value in the possible range of Is defined by arranging so that positive and negative values appear alternately in
The improved difference value generation means is determined based on a correspondence relationship between a range that can be taken by the pixel value, a range that can be taken by the difference value, and a range that can be taken by the improved difference value, which is determined based on the predicted value. An image compression apparatus for obtaining an improved difference value corresponding to the pixel value within a possible range of the improved difference value.
請求項13に記載された画像圧縮装置によって得られた圧縮画像データを伸張する画像伸張装置であって、
前記記録媒体に記録された前記圧縮画像データを復号化することにより、前記上位改良差分値を求める復号化手段と、
前記記録媒体に記録された前記付加符号ビットを除いた前記下位改良差分値と前記上位改良差分値をビット合成することにより、前記改良差分値を求めるビット合成手段と、
前記下位改良差分値に付加されていて前記記録媒体に記録された付加符号ビットが負の値である場合には、前記ビット合成手段により得られた前記改良差分値に−1を掛け算して負の値に変換する手段と、
すでに復元された画像データから求められる予測値から定められる、前記画素値のとりうる範囲と、前記差分値のとりうる範囲と前記改良差分値のとりうる範囲との対応関係に従い、前記改良差分値から対応する画素データを順次復元し、前記画像データを復元する手段
を備えたことを特徴とする画像伸張装置。
An image expansion device for expanding compressed image data obtained by the image compression device according to claim 13 ,
Decoding means for obtaining the upper improvement difference value by decoding the compressed image data recorded on the recording medium ;
Bit combining means for determining the improved difference value by combining the lower improved difference value and the higher improved difference value excluding the additional code bit recorded in the recording medium ;
If the additional sign bit added to the lower refinement difference value and recorded on the recording medium is a negative value, the refinement difference value obtained by the bit synthesizing means is multiplied by -1 to obtain a negative value. Means for converting to a value of
The improved difference value is determined according to a correspondence relationship between a range that can be taken by the pixel value, a range that can be taken by the difference value, and a range that can be taken by the improved difference value, which is determined from a predicted value obtained from image data that has already been restored. the corresponding pixel data sequentially restored from the image decompression apparatus being characterized in that a means for restoring the image data.
JP24759198A 1998-09-01 1998-09-01 Image compression apparatus and image expansion apparatus Expired - Fee Related JP3857820B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24759198A JP3857820B2 (en) 1998-09-01 1998-09-01 Image compression apparatus and image expansion apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24759198A JP3857820B2 (en) 1998-09-01 1998-09-01 Image compression apparatus and image expansion apparatus

Publications (2)

Publication Number Publication Date
JP2000078410A JP2000078410A (en) 2000-03-14
JP3857820B2 true JP3857820B2 (en) 2006-12-13

Family

ID=17165794

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24759198A Expired - Fee Related JP3857820B2 (en) 1998-09-01 1998-09-01 Image compression apparatus and image expansion apparatus

Country Status (1)

Country Link
JP (1) JP3857820B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7428341B2 (en) 2003-05-27 2008-09-23 Zaxel Systems, Inc. Method and apparatus for lossless data transformation with preprocessing by adaptive compression, multidimensional prediction, multi-symbol decoding enhancement enhancements

Also Published As

Publication number Publication date
JP2000078410A (en) 2000-03-14

Similar Documents

Publication Publication Date Title
JP4049792B2 (en) Floating-point format digital signal lossless encoding method, decoding method, each apparatus, and each program
JP4343440B2 (en) Real-time algorithm and architecture for encoding images compressed by DWT-based techniques
TWI521890B (en) Image coding apparatus, method and program, and image decoding apparatus, method and program
US6285796B1 (en) Pseudo-fixed length image compression scheme
US8254700B1 (en) Optimized method and system for entropy coding
JP7046325B2 (en) Methods and devices for digital data compression
CN110896483A (en) Method for compressing and decompressing image data
US6396955B1 (en) Image compression and expansion device
JP3796432B2 (en) Filter processing apparatus and filter processing method
Lee et al. An effective algorithm and architecture for the high-throughput lossless compression of high-resolution images
JP3033671B2 (en) Image signal Hadamard transform encoding / decoding method and apparatus
US11677932B2 (en) Image processing device
EP0635807B1 (en) Coding apparatus for image compression
JP2000244922A (en) Method for compressing picture data
JP3857820B2 (en) Image compression apparatus and image expansion apparatus
US6947606B2 (en) Skim encoding method for compression of a two dimensional array of data
JPH1188701A (en) Image compression device and image expansion device
JP2000013797A (en) Image compressing device and image expanding device
JP4092830B2 (en) Image data compression method
JP3845206B2 (en) Image compression apparatus and image expansion apparatus
JP3845208B2 (en) Image compression apparatus and image expansion apparatus
JP3559314B2 (en) Image compression device
JP2017525185A (en) High precision and quantization method applicable to wavelet transform matrix
JP3796354B2 (en) Image coding method
JP3650527B2 (en) Image compression apparatus and image expansion apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050704

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060502

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060628

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060915

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100922

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110922

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120922

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120922

Year of fee payment: 6

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

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

Free format text: PAYMENT UNTIL: 20120922

Year of fee payment: 6

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

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

Free format text: PAYMENT UNTIL: 20120922

Year of fee payment: 6

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20130922

Year of fee payment: 7

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees