JP2005236710A - Moving image encoder - Google Patents

Moving image encoder Download PDF

Info

Publication number
JP2005236710A
JP2005236710A JP2004043964A JP2004043964A JP2005236710A JP 2005236710 A JP2005236710 A JP 2005236710A JP 2004043964 A JP2004043964 A JP 2004043964A JP 2004043964 A JP2004043964 A JP 2004043964A JP 2005236710 A JP2005236710 A JP 2005236710A
Authority
JP
Japan
Prior art keywords
value
picture
motion vector
optimum
encoding
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
JP2004043964A
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 JP2004043964A priority Critical patent/JP2005236710A/en
Publication of JP2005236710A publication Critical patent/JP2005236710A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a moving image encoder for improving encoding efficiency and image quality by selecting an M value corresponding to the characteristics of a desired image and reducing a processing cost even under the condition of a low bit rate. <P>SOLUTION: In a motion vector information detecting unit 114, the largeness of a motion vector sought by a motion compensation predicting unit 113 and a retrieving range used when the motion vector is sought are made correlated with the largeness of the motion vector of each M value and the retrieving range, and then an optimum M value is determined by using generation frequency of motion vectors located in the retrieving range. In an optimum M value determining unit 116, a fluctuation of the optimum M value is controlled by using a ratio of the generated code amount of the motion vector sought by the motion compensation predicting unit 113, to the whole generated code amount of a current encoding picture obtained by a generated code amount counter 115 and held by a buffer unit 107; and finally an optimum M value for next encoding is determined. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は動画像符号化装置に係り、特にフレーム間予測符号化方式により符号量制御を行いながら動画像情報を符号化する動画像符号化装置に関する。   The present invention relates to a moving image encoding apparatus, and more particularly to a moving image encoding apparatus that encodes moving image information while performing code amount control by an inter-frame predictive encoding method.

画像情報の圧縮符号化方式として、例えば、国際標準化されたH.261、H.262、H.263、H.264、MPEG(Moving Picture Experts Group)−1、MPEG−2、MPEG−4等が知られている。これらの圧縮符号化方式は、DCT(Discrete Cosine Transform:離散コサイン変換)や動き補償フレーム間予測等の処理を含むもので、更に効率良く圧縮率を高め、画質を向上させ、特に低ビットレートで画質向上をすることが要望されている。   Examples of compression coding methods for image information include internationally standardized H.261, H.262, H.263, H.264, MPEG (Moving Picture Experts Group) -1, MPEG-2, MPEG-4, and the like. Are known. These compression coding methods include processes such as DCT (Discrete Cosine Transform) and motion compensation interframe prediction, and more efficiently increase the compression rate, improve the image quality, especially at low bit rates. There is a demand for improving image quality.

画像情報の圧縮符号化方式において、時間軸方向の冗長性を利用して圧縮する方式の一つとしてフレーム間予測符号化方式があり、前記MPEG−1、MPEG−2、MPEG−4などにおいては、前方向画像間予測符号化(以下、前方向予測という)と後方向画像間予測符号化(以下、後方向予測という)の両方を利用できる。前方向予測とは、過去のフレームと現在のフレームとの間の動きを検出し、過去のフレームから現在のフレームを生成するものであり、後方向予測とは、未来のフレームと現在のフレームとの間の動きを検出し、未来のフレームから現在のフレームを生成するものである。   As a compression encoding method for image information, there is an inter-frame prediction encoding method as one of the methods using compression in the time axis direction. In MPEG-1, MPEG-2, MPEG-4, etc. Both forward inter-picture prediction coding (hereinafter referred to as forward prediction) and backward inter-picture prediction coding (hereinafter referred to as backward prediction) can be used. Forward prediction is to detect the motion between the past frame and the current frame and generate the current frame from the past frame, and backward prediction is the future frame and the current frame. Is detected, and the current frame is generated from the future frame.

参照画像となり得る前記前方向予測による符号化の画像をPピクチャ、前記前方向予測と前記後方向予測の両方を用いる被参照画像である両方向予測による符号化の画像をBピクチャ、予測を伴わないフレーム内符号化(画像内符号化)の画像をIピクチャとする。前記MPEG−1、MPEG−2、MPEG−4などにおいては、上記の各ピクチャをIBBPBBP・・・のような順番でフレーム内符号化と予測による符号化とを組み合わせて符号化を行うものである。   An image encoded by the forward prediction that can be a reference image is a P picture, and an image encoded by the bidirectional prediction that is a referenced image using both the forward prediction and the backward prediction is a B picture. An image of intra-frame coding (intra-picture coding) is an I picture. In the MPEG-1, MPEG-2, MPEG-4, etc., the above-mentioned pictures are encoded by combining intra-frame encoding and prediction encoding in the order of IBBPBBP. .

ここで、隣接するIピクチャとPピクチャ間又は隣接するPピクチャ同士の間隔を一般にM値と呼ぶ(本明細書においても、M値はこのピクチャ間隔を意味するものとする。)。例えば、M=3である場合、隣接するIピクチャとPピクチャ間又は隣接するPピクチャ同士の間に2枚のBピクチャが存在し、IBBPBBP・・・のようになる。一般的に、MPEG技術を使用して符号化する際、前記M値を固定として符号化している場合が多い。   Here, an interval between adjacent I and P pictures or between adjacent P pictures is generally called an M value (in this specification, the M value means this picture interval). For example, when M = 3, there are two B pictures between adjacent I and P pictures or between adjacent P pictures, such as IBBPBBP. In general, when encoding using MPEG technology, the M value is often fixed.

しかし、動きの速い画像である場合、ピクチャ間の距離が大きくなると、動きを正確に捉えるために動きベクトルの探索範囲を大きくする必要があり、処理コストが大きくなる。逆に、処理コストを抑えるために、前記探索範囲を小さくしてしまうと前記動きベクトルの精度が下がってしまい予測効率が低下し、符号化効率も低下してしまう。そこで、処理コストを抑え、かつ、符号化効率の低下を防ぐために、MPEG技術を使用して画像を符号化する際、前記M値を固定として符号化するのではなく、動きの特徴に応じて前記M値を変化させて符号化する動画像符号化装置が従来より知られている(例えば、特許文献1、2参照)。   However, in the case of a fast-moving image, if the distance between pictures increases, it is necessary to increase the motion vector search range in order to accurately capture the motion, which increases processing costs. On the other hand, if the search range is reduced in order to reduce the processing cost, the accuracy of the motion vector is lowered, the prediction efficiency is lowered, and the coding efficiency is also lowered. Therefore, in order to reduce the processing cost and prevent a decrease in encoding efficiency, when encoding an image using MPEG technology, the M value is not fixed and is encoded according to the characteristics of the motion. 2. Description of the Related Art Conventionally, a moving image coding apparatus that performs coding by changing the M value is known (see, for example, Patent Documents 1 and 2).

