JP5375590B2 - Quantization control circuit, quantization parameter changing method, and encoding apparatus - Google Patents

Quantization control circuit, quantization parameter changing method, and encoding apparatus Download PDF

Info

Publication number
JP5375590B2
JP5375590B2 JP2009292234A JP2009292234A JP5375590B2 JP 5375590 B2 JP5375590 B2 JP 5375590B2 JP 2009292234 A JP2009292234 A JP 2009292234A JP 2009292234 A JP2009292234 A JP 2009292234A JP 5375590 B2 JP5375590 B2 JP 5375590B2
Authority
JP
Japan
Prior art keywords
value
quantization
pixel
block
linear
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2009292234A
Other languages
Japanese (ja)
Other versions
JP2011135269A (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.)
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Semiconductor 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 Fujitsu Semiconductor Ltd filed Critical Fujitsu Semiconductor Ltd
Priority to JP2009292234A priority Critical patent/JP5375590B2/en
Publication of JP2011135269A publication Critical patent/JP2011135269A/en
Application granted granted Critical
Publication of JP5375590B2 publication Critical patent/JP5375590B2/en
Expired - Fee Related 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)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce quantization noise. <P>SOLUTION: A quantization control circuit 13 calculates a non-linear detection value corresponding to a difference between values of adjacent pixels included in a macro block for every macro block into which a specified sized picture is divided. According to the non-linear detection value, the quantization control circuit 13 changes quantization parameters for controlling the quantization steps of a quantization part 12b which quantizes macro blocks. <P>COPYRIGHT: (C)2011,JPO&amp;INPIT

Description

量子化制御回路、量子化パラメータ変更方法、及び符号化装置に関する。 The present invention relates to a quantization control circuit, a quantization parameter changing method, and an encoding device .

従来、画像信号の符号化に、離散コサイン変換(DCT:Discrete Cosine Transform)が用いられている。このような装置は、入力画像信号に対してブロック毎にDCT演算を行い、演算結果の値を量子化し、量子化後の値を符号化する。   Conventionally, discrete cosine transform (DCT) is used for encoding an image signal. Such an apparatus performs a DCT operation on the input image signal for each block, quantizes the value of the operation result, and encodes the quantized value.

上記のDCT演算を用いた画像圧縮方法では、色の変化が少ない背景に例えば黒い線等のようにシャープな輪郭が表現された部分では、視覚的に、蚊の大群のような細かいもやもやとしたノイズ、所謂モスキートノイズ(Mosquito Noise)が発生する。これは、DCT演算により、高周波成分の情報が減少することに起因する。   In the image compression method using the above DCT operation, in a portion where a sharp outline such as a black line is expressed on a background with little color change, for example, a fine haze like a large group of mosquitoes is visually observed. Noise, so-called Mosquito Noise, is generated. This is due to the fact that the information of the high frequency component is reduced by the DCT calculation.

したがって、表示された画像の品質低下を抑制するため、画像データを復号する際に、フィルタを用いてモスキートノイズを除去する方法が提案されている(例えば、特許文献1参照)。   Therefore, a method for removing mosquito noise using a filter when decoding image data has been proposed in order to suppress deterioration in quality of the displayed image (see, for example, Patent Document 1).

特開2000−295615号公報JP 2000-295615 A

しかしながら、復号時にノイズを除去する方法では、この方法を用いていない装置では表示画像の品質低下が発生する。このため、装置にかかわらず画像の品質低下を抑制することが要求されている。   However, in the method of removing noise at the time of decoding, the quality of the display image is reduced in an apparatus that does not use this method. For this reason, it is required to suppress degradation in image quality regardless of the apparatus.

本発明の一観点によれば、所定数の画素データを有するブロックを分割したサブブロック毎に、前記サブブロックに含まれ所定の方向に連続して隣接する3つの画素の内の隣接する2つの画素の画素値の差に応じて線形予測値を算出し、前記連続する3つの画素の内の前記隣接する2つの画素とは異なる画素の画素値と前記線形予測値との差に基づいた非線形検出値に応じて前記サブブロックを量子化する際の量子化ステップを制御する量子化パラメータを変更する。 According to one aspect of the present invention, a predetermined number of each sub-block obtained by dividing a block having pixel data, the sub-blocks included in the three adjacent consecutively in a predetermined direction of the pixel adjacent the two A linear prediction value is calculated in accordance with a difference between pixel values of pixels, and nonlinearity based on a difference between a pixel value of a pixel different from the adjacent two pixels of the three consecutive pixels and the linear prediction value A quantization parameter for controlling a quantization step when the sub-block is quantized is changed according to the detected value.

本発明の一観点によれば、量子化ノイズが低減される。   According to one aspect of the present invention, quantization noise is reduced.

一実施形態の符号化装置のブロック図である。It is a block diagram of the encoding apparatus of one Embodiment. マクロブロックの説明図である。It is explanatory drawing of a macroblock. 量子化制御回路のブロック図である。It is a block diagram of a quantization control circuit. (a)(b)は非線形検出処理の説明図である。(A) (b) is explanatory drawing of a nonlinear detection process. 非線形検出処理の説明図である。It is explanatory drawing of a non-linear detection process. 非線形検出処理の説明図である。It is explanatory drawing of a non-linear detection process. 符号化処理のフローチャートである。It is a flowchart of an encoding process. (a)(b)は非線形検出処理の説明図である。(A) (b) is explanatory drawing of a nonlinear detection process.

以下、一実施形態を図1〜図7に従って説明する。
図1に示すように、符号化装置は、画像メモリ11に格納された画像データを符号化する符号化回路12を含む。
Hereinafter, an embodiment will be described with reference to FIGS.
As shown in FIG. 1, the encoding device includes an encoding circuit 12 that encodes image data stored in an image memory 11.

画像メモリ11は、複数枚の画面の画像データ(画素値)を記憶する容量のメモリである。画像メモリ11には、画像信号Siに応じた画像データを記憶する。画像メモリ11に記憶された画像データは、マクロブロック単位で読み出される。   The image memory 11 is a memory having a capacity for storing image data (pixel values) of a plurality of screens. The image memory 11 stores image data corresponding to the image signal Si. The image data stored in the image memory 11 is read in units of macro blocks.

符号化回路12は、直交変換部12a、量子化部12b、符号化部12cを含む。直交変換部12aは、画像メモリ11から読み出されたマクロブロック単位の画像データを離散コサイン変換(DCT:Discrete Cosine Transform)し、変換後のデータ(DCT係数値)を出力する。量子化部12bは、直交変換部12aの出力データを量子化し、量子化後のデータ(量子化係数値)を出力する。符号化部12cは、量子化部12bの出力データを可変長符号化変換し、変換後のデータ(符号化データSo)を出力する。   The encoding circuit 12 includes an orthogonal transform unit 12a, a quantization unit 12b, and an encoding unit 12c. The orthogonal transform unit 12a performs discrete cosine transform (DCT: Discrete Cosine Transform) on the macroblock unit image data read from the image memory 11, and outputs the transformed data (DCT coefficient value). The quantization unit 12b quantizes the output data of the orthogonal transform unit 12a, and outputs the quantized data (quantization coefficient value). The encoding unit 12c performs variable length encoding conversion on the output data of the quantization unit 12b, and outputs the converted data (encoded data So).

また、符号化装置は、量子化制御回路13を含む。量子化制御回路13には、画像信号Siが入力される。量子化制御回路13は、画像信号Siに基づく1画面(1ピクチャ)分の画像データに基づいて、量子化部12bにおける量子化ステップを制御する制御情報を生成する。そして、量子化制御回路13は、その制御情報を出力する。   The encoding device also includes a quantization control circuit 13. An image signal Si is input to the quantization control circuit 13. The quantization control circuit 13 generates control information for controlling the quantization step in the quantization unit 12b based on image data for one screen (one picture) based on the image signal Si. Then, the quantization control circuit 13 outputs the control information.

量子化部12bは、量子化制御回路13にて生成された制御情報に応じた量子化ステップでDCT係数値を量子化したデータを生成する。
詳しくは、量子化制御回路13は、1つのピクチャに含まれるエッジを検出し、その検出結果に応じて制御情報を生成する。エッジは、複数の画素から構成される画素列において、隣接する2つの画素の画素値の差が大きい部分、即ち画素列において、画素値が線形に変化しない非線形な部分である。このような画素値の非線形は、色の変化が少ない背景に例えば黒い線等のようにシャープな輪郭が表現された部分で発生する。そして、このような輪郭が表現された部分では、量子化ステップが粗いと量子化ノイズ(モスキートノイズ)が発生する。
The quantization unit 12b generates data obtained by quantizing the DCT coefficient value in a quantization step corresponding to the control information generated by the quantization control circuit 13.
Specifically, the quantization control circuit 13 detects an edge included in one picture and generates control information according to the detection result. The edge is a portion where the difference between the pixel values of two adjacent pixels is large in a pixel row composed of a plurality of pixels, that is, a non-linear portion where the pixel value does not change linearly in the pixel row. Such non-linearity of the pixel value occurs in a portion where a sharp outline is expressed, for example, a black line on a background with little color change. In a portion where such a contour is expressed, quantization noise (mosquito noise) is generated if the quantization step is rough.

量子化制御回路13は、1つのピクチャに含まれるエッジを検出し、その検出結果に応じて、輪郭が含まれるピクチャに対する量子化ステップを細かくするように、制御情報を生成する。同じ画像データを用いた場合、量子化部12bにおいて、細かい量子化ステップにて量子化されたデータは、粗い量子化ステップにて量子化されたデータに比べて、高周波成分がより多く保持されている。従って、量子化ステップを細かくすることにより、画質の劣化を抑制することができる。   The quantization control circuit 13 detects an edge included in one picture, and generates control information so that a quantization step for a picture including a contour is made fine according to the detection result. When the same image data is used, in the quantization unit 12b, the data quantized in the fine quantization step retains more high-frequency components than the data quantized in the coarse quantization step. Yes. Therefore, it is possible to suppress the deterioration of the image quality by making the quantization step fine.

本実施形態では、図2に示すように、16×16個の画素を1つのマクロブロックMBとする。個々の画素を示す場合、二次元配列された画素の配列方向のうち、1つの方向(図において左右方向)をX方向とし、X方向と異なる方向(図において上下方向)をY方向とし、各方向について左上から右下に向って0から15の番号を付し、それぞれの方向における番号を用いて画素ax,yとする。例えば、図面左上の画素は、画素a0,0とし、図面右上の画素は、画素a15,0とし、図面右下の画素は、画素a15,15とする。 In the present embodiment, as shown in FIG. 2, 16 × 16 pixels are defined as one macro block MB. When an individual pixel is shown, one direction (left and right direction in the figure) of the two-dimensionally arranged pixel arrangement direction is an X direction, a direction different from the X direction (up and down direction in the figure) is a Y direction, Numbers from 0 to 15 are assigned to the directions from the upper left to the lower right, and the numbers in the respective directions are used as pixels a x, y . For example, the upper left pixel in the drawing is the pixel a 0,0 , the upper right pixel is the pixel a 15,0, and the lower right pixel is the pixel a 15,15 .

