JP2007300389A - Image encoding apparatus and image encoding program - Google Patents

Image encoding apparatus and image encoding program Download PDF

Info

Publication number
JP2007300389A
JP2007300389A JP2006126585A JP2006126585A JP2007300389A JP 2007300389 A JP2007300389 A JP 2007300389A JP 2006126585 A JP2006126585 A JP 2006126585A JP 2006126585 A JP2006126585 A JP 2006126585A JP 2007300389 A JP2007300389 A JP 2007300389A
Authority
JP
Japan
Prior art keywords
coefficient
zero
encoding
code
unit
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.)
Pending
Application number
JP2006126585A
Other languages
Japanese (ja)
Inventor
Yoshiko Hozumi
芳子 穂積
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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan 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 Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP2006126585A priority Critical patent/JP2007300389A/en
Publication of JP2007300389A publication Critical patent/JP2007300389A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce an operation quantity in the variable length encoding of a factor, and to achieve a high speed an encoding processing in image encoding processing. <P>SOLUTION: A code variable calculator 52 calculates a code variable for specifying an arrangement of a zero factor and a non-zero factor based on whether each factor in a factor row generated in a zigzag scanner 51 is zero or non-zero. A first encoder 54a, a second encoder 54b, ..., and a n-th encoder 54n of an encoder 54 conduct the encoding processing of each individual according to the code variable. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、動画像を効率的に伝送するために、より少ない符号量で符号化する高能率の画像符号化装置および画像符号化プログラムに関する。   The present invention relates to a high-efficiency image encoding apparatus and image encoding program for encoding with a smaller code amount in order to efficiently transmit a moving image.

従来の画像符号化装置にあっては、予測画像と原画像との残差成分を直交変換量子化して生成した係数を、規格で決められたシンタックスに基づいて可変長符号化している。   In a conventional image encoding device, coefficients generated by orthogonal transform quantization of residual components between a predicted image and an original image are variable-length encoded based on a syntax determined by a standard.

仮に、輝度成分のブロックの大きさを16×16画素、色差成分のブロックの大きさを8×8画素、係数の直交変換を4×4の単位で行うとすると、係数の数は全部で384個となる。これを4×4、つまり16個ずつに区切って可変長符号化する。   If the size of the luminance component block is 16 × 16 pixels, the size of the color difference component block is 8 × 8 pixels, and the orthogonal transformation of the coefficients is performed in units of 4 × 4, the number of coefficients is 384 in total. It becomes a piece. This is divided into 4 × 4, that is, 16 pieces, and variable length coding is performed.

例えば、H.264/MPEG−4 AVC(以降、H.264/AVCと呼ぶ)の符号化においては、この16個の係数をまず高周波成分からジグザグスキャン順に並べ替えてから、最初の非ゼロ係数を探し、非ゼロ係数の値やゼロ係数の並び数、非ゼロ係数の絶対値が1かどうかなどを順次判定し、可変長符号化する必要がある。   For example, H.M. In the encoding of H.264 / MPEG-4 AVC (hereinafter referred to as H.264 / AVC), the 16 coefficients are first rearranged from high frequency components in zigzag scan order, and then the first non-zero coefficient is searched for. It is necessary to sequentially determine whether zero coefficient values, the number of zero coefficients are arranged, and whether the absolute value of non-zero coefficients is 1, and perform variable-length coding.

そのため、係数の可変長符号化処理では、非ゼロ係数とゼロ係数とがどのように分布しているかを調べるための条件判定文が多くなり、DSP等へ実装した場合に多くの演算量を必要とする。   Therefore, in variable-length coding processing of coefficients, there are many conditional judgment statements for examining how non-zero coefficients and zero coefficients are distributed, and a large amount of calculation is required when implemented in a DSP or the like. And

また、非ゼロ係数が多くなれば、演算量が増える。一般には、インター符号化と比較してイントラ符号化した場合の方が、非ゼロ係数が多く分布する。また、ビットレートを上げると非ゼロ係数の数が増加する。さらに、H.264/AVCのシンタックスで規定されている符号へ変換するためのテーブル参照が多く、これも実装時の負荷となっている。   In addition, as the non-zero coefficient increases, the amount of calculation increases. In general, more non-zero coefficients are distributed in the case of intra coding compared to inter coding. Also, increasing the bit rate increases the number of non-zero coefficients. Further, H.C. There are many table references for conversion to codes defined by the H.264 / AVC syntax, which is also a load at the time of mounting.

従来の画像符号化装置としては、例えば特許文献1に記載されたものが報告されている。この画像符号化装置では、ジグザグスキャンして並べ替えた係数列について、非ゼロ係数とゼロ係数の分布により、非ゼロ係数の数を求め、ゼロラン数とレベル値とを組み合わせてメモリ上に格納し、この組み合わせた値からVLCテーブルを参照して符号化を行っている。   As a conventional image encoding device, for example, a device described in Patent Document 1 has been reported. In this image encoding device, the number of nonzero coefficients is obtained from the distribution of nonzero coefficients and zero coefficients for the coefficient sequence rearranged by zigzag scanning, and the number of zero runs and the level value are combined and stored in the memory. The encoding is performed by referring to the VLC table from the combined value.

ここで、従来の画像符号化装置における可変長符号化処理について説明する。ここでは、4×4画素の単位で直交変換された16個の係数を、H.264/AVCの規格に従って可変長符号化する場合について説明する。   Here, the variable-length encoding process in the conventional image encoding device will be described. Here, 16 coefficients obtained by orthogonal transform in units of 4 × 4 pixels are represented by H.264. The case of variable length coding according to the H.264 / AVC standard will be described.

図17は従来の画像符号化装置における可変長符号化処理を説明するためのフローチャートである。まず、図18(a)に示す4×4ブロックの係数を、図18(b)に示すジグザグスキャン順に並べ替える(ステップS10)。図19(a)はジグザグスキャン前の係数列を示す図、図19(b)はジグザグスキャン後の係数列を示す図である。   FIG. 17 is a flowchart for explaining variable-length coding processing in a conventional image coding apparatus. First, the 4 × 4 block coefficients shown in FIG. 18A are rearranged in the zigzag scan order shown in FIG. 18B (step S10). FIG. 19A shows a coefficient sequence before zigzag scanning, and FIG. 19B shows a coefficient sequence after zigzag scanning.

そして、各係数C00´〜C15´について判定を行う(ステップS20)。1つの係数のループについて説明すると、まず、その係数が非ゼロ係数かゼロ係数かを判定し(ステップS30)、ゼロ係数でない(ステップS30:NO)場合は、その非ゼロ係数の係数値(レベル値)を記録する(ステップS60)。そして、非ゼロ係数の数を更新し(ステップS70)、ループを終了する(ステップS80)。 Then, each coefficient C 00 ′ to C 15 ′ is determined (step S20). The loop of one coefficient will be described. First, it is determined whether the coefficient is a non-zero coefficient or a zero coefficient (step S30). If the coefficient is not a zero coefficient (step S30: NO), the coefficient value (level) of the non-zero coefficient is determined. Value) is recorded (step S60). Then, the number of non-zero coefficients is updated (step S70), and the loop is terminated (step S80).

また、符号化には非ゼロ係数に続くゼロ係数の連続数(ゼロラン数)が必要となる。このため、係数がゼロ係数である(ステップS30:YES)場合は、その係数の前までに非ゼロ係数があるかどうかを判定し(ステップS40)、非ゼロ係数がある(ステップS40:YES)場合、ゼロラン数を更新して記録する(ステップS50)。非ゼロ係数がない(ステップS40:NO)場合、ループを終了する(ステップS80)。   Also, encoding requires a continuous number of zero coefficients (zero run number) following non-zero coefficients. For this reason, when the coefficient is a zero coefficient (step S30: YES), it is determined whether there is a non-zero coefficient before the coefficient (step S40), and there is a non-zero coefficient (step S40: YES). In this case, the zero run number is updated and recorded (step S50). If there is no non-zero coefficient (step S40: NO), the loop is terminated (step S80).

16個の係数についてこのループが終わった後、非ゼロ係数の最初に連続する絶対値1の係数の数(先行1の数)を符号化して、それらの係数の符号とともに出力する(ステップS90)。   After this loop is completed for 16 coefficients, the number of first consecutive coefficient of absolute value 1 (number of leading 1) of non-zero coefficients is encoded and output together with the sign of those coefficients (step S90). .

また、ステップS60で記録したレベル値、ステップS50で記録したゼロラン数、最初の非ゼロ係数以降のゼロ係数の数(ゼロ数)を規格に従って符号化して出力する(ステップS100〜S120)。   The level value recorded in step S60, the number of zero runs recorded in step S50, and the number of zero coefficients after the first non-zero coefficient (zero number) are encoded and output according to the standard (steps S100 to S120).

図19(c)は係数列の一例を示す図、図19(d)は図19(c)に示す係数列でのゼロラン数とレベル値、およびゼロラン数とレベル値の組み合わせ数を示す表図である。   FIG. 19C is a diagram showing an example of a coefficient sequence, FIG. 19D is a table showing the number of zero runs and level values, and the number of combinations of zero run numbers and level values in the coefficient sequence shown in FIG. It is.

図19(c)に示す係数列では、非ゼロ係数が3つとなるので、ステップS50,S60において、3つのレベル値とゼロラン数を記録する。そして、S110においてゼロラン数を符号化して出力する際には、ゼロラン数により規定のテーブルを参照し、テーブルに規定の符号化コードを、規定のコード長で出力する。   In the coefficient sequence shown in FIG. 19C, since there are three non-zero coefficients, three level values and the number of zero runs are recorded in steps S50 and S60. Then, when the zero run number is encoded and output in S110, the prescribed table is referred to by the zero run number, and the prescribed encoded code is output in the table with the prescribed code length.

また、ステップS90,S120においても同様に、それぞれ先行1の数、ゼロ数により規定のテーブルを参照し、テーブルに規定の符号化コードを、規定のコード長で出力する。
特開2001−308715号公報
Similarly, in steps S90 and S120, a prescribed table is referred to by the number of leading ones and the number of zeros, respectively, and a prescribed encoded code is output in the table with a prescribed code length.
JP 2001-308715 A

上述した可変長符号化処理では、ステップS30,S40の処理において、条件判定文が多用されるために、DSP等に実装する場合に演算量が多くなるという問題があった。   In the variable length encoding process described above, the condition determination statements are frequently used in the processes of steps S30 and S40, so that there is a problem that the amount of calculation increases when implemented in a DSP or the like.

また、係数列からゼロラン数等のデータを取得して別のメモリ上にストアした後に、ステップS90〜S120の処理の際に、これらのデータをロードするために、実装時にメモリへのアクセス動作が多く発生する。   In addition, after acquiring data such as the number of zero runs from the coefficient sequence and storing it in another memory, in order to load these data during the processing of steps S90 to S120, an access operation to the memory is performed at the time of mounting. Many occur.

