JP2007135045A - Compression coding apparatus, compression coding method, and storage medium - Google Patents

Compression coding apparatus, compression coding method, and storage medium Download PDF

Info

Publication number
JP2007135045A
JP2007135045A JP2005327209A JP2005327209A JP2007135045A JP 2007135045 A JP2007135045 A JP 2007135045A JP 2005327209 A JP2005327209 A JP 2005327209A JP 2005327209 A JP2005327209 A JP 2005327209A JP 2007135045 A JP2007135045 A JP 2007135045A
Authority
JP
Japan
Prior art keywords
code amount
allocated code
maximum
encoding
allocated
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
JP2005327209A
Other languages
Japanese (ja)
Inventor
Shinya Seto
慎哉 瀬戸
Shinjiro Mizuno
慎二郎 水野
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2005327209A priority Critical patent/JP2007135045A/en
Publication of JP2007135045A publication Critical patent/JP2007135045A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To ensure the total recording time when compressing and coding a dynamic image to record in a storage medium, even when recording time for each recording and total recording frequencies are not predictable. <P>SOLUTION: A means for measuring recording time 107 measures the elapsed time since the recording starts. A means for calculating the maximum amount of assigned codes 108 calculates the maximum amount of assigned codes according to the elapsed time. A means for calculating the amount of assigned codes 110 calculates the variable amount of assigned codes based on the difficulty of coding the input dynamic image. A means for limiting the amount of assigned codes 112 limits the amount of assigned codes to be equal to or less than the maximum amount of assigned codes. A means for determining quantization parameter 113 determines quantization parameter so that the amount of generated codes is equal to the amount of assigned codes. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、動画像信号の圧縮符号化を行い、可変ビットレートの符号化ストリームに変換して記録または伝送する圧縮符号化装置、圧縮符号化方法、および記録媒体に関するものである。   The present invention relates to a compression encoding apparatus, a compression encoding method, and a recording medium that perform compression encoding of a moving image signal, convert it into a variable bit rate encoded stream, and record or transmit the encoded stream.

近年、動画像信号を圧縮符号化する方法として、国際標準規格であるMPEG2方式が広く用いられている。MPEG2方式では、入力動画像信号のフレーム毎にマクロブロックと呼ばれる16×16画素のブロックに分割し、マクロブロック単位で動き補償によるフレーム間予測、DCT、量子化、可変長符号化を用いることで高効率圧縮を実現している。   In recent years, the MPEG2 system, which is an international standard, has been widely used as a method for compression-coding moving image signals. In the MPEG2 system, each frame of an input moving image signal is divided into 16 × 16 pixel blocks called macroblocks, and interframe prediction by motion compensation, DCT, quantization, and variable length coding are used for each macroblock. Achieves high-efficiency compression.

フレーム間予測は、動画像の時間的相関が強いことを利用して前後のフレームから符号化対象フレームを予測する技術である。動き補償はこれに加え、前後のフレームから、符号化対象マクロブロックと相関の強い画像ブロックを探し出し、対象マクロブロックとの差分を符号化することで、画像の時間的冗長性を排除し、高い圧縮率を実現している。   Inter-frame prediction is a technique for predicting an encoding target frame from previous and subsequent frames using the strong temporal correlation of moving images. In addition to this, motion compensation finds an image block having a strong correlation with the encoding target macroblock from the previous and subsequent frames, and encodes the difference from the target macroblock, thereby eliminating temporal redundancy of the image, and high The compression ratio is realized.

DCTは画像情報を周波数成分に変換する処理であり、各周波数成分すなわちDCT係数を量子化することで大幅な情報の圧縮をしている。量子化とはDCT係数を量子化パラメータと呼ばれる値で除算することであり、振幅レベルの小さな周波数成分がゼロになる。一般に画像信号は低周波数成分が大部分を占め、高周波成分は少ない。従って量子化によって振幅レベルの小さな高周波成分を省略することで、画像の空間情報を大幅に削減している。人間の視覚には、高周波成分には鈍感であるという特性があり、量子化によって高周波成分を除去したとしても画質劣化は目立ちにくい。   DCT is a process of converting image information into frequency components, and each frequency component, that is, a DCT coefficient, is quantized to compress information greatly. Quantization means dividing a DCT coefficient by a value called a quantization parameter, and a frequency component having a small amplitude level becomes zero. In general, a low frequency component occupies most of an image signal, and a high frequency component is small. Therefore, the spatial information of the image is greatly reduced by omitting the high frequency component having a small amplitude level by quantization. Human vision has the characteristic that high-frequency components are insensitive, and even if high-frequency components are removed by quantization, image quality deterioration is not noticeable.

その後、量子化されたDCT係数に可変長符号化を施すことで、全体として高圧縮と高画質を実現している。   After that, variable length coding is applied to the quantized DCT coefficients to achieve high compression and high image quality as a whole.

さて、DVD等の記録メディアに動画像を圧縮符号化して記録するとき、量子化パラメータを逐次変更することで発生符合量を調節している。量子化パラメータを大きくすれば、発生符号量を減らすことができるが画質は悪くなる。逆に量子化パラメータを小さくすれば、高画質に符号化できるがその分発生符号量が増える。DVD等の固定容量のメディアに記録する場合には、発生符号量の増大は記録時間の減少につながる。このように一般的に画質と記録時間にはトレードオフの関係がある。   Now, when a moving image is compressed and recorded on a recording medium such as a DVD, the generated code amount is adjusted by sequentially changing the quantization parameter. If the quantization parameter is increased, the amount of generated codes can be reduced, but the image quality deteriorates. Conversely, if the quantization parameter is reduced, encoding can be performed with high image quality, but the amount of generated code increases accordingly. When recording on a fixed-capacity medium such as a DVD, an increase in the amount of generated code leads to a decrease in recording time. Thus, there is generally a trade-off relationship between image quality and recording time.

一般的に、一定期間毎の割当符号量を設定し、発生符号量と割当符号量の誤差が小さくなるように量子化パラメータを適応的に制御することを符号量制御という。   In general, code amount control refers to setting an assigned code amount for each fixed period and adaptively controlling a quantization parameter so that an error between the generated code amount and the assigned code amount becomes small.