例えば、特許文献1には、動きベクトルの分布の割合に応じてPピクチャ間距離を増加させ、また、ピクチャ間予測差分値によってフレーム間距離を短縮する方法が開示されている。すなわち、図6に示すように、Xl3〜Xu3の動きベクトルの探索範囲を持ち、現ピクチャに対してM=2で符号化している場合を考えると、探索範囲を2/3にしたXl2〜Xu2の範囲に検出した動きベクトルの分布の割合が多ければ次のM値を3にし、割合が少なければ、M値は2のままに維持しておき、ピクチャ間の予測誤差が一定値を超えていた場合、M値を2から1に減少させ、次に符号化するM値を決定し、M値を可変とすることで符号化効率を向上させている。この特許文献1記載の従来の動画像符号化装置によれば、動画像の特徴に応じて前記M値を変化させることで、M値固定のときよりも符号化効率を向上させることができる。   For example, Patent Literature 1 discloses a method of increasing the inter-P-picture distance according to the motion vector distribution ratio and reducing the inter-frame distance by the inter-picture prediction difference value. That is, as shown in FIG. 6, when considering a motion vector search range of X13 to Xu3 and encoding the current picture with M = 2, X12 to Xu2 with the search range set to 2/3 The next M value is set to 3 if the ratio of the motion vector distribution detected in the range is large, and if the ratio is small, the M value is maintained at 2 and the prediction error between pictures exceeds a certain value. In this case, the encoding efficiency is improved by decreasing the M value from 2 to 1, determining the M value to be encoded next, and making the M value variable. According to the conventional moving picture coding apparatus described in Patent Document 1, the coding efficiency can be improved by changing the M value according to the feature of the moving picture as compared with the case where the M value is fixed.

また、特許文献2には、動きベクトルの大きさの平均値と動きベクトルの時間変化の大きさからフレーム間距離を増減させる方法が開示されている。この特許文献2記載の従来の動画像符号化装置によれば、特許文献1記載の従来装置と同様に前記M値を可変とすることで、M値固定の時よりも符号化効率を向上させることができる。   Patent Document 2 discloses a method for increasing / decreasing the interframe distance from the average value of the magnitude of the motion vector and the magnitude of the temporal change of the motion vector. According to the conventional moving picture encoding device described in Patent Document 2, the M value is made variable as in the conventional device described in Patent Document 1, thereby improving the encoding efficiency as compared with the case where the M value is fixed. be able to.

特開平9−294266号公報JP-A-9-294266 特開2000−333179号公報JP 2000-333179 A

特許文献1記載の従来の動画像符号化装置は、予測の際に求められる動きベクトルの大ききを利用して最適M値を判断し、動きベクトルの大きさが小さい場合にはM値を大きくする。また、特許文献2記載の従来の動画像符号化装置は、動きベクトルの大きさの平均と動きベクトルの時間変化を利用してM値の増減を判断し、特許文献1記載の従来の動画像符号化装置と同様に、動きベクトルの大きさが小さい場合には、動きベクトルの平均値が小さくなるのでM値を大きく、前記平均値が大きくなる場合は、M値を小さくする。   The conventional moving image coding apparatus described in Patent Document 1 determines the optimum M value by using the magnitude of the motion vector obtained at the time of prediction, and increases the M value when the magnitude of the motion vector is small. To do. In addition, the conventional moving image encoding device described in Patent Document 2 determines increase / decrease in the M value using the average of the magnitudes of the motion vectors and the temporal change of the motion vector, and the conventional moving image described in Patent Document 1 is used. Similar to the encoding device, when the size of the motion vector is small, the average value of the motion vector is small, so the M value is large. When the average value is large, the M value is small.

例えば、穏やかに揺らいでいる水面の画像を考えると、この画像には、動きの変化は小さく複雑であるという特徴がある。また、符号化の際の特徴として、上記の画像を予測する際に求められる動きベクトルの大きさが小さく、かつ、動きが複雑なため、動きベクトルにばらつきが生じ、動きベクトルを符号化する際の符号量が増加してしまうことがある。動きベクトルの符号量が増加すると、低ビットレート条件下の場合、動きベクトル以外に与えられる符号量が不足することがあり、符号化効率の低下、画質が劣化することがある。   For example, when considering an image of a water surface that is gently shaking, this image has the feature that the change in motion is small and complicated. Also, as a feature of encoding, when the motion vector required for predicting the above image is small and the motion is complicated, the motion vector varies, and the motion vector is encoded. The amount of codes may increase. When the code amount of the motion vector increases, under the low bit rate condition, the code amount given in addition to the motion vector may be insufficient, resulting in a decrease in encoding efficiency and image quality.

しかるに、上記の特許文献1及び2記載の従来の動画像符号化装置は、いずれも前記の穏やかに揺らいでいる水面のような画像を符号化する場合、求められる動きベクトルの大きさが小さいのでM値を大きくするが、低ビットレートである場合、M値を大きくすることで動きベクトルの発生符号量が大きくなり、結果として符号化効率の低下・画質の劣化を招くことがある。   However, the conventional moving picture coding apparatuses described in Patent Documents 1 and 2 both require a small motion vector size when coding an image such as the gently fluctuating water surface. Although the M value is increased, when the bit rate is low, increasing the M value increases the generated code amount of the motion vector, resulting in a decrease in encoding efficiency and a deterioration in image quality.

本発明は以上の点に鑑みなされたもので、任意の画像の特徴に応じたM値を選択し、低ビットレートの条件下においても、より処理コストを抑え符号化効率の向上と画質改善を行い得る動画像符号化装置を提供することを目的とする。   The present invention has been made in view of the above points. The M value is selected according to the characteristics of an arbitrary image, and even under a low bit rate condition, the processing cost is further reduced and the encoding efficiency is improved and the image quality is improved. It is an object of the present invention to provide a moving image encoding apparatus that can be used.

上記の目的を達成するため、第1の発明は、画像内符号化、前方向画像間予測符号化及び両方向画像間予測符号化の3種類の符号化手法で動画像信号を符号化して得たIピクチャ、Pピクチャ及びBピクチャを組み合わせた符号化信号、又は画像内符号化と前期前方向画像間予測符号化との2つの符号化手法で動画像信号を符号化して得たIピクチャとPピクチャとを組み合わせた符号化信号を出力する画像間予測符号化方式による動画像符号化装置であり、符号化信号中の隣接するIピクチャとPピクチャとの間の間隔、又は隣接する2つのPピクチャの間隔を示すM値を可変して符号化を行う動画像符号化装置であって、符号化信号を局部復号して得た参照用画像データと動画像信号とに基づき、動き補償を行って動きベクトルを求める動き補償予測手段と、符号化した現ピクチャ1枚当りの全発生符号量に占める動き補償予測手段で求めた動きベクトルの発生符号量の割合を求める発生符号量カウント手段と、動き補償予測手段から動きベクトルの大きさと、その動きベクトルの探索範囲と予測絶対値誤差とを入力として受け、現在符号化しているピクチャがPピクチャであるときに、入力された現在のM値の動きベクトルの大きさと、その動きベクトルを求めた際に使用した探索範囲とを基準として予め定めた互いに異なる複数の各M値毎に、探索範囲とその探索範囲内に存在する動きベクトルの発生個数を求め、動きベクトルの発生個数の最も多い探索範囲に対応するM値を、最適M値として選択する動きベクトル情報検出手段と、発生符号量カウント手段により求められた割合と所定の閾値を比較し、割合が閾値を越えているときには、動きベクトル情報検出手段により選択されたM値を更に小さくしたM値を次に符号化するときの最終的な最適M値として決定し、割合が閾値以下のときには、動きベクトル情報検出手段により選択されたM値を次に符号化するときの最終的な最適M値として決定する最適M値決定手段とを有し、最終的な最適M値に基づき、次に符号化するピクチャを指定して符号化する構成としたものである。   In order to achieve the above object, the first invention is obtained by encoding a moving image signal by three kinds of encoding methods of intra-picture coding, forward inter-picture predictive coding, and bi-directional inter-picture predictive coding. An encoded signal obtained by combining an I picture, a P picture, and a B picture, or an I picture and P obtained by encoding a moving picture signal by two encoding methods of intra-picture encoding and previous inter-picture predictive encoding A video encoding apparatus based on an inter-picture predictive encoding system that outputs an encoded signal combined with a picture, and an interval between adjacent I and P pictures in the encoded signal, or two adjacent P A moving picture coding apparatus that performs coding by changing an M value indicating a picture interval and performs motion compensation based on reference picture data obtained by local decoding of a coded signal and a moving picture signal To find the motion vector Compensation code predicting means, generated code quantity counting means for determining the ratio of the generated code quantity of the motion vector obtained by the motion compensation predicting means to the total generated code quantity per one encoded current picture, and motion compensated prediction means When the magnitude of the motion vector, the search range of the motion vector, and the predicted absolute value error are received as input, and the currently encoded picture is a P picture, the magnitude of the input current M-value motion vector The search range and the number of motion vectors existing in the search range are determined for each of a plurality of different M values determined in advance with reference to the search range used when the motion vector is obtained, and the motion vector The motion vector information detecting means for selecting the M value corresponding to the search range having the largest number of occurrences as the optimum M value and the generated code amount counting means. When the ratio exceeds the threshold, the final optimum M value when the M value selected by the motion vector information detecting means is further reduced is encoded next. And when the ratio is equal to or less than the threshold value, the optimum M value determining means for determining the final optimum M value when the M value selected by the motion vector information detecting means is encoded next is included. Based on a typical optimum M value, a picture to be encoded next is designated and encoded.