図3に示すように、量子化制御回路13は設定レジスタ21を有している。設定レジスタ21には、量子化制御回路13に含まれる部に供給される各種情報が記憶されている。これらの情報は、例えば図示しないCPUにより設定される。従って、設定レジスタ21は、符号化装置と外部装置(CPU)とを接続するインタフェースの機能を有している、又はインタフェースが設定レジスタを含む構成としてもよい。   As shown in FIG. 3, the quantization control circuit 13 has a setting register 21. The setting register 21 stores various types of information supplied to the units included in the quantization control circuit 13. These pieces of information are set by a CPU (not shown), for example. Therefore, the setting register 21 may have a function of an interface for connecting the encoding device and an external device (CPU), or the interface may include a setting register.

設定レジスタ21に記憶された情報は、しきい値情報、サイズ情報、パラメータセットを含む。
しきい値情報は、垂直用しきい値Vth、水平用しきい値Hth、斜め用しきい値VHth、マクロブロック判定用しきい値MBth、ピクチャ判定用しきい値Qthを含む。しきい値Vth,Hth,VHthは、マクロブロックの非線形性を判定するために用いられる。しきい値MBthは、非線形値に基づいてマクロブロックの短波長性を判定するために用いられる。しきい値Qthは、1つのピクチャに含まれるマクロブロックの短波長性に基づいて、当該ピクチャに対して量子化ステップの制御を行うか否かを判定するために用いられる。垂直用しきい値Vth、水平用しきい値Hth、斜め用しきい値VHthは、非線形値算出部22に供給される。マクロブロック判定用しきい値MBthは、MB短波長検出部30に供給される。ピクチャ判定用しきい値Qthは、細分化判定部32に供給される。
The information stored in the setting register 21 includes threshold information, size information, and parameter set.
The threshold information includes a vertical threshold Vth, a horizontal threshold Hth, an oblique threshold VHth, a macroblock determination threshold MBth, and a picture determination threshold Qth. The threshold values Vth, Hth, and VHth are used to determine the nonlinearity of the macroblock. The threshold value MBth is used to determine the short wavelength property of the macroblock based on the nonlinear value. The threshold value Qth is used to determine whether or not to perform quantization step control on the picture based on the short wavelength property of the macroblock included in one picture. The vertical threshold value Vth, the horizontal threshold value Hth, and the oblique threshold value VHth are supplied to the nonlinear value calculation unit 22. The macroblock determination threshold value MBth is supplied to the MB short wavelength detector 30. The picture determination threshold value Qth is supplied to the subdivision determination unit 32.

サイズ情報は、画面サイズ設定値Sz、マクロブロック数Pを含む。画面サイズ設定値Szは、入力される画像信号Siに従って符号化回路12及び量子化制御回路13の供給される1つのピクチャに含まれる画素数、つまり画像信号Siを出力する撮像素子(図示略)の画素数に応じた設定値である。画面サイズ設定値Szは、画面終端検出部25に供給される。マクロブロック数Pは、1つのピクチャに含まれるマクロブロックの数である。マクロブロックMBは、16×16個の画素aを含む。従って、マクロブロック数Spは、画面サイズ設定値Szと、マクロブロックに含める画素aの数に基づいて設定される。マクロブロック数Pは、平均値算出部27、細分化判定部32に供給される。   The size information includes a screen size setting value Sz and the number of macroblocks P. The screen size setting value Sz is the number of pixels included in one picture supplied from the encoding circuit 12 and the quantization control circuit 13 according to the input image signal Si, that is, an image sensor (not shown) that outputs the image signal Si. Is a set value corresponding to the number of pixels. The screen size setting value Sz is supplied to the screen end detection unit 25. The number of macroblocks P is the number of macroblocks included in one picture. The macro block MB includes 16 × 16 pixels a. Therefore, the macroblock number Sp is set based on the screen size setting value Sz and the number of pixels a included in the macroblock. The macroblock number P is supplied to the average value calculation unit 27 and the segmentation determination unit 32.

パラメータセットPsは、パラメータQpBdOffsety 、定数k、等を含む。パラメータQpBdOffsetyは、1画素当りのビット幅に対応するパラメータであり、QpBdOffsety=6×bit_depth_luma_minus8 により算出される。なお、bit_depth_luma_minus8は、1画素当りのビット幅から「8」を引いた値である。パラメータセットPsは、差分値算出部33に供給される。   The parameter set Ps includes a parameter QpBdOffsety, a constant k, and the like. The parameter QpBdOffsety is a parameter corresponding to the bit width per pixel, and is calculated by QpBdOffsety = 6 × bit_depth_luma_minus8. Bit_depth_luma_minus8 is a value obtained by subtracting “8” from the bit width per pixel. The parameter set Ps is supplied to the difference value calculation unit 33.

非線形値算出部22は、マクロブロック単位の画素値としきい値Vth,Hth,VHthに基づいて、マクロブロックに対する非線形検出値Gを算出する。非線形検出値Gは、マクロブロックに含まれる画素の値(以下、単に画素値という)が線形的に変化しないポイント、即ち非線形なポイントの数に対応する。つまり、非線形値算出部22は、非線形ポイントをカウントし、そのカウント値を当該マクロブロックMBに対応する非線形検出値Gとして出力する。   The non-linear value calculation unit 22 calculates a non-linear detection value G for the macro block based on the pixel value of each macro block and the threshold values Vth, Hth, and VHth. The nonlinear detection value G corresponds to the number of points at which the pixel values (hereinafter simply referred to as pixel values) included in the macroblock do not change linearly, that is, the number of nonlinear points. That is, the non-linear value calculation unit 22 counts non-linear points and outputs the count value as a non-linear detection value G corresponding to the macroblock MB.

詳述すると、非線形値算出部22は、マクロブロックMBに含まれる各画素について、その画素を含む画素列が非線形ポイントを含むか否かを判定する。画素列は、二次元配列された画素a(図2参照)について、所定の方向(縦方向(Y軸方向),横方向(X軸方向),斜め方向)に連続する3つの画素を含む。3つの画素の画素値を、画素の配列方向に従って、第1の画素値、第2の画素値、第3の画素値とする。   More specifically, the nonlinear value calculation unit 22 determines, for each pixel included in the macroblock MB, whether or not the pixel column including the pixel includes a nonlinear point. The pixel column includes three pixels that are continuous in a predetermined direction (vertical direction (Y-axis direction), horizontal direction (X-axis direction), and diagonal direction) for the two-dimensionally arranged pixels a (see FIG. 2). The pixel values of the three pixels are defined as a first pixel value, a second pixel value, and a third pixel value according to the pixel arrangement direction.

非線形値算出部22は、画素列に含まれる3つの画素値のうち、中央の画素値(第2の画素値)と、その画素値に隣接する2つの画素値の内の一方(第1の画素値)に基づいて線形予測値を算出する。つまり、第1の画素値と第2の画素値に基づいて、第2の画素値から線形的に変化した場合の画素値(線形予測値)を算出する。詳しくは、第1の画素値と第2の画素値の差分を算出し、その差分値を第2の画素値に加算して線形予測値を算出する。第2の画素値に隣接する画素値のうち、第1の画素値と異なる方向に隣接する画素値(第3の画素値)は、この画素列の画素値が線形的に変化していれば、算出した線形予測値に基づく予測範囲内の値となる。この予測範囲はしきい値Vth,Hth,VHthにより設定される。従って、非線形値算出部22は、線形予測値と第3の画素値との差分の絶対値を算出し、この絶対値がしきい値より小さい場合には、第1〜第3の画素値が線形であると判定する。一方、非線形値算出部22は、絶対値がしきい値より大きい場合には、第1〜第3の画素値が非線形であると判定し、この画素列に非線形ポイントが含まれるとして、カウント値をカウントアップする。   The non-linear value calculation unit 22 includes a central pixel value (second pixel value) of three pixel values included in the pixel column and one of the two pixel values adjacent to the pixel value (first pixel value). A linear prediction value is calculated based on the pixel value. That is, based on the first pixel value and the second pixel value, a pixel value (linear prediction value) when linearly changing from the second pixel value is calculated. Specifically, a difference between the first pixel value and the second pixel value is calculated, and the difference value is added to the second pixel value to calculate a linear prediction value. Of the pixel values adjacent to the second pixel value, the pixel value adjacent to the first pixel value in the direction different from the first pixel value (third pixel value) is obtained by changing the pixel value of this pixel column linearly. The value is within the prediction range based on the calculated linear prediction value. This prediction range is set by threshold values Vth, Hth, VHth. Therefore, the nonlinear value calculation unit 22 calculates the absolute value of the difference between the linear prediction value and the third pixel value, and when the absolute value is smaller than the threshold value, the first to third pixel values are Judged to be linear. On the other hand, if the absolute value is larger than the threshold value, the nonlinear value calculation unit 22 determines that the first to third pixel values are nonlinear, and determines that the pixel value includes a nonlinear point. Count up.

画素値の第1の例を図4(a)に示す。画素列に含まれ横方向に隣接する3つの画素A,B,Cの画素値を、「5」,「20」,「3」とする。非線形値算出部22は、画素A,Bの画素値に基づいて線形予測値を算出する。図4(b)は、各画素A〜Cの画素値と線形予測値Eが棒グラフとして示す。この時、線形予測値Eは「35」となる。非線形値算出部22は、この線形予測値Eと画素値Cとの差分を算出し、この差分の絶対値としきい値(例えば水平用しきい値Hth)とを比較する。例えば、水平用しきい値Hthを「5」とすると、この場合、差分値(絶対値)は「32」であり、しきい値Hth(=5)よりも大きい。従って、非線形値算出部22は、この画素列に非線形ポイントが含まれると判定し、カウント値をカウントアップする。   A first example of the pixel value is shown in FIG. The pixel values of three pixels A, B, and C that are included in the pixel column and are adjacent in the horizontal direction are “5”, “20”, and “3”. The nonlinear value calculation unit 22 calculates a linear prediction value based on the pixel values of the pixels A and B. FIG. 4B shows the pixel values of the pixels A to C and the linear prediction value E as a bar graph. At this time, the linear prediction value E is “35”. The nonlinear value calculation unit 22 calculates a difference between the linear prediction value E and the pixel value C, and compares the absolute value of the difference with a threshold value (for example, a horizontal threshold value Hth). For example, if the horizontal threshold value Hth is “5”, the difference value (absolute value) is “32” in this case, which is larger than the threshold value Hth (= 5). Accordingly, the non-linear value calculation unit 22 determines that the non-linear point is included in this pixel row, and counts up the count value.