さらに、ステップS90,S110,S120の処理において、参照するテーブルをその都度切り替えるために、テーブルへのアクセス動作が多く発生し、処理に時間がかかるという問題があった。   Furthermore, in the processing of steps S90, S110, and S120, since the table to be referred to is switched each time, there is a problem that many access operations to the table occur and the processing takes time.

本発明は上記に鑑みてなされたもので、係数の可変長符号化における演算量を削減し、符号化処理を高速化することができる画像符号化装置および画像符号化プログラムを提供することを目的とする。   The present invention has been made in view of the above, and an object of the present invention is to provide an image encoding device and an image encoding program capable of reducing the amount of calculation in coefficient variable length encoding and speeding up the encoding process. And

本発明の画像符号化装置は、画像をブロック単位に分割して符号化処理を行う画像符号化装置において、予測画像と原画像との残差成分を直交変換量子化して生成された係数を高周波成分からジグザグスキャン順に並べ替えて係数列を生成する係数列生成手段と、この係数列生成手段で生成された前記係数列における各係数がゼロ係数であるか非ゼロ係数であるかに基づいて、前記ゼロ係数と前記非ゼロ係数の配置を特定するためのコード変数を算出するコード変数算出手段と、前記係数列の非ゼロ係数に続くゼロ係数の連続数を示すゼロラン数と、前記係数列の最初の非ゼロ係数以降のゼロ係数の数を示すゼロ数を、前記コード変数に対応して予め設定されている符号化コードとそのコード長とを用いて可変長符号化する符号化手段とを備えることを特徴とする。   The image coding apparatus according to the present invention is an image coding apparatus that divides an image into blocks and performs coding processing. A coefficient generated by orthogonal transform quantization of a residual component between a predicted image and an original image is a high frequency signal. Based on coefficient sequence generating means for generating a coefficient sequence by rearranging components in zigzag scan order, and whether each coefficient in the coefficient sequence generated by the coefficient sequence generating means is a zero coefficient or a non-zero coefficient, A code variable calculating means for calculating a code variable for specifying an arrangement of the zero coefficient and the non-zero coefficient; a zero-run number indicating a continuous number of zero coefficients following the non-zero coefficient of the coefficient string; and Encoding means for variable-length encoding a zero number indicating the number of zero coefficients after the first non-zero coefficient using an encoding code set in advance corresponding to the code variable and its code length; Preparation And wherein the Rukoto.

また、本発明の画像符号化装置は、画像をブロック単位に分割して符号化処理を行う画像符号化装置において、予測画像と原画像との残差成分を直交変換量子化して生成された係数を高周波成分からジグザグスキャン順に並べ替えて係数列を生成する係数列生成手段と、この係数列生成手段で生成された前記係数列を複数の分割係数列に分割し、これら分割係数列ごとに、各係数がゼロ係数であるか非ゼロ係数であるかに基づいて、前記ゼロ係数と前記非ゼロ係数の配置を特定するためのコード変数を算出するコード変数算出手段と、前記分割係数列ごとに、前記分割係数列の非ゼロ係数に続くゼロ係数の連続数を示すゼロラン数と、前記分割係数列の最初の非ゼロ係数以降のゼロ係数の数を示すゼロ数を、前記コード変数に対応して予め設定されている符号化コードとそのコード長とを用いて可変長符号化して符号化データを生成する符号化手段と、この符号化手段手段により生成された、すべての前記分割係数列についての前記符号化データを統合する統合手段とを備えることを特徴とする。   In addition, the image encoding device of the present invention is a coefficient generated by orthogonal transform quantization of the residual component between the predicted image and the original image in an image encoding device that performs encoding processing by dividing an image into blocks. The coefficient sequence generating means for rearranging the high-frequency components in zigzag scan order to generate a coefficient sequence, and dividing the coefficient sequence generated by the coefficient sequence generating means into a plurality of divided coefficient sequences, for each of these divided coefficient sequences, Based on whether each coefficient is a zero coefficient or a non-zero coefficient, a code variable calculation means for calculating a code variable for specifying the arrangement of the zero coefficient and the non-zero coefficient, and for each of the division coefficient sequences A zero-run number indicating the number of consecutive zero coefficients following the non-zero coefficient of the division coefficient sequence and a zero number indicating the number of zero coefficients after the first non-zero coefficient of the division coefficient sequence correspond to the code variable. In advance Encoding means for generating encoded data by variable length encoding using the encoded code and its code length, and the codes for all the division coefficient sequences generated by the encoding means means And integrating means for integrating the digitized data.

また、本発明の画像符号化プログラムは、画像をブロック単位に分割して符号化処理を行う画像符号化プログラムにおいて、予測画像と原画像との残差成分を直交変換量子化して生成された係数を高周波成分からジグザグスキャン順に並べ替えて係数列を生成するステップと、この係数列生成手段で生成された前記係数列における各係数がゼロ係数であるか非ゼロ係数であるかに基づいて、前記ゼロ係数と前記非ゼロ係数の配置を特定するためのコード変数を算出するステップと、前記係数列の非ゼロ係数に続くゼロ係数の連続数を示すゼロラン数と、前記係数列の最初の非ゼロ係数以降のゼロ係数の数を示すゼロ数を、前記コード変数に対応して予め設定されている符号化コードとそのコード長とを用いて可変長符号化するステップとをコンピュータに実行させることを特徴とする。   The image coding program of the present invention is a coefficient generated by orthogonal transform quantization of the residual component between the predicted image and the original image in an image coding program that performs coding processing by dividing the image into blocks. Reordering the high-frequency components in zigzag scan order to generate a coefficient sequence, and whether each coefficient in the coefficient sequence generated by the coefficient sequence generation means is a zero coefficient or a non-zero coefficient, Calculating a code variable for specifying a zero coefficient and the arrangement of the non-zero coefficient; a zero-run number indicating a continuous number of zero coefficients following the non-zero coefficient of the coefficient string; and a first non-zero of the coefficient string A step of performing variable length encoding on the number of zeros indicating the number of zero coefficients after the coefficient using a predetermined encoding code corresponding to the code variable and its code length. Characterized in that to execute the computer.

また、本発明の画像符号化プログラムは、画像をブロック単位に分割して符号化処理を行う画像符号化プログラムにおいて、予測画像と原画像との残差成分を直交変換量子化して生成された係数を高周波成分からジグザグスキャン順に並べ替えて係数列を生成するステップと、この係数列生成手段で生成された前記係数列を複数の分割係数列に分割し、これら分割係数列ごとに、各係数がゼロ係数であるか非ゼロ係数であるかに基づいて、前記ゼロ係数と前記非ゼロ係数の配置を特定するためのコード変数を算出するステップと、前記分割係数列ごとに、前記分割係数列の非ゼロ係数に続くゼロ係数の連続数を示すゼロラン数と、前記分割係数列の最初の非ゼロ係数以降のゼロ係数の数を示すゼロ数を、前記コード変数に対応して予め設定されている符号化コードとそのコード長とを用いて可変長符号化して符号化データを生成するステップと、この符号化手段手段により生成された、すべての前記分割係数列についての前記符号化データを統合するステップとをコンピュータに実行させることを特徴とする。   The image coding program of the present invention is a coefficient generated by orthogonal transform quantization of the residual component between the predicted image and the original image in an image coding program that performs coding processing by dividing the image into blocks. Generating a coefficient sequence by rearranging the high-frequency components in a zigzag scan order, and dividing the coefficient sequence generated by the coefficient sequence generation means into a plurality of divided coefficient sequences, and for each of the divided coefficient sequences, each coefficient is Calculating a code variable for specifying an arrangement of the zero coefficient and the non-zero coefficient based on whether the coefficient is a zero coefficient or a non-zero coefficient; A zero run number indicating the number of consecutive zero coefficients following the non-zero coefficient and a zero number indicating the number of zero coefficients after the first non-zero coefficient of the division coefficient sequence are set in advance corresponding to the code variable. Generating encoded data by variable-length encoding using the encoded code and its code length, and the encoded data for all the divided coefficient sequences generated by the encoding means means The step of integrating is executed by a computer.

本発明によれば、符号化する係数のゼロ係数と非ゼロ係数の配置を特定するためのコード変数を算出し、このコード変数に応じた個別の可変長符号化処理を行うので、係数の非ゼロ/ゼロ判定における条件判定文にかかる演算量や、符号化の際のテーブル参照にかかるメモリアクセスを削減することができ、係数の可変長符号化における演算量を削減し、符号化処理を高速化することができる。   According to the present invention, the code variable for specifying the arrangement of the zero coefficient and the non-zero coefficient of the coefficient to be encoded is calculated, and individual variable length encoding processing is performed according to the code variable. Reduces the amount of computation required for conditional judgment statements in zero / zero judgment and memory access required for table lookup during encoding, reduces the amount of computation required for variable-length coding of coefficients, and speeds up encoding processing Can be

以下、本発明を実施するための最良の形態について、図面を参照して説明する。   The best mode for carrying out the present invention will be described below with reference to the drawings.

(第1の実施の形態)
図1は本発明の第1の実施の形態に係る画像符号化装置の構成を示すブロック図である。図1に示すように、第1の実施の形態に係る画像符号化装置は、フレームメモリ1、演算器2、直交変換部3、量子化部4、可変長符号化部5、バッファ6、逆量子化部7、逆直交変換部8、演算器9、フレームメモリ10、動き検出部11、動き補償部12、画面内符号化部13、スイッチ14を備える。
(First embodiment)
FIG. 1 is a block diagram showing a configuration of an image coding apparatus according to the first embodiment of the present invention. As shown in FIG. 1, the image coding apparatus according to the first embodiment includes a frame memory 1, a computing unit 2, an orthogonal transform unit 3, a quantization unit 4, a variable length coding unit 5, a buffer 6, and an inverse. A quantization unit 7, an inverse orthogonal transform unit 8, a computing unit 9, a frame memory 10, a motion detection unit 11, a motion compensation unit 12, an intra-screen coding unit 13, and a switch 14 are provided.

フレームメモリ1は、入力画像信号を蓄積する。演算器2は、フレーム内符号化(以下、イントラ符号化という)が行われる場合、入力画像信号から画面内符号化部13により生成される予測信号を減算し、残差信号を求める。フレーム間符号化(以下、インター符号化という)が行われる場合、演算器2は、入力画像信号から動き補償部12により生成される予測信号を減算し、残差信号を求める。   The frame memory 1 stores input image signals. When intra-frame coding (hereinafter referred to as intra-coding) is performed, the computing unit 2 subtracts the prediction signal generated by the intra-frame coding unit 13 from the input image signal to obtain a residual signal. When inter-frame coding (hereinafter referred to as inter coding) is performed, the computing unit 2 subtracts the prediction signal generated by the motion compensation unit 12 from the input image signal to obtain a residual signal.

直交変換部3は、演算器2で生成された残差信号に離散コサイン変換等の直交変換を施す。量子化部4は、直交変換が施された変換係数の量子化処理を行う。可変長符号化部5は、量子化部4で生成された量子化データに可変長符号化を施し、符号化ビットストリームを出力する。   The orthogonal transform unit 3 performs orthogonal transform such as discrete cosine transform on the residual signal generated by the computing unit 2. The quantization unit 4 performs a quantization process on the transform coefficient subjected to the orthogonal transform. The variable length coding unit 5 performs variable length coding on the quantized data generated by the quantization unit 4 and outputs a coded bit stream.