この発明では、現在符号化しているピクチャがPピクチャであるときに、予め定めた互いに異なる複数の各M値毎の探索範囲内に存在する動きベクトルの発生個数を求め、動きベクトルの発生個数の最も多い探索範囲に対応するM値を最適M値として選択し、更に、符号化した現ピクチャ1枚当りの全発生符号量に占める動きベクトルの発生符号量の割合と所定の閾値を比較し、割合が閾値を越えているときには、上記の選択されたM値を更に小さくしたM値を次に符号化するときの最終的な最適M値として決定し、割合が閾値以下のときには、上記の選択されたM値を次に符号化するときの最終的な最適M値として決定するようにしたため、動きベクトルの探索範囲を使用することにより、任意の画像の特徴に応じたM値を選択できると共に、現ピクチャ1枚当りの全発生符号量に占める動きベクトルの発生符号量の割合を考慮することにより、低ビットレートにおいても正確なM値を求めることができる。   In the present invention, when the currently encoded picture is a P picture, the number of motion vectors generated within a predetermined search range for each of a plurality of different M values is obtained, and the number of motion vectors generated is calculated. The M value corresponding to the most search range is selected as the optimal M value, and the ratio of the generated code amount of the motion vector to the total generated code amount per encoded current picture is compared with a predetermined threshold, When the ratio exceeds the threshold value, the M value obtained by further reducing the selected M value is determined as the final optimum M value for the next encoding. The determined M value is determined as the final optimum M value when the next encoding is performed. Therefore, by using the motion vector search range, it is possible to select an M value corresponding to the feature of an arbitrary image. Both , By considering the percentage of the generated code amount of motion vectors in the total generated code amount per one current picture, it is possible to obtain an accurate M values even at low bit rates.

また、上記の目的を達成するため、第2の発明は、第1の発明の動きベクトル情報検出手段を、現在符号化しているピクチャがBピクチャであるときは、そのBピクチャを符号化する際に求められた前方向の動きベクトルが、直前にPピクチャを符号化する際に選択した最適M値で定められた探索範囲内に所定数以上存在するか否か判定し、Bピクチャを符号化する際に求められた前方向の動きベクトルが所定数以上存在するときには、直前にPピクチャを符号化する際に選択した最適M値をそのまま最適M値として選択し、所定数以上存在しないときには、最適M値に替えてBピクチャで算出されたM値を次に符号化するときの最適M値として選択する手段を更に有する構成としたものである。   In order to achieve the above object, according to a second aspect of the present invention, the motion vector information detecting means according to the first aspect of the present invention encodes a B picture when the currently encoded picture is a B picture. It is determined whether or not there are a predetermined number or more of the forward motion vectors obtained in the search range defined by the optimum M value selected when the P picture is encoded immediately before, and the B picture is encoded. When there are a predetermined number or more of the motion vectors in the forward direction, the optimum M value selected when the P picture is encoded immediately before is selected as the optimum M value as it is. It has a configuration further comprising means for selecting the M value calculated in the B picture instead of the optimum M value as the optimum M value for the next encoding.

この発明では、Pピクチャを符号化したときに決定した最適M値で定められた探索範囲内に、現在符号化しているBピクチャの前方向の動きベクトルが所定数以上存在しないときには、最適M値に替えてBピクチャで算出されたM値を次に符号化するピクチャのM値とするようにしたため、Bピクチャの動きベクトル情報を用いて最適M値を補正することができる。   In the present invention, when there are no more than a predetermined number of forward motion vectors of the currently encoded B picture within the search range determined by the optimal M value determined when the P picture is encoded, the optimal M value Since the M value calculated for the B picture is used as the M value of the next picture to be encoded, the optimal M value can be corrected using the motion vector information of the B picture.

本発明によれば、動きベクトルの探索範囲と動きベクトルの大きさを各M値の探索範囲と動きベクトルの大きさに対応させ、探索範囲に存在する動きベクトルの発生頻度によって最適なM値を制御することにより、任意の画像の特徴に応じたM値を選択できるため、処理コストを抑え符号化効率の低下を防ぐことができる。   According to the present invention, the motion vector search range and the size of the motion vector are made to correspond to the search range of each M value and the size of the motion vector, and the optimum M value is determined according to the occurrence frequency of the motion vector existing in the search range. By controlling, it is possible to select an M value according to the characteristics of an arbitrary image, so that it is possible to reduce processing costs and prevent a decrease in encoding efficiency.

また、本発明によれば、現ピクチャ1枚当りの全発生符号量に占める動きベクトルの発生符号量の割合に応じて最適M値の増減を制御するようにしたため、低ビットレートにおいても正確なM値を求めることができ、低ビットレートにおいて、更に符号化効率の低下を防ぐことができる。   Further, according to the present invention, since the increase / decrease in the optimum M value is controlled in accordance with the ratio of the generated code amount of the motion vector to the total generated code amount per current picture, it is accurate even at a low bit rate. The M value can be obtained, and further reduction in coding efficiency can be prevented at a low bit rate.

更に、本発明によれば、Pピクチャを符号化したときに決定した最適M値で定められた探索範囲内に、現在符号化しているBピクチャの前方向の動きベクトルが所定数以上存在しないときには、最適M値に替えてBピクチャで算出されたM値を次に符号化するピクチャのM値とすることで、Bピクチャの動きベクトル情報を用いて最適M値を補正するようにしたため、Pピクチャのみで次の最適M値を決定する場合と比較して、より一層、最適M値を精度良く選択することができる。   Furthermore, according to the present invention, when there are no more than a predetermined number of motion vectors in the forward direction of the currently encoded B picture within the search range determined by the optimum M value determined when the P picture is encoded. Since the M value calculated in the B picture instead of the optimal M value is used as the M value of the next picture to be encoded, the optimal M value is corrected using the motion vector information of the B picture. Compared with the case where the next optimum M value is determined only by the picture, the optimum M value can be selected with higher accuracy.

次に、本発明を実施するための最良の形態について、図面と共に説明する。本発明は、任意の動画像に適したM値を求める際に、前処理として動き検出の演算をすることなく、かつ、符号化の際に求められるデータを使用してM値を求めるので余分な演算が少なく、かつ、低ビットレート条件下でも高画質を得られることを実現する。   Next, the best mode for carrying out the present invention will be described with reference to the drawings. In the present invention, when an M value suitable for an arbitrary moving image is obtained, the M value is obtained without performing motion detection calculation as preprocessing and using data obtained at the time of encoding. It is possible to obtain high image quality even under a low bit rate condition with little computation.

図1は本発明になる動画像符号化装置の一実施の形態のブロック図を示す。本実施の形態の動画像符号化装置は、画像入力部101、画像メモリ部102、減算器103、DCT部104、量子化部105、可変長符号化(VLC)部106、バッファ部107、符号量制御部108、逆量子化部109、逆DCT部110、加算器111、動き補償予測部113、動きベクトル情報検出部114、発生符号量カウント部115、最適M値決定部116、M値制御部117及びビットストリーム出力部118とよりなる。   FIG. 1 is a block diagram showing an embodiment of a moving picture encoding apparatus according to the present invention. The moving image coding apparatus according to the present embodiment includes an image input unit 101, an image memory unit 102, a subtractor 103, a DCT unit 104, a quantization unit 105, a variable length coding (VLC) unit 106, a buffer unit 107, a code Quantity control unit 108, inverse quantization unit 109, inverse DCT unit 110, adder 111, motion compensation prediction unit 113, motion vector information detection unit 114, generated code amount count unit 115, optimum M value determination unit 116, M value control Part 117 and a bit stream output part 118.

画像入力部101では、これから符号化しようとする動画像のデータを1枚ずつ入力し、画像メモリ部102に必要な枚数だけ動画像データを出力する。画像メモリ部102は、画像入力部101から送られた動画像データを数枚保持することができ、M値制御部117から指定された符号化する動画像データを出力する。   The image input unit 101 inputs moving image data to be encoded one by one, and outputs the required number of moving image data to the image memory unit 102. The image memory unit 102 can hold several pieces of moving image data sent from the image input unit 101, and outputs moving image data to be encoded designated by the M-value control unit 117.

減算器103は、画像メモリ部102から出力された動画像データから動き補償予測部113から出力された動き補償信号を減算して差分信号を出力する。ただし、画像メモリ部102から出力される動画像データがIピクチャとなる場合のみ、減算器103は当該動画像データをスルーしてDCT部104に入力する。DCT部104では、より高い符号化効率を得るために、上記の差分信号又はIピクチャとるなる動画像データを8×8画素程度のブロック単位で、直交変換手段の一例の離散コサイン変換(DCT)により係数成分に変換する。   The subtracter 103 subtracts the motion compensation signal output from the motion compensation prediction unit 113 from the moving image data output from the image memory unit 102, and outputs a difference signal. However, only when the moving image data output from the image memory unit 102 is an I picture, the subtractor 103 passes the moving image data and inputs the moving image data to the DCT unit 104. In the DCT unit 104, in order to obtain higher coding efficiency, the above-described differential signal or moving image data to be taken as an I picture is converted into discrete cosine transform (DCT) as an example of orthogonal transform means in units of about 8 × 8 pixels. To convert to a coefficient component.

量子化部105は、DCT部104で変換された信号(係数成分)を入力として受け、係数成分毎に、符号量制御部108により制御される量子化ステップで量子化する。VLC部106は、上記の量子化部105で量子化された信号が入力され、ハフマン符号等の可変長符号に変換し、可変長デジタルデータとしてバッファ部107に出力する。バッファ部107は、VLC部106で可変長符号化されたデータや、符号化の際に生じたデータを保持する。バッファ部107で保持されたデータは、ビットストリーム出力部118から符号化された画像データとして出力される。この符号化された画像データは、IBBPBBP・・・のように、Iピクチャ、Pピクチャ及びBピクチャを組み合わせた符号化信号系列であるが、IピクチャとPピクチャを組み合わせた符号化信号系列であってもよい。   The quantization unit 105 receives the signal (coefficient component) converted by the DCT unit 104 as an input, and quantizes each coefficient component in a quantization step controlled by the code amount control unit 108. The VLC unit 106 receives the signal quantized by the quantization unit 105, converts the signal into a variable length code such as a Huffman code, and outputs the variable length digital data to the buffer unit 107. The buffer unit 107 holds data that has been variable-length encoded by the VLC unit 106 and data that has been generated during encoding. The data held in the buffer unit 107 is output as encoded image data from the bit stream output unit 118. The encoded image data is an encoded signal sequence that combines an I picture, a P picture, and a B picture, such as IBBPBBP, but is an encoded signal sequence that combines an I picture and a P picture. May be.

符号量制御部108は、VLC部106で保持しているデータをもとに、次のピクチャを符号化するための符号量の制御をするために、量子化部105の量子化ステップを制御する。逆量子化部109は、量子化部105から出力された量子化信号に対して、予測処理のために量子化部105と逆の変換処理を行う。逆DCT部110は、逆量子化部109で逆量子化された信号をDCT部104と逆の直交変換を行う。   The code amount control unit 108 controls the quantization step of the quantization unit 105 in order to control the code amount for encoding the next picture based on the data held in the VLC unit 106. . The inverse quantization unit 109 performs a conversion process opposite to that of the quantization unit 105 for the prediction process on the quantized signal output from the quantization unit 105. The inverse DCT unit 110 performs inverse orthogonal transform on the signal inversely quantized by the inverse quantization unit 109 and inversely to the DCT unit 104.

加算器111は、逆DCT部110から出力される信号に動き補償予測部113で得られた予測誤差信号を加算して符号化された画像データである参照画像信号を生成する。ただし、加算器111はIピクチャとなる画像データに対しては加算動作を行わず、逆DCT部110からの復号画像データをスルーして復号画像メモリ部112に供給する。   The adder 111 adds the prediction error signal obtained by the motion compensation prediction unit 113 to the signal output from the inverse DCT unit 110 to generate a reference image signal that is encoded image data. However, the adder 111 does not perform the addition operation on the image data to be the I picture, and passes the decoded image data from the inverse DCT unit 110 and supplies it to the decoded image memory unit 112.

復号画像メモリ部112は、加算器111より供給される復号化された画像データを保持する。動き補償予測部113は、画像メモリ部102から供給されるこれから符号化する動画像データと、復号画像メモリ部112から供給される局部復号して得た参照用画像データとを比較し、動き補償を行って動きベクトルを求める。   The decoded image memory unit 112 holds the decoded image data supplied from the adder 111. The motion compensation prediction unit 113 compares the moving image data to be encoded supplied from the image memory unit 102 with the reference image data obtained by local decoding supplied from the decoded image memory unit 112, and performs motion compensation. To obtain a motion vector.

動きベクトル情報検出部114は、動き補償予測部113で求めた動きベクトルの大きさと動きベクトルを求めた際に使用した探索範囲と予測絶対値誤差を用いて、後に詳述するように各M値の動きベクトルの大きさと探索範囲にそれぞれ存在する動きベクトルの発生頻度によって最適M値を決定し、その最適M値の結果を最適M値決定部116に出力する。発生符号量カウント部115は、バッファ部107に保持してある符号化した現符号化ピクチャの全発生符号量と、動き補償予測部113で求めた動きベクトルの発生符号量とに基づいて、全体に占める動きベクトルの符号量の割合(占有率)を求める。   The motion vector information detection unit 114 uses the search range and the predicted absolute value error used when the motion vector size and motion vector obtained by the motion compensation prediction unit 113 are obtained, as described in detail later. The optimum M value is determined based on the magnitude of the motion vector and the occurrence frequency of the motion vector existing in the search range, and the result of the optimum M value is output to the optimum M value determining unit 116. The generated code amount counting unit 115 is based on the total generated code amount of the encoded current encoded picture held in the buffer unit 107 and the generated code amount of the motion vector obtained by the motion compensation prediction unit 113. The ratio (occupation ratio) of the code amount of the motion vector in the area is obtained.