符号量制御の一つに固定ビットレート制御がある。これは常に固定の符号量が発生するように量子化パラメータの制御を行うものである。固定ビットレート制御の場合、入力画像の複雑さに関わらず常に一定の符号量しか割り当てずに符号化を行うため、入力画像が複雑な場合には発生符号量を抑えるためにQパラメータを大きく設定する必要があり、画質劣化につながる。また逆に、入力画像が簡単な場合には、必要以上の符号量を割り当てることになり、符合化の効率の観点からあまり良くない。   One of the code amount controls is fixed bit rate control. This is to control the quantization parameter so that a fixed code amount is always generated. In case of fixed bit rate control, regardless of the complexity of the input image, encoding is always performed by assigning only a fixed amount of code. If the input image is complex, the Q parameter is set to be large to reduce the amount of generated code. It is necessary to do so, which leads to image quality degradation. On the other hand, if the input image is simple, an amount of code more than necessary is allocated, which is not very good from the viewpoint of coding efficiency.

これに対して別の符号量制御として、可変ビットレート制御がある。可変ビットレート制御を用いれば、割当符号量を画像の符号化難易度に応じて変化させることができるので、固定ビットレート制御での問題を解決できる。すなわち符号化難易度が大きい画像の場合、目標平均符号量よりも割当符号量を大きくすることで、量子化パラメータをそれほど大きくすることなく符号化でき、逆に難易度が小さい画像の場合に目標平均符号量よりも割当符号量を小さくして符号化効率を向上させることが可能となる。このように可変ビットレート制御を用いれば、画像の符号化難易度に応じて適切な割当符号量を設定可能となり、高画質、高符号化効率が実現できる。   On the other hand, there is variable bit rate control as another code amount control. If the variable bit rate control is used, the allocated code amount can be changed according to the degree of difficulty in encoding the image, so that the problem in the fixed bit rate control can be solved. In other words, in the case of an image with a high degree of encoding difficulty, it is possible to encode without increasing the quantization parameter so much by increasing the allocated code amount rather than the target average code amount. It is possible to improve the coding efficiency by making the allocated code amount smaller than the average code amount. If variable bit rate control is used in this way, an appropriate allocated code amount can be set according to the degree of difficulty in encoding an image, and high image quality and high encoding efficiency can be realized.

可変ビットレート制御を実現する装置の例として特開2000−174635号公報記載のものが挙げられる。この装置では、あらかじめ与えられた目標平均符号量と発生符号量との累積誤差が、予め設定された許容累積誤差を超えないようにしつつ、符号化難易度に基づいて割当符号量を更新制御している。累積誤差が許容累積誤差に対して十分少ない場合には、符号化難易度が大きい画像に対して、十分な割当符号量を設定することができ、高画質を実現できる。一方、許容累積誤差に対する余裕量が少ない場合には、符号化難易度から計算される割当符号量を目標平均符号量に近づくように補正し、許容累積誤差を超過しないようにしている。許容累積誤差に対する余裕量がゼロとなった場合においても、最低でも目標平均符号量分は割り当てることができる。従って可変ビットレート制御によって高画質を実現しつつも、設定された許容誤差符号量を超えることもないので、記録時間の保証が可能となる。
特開2000−174635号公報
An example of an apparatus that realizes variable bit rate control is described in Japanese Patent Application Laid-Open No. 2000-174635. In this apparatus, the allocated code amount is controlled to be updated based on the degree of encoding difficulty while preventing the accumulated error between the target average code amount given in advance and the generated code amount from exceeding a preset allowable accumulated error. ing. When the accumulated error is sufficiently small with respect to the allowable accumulated error, a sufficient allocated code amount can be set for an image with a large degree of encoding difficulty, and high image quality can be realized. On the other hand, when the margin for the allowable accumulated error is small, the allocated code amount calculated from the encoding difficulty is corrected so as to approach the target average code amount so as not to exceed the allowable accumulated error. Even when the margin for the allowable accumulated error becomes zero, the target average code amount can be allocated at the minimum. Therefore, it is possible to guarantee the recording time since the set allowable error code amount is not exceeded while realizing high image quality by variable bit rate control.
JP 2000-174635 A

しかしながら、上記の特開2000−174635号公報で示されるような従来の符号量制御方法は、以下のような課題がある。   However, the conventional code amount control method as disclosed in the above Japanese Patent Laid-Open No. 2000-174635 has the following problems.

テレビ放送の番組録画のように、あらかじめ記録時間が設定される場合、記録時間と目標平均符号量から総符号量が正確に計算可能であり、記録メディアの容量と記録時間に見合った許容累積誤差をあらかじめ設定することが可能であるが、ビデオカメラでの撮影のように、いつ撮影が停止されるか分からない場合、前もって記録時間を知ることができないため、適切な許容累積誤差をあらかじめ設定することは困難である。   When the recording time is set in advance, as in the case of TV program recording, the total code amount can be accurately calculated from the recording time and the target average code amount, and the allowable cumulative error commensurate with the recording media capacity and recording time. Can be set in advance, but if you do not know when the shooting will stop, such as when shooting with a video camera, you cannot know the recording time in advance, so set an appropriate allowable cumulative error in advance. It is difficult.

可変ビットレートにおける割当符号量の振れ幅は、許容累積誤差に対する余裕量が大きいほど大きくすることができ、可変ビットレートの効果は大きくなる。しかし、符号化難易度が高い画像が続くと、目標平均符号量に対する誤差が蓄積され、符号量の余裕が無くなってしまう。このような状態のときに記録停止されると、目標平均符号量より多く記録容量を消費したことになる。さらに記録メディアの総記録容量いっぱいまでこのような記録が繰り返された場合、実際の総記録時間が、あらかじめ想定した記録時間よりも極端に短くなってしまうという課題があった。   The fluctuation amount of the allocated code amount at the variable bit rate can be increased as the margin for the allowable accumulated error is increased, and the effect of the variable bit rate is increased. However, if an image with a high encoding difficulty level continues, an error with respect to the target average code amount is accumulated, and there is no code amount margin. If recording is stopped in such a state, the recording capacity is consumed more than the target average code amount. Furthermore, when such recording is repeated up to the total recording capacity of the recording medium, there is a problem that the actual total recording time becomes extremely shorter than the recording time assumed in advance.