逆量子化部7は、量子化部4で生成された量子化データの逆量子化を行う。逆直交変換部8は、逆量子化のなされたデータに逆直交変換を施し、復号された残差信号を出力する。   The inverse quantization unit 7 performs inverse quantization on the quantized data generated by the quantization unit 4. The inverse orthogonal transform unit 8 performs inverse orthogonal transform on the inversely quantized data and outputs a decoded residual signal.

演算器9は、イントラ符号化が行われる場合、逆直交変換部8からの復号された残差信号と、画面内符号化部13より供給される予測信号とを加算し、復号画像信号を生成する。また、インター符号化が行われる場合、演算器9は、逆直交変換部8からの復号された残差信号と、動き補償部12より供給される予測信号とを加算し、復号画像信号を生成する。フレームメモリ10は、演算器9からの復号画像信号を蓄積する。   When intra coding is performed, the arithmetic unit 9 adds the decoded residual signal from the inverse orthogonal transform unit 8 and the prediction signal supplied from the intra-screen coding unit 13 to generate a decoded image signal. To do. When inter coding is performed, the arithmetic unit 9 adds the decoded residual signal from the inverse orthogonal transform unit 8 and the prediction signal supplied from the motion compensation unit 12 to generate a decoded image signal. To do. The frame memory 10 stores the decoded image signal from the calculator 9.

動き検出部11は、フレームメモリ10を参照して動きベクトルを検出し、検出された動きベクトルを動き補償部12に供給する。動き補償部12、動きベクトルを用いて動き補償処理を行う。画面内符号化部13は、入力画像に対してフレーム内予測処理を行う。   The motion detection unit 11 detects a motion vector with reference to the frame memory 10 and supplies the detected motion vector to the motion compensation unit 12. The motion compensation unit 12 performs motion compensation processing using the motion vector. The intra-frame encoding unit 13 performs intra-frame prediction processing on the input image.

スイッチ14はポート14a,14b,14cを備え、ポート14b−14aが接続されたときには演算器2と画面内符号化部13とが接続され、ポート14c−14aが接続されたときには演算器2と動き補償部12とが接続される。   The switch 14 includes ports 14a, 14b, and 14c. When the port 14b-14a is connected, the computing unit 2 and the in-screen encoding unit 13 are connected. When the port 14c-14a is connected, the switch 14 operates. The compensation unit 12 is connected.

図2は図1に示す画像符号化装置の可変長符号化部の構成を示すブロック図である。図2に示すように可変長符号化部5は、ジグザグスキャン部51、コード変数算出部52、スイッチ53、符号化部54、ビット列生成部56、CAVLCテーブル57、制御部58を備える。また、符号化部54は、第1符号化部54a、第2符号化部54b、・・・、第n符号化部54nを備える。   FIG. 2 is a block diagram showing the configuration of the variable length coding unit of the image coding apparatus shown in FIG. As shown in FIG. 2, the variable length encoding unit 5 includes a zigzag scanning unit 51, a code variable calculation unit 52, a switch 53, an encoding unit 54, a bit string generation unit 56, a CAVLC table 57, and a control unit 58. The encoding unit 54 includes a first encoding unit 54a, a second encoding unit 54b,..., And an nth encoding unit 54n.

ジグザグスキャン部51は、量子化部4から出力される量子化された変換係数をジグザグスキャン順に並べ替える。   The zigzag scan unit 51 rearranges the quantized transform coefficients output from the quantization unit 4 in the zigzag scan order.

コード変数算出部52は、ジグザグスキャン部51で生成された係数列における各係数がゼロであるか非ゼロであるかに基づいて、ゼロ係数と非ゼロ係数の配置を特定するためのコード変数を算出する。スイッチ53は、コード変数算出部52で算出されたコード変数に応じて、係数列の出力先を切り替える。   The code variable calculation unit 52 determines a code variable for specifying the arrangement of the zero coefficient and the non-zero coefficient based on whether each coefficient in the coefficient sequence generated by the zigzag scan unit 51 is zero or non-zero. calculate. The switch 53 switches the output destination of the coefficient sequence according to the code variable calculated by the code variable calculation unit 52.

符号化部54の第1符号化部54a、第2符号化部54b、・・・、第n符号化部54nは、コード変数に対応して設けられ、それぞれ個別の可変長符号化処理を行う。ビット列生成部56は、符号化部54から出力される符号化コードとコード長とをビット列(符号化ビットストリーム)として生成し、生成したビット列をバッファ6に出力する。   The first encoding unit 54a, the second encoding unit 54b,..., The n-th encoding unit 54n of the encoding unit 54 are provided corresponding to the code variables, and each perform individual variable-length encoding processing. . The bit string generation unit 56 generates the encoded code and code length output from the encoding unit 54 as a bit string (encoded bit stream), and outputs the generated bit string to the buffer 6.

CAVLCテーブル57は、CAVLC(Context−Adaptive Variable Length Coding)で用いられるテーブルであり、先行1の数を符号化するためのテーブル、ゼロ数を符号化するためのテーブル、ゼロラン数を符号化するためのテーブルを含み、各テーブルには、符号化コードと、符号化コードの長さ(コード長)を示すデータとが保存されている。制御部58は、可変長符号化部5に設けられた各部を制御する。   The CAVLC table 57 is a table used in CAVLC (Context-Adaptive Variable Length Coding), a table for encoding the number of leading ones, a table for encoding zero numbers, and a number of zero runs. Each table stores an encoded code and data indicating the length (code length) of the encoded code. The control unit 58 controls each unit provided in the variable length coding unit 5.

次に、第1の実施の形態に係る画像符号化装置の動作を説明する。   Next, the operation of the image coding apparatus according to the first embodiment will be described.

入力された画像信号はフレームメモリ1に蓄えられ、フレーム内またはフレーム間の信号が符号化される。   The input image signal is stored in the frame memory 1, and a signal within or between frames is encoded.

イントラ符号化ではフレーム内の画像信号のみが独立して符号化され、インター符号化では、直前、直後のフレームを参照フレームとする予測信号が生成され、予測誤差が符号化される。   In intra coding, only the image signal in a frame is independently coded, and in inter coding, a prediction signal using the immediately preceding and immediately following frames as reference frames is generated, and a prediction error is encoded.

イントラ符号化においては、入力画像信号はフレームメモリ1に蓄えられた後、演算器2と画面内符号化部13とに入力され、画面内符号化部13により生成される予測信号はスイッチ14のポート14b−14aを介して演算器2に供給される。演算器2では、入力画像信号と画面内符号化部13により生成される予測信号との残差信号が求められ、得られた残差信号は直交変換部3に供給される。直交変換部3では、離散コサイン変換等の直交変換が施され、得られた変換係数が量子化部4に供給される。   In the intra coding, after the input image signal is stored in the frame memory 1, the input image signal is input to the computing unit 2 and the in-screen coding unit 13, and the prediction signal generated by the in-screen coding unit 13 is the switch 14. It is supplied to the computing unit 2 through the ports 14b-14a. In the arithmetic unit 2, a residual signal between the input image signal and the prediction signal generated by the intra-frame encoding unit 13 is obtained, and the obtained residual signal is supplied to the orthogonal transformation unit 3. In the orthogonal transform unit 3, orthogonal transform such as discrete cosine transform is performed, and the obtained transform coefficient is supplied to the quantization unit 4.

量子化部4では、変換係数の量子化がなされ、生成された量子化データは、可変長符号化部5に供給される。そして、可変長符号化部5で量子化データに可変長符号化が施された後、符号化ビットストリームが出力され、バッファ6へ保存または外部へ伝送される。   In the quantization unit 4, the transform coefficient is quantized, and the generated quantized data is supplied to the variable length coding unit 5. Then, after the variable length coding unit 5 performs variable length coding on the quantized data, the coded bit stream is output and stored in the buffer 6 or transmitted to the outside.

また、量子化部4で生成された量子化データは、逆量子化部7に供給されて逆量子化がなされ、その逆量子化のなされたデータは逆直交変換部8に供給されて逆直交変換が施され、復号された残差信号となる。   The quantized data generated by the quantizing unit 4 is supplied to the inverse quantizing unit 7 for inverse quantization, and the dequantized data is supplied to the inverse orthogonal transform unit 8 for inverse orthogonality. Conversion is performed and a decoded residual signal is obtained.

逆直交変換部8で得られた復号された残差信号は、演算器9に供給され、画面内符号化部13より供給される予測信号が加算されて復号画像信号となり、フレームメモリ10に蓄積される。   The decoded residual signal obtained by the inverse orthogonal transform unit 8 is supplied to the arithmetic unit 9, and the prediction signal supplied from the in-screen encoding unit 13 is added to form a decoded image signal, which is stored in the frame memory 10. Is done.

一方、インター符号化においては、まず、入力画像信号が動き検出部11に入力される。動き検出部11では、フレームメモリ10を参照して動きベクトルを検出し、検出された動きベクトルは動き補償部12に供給される。動き補償部12では、動きベクトルを用いて動き補償処理が行われ、予測信号が生成される。   On the other hand, in inter coding, first, an input image signal is input to the motion detection unit 11. The motion detection unit 11 detects a motion vector with reference to the frame memory 10, and the detected motion vector is supplied to the motion compensation unit 12. The motion compensation unit 12 performs a motion compensation process using the motion vector, and generates a prediction signal.

この予測信号は、スイッチ14のポート14c−14aを介して演算器2に供給される。演算器2では、入力画像信号と動き補償部12により生成される予測信号との残差信号が求められ、得られた残差信号は直交変換部3に供給される。直交変換部3では、離散コサイン変換等の直交変換が施され、得られた変換係数が量子化部4に供給される。   This prediction signal is supplied to the computing unit 2 via the ports 14c-14a of the switch 14. In the computing unit 2, a residual signal between the input image signal and the prediction signal generated by the motion compensation unit 12 is obtained, and the obtained residual signal is supplied to the orthogonal transformation unit 3. In the orthogonal transform unit 3, orthogonal transform such as discrete cosine transform is performed, and the obtained transform coefficient is supplied to the quantization unit 4.

量子化部4では、変換係数の量子化がなされ、生成された量子化データは、可変長符号化部5に供給される。そして、可変長符号化部5で量子化データに可変長符号化が施された後、符号化ビットストリームが出力され、バッファ6へ保存または外部へ伝送される。   In the quantization unit 4, the transform coefficient is quantized, and the generated quantized data is supplied to the variable length coding unit 5. Then, after the variable length coding unit 5 performs variable length coding on the quantized data, the coded bit stream is output and stored in the buffer 6 or transmitted to the outside.

