JP2004336661A - Method and instrument for picture decoding - Google Patents
Method and instrument for picture decoding Download PDFInfo
- Publication number
- JP2004336661A JP2004336661A JP2003133534A JP2003133534A JP2004336661A JP 2004336661 A JP2004336661 A JP 2004336661A JP 2003133534 A JP2003133534 A JP 2003133534A JP 2003133534 A JP2003133534 A JP 2003133534A JP 2004336661 A JP2004336661 A JP 2004336661A
- Authority
- JP
- Japan
- Prior art keywords
- data
- group
- pixel
- register
- decoded
- 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.)
- Withdrawn
Links
Images
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、画像における画素のデータを、当該画素の位置に応じた位置に配置されたテンプレートに含まれる画素群のデータを用いて符号化することで得られる画像符号化データを復号する画像復号装置、この画像復号装置が行う画像復号方法に関するものである。
【0002】
【従来の技術】
テンプレートの形状によって決まる参照画素データ群から処理対象画素の画素値を予測して符号化された画像情報の従来の復号方法を図4、図5を用いて説明する。
【0003】
図4(a)は画像情報を復号する際に使用するテンプレートの形状の例を示す図で、図4(b)は上記符号化方法により符号化された画像情報を復号するためのテンプレートの使用方法を説明するための図である。また、図5は第1のレジスタ群に読み込まれる復号済みの画素データ群から、1次元的に連結された参照画素データ群を得る様子を示す図である。
【0004】
図4(a)において、Aで示した位置の画像情報(以下、処理対象画素A)を復号するときには、周辺に位置する復号済みの画素データ群(図4の網掛け部分、即ち、テンプレートの領域)を参照する。これらの参照画素データ群は通常メモリ上に格納されているので、これら参照画素データ群を使用する場合には、これら参照画素データ群を今メモリから所定のレジスタへ読み込んで格納する必要がある。
【0005】
図4(b)に示したテンプレートは3行にまたがっているので、図5に示すように第1のレジスタ群として3個のレジスタ1、2、3を用意し、復号時にはメモリに格納された復号済み画素データ群をこれらのレジスタ群に読み出し、格納する。レジスタ1には(m−2)行目の復号済み画素データ群を、レジスタ2には(m−1)行目の復号済み画素データ群を、レジスタ3には処理対象画素Aと同一の行m(以下、処理対象行)の復号済み画素データ群をそれぞれ読み込んで格納する。
【0006】
メモリからレジスタへのデータの読み込みは通常バイト単位で行なわれるので、参照画素データ群以外の不要な復号済み画素データ群も同時に読み込んでしまうことがある。そこで、図5のように第1のレジスタ群と同数の第2のレジスタ群としてレジスタ4、5、6を用意し、第1のレジスタ群から読み込んだ参照画素データ群にマスクをかけて第2のレジスタ群に参照画素データ群だけを取り出す。すなわち、レジスタ1から読み込んだ復号済み画素データ群にマスクをかけて、レジスタ4にテンプレートの1行目の参照画素データ群を得る。また、レジスタ2から読み込んだ復号済み画素データ群にマスクをかけて、レジスタ5にテンプレートの2行目の参照画素データ群を得る。同様に、レジスタ3から読み込んだ復号済み画素データ群にマスクをかけて、レジスタ6にテンプレートの3行目の参照画素データ群を得る。
【0007】
必要な全ての参照画素データ群は3個のレジスタ4、5、6に分割して格納されるが、このままでは処理対象画素Aの復号が複雑になる。そこで、図5の下部に示すように、参照画素データ群を1次元的に連結して参照画素データ群を一つのレジスタ7にまとめる。そしてこのように連結された参照画素データ群を参照することによって、処理対象画素Aを復号することができる。処理対象画素Aの復号が終わると、新たな処理対象画素であるAの右隣の画素を復号する準備としてテンプレートを右方向に1画素分移動させる。
【0008】
以上説明した方法、即ち従来の方法により、第2のレジスタ群(レジスタ4、5、6)に取り出された参照画素データ群から1次元的に連結された参照画素データ群をレジスタ7に得る様子を図6に2つ示す。
【0009】
図6は第2のレジスタ群に取り出された参照画素データ群を一次元的に連結してレジスタ7に格納する処理を説明する為の図である。
【0010】
図6(a)に示す例では、レジスタ4では左に2ビットシフト、レジスタ5では右に4ビットシフト、レジスタ6では右に12ビットシフトして、シフトされたそれぞれの参照画素データ群を連結(論理和演算)することによって、レジスタ7に1次元的に連結された参照画素データ群を得る。
【0011】
一方、図6(b)に示す例では、レジスタ4では左に9ビットシフト、レジスタ5は左に3ビットシフト、レジスタ6では右に5ビットシフトして、シフトされたそれぞれの参照画素データを連結することによって、レジスタ7に1次元的に連結された参照画素データ群を得る。
【0012】
このように、参照画素に基づくテンプレートを用いた符号化、復号に関するものとしては、JBIG方式(ITU−T T82)の符号化が知られている(例えば非特許文献1を参照)。
【0013】
このように第2のレジスタ群における処理対象画素Aの相対位置が変わると、夫々のレジスタのシフト方向、そしてシフトするビット数を変えなければ、レジスタ7に1次元的に連結された参照画素データ群を得ることができない。実際には第2のレジスタ群における処理対象画素Aの相対位置によって8通りのシフト形態が考えられる。
【0014】
【非特許文献1】
ディジタル静止画像圧縮符号化関連勧告集(ITU−T T82) 平成6年1月25日発行
【0015】
【発明が解決しようとする課題】
上記のように、従来手法では第2のレジスタ群における処理対象画素Aの相対位置によって、第2のレジスタ群に取り出される参照画素データ群に対して適用するシフト形態を変えなければならないため、1次元的に連結された参照画素データ群を得るための演算数が多くなってしまう。
【0016】
本発明は以上の問題に鑑みてなされたものであり、符号化された各画素を、参照画素に基づくテンプレートを用いて復号する場合に、より少ない演算数で行うことを目的とする。
【0017】
【課題を解決するための手段】
本発明の目的を達成するために、例えば本発明の画像復号方法は以下の構成を備える。
【0018】
すなわち、復号済みの画素データを記憶する第1のレジスタ群と、当該第1のレジスタとは異なる第2のレジスタ群とを備え、画像における画素のデータを、当該画素の位置に応じた位置に配置されたテンプレートに含まれる画素群のデータを用いて符号化することで得られる画像符号化データを復号する画像復号装置が行う画像復号方法であって、
前記第1のレジスタ群における前記テンプレートの位置を固定させ、前記テンプレートに含まれる復号済みの画素群のデータを第2のレジスタ群に読み出す読み出し工程と、
前記第2のレジスタ群に読み出された画素群のデータを一次元的に連結する連結工程と、
前記連結工程で連結した画素群のデータを用いて当該画素群のデータを符号化時に用いて符号化した画素が復号され、復号された当該画素のデータが前記第1のレジスタ群における復号前の当該画素のデータに上書きされた後に、前記第1のレジスタ群が記憶する各データの記憶位置を所定の方向に1ビット分シフトさせるシフト工程と
を備えることを特徴とする。
【0019】
本発明の目的を達成するために、例えば本発明の画像復号装置は以下の構成を備える。
【0020】
すなわち、画像における画素のデータを、当該画素の位置に応じた位置に配置されたテンプレートに含まれる画素群のデータを用いて符号化することで得られる画像符号化データを復号する画像復号装置であって、
復号済みの画素データを記憶する第1のレジスタ群と、
前記第1のレジスタ群における前記テンプレートの位置を固定させ、前記テンプレートに含まれる復号済みの画素群のデータを第2のレジスタ群に読み出す読み出し手段と、
前記第2のレジスタ群に読み出された画素群のデータを一次元的に連結する連結手段と、
前記連結手段が連結した画素群のデータを用いて当該画素群のデータを符号化時に用いて符号化した画素が復号され、復号された当該画素のデータが前記第1のレジスタ群における復号前の当該画素のデータに上書きされた後に、前記第1のレジスタ群が記憶する各データの記憶位置を所定の方向に1ビット分シフトさせるシフト手段と
を備えることを特徴とする。
【0021】
【発明の実施の形態】
以下添付図面を参照して、本発明を好適な実施形態に従って詳細に説明する。
【0022】
[第1の実施形態]
本実施形態では上記テンプレートを用いた周知の符号化処理によって符号化された画像を、後述の画像復号処理によって復号する画像復号装置として、RISC(Reduced Instruction Set Computer)プロセッサを用いたコンピュータを適用した場合について説明する。
【0023】
図7は本実施形態に係る画像復号装置の基本構成を示すブロック図である。701はCPUで、上述の通りRISC(Reduced Instruction Set Computer)プロセッサであって、RAM702やROM705に記憶されているプログラムやデータを用いて本装置全体の制御を行うと共に、後述の画像復号処理を実行する。また内部には後述する第1のレジスタ群703、第2のレジスタ群704を備える。
【0024】
702はRAMで、CPU701が各種の処理を行うために必要なワークエリアを備えると共に、外部記憶装置708や記憶媒体ドライブ709からロードされたプログラムやデータを一時的に記憶するためのエリアも備える。
【0025】
703は第1のレジスタ群で、復号済みのデータを一時的に記憶する。第1のレジスタ群703の詳細については後述する。
【0026】
704は第2のレジスタ群で、画像符号化データにおいて注目画素を復号するために必要な画素群のデータを後述する方法により第1のレジスタ群703から読み出して一時的に記憶する。第2のレジスタ群704の詳細については後述する。
【0027】
705はROMで、本装置全体の制御を行うためや、本装置の設定のためのプログラムやデータを格納する。
【0028】
706は表示部で、CRTや液晶画面等により構成されており、画像や文字情報などの各種の情報を表示することができ、例えば、後述復号処理の対象となる画像や、後述の復号処理を指示するためのGUIなどを表示することができる。
【0029】
707は操作部で、キーボードやマウスなどにより構成されており、各種の指示をCPU701に入力することができる。
【0030】
708は外部記憶装置で、一般にはハードディスクドライブなどの大容量情報記憶装置により構成されており、ここにはOSや後述する画像復号処理をCPU701に実行させるためのプログラムやデータが保存されており、これらプログラムやデータは必要に応じてCPU701からの指示に従ってRAM702にロードされる。また、外部記憶装置708には、処理対象の画像符号化データを保存されており、これも必要に応じてCPU701からの指示に従ってRAM702にロードされる。
【0031】
709は記憶媒体ドライブで、CD−ROMやDVD−ROMなどの記憶媒体に記憶されているプログラムやデータを読み出し、外部記憶装置708に出力することができる。なお上記外部記憶装置708に保存されている上記プログラムやデータをこの記憶媒体に記憶させておき、必要に応じてRAM702にロードするようにしても良い。
【0032】
710は上述の各部を繋ぐバスである。
【0033】
次に、上記構成を備える画像復号装置が行う、本実施形態に係る画像復号処理について説明する。図1はこの画像復号処理のフローチャートである。同図のフローチャートに従ったプログラムは外部記憶装置708もしくは記憶媒体ドライブ709からRAM702にロードされ、CPU701がこれを実行することで、本実施形態に係る画像復号装置は後述する画像復号処理を行うことができる。
【0034】
また、図2は、図1に示したフローチャートに従って復号処理を行う場合の、第1のレジスタ群703、第2のレジスタ群704の記憶内容を示す図である。以下、図1,2を用いて、本実施形態に係る画像復号処理について説明する。
【0035】
先ず復号の準備として、第1のレジスタ群703としてレジスタ1,2,3を、第2のレジスタ群704としてレジスタ4,5,6を、そして後述の処理により一次元的に連結された参照画素群のデータを格納する為のレジスタ7をCPU101内部に用意する。
【0036】
画像符号化データを復号する場合、画像の1行目から順に2行目、3行目、、、と復号するので、m行目を復号する場合にはn<mを満たす全てのnについてn行目は既に復号されており、復号された行の画素データはRAM702の所定の領域や外部記憶装置708(以下、これら「復号済みの画素データを記憶するためのメモリ」を総称して「復号済み画素データメモリ」と呼称する)に出力され、記憶される。
【0037】
従って、これから復号しようとする行(処理対象行)をm行目とした場合に、レジスタ1には(m−2)行目の復号済み画素データが復号済み画素データメモリから書き込まれ、レジスタ2には(m−1)行目の復号済み画素データが復号済み画素データメモリから書き込まれる。またレジスタ3は、処理対象行であるm行目の復号済み画素データを格納するために使用する。
【0038】
なお本実施形態ではレジスタ3には1バイト分の復号済み画素データを記憶させることができ、1バイト分の復号済み画素データが書き込まれると、これらは上記復号済み画素データメモリに出力される。このことから、第1のレジスタ群703の各レジスタ(1,2,3)はバイト単位で復号済みの画素データを記憶することができる。なお、本実施形態ではレジスタ1,2は3バイト分、レジスタ3は1バイト分とするが、これに限定されるものではない。
【0039】
上記準備が整うと、CPU701は第1のレジスタ群703に、復号済みの画素データを読み込むか否かを判断する(ステップS101)。読み込む場合には処理をステップS102に進め、先ず1バイト分の復号済みの画素データを、第1のレジスタ群703に読み込む(ステップS102)。具体的に、レジスタ1には(m−2)行目の1バイト分の復号済み画素データ群を、レジスタ2には(m−1)行目の1バイト分の復号済み画素データ群を読み込む。
【0040】
図2(a)は、ステップS102でレジスタ1,2の夫々に1バイト分の復号済み画素データ群を読み込む前の第1のレジスタ群703の記憶内容を示す図で、図2(b)は、ステップS102でレジスタ1,2の夫々に1バイト分の復号済み画素データ群を読み込むんだ後の第1のレジスタ群703の記憶内容を示す図である。
【0041】
図2(a)ではレジスタ1,2の最後1バイト分には何も読み込まれていないが、ステップS102における処理によって図2(b)に示すとおり、レジスタ1,2の最後の1バイト分に、夫々(m−2)行目、(m−1)行目の次の1バイト分の復号済みの画素データが読み込まれている。なお、図2(a)、(b)において斜線部分はテンプレートに含まれる部分を示しており、このテンプレートの位置は第1のレジスタ群703において固定しているものとする(換言すれば、第1のレジスタ群703における斜線部分の位置は固定されているものとする)。
【0042】
次に、図2(a)、(b)にAで示す位置の画素を復号する為に必要な参照画素群のデータ、即ち斜線部分の画素データを第1のレジスタ群703から第2のレジスタ群704に読み出す(ステップS102)。
【0043】
具体的には、レジスタ1から読み込んだ復号済み画素データ群にマスクをかけて(レジスタ1が格納する画像データ群のうち、参照画素データ群以外を0として読み出す)、レジスタ4にテンプレートの1行目の参照画素データ群((m−2)行目の画像のデータ)を得る。また、レジスタ2から読み込んだ復号済み画素データ群にマスクをかけて、レジスタ5にテンプレートの2行目の参照画素データ群((m−1)行目の画像のデータ)を得る。同様に、レジスタ3から読み込んだ復号済み画素データ群にマスクをかけて、レジスタ6にテンプレートの3行目の参照画素データ群(m行目の画像のデータ)を得る。
【0044】
図2(c)は、ステップS102において、取り出された参照画素データ群が記憶された第2のレジスタ群704の記憶内容を示す図である。同図に示すように、第1のレジスタ群703において、参照画素群のデータのみが第2のレジスタ群704に取り出されており、それ以外には0が記憶されている。
【0045】
次に、新たな復号対象である、Aで示す位置の右隣の位置の画素の復号の準備として、第1のレジスタ群703が記憶する各データの記憶位置を左の方向に1ビット分(1画素分)シフトさせる(ステップS103)。図2(d)はステップS103におけるシフト処理後の第1のレジスタ群703の記憶内容を示す図である。同図に示すように、レジスタ1,2の右端には復号済みの画素のデータが記憶されていない部分が1ビット分でき、レジスタ3の右端には図2(a)、(b)においてAで示す位置の画素のデータが記憶されている。当然このレジスタ3の右端に記憶されているデータ(図2(d)でAで示す位置に記憶されているデータ)はまだ復号されていないため、値が決まっていない。
【0046】
次に、第2のレジスタ群704に取り出された参照画素群のデータを一次元的に連結する処理を行う(ステップS104)。具体的には先ず、各レジスタ(4,5,6)が記憶しているデータを予め決まった方向、決まったビット数分だけシフトする。図2(c)を例に取ると、レジスタ4は右に2ビットシフト、レジスタ5は右に8ビットシフト、レジスタ6は16ビット右にシフトする。
【0047】
このようにシフトした結果の第2のレジスタ群704の記憶内容を図2(e)に示す。そして各レジスタ4,5,6において同じ記憶位置同士で論理和演算を行うことで、各レジスタ4,5,6の記憶内容を連結し、レジスタ7に格納する。図2(f)はレジスタ7の記憶内容を示す図である。同図において斜線部分のうち、先頭の4ビット分はレジスタ4が記憶していた参照画素群のデータ、次の7ビット分はレジスタ5が記憶していた参照画素群のデータ、そして最後の3ビット分はレジスタ6が記憶していた参照画素群のデータであり、結果としてレジスタ7にはレジスタ4,5,6の夫々が記憶していた参照画素群のデータを一次元的に連結したものが記憶されている。
【0048】
従来では上述の通り、次の画素を復号する場合には、第2のレジスタ群704においてテンプレートの位置が変化していたので(換言すれば、第2のレジスタ群704における復号対象画素の位置が変化していたので)、各レジスタでシフトする方向とシフトするビット数はその都度異なり、予め決めておくことはできないので、これをその都度求める必要があり、計算も複雑であった。
【0049】
しかし本実施形態に係る復号処理では、第2のレジスタ群704におけるテンプレートの位置が変化しないので(換言すれば、第2のレジスタ群704における復号対象画素の位置が変化しないので)、次の画素を復号する場合にも各レジスタでシフトする方向とシフトするビット数は常に同じであって、予め決めておくことができるので、計算をより簡便に行うことができ、より高速に一次元的に連結された参照画素群のデータを得ることができる。
【0050】
そしてこのようにして得られた一次元的に連結された参照画素群のデータを用いて、周知の方法により上記Aで示した位置の画素の復号処理を行い(ステップS105)、シフト後の第1のレジスタ群703における上記Aで示す位置(本実施形態では図2(d)におけるAで示す位置)に復号した画素のデータを上書きする(ステップS106)。これにより、図2(d)のAの位置には復号済みの画素のデータが記憶されていることになる。
【0051】
そして次に、まだ復号済み画素データメモリに書き込まれていない復号データを復号済み画素データメモリに書き込むか否かを判断する(ステップS107)。これは例えば書き込む単位を1バイト単位とする場合には、ステップS107では1バイト分の復号処理を行ったか否かを判断する。そして書き込むと判断した場合には処理をステップS108に進め、まだ復号済み画素データメモリに書き込まれていない復号データを復号済み画素データメモリに書き込む(ステップS108)。
【0052】
そして次に、1行分の画素を全て復号したか否かを判定する(ステップS109)。全て処理していなければ処理をステップS101に戻し、以降の処理を繰り返す。
【0053】
以上の説明により、本実施形態に係る画像復号装置は、第2のレジスタ群704の夫々のレジスタが記憶する参照画素群のデータを一次元的に連結する場合に、各レジスタでシフトする方向、ビット数を予め固定させておくことができるので、連結処理の際にこれらを従来のように求める必要が無く、復号処理をより簡便にすることができるため、処理全体をより高速化することができる。
【0054】
なお、レジスタ7を用いずに、レジスタ4、5、6のいずれかを代わりに使用してもよい。
【0055】
また本実施形態ではAの位置の画素の右隣の位置の画素の復号準備として、ステップS103で先に第1のレジスタ群703のシフト処理を行ったが、ステップS105でAの位置の画素を復号し、ステップS106で復号した画素のデータを上書きしたのちに、ステップS103におけるシフト処理を行っても良い。
【0056】
[第2の実施形態]
本実施形態では、CPU701としてSIMD(Single Instruction Multiple Data streams)演算能力を有するプロセッサを適用する。なお、本実施形態に係る画像復号装置の基本構成は図1と同じであり、CPU701がSIMDプロセッサであること以外は同じである。
【0057】
具体的に本実施形態に係る復号処理では、テンプレートの形状とCPU701に実装されている命令によって、使用するレジスタの数が適応的に変化する。例えば、図4に示したテンプレートを用い、CPU701は64ビットレジスタを持ち、32ビット単位でシフト演算を適用できる場合には、図3(a)、(b)に示すように、第1のレジスタ群703としてレジスタ1、2を、第2のレジスタ群704としてレジスタ3、4を用意する。図3は本実施形態に係る第1のレジスタ群703、第2のレジスタ群704の記憶内容を示す図である。
【0058】
ここで、”32ビット単位のシフト演算を適用する”とは、64ビットレジスタは2つの32ビットレジスタから構成されるとして、別々にシフト演算を適用できることを意味する。つまり、64ビットレジスタの内容が (x63, x62, …, x33, x32, x31, x30, …, x1, x0) であるとき、32ビット単位のシフト演算(1ビット左シフト)を適用すると、このレジスタの内容は (x62, x61, …, x32, 0, x30, x29, …, x0, 0)となる。
【0059】
図3(a)に示すように、レジスタ1は(m−2)行目と(m−1)行目の復号済み画素データを格納するために使用し、格納される画素データ群は復号済み画素データメモリから読み込んだ画素データ群である。レジスタ2は処理対象行mの復号済み画素データ群を格納するために使用し、格納される画素データ群は復号済みであるが、まだメモリへは書き込まれていない。
【0060】
次に本実施形態に係る復号処理の流れについて説明するが、基本的には第1の実施形態と同じであるので、異なる部分だけについて説明する。
【0061】
ステップS103では、レジスタ1から読み込んだ復号済み画素データ群にマスクをかけて、レジスタ3にテンプレートの1行目と2行目の参照画素データ群を得る。同様に、レジスタ2から読み込んだ復号済み画素データ群にマスクをかけて、レジスタ4にテンプレートの3行目の参照画素データ群を得る。レジスタ1には(m−2)行目と(m−1)行目の復号済み画素データ群が格納されているため、一度に2行分の参照画素群のデータをレジスタ3に読み取ることができる。このため、第1の実施形態よりも一回分少ない処理回数で(m−2)行目と(m−1)行目の復号済み画素データ群をレジスタ3に格納することができる。
【0062】
図3(b)に示すように、レジスタ1において、(m−2)行目、(m−1)行目の参照画素群のデータのみがレジスタ3に取り出されており、それ以外には0が記憶されている。
【0063】
また、ステップS103では、新たな復号対象である、Aで示す位置の右隣の位置の画素の復号の準備として、第1のレジスタ群703が記憶する各データの記憶位置を左の方向に1ビット分(1画素分)シフトさせる。本実施形態では32ビット単位でシフト処理を行うことができるので、第1の実施形態よりも少ない演算数でシフト処理を行うことができる。
【0064】
図3(c)はステップS103におけるシフト処理後の第1のレジスタ群703の記憶内容を示す図である。
【0065】
このように、SIMD演算能力を有するCPU701を用いることで、第1の実施形態のCPU701、即ちRISCプロセッサを用いた場合よりもさらに演算数を減らすことができ、復号処理全体をより高速化することができる。
【0066】
[第3の実施形態]
本実施形態では、CPU701として特殊な命令を有するプロセッサを適用する。なお、本実施形態に係る画像復号装置の基本構成は図1と同じであり、CPU701が特殊な命令を有するプロセッサであること以外は同じであるとする。
【0067】
本実施形態に係る復号処理の流れについて説明するが、基本的には第1の実施形態と同じであるので、異なる部分だけについて説明する。
【0068】
例えば、特別な命令として、レジスタの所定の位置にあるデータ群を他のレジスタに取り出し、元のレジスタのデータ群を指定した数だけシフトするような命令があるとする。この場合、ステップS103において、図2(b)のレジスタ1に格納されている復号済み画素データ群から、図2(c)のレジスタ4のように参照画素データ群を取り出す処理と、図2(d)のレジスタ1のように格納されている復号済み画素データ群をシフトする処理が1つの命令でできるため、これに係る演算数を第1の実施形態と比べて減らすことができ、復号処理全体をより高速化することができる。
【0069】
また、レジスタに格納されているデータを指定した数だけシフトした後、他のレジスタとの論理和をとるような命令があるとする。この場合、ステップS104において、図2(e)の第2のレジスタ群704に格納されている参照画素データ群から、図2(f)のレジスタ7に1次元的に連結された参照画素データ群を得るときの演算数を減らすことができる。
【0070】
このように特別な命令を持つプロセッサを用いた場合、1次元的に連結された参照画素データ群を得る処理に係る演算数を第1の実施形態と比べて減らすことができ、復号処理全体をより高速化することができる。
【0071】
なお、以上の実施形態ではテンプレートの形状を図4に示したものを用いているが、以上の実施形態は、同図に示した形状、サイズのテンプレートに限定されるものではない。
【0072】
[その他の実施形態]
本発明の目的は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記録媒体(または記憶媒体)を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記録媒体に格納されたプログラムコードを読み出し実行することによっても、達成されることは言うまでもない。この場合、記録媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記録した記録媒体は本発明を構成することになる。
【0073】
また、コンピュータが読み出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0074】
さらに、記録媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張カードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0075】
本発明を上記記録媒体に適用する場合、その記録媒体には、先に説明したフローチャートに対応するプログラムコードが格納されることになる。
【0076】
【発明の効果】
以上の説明により、本発明によって、符号化された各画素を、参照画素に基づくテンプレートを用いて復号する場合に、より少ない演算数で行うことができる。
【図面の簡単な説明】
【図1】本発明の第1の実施形態に係る画像復号処理のフローチャートである。
【図2】図1に示したフローチャートに従って復号処理を行う場合の、第1のレジスタ群703、第2のレジスタ群704の記憶内容を示す図である。
【図3】本発明の第2の実施形態に係る第1のレジスタ群703、第2のレジスタ群704の記憶内容を示す図である。
【図4】(a)は画像情報を復号する際に使用するテンプレートの形状の例を示す図で、(b)は上記符号化方法により符号化された画像情報を復号するためのテンプレートの使用方法を説明するための図である。
【図5】第1のレジスタ群に読み込まれる復号済みの画素データ群から、1次元的に連結された参照画素データ群を得る様子を示す図である。
【図6】第2のレジスタ群に取り出された参照画素データ群を一次元的に連結してレジスタ7に格納する処理を説明する為の図である。
【図7】本発明の第1の実施形態に係る画像復号装置の基本構成を示すブロック図である。[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention is directed to image decoding for decoding image encoded data obtained by encoding pixel data in an image using data of a pixel group included in a template arranged at a position corresponding to the position of the pixel. The present invention relates to an apparatus and an image decoding method performed by the image decoding apparatus.
[0002]
[Prior art]
A conventional decoding method of image information encoded by predicting a pixel value of a processing target pixel from a reference pixel data group determined by a template shape will be described with reference to FIGS.
[0003]
FIG. 4A is a diagram showing an example of the shape of a template used when decoding image information, and FIG. 4B is a diagram showing the use of a template for decoding image information encoded by the above encoding method. It is a figure for explaining a method. FIG. 5 is a diagram showing how to obtain a one-dimensionally linked reference pixel data group from the decoded pixel data group read into the first register group.
[0004]
In FIG. 4A, when decoding the image information at the position indicated by A (hereinafter referred to as “processing target pixel A”), a group of decoded pixel data located in the vicinity (the shaded portion in FIG. Region). Since these reference pixel data groups are usually stored on the memory, when these reference pixel data groups are used, it is necessary to read these reference pixel data groups from the memory into a predetermined register and store them.
[0005]
Since the template shown in FIG. 4B extends over three rows, three
[0006]
Since reading of data from the memory to the register is usually performed in byte units, unnecessary decoded pixel data groups other than the reference pixel data group may be simultaneously read. Therefore, as shown in FIG. 5,
[0007]
All necessary reference pixel data groups are divided and stored in the three
[0008]
A state in which the reference pixel data group one-dimensionally linked from the reference pixel data group extracted to the second register group (
[0009]
FIG. 6 is a diagram for explaining a process of connecting the reference pixel data groups extracted to the second register group one-dimensionally and storing the data in the
[0010]
In the example shown in FIG. 6A, the
[0011]
On the other hand, in the example shown in FIG. 6B, the
[0012]
As described above, JBIG (ITU-T T82) encoding is known as encoding and decoding using a template based on reference pixels (for example, see Non-Patent Document 1).
[0013]
If the relative position of the processing target pixel A in the second register group changes as described above, the reference pixel data one-dimensionally connected to the
[0014]
[Non-patent document 1]
Recommendations on Digital Still Image Compression Coding (ITU-T T82) Published January 25, 1994
[0015]
[Problems to be solved by the invention]
As described above, in the conventional method, the shift mode applied to the reference pixel data group extracted to the second register group must be changed depending on the relative position of the processing target pixel A in the second register group. The number of operations required to obtain a group of dimensionally connected reference pixel data increases.
[0016]
The present invention has been made in view of the above problems, and has as its object to perform a smaller number of operations when decoding each encoded pixel using a template based on reference pixels.
[0017]
[Means for Solving the Problems]
In order to achieve the object of the present invention, for example, an image decoding method of the present invention has the following configuration.
[0018]
That is, a first register group for storing decoded pixel data and a second register group different from the first register are provided, and pixel data in an image is stored in a position corresponding to the position of the pixel. An image decoding method performed by an image decoding device that decodes image encoded data obtained by encoding using pixel group data included in an arranged template,
A reading step of fixing the position of the template in the first register group and reading out data of a decoded pixel group included in the template to a second register group;
A linking step of linking the pixel group data read to the second register group one-dimensionally;
A pixel coded by using the data of the pixel group at the time of encoding using the data of the pixel group connected in the connecting step is decoded, and the decoded data of the pixel before decoding in the first register group is decoded. A shifting step of shifting the storage position of each data stored in the first register group by one bit in a predetermined direction after the data of the pixel is overwritten;
It is characterized by having.
[0019]
In order to achieve the object of the present invention, for example, an image decoding device of the present invention has the following configuration.
[0020]
That is, an image decoding apparatus that decodes image data obtained by encoding pixel data in an image using data of a pixel group included in a template arranged at a position corresponding to the position of the pixel. So,
A first group of registers for storing decoded pixel data;
Reading means for fixing a position of the template in the first register group and reading data of a decoded pixel group included in the template into a second register group;
Connecting means for one-dimensionally connecting pixel group data read to the second register group;
A pixel coded by using the data of the pixel group at the time of encoding using the data of the pixel group connected by the connection unit is decoded, and the decoded data of the pixel before decoding in the first register group is decoded. Shift means for shifting the storage position of each data stored in the first register group by one bit in a predetermined direction after being overwritten with the data of the pixel;
It is characterized by having.
[0021]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, the present invention will be described in detail according to preferred embodiments with reference to the accompanying drawings.
[0022]
[First Embodiment]
In this embodiment, a computer using a RISC (Reduced Instruction Set Computer) processor is applied as an image decoding device that decodes an image encoded by a known encoding process using the template by an image decoding process described later. The case will be described.
[0023]
FIG. 7 is a block diagram illustrating a basic configuration of the image decoding device according to the present embodiment. A reduced instruction set computer (RISC)
[0024]
A
[0025]
A
[0026]
[0027]
A
[0028]
[0029]
An
[0030]
Reference numeral 708 denotes an external storage device, which is generally constituted by a large-capacity information storage device such as a hard disk drive, in which an OS and programs and data for causing the
[0031]
Reference numeral 709 denotes a storage medium drive that can read out a program or data stored in a storage medium such as a CD-ROM or a DVD-ROM and output the program or data to the external storage device 708. Note that the programs and data stored in the external storage device 708 may be stored in this storage medium and loaded into the
[0032]
A
[0033]
Next, an image decoding process according to the present embodiment performed by the image decoding apparatus having the above configuration will be described. FIG. 1 is a flowchart of the image decoding process. The program according to the flowchart of FIG. 13 is loaded from the external storage device 708 or the storage medium drive 709 to the
[0034]
FIG. 2 is a diagram showing the stored contents of the
[0035]
First, as preparation for decoding, registers 1, 2, and 3 as a
[0036]
When decoding the encoded image data, the second row, the third row, and so on are sequentially decoded from the first row of the image. Therefore, when the m-th row is decoded, n is satisfied for all n that satisfies n <m. The row has already been decoded, and the decoded pixel data is stored in a predetermined area of the
[0037]
Therefore, if the row to be decoded (the row to be processed) is the m-th row, the decoded pixel data of the (m−2) -th row is written from the decoded pixel data memory to the
[0038]
In this embodiment, one byte of decoded pixel data can be stored in the
[0039]
When the preparation is completed, the
[0040]
FIG. 2A is a diagram showing the storage contents of the
[0041]
In FIG. 2A, nothing is read in the last 1 byte of the
[0042]
Next, the data of the reference pixel group necessary for decoding the pixel at the position indicated by A in FIGS. 2A and 2B, that is, the pixel data of the shaded portion is transferred from the
[0043]
Specifically, a mask is applied to the decoded pixel data group read from the register 1 (the image data group stored in the
[0044]
FIG. 2C is a diagram showing the storage contents of the
[0045]
Next, in preparation for decoding of a pixel to the right of the position indicated by A, which is a new decoding target, the storage position of each data stored in the
[0046]
Next, processing for one-dimensionally linking the data of the reference pixel group taken out to the
[0047]
FIG. 2E shows the storage contents of the
[0048]
Conventionally, as described above, when decoding the next pixel, the position of the template has changed in the second register group 704 (in other words, the position of the pixel to be decoded in the
[0049]
However, in the decoding processing according to the present embodiment, since the position of the template in the
[0050]
Using the data of the one-dimensionally connected reference pixel group obtained in this manner, the pixel at the position indicated by A is decoded by a known method (step S105), and the shifted The data of the decoded pixel is overwritten at the position indicated by A (the position indicated by A in FIG. 2D in this embodiment) in the one register group 703 (step S106). As a result, the decoded pixel data is stored at the position A in FIG. 2D.
[0051]
Then, it is determined whether or not the decoded data that has not yet been written to the decoded pixel data memory is to be written to the decoded pixel data memory (step S107). For example, when the writing unit is a one-byte unit, it is determined in step S107 whether the decoding process for one byte has been performed. If it is determined that the data is to be written, the process proceeds to step S108, and the decoded data not yet written to the decoded pixel data memory is written to the decoded pixel data memory (step S108).
[0052]
Then, it is determined whether or not all the pixels for one row have been decoded (step S109). If not, the process returns to step S101, and the subsequent processes are repeated.
[0053]
As described above, the image decoding apparatus according to the present embodiment is configured such that when the data of the reference pixel group stored in each of the registers of the
[0054]
Note that, instead of using the
[0055]
Further, in the present embodiment, in order to prepare for decoding of the pixel at the position on the right of the pixel at position A, the
[0056]
[Second embodiment]
In the present embodiment, as the
[0057]
Specifically, in the decoding process according to the present embodiment, the number of registers to be used is adaptively changed according to the shape of the template and the instruction mounted on the
[0058]
Here, "apply a 32-bit shift operation" means that a 64-bit register is composed of two 32-bit registers, and that a shift operation can be applied separately. That is, when the contents of the 64-bit register are (x63, x62,..., X33, x32, x31, x30,..., X1, x0), if a 32-bit shift operation (1-bit left shift) is applied, The contents of the register are (x62, x61, ..., x32, 0, x30, x29, ..., x0, 0).
[0059]
As shown in FIG. 3A, the
[0060]
Next, the flow of the decoding process according to the present embodiment will be described. However, since the flow is basically the same as that of the first embodiment, only different portions will be described.
[0061]
In step S103, a mask is applied to the decoded pixel data group read from the
[0062]
As shown in FIG. 3B, in the
[0063]
In step S103, in preparation for decoding of a pixel at a position on the right of the position indicated by A, which is a new decoding target, the storage position of each data stored in the
[0064]
FIG. 3C is a diagram showing the storage contents of the
[0065]
As described above, by using the
[0066]
[Third Embodiment]
In the present embodiment, a processor having a special instruction is applied as the
[0067]
The flow of the decoding process according to the present embodiment will be described. However, since it is basically the same as the first embodiment, only different portions will be described.
[0068]
For example, it is assumed that there is a special instruction that takes out a data group at a predetermined position of a register into another register and shifts the data group of the original register by a specified number. In this case, in step S103, a process of extracting the reference pixel data group from the decoded pixel data group stored in the
[0069]
It is also assumed that there is an instruction for shifting the data stored in a register by a specified number and then performing a logical sum with another register. In this case, in step S104, the reference pixel data group one-dimensionally connected to the
[0070]
When a processor having a special instruction is used as described above, the number of operations related to a process of obtaining one-dimensionally connected reference pixel data groups can be reduced as compared with the first embodiment, and the entire decoding process can be performed. Higher speed can be achieved.
[0071]
In the above embodiment, the template shape shown in FIG. 4 is used, but the above embodiment is not limited to the template having the shape and size shown in FIG.
[0072]
[Other embodiments]
An object of the present invention is to supply a recording medium (or a storage medium) in which a program code of software for realizing the functions of the above-described embodiments is recorded to a system or an apparatus and a computer (or CPU or MPU) of the system or the apparatus. Can be achieved by reading and executing the program code stored in the recording medium. In this case, the program code itself read from the recording medium implements the functions of the above-described embodiment, and the recording medium on which the program code is recorded constitutes the present invention.
[0073]
When the computer executes the readout program code, not only the functions of the above-described embodiments are realized, but also an operating system (OS) running on the computer based on the instruction of the program code. It goes without saying that a part or all of the actual processing is performed and the functions of the above-described embodiments are realized by the processing.
[0074]
Further, after the program code read from the recording medium is written into a memory provided in a function expansion card inserted into the computer or a function expansion unit connected to the computer, the function is executed based on the instruction of the program code. It goes without saying that the CPU included in the expansion card or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.
[0075]
When the present invention is applied to the recording medium, the recording medium stores program codes corresponding to the flowcharts described above.
[0076]
【The invention's effect】
As described above, according to the present invention, when each encoded pixel is decoded using the template based on the reference pixel, it can be performed with a smaller number of operations.
[Brief description of the drawings]
FIG. 1 is a flowchart of an image decoding process according to a first embodiment of the present invention.
FIG. 2 is a diagram showing storage contents of a
FIG. 3 is a diagram showing stored contents of a
FIG. 4A is a diagram illustrating an example of the shape of a template used when decoding image information, and FIG. 4B is a diagram illustrating the use of a template for decoding image information encoded by the encoding method. It is a figure for explaining a method.
FIG. 5 is a diagram illustrating a state in which a one-dimensionally linked reference pixel data group is obtained from a decoded pixel data group read into a first register group.
FIG. 6 is a diagram for explaining a process in which reference pixel data groups taken out by a second register group are connected one-dimensionally and stored in a
FIG. 7 is a block diagram illustrating a basic configuration of an image decoding device according to the first embodiment of the present invention.
Claims (5)
前記第1のレジスタ群における前記テンプレートの位置を固定させ、前記テンプレートに含まれる復号済みの画素群のデータを第2のレジスタ群に読み出す読み出し工程と、
前記第2のレジスタ群に読み出された画素群のデータを一次元的に連結する連結工程と、
前記連結工程で連結した画素群のデータを用いて当該画素群のデータを符号化時に用いて符号化した画素が復号され、復号された当該画素のデータが前記第1のレジスタ群における復号前の当該画素のデータに上書きされた後に、前記第1のレジスタ群が記憶する各データの記憶位置を所定の方向に1ビット分シフトさせるシフト工程と
を備えることを特徴とする画像復号方法。A first register group that stores decoded pixel data; and a second register group that is different from the first register. Pixel data in an image is arranged at a position corresponding to the position of the pixel. An image decoding method performed by an image decoding device that decodes image encoded data obtained by encoding using data of a pixel group included in the template,
A reading step of fixing the position of the template in the first register group and reading out data of a decoded pixel group included in the template to a second register group;
A linking step of linking the pixel group data read to the second register group one-dimensionally;
A pixel coded by using the data of the pixel group at the time of encoding using the data of the pixel group connected in the connecting step is decoded, and the decoded data of the pixel before decoding in the first register group is decoded. Shifting the storage position of each data stored in the first register group by one bit in a predetermined direction after overwriting the data of the pixel.
前記連結工程では、前記第2のレジスタ群に読み出された各行の画素データを、行毎に連結することを特徴とする請求項1に記載の画像復号方法。In the reading step, among the decoded pixel data for each row stored in the first register group, decoded pixel data of a row necessary for decoding a pixel of interest to be decoded is stored in the second register group. Read line by line
2. The image decoding method according to claim 1, wherein, in the connecting step, the pixel data of each row read into the second register group is connected for each row.
復号済みの画素データを記憶する第1のレジスタ群と、
前記第1のレジスタ群における前記テンプレートの位置を固定させ、前記テンプレートに含まれる復号済みの画素群のデータを第2のレジスタ群に読み出す読み出し手段と、
前記第2のレジスタ群に読み出された画素群のデータを一次元的に連結する連結手段と、
前記連結手段が連結した画素群のデータを用いて当該画素群のデータを符号化時に用いて符号化した画素が復号され、復号された当該画素のデータが前記第1のレジスタ群における復号前の当該画素のデータに上書きされた後に、前記第1のレジスタ群が記憶する各データの記憶位置を所定の方向に1ビット分シフトさせるシフト手段と
を備えることを特徴とする画像復号装置。An image decoding device for decoding image encoded data obtained by encoding pixel data in an image using data of a pixel group included in a template arranged at a position corresponding to the position of the pixel. ,
A first group of registers for storing decoded pixel data;
Reading means for fixing a position of the template in the first register group and reading data of a decoded pixel group included in the template into a second register group;
Connecting means for one-dimensionally connecting pixel group data read to the second register group;
A pixel coded by using the data of the pixel group at the time of encoding using the data of the pixel group connected by the connection unit is decoded, and the decoded data of the pixel before decoding in the first register group is decoded. An image decoding apparatus comprising: a shift unit that shifts a storage position of each data stored in the first register group by one bit in a predetermined direction after being overwritten with data of the pixel.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003133534A JP2004336661A (en) | 2003-05-12 | 2003-05-12 | Method and instrument for picture decoding |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003133534A JP2004336661A (en) | 2003-05-12 | 2003-05-12 | Method and instrument for picture decoding |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004336661A true JP2004336661A (en) | 2004-11-25 |
Family
ID=33508045
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003133534A Withdrawn JP2004336661A (en) | 2003-05-12 | 2003-05-12 | Method and instrument for picture decoding |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004336661A (en) |
-
2003
- 2003-05-12 JP JP2003133534A patent/JP2004336661A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6246396B1 (en) | Cached color conversion method and apparatus | |
US6259456B1 (en) | Data normalization techniques | |
US6414687B1 (en) | Register setting-micro programming system | |
US6807620B1 (en) | Game system with graphics processor | |
US6336180B1 (en) | Method, apparatus and system for managing virtual memory with virtual-physical mapping | |
US20040263524A1 (en) | Memory command handler for use in an image signal processor having a data driven architecture | |
JPH0689567A (en) | Programmable processor used in video game system, etc. and external memory system having processor thereof | |
JP5317573B2 (en) | How to procure immediate values from very long command words | |
JP2002522821A (en) | Data processor and data processing method | |
JP3958224B2 (en) | Parallel subword instructions with distributed results | |
KR20200067222A (en) | Compression and decompression of indexes in the graphics pipeline | |
KR100971626B1 (en) | Instruction encoding within a data processing apparatus having multiple instruction sets | |
US7787021B2 (en) | Programmable architecture for flexible camera image pipe processing | |
US6674435B1 (en) | Fast, symmetric, integer bezier curve to polygon conversion | |
JP2004336661A (en) | Method and instrument for picture decoding | |
US7483595B2 (en) | Image processing method and device | |
JP4442905B2 (en) | Image data processing method | |
JP4482356B2 (en) | Image processing method and image processing apparatus using SIMD processor | |
EP1367484B1 (en) | Instruction encoding | |
CA2298337C (en) | Game system with graphics processor | |
JP2004165766A (en) | Image processing method | |
JP4294190B2 (en) | Parallel processor and image processing apparatus using the same | |
US20080158238A1 (en) | Format conversion apparatus from band interleave format to band separate format | |
JP2006260477A (en) | Pipeline image processor, image processing method and program | |
JP2007080186A (en) | Data processing apparatus, and control method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20060801 |