最適M値決定部116は、発生符号量カウント部115により求められた、符号化した現符号化ピクチャの全発生符号量に占める、動き補償予測部113で求めた動きベクトルの発生符号量の割合によって、後に詳述するように上記の最適M値の増減を制御し、最終的に次に符号化する最適M値を決定する。M値制御部117は、最適M値決定部116で決定された最適M値から、画像メモリ部102に対して次に符号化するピクチャタイプとピクチャを指定すると共に、一定の間隔でIピクチャを指定する。   The optimum M value determination unit 116 occupies the ratio of the generated code amount of the motion vector obtained by the motion compensation prediction unit 113 to the total generated code amount of the current encoded picture obtained by the generated code amount counting unit 115. By controlling the increase / decrease of the optimum M value as will be described in detail later, the optimum M value to be encoded next is finally determined. The M value control unit 117 designates the picture type and picture to be encoded next to the image memory unit 102 from the optimal M value determined by the optimal M value determination unit 116, and I pictures at regular intervals. specify.

次に、動きベクトル情報検出部114の動作について、図2に示す本発明のM値を可変にする際の動きベクトルのある探索範囲内の動きベクトルの個数を求めるためのフローチャートと共に詳細に説明する。まず、動きベクトル情報検出部114は、動き補償予測部113で求められた動きベクトルの水平方向と垂直方向の大きさ、探索範囲の大きさ、予測絶対値誤差の大きさとピクチャタイプが入力されて最適M値の決定処理を開始する(ステップS201)。続いて、動きベクトル情報検出部114は、ステップS201で入力されたピクチャタイプに基づき、現在符号化しているピクチャがPピクチャかBピクチャかを判定する(ステップS202)。   Next, the operation of the motion vector information detection unit 114 will be described in detail together with a flowchart for obtaining the number of motion vectors within a search range having a motion vector when the M value of the present invention shown in FIG. 2 is made variable. . First, the motion vector information detection unit 114 receives the horizontal and vertical sizes of the motion vector obtained by the motion compensation prediction unit 113, the size of the search range, the size of the predicted absolute value error, and the picture type. The process for determining the optimum M value is started (step S201). Subsequently, the motion vector information detection unit 114 determines whether the currently encoded picture is a P picture or a B picture based on the picture type input in step S201 (step S202).

動きベクトル情報検出部114は、ステップS202で現在符号化しているピクチャがPピクチャであると判定したときには、ステップS201で入力された現在のM値の探索範囲の大きさに基づいて、現在のM値を基準にして、各M値の距離に対応した探索範囲を求め(ステップS203)、更にステップS201で入力された水平・垂直方向の動きベクトルの大きさに基づいて、ステップS203の各M値に対応した探索範囲を求めた時と同様に、各M値に対応した動きベクトルの大きさを求める(ステップS204)。   When the motion vector information detection unit 114 determines in step S202 that the current encoded picture is a P picture, the motion vector information detection unit 114 determines the current M value based on the size of the search range of the current M value input in step S201. Based on the value, a search range corresponding to the distance of each M value is obtained (step S203), and each M value in step S203 is determined based on the magnitude of the horizontal and vertical motion vectors input in step S201. Similarly to the case where the search range corresponding to is obtained, the magnitude of the motion vector corresponding to each M value is obtained (step S204).

動きベクトル情報検出部114は、続いてステップS203及びステップS204で求まった各M値に対応した探索範囲と動きベクトルの大きさを用いて、各探索範囲内に存在する動きベクトルの発生個数を数える(ステップS205)。続いて、ステップS205で求められた各探索範囲内に存在する動きベクトルの発生個数の中で、最も発生頻度の大きい探索範囲に対応するM値を、次に符号化するPピクチャの間隔である最適M値と選択する(ステップS206)。   Subsequently, the motion vector information detection unit 114 uses the search range corresponding to each M value obtained in steps S203 and S204 and the magnitude of the motion vector to count the number of motion vectors that exist in each search range. (Step S205). Next, among the number of motion vectors generated in each search range obtained in step S205, the M value corresponding to the search range with the highest occurrence frequency is the interval between P pictures to be encoded next. The optimum M value is selected (step S206).

続いて、動きベクトル情報検出部114は、ステップS206で選択された最適M値が現在符号化しているピクチャのM値と等しい場合、各M値で予め定められた所定値と前記ステップS201で入力された予測絶対値誤差の大きさとを比較し(ステップS207)、予測絶対値誤差の大きさが、各M値で予め定められた所定値以上の大きさの場合には、現在のM値を小さくすることを決定し、前記予測絶対値誤差の大きさが前記所定値より小さい場合には、現在のM値を最適M値と決定する(ステップS208)。   Subsequently, when the optimum M value selected in step S206 is equal to the M value of the currently encoded picture, the motion vector information detection unit 114 inputs a predetermined value determined in advance for each M value in step S201. The magnitude of the predicted absolute value error is compared (step S207), and if the magnitude of the predicted absolute value error is greater than or equal to a predetermined value predetermined for each M value, the current M value is If it is determined that the predicted absolute value error is smaller than the predetermined value, the current M value is determined as the optimum M value (step S208).

他方、ステップS206で選択された最適M値が現在符号化しているピクチャのM値と異なる場合、選択された最適M値を次の最適M値として決定する(ステップS208)。動きベクトル情報検出部114は、ステップS208で決定した最適M値を、外部の最適M値決定部116へ出力する一方(ステップS209)、ステップS210で用いる。   On the other hand, if the optimum M value selected in step S206 is different from the M value of the currently encoded picture, the selected optimum M value is determined as the next optimum M value (step S208). The motion vector information detection unit 114 outputs the optimum M value determined in step S208 to the external optimum M value determination unit 116 (step S209), and uses it in step S210.

また、動きベクトル情報検出部114は、ステップS202で現在符号化しているピクチャがBピクチャであると判定したときには、ステップS208にてPピクチャを用いて決定された最適M値を保持する(ステップS210)。続いて、前記ステップS203と同様に、このステップS210で保持されたPピクチャを用いて決定された最適M値に対応した探索範囲の大きさを求める(ステップS211)。   If the motion vector information detection unit 114 determines in step S202 that the current encoded picture is a B picture, the motion vector information detection unit 114 holds the optimum M value determined using the P picture in step S208 (step S210). ). Subsequently, as in step S203, the size of the search range corresponding to the optimum M value determined using the P picture held in step S210 is obtained (step S211).

更に、ステップS211で求めた探索範囲に対応したBピクチャの前方向の動きベクトルの大きさを前記ステップS204と同様の方法で求める(ステップS212)。続いて、上記ステップS211で求められた探索範囲とステップS212で求められたBピクチャの前方向の動きベクトルとを用いて、その探索範囲内のBピクチャの前方向の動きベクトルの発生個数を数える(ステップS213)。   Further, the size of the forward motion vector of the B picture corresponding to the search range obtained in step S211 is obtained by the same method as in step S204 (step S212). Subsequently, using the search range obtained in step S211 and the forward motion vector of the B picture obtained in step S212, the number of forward motion vectors of the B picture in the search range is counted. (Step S213).

次に、上記ステップS213で求めた発生個数の、前記ステップS206で求めた発生個数に対する割合を求め、その割合がある閾値(以下、閾値Fとする)以上であれば、前記ステップS208で求まったM値を最適M値として決定し、割合がFより小さい場合であれば、ステップS208で求まったM値と異なるBピクチャでのM値を最適M値として決定する(ステップS214)。   Next, the ratio of the number of occurrences obtained in step S213 to the number of occurrences obtained in step S206 is obtained. If the ratio is equal to or greater than a certain threshold value (hereinafter referred to as threshold F), it is obtained in step S208. The M value is determined as the optimum M value, and if the ratio is smaller than F, the M value in the B picture different from the M value obtained in step S208 is determined as the optimum M value (step S214).

すなわち、上記の割合が閾値F以上であるということは、探索範囲の中にBピクチャの前方向の動きベクトルが多数存在していることを意味するので、その探索範囲に該当するM値が妥当であると判断して、ステップS208で求まったPピクチャで決定したM値を最適M値として決定する。他方、上記の割合が閾値Fより小さいということは、その探索範囲にはBピクチャの前方向の動きベクトルの数が少なく、どの探索範囲にも動きベクトルが適当に散らばって存在していることを意味するので、ステップS208で求まったPピクチャで決定したM値は最適ではないと判断されるため、現在のBピクチャで算出されたM値、例えばPピクチャで決定したM値よりも所定値小さなM値を最適M値として決定するのである。   That is, if the above ratio is equal to or greater than the threshold value F, it means that there are a large number of forward motion vectors of B pictures in the search range, and therefore the M value corresponding to the search range is appropriate. Therefore, the M value determined in the P picture obtained in step S208 is determined as the optimum M value. On the other hand, the fact that the above ratio is smaller than the threshold value F means that the number of motion vectors in the forward direction of the B picture is small in the search range, and the motion vectors are scattered appropriately in any search range. This means that the M value determined in the P picture obtained in step S208 is determined to be not optimal, and thus is smaller than the M value calculated in the current B picture, for example, the M value determined in the P picture by a predetermined value. The M value is determined as the optimum M value.

最後に、動きベクトル情報検出部114は、ステップS214で決定した最適M値を、外部の最適M値決定部116へ出力する(ステップS209)。このように、本実施の形態によれば、Bピクチャの動きベクトル情報を用いて最適M値を補正することによって、Pピクチャのみで次のM値を決定する場合と比較して、精度良く最適M値を決定することができる。   Finally, the motion vector information detection unit 114 outputs the optimal M value determined in step S214 to the external optimal M value determination unit 116 (step S209). As described above, according to the present embodiment, the optimum M value is corrected using the motion vector information of the B picture, so that the optimum M value can be optimized with higher accuracy than in the case where the next M value is determined only by the P picture. The M value can be determined.

次に、動きベクトル情報検出部114における各M値毎の探索範囲と動きベクトルの求め方の一例について図3と共に説明する。動きベクトル情報検出部114は、M=2の探索範囲を基準として、図3に示すような各M値(M=2,3,4)に対応した探索範囲を求めている。仮に、M=2のときの探索範囲を図3に301で示す一辺Rの正方形とすると、M=3の場合の探索範囲は同図に302で示す一辺R/2の正方形、M=4の場合の探索範囲は同図に303で示す一辺R×2/3の正方形と求められる。   Next, an example of how to obtain the search range and motion vector for each M value in the motion vector information detection unit 114 will be described with reference to FIG. The motion vector information detection unit 114 obtains a search range corresponding to each M value (M = 2, 3, 4) as shown in FIG. 3 with reference to the search range of M = 2. If the search range when M = 2 is a square of one side R indicated by 301 in FIG. 3, the search range when M = 3 is a square of one side R / 2 indicated by 302 in FIG. The search range in this case is obtained as a square of one side R × 2/3 indicated by 303 in FIG.

動きベクトル情報検出部114は、前記各M値に対して求めた各探索範囲内に発生している、現在符号化したピクチャ1枚当りの動きベクトルの数をカウントし、最も動きベクトルの数の多い探索範囲に対応しているM値を次に符号化するPピクチャの間隔と決定する。例えば、動きベクトルが全部で100個あったとし、M=1の探索範囲では動きベクトルが10個、M=2の探索範囲では動きベクトルが10個、M=3の探索範囲では動きベクトルが60個、M=4の探索範囲では動きベクトルが20個あったときには、M=3の探索範囲が適当と判断され、M=3が最適M値とされる。   The motion vector information detection unit 114 counts the number of motion vectors per currently encoded picture generated within each search range obtained for each M value, and determines the most motion vector number. The M value corresponding to a large search range is determined as the interval between P pictures to be encoded next. For example, assuming that there are 100 motion vectors in total, there are 10 motion vectors in the search range of M = 1, 10 motion vectors in the search range of M = 2, and 60 motion vectors in the search range of M = 3. When there are 20 motion vectors in the search range of M = 4, it is determined that the search range of M = 3 is appropriate, and M = 3 is set as the optimum M value.

ただし、現在のM値と最適M値が等しい場合は、現在符号化したピクチャの予測誤差の大きさを用いて、ある一定値以上である場合には、現在のM値を小さくし、ある一定値より小さい場合には、現在のM値を最適M値とする。   However, when the current M value and the optimum M value are equal, the current M value is reduced by using the magnitude of the prediction error of the current encoded picture, and when it is equal to or greater than a certain value, If it is smaller than the value, the current M value is set as the optimum M value.

次に、図1の最適M値決定部116の動作について、図4のフローチャートと共に詳細に説明する。図4のフローチャートはピクチャ毎に起動される。最適M値決定部116は、図1の発生符号量カウント部115から供給されるピクチャ1枚当りの動きベクトルの発生符号量の占有率(割合)と、動きベクトル情報検出部114で保持している現在のM値分の発生符合量における動きベクトル発生符号量の占有率と探索範囲別の動きベクトルの発生個数のデータが入力される(ステップS401)。   Next, the operation of the optimum M value determination unit 116 of FIG. 1 will be described in detail with reference to the flowchart of FIG. The flowchart of FIG. 4 is activated for each picture. The optimum M value determination unit 116 holds the occupation rate (ratio) of the generated code amount of the motion vector per picture supplied from the generated code amount count unit 115 of FIG. Data on the occupancy rate of the motion vector generated code amount in the generated code amount for the current M value and the number of generated motion vectors for each search range are input (step S401).

続いて、最適M値決定部116は、前記ステップS401で入力された動きベクトル発生符号量の占有率を使用してM値の増減を判定し、M値を小さくするか否か判定する(ステップS402)。すなわち、ステップS402では、動きベクトルの発生符号量の占有率が、ピクチャ1枚当りの符号量と比較して、ある定められた閾値を越えている場合、現在のM値(Pピクチャ間隔)では、動きベクトルに符号量を与えて、動きベクトル以外に与える符号量が小さくなってしまう可能性があり、画質改善にならないと考えられるので、ある閾値を越えた場合はM値を小さくすると判定する。   Subsequently, the optimal M value determination unit 116 determines increase / decrease in the M value using the occupation rate of the motion vector generation code amount input in Step S401, and determines whether or not to decrease the M value (Step S401). S402). That is, in step S402, when the occupation rate of the generated code amount of the motion vector exceeds a predetermined threshold value compared with the code amount per picture, the current M value (P picture interval) Since the code amount given to the motion vector may be small and the code amount given to other than the motion vector may be reduced, it is considered that the image quality does not improve. Therefore, if a certain threshold value is exceeded, the M value is determined to be small. .