また、量子化部4で生成された量子化データは、逆量子化部7に供給されて逆量子化がなされ、その逆量子化のなされたデータは逆直交変換部8に供給されて逆直交変換が施され、復号された残差信号となる。   The quantized data generated by the quantizing unit 4 is supplied to the inverse quantizing unit 7 for inverse quantization, and the dequantized data is supplied to the inverse orthogonal transform unit 8 for inverse orthogonality. Conversion is performed and a decoded residual signal is obtained.

逆直交変換部8で得られた復号された残差信号は、演算器9に供給され、動き補償部12より供給される予測信号が加算されて復号画像信号となり、フレームメモリ10に蓄積される。   The decoded residual signal obtained by the inverse orthogonal transform unit 8 is supplied to the arithmetic unit 9, and the prediction signal supplied from the motion compensation unit 12 is added to form a decoded image signal, which is accumulated in the frame memory 10. .

次に、可変長符号化部5における係数の可変長符号化処理について説明する。図4は図2に示す可変長符号化部5における可変長符号化処理を説明するためのフローチャートである。   Next, the variable length coding process of coefficients in the variable length coding unit 5 will be described. FIG. 4 is a flowchart for explaining variable length coding processing in the variable length coding unit 5 shown in FIG.

まずステップS210において、制御部58は、係数の非ゼロ位置情報を示す16ビットのコード変数を用意し、これを0に初期化するようにコード変数算出部52を制御する。図5はコード変数を説明するための図である。図5(a)に示すジグザグスキャン後の係数列に対して、図5(b)に示すように、各ビットの0/1を係数のゼロ/非ゼロに対応させる。   First, in step S210, the control unit 58 prepares a 16-bit code variable indicating the non-zero position information of the coefficient, and controls the code variable calculation unit 52 to initialize it to zero. FIG. 5 is a diagram for explaining code variables. For the coefficient sequence after the zigzag scan shown in FIG. 5A, as shown in FIG. 5B, 0/1 of each bit is made to correspond to the coefficient zero / non-zero.

次に、ステップS220では、制御部58は、量子化部4から入力される係数を、高周波成分からジグザグスキャン順に並べ替えるようにジグザグスキャン部51を制御する。   Next, in step S220, the control unit 58 controls the zigzag scanning unit 51 so that the coefficients input from the quantization unit 4 are rearranged in the zigzag scanning order from the high frequency components.

そして、制御部58は、各係数C00´〜C15´について判定を行うようにコード変数算出部52を制御する(ステップS230)。1つの係数のループについて説明すると、まず、ステップS240において、コード変数算出部52は、その係数が非ゼロ係数かゼロ係数かを判定し、ゼロ係数でない(ステップS240:NO)場合は、ステップS250において、コードのビットをONにする。ゼロ係数である(ステップS240:YES)場合はコードのビットをONせず、ループを終了する(ステップS260)。 Then, the control unit 58 controls the code variable calculation unit 52 to perform determination for each coefficient C 00'~C 15 '(step S230). The loop of one coefficient will be described. First, in step S240, the code variable calculation unit 52 determines whether the coefficient is a non-zero coefficient or a zero coefficient. If the coefficient is not a zero coefficient (step S240: NO), step S250 is performed. In FIG. 5, the bit of the code is turned ON. If the coefficient is zero (step S240: YES), the code bit is not turned on, and the loop is terminated (step S260).

これにより、16個の係数の非ゼロ位置情報が16ビットのコード変数で表現できる。図5(c)に示すように、係数C15´のみが非ゼロ係数である場合はコード=1、係数C14´のみが非ゼロ係数である場合はコード=2となる。 Thereby, the non-zero position information of 16 coefficients can be expressed by a 16-bit code variable. As shown in FIG. 5C, code = 1 when only the coefficient C 15 ′ is a non-zero coefficient, and code = 2 when only the coefficient C 14 ′ is a non-zero coefficient.

次に、S270では、制御部58は、コード変数算出部52で算出したコード変数がいくつであるかを判断し、ジグザグスキャン部51からコード変数算出部52を介して出力される係数列の出力先を切り替えるようにスイッチ53を制御する。   Next, in S <b> 270, the control unit 58 determines how many code variables are calculated by the code variable calculation unit 52, and outputs a coefficient sequence output from the zigzag scanning unit 51 via the code variable calculation unit 52. The switch 53 is controlled to switch the destination.

そして、制御部58は、例えば、コード=0の場合は第1符号化部54a、コード=1の場合は第2符号化部54bに係数列を出力し、個別の可変長符号化処理を行わせる(ステップS280a,S280b,・・・)。   Then, for example, the control unit 58 outputs the coefficient sequence to the first encoding unit 54a when the code = 0 and the second encoding unit 54b when the code = 1, and performs individual variable length encoding processing. (Steps S280a, S280b,...).

ここで、コード=1の場合の第2符号化部54bにおける可変長符号化処理について説明する。コード=1となるのは、図6に示すように、係数C15´のみが非ゼロ係数である場合である。図7は第2符号化部54bにおける可変長符号化処理を説明するためのフローチャートである。 Here, the variable length encoding process in the second encoding unit 54b in the case of code = 1 will be described. The code = 1 is when only the coefficient C 15 ′ is a non-zero coefficient as shown in FIG. FIG. 7 is a flowchart for explaining variable-length encoding processing in the second encoding unit 54b.

まず、ステップS310において、第2符号化部54bは、係数C15´の係数値(レベル値)の絶対値が1であるかどうかを判定する。H.264/AVCでは、非ゼロ係数の最初に連続する絶対値1の係数の数(先行1の数)を符号化することによって符号化効率を上げているので、この判定が必要となる。 First, in step S310, the second encoding unit 54b determines whether or not the absolute value of the coefficient value (level value) of the coefficient C 15 ′ is 1. H. In H.264 / AVC, the encoding efficiency is increased by encoding the number of coefficients of the absolute value 1 that are consecutive at the beginning of the non-zero coefficient (the number of leading 1s), so this determination is necessary.

係数C15´のレベル値の絶対値が1である(ステップS310:YES)場合、ステップS320において、第2符号化部54bは、CAVLCテーブル57を参照して、先行1の数を符号化するためのテーブルに規定されている先行1の数=1に対応する符号化コードを、テーブルに規定のコード長で出力する。また、第2符号化部54bは、係数C15´の正負の符号についても符号化して符号化コードを出力する。 When the absolute value of the level value of the coefficient C 15 ′ is 1 (step S310: YES), in step S320, the second encoding unit 54b refers to the CAVLC table 57 and encodes the number of leading 1s. For this reason, an encoded code corresponding to the number of leading 1s = 1 defined in the table for output is output to the table with a specified code length. The second encoding unit 54b also encodes the positive and negative signs of the coefficient C 15 ′ and outputs an encoded code.

係数C15´のレベル値の絶対値が1でない(ステップS310:NO)場合、ステップS330において、第2符号化部54bは、CAVLCテーブル57を参照して、先行1の数を符号化するためのテーブルに規定されている先行1の数=0に対応する符号化コードを、テーブルに規定のコード長で出力する。その後、ステップS340では、第2符号化部54bは、係数C15´のレベル値を符号化して符号化コードを出力する。 When the absolute value of the level value of the coefficient C 15 ′ is not 1 (step S310: NO), in step S330, the second encoding unit 54b refers to the CAVLC table 57 to encode the number of the preceding 1s. The encoded code corresponding to the number of leading 1s = 0 defined in the table is output to the table with a specified code length. Then, in step S340, the second encoding unit 54b is to encode the level value of the coefficient C 15 'and outputs the encoded code.

次に、ステップS350において、第2符号化部54bは、ゼロラン数を符号化して符号化コードを出力するが、コード=1の場合は、ゼロラン数の符号化コードは出力不要である。   Next, in step S350, the second encoding unit 54b encodes the zero-run number and outputs an encoded code. However, if the code = 1, the zero-run number encoded code is not required to be output.

そして、ステップS360において、第2符号化部54bは、ゼロ数(=0)に対応して予め設定されている符号化コード(=1)を、予め設定されているコード長(=1ビット)で出力する。   Then, in step S360, the second encoding unit 54b converts the preset encoding code (= 1) corresponding to the zero number (= 0) to the preset code length (= 1 bit). To output.

その後、ビット列生成部56は、第2符号化部54bから出力された符号化コードとコード長とをビット列(符号化ビットストリーム)として生成し、生成したビット列をバッファ6に出力する。   Thereafter, the bit string generation unit 56 generates the encoded code and code length output from the second encoding unit 54 b as a bit string (encoded bit stream), and outputs the generated bit string to the buffer 6.

ここで、従来の可変長符号化処理においては、ゼロラン数、ゼロ数を符号化して出力する際、CAVLCテーブルを参照していた。図8はCAVLCにおいてゼロ数を符号化するために用いられるテーブルを示す図である。   Here, in the conventional variable length encoding process, when the zero run number and the zero number are encoded and output, the CAVLC table is referred to. FIG. 8 shows a table used for encoding zero numbers in CAVLC.

従来の可変長符号化処理では、例えばゼロ数が0、非ゼロ係数の個数が1のとき、図8に示すテーブルを参照して、符号化コード=1、コード長=1ビットを取得していた。第1の実施の形態の画像符号化装置では、第2符号化部54bに、ゼロ数(=0)に対応して符号化コード(=1)、コード長(=1ビット)が予め設定されているため、テーブルを参照する必要がない。ゼロラン数についても同様に、符号化コード、コード長が予め設定され、テーブルを参照することなく符号化することができる。   In the conventional variable length encoding process, for example, when the number of zeros is 0 and the number of non-zero coefficients is 1, the encoding code = 1 and the code length = 1 bit are obtained with reference to the table shown in FIG. It was. In the image encoding device according to the first embodiment, the encoding code (= 1) and the code length (= 1 bit) are set in advance in the second encoding unit 54b corresponding to the number of zeros (= 0). Because there is no need to refer to the table. Similarly, for the zero-run number, an encoding code and a code length are set in advance, and encoding can be performed without referring to a table.

次に、コード=2の場合の第3符号化部54cにおける可変長符号化処理について説明する。コード=2となるのは、図9に示すように、係数C14´のみが非ゼロ係数である場合である。図10は第3符号化部54cにおける可変長符号化処理を説明するためのフローチャートである。 Next, the variable length encoding process in the third encoding unit 54c in the case of code = 2 will be described. The code = 2 is the case where only the coefficient C 14 ′ is a non-zero coefficient as shown in FIG. FIG. 10 is a flowchart for explaining variable-length encoding processing in the third encoding unit 54c.

まず、ステップS410において、第3符号化部54cは、係数C14´のレベル値の絶対値が1であるかどうかを判定する。 First, in step S410, the third encoding unit 54c determines whether or not the absolute value of the level value of the coefficient C 14 ′ is 1.