逆に総記録時間を保証するために、1回の記録に対して、少量の累積誤差しか許容しないようにすると、割当符号量の振れ幅を小さくする必要がある。仮に大きく振ってしまうとすぐに余裕量を食いつぶしてしまい、目標平均符号量分しか符号を割り当てられず、固定ビットレート制御に近づいてしまうので、符号化難易度が高い画像の場合に必要な割当符号量を与えられなくなるという課題があった。   Conversely, in order to guarantee the total recording time, if only a small amount of accumulated error is allowed for one recording, it is necessary to reduce the fluctuation amount of the assigned code amount. If it shakes greatly, the margin will be consumed immediately, and only the target average code amount can be allocated, and it will approach the fixed bit rate control, so allocation necessary for images with high coding difficulty There was a problem that the code amount could not be given.

以上のように、符号化難易度が高い動画像を比較的短い時間で記録するという動作を、記録メディアの容量いっぱいまで繰り返した場合、従来の方法では画質と総記録時間の両方を保障することができないという課題があった。   As described above, when the operation of recording a moving image with high encoding difficulty in a relatively short time is repeated to the full capacity of the recording medium, the conventional method guarantees both the image quality and the total recording time. There was a problem that it was not possible.

本発明の圧縮符号化装置は、上記の課題を解決するために、動画像を圧縮符号化し、符号化ストリームを出力する圧縮符号化手段と、前記符号化ストリームの符号化難易度に基づき割当符号量を計算する割当符号量計算手段と、最大割当符号量を前記動画像の圧縮符号化開始からの経過時間に応じて増加させる最大割当符号量計算手段と、前記割当符号量を前記最大割当符号量で制限した実効割当符号量を算出する割当符号量制限手段と、前記実効割当符号量に基づき前記圧縮符号化時の量子化パラメータを決定する量子化パラメータ決定手段とを備える。   In order to solve the above-described problem, the compression encoding apparatus of the present invention compresses and encodes a moving image and outputs an encoded stream, and an assigned code based on the encoding difficulty of the encoded stream. An allocated code amount calculating means for calculating the amount, a maximum allocated code amount calculating means for increasing the maximum allocated code amount in accordance with an elapsed time from the start of compression encoding of the moving image, and the allocated code amount for the maximum allocated code An allocation code amount limiting unit that calculates an effective allocation code amount limited by an amount; and a quantization parameter determination unit that determines a quantization parameter at the time of compression encoding based on the effective allocation code amount.

以上のように本発明の符号量制御方法は、最大割当符号量を記録時間に応じて増加させるので、いつ記録が停止されたとしても、また何回記録を繰り返しても、目標平均符号量に対する累積誤差を所定値以下に規定することができるので、記録時間を保証することができる。   As described above, the code amount control method of the present invention increases the maximum allocated code amount according to the recording time, so that no matter how many times recording is stopped and how many times the recording is repeated, Since the accumulated error can be regulated to a predetermined value or less, the recording time can be guaranteed.

本発明の圧縮符号化装置は、動画像を圧縮符号化し、符号化ストリームを出力する圧縮符号化手段と、前記符号化ストリームの符号化難易度に基づき割当符号量を計算する割当符号量計算手段と、最大割当符号量を前記動画像の圧縮符号化開始からの経過時間に応じて増加させる最大割当符号量計算手段と、前記割当符号量を前記最大割当符号量で制限した実効割当符号量を算出する割当符号量制限手段と、前記実効割当符号量に基づき前記圧縮符号化時の量子化パラメータを決定する量子化パラメータ決定手段とを備える。これにより、最大割当符号量を記録時間に応じて増加させるので、いつ記録が停止されたとしても、また何回記録を繰り返しても、目標平均符号量に対する累積誤差を所定値以下に規定することができるので、記録時間を保証することができる。   The compression encoding apparatus of the present invention includes compression encoding means for compressing and encoding a moving image and outputting an encoded stream, and allocated code amount calculation means for calculating an allocated code amount based on the encoding difficulty of the encoded stream. A maximum allocated code amount calculating means for increasing the maximum allocated code amount according to an elapsed time from the start of compression encoding of the moving image, and an effective allocated code amount obtained by limiting the allocated code amount by the maximum allocated code amount. Allocation code amount limiting means for calculating, and quantization parameter determining means for determining a quantization parameter at the time of compression encoding based on the effective allocation code amount. As a result, the maximum allocated code amount is increased in accordance with the recording time, so that the accumulated error with respect to the target average code amount is specified to be equal to or less than a predetermined value no matter when recording is stopped or when recording is repeated. Recording time can be guaranteed.

上記の構成にかかる本発明の圧縮符号化装置において、前記最大割当符号量計算手段は、目標平均符号量と前記符号化ストリームの符号量とから算出した累積誤差が、許容累積誤差を超えないように前記最大割当符号量を制限するとしても良い。これにより、長時間記録された場合においても、累積誤差に応じた適切な最大割当符号量を設定することができるので、高画質を実現しつつ、記録時間を保証することができる。   In the compression encoding apparatus of the present invention according to the above configuration, the maximum allocated code amount calculation means prevents the accumulated error calculated from the target average code amount and the code amount of the encoded stream from exceeding an allowable accumulated error. The maximum allocated code amount may be limited. Thereby, even when recording is performed for a long time, an appropriate maximum allocated code amount according to the accumulated error can be set, so that the recording time can be ensured while realizing high image quality.

以下、本発明にかかわる圧縮符号化方法の実施の形態を図面に基づいて詳細に説明する。   Embodiments of a compression encoding method according to the present invention will be described below in detail with reference to the drawings.