画素値の第2の例を図5に示す。今、非線形値算出部22は、画素列を斜めに隣接する3つの画素a0,0,a1,1,a2,2とする。これらの画素値は図に示す通りであり、線形予測値は「0」となる。このとき、斜め用しきい値VHthを「5」とすると、線形予測値と画素a2,2の画素値の差分は、しきい値VHthより大きい。従って、非線形値算出部22は、この画素列に非線形ポイントが含まれると判定し、カウント値をカウントアップする。次に、画素列を画素a1,1,a2,2,a3,3とした場合、線形予測値は「197」となり、この線形予測値と画素a3,3の画素値の差分は、しきい値VHthより小さい。従って、非線形値算出部22は、この画素列に非線形ポイントが含まれないと判定し、カウント値を保持する。 A second example of pixel values is shown in FIG. Now, the nonlinear value calculation unit 22 sets the pixel row to three pixels a 0,0 , a 1,1 and a 2,2 that are diagonally adjacent to each other. These pixel values are as shown in the figure, and the linear prediction value is “0”. At this time, if the diagonal threshold value VHth is “5”, the difference between the linear prediction value and the pixel value of the pixel a 2 , 2 is larger than the threshold value VHth. Accordingly, the non-linear value calculation unit 22 determines that the non-linear point is included in this pixel row, and counts up the count value. Next, when the pixel columns are the pixels a 1,1 , a 2,2 , and a 3,3 , the linear prediction value is “197”, and the difference between the linear prediction value and the pixel value of the pixel a 3,3 is Is smaller than the threshold value VHth. Therefore, the non-linear value calculation unit 22 determines that the non-linear point is not included in this pixel row, and holds the count value.

そして、非線形値算出部22は、上記の判定を、各マクロブロックについて、マクロブロックに含まれる全ての画素値ついて行う。即ち、非線形値算出部22は、次式に従って、マクロブロックに対する非線形検出値Gを算出する。   Then, the non-linear value calculation unit 22 performs the above determination on all the pixel values included in the macro block for each macro block. That is, the nonlinear value calculation unit 22 calculates the nonlinear detection value G for the macroblock according to the following equation.

Figure 0005375590
つまり、非線形値算出部22は、線形予測値がしきい値越える画素列の判定値を「1」とし、線形予測値がしきい値以下の画素列の判定値を「0」とする。そして、非線形値算出部22は、マクロブロックMBについて、画素列の判定値を累積加算し、その累積的な加算結果を非線形検出値Gとして出力する。
Figure 0005375590
That is, the nonlinear value calculation unit 22 sets the determination value of the pixel column whose linear prediction value exceeds the threshold value to “1”, and sets the determination value of the pixel column whose linear prediction value is equal to or less than the threshold value to “0”. Then, the nonlinear value calculation unit 22 cumulatively adds the pixel column determination values for the macroblock MB, and outputs the cumulative addition result as the nonlinear detection value G.

非線形検出値Gは、隣接する画素値の差がしきい値以上である非線形ポイントの数に対応し、マクロブロックにおける画素値変化の度合いを示す。つまり、大きな非線形検出値Gのマクロブロックは、小さな非線形検出値Gのマクロブロックに比べ、多くのエッジを含む、つまり直交変換したデータに高周波成分が多いことを示す。従って、非線形検出値Gを算出することは、マクロブロック単位で高周波度(画素値変化の激しさ)、つまり短波長度を算出していることと等しい。   The non-linear detection value G corresponds to the number of non-linear points where the difference between adjacent pixel values is equal to or greater than a threshold value, and indicates the degree of change in pixel value in the macroblock. That is, the macro block having a large non-linear detection value G includes more edges than the macro block having a small non-linear detection value G, that is, the high-frequency component is included in the orthogonally transformed data. Therefore, calculating the non-linear detection value G is equivalent to calculating the high frequency degree (the intensity of change in pixel value), that is, the short wavelength degree in units of macroblocks.

尚、上記の式(1)において、右辺第1項は、図2に示すマクロブロックに含まれる画素aについて、縦方向に隣接する3つの画素を含む画素列に対する判定及びカウントを示す。同様に、右辺第2項は、横方向に隣接する3つの画素を含む画素列に対する判定及びカウントを示す。また、右辺第3項は、図2に示すマクロブロックに含まれる画素aについて、左上から右下に向う斜め方向に隣接する3つの画素を含む画素列に対する判定及びカウントを示し、右辺第4項は、右上から左下に向う斜め方向に隣接する3つの画素を含む画素列に対する判定及びカウントを示す。   In the above equation (1), the first term on the right side indicates the determination and count for the pixel row including three pixels adjacent in the vertical direction for the pixel a included in the macroblock shown in FIG. Similarly, the second term on the right side indicates determination and count for a pixel column including three pixels adjacent in the horizontal direction. Further, the third term on the right side indicates determination and count for a pixel column including three pixels adjacent in the oblique direction from the upper left to the lower right with respect to the pixel a included in the macroblock illustrated in FIG. Indicates determination and count for a pixel column including three pixels adjacent in an oblique direction from upper right to lower left.

このように、非線形値算出部22は、4つの方向に隣接する3つの画素値により非線形検出値Gを算出することにより、マクロブロックMBに含まれる任意の方向に沿って延びるエッジを検出することができる。   As described above, the nonlinear value calculation unit 22 detects an edge extending along an arbitrary direction included in the macroblock MB by calculating the nonlinear detection value G using three pixel values adjacent to each other in the four directions. Can do.

画面先頭検出部23は、画像信号Siに基づいて、各ピクチャにおいて最初の画素データが入力されるタイミング、即ち画素値の入力開始タイミングを検出し、先頭検出信号Ssとクリア信号Sclを出力する。入力開始タイミングは、信号読み出しパルス、垂直同期信号、転送開始パルス信号、等により検出される。先頭検出信号Ssは書き込み制御部24に供給され、クリア信号Scは累積加算部26に供給される。   The screen head detection unit 23 detects the timing at which the first pixel data is input in each picture, that is, the input start timing of the pixel value, based on the image signal Si, and outputs the head detection signal Ss and the clear signal Scl. The input start timing is detected by a signal readout pulse, a vertical synchronization signal, a transfer start pulse signal, and the like. The head detection signal Ss is supplied to the write control unit 24, and the clear signal Sc is supplied to the cumulative addition unit 26.

書き込み制御部24は、画面先頭検出部23から出力される先頭検出信号Ssに応答して、非線形値算出部22から出力される非線形検出値Gを、その非線形検出値Gを算出したマクロブロックMBに対応するメモリ28の領域(メモリアドレス)に書き込む制御を行う。例えば、書き込み制御部24は、非線形値算出部22から非線形検出値Gが出力される毎に、マクロブロックに対応するアドレス信号を含む書き込み制御信号WCをメモリ28に供給する。メモリ28は、その書き込み制御信号WCに応答し、制御信号WCに含まれるアドレス信号により指定されるメモリアドレスに、非線形値算出部22から出力される非線形検出値Gを記憶する。   The writing control unit 24 responds to the head detection signal Ss output from the screen head detection unit 23, the nonlinear detection value G output from the nonlinear value calculation unit 22, and the macroblock MB in which the nonlinear detection value G is calculated. Control is performed to write to the area (memory address) of the memory 28 corresponding to the. For example, the write control unit 24 supplies the memory 28 with a write control signal WC including an address signal corresponding to a macroblock every time the nonlinear detection value G is output from the nonlinear value calculation unit 22. In response to the write control signal WC, the memory 28 stores the non-linear detection value G output from the non-linear value calculator 22 at a memory address specified by the address signal included in the control signal WC.

画面終端検出部25は、画像信号Siに基づいて、各ピクチャにおいて最後の画素データが入力されるタイミング、即ち画素値の入力終了タイミングを検出し、終端検出信号Seを出力する。入力終了タイミングは、画素値のカウント結果、水平同期信号のカウント結果、転送終了パルス信号、等により検出される。終端検出信号Seは、読み出し制御部29、ピクチャ平均値算出部27、細分化判定部32に供給される。   The screen end detection unit 25 detects the timing at which the last pixel data is input in each picture, that is, the input end timing of the pixel value, based on the image signal Si, and outputs the end detection signal Se. The input end timing is detected by a pixel value count result, a horizontal synchronization signal count result, a transfer end pulse signal, and the like. The end detection signal Se is supplied to the read control unit 29, the picture average value calculation unit 27, and the segmentation determination unit 32.

累積加算部26は、非線形値算出部22から出力される非線形検出値Gを累積加算し、その加算結果の値を出力する。つまり、累積加算部26は、値を記憶するレジスタを有し、そのレジスタに記憶した記憶値に非線形値算出部22から出力される非線形検出値Gを加算し、記憶値(=累積値)を出力する。また、累積加算部26は、画面先頭検出部23から出力されるクリア信号Scに応答して記憶値をクリア(=0)する。クリア信号Scは、ピクチャの先頭に応じて画面先頭検出部23から出力される。従って、累積加算値は、ピクチャの先頭でクリアされる。従って、累積加算部26は、非線形値算出部22から出力される非線形検出値Gを、ピクチャ単位で累積加算する。   The cumulative addition unit 26 cumulatively adds the non-linear detection value G output from the non-linear value calculation unit 22 and outputs the value of the addition result. That is, the cumulative addition unit 26 has a register for storing a value, adds the nonlinear detection value G output from the nonlinear value calculation unit 22 to the stored value stored in the register, and stores the stored value (= cumulative value). Output. Further, the cumulative addition unit 26 clears the stored value (= 0) in response to the clear signal Sc output from the screen head detection unit 23. The clear signal Sc is output from the screen head detection unit 23 according to the head of the picture. Therefore, the cumulative addition value is cleared at the beginning of the picture. Accordingly, the cumulative addition unit 26 cumulatively adds the nonlinear detection value G output from the nonlinear value calculation unit 22 in units of pictures.

平均値算出部27は、累積加算部26から出力される累積値SGを1つのピクチャに含まれるマクロブロックの数(総マクロブロック数)Pで除算し、その演算結果を出力する。累積値は、1つのピクチャに含まれるマクロブロックに対応する非線形検出値Gの合計値であり、その合計値を総マクロブロック数で除算した結果は、1つのピクチャに含まれる全てのマクロブロックにおける非線形検出値Gの平均値(EdgeAverage )である。この平均値EAは、差分値算出部33に供給される。   The average value calculation unit 27 divides the cumulative value SG output from the cumulative addition unit 26 by the number of macroblocks (total number of macroblocks) P included in one picture, and outputs the calculation result. The accumulated value is the total value of the non-linear detection values G corresponding to the macroblocks included in one picture, and the result of dividing the total value by the total number of macroblocks is the result for all macroblocks included in one picture. This is the average value (EdgeAverage) of the nonlinear detection values G. This average value EA is supplied to the difference value calculation unit 33.