M値を小さくすると判定した場合、現在のM値より小さくする(ステップS403)。ここでは、M=1〜4としているので、上記のステップS403では、M値を現在の値よりも1又は2小さくする。一方、ステップS402でM値を小さくしないと判定した場合は、ステップS401において入力された探索範囲別の動きベクトルの発生個数を使用してM値の増減を判断して最適M値を決定する(ステップS404)。   If it is determined that the M value is to be decreased, it is set to be smaller than the current M value (step S403). Here, since M = 1 to 4, in step S403, the M value is made 1 or 2 smaller than the current value. On the other hand, if it is determined in step S402 that the M value is not decreased, the optimum M value is determined by determining the increase or decrease of the M value using the number of motion vectors generated for each search range input in step S401 ( Step S404).

ステップS403又はステップS404の処理に続いて、最適M値決定部116は、ステップS403又はS404で決定された最適M値をM値制御部117に出力する(ステップS405)。前記ステップS403及びステップS404の方法を用いることにより、求めるM値の精度が向上し、結果として符号化効率の向上と画質の向上が期待できる。   Subsequent to the processing in step S403 or step S404, the optimum M value determination unit 116 outputs the optimum M value determined in step S403 or S404 to the M value control unit 117 (step S405). By using the methods of steps S403 and S404, the accuracy of the obtained M value is improved, and as a result, improvement in encoding efficiency and improvement in image quality can be expected.

次に、最適M値決定部116によるピクチャ1枚あたりの発生符号量に占める動きベクトルの占有率からM値の増減を決定する動作について図5と共に説明する。図5において、符号化したピクチャ1枚あたりの発生符号量に占める動きベクトルの発生符号量の占有率(割合)が所定の閾値Aより小さい場合、ピクチャ1枚あたりの発生符号量に占める動きベクトルの発生符号量が小さいことを示すので、M値は大きくすることができる。   Next, an operation of determining the increase / decrease in the M value from the occupation rate of the motion vector in the generated code amount per picture by the optimum M value determination unit 116 will be described with reference to FIG. In FIG. 5, when the occupation rate (ratio) of the generated code amount in the generated code amount per encoded picture is smaller than the predetermined threshold A, the motion vector in the generated code amount per picture Since the generated code amount is small, the M value can be increased.

これに対し、占有率が所定の閾値A以上である場合、ピクチャ1枚あたりの発生符号量に占める動きベクトルの発生符号量の割合が大きく、動きベクトル以外に割り当てる符号量が足りなくなる可能性があるため、M値を小さくし、動きベクトルの発生符号量を減らし、動きベクトル以外に符号量を割り当てる。   On the other hand, when the occupation rate is equal to or greater than the predetermined threshold A, the ratio of the generated code amount of the motion vector to the generated code amount per picture is large, and there is a possibility that the code amount allocated to other than the motion vector is insufficient. Therefore, the M value is reduced, the generated code amount of the motion vector is reduced, and the code amount is assigned to other than the motion vector.

このように、ピクチャ1枚あたりの発生符号量に占める動きベクトルの発生符号量の占有率(割合)を考慮することによって、低ビットレートにおいても、M値を適時、最適に変更し、符号化効率の向上と画質の改善ができる。   Thus, by considering the occupation rate (ratio) of the generated code amount of the motion vector in the generated code amount per picture, the M value is changed optimally in a timely manner even at a low bit rate. Improve efficiency and improve image quality.

従来は、画像を数枚入力し、まず、動きベクトルを求め、それから最適M値を決定し、決定されたM値で符号化するため、2回動きベクトルを求める可能性があり、演算量が大きくなる。これに対し、本発明では、動画像の相関性を利用して、1つ前のM値の画像情報から次のM値を決定するため、動きベクトルを求める回数は必ず1回であり、演算量の減少ができるので、リアルタイム処理が必要とされている放送機器などに有効であると考えられる。また、低ビットレートにおいても、高画質な最適M値を求めることが可能であるため、モバイル機器、録画機器(長時間モード)など低レート用の機器にも有効であると考えられる。   Conventionally, since several images are input, first, a motion vector is obtained, then an optimum M value is determined, and encoding is performed with the determined M value. growing. On the other hand, in the present invention, since the next M value is determined from the image information of the previous M value using the correlation of moving images, the number of times of obtaining the motion vector is always one, Since the amount can be reduced, it is considered to be effective for broadcasting equipment that requires real-time processing. In addition, since it is possible to obtain an optimum M value with high image quality even at a low bit rate, it is considered to be effective for low rate devices such as mobile devices and recording devices (long-time mode).

なお、本発明は、上記の実施の形態の機能をコンピュータに実現させるプログラムも包含するものである。このプログラムは、記録媒体から読み取られてコンピュータに取り込まれてもよいし、通信ネットワークを介して伝送されてコンピュータに取り込まれてもよい。また、本発明は画像間予測符号化方式による動画像符号化装置に広く適用できるものであり、フィールド間の画像間予測符号化方式にも適用できる。   The present invention also includes a program that causes a computer to realize the functions of the above-described embodiments. This program may be read from a recording medium and loaded into a computer, or may be transmitted via a communication network and loaded into a computer. In addition, the present invention can be widely applied to a moving picture encoding apparatus using an inter-picture prediction encoding scheme, and can also be applied to an inter-picture prediction encoding scheme between fields.

本発明の一実施の形態のブロック図である。It is a block diagram of one embodiment of the present invention. 図1中の動きベクトル情報検出部の動作説明用フローチャートである。2 is a flowchart for explaining the operation of a motion vector information detection unit in FIG. 1. 図1中の動きベクトル情報検出部における各M値毎の探索範囲と動きベクトルの求め方の一例の説明図である。It is explanatory drawing of an example of how to obtain | require the search range and motion vector for each M value in the motion vector information detection part in FIG. 図1中の最適M値決定部の動作説明用フローチャートである。2 is a flowchart for explaining an operation of an optimum M value determination unit in FIG. 1. 動きベクトルの発生符号量の占有率とM値との関係図である。FIG. 10 is a relationship diagram between an occupation rate of a generated code amount of a motion vector and an M value. 従来装置による動きベクトルの探索範囲の一例の説明図である。It is explanatory drawing of an example of the search range of the motion vector by a conventional apparatus.

符号の説明Explanation of symbols

101 画像入力部
102 画像メモリ部
103 減算器
104 DCT部
105 量子化部
106 可変長符号化(VLC)部
108 符号量制御部
109 逆量子化部
110 逆DCT部
111 加算器
112 復号画像メモリ部
113 動き補償予測部
114 動きベクトル情報検出部
115 発生符号量カウント部
116 最適M値決定部
117 M値制御部
DESCRIPTION OF SYMBOLS 101 Image input part 102 Image memory part 103 Subtractor 104 DCT part 105 Quantization part 106 Variable length coding (VLC) part 108 Code amount control part 109 Inverse quantization part 110 Inverse DCT part 111 Adder 112 Decoded image memory part 113 Motion compensation prediction unit 114 Motion vector information detection unit 115 Generated code amount count unit 116 Optimum M value determination unit 117 M value control unit

Claims (2)