図1は、本発明の一実施の形態における圧縮符号化装置の構成を示すブロック図である。図1において、101は動画像入力端子、102は量子化処理を有した圧縮符号化手段、103は符号化ストリーム出力端子、104は発生符号量計測手段、105は目標平均符号量入力端子、106は累積誤差計算手段、107は記録時間計測手段、108は最大割当符号量計算手段、109は符号化難易度計算手段、110は割当符号量計算手段、111は許容累積誤差入力端子、112は割当符号量制限手段、113は量子化パラメータ決定手段である。   FIG. 1 is a block diagram showing a configuration of a compression encoding apparatus according to an embodiment of the present invention. In FIG. 1, 101 is a moving image input terminal, 102 is a compression encoding means having a quantization process, 103 is an encoded stream output terminal, 104 is a generated code amount measuring means, 105 is a target average code amount input terminal, 106 Is an accumulated error calculating means, 107 is a recording time measuring means, 108 is a maximum allocated code amount calculating means, 109 is an encoding difficulty level calculating means, 110 is an allocated code amount calculating means, 111 is an allowable accumulated error input terminal, and 112 is an allocation A code amount limiting unit 113 is a quantization parameter determining unit.

このように構成された圧縮符号化装置について、以下に動作を説明する。   The operation of the compression coding apparatus configured as described above will be described below.

まず、動画像入力端子101から入力された動画像信号は圧縮符号化手段102において符号化され、符号化ストリームが符号化ストリーム出力端子103へと出力される。   First, the moving image signal input from the moving image input terminal 101 is encoded by the compression encoding means 102, and the encoded stream is output to the encoded stream output terminal 103.

圧縮符号化手段102は、圧縮のために量子化処理を行っており、量子化のための量子化パラメータQは量子化パラメータ決定手段113から与えられる。   The compression encoding unit 102 performs a quantization process for compression, and a quantization parameter Q for quantization is supplied from the quantization parameter determination unit 113.

発生符号量計測手段104は符号化ストリームの発生符号量Bを所定期間ごとに計測する。   The generated code amount measuring means 104 measures the generated code amount B of the encoded stream every predetermined period.

累積誤差計算手段106は、目標平均符号量入力端子105から入力される目標平均符号量Baと、発生符号量計測手段104から得られる発生符号量Bとの誤差dを算出し、それを累積加算して累積誤差Dを計算する。この結果を累積誤差情報として最大割当符号量計算手段108へ出力する。   The accumulated error calculation means 106 calculates an error d between the target average code quantity Ba input from the target average code quantity input terminal 105 and the generated code quantity B obtained from the generated code quantity measurement means 104, and cumulatively adds it. To calculate the cumulative error D. This result is output to the maximum allocated code amount calculation means 108 as accumulated error information.

一方、記録時間計測手段107は記録開始からの経過時間Tを測定する。経過時間Tは、例えば記録開始から符号化が完了したフレーム数とフレームレートをもとに計算すればよい。この経過時間情報を最大割当符号量計算手段108へ出力する。   On the other hand, the recording time measuring means 107 measures an elapsed time T from the start of recording. The elapsed time T may be calculated based on, for example, the number of frames that have been encoded from the start of recording and the frame rate. This elapsed time information is output to the maximum allocated code amount calculation means 108.

最大割当符号量計算手段108は、経過時間計測手段107より与えられる経過時間情報に基づいて、最大割当符号量Bt_maxを算出する。最大割当符号量Bt_maxは、割当符号量Btの上限を規定するものである。本発明では、割当符号量Btを最大割当符号量Bt_maxによって制限することにより、発生符号量Bが大きくなり過ぎないようにして記録時間保証を実現している。   The maximum allocated code amount calculation unit 108 calculates the maximum allocated code amount Bt_max based on the elapsed time information given from the elapsed time measuring unit 107. The maximum allocated code amount Bt_max defines the upper limit of the allocated code amount Bt. In the present invention, the recording code guarantee is realized by limiting the allocated code amount Bt by the maximum allocated code amount Bt_max so that the generated code amount B does not become too large.

以下、最大割当符号量計算手段108における最大割当符号量Bt_maxの計算方法について、図2のフローチャートを用いて説明する。   Hereinafter, a method of calculating the maximum allocated code amount Bt_max in the maximum allocated code amount calculating means 108 will be described with reference to the flowchart of FIG.

記録開始からの経過時間Tが、記録時間計測手段107から入力される(ステップ201)。最大割当符号量計算手段108は、記録開始からの経過時間Tがあらかじめ設定された所定時間に達した際(ステップ202)に、まず仮の最大割当符号量Bt_max’を、経過時間Tをパラメータとし、経過時間に応じて増加する所定の関数を用いて計算する(ステップ203)。例えば、
Bt_max’ = a × T + b(a、bはあらかじめ設定された正の実定数)
として計算することができる。また、Bt_max’について、ある上限値Pで制限してそれより大きくならないようにすることもできる。
The elapsed time T from the start of recording is input from the recording time measuring means 107 (step 201). When the elapsed time T from the start of recording reaches a predetermined time set in advance (step 202), the maximum allocated code amount calculation means 108 first sets the temporary maximum allocated code amount Bt_max ′ using the elapsed time T as a parameter. The calculation is performed using a predetermined function that increases with the elapsed time (step 203). For example,
Bt_max '= a × T + b (a and b are positive real constants set in advance)
Can be calculated as Also, Bt_max ′ can be limited by a certain upper limit value P so that it does not become larger.

さらに、最大割当符号量計算手段108は、累積誤差計算手段106より入力された累積誤差Dを用いて(ステップ204)、許容累積誤差入力端子111より与えられる許容累積誤差Dmaxを超過しないように、Bt_max’を補正して最大割当符号量Bt_maxを算出する。すなわち許容累積誤差Dmaxに対する累積誤差Dの余裕量が少ない場合(ステップ205)、Bt_max’を減じるように補正する(ステップ206)。余裕量がゼロに近づくほど、最大割当符号量Bt_maxは目標平均符合量Baに近づくように補正し、余裕量がゼロになった場合は、Bt_max’を目標平均符号量Baとする。割当符号量Btは最大割当符号量Bt_maxで制限されるため、累積誤差Dが許容累積誤差Dmaxを超過することはない。このようにして算出した最大割当符号量Bt_maxを、割当符号量制限手段112に出力する(ステップ207)。   Further, the maximum allocated code amount calculating means 108 uses the accumulated error D input from the accumulated error calculating means 106 (step 204) so as not to exceed the allowable accumulated error Dmax given from the allowable accumulated error input terminal 111. Bt_max ′ is corrected to calculate the maximum allocated code amount Bt_max. That is, when the margin of the accumulated error D with respect to the allowable accumulated error Dmax is small (step 205), correction is performed so as to reduce Bt_max '(step 206). As the margin amount approaches zero, the maximum allocated code amount Bt_max is corrected so as to approach the target average code amount Ba, and when the margin amount becomes zero, Bt_max ′ is set as the target average code amount Ba. Since the allocated code amount Bt is limited by the maximum allocated code amount Bt_max, the accumulated error D does not exceed the allowable accumulated error Dmax. The maximum allocated code amount Bt_max calculated in this way is output to the allocated code amount limiting means 112 (step 207).