係数C14´のレベル値の絶対値が1である(ステップS410:YES)場合、ステップS420において、第3符号化部54cは、CAVLCテーブル57を参照して、先行1の数を符号化するためのテーブルに規定されている先行1の数=1に対応する符号化コードを、テーブルに規定のコード長で出力する。また、第3符号化部54cは、係数C14´の正負の符号についても符号化して符号化コードを出力する。 If the absolute value of the level value of the coefficient C 14 ′ is 1 (step S410: YES), in step S420, the third encoding unit 54c refers to the CAVLC table 57 and encodes the number of the preceding 1s. For this reason, an encoded code corresponding to the number of leading 1s = 1 defined in the table for output is output to the table with a specified code length. The third encoding unit 54c also encodes the positive and negative signs of the coefficient C 14 ′ and outputs an encoded code.

係数C14´のレベル値の絶対値が1でない(ステップS410:NO)場合、ステップS430において、第3符号化部54cは、CAVLCテーブル57を参照して、先行1の数を符号化するためのテーブルに規定されている先行1の数=0に対応する符号化コードを、テーブルに規定のコード長で出力する。その後、ステップS440では、第3符号化部54cは、係数C14´のレベル値を符号化して符号化コードを出力する。 When the absolute value of the level value of the coefficient C 14 ′ is not 1 (step S410: NO), in step S430, the third encoding unit 54c refers to the CAVLC table 57 to encode the number of the preceding 1s. The encoded code corresponding to the number of leading 1s = 0 defined in the table is output to the table with a specified code length. Thereafter, in step S440, the third encoding unit 54c encodes the level value of the coefficient C 14 ′ and outputs an encoded code.

次に、ステップS450において、第3符号化部54cは、ゼロラン数(=1)に対応して予め設定されている符号化コードを、予め設定されているコード長で出力する。そして、ステップS460において、第3符号化部54cは、ゼロ数(=1)に対応して予め設定されている符号化コードを、予め設定されているコード長で出力する。   Next, in step S450, the third encoding unit 54c outputs an encoding code set in advance corresponding to the number of zero runs (= 1) with a code length set in advance. In step S460, the third encoding unit 54c outputs an encoding code set in advance corresponding to the number of zeros (= 1) with a code length set in advance.

次に、コード=11の場合の第12符号化部54lにおける可変長符号化処理について説明する。コード=11となるのは、図11に示すように、係数C12´,C14´,C15´が非ゼロ係数である場合である。図12は第12符号化部54lにおける可変長符号化処理を説明するためのフローチャートである。 Next, the variable length encoding process in the twelfth encoding unit 54l in the case of code = 11 will be described. The code = 11 is a case where the coefficients C 12 ′, C 14 ′, and C 15 ′ are non-zero coefficients as shown in FIG. FIG. 12 is a flowchart for explaining variable-length encoding processing in the twelfth encoding unit 54l.

まず、ステップS510において、第12符号化部54lは、係数C12´のレベル値の絶対値が1であるかどうかを判定する。 First, in step S510, the twelfth encoding unit 54l determines whether or not the absolute value of the level value of the coefficient C 12 ′ is 1.

係数C12´のレベル値の絶対値が1である(ステップS510:YES)場合、ステップS520に進む。係数C12´のレベル値の絶対値が1でない(ステップS510:NO)場合、ステップS590において、第12符号化部54lは、CAVLCテーブル57を参照して、先行1の数を符号化するためのテーブルに規定されている先行1の数=0に対応する符号化コードを、テーブルに規定のコード長で出力する。その後、ステップS600では、第12符号化部54lは、係数C12´,C14´,C15´のレベル値をそれぞれ符号化して符号化コードを出力する。 When the absolute value of the level value of the coefficient C 12 ′ is 1 (step S510: YES), the process proceeds to step S520. When the absolute value of the level value of the coefficient C 12 ′ is not 1 (step S510: NO), in step S590, the twelfth encoding unit 54l refers to the CAVLC table 57 to encode the number of leading 1s. The encoded code corresponding to the number of leading 1s = 0 defined in the table is output to the table with a specified code length. Then, in step S600, the 12 encoding unit 54l includes coefficients C 12 ', C 14', and which encoded the level value of C 15 'outputs the encoded code.

次に、ステップS520において、第12符号化部54lは、係数C14´のレベル値の絶対値が1であるかどうかを判定する。 Next, in Step S520, the twelfth encoding unit 54l determines whether or not the absolute value of the level value of the coefficient C 14 ′ is 1.

係数C14´のレベル値の絶対値が1である(ステップS520:YES)場合、ステップS530に進む。係数C14´のレベル値の絶対値が1でない(ステップS520:NO)場合、ステップS570において、第12符号化部54lは、CAVLCテーブル57を参照して、先行1の数を符号化するためのテーブルに規定されている先行1の数=1に対応する符号化コードを、テーブルに規定のコード長で出力する。その後、ステップS580では、第12符号化部54lは、係数C14´,C15´のレベル値をそれぞれ符号化して符号化コードを出力する。 When the absolute value of the level value of the coefficient C 14 ′ is 1 (step S520: YES), the process proceeds to step S530. When the absolute value of the level value of the coefficient C 14 ′ is not 1 (step S520: NO), in step S570, the twelfth encoding unit 54l refers to the CAVLC table 57 and encodes the number of the preceding one. The encoded code corresponding to the number of leading 1s = 1 defined in the table is output to the table with the defined code length. Then, in step S580, the 12 encoding unit 54l includes coefficients C 14 ', C 15' to each coding level values of outputting the encoded code.

次に、ステップS530において、第12符号化部54lは、係数C15´のレベル値の絶対値が1であるかどうかを判定する。 Next, in Step S530, the twelfth encoding unit 54l determines whether or not the absolute value of the level value of the coefficient C 15 ′ is 1.

係数C15´のレベル値の絶対値が1である(ステップS530:YES)場合、ステップS540に進む。係数C14´のレベル値の絶対値が1でない(ステップS530:NO)場合、ステップS550において、第12符号化部54lは、CAVLCテーブル57を参照して、先行1の数を符号化するためのテーブルに規定されている先行1の数=2に対応する符号化コードを、テーブルに規定のコード長で出力する。その後、ステップS560では、第12符号化部54lは、係数C14´のレベル値を符号化して出力する。 When the absolute value of the level value of the coefficient C 15 ′ is 1 (step S530: YES), the process proceeds to step S540. When the absolute value of the level value of the coefficient C 14 ′ is not 1 (step S530: NO), in step S550, the twelfth encoding unit 54l refers to the CAVLC table 57 and encodes the number of the preceding one. The encoded code corresponding to the number of leading 1s = 2 defined in the table is output to the table with the defined code length. Thereafter, in step S560, the twelfth encoding unit 54l encodes and outputs the level value of the coefficient C 14 ′.

次いで、ステップS540において、第12符号化部54lは、CAVLCテーブル57を参照して、先行1の数を符号化するためのテーブルに規定されている先行1の数=3に対応する符号化コードを、テーブルに規定のコード長で出力する。   Next, in step S540, the twelfth encoding unit 54l refers to the CAVLC table 57, and encodes the encoding code corresponding to the number of leading 1s = 3 specified in the table for encoding the number of leading 1s. Is output to the table with the specified code length.

次に、ステップS610において、第12符号化部54lは、ゼロラン数に対応して予め設定されている符号化コードを、予め設定されているコード長で出力する。そして、ステップS620において、第12符号化部54lは、ゼロ数に対応して予め設定されている符号化コードを、予め設定されているコード長で出力する。   Next, in step S610, the twelfth encoding unit 54l outputs an encoding code set in advance corresponding to the number of zero runs with a code length set in advance. In step S620, the twelfth encoding unit 54l outputs an encoding code set in advance corresponding to the number of zeros with a code length set in advance.

このように、第1の実施の形態によれば、係数の可変長符号化を行う際に、係数と非ゼロ係数の配置を特定するためのコード変数を算出し、このコード変数に対応する個別の符号化処理を行うので、コード変数により非ゼロ係数の位置やゼロラン数が確定し、非ゼロ係数の位置情報やゼロ係数の連続数を取得するための演算量を削減することができる。また、ゼロラン数、ゼロ数を符号化して出力する際にCAVLCテーブルを参照する必要がなく、テーブル参照の回数を減らすことができ、符号化処理を高速化することができる。   Thus, according to the first embodiment, when variable-length coding of coefficients is performed, code variables for specifying the arrangement of coefficients and non-zero coefficients are calculated, and individual codes corresponding to the code variables are calculated. Thus, the position of the non-zero coefficient and the number of zero runs are determined by the code variable, and the amount of calculation for obtaining the position information of the non-zero coefficient and the number of consecutive zero coefficients can be reduced. Further, it is not necessary to refer to the CAVLC table when the zero run number and the zero number are encoded and output, the number of table references can be reduced, and the encoding process can be speeded up.

ところで、係数が16個ある場合にはコード変数は16ビットの値となり、0〜65535の範囲の値を持つ。しかし、このすべてのパターンについて個別の符号化処理を行うようにするのは困難である。そこで、直交変換の性質から係数が低周波成分に集中することを利用して、頻度の高いパターンのみについて個別の符号化処理を行うことが可能である。例えば、C12´〜C15´のみに非ゼロ係数が分布する場合のみ個別の符号化処理を行うようにすることができる。 By the way, when there are 16 coefficients, the code variable has a 16-bit value and has a value in the range of 0 to 65535. However, it is difficult to perform individual encoding processing for all the patterns. In view of this, it is possible to perform individual encoding processing for only frequently occurring patterns by using the fact that coefficients are concentrated on low frequency components due to the nature of orthogonal transform. For example, individual encoding processing can be performed only when non-zero coefficients are distributed only in C 12 ′ to C 15 ′.

図3は第1の実施の形態に係る画像符号化装置の変形例の可変長符号化部の構成を示すブロック図である。図3に示すように可変長符号化部5aは、図2に示す可変長符号化部5に対し、符号化部54を符号化部55に置き換えた構成である。符号化部55は、第1符号化部54a、第2符号化部54b、・・・、第16符号化部54p、範囲外符号化部55aを備える。   FIG. 3 is a block diagram showing a configuration of a variable length coding unit of a modification of the image coding apparatus according to the first embodiment. As shown in FIG. 3, the variable length encoding unit 5 a has a configuration in which the encoding unit 54 is replaced with an encoding unit 55 with respect to the variable length encoding unit 5 shown in FIG. 2. The encoding unit 55 includes a first encoding unit 54a, a second encoding unit 54b,..., A sixteenth encoding unit 54p, and an out-of-range encoding unit 55a.

可変長符号化部5aでは、例えば、C12´〜C15´のみに非ゼロ係数が分布する場合、つまりコード変数が0〜15である場合、第1符号化部54a、第2符号化部54b、・・・、第16符号化部54pにおいて、上記に説明したような個別の可変長符号化処理を行う。コード変数が15より大きい値である場合は、範囲外符号化部55aにおいて、図16のフローチャートに示した従来の符号化処理の手順で可変長符号化処理が行われる。 In the variable length coding unit 5a, for example, C 12'~C 15 'only if the non-zero coefficients are distributed, that is, if the code variable is 0-15, the first encoding unit 54a, a second encoding unit 54b,..., The 16th encoding unit 54p performs individual variable length encoding processing as described above. If the code variable is larger than 15, the out-of-range encoding unit 55a performs variable length encoding processing according to the conventional encoding processing procedure shown in the flowchart of FIG.

非ゼロ係数が低周波に集中する場合、例えば低レート符号化やインター符号化では、この変形例の画像符号化装置により、符号化処理を高速に行うことができる。   When non-zero coefficients are concentrated in a low frequency, for example, in low-rate encoding or inter-encoding, the encoding process can be performed at high speed by the image encoding device of this modification.

(第2の実施の形態)
次に、第2の実施の形態について説明する。第2の実施の形態に係る画像符号化装置の構成は、図1に示す第1の実施の形態に係る画像符号化装置の構成と同様である。
(Second Embodiment)
Next, a second embodiment will be described. The configuration of the image encoding device according to the second embodiment is the same as the configuration of the image encoding device according to the first embodiment shown in FIG.

図13は第2の実施の形態に係る画像符号化装置の可変長符号化部の構成を示すブロック図である。図13に示すように可変長符号化部5bは、ジグザグスキャン部61、コード変数算出部62、スイッチ63、符号化部64、ビット列生成部65、ビット列格納部66、ビット列統合部67、CAVLCテーブル68、制御部69を備える。また、符号化部64は、第1符号化部64a、第2符号化部64b、・・・、第16符号化部64pを備える。   FIG. 13 is a block diagram showing the configuration of the variable length coding unit of the image coding apparatus according to the second embodiment. As shown in FIG. 13, the variable length encoding unit 5b includes a zigzag scanning unit 61, a code variable calculation unit 62, a switch 63, an encoding unit 64, a bit string generation unit 65, a bit string storage unit 66, a bit string integration unit 67, and a CAVLC table. 68 and a control unit 69. The encoding unit 64 includes a first encoding unit 64a, a second encoding unit 64b, ..., and a sixteenth encoding unit 64p.

ジグザグスキャン部61は、量子化部4から出力される量子化された変換係数をジグザグスキャン順に並べ替える。   The zigzag scan unit 61 rearranges the quantized transform coefficients output from the quantization unit 4 in the zigzag scan order.

コード変数算出部62は、ジグザグスキャン部61で生成された係数列を複数の分割係数列に分割し、分割係数列ごとに、各係数がゼロであるか非ゼロであるかに基づいて、ゼロ係数と非ゼロ係数の配置を特定するためのコード変数を算出する。スイッチ63は、コード変数算出部62で算出されたコード変数に応じて、係数列の出力先を切り替える。   The code variable calculation unit 62 divides the coefficient sequence generated by the zigzag scanning unit 61 into a plurality of division coefficient sequences, and determines zero for each division coefficient sequence based on whether each coefficient is zero or non-zero. A code variable for specifying the arrangement of coefficients and non-zero coefficients is calculated. The switch 63 switches the output destination of the coefficient sequence according to the code variable calculated by the code variable calculation unit 62.

符号化部64の第1符号化部64a、第2符号化部64b、・・・、第16符号化部64pは、コード変数に対応して設けられ、それぞれ個別の可変長符号化処理を行う。ビット列生成部65は、符号化部64から出力される符号化コードとコード長とをビット列として生成し、生成したビット列をビット列格納部66に出力する。   The first encoding unit 64a, the second encoding unit 64b,..., And the sixteenth encoding unit 64p of the encoding unit 64 are provided corresponding to the code variables, and each perform individual variable length encoding processing. . The bit string generation unit 65 generates the encoded code and code length output from the encoding unit 64 as a bit string, and outputs the generated bit string to the bit string storage unit 66.

ビット列格納部66は、ビット列生成部65生成された分割係数列ごとのビット列を格納する。ビット列統合部67は、ビット列格納部66に格納された、すべての分割係数列についてのビット列を統合し、統合したビット列(符号化ビットストリーム)をバッファ6へ出力する。   The bit string storage unit 66 stores a bit string for each division coefficient string generated by the bit string generation unit 65. The bit string integration unit 67 integrates the bit strings for all the divided coefficient strings stored in the bit string storage unit 66 and outputs the integrated bit string (encoded bit stream) to the buffer 6.

CAVLCテーブル68は、CAVLCで用いられるテーブルであり、先行1の数を符号化するためのテーブル、ゼロ数を符号化するためのテーブル、ゼロラン数を符号化するためのテーブルを含み、各テーブルには、符号化コードと、符号化コードの長さ(コード長)を示すデータとが保存されている。制御部69は、可変長符号化部5bに設けられた各部を制御する。   The CAVLC table 68 is a table used in CAVLC, and includes a table for encoding the number of leading 1s, a table for encoding the number of zeros, and a table for encoding the number of zero runs. Stores an encoded code and data indicating the length of the encoded code (code length). The control unit 69 controls each unit provided in the variable length coding unit 5b.

次に、可変長符号化部5bにおける係数の可変長符号化処理について説明する。以下、16個の係数を含む係数列を、4個の係数からなる4つの分割係数列に分割する例について説明するが、分割数はこれに限らない。   Next, the variable length coding process of coefficients in the variable length coding unit 5b will be described. Hereinafter, an example in which a coefficient sequence including 16 coefficients is divided into four division coefficient sequences including four coefficients will be described, but the number of divisions is not limited thereto.

図15は図13に示す可変長符号化部5bにおける可変長符号化処理を説明するためのフローチャートである。まずステップS710において、制御部69は、係数の非ゼロ位置情報を示す16ビットのコード変数を用意し、これを0に初期化するようにコード変数算出部62を制御する。   FIG. 15 is a flowchart for explaining the variable-length encoding process in the variable-length encoding unit 5b shown in FIG. First, in step S710, the control unit 69 prepares a 16-bit code variable indicating the non-zero position information of the coefficient, and controls the code variable calculation unit 62 to initialize it to zero.

次に、ステップS720では、制御部69は、量子化部4から入力される係数を、高周波成分からジグザグスキャン順に並べ替えるようにジグザグスキャン部61を制御する。   Next, in step S720, the control unit 69 controls the zigzag scanning unit 61 so that the coefficients input from the quantization unit 4 are rearranged in the zigzag scanning order from the high frequency component.

そして、制御部69は、各係数C00´〜C15´を、図14に示すように、上位から4個の係数からなる4つの分割係数列に分割し、各分割係数列の係数について判定を行うようにコード変数算出部62を制御する(ステップS730,S740)。ループ2は分割係数列についてのループであり、ループ1は各分割係数列の係数についてのループである。 Then, the control unit 69 divides each coefficient C 00 ′ to C 15 ′ into four divided coefficient sequences composed of the top four coefficients as shown in FIG. 14 and determines the coefficients of each divided coefficient sequence. The code variable calculation unit 62 is controlled so as to perform (steps S730 and S740). Loop 2 is a loop for the division coefficient sequence, and loop 1 is a loop for the coefficient of each division coefficient sequence.

ループ1における1つの係数のループについて説明すると、まず、ステップS750において、コード変数算出部62は、その係数が非ゼロ係数かゼロ係数かを判定し、ゼロ係数でない(ステップS750:NO)場合は、ステップS760において、コードのビットをONにする。ゼロ係数である(ステップS750:YES)場合はコードのビットをONせず、ループ1を終了する(ステップS770)。   The loop of one coefficient in the loop 1 will be described. First, in step S750, the code variable calculation unit 62 determines whether the coefficient is a non-zero coefficient or a zero coefficient, and if it is not a zero coefficient (step S750: NO) In step S760, the code bit is turned ON. If the coefficient is zero (step S750: YES), the code bit is not turned ON, and the loop 1 is terminated (step S770).

これにより、1つの分割係数列について、4個の係数の非ゼロ位置情報が4ビットのコード変数で表現できる。図14に示すように、例えば、最初の分割係数列について、係数C01´のみが非ゼロ係数である場合はコード=4となる。 As a result, the non-zero position information of the four coefficients can be expressed by a 4-bit code variable for one divided coefficient sequence. As shown in FIG. 14, for example, when only the coefficient C 01 ′ is a non-zero coefficient for the first divided coefficient sequence, code = 4.

次に、S780では、制御部69は、コード変数算出部62で算出したコード変数がいくつであるかを判断し、ジグザグスキャン部61からコード変数算出部62を介して出力される分割係数列の出力先を切り替えるようにスイッチ63を制御する。   Next, in S780, the control unit 69 determines how many code variables are calculated by the code variable calculation unit 62, and the division coefficient sequence output from the zigzag scanning unit 61 via the code variable calculation unit 62 is determined. The switch 63 is controlled to switch the output destination.

そして、制御部69は、例えば、コード=0の場合は第1符号化部54a、コード=1の場合は第2符号化部54bに係数列を出力し、個別の可変長符号化処理を行わせる(ステップS790a,S790b,・・・)。ここで、第1符号化部54a、第2符号化部54b、・・・における符号化処理は、第1の実施の形態で説明した手順と同様に行われる。   Then, for example, the control unit 69 outputs a coefficient sequence to the first encoding unit 54a when the code = 0 and to the second encoding unit 54b when the code = 1, and performs individual variable length encoding processing. (Steps S790a, S790b,...). Here, the encoding process in the first encoding unit 54a, the second encoding unit 54b,... Is performed in the same manner as the procedure described in the first embodiment.

その後、ビット列生成部65は、符号化部64から出力された符号化コードとコード長とをビット列(符号化ビットストリーム)として生成し、生成したビット列をビット列格納部66に出力する。ここで、ゼロラン数は分割係数列間にまたがるデータであるため、ステップS800において、各分割係数列の符号化処理が終わる毎にデータの更新を行い、ループ2を終了する(ステップS810)。   Thereafter, the bit string generation unit 65 generates the encoded code and code length output from the encoding unit 64 as a bit string (encoded bit stream), and outputs the generated bit string to the bit string storage unit 66. Here, since the zero-run number is data extending between the divided coefficient sequences, in step S800, the data is updated every time encoding processing of each divided coefficient sequence is completed, and the loop 2 is ended (step S810).

ループ2が分割数分(4回)終了すると、ステップS820において、制御部69は、ビット列格納部66に格納された、すべての分割係数列についてのビット列を符号化処理の順序に従って統合し、統合したビット列(符号化ビットストリーム)をバッファ6へ出力するようにビット列格納部66を制御する。   When the loop 2 is completed for the number of divisions (four times), in step S820, the control unit 69 integrates the bit sequences for all the divided coefficient sequences stored in the bit sequence storage unit 66 according to the order of the encoding process. The bit string storage unit 66 is controlled to output the bit string (encoded bit stream) to the buffer 6.

高レート符号化やイントラ符号化では非ゼロ係数の分布が広がるので、第1の実施の形態に係る画像符号化装置では十分な高速化の効果が得られない場合がある。第2の実施の形態では、係数列を上位より任意の数に分割して可変長符号化処理を行うので、非ゼロ係数が多く含まれる係数列においても演算量を削減することができ、高速な符号化処理が可能となる。   Since the distribution of non-zero coefficients is widened in high-rate coding or intra coding, the image coding apparatus according to the first embodiment may not be able to obtain a sufficient speed-up effect. In the second embodiment, since the variable length coding process is performed by dividing the coefficient sequence into an arbitrary number from the top, it is possible to reduce the amount of calculation even in the coefficient sequence including many non-zero coefficients. Encoding processing is possible.

