JP2008252225A - Motion picture encoding device and method - Google Patents

Motion picture encoding device and method Download PDF

Info

Publication number
JP2008252225A
JP2008252225A JP2007087770A JP2007087770A JP2008252225A JP 2008252225 A JP2008252225 A JP 2008252225A JP 2007087770 A JP2007087770 A JP 2007087770A JP 2007087770 A JP2007087770 A JP 2007087770A JP 2008252225 A JP2008252225 A JP 2008252225A
Authority
JP
Japan
Prior art keywords
picture
code amount
scene change
allocation code
ratio
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
JP2007087770A
Other languages
Japanese (ja)
Inventor
Yasuo Shirosaki
康夫 城▲崎▼
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.)
Pioneer Corp
Original Assignee
Pioneer Electronic Corp
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 Pioneer Electronic Corp filed Critical Pioneer Electronic Corp
Priority to JP2007087770A priority Critical patent/JP2008252225A/en
Publication of JP2008252225A publication Critical patent/JP2008252225A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a motion picture encoding device and a method that can perform scene change detection with a small computational quantity and suitably encode image data without specially using a storage device to store pixel values of an image. <P>SOLUTION: The ratio between the generated code amount of encoded data generated by encoding input image data and the area allocation code amount of each area is calculated to judge a picture of scene change according to the ratio, and when a picture of scene change is judged, a calculated picture allocation code amount is adjusted to determine quantization parameters for each microblock according to the adjusted picture allocation code amount. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、動画像の画像データを符号化する動画像符号化装置及び方法に関する。   The present invention relates to a moving image encoding apparatus and method for encoding image data of a moving image.

動画像の画像データをMPEG−2やH.264等の符号方式で符号化する動画像符号化装置においては、ピクチャ毎に画像データの符号化後の生成符号量及び量子化スケール(量子化係数)に応じて符号化の複雑度(難易度)を算出し、更に、その複雑度に応じて次のピクチャの符号化の割当符号量を定めることが行われている。   The image data of the moving image is converted to MPEG-2 or H.264. In a moving picture coding apparatus that performs coding using a coding scheme such as H.264, the coding complexity (difficulty level) depends on a generated code amount after coding of image data and a quantization scale (quantization coefficient) for each picture. ), And an assigned code amount for encoding the next picture is determined according to the complexity.

従来の動画像符号化装置においては、画像内容が大きく変化するシーンチェンジが発生した場合にはその前後のピクチャの複雑度が大きく変化する故、シーンチェンジ前の生成符号量及び量子化スケールを用いて算出された複雑度に応じて次のピクチャの符号化の割当符号量を定めることは適当でないため、複雑度を初期値にリセットしてリセット後の複雑度に応じて次のピクチャの符号化の割当符号量が定められている。   In a conventional moving image encoding device, when a scene change in which the image content changes greatly occurs, the complexity of pictures before and after the change changes greatly, so the generated code amount and the quantization scale before the scene change are used. Since it is not appropriate to determine the allocated code amount for encoding the next picture according to the complexity calculated in the above, the complexity is reset to the initial value and the next picture is encoded according to the complexity after reset. The assigned code amount is determined.

シーンチェンジを検出する従来方法としては、画面を複数の領域に分割して領域毎に前後の画像の画素値の差分値が第1閾値以上の大きい画像変化を検出し、更に、そのような画像変化の領域が1画面で第2閾値以上であることを検出したときシーンチェンジと判断する方法がある(特許文献1及び2参照)。
特開2002−185817号公報 特開2003−47004号公報
As a conventional method for detecting a scene change, a screen is divided into a plurality of areas, and a large image change in which the difference value of the pixel values of the preceding and succeeding images is greater than or equal to a first threshold value is detected for each area. There is a method of determining a scene change when it is detected that the area of change is equal to or greater than a second threshold on one screen (see Patent Documents 1 and 2).
JP 2002-185817 A JP 2003-47004 A

しかしながら、かかる従来のシーンチェンジ検出方法を用いた動画像符号化装置においては、シーンチェンジの検出のために画像の画素値を記憶する記憶装置が必要となる。また、画素毎に差分値を算出して閾値との大小比較をするため演算量が多くなるという問題もあった。   However, in a moving image encoding apparatus using such a conventional scene change detection method, a storage device for storing pixel values of an image is necessary for detecting a scene change. There is also a problem that the amount of calculation increases because a difference value is calculated for each pixel and compared with a threshold value.

そこで、本発明が解決しようとする課題には、上記の欠点が一例として挙げられ、画像の画素値を記憶するための記憶装置を特に用いることなく少ない演算量でシーンチェンジ検出を行いかつ画像データを適切に符号化することができる動画像符号化装置及び方法を提供することが本発明の目的である。   Therefore, the problem to be solved by the present invention includes the above-mentioned drawbacks as an example, scene change detection can be performed with a small amount of computation and image data without using a storage device for storing image pixel values. It is an object of the present invention to provide a moving picture coding apparatus and method capable of appropriately coding a video.

請求項1に係る発明の動画像符号化装置は、入力画像データをマクロブロック毎に量子化パラメータに応じて符号化して符号化データを生成する符号化手段と、前記入力画像データについてピクチャ毎に割当符号量をピクチャ割当符号量として算出するピクチャ割当符号量算出手段と、前記ピクチャ割当符号量算出手段によって算出されたピクチャ割当符号量に応じて前記マクロブロック毎の量子化パラメータを決定する量子化パラメータ決定手段と、前記入力画像データについてピクチャ毎に複数の領域に分割してその複数の領域各々の割当符号量を領域割当符号量として算出する領域割当符号量算出手段と、前記符号化手段によって生成された符号化データの生成符号量と領域割当符号量との比率を領域毎に算出する比率算出手段と、前記比率算出手段によって算出された比率に応じてシーンチェンジのピクチャを判定するシーンチェンジ判定手段と、を備え、前記シーンチェンジ判定手段によってシーンチェンジのピクチャが判定されたときには前記ピクチャ割当符号量算出手段は算出した前記ピクチャ割当符号量を調整し、前記量子化パラメータ決定手段はその調整後の前記ピクチャ割当符号量に応じて前記マクロブロック毎の前記量子化パラメータを決定することを特徴としている。   The moving picture encoding apparatus according to the first aspect of the present invention includes an encoding unit that encodes input image data for each macroblock according to a quantization parameter to generate encoded data, and the input image data for each picture. Picture allocation code amount calculation means for calculating an allocation code amount as a picture allocation code amount, and quantization for determining a quantization parameter for each macroblock according to the picture allocation code amount calculated by the picture allocation code amount calculation means A parameter determination unit; a region allocation code amount calculation unit that divides the input image data into a plurality of regions for each picture and calculates an allocation code amount of each of the plurality of regions as a region allocation code amount; and the encoding unit. A ratio calculating means for calculating a ratio between a generated code amount of generated encoded data and a region allocation code amount for each region; Scene change determining means for determining a scene change picture according to the ratio calculated by the ratio calculating means, and when the scene change picture is determined by the scene change determining means, the picture allocation code amount calculating means is The calculated picture allocation code amount is adjusted, and the quantization parameter determining means determines the quantization parameter for each macroblock according to the adjusted picture allocation code amount.