読み出し制御部29は、終端検出信号Seに応答して、メモリ28に記憶された非線形検出値Gを読み出すための読み出し制御信号RCを生成する。終端検出信号Seは、1つのピクチャの最終画素のデータに対応して出力される。読み出し制御部29は、例えば要望か回路12において処理されるマクロブロックMBに対応する非線形検出値Gを読み出すようにアドレス信号を含む読み出し制御信号RCを生成する。従って、メモリ28には1つのピクチャに対応する数の非線形検出値Gが記憶され、それらの非線形検出値Gが読み出し制御部29によって順次読み出される。メモリ28から出力される非線形検出値RGは、差分値算出部33に供給される。尚、各マクロブロックMBの非線形検出値RGを区別する場合に、マクロブロックMBの番号mbを付した符号Gmbを用いるものとする。   In response to the termination detection signal Se, the read control unit 29 generates a read control signal RC for reading the nonlinear detection value G stored in the memory 28. The end detection signal Se is output corresponding to the data of the last pixel of one picture. The read control unit 29 generates a read control signal RC including an address signal so as to read the non-linear detection value G corresponding to the macro block MB processed in the circuit 12 if desired. Accordingly, the number of nonlinear detection values G corresponding to one picture is stored in the memory 28, and these nonlinear detection values G are sequentially read out by the read control unit 29. The nonlinear detection value RG output from the memory 28 is supplied to the difference value calculation unit 33. In addition, when distinguishing the nonlinear detection value RG of each macroblock MB, the code | symbol Gmb which attached | subjected the number mb of macroblock MB shall be used.

短波長検出部30は、非線形値算出部22から出力される非線形検出値Gmbと、設定レジスタ21から供給されるマクロブロック判定用しきい値MBthとを比較し、その比較結果に応じた検出値MMを出力する。短波長検出部30は、非線形検出値Gmbがしきい値MBthより大きい場合に第1の所定値(例えば「1」)の検出値MMを出力し、非線形検出値Gmbがしきい値MBth以下の場合に第2の所定値(例えば「0」)の検出値MMを出力する。   The short wavelength detection unit 30 compares the non-linear detection value Gmb output from the non-linear value calculation unit 22 with the macroblock determination threshold value MBth supplied from the setting register 21 and detects the detection value according to the comparison result. Output MM. The short wavelength detection unit 30 outputs a detection value MM having a first predetermined value (for example, “1”) when the nonlinear detection value Gmb is larger than the threshold value MBth, and the nonlinear detection value Gmb is equal to or less than the threshold value MBth. In this case, a detection value MM having a second predetermined value (for example, “0”) is output.

マクロブロック判定用しきい値MBthは、マクロブロックにおける非線形ポイントのカウント値に対するしきい値であり、マクロブロックに対応する画像に含まれる周波数成分について、量子化ステップの変更が必要か否かを判定するための設定値である。短波長成分は、高周波成分であり、非線形ポイントによって生じる。従って、しきい値MBthは、多くの短波長成分を含むマクロブロックについて量子化ステップの変更が必要であると判定するように設定される。従って、検出値MMが第1の所定値「1」の場合、当該検出値MMに対応するマクロブロックMBについて、量子化ステップの変更が必要であることを示し、検出値MMが第2の所定値「0」の場合に量子化ステップの変更が必要ないことを示す。   The macroblock determination threshold MBth is a threshold for the non-linear point count value in the macroblock, and determines whether the quantization step needs to be changed for the frequency component included in the image corresponding to the macroblock. It is a set value for The short wavelength component is a high frequency component and is generated by a non-linear point. Therefore, the threshold value MBth is set so as to determine that the quantization step needs to be changed for a macroblock including many short wavelength components. Therefore, when the detection value MM is the first predetermined value “1”, it indicates that the quantization step needs to be changed for the macroblock MB corresponding to the detection value MM, and the detection value MM is the second predetermined value. A value of “0” indicates that the quantization step need not be changed.

累積加算部31は、短波長検出部30から出力される検出値MMを累積加算し、その加算結果の累積値Hを出力する。つまり、累積加算部31は、値を記憶するレジスタを有し、そのレジスタに記憶した記憶値に、短波長検出部30から出力される検出値MMを加算し、その加算結果をレジスタに記憶する。そして、累積加算部31は、レジスタに記憶した累積値Hを出力する。この累積値Hは、細分化判定部32に供給される。   The cumulative addition unit 31 cumulatively adds the detection values MM output from the short wavelength detection unit 30, and outputs a cumulative value H as a result of the addition. That is, the cumulative addition unit 31 has a register for storing a value, adds the detection value MM output from the short wavelength detection unit 30 to the stored value stored in the register, and stores the addition result in the register. . Then, the cumulative addition unit 31 outputs the cumulative value H stored in the register. The accumulated value H is supplied to the segmentation determination unit 32.

尚、累積加算部31は、画面先頭検出部23から出力されるクリア信号Scに応答して記憶値をクリア(=0)する。従って、累積加算部31は、短波長検出部30から出力される検出値MMを、ピクチャ単位で累積加算する。   The cumulative addition unit 31 clears the stored value (= 0) in response to the clear signal Sc output from the screen head detection unit 23. Accordingly, the cumulative addition unit 31 cumulatively adds the detection value MM output from the short wavelength detection unit 30 in units of pictures.

即ち、短波長検出部30と累積加算部31は、ピクチャ単位、つまり1つのピクチャに含まれるマクロブロックMBのうち、量子化ステップの変更が必要なマクロブロックMBの数を検出する。つまり、短波長検出部30と累積加算部31は、次式に対応する処理を実行し、累積値Hを出力する。   That is, the short wavelength detection unit 30 and the cumulative addition unit 31 detect the number of macroblocks MB that need to be changed in the quantization step among the macroblocks MB included in one picture, that is, one picture. That is, the short wavelength detection unit 30 and the cumulative addition unit 31 execute processing corresponding to the following equation and output the cumulative value H.

Figure 0005375590
細分化判定部32は、累積加算部31から供給される累積値Hと、設定レジスタ21から供給されるピクチャ判定用しきい値Qth,総マクロブロック数Pに基づいて、量子化ステップの変更に対する判定フラグFIを設定する。この判定フラグFIは、差分値算出部33に供給される。
Figure 0005375590
The subdivision determination unit 32 responds to the change of the quantization step based on the cumulative value H supplied from the cumulative addition unit 31, the picture determination threshold value Qth supplied from the setting register 21, and the total number of macroblocks P. A determination flag FI is set. This determination flag FI is supplied to the difference value calculation unit 33.

ピクチャ判定用しきい値Qthは、1つのピクチャに対して量子化ステップの変更を行うか否かを判定するためのしきい値であり、1つのピクチャに含まれる総マクロブロック数Pに対する量子化ステップが必要と判定されたマクロブロック数の比率として設定されている。これにより、ピクチャサイズの異なる画像についても、同じしきい値Qthを用いることができる。   The picture determination threshold value Qth is a threshold value for determining whether or not to change the quantization step for one picture, and the quantization for the total number of macroblocks P included in one picture It is set as a ratio of the number of macroblocks determined to require a step. Accordingly, the same threshold value Qth can be used for images having different picture sizes.

即ち、細分化判定部32は、累積加算部31から供給される累積値Hを設定レジスタ21から供給される総マクロブロック数Pで除算し、その演算結果と設定レジスタ21から供給されるしきい値Qthを比較する。そして、細分化判定部32は、演算結果がしきい値Qthより大きい場合に、当該ピクチャに対して量子化ステップの変更が必要と判定し、その旨を示す値(例えば、「1」、)の判定フラグFIを出力する。一方、細分化判定部32は、演算結果がしきい値Qth以下の場合に、当該ピクチャに対して量子化ステップの変更が必要ないと判定し、その旨を示す値(例えば、「0」、)の判定フラグFIを出力する。   That is, the subdivision determination unit 32 divides the cumulative value H supplied from the cumulative addition unit 31 by the total number of macroblocks P supplied from the setting register 21, and the calculation result and the threshold supplied from the setting register 21. The value Qth is compared. Then, when the calculation result is larger than the threshold value Qth, the subdivision determination unit 32 determines that the quantization step needs to be changed for the picture, and a value indicating that (for example, “1”). The determination flag FI is output. On the other hand, when the calculation result is equal to or less than the threshold value Qth, the subdivision determination unit 32 determines that the quantization step does not need to be changed for the picture, and a value indicating that (for example, “0”, ) Determination flag FI is output.

即ち、図6に示すように、1つのピクチャIpは、量子化ステップの変更を必要とする第1のマクロブロックMBaと、量子化ステップの変更を必要とする第2のマクロブロックMBbを含む。   That is, as shown in FIG. 6, one picture Ip includes a first macroblock MBa that requires a change in the quantization step and a second macroblock MBb that requires a change in the quantization step.

ピクチャIpに対する第2のマクロブロックMBbの比率が小さい場合、その第2のマクロブロックMBbに発生する量子化ノイズは、ピクチャIp全体に対して目立ち難い。つまり、視覚的に、表示された画像の品質低下は少ない。一方、ピクチャIpに対する第2のマクロブロックMBbの比率が大きい場合、その第2のマクロブロックMBbに発生する量子化ノイズは、ピクチャIp全体に対して目立ち易い。つまり、視覚的に、表示された画像の品質が低下する。つまり、細分化判定部32は、量子化ノイズが目立ち易いか否かにより、判定フラグFIを設定するということもできる。この場合、ピクチャIpに対する量子化ノイズの目立ち易いマクロブロックMBの比率によりしきい値Qthが設定されるとすることもできる。   When the ratio of the second macroblock MBb to the picture Ip is small, the quantization noise generated in the second macroblock MBb is not noticeable with respect to the entire picture Ip. In other words, there is little deterioration in the quality of the displayed image visually. On the other hand, when the ratio of the second macroblock MBb to the picture Ip is large, the quantization noise generated in the second macroblock MBb is easily noticeable with respect to the entire picture Ip. That is, the quality of the displayed image is visually deteriorated. That is, the subdivision determination unit 32 can also set the determination flag FI depending on whether quantization noise is conspicuous. In this case, the threshold value Qth may be set based on the ratio of the macroblock MB in which quantization noise is conspicuous with respect to the picture Ip.

差分値算出部33は、細分化判定部32から供給されるフラグFIに基づいて、量子化ステップの変更が必要な場合に、平均値算出部27から供給される平均値EAと、メモリ28から読み出された非線形検出値Gと、設定レジスタ21から供給されるパラメータセットPsに基づいて、次式により、差分値mb_qp_delta (以下、差分値MDとする)を算出する。一方、差分値算出部33は、フラグFIに基づいて、量子化ステップの変更が必要ない場合に、演算処理を行うことなく値が「0」の差分値MDを出力する。   Based on the flag FI supplied from the subdivision determination unit 32, the difference value calculation unit 33 uses the average value EA supplied from the average value calculation unit 27 and the memory 28 when the quantization step needs to be changed. Based on the read nonlinear detection value G and the parameter set Ps supplied from the setting register 21, a difference value mb_qp_delta (hereinafter referred to as a difference value MD) is calculated by the following equation. On the other hand, based on the flag FI, the difference value calculation unit 33 outputs the difference value MD having a value of “0” without performing arithmetic processing when the quantization step does not need to be changed.

Figure 0005375590
上記式において、「Clip3」は、値を設定された範囲内の値に制限する処理を示す。例えば、「R=Clpi3(x、y、z)」は、xが範囲の下限値を、yが範囲の上限値を、zが対象の値(演算結果)を、Rが処理結果を示す。値zが下限値以下の場合には処理結果R=xとし、値zが上限値y以上の場合には処理結果R=yとし、値zが下限値xと上限値yとの間の値の場合には処理結果R=zとする。
Figure 0005375590
In the above formula, “Clip 3” indicates processing for limiting the value to a value within the set range. For example, “R = Clpi3 (x, y, z)” indicates that x is the lower limit value of the range, y is the upper limit value of the range, z is the target value (calculation result), and R is the processing result. When the value z is less than or equal to the lower limit value, the processing result R = x. When the value z is greater than or equal to the upper limit value y, the processing result R = y, and the value z is a value between the lower limit value x and the upper limit value y. In this case, the processing result R = z.

