JP6204171B2 - Image encoding apparatus and image decoding apparatus - Google Patents

Image encoding apparatus and image decoding apparatus Download PDF

Info

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
Application number
JP2013249884A
Other languages
Japanese (ja)
Other versions
JP2015106912A (en
Inventor
佐藤 純一
純一 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shikino High Tech Co Ltd
Original Assignee
Shikino High Tech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shikino High Tech Co Ltd filed Critical Shikino High Tech Co Ltd
Priority to JP2013249884A priority Critical patent/JP6204171B2/en
Publication of JP2015106912A publication Critical patent/JP2015106912A/en
Application granted granted Critical
Publication of JP6204171B2 publication Critical patent/JP6204171B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 image encoding apparatus 100 includes a color space conversion unit 110, a frequency conversion unit 120, a quantization unit 130, a coefficient prediction unit 140, an adaptive scan unit 150, a VLC encoding unit 160, a bit. The stream output unit 170 is configured. Note that VLC in the name of the VLC encoding unit 160 is an abbreviation for Variable Length Coding (Variable Length Coding).

画像データは、画像の最小単位である画素(ピクセル)からなり、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 space conversion unit 110 performs color space conversion processing on the input image data for each pixel in units of macroblocks. The color space conversion process depends on the pixel format defined in the standard of Non-Patent Document 1. When the pixel format requires color space conversion, the original image data in the RGB format is converted into the YUV format, and the original image data in the CMYK format is converted into the YUVK format. The Further, when the pixel format does not require color space conversion, the original image data is processed so as not to be color space converted. Then, the color space conversion unit 110 inputs the processed image data to the frequency conversion unit 120.

前記周波数変換部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 frequency conversion unit 120 converts the image data that has been color space processed by the color space conversion unit 110 into a raster order in units of macroblocks, and within each macroblock, in the order of the color components after the color space conversion in each macroblock. For each block, processing (frequency conversion) for converting the data of each pixel into coefficient data for each frequency band is performed. The frequency conversion unit 120 performs frequency conversion on the 16 pixel data of 4 × 4 pixels in each block and converts the pixel data into coefficient data, and then removes the remaining data except the coefficient data on the upper left of the 16 blocks. Fifteen coefficient data are collected to form first layer data. This is HP coefficient (high pass coefficient) data which is a high frequency component. Next, the coefficient data at the upper left of each of the 16 blocks are collected to form 4 × 4 16 coefficient data, and the collected 4 × 4 coefficient data is further frequency-converted to obtain 4 × 4. The second hierarchical data is formed by the remaining 15 coefficient data except the one coefficient data at the upper left of the 4 × 4 coefficient data subjected to frequency conversion, and after the second frequency conversion. Among the 4 × 4 coefficient data, the third hierarchical data is formed by one coefficient data at the upper left. The second layer data corresponds to LP coefficient (low-pass coefficient) data that is a low frequency component, and the third layer data corresponds to DC coefficient (DC coefficient) data that is a direct current component. As described above, the frequency conversion unit 120 generates the first layer data (HP coefficient), the second layer data (LP coefficient), and the third layer data (DC coefficient), and each of these layer data is quantized. Input to the unit 130.

前記量子化部130は、前記周波数変換部120から入力された周波数変換後の第1階層データ、第2階層データ、及び第3階層データを、それぞれ選択された量子化パラメータを用いて量子化する処理を行い、処理後の前記第1階層データ、第2階層データ、及び第3階層データを前記係数予測部140に入力する。   The quantization unit 130 quantizes the first layer data, the second layer data, and the third layer data after the frequency conversion input from the frequency conversion unit 120 using selected quantization parameters. Processing is performed, and the processed first layer data, second layer data, and third layer data are input to the coefficient prediction unit 140.

前記量子化部130は、図12に示すように、量子化パラメータ記憶部111、iMan値生成部112、iExp値生成部113、左方向バレルシフタ114、除算部115から構成される。   As shown in FIG. 12, the quantization unit 130 includes a quantization parameter storage unit 111, an iMan value generation unit 112, an iExp value generation unit 113, a left barrel shifter 114, and a division unit 115.

量子化処理は、前記周波数変換部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 frequency converter 120. The quantization parameter is input to the quantization parameter storage unit 111 from the external controller or the like before the compression process is started, and is stored in the quantization parameter storage unit 111.

量子化パラメータは、第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 parameter storage unit 111. This is indicated by QP [7: 0]. This quantization parameter QP consists of an 8-bit numerical value, and [7: 0] of the above-mentioned QP [7: 0] indicates that it has 8 bits in the arrangement order of bit 7 to bit 0. ing. The bit notation shown below is the same notation.

非特許文献1の規格では、量子化処理は、量子化パラメータ(QP)の上位ビット(ビット7〜4)が全て0か否かの情報と下位ビット(ビット3〜0)から生成されるiMan値というデータを量子化パラメータQPの上位ビット(ビット7〜4)から生成されるiExp値というデータで表わされる値だけ左方向にビットシフトしたデータである量子化スケーリングファクタ(QSF)を用いて行われ、入力された係数データは、この量子化スケーリングファクタで除算されて量子化される。   In the standard of Non-Patent Document 1, the quantization process is performed by iMan generated from information indicating whether or not the upper bits (bits 7 to 4) of the quantization parameter (QP) are all 0 and the lower bits (bits 3 to 0). Quantization scaling factor (QSF), which is data obtained by bit-shifting the value data to the left by the value represented by the data called iExp value generated from the upper bits (bits 7 to 4) of quantization parameter QP In other words, the input coefficient data is divided by this quantization scaling factor and quantized.

この処理を図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 parameter storage unit 111 is input to the iMan value generation unit 112 and the iExp value generation unit 113.

ここで、iMan値生成部112の構成を図13に示す。同図13に示すように、iMan値生成部112は、ビット切出し部116、加算器117、比較部118、及び選択器119より構成される。   Here, the configuration of the iMan value generation unit 112 is shown in FIG. As shown in FIG. 13, the iMan value generation unit 112 includes a bit cutout unit 116, an adder 117, a comparison unit 118, and a selector 119.

前記量子化パラメータ記憶部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 parameter storage unit 111 is input to the bit cutout unit 116 and the comparison unit 118. The bit cutout unit 116 cuts out QP [3: 0], which is the lower 4 bits, of the input quantization parameter QP [7: 0], and inputs the input port A of the selector 119 and the adder. The adder 117 adds the numerical value 16 to the lower bits QP [3: 0] of the input quantization parameter, and inputs the addition result to the input port B of the selector 119.

また、前記比較部118は、入力された量子化パラメータQP[7:0]を数値16と比較して、QPが16よりも小さければ(QPの上位ビットが全て0)、数値1(結果が真)を、そうでなければ、数値0(結果が偽)を出力し、その出力を前記選択器119の入力ポートCに入力する。   The comparison unit 118 compares the input quantization parameter QP [7: 0] with the numerical value 16, and if the QP is smaller than 16 (all the high-order bits of QP are 0), the numerical value 1 (result is True), otherwise, the value 0 (result is false) is output, and the output is input to the input port C of the selector 119.

前記選択器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 comparison unit 118 is 1 (the result is true), the selector 119 performs the quantization input to the input port A of the selector 119 from the bit cutout unit 116. If QP [3: 0], which is the lower 4 bits of the parameter, is selected and the value of the input port C is 0 (result is false), the input port B of the selector input from the adder 117 is input. A result obtained by adding QP [3: 0], which is the lower 4 bits of the input quantization parameter, and a numerical value 16 is selected, and the selected data is output as iMan [4: 0]. Input to the barrel shifter 114.

また、前記iExp値生成部113は、前記量子化パラメータ記憶部111から入力された量子化パラメータQP[7:0]の内、上位4ビットのQP[7:4]をビット切り出しして、これをiExp[3:0]として前記左方向バレルシフタ144に入力する。   Further, the iExp value generation unit 113 cuts out the upper 4 bits QP [7: 4] from the quantization parameter QP [7: 0] input from the quantization parameter storage unit 111, and extracts this bit. Is input to the left barrel shifter 144 as iExp [3: 0].

そして、前記左方向バレルシフタ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 left barrel shifter 114 bit-shifts iMan [4: 0] input from the iMan generation unit to the left by the number represented by iExp [3: 0] input from the iExp generation unit. Then, a quantization scaling factor (QSF [19: 0]) that is a divisor of quantization is generated, and this QSF [19: 0] is input to the division unit 115. Note that iMan is composed of 5 bits, and iExp, which is a shift value composed of 4 bits, takes a numerical value of 0 to 15. Therefore, since the quantization scaling factor is generated by shifting the 5-bit iMan to the left by a maximum of 15 bits, the quantization scaling factor has a maximum bit length of 20 bits.

前記除算部115は、前記周波数変換部より入力された係数データである前記第1階層データ、第2階層データ、及び第3階層データを前記左方向バレルシフタ114より入力された量子化スケーリングファクタで除算して、除算結果を量子化係数データとして、前記係数予測部140に入力する。   The division unit 115 divides the first layer data, the second layer data, and the third layer data, which are coefficient data input from the frequency conversion unit, by a quantization scaling factor input from the left barrel shifter 114. Then, the division result is input to the coefficient prediction unit 140 as quantized coefficient data.

前記係数予測部140は、前記量子化部130から入力された量子化係数データである前記第1階層データ、第2階層データ、及び第3階層データについて、それぞれ、隣接するブロック間の係数値の比較を行って予測モードを算出し、所定の演算式に基づいて、導出された予測モードの方向に、相関の高いブロック間で減算する処理を行う。そして、前記係数予測部140は、処理後の第1階層データ、第2階層データ、及び第3階層データを適応型スキャン部150に入力する。   The coefficient prediction unit 140 is configured to calculate coefficient values between adjacent blocks for the first layer data, the second layer data, and the third layer data, which are the quantized coefficient data input from the quantization unit 130, respectively. A prediction mode is calculated by comparison, and a process of subtracting between blocks having high correlation in the direction of the derived prediction mode is performed based on a predetermined arithmetic expression. Then, the coefficient prediction unit 140 inputs the processed first layer data, second layer data, and third layer data to the adaptive scan unit 150.

前記適応型スキャン部150は、前記係数予測部140から入力された第1階層データ及び第2階層データについて、ブロック毎にその係数データを入れ替える処理を行う。この入替処理は、周波数変換後のブロック内の画素位置が小さい側(低周波数側)に非ゼロの係数データを集め、ブロック内の画素位置が大きい側(高周波数側)にゼロ値が連続する係数データを集めるので、符号化の圧縮率を高めることができる。そして、前記適応型スキャン部150は、係数データを入れ替えた第1階層データ、第2階層データ、及び入替処理を実施しない第3階層データを、前記VLC符号化部160に入力する。   The adaptive scan unit 150 performs a process of replacing the coefficient data for each block with respect to the first layer data and the second layer data input from the coefficient prediction unit 140. In this replacement process, non-zero coefficient data is collected on the side where the pixel position in the block after frequency conversion is small (low frequency side), and the zero value is continuous on the side where the pixel position in the block is large (high frequency side). Since coefficient data is collected, the compression rate of encoding can be increased. Then, the adaptive scan unit 150 inputs the first layer data, the second layer data, and the third layer data on which the replacement process is not performed to the VLC encoding unit 160.

前記VLC符号化部160は、前記適応型スキャン部150で処理された第1階層データ、第2階層データ、及び第3階層データに対して、エントロピー符号化処理を施し、コードストリームを生成して、そのコードストリームを前記ビットストリーム出力部170に入力する。   The VLC encoder 160 performs entropy encoding on the first layer data, the second layer data, and the third layer data processed by the adaptive scan unit 150 to generate a code stream. The code stream is input to the bit stream output unit 170.

前記ビットストリーム170は、ヘッダ情報としての画像設定データに、前記VLC符号化部160で符号化されたコードストリームを順次連接し、1画像データ分のビットストリームとして1纏めにして、1つのファイルを形成し、形成したファイルを外部に出力する。   The bit stream 170 sequentially concatenates the code stream encoded by the VLC encoding unit 160 to the image setting data as header information, and collects one file as a bit stream for one image data. Create and output the formed file to the outside.

次に、前記規格に従った画像復号化装置の概略構成を図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 image decoding apparatus 200 includes a bit stream analysis unit 210, a VLC decoding unit 220, an adaptive scan unit 230, a coefficient inverse prediction unit 240, an inverse quantization unit 250, and a frequency inverse transform unit. 260 and a color space inverse transform unit 270. The process of the image decoding apparatus is performed in the reverse procedure of the process of the above-described image encoding apparatus, and the configuration of the image data used is the same as that of the image encoding apparatus. The first layer data (HP coefficient), second layer data (LP coefficient), and third layer data (DC coefficient) are restored to image data in units of macroblocks and blocks. Hereinafter, the operation of each component of the image decoding apparatus 200 will be described in order.

前記ビットストリーム解析部210は、入力された1画像分の圧縮データであるビットストリームを解析し、画像情報を抽出するとともに、符号化された画像データを分離し、前記VLC復号化部220に入力する。   The bitstream analysis unit 210 analyzes a bitstream that is input compressed data for one image, extracts image information, separates encoded image data, and inputs the encoded image data to the VLC decoding unit 220 To do.

前記VLC復号化部220は、前記ビットストリーム解析部210で分離された画像符号化データである第1階層データ(HP係数)、2階層データ(LP係数)及び第3階層データ(DC係数)に対して、VLC復号化処理である可変長復号化処理を施し、復号化した係数データを前記適応型スキャン部230に出力する。   The VLC decoding unit 220 converts the first layer data (HP coefficient), the second layer data (LP coefficient), and the third layer data (DC coefficient), which are the image encoded data separated by the bit stream analysis unit 210. On the other hand, variable length decoding processing which is VLC decoding processing is performed, and the decoded coefficient data is output to the adaptive scan unit 230.

前記適応型スキャン部230は、圧縮時に定められた手法によって画素順を入れ替えられた第1階層データ及び第2階層データについて、その係数データを圧縮とは逆の手順によって入れ替え、元の画素順に戻す処理を行う。この入替処理は、圧縮の際にブロックの左上部の周波数帯域の低い側に非ゼロの係数を集めることで(逆に右下部の周波数帯域の高い側に係数値がゼロのものが集まる)、符号化において圧縮率を高めるために行われるものである。   The adaptive scan unit 230 replaces the coefficient data of the first layer data and the second layer data whose pixel order is replaced by a method determined at the time of compression by a procedure reverse to the compression, and returns the original pixel order. Process. This replacement process collects non-zero coefficients on the lower side of the frequency band at the upper left of the block during compression (conversely, those with zero coefficient values gather on the higher side of the lower right frequency band) This is performed in order to increase the compression rate in encoding.

前記係数逆予測部240は、前記適応型スキャン部230から入力された第1階層データ、第2階層データ、及び前記VLC復号化部220から入力された第3階層データについて、それぞれ、隣接するブロック間での係数の比較を行って予測モードを導出し、予測モードに対し、設定された演算式に従って、相関の高いブロックの対応する画素の値を、対象画素に足し込むことで、圧縮における予測処理前の画素値を復元(逆予測)する。そして、逆予測後の第1階層データ、第2階層データ及び第3階層データを逆量子化部250に入力する。   The coefficient inverse prediction unit 240 uses adjacent blocks for the first layer data, the second layer data, and the third layer data input from the VLC decoding unit 220, which are input from the adaptive scan unit 230, respectively. The prediction mode is derived by comparing the coefficients between them, and the corresponding pixel value of the highly correlated block is added to the target pixel according to the set arithmetic expression for the prediction mode. The pixel value before processing is restored (reverse prediction). Then, the first hierarchy data, the second hierarchy data, and the third hierarchy data after inverse prediction are input to the inverse quantization unit 250.

前記逆量子化部250は、前記係数逆予測部240により逆予測された第1階層データ、第2階層データ及び第3階層データを、それぞれ設定された量子化パラメータを用いて逆量子化する処理を行い、処理後の第1階層データ、第2階層データ及び第3階層データを、ブロック毎に周波数逆変換部260に入力する。   The inverse quantization unit 250 performs inverse quantization on the first layer data, the second layer data, and the third layer data inversely predicted by the coefficient inverse prediction unit 240 using the set quantization parameters. And the processed first layer data, second layer data, and third layer data are input to the frequency inverse transform unit 260 for each block.

前記逆量子化部250は、図15に示すように、量子化パラメータ記憶部211、iMan値生成部212、iExp値生成部213、左方向バレルシフタ214、乗算器215から構成される。   As shown in FIG. 15, the inverse quantization unit 250 includes a quantization parameter storage unit 211, an iMan value generation unit 212, an iExp value generation unit 213, a left barrel shifter 214, and a multiplier 215.

これは、図12における画像符号化装置100の量子化部130の構成と比べ、除算部115を乗算器215に置き換えたことを除き、同様の構成となっている。   This is the same configuration as that of the quantization unit 130 of the image encoding device 100 in FIG. 12 except that the division unit 115 is replaced with a multiplier 215.

即ち、前記量子化パラメータ記憶部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 iMan generating unit 212 generates information based on information indicating whether the upper 4 bits are all 0 and the lower 4 bits in the QP [7: 0] that is the quantization parameter held in the quantization parameter storage unit 211. The 5-bit length iMan [4: 0] and the 4-bit length iExp [3: 0] generated from the upper 4 bits are input to the left barrel shifter 214, and the left barrel shifter 214 receives the iMan [4 : 0] is shifted to the left by the number indicated by iExp [3: 0] to generate a quantized scaling factor (QSF [19: 0]), which is input to the multiplier 215.

乗算器215は、前記係数逆予測部240より入力された逆予測係数データを、前記左方向バレルシフタ214より入力された量子化スケーリングファクタで乗算して、逆量子化係数データを生成し、前記周波数逆変換部260に入力する。   The multiplier 215 multiplies the inverse prediction coefficient data input from the coefficient inverse prediction unit 240 by the quantization scaling factor input from the left barrel shifter 214 to generate inverse quantization coefficient data, and the frequency Input to the inverse transform unit 260.

前記周波数逆変換部260は、前記逆量子化部250によって逆量子化された係数データを、4×4画素を一つのブロックとしてラスター方向に順次処理し、周波数帯域毎の係数データを画素データに変換する処理を行う。この周波数逆変換部260は、周波数帯域毎に分離していた第1階層データ、第2階層データ及び第3階層データを、色成分毎に、1マクロブロック(16×16画素)の2次元空間データに戻して、前記色空間逆変換部270に入力する。   The frequency inverse transform unit 260 sequentially processes the coefficient data inversely quantized by the inverse quantization unit 250 in the raster direction with 4 × 4 pixels as one block, and converts the coefficient data for each frequency band into pixel data. Perform the conversion process. The frequency inverse transform unit 260 converts the first layer data, the second layer data, and the third layer data separated for each frequency band into a two-dimensional space of one macroblock (16 × 16 pixels) for each color component. The data is returned to the color space inverse transform unit 270.

前記色空間逆変換部270は、前記周波数逆変換部260から入力された色成分毎の画像データを画素毎に処理し、色空間逆変換が不要な場合は、色空間逆変換せず、色空間逆変換が必要な場合は、色空間逆変換を行って、処理後の画素データを、外部に1画像分の画像データとして出力する。   The color space inverse conversion unit 270 processes the image data for each color component input from the frequency inverse conversion unit 260 for each pixel, and when color space reverse conversion is unnecessary, the color space reverse conversion is not performed. When space inverse transformation is necessary, color space inverse transformation is performed and the processed pixel data is output to the outside as image data for one image.

尚、前述のように、色空間逆変換の要否は、非特許文献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 Non-Patent Document 1, and the pixel format requires conversion. In some cases, image data in YUV format is converted to RGB format, and image data in YUVK format is converted to CMYK format. Further, when the pixel format does not require color space reverse conversion, color space reverse conversion is not performed.

JPEG XR勧告書ITU-T T.832 : Information technology -JPEG XR image coding system - Image coding specification. [online].Recommendation T.832(01/12). Approval 2012-01-13. Status : In force.2012-9-14, ITU(International Telecommunication Union).[retrieved on 2013-10-29]. Retrieved from the Internet : <URL : http://www.itu.int/rec/T-REC-T.832-201201-I/en>.JPEG XR Recommendation ITU-T T.832: Information technology -JPEG XR image coding system-Image coding specification. [Online] .Recommendation T.832 (01/12). Approval 2012-01-13. Status: In force. 2012-9-14, ITU (International Telecommunication Union). [Retrieved on 2013-10-29]. Retrieved from the Internet: <URL: http://www.itu.int/rec/T-REC-T.832 -201201-I / en>.

ところで、画像符号化装置の量子化部における除算部へ入力される係数データとその除数データ、及び画像復号化装置の逆量子化部における乗算器へ入力される係数とその乗数データは、そのビット幅が増大する程、前記除算部及び乗算器を構成する回路規模が大きくなり、除算部及び乗算器の処理速度が低下することが知られている。   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 division unit 115 in the quantization unit 130 of the conventional image encoding device 100 shown in FIG. 12 and the multiplier data of the multiplier 215 in the inverse quantization unit 250 of the conventional image decoding device 200 shown in FIG. As described above, iMan generated from the information indicating whether all the upper bits of the quantization parameter are 0 and the lower bits and iExp generated from the upper bits of the quantization parameter are bit-shifted to the left. A 20-bit long quantization scaling factor is used.

図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 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 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 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 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.

本発明の一実施形態に係る画像符号化装置の概略構成を示したブロック図である。It is the block diagram which showed schematic structure of the image coding apparatus which concerns on one Embodiment of this invention. 本実施形態に係る量子化部の構成を示したブロック図である。It is the block diagram which showed the structure of the quantization part which concerns on this embodiment. 本実施形態に係る除算部の構成を示したブロック図である。It is the block diagram which showed the structure of the division part which concerns on this embodiment. 本実施形態に係る量子化パラメータとiManの関係を説明するための説明図である。It is explanatory drawing for demonstrating the relationship between the quantization parameter which concerns on this embodiment, and iMan. 本実施形態に係るiManの逆数の一例を説明するための説明図である。It is explanatory drawing for demonstrating an example of the reciprocal number of iMan concerning this embodiment. 本実施形態に係る量子化パラメータとiExpの関係を説明するための説明図である。It is explanatory drawing for demonstrating the relationship between the quantization parameter which concerns on this embodiment, and iExp. 本実施形態に係る量子化部を中心とした処理手順を示したフローチャートである。It is the flowchart which showed the process sequence centering on the quantization part which concerns on this embodiment. 本発明の一実施形態に係る画像復号化装置の概略構成を示したブロック図である。It is the block diagram which showed schematic structure of the image decoding apparatus which concerns on one Embodiment of this invention. 本実施形態に係る逆量子化部の構成を示したブロック図である。It is the block diagram which showed the structure of the inverse quantization part which concerns on this embodiment. 本実施形態に係る逆量子化部を中心とした処理手順を示したフローチャートである。It is the flowchart which showed the process sequence centering on the inverse quantization part which concerns on this embodiment. 従来の画像符号化装置の概略構成を示したブロック図である。It is the block diagram which showed schematic structure of the conventional image coding apparatus. 従来の量子化部の構成を示したブロック図である。It is the block diagram which showed the structure of the conventional quantization part. 従来のiMan値生成部の構成を示したブロック図であるIt is the block diagram which showed the structure of the conventional iMan value production | generation part. 従来の画像復号化装置の概略構成を示したブロック図である。It is the block diagram which showed schematic structure of the conventional image decoding apparatus. 従来の逆量子化部の構成を示したブロック図である。It is the block diagram which showed the structure of the conventional inverse quantization part. 従来の量子化パラメータと量子化スケーリングファクタの関係を説明するための説明図である。It is explanatory drawing for demonstrating the relationship between the conventional quantization parameter and a quantization scaling factor.

以下、本発明に係る画像符号化装置及び画像復号化装置についての具体的な実施形態について、図面を参照しながら説明する。まず、画像符号化装置について説明する。   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 image encoding device 1 according to the present embodiment. As shown in FIG. 1, the image encoding device 1 of this embodiment replaces the quantization unit 130 in the conventional image encoding device 100 of FIG. 11 with a quantization unit 10 having a different configuration from this. Only in this respect, the configuration of the conventional image encoding device 100 is different. Therefore, the other components are denoted by the same reference numerals as those in the image encoding device 100, and detailed description thereof is omitted.

前記量子化部10は、図2に示すように、量子化パラメータ記憶部11、iMan値生成部12、iExp値生成部13、除算部14、右方向バレルシフタ15から構成され、図7に示すフローで処理が進められる。以下、図7の各ステップを参照しながら、量子化部の各処理について説明する。   As shown in FIG. 2, the quantization unit 10 includes a quantization parameter storage unit 11, an iMan value generation unit 12, an iExp value generation unit 13, a division unit 14, and a right barrel shifter 15, and the flow shown in FIG. The process will proceed. Hereinafter, each process of the quantization unit will be described with reference to each step of FIG.

量子化パラメータ記憶部11は、符号化処理開始前にコントローラ等から処理に必要な量子化パラメータを取得し記憶する(ステップS1)。   The quantization parameter storage unit 11 acquires and stores a quantization parameter necessary for processing from a controller or the like before starting the encoding processing (step S1).

符号化処理開始時に、係数データをカウントしてマクロブロック、色成分、及びブロックのカウンタ値を更新しているブロックカウンタ(図示せず)のマクロブロックのカウンタ値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 frequency conversion unit 120, the image data of the current macro block (corresponding to the counter value m) is frequency converted, and each coefficient data of a direct current (DC) component, a low frequency (LP) component, and a high frequency (HP) component. (Step S3). In this macroblock, there are 1, 3, or 4 color components. Within each color component, there is a DC component coefficient data (DC coefficient) of one pixel and a low frequency component consisting of one block of 15 pixels. Coefficient data (LP coefficient) and 15 pixels are one block, and there are high-frequency component coefficient data (HP coefficient) consisting of 16 blocks.

前記量子化パラメータ記憶部11は、現在の色成分(カウンタ値cに対応)に対応する直流成分、低周波数成分、及び高周波数成分の量子化パラメータ(各8ビット長)を選択する(ステップS4)。量子化処理は、DC係数データ、LP係数データ、及びHP係数データの順で実施される。   The quantization parameter storage unit 11 selects a DC parameter, a low frequency component, and a high frequency component quantization parameter (each 8 bits long) corresponding to the current color component (corresponding to the counter value c) (step S4). ). The quantization process is performed in the order of DC coefficient data, LP coefficient data, and HP coefficient data.

