JP6204171B2 - Image encoding apparatus and image decoding apparatus - Google Patents
Image encoding apparatus and image decoding apparatus Download PDFInfo
- Publication number
- JP6204171B2 JP6204171B2 JP2013249884A JP2013249884A JP6204171B2 JP 6204171 B2 JP6204171 B2 JP 6204171B2 JP 2013249884 A JP2013249884 A JP 2013249884A JP 2013249884 A JP2013249884 A JP 2013249884A JP 6204171 B2 JP6204171 B2 JP 6204171B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- unit
- value
- coefficient
- iman
- 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.)
- Active
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Description
本発明は、画像データを圧縮して符号化する画像符号化装置及び画像符号化データを伸長して復号化する画像復号化装置に関する。 The present invention relates to an image encoding device that compresses and encodes image data, and an image decoding device that decompresses and decodes image encoded data.
従来、通信における負担等の軽減を目的として、画像データを圧縮し、符号化する画像符号化装置があり、その逆処理である符号化した画像データを伸長し、元の画像に復元する画像復号化装置も知られている。そして、近年では、より高い圧縮率で圧縮可能な符号化の規格が提案されている(非特許文献1参照)。 2. Description of the Related Art Conventionally, there is an image encoding device that compresses and encodes image data for the purpose of reducing the burden on communication, etc., and image decoding that decompresses the encoded image data that is the reverse process and restores the original image An apparatus is also known. In recent years, an encoding standard that can be compressed at a higher compression rate has been proposed (see Non-Patent Document 1).
前記規格に従った画像符号化装置及び画像復号化装置について説明する。まず、画像符号化装置の概略構成を図11に示す。同図11に示すように、この画像符号化装置100は、色空間変換部110、周波数変換部120、量子化部130、係数予測部140、適応型スキャン部150、VLC符号化部160、ビットストリーム出力部170より構成される。なお、前記VLC符号化部160の名称中のVLCは、可変長符号化方式(Variable Length Coding)の略称である。
An image encoding device and an image decoding device according to the standard will be described. First, FIG. 11 shows a schematic configuration of the image encoding device. As shown in FIG. 11, the
画像データは、画像の最小単位である画素(ピクセル)からなり、16画素(水平方向)×16画素(垂直方向)で区切られた256画素の画像領域を1つの単位としたマクロブロックと、このマクロブロックを水平方向、垂直方向にそれぞれ4分割した4画素×4画素の単位のブロックから構成される。前記規格に従った画像処理では、このマクロブロック及びブロックを単位として処理が進められる。 The image data is composed of pixels (pixels), which are the minimum unit of an image, and a macroblock having an image area of 256 pixels divided by 16 pixels (horizontal direction) × 16 pixels (vertical direction) as one unit, The macro block is composed of 4 pixel × 4 pixel unit blocks obtained by dividing each macro block into four in the horizontal and vertical directions. In the image processing according to the standard, the processing proceeds in units of the macroblock and the block.
前記色空間変換部110は、入力された画像データをマクロブロック単位で画素毎に色空間変換処理する。色空間変換処理は、非特許文献1の規格で定められたピクセルフォーマットに依存する。ピクセルフォーマットが色空間変換を必要とするものである場合、RGBフォーマットである原画像データはYUVフォーマットに変換される処理がされ、CMYKフォーマットである原画像データはYUVKフォーマットに変換される処理がされる。また、ピクセルフォーマットが色空間変換を必要とするものでない場合、原画像データは色空間変換されない処理がなされる。そして、前記色空間変換部110は、前記処理をした画像データを前記周波数変換部120に入力する。
The color
前記周波数変換部120は、前記色空間変換部110によって色空間処理された画像データを、マクロブロック単位でラスター順に、各マクロブロック内では前記色空間変換後の色成分順に、各色成分内の16個のブロックについて、各画素のデータを周波数帯域毎の係数データに変換する処理(周波数変換)を行う。この周波数変換部120は、各ブロック内の4×4画素の16個の画素データについて、周波数変換をして係数データに変換した後、16個のブロックの各左上の係数データを除く残りの各15個の係数データを集めて、第1階層データを形成する。これは、高周波成分であるHP係数(ハイパス係数)データとなる。次に、16個のブロックの各左上の係数データを集めて、4×4の16個の係数データを形成し、この集められた4×4の係数データをさらに周波数変換して、4×4の係数データとし、この周波数変換した4×4の係数データの内、左上の1個の係数データを除く残りの15個の係数データで第2階層データを形成し、前記2回目の周波数変換後の4×4の係数データの内、左上の1個の係数データで第3階層データを形成する。この第2階層データは、低周波成分であるLP係数(ローパス係数)データに相当し、第3階層データは、直流成分であるDC係数(ディーシー係数)データに相当する。このように前記周波数変換部120は、前記第1階層データ(HP係数)、第2階層データ(LP係数)、第3階層データ(DC係数)を生成し、これらの各階層データを前記量子化部130に入力する。
The
前記量子化部130は、前記周波数変換部120から入力された周波数変換後の第1階層データ、第2階層データ、及び第3階層データを、それぞれ選択された量子化パラメータを用いて量子化する処理を行い、処理後の前記第1階層データ、第2階層データ、及び第3階層データを前記係数予測部140に入力する。
The
前記量子化部130は、図12に示すように、量子化パラメータ記憶部111、iMan値生成部112、iExp値生成部113、左方向バレルシフタ114、除算部115から構成される。
As shown in FIG. 12, the
量子化処理は、前記周波数変換部120により周波数変換された係数データを除算するための数値である量子化パラメータを用いて実施される。量子化パラメータは外部のコントローラ等から圧縮処理の開始前に前記量子化パラメータ記憶部111に入力され、該量子化パラメータ記憶部111に記憶される。
The quantization process is performed using a quantization parameter that is a numerical value for dividing the coefficient data frequency-converted by the
量子化パラメータは、第1階層データ、第2階層データ、及び第3階層データ毎に異なる値が用いられ、前記量子化パラメータ記憶部111より選択されて出力され、この選択された量子化パラメータをQP[7:0]で示す。この量子化パラメータQPは8ビットの数値からなり、前述のQP[7:0]の内、[7:0]は、ビット7〜ビット0の並び順で8ビットを有していることを表している。以下に示すビット表記も同様の表記である。
Different quantization parameters are used for each of the first layer data, the second layer data, and the third layer data. The quantization parameter is selected and output from the quantization
非特許文献1の規格では、量子化処理は、量子化パラメータ(QP)の上位ビット(ビット7〜4)が全て0か否かの情報と下位ビット(ビット3〜0)から生成されるiMan値というデータを量子化パラメータQPの上位ビット(ビット7〜4)から生成されるiExp値というデータで表わされる値だけ左方向にビットシフトしたデータである量子化スケーリングファクタ(QSF)を用いて行われ、入力された係数データは、この量子化スケーリングファクタで除算されて量子化される。
In the standard of Non-Patent
この処理を図12を用いて説明すると、前記量子化パラメータ記憶部111から出力された量子化パラメータQP[7:0]は、iMan値生成部112及びiExp値生成部113に入力される。
This process will be described with reference to FIG. 12. The quantization parameter QP [7: 0] output from the quantization
ここで、iMan値生成部112の構成を図13に示す。同図13に示すように、iMan値生成部112は、ビット切出し部116、加算器117、比較部118、及び選択器119より構成される。
Here, the configuration of the iMan
前記量子化パラメータ記憶部111より入力された量子化パラメータQPは、ビット切出し部116及び比較部118に入力される。前記ビット切出し部116は、入力された量子化パラメータQP[7:0]の内、下位4ビットであるQP[3:0]をビット切出しして前記選択器119の入力ポートA及び前記加算器117に入力し、前記加算器117は、入力された量子化パラメータの下位ビットQP[3:0]に数値16を加算して、その加算結果を前記選択器119の入力ポートBに入力する。
The quantization parameter QP input from the quantization
また、前記比較部118は、入力された量子化パラメータQP[7:0]を数値16と比較して、QPが16よりも小さければ(QPの上位ビットが全て0)、数値1(結果が真)を、そうでなければ、数値0(結果が偽)を出力し、その出力を前記選択器119の入力ポートCに入力する。
The
前記選択器119は、前記比較部118より入力された入力ポートCの値が1(結果が真)であれば、前記ビット切出し部116より該選択器119の入力ポートAに入力された量子化パラメータの下位4ビットであるQP[3:0]を選択し、前記入力ポートCの値が0(結果が偽)であれば、前記加算器117より入力された該選択器の入力ポートBに入力された量子化パラメータの下位4ビットであるQP[3:0]と数値16を加算した結果を選択し、選択されたデータをiMan[4:0]として出力し、出力結果を前記左方向バレルシフタ114に入力する。
If the value of the input port C input from the
また、前記iExp値生成部113は、前記量子化パラメータ記憶部111から入力された量子化パラメータQP[7:0]の内、上位4ビットのQP[7:4]をビット切り出しして、これをiExp[3:0]として前記左方向バレルシフタ144に入力する。
Further, the iExp
そして、前記左方向バレルシフタ114は、前記iMan生成部から入力されたiMan[4:0]を前記iExp生成部より入力されたiExp[3:0]で表わされる数だけ左方向にビットシフトして、量子化の除数となる量子化スケーリングファクタ(QSF[19:0])を生成し、このQSF[19:0]を前記除算部115に入力する。尚、iManは5ビットで構成されており、4ビットで構成されているシフト値であるiExpは0〜15の数値をとる。よって、量子化スケーリングファクタは、5ビットのiManが最大15ビット左シフトされて生成されるので、最大20ビットのビット長を有することになる。
The
前記除算部115は、前記周波数変換部より入力された係数データである前記第1階層データ、第2階層データ、及び第3階層データを前記左方向バレルシフタ114より入力された量子化スケーリングファクタで除算して、除算結果を量子化係数データとして、前記係数予測部140に入力する。
The
前記係数予測部140は、前記量子化部130から入力された量子化係数データである前記第1階層データ、第2階層データ、及び第3階層データについて、それぞれ、隣接するブロック間の係数値の比較を行って予測モードを算出し、所定の演算式に基づいて、導出された予測モードの方向に、相関の高いブロック間で減算する処理を行う。そして、前記係数予測部140は、処理後の第1階層データ、第2階層データ、及び第3階層データを適応型スキャン部150に入力する。
The
前記適応型スキャン部150は、前記係数予測部140から入力された第1階層データ及び第2階層データについて、ブロック毎にその係数データを入れ替える処理を行う。この入替処理は、周波数変換後のブロック内の画素位置が小さい側(低周波数側)に非ゼロの係数データを集め、ブロック内の画素位置が大きい側(高周波数側)にゼロ値が連続する係数データを集めるので、符号化の圧縮率を高めることができる。そして、前記適応型スキャン部150は、係数データを入れ替えた第1階層データ、第2階層データ、及び入替処理を実施しない第3階層データを、前記VLC符号化部160に入力する。
The
前記VLC符号化部160は、前記適応型スキャン部150で処理された第1階層データ、第2階層データ、及び第3階層データに対して、エントロピー符号化処理を施し、コードストリームを生成して、そのコードストリームを前記ビットストリーム出力部170に入力する。
The
前記ビットストリーム170は、ヘッダ情報としての画像設定データに、前記VLC符号化部160で符号化されたコードストリームを順次連接し、1画像データ分のビットストリームとして1纏めにして、1つのファイルを形成し、形成したファイルを外部に出力する。
The
次に、前記規格に従った画像復号化装置の概略構成を図14に示す。同図14に示すように、この画像復号化装置200は、ビットストリーム解析部210、VLC復号化部220、適応型スキャン部230、係数逆予測部240、逆量子化部250、周波数逆変換部260、色空間逆変換部270より構成される。なお、画像復号化装置の処理は、前述の画像符号化装置の処理と逆の手順で行われ、用いられる画像データの構成は前記画像符号化装置の場合と同様であり、符号化された第1階層データ(HP係数)、第2階層データ(LP係数)、及び第3階層データ(DC係数)がマクロブロック及びブロック単位で画像データに復元されていく。以下、画像復号化装置200の各構成要素の動作を順に説明する。
Next, FIG. 14 shows a schematic configuration of an image decoding apparatus according to the standard. As shown in FIG. 14, the
前記ビットストリーム解析部210は、入力された1画像分の圧縮データであるビットストリームを解析し、画像情報を抽出するとともに、符号化された画像データを分離し、前記VLC復号化部220に入力する。
The
前記VLC復号化部220は、前記ビットストリーム解析部210で分離された画像符号化データである第1階層データ(HP係数)、2階層データ(LP係数)及び第3階層データ(DC係数)に対して、VLC復号化処理である可変長復号化処理を施し、復号化した係数データを前記適応型スキャン部230に出力する。
The
前記適応型スキャン部230は、圧縮時に定められた手法によって画素順を入れ替えられた第1階層データ及び第2階層データについて、その係数データを圧縮とは逆の手順によって入れ替え、元の画素順に戻す処理を行う。この入替処理は、圧縮の際にブロックの左上部の周波数帯域の低い側に非ゼロの係数を集めることで(逆に右下部の周波数帯域の高い側に係数値がゼロのものが集まる)、符号化において圧縮率を高めるために行われるものである。
The
前記係数逆予測部240は、前記適応型スキャン部230から入力された第1階層データ、第2階層データ、及び前記VLC復号化部220から入力された第3階層データについて、それぞれ、隣接するブロック間での係数の比較を行って予測モードを導出し、予測モードに対し、設定された演算式に従って、相関の高いブロックの対応する画素の値を、対象画素に足し込むことで、圧縮における予測処理前の画素値を復元(逆予測)する。そして、逆予測後の第1階層データ、第2階層データ及び第3階層データを逆量子化部250に入力する。
The coefficient
前記逆量子化部250は、前記係数逆予測部240により逆予測された第1階層データ、第2階層データ及び第3階層データを、それぞれ設定された量子化パラメータを用いて逆量子化する処理を行い、処理後の第1階層データ、第2階層データ及び第3階層データを、ブロック毎に周波数逆変換部260に入力する。
The
前記逆量子化部250は、図15に示すように、量子化パラメータ記憶部211、iMan値生成部212、iExp値生成部213、左方向バレルシフタ214、乗算器215から構成される。
As shown in FIG. 15, the
これは、図12における画像符号化装置100の量子化部130の構成と比べ、除算部115を乗算器215に置き換えたことを除き、同様の構成となっている。
This is the same configuration as that of the
即ち、前記量子化パラメータ記憶部211に保持された量子化パラメータであるQP[7:0]の内、上位4ビットが全て0か否かの情報と下位4ビットから前記iMan生成部212により生成された5ビット長のiMan[4:0]と上位4ビットから生成された4ビット長のiExp[3:0]を前記左方向バレルシフタ214に入力し、前記左方向バレルシフタ214は、iMan[4:0]をiExp[3:0]が示す数だけ左シフトし、量子化スケーリングファクタ(QSF[19:0])を生成し、前記乗算器215に入力する。
That is, the
乗算器215は、前記係数逆予測部240より入力された逆予測係数データを、前記左方向バレルシフタ214より入力された量子化スケーリングファクタで乗算して、逆量子化係数データを生成し、前記周波数逆変換部260に入力する。
The
前記周波数逆変換部260は、前記逆量子化部250によって逆量子化された係数データを、4×4画素を一つのブロックとしてラスター方向に順次処理し、周波数帯域毎の係数データを画素データに変換する処理を行う。この周波数逆変換部260は、周波数帯域毎に分離していた第1階層データ、第2階層データ及び第3階層データを、色成分毎に、1マクロブロック(16×16画素)の2次元空間データに戻して、前記色空間逆変換部270に入力する。
The frequency
前記色空間逆変換部270は、前記周波数逆変換部260から入力された色成分毎の画像データを画素毎に処理し、色空間逆変換が不要な場合は、色空間逆変換せず、色空間逆変換が必要な場合は、色空間逆変換を行って、処理後の画素データを、外部に1画像分の画像データとして出力する。
The color space
尚、前述のように、色空間逆変換の要否は、非特許文献1の規格で定められた画像の形式を表わすピクセルフォーマットという情報に依存し、そのピクセルフォーマットが変換を必要とするものである場合には、YUVフォーマットである画像データは、RGBフォーマットに変換され、YUVKフォーマットである画像データは、CMYKフォーマットに変換される。また、そのピクセルフォーマットが色空間逆変換を必要とするものでない場合には、色空間逆変換されない。
As described above, whether or not color space reverse conversion is necessary depends on information called a pixel format representing an image format defined in the standard of
ところで、画像符号化装置の量子化部における除算部へ入力される係数データとその除数データ、及び画像復号化装置の逆量子化部における乗算器へ入力される係数とその乗数データは、そのビット幅が増大する程、前記除算部及び乗算器を構成する回路規模が大きくなり、除算部及び乗算器の処理速度が低下することが知られている。 By the way, the coefficient data and its divisor data input to the division unit in the quantization unit of the image encoding device, and the coefficient and its multiplier data input to the multiplier in the inverse quantization unit of the image decoding device are the bits. It is known that as the width increases, the circuit scale constituting the division unit and multiplier increases, and the processing speed of the division unit and multiplier decreases.
図12に示す従来の画像符号化装置100の量子化部130における除算部115の除数データ及び図15に示す従来の画像復号化装置200の逆量子化部250における乗算器215の乗数データとして、前述のように、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されるiManを量子化パラメータの上位ビットから生成されるiExpの値で左方向にビットシフトしたデータである20ビット長の量子化スケーリングファクタが用いられる。
As the divisor data of the
図16に量子化パラメータ(QP)と量子化スケーリングファクタ(QSF)の関係を示す。量子化パラメータは1〜255まで変化するのに対し、量子化スケーリングファクタは16進数表記で00002(16)〜F8000(16)まで変化し、10進数表記では2〜1015808まで変化する。量子化パラメータの上位ビットから生成されるiExpを用いて左方向へのビットシフトを行っているために、量子化パラメータの変化に対し、量子化スケーリングファクタの変化は、量子化パラメータが大きくなる程、急激に大きくなる。 FIG. 16 shows the relationship between the quantization parameter (QP) and the quantization scaling factor (QSF). While the quantization parameter varies from 1 to 255, the quantization scaling factor varies from 00002 (16) to F8000 (16) in hexadecimal notation and from 2 to 1015808 in decimal notation. Since bit shift in the left direction is performed using iExp generated from the higher-order bits of the quantization parameter, the change in the quantization scaling factor with respect to the change in the quantization parameter increases as the quantization parameter increases. Suddenly grows.
従来の画像符号化装置の量子化部における除算データ及び従来の画像復号化装置における乗算データは、上記のように、20ビットで表わされるような大きな値であり、これを用いて除算並びに乗算をしているので、量子化部に用いる除算部や逆量子化部に用いる乗算器の回路規模が大きくなり、乗算器や除算部の処理速度が低下するという問題があった。 The division data in the quantization unit of the conventional image coding apparatus and the multiplication data in the conventional image decoding apparatus are large values as represented by 20 bits as described above, and division and multiplication are performed using this. Therefore, there has been a problem that the circuit scale of the multiplier used in the division unit and the inverse quantization unit used in the quantization unit is increased, and the processing speed of the multiplier and the division unit is reduced.
本発明は、以上の実情に鑑み、なされたものであって、画像符号化装置の量子化部における除算データ及び画像復号化装置の逆量子化部における乗算データの値を量子化パラメータの値の増加に対して、極端に増大させないようにし、その回路規模が小さく、高速な処理が可能な量子化部を備えた画像符号化装置、及び逆量子化部を備えた画像復号化装置の提供を、その目的とする。 The present invention has been made in view of the above circumstances, and the division data in the quantization unit of the image encoding device and the value of the multiplication data in the inverse quantization unit of the image decoding device are converted into the values of the quantization parameters. Providing an image encoding device including a quantization unit capable of performing high-speed processing, and an image decoding device including an inverse quantization unit so as not to increase extremely with respect to the increase, the circuit scale being small And its purpose.
上記課題を解決するため、本発明の画像符号化装置は、
画像データを水平及び垂直の各方向にn画素からなるブロックを単位として、水平及び垂直の各方向にm個のブロックからなるマクロブロックについて周波数変換し、マクロブロック内の各ブロックの左上の画素位置以外の画素位置に相当するデータを高周波数成分の係数データとし、マクロブロック内の各ブロックの左上の画素位置に相当するデータを集めてさらに周波数変換し、該周波数変換後の左上の画素位置に相当するデータを直流成分の係数データとし、左上以外の画素位置に相当するデータを低周波数成分の係数データとする周波数変換部と、
前記周波数変換部により周波数変換された各成分の係数データを、内部又は外部の記憶領域に保持された(p+q)ビット長からなる量子化パラメータを用いて量子化して量子化係数データとする量子化部と、
前記量子化部により量子化された低周波数成分及び高周波数成分の量子化係数データのブロック内における画素の並び順を入れ替える処理をして入替係数データとする係数スキャン部と、
前記量子化部による量子化後の直流成分の量子化係数データ及び前記係数スキャン部による入替処理後の低周波数成分及び高周波数成分の入替係数データを符号化して符号化データを生成する符号化部とを備えた画像符号化装置において、
前記量子化部は、
量子化パラメータの上位p個のビットをビット切出ししたデータであるpビット長のiExp値を生成するiExp値生成部と、
量子化パラメータの上位p個の各ビットが全て0であるときは、量子化パラメータの下位q個のビットをビット切出しし、その最上位ビットの1つ上のビットに0の値を充当したデータである(q+1)ビット長のiMan値を生成し、量子化パラメータの上位p個のビットのいずれか1つが1であるときは、量子化パラメータの下位q個のビットをビット切出しし、その最上位ビットの1つ上のビットに1の値を充当したデータである(q+1)ビット長のiMan値を生成するiMan値生成部と、
前記周波数変換部により周波数変換された直流成分、低周波数成分、及び高周波数成分の係数データを該iMan値で除算して除算データとする除算部と、
前記除算部により除算された除算データを前記iExp値生成部により生成されたiExp値で表わされる値だけ右方向にビットシフトして、量子化係数データを生成する右方向バレルシフタとを備える。但し、前記n及びmは2以上の整数であり、前記p及びqは1以上の整数である。
In order to solve the above-described problem, an image encoding device according to the present invention includes:
The image data is frequency-converted for a macroblock consisting of m blocks in each horizontal and vertical direction in units of a block consisting of n pixels in each horizontal and vertical direction, and the upper left pixel position of each block in the macroblock The data corresponding to the pixel position other than the above is used as the coefficient data of the high frequency component, the data corresponding to the upper left pixel position of each block in the macro block is collected, further frequency-converted, and the upper left pixel position after the frequency conversion. The frequency conversion unit which makes the corresponding data the coefficient data of the direct current component, and the data corresponding to the pixel position other than the upper left the coefficient data of the low frequency component,
Quantization of the coefficient data of each component frequency-converted by the frequency conversion unit by using a quantization parameter having a (p + q) bit length held in an internal or external storage area to obtain quantized coefficient data And
A coefficient scanning unit that performs replacement processing of pixels in the block of quantized coefficient data of the low frequency component and high frequency component quantized by the quantizing unit to obtain replacement coefficient data;
An encoding unit that generates encoded data by encoding the quantized coefficient data of the DC component after quantization by the quantizing unit and the low-frequency component and high-frequency component replacement coefficient data after the replacement processing by the coefficient scanning unit In an image encoding device comprising:
The quantization unit is
An iExp value generation unit for generating an iExp value having a p-bit length, which is data obtained by cutting out the upper p bits of the quantization parameter;
When all the upper p bits of the quantization parameter are 0, the lower q bits of the quantization parameter are cut out, and the
A division unit that divides the coefficient data of the direct current component, the low frequency component, and the high frequency component that are frequency-converted by the frequency conversion unit by the iMan value to obtain divided data;
A right barrel shifter that shifts the data divided by the division unit to the right by the value represented by the iExp value generated by the iExp value generation unit and generates quantized coefficient data; However, n and m are integers of 2 or more, and p and q are integers of 1 or more.
上記構成を備えた本発明に係る画像符号化装置によれば、まず、1画像分の画像データが周波数変換部に入力され、周波数変換部においては、画像データは水平及び垂直の各方向にn画素からなるブロックを単位として、水平及び垂直の各方向にm個のブロックからなるマクロブロックについて周波数変換されて高周波数成分、低周波数成分、及び直流成分の係数データとされ、量子化部に入力される。 According to the image coding apparatus according to the present invention having the above-described configuration, first, image data for one image is input to the frequency conversion unit, and the image data is divided into n in each of the horizontal and vertical directions. Using a block of pixels as a unit, frequency conversion is performed on a macroblock consisting of m blocks in each of the horizontal and vertical directions to obtain coefficient data of a high frequency component, a low frequency component, and a direct current component, and input to the quantization unit Is done.
そして、量子化部において、周波数変換された各成分の係数データは、内部又は外部の記憶領域に保持された量子化パラメータを用いて量子化される。 Then, in the quantization unit, the frequency-converted coefficient data of each component is quantized using a quantization parameter held in an internal or external storage area.
量子化された係数データは、係数予測部に入力され、係数予測部において、予測モードを導出するとともに、相関の高いブロック間で減算される処理を行った後、係数スキャン部に入力され、係数スキャン部において、非ゼロの係数データをブロック内の低周波数側に集中させるように、ブロック内の画素の並び順を入れ替える処理が行われ、入れ替え後のブロック単位の係数データが符号化部において符号化され、符号化データが生成される。 The quantized coefficient data is input to the coefficient prediction unit. The coefficient prediction unit derives a prediction mode and performs a process of subtracting between highly correlated blocks, and then inputs the coefficient data to the coefficient scan unit. In the scanning unit, processing for changing the arrangement order of the pixels in the block is performed so that non-zero coefficient data is concentrated on the low frequency side in the block, and the coefficient data in the block unit after the replacement is encoded in the encoding unit. And encoded data is generated.
そして、量子化部では、iExp値生成部において、(p+q)ビット長からなる量子化パラメータの上位p個のビットをビット切出しして、pビット長のiExp値を生成し、iMan値生成部において、量子化パラメータの上位p個のビットが全て0か否かの情報と量子化パラメータの下位q個のビットをビット切出ししたデータから、(q+1)ビット長のiMan値を生成し、除算部において、周波数変換部にて周波数変換された各成分の係数データを、iMan値生成部にて生成されたiMan値で除算し、右方向バレルシフタにおいて、除算部にて除算された除算データを、iExp値生成部にて生成されたiExp値が示す数値だけ右方向にビットシフトされ、量子化される。 Then, in the quantization unit, in the iExp value generation unit, the upper p bits of the quantization parameter having a length of (p + q) bits are cut out to generate an iExp value having a p bit length, and in the iMan value generation unit. Then, an iMan value having a length of (q + 1) bits is generated from information indicating whether all the upper p bits of the quantization parameter are 0 and data obtained by cutting out the lower q bits of the quantization parameter. The coefficient data of each component frequency-converted by the frequency conversion unit is divided by the iMan value generated by the iMan value generation unit, and the division data divided by the division unit is converted to the iExp value in the right barrel shifter. The numerical value indicated by the iExp value generated by the generation unit is bit-shifted rightward and quantized.
このように、本発明の構成によれば、周波数変換部にて周波数変換された各成分の係数データを、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されたiMan値で除算し、除算データを量子化パラメータの上位ビットから生成されたiExp値で右方向にビットシフトしているので、従来の構成のように、各成分の係数データを、iMan値を左方向にiExp値でビットシフトしたデータである量子化スケーリングファクタという大きな数値で除算されることがなくなり、除算を実施する除算器の回路規模を小さくすることができ、除算の処理速度を向上させることが可能となり、画像符号化処理の最適化を図ることができる。 As described above, according to the configuration of the present invention, the coefficient data of each component frequency-converted by the frequency conversion unit is generated from iMan generated from information indicating whether or not all the upper bits of the quantization parameter are 0 and the lower bits. Since the division data is bit-shifted to the right by the iExp value generated from the higher-order bits of the quantization parameter, the coefficient data of each component is moved to the left by the iMan value as in the conventional configuration. In this case, the data is not divided by a large numerical value called a quantization scaling factor that is data bit-shifted by the iExp value, the circuit scale of the divider that performs the division can be reduced, and the processing speed of the division can be improved. Thus, the image encoding process can be optimized.
さらに、本発明の画像符号化装置に係る除算部は、
前記各iMan値に対応する逆数の値を保持した記憶領域を有し、前記iMan値生成部により生成されたiMan値に応じて、対応する逆数値を選択する逆数テーブル部と、
前記周波数変換部により周波数変換された直流成分、低周波数成分、及び高周波数成分の係数データを前記逆数テーブル部により選択されたiMan値の逆数値で乗算する乗算器とを備える。
Furthermore, the division unit according to the image encoding device of the present invention is:
A reciprocal table unit that has a storage area that holds a reciprocal value corresponding to each iMan value, and selects a reciprocal value corresponding to the iMan value generated by the iMan value generation unit;
A multiplier that multiplies the coefficient data of the DC component, the low frequency component, and the high frequency component frequency-converted by the frequency conversion unit by the reciprocal value of the iMan value selected by the reciprocal table unit.
上記構成を備えた本発明に係る画像符号化装置における除算部によれば、まず、逆数テーブル部において、iMan値生成部により生成されたiMan値に対応する逆数が、逆数テーブル部内の記憶領域に保持された各iMan値の逆数の中から選択され、乗算器において、周波数変換部により周波数変換された各成分の係数データに、逆数テーブル部により選択されたiManの逆数値が乗算されて、係数データの量子化が実施される。 According to the division unit in the image encoding device according to the present invention having the above configuration, first, in the reciprocal table unit, the reciprocal corresponding to the iMan value generated by the iMan value generating unit is stored in the storage area in the reciprocal table unit. The reciprocal of each iMan value held is selected, and the coefficient data of each component frequency-converted by the frequency converter in the multiplier is multiplied by the reciprocal value of iMan selected by the reciprocal table unit to obtain the coefficient Data quantization is performed.
このように、本発明の構成によれば、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットのビット切出しデータから生成されたビット幅の小さいiMan値を用いて、逆数を生成するので、従来のiMan値を量子化パラメータの上位ビットから生成されるiExp値で左方向にビットシフトしたデータである量子化スケーリングファクタを用いる場合と比べて、逆数をとった場合の逆数データのビット幅を小さくすることができる。また、iMan値は量子化パラメータの上位ビットが全て0か否かの情報と下位ビットのビット切出しデータから生成されるので、従来の量子化パラメータ全体を用いるのに比べ、逆数をとるべき基となる数値の数を少なくすることができ、保持しておくべき逆数の数も少なくすることができる。よって、本構成の逆数テーブル部及び乗算器の回路規模を小さくし、本除算部の処理速度を向上させることが可能となり、画像符号化処理の最適化を図ることができる。 As described above, according to the configuration of the present invention, the reciprocal is generated by using the information indicating whether the upper bits of the quantization parameter are all 0 and the iMan value having a small bit width generated from the bit extraction data of the lower bits. Therefore, the reciprocal data of the reciprocal data when the reciprocal is taken compared to the case of using the quantized scaling factor that is the data obtained by bit shifting the iMan value to the left by the iExp value generated from the higher order bits of the quantization parameter. The bit width can be reduced. Further, since the iMan value is generated from the information indicating whether all the upper bits of the quantization parameter are 0 and the bit cut-out data of the lower bits, the iMan value is based on the reciprocal number compared to the conventional quantization parameter as a whole. The number of numerical values can be reduced, and the number of reciprocals to be held can also be reduced. Therefore, it is possible to reduce the circuit scale of the reciprocal table unit and the multiplier of this configuration, improve the processing speed of the division unit, and optimize the image encoding process.
また、本発明の画像復号化装置は、
周波数変換後の画像データの内、直流成分、低周波数成分、及び高周波数成分からなる係数データが符号化された画像圧縮データを復号化して、直流成分、低周波数成分、及び高周波数成分からなる復号化データを生成する復号化部と、
前記復号化部により復号化された低周波数成分及び高周波数成分の復号化データのブロック内における画素の並び順を入れ替える処理をして入替係数データとする係数スキャン部と、
前記復号化部により復号化された直流成分の復号化データ、及び、前記係数スキャン部によりブロック内における画素の並び順が入れ替えられた低周波数成分及び高周波数成分の係数データを、内部又は外部の記憶領域に保持された8ビット長からなる量子化パラメータを用いて逆量子化して逆量子化係数データとする逆量子化部と、
該逆量子化係数データを周波数逆変換して復元される画像領域を、水平及び垂直の各方向にn画素からなるブロックからなり、該ブロックを水平及び垂直の各方向にm個有するマクロブロックからなる画像領域として、水平及び垂直の各方向にm個からなる領域の左上の画素位置に直流成分の逆量子化係数データを配置し、該領域の左上以外の画素位置に低周波数成分の逆量子化係数データを配置して、該領域について周波数逆変換し、周波数逆変換した該領域の各画素位置の係数データを該領域の画素位置に対応する位置に相当するマクロブロック内の各ブロックの、左上の画素位置に配置し、該マクロブロック内の各ブロックの左上の画素位置以外の画素位置に高周波数成分の逆量子化係数データを配置し、該マクロブロック内のブロック毎に、さらに周波数逆変換して、周波数逆変換データとする周波数逆変換部とを備えた画像復号化装置において、
前記逆量子化部は、
量子化パラメータの上位p個のビットをビット切出ししたデータであるpビット長のiExp値を生成するiExp値生成部と、
量子化パラメータの上位p個の各ビットが全て0であるときは、量子化パラメータの下位q個のビットをビット切出しし、その最上位ビットの1つ上のビットに0の値を充当したデータである(q+1)ビット長のiMan値を生成し、量子化パラメータの上位p個のビットのいずれか1つが1であるときは、量子化パラメータの下位q個のビットをビット切出しし、その最上位ビットの1つ上のビットに1の値を充当したデータである(q+1)ビット長のiMan値を生成するiMan値生成部と、
前記復号化部により復号化された直流成分の復号化データ、及び前記係数スキャン部によりブロック内における画素の並び順を入れ替えられた低周波数成分及び高周波数成分の係数データを該iMan値で乗算して乗算データとする乗算器と、
前記乗算器により乗算された乗算データを前記iExp値生成部により生成されたiExp値で表わされる値だけ左方向にビットシフトして、逆量子化係数データを生成する左方向バレルシフタとを備える。但し、前記n及びmは2以上の整数であり、前記p及びqは1以上の整数である。
The image decoding apparatus of the present invention is
Decodes compressed image data in which coefficient data consisting of DC components, low-frequency components, and high-frequency components in the image data after frequency conversion is encoded, and consists of DC components, low-frequency components, and high-frequency components A decryption unit for generating decrypted data;
A coefficient scanning unit that performs replacement processing of pixels in the block of the decoded data of the low-frequency component and the high-frequency component decoded by the decoding unit to obtain replacement coefficient data;
The DC component decoded data decoded by the decoding unit, and the low frequency component and high frequency component coefficient data in which the arrangement order of pixels in the block is changed by the coefficient scanning unit An inverse quantization unit that performs inverse quantization using an 8-bit length quantization parameter held in a storage area to obtain inverse quantization coefficient data;
An image area restored by inverse frequency transform of the inverse quantization coefficient data is composed of blocks of n pixels in each of the horizontal and vertical directions, and from a macro block having m blocks in each of the horizontal and vertical directions. As the image area, the inverse quantization coefficient data of the direct current component is arranged at the pixel position at the upper left of the m area in each of the horizontal and vertical directions, and the inverse quantization of the low frequency component is performed at a pixel position other than the upper left of the area. The coefficient data of each pixel position in the region subjected to frequency inverse transform for the region is disposed, and the coefficient data of each pixel position in the region subjected to the frequency inverse transform is converted into each block in the macroblock corresponding to the position corresponding to the pixel position in the region, It is arranged at the pixel position at the upper left, and the inverse quantization coefficient data of the high frequency component is arranged at a pixel position other than the pixel position at the upper left of each block in the macro block. Every further by frequency inverse conversion, the image decoding apparatus and a frequency inverse conversion unit for the frequency inversion data,
The inverse quantization unit includes:
An iExp value generation unit for generating an iExp value having a p-bit length, which is data obtained by cutting out the upper p bits of the quantization parameter;
When all the upper p bits of the quantization parameter are 0, the lower q bits of the quantization parameter are cut out, and the
The iMan value is multiplied by the decoded data of the DC component decoded by the decoding unit and the coefficient data of the low frequency component and the high frequency component in which the arrangement order of the pixels in the block is changed by the coefficient scanning unit. A multiplier for multiplication data,
A left barrel shifter for generating dequantized coefficient data by bit-shifting the multiplication data multiplied by the multiplier to the left by a value represented by the iExp value generated by the iExp value generation unit; However, n and m are integers of 2 or more, and p and q are integers of 1 or more.
上記構成を備えた本発明に係る画像復号化装置によれば、まず、1画像分の画像データに相当する符号化データが復号化部に入力され、復号化部においては、直流成分、低周波数成分、及び高周波数成分毎に復号化されて、復号化データとして、係数スキャン部に入力され、係数スキャン部において、非ゼロの係数データをブロック内の低周波数側に集中させるように、ブロック内の画素の並び順を入れ替える処理が行われ、入れ替え後のブロック単位の係数データが係数逆予測部に入力され、係数逆予測部において、予測モードを導出するとともに、相関の高いブロック間で足し戻される処理を行った後、逆予測データは逆量子化部に入力される。 According to the image decoding apparatus according to the present invention having the above-described configuration, first, encoded data corresponding to image data for one image is input to the decoding unit, and in the decoding unit, a DC component, a low frequency It is decoded for each component and high-frequency component, and is input to the coefficient scanning unit as decoded data. In the coefficient scanning unit, non-zero coefficient data is concentrated on the low frequency side in the block. The processing is performed to change the order of the pixels in the block, and the coefficient data of the block unit after the replacement is input to the coefficient inverse prediction unit, and the coefficient inverse prediction unit derives the prediction mode and adds back between the highly correlated blocks. Then, the inverse prediction data is input to the inverse quantization unit.
そして、逆量子化部において、逆予測された各成分の係数データは、内部又は外部の記憶領域に保持された量子化パラメータを用いて乗算することにより逆量子化される。 Then, in the inverse quantization unit, the inversely predicted coefficient data of each component is inversely quantized by multiplication using a quantization parameter held in an internal or external storage area.
逆量子化された各成分の係数データは、周波数逆変換部に入力され、周波数逆変換部において、水平及び垂直の各方向にn画素からなるブロック、及び該ブロックを水平及び垂直の各方向にm個有するマクロブロックに周波数逆変換し、画像データとされる。 The inversely quantized coefficient data of each component is input to the frequency inverse transform unit, where the frequency inverse transform unit includes a block of n pixels in each horizontal and vertical direction, and the block in each horizontal and vertical direction. The frequency is inversely converted into m macroblocks to obtain image data.
そして、逆量子化部では、iExp値生成部において、(p+q)ビット長からなる量子化パラメータの上位p個のビットをビット切出しして、pビット長のiExp値を生成し、iMan値生成部において、量子化パラメータの上位p個のビットが全て0か否かの情報と量子化パラメータの下位q個のビットをビット切出ししたデータから、(q+1)ビット長のiMan値を生成し、乗算器において、係数逆予測部にて逆予測処理された各成分の係数データを、iMan値生成部にて生成されたiMan値で乗算し、左方向バレルシフタにおいて、乗算器にて乗算された乗算データを、iExp値生成部にて生成されたiExp値が示す数値だけ左方向にビットシフトし、逆量子化される。 Then, in the inverse quantization unit, in the iExp value generation unit, the upper p bits of the quantization parameter having a length of (p + q) bits are cut out to generate an iExp value having a p bit length, and the iMan value generation unit A qq) bit length iMan value is generated from the information indicating whether the upper p bits of the quantization parameter are all 0 and the lower q bits of the quantization parameter. , The coefficient data of each component subjected to the inverse prediction processing by the coefficient inverse prediction unit is multiplied by the iMan value generated by the iMan value generation unit, and the multiplication data multiplied by the multiplier is multiplied by the left barrel shifter. , Bit shift leftward by the numerical value indicated by the iExp value generated by the iExp value generation unit, and inverse quantization is performed.
このように、本発明の構成によれば、係数逆予測部にて逆予測処理された各成分の係数データを、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されたiMan値で乗算し、乗算データを量子化パラメータの上位ビットから生成されたiExp値で左方向にビットシフトしているので、従来の構成のように、各成分の係数データを、iMan値を左方向にiExp値でビットシフトしたデータである量子化スケーリングファクタという大きな数値で乗算されることがなくなり、乗算を実施する乗算器の回路規模を小さくすることができ、乗算の処理速度を向上させることが可能となり、画像復号化処理の最適化を図ることができる。 As described above, according to the configuration of the present invention, the coefficient data of each component subjected to the inverse prediction processing by the coefficient inverse prediction unit is generated from the information indicating whether the upper bits of the quantization parameter are all 0 and the lower bits. The iMan value is multiplied, and the multiplication data is bit-shifted leftward by the iExp value generated from the higher-order bits of the quantization parameter, so that the coefficient data of each component is converted to the iMan value as in the conventional configuration. Multiplication by a large value called a quantization scaling factor, which is data shifted bitwise by an iExp value in the left direction, is eliminated, the circuit scale of the multiplier that performs the multiplication can be reduced, and the multiplication processing speed is improved. Therefore, it is possible to optimize the image decoding process.
以上のように、本発明によれば、画像符号化装置における量子化部及び画像復号化装置における逆量子化部において、量子化部及び逆量子化部に用いる量子化パラメータについて、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットからiMan値を生成し、量子化パラメータの上位ビットからiExp値を生成して、量子化部においては、周波数変換された各成分の係数データをiMan値で除算した後、除算データをiExp値で右方向にビットシフトして量子化し、逆量子化部においては、逆予測処理された各成分の係数データをiMan値で乗算した後、乗算データをiExp値で左方向にビットシフトして逆量子化する構成としているので、画像符号化装置における量子化部及び画像復号化装置における逆量子化部の回路規模を小さくし、その処理速度を向上させることが可能となり、画像符号化処理及び画像復号化処理の最適化を図ることができる。 As described above, according to the present invention, the quantization parameter used in the quantization unit and the inverse quantization unit in the quantization unit in the image encoding device and the inverse quantization unit in the image decoding device is the quantization parameter. An iMan value is generated from the information indicating whether the upper bits are all 0 and the lower bits, and an iExp value is generated from the upper bits of the quantization parameter. In the quantizing unit, the coefficient data of each component subjected to frequency conversion is generated. After dividing by the iMan value, the divided data is bit-shifted to the right by the iExp value and quantized, and the inverse quantization unit multiplies the coefficient data of each component subjected to inverse prediction processing by the iMan value, and then multiplies the data. Is bit-shifted to the left with the iExp value and is inversely quantized, so that the quantization unit in the image encoding device and the inverse quantization unit in the image decoding device To reduce the circuit scale, it is possible to improve the processing speed, it is possible to optimize the image encoding processing and image decoding processing.
以下、本発明に係る画像符号化装置及び画像復号化装置についての具体的な実施形態について、図面を参照しながら説明する。まず、画像符号化装置について説明する。 Hereinafter, specific embodiments of an image encoding device and an image decoding device according to the present invention will be described with reference to the drawings. First, an image encoding device will be described.
[1.本実施形態に係る画像符号化装置]
図1は本実施形態に係る画像符号化装置1の構成を示したブロック図である。同図1に示すように、本実施形態の画像符号化装置1は、図11の従来の画像符号化装置100における量子化部130に代えて、これとはその構成の異なる量子化部10を備えるもので、この点においてのみ、従来の画像符号化装置100とその構成が異なっている。従って、他の構成については、上記画像符号化装置100におけるものと同一の符号を付して、その詳しい説明は省略する。
[1. Image coding apparatus according to this embodiment]
FIG. 1 is a block diagram showing a configuration of an
前記量子化部10は、図2に示すように、量子化パラメータ記憶部11、iMan値生成部12、iExp値生成部13、除算部14、右方向バレルシフタ15から構成され、図7に示すフローで処理が進められる。以下、図7の各ステップを参照しながら、量子化部の各処理について説明する。
As shown in FIG. 2, the
量子化パラメータ記憶部11は、符号化処理開始前にコントローラ等から処理に必要な量子化パラメータを取得し記憶する(ステップS1)。
The quantization
符号化処理開始時に、係数データをカウントしてマクロブロック、色成分、及びブロックのカウンタ値を更新しているブロックカウンタ(図示せず)のマクロブロックのカウンタ値m、色成分のカウンタ値c、及びブロックのカウンタ値nを1に初期化する(ステップS2)。以降、処理とともに更新されたマクロブロック、色成分、及びブロックの各カウンタ値における量子化処理は同様の処理となるので、処理が進んだ状態での各カウンタ値における量子化処理について説明する。 At the start of the encoding process, the coefficient value is counted and the macro block counter value m of the block counter (not shown) that updates the macro block, the color component, and the block counter value, the color component counter value c, The counter value n of the block is initialized to 1 (step S2). Hereinafter, the quantization process for each counter value of the macroblock, the color component, and the block updated together with the process is the same process, and therefore, the quantization process for each counter value in a state in which the process has progressed will be described.
前記周波数変換部120において、現在のマクロブロック(カウンタ値mに対応)の画像データを周波数変換し、直流(DC)成分、低周波数(LP)成分、及び高周波数(HP)成分の各係数データとする(ステップS3)。このマクロブロック内には、1、3、又は4個の色成分があり、各色成分内には、1画素の直流成分の係数データ(DC係数)と15画素の1ブロックからなる低周波数成分の係数データ(LP係数)と15画素を1ブロックとし、16個のブロックからなる高周波成分の係数データ(HP係数)がある。
In the
前記量子化パラメータ記憶部11は、現在の色成分(カウンタ値cに対応)に対応する直流成分、低周波数成分、及び高周波数成分の量子化パラメータ(各8ビット長)を選択する(ステップS4)。量子化処理は、DC係数データ、LP係数データ、及びHP係数データの順で実施される。
The quantization
まず、前記量子化パラメータ記憶部11により選択された直流成分の量子化パラメータ(8ビット長)が、前記iMan値生成部12及び前記iExp値生成部13に入力される。
First, a DC component quantization parameter (8-bit length) selected by the quantization
前記iMan値生成部12の構成は、図13で既に説明した構成と同じであるが、前記iMan値生成部12は、量子化パラメータの値が16未満(上位4ビットが全て0)であれば、量子化パラメータの下位4ビットをビット切出しし、その最上位ビットの1つ上のビットに0を充当したデータを5ビットのiMan値として生成し、量子化パラメータの値が16以上(上位4ビットのいずれか1つのビットが1)であれば、量子化パラメータの下位4ビットをビット切出しし、数値の16を加算(その最上位ビットの1つ上のビットに1を充当)したデータを5ビットのiMan値として生成し、前記除算部14に入力する。そして、前記iExp値生成部13は、量子化パラメータの上位4ビットをビット切出しし、4ビットのiExp値として生成し、前記右方向バレルシフタ15に入力する(ステップS5)。
The configuration of the iMan
なお、量子化パラメータ(QP)に対応するiMan値の具体的数値を図4に示す。量子化パラメータが1〜31の範囲では、iMan値は量子化パラメータと同じ値となるが、量子化パラメータが31以降については、32〜47、48〜63、といった16個の数の繰り返し毎に、iMan値はそれぞれ16〜31の値を繰り返すことになる。同図4中、‥の表記は、数値の表記を省略したもので、数値が1ずつ増加している数列を示している。このように、1〜255の範囲の量子化パラメータに対し、iMan値は1〜31の範囲となり、数の範囲が少なく、限定されたものとなっている。また、量子化パラメータ(QP)に対応するiExp値の具体的数値を図6に示す。iExp値は、量子化パラメータの上位4ビットをビット切出ししているので、量子化パラメータの値が1〜31の範囲で1、32〜47の範囲で2、48〜63の範囲で3というように、16個の数値毎に(最初の量子化パラメータのみ15個)、1つずつ増加する1〜15のデータとなる。なお、同図6中、‥の表記は、量子化パラメータ(QP)の欄については、1ずつ増加する数で、48〜63に続く、64〜79といった16個の数の範囲の各数列を示しており、iExpの欄については、1ずつ増加する数値を示している。 Note that specific numerical values of iMan values corresponding to the quantization parameter (QP) are shown in FIG. When the quantization parameter is in the range of 1 to 31, the iMan value is the same as the quantization parameter. However, when the quantization parameter is 31 or later, every 16 repetitions of 32 to 47 and 48 to 63 are performed. , IMan values repeat values of 16 to 31, respectively. In FIG. 4, the notation of... Is an abbreviation of the numerical value, and indicates a numerical sequence in which the numerical value increases by one. As described above, the iMan value is in the range of 1 to 31 with respect to the quantization parameter in the range of 1 to 255, and the number range is small and limited. Further, specific numerical values of the iExp value corresponding to the quantization parameter (QP) are shown in FIG. The iExp value is obtained by cutting out the upper 4 bits of the quantization parameter, so that the quantization parameter value is 1 in the range of 1-31, 2 in the range of 32-47, and 3 in the range of 48-63. In addition, for every 16 numerical values (only the first quantization parameter is 15), the data is increased by 1 to 1-15. 6, the notation of... Is a number that is incremented by one in the quantization parameter (QP) column, and each number sequence in the range of 16 numbers such as 64-79 following 48-63. In the iExp column, numerical values increasing by 1 are shown.
前記除算部14は、前記周波数変換部120より入力された係数データを前記iMan値生成部12より入力されたiMan値で除算し、除算データを前記右方向バレルシフタ15に入力する。前記右方向バレルシフタ15は、前記除算部14より入力された除算データを前記iExp値生成部13より入力されたiExp値の数だけ右方向にビットシフトして、量子化係数データを生成し、前記係数予測部140に入力する(ステップS6)。このように、前記除算部14は、除数をiMan値という1〜31の範囲の5ビット長のデータとすることができるので、回路規模を小さくし、処理速度を向上させることができる。また、除算の一部を右方向バレルシフタによるビットシフトにしているが、バレルシフタは除算器に比べ、回路規模も小さく、高速処理が可能なように構成できるので、処理能力の向上を実現することができる。
The
また、前記除算部は、除算器を用いて構成することもできるが、図3のように乗算器を用いて構成することができる。前記除算部14は、逆数テーブル部16と乗算器17から構成される。
Moreover, although the said division part can also be comprised using a divider, it can be comprised using a multiplier like FIG. The
前記逆数テーブル部16は、1〜31の整数に対応する逆数値を保持した記憶領域を有し、iMan値生成部12より入力されたiMan値というデータに対応する逆数値を選択し、その逆数値のデータを前記乗算器17に入力する。前記乗算器17は、前記周波数変換部120より入力された係数データを前記逆数テーブル部16より入力されたiMan値の逆数データで乗算し、乗算データ(逆数値で乗算しているので除算データとなる)を前記右方向バレルシフタ15に入力する。
The
なお、iMan値に対応する逆数データの具体的数値を図5に示す。同図5は、1〜31の範囲のiMan値に対応する逆数データを16進数で示している。本例で示した逆数値は、16ビット長の数値の固定小数点表記のもので、最上位ビットを1の位の数値、最上位ビット以外のビットを小数部の数値とし、小数点は1の位の数値と小数部との間にあるものとしている。例えば、iMan値が1のとき、その逆数は8000(16)となり、iMan値が2のとき、その逆数は半分の値の4000(16)となる。以降、iMan値が3〜31までの値に対し、その逆数はiMan値が1の逆数である8000(16)を基として、その1/iManの値となるようになっている。同図5中、‥の表記は、iManの欄については、5〜27までの数値の省略、逆数の欄については、5〜27までの数値の逆数の値の省略を示している。本例は、逆数テーブルの一例であって、逆数値の取り得るビット長は16ビットに限られず、用途・目的によって増減させることができる。 Note that specific numerical values of the reciprocal data corresponding to the iMan value are shown in FIG. FIG. 5 shows the reciprocal data corresponding to iMan values in the range of 1 to 31 in hexadecimal. The reciprocal value shown in this example is a fixed-point representation of a 16-bit number. The most significant bit is the one's digit, the other bits are the decimal part, and the decimal is one It is assumed to be between the numerical value and the decimal part. For example, when the iMan value is 1, the reciprocal is 8000 (16) , and when the iMan value is 2, the reciprocal is a half value of 4000 (16) . Thereafter, the iMan value is a value of 1 to iMan based on 8000 (16) where the iMan value is a reciprocal of 1 with respect to the value of 3 to 31. In FIG. 5,... Indicates omission of numerical values from 5 to 27 for the iMan column and omission of reciprocal values of the numerical values from 5 to 27 for the reciprocal column. This example is an example of the reciprocal table, and the bit length that can be taken by the reciprocal value is not limited to 16 bits, and can be increased or decreased depending on the application and purpose.
このように、除算部14を逆数テーブル16と乗算器17を用いて構成することで、除算部14の回路規模と処理速度を向上させることができる。なお、除数であるiMan値は、5ビット長で表わされる1〜31の範囲の小さい数値範囲にあるため、逆数となるデータのビット長も小さくすることができ、また、保持すべき逆数の個数としても、1から31の範囲の31個について、その逆数を保持すれば足りるので、逆数テーブル部16の回路規模を小さくすることが可能となる。
Thus, by configuring the
次に、前記量子化パラメータ記憶部11により選択された低周波数成分の量子化パラメータ(8ビット長)が、前記iMan値生成部12及び前記iExp値生成部13に入力される。
Next, the low-frequency component quantization parameter (8-bit length) selected by the quantization
直流成分の量子化パラメータの場合と同様にして、iMan値生成部12にて、低周波数成分のiMan値のデータが生成され、iExp値生成部13にて、低周波数成分のiExp値のデータが生成され(ステップS7)、除算部14にて前記周波数変換部120より入力されたブロック単位の15個のLP係数データがiMan値生成部12にて生成されたiMan値データで除算され、その15個の除算データが右方向バレルシフタ15にて、iExp生成部13により生成されたiExp値データの値だけ右方向にビットシフトされ、量子化係数データを生成し、前記係数予測部140に入力される(ステップS8)。
Similarly to the case of the DC component quantization parameter, the iMan
低周波数成分の量子化パラメータの場合と同様にして、iMan値生成部12にて、高周波数成分のiMan値のデータが生成され、iExp値生成部13にて、高周波数成分のiExp値のデータが生成され(ステップS9)、除算部14にて前記周波数変換部120より入力された現在のブロック(カウンタ値nに対応)の15個のHP係数データがiMan値生成部12にて生成されたiMan値データで除算され、その15個の除算データが右方向バレルシフタ15にて、iExp値生成部13にて生成されたiExp値データの値だけ右方向にビットシフトされ、量子化係数データを生成し、前記係数予測部140に入力される(ステップS10)。そして、現在のブロックの量子化の終了毎にブロックのカウンタ値を更新し(ステップS12)、現在の色成分の最終ブロックまで量子化処理を実施する。最終の色成分になるまで同様に各周波数成分の量子化処理を実施し(ステップS13)、最終のマクロブロックになるまで、同様に各周波数成分の量子化処理を実施して、量子化処理を終了する(ステップS15)。
Similarly to the case of the low-frequency component quantization parameter, the iMan
以上の構成を備えた本例の画像符号化装置1によれば、まず、色空間変換部110に、1画像分の画像データが入力され、画像データのピクセルフォーマットに従い、色空間変換され、又は色空間変換されず、前記色空間変換部110での処理を経由した画像データが周波数変換部120へ入力される。
According to the
周波数変換部120は、マクロブロック単位(16×16画素)でラスター方向に順次、各画素のデータを周波数帯域毎の係数に変換する処理を行い、処理後の第1階層データ(HP係数)、第2階層データ(LP係数)、及び第3階層データ(DC係数)をブロック単位(4×4画素)で量子化部10に入力する。
The
量子化部10は、周波数変換部120により係数化された第1階層データ、第2階層データ、及び第3階層データを、量子化パラメータの上位4ビットが全て0か否かの情報と下位4ビットから生成される5ビット長のiMan値で除算し、除算データを量子化パラメータの上位4ビットから生成される4ビット長のiExp値の値だけ右方向にビットシフトして量子化する処理を行い、処理後の第1階層データ、第2階層データ、及び第3階層データを係数予測部140に入力する。
The
係数予測部140は、第1階層データ、第2階層データ、及び第3階層データについて、予測モードを導出するとともに、相関の高いブロック間で減算する処理を行い、処理後の第1階層データ及び第2階層データをブロック毎に適応型スキャン部150に入力する。
The
適応型スキャン部150は、第1階層データ(HP係数)及び第2階層データ(LP係数)について、ブロック毎にその係数データを入れ替える処理を行う。この入替処理は、周波数変換後、ブロック内の画素位置が小さい側(低周波数側)に非ゼロの係数を集め、ブロック内の画素位置が大きい側(高周波数側)にゼロ値が連続する係数データを集めることで、符号化の圧縮率を高めるためのものである。係数データが入れ替えられた第1階層データ、第2階層データ、及び入替処理が実施されない第3階層データは、VLC符号化部160に入力される。
The
VLC符号化部160は、適応型スキャン部150で処理された第1階層データ、第2階層データ、及び第3階層データに対し、エントロピー符号化処理を施し、コードストリームを生成して、そのコードストリームをビットストリーム出力部170に入力する。
The
ビットストリーム出力部170は、ヘッダ情報としての画像設定データに、VLC符号化部160で符号化されたコードストリームを順次連接し、1画像データ分のビットストリームとして1纏めにして1つのファイルを形成し、形成したファイルを外部に出力する。
The bit
[2.本実施形態に係る画像復号化装置]
次に、本発明に係る画像復号化装置について説明する。図8は本実施形態に係る画像復号化装置2の構成を示したブロック図である。同図8に示すように、本実施形態の画像復号化装置2は図14の従来の画像復号化装置200における逆量子化部250に代えて、これとはその構成の異なる逆量子化部20を備えるもので、この点においてのみ、従来の画像復号化装置200とその構成が異なっている。従って、他の構成については、上記画像復号化装置200におけるものと同一の符号を付して、その詳しい説明は省略する。
[2. Image decoding apparatus according to this embodiment]
Next, an image decoding apparatus according to the present invention will be described. FIG. 8 is a block diagram showing the configuration of the
前記逆量子化部20は、図9に示すように、量子化パラメータ記憶部21、iMan値生成部22、iExp値生成部23、乗算器24、左方向バレルシフタ25から構成され、図10に示すフローで処理が進められる。以下、図10のステップを参照しながら、逆量子化部の各処理について説明する。
As shown in FIG. 9, the
符号化処理開始時に、係数データをカウントしてマクロブロック、色成分、及びブロックのカウンタ値を更新しているブロックカウンタ(図示せず)のマクロブロックのカウンタ値m、色成分のカウンタ値c、及びブロックのカウンタ値nを1に初期化する(ステップS21)。以降、処理とともに更新されたマクロブロック、色成分、及びブロックの各カウンタ値における量子化処理は同様の処理となるので、処理が進んだ状態での各カウンタ値における量子化処理について説明する。 At the start of the encoding process, the coefficient value is counted and the macro block counter value m of the block counter (not shown) that updates the macro block, the color component, and the block counter value, the color component counter value c, The counter value n of the block is initialized to 1 (step S21). Hereinafter, the quantization process for each counter value of the macroblock, the color component, and the block updated together with the process is the same process, and therefore, the quantization process for each counter value in a state in which the process has advanced will be described.
量子化パラメータ記憶部21は、復号化処理開始後に符号化された圧縮データから処理に必要な量子化パラメータを取得し記憶する(ステップS22)。
The quantization
前記VLC復号化部220において、現在のマクロブロック(カウンタ値mに対応)の符号化データを復号化処理し、直流(DC)成分、低周波数(LP)成分、及び高周波数(HP)成分の各係数データとする(ステップS23)。このマクロブロック内には、1、3、又は4個の色成分があり、各色成分内には、1画素の直流成分の係数データ(DC係数)と15画素の1ブロックからなる低周波数成分の係数データ(LP係数)と15画素を1ブロックとし、16個のブロックからなる高周波成分の係数データ(HP係数)がある。
The
前記量子化パラメータ記憶部21は、現在の色成分(カウンタ値cに対応)に対応する直流成分、低周波数成分、及び高周波数成分の量子化パラメータ(各8ビット長)を選択する(ステップS24)。逆量子化処理は、DC係数データ、LP係数データ、及びHP係数データの順で実施される。
The quantization
まず、前記量子化パラメータ記憶部21により選択された直流成分の量子化パラメータ(8ビット長)が、前記iMan値生成部22及び前記iExp値生成部23に入力される。
First, the DC component quantization parameter (8-bit length) selected by the quantization
前記iMan値生成部の構成は、図13で既に説明した構成と同じであるが、前記iMan値生成部は、量子化パラメータの値が16未満(上位4ビットが全て0)であれば、量子化パラメータの下位4ビットをビット切出しし、その最上位ビットの1つ上のビットに0を充当したデータを5ビット長のiMan値として生成し、量子化パラメータの値が16以上(上位4ビットのいずれか1つのビットが1)であれば、量子化パラメータの下位4ビットをビット切出しし、数値の16を加算(その最上位ビットの1つ上のビットに1を充当)したデータを5ビット長のiMan値として生成し、前記乗算器24に入力する。そして、前記iExp値生成部23は、量子化パラメータの上位4ビットをビット切出しし、4ビットのiExp値として生成し、前記左方向バレルシフタ25に入力する(ステップS25)。
The configuration of the iMan value generation unit is the same as that already described with reference to FIG. 13, but the iMan value generation unit has a quantization parameter value of less than 16 (all the upper 4 bits are all 0). The lower 4 bits of the quantization parameter are extracted, and data with 0 assigned to the upper bit of the most significant bit is generated as a 5-bit iMan value, and the quantization parameter value is 16 or more (upper 4 bits If any one of the bits is 1), the lower 4 bits of the quantization parameter are extracted, and the
前記乗算器24は、前記係数逆予測部240より入力された係数データを前記iMan値生成部23より入力されたiMan値で乗算し、乗算データを前記左方向バレルシフタ25に入力する。前記左方向バレルシフタ25は、前記乗算器24より入力された乗算データを前記iExp値生成部23より入力されたiExp値の数だけ左方向にビットシフトして、逆量子化係数データを生成し、前記周波数逆変換部260に入力する(ステップS26)。このように、前記乗算器24は、乗数をiMan値という1〜31の範囲の5ビット長のデータとすることができるので、回路規模を小さくし、処理速度を向上させることができる。また、乗算の一部を左方向バレルシフタによるビットシフトにしているが、バレルシフタは乗算器に比べ、回路規模も小さく、高速処理が可能なように構成できるので、処理能力の向上を実現することができる。
The
次に、前記量子化パラメータ記憶部21により選択された低周波数成分の量子化パラメータ(8ビット長)が、前記iMan値生成部22及び前記iExp値生成部23に入力される。
Next, the low-frequency component quantization parameter (8-bit length) selected by the quantization
直流成分の量子化パラメータの場合と同様にして、iMan値生成部22にて、低周波数成分のiMan値のデータが生成され、iExp値生成部23にて、低周波数成分のiExp値のデータが生成され(ステップS27)、乗算器24にて前記係数逆予測部240より入力されたブロック単位の15個のLP係数データがiMan値生成部22にて生成されたiMan値データで乗算され、その15個の乗算データが左方向バレルシフタ25にて、iExp生成部23により生成されたiExp値データの値だけ左方向にビットシフトされ、逆量子化係数データを生成し、前記周波数逆変換部260に入力される(ステップS28)。
Similar to the case of the DC component quantization parameter, the iMan
低周波数成分の量子化パラメータの場合と同様にして、iMan値生成部22にて、高周波数成分のiMan値のデータが生成され、iExp生成部23にて、高周波数成分のiExp値のデータが生成され(ステップS29)、乗算器24にて前記係数逆予測部240より入力された現在のブロック(カウンタ値nに対応)の15個のHP係数データがiMan値生成部22にて生成されたiMan値データで乗算され、その15個の乗算データが左方向バレルシフタ25にて、iExp生成部23にて生成されたiExp値データの値だけ左方向にビットシフトされ、逆量子化係数データを生成し、前記周波数逆変換部260に入力される(ステップS30)。そして、現在のブロックの量子化の終了毎にブロックのカウンタ値を更新し(ステップS32)、現在の色成分の最終ブロックまで量子化処理を実施する。最終の色成分になるまで同様に各周波数成分の量子化処理を実施し(ステップS33)、最終のマクロブロックになるまで、同様に各周波数成分の量子化処理を実施して、量子化処理を終了する(ステップS35)。
Similar to the case of the low-frequency component quantization parameter, the iMan
以上の構成を備えた本例の画像復号化装置2によれば、まず、ビットストリーム解析部210に、1画像分の圧縮データが入力され、画像情報が抽出されるとともに、分離された符号化データがVLC復号化部220へ入力される。
According to the
VLC復号化部220は、ビットストリーム解析部210で分離された符号化データを復号化し、第1階層データ(HP係数)、第2階層データ(LP係数)、及び第3階層データ(DC係数)の各階層データを生成して、その各階層データを適応型スキャン部230に入力する。
The
適応型スキャン部230は、第1階層データ(HP係数)及び第2階層データ(LP係数)について、ブロック毎にその係数データを入れ替える処理を行う。この入替処理は、圧縮における周波数変換の際、ブロック内の画素位置が小さい側(低周波数側)に非ゼロの係数を集め、ブロック内の画素位置が大きい側(高周波数側)にゼロ値が連続する係数データを集めることで、符号化の圧縮率を高めるために行われるものである。係数データが入れ替えられた第1階層データ、第2階層データ、及び入替処理が実施されない第3階層データは、係数逆予測部240に入力される。
The
係数逆予測部240は、第1階層データ、第2階層データ、及び第3階層データについて、予測モードを導出するとともに、相関の高いブロック間で足し戻す処理を行い、処理後の第1階層データ、第2階層データ、及び第3階層データを逆量子化部20に入力する。
The coefficient
逆量子化部20は、係数逆予測部240により逆予測処理された第1階層データ、第2階層データ、及び第3階層データを、量子化パラメータの上位4ビットが全て0か否かの情報と下位4ビットから生成される5ビット長のiMan値で乗算し、乗算データを量子化パラメータの上位4ビットから生成される4ビット長のiExp値の値だけ左方向にビットシフトして逆量子化する処理を行い、処理後の第1階層データ、第2階層データ、及び第3階層データを周波数逆変換部260に入力する。
The
周波数逆変換部260は、逆量子化部20により逆量子化された第1階層データ、第2階層データ、及び第3階層データを、周波数逆変換し、マクロブロック単位(16×16画素)の画像データとし、変換された画像データを色空間逆変換部270に入力する。
The frequency
色空間逆変換部270は、周波数逆変換部260により周波数逆変換されたマクロブロック単位の画像データを、ビットストリーム解析部210により抽出された画像情報であるピクセルフォーマットに従い、色空間逆変換し、又は色空間逆変換せず、処理した画像データを1画像分の画像データとして外部に出力する。
The color space
以上詳述したように、本実施形態の画像符号化装置1によれば、その量子化部10において、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されたiMan値により、周波数変換部から入力された係数データを除算部にて除算し、その除算データを量子化パラメータの上位ビットから生成されたiExp値の値だけ右方向にビットシフトして量子化係数データを得る構成としているので、従来のiMan値をiExp値の値だけ左方向にビットシフトしたデータである量子化スケーリングファクタで係数データを除算する構成と比べ、除算部に与える除数の数値を小さくすることができ、除算部の回路規模を縮小し、除算部の処理速度を向上させることが可能となる。
As described above in detail, according to the
そして、本実施形態の画像符号化装置1の量子化部における除算部は、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されるiMan値の逆数の値をその記憶領域に保持した逆数テーブル部を有し、iMan値が生成される毎に逆数テーブル部からそのiMan値の逆数を選択し、iMan値の逆数で周波数変換部より入力された係数データを乗算器にて乗算する構成としているので、従来のiMan値をiExp値の値だけ左方向にビットシフトしたデータである量子化スケーリングファクタの逆数で周波数変換部より入力された係数データを乗算器にて乗算する構成と比べて、保持しておく逆数データのビット幅を小さくすることができ、保持しておく逆数データの数も少なくなり、逆数テーブル部及び乗算器の回路規模を縮小でき、本除算部の処理速度を向上させることが可能となる。これにより、画像符号化装置の画像符号化処理の最適化を図ることができる。
Then, the division unit in the quantization unit of the
また、本実施形態の画像復号化装置2によれば、その逆量子化部20において、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されたiMan値により、周波数変換部から入力された係数データを乗算器にて乗算し、その乗算データを量子化パラメータの上位ビットから生成されたiExp値の値だけ左方向にビットシフトして逆量子化係数データを得る構成としているので、従来のiMan値をiExp値の値だけ左方向にビットシフトしたデータである量子化スケーリングファクタで係数データを乗算する構成と比べ、乗算器に与える乗数の数値を小さくすることができ、乗算器の回路規模を縮小し、乗算器の処理速度を向上させることが可能となる。これにより、画像復号化装置の画像復号化処理の最適化を図ることができる。
Further, according to the
以上、本発明の一実施形態について説明したが、本発明が採り得る具体的な態様は、何らこれに限定されるものではない。例えば、上例では、量子化パラメータを8ビット長とし、量子化パラメータの上位4ビットが全て0か否かの情報と下位4ビットから、5ビット長のiMan値を生成し、量子化パラメータの上位4ビットから4ビット長のiExp値を生成しているが、これに限られるものではなく、量子化パラメータを(p+q)ビット長とし、量子化パラメータの上位pビットが全て0か否かの情報と下位qビットから、(q+1)ビット長のiManを生成し、量子化パラメータの上位pビットからpビット長のiExp値を生成するようにしてもよい。 As mentioned above, although one Embodiment of this invention was described, the specific aspect which this invention can take is not limited to this at all. For example, in the above example, the quantization parameter is 8 bits long, and an iMan value having a length of 5 bits is generated from the information indicating whether the upper 4 bits of the quantization parameter are all 0 and the lower 4 bits. Although an iExp value having a length of 4 bits is generated from the upper 4 bits, the present invention is not limited to this. The quantization parameter is set to (p + q) bits, and whether the upper p bits of the quantization parameter are all 0 or not. An iMan having a length of (q + 1) bits may be generated from the information and the lower q bits, and an iExp value having a p bit length may be generated from the upper p bits of the quantization parameter.
また、本実施形態では、画像符号化装置と画像復号化装置は別の構成としたが、画像符号化・復号化装置として、1つの構成としてもよい。その際、画像符号化装置における量子化部と画像復号化装置における逆量子化部は別の構成としてもよく、また、量子化・逆量子化部として1つの構成とすることもできる。量子化・逆量子化部として1つの構成とした場合、量子化パラメータ記憶部、iMan値生成部、及びiExp値生成部は共通の構成とし、除算部と乗算器、及び、右方向バレルシフタと左方向バレルシフタについては、符号化の際は、除算部と右方向バレルシフタを用いて量子化を行い、復号化の際は、乗算器と左方向バレルシフタを用いて逆量子化を行うように構成してもよい。 In the present embodiment, the image encoding device and the image decoding device have different configurations. However, the image encoding / decoding device may have a single configuration. In that case, the quantization unit in the image encoding device and the inverse quantization unit in the image decoding device may have different configurations, or may be configured as a single quantization / inverse quantization unit. When the quantization / inverse quantization unit has one configuration, the quantization parameter storage unit, iMan value generation unit, and iExp value generation unit have a common configuration, and a division unit, a multiplier, a right barrel shifter, and a left The direction barrel shifter is configured to perform quantization using a division unit and a right direction barrel shifter for encoding, and to perform inverse quantization using a multiplier and a left direction barrel shifter for decoding. Also good.
1 画像符号化装置
2 画像復号化装置
10 量子化部
11 量子化パラメータ記憶部
12 iMan値生成部
13 iExp値生成部
14 除算部
15 右方向バレルシフタ
16 逆数テーブル部
17 乗算器
20 逆量子化部
21 量子化パラメータ記憶部
22 iMan値生成部
23 iExp値生成部
24 乗算器
25 左方向バレルシフタ
100 画像符号化装置
110 色空間変換部
111 量子化パラメータ記憶部
112 iMan値生成部
113 iExp値生成部
114 左方向バレルシフタ
115 除算部
116 ビット切出し部
117 加算器
118 比較部
119 選択器
120 周波数変換部
130 量子化部
140 係数予測部
150 適応型スキャン部
160 VLC符号化部
170 ビットストリーム出力部
200 画像復号化装置
210 ビットストリーム解析部
211 量子化パラメータ記憶部
212 iMan値生成部
213 iExp値生成部
214 左方向バレルシフタ
215 乗算器
220 VLC復号化部
230 適応型スキャン部
240 係数逆予測部
250 逆量子化部
260 周波数逆変換部
270 色空間逆変換部
DESCRIPTION OF
Claims (3)
前記周波数変換部により周波数変換された各成分の係数データを、内部又は外部の記憶領域に保持された(p+q)ビット長からなる量子化パラメータを用いて量子化して量子化係数データとする量子化部と、
前記量子化部により量子化された低周波数成分及び高周波数成分の量子化係数データのブロック内における画素の並び順を入れ替える処理をして入替係数データとする係数スキャン部と、
前記量子化部による量子化後の直流成分の量子化係数データ及び前記係数スキャン部による入替処理後の低周波数成分及び高周波数成分の入替係数データを符号化して符号化データを生成する符号化部とを備えた画像符号化装置において、
前記量子化部は、
量子化パラメータの上位p個のビットをビット切出ししたデータであるpビット長のiExp値を生成するiExp値生成部と、
量子化パラメータの上位p個の各ビットが全て0であるときは、量子化パラメータの下位q個のビットをビット切出しし、その最上位ビットの1つ上のビットに0の値を充当したデータである(q+1)ビット長のiMan値を生成し、量子化パラメータの上位p個のビットのいずれか1つが1であるときは、量子化パラメータの下位q個のビットをビット切出しし、その最上位ビットの1つ上のビットに1の値を充当したデータである(q+1)ビット長のiMan値を生成するiMan値生成部と、
前記周波数変換部により周波数変換された直流成分、低周波数成分、及び高周波数成分の係数データを該iMan値で除算して除算データとする除算部と、
前記除算部により除算された除算データを前記iExp値生成部により生成されたiExp値で表わされる値だけ右方向にビットシフトして、量子化係数データを生成する右方向バレルシフタとを備えて構成されることを特徴とする画像符号化装置。
但し、前記n及びmは2以上の整数であり、前記p及びqは1以上の整数である。 The image data is frequency-converted for a macroblock consisting of m blocks in each horizontal and vertical direction in units of a block consisting of n pixels in each horizontal and vertical direction, and the upper left pixel position of each block in the macroblock The data corresponding to the pixel position other than the above is used as the coefficient data of the high frequency component, the data corresponding to the upper left pixel position of each block in the macro block is collected, further frequency-converted, and the upper left pixel position after the frequency conversion. The frequency conversion unit which makes the corresponding data the coefficient data of the direct current component, and the data corresponding to the pixel position other than the upper left the coefficient data of the low frequency component,
Quantization of the coefficient data of each component frequency-converted by the frequency conversion unit by using a quantization parameter having a (p + q) bit length held in an internal or external storage area to obtain quantized coefficient data And
A coefficient scanning unit that performs replacement processing of pixels in the block of quantized coefficient data of the low frequency component and high frequency component quantized by the quantizing unit to obtain replacement coefficient data;
An encoding unit that generates encoded data by encoding the quantized coefficient data of the DC component after quantization by the quantizing unit and the low-frequency component and high-frequency component replacement coefficient data after the replacement processing by the coefficient scanning unit In an image encoding device comprising:
The quantization unit is
An iExp value generation unit for generating an iExp value having a p-bit length, which is data obtained by cutting out the upper p bits of the quantization parameter;
When all the upper p bits of the quantization parameter are 0, the lower q bits of the quantization parameter are cut out, and the value 0 is assigned to the bit above the most significant bit (Q + 1) bit length iMan value is generated, and when any one of the upper p bits of the quantization parameter is 1, the lower q bits of the quantization parameter are cut out and the An iMan value generation unit that generates an iMan value having a length of (q + 1) bits, which is data obtained by assigning a value of 1 to a bit above the upper bit,
A division unit that divides the coefficient data of the direct current component, the low frequency component, and the high frequency component that are frequency-converted by the frequency conversion unit by the iMan value to obtain divided data;
A right barrel shifter for generating quantized coefficient data by bit-shifting the division data divided by the division unit to the right by the value represented by the iExp value generated by the iExp value generation unit; An image encoding device characterized by that.
However, n and m are integers of 2 or more, and p and q are integers of 1 or more.
前記各iMan値に対応する逆数の値を保持した記憶領域を有し、前記iMan値生成部により生成されたiMan値に応じて、対応する逆数値を選択する逆数テーブル部と、
前記周波数変換部により周波数変換された直流成分、低周波数成分、及び高周波数成分の係数データを前記逆数テーブル部により選択されたiMan値の逆数値で乗算する乗算器とを備えて構成されることを特徴とする請求項1記載の画像符号化装置。 The division unit is
A reciprocal table unit that has a storage area that holds a reciprocal value corresponding to each iMan value, and selects a reciprocal value corresponding to the iMan value generated by the iMan value generation unit;
A multiplier that multiplies the coefficient data of the DC component, the low frequency component, and the high frequency component frequency-converted by the frequency conversion unit by the reciprocal value of the iMan value selected by the reciprocal table unit. The image encoding device according to claim 1.
前記復号化部により復号化された低周波数成分及び高周波数成分の復号化データのブロック内における画素の並び順を入れ替える処理をして入替係数データとする係数スキャン部と、
前記復号化部により復号化された直流成分の復号化データ、及び、前記係数スキャン部によりブロック内における画素の並び順が入れ替えられた低周波数成分及び高周波数成分の係数データを、内部又は外部の記憶領域に保持された8ビット長からなる量子化パラメータを用いて逆量子化して逆量子化係数データとする逆量子化部と、
該逆量子化係数データを周波数逆変換して復元される画像領域を、水平及び垂直の各方向にn画素からなるブロックからなり、該ブロックを水平及び垂直の各方向にm個有するマクロブロックからなる画像領域として、水平及び垂直の各方向にm個からなる領域の左上の画素位置に直流成分の逆量子化係数データを配置し、該領域の左上以外の画素位置に低周波数成分の逆量子化係数データを配置して、該領域について周波数逆変換し、周波数逆変換した該領域の各画素位置の係数データを該領域の画素位置に対応する位置に相当するマクロブロック内の各ブロックの、左上の画素位置に配置し、該マクロブロック内の各ブロックの左上の画素位置以外の画素位置に高周波数成分の逆量子化係数データを配置し、該マクロブロック内のブロック毎に、さらに周波数逆変換して、周波数逆変換データとする周波数逆変換部とを備えた画像復号化装置において、
前記逆量子化部は、
量子化パラメータの上位p個のビットをビット切出ししたデータであるpビット長のiExp値を生成するiExp値生成部と、
量子化パラメータの上位p個の各ビットが全て0であるときは、量子化パラメータの下位q個のビットをビット切出しし、その最上位ビットの1つ上のビットに0の値を充当したデータである(q+1)ビット長のiMan値を生成し、量子化パラメータの上位p個のビットのいずれか1つが1であるときは、量子化パラメータの下位q個のビットをビット切出しし、その最上位ビットの1つ上のビットに1の値を充当したデータである(q+1)ビット長のiMan値を生成するiMan値生成部と、
前記復号化部により復号化された直流成分の復号化データ、及び前記係数スキャン部によりブロック内における画素の並び順を入れ替えられた低周波数成分及び高周波数成分の係数データを該iMan値で乗算して乗算データとする乗算器と、
前記乗算器により乗算された乗算データを前記iExp値生成部により生成されたiExp値で表わされる値だけ左方向にビットシフトして、逆量子化係数データを生成する左方向バレルシフタとを備えて構成されることを特徴とする画像復号化装置。
但し、前記n及びmは2以上の整数であり、前記p及びqは1以上の整数である。 Decodes compressed image data in which coefficient data consisting of DC components, low-frequency components, and high-frequency components in the image data after frequency conversion is encoded, and consists of DC components, low-frequency components, and high-frequency components A decryption unit for generating decrypted data;
A coefficient scanning unit that performs replacement processing of pixels in the block of the decoded data of the low-frequency component and the high-frequency component decoded by the decoding unit to obtain replacement coefficient data;
The DC component decoded data decoded by the decoding unit, and the low frequency component and high frequency component coefficient data in which the arrangement order of pixels in the block is changed by the coefficient scanning unit An inverse quantization unit that performs inverse quantization using an 8-bit length quantization parameter held in a storage area to obtain inverse quantization coefficient data;
An image area restored by inverse frequency transform of the inverse quantization coefficient data is composed of blocks of n pixels in each of the horizontal and vertical directions, and from a macro block having m blocks in each of the horizontal and vertical directions. As the image area, the inverse quantization coefficient data of the direct current component is arranged at the pixel position at the upper left of the m area in each of the horizontal and vertical directions, and the inverse quantization of the low frequency component is performed at a pixel position other than the upper left of the area. The coefficient data of each pixel position in the region subjected to frequency inverse transform for the region is disposed, and the coefficient data of each pixel position in the region subjected to the frequency inverse transform is converted into each block in the macroblock corresponding to the position corresponding to the pixel position in the region, It is arranged at the pixel position at the upper left, and the inverse quantization coefficient data of the high frequency component is arranged at a pixel position other than the pixel position at the upper left of each block in the macro block. Every further by frequency inverse conversion, the image decoding apparatus and a frequency inverse conversion unit for the frequency inversion data,
The inverse quantization unit includes:
An iExp value generation unit for generating an iExp value having a p-bit length, which is data obtained by cutting out the upper p bits of the quantization parameter;
When all the upper p bits of the quantization parameter are 0, the lower q bits of the quantization parameter are cut out, and the value 0 is assigned to the bit above the most significant bit (Q + 1) bit length iMan value is generated, and when any one of the upper p bits of the quantization parameter is 1, the lower q bits of the quantization parameter are cut out and the An iMan value generation unit that generates an iMan value having a length of (q + 1) bits, which is data obtained by assigning a value of 1 to a bit above the upper bit,
The iMan value is multiplied by the decoded data of the DC component decoded by the decoding unit and the coefficient data of the low frequency component and the high frequency component in which the arrangement order of the pixels in the block is changed by the coefficient scanning unit. A multiplier for multiplication data,
A left barrel shifter configured to bit-shift the multiplication data multiplied by the multiplier leftward by a value represented by the iExp value generated by the iExp value generation unit to generate inverse quantization coefficient data; The image decoding apparatus characterized by the above-mentioned.
However, n and m are integers of 2 or more, and p and q are integers of 1 or more.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013249884A JP6204171B2 (en) | 2013-12-03 | 2013-12-03 | Image encoding apparatus and image decoding apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013249884A JP6204171B2 (en) | 2013-12-03 | 2013-12-03 | Image encoding apparatus and image decoding apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015106912A JP2015106912A (en) | 2015-06-08 |
JP6204171B2 true JP6204171B2 (en) | 2017-09-27 |
Family
ID=53436785
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013249884A Active JP6204171B2 (en) | 2013-12-03 | 2013-12-03 | Image encoding apparatus and image decoding apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6204171B2 (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05307467A (en) * | 1991-07-16 | 1993-11-19 | Lsi Logic Corp | Method and device for executing quantization |
JP3390599B2 (en) * | 1996-04-01 | 2003-03-24 | シャープ株式会社 | Divider |
US7123655B2 (en) * | 2001-08-09 | 2006-10-17 | Sharp Laboratories Of America, Inc. | Method for reduced bit-depth quantization |
JP4992117B2 (en) * | 2008-03-24 | 2012-08-08 | 株式会社メガチップス | Image processing device |
-
2013
- 2013-12-03 JP JP2013249884A patent/JP6204171B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015106912A (en) | 2015-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102165340B1 (en) | Methods of determination for chroma quantization parameter and apparatuses for using the same | |
JP6855419B2 (en) | Block information coding / decoding method using a quad tree and a device using the method | |
JP7402280B2 (en) | Video decoding device, video decoding method and program | |
JP2010226532A (en) | Image compression apparatus and image decompression apparatus | |
JP2024019542A (en) | Decoding device, program, and decoding method | |
JP6204171B2 (en) | Image encoding apparatus and image decoding apparatus | |
US20130279818A1 (en) | Image encoding apparatus and method, image decoding apparatus and method, and non-transitory computer readable medium | |
JP7121584B2 (en) | Image encoding device and its control method and program | |
JP6419934B2 (en) | Electronic device, encoding method and program | |
JP2021177599A (en) | Image coding device and program therefor | |
WO2012118359A2 (en) | Method for determining color difference component quantization parameter and device using the method | |
KR20120095814A (en) | Methods of encoding/decoding using multiple reference pictures and apparatuses for using the same | |
JP6081869B2 (en) | Image decoding device | |
JPH0774968A (en) | Method for compressing/extending picture data | |
JP6081862B2 (en) | Image encoding device | |
JP6262380B2 (en) | Electronic device, decoding method and program | |
JP6132950B2 (en) | Encoding method, decoding method, encoding device, and decoding device | |
JP2006128759A (en) | Video coding device, video decoding device, video coding method and video decoding method | |
GB2496193A (en) | Context adaptive data encoding and decoding | |
WO2012115434A2 (en) | Method for encoding and decoding images using plurality of reference images and device using method | |
JP2006005479A (en) | Device and method of encoding image | |
JP2007082255A (en) | Image coding method, image decoding method, image coding device, image decoding device, program for them, and program recording medium for them | |
KR20120100838A (en) | Methods of encoding/decoding using adaptive threshold and apparatuses for using the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20161006 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170725 |
|
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: 20170803 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170831 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6204171 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |