JP2008153802A - Moving picture encoding device and moving picture encoding program - Google Patents

Moving picture encoding device and moving picture encoding program Download PDF

Info

Publication number
JP2008153802A
JP2008153802A JP2006337747A JP2006337747A JP2008153802A JP 2008153802 A JP2008153802 A JP 2008153802A JP 2006337747 A JP2006337747 A JP 2006337747A JP 2006337747 A JP2006337747 A JP 2006337747A JP 2008153802 A JP2008153802 A JP 2008153802A
Authority
JP
Japan
Prior art keywords
block
encoding
quantization
blocks
encoded
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
JP2006337747A
Other languages
Japanese (ja)
Inventor
Futoshi Tsubaki
太 椿
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 JP2006337747A priority Critical patent/JP2008153802A/en
Publication of JP2008153802A publication Critical patent/JP2008153802A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that a conventional moving picture encoding device determines a quantization value without considering encoding types of adjacent MBs, so that block distortion between adjacent MBs differing in encoding type is generated and then picture quality deteriorates. <P>SOLUTION: In a motion picture encoding device, a quantization determining unit 112 inputs intra/inter MB types for each MB from an ME/MC type determination unit 111, determines a quantization value of an MB input from a peripheral MB information storage unit 113 by using peripheral MB information on the MB, and makes an adjustment in accordance with an average quantization value input from a code amount control unit 114. The peripheral MB information storage unit 113 holds the quantization value and MB type (intra/inter) of the MB determined by a quantization determining unit 112. Furthermore, the peripheral MB information storage unit 113 outputs the peripheral MB information to the quantization determining unit 112 as needed. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は動画像符号化装置及び動画像符号化プログラムに係り、特に動画像信号の各画面を所定の画素数の画像領域であるブロックを単位として分割し、そのブロック単位でピクチャ間の相関性を用いて情報量を削減すると共に、ブロック単位で直交変換、量子化及び可変長符号化を行って動画像符号化データを生成する動画像符号化装置及び動画像符号化プログラムに関する。   The present invention relates to a moving image coding apparatus and a moving image coding program, and in particular, each screen of a moving image signal is divided into blocks each having a predetermined number of pixels as a unit, and the correlation between pictures in units of the blocks. The present invention relates to a moving picture coding apparatus and a moving picture coding program for generating moving picture coded data by performing orthogonal transformation, quantization, and variable length coding in units of blocks.

情報量が膨大な動画像信号を帯域が限られた伝送媒体で高速に伝送したり、記録容量が制限された記録媒体に長時間記録するなどのため、動画像の圧縮符号化技術は益々重要となっている。この動画像の圧縮符号化技術としては、例えば、国際基準化されたMPEG(Moving Picture Experts Group)−1、MPEG−2、MPEG−4、H.261、H.263、H.264等が知られている。これらの動画像圧縮符号化技術では、動画像信号の各画面を所定の画素数の画像領域であるブロックを単位として分割し、そのブロック単位でピクチャ間の相関性を用いた動き補償フレーム間予測等の処理により情報量を削減すると共に、ブロック単位でDCT(Discrete Cosine Transform:離散コサイン変換)等の直交変換、量子化及び可変長符号化を行って動画像符号化データを生成する。   Video encoding technology for moving images is becoming more and more important because video signals with a large amount of information can be transmitted at high speed using a transmission medium with limited bandwidth, or can be recorded for a long time on a recording medium with limited recording capacity. It has become. For example, MPEG (Moving Picture Experts Group) -1, MPEG-2, MPEG-4, H.261, H.263, and H.264 are known as compression coding techniques for moving images. It has been. In these moving image compression coding technologies, each frame of a moving image signal is divided in units of blocks, which are image areas of a predetermined number of pixels, and motion compensated interframe prediction using correlation between pictures in units of blocks. The amount of information is reduced by processing such as the above, and moving image coded data is generated by performing orthogonal transform such as DCT (Discrete Cosine Transform), quantization, and variable length coding in units of blocks.

このような動画像符号化データを生成する動画像符号化装置では、効率良く符号化効率を高め、動画像符号化データの画質を向上させることが要望されており、そのため、例えば画像データの複雑度(アクティビティ)を量子化パラメータの変化量に反映させる手段を備えた動画像符号化装置が従来提案されている(例えば、特許文献1参照)。   In a moving image encoding apparatus that generates such moving image encoded data, it is desired to efficiently increase the encoding efficiency and improve the image quality of the encoded moving image data. Conventionally, a moving picture coding apparatus having means for reflecting a degree (activity) in a change amount of a quantization parameter has been proposed (see, for example, Patent Document 1).

図4は上記の特許文献1記載の動画像符号化装置の全体構成を示すブロック図である。図4において、動画像信号はA/D変換回路11でディジタル画像信号に変換され、画面並べ替え回路12で、GOP(Group of Picture)構造に応じて各フレーム画像信号単位で符号化する順番に並べ替えられて演算回路13、動き予測・補償回路22、アクティビティ算出回路23に供給される。演算回路13は入力されたフレーム画像信号がインター(Inter)符号化される場合には、入力フレーム画像信号と動き予測・補償回路22からの予測フレーム画像データとの差分を示す画像データを生成して直交変換回路14へ供給し、入力されたフレーム画像信号がイントラ(Intra)符号化される場合には、入力フレーム画像信号を画像データとしてそのまま直交変換回路14に供給する。   FIG. 4 is a block diagram showing the overall configuration of the moving picture encoding apparatus described in Patent Document 1. In FIG. 4, the moving image signal is converted into a digital image signal by the A / D conversion circuit 11, and the screen rearrangement circuit 12 sequentially encodes each frame image signal in accordance with the GOP (Group of Picture) structure. The data are rearranged and supplied to the arithmetic circuit 13, the motion prediction / compensation circuit 22, and the activity calculation circuit 23. When the input frame image signal is inter-coded, the arithmetic circuit 13 generates image data indicating a difference between the input frame image signal and the predicted frame image data from the motion prediction / compensation circuit 22. When the input frame image signal is intra-coded, the input frame image signal is supplied to the orthogonal transformation circuit 14 as image data as it is.

直交変換回路14は入力された画像データを4×4画素のブロック単位で直交変換して得た信号を量子化回路15に供給して、ここでレート制御回路25からの量子化スケールに応じた量子化が行われる。可逆符号化回路16は、量子化回路15から出力された量子化後の画像データを可変長符号化してバッファ17に格納すると共に、動き予測・補償回路22からの動きベクトルMVあるいはその差分を符号化してヘッダデータに格納する。   The orthogonal transform circuit 14 supplies a signal obtained by orthogonal transform of the input image data in units of 4 × 4 pixel blocks to the quantization circuit 15, and here, according to the quantization scale from the rate control circuit 25. Quantization is performed. The lossless encoding circuit 16 variable-length-encodes the quantized image data output from the quantization circuit 15 and stores it in the buffer 17, and also encodes the motion vector MV from the motion prediction / compensation circuit 22 or the difference thereof. And store it in the header data.

また、量子化回路15から出力された量子化後の画像データは、逆量子化回路18で逆量子化され、デブロックフィルタ19でブロック歪み除去のためのフィルタ処理され、更に逆直交変換回路20で4×4画素のブロック単位で逆直交変換されて画像データに復号された後、フレームメモリ21に格納される。動き予測・補償回路22は、フレームメモリ21からの画像データと、画面並べ替え回路12からの画像データとに基づいて、動きベクトルMV及び参照画像データを生成し、動きベクトルMVは可逆符号化回路16へ、参照画像データは演算回路13へそれぞれ出力する。   The quantized image data output from the quantization circuit 15 is inversely quantized by the inverse quantization circuit 18, is subjected to filter processing for removing block distortion by the deblocking filter 19, and is further subjected to the inverse orthogonal transform circuit 20. Then, the inverse orthogonal transform is performed in units of 4 × 4 pixel blocks, decoded into image data, and stored in the frame memory 21. The motion prediction / compensation circuit 22 generates a motion vector MV and reference image data based on the image data from the frame memory 21 and the image data from the screen rearrangement circuit 12, and the motion vector MV is a lossless encoding circuit. 16, the reference image data is output to the arithmetic circuit 13, respectively.

一方、アクティビティ算出回路23は画面並べ替え回路12からの画像データに基づいて入力動画像信号の画像の複雑度(アクティビティ)を所定の方法に基づいて算出し、算出したアクティビティNactをΔQ算出回路24に供給し、ここで、Nactに応じて量子化パラメータの変化量データΔQを所定の演算式に従って算出させる。レート制御回路25は上記の変化量データΔQとバッファ17からの参照データとを加算して量子化パラメータQPを生成させる。   On the other hand, the activity calculation circuit 23 calculates the image complexity (activity) of the input moving image signal based on the image data from the screen rearrangement circuit 12 based on a predetermined method, and calculates the calculated activity Nact as the ΔQ calculation circuit 24. Here, the variation data ΔQ of the quantization parameter is calculated according to a predetermined arithmetic expression according to Nact. The rate control circuit 25 adds the change amount data ΔQ and the reference data from the buffer 17 to generate the quantization parameter QP.

次に、アクティビティ算出回路23、ΔQ算出回路14及びレート制御回路25を使用して設定される量子化値の決定方法について、図5のフローチャートと共に説明する。図5において、ステップS501は、複数枚のピクチャから構成されるGOPと呼ばれる単位に、入力される動画像データを分割し、GOP単位のループの始点を示す。ステップS502では、設定されているビットレートから、前記GOPの符号量配分を決定する。ステップS503は、GOP内のピクチャ単位のループの始点を示す。   Next, a method for determining the quantization value set using the activity calculation circuit 23, the ΔQ calculation circuit 14, and the rate control circuit 25 will be described with reference to the flowchart of FIG. In FIG. 5, step S501 divides input moving image data into units called GOPs composed of a plurality of pictures, and indicates the start point of a loop in units of GOPs. In step S502, the GOP code amount distribution is determined from the set bit rate. Step S503 indicates the start point of a loop in units of pictures in the GOP.

ステップS504では、GOP内のピクチャ1枚あたりの符号量配分を行う。特許文献1では、ピクチャのタイプ(Iピクチャ、Pピクチャ、Bピクチャ)に応じて、重み付けをし、ピクチャ1枚あたりの符号量を決定している。ステップS505は、ピクチャ内の16×16画素で構成されるマクロブロック(MB)と呼ばれる単位のループの始点を示す。   In step S504, code amount distribution per picture in the GOP is performed. In Patent Document 1, weighting is performed according to the type of picture (I picture, P picture, B picture), and the code amount per picture is determined. Step S505 indicates the start point of a unit loop called a macroblock (MB) made up of 16 × 16 pixels in the picture.

次に、ステップS506で、MB単位の符号量配分を決定する処理が行われる。特許文献1では、ピクチャに割り当てられた符号量を、単純にピクチャ内のMB総数で分割している。ここで、決定された符号量を元に、量子化値を決定している。続いて、ステップS507で、アクティビティを反映した量子化値の決定処理が行われる。このステップS507の処理では、まず、アクティビティ算出回路23において、入力される動画像データの輝度値を使用し、画像の複雑さ(アクティビティ)を算出し、ピクチャ全体の傾向から各MBのアクティビティNactを算出する。このアクティビティNactの値は、ピクチャ内の画像の複雑さを測る指標であり、アクティビティ値が大きいことは、画像が複雑であることを意味する。特許文献1では、画像が複雑である場合、他の部分よりも量子化値を粗く設定しても肉眼では画像劣化が認識され難いという性質を利用し、アクティビティNactを用いて量子化値の補正を行っている。   Next, in step S506, processing for determining code amount distribution in MB units is performed. In Patent Document 1, the code amount allocated to a picture is simply divided by the total number of MBs in the picture. Here, the quantization value is determined based on the determined code amount. Subsequently, in step S507, a quantization value determination process reflecting the activity is performed. In the process of step S507, first, the activity calculation circuit 23 calculates the complexity (activity) of the image using the luminance value of the input moving image data, and calculates the activity Nact of each MB from the tendency of the entire picture. calculate. The value of this activity Nact is an index for measuring the complexity of the image in the picture, and a large activity value means that the image is complicated. In patent document 1, when an image is complicated, even if a quantized value is set to be coarser than other portions, it is difficult to recognize image degradation with the naked eye, and the quantized value is corrected using activity Nact. It is carried out.

続いて、ステップS508にて、ステップS507で決定された量子化値を用いて符号化した際に、発生した符号量が、予めMBに与えられた符号量と比較して過不足がある場合に、精算処理を行う。特許文献1では、以下の式で精算を行っている。   Subsequently, when encoding is performed using the quantized value determined in step S507 in step S508, the generated code amount is excessive or insufficient as compared with the code amount given to the MB in advance. Execute the checkout process. In Patent Document 1, settlement is performed using the following equation.

次のMB符号量=(PicRate−符号化済みのMBの符号量)÷残りのMB数
ただし、上式中、「PicRate」はピクチャ1枚当りに割り振られる予定の符号量である。つまり、ピクチャの符号量は決まっているため、ピクチャ内で後から符号化されるMBが、過不足の影響を受けることになる。特許文献1では、MBの符号化順は、ピクチャの左上から右下方向に符号化されるので、MB単位の量子化値は、右下に行くに従い、前に符号化した影響を受けることとなる。
Next MB code amount = (PicRate−encoded MB code amount) ÷ number of remaining MBs However, in the above equation, “PicRate” is a code amount to be allocated per picture. That is, since the code amount of a picture is determined, MBs encoded later in the picture are affected by excess or deficiency. In Patent Document 1, since the MB encoding order is encoded from the upper left to the lower right of the picture, the quantization value in MB units is affected by the previous encoding as it goes to the lower right. Become.

ステップS509は、ピクチャ内のMB単位ループの終端を示す。ピクチャ内のすべてのMBについて、MB単位でステップS506〜S508の処理が繰り返される。続いて、ステップS510では、前記ステップS508と同様に、ピクチャ単位での符号量の過不足を精算する。ステップS511は、GOP内のピクチャ単位のループの終端である。GOP内の各ピクチャについてステップS504〜S510の処理が行われる。続くステップS512では、前記ステップS510と同様に、GOP単位での符号量の過不足を精算する。ステップS513は、GOP単位のループの終端である。   Step S509 indicates the end of the MB unit loop in the picture. For all MBs in the picture, the processes in steps S506 to S508 are repeated for each MB. Subsequently, in step S510, as in step S508, the excess or deficiency of the code amount in units of pictures is settled. Step S511 is the end of a loop for each picture in the GOP. The processes in steps S504 to S510 are performed for each picture in the GOP. In the subsequent step S512, the excess or deficiency of the code amount in GOP units is settled as in step S510. Step S513 is the end of the loop in GOP units.

上記の動作を行う特許文献1記載の従来の動画像符号化装置では、画像特性を無視し、左上から右下の順で量子化値が決定されることを課題とし、画像の複雑さを示すアクティビティを導入し、量子化値を決定する際に指標として用いることで、ピクチャ内での均一的な画質が得られるとしている。   In the conventional moving picture coding apparatus described in Patent Document 1 that performs the above operation, the image characteristic is ignored, and the quantization value is determined in order from the upper left to the lower right, and the complexity of the image is shown. By introducing an activity and using it as an index when determining a quantized value, uniform image quality within a picture can be obtained.

特開2004−194076号公報JP 2004-194076 A

ここで、イントラ符号化とインター符号化において、同等の量子化値を用いて符号化した場合の画質差について、図6を使用して説明する。図6(A)はイントラ符号化(イントラ圧縮)、図6(B)はインター符号化(インター圧縮)の簡単な処理の流れを示す。   Here, the difference in image quality when encoding is performed using equivalent quantization values in intra encoding and inter encoding will be described with reference to FIG. FIG. 6A shows a simple processing flow of intra coding (intra compression), and FIG. 6B shows a simple processing flow of inter coding (inter compression).

図6(A)に示すように、イントラ符号化(イントラ圧縮)では、入力される現画像601に対して、変換602、量子化603、逆量子化604、逆変換605の各処理を順次経て、復号画像606を得ることができる。つまり、イントラ圧縮の場合、量子化値の大小によって削減される情報量が変動し、作成される復号画像606が大きく変化するといえる。   As shown in FIG. 6A, in intra coding (intra compression), each process of transformation 602, quantization 603, inverse quantization 604, and inverse transformation 605 is sequentially performed on the input current image 601. The decoded image 606 can be obtained. That is, in the case of intra compression, it can be said that the amount of information to be reduced varies depending on the magnitude of the quantization value, and the generated decoded image 606 changes greatly.

一方、インター符号化(インター圧縮)については、図6(B)に示すように、現画像601に対して、参照ピクチャを使用して動き補償予測(MC)610を行い、MCより作成されるMC画像611と、現画像601とMC画像611の差分である残差成分612とに分けて圧縮処理を行う。MC画像611は、参照ピクチャより動きベクトル値を用いて作成することができ、実際に圧縮処理を行うことはない。つまり、インター圧縮では、MC610によって求められた残差成分612についてのみ、変換613、量子化614、逆量子化615、逆変換616の各処理を順次行い、逆変換後の残差成分とMC画像611とから復号画像617を得ることができる。   On the other hand, as shown in FIG. 6B, inter coding (inter compression) is created from MC by performing motion compensation prediction (MC) 610 using a reference picture for the current image 601. The compression processing is performed separately for the MC image 611 and a residual component 612 that is a difference between the current image 601 and the MC image 611. The MC image 611 can be created using a motion vector value from a reference picture, and is not actually compressed. That is, in the inter compression, only the residual component 612 obtained by the MC 610 is subjected to the transformation 613, quantization 614, inverse quantization 615, and inverse transformation 616 sequentially, and the residual component after the inverse transformation and the MC image are processed. 611 and a decoded image 617 can be obtained.

このインター圧縮では、量子化614によって、残差成分が0となった場合であってもMC画像611があるので、復号画像617が補償される。従って、イントラ圧縮と比較すると、量子化値の大小によって作成される復号画像は、影響が少ないといえる。   In this inter compression, since the MC image 611 exists even when the residual component becomes 0 by the quantization 614, the decoded image 617 is compensated. Therefore, it can be said that the decoded image generated by the magnitude of the quantized value has less influence than the intra compression.

以上により、同等の量子化値で、イントラ圧縮とインター圧縮を行った場合、インター圧縮の参照ピクチャの画質がある程度綺麗であれば、イントラ圧縮の画像と比較して、インター圧縮の復号画像の方が綺麗である。つまり、同等の量子化値で圧縮することにおいては、イントラ圧縮とインター圧縮で画質差が生じる。   As described above, when intra compression and inter compression are performed with the same quantized value, if the image quality of the inter compression reference picture is somewhat clean, the decoded image of the inter compression is compared with the image of the intra compression. Is beautiful. That is, in the case of compressing with an equivalent quantized value, a difference in image quality occurs between intra compression and inter compression.

しかし、特許文献1記載の従来の動画像符号化装置においては、ピクチャの画像特性であるアクティビティを算出し、そのアクティビティを量子化値の決定の際に反映させているが、N番目のMBの量子化値を決定しようとした場合、N−1番目までに決定されたMBの量子化値の影響を、N番目のMBが受けてしまう。例えば、N−1番目のMBの符号化タイプがインターMBであり、N番目のMBの符号化タイプがイントラMBである場合を考える。N−1番目のMBの量子化値を決定した際に、予定された符号量と同等の符号量であったとする。   However, in the conventional video encoding device described in Patent Document 1, an activity that is an image characteristic of a picture is calculated, and the activity is reflected when the quantization value is determined. When trying to determine the quantized value, the Nth MB is affected by the quantized values of the MBs determined up to the (N-1) th. For example, consider a case where the encoding type of the (N-1) th MB is an inter MB and the encoding type of the Nth MB is an intra MB. It is assumed that when the quantization value of the (N-1) th MB is determined, the code amount is equal to the scheduled code amount.

すると、次のMB(N番目)の量子化値は、N−1番目の量子化値と同じとなってしまい、前述したようにブロック歪みを発生される要因となる。つまり、特許文献1記載の従来の動画像符号化装置では、隣接するMBの符号化タイプを考慮せずに量子化値を決定しているため、画質が劣化する場合があることが課題である。   Then, the quantized value of the next MB (Nth) becomes the same as the (N−1) th quantized value, which causes a block distortion as described above. That is, in the conventional video encoding device described in Patent Document 1, since the quantization value is determined without considering the encoding type of the adjacent MB, there is a problem that the image quality may be deteriorated. .

本発明は以上の点に鑑みなされたもので、更に効率良く符号化効率を高め、画質を向上し得る動画像符号化装置及び動画像符号化プログラムを提供することを目的とする。   The present invention has been made in view of the above points, and it is an object of the present invention to provide a moving picture coding apparatus and a moving picture coding program that can improve coding efficiency more efficiently and improve image quality.

上記の目的を達成するため、第1の発明は、動画像信号の一画面を所定の画素数の画像領域であるブロック単位に分割し、符号化対象の動画像信号と符号化データから復号した参照画像信号とを用いて動き補償予測して得られた予測信号と、符号化対象の動画像信号との差分信号に対して、ブロック単位に直交変換、量子化及び可変長符号化を順次行って、インター符号化された各画面の符号化データを生成する動画像符号化装置において、
符号化対象の一画面のすべてのブロックが、予め定めた第1のブロックと第1のブロック以外の複数の第2のブロックとからなるとき、第1のブロックの第1の量子化値候補と、そのブロックが参照画像信号の対応するブロックの情報を用いてインター符号化を行う第1の符号化タイプか、参照画像信号を用いないイントラ符号化を行う第2の符号化タイプであるかを示す第1の符号化タイプ情報とが事前に保存されており、かつ、複数の第2のブロックの量子化値候補と、その第2のブロックが第1の符号化タイプか第2の符号化タイプであるかを示す第2の符号化タイプ情報とを全てブロック単位で順次に保存するための情報保存手段と、情報保存手段からそれぞれ取得した、複数の第2のブロックの内の一の第2のブロックに隣接する周辺ブロックの第1又は第2の符号化タイプ情報及び第1又は第2の量子化値候補と、動画像信号から取得した第2のブロックの第2の符号化タイプ情報とに基づいて、第2のブロックの第2の量子化値候補を決定し、その決定した第2の量子化値候補と共に第2のブロックの第2の符号化タイプ情報を情報保存手段に保存する第2の量子化値候補決定・保存動作を全ての第2のブロックに対して順次に行う量子化値決定手段と、符号化対象の一画面をインター符号化するときに割り当てられた符号量に基づいて、ピクチャ平均量子化値を算出する算出手段と、情報保存手段から符号化対象の一画面のすべての第1及び第2のブロックの第1及び第2の量子化値候補を読み出してその平均値を算出し、算出した平均値がピクチャ平均量子化値と同等となるように情報保存手段から読み出した第1及び第2のブロックの第1及び第2の量子化値候補を補正して各ブロック毎の量子化値を生成する補正手段とを有し、補正手段により生成された各ブロック毎の量子化値に基づいて、直交変換された差分信号に対して量子化をブロック単位で行うことを特徴とする。
In order to achieve the above object, the first invention divides one screen of a moving image signal into block units, which are image regions having a predetermined number of pixels, and decodes the encoded moving image signal and encoded data. The difference signal between the prediction signal obtained by motion compensation prediction using the reference image signal and the moving image signal to be encoded is sequentially subjected to orthogonal transform, quantization, and variable length coding in units of blocks. Then, in the moving picture coding apparatus for generating the coded data of each screen that is inter-coded,
When all the blocks of one screen to be encoded are composed of a predetermined first block and a plurality of second blocks other than the first block, the first quantized value candidates of the first block are Whether the block is a first coding type that performs inter coding using information of a corresponding block of a reference image signal or a second coding type that performs intra coding without using a reference image signal First coding type information to be stored in advance, and a plurality of second block quantization value candidates and whether the second block is the first coding type or the second coding Information storing means for sequentially storing all the second encoding type information indicating whether the type is a block unit, and a first one of the plurality of second blocks respectively obtained from the information storing means Adjacent to 2 blocks Based on the first or second encoding type information of the side block and the first or second quantization value candidate, and the second encoding type information of the second block acquired from the video signal, 2nd quantization value which determines the 2nd quantization value candidate of 2 blocks, and preserve | saves the 2nd coding type information of 2nd block with the determined 2nd quantization value candidate in an information storage means Quantization value determination means for sequentially performing value candidate determination / storing operation for all second blocks, and a picture average based on the code amount assigned when inter-coding one screen to be encoded A calculation means for calculating a quantized value, and reads out first and second quantized value candidates of all the first and second blocks of one screen to be encoded from the information storage means, and calculates an average value thereof. The calculated average value is the picture average quantization value. Correction means for correcting the first and second quantized value candidates of the first and second blocks read from the information storage means so as to be equivalent to generate quantized values for each block; Based on the quantized value for each block generated by the correcting means, quantization is performed on the orthogonally transformed difference signal in units of blocks.

また、上記の目的を達成するため、第2の発明は、動画像信号の一画面を所定の画素数の画像領域であるブロック単位に分割し、符号化対象の動画像信号と符号化データから復号した参照画像信号とを用いて動き補償予測して得られた予測信号と、符号化対象の動画像信号との差分信号に対して、ブロック単位に直交変換、量子化及び可変長符号化を順次行って、インター符号化された各画面の符号化データを、コンピュータにより生成する動画像符号化プログラムにおいて、コンピュータに、第1の発明の各手段を機能させることを特徴とする。   In order to achieve the above object, the second invention divides one screen of a moving image signal into block units, which are image regions having a predetermined number of pixels, and uses the moving image signal to be encoded and the encoded data. For the difference signal between the prediction signal obtained by motion compensation prediction using the decoded reference image signal and the moving image signal to be encoded, orthogonal transform, quantization, and variable length encoding are performed in block units. In a moving image encoding program that is sequentially performed and generates encoded data of each screen that has been inter-encoded, the computer causes each of the means of the first invention to function.

第1及び第2の発明では、符号化対象のブロックの符号化タイプ情報と、そのブロックに隣接する周辺のブロックの符号化タイプ情報と量子化値候補とを取得して、符号化対象のブロックの量子化値候補を決定することを符号化対象の一画面のピクチャについて求めた後、符号化対象の一画面のすべてのブロックの量子化値候補の平均値がピクチャの平均量子化値と同等となるように各ブロック毎の量子化値候補を補正して各ブロック毎の量子化値を生成する。   In the first and second inventions, the encoding type information of the block to be encoded, the encoding type information of neighboring blocks adjacent to the block, and the quantization value candidate are acquired, and the block to be encoded is acquired. After determining the quantization value candidates for one picture of the encoding target screen, the average quantization value candidate of all the blocks of the encoding target screen is equal to the average quantization value of the picture The quantized value candidate for each block is corrected so that the quantized value for each block is generated.

本発明によれば、所定のブロック単位で量子化値を決定する際に、符号化対象のブロックの周辺のブロックの情報(符号化タイプ情報と量子化値候補)を使用してブロック単位で量子化値候補を一画面内の全ブロックについて求めた後、一画面の符号化対象ピクチャ内の全ブロックの量子化値候補の平均値がそのピクチャの平均量子化値と同等となるように補正して量子化値を生成するようにしているので、符号化対象のブロックと隣接する周辺のブロックの各符号化タイプが異なる時に起こるブロック間のブロック歪みを減少することができ、主観画質の向上が実現できる。   According to the present invention, when a quantization value is determined in a predetermined block unit, information on blocks around the block to be encoded (encoding type information and quantization value candidates) is used to quantize the block unit. After obtaining the quantized value candidates for all blocks in one screen, the average value of the quantized value candidates of all blocks in the picture to be encoded on one screen is corrected to be equal to the average quantized value of that picture. Since the quantization value is generated, the block distortion between the blocks when the encoding type of the block to be encoded and the neighboring block adjacent to each other is different can be reduced, and the subjective image quality can be improved. realizable.

次に、本発明の一実施の形態について図面と共に説明する。図1は本発明になる動画像符号化装置の一実施の形態のブロック図を示す。本実施の形態は、符号化対象の動画像信号を1フレーム分以上蓄積するフレームメモリ101と、フレーム出力部102と、差分信号を得る減算器103と、直交変換を行う直交変換器104と、入力信号を量子化値に応じて量子化する量子化器105と、可変長符号化処理を行う符号化回路106と、量子化後の画像データに対して逆量子化を行う逆量子化器107と、逆量子化後の画像データに対して逆直交変換を行う逆直交変換器108と、加算器109と、フレームメモリ110と、MB単位で動きベクトルを算出する動き推定(ME)処理、動き補償(MC)処理、及び処理対象のMBがイントラMBかインターMBかのタイプ判定処理を行うME/MC・タイプ判定部111とを有し、更に、符号量制御部114、量子化決定部112及び周辺MB情報保存部113を有する。   Next, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of a moving picture encoding apparatus according to the present invention. In this embodiment, a frame memory 101 that accumulates one or more frames of moving image signals to be encoded, a frame output unit 102, a subtractor 103 that obtains a difference signal, an orthogonal transformer 104 that performs orthogonal transformation, A quantizer 105 that quantizes an input signal according to a quantization value, an encoding circuit 106 that performs variable-length encoding processing, and an inverse quantizer 107 that performs inverse quantization on the quantized image data. An inverse orthogonal transformer 108 that performs inverse orthogonal transformation on the image data after inverse quantization, an adder 109, a frame memory 110, a motion estimation (ME) process for calculating a motion vector in MB units, motion A ME / MC / type determination unit 111 that performs compensation (MC) processing and type determination processing of whether the processing target MB is an intra MB or an inter MB, and further includes a code amount control unit 114 and a quantization determination unit. 12 and a peripheral MB information storage unit 113.

フレームメモリ101は、符号化対象の動画像信号をディジタル信号に変換して得られた画像データを数枚(数フレーム)分保持し、必要となった場合、保持している画像データをフレーム出力部102を介して減算器103及びME/MC・タイプ判定部111にそれぞれ出力する。減算器103は、フレーム出力部102から出力される画像データと、ME/MC・タイプ判定部111から出力される動き補償予測処理された画像データとの差分データを減算により生成し、生成した差分データを直交変換器104に出力する。   The frame memory 101 holds several pieces (several frames) of image data obtained by converting a moving image signal to be encoded into a digital signal, and outputs the held image data as a frame when necessary. The data is output to the subtractor 103 and the ME / MC / type determination unit 111 via the unit 102. The subtractor 103 generates difference data between the image data output from the frame output unit 102 and the image data subjected to motion compensation prediction processing output from the ME / MC / type determination unit 111 by subtraction, and the generated difference Data is output to the orthogonal transformer 104.

直交変換器104は、フレーム出力部102から出力された画像データ、又は減算器103から出力された差分データに対して、直交変換の一例として例えばDCTを行い、周波数成分(DCT係数情報)に変換する。直交変換器104で直交変換して得られたデータは量子化器105に入力される。なお、本実施の形態では直交変換としてDCTを用いたが、入力されるデータに対して、符号化を行い易い他の直交変換方法であっても構わない。   The orthogonal transformer 104 performs, for example, DCT on the image data output from the frame output unit 102 or the difference data output from the subtractor 103 as an example of orthogonal transformation, and converts the data into frequency components (DCT coefficient information). To do. Data obtained by orthogonal transformation by the orthogonal transformer 104 is input to the quantizer 105. In this embodiment, DCT is used as orthogonal transform. However, other orthogonal transform methods that facilitate encoding of input data may be used.

量子化器105は、直交変換器104より入力されるデータを、量子化決定部112より入力される量子化値で量子化する。この量子化器105から出力される量子化後データは、符号化回路106、及び逆量子化器107にそれぞれ供給される。符号化回路106は、量子化器105より入力される量子化後データに対して公知の可変長符号化(VLC)処理を行う。本実施の形態では、符号化回路106は、VLCテーブルを使用して可変長符号化を行い、符号化して得られたデータを符号化画像データとして外部へ出力する。また、符号化回路106は、符号量制御部114で使用するパラメータを符号量制御部114へ出力する。なお、本実施の形態では、符号化回路106はVLCテーブルを用いたが、他の可変長符号化方法であっても構わない。   The quantizer 105 quantizes the data input from the orthogonal transformer 104 with the quantization value input from the quantization determination unit 112. The quantized data output from the quantizer 105 is supplied to the encoding circuit 106 and the inverse quantizer 107, respectively. The encoding circuit 106 performs a known variable length encoding (VLC) process on the quantized data input from the quantizer 105. In the present embodiment, the encoding circuit 106 performs variable length encoding using the VLC table, and outputs the data obtained by encoding to the outside as encoded image data. Also, the encoding circuit 106 outputs parameters used in the code amount control unit 114 to the code amount control unit 114. In this embodiment, the encoding circuit 106 uses a VLC table, but other variable length encoding methods may be used.

逆量子化器107は、量子化器105より入力される量子化後データに対して量子化器105で行った操作と逆の操作を行い、逆量子化する。逆量子化器107で逆量子化されて得られたデータは逆直交変換器108に供給され、ここで直交変換器104で行った操作と逆の操作が行われ、逆直交変換される。逆直交変換器108で逆直交変換されて取り出される画像データが、イントラ符号化対象の画像データである場合は、フレームメモリ110に供給され、インター符号化対象の画像データである場合は加算器109に供給される。   The inverse quantizer 107 performs inverse quantization on the quantized data input from the quantizer 105 by performing an operation opposite to that performed by the quantizer 105. The data obtained by inverse quantization by the inverse quantizer 107 is supplied to the inverse orthogonal transformer 108, where an operation reverse to the operation performed by the orthogonal transformer 104 is performed and inverse orthogonal transformation is performed. If the image data extracted by inverse orthogonal transform by the inverse orthogonal transformer 108 is image data to be intra-encoded, it is supplied to the frame memory 110, and if it is image data to be inter-encoded, an adder 109 is supplied. To be supplied.

加算器109は、逆直交変換器108から出力される逆直交変換後の画像データと、ME/MC・タイプ判定部111から出力されるデータとを加算し、復号画像データを作成する。作成された復号画像データはフレームメモリ110に出力される。フレームメモリ110は、逆直交変換器108、又は加算器109より入力される復号画像データを保持する。また、フレームメモリ110は保持している画像データを、必要に応じてフレーム出力部102を介してME/MC・タイプ判定部111に参照画像データとして出力する。   The adder 109 adds the image data after the inverse orthogonal transform output from the inverse orthogonal transformer 108 and the data output from the ME / MC / type determination unit 111 to generate decoded image data. The generated decoded image data is output to the frame memory 110. The frame memory 110 holds decoded image data input from the inverse orthogonal transformer 108 or the adder 109. The frame memory 110 outputs the stored image data as reference image data to the ME / MC / type determination unit 111 via the frame output unit 102 as necessary.

ME/MC・タイプ判定部111は、フレームメモリ110に保持された復号画像データを参照画像データとして取得すると共に、フレームメモリ101よりフレーム出力部102を介して符号化対象の画像データを取得して、符号化対象の画像データの動きをMB単位で推定して、参照画像データと符号化対象の画像データの対応するMBの相対位置関係を示す動きベクトルを算出し(ME)、それに基づき動き補償(MC)を行ってピクチャ予測画像データを作成する。   The ME / MC / type determination unit 111 acquires the decoded image data held in the frame memory 110 as reference image data, and acquires the image data to be encoded from the frame memory 101 via the frame output unit 102. Then, the motion of the image data to be encoded is estimated in MB units, a motion vector indicating the relative positional relationship between the reference image data and the corresponding MB of the image data to be encoded is calculated (ME), and motion compensation is performed based on the motion vector (MC) is performed to create picture prediction image data.

また、ME/MC・タイプ判定部111は、フレーム出力部102より入力される符号化対象の画像データのMBがイントラ符号化対象のイントラMBであるか、またはインター符号化対象のインターMBであるかの判定(タイプ判定)も行う。この判定は、フレーム出力部102で符号化対象の画像データのMBをインター符号化したときの符号量とイントラ符号化したときの符号量とを比較し、符号量が少ない方のタイプの判定結果を得る。   The ME / MC / type determination unit 111 also determines whether the MB of the encoding target image data input from the frame output unit 102 is an intra encoding target intra MB or an inter encoding target inter MB. The determination (type determination) is also performed. This determination is made by comparing the code amount when the MB of the image data to be encoded is inter-encoded by the frame output unit 102 and the code amount when the intra-encoding is performed, and the determination result of the type with the smaller code amount Get.

ME/MC・タイプ判定部111で算出された動きベクトルは符号化回路106に出力され、動き補償によって作成されたピクチャ予測画像データは減算器103及び加算器109に出力され、タイプ判定結果は量子化決定部112に出力される。   The motion vector calculated by the ME / MC / type determination unit 111 is output to the encoding circuit 106, the picture prediction image data created by the motion compensation is output to the subtracter 103 and the adder 109, and the type determination result is the quantum Is output to the conversion determination unit 112.

符号量制御部114は、符号化回路106より入力されたパラメータを使用し、これから符号化されるピクチャの先頭MBの初期量子化値、及びピクチャ内の平均量子化値Qaveを決定し、この決定された初期量子化値、及び平均量子化値Qaveを量子化決定部112に出力する。なお、ピクチャ単位で平均量子化値を算出し、先頭のMBの量子化値を決定するような符号量制御であれば、どのような制御を行ってもよい。   The code amount control unit 114 uses the parameters input from the encoding circuit 106, determines the initial quantized value of the first MB of the picture to be encoded, and the average quantized value Qave in the picture. The initial quantization value and the average quantization value Qave are output to the quantization determination unit 112. Note that any control may be performed as long as the code amount control is such that the average quantization value is calculated in units of pictures and the quantization value of the leading MB is determined.

量子化決定部112は、ME/MC・タイプ判定部111よりMB単位でイントラ/インターのMBタイプが入力され、周辺MB情報保存部113より入力される該当MBの周辺MB情報を使用し、該当MBの量子化値候補を決定し、符号量制御部114より入力された平均量子化値に沿うように調整する。これについては後で詳しく説明する。   The quantization determination unit 112 receives the MB type of intra / inter in MB units from the ME / MC / type determination unit 111, uses the peripheral MB information of the corresponding MB input from the peripheral MB information storage unit 113, MB quantization value candidates are determined and adjusted so as to follow the average quantization value input from the code amount control unit 114. This will be described in detail later.

周辺MB情報保存部113は、少なくとも量子化決定部112で決定されたMBの量子化値候補、MBタイプ(イントラ/インター)をMB毎に保持する。また、周辺MB情報保存部113は、必要に応じて、量子化決定部112に周辺MB情報を出力する。   The peripheral MB information storage unit 113 holds at least the MB quantization value candidate and the MB type (intra / inter) determined by the quantization determination unit 112 for each MB. Also, the peripheral MB information storage unit 113 outputs the peripheral MB information to the quantization determination unit 112 as necessary.

次に、本実施の形態の動作について、図2のフローチャートと共に説明する。なお、各ステップの詳細な説明は、図1のブロック図の上記の説明と同様であるため省略する。まず、符号化対象の動画像信号をディジタル信号に変換して得られた画像データが入力されてフレームメモリ101に保存する(ステップS201)。続くステップS202は1ピクチャ単位のループの始点を示し、ピクチャ単位ループの終端を示すステップS217までの、後述するステップS203〜ステップS216の処理が符号化対象のピクチャ単位で行われる。また、ステップS202に続くステップS203は、ピクチャ内のMB単位のループの始点を示し、ピクチャ内のMB単位のループの終端を示すステップS209までの、後述するステップS204〜S208の処理が符号化対象のピクチャ内のすべてのMBについてMB単位で行われる。   Next, the operation of the present embodiment will be described with reference to the flowchart of FIG. A detailed description of each step is the same as the above description of the block diagram of FIG. First, image data obtained by converting a moving image signal to be encoded into a digital signal is input and stored in the frame memory 101 (step S201). The subsequent step S202 indicates the starting point of the loop for one picture unit, and the processing of step S203 to step S216, which will be described later, up to step S217 indicating the end of the picture unit loop is performed for each picture to be encoded. Step S203 subsequent to step S202 indicates the start point of the MB-unit loop in the picture, and the processing in steps S204 to S208 described later up to step S209 that indicates the end of the MB-unit loop in the picture is to be encoded. This is performed in units of MB for all MBs in the picture.

続いて、フレームメモリ101から出力される符号化対象のピクチャがイントラピクチャであるか、インターピクチャであるかをフレーム出力部102により判断する(ステップS204)。イントラピクチャである場合はステップS208へ、インターピクチャである場合はステップS205へ移動する。   Subsequently, the frame output unit 102 determines whether the encoding target picture output from the frame memory 101 is an intra picture or an inter picture (step S204). If it is an intra picture, the process proceeds to step S208. If it is an inter picture, the process proceeds to step S205.

符号化対象のピクチャがインターピクチャの場合は、ME/MC・タイプ判定部111において、フレームメモリ110より入力される参照画像データと、フレームメモリ101よりフレーム出力部102を介して入力される符号化対象の画像データとを使用して、符号化対象の画像データの動きをMB単位で推定して、参照画像データと符号化対象の画像データの対応するMBの相対位置関係を示す動きベクトルを算出し(ME)、それに基づき動き補償(MC)を行ってピクチャ予測画像データを作成すると共に、フレームメモリ101よりフレーム出力部102を介して入力される画像データのMBがイントラ符号化対象のイントラMBであるか、またはインター符号化対象のインターMBであるかのタイプ判定を行う(ステップS205)。   When the picture to be encoded is an inter picture, the ME / MC / type determination unit 111 encodes reference image data input from the frame memory 110 and encoding input from the frame memory 101 via the frame output unit 102. Using the target image data, the motion of the image data to be encoded is estimated in MB units, and a motion vector indicating the relative positional relationship between the reference image data and the corresponding MB of the image data to be encoded is calculated. (ME), motion compensation (MC) is performed on the basis thereof to generate picture prediction image data, and the MB of the image data input from the frame memory 101 via the frame output unit 102 is the intra MB to be intra-encoded. Or the type of inter MB to be inter-coded (step S2). 5).

続いて、量子化決定部112により、ME/MC・タイプ判定部111よりMB単位で入力されるイントラ/インターのMBタイプと、周辺MB情報保存部113より入力される該当MBの周辺MB情報と、符号量制御111より入力される初期量子化値とを使用して、後述するように該当MBの量子化値候補を決定し(ステップS206)、その決定された量子化値候補、及びタイプ情報を周辺MB情報保存部113に保存する(ステップS207)。一方、ステップS204で符号化対象のピクチャがイントラピクチャであると判定された場合は、量子化決定部112は、符号量制御部111の出力に基づいてMB単位で量子化値を決定する(ステップS208)。   Subsequently, by the quantization determination unit 112, the intra / inter MB type input in units of MB from the ME / MC / type determination unit 111, and the peripheral MB information of the corresponding MB input from the peripheral MB information storage unit 113, Then, using the initial quantized value input from the code amount control 111, the quantized value candidate of the corresponding MB is determined as will be described later (step S206), and the determined quantized value candidate and type information are determined. Is stored in the peripheral MB information storage unit 113 (step S207). On the other hand, if it is determined in step S204 that the picture to be encoded is an intra picture, the quantization determination unit 112 determines a quantization value in MB units based on the output of the code amount control unit 111 (step S204). S208).

ステップS204〜S208の処理が符号化対象のピクチャ内のすべてのMBについてMB単位で行われると、続いて、符号化対象のピクチャがインターピクチャであるかどうかをフレーム出力部102の出力に基づいて再び判断し(ステップS210)、イントラピクチャである場合はステップS212へ、インターピクチャである場合はステップS211へ移動する。   When the processing of steps S204 to S208 is performed in units of MB for all MBs in the encoding target picture, whether or not the encoding target picture is an inter picture is determined based on the output of the frame output unit 102. It judges again (step S210), and when it is an intra picture, it moves to step S212, and when it is an inter picture, it moves to step S211.

ステップS211では、ステップS206にて決定された符号化対象のインターピクチャ内の各MBの量子化値候補を、符号量制御部114より入力されるピクチャ平均量子化値と同等にするための補正処理を行い、符号化対象のインターピクチャのMB単位の量子化値を最終的に決定する。続いて、直交変換器104に入力される画像データ又は差分データに対して直交変換された後、量子化器105によりステップS208又はS211で決定されたMB単位の量子化値に基づく量子化がMB単位で行われ、その量子化後データに対する符号化回路106による可変長符号化及び逆量子化器107による逆量子化、逆量子化後データに対する逆直交変換器108による逆直交変換からなる画像圧縮処理が行われる(ステップS212)。   In step S211, correction processing for making the quantized value candidate of each MB in the inter picture to be coded determined in step S206 equal to the picture average quantized value input from the code amount control unit 114 To finally determine the quantization value in MB of the inter picture to be encoded. Subsequently, after the orthogonal transformation is performed on the image data or the difference data input to the orthogonal transformer 104, the quantization based on the quantization value in MB determined by the quantizer 105 in step S208 or S211 is performed by MB. Image compression that is performed in units and includes variable length coding by the coding circuit 106 for the quantized data, inverse quantization by the inverse quantizer 107, and inverse orthogonal transform by the inverse orthogonal transformer 108 for the inverse quantized data. Processing is performed (step S212).

続いて、逆直交変換器108で逆直交変換されて取り出される符号化されるピクチャの画像データが、インター符号化時に用いられる参照ピクチャであるかどうか判断し(ステップS213)、非参照ピクチャである場合はステップS216へ移動し、参照ピクチャである場合はステップS214へ移動する。   Subsequently, it is determined whether or not the image data of the picture to be encoded, which is extracted by inverse orthogonal transform by the inverse orthogonal transformer 108, is a reference picture used at the time of inter coding (step S213), and is a non-reference picture. If so, the process proceeds to step S216. If it is a reference picture, the process proceeds to step S214.

ステップS214は、復号画像を作成するステップであり、完全面内符号化ピクチャである場合は、何も処理をせず、インター符号化時に用いられる参照ピクチャである場合に、加算器109において逆直交変換器108から出力される逆直交変換後の画像データ(復号された誤差画像データ)と、ME/MC・タイプ判定部111から出力される動き補償して作成されたデータとを加算し、復号画像データを作成する(ステップS214)。作成された復号画像データはフレームメモリ110に出力されて保存される(ステップS215)。   Step S214 is a step of creating a decoded image. If the picture is a completely intra-coded picture, no processing is performed. If the picture is a reference picture used for inter coding, the adder 109 performs inverse orthogonality. The inverse orthogonal transform image data (decoded error image data) output from the converter 108 and the data generated by motion compensation output from the ME / MC / type determination unit 111 are added and decoded. Image data is created (step S214). The generated decoded image data is output and stored in the frame memory 110 (step S215).

そして、符号量制御部114により、符号化回路106より入力されたパラメータを使用し、次に符号化されるピクチャの先頭MBの初期量子化値、及びピクチャ内の平均量子化値を決定するピクチャ単位符号量制御処理を行う(ステップS216)。この決定された初期量子化値、及び平均量子化値は量子化決定部112に出力される。ここで、上記のピクチャ内の平均量子化値(後述するQave)は、例えばGOP内で割り当てられた符号量から符号化対象ピクチャの符号化を行う直前までにGOP内の各ピクチャを符号化して得られた合計の符号量を差し引いた符号量と、GOP内の符号化前の残りのピクチャの数とに基づいて、その符号化対象ピクチャに割り当てられた符号量から所定のアルゴリズムにより算出されたものである。   Then, the code amount control unit 114 uses the parameters input from the encoding circuit 106, and determines the initial quantization value of the first MB of the picture to be encoded next and the average quantization value in the picture. A unit code amount control process is performed (step S216). The determined initial quantization value and the average quantization value are output to the quantization determination unit 112. Here, the average quantization value (Qave described later) in the above picture is obtained by encoding each picture in the GOP from the code amount allocated in the GOP until immediately before encoding the encoding target picture. Based on the code amount obtained by subtracting the obtained total code amount and the number of remaining pictures before encoding in the GOP, the code amount calculated by a predetermined algorithm is assigned to the encoding target picture. Is.

なお、本実施の形態ではMB単位の符号量制御を行わなかったが、ステップS207、及びステップS208の後にMB単位の符号量制御を行って、次のMBの量子化値を算出し、前記算出した量子化値を使用してもよい。   In this embodiment, code amount control in units of MB is not performed. However, code amount control in units of MB is performed after steps S207 and S208, and the quantization value of the next MB is calculated. Quantized values may be used.

次に、量子化決定部112について詳しく説明する。量子化決定部112は、ME/MC・タイプ判定部111より、符号化対象MBのイントラ/インターのタイプ判定結果が入力されると共に、周辺MB情報保存部113より、図3に示すように、現在の符号化対象のMB301に対して上側に隣接した位置にある上MB302の量子化値候補及びタイプ情報と、左側に隣接した位置にある左MB303の量子化値候補及びタイプ情報とが入力され、符号量制御部114より、先頭MBの初期量子化値と、インターピクチャのピクチャタイプに対応した平均量子化値Qaveが入力され、これらの入力されたデータを使用し、現在の符号化対象のMB301の量子化値候補を決定し、その決定後の量子化値候補を周辺MB情報保存部113にピクチャタイプと共に保存する。なお、一画面の左端でかつ上端の1MBについては、周辺MBは存在しないので、周辺MB情報保存部113には、ピクチャ平均量子化値がそのMBの量子化値候補として保存される。   Next, the quantization determination unit 112 will be described in detail. The quantization determination unit 112 receives the intra / inter type determination result of the encoding target MB from the ME / MC / type determination unit 111, and from the neighboring MB information storage unit 113, as shown in FIG. The quantized value candidate and type information of the upper MB 302 located at the upper adjacent position to the current encoding target MB 301 and the quantized value candidate and type information of the left MB 303 located at the left adjacent position are input. The code amount control unit 114 receives the initial quantization value of the first MB and the average quantization value Qave corresponding to the picture type of the inter picture, and uses these input data to determine the current encoding target. MB301 quantization value candidates are determined, and the determined quantization value candidates are stored in the peripheral MB information storage unit 113 together with the picture type. Since 1 MB at the left end and the upper end of one screen does not have a peripheral MB, the peripheral MB information storage unit 113 stores the picture average quantized value as a quantized value candidate of the MB.

このようにして符号化対象ピクチャ内の全てのMBの量子化値候補が決定して周辺MB情報保存部113に保持され次第、周辺MB情報保存部113から符号化対象ピクチャの全MBの量子化値候補を読み出してその平均値を算出し、算出した平均値が符号化対象ピクチャの平均量子化値Qaveと同等になるまで全体的に各MBの量子化値候補を補正して、最終的な量子化値を生成する。   As soon as quantization value candidates for all MBs in the encoding target picture are determined and stored in the peripheral MB information storage unit 113, the quantization of all MBs of the encoding target picture is performed from the peripheral MB information storage unit 113. The value candidates are read and the average value is calculated, and the quantized value candidates of each MB are corrected as a whole until the calculated average value is equal to the average quantized value Qave of the encoding target picture. Generate quantized values.

例えば、周辺情報を利用して、符号化対象ピクチャ内の全MBの量子化値候補を決定したとする。その際の符号化対象ピクチャ内の全てのMBの平均量子化値候補を「20」とする。設定するべき量子化値は、入力された符号化対象ピクチャの予め定められた平均量子化値Qaveが「22」とすると、「2」(=22−20)だけ小さいことになる。よって、この場合、符号化対象ピクチャ内の全MBの量子化値候補を「2」ずつ増やし、そのピクチャ内の全てのMBの量子化値候補を平均量子化値Qaveと同等にするように補正することで、各MBの量子化値を求める。   For example, it is assumed that quantization value candidates for all MBs in the encoding target picture are determined using peripheral information. In this case, the average quantization value candidate of all MBs in the encoding target picture is set to “20”. The quantization value to be set is smaller by “2” (= 22−20) when the predetermined average quantization value Qave of the input encoding target picture is “22”. Therefore, in this case, the quantization value candidates of all MBs in the encoding target picture are increased by “2”, and the quantization value candidates of all MBs in the picture are corrected to be equal to the average quantization value Qave. As a result, the quantization value of each MB is obtained.

対象MBの量子化決定方法の表を表1に示す。   A table of quantization determination methods for the target MB is shown in Table 1.

Figure 2008153802
なお、表1において、カレントMBは現在の符号化対象のMBであり、イントラ補正値(IntraQ)とは、ある量子化値をイントラ量子化値に換算する数値であり、インター補正値(InterQ)とは、ある量子化値をインター量子化値に換算する数値である。
Figure 2008153802
In Table 1, the current MB is the current encoding target MB, and the intra correction value (IntraQ) is a numerical value for converting a certain quantized value into an intra quantized value, and an inter correction value (InterQ). Is a numerical value for converting a certain quantized value into an inter quantized value.

イントラ補正値(IntraQ)及びインター補正値(InterQ)は、本実施の形態では、Pピクチャを符号化している場合は、イントラ補正値(IntraQ)は「1/1.1」、インター補正値(InterQ)は「1.1」とし、Bピクチャを符号化している場合は、イントラ補正値(IntraQ)は「1/1.4」、インター補正値(InterQ)は「1.4」とした。   In the present embodiment, the intra correction value (IntraQ) and the inter correction value (InterQ) are “1 / 1.1” when the P picture is encoded, InterQ) is “1.1”, and when the B picture is encoded, the intra correction value (IntraQ) is “1 / 1.4” and the inter correction value (InterQ) is “1.4”.

このように、本実施の形態によれば、量子化決定部112がインターピクチャ内の各MBの量子化値候補をMB単位で決定する際に、量子化値候補を決定したいMBの周辺MB(左側と上側に隣接する各MB)の情報を使用してMB単位で量子化値候補を全MBについて求めた後、一画面の符号化対象ピクチャ内の全MBの量子化値候補の平均値がピクチャの平均量子化値Qaveと同等となるように各MB単位で量子化値候補を補正して各MB単位で量子化値を生成するようにしているので、隣接するMB間に生じるブロック歪みを減少することができ、主観画質の向上が実現できる。   As described above, according to the present embodiment, when the quantization determination unit 112 determines the quantization value candidates of each MB in the inter picture in units of MB, the neighboring MBs ( After obtaining quantization value candidates for all MBs in units of MB using the information on each MB adjacent to the left side and the upper side, the average value of the quantization value candidates for all MBs in the picture to be encoded in one screen is Since the quantized value candidate is corrected in each MB unit so as to be equal to the average quantized value Qave of the picture and the quantized value is generated in each MB unit, block distortion generated between adjacent MBs is reduced. The subjective image quality can be improved.

なお、本実施の形態では、イントラ補正値とインター補正値を固定値としたが、画像特性などで任意に変更しても構わない。また、ピクチャ境界など周辺MBが存在しない場合は、存在するMBのみを使用し、量子化値候補を算出する。また、本実施の形態では、上MBと左MBを周辺MBとしたが、既に量子化値候補の算出が終了している左上MBや右上MBを周辺情報として利用し量子化値候補を算出してもよい。また、本実施の形態では、MBタイプを使用して量子化値候補を決定したが、周辺MBの動きベクトル値、タイプ判定結果などの情報を用いて重み付けなどして量子化値候補を決定してもよい。   In this embodiment, the intra correction value and the inter correction value are fixed values, but may be arbitrarily changed depending on image characteristics. If there is no neighboring MB such as a picture boundary, only the existing MB is used to calculate a quantization value candidate. In this embodiment, the upper MB and the left MB are set as the peripheral MBs. However, the quantized value candidates are calculated using the upper left MB and the upper right MB, which have already been calculated, as peripheral information. May be. In this embodiment, the MB type is used to determine the quantized value candidate. However, the quantized value candidate is determined by weighting using information such as the motion vector value of the neighboring MB and the type determination result. May be.

なお、本発明は図1に示した動画像符号化装置のフレームメモリ101、109以外の各構成部をコンピュータにより実現するための動画像符号化プログラムを含む。この場合、動画像符号化プログラムは、記録媒体からコンピュータに取り込まれてもよいし、通信ネットワークを介して配信されてコンピュータに取り込まれてもよい。   The present invention includes a moving picture coding program for realizing each component other than the frame memories 101 and 109 of the moving picture coding apparatus shown in FIG. 1 by a computer. In this case, the moving image encoding program may be taken into the computer from the recording medium, or may be delivered via the communication network and taken into the computer.

本発明の動画像符号化装置の一実施の形態のブロック図である。It is a block diagram of one embodiment of a moving picture coding apparatus of the present invention. 本発明装置の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of this invention apparatus. 現MBの周辺MBの一例の説明図である。It is explanatory drawing of an example of peripheral MB of the present MB. 特許文献1記載の従来の動画像符号化装置のブロック図である。It is a block diagram of the conventional moving image encoding device described in Patent Document 1. 図4の装置の符号量制御フローチャートである。6 is a code amount control flowchart of the apparatus of FIG. イントラ圧縮とインター圧縮の違いを説明する図である。It is a figure explaining the difference between intra compression and inter compression.

符号の説明Explanation of symbols

101、110 フレームメモリ
103 減算器
104 直交変換器
105 量子化器
106 符号化回路
107 逆量子化器
108 逆直交変換器
109 加算器
111 ME/MC・タイプ判定部
112 量子化決定部
113 周辺MB情報保存部
114 符号量制御部
101, 110 Frame memory 103 Subtractor 104 Orthogonal transformer 105 Quantizer 106 Coding circuit 107 Inverse quantizer 108 Inverse orthogonal transformer 109 Adder 111 ME / MC / type determining unit 112 Quantization determining unit 113 Peripheral MB information Storage unit 114 Code amount control unit

Claims (2)

動画像信号の一画面を所定の画素数の画像領域であるブロック単位に分割し、符号化対象の前記動画像信号と符号化データから復号した参照画像信号とを用いて動き補償予測して得られた予測信号と、前記符号化対象の動画像信号との差分信号に対して、前記ブロック単位に直交変換、量子化及び可変長符号化を順次行って、インター符号化された各画面の前記符号化データを生成する動画像符号化装置において、
符号化対象の一画面のすべての前記ブロックが、予め定めた第1のブロックと該第1のブロック以外の複数の第2のブロックとからなるとき、前記第1のブロックの第1の量子化値候補と、そのブロックが前記参照画像信号の対応するブロックの情報を用いて前記インター符号化を行う第1の符号化タイプか、前記参照画像信号を用いないイントラ符号化を行う第2の符号化タイプであるかを示す第1の符号化タイプ情報とが事前に保存されており、かつ、前記複数の第2のブロックの量子化値候補と、その第2のブロックが前記第1の符号化タイプか前記第2の符号化タイプであるかを示す第2の符号化タイプ情報とを全てブロック単位で順次に保存するための情報保存手段と、
前記情報保存手段からそれぞれ取得した、前記複数の第2のブロックの内の一の第2のブロックに隣接する周辺ブロックの前記第1又は第2の符号化タイプ情報及び前記第1又は第2の量子化値候補と、前記動画像信号から取得した該第2のブロックの前記第2の符号化タイプ情報とに基づいて、該第2のブロックの前記第2の量子化値候補を決定し、その決定した第2の量子化値候補と共に該第2のブロックの前記第2の符号化タイプ情報を前記情報保存手段に保存する第2の量子化値候補決定・保存動作を全ての前記第2のブロックに対して順次に行う量子化値決定手段と、
前記符号化対象の一画面をインター符号化するときに割り当てられた符号量に基づいて、ピクチャ平均量子化値を算出する算出手段と、
前記情報保存手段から前記符号化対象の一画面のすべての前記第1及び第2のブロックの前記第1及び第2の量子化値候補を読み出してその平均値を算出し、算出した該平均値が前記ピクチャ平均量子化値と同等となるように前記情報保存手段から読み出した前記第1及び第2のブロックの前記第1及び第2の量子化値候補を補正して各ブロック毎の量子化値を生成する補正手段と
を有し、前記補正手段により生成された前記各ブロック毎の量子化値に基づいて、前記直交変換された差分信号に対して前記量子化を前記ブロック単位で行うことを特徴とする動画像符号化装置。
It is obtained by dividing one screen of a moving image signal into blocks, which are image areas having a predetermined number of pixels, and performing motion compensation prediction using the moving image signal to be encoded and a reference image signal decoded from the encoded data. The difference signal between the encoded prediction signal and the video signal to be encoded is sequentially subjected to orthogonal transform, quantization, and variable length encoding in units of blocks, and the inter-encoded screens In a video encoding device that generates encoded data,
When all the blocks of one screen to be encoded are composed of a predetermined first block and a plurality of second blocks other than the first block, the first quantization of the first block A value candidate and a first encoding type in which the block performs the inter encoding using information of a corresponding block of the reference image signal, or a second code that performs intra encoding without using the reference image signal First coding type information indicating whether the second block is a quantization type is stored in advance, and the quantized value candidates of the plurality of second blocks, and the second block is the first code. Information storage means for sequentially storing all the second encoding type information indicating whether the encoding type or the second encoding type, in units of blocks;
The first or second encoding type information of the neighboring block adjacent to one second block of the plurality of second blocks and the first or second obtained respectively from the information storage unit Determining the second quantized value candidate of the second block based on the quantized value candidate and the second encoding type information of the second block acquired from the video signal; The second quantization value candidate determination / storage operation for storing the second encoding type information of the second block in the information storage unit together with the determined second quantization value candidate is performed for all the second quantization values. Quantization value determining means for sequentially performing the blocks,
Calculation means for calculating a picture average quantization value based on a code amount assigned when inter-encoding one screen to be encoded;
Read the first and second quantized value candidates of all the first and second blocks of one screen of the encoding target from the information storage unit, calculate the average value, and calculate the average value Quantize each block by correcting the first and second quantized value candidates of the first and second blocks read from the information storage means so that is equal to the picture average quantized value. Correcting means for generating a value, and performing the quantization on the orthogonally transformed difference signal in units of blocks based on the quantized value for each block generated by the correcting means. A video encoding apparatus characterized by the above.
動画像信号の一画面を所定の画素数の画像領域であるブロック単位に分割し、符号化対象の前記動画像信号と符号化データから復号した参照画像信号とを用いて動き補償予測して得られた予測信号と、前記符号化対象の動画像信号との差分信号に対して、前記ブロック単位に直交変換、量子化及び可変長符号化を順次行って、インター符号化された各画面の前記符号化データを、コンピュータにより生成する動画像符号化プログラムにおいて、
前記コンピュータに、
符号化対象の一画面のすべての前記ブロックが、予め定めた第1のブロックと該第1のブロック以外の複数の第2のブロックとからなるとき、前記第1のブロックの第1の量子化値候補と、そのブロックが前記参照画像信号の対応するブロックの情報を用いて前記インター符号化を行う第1の符号化タイプか、前記参照画像信号を用いないイントラ符号化を行う第2の符号化タイプであるかを示す第1の符号化タイプ情報とが事前に保存されており、かつ、前記複数の第2のブロックの量子化値候補と、その第2のブロックが前記第1の符号化タイプか前記第2の符号化タイプであるかを示す第2の符号化タイプ情報とを全てブロック単位で順次に保存するための情報保存手段からそれぞれ取得した、前記複数の第2のブロックの内の一の第2のブロックに隣接する周辺ブロックの前記第1又は第2の符号化タイプ情報及び前記第1又は第2の量子化値候補と、前記動画像信号から取得した該第2のブロックの前記第2の符号化タイプ情報とに基づいて、該第2のブロックの前記第2の量子化値候補を決定し、その決定した第2の量子化値候補と共に該第2のブロックの前記第2の符号化タイプ情報を前記情報保存手段に保存する第2の量子化値候補決定・保存動作を全ての前記第2のブロックに対して順次に行う第1のステップと、
前記第1のステップで決定した前記第2の量子化値候補を前記情報保存手段に保存すると共に前記符号化対象の第2のブロックの第2の符号化タイプ情報を前記情報保存手段に保存する第2のステップと、
前記符号化対象の一画面をインター符号化するときに割り当てられた符号量に基づいて、ピクチャ平均量子化値を算出する第3のステップと、
前記情報保存手段から前記符号化対象の一画面のすべての前記第1及び第2のブロックの前記第1及び第2の量子化値候補を読み出してその平均値を算出する第4のステップと、
前記第4のステップで算出した前記平均値が前記ピクチャ平均量子化値と同等となるように前記情報保存手段から読み出した前記第1及び第2のブロックの前記第1及び第2の量子化値候補を補正して各ブロック毎の量子化値を生成する第5のステップと、
を含み、前記第5のステップにより生成された前記各ブロック毎の量子化値に基づいて、前記直交変換された差分信号に対して前記量子化を前記ブロック単位で前記コンピュータに実行させることを特徴とする動画像符号化プログラム。
It is obtained by dividing one screen of a moving image signal into blocks, which are image areas having a predetermined number of pixels, and performing motion compensation prediction using the moving image signal to be encoded and a reference image signal decoded from the encoded data. The difference signal between the encoded prediction signal and the video signal to be encoded is sequentially subjected to orthogonal transform, quantization, and variable length encoding in units of blocks, and the inter-encoded screens In a moving image encoding program for generating encoded data by a computer,
In the computer,
When all the blocks of one screen to be encoded are composed of a predetermined first block and a plurality of second blocks other than the first block, the first quantization of the first block A value candidate and a first encoding type in which the block performs the inter encoding using information of a corresponding block of the reference image signal, or a second code that performs intra encoding without using the reference image signal First coding type information indicating whether the second block is a quantization type is stored in advance, and the quantized value candidates of the plurality of second blocks, and the second block is the first code. Each of the plurality of second blocks obtained from the information storage means for sequentially storing all the second encoding type information indicating whether the encoding type or the second encoding type is in block units. The first in The first or second encoding type information and the first or second quantization value candidate of the neighboring block adjacent to the block, and the second block of the second block acquired from the moving image signal The second quantization value candidate of the second block is determined based on the coding type information, and the second encoding of the second block is determined together with the determined second quantization value candidate. A first step of sequentially performing a second quantized value candidate determining / storing operation for storing type information in the information storing unit for all the second blocks;
The second quantized value candidate determined in the first step is stored in the information storage unit, and the second encoding type information of the second block to be encoded is stored in the information storage unit. A second step;
A third step of calculating a picture average quantization value based on a code amount assigned when inter-encoding one screen to be encoded;
A fourth step of reading out the first and second quantized value candidates of all the first and second blocks of one screen of the encoding target from the information storage unit and calculating an average value thereof;
The first and second quantized values of the first and second blocks read from the information storage means so that the average value calculated in the fourth step is equivalent to the picture average quantized value. A fifth step of correcting candidates and generating a quantized value for each block;
And causing the computer to execute the quantization on the block-by-block basis for the orthogonally transformed difference signal based on the quantization value for each block generated by the fifth step. A video encoding program.
JP2006337747A 2006-12-15 2006-12-15 Moving picture encoding device and moving picture encoding program Pending JP2008153802A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006337747A JP2008153802A (en) 2006-12-15 2006-12-15 Moving picture encoding device and moving picture encoding program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006337747A JP2008153802A (en) 2006-12-15 2006-12-15 Moving picture encoding device and moving picture encoding program

Publications (1)

Publication Number Publication Date
JP2008153802A true JP2008153802A (en) 2008-07-03

Family

ID=39655549

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006337747A Pending JP2008153802A (en) 2006-12-15 2006-12-15 Moving picture encoding device and moving picture encoding program

Country Status (1)

Country Link
JP (1) JP2008153802A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101552631B1 (en) 2011-05-20 2015-09-11 주식회사 케이티 Method And Apparatus For Intra Prediction
JP2018117356A (en) * 2010-08-17 2018-07-26 エレクトロニクス アンド テレコミュニケーションズ リサーチ インスチチュートElectronics And Telecommunications Research Institute Video coding method, video coding device, video decoding method and video decoding device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018117356A (en) * 2010-08-17 2018-07-26 エレクトロニクス アンド テレコミュニケーションズ リサーチ インスチチュートElectronics And Telecommunications Research Institute Video coding method, video coding device, video decoding method and video decoding device
US10939106B2 (en) 2010-08-17 2021-03-02 Electronics And Telecommunications Research Institute Method and apparatus for encoding video, and decoding method and apparatus
US10827174B2 (en) 2010-08-17 2020-11-03 Electronics And Telecommunications Research Institute Method and apparatus for encoding video, and decoding method and apparatus
US9749640B2 (en) 2011-05-20 2017-08-29 Kt Corporation Method and apparatus for intra prediction within display screen
US9445123B2 (en) 2011-05-20 2016-09-13 Kt Corporation Method and apparatus for intra prediction within display screen
US9584815B2 (en) 2011-05-20 2017-02-28 Kt Corporation Method and apparatus for intra prediction within display screen
KR101552631B1 (en) 2011-05-20 2015-09-11 주식회사 케이티 Method And Apparatus For Intra Prediction
US9749639B2 (en) 2011-05-20 2017-08-29 Kt Corporation Method and apparatus for intra prediction within display screen
US9756341B2 (en) 2011-05-20 2017-09-05 Kt Corporation Method and apparatus for intra prediction within display screen
US9843808B2 (en) 2011-05-20 2017-12-12 Kt Corporation Method and apparatus for intra prediction within display screen
US9432669B2 (en) 2011-05-20 2016-08-30 Kt Corporation Method and apparatus for intra prediction within display screen
US10158862B2 (en) 2011-05-20 2018-12-18 Kt Corporation Method and apparatus for intra prediction within display screen
US9432695B2 (en) 2011-05-20 2016-08-30 Kt Corporation Method and apparatus for intra prediction within display screen
US9288503B2 (en) 2011-05-20 2016-03-15 Kt Corporation Method and apparatus for intra prediction within display screen

Similar Documents

Publication Publication Date Title
JP4901772B2 (en) Moving picture coding method and moving picture coding apparatus
JP2006157881A (en) Variable-length coding device and method of same
KR20050074286A (en) Image encoding device, image encoding method and image encoding program
JPWO2006101126A1 (en) Encoding device and moving image recording system provided with encoding device
JP2008227670A (en) Image coding device
JP4901450B2 (en) Video encoding device
JP5649296B2 (en) Image encoding device
KR100987921B1 (en) Block based Motion-Search Area Rate Distortion Optimization using Motion Blur/Deblur post filter
KR100708182B1 (en) Rate control apparatus and method in video encoder
JP6708211B2 (en) Moving picture coding apparatus, moving picture coding method, and recording medium storing moving picture coding program
JP4130617B2 (en) Moving picture coding method and moving picture coding apparatus
JP2009049969A (en) Device and method of coding moving image and device and method of decoding moving image
JP2008153802A (en) Moving picture encoding device and moving picture encoding program
JP2008160402A (en) Encoding device and method, and image encoding device
JP4367354B2 (en) Image encoding device
JP5937926B2 (en) Image encoding device, image decoding device, image encoding program, and image decoding program
JP2010212785A (en) Moving image coding apparatus and moving image coding method
JP4561701B2 (en) Video encoding device
JP7069421B2 (en) Encoding device, decoding device, and program
JP4847423B2 (en) Moving picture encoding apparatus and computer program
KR20090037288A (en) Method for real-time scene-change detection for rate control of video encoder, method for enhancing qulity of video telecommunication using the same, and system for the video telecommunication
JP7291478B2 (en) Video encoding device and its program
JP2010166275A (en) Image encoding device
KR100507441B1 (en) Method for encoding video signals for reducing bitrate using feature of vlc inputs and video encoder for executing the method
JP4429516B2 (en) Image encoding device