なお、本発明は上記装置の機能をコンピュータに実現させるためのプログラムを含むものである。このプログラムは、記録媒体から読み取られてコンピュータに取り込まれてもよいし、通信ネットワークを介して伝送されてコンピュータに取り込まれてもよい。   The present invention includes a program for causing a computer to realize the functions of the above apparatus. This program may be read from a recording medium and loaded into a computer, or may be transmitted via a communication network and loaded into a computer.

図16は本発明に係る画像符号化プログラムを実行可能なパーソナルコンピュータ(PC)の構成を示す図である。   FIG. 16 is a diagram showing a configuration of a personal computer (PC) capable of executing the image encoding program according to the present invention.

図16において、CPU101は、ROM102に記憶されているプログラム、または記憶部108からRAM103にロードされたプログラムに従って、画像符号化処理や各種の処理を実行する。RAM103にはまた、CPU101が画像符号化処理や各種の処理を実行する上において必要なデータなども適宜記憶される。   In FIG. 16, the CPU 101 executes an image encoding process and various processes according to a program stored in the ROM 102 or a program loaded from the storage unit 108 to the RAM 103. The RAM 103 also stores data necessary for the CPU 101 to execute image encoding processing and various processes as appropriate.

CPU101、ROM102、およびRAM103は、バス104を介して相互に接続されている。また、このバス104には、入出力インタフェース105も接続されている。     The CPU 101, ROM 102, and RAM 103 are connected to each other via a bus 104. An input / output interface 105 is also connected to the bus 104.

入出力インタフェース105には、キーボード、マウスなどからなる入力部106、ディスプレイやスピーカなどからなる出力部107、ハードディスクなどから構成される記憶部108、モデム、ターミナルアダプタなどから構成される通信部109が接続されている。通信部109は、インターネットを含む通信ネットワークを介しての通信処理を行う。     The input / output interface 105 includes an input unit 106 including a keyboard and a mouse, an output unit 107 including a display and a speaker, a storage unit 108 including a hard disk, and a communication unit 109 including a modem and a terminal adapter. It is connected. The communication unit 109 performs communication processing via a communication network including the Internet.

入出力インタフェース105にはまた、必要に応じてドライブ110が接続され、磁気ディスク111、光ディスク112、光磁気ディスク113、もしくは、半導体メモリ114などが適宜装着され、それらから読み出された、画像符号化処理や各種の処理を実行するためのプログラムが、必要に応じて記憶部108にインストールされる。     A drive 110 is connected to the input / output interface 105 as necessary, and a magnetic disk 111, an optical disk 112, a magneto-optical disk 113, a semiconductor memory 114, or the like is appropriately mounted, and image codes read therefrom are read out. A program for executing the conversion process and various processes is installed in the storage unit 108 as necessary.

本発明は、係数部の可変長符号化を行う画像符号化装置として、カムコーダやビデオレコーダ、監視カメラやTV会議システム等に適用できる。また、PC上のエンコーダプログラムに適用できる。   The present invention can be applied to a camcorder, a video recorder, a surveillance camera, a video conference system, and the like as an image encoding device that performs variable length encoding of a coefficient portion. It can also be applied to an encoder program on a PC.

本発明の第1の実施の形態に係る画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image coding apparatus which concerns on the 1st Embodiment of this invention. 図1に示す画像符号化装置の可変長符号化部の構成を示すブロック図である。It is a block diagram which shows the structure of the variable length encoding part of the image coding apparatus shown in FIG. 第1の実施の形態に係る画像符号化装置の変形例の可変長符号化部の構成を示すブロック図である。It is a block diagram which shows the structure of the variable length encoding part of the modification of the image coding apparatus which concerns on 1st Embodiment. 図2に示す可変長符号化部5における可変長符号化処理を説明するためのフローチャートである。It is a flowchart for demonstrating the variable length encoding process in the variable length encoding part 5 shown in FIG. コード変数を説明するための図である。It is a figure for demonstrating a code variable. コード=1を示す図である。It is a figure which shows code | symbol = 1. 第2符号化部54bにおける可変長符号化処理を説明するためのフローチャートである。It is a flowchart for demonstrating the variable-length encoding process in the 2nd encoding part 54b. CAVLCにおいてゼロ数を符号化するために用いられるテーブルを示す図である。FIG. 6 shows a table used to encode zero numbers in CAVLC. コード=2を示す図である。It is a figure which shows code = 2. 第3符号化部54cにおける可変長符号化処理を説明するためのフローチャートである。It is a flowchart for demonstrating the variable-length encoding process in the 3rd encoding part 54c. コード=11を示す図である。It is a figure which shows code | symbol = 11. 第12符号化部54lにおける可変長符号化処理を説明するためのフローチャートである。It is a flowchart for demonstrating the variable-length encoding process in the 12th encoding part 54l. 第2の実施の形態に係る画像符号化装置の可変長符号化部の構成を示すブロック図である。It is a block diagram which shows the structure of the variable length encoding part of the image coding apparatus which concerns on 2nd Embodiment. 係数列の分割を説明するための図である。It is a figure for demonstrating the division | segmentation of a coefficient sequence. 図13に示す可変長符号化部5bにおける可変長符号化処理を説明するためのフローチャートである。It is a flowchart for demonstrating the variable length encoding process in the variable length encoding part 5b shown in FIG. 本発明に係る画像符号化プログラムを実行可能なパーソナルコンピュータ(PC)の構成を示す図である。It is a figure which shows the structure of the personal computer (PC) which can execute the image coding program which concerns on this invention. 従来の画像符号化装置における可変長符号化処理を説明するためのフローチャートである。It is a flowchart for demonstrating the variable-length-coding process in the conventional image coding apparatus. ジグザグスキャンを説明するための図である。It is a figure for demonstrating a zigzag scan. (a)はジグザグスキャン前の係数列を示す図、(b)はジグザグスキャン後の係数列を示す図、(c)は係数列の一例を示す図、(d)は(c)に示す係数列でのゼロラン数とレベル値、およびゼロラン数とレベル値の組み合わせ数を示す表図である。(A) is a diagram showing a coefficient sequence before zigzag scanning, (b) is a diagram showing a coefficient sequence after zigzag scanning, (c) is a diagram showing an example of the coefficient sequence, and (d) is a coefficient shown in (c). It is a table | surface figure which shows the zero run number and level value in a row | line | column, and the number of combinations of a zero run number and level value.

符号の説明Explanation of symbols

1,10 フレームメモリ
2,9 演算器
3 直交変換部
4 量子化部
5,5a,5b 可変長符号化部
6 バッファ
7 逆量子化部
8 逆直交変換部
11 動き検出部
12 動き補償部
13 画面内符号化部
14 スイッチ
51,61 ジグザグスキャン部
52,62 コード変数算出部
53,63 スイッチ
54,55,64 符号化部
54a,64a 第1符号化部
54b,64b 第2符号化部
54p,64p 第16符号化部
55a 範囲外符号化部
56,65 ビット列生成部
66 ビット列格納部
67 ビット列統合部
57,68 CAVLCテーブル
58,69 制御部
DESCRIPTION OF SYMBOLS 1,10 Frame memory 2,9 Operation unit 3 Orthogonal transformation part 4 Quantization part 5, 5a, 5b Variable length encoding part 6 Buffer 7 Inverse quantization part 8 Inverse orthogonal transformation part 11 Motion detection part 12 Motion compensation part 13 Screen Inner encoding unit 14 Switch 51, 61 Zigzag scanning unit 52, 62 Code variable calculation unit 53, 63 Switch 54, 55, 64 Encoding unit 54a, 64a First encoding unit 54b, 64b Second encoding unit 54p, 64p Sixteenth encoding unit 55a Out-of-range encoding unit 56, 65 Bit string generation unit 66 Bit string storage unit 67 Bit string integration unit 57, 68 CAVLC table 58, 69 Control unit

Claims (4)