符号化難易度計算手段109は、発生符合量計測手段104から入力される発生符号量Bと、量子化パラメータ決定手段113から入力される量子化パラメータQに基づいて、現在の入力動画像の符号化難易度Xを算出する。まず、直前に符号化が完了した一定区間における発生符号量と、そのときの量子化処理で用いた量子化パラメータから、現在の入力動画像の符号化の難しさを求める。符号化の難しさは、例えば発生符号量と量子化パラメータの積として計算される。また符号化難易度計算手段109は、過去の符号化の難しさを記憶しており、過去の符号化の難しさの平均等によって、入力動画像の平均的な符号化の難しさを計算する。平均的な符号化の難しさと現在の符号化の難しさの比率から、現在の符号化難易度を計算する。そして、これを符号化難易度情報として、割当符号量計算手段110へ出力する。   The encoding difficulty level calculation means 109 encodes the code of the current input moving image based on the generated code amount B input from the generated code amount measurement means 104 and the quantization parameter Q input from the quantization parameter determination means 113. The difficulty level X is calculated. First, the difficulty of encoding the current input moving image is obtained from the amount of generated code in a certain section where encoding was completed immediately before and the quantization parameter used in the quantization process at that time. The difficulty of encoding is calculated, for example, as the product of the generated code amount and the quantization parameter. Also, the encoding difficulty level calculation means 109 stores past encoding difficulties, and calculates the average encoding difficulty of the input moving image based on the average of past encoding difficulties. . The current encoding difficulty level is calculated from the ratio between the average encoding difficulty and the current encoding difficulty. And this is output to the allocation code amount calculation means 110 as encoding difficulty level information.

割当符号量計算手段110は、符号化難易度計算手段109から入力される符号化難易度Xに基づき、動画像を符号化するときに、所定期間ごとの目標符号量である割当符号量Btを計算する。割当符号量計算手段110は、符号化難易度情報に応じて、目標平均符号量Baより大きく設定したり、小さく設定したりするものである。符号化難易度Xは先に述べたように、過去の符号化の難しさと現在の符号化の難しさの比率としたので、目標符号量にこの比率を乗じて割当符号量を決定すればよい。このように割当符号量Btを計算することにより、過去に符号化した動画像よりも符号化が難しい動画像が入力された場合、画質が劣化しないように目標平均符号量Baよりも大きな割当符号量が設定される。逆に易しい動画像の場合には、目標平均符号量Baよりも小さい符号量が設定され、符号量が節約できることになる。   Based on the encoding difficulty level X input from the encoding difficulty level calculation unit 109, the allocation code amount calculation unit 110 calculates an allocation code amount Bt that is a target code amount for each predetermined period when encoding a moving image. calculate. The allocated code amount calculation means 110 is set larger or smaller than the target average code amount Ba according to the encoding difficulty level information. As described above, the encoding difficulty level X is the ratio of the past encoding difficulty to the current encoding difficulty, so the allocated code amount may be determined by multiplying the target code amount by this ratio. . By calculating the allocated code amount Bt in this way, when a moving image that is more difficult to encode than a previously encoded moving image is input, an allocated code that is larger than the target average code amount Ba so that the image quality does not deteriorate. The amount is set. Conversely, in the case of a moving image that is easy, a code amount smaller than the target average code amount Ba is set, and the code amount can be saved.

なお、上に説明したような符号化の難しさや符号化難易度の計算方法、割当符号量を変化させるための計算要素は、他の情報を用いてもよいし、他の計算方法で算出しても構わない。   It should be noted that other information may be used for the calculation difficulty and encoding difficulty calculation method as described above, and the calculation element for changing the allocated code amount, or may be calculated by another calculation method. It doesn't matter.

割当符号量制限手段112は、割当符号量計算手段110から入力される割当符号量Btを、最大割当符号量計算手段108から入力される最大割当符号量Bt_maxによって制限する。すなわち割当符号量Btが最大割当符号量Bt_maxより大きい場合には、最大割当符号量Bt_maxを割当符号量とし、割当符号量Btが最大割当符号量Bt_max以下の場合には、割当符号量Btを割当符号量として、量子化パラメータ決定手段113へ出力する。   The allocation code amount limiting unit 112 limits the allocation code amount Bt input from the allocation code amount calculation unit 110 by the maximum allocation code amount Bt_max input from the maximum allocation code amount calculation unit 108. That is, when the allocated code amount Bt is larger than the maximum allocated code amount Bt_max, the maximum allocated code amount Bt_max is set as the allocated code amount, and when the allocated code amount Bt is less than the maximum allocated code amount Bt_max, the allocated code amount Bt is allocated. The code amount is output to the quantization parameter determining unit 113.

量子化パラメータ決定手段113は、これから符号化する動画像の符号化後の符号量Bが、割当符号量Btに等しくなるように量子化パラメータQを変化させる。   The quantization parameter determining unit 113 changes the quantization parameter Q so that the encoded code amount B of the moving image to be encoded is equal to the allocated code amount Bt.

次に、上述したような発生符号量B、割当符号量Bt、最大割当符号量Bt_max、累積誤差D等の各要素の関係について、図面を用いて詳細に説明する。   Next, the relationship among the elements such as the generated code amount B, the assigned code amount Bt, the maximum assigned code amount Bt_max, the accumulated error D and the like as described above will be described in detail with reference to the drawings.