画像内符号化、前方向画像間予測符号化及び両方向画像間予測符号化の3種類の符号化手法で動画像信号を符号化して得たIピクチャ、Pピクチャ及びBピクチャを組み合わせた符号化信号、又は前記画像内符号化と前期前方向画像間予測符号化との2つの符号化手法で動画像信号を符号化して得たIピクチャとPピクチャとを組み合わせた符号化信号を出力する画像間予測符号化方式による動画像符号化装置であり、前記符号化信号中の隣接する前記Iピクチャと前記Pピクチャとの間の間隔、又は隣接する2つの前記Pピクチャの間隔を示すM値を可変して前記符号化を行う動画像符号化装置であって、
前記符号化信号を局部復号して得た参照用画像データと前記動画像信号とに基づき、動き補償を行って動きベクトルを求める動き補償予測手段と、
符号化した現ピクチャ1枚当りの全発生符号量に占める前記動き補償予測手段で求めた前記動きベクトルの発生符号量の割合を求める発生符号量カウント手段と、
前記動き補償予測手段から前記動きベクトルの大きさと、その動きベクトルの探索範囲と予測絶対値誤差とを入力として受け、現在符号化しているピクチャが前記Pピクチャであるときに、入力された現在のM値の前記動きベクトルの大きさと、その動きベクトルを求めた際に使用した探索範囲とを基準として予め定めた互いに異なる複数の各M値毎に、探索範囲とその探索範囲内に存在する動きベクトルの発生個数を求め、動きベクトルの発生個数の最も多い探索範囲に対応するM値を、最適M値として選択する動きベクトル情報検出手段と、
前記発生符号量カウント手段により求められた前記割合と所定の閾値を比較し、前記割合が前記閾値を越えているときには、前記動きベクトル情報検出手段により選択されたM値を更に小さくしたM値を次に符号化するときの最終的な最適M値として決定し、前記割合が前記閾値以下のときには、前記動きベクトル情報検出手段により選択されたM値を次に符号化するときの最終的な最適M値として決定する最適M値決定手段と
を有し、前記最終的な最適M値に基づき、次に符号化するピクチャを指定して符号化することを特徴とする動画像符号化装置。
A coded signal obtained by combining an I picture, a P picture, and a B picture obtained by coding a moving picture signal by three kinds of coding methods of intra-picture coding, forward inter-picture predictive coding, and bi-directional inter-picture predictive coding. Or between images that output an encoded signal that is a combination of an I picture and a P picture obtained by encoding a moving image signal using the two encoding methods of the intra-picture encoding and the forward inter-picture predictive encoding. A video encoding apparatus using a predictive encoding method, wherein an M value indicating an interval between adjacent I and P pictures in the encoded signal or an interval between two adjacent P pictures is variable. A video encoding device that performs the encoding,
Motion-compensated prediction means for obtaining a motion vector by performing motion compensation based on the reference image data obtained by locally decoding the encoded signal and the moving image signal;
Generated code amount counting means for determining the ratio of the generated code amount of the motion vector determined by the motion compensation prediction means in the total generated code amount per encoded current picture;
The motion compensation prediction means receives the magnitude of the motion vector, the search range of the motion vector, and the predicted absolute value error as inputs, and when the currently encoded picture is the P picture, The search range and the motion existing in the search range for each of a plurality of different M values determined in advance on the basis of the magnitude of the motion vector of the M value and the search range used when the motion vector was obtained. Motion vector information detection means for obtaining the number of generated vectors and selecting an M value corresponding to a search range having the largest number of generated motion vectors as an optimum M value;
The ratio obtained by the generated code amount counting means is compared with a predetermined threshold value. When the ratio exceeds the threshold value, the M value selected by the motion vector information detecting means is further reduced. Determined as the final optimum M value for the next encoding, and when the ratio is equal to or less than the threshold value, the final optimum M value selected by the motion vector information detecting means is encoded next. A moving picture coding apparatus comprising: an optimum M value deciding unit that decides as an M value; and coding based on the final optimum M value by designating a picture to be coded next.
前記動きベクトル情報検出手段は、現在符号化しているピクチャが前記Bピクチャであるときは、そのBピクチャを符号化する際に求められた前方向の動きベクトルが、直前に前記Pピクチャを符号化する際に選択した前記最適M値で定められた前記探索範囲内に所定数以上存在するか否か判定し、前記Bピクチャを符号化する際に求められた前方向の動きベクトルが前記所定数以上存在するときには、直前に前記Pピクチャを符号化する際に選択した前記最適M値をそのまま最適M値として選択し、前記所定数以上存在しないときには、前記最適M値に替えて前記Bピクチャで算出されたM値を次に符号化するときの最適M値として選択する手段を更に有することを特徴とする請求項1記載の動画像符号化装置。

When the currently encoded picture is the B picture, the motion vector information detecting means encodes the P picture immediately before the forward motion vector obtained when the B picture is encoded. It is determined whether or not there is a predetermined number or more within the search range defined by the optimum M value selected when performing the operation, and the forward motion vector obtained when encoding the B picture is the predetermined number When there are more than the above, the optimum M value selected when encoding the P picture immediately before is selected as the optimum M value as it is, and when there are not more than the predetermined number, the B picture is replaced with the optimum M value. 2. The moving picture encoding apparatus according to claim 1, further comprising means for selecting the calculated M value as an optimum M value for the next encoding.

JP2004043964A 2004-02-20 2004-02-20 Moving image encoder Pending JP2005236710A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004043964A JP2005236710A (en) 2004-02-20 2004-02-20 Moving image encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004043964A JP2005236710A (en) 2004-02-20 2004-02-20 Moving image encoder

Publications (1)

Publication Number Publication Date
JP2005236710A true JP2005236710A (en) 2005-09-02

Family

ID=35019206

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004043964A Pending JP2005236710A (en) 2004-02-20 2004-02-20 Moving image encoder

Country Status (1)

Country Link
JP (1) JP2005236710A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015530035A (en) * 2012-08-21 2015-10-08 騰訊科技(深▲せん▼)有限公司Tencent Technology(Shenzhen) Company Limited Video encoding method and video encoding apparatus using this method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015530035A (en) * 2012-08-21 2015-10-08 騰訊科技(深▲せん▼)有限公司Tencent Technology(Shenzhen) Company Limited Video encoding method and video encoding apparatus using this method

Similar Documents

Publication Publication Date Title
JP4901772B2 (en) Moving picture coding method and moving picture coding apparatus
US7050499B2 (en) Video encoding apparatus and method and video encoding mode converting apparatus and method
JP4764136B2 (en) Moving picture coding apparatus and fade scene detection apparatus
US20100246684A1 (en) Video encoder and its decoder
JP2008227670A (en) Image coding device
JP2008067353A (en) Motion vector detection apparatus, and motion vector detection method
JP5649296B2 (en) Image encoding device
JP2008153907A (en) Image encoding apparatus, information terminal including the same, and image encoding method
JP4257789B2 (en) Video encoding device
JP4130617B2 (en) Moving picture coding method and moving picture coding apparatus
JP2010258576A (en) Scene change detector, and video recorder
JP2009049969A (en) Device and method of coding moving image and device and method of decoding moving image
JP2008252225A (en) Motion picture encoding device and method
JP4586340B2 (en) Encoding apparatus, encoding method, and program
JP4073541B2 (en) Video re-encoding device
JP5171658B2 (en) Image encoding device
JP2005236710A (en) Moving image encoder
JP2005303555A (en) Moving image encoding apparatus and its method
JP4871848B2 (en) Video re-encoding device
JP5171675B2 (en) Image processing apparatus and imaging apparatus equipped with the same
JP2008182408A (en) Dynamic image encoder and dynamic image encoding method
JP4561701B2 (en) Video encoding device
JP2008153802A (en) Moving picture encoding device and moving picture encoding program
JP2009118097A (en) Image encoder, its control method, and computer program
JP2007020216A (en) Encoding apparatus, encoding method, filtering apparatus and filtering method