請求項11に係る発明の動画像符号化方法は、入力画像データをマクロブロック毎に量子化パラメータに応じて符号化して符号化データを生成する符号化ステップと、前記入力画像データについてピクチャ毎に割当符号量をピクチャ割当符号量として算出するピクチャ割当符号量算出ステップと、前記ピクチャ割当符号量算出ステップにて算出されたピクチャ割当符号量に応じて前記マクロブロック毎の量子化パラメータを決定する量子化パラメータ決定ステップと、前記入力画像データについてピクチャ毎に複数の領域に分割してその複数の領域各々の割当符号量を領域割当符号量として算出する領域割当符号量算出ステップと、前記符号化ステップにて生成された符号化データの生成符号量と領域割当符号量との比率を領域毎に算出する比率算出ステップと、前記比率算出ステップにて算出された比率に応じてシーンチェンジのピクチャを判定するシーンチェンジ判定ステップと、を備え、前記シーンチェンジ判定ステップにてシーンチェンジのピクチャが判定されたときには前記ピクチャ割当符号量算出ステップでは算出した前記ピクチャ割当符号量を調整し、前記量子化パラメータ決定手段ではその調整後の前記ピクチャ割当符号量に応じて前記マクロブロック毎の前記量子化パラメータを決定することを特徴としている。   The moving image encoding method according to an eleventh aspect of the invention relates to an encoding step of generating input data by encoding input image data according to a quantization parameter for each macroblock, and for each picture of the input image data. A picture allocation code amount calculation step for calculating an allocation code amount as a picture allocation code amount, and a quantum for determining a quantization parameter for each macroblock according to the picture allocation code amount calculated in the picture allocation code amount calculation step A segmentation parameter determination step, a region allocation code amount calculation step of dividing the input image data into a plurality of regions for each picture and calculating an allocation code amount of each of the plurality of regions as a region allocation code amount, and the encoding step The ratio between the generated code amount of the encoded data generated in step 1 and the region allocation code amount is calculated for each region. A rate change step, and a scene change determination step for determining a scene change picture according to the ratio calculated in the ratio calculation step, and when the scene change picture is determined in the scene change determination step In the picture allocation code amount calculation step, the calculated picture allocation code amount is adjusted, and the quantization parameter determining means determines the quantization parameter for each macroblock according to the adjusted picture allocation code amount. It is characterized by that.

かかる請求項1に係る発明の動画像符号化装置及び請求項11に係る発明の動画像符号化方法によれば、入力画像データの符号化によって実際に生成された符号化データの生成符号量と領域毎の領域割当符号量との比率を算出し、その比率に応じてシーンチェンジのピクチャを判定することが行われる。シーンチェンジのピクチャが判定されたときには算出したピクチャ割当符号量が調整され、その調整後の前記ピクチャ割当符号量に応じてマクロブロック毎の量子化パラメータが決定される。よって、従来のように、シーンチェンジのピクチャ判定のためにピクチャの画素値を記憶するための記憶装置を用いる必要がなく、また、画素毎に差分値を算出して閾値との大小比較をする演算が必要がないので、比率計算を含む少ない演算量だけでシーンチェンジ検出を行いかつ画像データを適切に符号化することができる。   According to the moving image encoding apparatus of the invention according to claim 1 and the moving image encoding method of the invention according to claim 11, the generated code amount of the encoded data actually generated by encoding the input image data and A ratio with the area allocation code amount for each area is calculated, and a scene change picture is determined according to the ratio. When the scene change picture is determined, the calculated picture allocation code amount is adjusted, and the quantization parameter for each macroblock is determined according to the adjusted picture allocation code amount. Therefore, unlike the conventional case, it is not necessary to use a storage device for storing the pixel value of a picture for scene change picture determination, and the difference value is calculated for each pixel and compared with a threshold value. Since no calculation is required, scene change detection can be performed with a small amount of calculation including ratio calculation, and image data can be encoded appropriately.

以下、本発明の実施例を図面を参照しつつ詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

図1は、本発明による動画像符号化装置の構成を示している。この動画像符号化装置は、符号化部1とレート制御部2とから構成される。   FIG. 1 shows the configuration of a moving picture encoding apparatus according to the present invention. This moving image encoding apparatus includes an encoding unit 1 and a rate control unit 2.

符号化部1は、演算器11、DCT変換器12、量子化器13、可変長符号化器14、バッファ15、逆量子化器16、逆DCT変換器17、演算器18、フレームメモリ19、動き補償器20及び動きベクトル検出器21からなり、例えば、MPEG2規格準拠の符号化を行う。   The encoding unit 1 includes an arithmetic unit 11, a DCT converter 12, a quantizer 13, a variable length encoder 14, a buffer 15, an inverse quantizer 16, an inverse DCT converter 17, an arithmetic unit 18, a frame memory 19, It consists of a motion compensator 20 and a motion vector detector 21, and performs, for example, encoding conforming to the MPEG2 standard.

演算器11は、入力された画像データからマクロブロック毎に、動き補償器20により動き補償された予測画像データを減算し、その差分データをDCT変換器12に出力する。マクロブロックとは画像データを例えば、16画素×16画素に分割して得られた各ブロックである。なお、入力画像データのマクロブロック化の処理ブロックは図1には示していない。DCT変換器12は演算器11の出力データを2次元離散コサイン変換を行う。量子化器13は、DCT変換後の画像データを後述する量子化パラメータに対応した量子化係数を用いて量子化して量子化データを生成し、それを可変長符号化器14及び逆量子化器16に出力する。可変長符号化器14は、量子化器13から供給された量子化データと、動きベクトル検出器21から供給された動きベクトルを可変長符号化してそれを符号化データとしてバッファ15を介して出力する。   The computing unit 11 subtracts the predicted image data motion-compensated by the motion compensator 20 for each macroblock from the input image data, and outputs the difference data to the DCT converter 12. A macro block is each block obtained by dividing image data into, for example, 16 pixels × 16 pixels. Note that the processing blocks for converting the input image data into macroblocks are not shown in FIG. The DCT converter 12 performs two-dimensional discrete cosine transform on the output data of the calculator 11. The quantizer 13 quantizes the image data after DCT conversion using a quantization coefficient corresponding to a quantization parameter described later to generate quantized data, which is then converted into a variable length encoder 14 and an inverse quantizer. 16 is output. The variable length encoder 14 performs variable length encoding on the quantized data supplied from the quantizer 13 and the motion vector supplied from the motion vector detector 21, and outputs the encoded data as encoded data via the buffer 15. To do.

逆量子化器16は、量子化器13より入力された量子化データを逆量子化し、逆DCT変換器17に出力する。逆DCT変換器17は逆量子化後のデータを逆DCT変換して演算器18に供給する。演算器18は、動き補償器20により動き補償された予測画像データと逆DCT変換器17より入力された誤差分データとを加算して元の画像データに変換し、その変換した画像データをフレームメモリ19に供給して記憶させる。   The inverse quantizer 16 inversely quantizes the quantized data input from the quantizer 13 and outputs the quantized data to the inverse DCT converter 17. The inverse DCT converter 17 performs inverse DCT conversion on the dequantized data and supplies the result to the calculator 18. The arithmetic unit 18 adds the predicted image data motion-compensated by the motion compensator 20 and the error data input from the inverse DCT converter 17 to convert the converted image data into original image data. The data is supplied to the memory 19 and stored.

動きベクトル検出器21は、フレームメモリ19から読み出された画像データを参照して入力された画像データの動きベクトルを検出し、その動きベクトルを可変長符号化器14及び動き補償器20に出力する。動き補償器20は、フレームメモリ19から読み出された画像データを、動きベクトルに対応して動き補償して予測画像データを生成する。   The motion vector detector 21 detects the motion vector of the input image data with reference to the image data read from the frame memory 19, and outputs the motion vector to the variable length encoder 14 and the motion compensator 20. To do. The motion compensator 20 performs motion compensation on the image data read from the frame memory 19 in accordance with the motion vector to generate predicted image data.