差分値MDは、符号化回路12の量子化部12b(図1参照)において用いられる量子化パラメータQPに対応する値である。さらに詳しくは、差分値MDは、量子化部12bにおいて処理されるマクロブロックの量子化パラメータQPと、その直前に処理されたマクロブロックの量子化パラメータQPの差分値である。量子化パラメータQP(Quantization Parameter)は量子化ステップと対応する。例えば、H.264/AVC符号化規格では、量子化パラメータQPと量子化ステップの対数が比例する。従って、差分値MDの値を変更することは、量子化パラメータQPを変更すること、即ち量子化ステップを変更することである。そして、差分値MDが「0」の場合、直前のマクロブロックに対する量子化ステップが維持され、差分値MDが「0」以外の場合、量子化ステップが変更される。   The difference value MD is a value corresponding to the quantization parameter QP used in the quantization unit 12b (see FIG. 1) of the encoding circuit 12. More specifically, the difference value MD is a difference value between the quantization parameter QP of the macroblock processed in the quantization unit 12b and the quantization parameter QP of the macroblock processed immediately before. A quantization parameter QP (Quantization Parameter) corresponds to the quantization step. For example, H.M. In the H.264 / AVC coding standard, the quantization parameter QP and the logarithm of the quantization step are proportional. Therefore, changing the value of the difference value MD means changing the quantization parameter QP, that is, changing the quantization step. When the difference value MD is “0”, the quantization step for the immediately preceding macroblock is maintained, and when the difference value MD is other than “0”, the quantization step is changed.

上記したように、差分値MDは、1つのピクチャにおける非線形検出値Gの平均値EAと、各マクロブロックの非線形検出値Gに基づいて算出される。従って、量子化制御回路13は、マクロブロックの非線形検出値Gに応じて、そのマクロブロックに対する量子化ステップを制御する。また、量子化制御回路13は、1つのピクチャに含まれる非線形なマクロブロックの数に応じて、量子化ステップの制御/非制御を判定する。   As described above, the difference value MD is calculated based on the average value EA of the non-linear detection values G in one picture and the non-linear detection value G of each macroblock. Therefore, the quantization control circuit 13 controls the quantization step for the macroblock according to the non-linear detection value G of the macroblock. Further, the quantization control circuit 13 determines control / non-control of the quantization step according to the number of nonlinear macroblocks included in one picture.

各マクロブロックの非線形検出値Gを平均値EAから減算することは、非線形検出値Gと平均値EAから算出する差分値MDを、上記設定範囲内において、非線形検出値Gと反比例するように生成することである。これにより、非線形検出値Gが大きいほど、差分値MDが小さくなり、量子化ステップが細かくなる。即ち、非線形ポイントが多いマクロブロックMB、つまり短波長性(高周波性)の高いマクロブロックMBほど量子化ステップを細かくする。   Subtracting the non-linear detection value G of each macroblock from the average value EA generates a difference value MD calculated from the non-linear detection value G and the average value EA so as to be inversely proportional to the non-linear detection value G within the above setting range. It is to be. Thereby, the larger the nonlinear detection value G, the smaller the difference value MD and the finer the quantization step. That is, the quantization step is made finer for a macroblock MB having many nonlinear points, that is, a macroblock MB having a short wavelength (high frequency).

差分値MDは、非線形検出値Gが平均値EAと等しいときにゼロ(0)になり、量子化部12bにおいて量子化ステップは変更されない。そして、非線形検出値Gが平均値EAより小さいとき、差分値MDは「0」より大きな値となり、量子化部12bにおける量子化ステップは、平均値EAと等しい非線形検出値Gによる量子化ステップよりも粗くなる。   The difference value MD becomes zero (0) when the nonlinear detection value G is equal to the average value EA, and the quantization step is not changed in the quantization unit 12b. When the nonlinear detection value G is smaller than the average value EA, the difference value MD is larger than “0”, and the quantization step in the quantization unit 12b is more than the quantization step using the nonlinear detection value G equal to the average value EA. Also becomes rough.

量子化ステップを細かくすることは、可変長符号化変換により生成された符号データのデータ量を多くし、量子化ステップを粗くすることは、可変長符号化変換により生成された符号データのデータ量を少なくする。従って、量子化ステップを粗くすることにより、可変長符号化変換により生成された符号データの量の増加を抑制することができる。   Making the quantization step finer increases the amount of code data generated by variable-length coding conversion, and making the quantization step coarser means that the amount of code data generated by variable-length coding conversion. Reduce. Therefore, by increasing the quantization step, it is possible to suppress an increase in the amount of code data generated by variable length coding conversion.

次に、上記のように構成された符号化装置の動作を説明する。
図7に示すステップ51〜67は、符号化装置が実行する処理を示す。そして、ステップ51〜59は図1に示す量子化制御回路13が実行する処理を示し、ステップ60〜67は図1に示す符号化回路12が実行する処理を示す。従って、各ステップに対応する回路の動作として説明する。
Next, the operation of the encoding apparatus configured as described above will be described.
Steps 51 to 67 shown in FIG. 7 indicate processing executed by the encoding device. Steps 51 to 59 show processing executed by the quantization control circuit 13 shown in FIG. 1, and Steps 60 to 67 show processing executed by the encoding circuit 12 shown in FIG. Therefore, the operation of the circuit corresponding to each step will be described.

ステップ51において、量子化制御回路13は、入力画像の受信を開始を検出すると、非線形検出値Gに対する累積値SGと、短波長検出値MMに対する累積値Hをクリアする。   In step 51, when the quantization control circuit 13 detects the start of reception of the input image, the quantization control circuit 13 clears the cumulative value SG for the non-linear detection value G and the cumulative value H for the short wavelength detection value MM.

ステップ52において、量子化制御回路13は、入力画像のマクロブロックMB毎に、非線形ポイントをカウントし、そのカウント値を非線形検出値Gとする。そして、量子化制御回路13は、非線形検出値Gを累積加算し、加算結果を累積値SGとする。また、量子化制御回路13は、非線形検出値Gとしきい値MBthとを比較してマクロブロックMBの短波長性を検出し、その検出値MMを累積加算し、加算結果を累積値Hとする。   In step 52, the quantization control circuit 13 counts the non-linear points for each macro block MB of the input image, and sets the count value as the non-linear detection value G. Then, the quantization control circuit 13 cumulatively adds the nonlinear detection value G and sets the addition result as a cumulative value SG. Further, the quantization control circuit 13 compares the nonlinear detection value G with the threshold value MBth to detect the short wavelength property of the macroblock MB, cumulatively adds the detection value MM, and sets the addition result as the cumulative value H. .

そして、ステップ53において、量子化制御回路13は、算出した非線形検出値Gを、メモリ28のマクロブロックMBに対応する領域に格納する。
ステップ54において、量子化制御回路13は、1ピクチャ分の入力画像の受信を終了したか否かを判断し、受信が終了していない場合にステップ52に移行し、受信が終了した場合に次のステップに移行する。
In step 53, the quantization control circuit 13 stores the calculated nonlinear detection value G in an area corresponding to the macro block MB in the memory 28.
In step 54, the quantization control circuit 13 determines whether or not the reception of the input image for one picture has been completed. If the reception has not been completed, the process proceeds to step 52. Move on to the step.

ステップ55において、量子化制御回路13は、1つのピクチャに対する累積値Hと総マクロブロック数Pに基づいて、1つのピクチャにおいて短波長と判定されたマクロブロックの比率を算出し、その比率値としきい値Qthとを比較して、その比較結果に応じて判定フラグFIを設定する。つまり、量子化制御回路13は、1つのピクチャに対する量子化ステップ変更の要否を判定し、判定フラグFIを設定する。   In step 55, the quantization control circuit 13 calculates the ratio of macroblocks determined to be short wavelength in one picture based on the accumulated value H and the total number of macroblocks P for one picture, and sets the ratio value as the ratio value. The threshold value Qth is compared, and the determination flag FI is set according to the comparison result. That is, the quantization control circuit 13 determines whether it is necessary to change the quantization step for one picture, and sets the determination flag FI.

ステップ56において、量子化制御回路13は、判定フラグFIに基づいて、その判定フラグが眞(=true:1)の場合に次のステップ57に移行し、判定フラグFIが偽(=false:0)の場合にステップ60に移行する。即ち、量子化制御回路13は、1つのピクチャに対して量子化ステップの変更が必要と判定した場合にステップ57〜59の処理を実行し、量子化ステップの変更が必要ないと判定した場合にステップ57〜59の処理をスキップする。   In step 56, based on the determination flag FI, the quantization control circuit 13 proceeds to the next step 57 when the determination flag is 眞 (= true: 1), and the determination flag FI is false (= false: 0). ) Go to Step 60. That is, the quantization control circuit 13 executes the processing of steps 57 to 59 when it is determined that the quantization step needs to be changed for one picture, and when it is determined that the quantization step does not need to be changed. Steps 57 to 59 are skipped.

ステップ57において、量子化制御回路13は、累積値SGに基づいて、1つのピクチャにおける非線形検出値Gの平均値EA(EdgeAverage )を算出する。
ステップ58において、量子化制御回路13は、メモリ28から非線形検出値Gを読み出す。そして、ステップ59において、量子化制御回路13は、読み出した非線形検出値Gに基づいて差分値MDを算出する。
In step 57, the quantization control circuit 13 calculates an average value EA (EdgeAverage) of the nonlinear detection values G in one picture based on the accumulated value SG.
In step 58, the quantization control circuit 13 reads the nonlinear detection value G from the memory 28. In step 59, the quantization control circuit 13 calculates a difference value MD based on the read nonlinear detection value G.

ステップ60において、符号化回路12は、マクロブロック単位の画像データを直交変換(離散コサイン変換:DCT)し、その変換後のデータを差分値MDに基づく量子化ステップにて量子化する。なお、図7に示すステップの実行開始時において、差分値MDがクリアされている。従って、量子化制御回路13がステップ58〜59をスキップした場合、符号化回路12には、クリアされた差分値MD(=0)が入力される。従って、符号化回路12は、そのクリアされた差分値MDに基づいて、先に処理したのマクロブロックMBに対する量子化ステップにて、今のマクロブロックMBの画像データを量子化する。   In step 60, the encoding circuit 12 performs orthogonal transform (discrete cosine transform: DCT) on the image data in units of macroblocks, and quantizes the converted data in a quantization step based on the difference value MD. Note that the difference value MD is cleared at the start of execution of the steps shown in FIG. Therefore, when the quantization control circuit 13 skips steps 58 to 59, the cleared difference value MD (= 0) is input to the encoding circuit 12. Therefore, the encoding circuit 12 quantizes the image data of the current macroblock MB in the quantization step for the previously processed macroblock MB based on the cleared difference value MD.

ステップ61において、符号化回路12は、ステップ60における変換処理により生成された画像データを、可変長符号化変換し、変換後のデータ(符号化データSo)を出力する。   In step 61, the encoding circuit 12 performs variable length encoding conversion on the image data generated by the conversion processing in step 60, and outputs the converted data (encoded data So).

ステップ62において、符号化回路12は、ステップ60における変換処理により生成された画像データ(量子化係数)を、逆量子化して変換係数を再生する。更に、符号化回路12は、再生された変換係数を逆直交変換(逆離散コサイン変換:逆DCT)する。つまり、符号化回路12は、量子化により生成した量子化係数を復号する。   In step 62, the encoding circuit 12 dequantizes the image data (quantization coefficient) generated by the conversion process in step 60 to reproduce the conversion coefficient. Further, the encoding circuit 12 performs inverse orthogonal transform (inverse discrete cosine transform: inverse DCT) on the reconstructed transform coefficient. That is, the encoding circuit 12 decodes the quantized coefficient generated by the quantization.

ステップ63において、符号化回路12は、デブロッキングフィルタによる処理を行い、復号後の画像データ中のブロック歪みを除去する。
ステップ64において、符号化回路12は、画面内予測処理を行い、図示しないフレームメモリに格納されている参照フレームを参照してブロック単位の予測画像を生成する。
In step 63, the encoding circuit 12 performs a process using a deblocking filter, and removes block distortion in the decoded image data.
In step 64, the encoding circuit 12 performs an intra-screen prediction process, and generates a prediction image for each block with reference to a reference frame stored in a frame memory (not shown).

ステップ65において、符号化回路12は、動き補償処理を行い、図示しないフレームメモリに格納されている参照フレームを参照して動きベクトルを生成する。
ステップ66において、符号化回路12は、ステップ64,65の処理結果に基づき、ローカルデコード画(予測フレーム)を生成する。
In step 65, the encoding circuit 12 performs a motion compensation process, and generates a motion vector with reference to a reference frame stored in a frame memory (not shown).
In step 66, the encoding circuit 12 generates a local decoded image (predicted frame) based on the processing results of steps 64 and 65.

ステップ67において、符号化回路12は、ローカルデコード画と入力画像との差分を取得する。符号化回路12は、ステップ60における処理について、ステップ67において取得した差分を含めて直交変換及び量子化を行う。   In step 67, the encoding circuit 12 acquires a difference between the local decoded image and the input image. The encoding circuit 12 performs orthogonal transformation and quantization on the processing in step 60 including the difference acquired in step 67.

以上記述したように、本実施形態によれば、以下の効果を奏する。
(1)量子化制御回路13は、所定サイズのピクチャIpを分割したマクロブロックMB毎に、マクロブロックMBに含まれ隣接する画素値の差に応じて非線形検出値Gを算出し、その非線形検出値Gに応じてマクロブロックMBを量子化する際の量子化ステップを制御する量子化パラメータを変更するようにした。
As described above, according to the present embodiment, the following effects can be obtained.
(1) The quantization control circuit 13 calculates a non-linear detection value G for each macro block MB obtained by dividing a picture Ip of a predetermined size according to a difference between adjacent pixel values included in the macro block MB, and detects the non-linear detection thereof. The quantization parameter for controlling the quantization step when the macroblock MB is quantized is changed according to the value G.

非線形検出値Gは、マクロブロックに含まれる画素の値(以下、単に画素値という)が線形的に変化しないポイント、即ち非線形なポイントの数に対応する。大きな非線形検出値Gのマクロブロックは、小さな非線形検出値Gのマクロブロックに比べ、多くのエッジを含む、つまり直交変換したデータに高周波成分が多いことを示す。従って、非線形ポイントが多いマクロブロックMB、つまり短波長性(高周波性)の高いマクロブロックMBほど量子化ステップを細かくすることで、量子化ノイズを低減することができる。   The nonlinear detection value G corresponds to the number of points at which the pixel values (hereinafter simply referred to as pixel values) included in the macroblock do not change linearly, that is, the number of nonlinear points. A macroblock having a large non-linear detection value G includes more edges than a macro block having a small non-linear detection value G, that is, it indicates that there are many high-frequency components in orthogonally transformed data. Therefore, the quantization noise can be reduced by making the quantization step finer for the macroblock MB having more nonlinear points, that is, the macroblock MB having a higher short wavelength property (high frequency property).

(2)量子化制御回路13の非線形値算出部22は、マクロブロックMB毎に、マクロブロックMB内の画素列における画素値の差に応じて非線形検出値Gをカウントアップ算出する。差分値算出部33は、非線形検出値に基づいて量子化ステップを制御する差分値を算出する。従って、非線形検出値Gに応じた量子化パラメータ(差分値)を容易に算出することができる。   (2) The non-linear value calculation unit 22 of the quantization control circuit 13 counts up the non-linear detection value G for each macro block MB according to the difference in pixel values in the pixel columns in the macro block MB. The difference value calculation unit 33 calculates a difference value for controlling the quantization step based on the nonlinear detection value. Accordingly, the quantization parameter (difference value) corresponding to the nonlinear detection value G can be easily calculated.

(3)量子化制御回路13の累積加算部26は、非線形検出値を累積加算する。平均値算出部27は、累積値SGと、ピクチャIpの画面サイズ設定値Szに基づいて、当該ピクチャIpにおける非線形検出値Gの平均値EAを算出する。そして、差分値算出部33は、平均値EAと非線形検出値RGとに基づいて量子化ステップを制御するための差分値MDを算出する。従って、非線形検出値Gが大きいほど、差分値MDが小さくなり、量子化ステップが細かくすることができる。   (3) The cumulative addition unit 26 of the quantization control circuit 13 cumulatively adds the nonlinear detection values. The average value calculation unit 27 calculates the average value EA of the nonlinear detection values G in the picture Ip based on the accumulated value SG and the screen size setting value Sz of the picture Ip. Then, the difference value calculation unit 33 calculates a difference value MD for controlling the quantization step based on the average value EA and the non-linear detection value RG. Therefore, the larger the non-linear detection value G, the smaller the difference value MD and the finer the quantization step.

(4)量子化制御回路13は、非線形検出値に応じて短波長のピクチャIpを検出し、その検出結果に基づいて、ピクチャIpに対して量子化ステップを変更するか否かを示すための判定フラグを設定し、判定フラグに応じて、量子化ステップの変更が必要と判定したピクチャに対して算出した差分値を出力し、量子化ステップの変更が不要と判定したピクチャに対して所定値の差分値を出力するようにした。従って、量子化ステップの制御/非制御を容易に判定することができる。   (4) The quantization control circuit 13 detects the short wavelength picture Ip according to the non-linear detection value, and indicates whether or not to change the quantization step for the picture Ip based on the detection result. A determination flag is set, and a difference value calculated for a picture determined to require a change in quantization step is output in accordance with the determination flag, and a predetermined value is set for a picture determined to require no change in the quantization step. The difference value of was output. Therefore, control / non-control of the quantization step can be easily determined.

(5)短波長検出部30は、非線形検出値Gとしきい値MBthとを比較して短波長のマクロブロックMBを検出した旨の検出値MMを生成する。累積加算部31は検出値MMを累積加算する。細分化判定部32は、累積値HとピクチャIpに含まれるマクロブロックMBの数Pに基づいて、ピクチャIpに含まれる短波長と判定したマクロブロックMBの比率を算出し、その比率としきい値Qthとを比較して判定フラグFIを設定する。従って、各ピクチャIpに対する量子化ステップの制御/非制御を容易に判定することができる。   (5) The short wavelength detection unit 30 compares the nonlinear detection value G with the threshold value MBth and generates a detection value MM indicating that the short wavelength macroblock MB has been detected. The cumulative addition unit 31 cumulatively adds the detection value MM. Based on the accumulated value H and the number P of macroblocks MB included in the picture Ip, the subdivision determination unit 32 calculates a ratio of the macroblocks MB determined to be a short wavelength included in the picture Ip, and the ratio and threshold value The determination flag FI is set by comparing with Qth. Therefore, the control / non-control of the quantization step for each picture Ip can be easily determined.

(6)非線形値算出部22は、3つの画素値のうちの2つから線形予測値を算出し、線形予測値の算出に用いなかった画素値と線形予測値との差を算出し、その差分値としきい値とを比較して非線形検出値Gを算出するようにした。その結果、マクロブロックMBに含まれるエッジなどの非線形なポイントを検出し、マクロブロックMBにおける非線形ポイントの数を容易に算出することができる。   (6) The nonlinear value calculation unit 22 calculates a linear prediction value from two of the three pixel values, calculates a difference between the pixel value not used for calculating the linear prediction value and the linear prediction value, and The non-linear detection value G is calculated by comparing the difference value with the threshold value. As a result, nonlinear points such as edges included in the macroblock MB can be detected, and the number of nonlinear points in the macroblock MB can be easily calculated.

尚、上記実施形態は、以下の態様で実施してもよい。
・非線形値算出部22において、3つの画素値を含む画素列において、その画素列に含まれる両端の第1の画素値と第3の画素値から線形予測値を算出し、その線形算出値と画素列の中央の第2の画素値との差分値を算出し、その差分値としきい値とを比較して線形ポイントを判定する。
In addition, you may implement the said embodiment in the following aspects.
In the non-linear value calculation unit 22, in a pixel column including three pixel values, a linear prediction value is calculated from the first pixel value and the third pixel value at both ends included in the pixel column, and the linear calculation value A difference value from the second pixel value at the center of the pixel row is calculated, and the linear value is determined by comparing the difference value with a threshold value.

・非線形値算出部22における画素列に含まれる画素の数を適宜変更する。例えば、2つの画素を含む画素列について、非線形ポイントの判定を行う。非線形値算出部22は、2つの画素値の差分値の絶対値を算出し、その絶対値と画素列の方向に対応するしきい値とを比較し、絶対値がしきい値より大きい場合に、当該画素列が非線形ポイントを含むと判定する。従って、非線形値算出部22は、以下の式により、マクロブロックMBに対する非線形検出値Gを算出する。   The number of pixels included in the pixel column in the nonlinear value calculation unit 22 is changed as appropriate. For example, a non-linear point is determined for a pixel column including two pixels. The nonlinear value calculation unit 22 calculates an absolute value of a difference value between two pixel values, compares the absolute value with a threshold value corresponding to the direction of the pixel column, and when the absolute value is larger than the threshold value. , It is determined that the pixel column includes a non-linear point. Therefore, the non-linear value calculation unit 22 calculates the non-linear detection value G for the macroblock MB by the following equation.

Figure 0005375590
上記の構成により、マクロブロック単位での高周波度(画素値変化の激しさ)を算出することができる。
Figure 0005375590
With the above configuration, it is possible to calculate the high-frequency level (the intensity of pixel value change) in units of macroblocks.