図3は、記録開始時点から符号化難易度が高い動画像が入力される場合における、割当符号量と累積誤差との経過時間毎の変化を示す。図3(a)には、従来の方法を用いた場合の割当符号量を破線で、本発明における割当符号量を実線で示している。入力動画像の符号化難易度が非常に高いために、目標平均符号量を大きく上回る割当符号量が必要とされる。本発明では、最大割当符号量Bt_maxを、記録開始当初は値を抑え、時間毎に増加するように設定することにより、実際に量子化パラメータ決定手段113に設定される割当符号量は実線で示されるものとなる。   FIG. 3 shows changes in allocated code amount and accumulated error for each elapsed time when a moving image having a high encoding difficulty level is input from the recording start time. In FIG. 3A, the assigned code amount when the conventional method is used is indicated by a broken line, and the assigned code amount in the present invention is indicated by a solid line. Since the encoding difficulty level of the input moving image is very high, an allocated code amount that greatly exceeds the target average code amount is required. In the present invention, the maximum allocated code amount Bt_max is set such that the value is suppressed at the beginning of recording and increased every time, so that the allocated code amount actually set in the quantization parameter determining unit 113 is indicated by a solid line. It will be.

このときの累積誤差Dの様子を図3(b)に示す。従来の割当符号量で符号化した場合の累積誤差は破線で、また本発明の最大割当符号量Bt_maxによって制限された割当符号量で符号化した場合の累積誤差は実線で示される。これによると従来の割当符号量の制限がない方法では、明らかに大量の符号量を消費している。このように大量の符合量を消費し、そこで記録が停止され、なおかつそれが繰り返された場合、記録メディアの容量と目標平均符合量から計算される記録時間に対して、実際の記録時間は極端に短いものとなる。それに対して、本発明の最大割当符号量によって割当符号量を制限した場合は、記録開始当初は、最大割当符号量によって割当符号量が低く抑えられているため、累積誤差はあまり大きく増えることはない。従って、短時間で記録が停止されたとしても、そのときの累積誤差量をある規定値以下に押さえ込むことができるので、この動作が繰り返されたとしても記録時間を保証できる。   The state of the accumulated error D at this time is shown in FIG. The accumulated error when coding with the conventional allocated code amount is indicated by a broken line, and the accumulated error when encoded with the allocated code amount limited by the maximum allocated code amount Bt_max of the present invention is indicated by a solid line. According to this, in the conventional method in which there is no limitation on the allocated code amount, a large amount of code amount is obviously consumed. When a large amount of code is consumed and recording is stopped and repeated, the actual recording time is extremely large compared to the recording time calculated from the capacity of the recording medium and the target average code amount. It will be short. On the other hand, when the allocated code amount is limited by the maximum allocated code amount of the present invention, since the allocated code amount is kept low by the maximum allocated code amount at the beginning of recording, the cumulative error does not increase so much. Absent. Therefore, even if the recording is stopped in a short time, the accumulated error amount at that time can be suppressed to a predetermined value or less, so that the recording time can be guaranteed even if this operation is repeated.

また、記録開始時の最大割当符号量を目標平均符号量より大きく設定しておくことで、目標平均符号量よりも割当符号量を大きくすることができ、固定ビットレート制御よりも高画質に符号化することが可能となる。   In addition, by setting the maximum allocated code amount at the start of recording to be larger than the target average code amount, the allocated code amount can be made larger than the target average code amount, and the code quality is higher than that of the fixed bit rate control. Can be realized.

次に、図4は、本発明における記録開始から十分に時間が経過し、かつ許容累積誤差Dmaxに対して、累積誤差Dが十分小さいときの通常状態での可変ビットレート制御の応答を表している。   Next, FIG. 4 shows a response of variable bit rate control in a normal state when a sufficient time has elapsed from the start of recording in the present invention and the accumulated error D is sufficiently small with respect to the allowable accumulated error Dmax. Yes.

まず、図4(a)では、目標平均符号量Baは時間経過に関係なく、常に一定値が設定される。破線で示されているのが最大割当符号量Bt_maxであり、記録開始から十分に時間が経過しているので、十分に大きな値となり既に一定の値で固定されている。このようなとき、割当符号量Btは画像の符号化難易度Xに応じて大きく割り振ることが出来る。このときの割り割当符号量Btを実線で示す。割当符号量Btが目標平均符号量Baより上回っている期間は、符号化難易度が高い動画像が入力されている期間であり、逆に割当符号量Btが目標平均符号量Baより下回っている期間は、符号化難易度が低い動画像が入力されている期間である。図4(a)のような割当符号量Btが量子化パラメータ決定手段113に設定される場合、実際の発生符号量Bは割当符号量Btに一致するように量子化パラメータ決定手段113がQパラメータを制御するので、累積誤差Dは図4(b)のような挙動を示す。割当符号量Btが目標平均符号量Baより上回っている期間は、累積誤差Dが増加し、逆に割当符号量Btが目標平均符号量Baより下回っている期間は、累積誤差Dは減少する。   First, in FIG. 4A, the target average code amount Ba is always set to a constant value regardless of the passage of time. What is indicated by a broken line is the maximum allocated code amount Bt_max. Since a sufficient amount of time has elapsed since the start of recording, the value is sufficiently large and is already fixed at a constant value. In such a case, the allocated code amount Bt can be largely allocated according to the encoding difficulty level X of the image. The allocation code amount Bt at this time is indicated by a solid line. The period in which the assigned code amount Bt is higher than the target average code amount Ba is a period in which a moving image having a high degree of difficulty in encoding is being input, and conversely, the assigned code amount Bt is lower than the target average code amount Ba. The period is a period in which a moving image with a low encoding difficulty level is input. When the allocated code amount Bt as shown in FIG. 4 (a) is set in the quantization parameter determining unit 113, the quantization parameter determining unit 113 sets the Q parameter so that the actual generated code amount B matches the allocated code amount Bt. Therefore, the accumulated error D behaves as shown in FIG. The accumulated error D increases during the period when the allocated code amount Bt is higher than the target average code amount Ba, and conversely, the accumulated error D decreases during the period when the allocated code amount Bt is lower than the target average code amount Ba.