レート制御部2は、図2に示すように、ピクチャ割当符号量算出部26、領域割当符号量算出部27、符号量比率算出部28、シーンチェンジ判定部29及び量子化パラメータ決定部30を備えている。   As shown in FIG. 2, the rate control unit 2 includes a picture allocation code amount calculation unit 26, a region allocation code amount calculation unit 27, a code amount ratio calculation unit 28, a scene change determination unit 29, and a quantization parameter determination unit 30. ing.

ピクチャ割当符号量算出部26は量子化器13の直前の量子化で用いられた量子化係数を含む量子化パラメータを入力し、1GOP毎にGOP符号量を割り当てると共に、入力画像データのピクチャ毎に目標ビットレートに基づいて割当符号量(ピクチャ割当符号量)を算出する。   The picture allocation code amount calculation unit 26 inputs a quantization parameter including a quantization coefficient used in the quantization immediately before the quantizer 13 and allocates a GOP code amount for each GOP, and for each picture of the input image data. An allocation code amount (picture allocation code amount) is calculated based on the target bit rate.

なお、GOPはGroup Of Pictureの略である。入力されたフレーム単位の画像データは符号化部1ではイントラピクチャ(Iピクチャ)、インターピクチャ(Pピクチャ)及びバイディレクショナルピクチャ(Bピクチャ)のいずれか1のピクチャとしての符号化され、Iピクチャの発生から次のIピクチャの発生前までが1GOPである。   GOP is an abbreviation for Group Of Picture. The input frame-unit image data is encoded as one of an intra picture (I picture), an inter picture (P picture), and a bi-directional picture (B picture) in the encoding unit 1, and the I picture 1 GOP is from the occurrence of the first I picture to the occurrence of the next I picture.

領域割当符号量算出部27はピクチャ割当符号量算出部26によって算出されたピクチャ割当符号量を入力し、1ピクチャを複数の領域に分割して領域毎に割当符号量(領域割当符号量)を算出する。複数の領域は、図3に示すように、1ピクチャを符号化の処理順に、マクロブロック数が一定となるように分割された領域である。この実施例では水平方向の複数の分割線によって等間隔に分割された領域となっている。図3の場合には16領域(area0〜area15)が形成されている。なお、分割された領域数はこれに限定されない。   The region allocation code amount calculation unit 27 receives the picture allocation code amount calculated by the picture allocation code amount calculation unit 26, divides one picture into a plurality of regions, and assigns an allocation code amount (region allocation code amount) for each region. calculate. As shown in FIG. 3, the plurality of areas are areas obtained by dividing one picture so that the number of macroblocks is constant in the encoding processing order. In this embodiment, the area is divided at equal intervals by a plurality of horizontal dividing lines. In the case of FIG. 3, 16 areas (area 0 to area 15) are formed. The number of divided areas is not limited to this.

符号量比率算出部28は領域割当符号量算出部27によって算出された領域割当符号量を入力し、更に、可変長符号化器14によって生成される符号化データの生成符号量を入力して領域毎の実際の生成符号量(領域生成符号量)を得て、領域割当符号量と領域生成符号量との比率を算出する。シーンチェンジ判定部29は符号量比率算出部28から比率を入力し、その比率に基づいてピクチャがシーンチェンジである否かを判定する。シーンチェンジ判定部29によるシーンチェンジの判定結果はピクチャ割当符号量算出部26に供給される。   The code amount ratio calculation unit 28 inputs the region allocation code amount calculated by the region allocation code amount calculation unit 27, and further inputs the generated code amount of the encoded data generated by the variable length encoder 14. An actual generated code amount (region generated code amount) is obtained for each, and a ratio between the region allocation code amount and the region generated code amount is calculated. The scene change determination unit 29 receives the ratio from the code amount ratio calculation unit 28 and determines whether the picture is a scene change based on the ratio. The scene change determination result by the scene change determination unit 29 is supplied to the picture allocation code amount calculation unit 26.

量子化パラメータ決定部30はピクチャ割当符号量算出部26によって算出されたピクチャ割当符号量に応じてマクロブロック毎の量子化パラメータを決定し、それを量子化器13に供給する。なお、ピクチャ割当符号量算出部26に入力される量子化パラメータは量子化パラメータ決定部30で決定するマクロブロックの量子化パラメータより前の同じピクチャタイプの量子化パラメータである。   The quantization parameter determination unit 30 determines a quantization parameter for each macroblock according to the picture allocation code amount calculated by the picture allocation code amount calculation unit 26 and supplies it to the quantizer 13. The quantization parameter input to the picture allocation code amount calculation unit 26 is a quantization parameter of the same picture type before the quantization parameter of the macroblock determined by the quantization parameter determination unit 30.

次に、かかる構成の動画像符号化装置のレート制御部2において行われるシーンチェンジ判定処理について説明する。   Next, a scene change determination process performed in the rate control unit 2 of the moving image encoding apparatus having the above configuration will be described.

ここでは、1ピクチャが図3に示したように領域area0〜area15に分割され、その領域area0〜area15各々の領域割当符号量が領域割当符号量算出部27によって算出されるとする。シーンチェンジ判定処理には第1処理と第2処理とがある。   Here, it is assumed that one picture is divided into areas area0 to area15 as shown in FIG. 3, and the area allocation code amount calculation unit 27 calculates the area allocation code amount of each of the areas area0 to area15. The scene change determination process includes a first process and a second process.

第1処理では図4に示すように、先ず、ステップS1で領域割当符号量算出部27によって1ピクチャの各領域area0〜area15の領域割当符号量が算出されると、変数N=0が設定され(ステップS2)、領域areaNについて符号量比率算出部28によって比率が生成符号量/領域割当符号量のように算出され(ステップS3)、その比率が閾値I1(第1閾値)より大であるか否かが判別される(ステップS4)。なお、領域割当符号量に基づいて符号化した結果が領域生成符号量となるため、ステップS3の比率算出時には領域割当符号量は領域生成符号量より少なくとも1領域分だけ時間的なずれがある。
比率>閾値I1ならば、領域数C1が1だけ増加される(ステップS5)。領域数C1は1ピクチャにおいて比率>閾値I1となった領域を計数する値である。比率≦閾値I1ならば、現在の領域数C1が維持される。このように領域数C1が処理された後、その領域数C1が閾値I2(第2閾値)より大であるか否かが判別される(ステップS6)。領域数C1>閾値I2となると、シーンチェンジと判定される(ステップS7)。領域数C1≦閾値I2であるならば、変数Nに1が加算され(ステップS8)、Nが15より大であるか否かが判別される(ステップS9)。N≦15であるならば、ステップS3に戻って上記の動作が繰り返される。ステップS4〜S7はシーンチェンジ判定部29の動作である。
In the first process, as shown in FIG. 4, first, when the area allocation code amount calculation unit 27 calculates the area allocation code amounts of the areas area0 to area15 of one picture in step S1, a variable N = 0 is set. (Step S2) Whether the ratio of the area areaN is calculated by the code amount ratio calculation unit 28 as the generated code amount / region allocation code amount (Step S3), and is the ratio larger than the threshold value I1 (first threshold value)? It is determined whether or not (step S4). Since the result of encoding based on the region allocation code amount is the region generation code amount, the region allocation code amount is temporally shifted from the region generation code amount by at least one region when calculating the ratio in step S3.
If the ratio> threshold value I1, the number of areas C1 is increased by 1 (step S5). The number of areas C1 is a value for counting areas where the ratio> threshold value I1 in one picture. If ratio ≦ threshold value I1, the current number of regions C1 is maintained. After the area number C1 is processed in this way, it is determined whether or not the area number C1 is larger than the threshold value I2 (second threshold value) (step S6). When the number of areas C1> threshold I2, it is determined that the scene has changed (step S7). If the number of regions C1 ≦ threshold I2, 1 is added to the variable N (step S8), and it is determined whether N is greater than 15 (step S9). If N ≦ 15, the process returns to step S3 and the above operation is repeated. Steps S4 to S7 are operations of the scene change determination unit 29.