画像をブロック単位に分割して符号化処理を行う画像符号化装置において、
予測画像と原画像との残差成分を直交変換量子化して生成された係数を高周波成分からジグザグスキャン順に並べ替えて係数列を生成する係数列生成手段と、
この係数列生成手段で生成された前記係数列における各係数がゼロ係数であるか非ゼロ係数であるかに基づいて、前記ゼロ係数と前記非ゼロ係数の配置を特定するためのコード変数を算出するコード変数算出手段と、
前記係数列の非ゼロ係数に続くゼロ係数の連続数を示すゼロラン数と、前記係数列の最初の非ゼロ係数以降のゼロ係数の数を示すゼロ数を、前記コード変数に対応して予め設定されている符号化コードとそのコード長とを用いて可変長符号化する符号化手段と
を備えることを特徴とする画像符号化装置。
In an image encoding apparatus that performs an encoding process by dividing an image into blocks,
Coefficient sequence generation means for generating a coefficient sequence by rearranging the coefficients generated by orthogonal transform quantization of the residual component of the predicted image and the original image in order of zigzag scan from the high frequency component;
A code variable for specifying the arrangement of the zero coefficient and the non-zero coefficient is calculated based on whether each coefficient in the coefficient string generated by the coefficient string generation unit is a zero coefficient or a non-zero coefficient. Code variable calculation means to perform,
A zero run number indicating the number of consecutive zero coefficients following the non-zero coefficient of the coefficient sequence, and a zero number indicating the number of zero coefficients after the first non-zero coefficient of the coefficient sequence are set in advance corresponding to the code variable. An image encoding apparatus comprising: encoding means for performing variable length encoding using the encoded code and the code length thereof.
画像をブロック単位に分割して符号化処理を行う画像符号化装置において、
予測画像と原画像との残差成分を直交変換量子化して生成された係数を高周波成分からジグザグスキャン順に並べ替えて係数列を生成する係数列生成手段と、
この係数列生成手段で生成された前記係数列を複数の分割係数列に分割し、これら分割係数列ごとに、各係数がゼロ係数であるか非ゼロ係数であるかに基づいて、前記ゼロ係数と前記非ゼロ係数の配置を特定するためのコード変数を算出するコード変数算出手段と、
前記分割係数列ごとに、前記分割係数列の非ゼロ係数に続くゼロ係数の連続数を示すゼロラン数と、前記分割係数列の最初の非ゼロ係数以降のゼロ係数の数を示すゼロ数を、前記コード変数に対応して予め設定されている符号化コードとそのコード長とを用いて可変長符号化して符号化データを生成する符号化手段と、
この符号化手段手段により生成された、すべての前記分割係数列についての前記符号化データを統合する統合手段と
を備えることを特徴とする画像符号化装置。
In an image encoding apparatus that performs an encoding process by dividing an image into blocks,
Coefficient sequence generation means for generating a coefficient sequence by rearranging the coefficients generated by orthogonal transform quantization of the residual component of the predicted image and the original image in order of zigzag scan from the high frequency component;
The coefficient sequence generated by the coefficient sequence generation means is divided into a plurality of divided coefficient sequences, and the zero coefficient is determined for each of the divided coefficient sequences based on whether each coefficient is a zero coefficient or a non-zero coefficient. And a code variable calculating means for calculating a code variable for specifying the arrangement of the non-zero coefficient,
For each of the division coefficient sequences, a zero run number indicating the number of consecutive zero coefficients following the non-zero coefficient of the division coefficient sequence, and a zero number indicating the number of zero coefficients after the first non-zero coefficient of the division coefficient sequence, Encoding means for generating encoded data by variable length encoding using an encoding code set in advance corresponding to the code variable and its code length;
An image encoding apparatus comprising: an integration unit that integrates the encoded data for all the divided coefficient sequences generated by the encoding unit.
画像をブロック単位に分割して符号化処理を行う画像符号化プログラムにおいて、
予測画像と原画像との残差成分を直交変換量子化して生成された係数を高周波成分からジグザグスキャン順に並べ替えて係数列を生成するステップと、
この係数列生成手段で生成された前記係数列における各係数がゼロ係数であるか非ゼロ係数であるかに基づいて、前記ゼロ係数と前記非ゼロ係数の配置を特定するためのコード変数を算出するステップと、
前記係数列の非ゼロ係数に続くゼロ係数の連続数を示すゼロラン数と、前記係数列の最初の非ゼロ係数以降のゼロ係数の数を示すゼロ数を、前記コード変数に対応して予め設定されている符号化コードとそのコード長とを用いて可変長符号化するステップと
をコンピュータに実行させるための画像符号化プログラム。
In an image encoding program that divides an image into blocks and performs an encoding process,
Rearranging the coefficients generated by orthogonal transform quantization of the residual components of the predicted image and the original image in order of high-frequency components in zigzag scan order to generate a coefficient sequence;
A code variable for specifying the arrangement of the zero coefficient and the non-zero coefficient is calculated based on whether each coefficient in the coefficient string generated by the coefficient string generation unit is a zero coefficient or a non-zero coefficient. And steps to
A zero run number indicating the number of consecutive zero coefficients following the non-zero coefficient of the coefficient sequence, and a zero number indicating the number of zero coefficients after the first non-zero coefficient of the coefficient sequence are set in advance corresponding to the code variable. An image encoding program for causing a computer to execute variable length encoding using the encoded code and the code length.
画像をブロック単位に分割して符号化処理を行う画像符号化プログラムにおいて、
予測画像と原画像との残差成分を直交変換量子化して生成された係数を高周波成分からジグザグスキャン順に並べ替えて係数列を生成するステップと、
この係数列生成手段で生成された前記係数列を複数の分割係数列に分割し、これら分割係数列ごとに、各係数がゼロ係数であるか非ゼロ係数であるかに基づいて、前記ゼロ係数と前記非ゼロ係数の配置を特定するためのコード変数を算出するステップと、
前記分割係数列ごとに、前記分割係数列の非ゼロ係数に続くゼロ係数の連続数を示すゼロラン数と、前記分割係数列の最初の非ゼロ係数以降のゼロ係数の数を示すゼロ数を、前記コード変数に対応して予め設定されている符号化コードとそのコード長とを用いて可変長符号化して符号化データを生成するステップと、
この符号化手段手段により生成された、すべての前記分割係数列についての前記符号化データを統合するステップと
をコンピュータに実行させるための画像符号化プログラム。
In an image encoding program that divides an image into blocks and performs an encoding process,
Rearranging the coefficients generated by orthogonal transform quantization of the residual components of the predicted image and the original image in order of high-frequency components in zigzag scan order to generate a coefficient sequence;
The coefficient sequence generated by the coefficient sequence generation means is divided into a plurality of divided coefficient sequences, and the zero coefficient is determined for each of the divided coefficient sequences based on whether each coefficient is a zero coefficient or a non-zero coefficient. Calculating a code variable for specifying the arrangement of the non-zero coefficients;
For each of the division coefficient sequences, a zero run number indicating the number of consecutive zero coefficients following the non-zero coefficient of the division coefficient sequence, and a zero number indicating the number of zero coefficients after the first non-zero coefficient of the division coefficient sequence, Generating encoded data by variable length encoding using an encoding code set in advance corresponding to the code variable and its code length;
An image encoding program for causing a computer to execute the step of integrating the encoded data for all the divided coefficient sequences generated by the encoding means.
JP2006126585A 2006-04-28 2006-04-28 Image encoding apparatus and image encoding program Pending JP2007300389A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006126585A JP2007300389A (en) 2006-04-28 2006-04-28 Image encoding apparatus and image encoding program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006126585A JP2007300389A (en) 2006-04-28 2006-04-28 Image encoding apparatus and image encoding program

Publications (1)

Publication Number Publication Date
JP2007300389A true JP2007300389A (en) 2007-11-15

Family

ID=38769514

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006126585A Pending JP2007300389A (en) 2006-04-28 2006-04-28 Image encoding apparatus and image encoding program

Country Status (1)

Country Link
JP (1) JP2007300389A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011521536A (en) * 2008-05-02 2011-07-21 マイクロソフト コーポレーション Multilevel representation of rearranged transform coefficients
US8712783B2 (en) 2002-09-04 2014-04-29 Microsoft Corporation Entropy encoding and decoding using direct level and run-length/level context-adaptive arithmetic coding/decoding modes
JP2015084599A (en) * 2010-04-23 2015-04-30 エム アンド ケー ホールディングス インコーポレイテッド Image encoding apparatus
US9554154B2 (en) 2010-07-31 2017-01-24 M & K Holding Inc. Image encoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9565446B2 (en) 2010-12-14 2017-02-07 M&K Holdings Inc. Apparatus for encoding a moving picture

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8712783B2 (en) 2002-09-04 2014-04-29 Microsoft Corporation Entropy encoding and decoding using direct level and run-length/level context-adaptive arithmetic coding/decoding modes
US9390720B2 (en) 2002-09-04 2016-07-12 Microsoft Technology Licensing, Llc Entropy encoding and decoding using direct level and run-length/level context-adaptive arithmetic coding/decoding modes
JP2011521536A (en) * 2008-05-02 2011-07-21 マイクロソフト コーポレーション Multilevel representation of rearranged transform coefficients
US9172965B2 (en) 2008-05-02 2015-10-27 Microsoft Technology Licensing, Llc Multi-level representation of reordered transform coefficients
JP2015084599A (en) * 2010-04-23 2015-04-30 エム アンド ケー ホールディングス インコーポレイテッド Image encoding apparatus
JP2015111914A (en) * 2010-04-23 2015-06-18 エム アンド ケー ホールディングス インコーポレイテッド Video encoding device
JP2015111915A (en) * 2010-04-23 2015-06-18 エム アンド ケー ホールディングス インコーポレイテッド Intra prediction device
JP2015122774A (en) * 2010-04-23 2015-07-02 エム アンド ケー ホールディングス インコーポレイテッド Video encoding apparatus
JP2015122773A (en) * 2010-04-23 2015-07-02 エム アンド ケー ホールディングス インコーポレイテッド Video encoding apparatus
JP2016165125A (en) * 2010-04-23 2016-09-08 エム アンド ケー ホールディングス インコーポレイテッド Video decryption device
US9584828B2 (en) 2010-07-31 2017-02-28 M&K Holdings Inc. Image encoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9609360B2 (en) 2010-07-31 2017-03-28 M&K Holdings Inc. Image decoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9578349B2 (en) 2010-07-31 2017-02-21 M&K Holdings Inc. Image decoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9584830B2 (en) 2010-07-31 2017-02-28 M&K Holdings Inc. Image decoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9554154B2 (en) 2010-07-31 2017-01-24 M & K Holding Inc. Image encoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9584826B2 (en) 2010-07-31 2017-02-28 M&K Holdings Inc. Image encoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9584829B2 (en) 2010-07-31 2017-02-28 M&K Holdings Inc. Image encoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9584827B2 (en) 2010-07-31 2017-02-28 M&K Holdings Inc. Image encoding apparatus adaptively determining a scan pattern according to an intra prediction mode
USRE48564E1 (en) 2010-07-31 2021-05-18 M&K Holdings Inc. Image decoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9609359B2 (en) 2010-07-31 2017-03-28 M&K Holdings Inc. Image decoding apparatus adaptively determining a scan pattern according to an intra prediction mode
US9609350B2 (en) 2010-12-14 2017-03-28 M&K Holdings Inc. Apparatus for decoding a moving picture
US9609349B2 (en) 2010-12-14 2017-03-28 M & K Holdings Inc. Apparatus for decoding a moving picture
US9609352B2 (en) 2010-12-14 2017-03-28 M&K Holdings Inc. Apparatus for encoding a moving picture
US9565446B2 (en) 2010-12-14 2017-02-07 M&K Holdings Inc. Apparatus for encoding a moving picture
US9609353B2 (en) 2010-12-14 2017-03-28 M&K Holdings Inc. Apparatus for encoding a moving picture
US9609351B2 (en) 2010-12-14 2017-03-28 M&K Holdings Inc. Apparatus for decoding a moving picture
US9621916B2 (en) 2010-12-14 2017-04-11 M&K Holdings Inc. Apparatus for encoding a moving picture
US9609354B2 (en) 2010-12-14 2017-03-28 M&K Holdings Inc. Apparatus for decoding a moving picture

Similar Documents

Publication Publication Date Title
US11671599B2 (en) Data encoding and decoding
US11463698B2 (en) Selection of the maximum dynamic range of transformed data and the data precision of transform matrices according to the bit depth of input data
US10893273B2 (en) Data encoding and decoding
JP5492206B2 (en) Image encoding method and image decoding method, and image encoding device and image decoding device
US8494295B2 (en) Variable length coding for clustered transform coefficients in video compression
JP4555257B2 (en) Image encoding device
US7486212B2 (en) Variable length coding for sparse coefficients
EP2150061A1 (en) Video encoding device, video encoding method, and video encoding program
JP2000115770A (en) Coder and its method
WO2007056657A2 (en) Extended amplitude coding for clustered transform coefficients
JP2008022383A (en) Image encoding apparatus
GB2496201A (en) Context adaptive data encoding and decoding
JP2007300389A (en) Image encoding apparatus and image encoding program
JP2004007555A (en) Entropy encoder
TW201737706A (en) Apparatus and method for vector-based entropy coding for display stream compression
JP4833309B2 (en) Video compression encoding device
US8233729B2 (en) Method and apparatus for generating coded block pattern for highpass coefficients
KR100552345B1 (en) method and apparatus for compressing video image using universal variable length coding
JP4847423B2 (en) Moving picture encoding apparatus and computer program
TWI646823B (en) Video compression method and video compression device
JP2006033868A (en) Image processing apparatus and method
JP2022548685A (en) Encoding and decoding image data
JPH10304363A (en) Image signal processing unit and its method
JP2008048235A (en) Decoding method and decoding device for variable-length code
JP2008306574A (en) Encoding method, encoder and decoder for image data