例えば、図8(a)に示すように、3つの画素A,B,Cの画素値を、「5」,「6」,「30」とする。図8(b)は、各画素A〜Cの画素値を棒グラフとして示す。
非線形値算出部22は、画素A,Bの画素値の差分値D(=1)を算出し、その差分値Dとしきい値(例えば水平用しきい値Hth)と比較する。例えば、水平用しきい値Hthを「5」とすると、差分値Dはしきい値Hthより小さいため、非線形値算出部22は、この画素A,B間は、非線形ポイントではない、と判定する。
For example, as shown in FIG. 8A, the pixel values of three pixels A, B, and C are “5”, “6”, and “30”. FIG. 8B shows the pixel values of the pixels A to C as a bar graph.
The nonlinear value calculator 22 calculates a difference value D (= 1) between the pixel values of the pixels A and B, and compares the difference value D with a threshold value (for example, a horizontal threshold value Hth). For example, if the horizontal threshold value Hth is “5”, the difference value D is smaller than the threshold value Hth, so the nonlinear value calculation unit 22 determines that the pixel A is not a nonlinear point. .

次に、非線形値算出部22は、画素B,Cの画素値の差分値D(=26)を算出し、その差分値Dとしきい値(例えば水平用しきい値Hth)と比較する。この場合、差分値Dはしきい値Hthより大きいため、非線形値算出部22は、この画素B,C間は、非線形ポイントである、と判定する。このように、非線形ポイントをカウントすることにより、マクロブロックMB単位での高周波度(画素値変化の激しさ)を検出することができる。   Next, the nonlinear value calculation unit 22 calculates a difference value D (= 26) between the pixel values of the pixels B and C, and compares the difference value D with a threshold value (for example, a horizontal threshold value Hth). In this case, since the difference value D is larger than the threshold value Hth, the nonlinear value calculation unit 22 determines that the pixel B and C are nonlinear points. Thus, by counting the non-linear points, it is possible to detect the high frequency (intensity of change in pixel value) in units of macroblock MB.

・マクロブロックのサイズを16×16画素以外の画素数、例えば、8×8画素,4×4画素などのように、サイズを適宜変更する。また、例えば8×16画素のように、縦の画素数と横の画素数を異なる値に設定したマクロブロック毎に非線形検出値Gを算出する。   Change the size of the macro block as appropriate, such as the number of pixels other than 16 × 16 pixels, for example, 8 × 8 pixels, 4 × 4 pixels, etc. Further, the nonlinear detection value G is calculated for each macroblock in which the number of vertical pixels and the number of horizontal pixels are set to different values, for example, 8 × 16 pixels.

・量子化制御回路13が画像メモリ11に記憶された画像データをマクロブロック単位で読み出して制御情報を生成する、即ち画像メモリ11に記憶されたピクチャについて量子化ステップの細分化を判定する。このように、画像メモリ11に記憶された画像データを読み出す場合、画面先頭検出部23は、画像データの読み出し開始時にクリア信号Scと先頭検出信号Ssを出力し、画面終端検出部25は、読み出し終了時に終端検出信号Seを出力するように変更されればよい。また、読み出し開始を示す信号をクリア信号Scと先頭検出信号Ssとして用い、読み出し終了を示す信号を終端検出信号Seとして用いることで、両検出部23,25を省略してもよい。   The quantization control circuit 13 reads out the image data stored in the image memory 11 in units of macroblocks to generate control information, that is, determines the subdivision of the quantization step for the picture stored in the image memory 11. As described above, when the image data stored in the image memory 11 is read, the screen head detection unit 23 outputs the clear signal Sc and the head detection signal Ss at the start of reading the image data, and the screen end detection unit 25 reads the data. What is necessary is just to change so that the termination | terminus detection signal Se may be output at the time of completion | finish. Further, both the detection units 23 and 25 may be omitted by using a signal indicating the start of reading as the clear signal Sc and the head detection signal Ss and using a signal indicating the end of reading as the end detection signal Se.

・図3に示す短波長検出部30、累積加算部31、細分化判定部32を省略し、全てのピクチャについて、差分値MDを算出する。
・図7に示すステップ55,56を省略し、全てのピクチャについて、差分値MDを算出する。
-The short wavelength detection part 30, the accumulation addition part 31, and the subdivision determination part 32 which are shown in FIG. 3 are abbreviate | omitted, and the difference value MD is calculated about all the pictures.
Steps 55 and 56 shown in FIG. 7 are omitted, and difference values MD are calculated for all the pictures.

・画像のコード変換(例えば、規格MPEG2から規格H.264へ)を行う画像処理装置の符号化回路に適用する。
・設定レジスタ21に記憶した各種パラメータのうちの少なくとも1つを固定値としてそのパラメータを用いる処理部に設定する。
The present invention is applied to an encoding circuit of an image processing apparatus that performs image code conversion (for example, from standard MPEG2 to standard H.264).
At least one of various parameters stored in the setting register 21 is set as a fixed value in a processing unit that uses the parameter.

・符号化回路12と量子化制御回路13とを1つの回路として実施する。また、符号化回路12と量子化制御回路13のうちの少なくとも一方を、図7に示すステップを含むプログラムを実行するプロセッサ(例えばCPU)とすること。   The encoding circuit 12 and the quantization control circuit 13 are implemented as one circuit. Further, at least one of the encoding circuit 12 and the quantization control circuit 13 is a processor (for example, CPU) that executes a program including the steps shown in FIG.

上記各実施形態に関し、以下の付記を開示する。
(付記1)
所定サイズのブロックを分割したサブブロック毎に、サブブロックに含まれ隣接する画素値の差に応じて算出した非線形検出値に応じて前記サブブロックを量子化する際の量子化ステップを制御する量子化パラメータを変更する、ことを特徴とする量子化制御回路。
(付記2)
前記サブブロック毎に、前記サブブロック内の画素列における画素値の差に応じて非線形検出値をカウントアップ算出する非線形値算出部と、
前記非線形検出値に基づいて前記量子化ステップを制御する量子化パラメータを算出するパラメータ算出部と、
を有することを特徴とする付記1に記載の量子化制御回路。
(付記3)
前記非線形検出値を累積加算する第1の累積加算部と、
前記第1の累積加算部の累積値と、前記ブロックのサイズに基づいて、当該ブロックにおける非線形検出値の平均値を算出する平均値算出部と、
を含み、
前記パラメータ算出部は、前記平均値と前記非線形検出値とに基づいて前記量子化ステップを制御する量子化パラメータを算出する、
ことを特徴とする付記2に記載の量子化制御回路。
(付記4)
前記非線形検出値に応じて短波長のブロックを検出し、その検出結果に基づいて、前記ブロックに対して量子化ステップを変更するか否かを示すための判定フラグを設定する判定部を有し、
前記判定部の判定結果に応じて、算出値又は所定値を量子化パラメータとして出力する、
ことを特徴とする付記1〜3のうちの何れか一項に記載の量子化制御回路。
(付記5)
前記判定部は、
前記非線形検出値としきい値とを比較して短波長のサブブロックを検出した旨の検出値を生成する短波長検出部と、
前記検出値を累積加算する第2の累積加算部と、
前記第2の累積加算部の累積値とブロックに含まれるサブブロックの数に基づいて、ブロックに含まれる短波長と判定したサブブロックの比率を算出し、その比率としきい値とを比較して前記判定フラグを設定する細分化判定部と、
を含むことを特徴とする付記4に記載の量子化制御回路。
(付記6)
前記非線形値算出部は、3つの画素値のうちの2つから線形予測値を算出し、前記線形予測値の算出に用いなかった画素値と前記線形予測値との差を算出し、その差分値としきい値とを比較し、比較結果に応じて非線形検出値をカウントアップする、ことを特徴とする付記2に記載の量子化制御回路。
(付記7)
前記非線形値算出部は、隣接する2つの画素値の差を算出し、その差分値としきい値とを比較し、比較結果に応じて非線形検出値をカウントアップする、ことを特徴とする付記2に記載の量子化制御回路。
(付記8)
前記ブロックの画像データの先頭を検出して先頭検出信号を生成する先頭検出部と、
前記ブロックの画像の終端を検出して終端検出信号を生成する終端検出部と、
前記先頭検出信号に応答して前記非線形検出値をメモリに書き込む制御を行う書き込み制御部と、
前記終端検出信号に応答して前記メモリから非線形検出値を読み出す制御を行う読み出し制御部と、
を有し、
前記パラメータ算出部は、前記メモリから読み出された非線形検出値に基づき前記量子化パラメータを算出する、
ことを特徴とする付記2又は3に記載の量子化制御回路。
(付記9)
所定サイズのブロックを分割したサブブロック毎に、サブブロックに含まれ隣接する画素値の差に応じて算出した非線形検出値に応じて前記サブブロックを量子化する際の量子化ステップを制御する量子化パラメータを変更する、ことを特徴とする量子化パラメータ変更方法。
(付記10)
所定サイズのブロックを分割したサブブロック毎に、サブブロックに含まれ隣接する画素値の差に応じて算出した非線形検出値に応じて前記サブブロックを量子化する際の量子化ステップを制御する量子化パラメータを変更する量子化制御回路と、
前記量子化パラメータに応じて量子化ステップを設定し、該量子化ステップにて画像データを量子化し、量子化後のデータを符号データに変換する符号化回路と、
を有する符号化回路。
The following notes are disclosed regarding the above embodiments.
(Appendix 1)
For each sub-block obtained by dividing a block of a predetermined size, a quantum for controlling a quantization step when the sub-block is quantized according to a non-linear detection value calculated according to a difference between adjacent pixel values included in the sub-block A quantization control circuit characterized by changing a quantization parameter.
(Appendix 2)
A non-linear value calculation unit that counts up a non-linear detection value according to a difference in pixel values in a pixel column in the sub block for each sub block;
A parameter calculation unit for calculating a quantization parameter for controlling the quantization step based on the non-linear detection value;
The quantization control circuit according to appendix 1, characterized by comprising:
(Appendix 3)
A first cumulative addition unit that cumulatively adds the nonlinear detection values;
An average value calculation unit that calculates an average value of nonlinear detection values in the block based on the cumulative value of the first cumulative addition unit and the size of the block;
Including
The parameter calculation unit calculates a quantization parameter for controlling the quantization step based on the average value and the nonlinear detection value;
The quantization control circuit according to appendix 2, characterized in that:
(Appendix 4)
A determination unit configured to detect a short wavelength block according to the non-linear detection value and set a determination flag for indicating whether or not to change a quantization step for the block based on the detection result; ,
According to the determination result of the determination unit, a calculated value or a predetermined value is output as a quantization parameter.
The quantization control circuit according to any one of Appendices 1 to 3, characterized in that:
(Appendix 5)
The determination unit
A short wavelength detection unit that generates a detection value indicating that a short wavelength sub-block has been detected by comparing the nonlinear detection value with a threshold value;
A second cumulative addition unit that cumulatively adds the detection values;
Based on the cumulative value of the second cumulative adder and the number of sub-blocks included in the block, a ratio of sub-blocks determined to be short wavelengths included in the block is calculated, and the ratio is compared with a threshold value. A subdivision determination unit for setting the determination flag;
The quantization control circuit according to appendix 4, characterized by comprising:
(Appendix 6)
The nonlinear value calculation unit calculates a linear prediction value from two of the three pixel values, calculates a difference between the pixel value not used to calculate the linear prediction value and the linear prediction value, and the difference The quantization control circuit according to appendix 2, wherein the value is compared with a threshold value, and the non-linear detection value is counted up according to the comparison result.
(Appendix 7)
The non-linear value calculation unit calculates a difference between two adjacent pixel values, compares the difference value with a threshold value, and counts up the non-linear detection value according to the comparison result. A quantization control circuit according to 1.
(Appendix 8)
A head detection unit that detects the head of the image data of the block and generates a head detection signal;
An end detection unit that detects the end of the image of the block and generates an end detection signal;
A write control unit for performing control to write the non-linear detection value in a memory in response to the head detection signal;
A read control unit that performs control to read a non-linear detection value from the memory in response to the termination detection signal;
Have
The parameter calculation unit calculates the quantization parameter based on a non-linear detection value read from the memory;
4. The quantization control circuit according to appendix 2 or 3, characterized by the above.
(Appendix 9)
For each sub-block obtained by dividing a block of a predetermined size, a quantum for controlling a quantization step when the sub-block is quantized according to a non-linear detection value calculated according to a difference between adjacent pixel values included in the sub-block A quantization parameter changing method characterized by changing a quantization parameter.
(Appendix 10)
For each sub-block obtained by dividing a block of a predetermined size, a quantum for controlling a quantization step when the sub-block is quantized according to a non-linear detection value calculated according to a difference between adjacent pixel values included in the sub-block A quantization control circuit for changing the quantization parameter;
An encoding circuit that sets a quantization step according to the quantization parameter, quantizes the image data in the quantization step, and converts the quantized data into code data;
An encoding circuit.