第2処理では図5に示すように、先ず、ステップS11で領域割当符号量算出部27によって1ピクチャの各領域area0〜area15の領域割当符号量が算出されると、変数N=0が設定され(ステップS12)、領域areaNについて符号量比率算出部28によって比率が生成符号量/領域割当符号量のように算出され(ステップS13)、その比率が閾値D1(第3閾値)より小であるか否かが判別される(ステップS14)。比率<閾値D1ならば、領域数C2が1だけ増加される(ステップS15)。領域数C2は1ピクチャにおいて比率<閾値D1となった領域を計数する値である。比率≧閾値D1ならば、現在の領域数C2が維持される。このように領域数C2が処理された後、その領域数C2が閾値D2(第4閾値)より大であるか否かが判別される(ステップS16)。領域数C1>閾値D2となると、シーンチェンジの検出と判定される(ステップS17)。領域数C1≦閾値D2であるならば、変数Nに1が加算され(ステップS18)、Nが15より大であるか否かが判別される(ステップS19)。N≦15であるならば、ステップS13に戻って上記の動作が繰り返される。ステップS14〜S17はシーンチェンジ判定部29の動作である。   In the second process, as shown in FIG. 5, first, when the area allocation code amount calculation unit 27 calculates the area allocation code amount of each area area0 to area15 of one picture in step S11, a variable N = 0 is set. (Step S12) Whether the ratio for the area areaN is calculated by the code amount ratio calculation unit 28 as generated code amount / region assigned code amount (Step S13), and is the ratio smaller than the threshold value D1 (third threshold value)? It is determined whether or not (step S14). If the ratio <threshold value D1, the number of regions C2 is increased by 1 (step S15). The number of areas C2 is a value for counting the areas where the ratio <threshold value D1 in one picture. If the ratio ≧ the threshold value D1, the current area number C2 is maintained. After the area number C2 is processed in this way, it is determined whether or not the area number C2 is larger than the threshold value D2 (fourth threshold value) (step S16). When the number of areas C1> threshold value D2, it is determined that a scene change has been detected (step S17). If the number of regions C1 ≦ threshold D2, 1 is added to the variable N (step S18), and it is determined whether N is greater than 15 (step S19). If N ≦ 15, the process returns to step S13 and the above operation is repeated. Steps S14 to S17 are operations of the scene change determination unit 29.

本発明による動画像符号化装置において、上記のシーンチェンジ判定処理は、実際には符号化処理と組み合わされて実行される。その実行方法として、1ピクチャの符号化処理を終了する毎に実行する方法と、1ピクチャの符号化処理中に実行する方法とがある。   In the moving picture encoding apparatus according to the present invention, the scene change determination process is actually executed in combination with the encoding process. As an execution method thereof, there are a method that is executed every time the encoding process of one picture is completed, and a method that is executed during the encoding process of one picture.

1ピクチャの符号化処理を終了する毎の場合の動画像符号化装置における動作フローは図6に示す通りである。ここでは、1GOPがm個(例えば、10)のピクチャからなるとしている。   FIG. 6 shows an operation flow in the moving picture encoding apparatus every time one picture encoding process is completed. Here, one GOP is assumed to be composed of m (for example, 10) pictures.

図6の処理においては、1GOP毎に先ず、GOP符号量が割り当てられ(ステップS51)、変数kが0とされる(ステップS52)。k番目のピクチャについてのピクチャ割当符号量がピクチャ割当符号量算出部26において算出される(ステップS53)。そして、直前のピクチャ(k−1番目のピクチャ)でシーンチェンジが検出されたか否かが判別される(ステップS54)。シーンチェンジ判定部29によってシーンチェンジが検出されたならば、算出されたピクチャ割当符号量がピクチャ割当符号量算出部26において調整される(ステップS55)。量子化パラメータ決定部30は領域割当符号量算出部27はピクチャ割当符号量算出部26によって算出されたピクチャ割当符号量に応じて量子化パラメータを決定し、それを量子化器13に供給する。よって、k番目のピクチャについての符号化が符号化部1において実行され(ステップS56)、その符号化結果に応じて上記のシーンチェンジ判定処理が実行される(ステップS57)。ステップS57では全ての領域area0〜16各々についてシーンチェンジ判定処理が実行される。そして、変数kに1が加算され(ステップS58)、kがmより大であるか否かが判別される(ステップS59)。k≦mであるならば、ステップS53に戻って上記の動作が繰り返される。k>mであるならば、1GOPの処理が終了したので、次のGOPの処理が開始される。   In the process of FIG. 6, first, a GOP code amount is assigned for each GOP (step S51), and the variable k is set to 0 (step S52). The picture allocation code amount for the kth picture is calculated by the picture allocation code amount calculation unit 26 (step S53). Then, it is determined whether or not a scene change has been detected in the immediately preceding picture (k-1th picture) (step S54). If a scene change is detected by the scene change determination unit 29, the calculated picture allocation code amount calculation unit 26 adjusts the picture allocation code amount calculation unit 26 (step S55). The quantization parameter determination unit 30 determines the quantization parameter according to the picture allocation code amount calculated by the picture allocation code amount calculation unit 26 and supplies it to the quantizer 13. Therefore, encoding for the kth picture is performed in the encoding unit 1 (step S56), and the above-described scene change determination process is performed according to the encoding result (step S57). In step S57, scene change determination processing is executed for each of all areas area0-16. Then, 1 is added to the variable k (step S58), and it is determined whether k is larger than m (step S59). If k ≦ m, the process returns to step S53 and the above operation is repeated. If k> m, the processing of the next GOP is started because the processing of 1 GOP is completed.

1ピクチャの符号化処理中に実行する場合には、図7に示す如き動作フローとなる。図7においてステップS51〜S55については1ピクチャの符号化処理を終了する毎に実行する場合と同一である。ステップS54の判別でNoの場合又はステップS55の実行後、変数N=0が設定され(ステップS61)、領域areaNについての符号化が符号化部1において実行され(ステップS62)、領域areaNの符号化結果に応じて領域areaNについてのシーンチェンジ判定処理が実行される(ステップS63)。このシーンチェンジ判定処理は第1処理のステップS3〜S8及び第2処理のステップS13〜S18に相当する。ステップS63のシーンチェンジ判定処理結果がシーンチェンジ検出であったか否かが判別される(ステップS64)。シーンチェンジ検出であったならば、ピクチャ割当符号量がピクチャ割当符号量算出部26において調整される(ステップS65)。ステップS64においてシーンチェンジの検出がなかったと判別されたならば、変数Nに1が加算され(ステップS66)、Nが15より大であるか否かが判別される(ステップS67)。N≦15であるならば、ステップS62に戻ってそれ以降の動作が繰り返される。また、ステップS65でピクチャ割当符号量が調整された後においてもステップS66,S67が実行される。N>15ならは、ステップS58において変数kに1が加算され、ステップS59においてkがmより大であるか否かが判別される。k≦mであるならば、ステップS53に戻って上記の動作が繰り返される。k>mであるならば、1GOPの処理が終了したので、次のGOPの処理が開始される。   When it is executed during the encoding process of one picture, the operation flow is as shown in FIG. In FIG. 7, steps S51 to S55 are the same as those executed every time the encoding process for one picture is completed. If the determination in step S54 is No or after execution of step S55, the variable N = 0 is set (step S61), and the encoding for the area areaN is executed in the encoding unit 1 (step S62). A scene change determination process for the area areaN is executed in accordance with the conversion result (step S63). This scene change determination process corresponds to steps S3 to S8 of the first process and steps S13 to S18 of the second process. It is determined whether or not the scene change determination processing result in step S63 is a scene change detection (step S64). If the scene change is detected, the picture allocation code amount is adjusted by the picture allocation code amount calculation unit 26 (step S65). If it is determined in step S64 that no scene change has been detected, 1 is added to the variable N (step S66), and it is determined whether N is greater than 15 (step S67). If N ≦ 15, the process returns to step S62 and the subsequent operations are repeated. Steps S66 and S67 are executed even after the picture allocation code amount is adjusted in step S65. If N> 15, 1 is added to the variable k in step S58, and it is determined in step S59 whether k is greater than m. If k ≦ m, the process returns to step S53 and the above operation is repeated. If k> m, the processing of the next GOP is started because the processing of 1 GOP is completed.