次に、図4で説明したような状態のときに、符号化難易度が非常に高い動画像が入力され続けたときの各要素の応答を図5に示す。図5(a)において、最大割当符号量Bt_maxによる制限なしの場合の割当符号量を破線で示している。これは入力動画像の符号化難易度が非常に高いために本来必要とされる割当符号量である。しかし実際には累積誤差Dが許容累積誤差Dmaxに近づくにつれて、最大割当符号量Bt_maxをだんだん減少させるように補正する。割当符号量Btは割当符号量制限手段112によってBt_maxでクリップされるため、実際に量子化パラメータ決定手段113に設定される割当符号量はBt_maxとなる。このため累積誤差Dは図5(b)のような挙動を示す。累積誤差Dが許容累積誤差Dmaxに達したときには、最大割当符号量Bt_maxは目標平均符号量Baと等しくなるように補正されるため、累積誤差Dは許容累積誤差Dmaxを超過することはない。   Next, FIG. 5 shows the response of each element when a moving image having a very high encoding difficulty level is input in the state described with reference to FIG. In FIG. 5A, the allocation code amount when there is no restriction by the maximum allocation code amount Bt_max is indicated by a broken line. This is an allocated code amount that is originally required because the input video is very difficult to encode. However, in practice, correction is performed so that the maximum allocated code amount Bt_max gradually decreases as the accumulated error D approaches the allowable accumulated error Dmax. Since the allocated code amount Bt is clipped at Bt_max by the allocated code amount limiting unit 112, the allocated code amount actually set in the quantization parameter determining unit 113 is Bt_max. For this reason, the cumulative error D exhibits a behavior as shown in FIG. When the cumulative error D reaches the allowable cumulative error Dmax, the maximum allocated code amount Bt_max is corrected so as to be equal to the target average code amount Ba, so that the cumulative error D does not exceed the allowable cumulative error Dmax.

またこの後、符号化難易度が低い動画像が入力され、累積誤差Dが減少して余裕ができた場合には、最大割当符号量を増加させて割当符号量を大きくすることができる。   Thereafter, when a moving image having a low encoding difficulty level is input and the accumulated error D is reduced to allow for a margin, the allocated code amount can be increased by increasing the maximum allocated code amount.

このように、本発明では、長時間記録された場合は、最大割当符号量が十分大きくなっており、割当符号量を符号化難易度に応じて十分に割り振ることができ、高画質を実現できる。   As described above, in the present invention, when recording is performed for a long time, the maximum allocated code amount is sufficiently large, and the allocated code amount can be sufficiently allocated according to the degree of encoding difficulty, thereby realizing high image quality. .

以上述べたように本発明は、最大割当符号量を記録開始時点からの経過時間に応じて増加させるので、いつ記録停止されたとしても、また何回記録を繰り返したとしても、設定された総記録容量に対して累積誤差量が規定値以下に抑えることが可能なので、記録時間を保証でき、動画像を圧縮符号化する圧縮符号化装置、あるいは動画像の圧縮符号化方法として有用である。   As described above, the present invention increases the maximum allocated code amount in accordance with the elapsed time from the recording start time, so that no matter how many times recording is stopped or how many times recording is repeated, Since the accumulated error amount can be suppressed to a predetermined value or less with respect to the recording capacity, the recording time can be guaranteed, which is useful as a compression encoding apparatus or a compression encoding method for a moving image.

本発明の一実施の形態における圧縮符号化装置のブロック図1 is a block diagram of a compression coding apparatus according to an embodiment of the present invention. 本発明の一実施の形態における最大割当符号量を算出するフローチャートFlowchart for calculating maximum allocated code amount in an embodiment of the present invention 本発明の一実施の形態における記録開始時から複雑な動画像が入力された際の割当符号量と累積誤差を示す概念図The conceptual diagram which shows the allocation code amount at the time of the complicated moving image input from the recording start in one embodiment of this invention, and a cumulative error 本発明の一実施の形態における一定時間経過後の割当符号量と累積誤差を示す概念図The conceptual diagram which shows the allocation code amount and accumulation error after progress for a fixed time in one embodiment of this invention 本発明の一実施の形態における一定時間経過後に複雑な動画像が入力された際の割当符号量と累積誤差を示す概念図The conceptual diagram which shows the allocation code amount and the accumulation error at the time of the complicated moving image being input after progress for a fixed time in one embodiment of this invention

符号の説明Explanation of symbols

101 動画像入力端子
102 圧縮符号化手段
103 符号化ストリーム出力端子
104 発生符号量計測手段
105 目標平均符号量入力端子
106 累積誤差計算手段
107 記録時間計測手段
108 最大割当符号量計算手段
109 符号化難易度計算手段
110 割当符号量計算手段
111 許容累積誤差入力端子
112 割当符号量制限手段
113 量子化パラメータ決定手段
101 moving image input terminal 102 compression encoding means 103 encoded stream output terminal 104 generated code amount measuring means 105 target average code amount input terminal 106 cumulative error calculating means 107 recording time measuring means 108 maximum allocated code amount calculating means 109 encoding difficulty Degree calculation means 110 Allocation code amount calculation means 111 Permissible cumulative error input terminal 112 Allocation code amount restriction means 113 Quantization parameter determination means

Claims (5)

動画像を圧縮符号化し、符号化ストリームを出力する圧縮符号化手段と、
前記符号化ストリームの符号化難易度に基づき割当符号量を計算する割当符号量計算手段と、
最大割当符号量を前記動画像の圧縮符号化開始からの経過時間に応じて増加させる最大割当符号量計算手段と、
前記割当符号量を前記最大割当符号量で制限した実効割当符号量を算出する割当符号量制限手段と、
前記実効割当符号量に基づき前記圧縮符号化時の量子化パラメータを決定する量子化パラメータ決定手段とを備えた圧縮符号化装置。
Compression encoding means for compressing and encoding a moving image and outputting an encoded stream;
An allocated code amount calculating means for calculating an allocated code amount based on the encoding difficulty level of the encoded stream;
Maximum allocated code amount calculating means for increasing the maximum allocated code amount according to the elapsed time from the start of compression encoding of the moving image;
An allocated code amount limiting means for calculating an effective allocated code amount obtained by limiting the allocated code amount with the maximum allocated code amount;
A compression coding apparatus comprising: quantization parameter determining means for determining a quantization parameter at the time of compression encoding based on the effective allocation code amount.
前記最大割当符号量計算手段は、目標平均符号量と前記符号化ストリームの符号量とから算出した累積誤差が、許容累積誤差を超えないように前記最大割当符号量を制限する請求項1記載の圧縮符号化装置。 The maximum allocated code amount calculation unit limits the maximum allocated code amount so that an accumulated error calculated from a target average code amount and a code amount of the encoded stream does not exceed an allowable accumulated error. Compression encoding device. 動画像を圧縮符号化し、符号化ストリームを出力する圧縮符号化ステップと、
前記符号化ストリームの符号化難易度に基づき割当符号量を計算する割当符号量計算ステップと、
最大割当符号量を前記動画像の圧縮符号化開始からの経過時間に応じて増加させる最大割当符号量計算ステップと、
前記割当符号量を前記最大割当符号量で制限した実効割当符号量を算出する割当符号量制限ステップと、
前記実効割当符号量に基づき前記圧縮符号化時の量子化パラメータを決定する量子化パラメータ決定ステップとからなる圧縮符号化方法。
A compression encoding step of compressing and encoding a moving image and outputting an encoded stream;
An allocated code amount calculation step of calculating an allocated code amount based on the encoding difficulty level of the encoded stream;
A maximum allocated code amount calculating step for increasing the maximum allocated code amount according to an elapsed time from the start of compression encoding of the moving image;
An allocated code amount limiting step of calculating an effective allocated code amount obtained by limiting the allocated code amount with the maximum allocated code amount;
A compression encoding method comprising: a quantization parameter determining step for determining a quantization parameter at the time of compression encoding based on the effective allocation code amount.
前記最大割当符号量計算ステップは、目標平均符号量と前記符号化ストリームの符号量とから算出した累積誤差が、許容累積誤差を超えないように前記最大割当符号量を制限する請求項3記載の圧縮符号化方法。 The maximum allocation code amount calculation step limits the maximum allocation code amount so that a cumulative error calculated from a target average code amount and a code amount of the encoded stream does not exceed an allowable cumulative error. Compression encoding method. 動画像を圧縮符号化し、符号化ストリームを出力する圧縮符号化ステップと、
前記符号化ストリームの符号化難易度に基づき割当符号量を計算する割当符号量計算ステップと、
最大割当符号量を前記動画像の圧縮符号化開始からの経過時間に応じて増加させる最大割当符号量計算ステップと、
前記割当符号量を前記最大割当符号量で制限した実効割当符号量を算出する割当符号量制限ステップと、
前記実効割当符号量に基づき前記圧縮符号化時の量子化パラメータを決定する量子化パラメータ決定ステップと
をコンピュータに実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。
A compression encoding step of compressing and encoding a moving image and outputting an encoded stream;
An allocated code amount calculation step of calculating an allocated code amount based on the encoding difficulty level of the encoded stream;
A maximum allocated code amount calculating step for increasing the maximum allocated code amount according to an elapsed time from the start of compression encoding of the moving image;
An allocated code amount limiting step of calculating an effective allocated code amount obtained by limiting the allocated code amount with the maximum allocated code amount;
A computer-readable recording medium storing a program for causing a computer to execute a quantization parameter determination step for determining a quantization parameter at the time of compression encoding based on the effective allocation code amount.
JP2005327209A 2005-11-11 2005-11-11 Compression coding apparatus, compression coding method, and storage medium Pending JP2007135045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005327209A JP2007135045A (en) 2005-11-11 2005-11-11 Compression coding apparatus, compression coding method, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005327209A JP2007135045A (en) 2005-11-11 2005-11-11 Compression coding apparatus, compression coding method, and storage medium

Publications (1)

Publication Number Publication Date
JP2007135045A true JP2007135045A (en) 2007-05-31

Family

ID=38156333

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005327209A Pending JP2007135045A (en) 2005-11-11 2005-11-11 Compression coding apparatus, compression coding method, and storage medium

Country Status (1)

Country Link
JP (1) JP2007135045A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109479136A (en) * 2016-08-04 2019-03-15 深圳市大疆创新科技有限公司 System and method for Bit-Rate Control Algorithm

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109479136A (en) * 2016-08-04 2019-03-15 深圳市大疆创新科技有限公司 System and method for Bit-Rate Control Algorithm

Similar Documents

Publication Publication Date Title
AU2006221586B2 (en) Encoding method, encoding device, processing program for encoding, and recording medium having the processing program for encoding recorded therein
JP2001169281A (en) Device and method for encoding moving image
JP2006509444A (en) Rate control with picture-based look-ahead window
JP2001169284A (en) Quantization step setting method in moving image encoder and moving image encoder using the method
JPH07184196A (en) Picture coder
US8948242B2 (en) Encoding device and method and multimedia apparatus including the encoding device
JP3907875B2 (en) Coding rate control device and information coding device
WO2000065842A1 (en) Image encoder and its method
JP2004274236A (en) Encoding apparatus, encoding method, program, and recording medium
JP4795223B2 (en) Image processing device
JP2006295535A (en) Dynamic image coding apparatus, and method
JP4736619B2 (en) Image processing apparatus and image processing method
JP2001028753A (en) Dynamic image coder and its method
US8116577B2 (en) Encoding method, encoding device, encoding process program, and recording medium on which encoding process program is recorded
JP2004328150A (en) Moving picture coding apparatus and method
JP4407249B2 (en) Data processing apparatus, method and encoding apparatus, method and program
JP2007135045A (en) Compression coding apparatus, compression coding method, and storage medium
JP4556844B2 (en) Code amount control method and code amount control apparatus
JP3218994B2 (en) Image coding method and apparatus
JP2005045736A (en) Method and device for encoding image signal, encoding controller, and program
JP2010213187A (en) Video coding transmission apparatus
JPH11328937A (en) Device and method for recording signal
JP3779066B2 (en) Video encoding device
JP2004072143A (en) Encoder and encoding method, program, and recording medium
JP2007116655A (en) Moving picture coding apparatus