まず、前記量子化パラメータ記憶部11により選択された直流成分の量子化パラメータ(8ビット長)が、前記iMan値生成部12及び前記iExp値生成部13に入力される。   First, a DC component quantization parameter (8-bit length) selected by the quantization parameter storage unit 11 is input to the iMan value generation unit 12 and the iExp value generation unit 13.

前記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 value generation unit 12 is the same as that already described with reference to FIG. 13, but the iMan value generation unit 12 has a quantization parameter value less than 16 (the upper 4 bits are all 0). , The lower 4 bits of the quantization parameter are cut out, and data obtained by assigning 0 to the bit above the most significant bit is generated as a 5-bit iMan value, and the quantization parameter value is 16 or more (upper 4 If any one of the bits is 1), the lower 4 bits of the quantization parameter are cut out, and the value 16 is added (1 is assigned to the bit above the most significant bit). A 5-bit iMan value is generated and input to the division unit 14. The iExp value generation unit 13 cuts out the upper 4 bits of the quantization parameter, generates a 4-bit iExp value, and inputs it to the right barrel shifter 15 (step S5).

なお、量子化パラメータ(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 division unit 14 divides the coefficient data input from the frequency conversion unit 120 by the iMan value input from the iMan value generation unit 12 and inputs the division data to the right barrel shifter 15. The right barrel shifter 15 bit-shifts the division data input from the division unit 14 to the right by the number of iExp values input from the iExp value generation unit 13 to generate quantization coefficient data, and It inputs into the coefficient estimation part 140 (step S6). As described above, the division unit 14 can set the divisor to 5-bit data in the range of 1 to 31 called iMan values, so that the circuit scale can be reduced and the processing speed can be improved. Although part of the division is bit-shifted by the right barrel shifter, the barrel shifter has a smaller circuit scale than the divider and can be configured to be capable of high-speed processing. it can.

また、前記除算部は、除算器を用いて構成することもできるが、図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 division unit 14 includes an inverse table unit 16 and a multiplier 17.

前記逆数テーブル部16は、1〜31の整数に対応する逆数値を保持した記憶領域を有し、iMan値生成部12より入力されたiMan値というデータに対応する逆数値を選択し、その逆数値のデータを前記乗算器17に入力する。前記乗算器17は、前記周波数変換部120より入力された係数データを前記逆数テーブル部16より入力されたiMan値の逆数データで乗算し、乗算データ(逆数値で乗算しているので除算データとなる)を前記右方向バレルシフタ15に入力する。   The reciprocal table unit 16 has a storage area for holding reciprocal values corresponding to integers 1 to 31, and selects a reciprocal value corresponding to data called iMan value input from the iMan value generation unit 12 and its inverse. Numerical data is input to the multiplier 17. The multiplier 17 multiplies the coefficient data input from the frequency conversion unit 120 by the reciprocal data of the iMan value input from the reciprocal table unit 16, and multiplies data (because it is multiplied by the reciprocal value. Is input to the right barrel shifter 15.

なお、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 division unit 14 using the reciprocal table 16 and the multiplier 17, the circuit scale and processing speed of the division unit 14 can be improved. Since the iMan value that is a divisor is in a small numerical range of 1 to 31 represented by a 5-bit length, the bit length of the reciprocal data can be reduced, and the number of reciprocals to be retained However, since it is sufficient to hold the reciprocal number of 31 pieces in the range of 1 to 31, the circuit scale of the reciprocal table unit 16 can be reduced.

次に、前記量子化パラメータ記憶部11により選択された低周波数成分の量子化パラメータ(8ビット長)が、前記iMan値生成部12及び前記iExp値生成部13に入力される。   Next, the low-frequency component quantization parameter (8-bit length) selected by the quantization parameter storage unit 11 is input to the iMan value generation unit 12 and the iExp value generation unit 13.

直流成分の量子化パラメータの場合と同様にして、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 value generation unit 12 generates iMan value data of a low frequency component, and the iExp value generation unit 13 generates data of the iExp value of the low frequency component. The 15 LP coefficient data in block units generated by the dividing unit 14 and input from the frequency converting unit 120 by the dividing unit 14 are divided by the iMan value data generated by the iMan value generating unit 12, and the 15 The divided data is bit-shifted rightward by the value of the iExp value data generated by the iExp generation unit 13 in the right barrel shifter 15 to generate quantized coefficient data, which is input to the coefficient prediction unit 140 (Step S8).

低周波数成分の量子化パラメータの場合と同様にして、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 value generation unit 12 generates high-frequency component iMan value data, and the iExp value generation unit 13 generates high-frequency component iExp value data. Is generated (step S9), and 15 HP coefficient data of the current block (corresponding to the counter value n) input from the frequency converting unit 120 by the dividing unit 14 is generated by the iMan value generating unit 12. Divided by the iMan value data, the 15 divided data are bit-shifted rightward by the value of the iExp value data generated by the iExp value generation unit 13 in the right barrel shifter 15 to generate quantized coefficient data. Then, it is input to the coefficient prediction unit 140 (step S10). Then, every time the quantization of the current block is completed, the counter value of the block is updated (step S12), and the quantization process is performed up to the final block of the current color component. The quantization processing of each frequency component is similarly performed until the final color component (step S13), and the quantization processing of each frequency component is performed similarly until the final macroblock is obtained. The process ends (step S15).

以上の構成を備えた本例の画像符号化装置1によれば、まず、色空間変換部110に、1画像分の画像データが入力され、画像データのピクセルフォーマットに従い、色空間変換され、又は色空間変換されず、前記色空間変換部110での処理を経由した画像データが周波数変換部120へ入力される。   According to the image encoding apparatus 1 of the present example having the above configuration, first, image data for one image is input to the color space conversion unit 110, and color space conversion is performed according to the pixel format of the image data, or Image data that has not undergone color space conversion and has undergone processing in the color space conversion unit 110 is input to the frequency conversion unit 120.

周波数変換部120は、マクロブロック単位(16×16画素)でラスター方向に順次、各画素のデータを周波数帯域毎の係数に変換する処理を行い、処理後の第1階層データ(HP係数)、第2階層データ(LP係数)、及び第3階層データ(DC係数)をブロック単位(4×4画素)で量子化部10に入力する。   The frequency conversion unit 120 performs processing for sequentially converting the data of each pixel into a coefficient for each frequency band in the raster direction in units of macroblocks (16 × 16 pixels), and the first layer data (HP coefficient) after processing, The second layer data (LP coefficient) and the third layer data (DC coefficient) are input to the quantization unit 10 in block units (4 × 4 pixels).

量子化部10は、周波数変換部120により係数化された第1階層データ、第2階層データ、及び第3階層データを、量子化パラメータの上位4ビットが全て0か否かの情報と下位4ビットから生成される5ビット長のiMan値で除算し、除算データを量子化パラメータの上位4ビットから生成される4ビット長のiExp値の値だけ右方向にビットシフトして量子化する処理を行い、処理後の第1階層データ、第2階層データ、及び第3階層データを係数予測部140に入力する。   The quantization unit 10 uses the first layer data, the second layer data, and the third layer data that have been coefficientized by the frequency conversion unit 120, the information about whether all the upper 4 bits of the quantization parameter are 0 and the lower 4 A process of dividing the divided data by a 5-bit iMan value generated from the bits and shifting the divided data to the right by the value of the 4-bit iExp value generated from the upper 4 bits of the quantization parameter to quantize the data. The first layer data, the second layer data, and the third layer data after processing are input to the coefficient prediction unit 140.

係数予測部140は、第1階層データ、第2階層データ、及び第3階層データについて、予測モードを導出するとともに、相関の高いブロック間で減算する処理を行い、処理後の第1階層データ及び第2階層データをブロック毎に適応型スキャン部150に入力する。   The coefficient prediction unit 140 derives a prediction mode for the first layer data, the second layer data, and the third layer data, and performs a process of subtracting between the highly correlated blocks, The second layer data is input to the adaptive scan unit 150 for each block.

適応型スキャン部150は、第1階層データ(HP係数)及び第2階層データ(LP係数)について、ブロック毎にその係数データを入れ替える処理を行う。この入替処理は、周波数変換後、ブロック内の画素位置が小さい側(低周波数側)に非ゼロの係数を集め、ブロック内の画素位置が大きい側(高周波数側)にゼロ値が連続する係数データを集めることで、符号化の圧縮率を高めるためのものである。係数データが入れ替えられた第1階層データ、第2階層データ、及び入替処理が実施されない第3階層データは、VLC符号化部160に入力される。   The adaptive scanning unit 150 performs processing for replacing the coefficient data for each block with respect to the first layer data (HP coefficient) and the second layer data (LP coefficient). In this replacement process, after frequency conversion, non-zero coefficients are collected on the side where the pixel position in the block is small (low frequency side), and the zero value continues on the side where the pixel position in the block is large (high frequency side). This is to increase the compression rate of encoding by collecting data. The first layer data, the second layer data, and the third layer data on which the replacement process is not performed are input to the VLC encoding unit 160.

VLC符号化部160は、適応型スキャン部150で処理された第1階層データ、第2階層データ、及び第3階層データに対し、エントロピー符号化処理を施し、コードストリームを生成して、そのコードストリームをビットストリーム出力部170に入力する。   The VLC encoding unit 160 performs entropy encoding processing on the first layer data, the second layer data, and the third layer data processed by the adaptive scan unit 150, generates a code stream, and outputs the code stream. The stream is input to the bit stream output unit 170.

ビットストリーム出力部170は、ヘッダ情報としての画像設定データに、VLC符号化部160で符号化されたコードストリームを順次連接し、1画像データ分のビットストリームとして1纏めにして1つのファイルを形成し、形成したファイルを外部に出力する。   The bit stream output unit 170 sequentially concatenates the code streams encoded by the VLC encoding unit 160 to the image setting data as header information, and forms one file as a bit stream for one image data. And output the formed file to the outside.

[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 image decoding apparatus 2 according to this embodiment. As shown in FIG. 8, the image decoding apparatus 2 of the present embodiment is replaced with the inverse quantization unit 250 in the conventional image decoding apparatus 200 of FIG. Only in this respect, the configuration of the conventional image decoding apparatus 200 is different. Accordingly, the other components are denoted by the same reference numerals as those in the image decoding apparatus 200, and detailed description thereof is omitted.

前記逆量子化部20は、図9に示すように、量子化パラメータ記憶部21、iMan値生成部22、iExp値生成部23、乗算器24、左方向バレルシフタ25から構成され、図10に示すフローで処理が進められる。以下、図10のステップを参照しながら、逆量子化部の各処理について説明する。   As shown in FIG. 9, the inverse quantization unit 20 includes a quantization parameter storage unit 21, an iMan value generation unit 22, an iExp value generation unit 23, a multiplier 24, and a left barrel shifter 25, and is shown in FIG. Processing proceeds with the flow. Hereinafter, each process of the inverse quantization unit will be described with reference to the steps of FIG.

符号化処理開始時に、係数データをカウントしてマクロブロック、色成分、及びブロックのカウンタ値を更新しているブロックカウンタ(図示せず)のマクロブロックのカウンタ値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 parameter storage unit 21 acquires and stores the quantization parameter necessary for the process from the compressed data encoded after the start of the decoding process (step S22).

前記VLC復号化部220において、現在のマクロブロック(カウンタ値mに対応)の符号化データを復号化処理し、直流(DC)成分、低周波数(LP)成分、及び高周波数(HP)成分の各係数データとする(ステップS23)。このマクロブロック内には、1、3、又は4個の色成分があり、各色成分内には、1画素の直流成分の係数データ(DC係数)と15画素の1ブロックからなる低周波数成分の係数データ(LP係数)と15画素を1ブロックとし、16個のブロックからなる高周波成分の係数データ(HP係数)がある。   The VLC decoding unit 220 decodes the encoded data of the current macroblock (corresponding to the counter value m), and generates a direct current (DC) component, a low frequency (LP) component, and a high frequency (HP) component. Each coefficient data is set (step S23). In this macroblock, there are 1, 3, or 4 color components. Within each color component, there is a DC component coefficient data (DC coefficient) of one pixel and a low frequency component consisting of one block of 15 pixels. Coefficient data (LP coefficient) and 15 pixels are one block, and there are high-frequency component coefficient data (HP coefficient) consisting of 16 blocks.

前記量子化パラメータ記憶部21は、現在の色成分(カウンタ値cに対応)に対応する直流成分、低周波数成分、及び高周波数成分の量子化パラメータ(各8ビット長)を選択する(ステップS24)。逆量子化処理は、DC係数データ、LP係数データ、及びHP係数データの順で実施される。   The quantization parameter storage unit 21 selects a DC component, a low frequency component, and a high frequency component quantization parameter (each 8 bits long) corresponding to the current color component (corresponding to the counter value c) (step S24). ). The inverse quantization process is performed in the order of DC coefficient data, LP coefficient data, and HP coefficient data.

まず、前記量子化パラメータ記憶部21により選択された直流成分の量子化パラメータ(8ビット長)が、前記iMan値生成部22及び前記iExp値生成部23に入力される。   First, the DC component quantization parameter (8-bit length) selected by the quantization parameter storage unit 21 is input to the iMan value generation unit 22 and the iExp value generation unit 23.

前記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 numerical value 16 is added (1 is assigned to the bit above the most significant bit). A bit length iMan value is generated and input to the multiplier 24. The iExp value generation unit 23 cuts out the upper 4 bits of the quantization parameter, generates a 4-bit iExp value, and inputs it to the left barrel shifter 25 (step S25).

前記乗算器24は、前記係数逆予測部240より入力された係数データを前記iMan値生成部23より入力されたiMan値で乗算し、乗算データを前記左方向バレルシフタ25に入力する。前記左方向バレルシフタ25は、前記乗算器24より入力された乗算データを前記iExp値生成部23より入力されたiExp値の数だけ左方向にビットシフトして、逆量子化係数データを生成し、前記周波数逆変換部260に入力する(ステップS26)。このように、前記乗算器24は、乗数をiMan値という1〜31の範囲の5ビット長のデータとすることができるので、回路規模を小さくし、処理速度を向上させることができる。また、乗算の一部を左方向バレルシフタによるビットシフトにしているが、バレルシフタは乗算器に比べ、回路規模も小さく、高速処理が可能なように構成できるので、処理能力の向上を実現することができる。   The multiplier 24 multiplies the coefficient data input from the coefficient inverse prediction unit 240 by the iMan value input from the iMan value generation unit 23 and inputs the multiplication data to the left barrel shifter 25. The left barrel shifter 25 bit-shifts the multiplication data input from the multiplier 24 to the left by the number of iExp values input from the iExp value generation unit 23 to generate inverse quantization coefficient data, The frequency is input to the inverse frequency converter 260 (step S26). Thus, since the multiplier 24 can set the multiplier to 5-bit length data in the range of 1 to 31 called iMan values, the circuit scale can be reduced and the processing speed can be improved. In addition, part of the multiplication is bit-shifted by the left barrel shifter, but the barrel shifter is smaller in circuit scale than the multiplier and can be configured to be capable of high-speed processing, so it is possible to improve processing performance. it can.

次に、前記量子化パラメータ記憶部21により選択された低周波数成分の量子化パラメータ(8ビット長)が、前記iMan値生成部22及び前記iExp値生成部23に入力される。   Next, the low-frequency component quantization parameter (8-bit length) selected by the quantization parameter storage unit 21 is input to the iMan value generation unit 22 and the iExp value generation unit 23.

直流成分の量子化パラメータの場合と同様にして、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 value generation unit 22 generates low frequency component iMan value data, and the iExp value generation unit 23 generates low frequency component iExp value data. The 15 LP coefficient data in block units input from the coefficient inverse prediction unit 240 is generated by the multiplier 24 and multiplied by the iMan value data generated by the iMan value generation unit 22, The 15 multiplication data are bit-shifted leftward by the value of the iExp value data generated by the iExp generation unit 23 in the left barrel shifter 25 to generate inverse quantization coefficient data, and the frequency inverse conversion unit 260 Input (step S28).

低周波数成分の量子化パラメータの場合と同様にして、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 value generation unit 22 generates high-frequency component iMan value data, and the iExp generation unit 23 generates high-frequency component iExp value data. The iMan value generation unit 22 generates 15 HP coefficient data of the current block (corresponding to the counter value n) input from the coefficient inverse prediction unit 240 by the multiplier 24 (step S29). The iMan value data is multiplied, and the 15 multiplication data are bit-shifted leftward by the value of the iExp value data generated by the iExp generation unit 23 in the left barrel shifter 25 to generate inverse quantization coefficient data. Then, it is input to the frequency inverse transform unit 260 (step S30). Then, every time the quantization of the current block is completed, the block counter value is updated (step S32), and the quantization process is performed up to the final block of the current color component. The quantization processing of each frequency component is similarly performed until the final color component is obtained (step S33), and the quantization processing of each frequency component is performed similarly until the final macroblock is obtained. The process ends (step S35).

以上の構成を備えた本例の画像復号化装置2によれば、まず、ビットストリーム解析部210に、1画像分の圧縮データが入力され、画像情報が抽出されるとともに、分離された符号化データがVLC復号化部220へ入力される。   According to the image decoding apparatus 2 of the present example having the above-described configuration, first, compressed data for one image is input to the bitstream analysis unit 210, image information is extracted, and separated encoding is performed. Data is input to the VLC decoding unit 220.

VLC復号化部220は、ビットストリーム解析部210で分離された符号化データを復号化し、第1階層データ(HP係数)、第2階層データ(LP係数)、及び第3階層データ(DC係数)の各階層データを生成して、その各階層データを適応型スキャン部230に入力する。   The VLC decoding unit 220 decodes the encoded data separated by the bitstream analysis unit 210, and performs first layer data (HP coefficient), second layer data (LP coefficient), and third layer data (DC coefficient). Are generated and input to the adaptive scanning unit 230.

適応型スキャン部230は、第1階層データ(HP係数)及び第2階層データ(LP係数)について、ブロック毎にその係数データを入れ替える処理を行う。この入替処理は、圧縮における周波数変換の際、ブロック内の画素位置が小さい側(低周波数側)に非ゼロの係数を集め、ブロック内の画素位置が大きい側(高周波数側)にゼロ値が連続する係数データを集めることで、符号化の圧縮率を高めるために行われるものである。係数データが入れ替えられた第1階層データ、第2階層データ、及び入替処理が実施されない第3階層データは、係数逆予測部240に入力される。   The adaptive scanning unit 230 performs processing for replacing the coefficient data for each block with respect to the first layer data (HP coefficient) and the second layer data (LP coefficient). This replacement process collects non-zero coefficients on the side where the pixel position in the block is small (low frequency side) during frequency conversion in compression, and the zero value is on the side where the pixel position in the block is large (high frequency side). This is performed in order to increase the compression rate of encoding by collecting continuous coefficient data. The first layer data, the second layer data, and the third layer data on which the replacement process is not performed are input to the coefficient inverse prediction unit 240.

係数逆予測部240は、第1階層データ、第2階層データ、及び第3階層データについて、予測モードを導出するとともに、相関の高いブロック間で足し戻す処理を行い、処理後の第1階層データ、第2階層データ、及び第3階層データを逆量子化部20に入力する。   The coefficient inverse prediction unit 240 derives a prediction mode for the first layer data, the second layer data, and the third layer data, and performs a process of adding back between the highly correlated blocks. , Second layer data, and third layer data are input to the inverse quantization unit 20.

逆量子化部20は、係数逆予測部240により逆予測処理された第1階層データ、第2階層データ、及び第3階層データを、量子化パラメータの上位4ビットが全て0か否かの情報と下位4ビットから生成される5ビット長のiMan値で乗算し、乗算データを量子化パラメータの上位4ビットから生成される4ビット長のiExp値の値だけ左方向にビットシフトして逆量子化する処理を行い、処理後の第1階層データ、第2階層データ、及び第3階層データを周波数逆変換部260に入力する。   The inverse quantization unit 20 is information on whether or not all the upper 4 bits of the quantization parameter are 0 for the first layer data, the second layer data, and the third layer data subjected to the inverse prediction processing by the coefficient inverse prediction unit 240 And the 5-bit iMan value generated from the lower 4 bits, and the multiplication data is bit-shifted to the left by the value of the 4-bit iExp value generated from the upper 4 bits of the quantization parameter. The first layer data, the second layer data, and the third layer data after processing are input to the frequency inverse transform unit 260.

周波数逆変換部260は、逆量子化部20により逆量子化された第1階層データ、第2階層データ、及び第3階層データを、周波数逆変換し、マクロブロック単位(16×16画素)の画像データとし、変換された画像データを色空間逆変換部270に入力する。   The frequency inverse transform unit 260 performs frequency inverse transform on the first layer data, the second layer data, and the third layer data inversely quantized by the inverse quantization unit 20, and performs macroblock unit (16 × 16 pixels). The converted image data is input to the color space inverse conversion unit 270 as image data.

色空間逆変換部270は、周波数逆変換部260により周波数逆変換されたマクロブロック単位の画像データを、ビットストリーム解析部210により抽出された画像情報であるピクセルフォーマットに従い、色空間逆変換し、又は色空間逆変換せず、処理した画像データを1画像分の画像データとして外部に出力する。   The color space inverse transform unit 270 performs the color space inverse transform on the image data in units of macro blocks frequency-transformed by the frequency inverse transform unit 260 according to the pixel format that is the image information extracted by the bit stream analysis unit 210, Alternatively, the processed image data is output to the outside as image data for one image without performing inverse color space conversion.

以上詳述したように、本実施形態の画像符号化装置1によれば、その量子化部10において、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されたiMan値により、周波数変換部から入力された係数データを除算部にて除算し、その除算データを量子化パラメータの上位ビットから生成されたiExp値の値だけ右方向にビットシフトして量子化係数データを得る構成としているので、従来のiMan値をiExp値の値だけ左方向にビットシフトしたデータである量子化スケーリングファクタで係数データを除算する構成と比べ、除算部に与える除数の数値を小さくすることができ、除算部の回路規模を縮小し、除算部の処理速度を向上させることが可能となる。   As described above in detail, according to the image encoding device 1 of the present embodiment, in the quantization unit 10, the iMan value generated from the information indicating whether or not all the upper bits of the quantization parameter are 0 and the lower bits. Then, the coefficient data input from the frequency conversion unit is divided by the division unit, and the division data is bit-shifted to the right by the value of the iExp value generated from the upper bits of the quantization parameter to obtain the quantized coefficient data. Compared to the conventional configuration in which the coefficient data is divided by the quantization scaling factor, which is data obtained by bit shifting the iMan value to the left by the value of the iExp value, the divisor value given to the division unit is reduced. Therefore, it is possible to reduce the circuit scale of the division unit and improve the processing speed of the division unit.

そして、本実施形態の画像符号化装置1の量子化部における除算部は、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されるiMan値の逆数の値をその記憶領域に保持した逆数テーブル部を有し、iMan値が生成される毎に逆数テーブル部からそのiMan値の逆数を選択し、iMan値の逆数で周波数変換部より入力された係数データを乗算器にて乗算する構成としているので、従来のiMan値をiExp値の値だけ左方向にビットシフトしたデータである量子化スケーリングファクタの逆数で周波数変換部より入力された係数データを乗算器にて乗算する構成と比べて、保持しておく逆数データのビット幅を小さくすることができ、保持しておく逆数データの数も少なくなり、逆数テーブル部及び乗算器の回路規模を縮小でき、本除算部の処理速度を向上させることが可能となる。これにより、画像符号化装置の画像符号化処理の最適化を図ることができる。   Then, the division unit in the quantization unit of the image encoding device 1 according to the present embodiment stores information on whether all the upper bits of the quantization parameter are 0 and the reciprocal value of the iMan value generated from the lower bits. Each time an iMan value is generated, an inverse number of the iMan value is selected from the inverse number table unit, and the coefficient data input from the frequency conversion unit by the inverse of the iMan value is input to the multiplier. Therefore, the multiplier multiplies the coefficient data input from the frequency conversion unit by a reciprocal of the quantization scaling factor which is data obtained by bit shifting the iMan value in the left direction by the value of the iExp value to the left. Compared to the configuration, the bit width of the reciprocal data to be retained can be reduced, the number of reciprocal data to be retained is reduced, the reciprocal table unit and multiplication Can reduce the circuit scale, it is possible to improve the processing speed of the divider. Thereby, the optimization of the image coding process of an image coding apparatus can be aimed at.

また、本実施形態の画像復号化装置2によれば、その逆量子化部20において、量子化パラメータの上位ビットが全て0か否かの情報と下位ビットから生成されたiMan値により、周波数変換部から入力された係数データを乗算器にて乗算し、その乗算データを量子化パラメータの上位ビットから生成されたiExp値の値だけ左方向にビットシフトして逆量子化係数データを得る構成としているので、従来のiMan値をiExp値の値だけ左方向にビットシフトしたデータである量子化スケーリングファクタで係数データを乗算する構成と比べ、乗算器に与える乗数の数値を小さくすることができ、乗算器の回路規模を縮小し、乗算器の処理速度を向上させることが可能となる。これにより、画像復号化装置の画像復号化処理の最適化を図ることができる。   Further, according to the image decoding device 2 of the present embodiment, the inverse quantization unit 20 performs frequency conversion based on information indicating whether all the upper bits of the quantization parameter are 0 and the iMan value generated from the lower bits. The coefficient data input from the unit is multiplied by a multiplier, and the multiplication data is bit-shifted to the left by the value of the iExp value generated from the upper bits of the quantization parameter to obtain inverse quantization coefficient data. Therefore, the multiplier value given to the multiplier can be reduced as compared with the configuration in which the coefficient data is multiplied by the quantization scaling factor which is data obtained by bit shifting the iMan value to the left by the value of the iExp value, It is possible to reduce the circuit scale of the multiplier and improve the processing speed of the multiplier. Thereby, optimization of the image decoding process of an image decoding apparatus can be aimed at.

以上、本発明の一実施形態について説明したが、本発明が採り得る具体的な態様は、何らこれに限定されるものではない。例えば、上例では、量子化パラメータを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 SYMBOLS 1 Image coding apparatus 2 Image decoding apparatus 10 Quantization part 11 Quantization parameter memory | storage part 12 iMan value generation part 13 iExp value generation part 14 Division part 15 Right direction barrel shifter 16 Reciprocal number table part 17 Multiplier 20 Inverse quantization part 21 Quantization parameter storage unit 22 iMan value generation unit 23 iExp value generation unit 24 Multiplier 25 Left barrel shifter 100 Image encoding device 110 Color space conversion unit 111 Quantization parameter storage unit 112 iMan value generation unit 113 iExp value generation unit 114 Left Direction barrel shifter 115 Division unit 116 Bit cutout unit 117 Adder 118 Comparison unit 119 Selector 120 Frequency conversion unit 130 Quantization unit 140 Coefficient prediction unit 150 Adaptive scan unit 160 VLC encoding unit 170 Bit stream output unit 200 Image decoding device 210 Bitstream Analysis Unit 211 Quantization Parameter Storage Unit 212 iMan Value Generation Unit 213 iExp Value Generation Unit 214 Left Barrel Shifter 215 Multiplier 220 VLC Decoding Unit 230 Adaptive Scan Unit 240 Coefficient Inverse Prediction Unit 250 Inverse Quantization Unit 260 Frequency Inverse transform unit 270 Color space inverse transform unit

Claims (3)

画像データを水平及び垂直の各方向に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以上の整数である。
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.
JP2013249884A 2013-12-03 2013-12-03 Image encoding apparatus and image decoding apparatus Active JP6204171B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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