次に、ステップS65において実行されるピクチャ割当符号量の調整について説明する。   Next, adjustment of the picture allocation code amount executed in step S65 will be described.

ピクチャの上部で割当符号量<生成符号量 (生成符号量が大きい)となると、発生符号量をピクチャ割当符号量内に抑えるために量子化パラメータが大きくなり、図8に示すようにピクチャの下部では割当符号量>生成符号量となる。この場合、シーンチェンジ判定を行わず、直前の量子化パラメータから現在の量子化パラメータを算出すると、ピクチャの下部において劣化が目立つことになる。   When the allocated code amount is smaller than the generated code amount (the generated code amount is large) in the upper part of the picture, the quantization parameter increases in order to keep the generated code amount within the picture allocated code amount, and as shown in FIG. Then, the allocated code amount> the generated code amount. In this case, if the current quantization parameter is calculated from the immediately preceding quantization parameter without performing the scene change determination, the deterioration is conspicuous in the lower part of the picture.

そこで、第1処理では、生成符号量/割当符号量>閾値I1となる領域の数が閾値I2より多い場合には、シーンチェンジと判定される。この場合にはピクチャ割当符号量算出部26はステップS6のシーンチェンジの判定に応じてピクチャ割当符号量はその増加を抑えるように調整される。これにより、急激な画質の変化を防止することができる。   Therefore, in the first process, when the number of regions where the generated code amount / assigned code amount> threshold value I1 is larger than the threshold value I2, it is determined that the scene change has occurred. In this case, the picture allocation code amount calculation unit 26 adjusts the picture allocation code amount to suppress the increase in accordance with the scene change determination in step S6. Thereby, a sudden change in image quality can be prevented.

また、ピクチャの上部で割当符号量<生成符号量となると、量子化パラメータが大きくなり、これにより、ピクチャの下部になるほど図9に示すように生成符号量が抑えられる。比率>閾値I1となった場合には閾値I1をInewとして式(1)に示すように算出することが行われる。 Further, when the allocated code amount is smaller than the generated code amount at the upper part of the picture, the quantization parameter increases, and as a result, the generated code amount is suppressed toward the lower part of the picture as shown in FIG. When the ratio> threshold value I1, the threshold value I1 is calculated as shown in Expression (1) with Inew as Inew.

例えば、閾値I1=2.0、生成符号量/割当符号量=2.0の場合には、式(1)からI1=1.0+(2.0−1.0)/2.0=1.5となる。閾値I1=2.0、生成符号量/割当符号量=1.5の場合には、式(1)からI1=1.0+(2.0−1.0)/1.5=1.67となる。このように、比率が大きいときほど、閾値I1を小さく設定することができる。よって、シーンチェンジと判定され易くなり画質劣化を抑制することができる。   For example, when the threshold value I1 = 2.0 and the generated code amount / assigned code amount = 2.0, I1 = 1.0 + (2.0-1.0) /2.0=1 from the equation (1). .5. In the case of the threshold value I1 = 2.0 and the generated code amount / assigned code amount = 1.5, from the equation (1), I1 = 1.0 + (2.0-1.0) /1.5=1.67. It becomes. Thus, the threshold I1 can be set smaller as the ratio increases. Therefore, it is easy to determine that a scene change has occurred, and image quality deterioration can be suppressed.

一方、ピクチャの上部で割当符号量>生成符号量 (生成符号量が小さく)となると、発生符号量に余裕があるために量子化パラメータが小さくなり、図10に示すようにピクチャの下部では割当符号量<生成符号量となる。この場合には、更に少ない符号量でも同程度の画質を得られる状態であっても、量子化パラメータが小さいために多くの符号量を発生することになる。そこで、第2処理では、生成符号量/割当符号量<閾値D1となる領域が閾値D2より多い場合には、シーンチェンジと判定し、量子化パラメータが小さくなり過ぎないようにピクチャ割当符号量を調整することで、より複雑なピクチャへ多くの符号量を割り当てられるようにする。   On the other hand, if the allocated code amount> the generated code amount (the generated code amount is small) in the upper part of the picture, the quantization parameter becomes small because there is a margin in the generated code amount. As shown in FIG. Code amount <generated code amount. In this case, a large amount of code is generated because the quantization parameter is small even if the image quality can be obtained with a smaller amount of code. Therefore, in the second process, when the region where the generated code amount / assigned code amount <threshold D1 is larger than the threshold D2, it is determined as a scene change, and the picture assigned code amount is set so that the quantization parameter does not become too small. By adjusting, a large amount of code can be assigned to a more complicated picture.

また、ピクチャの上部で割当符号量>生成符号量となると、量子化パラメータが小さくなり、これにより、ピクチャの下部になるほど図11に示すように、生成符号量が増えるように制御される。比率<閾値D1となった場合に閾値D1をDnewとして式(2)に示すように算出することが行われる。 Also, when the allocated code amount> the generated code amount in the upper part of the picture, the quantization parameter becomes smaller. As a result, the generated code amount is controlled to increase toward the lower part of the picture as shown in FIG. When the ratio <threshold value D1, the threshold value D1 is calculated as Dnew as shown in Expression (2).

例えば、閾値D1=0.5、生成符号量/割当符号量=0.5の場合には、式(2)からD1=1.0−(1.0−0.5)×0.5=0.75となる。閾値D1=0.5、生成符号量/割当符号量=0.1の場合には、式(2)からD1=1.0−(1.0−0.5)×0.1=0.95となる。このように、比率が小さいときほど、閾値D1を大きく設定することができる。よって、シーンチェンジと判定され易くなり画質劣化を抑制することができる。   For example, when the threshold value D1 = 0.5 and the generated code amount / assigned code amount = 0.5, D1 = 1.0− (1.0−0.5) × 0.5 = 0.75. When the threshold value D1 = 0.5 and the generated code amount / assigned code amount = 0.1, D1 = 1.0− (1.0−0.5) × 0.1 = 0. 95. Thus, the threshold D1 can be set larger as the ratio is smaller. Therefore, it is easy to determine that a scene change has occurred, and image quality deterioration can be suppressed.

また、第1処理では、図12に示すように、ステップS6の判別結果が領域数C1≦閾値I2ならば、領域数C1が閾値I2/2にほぼ等しいことが判別されたときに(ステップS21のYes)、ステップS22で閾値I1を上記のように変更するようにしても良い。同様に、第2処理では、図13に示すように、ステップS16の判別結果が領域数C2≦閾値D2ならば、領域数C2が閾値D2/2にほぼ等しいことが判別されたときに(ステップS23のYes)、ステップS24で閾値D1を上記のように変更するようにしても良い。   Further, in the first process, as shown in FIG. 12, when the determination result in step S6 is the number of regions C1 ≦ threshold I2, it is determined that the number of regions C1 is substantially equal to the threshold I2 / 2 (step S21). Yes), the threshold value I1 may be changed as described above in step S22. Similarly, in the second process, as shown in FIG. 13, if the determination result in step S16 is the number of areas C2 ≦ threshold D2, it is determined that the number of areas C2 is substantially equal to the threshold D2 / 2 (step In step S23, the threshold value D1 may be changed as described above.

更に、第1処理及び第2処理は図14及び図15に示すよう実行しても良い。図14の第1処理では、ステップS4の判別結果が比率>閾値I1ならば、領域数C1が1だけ増加され(ステップS5)、比率≦閾値I1ならば、領域数C1が0に等しくされる(ステップS5a)。ステップS5又はS5aの実行後、その領域数C1が閾値I3(第6閾値)より大であるか否かが判別される(ステップS6a)。領域数C1>閾値I3となると、シーンチェンジと判定される(ステップS7)。すなわち、比率>閾値I1が閾値I3を越える回数だけ連続して各領域で検出されたときにシーンチェンジと判定される。   Further, the first process and the second process may be executed as shown in FIGS. In the first process of FIG. 14, if the determination result in step S4 is ratio> threshold I1, the number of regions C1 is increased by 1 (step S5), and if ratio ≦ threshold I1, the number of regions C1 is made equal to zero. (Step S5a). After execution of step S5 or S5a, it is determined whether or not the number of areas C1 is larger than a threshold value I3 (sixth threshold value) (step S6a). When the number of areas C1> threshold I3, it is determined that the scene has changed (step S7). That is, a scene change is determined when the ratio> threshold value I1 is detected in each region continuously for the number of times that the threshold value I1 exceeds the threshold value I3.

図15の第2処理では、ステップS14の判別結果が比率<閾値D1ならば、領域数C2が1だけ増加され(ステップS15)、比率≧閾値D1ならば、領域数C2が0に等しくされる(ステップS15a)。ステップS15又はS15aの実行後、その領域数C2が閾値D3(第7閾値)より大であるか否かが判別される(ステップS16a)。領域数C2>閾値D3となると、シーンチェンジと判定される(ステップS17)。すなわち、比率<閾値D1が閾値D3を越える回数だけ連続して各領域で検出されたときにシーンチェンジと判定される。   In the second process of FIG. 15, if the determination result in step S14 is ratio <threshold D1, the number of areas C2 is increased by 1 (step S15), and if ratio ≧ threshold D1, the number of areas C2 is made equal to zero. (Step S15a). After execution of step S15 or S15a, it is determined whether or not the number of areas C2 is greater than a threshold D3 (seventh threshold) (step S16a). When the number of areas C2> threshold value D3, it is determined that the scene has changed (step S17). That is, a scene change is determined when the ratio <threshold value D1 is detected in each region continuously for the number of times that exceeds the threshold value D3.

また、図14の第1処理でも図16に示すように、領域数C1が閾値I2/2にほぼ等しいことが判別されたときに閾値I1を変更するようにしても良い。図15の第2処理でも図17に示すように、領域数C2が閾値D2/2にほぼ等しいことが判別されたときに閾値D1を変更するようにしても良い。   Also in the first process of FIG. 14, as shown in FIG. 16, the threshold value I1 may be changed when it is determined that the number of regions C1 is substantially equal to the threshold value I2 / 2. In the second process of FIG. 15, as shown in FIG. 17, the threshold value D1 may be changed when it is determined that the number of areas C2 is substantially equal to the threshold value D2 / 2.

なお、上記のシーンチェンジ判定処理を利用して映像のフェードと判定することができる。図18に示すように、シーンチェンジ判定処理においてシーンチェンジとして検出された領域を備えたピクチャが閾値I4(第5閾値)を越える回数(ピクチャ値C3)だけ連続したときにはフェードと判定するのである。例えば、映像が徐々に出現するフェードイン或いは徐々に消滅するフェードアウトのようなピクチャである。   Note that it is possible to determine a video fade using the scene change determination process described above. As shown in FIG. 18, when a picture having an area detected as a scene change in the scene change determination process continues for the number of times (picture value C3) exceeding a threshold I4 (fifth threshold), it is determined as a fade. For example, a picture such as a fade-in in which video gradually appears or a fade-out in which video gradually disappears.

また、1ピクチャを複数の領域に分割する方法については、例えば、図19に概略的に示すように複数の領域(実線で囲まれた領域)に分割しても良い。すなわち、1ピクチャを符号化の処理順に、各領域のマクロブロック数が一定となるように分割すれば良く、必ずしも図3に示したように各領域が同一幅の帯状になる必要はない。   As for a method of dividing one picture into a plurality of regions, for example, it may be divided into a plurality of regions (regions surrounded by solid lines) as schematically shown in FIG. In other words, one picture may be divided in the encoding processing order so that the number of macroblocks in each region is constant, and each region does not necessarily have to be a strip having the same width as shown in FIG.

以上のように、本発明によれば、比率計算を含む少ない演算量だけでシーンチェンジを検出することができ、更に、そのシーンチェンジの検出に応じて画像データを適切に符号化することができる。   As described above, according to the present invention, a scene change can be detected with only a small amount of calculation including a ratio calculation, and image data can be appropriately encoded in accordance with the detection of the scene change. .

本発明はDVD/HDDレコーダ等の画像の符号化機能を備えた製品に適用可能である。また、本発明はコンピュータが符号化プログラムを実行することより上記した図6及び図7にフローチャートとして示した如き符号化変換動作を行うようにしても良い。   The present invention is applicable to products having an image encoding function such as a DVD / HDD recorder. In the present invention, the encoding / conversion operation as shown in the flowcharts of FIGS. 6 and 7 may be performed by the computer executing the encoding program.

本発明による動画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the moving image encoder by this invention. 図1の装置中のレート制御部の構成を示すブロック図である。It is a block diagram which shows the structure of the rate control part in the apparatus of FIG. 複数の領域area0〜area15を示す図である。It is a figure which shows several area | regions area0-area15. シーンチェンジ判定処理の第1処理を示すフローチャートである。It is a flowchart which shows the 1st process of a scene change determination process. シーンチェンジ判定処理の第2処理を示すフローチャートである。It is a flowchart which shows the 2nd process of a scene change determination process. 1ピクチャ符号化処理終了後にシーンチェンジ判定処理を行う場合の動画像符号化装置の概略動作を示すフローチャートである。It is a flowchart which shows schematic operation | movement of the moving image encoder in the case of performing a scene change determination process after completion | finish of 1 picture encoding process. 1ピクチャ符号化処理中にシーンチェンジ判定処理を行う場合の動画像符号化装置の概略動作を示すフローチャートである。It is a flowchart which shows schematic operation | movement of the moving image encoder in the case of performing a scene change determination process during 1 picture encoding process. ピクチャの上部で生成符号量が多い場合のピクチャ割当符号量の変化を示す図である。It is a figure which shows the change of the picture allocation code amount when the amount of generated code is large in the upper part of a picture. ピクチャの上部で生成符号量が多い場合にピクチャ下部に向かって減少する生成符号量を示す図である。It is a figure which shows the production | generation code amount which decreases toward the lower part of a picture when the production | generation code amount is large in the upper part of a picture. ピクチャの上部で生成符号量が少ない場合のピクチャ割当符号量の変化を示す図である。It is a figure which shows the change of the picture allocation code amount in case the production | generation code amount is small in the upper part of a picture. ピクチャの上部で生成符号量が少ない場合にピクチャ下部に向かって増加する生成符号量を示す図である。It is a figure which shows the production | generation code amount which increases toward the lower part of a picture when the production | generation code amount is small in the upper part of a picture. シーンチェンジ判定処理の第1処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of the 1st process of a scene change determination process. シーンチェンジ判定処理の第2処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of the 2nd process of a scene change determination process. シーンチェンジ判定処理の第1処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of the 1st process of a scene change determination process. シーンチェンジ判定処理の第2処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of the 2nd process of a scene change determination process. シーンチェンジ判定処理の第1処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of the 1st process of a scene change determination process. シーンチェンジ判定処理の第2処理の他の例を示すフローチャートである。It is a flowchart which shows the other example of the 2nd process of a scene change determination process. フェード判定処理を示すフローチャートである。It is a flowchart which shows a fade determination process. 1ピクチャを分割して形成される複数の領域の他の例を示す図である。It is a figure which shows the other example of the several area | region formed by dividing | segmenting 1 picture.

符号の説明Explanation of symbols

1 符号化部
2 レート制御部
13 量子化器
14 可変長符号化器
26 ピクチャ割当符号量算出部
27 領域割当符号量算出部
28 符号量比率算出部
29 シーンチェンジ判定部
30 量子化パラメータ決定部
DESCRIPTION OF SYMBOLS 1 Encoding part 2 Rate control part 13 Quantizer 14 Variable length encoder 26 Picture allocation code amount calculation part 27 Area allocation code amount calculation part 28 Code amount ratio calculation part 29 Scene change determination part 30 Quantization parameter determination part

Claims (11)

入力画像データをマクロブロック毎に量子化パラメータに応じて符号化して符号化データを生成する符号化手段と、
前記入力画像データについてピクチャ毎に割当符号量をピクチャ割当符号量として算出するピクチャ割当符号量算出手段と、
前記ピクチャ割当符号量算出手段によって算出されたピクチャ割当符号量に応じて前記マクロブロック毎の量子化パラメータを決定する量子化パラメータ決定手段と、
前記入力画像データについてピクチャ毎に複数の領域に分割してその複数の領域各々の割当符号量を領域割当符号量として算出する領域割当符号量算出手段と、
前記符号化手段によって生成された符号化データの生成符号量と領域割当符号量との比率を領域毎に算出する比率算出手段と、
前記比率算出手段によって算出された比率に応じてシーンチェンジのピクチャを判定するシーンチェンジ判定手段と、を備え、
前記シーンチェンジ判定手段によってシーンチェンジのピクチャが判定されたときには前記ピクチャ割当符号量算出手段は算出した前記ピクチャ割当符号量を調整し、前記量子化パラメータ決定手段はその調整後の前記ピクチャ割当符号量に応じて前記マクロブロック毎の前記量子化パラメータを決定することを特徴とする動画像符号化装置。
Encoding means for encoding input image data for each macroblock according to a quantization parameter to generate encoded data;
Picture allocation code amount calculation means for calculating an allocation code amount for each picture of the input image data as a picture allocation code amount;
Quantization parameter determining means for determining a quantization parameter for each macroblock according to the picture allocation code amount calculated by the picture allocation code amount calculation means;
A region allocation code amount calculating means for dividing the input image data into a plurality of regions for each picture and calculating an allocation code amount of each of the plurality of regions as a region allocation code amount;
A ratio calculating unit that calculates a ratio between a generated code amount of encoded data generated by the encoding unit and a region allocation code amount for each region;
Scene change determination means for determining a picture of a scene change according to the ratio calculated by the ratio calculation means,
When a scene change picture is determined by the scene change determination means, the picture allocation code amount calculation means adjusts the calculated picture allocation code amount, and the quantization parameter determination means determines the adjusted picture allocation code amount. And determining the quantization parameter for each of the macroblocks according to the method.
前記シーンチェンジ判定手段は、1ピクチャにおいて前記比率算出手段によって算出された比率=前記生成符号量/前記領域割当符号量が第1閾値より大の領域の数が第2閾値より多く検出されたときには、その1ピクチャをシーンチェンジのピクチャと判定することを特徴とする請求項1記載の動画像符号化装置。   The scene change determination means detects when the ratio calculated by the ratio calculation means in one picture = the number of areas where the generated code amount / area allocation code quantity is greater than the first threshold is greater than the second threshold. 2. The moving picture coding apparatus according to claim 1, wherein the one picture is determined as a scene change picture. 前記シーンチェンジ判定手段は、1ピクチャにおいて前記比率算出手段によって算出された比率=前記生成符号量/前記領域割当符号量が第3閾値より小の領域の数が第4閾値より多く検出されたときには、その1ピクチャをシーンチェンジのピクチャと判定することを特徴とする請求項1記載の動画像符号化装置。   The scene change determination means detects when the ratio calculated by the ratio calculation means in one picture = the number of areas where the generated code quantity / area allocation code quantity is smaller than the third threshold is greater than the fourth threshold. 2. The moving picture coding apparatus according to claim 1, wherein the one picture is determined as a scene change picture. 前記シーンチェンジ判定手段は、1ピクチャにおいて前記比率算出手段によって算出された比率=前記生成符号量/前記領域割当符号量が第1閾値より大の領域がその1ピクチャ上において第6閾値より多く連続する領域として検出されたときには、その1ピクチャをシーンチェンジのピクチャと判定することを特徴とする請求項1記載の動画像符号化装置。   The scene change determination means has a ratio calculated by the ratio calculation means in one picture = a region where the generated code amount / the region allocation code amount is larger than the first threshold and is continuous more than the sixth threshold on the one picture. 2. The moving picture coding apparatus according to claim 1, wherein when the detected area is detected, the one picture is determined to be a scene change picture. 前記シーンチェンジ判定手段は、1ピクチャにおいて前記比率算出手段によって算出された比率=前記生成符号量/前記領域割当符号量が第3閾値より小の領域がその1ピクチャ上において第7閾値より多く連続する領域として検出されたときには、その1ピクチャをシーンチェンジのピクチャと判定することを特徴とする請求項1記載の動画像符号化装置。   The scene change determination means has a ratio calculated by the ratio calculation means for one picture = a region where the generated code amount / the region allocation code amount is smaller than a third threshold value and continues more than the seventh threshold value on the one picture. 2. The moving picture coding apparatus according to claim 1, wherein when the detected area is detected, the one picture is determined to be a scene change picture. 前記シーンチェンジ判定手段は、1ピクチャにおいて前記比率算出手段によって算出された比率=前記生成符号量/前記領域割当符号量が前記第1閾値より大の領域の数が前記第2閾値の半分の数にほぼ達したときには、前記第1閾値を小さくすることを特徴とする請求項2記載の動画像符号化装置。   The scene change determination means has a ratio calculated by the ratio calculation means in one picture = the number of generated codes / the number of areas where the area allocation code quantity is larger than the first threshold is half the number of the second threshold. 3. The moving picture encoding apparatus according to claim 2, wherein the first threshold value is decreased when the value reaches approximately. 前記シーンチェンジ判定手段は、1ピクチャにおいて前記比率算出手段によって算出された比率=前記生成符号量/前記領域割当符号量が前記第3閾値より小の領域の数が前記第4閾値の半分の数にほぼ達したときには、前記第3閾値を大きくすることを特徴とする請求項3記載の動画像符号化装置。   The scene change determination unit is configured such that the ratio calculated by the ratio calculation unit in one picture = the number of generated code amounts / the area allocation code amount is half the number of the fourth threshold value. 4. The moving picture encoding apparatus according to claim 3, wherein the third threshold value is increased when substantially reaching the above. 前記符号化手段が1領域分の符号化を行う毎に前記シーンチェンジ判定手段は前記比率算出手段によって算出された比率に応じてシーンチェンジのピクチャを判定し、
前記シーンチェンジ判定手段によってシーンチェンジのピクチャが判定されたときには前記ピクチャ割当符号量算出手段は算出した前記ピクチャ割当符号量を調整し、前記量子化パラメータ決定手段はその調整後の前記ピクチャ割当符号量に応じてその後のマクロブロック毎の前記量子化パラメータを決定することを特徴とする請求項1記載の動画像符号化装置。
Each time the encoding unit performs encoding for one area, the scene change determination unit determines a scene change picture according to the ratio calculated by the ratio calculation unit,
When a scene change picture is determined by the scene change determination means, the picture allocation code amount calculation means adjusts the calculated picture allocation code amount, and the quantization parameter determination means determines the adjusted picture allocation code amount. The moving picture coding apparatus according to claim 1, wherein the quantization parameter for each subsequent macroblock is determined according to.
前記複数の領域は1ピクチャを符号化の処理順に、マクロブロック数が一定になるように分割された領域であることを特徴とする請求項1記載の動画像符号化装置。   2. The moving picture coding apparatus according to claim 1, wherein the plurality of areas are areas obtained by dividing one picture so that the number of macroblocks is constant in the coding processing order. 前記シーンチェンジ判定手段は、前記比率算出手段によって算出された比率=前記生成符号量/前記領域割当符号量が前記第1閾値より大の領域の有するピクチャが第5閾値より多く連続したときフェードのピクチャと判定することを特徴とする請求項1又は2記載の動画像符号化装置。   The scene change determination unit determines that the ratio calculated by the ratio calculation unit = the generated code amount / the region allocation code amount is greater than the first threshold value. The moving picture coding apparatus according to claim 1, wherein the moving picture coding apparatus is determined as a picture. 入力画像データをマクロブロック毎に量子化パラメータに応じて符号化して符号化データを生成する符号化ステップと、
前記入力画像データについてピクチャ毎に割当符号量をピクチャ割当符号量として算出するピクチャ割当符号量算出ステップと、
前記ピクチャ割当符号量算出ステップにて算出されたピクチャ割当符号量に応じて前記マクロブロック毎の量子化パラメータを決定する量子化パラメータ決定ステップと、
前記入力画像データについてピクチャ毎に複数の領域に分割してその複数の領域各々の割当符号量を領域割当符号量として算出する領域割当符号量算出ステップと、
前記符号化ステップにて生成された符号化データの生成符号量と領域割当符号量との比率を領域毎に算出する比率算出ステップと、
前記比率算出ステップにて算出された比率に応じてシーンチェンジのピクチャを判定するシーンチェンジ判定ステップと、を備え、
前記シーンチェンジ判定ステップにてシーンチェンジのピクチャが判定されたときには前記ピクチャ割当符号量算出ステップでは算出した前記ピクチャ割当符号量を調整し、前記量子化パラメータ決定手段ではその調整後の前記ピクチャ割当符号量に応じて前記マクロブロック毎の前記量子化パラメータを決定することを特徴とする動画像符号化方法。
An encoding step of encoding input image data for each macroblock according to a quantization parameter to generate encoded data;
A picture allocation code amount calculating step for calculating an allocation code amount for each picture of the input image data as a picture allocation code amount;
A quantization parameter determination step for determining a quantization parameter for each macroblock according to the picture allocation code amount calculated in the picture allocation code amount calculation step;
A region allocation code amount calculation step of dividing the input image data into a plurality of regions for each picture and calculating an allocation code amount of each of the plurality of regions as a region allocation code amount;
A ratio calculating step for calculating, for each region, a ratio between the generated code amount of the encoded data generated in the encoding step and the region allocation code amount;
A scene change determination step for determining a picture of a scene change according to the ratio calculated in the ratio calculation step,
When the scene change picture is determined in the scene change determination step, the picture allocation code amount calculation step adjusts the calculated picture allocation code amount, and the quantization parameter determination means adjusts the adjusted picture allocation code. A moving picture encoding method, wherein the quantization parameter for each macroblock is determined according to a quantity.
JP2007087770A 2007-03-29 2007-03-29 Motion picture encoding device and method Pending JP2008252225A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007087770A JP2008252225A (en) 2007-03-29 2007-03-29 Motion picture encoding device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007087770A JP2008252225A (en) 2007-03-29 2007-03-29 Motion picture encoding device and method

Publications (1)

Publication Number Publication Date
JP2008252225A true JP2008252225A (en) 2008-10-16

Family

ID=39976708

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007087770A Pending JP2008252225A (en) 2007-03-29 2007-03-29 Motion picture encoding device and method

Country Status (1)

Country Link
JP (1) JP2008252225A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101902634A (en) * 2008-10-30 2010-12-01 Vixs系统公司 Video transcoding system with drastic scene change detection and method for use therewith
JP2011114813A (en) * 2009-11-30 2011-06-09 Mega Chips Corp Data transmission system, and data transmission method of data transmission system
JP2013229911A (en) * 2013-06-20 2013-11-07 Mega Chips Corp Data transmission system
JP2017500830A (en) * 2013-11-04 2017-01-05 マグナム セミコンダクター, インコーポレイテッド Method and apparatus for multipath adaptive quantization

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101902634A (en) * 2008-10-30 2010-12-01 Vixs系统公司 Video transcoding system with drastic scene change detection and method for use therewith
US8787447B2 (en) 2008-10-30 2014-07-22 Vixs Systems, Inc Video transcoding system with drastic scene change detection and method for use therewith
CN101902634B (en) * 2008-10-30 2014-11-26 Vixs系统公司 Video transcoding system with drastic scene change detection and method for use therewith
JP2011114813A (en) * 2009-11-30 2011-06-09 Mega Chips Corp Data transmission system, and data transmission method of data transmission system
JP2013229911A (en) * 2013-06-20 2013-11-07 Mega Chips Corp Data transmission system
JP2017500830A (en) * 2013-11-04 2017-01-05 マグナム セミコンダクター, インコーポレイテッド Method and apparatus for multipath adaptive quantization

Similar Documents

Publication Publication Date Title
JP4901772B2 (en) Moving picture coding method and moving picture coding apparatus
JP5133290B2 (en) Video encoding apparatus and decoding apparatus
EP1551186A1 (en) Video coding apparatus with resolution converter
JP2002010259A (en) Image encoding apparatus and its method and recording medium recording image encoding program
JP2007235291A (en) Adaptive quantization apparatus and adaptive quantization program
JP4764136B2 (en) Moving picture coding apparatus and fade scene detection apparatus
JP2003018603A (en) Method and device for encoding moving image
JP2007124586A (en) Apparatus and program for encoding moving picture
JP2022123031A (en) Encoding device, encoding method, and encoding program
JP4958713B2 (en) Video encoding apparatus and control method thereof
JP2006135557A (en) Moving picture encoding device
JP2008252225A (en) Motion picture encoding device and method
JP2007318617A (en) Image encoder and image encoding program
JP5649296B2 (en) Image encoding device
JP4257789B2 (en) Video encoding device
JP4179917B2 (en) Video encoding apparatus and method
JP2005045736A (en) Method and device for encoding image signal, encoding controller, and program
JP2008182408A (en) Dynamic image encoder and dynamic image encoding method
JP2001238215A (en) Moving picture coding apparatus and its method
CN102202220B (en) Encoding apparatus and control method for encoding apparatus
JP2003069997A (en) Moving picture encoder
JP4871848B2 (en) Video re-encoding device
JP3812269B2 (en) Video encoding apparatus and method
JP5171658B2 (en) Image encoding device
JP2009194474A (en) Moving image encoder