12 符号化回路
12b 量子化部
13 量子化制御回路
22 非線形値算出部
33 差分値算出部(量子化パラメータ算出部)
G,Gmb 非線形検出値
H 累積値
MD 差分値(量子化パラメータ:mb_qp_delta)
Ip ピクチャ(ブロック)
MB マクロブロック(サブブロック)
x,y 画素,画素値
DESCRIPTION OF SYMBOLS 12 Coding circuit 12b Quantization part 13 Quantization control circuit 22 Nonlinear value calculation part 33 Difference value calculation part (quantization parameter calculation part)
G, Gmb Nonlinear detection value H Cumulative value MD Difference value (quantization parameter: mb_qp_delta)
Ip picture (block)
MB macroblock (sub-block)
a x, y pixel, pixel value

Claims (6)

所定数の画素データを有するブロックを分割したサブブロック毎に、前記サブブロックに含まれ所定の方向に連続して隣接する3つの画素の内の隣接する2つの画素の画素値の差に応じて線形予測値を算出し、前記連続する3つの画素の内の前記隣接する2つの画素とは異なる画素の画素値と前記線形予測値との差に基づいた非線形検出値に応じて前記サブブロックを量子化する際の量子化ステップを制御する量子化パラメータを変更する、ことを特徴とする量子化制御回路。 For each sub-block obtained by dividing a block having a predetermined number of pixel data, depending on the difference between the pixel values of two adjacent pixels of the three pixels adjacent in succession in a predetermined direction included in the sub-block A linear prediction value is calculated , and the sub-block is determined according to a non-linear detection value based on a difference between a pixel value of a pixel different from the adjacent two pixels of the three consecutive pixels and the linear prediction value. A quantization control circuit characterized by changing a quantization parameter for controlling a quantization step at the time of quantization. 前記隣接する2つの画素とは異なる画素の画素値と前記線形予測値との差に応じて非線形検出値をカウントアップ算出する非線形値算出部と、
前記非線形検出値に基づいて前記量子化ステップを制御する量子化パラメータを算出するパラメータ算出部と、
を有することを特徴とする請求項1に記載の量子化制御回路。
A non-linear value calculation unit that counts up a non-linear detection value according to a difference between a pixel value of a pixel different from the two adjacent pixels and the linear prediction value ;
A parameter calculation unit for calculating a quantization parameter for controlling the quantization step based on the non-linear detection value;
The quantization control circuit according to claim 1, comprising:
前記非線形検出値を累積加算する第1の累積加算部と、
前記第1の累積加算部の累積値と、前記ブロックのサイズに基づいて、当該ブロックにおける非線形検出値の平均値を算出する平均値算出部と、
を含み、
前記パラメータ算出部は、前記平均値と前記非線形検出値とに基づいて前記量子化ステップを制御する量子化パラメータを算出する、
ことを特徴とする請求項2に記載の量子化制御回路。
A first cumulative addition unit that cumulatively adds the nonlinear detection values;
An average value calculation unit that calculates an average value of nonlinear detection values in the block based on the cumulative value of the first cumulative addition unit and the size of the block;
Including
The parameter calculation unit calculates a quantization parameter for controlling the quantization step based on the average value and the nonlinear detection value;
The quantization control circuit according to claim 2.
前記非線形検出値に応じて短波長のブロックを検出し、その検出結果に基づいて、前記ブロックに対して量子化ステップを変更するか否かを示すための判定フラグを設定する判定部を有し、
前記判定部の判定結果に応じて、算出値又は所定値を量子化パラメータとして出力する、
ことを特徴とする請求項1〜3のうちの何れか一項に記載の量子化制御回路。
A determination unit configured to detect a short wavelength block according to the non-linear detection value and set a determination flag for indicating whether or not to change a quantization step for the block based on the detection result; ,
According to the determination result of the determination unit, a calculated value or a predetermined value is output as a quantization parameter.
The quantization control circuit according to any one of claims 1 to 3.
所定数の画素データを有するブロックを分割したサブブロック毎に、前記サブブロックに含まれ所定の方向に連続して隣接する3つの画素の内の隣接する2つの画素の画素値の差に応じて線形予測値を算出し、前記連続する3つの画素の内の前記隣接する2つの画素とは異なる画素の画素値と前記線形予測値との差に基づいた非線形検出値に応じて前記サブブロックを量子化する際の量子化ステップを制御する量子化パラメータを変更する、ことを特徴とする量子化パラメータ変更方法。 For each sub-block obtained by dividing a block having a predetermined number of pixel data, depending on the difference between the pixel values of two adjacent pixels of the three pixels adjacent in succession in a predetermined direction included in the sub-block A linear prediction value is calculated , and the sub-block is determined according to a non-linear detection value based on a difference between a pixel value of a pixel different from the adjacent two pixels of the three consecutive pixels and the linear prediction value. A quantization parameter changing method, characterized by changing a quantization parameter for controlling a quantization step at the time of quantization. 所定数の画素データを有するブロックを分割したサブブロック毎に、前記サブブロックに含まれ所定の方向に連続して隣接する3つの画素の内の隣接する2つの画素の画素値の差に応じて線形予測値を算出し、前記連続する3つの画素の内の前記隣接する2つの画素とは異なる画素の画素値と前記線形予測値との差に基づいた非線形検出値に応じて前記サブブロックを量子化する際の量子化ステップを制御する量子化パラメータを変更する量子化制御回路と、
前記量子化パラメータに応じて量子化ステップを設定し、該量子化ステップにて画像データを量子化し、量子化後のデータを符号データに変換する符号化回路と、
を有する符号化装置
For each sub-block obtained by dividing a block having a predetermined number of pixel data, depending on the difference between the pixel values of two adjacent pixels of the three pixels adjacent in succession in a predetermined direction included in the sub-block A linear prediction value is calculated , and the sub-block is determined according to a non-linear detection value based on a difference between a pixel value of a pixel different from the adjacent two pixels of the three consecutive pixels and the linear prediction value. A quantization control circuit for changing a quantization parameter for controlling a quantization step at the time of quantization;
An encoding circuit that sets a quantization step according to the quantization parameter, quantizes the image data in the quantization step, and converts the quantized data into code data;
An encoding device .
JP2009292234A 2009-12-24 2009-12-24 Quantization control circuit, quantization parameter changing method, and encoding apparatus Expired - Fee Related JP5375590B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009292234A JP5375590B2 (en) 2009-12-24 2009-12-24 Quantization control circuit, quantization parameter changing method, and encoding apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009292234A JP5375590B2 (en) 2009-12-24 2009-12-24 Quantization control circuit, quantization parameter changing method, and encoding apparatus

Publications (2)

Publication Number Publication Date
JP2011135269A JP2011135269A (en) 2011-07-07
JP5375590B2 true JP5375590B2 (en) 2013-12-25

Family

ID=44347546

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009292234A Expired - Fee Related JP5375590B2 (en) 2009-12-24 2009-12-24 Quantization control circuit, quantization parameter changing method, and encoding apparatus

Country Status (1)

Country Link
JP (1) JP5375590B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5917117B2 (en) * 2011-12-07 2016-05-11 株式会社日立国際電気 Image coding apparatus and image coding method
CN109474824B (en) * 2018-12-04 2020-04-10 深圳市华星光电半导体显示技术有限公司 Image compression method
CN111291876B (en) * 2020-01-21 2023-03-28 星宸科技股份有限公司 Arithmetic device, arithmetic method, and arithmetic chip

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3104803B2 (en) * 1991-07-31 2000-10-30 ソニー株式会社 Video signal transmission device
JPH05227526A (en) * 1991-10-17 1993-09-03 Sony Corp Picture processor
JPH08107502A (en) * 1994-10-05 1996-04-23 Kawasaki Steel Corp Quantizing table selecting method
JP2830855B2 (en) * 1996-08-22 1998-12-02 日本電気株式会社 Adaptive quantization controller
JP4649355B2 (en) * 2006-03-27 2011-03-09 富士通株式会社 Block noise detection method and apparatus, and block noise reduction method and apparatus

Also Published As

Publication number Publication date
JP2011135269A (en) 2011-07-07

Similar Documents

Publication Publication Date Title
US9467717B2 (en) Filtering method for removing block artifacts and/or ringing noise and apparatus therefor
JP4455487B2 (en) Decoding device, decoding method, and program
CN110036637B (en) Method and device for denoising and vocalizing reconstructed image
US20130287312A1 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
US20080205788A1 (en) Image Processing Apparatus and Method, and Computer Program and Computer-Readable Storage Medium
CN110024387A (en) Code device, decoding apparatus, coding method and coding/decoding method
KR100846774B1 (en) Filtering method for removing block artifacts and/or ringing noise and apparatus therefor
KR100968027B1 (en) Variable block-based method and apparatus for filtering of deblocking type, and deblocking filter applied to the same
JP5375590B2 (en) Quantization control circuit, quantization parameter changing method, and encoding apparatus
KR20050099256A (en) Apparatus and method for processing image data using deblocking
JP2017069959A (en) Image quality detection method and decoding system
KR100762578B1 (en) Aapparatus and method for post-processing filtering of Video signal
JP2011004285A (en) Image data encoding device, image data encoding method, image data code amount control method, and electronic information apparatus
JP2007306528A (en) Motion picture decoding device and motion picture decoding method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120907

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130516

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130521

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130719

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130909

R150 Certificate of patent or registration of utility model

Ref document number: 5375590

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees