JP5706759B2 - Image coding apparatus and image coding method - Google Patents

Image coding apparatus and image coding method Download PDF

Info

Publication number
JP5706759B2
JP5706759B2 JP2011123654A JP2011123654A JP5706759B2 JP 5706759 B2 JP5706759 B2 JP 5706759B2 JP 2011123654 A JP2011123654 A JP 2011123654A JP 2011123654 A JP2011123654 A JP 2011123654A JP 5706759 B2 JP5706759 B2 JP 5706759B2
Authority
JP
Japan
Prior art keywords
encoded
code amount
amount
frame
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2011123654A
Other languages
Japanese (ja)
Other versions
JP2012253516A (en
Inventor
横山 裕
裕 横山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics 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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2011123654A priority Critical patent/JP5706759B2/en
Publication of JP2012253516A publication Critical patent/JP2012253516A/en
Application granted granted Critical
Publication of JP5706759B2 publication Critical patent/JP5706759B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像符号化装置及び画像符号化方法に関する。   The present invention relates to an image encoding device and an image encoding method.

ビデオフレームのエンコードにおいては、ビデオエンコーダの処理速度の向上のために、複数のエンコーダでビデオフレームのエンコードを分担して並列に処理することが行われている。そのような技術として、特許文献1が開示されている。   In the encoding of video frames, in order to improve the processing speed of the video encoder, the encoding of video frames is shared by a plurality of encoders and processed in parallel. As such a technique, Patent Document 1 is disclosed.

特許文献1には、並列にビデオフレームをエンコードする際に、各ビデオフレームをエンコード中に生成したビット量に基づいて、量子化パラメタを最適化する制御を行うことを目的とした技術が開示されている。特許文献1に開示の情報処理装置は、1フレーム内のエンコードされたパーティションのビット量Biと、未エンコードのパーティション数Riとから、数式を用いて、残りのパーティションの生成ビット量を計算・予測する。この情報処理装置は、生成されたビット量Biと数式による計算結果との和と、目的ビット量とを比較する。そして、この情報処理装置は、比較結果に応じて、量子化パラメタの値を大きく又は小さくすることによって量子化パラメタを最適化する制御を行っている。   Patent Document 1 discloses a technique for performing control for optimizing a quantization parameter based on a bit amount generated during encoding of each video frame when encoding video frames in parallel. ing. The information processing apparatus disclosed in Patent Document 1 calculates and predicts the generated bit amount of the remaining partition from the bit amount Bi of the encoded partition in one frame and the number of unencoded partitions Ri using an equation. To do. This information processing apparatus compares the sum of the generated bit amount Bi and the calculation result by the mathematical expression with the target bit amount. The information processing apparatus performs control to optimize the quantization parameter by increasing or decreasing the value of the quantization parameter according to the comparison result.

しかし、この制御方法では、基本的に、エンコード中のビット量のみを用いて残りのパーティションのビット量を算出するようにしているため、残りのパーティションのビット量を精度良く予測することができていないという問題がある。そのため、その予測結果に基づいて適切でない量子化パラメタが決定されてしまう。その結果、適切でない量子化パラメタによってエンコードが行われてしまい、ビデオフレームの画質劣化を引き起こしてしまうという問題がある。   However, with this control method, the bit amount of the remaining partition is basically calculated using only the bit amount being encoded, so the bit amount of the remaining partition can be accurately predicted. There is no problem. Therefore, an inappropriate quantization parameter is determined based on the prediction result. As a result, there is a problem that encoding is performed with an inappropriate quantization parameter, which causes a deterioration in image quality of the video frame.

ここで、特許文献2には、画質劣化を抑えながら、画像全体の総符号量を一定値以下に抑えることを目的とした技術が開示されている。特許文献2に開示の符号化方法は、フレーム間の動き検出結果の差分データの絶対値和に応じて、同一符号量制御範囲内の各フレームに割り当てる符号量の比率を変えるようにしている。また、この符号化方法は、符号化フレームに対して、画像の特徴を示すアクティビティから発生符号量の予測モデルを生成して、予測モデルに沿って符号化を行う。具体的には、発生符号量と予測モデルの差に基づいて参照スケーリングファクタを制御している。   Here, Patent Document 2 discloses a technique for the purpose of suppressing the total code amount of the entire image to a certain value or less while suppressing image quality deterioration. In the encoding method disclosed in Patent Document 2, the ratio of the code amount allocated to each frame within the same code amount control range is changed according to the absolute value sum of the difference data of the motion detection result between frames. In this encoding method, a prediction model of the generated code amount is generated from the activity indicating the feature of the image, and encoding is performed according to the prediction model. Specifically, the reference scaling factor is controlled based on the difference between the generated code amount and the prediction model.

しかし、特許文献2は、符号化途中のピクチャの未符号化領域の符号量を推定して、未符号化領域の符号量制御パラメタを決定する技術を開示したものではない。さらに、文献1、2ともに、生成したビットストリームのバッファ占有量については考慮されておらず、バッファオーバーフローあるいはバッファーアンダーフローを引き起こす恐れがある。   However, Patent Document 2 does not disclose a technique for estimating a code amount of an unencoded area of a picture that is being encoded and determining a code amount control parameter of the unencoded area. Furthermore, in both documents 1 and 2, the buffer occupation amount of the generated bitstream is not taken into consideration, and there is a possibility of causing a buffer overflow or a buffer underflow.

特開2007−166192号公報JP 2007-166192 A 特開平10−313463号公報JP-A-10-313463

背景技術として説明したように、特許文献1に開示の技術には、符号化したときにフレームの画質を劣化させてしまうという課題がある。   As described in the background art, the technique disclosed in Patent Document 1 has a problem that the image quality of a frame is deteriorated when encoding is performed.

本発明の第1の態様にかかる画像符号化装置は、複数のフレームからなる動画像データを符号化する画像符号化装置であって、前記フレームを符号化する符号化部と、前記符号化された符号化済みフレームの符号量と、前記符号化部による符号化途中である符号化中フレームに含まれる符号化済み領域の符号量とが格納される符号量記憶部と、前記符号量記憶部に格納された、符号化済みフレームの符号量及び符号化中フレームの符号量に基づき、前記符号化中フレームに含まれる未符号化領域の符号量を推定する符号量推定部と、前記推定された前記未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定する符号量制御部と、を備え、前記符号化部は、前記符号化中フレームに含まれる未符号化領域を、前記決定された符号量制御パラメタに基づいて符号化するものであって、前記符号量推定部は、前記符号化中フレームに時間的に近接する符号化済みフレームにおける、当該符号化中フレームに含まれる符号化済み領域及び未符号化領域のそれぞれに対応する領域の符号量である第1の符号量及び第2の符号量の比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を推定する、ものである。   An image encoding apparatus according to a first aspect of the present invention is an image encoding apparatus that encodes moving image data including a plurality of frames, and an encoding unit that encodes the frames; A code amount storage unit that stores a code amount of the encoded frame and a code amount of the encoded region included in the encoding frame that is being encoded by the encoding unit; and the code amount storage unit A code amount estimation unit that estimates a code amount of an unencoded area included in the frame being encoded based on the code amount of the encoded frame and the code amount of the frame that is being encoded, A code amount control unit that determines a code amount control parameter of the uncoded region based on a code amount of the uncoded region and a code amount that can be assigned to the uncoded region, The encoding unit includes the code An uncoded region included in a middle frame is coded based on the determined code amount control parameter, and the code amount estimation unit performs coding close in time to the frame being coded. Based on the ratio of the first code amount and the second code amount that are the code amounts of the regions corresponding to the encoded region and the unencoded region included in the encoded frame in the completed frame, The code amount of the uncoded region is estimated from the code amount of the encoded region.

本発明の第2の態様にかかる画像符号化方法は、複数のフレームからなる動画像データを符号化する画像符号化方法であって、前記フレームを符号化する符号化工程と、前記符号化された符号化済みフレームの符号量と、符号化途中である符号化中フレームに含まれる符号化済み領域の符号量とを符号量記憶部に格納する格納工程と、前記符号量記憶部に格納された、符号化済みフレームの符号量及び符号化中フレームの符号量に基づき、前記符号化中フレームに含まれる未符号化領域の符号量を推定する符号量推定工程と、前記推定された未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定するパラメタ決定工程と、を有し、前記符号量推定工程では、前記符号化中フレームに時間的に近接する符号化済みフレームにおける、当該符号化中フレームに含まれる符号化済み領域及び未符号化領域に対応する領域のそれぞれの符号量である第1の符号量及び第2の符号量の比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量が推定され、前記符号化工程では、前記符号化中フレームに含まれる未符号化領域が、前記決定された符号量制御パラメタに基づいて符号化される、ものである。   An image encoding method according to a second aspect of the present invention is an image encoding method for encoding moving image data including a plurality of frames, the encoding step for encoding the frames, and the encoding A storage step of storing in the code amount storage unit the code amount of the encoded frame and the code amount of the encoded region included in the encoding frame that is being encoded; A code amount estimating step of estimating a code amount of an unencoded area included in the frame being encoded based on a code amount of the encoded frame and a code amount of the frame being encoded; and the estimated uncoded A parameter determining step for determining a code amount control parameter for the unencoded region based on a code amount of the encoded region and a code amount that can be assigned to the uncoded region, and the code amount estimating step Then, the mark A first code amount that is a code amount of each of a region corresponding to an encoded region and an unencoded region included in the encoded frame in an encoded frame that is temporally adjacent to the encoded frame; 2, the code amount of the unencoded region is estimated from the code amount of the encoded region, and in the encoding step, the unencoded region included in the frame being encoded is The encoding is performed based on the determined code amount control parameter.

上述した本発明の第1及び第2の態様によれば、符号化中フレームと相関の高い符号化済みフレームの符号量分布を参考にして、未符号化領域の符号量を高い精度で推定することが可能となる。したがって、高い精度で推定された未符号化領域の符号量に基づいて、適切な符号量制御パラメタを決定することができる。   According to the first and second aspects of the present invention described above, the code amount of the uncoded region is estimated with high accuracy with reference to the code amount distribution of the encoded frame having a high correlation with the frame being encoded. It becomes possible. Therefore, an appropriate code amount control parameter can be determined based on the code amount of the uncoded region estimated with high accuracy.

本発明の第3の態様にかかる画像符号化装置は、複数のフレームからなる動画像データ、又は、1枚のフレームからなる静止画像データを符号化する画像符号化装置であって、符号化するフレームの特徴量を検出する特徴量検出部と、前記フレームを符号化する符号化部と、前記符号化部による符号化途中である符号化中フレームに含まれる符号化済み領域の符号量が格納される符号量記憶部と、前記検出された特徴量と、前記格納された符号量とに基づき、前記符号化中フレームに含まれる符号化領域の符号量を推定する符号量推定部と、前記推定された未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定する符号量制御部と、を備え、前記符号化部は、前記符号化中フレームに含まれる未符号化領域を、前記決定された符号量制御パラメタに基づいて符号化するものであって、前記符号量推定部は、前記符号化中フレームに含まれる符号化済み領域の特徴量と、前記符号化中フレームに含まれる未符号化領域の特徴量との比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を推定する、ものである。   An image encoding apparatus according to a third aspect of the present invention is an image encoding apparatus that encodes moving image data composed of a plurality of frames or still image data composed of a single frame, and encodes the encoded image data. Stores a feature amount detection unit that detects a feature amount of a frame, an encoding unit that encodes the frame, and a code amount of an encoded area included in a frame that is being encoded by the encoding unit. A code amount storage unit, a code amount estimation unit that estimates a code amount of a coding area included in the frame being encoded, based on the detected feature amount and the stored code amount, A code amount control unit that determines a code amount control parameter of the uncoded region based on the estimated code amount of the uncoded region and the code amount that can be assigned to the uncoded region; The encoding unit includes the A non-encoded area included in a frame being encoded is encoded based on the determined code amount control parameter, and the code amount estimation unit includes an encoded portion included in the frame being encoded Estimating the code amount of the unencoded region from the code amount of the encoded region based on the ratio between the feature amount of the region and the feature amount of the unencoded region included in the frame being encoded It is.

本発明の第4の態様にかかる画像符号化装置は、複数のフレームからなる動画像データを符号化する画像符号化装置であって、符号化するフレームの特徴量を検出する特徴量検出部と、前記フレームを符号化する符号化部と、前記符号化部による符号化途中である符号化中フレームに含まれる符号化済み領域の符号量が格納される符号量記憶部と、前記検出された特徴量と、前記格納された符号量とに基づき、前記符号化中フレームに含まれる符号化領域の符号量を推定する符号量推定部と、前記推定された未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定する符号量制御部と、を備え、前記符号化部は、前記符号化中フレームに含まれる未符号化領域を、前記決定された符号量制御パラメタに基づいて符号化するものであって、前記符号量推定部は、前記符号化中フレームに時間的に近接するフレームにおける、当該符号化中フレームに含まれる符号化済み領域及び未符号化領域のそれぞれに対応する領域の特徴量である第1の特徴量及び第2の特徴量の比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を推定する、ものである。   An image encoding device according to a fourth aspect of the present invention is an image encoding device that encodes moving image data including a plurality of frames, and a feature amount detection unit that detects a feature amount of a frame to be encoded. An encoding unit that encodes the frame, a code amount storage unit that stores a code amount of an encoded region included in the encoding frame that is being encoded by the encoding unit, and the detected A code amount estimation unit that estimates a code amount of an encoded region included in the frame being encoded based on a feature amount and the stored code amount; and a code amount of the estimated unencoded region; A code amount control unit that determines a code amount control parameter of the uncoded region based on a code amount that can be assigned to the uncoded region, and the coding unit The included uncoded area The encoding is performed based on the determined code amount control parameter, and the code amount estimation unit is encoded in a frame being encoded in a frame that is temporally close to the frame being encoded Based on the ratio of the first feature value and the second feature value, which are the feature values of the region corresponding to each of the region and the uncoded region, the code of the uncoded region from the code amount of the coded region The amount is to be estimated.

本発明の第5の態様にかかる画像符号化方法は、複数のフレームからなる動画像データ、又は、1枚のフレームからなる静止画像データを符号化する画像符号化方法であって、符号化するフレームの特徴量を検出する特徴量検出工程と、前記フレームを符号化する符号化工程と、符号化途中のフレームである符号化中フレームに含まれる符号化済み領域の符号量を符号量記憶部に格納する格納工程と、前記特徴量検出工程にて検出された特徴量と、前記符号量記憶部に格納された符号量とに基づき、前記符号化中フレームに含まれる未符号化領域の符号量を推定する符号量推定工程と、前記推定された未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定するパラメタ決定工程と、を有し、前記符号量推定工程では、前記符号化中フレームに含まれる符号化済み領域の特徴量と、前記符号化中フレームに含まれる未符号化領域の特徴量との比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量が推定され、前記符号化工程では、前記符号化中フレームに含まれる未符号化領域が、前記パラメタ決定工程にて決定された符号量制御パラメタに基づいて符号化される、ものである。   An image encoding method according to a fifth aspect of the present invention is an image encoding method for encoding moving image data consisting of a plurality of frames or still image data consisting of a single frame. A code amount storage unit that stores a feature amount detection step of detecting a feature amount of a frame, an encoding step of encoding the frame, and a code amount of an encoded area included in a frame being encoded that is a frame in the middle of encoding Based on the storage step stored in the feature amount, the feature amount detected in the feature amount detection step, and the code amount stored in the code amount storage unit. A code amount estimation step for estimating the amount, a code amount control parameter for the uncoded region based on the estimated code amount of the uncoded region and a code amount that can be assigned to the uncoded region. Para to decide And determining the feature amount of the encoded region included in the frame being encoded and the feature amount of the unencoded region included in the frame being encoded. Based on the ratio, the code amount of the unencoded region is estimated from the code amount of the encoded region, and in the encoding step, the uncoded region included in the frame being encoded is the parameter determining step. Is encoded based on the code amount control parameter determined in (1).

上述した本発明の第3乃至第5の態様によれば、符号化中フレームの符号量分布と相関の高い、符号化済みフレーム又は符号化中フレームの特徴量分布を参考にして、未符号化領域の符号量を高い精度で推定することが可能となる。したがって、高い精度で推定された未符号化領域の符号量に基づいて、適切な符号量制御パラメタを決定することができる。   According to the third to fifth aspects of the present invention described above, unencoded with reference to the feature amount distribution of the encoded frame or the encoded frame that has a high correlation with the encoded amount distribution of the encoded frame. It is possible to estimate the code amount of the region with high accuracy. Therefore, an appropriate code amount control parameter can be determined based on the code amount of the uncoded region estimated with high accuracy.

上述した本発明の各態様によれば、符号化したときにおけるフレームの画質の劣化を抑制することができる画像符号化装置及び画像符号化方法を提供することができる。   According to each aspect of the present invention described above, it is possible to provide an image encoding device and an image encoding method capable of suppressing deterioration in image quality of a frame when encoded.

本発明の実施の形態1にかかる画像符号化装置の構成図である。It is a block diagram of the image coding apparatus concerning Embodiment 1 of this invention. 本発明の実施の形態1にかかる画像符号化装置による画像符号化処理タイミングを示す図である。It is a figure which shows the image coding process timing by the image coding apparatus concerning Embodiment 1 of this invention. 図2の時刻tにおけるピクチャの符号化処理状況を示す図である。FIG. 3 is a diagram illustrating a picture encoding process status at time t in FIG. 2. ピクチャの構成を示す図である。It is a figure which shows the structure of a picture. 本発明の実施の形態1にかかる1ピクチャ内の発生符号量の分布の一例を模式的に示した図である。It is the figure which showed typically an example of distribution of the generated code amount in 1 picture concerning Embodiment 1 of this invention. 本発明の実施の形態1にかかる未符号化領域の符号量推定方法を説明するための図である。It is a figure for demonstrating the code amount estimation method of the uncoded area | region concerning Embodiment 1 of this invention. 本発明の実施の形態1にかかる画像符号化装置の処理を示すフローチャートである。It is a flowchart which shows the process of the image coding apparatus concerning Embodiment 1 of this invention. 本発明の実施の形態2にかかる画像符号化装置の構成図である。It is a block diagram of the image coding apparatus concerning Embodiment 2 of this invention. 本発明の実施の形態2にかかる未符号化領域の符号量推定方法を説明するための図である。It is a figure for demonstrating the code amount estimation method of the uncoded area | region concerning Embodiment 2 of this invention. 本発明の実施の形態2にかかる画像符号化装置の処理を示すフローチャートである。It is a flowchart which shows the process of the image coding apparatus concerning Embodiment 2 of this invention. 本発明の実施の形態3にかかる画像符号化装置の構成図である。It is a block diagram of the image coding apparatus concerning Embodiment 3 of this invention. 本発明の実施の形態3にかかる画像符号化装置の処理を示すフローチャートである。It is a flowchart which shows the process of the image coding apparatus concerning Embodiment 3 of this invention. 本発明の実施の形態4にかかる画像符号化装置の構成図である。It is a block diagram of the image coding apparatus concerning Embodiment 4 of this invention. 本発明の実施の形態4にかかる動きがある場合における未符号化領域の符号量推定方法を説明するための図である。It is a figure for demonstrating the code amount estimation method of an unencoded area | region when there exists a motion concerning Embodiment 4 of this invention. 本発明の実施の形態4にかかる動きがある場合における未符号化領域の符号量推定方法を説明するための図である。It is a figure for demonstrating the code amount estimation method of an unencoded area | region when there exists a motion concerning Embodiment 4 of this invention. 本発明の実施の形態4にかかる画像符号化装置の処理を示すフローチャートである。It is a flowchart which shows the process of the image coding apparatus concerning Embodiment 4 of this invention. 本発明の実施の形態4にかかる動きがある場合における未符号化領域の符号量推定方法を説明するための図である。It is a figure for demonstrating the code amount estimation method of an unencoded area | region when there exists a motion concerning Embodiment 4 of this invention. 本発明の実施の形態4にかかる動きがある場合における未符号化領域の符号量推定方法を説明するための図である。It is a figure for demonstrating the code amount estimation method of an unencoded area | region when there exists a motion concerning Embodiment 4 of this invention. 本発明の実施の形態5にかかる画像符号化装置の構成図である。It is a block diagram of the image coding apparatus concerning Embodiment 5 of this invention. 本発明の実施の形態5にかかるバッファ占有量の推定方法によって推定されたデコーダ側の仮想バッファのバッファ占有量を示す図である。It is a figure which shows the buffer occupation amount of the virtual buffer by the side of the decoder estimated by the estimation method of the buffer occupation amount concerning Embodiment 5 of this invention. 本発明の実施の形態6にかかる画像符号化装置の構成図である。It is a block diagram of the image coding apparatus concerning Embodiment 6 of this invention. 動画符号化規格における1ピクチャのビットストリームの構成を示す図である。It is a figure which shows the structure of the bit stream of 1 picture in a moving image encoding standard. 推定されたデコーダ側の仮想バッファのバッファ占有量の推移と、実際のデコーダ側の仮想バッファのバッファ占有量の推移とを示す図である。It is a figure which shows transition of the buffer occupancy of the estimated virtual buffer of the decoder side, and transition of the buffer occupancy of the actual virtual buffer of the decoder side. 本発明の実施の形態7にかかる画像符号化装置の構成図である。It is a block diagram of the image coding apparatus concerning Embodiment 7 of this invention. 本発明の他の実施の形態にかかる未符号化領域の符号量推定方法を説明するための図である。It is a figure for demonstrating the code amount estimation method of the uncoded area | region concerning other embodiment of this invention. 本発明の他の実施の形態にかかる未符号化領域の符号量推定方法を説明するための図である。It is a figure for demonstrating the code amount estimation method of the uncoded area | region concerning other embodiment of this invention.

発明の実施の形態1.
図1を参照して、本発明の実施の形態1にかかる画像符号化装置1の構成について説明する。図1は、本発明の実施の形態1にかかる画像符号化装置1の構成図である。
Embodiment 1 of the Invention
With reference to FIG. 1, the structure of the image coding apparatus 1 concerning Embodiment 1 of this invention is demonstrated. FIG. 1 is a configuration diagram of an image encoding device 1 according to the first embodiment of the present invention.

画像符号化装置1は、フレームバッファ10、発生符号量記憶装置11、発生符号量予測装置12、符号量制御装置13、ストリーム結合装置14、エンコーダ30〜33、及びストリームバッファ40〜43を有する。画像符号化装置1は、複数のフレームからなる動画像データを符号化する。画像符号化装置1には、動画像データを構成する複数のフレームのそれぞれが入力画像として順次入力される。以下、フレームを「ピクチャ」又は「画像」とも言う。   The image encoding device 1 includes a frame buffer 10, a generated code amount storage device 11, a generated code amount prediction device 12, a code amount control device 13, a stream combination device 14, encoders 30 to 33, and stream buffers 40 to 43. The image encoding device 1 encodes moving image data including a plurality of frames. Each of a plurality of frames constituting moving image data is sequentially input to the image encoding device 1 as an input image. Hereinafter, the frame is also referred to as “picture” or “image”.

画像符号化装置1は、例えば、動画像を符号化して記憶媒体に記憶するレコーダ、地上波デジタル放送番組の動画像を符号化して送信するデジタル放送送信装置、動画像を符号化して他のテレビ電話に送信するテレビ電話等に含まれる。記憶媒体は、例えば、メモリ、ハードディスク、及び光ディスク等である。   The image encoding device 1 is, for example, a recorder that encodes a moving image and stores it in a storage medium, a digital broadcast transmission device that encodes and transmits a moving image of a terrestrial digital broadcast program, and encodes a moving image to another television set. Included in video-phone calls that are sent to the phone. The storage medium is, for example, a memory, a hard disk, an optical disk, or the like.

フレームバッファ10は、画像符号化装置1に入力された入力画像が一時的に記憶される。フレームバッファ10は、入力画像を記憶するための任意の記憶装置を含む。ここで、記憶装置とは、例えば、メモリ及びハードディスク等である。   The frame buffer 10 temporarily stores an input image input to the image encoding device 1. The frame buffer 10 includes an arbitrary storage device for storing an input image. Here, the storage device is, for example, a memory and a hard disk.

発生符号量記憶装置11は、符号化済みの画像の発生符号量と、符号化途中の画像の符号化済み領域の発生符号量とが記憶される。発生符号量は、1画像を予め定めた大きさに分割した単位毎に記憶される。発生符号量記憶装置11は、発生符号量を記憶するための任意の記憶装置を含む。   The generated code amount storage device 11 stores the generated code amount of the encoded image and the generated code amount of the encoded region of the image being encoded. The generated code amount is stored for each unit obtained by dividing one image into a predetermined size. The generated code amount storage device 11 includes an arbitrary storage device for storing the generated code amount.

発生符号量予測装置12は、符号化済みの画像の発生符号量と、符号化途中の画像の符号化済み領域の発生符号量とに基づいて、符号化途中の画像の未符号化領域の発生符号量を推定する。   The generated code amount prediction device 12 generates an unencoded area of the image being encoded based on the generated code amount of the encoded image and the generated code amount of the encoded area of the image being encoded. Estimate the code amount.

符号量制御装置13は、推定された未符号化領域の発生符号量に基づいて、予め指定されたビットレートを達成するようにエンコーダ30〜33に対して指定する符号量制御パラメタを計算する。符号量制御装置13は、計算した符号量制御パラメタをエンコーダ30〜33に対して指定する。   The code amount control device 13 calculates a code amount control parameter designated for the encoders 30 to 33 so as to achieve a bit rate designated in advance based on the estimated generated code amount of the uncoded region. The code amount control device 13 specifies the calculated code amount control parameter for the encoders 30 to 33.

ストリーム結合装置14は、ストリームバッファ40〜43のそれぞれに記憶されたビットストリームを指定の順序で結合して1つのビットストリームを生成する。ストリーム結合装置14は、生成したビットストリームを画像符号化装置1の外部に出力する。   The stream combining device 14 combines the bit streams stored in the stream buffers 40 to 43 in a specified order to generate one bit stream. The stream combining device 14 outputs the generated bit stream to the outside of the image encoding device 1.

エンコーダ30〜33のそれぞれは、符号化対象として指定された入力画像をフレームバッファ10から読み出して符号化する。エンコーダ30〜33のそれぞれは、符号量制御装置13から指定された符号量制御パラメタに応じた符号量で入力画像を符号化する。エンコーダ30〜33のそれぞれは、入力画像を符号化したデータを含むビットストリームを生成する。エンコーダ30〜33のそれぞれは、ビットストリームをストリームバッファ40〜43のそれぞれに記憶する。エンコーダ30〜33のそれぞれは、例えば、MPEG−2又はH.264等の動画像符号化規格において規定されている符号化方式によって入力画像を符号化する。   Each of the encoders 30 to 33 reads an input image designated as an encoding target from the frame buffer 10 and encodes it. Each of the encoders 30 to 33 encodes an input image with a code amount corresponding to a code amount control parameter designated by the code amount control device 13. Each of the encoders 30 to 33 generates a bit stream including data obtained by encoding an input image. Each of the encoders 30 to 33 stores the bit stream in each of the stream buffers 40 to 43. Each of the encoders 30 to 33 is, for example, MPEG-2 or H.264. An input image is encoded by an encoding method defined in a moving image encoding standard such as H.264.

ストリームバッファ40〜43のそれぞれは、エンコーダ30〜33のそれぞれから出力されたビットストリームを一時的に記憶する。具体的には、ストリームバッファ40はエンコーダ30によって生成されたビットストリームを記憶し、ストリームバッファ41はエンコーダ31によって生成されたビットストリームを記憶し、ストリームバッファ42はエンコーダ32によって生成されたビットストリームを記憶し、ストリームバッファ43はエンコーダ33によって生成されたビットストリームを記憶する。   Each of the stream buffers 40 to 43 temporarily stores a bit stream output from each of the encoders 30 to 33. Specifically, the stream buffer 40 stores the bit stream generated by the encoder 30, the stream buffer 41 stores the bit stream generated by the encoder 31, and the stream buffer 42 stores the bit stream generated by the encoder 32. The stream buffer 43 stores the bit stream generated by the encoder 33.

続いて、図2を参照して、本発明の実施の形態1にかかる画像符号化装置1による画像符号化処理タイミングについて説明する。図2は、本発明の実施の形態1にかかる画像符号化装置1による画像符号化処理タイミングを示す図である。図2は、4つのエンコーダ30〜33が、時分割に並列して入力画像の符号化処理を行う場合について示している。   Next, with reference to FIG. 2, the image encoding processing timing by the image encoding device 1 according to the first embodiment of the present invention will be described. FIG. 2 is a diagram illustrating image encoding processing timing by the image encoding device 1 according to the first embodiment of the present invention. FIG. 2 shows a case where the four encoders 30 to 33 perform input image encoding processing in parallel with time division.

図2に示すように、本実施の形態1では、動画像に含まれる複数のピクチャ1〜9のそれぞれは、符号化順にエンコーダ30〜33のそれぞれに順番に割り当てられる。ここで、ピクチャ1〜9は、符号化順序は、ピクチャ1、ピクチャ2、・・・、ピクチャ9の順番であるものとする。また、ピクチャ9に後続するピクチャの図示及び説明は省略する。具体的には、エンコーダ30にはピクチャ1、5及び9が割り当てられ、エンコーダ31にはピクチャ2及び6が割り当てられ、エンコーダ32にはピクチャ3及び7が割り当てられ、エンコーダ33にはピクチャ4及び8が割り当てられる。エンコーダ30〜33のそれぞれは、割り当てられたピクチャを符号化する。言い換えると、割り当てられたピクチャとは、符号化対象として指定されたピクチャである。   As shown in FIG. 2, in the first embodiment, each of the plurality of pictures 1 to 9 included in the moving image is sequentially assigned to each of the encoders 30 to 33 in the encoding order. Here, the encoding order of pictures 1 to 9 is assumed to be the order of picture 1, picture 2,. Further, illustration and description of a picture subsequent to the picture 9 are omitted. Specifically, pictures 1, 5, and 9 are assigned to the encoder 30, pictures 2 and 6 are assigned to the encoder 31, pictures 3 and 7 are assigned to the encoder 32, and pictures 4 and 6 are assigned to the encoder 33. 8 is assigned. Each of the encoders 30 to 33 encodes the assigned picture. In other words, the assigned picture is a picture designated as an encoding target.

以下、図2について具体的に説明する。時刻t0で、エンコーダ30は、フレームバッファ10からピクチャ1を取得して、取得したピクチャ1の符号化を開始する。以降、時刻t0からピクチャ入力間隔経過する毎の時刻をt1〜t8として示す。なお、ピクチャ入力間隔は、予め任意に定められる。   Hereinafter, FIG. 2 will be described in detail. At time t0, the encoder 30 acquires picture 1 from the frame buffer 10 and starts encoding the acquired picture 1. Hereafter, the times when the picture input interval elapses from time t0 are indicated as t1 to t8. Note that the picture input interval is arbitrarily determined in advance.

時刻t1で、エンコーダ31は、フレームバッファ10からピクチャ2を取得して、取得したピクチャ2の符号化を開始する。時刻t2で、エンコーダ32は、フレームバッファ10からピクチャ3を取得して、取得したピクチャ3の符号化を開始する。時刻t3で、エンコーダ33は、フレームバッファ10からピクチャ4を取得して、取得したピクチャ4の符号化を開始する。   At time t1, the encoder 31 acquires picture 2 from the frame buffer 10 and starts encoding of the acquired picture 2. At time t2, the encoder 32 acquires the picture 3 from the frame buffer 10 and starts encoding the acquired picture 3. At time t3, the encoder 33 acquires the picture 4 from the frame buffer 10 and starts encoding the acquired picture 4.

ここで、1つのエンコーダで、1ピクチャを符号化する時間は、ピクチャ入力間隔の4倍未満の時間がかかるものとする。よって、時刻t4では、時刻t0から開始したエンコーダ30によるピクチャ1の符号化は終了していることになる。   Here, it is assumed that the time for encoding one picture with one encoder takes less than four times the picture input interval. Therefore, at time t4, encoding of picture 1 by the encoder 30 started from time t0 is completed.

そのため、時刻t4で、エンコーダ30は、フレームバッファ10からピクチャ5を取得して、取得したピクチャ5の符号化を開始する。以降も同様にして、ピクチャ入力間隔が経過する毎に、時刻5でエンコーダ31によるピクチャ6の符号化が開始され、時刻6でエンコーダ32によるピクチャ7の符号化が開始され、時刻7でエンコーダ33によるピクチャ8の符号化が開始され、時刻t8でエンコーダ30によるピクチャ9の符号化が開始される。このようにして、エンコーダ30〜33は、ピクチャ1〜9のそれぞれを並列に符号化していく。   Therefore, at time t4, the encoder 30 acquires the picture 5 from the frame buffer 10 and starts encoding the acquired picture 5. Similarly, every time the picture input interval elapses, encoding of picture 6 by the encoder 31 is started at time 5, encoding of picture 7 by the encoder 32 is started at time 6, and encoder 33 is started at time 7. Encoding of picture 8 is started, and encoding of picture 9 by encoder 30 is started at time t8. In this way, the encoders 30 to 33 encode each of the pictures 1 to 9 in parallel.

なお、エンコーダ30〜33に対するピクチャの割り当て順序は、図2に例示した順序に限定されない。本実施の形態1では、図2に例示したように、エンコーダ30、31、32、33の順にサイクリックにピクチャを割り当てるようにしているが、これ以外の順序で、エンコーダ30〜33にピクチャを割り当てるようにしてもよい。   Note that the order in which pictures are assigned to the encoders 30 to 33 is not limited to the order illustrated in FIG. In the first embodiment, as illustrated in FIG. 2, pictures are cyclically assigned in the order of encoders 30, 31, 32, and 33. However, pictures are assigned to encoders 30 to 33 in other orders. You may make it allocate.

また、上述したように、エンコーダ30〜33のそれぞれに符号化対象のピクチャを割り当てて、エンコーダ30〜33のそれぞれが割り当てられたピクチャを符号化する構成は、どのように実現しても良い。一例としては、画像符号化装置1に入力画像を符号化順に入力するようにして、フレームバッファ10に入力順に入力画像がキューイングされるようにする。そして、エンコーダ30〜33のそれぞれが順番に、フレームバッファ10から入力画像を取り出すようにする。   Further, as described above, the configuration in which the picture to be encoded is assigned to each of the encoders 30 to 33 and the picture to which each of the encoders 30 to 33 is assigned may be realized in any way. As an example, the input images are input to the image encoding device 1 in the encoding order, and the input images are queued in the frame buffer 10 in the input order. Then, each of the encoders 30 to 33 sequentially takes out the input image from the frame buffer 10.

続いて、図3を参照して、図2の時刻tにおけるピクチャの符号化処理状況について説明する。図3は、図2の時刻tにおけるピクチャの符号化処理状況を示す図である。時刻tは、エンコーダ30によるピクチャ5の符号化の終了後、エンコーダ30によるピクチャ9の符号化の開始前の時刻である。   Next, with reference to FIG. 3, the picture encoding process status at time t in FIG. 2 will be described. FIG. 3 is a diagram illustrating a picture encoding process status at time t in FIG. The time t is a time after the encoding of the picture 5 by the encoder 30 is finished and before the encoding of the picture 9 by the encoder 30 is started.

図3は、図2の時刻tにおけるピクチャ5〜9のそれぞれの符号化処理状況を示している。図3において、ピクチャ中のハッチング領域は、符号化済み領域を示し、ピクチャ中のハッチングをしていない無地の領域は、未符号化領域を示す。このように、符号化途中のある瞬間では、符号化途中のピクチャ5〜8のそれぞれにおいて、符号化済み領域及び未符号化領域の大きさは、それぞれ異なる。   FIG. 3 shows the encoding processing status of each of the pictures 5 to 9 at time t in FIG. In FIG. 3, a hatched area in a picture indicates an encoded area, and a plain area not hatched in a picture indicates an uncoded area. In this way, at a certain moment in the middle of encoding, the size of the encoded region and the unencoded region are different in each of the pictures 5 to 8 being encoded.

続いて、図4を参照して、ピクチャの構成について説明する。図4は、ピクチャの構成を示す図である。   Next, the picture configuration will be described with reference to FIG. FIG. 4 is a diagram illustrating the configuration of a picture.

図4に示すように、1枚のピクチャは、符号化が行われる際に、複数のマクロブロックに分割されて、マクロブロック単位で符号化されていく。なお、動画像符号化規格のH.264においては、上下に隣接する2つのマクロブロックを組にしたマクロブロックペア単位で、ピクチャが符号化されることもある。よって、マクロブロックペア単位で符号化していくようにしてもよい。   As shown in FIG. 4, one picture is divided into a plurality of macroblocks and encoded in units of macroblocks when encoding is performed. Note that H.264 of the moving image coding standard. In H.264, a picture may be encoded in units of a macroblock pair in which two macroblocks adjacent in the vertical direction are paired. Therefore, encoding may be performed in units of macroblock pairs.

ここで、本実施の形態1では、マクロブロックの水平方向1列分毎の発生符号量が発生符号量記憶装置11に記憶されていくものとする。以下、マクロブロックの水平方向1列分の単位を「マクロブロックライン」と言う。つまり、エンコーダ30〜33のそれぞれは、マクロブロックラインを符号化する毎に、そのマクロブロックラインにおける発生符号量を発生符号量記憶装置11に記憶する。エンコーダ30〜33のそれぞれは、例えば、マクロブロックを符号化する毎に、符号化によって発生した1マクロブロック当たりの符号量を累積加算していき、1マクロブロックライン当たりの発生符号量を算出する。   Here, in the first embodiment, it is assumed that the generated code amount for each column in the horizontal direction of the macroblock is stored in the generated code amount storage device 11. Hereinafter, a unit of one column in the horizontal direction of the macroblock is referred to as a “macroblock line”. That is, each time the encoders 30 to 33 encode a macroblock line, the generated code amount in the macroblock line is stored in the generated code amount storage device 11. Each of the encoders 30 to 33, for example, every time a macroblock is encoded, the code amount per macroblock generated by encoding is cumulatively added, and the generated code amount per macroblock line is calculated. .

また、マクロブロックペアの水平方向1列分毎の発生符号量が発生符号量記憶装置11に記憶されていくようにしてもよい。以下、マクロブロックペアの水平方向1列分の単位を「マクロブロックペアライン」と言う。この場合、エンコーダ30〜33のそれぞれは、マクロブロックペアラインを符号化する毎に、そのマクロブロックペアラインにおける発生符号量を発生符号量記憶装置11に記憶する。エンコーダ30〜33のそれぞれは、例えば、マクロブロックペアを符号化する毎に、符号化によって発生した1マクロブロックペア当たりの符号量を累積加算していき、1マクロブロックペアライン当たりの発生符号量を算出する。なお、本実施の形態では、図4に示すように、1枚のピクチャにマクロブロックがNラインある場合について例示する。ここで、Nは、任意の正整数である。   Further, the generated code amount for each horizontal column of the macroblock pair may be stored in the generated code amount storage device 11. Hereinafter, a unit of one column in the horizontal direction of the macroblock pair is referred to as a “macroblock pair line”. In this case, each of the encoders 30 to 33 stores the generated code amount in the macroblock pair line in the generated code amount storage device 11 every time the macroblock pair line is encoded. Each of the encoders 30 to 33, for example, every time a macroblock pair is encoded, the code amount per macroblock pair generated by encoding is cumulatively added, and the generated code amount per macroblock pair line, for example. Is calculated. In the present embodiment, as shown in FIG. 4, a case where there are N lines of macroblocks in one picture is illustrated. Here, N is an arbitrary positive integer.

続いて、図5を参照して、1ピクチャ内の発生符号量の分布の一例について説明する。図5は、本発明の実施の形態1にかかる1ピクチャ内の発生符号量の分布の一例を模式的に示した図である。   Next, an example of the distribution of the generated code amount in one picture will be described with reference to FIG. FIG. 5 is a diagram schematically illustrating an example of a generated code amount distribution in one picture according to the first embodiment of the present invention.

一般的に、1ピクチャ内における画素値は、一様ではなく、単調な変化をしているわけでもない。よって、符号化済みのピクチャ内における符号量も、一様ではなく、単調な変化をしない場合がある。図5に例示するように、1ピクチャ内で、符号化による発生符号量が、前半のマクロブロックラインと後半のマクロブロックラインとで大きく異なってしまうものも存在する。このような画像では、例えば、第iマクロブロックラインまで符号化が済んでおり、第iマクロブロックラインまでの発生符号量が分かっていたとしても、それ以降に符号化される第i+1マクロブロックライン〜第Nマクロブロックラインにおける発生符号量を、第iマクロブロックラインまでの符号化済み領域の発生符号量のみから予測することは困難である。ここで、iは、N以下の正整数である。   In general, pixel values in one picture are not uniform and do not change monotonously. Therefore, the code amount in the encoded picture is not uniform and does not change monotonously. As illustrated in FIG. 5, there is a case where the amount of code generated by encoding differs greatly between the first half macroblock line and the second half macroblock line within one picture. In such an image, for example, even if the encoding has been completed up to the i-th macroblock line and the generated code amount up to the i-th macroblock line is known, the i + 1-th macroblock line to be encoded thereafter It is difficult to predict the generated code amount in the Nth macroblock line only from the generated code amount in the encoded area up to the i-th macroblock line. Here, i is a positive integer less than or equal to N.

続いて、図6を参照して、本発明の実施の形態1にかかる未符号化領域の符号量推定方法について説明する。図6は、本発明の実施の形態1にかかる未符号化領域の符号量推定方法を説明するための図である。   Next, with reference to FIG. 6, a code amount estimation method for an uncoded region according to the first embodiment of the present invention will be described. FIG. 6 is a diagram for explaining the code amount estimation method for an uncoded region according to the first embodiment of the present invention.

一般的に、動画像を構成する画像が、時間的に近い画像であれば相関が高く、画像内の発生符号量分布も類似していることが知られている。そこで、本実施の形態1にかかる発生符号量予測装置12は、符号化途中のピクチャの未符号化領域の発生符号量を、符号化途中のピクチャの符号化済み領域における発生符号量と、直前に符号化が終了した符号化済みピクチャの発生符号量から推定する。図2を参照して説明すると、発生符号量予測装置12は、例えば、ピクチャ5を符号化しているときは、直前の符号化済みピクチャ1の符号発生量から、ピクチャ5の未符号化領域の符号量を推定する。以下、符号化途中のピクチャを「符号化途中ピクチャ」と言い、符号化済みのピクチャを「符号化済みピクチャ」と言う。   In general, it is known that if an image constituting a moving image is an image close in time, the correlation is high, and the generated code amount distribution in the image is similar. Therefore, the generated code amount prediction apparatus 12 according to the first embodiment determines the generated code amount in the unencoded area of the picture being encoded, the generated code amount in the encoded area of the picture being encoded, and the immediately preceding code amount. Is estimated from the generated code amount of the encoded picture that has been encoded. Referring to FIG. 2, for example, when the generated code amount prediction device 12 encodes picture 5, the generated code amount prediction device 12 calculates the uncoded region of picture 5 from the code generation amount of the immediately previous encoded picture 1. Estimate the code amount. Hereinafter, a picture in the middle of encoding is referred to as a “picture in progress”, and a picture that has been encoded is referred to as a “coded picture”.

例えば、図6に例示するように、符号化途中ピクチャのaで示す範囲まで符号化が進んでいるものとする。図6に示すbは、符号化途中ピクチャ全体の垂直方向の長さNから、符号化済み領域の垂直方向の長さaを差し引いた長さである。つまり、N=a+bが成立する。ここで、aはN以下の正整数であり、bはN以下の正整数である。よって、符号化途中ピクチャのaで示す範囲は、符号化済み領域であり、符号化途中ピクチャのbで示す範囲は、未符号化領域である。言い換えると、符号化途中ピクチャのaで示す範囲に含まれるマクロブロックラインは、符号化されており、符号化途中ピクチャのbで示す範囲に含まれるマクロブロックラインは、符号化されていない。また、Nは1ピクチャ中のマクロブロックライン数であるため、aは、符号化済み領域に含まれるマクロブロックライン数となり、bは、未符号化領域に含まれるマクロブロックライン数となる。   For example, as illustrated in FIG. 6, it is assumed that the encoding has progressed to the range indicated by “a” in the middle of encoding. B shown in FIG. 6 is a length obtained by subtracting the vertical length a of the encoded region from the vertical length N of the entire picture being encoded. That is, N = a + b is established. Here, a is a positive integer less than or equal to N, and b is a positive integer less than or equal to N. Therefore, the range indicated by a in the picture being encoded is an encoded area, and the range indicated by b in the picture being encoded is an uncoded area. In other words, the macroblock line included in the range indicated by a in the mid-coding picture is encoded, and the macroblock line included in the range indicated by b in the mid-encoding picture is not encoded. Since N is the number of macroblock lines in one picture, a is the number of macroblock lines included in the encoded area, and b is the number of macroblock lines included in the uncoded area.

このときに、符号化途中ピクチャの符号化済み領域の発生符号量がSaである場合、符号化途中の未符号化領域の発生符号量Sbを次式(1)によって推定する。ここで、S'aは、符号化済みピクチャのaで示す範囲の発生符号量であり、S'bは、符号化済みピクチャのbで示す範囲の発生符号量である。つまり、S'aは、符号化済みピクチャのうち、符号化途中ピクチャの符号化済み領域に対応する領域の発生符号量であり、S'bは、符号化済みピクチャのうち、符号化途中ピクチャの未符号化領域に対応する領域の発生符号量である。ここでは、符号化済み領域と、符号化済み領域に対応する領域は、ピクチャ中の同一位置における同一面積の領域となり、未符号化領域と、未符号化領域に対応する領域も、ピクチャ中の同一位置における同一面積の領域となる。   At this time, when the generated code amount of the encoded area of the picture being encoded is Sa, the generated code quantity Sb of the uncoded area being encoded is estimated by the following equation (1). Here, S′a is the generated code amount in the range indicated by a of the encoded picture, and S′b is the generated code amount in the range indicated by b of the encoded picture. That is, S′a is the generated code amount of the area corresponding to the encoded area of the halfway encoded picture among the encoded pictures, and S′b is the halfway encoded picture among the encoded pictures. This is a generated code amount in a region corresponding to the uncoded region. Here, the encoded region and the region corresponding to the encoded region are regions of the same area at the same position in the picture, and the uncoded region and the region corresponding to the uncoded region are also included in the picture. It becomes the area | region of the same area in the same position.

Figure 0005706759
Figure 0005706759

上述したように、時間的に近いピクチャ同士であれば、ピクチャ内の発生符号量分布は、相互に類似している。また、ここでは、符号化済みピクチャとして、直前に符号化が終了した符号化済みピクチャを使用している。つまり、この符号化済みピクチャと符号化途中ピクチャとは、時間的に近いピクチャ同士となる。よって、符号化途中ピクチャの符号化済み領域の発生符号量Saと、符号化途中ピクチャの未符号化領域の発生符号量Sbとの比率は、符号化済みピクチャのうち、符号化途中ピクチャの符号化済み領域に対応する領域の発生符号量S'aと、符号化済みピクチャのうち、符号化途中ピクチャの未符号化領域に対応する領域の発生符号量S'bとの比率と類似することになる。そのため、式(1)によって、Sa及びSbの比率が、S'a及びS'bの比率と同じとなるように、SaからSbを算出することで、符号化済みピクチャの未符号化領域の発生符号量を高い精度で推定することができる。以下、Sbを「推定符号量」とも言う。   As described above, if the pictures are close in time, the generated code amount distributions in the pictures are similar to each other. Here, an encoded picture that has been encoded immediately before is used as the encoded picture. In other words, the encoded picture and the encoded picture are pictures close in time. Therefore, the ratio between the generated code amount Sa of the encoded area of the picture being encoded and the generated code amount Sb of the uncoded area of the encoded picture is the code of the encoded picture of the encoded pictures. Similar to the ratio between the generated code amount S′a of the region corresponding to the encoded region and the generated code amount S′b of the region corresponding to the uncoded region of the encoded picture among the encoded pictures become. Therefore, by calculating Sb from Sa so that the ratio of Sa and Sb is the same as the ratio of S′a and S′b by Equation (1), the unencoded area of the encoded picture The generated code amount can be estimated with high accuracy. Hereinafter, Sb is also referred to as “estimated code amount”.

ここで、本実施の形態1では、発生符号量の推定に使用する符号化済みピクチャとして、直前に符号化が終了した符号化済みピクチャを使用する場合について例示するが、これに限られない。上述したように、符号化途中ピクチャと時間的に近接した符号化済みピクチャであれば、符号化途中ピクチャとの相関は高い。そのため、直前に符号化が終了した符号化済みピクチャ以外の符号化途中ピクチャと時間的に近接した符号化済みピクチャを使用するようにしてもよい。   Here, in the first embodiment, a case where an encoded picture that has been encoded immediately before is used as an encoded picture used for estimation of the generated code amount is exemplified, but the present invention is not limited to this. As described above, an encoded picture that is close in time to an encoding-in-progress picture has a high correlation with the encoding-in-progress picture. For this reason, an encoded picture that is temporally close to an in-encoding picture other than the encoded picture that has been encoded immediately before may be used.

例えば、符号化途中ピクチャに時間的に近接した符号化済みピクチャとして、符号化途中ピクチャより所定数前に符号化が開始されたピクチャまでの範囲に含まれる符号化済みピクチャのいずれかを使用するようにしてもよい。また、MPEG−2又はH.264等の動画像符号化規格のように、ピクチャの符号化順序と、ピクチャの再生順序とが必ずしも一致しない場合もある。そのような場合、ピクチャの再生順序が分かるのであれば、それに基づいて使用する符号化済みピクチャを決定するようにしてもよい。例えば、符号化途中ピクチャと時間的に近接した符号化済みピクチャとして、符号化途中ピクチャより所定数前又は後に再生されるピクチャまでの範囲に含まれる符号化済みピクチャのいずれかを使用するようにしてもよい。なお、そのような動画像符号化規格であっても、符号化順序と再生順序とは大きくことなることはないため、どちらの順序に基づいて、使用する符号化済みピクチャを決定するようにしてもよい。   For example, any of the encoded pictures included in the range up to a picture started to be encoded a predetermined number of times before the in-encoding picture is used as an encoded picture that is temporally close to the in-encoding picture. You may do it. Also, MPEG-2 or H.264. In some cases, like the video coding standard such as H.264, the picture coding order does not always match the picture playback order. In such a case, if the reproduction order of pictures is known, an encoded picture to be used may be determined based on the picture reproduction order. For example, any of the encoded pictures included in the range up to a picture to be reproduced a predetermined number of times before or after the in-encoding picture is used as an encoded picture that is temporally close to the in-encoding picture. May be. Even in such a moving picture coding standard, the coding order and the playback order do not differ greatly, so that the coded picture to be used should be determined based on which order. Also good.

また、符号化済みピクチャとして、符号化途中ピクチャと同じピクチャタイプの符号化済みピクチャで、時間的に近接した符号化済みピクチャを使用してもよい。ここで、例えば、MPEG−2又はH.264等の動画像符号化規格では、ピクチャタイプによって予測符号化方式が異なる。Iピクチャに対しては、フレーム内予測(イントラ予測)が使用され、Pピクチャに対しては、順方向動き補償フレーム間予測が使用され、Bピクチャでは、順方向、逆方向、又は双方向動き補償フレーム間予測が使用される。つまり、同じピクチャタイプのピクチャ同士は、発生符号量の特性が近くなる。したがって、符号化途中ピクチャと同じピクチャタイプの符号化済みピクチャを使用することで、未符号化領域の発生符号量の推定精度を向上することができる。   In addition, as the encoded picture, an encoded picture of the same picture type as the in-encoding picture and temporally close encoded pictures may be used. Here, for example, MPEG-2 or H.264 is used. In the moving picture coding standard such as H.264, the predictive coding method differs depending on the picture type. Intra-frame prediction (intra prediction) is used for I pictures, forward motion compensated interframe prediction is used for P pictures, and forward, backward, or bidirectional motion for B pictures. Compensated interframe prediction is used. That is, the characteristics of the generated code amount are close between pictures of the same picture type. Therefore, by using a coded picture of the same picture type as the picture being coded, it is possible to improve the estimation accuracy of the generated code amount in the uncoded area.

ここで、動画像データの符号化開始直後には、符号化済みピクチャが存在しない。また、シーンチェンジによって、符号化済みピクチャと符号化途中ピクチャとの間で、シーンの性質が変化した場合には、符号化途中ピクチャと時間的に近接した符号化済みピクチャであっても、符号化途中ピクチャと発生符号量分布が類似していない可能性が高い。したがって、それらの場合、発生符号量予測装置12は、符号化済みピクチャを使用せずに、符号化途中ピクチャの符号化済み領域と、符号化途中ピクチャの未符号化領域との比率に応じた比例計算によって、符号化途中ピクチャの未符号化領域の発生符号量Sbを推定するようにしてもよい。つまり、符号化途中ピクチャの未符号化領域の発生符号量を次式(2)によって推定する。   Here, there is no encoded picture immediately after the start of encoding of moving image data. In addition, if the scene property changes between an encoded picture and an encoded picture due to a scene change, even if the encoded picture is temporally close to the encoded picture, There is a high possibility that the generated code amount distribution is not similar to the picture being processed. Therefore, in these cases, the generated code amount prediction device 12 does not use the encoded picture, and responds to the ratio between the encoded area of the encoding intermediate picture and the unencoded area of the encoding intermediate picture. The generated code amount Sb of the unencoded area of the picture being encoded may be estimated by proportional calculation. That is, the generated code amount in the unencoded area of the picture being encoded is estimated by the following equation (2).

Figure 0005706759
Figure 0005706759

符号量制御装置13は、以上に説明した方法によって推定された未符号化領域の推定符号量と、未符号化領域に割り当て可能な目標符号量との差分に基づいて、符号量制御パラメタを決定する。なお、図3を参照して説明したように、エンコーダ30〜33のそれぞれで符号化の進行状況は異なるため、エンコーダ30〜33のそれぞれに対して、別々の符号量制御パラメタが決定されることになる。そして、符号量制御装置13は、決定した符号量制御パラメタをエンコーダ30〜33のそれぞれに与える。エンコーダ30〜33のそれぞれは、符号量制御装置13から与えられた符号量制御パラメタに基づいて、符号化途中ピクチャの未符号化領域を符号化する。符号量制御パラメタは、例えば、量子化ステップである。例えば、推定符号量が目標符号量よりも大きい場合、量子化ステップを大きくして発生する符号量を抑制する。逆に、推定符号量が目標符号量よりも小さい場合、量子化ステップを小さくして発生する符号量が多くなるようにする。   The code amount control device 13 determines the code amount control parameter based on the difference between the estimated code amount of the uncoded region estimated by the method described above and the target code amount that can be allocated to the uncoded region. To do. As described with reference to FIG. 3, since the progress of encoding is different for each of the encoders 30 to 33, different code amount control parameters are determined for each of the encoders 30 to 33. become. Then, the code amount control device 13 gives the determined code amount control parameter to each of the encoders 30 to 33. Each of the encoders 30 to 33 encodes an unencoded area of a picture being encoded based on a code amount control parameter given from the code amount control device 13. The code amount control parameter is, for example, a quantization step. For example, when the estimated code amount is larger than the target code amount, the code amount generated by suppressing the quantization step is suppressed. Conversely, when the estimated code amount is smaller than the target code amount, the generated code amount is increased by reducing the quantization step.

なお、ピクチャの符号化開始時には、まだピクチャの符号化済み領域が存在しないため、符号量制御装置13は、符号量制御パラメタをどのように決定するようにしてもよい。一例としては、ピクチャの目標符号量に応じて、適切と考えられる符号量制御パラメタを予め定めておく。具体的には、ピクチャがとり得る目標符号量のそれぞれから、適切な符号量制御パラメタを導き出すことができる情報を画像符号化装置1が有する任意の記憶装置に予め用意しておく。この情報は、例えば、目標符号量からそれに適した符号量制御パラメタを得ることができるテーブル又は関数等としてよい。そして、符号量制御装置13が、この情報を参照して、ピクチャの目標符号量から符号量制御パラメタを決定できるようにする。   It should be noted that since the encoded region of the picture does not yet exist at the start of picture encoding, the code amount control device 13 may determine the code amount control parameter in any way. As an example, a code amount control parameter that is considered appropriate is determined in advance according to the target code amount of the picture. Specifically, information capable of deriving an appropriate code amount control parameter from each target code amount that a picture can take is prepared in advance in an arbitrary storage device included in the image encoding device 1. This information may be, for example, a table or a function that can obtain a code amount control parameter suitable for the target code amount. Then, the code amount control device 13 refers to this information so that the code amount control parameter can be determined from the target code amount of the picture.

また、ピクチャの目標符号量は、予め定められたビットレートを達成するように予め決定しておく。ピクチャの目標符号量は、ビットレートに基づいて、ピクチャタイプ毎に異なる重み付けをして決定するようにしてもよい。具体的には、Iピクチャ、Pピクチャ、Bピクチャの順に符号化における圧縮率が高くなっていく。そのため、例えば、目標符号量が、Bピクチャ、Pピクチャ、Iピクチャの順に高くなっていくように重み付けをする。符号化途中ピクチャの目標符号量は、例えば、画像符号化装置1が有する任意の記憶装置に予め格納しておき、符号量制御装置13が参照可能としておく。   Further, the target code amount of the picture is determined in advance so as to achieve a predetermined bit rate. The target code amount of a picture may be determined by weighting differently for each picture type based on the bit rate. Specifically, the compression rate in encoding increases in the order of I picture, P picture, and B picture. Therefore, for example, weighting is performed so that the target code amount increases in the order of B picture, P picture, and I picture. For example, the target code amount of a picture being encoded is stored in advance in an arbitrary storage device included in the image encoding device 1 so that the code amount control device 13 can refer to the target code amount.

続いて、図7を参照して、本発明の実施の形態1にかかる画像符号化装置1の処理について説明する。図7は、本発明の実施の形態1にかかる画像符号化装置1の処理を示すフローチャートである。ここでは、エンコーダ30に対する符号量制御パラメタの最適化を例に挙げて説明するが、エンコーダ31〜33のそれぞれに対しても、並列して同様の処理が行われる。   Next, with reference to FIG. 7, processing of the image encoding device 1 according to the first embodiment of the present invention will be described. FIG. 7 is a flowchart showing processing of the image encoding device 1 according to the first embodiment of the present invention. Here, optimization of the code amount control parameter for the encoder 30 will be described as an example, but the same processing is performed in parallel for each of the encoders 31 to 33.

エンコーダ30は、ピクチャに含まれるマクロブロックラインを符号化する(S1)。エンコーダ30は、符号化したデータを順次、ストリームバッファ40に格納してく。これによって、ストリームバッファ40にビットストリームが形成されていく。エンコーダ30は、符号化したマクロブロックラインの発生符号量を発生符号量記憶装置11に格納する。エンコーダ30は、ピクチャに含まれる全てのマクロブロックラインを符号化したか否かを判定する(S2)。   The encoder 30 encodes the macroblock line included in the picture (S1). The encoder 30 stores the encoded data in the stream buffer 40 sequentially. As a result, a bit stream is formed in the stream buffer 40. The encoder 30 stores the generated code amount of the encoded macroblock line in the generated code amount storage device 11. The encoder 30 determines whether all macroblock lines included in the picture have been encoded (S2).

全てのマクロブロックラインを符号化した場合(S2:YES)、エンコーダ30は、そのピクチャの符号化を終了する。   When all the macroblock lines are encoded (S2: YES), the encoder 30 ends the encoding of the picture.

全てのマクロブロックラインを符号化していない場合(S2:NO)、上述した式(1)によって、発生符号量S'a及びS'bの比率に基づいて、発生符号量Saから未符号化領域の発生符号量Sbを推定する(S3)。   When not all the macroblock lines are encoded (S2: NO), from the generated code amount Sa based on the ratio of the generated code amounts S′a and S′b according to the above-described formula (1), The generated code amount Sb is estimated (S3).

ここで、発生符号量記憶装置11には、符号化途中ピクチャの符号化済み領域に含まれるマクロブロックラインのそれぞれにおける発生符号量と、符号化済みピクチャに含まれるマクロブロックラインのそれぞれにおける発生符号量とが格納されていることになる。そのため、発生符号量予測装置12は、発生符号量記憶装置11に格納されたマクロブロックライン毎の発生符号量に基づいて、各発生符号量Sa、S'a、及びS'bを算出する。   Here, the generated code amount storage device 11 stores the generated code amount in each of the macroblock lines included in the encoded area of the picture being encoded and the generated code in each of the macroblock lines included in the encoded picture. The amount and the stored. Therefore, the generated code amount prediction device 12 calculates each generated code amount Sa, S′a, and S′b based on the generated code amount for each macroblock line stored in the generated code amount storage device 11.

具体的には、発生符号量予測装置12は、符号化途中ピクチャの符号化済み領域のマクロブロックラインの発生符号量の総和を、符号化途中ピクチャの符号化済み領域の発生符号量Saとして算出する。発生符号量予測装置12は、符号化済みピクチャのうち、符号化途中ピクチャの符号化済み領域に対応する領域のマクロブロックラインの発生符号量の総和を、その符号化済み領域に対応する領域の発生符号量S'aとして算出する。発生符号量予測装置12は、符号化済みピクチャのうち、符号化途中ピクチャの未符号化領域に対応する領域のマクロブロックラインの発生符号量の総和を、その未符号化領域に対応する領域の発生符号量S'bとして算出する。   Specifically, the generated code amount prediction device 12 calculates the sum of the generated code amounts of the macroblock lines in the encoded region of the picture being encoded as the generated code amount Sa of the encoded region of the picture being encoded. To do. The generated code amount prediction device 12 calculates the sum of the generated code amounts of the macroblock lines in the region corresponding to the encoded region of the halfway encoded picture among the encoded pictures in the region corresponding to the encoded region. Calculated as the generated code amount S′a. The generated code amount prediction device 12 calculates the sum of the generated code amounts of the macroblock lines in the region corresponding to the uncoded region of the picture being encoded among the encoded pictures in the region corresponding to the uncoded region. The generated code amount S′b is calculated.

発生符号量予測装置12は、推定した未符号化領域の発生符号量Sbを符号量制御装置13に出力する。   The generated code amount prediction device 12 outputs the estimated generated code amount Sb of the uncoded region to the code amount control device 13.

符号量制御装置13は、発生符号量予測装置12から出力された、符号化途中ピクチャの未符号化領域の推定符号量Sbを、符号化途中ピクチャの未符号化領域の目標符号量と比較する(S4)。符号量制御装置13は、例えば、未符号化領域の目標符号量を、符号化途中ピクチャの目標符号量から、符号化途中ピクチャの符号化済み領域の発生符号量を減算することによって算出する。なお、符号量制御装置13は、符号化途中ピクチャの符号化済み領域の発生符号量を、発生符号量予測装置12と同様に発生符号量記憶装置11から取得するようにしてもよく、発生符号量予測装置12から推定符号量Sbとともに取得するようにしてもよい。   The code amount control device 13 compares the estimated code amount Sb of the unencoded area of the picture being encoded output from the generated code amount prediction apparatus 12 with the target code amount of the uncoded area of the picture being encoded. (S4). For example, the code amount control device 13 calculates the target code amount of the uncoded region by subtracting the generated code amount of the encoded region of the halfway encoded picture from the target code amount of the halfway encoded picture. It should be noted that the code amount control device 13 may acquire the generated code amount of the encoded region of the picture being encoded from the generated code amount storage device 11 in the same manner as the generated code amount prediction device 12, or the generated code amount You may make it acquire with the estimated code amount Sb from the quantity prediction apparatus 12. FIG.

未符号化領域の推定符号量が、未符号化領域の目標符号量よりも大きい場合(S4:大きい)、符号量制御装置13は、エンコーダ30による符号化によって発生する符号量を低減させるように符号量制御パラメタを変更する(S5)。つまり、量子化ステップを大きくする。符号量制御装置13は、変更後の符号量制御パラメタをエンコーダ20に出力する。   When the estimated code amount of the uncoded region is larger than the target code amount of the uncoded region (S4: large), the code amount control device 13 reduces the code amount generated by the encoding by the encoder 30. The code amount control parameter is changed (S5). That is, the quantization step is increased. The code amount control device 13 outputs the changed code amount control parameter to the encoder 20.

未符号化領域の推定符号量が、未符号化領域の目標符号量よりも小さい場合(S4:小さい)、符号量制御装置13は、エンコーダ30による符号化によって発生する符号量を増加させるように符号量制御パラメタを変更する(S6)。つまり、量子化ステップを小さくする。符号量制御装置13は、変更後の符号量制御パラメタをエンコーダ20に出力する。   When the estimated code amount of the uncoded region is smaller than the target code amount of the uncoded region (S4: small), the code amount control device 13 increases the code amount generated by the encoding by the encoder 30. The code amount control parameter is changed (S6). That is, the quantization step is reduced. The code amount control device 13 outputs the changed code amount control parameter to the encoder 20.

未符号化領域の推定符号量が、未符号化領域の目標符号量と等しい場合(S4:等しい)、符号量制御パラメタは、変更しない。   When the estimated code amount of the uncoded region is equal to the target code amount of the uncoded region (S4: equal), the code amount control parameter is not changed.

エンコーダ30は、符号量制御装置13から出力された符号量制御パラメタに基づいて、次のマクロブロックラインを符号化する(S1)。以降も同様に、ステップS1〜S6の処理を繰り返すことによって、符号化制御パラメタを最適化しながら、ピクチャ5の符号化を行うことができる。   The encoder 30 encodes the next macroblock line based on the code amount control parameter output from the code amount control device 13 (S1). Similarly, by repeating the processes of steps S1 to S6, the picture 5 can be encoded while optimizing the encoding control parameter.

以上に説明したように、本実施の形態1にかかる符号化処理では、相関の高いピクチャの符号化結果を利用しているため、そのピクチャの符号量の発生分布に応じて、精度の高い符号量推定が可能となる。特に、図5に例示したように、符号化による発生符号量が、ピクチャ内の前半と後半とで大きく異なってしまうピクチャであっても、精度の高い符号量推定が可能となる。   As described above, since the encoding process according to the first embodiment uses the encoding result of a highly correlated picture, a highly accurate code is generated according to the distribution of the code amount of the picture. Quantity estimation is possible. In particular, as illustrated in FIG. 5, it is possible to estimate the amount of code with high accuracy even for a picture in which the amount of code generated by encoding differs greatly between the first half and the latter half of the picture.

以上に説明したように、本実施の形態1では、符号化中フレームに時間的に近接する符号化済みフレームにおける、符号化中フレームに含まれる符号化済み領域及び未符号化領域に対応する領域のそれぞれの符号量の比率に基づいて、符号化済み領域の符号量から未符号化領域の符号量を推定するようにしている。   As described above, in the first embodiment, in the encoded frame that is temporally close to the encoded frame, the regions corresponding to the encoded region and the unencoded region included in the encoded frame The code amount of the uncoded region is estimated from the code amount of the encoded region based on the ratio of the respective code amounts.

これによれば、符号化中フレームと相関の高い符号化済みフレームの符号量分布を参考にして、未符号化領域の符号量を高い精度で推定することが可能となる。したがって、高い精度で推定された未符号化領域の符号量に基づいて、適切な符号量制御パラメタを決定することができるため、符号化したときにおけるフレームの画質の劣化を抑制することができる。   According to this, it is possible to estimate the code amount of the uncoded region with high accuracy by referring to the code amount distribution of the encoded frame having a high correlation with the frame being encoded. Therefore, since an appropriate code amount control parameter can be determined based on the code amount of the unencoded area estimated with high accuracy, it is possible to suppress deterioration of the image quality of the frame when encoded.

発明の実施の形態2.
続いて、図8を参照して、本発明の実施の形態2にかかる画像符号化装置2の構成について説明する。図8は、本発明の実施の形態2にかかる画像符号化装置2の構成図である。なお、実施の形態1と同様の構成要素については、同一の符号を付して、説明を省略する。
Embodiment 2 of the Invention
Next, the configuration of the image encoding device 2 according to the second embodiment of the present invention will be described with reference to FIG. FIG. 8 is a configuration diagram of the image encoding device 2 according to the second embodiment of the present invention. In addition, about the component similar to Embodiment 1, the same code | symbol is attached | subjected and description is abbreviate | omitted.

画像符号化装置2は、フレームバッファ10、発生符号量記憶装置11、符号量制御装置13、ストリーム結合装置14、事前解析装置15、解析結果記憶装置16、発生符号量予測装置17、エンコーダ30〜33、及びストリームバッファ40〜43を有する。本実施の形態2において、画像符号化装置2に入力される入力画像は、動画データを構成するフレームであってもよく、静止画像データを構成する1枚のフレームであってもよい。   The image encoding device 2 includes a frame buffer 10, a generated code amount storage device 11, a code amount control device 13, a stream combination device 14, a pre-analysis device 15, an analysis result storage device 16, a generated code amount prediction device 17, and encoders 30 to 30. 33 and stream buffers 40-43. In the second embodiment, the input image input to the image encoding device 2 may be a frame constituting moving image data or a single frame constituting still image data.

事前解析装置15は、画像符号化装置2の外部から入力画像が入力される。事前解析装置15は、入力画像を解析して、1画像を予め定めた大きさに分割した単位毎の特徴量を算出する。事前解析装置15は、算出した特徴量を事前解析結果として解析結果記憶装置16に記憶する。事前解析装置15は、事前解析後の入力画像をフレームバッファ10に記憶する。   The pre-analysis device 15 receives an input image from the outside of the image encoding device 2. The pre-analysis device 15 analyzes the input image and calculates a feature amount for each unit obtained by dividing one image into a predetermined size. The pre-analysis device 15 stores the calculated feature quantity in the analysis result storage device 16 as a pre-analysis result. The pre-analysis device 15 stores the input image after the pre-analysis in the frame buffer 10.

解析結果記憶装置16は、入力画像の事前解析結果が一時的に記憶される。事前解析結果としての特徴量は、1画像を予め定めた大きさに分割した単位毎に記憶される。解析結果記憶装置16は、特徴量を記憶するための任意の記憶装置によって構成される。   The analysis result storage device 16 temporarily stores the pre-analysis result of the input image. The feature amount as the pre-analysis result is stored for each unit obtained by dividing one image into a predetermined size. The analysis result storage device 16 is configured by an arbitrary storage device for storing feature quantities.

発生符号量予測装置17は、符号化途中の画像の符号化済み領域の発生符号量と、符号化途中の画像の特徴量とに基づいて、符号化途中の画像の未符号化領域の発生符号量を推定する。   The generated code amount prediction device 17 generates the generated code of the unencoded area of the image being encoded based on the generated code amount of the encoded area of the image being encoded and the feature amount of the image being encoded. Estimate the amount.

続いて、図9を参照して、本発明の実施の形態2にかかる未符号化領域の符号量推定方法について説明する。図9は、本発明の実施の形態2にかかる未符号化領域の符号量推定方法を説明するための図である。   Next, with reference to FIG. 9, a code amount estimation method for an uncoded region according to the second embodiment of the present invention will be described. FIG. 9 is a diagram for explaining a code amount estimation method for an unencoded area according to the second embodiment of the present invention.

一般的に、画像内の特定の特徴量と、その画像内の発生符号量とは相関があり、画像内の特定の特徴量分布と、その画像内の発生符号量分布とが類似していることが知られている。そこで、本実施の形態2にかかる発生符号量予測装置17は、符号化途中ピクチャの未符号化領域の発生符号量を、符号化途中ピクチャの符号化済み領域における発生符号量と、符号化途中のピクチャの特徴量から推定する。   In general, there is a correlation between a specific feature amount in an image and a generated code amount in the image, and the specific feature amount distribution in the image is similar to the generated code amount distribution in the image. It is known. Therefore, the generated code amount prediction apparatus 17 according to the second embodiment determines the generated code amount in the unencoded area of the picture in the middle of encoding, the generated code quantity in the encoded area of the picture in the middle of encoding, It is estimated from the feature quantity of the picture.

例えば、図9に例示するように、符号化途中ピクチャのaで示す範囲まで符号化が進んでいるものとする。つまり、図9では、図6の右図と同様に、符号化途中ピクチャのaで示す範囲は、符号化済み領域であり、符号化途中ピクチャのbで示す範囲は、未符号化領域である。このときに、符号化途中ピクチャの符号化済み領域の発生符号量がSaである場合、符号化途中ピクチャの未符号化領域の発生符号量Sbを次式(3)によって推定する。ここで、Caは、符号化途中ピクチャの符号化済み領域の特徴量であり、Cbは、符号化途中ピクチャの未符号化領域の特徴量である。   For example, as illustrated in FIG. 9, it is assumed that the encoding has progressed to the range indicated by “a” in the middle of encoding. That is, in FIG. 9, as in the right diagram of FIG. 6, the range indicated by a in the middle picture is an encoded area, and the range indicated by b in the middle picture is an uncoded area. . At this time, when the generated code amount of the encoded region of the picture in the middle of encoding is Sa, the generated code amount Sb of the uncoded region of the picture in the middle of encoding is estimated by the following equation (3). Here, Ca is the feature amount of the encoded area of the picture in the middle of encoding, and Cb is the feature quantity of the uncoded area of the picture in the middle of encoding.

Figure 0005706759
Figure 0005706759

上述したように、ピクチャ内の特定の特徴量分布と、そのピクチャ内の発生符号量分布とは、相互に類似している。よって、符号化途中ピクチャの符号化済み領域の発生符号量Saと、符号化途中ピクチャの未符号化領域の発生符号量Sbとの比率は、符号化途中ピクチャの符号化済み領域の発生符号量Caと、符号化途中ピクチャの未符号化の発生符号量Cbとの比率と類似することになる。そのため、式(3)によって、Sa及びSbの比率が、Ca及びCbの比率と同じとなるように、SaからSbを算出することで、符号化済みピクチャの未符号化領域の発生符号量を高い精度で推定することができる。   As described above, the specific feature amount distribution in the picture and the generated code amount distribution in the picture are similar to each other. Therefore, the ratio between the generated code amount Sa of the encoded region of the picture being encoded and the generated code amount Sb of the unencoded region of the image being encoded is the generated code amount of the encoded region of the picture being encoded This is similar to the ratio between Ca and the unencoded code amount Cb of the picture being encoded. Therefore, by calculating Sb from Sa so that the ratio of Sa and Sb is the same as the ratio of Ca and Cb according to Equation (3), the generated code amount of the uncoded area of the encoded picture can be calculated. It can be estimated with high accuracy.

ここで、事前解析装置15は、特徴量として、例えば、ピクチャ内隣接画素間差分絶対値の総和、ピクチャ間差分絶対値の総和、及びピクチャ内画素分散等の発生符号量に相関のある統計量を算出する。ここで、ピクチャ内隣接画素間差分絶対値とは、ピクチャ内において隣接する画素間の画素値の差分値の絶対値のことである。ピクチャ間差分絶対値とは、符号化途中ピクチャと、符号化途中ピクチャの直前に入力されたピクチャとの同一位置における画素値の差分値の絶対値のことである。なお、事前解析装置15は、直前に入力されたピクチャに限られず、フレームバッファ10に格納済みの過去に入力されたピクチャを参照することによって、今回に入力されたピクチャとのピクチャ間差分絶対値を算出するようにしてもよい。ピクチャ内画素分散値とは、ピクチャ内における画素値の分散値である。事前解析装置15は、マクロブロックライン毎に特徴量を算出して解析結果記憶装置16に格納していく。   Here, the pre-analysis device 15 uses, as the feature quantity, for example, a statistical quantity correlated with the generated code quantity such as the sum of absolute difference values between adjacent pixels in the picture, the sum of absolute difference values between pictures, and the intra-picture pixel variance. Is calculated. Here, the difference absolute value between adjacent pixels in a picture is an absolute value of a difference value of pixel values between adjacent pixels in the picture. The inter-picture difference absolute value is an absolute value of a difference value of pixel values at the same position between a picture being coded and a picture input immediately before the picture being coded. Note that the pre-analysis device 15 is not limited to the picture input immediately before, but refers to a picture input in the past and stored in the frame buffer 10, so that the absolute value of the inter-picture difference from the picture input this time May be calculated. The intra-picture pixel variance value is a variance value of pixel values within a picture. The pre-analysis device 15 calculates a feature amount for each macroblock line and stores it in the analysis result storage device 16.

なお、特徴量として、ピクチャ内隣接画素間差分絶対値の総和、ピクチャ間差分絶対値の総和、及びピクチャ内画素分散値のうち、いずれか1つの統計量を使用するようにしてもよく、いずれか2つ以上の統計量を使用するようにしてもよい。いずれか2つ以上の統計量を使用する場合、統計量のそれぞれに予め任意に定めた重みを乗じてから、それらを加算した値を特徴量として使用するようにしてもよい。   As the feature amount, any one statistic may be used among the sum of absolute differences between adjacent pixels in a picture, the sum of absolute differences between pictures, and the pixel dispersion value in a picture. Or two or more statistics may be used. In the case of using any two or more statistics, a value obtained by multiplying each of the statistics by a predetermined weight and then adding them may be used as the feature.

ここで、符号化途中ピクチャがIピクチャのように、フレーム内予測(イントラ予測)によって符号化される場合、発生符号量は、ピクチャ内隣接画素間差分絶対値の総和、あるいはピクチャ内画素分散値に応じて大きくなる。そのため、この場合は、特徴量として、ピクチャ内隣接画素間差分絶対値の総和、及び、ピクチャ内画素分散値のうち、少なくとも1つを使用するようにするとよい。   Here, when a picture in the middle of encoding is encoded by intra-frame prediction (intra prediction) like an I picture, the generated code amount is the sum of absolute values of differences between adjacent pixels in a picture or a pixel dispersion value in a picture It grows according to. Therefore, in this case, it is preferable to use at least one of the sum of absolute differences between adjacent pixels in the picture and the pixel dispersion value in the picture as the feature amount.

また、符号化途中ピクチャがPピクチャ又はBピクチャのように、動き補償フレーム間予測によって符号化される場合、発生符号量は、ピクチャ間差分絶対値の総和に応じて大きくなる。そのため、この場合は、特徴量として、ピクチャ間差分絶対値の総和を使用するようにするとよい。   Further, when a picture in the middle of encoding is encoded by motion compensated interframe prediction, such as a P picture or a B picture, the generated code amount increases in accordance with the sum of absolute differences between pictures. Therefore, in this case, it is preferable to use the sum of absolute differences between pictures as the feature amount.

つまり、上述した異なる種類の統計量を全て算出するようにして、算出した統計量の中から、ピクチャタイプに応じて選択的に統計量を特徴量として使用するようにしてもよい。   In other words, all the different types of statistics described above may be calculated, and the statistics may be selectively used as the feature value from the calculated statistics according to the picture type.

続いて、図10を参照して、本発明の実施の形態2にかかる画像符号化装置2の処理について説明する。図10は、本発明の実施の形態2にかかる画像符号化装置2の処理を示すフローチャートである。ここでは、エンコーダ30に対する符号量制御パラメタの最適化を例に挙げて説明するが、エンコーダ31〜33のそれぞれに対しても、並列して同様の処理が行われる。   Next, with reference to FIG. 10, processing of the image encoding device 2 according to the second exemplary embodiment of the present invention will be described. FIG. 10 is a flowchart showing processing of the image encoding device 2 according to the second embodiment of the present invention. Here, optimization of the code amount control parameter for the encoder 30 will be described as an example, but the same processing is performed in parallel for each of the encoders 31 to 33.

事前解析装置15は、入力画像として入力されたピクチャの特徴量をマクロブロックライン毎に算出する(S11)。事前解析装置15は、算出したマクロブロックライン毎の特徴量を解析結果記憶装置16に格納する。なお、ステップS12、S13については、実施の形態1におけるステップS1、S2と同様であるため、説明を省略する。   The pre-analysis device 15 calculates the feature amount of the picture input as the input image for each macroblock line (S11). The prior analysis device 15 stores the calculated feature amount for each macroblock line in the analysis result storage device 16. Since steps S12 and S13 are the same as steps S1 and S2 in the first embodiment, the description thereof is omitted.

全てのマクロブロックラインを符号化していない場合(S13:NO)、上述した式(3)によって、特徴量Ca及びCbの比率に基づいて、符号化済み領域の発生符号量Saから未符号化領域の発生符号量Sbを推定する(S14)。   When all the macroblock lines are not encoded (S13: NO), from the generated code amount Sa of the encoded region based on the ratio of the feature amounts Ca and Cb, the uncoded region is calculated based on the ratio of the feature amounts Ca and Cb. The generated code amount Sb is estimated (S14).

ここで、解析結果記憶装置16には、符号化途中ピクチャに含まれるマクロブロックラインのそれぞれにおける特徴量が格納されていることになる。そのため、発生符号量予測装置17は、解析結果記憶装置16に格納されたマクロブロックライン毎の特徴量に基づいて、各特徴量Ca及びCbを算出する。   Here, the analysis result storage device 16 stores the feature values of each of the macroblock lines included in the picture being encoded. Therefore, the generated code amount prediction device 17 calculates each feature amount Ca and Cb based on the feature amount for each macroblock line stored in the analysis result storage device 16.

具体的には、発生符号量予測装置17は、符号化途中ピクチャの符号化済み領域のマクロブロックラインの特徴量の総和を、符号化途中ピクチャの符号化済み領域の特徴量Caとして算出する。発生符号量予測装置17は、符号化途中ピクチャの未符号化領域のマクロブロックラインの特徴量の総和を、符号化途中ピクチャの未符号化領域の特徴量Cbとして算出する。なお、発生符号量予測装置17は、実施の形態1にかかる発生符号量予測装置12と同様に、符号化途中ピクチャの符号化済み領域の発生符号量Saとして、符号化途中ピクチャの符号化済み領域のマクロブロックラインの発生符号量の総和を算出する。   Specifically, the generated code amount prediction apparatus 17 calculates the sum of the feature amounts of the macroblock lines in the encoded region of the picture being encoded as the feature amount Ca of the encoded region of the picture being encoded. The generated code amount prediction device 17 calculates the sum of the feature amounts of the macroblock lines in the unencoded area of the picture being coded as the feature quantity Cb of the uncoded area of the picture being coded. The generated code amount predicting device 17 encodes the halfway encoded picture as the generated code amount Sa of the encoded region of the intermediate encoded picture, similarly to the generated code amount predicting device 12 according to the first embodiment. The sum of the generated code amounts of the macro block lines in the area is calculated.

発生符号量予測装置17は、推定した未符号化領域の発生符号量Sbを示す推定符号量情報を符号量制御装置13に出力する。以降、ステップS15〜S17の処理については、実施の形態1におけるステップS4〜S6と同様であるため、説明を省略する。   The generated code amount prediction device 17 outputs estimated code amount information indicating the estimated generated code amount Sb of the uncoded region to the code amount control device 13. Henceforth, about the process of step S15-S17, since it is the same as that of step S4-S6 in Embodiment 1, description is abbreviate | omitted.

以上に説明したように、本実施の形態2では、符号化中フレームに含まれる符号化済み領域の特徴量と、符号化中フレームに含まれる未符号化領域の特徴量との比率に基づいて、符号化済み領域の符号量から未符号化領域の符号量を推定するようにしている。   As described above, the second embodiment is based on the ratio between the feature amount of the encoded region included in the frame being encoded and the feature amount of the unencoded region included in the frame being encoded. The code amount of the uncoded region is estimated from the code amount of the encoded region.

これによれば、符号化中フレームの符号量分布と相関の高い符号化中フレームの特徴量分布を参考にして、未符号化領域の符号量を高い精度で推定することが可能となる。したがって、高い精度で推定された未符号化領域の符号量に基づいて、符号量制御パラメタを決定することができるため、符号化したときにおけるフレームの画質の劣化を抑制することができる。   According to this, it is possible to estimate the code amount of the uncoded region with high accuracy by referring to the feature amount distribution of the encoded frame having a high correlation with the code amount distribution of the encoded frame. Therefore, since the code amount control parameter can be determined based on the code amount of the unencoded area estimated with high accuracy, it is possible to suppress deterioration of the image quality of the frame when it is encoded.

なお、上述した本実施の形態2では、発生符号量予測装置17が、符号化途中ピクチャの特徴量に基づいて、符号化途中ピクチャの未符号化領域の発生符号量を推定する場合について例示したが、これに限られない。発生符号量予測装置17は、符号化途中ピクチャに時間的に近接する符号化済みピクチャの特徴量に基づいて、符号化途中ピクチャの未符号化領域の発生符号量を推定するようにしてもよい。具体的は、発生符号量予測装置17は、符号化途中ピクチャの符号化済み領域の発生符号量と、符号化途中ピクチャの未符号化領域の発生符号量との比率が、符号化済みピクチャのうち、符号化途中ピクチャの符号化済み領域に対応する領域の特徴量と、符号化済みピクチャのうち、符号化途中ピクチャの未符号化領域に対応する領域の特徴量との比率と同じとなるように、符号化済み領域の発生符号量から未符号化領域の発生符号量を算出するようにしてもよい。   In the second embodiment described above, the case where the generated code amount prediction device 17 estimates the generated code amount of the unencoded area of the coding intermediate picture based on the feature amount of the coding intermediate picture is illustrated. However, it is not limited to this. The generated code amount prediction device 17 may estimate the generated code amount of an unencoded area of the picture being encoded based on the feature value of the encoded picture that is temporally close to the picture being encoded. . Specifically, the generated code amount prediction device 17 determines that the ratio between the generated code amount of the encoded region of the picture being encoded and the generated code amount of the uncoded region of the picture being encoded is that of the encoded picture. Among them, the ratio between the feature amount of the region corresponding to the encoded region of the picture being encoded and the feature amount of the region corresponding to the uncoded region of the encoded picture of the encoded picture is the same. In this way, the generated code amount of the uncoded region may be calculated from the generated code amount of the encoded region.

なぜなら、一般的に、符号化途中ピクチャに時間的に近接する符号化済みピクチャであれば、符号化途中ピクチャと相関が高く、符号化途中ピクチャと特徴量分布も類似しているからである。そのため、符号化途中ピクチャに時間的に近接する符号化済みピクチャの特徴量を使用しても、符号化途中ピクチャの未符号化領域の発生符号量を高い精度で推定することができる。   This is because, in general, an encoded picture that is temporally close to an in-encoding picture has a high correlation with the in-encoding picture, and the feature amount distribution is similar to the in-encoding picture. For this reason, even if the feature amount of the encoded picture that is temporally close to the picture that is being encoded is used, the generated code amount of the uncoded area of the picture that is being encoded can be estimated with high accuracy.

発明の実施の形態3.
続いて、図11を参照して、本発明の実施の形態3にかかる画像符号化装置3の構成について説明する。図11は、本発明の実施の形態3にかかる画像符号化装置3の構成図である。なお、実施の形態1及び実施の形態2と同様の構成要素については、同一の符号を付して、説明を省略する。
Embodiment 3 of the Invention
Next, the configuration of the image encoding device 3 according to the third embodiment of the present invention will be described with reference to FIG. FIG. 11 is a configuration diagram of the image encoding device 3 according to the third embodiment of the present invention. In addition, about the component similar to Embodiment 1 and Embodiment 2, the same code | symbol is attached | subjected and description is abbreviate | omitted.

画像符号化装置3は、フレームバッファ10、発生符号量記憶装置11、符号量制御装置13、ストリーム結合装置14、事前解析装置15、解析結果記憶装置16、発生符号量予測装置18、エンコーダ30〜33、及びストリームバッファ40〜43を有する。   The image encoding device 3 includes a frame buffer 10, a generated code amount storage device 11, a code amount control device 13, a stream combination device 14, a pre-analysis device 15, an analysis result storage device 16, a generated code amount prediction device 18, and encoders 30 to 30. 33 and stream buffers 40-43.

発生符号量予測装置18は、通常時には、符号化済みの画像の発生符号量と、符号化途中の画像の符号化済み領域の発生符号量とに基づいて、符号化途中の画像の未符号化領域の発生符号量を推定する。つまり、発生符号量予測装置18は、通常時には、実施の形態1と同様に式(1)を使用して符号化途中の画像の未符号化領域の発生符号量を推定する。   The generated code amount prediction device 18 normally performs the unencoding of the image being encoded based on the generated code amount of the encoded image and the generated code amount of the encoded region of the image being encoded. Estimate the amount of generated code in a region. In other words, the generated code amount prediction device 18 estimates the generated code amount of an unencoded area of an image that is being encoded using Equation (1) in the same way as in the first embodiment.

発生符号量予測装置18は、シーンチェンジによって、符号化済みの画像と符号化途中の画像との間で、シーンの性質が変化した場合には、符号化途中の画像の符号化済み領域の発生符号量と、符号化途中の画像の特徴量とに基づいて、符号化途中の画像の未符号化領域の発生符号量を推定する。つまり、発生符号量予測装置18は、シーンの性質が変化した場合には、実施の形態2と同様に式(3)を使用して符号化途中の画像の未符号化領域の発生符号量を推定する。上述したように、シーンの性質が変化した場合には、符号化途中ピクチャと時間的に近接した符号化済みピクチャであっても、その符号化済みピクチャの発生符号量分布と、符号化途中ピクチャの発生符号量分布とが類似していない可能性が高いからである。   The generated code amount prediction device 18 generates an encoded region of an image being encoded when a scene change causes a scene change between the encoded image and the image being encoded. Based on the code amount and the feature amount of the image being encoded, the generated code amount of the unencoded area of the image being encoded is estimated. In other words, the generated code amount prediction device 18 uses the expression (3) in the same manner as in the second embodiment to calculate the generated code amount of the unencoded area of the image being encoded when the scene property changes. presume. As described above, when the nature of the scene changes, even if the encoded picture is temporally close to the encoding-in-progress picture, the generated code amount distribution of the encoded picture and the encoding-in-progress picture This is because there is a high possibility that the generated code amount distribution is not similar.

続いて、図12を参照して、本発明の実施の形態3にかかる画像符号化装置3の処理について説明する。図12は、本発明の実施の形態3にかかる画像符号化装置3の処理を示すフローチャートである。ここでは、エンコーダ30における符号量制御パラメタの最適化を例に挙げて説明する。   Next, with reference to FIG. 12, processing of the image encoding device 3 according to the third exemplary embodiment of the present invention will be described. FIG. 12 is a flowchart showing processing of the image encoding device 3 according to the third embodiment of the present invention. Here, the optimization of the code amount control parameter in the encoder 30 will be described as an example.

なお、ステップS21〜23については、実施の形態2にかかるステップS11〜13と同様であるため、説明を省略する。   In addition, about step S21-23, since it is the same as that of step S11-13 concerning Embodiment 2, description is abbreviate | omitted.

全てのマクロブロックラインを符号化していない場合(S23:NO)、発生符号量予測装置18は、符号化済みピクチャと符号化途中ピクチャとの間で、シーンの性質が変化したか否かを判定する(S24)。なお、シーンの性質が変化したか否かは、符号化済みピクチャと符号化途中ピクチャとの間の画素値の差分値に基づいて判定する。   When all the macroblock lines have not been encoded (S23: NO), the generated code amount prediction device 18 determines whether or not the scene property has changed between the encoded picture and the intermediate picture. (S24). Note that whether or not the nature of the scene has changed is determined based on the difference value of the pixel value between the encoded picture and the current encoding picture.

例えば、事前解析装置15が、符号化済みピクチャと符号化途中ピクチャとの間におけるピクチャ間差分絶対値の総和を算出して解析結果記憶装置16に格納するようにする。発生符号量予測装置18は、解析結果記憶装置16に格納されたピクチャ間差分絶対値の総和を取得する。そして、発生符号量予測装置18は、ピクチャ全体におけるピクチャ間差分絶対値の総和が、予め任意に定めた閾値を超えた場合に、シーンの性質が変化したと判定し、ピクチャ全体におけるピクチャ間差分絶対値の総和が、予め任意に定めた閾値を超えていない場合に、シーンの性質が変化していないと判定する。   For example, the pre-analysis device 15 calculates the sum of the absolute values of inter-picture differences between the encoded picture and the half-encoded picture and stores it in the analysis result storage device 16. The generated code amount prediction device 18 acquires the sum total of the inter-picture difference absolute values stored in the analysis result storage device 16. The generated code amount prediction device 18 determines that the nature of the scene has changed when the sum of the absolute values of inter-picture differences in the entire picture exceeds a predetermined threshold value, and determines the inter-picture difference in the entire picture. When the sum of absolute values does not exceed a predetermined threshold value, it is determined that the scene property has not changed.

シーンの性質が変化したと判定した場合(S24:Yes)、発生符号量予測装置18は、実施の形態2におけるステップS14と同様に、符号化途中ピクチャの特徴量に基づいて、符号化途中ピクチャの未符号化領域の推定符号量を推定する(S25)。   When it is determined that the nature of the scene has changed (S24: Yes), the generated code amount prediction device 18 uses the feature value of the coding intermediate picture based on the feature amount of the coding middle picture as in step S14 in the second embodiment. The estimated code amount of the uncoded area is estimated (S25).

シーンの性質が変化していないと判定した場合(S24:No)、発生符号量予測装置18は、実施の形態1にかかるステップS3と同様に、符号化済みピクチャの発生符号量に基づいて、符号化途中ピクチャの未符号化領域の推定符号量を推定する(S26)。   If it is determined that the nature of the scene has not changed (S24: No), the generated code amount prediction device 18 uses the generated code amount of the encoded picture, as in step S3 according to the first embodiment. The estimated code amount of the unencoded area of the picture being encoded is estimated (S26).

発生符号量予測装置18は、推定した未符号化領域の発生符号量Sbを示す推定符号量情報を符号量制御装置13に出力する。以降、ステップS27〜S29の処理については、実施の形態1におけるステップS4〜S6と同様であるため、説明を省略する。   The generated code amount prediction device 18 outputs estimated code amount information indicating the estimated generated code amount Sb of the uncoded region to the code amount control device 13. Henceforth, about the process of step S27-S29, since it is the same as that of step S4-S6 in Embodiment 1, description is abbreviate | omitted.

以上に説明したように、本実施の形態3では、符号化済みフレームと符号化中フレームとの間に、所定の変化がある場合、符号化中フレームに含まれる符号化済み領域の特徴量と、符号化中フレームに含まれる未符号化領域の特徴量との比率に基づいて、符号化済み領域の符号量から未符号化領域の符号量を推定するようにしている。また、本実施の形態3では、符号化済みフレームと符号化中フレームとの間に、所定の変化がない場合は、符号化中フレームに時間的に近接する符号化済みフレームにおける、符号化中フレームに含まれる符号化済み領域及び未符号化領域に対応する領域のそれぞれの符号量の比率に基づいて、符号化済み領域の符号量から未符号化領域の符号量を推定するようにしている。   As described above, in the third embodiment, when there is a predetermined change between the encoded frame and the encoded frame, the feature amount of the encoded area included in the encoded frame is The code amount of the unencoded region is estimated from the code amount of the encoded region based on the ratio to the feature amount of the unencoded region included in the frame being encoded. In the third embodiment, if there is no predetermined change between the encoded frame and the encoded frame, the encoded frame in the encoded frame that is temporally adjacent to the encoded frame is being encoded. The code amount of the uncoded region is estimated from the code amount of the encoded region based on the ratio of the code amount of each of the encoded region and the region corresponding to the uncoded region included in the frame. .

これによれば、符号化済みフレームと符号化中フレームとの間に、シーンチェンジ等の所定の変化があり、符号化済みフレームと符号化中フレームとの相関が高くないと考えられる場合には、符号化中フレームの符号量分布と相関の高い符号化中フレームの特徴量分布を参考にして、未符号化領域の符号量を高い精度で推定することが可能となる。また、符号化済みフレームと符号化中フレームとの間に、シーンチェンジ等の所定の変化がなく、符号化済みフレームと符号化中フレームとの相関が高いと考えられる場合には、符号化中フレームと相関の高い符号化済みフレームの符号量分布を参考にして、未符号化領域の符号量を高い精度で推定することが可能となる。   According to this, when there is a predetermined change such as a scene change between the encoded frame and the encoded frame, and it is considered that the correlation between the encoded frame and the encoded frame is not high. Thus, it is possible to estimate the code amount of the uncoded region with high accuracy by referring to the feature amount distribution of the encoded frame having a high correlation with the code amount distribution of the encoded frame. In addition, if there is no predetermined change such as a scene change between the encoded frame and the encoded frame, and the correlation between the encoded frame and the encoded frame is considered high, With reference to the code amount distribution of the encoded frame having a high correlation with the frame, the code amount of the uncoded area can be estimated with high accuracy.

したがって、シーンの性質に変化のあるなしに関わらず、高い精度で推定された未符号化領域の符号量に基づいて、適切な符号量制御パラメタを決定することができるため、符号化したときにおけるフレームの画質の劣化を抑制することができる。   Therefore, an appropriate code amount control parameter can be determined based on the code amount of the uncoded region estimated with high accuracy regardless of whether or not the nature of the scene is changed. Degradation of the image quality of the frame can be suppressed.

なお、上述した本実施の形態3では、シーンチェンジした場合に、符号化途中ピクチャの特徴量のみを使用するようにしているが、これに限られない。例えば、シーンチェンジした場合に、次式(4)で示すように、符号化途中ピクチャの特徴量と、符号化済みピクチャの発生符号量との平均値を使用して、未符号化領域の発生符号量Sbを算出するようにもよい。   In the third embodiment described above, only the feature amount of the picture in the middle of encoding is used when the scene is changed. However, the present invention is not limited to this. For example, when a scene change occurs, as shown in the following equation (4), an uncoded region is generated by using an average value of the feature amount of a picture being encoded and the generated code amount of a coded picture. The code amount Sb may be calculated.

Figure 0005706759
Figure 0005706759

また、シーンチェンジした場合に、次式(5)で示すように、符号化途中ピクチャの特徴量と、符号化済みピクチャの符号量とのそれぞれに重み付けをした加重平均値を使用して、未符号化領域の発生符号量Sbを算出するようにもよい。ここで、Wは、0以上1以下の予め定められた任意の値である。   In addition, when a scene change occurs, as shown in the following equation (5), the weighted average value obtained by weighting the feature amount of the picture being encoded and the code amount of the encoded picture is used. The generated code amount Sb in the coding area may be calculated. Here, W is a predetermined arbitrary value between 0 and 1.

Figure 0005706759
Figure 0005706759

発明の実施の形態4.
続いて、図13を参照して、本発明の実施の形態4にかかる画像符号化装置4の構成について説明する。図13は、本発明の実施の形態4にかかる画像符号化装置4の構成図である。なお、実施の形態1〜3と同様の構成要素については、同一の符号を付して、説明を省略する。
Embodiment 4 of the Invention
Next, the configuration of the image encoding device 4 according to the fourth embodiment of the present invention will be described with reference to FIG. FIG. 13 is a configuration diagram of the image encoding device 4 according to the fourth embodiment of the present invention. In addition, about the component similar to Embodiment 1-3, the same code | symbol is attached | subjected and description is abbreviate | omitted.

画像符号化装置4は、フレームバッファ10、発生符号量記憶装置11、符号量制御装置13、ストリーム結合装置14、事前解析装置19、解析結果記憶装置20、発生符号量予測装置21、エンコーダ30〜33、及びストリームバッファ40〜43を有する。   The image encoding device 4 includes a frame buffer 10, a generated code amount storage device 11, a code amount control device 13, a stream combination device 14, a pre-analysis device 19, an analysis result storage device 20, a generated code amount prediction device 21, and encoders 30 to 30. 33 and stream buffers 40-43.

事前解析装置19は、画像符号化装置4の外部から入力画像が入力される。事前解析装置19は、入力画像を解析して、1画像を予め定めた大きさに分割した単位毎に動き量を算出する。動き量は、例えば、動きベクトルである。事前解析装置19は、算出した動き量を事前解析結果として解析結果記憶装置20に記憶する。事前解析装置19は、事前解析後の入力画像をフレームバッファ10に記憶する。ここで、事前解析装置19は、直前に入力された画像に限られず、フレームバッファ10に格納済みの過去に入力された画像を参照することによって、今回に入力された画像における動き量を算出するようにしてもよい。   The pre-analysis device 19 receives an input image from the outside of the image encoding device 4. The pre-analysis device 19 analyzes the input image and calculates a motion amount for each unit obtained by dividing one image into a predetermined size. The amount of motion is, for example, a motion vector. The prior analysis device 19 stores the calculated amount of motion in the analysis result storage device 20 as a prior analysis result. The pre-analysis device 19 stores the input image after the pre-analysis in the frame buffer 10. Here, the pre-analysis device 19 calculates the amount of motion in the image input this time by referring to the previously input image stored in the frame buffer 10 without being limited to the image input immediately before. You may do it.

解析結果記憶装置20は、入力画像の事前解析結果が一時的に記憶される。事前解析結果としての動き量は、1画面を予め定めた大きさに分割した単位毎に記憶される。   The analysis result storage device 20 temporarily stores the pre-analysis result of the input image. The amount of movement as a result of the prior analysis is stored for each unit obtained by dividing one screen into predetermined sizes.

発生符号量予測装置21は、符号化済みの画像の発生符号量と、符号化途中の画像の符号化済み領域の発生符号量と、符号化途中の画像の動き量とに基づいて、符号化途中の画像の未符号化領域の発生符号量を推定する。   The generated code amount prediction device 21 performs encoding based on the generated code amount of the encoded image, the generated code amount of the encoded region of the image being encoded, and the motion amount of the image being encoded. A generated code amount of an unencoded area of an intermediate image is estimated.

続いて、図14A、Bを参照して、本発明の実施の形態4にかかる動きがある場合における未符号化領域の符号量推定方法について説明する。図14A、Bは、本発明の実施の形態4にかかる動きがある場合における未符号化領域の符号量推定方法を説明するための図である。   Next, with reference to FIGS. 14A and 14B, a code amount estimation method for an uncoded region when there is a motion according to the fourth embodiment of the present invention will be described. FIGS. 14A and 14B are diagrams for explaining a code amount estimation method for an uncoded region when there is a motion according to the fourth embodiment of the present invention.

本実施の形態4では、符号化途中ピクチャの未符号化領域に動きがある場合、事前解析装置19において検出した符号化途中ピクチャの未符号化領域の動きに応じて補正した位置における符号化済みピクチャの発生符号量を利用して、符号化途中ピクチャの未符号化領域の発生符号量を推定する。   In the fourth embodiment, when there is a motion in an unencoded area of a picture in the middle of encoding, it has been encoded at a position corrected in accordance with the motion of the unencoded area of the picture in the middle of encoding detected by the pre-analysis device 19 Using the generated code amount of a picture, the generated code amount of an unencoded area of a picture being encoded is estimated.

事前解析装置19は、図14Aに示すように、ピクチャのマクロブロックライン毎の垂直方向の動き量を算出する。事前解析装置19は、算出した動き量をマクロブロックライン毎に解析結果記憶装置20に格納する。発生符号量予測装置21は、符号化途中ピクチャの未符号化領域の発生符号量を推定するときに、解析結果記憶装置20に格納された動き量に基づいて、未符号化領域の動き量を算出する。ここで、図14Aでは、図6と同様に、1枚のピクチャにマクロブロックラインがNラインある場合について例示している。また、図14では、図6の右図と同様に、符号化途中ピクチャのaで示す範囲は、符号化済み領域であり、符号化途中ピクチャのbで示す範囲は、未符号化領域である。   As shown in FIG. 14A, the pre-analysis device 19 calculates the amount of motion in the vertical direction for each macroblock line of a picture. The prior analysis device 19 stores the calculated amount of motion in the analysis result storage device 20 for each macroblock line. When the generated code amount prediction device 21 estimates the generated code amount of the uncoded region of the picture being encoded, the generated code amount prediction device 21 calculates the motion amount of the uncoded region based on the motion amount stored in the analysis result storage device 20. calculate. Here, FIG. 14A illustrates a case where there are N macroblock lines in one picture, as in FIG. Further, in FIG. 14, as in the right diagram of FIG. 6, the range indicated by a in the middle picture is an encoded area, and the range indicated by b in the middle picture is an uncoded area. .

発生符号量予測装置21は、例えば、図14Aに示すように、符号化途中ピクチャの未符号化領域に含まれるマクロブロックラインの動き量の平均値を、符号化途中ピクチャの未符号化領域の動き量として算出する。なお、未符号化領域の動き量の算出方法は、これに限られない。例えば、符号化途中ピクチャの未符号化領域に含まれるマクロブロックラインの動き量の総和を、未符号化領域の動き量として算出してもよい。例えば、符号化途中ピクチャの未符号化領域に含まれる全てのマクロブロックラインではなく、その中から任意に選択した2つ以上のマクロブロックの平均値又は総和を、未符号化領域の動き量として算出してもよい。例えば、符号化途中ピクチャの未符号化領域に含まれる全てのマクロブロックラインの中間に位置するマクロブロックラインの動き量を、未符号化領域の動き量として算出してもよい。   For example, as illustrated in FIG. 14A, the generated code amount prediction device 21 calculates the average value of the motion amounts of the macroblock lines included in the unencoded area of the in-encoding picture in the unencoded area of the in-encoding picture. Calculated as the amount of movement. Note that the method for calculating the motion amount of the uncoded region is not limited to this. For example, the sum of the motion amounts of the macroblock lines included in the unencoded area of the picture that is being encoded may be calculated as the motion amount of the uncoded area. For example, instead of all the macroblock lines included in the unencoded area of the picture being encoded, the average value or sum of two or more macroblocks arbitrarily selected from them is used as the motion amount of the uncoded area It may be calculated. For example, the motion amount of a macroblock line located in the middle of all the macroblock lines included in the unencoded region of the picture that is being encoded may be calculated as the motion amount of the unencoded region.

図14Aに示すように、未符号化領域に垂直下方向の動きがある場合、図14Bに示すように、符号化途中ピクチャの未符号化領域における画像は、符号化済みピクチャにおいて、ピクチャ中の同じ位置に存在しないことになる。つまり、符号化済みピクチャのうち、符号化途中ピクチャの未符号化領域に対応する領域は、符号化途中ピクチャの未符号化領域よりも、垂直上方向にずれた位置に存在することになる。なお、厳密には、符号化途中ピクチャが、符号化済みピクチャよりも後に表示されるピクチャである場合に、このような関係となる。   As shown in FIG. 14A, when there is a vertical downward motion in the uncoded area, as shown in FIG. 14B, the image in the uncoded area of the picture being coded is It will not be in the same position. That is, among the encoded pictures, the area corresponding to the uncoded area of the picture being coded is located at a position shifted vertically upward from the uncoded area of the picture being coded. Strictly speaking, this relationship is established when the picture being encoded is a picture displayed after the encoded picture.

符号化途中ピクチャの符号化済み領域と、符号化済みピクチャのうち、符号化途中ピクチャの符号化済み領域に対応する領域との間も、同様のことが言える。符号化途中ピクチャの未符号化領域と、それに対応する領域のそれぞれは、符号化途中ピクチャの符号化済み領域と、それに対応する領域のそれぞれと隣接するからである。この場合、図14Bに示すように、符号化途中ピクチャの符号化済み領域における画像は、符号化済みピクチャ内に全てが収まっていなかったことになる。   The same can be said between the encoded region of the in-encoding picture and the region corresponding to the encoded region of the in-encoding picture among the encoded pictures. This is because the unencoded area of the picture being encoded and the area corresponding thereto are adjacent to the encoded area of the picture being encoded and the areas corresponding thereto. In this case, as shown in FIG. 14B, all the images in the encoded area of the picture in the middle of encoding are not included in the encoded picture.

ここで、図14Bにおいて、符号化済みピクチャのa'で示す範囲は、符号化済みピクチャのうち、符号化途中ピクチャの符号化済み領域であるaで示す範囲に対応する領域であり、符号化済みピクチャのb'で示す範囲は、符号化済みピクチャのうち、符号化途中ピクチャの未符号化領域であるbで示す範囲に対応する領域である。そして、a'は、aよりも短くなり、b'は、bと同じ長さとなる。つまり、未符号化領域と、未符号化領域に対応する領域は、ピクチャ中の異なる位置における同一面積の領域となるが、符号化済み領域と、符号化済み領域に対応する領域とは、ピクチャ中の異なる位置における異なる面積の領域となる。   Here, in FIG. 14B, the range indicated by a ′ of the encoded picture is an area corresponding to the range indicated by a that is the encoded area of the picture in the middle of the encoded picture. The range indicated by b ′ of the completed picture is an area corresponding to the range indicated by b, which is an unencoded area of the picture being encoded, among the encoded pictures. Then, a ′ is shorter than a, and b ′ is the same length as b. That is, the uncoded area and the area corresponding to the uncoded area are areas of the same area at different positions in the picture, but the encoded area and the area corresponding to the encoded area are a picture. It becomes the area | region of a different area in a different position inside.

そこで、発生符号量予測装置21は、符号化途中ピクチャの未符号化領域に動きがあると判定した場合は、符号化済みピクチャの発生符号量を補正して、符号化途中ピクチャの未符号化領域の発生符号量を推定する。   Therefore, when the generated code amount prediction device 21 determines that there is a motion in the unencoded area of the halfway encoded picture, the generated code amount prediction apparatus 21 corrects the generated code amount of the encoded picture, Estimate the amount of generated code in a region.

具体的には、符号化途中ピクチャの符号化済み領域の発生符号量がSaである場合、符号化途中ピクチャの未符号化領域の発生符号量Sbを次式(6)によって推定する。ここで、S'aは、符号化済みピクチャのa'で示す範囲の発生符号量であり、S'bは、符号化済みピクチャのb'で示す範囲の発生符号量である。   Specifically, when the generated code amount of the encoded region of the picture in the middle of encoding is Sa, the generated code amount Sb of the uncoded region of the picture in the middle of encoding is estimated by the following equation (6). Here, S′a is the generated code amount in the range indicated by a ′ of the encoded picture, and S′b is the generated code amount in the range indicated by b ′ of the encoded picture.

Figure 0005706759
Figure 0005706759

まず、このように、符号化途中ピクチャのbで示す範囲が、符号化済みピクチャではb'で示す範囲に存在していたと考えられる場合、符号化済みピクチャのb'で示す範囲の発生符号量を、符号化途中ピクチャの未符号化領域であるbで示す範囲に対応する領域の発生符号量として使用する。つまり、符号化途中ピクチャの未符号化領域に対応する領域の位置として、未符号化領域の動き量に応じて補正された位置が決定される。符号化途中ピクチャの符号化済み領域に対応する位置についても同様である。   First, in this way, when it is considered that the range indicated by b of the picture being encoded exists in the range indicated by b ′ in the encoded picture, the generated code amount in the range indicated by b ′ of the encoded picture Is used as the generated code amount of the area corresponding to the range indicated by b which is an uncoded area of the picture in the middle of encoding. That is, the position corrected according to the amount of motion of the uncoded area is determined as the position of the area corresponding to the uncoded area of the picture being coded. The same applies to the position corresponding to the encoded area of the picture being encoded.

しかし、上述したように、符号化途中ピクチャのaで示す範囲は、符号化済みピクチャではa'で示す範囲までしか収まっていない。そのため、符号化済みピクチャのa'で示す範囲当たりの発生符号量S'aを、aで示す範囲当たりの発生符号量に補正して、推定符号量Sbを算出するようにしている。   However, as described above, the range indicated by a in the picture being encoded is only within the range indicated by a ′ in the encoded picture. For this reason, the estimated code amount Sb is calculated by correcting the generated code amount S′a per range indicated by a ′ of the encoded picture to the generated code amount per range indicated by a.

なお、上述した式(6)は、符号化途中ピクチャのaで示す範囲当たりの発生符号量Saを、a'で示す範囲当たりの発生符号量に補正して、推定符号量Sbを算出する次式(7)と等価となる。   It should be noted that the above equation (6) calculates the estimated code amount Sb by correcting the generated code amount Sa per range indicated by a of the picture being encoded to the generated code amount per range indicated by a ′. Equivalent to equation (7).

Figure 0005706759
Figure 0005706759

よって、符号化途中ピクチャの未符号化領域に動きがある場合における未符号化領域の推定符号量Sbは、式(6)及び式(7)のいずれの式によって推定してもよい。つまり、符号化途中ピクチャの未符号化領域に動きがある場合、上述した式(6)又は式(7)のように、発生符号量Sa及び発生符号量S'aのいずれか一方の発生符号量を、他方の発生符号量が算出された面積と同一面積当たりの発生符号量となるように補正して、未符号化領域の発生符号量Sbを推定する。   Therefore, the estimated code amount Sb of the uncoded area when there is a motion in the uncoded area of the picture in the middle of coding may be estimated by either expression (6) or expression (7). That is, when there is a motion in an unencoded area of a picture in the middle of encoding, one of the generated code amount Sa and the generated code amount S′a is generated as in Expression (6) or Expression (7) described above. The amount is corrected so that the other generated code amount becomes the generated code amount per the same area as the calculated area, and the generated code amount Sb of the uncoded region is estimated.

このように、事前解析結果を利用することで、符号化済みピクチャと符号化途中ピクチャとの間に動きがある場合であっても、適切な領域における発生符号量を使用して、未符号化領域の発生符号量を推定することができる。また、事前解析結果を利用することで、符号化済みピクチャと符号化途中ピクチャとの間に動きがある場合であっても、比較対象となる発生符号量を同一面積当たりの発生符号量に補正して、未符号化領域の発生符号量を推定することができる。そのため、本実施の形態4によれば、動きがある場合であっても、精度の低下を抑制しつつ発生符号量を推定することが可能となる。   In this way, by using the pre-analysis result, even if there is a motion between the coded picture and the halfway coded picture, it is possible to use the generated code amount in an appropriate region and The generated code amount of the area can be estimated. Also, by using the pre-analysis result, even if there is a motion between the encoded picture and the intermediate picture, the generated code amount to be compared is corrected to the generated code amount per the same area. Thus, it is possible to estimate the generated code amount of the uncoded area. Therefore, according to the fourth embodiment, it is possible to estimate the generated code amount while suppressing a decrease in accuracy even when there is a motion.

続いて、図15を参照して、本発明の実施の形態4にかかる画像符号化装置4の処理について説明する。図15は、本発明の実施の形態4にかかる画像符号化装置4の処理を示すフローチャートである。ここでは、エンコーダ30における符号量制御パラメタの最適化を例に挙げて説明する。   Next, with reference to FIG. 15, processing of the image encoding device 4 according to the fourth embodiment of the present invention will be described. FIG. 15 is a flowchart showing processing of the image encoding device 4 according to the fourth embodiment of the present invention. Here, the optimization of the code amount control parameter in the encoder 30 will be described as an example.

事前解析装置19は、入力画像として入力されたピクチャの動き量をマクロブロックライン毎に算出する(S31)。なお、ステップS32、33については、実施の形態1におけるステップS1、S2と同様であるため、説明を省略する。   The pre-analysis device 19 calculates the motion amount of the picture input as the input image for each macroblock line (S31). Since steps S32 and 33 are the same as steps S1 and S2 in the first embodiment, description thereof is omitted.

全てのマクロブロックラインを符号化していない場合(S33:NO)、発生符号量予測装置21は、符号化途中ピクチャの未符号化領域に動きがあるか否かを判定する(S34)。ここで、解析結果記憶装置20には、符号化途中ピクチャに含まれるマクロブロックラインのそれぞれにおける動き量が格納されていることになる。そのため、発生符号量予測装置21は、解析結果記憶装置20に格納されたマクロブロックライン毎の動き量に基づいて、符号化途中ピクチャの未符号化領域の動き量を算出する。具体的には、発生符号量予測装置21は、符号化途中ピクチャの未符号化領域のマクロブロックラインの動き量の平均値を、符号化途中ピクチャの未符号化領域の動き量として算出する。発生符号量予測装置21は、算出した未符号化領域の動き量が動きを示している場合、未符号化領域に動きがあると判定する。   When all the macroblock lines are not encoded (S33: NO), the generated code amount prediction device 21 determines whether or not there is a motion in the unencoded area of the picture being encoded (S34). Here, the analysis result storage device 20 stores the amount of motion in each of the macroblock lines included in the picture being encoded. Therefore, the generated code amount prediction device 21 calculates the motion amount of the unencoded area of the picture being encoded based on the motion amount for each macroblock line stored in the analysis result storage device 20. Specifically, the generated code amount prediction device 21 calculates the average value of the motion amounts of the macroblock lines in the uncoded region of the picture being coded as the motion amount of the uncoded region of the picture being coded. The generated code amount prediction device 21 determines that there is a motion in the uncoded region when the calculated motion amount in the uncoded region indicates a motion.

未符号化領域に動きがないと判定した場合(S34:No)、発生符号量予測装置21は、実施の形態1にかかるステップS3と同様に、符号化済みピクチャの発生符号量に基づいて、符号化途中ピクチャの未符号化領域の推定符号量を推定する(S35)。   When it is determined that there is no motion in the uncoded region (S34: No), the generated code amount prediction device 21 is based on the generated code amount of the encoded picture, similarly to step S3 according to the first embodiment. The estimated code amount of the unencoded area of the picture being encoded is estimated (S35).

未符号化領域に動きがあると判定した場合(S34:Yes)、発生符号量予測装置21は、符号化途中ピクチャの未符号化領域の動き量に応じて、符号化済みピクチャのうち、符号化途中ピクチャの符号化済み領域及び未符号化領域のそれぞれに対応する領域の位置を補正する。そして、発生符号量予測装置21は、上述した式(6)又は(7)によって、発生符号量S'a及び発生符号量Saが同一面積当たりの発生符号量となるように補正した上で、発生符号量S'a及びS'bの比率に基づいて、発生符号量Saから未符号化領域の発生符号量Sbを推定する(S36)。   If it is determined that there is motion in the unencoded area (S34: Yes), the generated code amount prediction device 21 selects the code among the encoded pictures according to the amount of motion in the unencoded area of the in-encoding picture. The position of the region corresponding to each of the encoded region and the unencoded region of the picture in process of correction is corrected. The generated code amount prediction device 21 corrects the generated code amount S′a and the generated code amount Sa so as to be the generated code amount per the same area by the above-described equation (6) or (7). Based on the ratio between the generated code amounts S′a and S′b, the generated code amount Sb in the uncoded region is estimated from the generated code amount Sa (S36).

ここで、未符号化領域に動きがある場合において、符号化済みピクチャのうち、符号化途中ピクチャの未符号化領域に対応する領域の動き量に応じた位置を特定する方法は、どのような方法であってもよい。一例としては、符号化途中ピクチャの未符号化領域の動き量に基づいて、未符号化領域とそれに対応するべき領域とが何マクロブロックライン分ずれているかを導き出すことができる情報を画像符号化装置4が有する記憶装置(図示せず)に予め用意しておく。この情報は、例えば、動き量からマクロブロックライン数を得ることができるテーブル又は関数等としてよい。そして、発生符号量予測装置21が、この情報を参照して、未符号化領域の動き量から、未符号化領域に対応する領域の動き量に応じた位置を特定できるようにする。なお、発生符号量については、実施の形態1と同様に、対象とする領域のマクロブロックラインの発生符号量の総和によって算出することができる。   Here, in the case where there is motion in the unencoded area, what is the method for specifying the position corresponding to the motion amount of the area corresponding to the unencoded area of the halfway encoded picture among the encoded pictures? It may be a method. As an example, based on the amount of motion of an unencoded area of a picture that is being encoded, information that can be used to derive how many macroblock lines the uncoded area and the area that should correspond to it are image-encoded A storage device (not shown) included in the device 4 is prepared in advance. This information may be, for example, a table or function that can obtain the number of macroblock lines from the amount of motion. Then, the generated code amount prediction device 21 refers to this information and can specify the position according to the amount of motion of the region corresponding to the uncoded region from the amount of motion of the uncoded region. Note that the generated code amount can be calculated by the sum of the generated code amounts of the macroblock lines in the target region as in the first embodiment.

発生符号量予測装置21は、推定した未符号化領域の発生符号量Sbを示す推定符号量情報を符号量制御装置13に出力する。以降、ステップS37〜S39の処理については、実施の形態1におけるステップS4〜S6と同様であるため、説明を省略する。   The generated code amount prediction device 21 outputs estimated code amount information indicating the estimated generated code amount Sb of the uncoded region to the code amount control device 13. Henceforth, about the process of step S37-S39, since it is the same as that of step S4-S6 in Embodiment 1, description is abbreviate | omitted.

以上に説明したように、本実施の形態4では、符号化中フレームの動き量に基づいて、符号化中フレームに動きがあると判定した場合、符号化済み領域及び未符号化領域のそれぞれに対応する領域の位置を、符号化中フレームにおける動き量に応じて補正するようにしている。   As described above, in the fourth embodiment, when it is determined that there is motion in the frame being encoded based on the motion amount of the frame being encoded, each of the encoded region and the unencoded region is displayed. The position of the corresponding region is corrected according to the amount of motion in the frame being encoded.

これによれば、符号化中フレームと、符号化中フレームと相関の高い符号化済みフレームとの間に動きがある場合であっても、符号化済みフレームの符号量分布の適切な位置を参考にして、未符号化領域の符号量を高い精度で推定することが可能となる。したがって、高い精度で推定された未符号化領域の符号量に基づいて、適切な符号量制御パラメタを決定することができるため、符号化したときにおけるフレームの画質の劣化を抑制することができる。   According to this, even if there is a motion between the encoded frame and the encoded frame having a high correlation with the encoded frame, the appropriate position of the code amount distribution of the encoded frame is referred to. Thus, it is possible to estimate the code amount of the uncoded area with high accuracy. Therefore, since an appropriate code amount control parameter can be determined based on the code amount of the unencoded area estimated with high accuracy, it is possible to suppress deterioration of the image quality of the frame when encoded.

なお、上述した本実施の形態4では、未符号化領域に垂直下方向に動きがある場合について例示したが、図16Aに例示するように、未符号化領域に垂直上方向に動きがある場合についても、同様に、符号化済みピクチャの発生符号量を補正して、符号化途中ピクチャの未符号化領域の発生符号量を推定するようにしてもよい。図16Aに示すように、未符号化領域に垂直上方向の動きがある場合、図16Bに示すように、符号化途中ピクチャのbで示す範囲が、符号化済みピクチャではb'で示す範囲までしか収まっていないことになる。ここで、N、a、b、a'、及びb'については、図14A及び図14Bと同様であるため、説明を省略する。ただし、図16Bでは、a'は、aと同じ長さとなり、b'は、bよりも短くなる。   In the fourth embodiment described above, the case where there is a movement in the vertically downward direction in the uncoded area is exemplified, but as shown in FIG. 16A, the case where there is a movement in the vertically upward direction in the uncoded area. Similarly, the generated code amount of the encoded picture may be corrected to estimate the generated code amount of the unencoded area of the picture being encoded. As shown in FIG. 16A, when there is a vertical upward motion in the unencoded area, the range indicated by b of the halfway encoded picture reaches the range indicated by b ′ in the encoded picture as shown in FIG. 16B. It will only fit. Here, since N, a, b, a ′, and b ′ are the same as those in FIGS. 14A and 14B, description thereof is omitted. However, in FIG. 16B, a ′ has the same length as a, and b ′ is shorter than b.

このような場合、符号化途中ピクチャの未符号化領域の発生符号量Sbを次式(8)によって推定する。Sa、S'a、及びS'bについては、式(6)及び(7)と同様であるため、説明を省略する。   In such a case, the generated code amount Sb of the unencoded area of the picture being encoded is estimated by the following equation (8). Since Sa, S′a, and S′b are the same as in equations (6) and (7), description thereof is omitted.

Figure 0005706759
Figure 0005706759

このように、符号化済みピクチャのb'で示す範囲当たりの発生符号量S'bを、bで示す範囲当たりの発生符号量に補正して、推定符号量Sbを算出するようにすることもできる。   In this manner, the estimated code amount Sb may be calculated by correcting the generated code amount S′b per range indicated by b ′ of the encoded picture to the generated code amount per range indicated by b. it can.

つまり、実施の形態4にかかる、動きがある場合における未符号化領域の符号量推定方法は、符号化途中ピクチャの符号化済み領域の発生符号量と、符号化途中ピクチャの符号化済み領域に対応する領域の発生符号量とが同一面積当たりの発生符号量となるように、いずれかの発生符号量を補正するものに限られない。符号化途中ピクチャの未符号化領域の発生符号量と、符号化途中ピクチャの未符号化領域に対応する領域の発生符号量とが同一面積当たりの発生符号量となるように、符号化途中ピクチャの未符号化領域に対応する領域の発生符号量を補正するようにしてもよい。   That is, according to the fourth embodiment, the code amount estimation method for an unencoded area when there is a motion is performed on the generated code amount of the encoded area of the picture being encoded and the encoded area of the picture being encoded. It is not limited to correcting one of the generated code amounts so that the generated code amount of the corresponding region is the generated code amount per the same area. The coding intermediate picture so that the generated code amount of the uncoded area of the coding intermediate picture and the generated code quantity of the area corresponding to the uncoded area of the coding intermediate picture become the generated code quantity per the same area. The generated code amount in the area corresponding to the uncoded area may be corrected.

また、これらの補正は、上述した実施の形態4のように、完全な同一面積当たりの発生符号量に補正するものに限られず、符号量制御に影響を与えないと考えられる程度に略同一面積当たりの発生符号量に補正するようにしてもよい。一例としては、それぞれの面積の差が、いずれかの面積の数パーセント以内となる程度に略同一面積当たりの発生符号量に補正するようにしてもよい。   Further, these corrections are not limited to correction to the generated code amount per the same area as in the above-described fourth embodiment, but are substantially the same area to the extent that it is considered that the code amount control is not affected. You may make it correct | amend to the amount of generated codes per hit. As an example, the generated code amount per substantially the same area may be corrected so that the difference between the areas is within a few percent of any one area.

また、上述した本実施の形態4では、符号化途中ピクチャの未符号化領域の動き量を算出して使用するようにしているが、これに限られない。例えば、同様にして、符号化途中ピクチャ全体の動き量、又は、符号化途中ピクチャの符号化済みピクチャの動き量を算出して使用するようにしてもよい。   In the fourth embodiment described above, the motion amount of the unencoded area of the picture being encoded is calculated and used, but the present invention is not limited to this. For example, in the same manner, the motion amount of the entire picture being encoded or the motion amount of the encoded picture of the intermediate picture may be calculated and used.

なお、本実施の形態4は、実施の形態3と組み合わせて実施するようにしてもよい。例えば、発生符号量予測装置21は、シーンの性質が変化したと判定した場合に(S24:No)、未符号化部分に動きがあるか否かを判定するようにし(S34)、判定結果に応じて上述の処理を実行するようにする(S35、S36)。この場合、事前解析装置19は、特徴量とともに動き量も算出するようにする。   The fourth embodiment may be implemented in combination with the third embodiment. For example, when it is determined that the scene property has changed (S24: No), the generated code amount prediction device 21 determines whether or not there is motion in the uncoded part (S34), Accordingly, the above-described processing is executed (S35, S36). In this case, the prior analysis device 19 calculates the motion amount together with the feature amount.

発明の実施の形態5.
続いて、図17を参照して、本発明の実施の形態5にかかる画像符号化装置5の構成について説明する。図17は、本発明の実施の形態5にかかる画像符号化装置5の構成図である。なお、実施の形態1〜4と同様の構成要素については、同一の符号を付し、説明を省略する。
Embodiment 5 of the Invention
Subsequently, the configuration of the image encoding device 5 according to the fifth embodiment of the present invention will be described with reference to FIG. FIG. 17 is a configuration diagram of the image encoding device 5 according to the fifth embodiment of the present invention. In addition, about the component similar to Embodiment 1-4, the same code | symbol is attached | subjected and description is abbreviate | omitted.

画像符号化装置5は、フレームバッファ10、発生符号量記憶装置11、ストリーム結合装置14、事前解析装置19、解析結果記憶装置20、発生符号量予測装置22、バッファ占有量予測装置23、符号量制御装置24、エンコーダ30〜33、及びストリームバッファ40〜43を有する。   The image encoding device 5 includes a frame buffer 10, a generated code amount storage device 11, a stream combination device 14, a pre-analysis device 19, an analysis result storage device 20, a generated code amount prediction device 22, a buffer occupation amount prediction device 23, a code amount. A control device 24, encoders 30 to 33, and stream buffers 40 to 43 are included.

発生符号量予測装置22は、実施の形態3にかかる発生符号量予測装置18と同様にして、符号化途中ピクチャの未符号化領域の発生符号量を推定するが、さらに符号化途中ピクチャの符号化済み領域の発生符号量と、符号化途中ピクチャの符号化済み領域及び未符号化領域のそれぞれの発生符号量及び推定符号量とをバッファ占有量予測装置23に出力する。ここで、発生符号量予測装置22は、バッファ占有量の予測に必要な発生符号量を発生符号量記憶装置11から取得してバッファ占有量予測装置23に出力する。   The generated code amount prediction device 22 estimates the generated code amount of the unencoded area of the coding intermediate picture in the same manner as the generated code amount prediction device 18 according to the third embodiment. The generated code amount of the encoded region and the generated code amount and estimated code amount of each of the encoded region and unencoded region of the picture being encoded are output to the buffer occupancy prediction device 23. Here, the generated code amount prediction device 22 acquires the generated code amount necessary for predicting the buffer occupancy amount from the generated code amount storage device 11 and outputs it to the buffer occupancy amount prediction device 23.

バッファ占有量予測装置23は、発生符号量予測装置22から出力された発生符号量及び推定符号量に基づいて、デコーダ側の仮想バッファのバッファ占有量の推移を予測する。ここで、デコーダ側の仮想バッファとは、例えば、MPEG−2及びH.264等の動画像符号化規格において規定される仮想デコーダ・モデルにおけるバッファである。なお、バッファ占有量予測装置23は、直接、発生符号量記憶装置11から発生符号量を取得するようにしてもよい。   The buffer occupation amount prediction device 23 predicts the transition of the buffer occupation amount of the virtual buffer on the decoder side based on the generated code amount and the estimated code amount output from the generated code amount prediction device 22. Here, the virtual buffer on the decoder side is, for example, MPEG-2 and H.264. It is a buffer in a virtual decoder model defined in a moving picture coding standard such as H.264. Note that the buffer occupation amount prediction device 23 may acquire the generated code amount directly from the generated code amount storage device 11.

符号量制御装置24は、発生符号量予測装置22によって推定された未符号化領域の推定符号量と、未符号化領域に割り当て可能な目標符号量との差分に加えて、さらにバッファ占有量予測装置23によって予測されたデコーダ側の仮想バッファのバッファ占有量の推移に基づいて、符号量制御パラメタを決定する。   In addition to the difference between the estimated code amount of the uncoded region estimated by the generated code amount prediction device 22 and the target code amount that can be assigned to the uncoded region, the code amount control device 24 further predicts the buffer occupancy amount. Based on the transition of the buffer occupation amount of the decoder-side virtual buffer predicted by the device 23, the code amount control parameter is determined.

続いて、図18を参照して、本発明の実施の形態5にかかるバッファ占有量の推定方法について説明する。図18は、本発明の実施の形態5にかかるバッファ占有量の推定方法によって推定されたデコーダ側の仮想バッファのバッファ占有量を示す図である。なお、図18では、図2におけるピクチャ5の符号化終了時点において、デコーダ側の仮想バッファのバッファ占有量を推定する場合について例示している。   Next, a buffer occupancy estimation method according to Embodiment 5 of the present invention will be described with reference to FIG. FIG. 18 is a diagram illustrating the buffer occupancy of the decoder-side virtual buffer estimated by the buffer occupancy estimation method according to the fifth embodiment of the present invention. FIG. 18 illustrates a case where the buffer occupation amount of the virtual buffer on the decoder side is estimated at the end of encoding of picture 5 in FIG.

バッファ占有量予測装置23は、図2のピクチャ5の符号化終了時点で、符号化途中ピクチャであるピクチャ6〜9のそれぞれの符号化終了時点における、デコーダ側の仮想バッファのバッファ占有量を次式(9)〜(12)によって推定する。ここで、B(x)は、ピクチャxの符号化終了時点におけるデコーダ側の仮想バッファのバッファ占有量である。言い換えると、B(x)は、デコーダ側において仮想バッファからピクチャxを引き抜く前におけるバッファ占有量である。S(x)は、ピクチャxの発生符号量である。Sa(x)は、ピクチャxの符号化済み領域の発生符号量であり、Sb(x)は、ピクチャxの未符号化領域の発生符号量である。Rtは、予め定められたビットレートRと、ピクチャ符号化間隔Δtとを乗じた値である。   The buffer occupancy prediction device 23 calculates the buffer occupancy of the virtual buffer on the decoder side at the end of encoding of each of the pictures 6 to 9 which are pictures being encoded at the end of encoding of the picture 5 in FIG. It estimates by Formula (9)-(12). Here, B (x) is the buffer occupation amount of the virtual buffer on the decoder side at the end of the encoding of the picture x. In other words, B (x) is the buffer occupancy before the picture x is extracted from the virtual buffer on the decoder side. S (x) is the generated code amount of picture x. Sa (x) is the generated code amount of the encoded region of picture x, and Sb (x) is the generated code amount of the uncoded region of picture x. Rt is a value obtained by multiplying a predetermined bit rate R and the picture encoding interval Δt.

Figure 0005706759
Figure 0005706759

図2におけるピクチャ5の符号化終了時点では、図3に示したように、ピクチャ6〜8のそれぞれは符号化途中である。そのため、上述した式(9)〜(12)のように、ピクチャ6〜8のそれぞれの未符号化領域の推定符号量Sb(6)、Sb(7)、Sb(8)と、ピクチャ5〜8のそれぞれの符号化済み領域の発生符号量S(5)、Sa(6)、Sa(7)、Sa(8)とに基づいて、符号化途中ピクチャ6〜8、及び、次に符号化を開始するピクチャ9のそれぞれの符号化終了時点におけるバッファ占有量B(6)〜B(9)の推移を推定する。   At the end of encoding of picture 5 in FIG. 2, as shown in FIG. 3, each of pictures 6 to 8 is in the middle of encoding. Therefore, as in the above-described equations (9) to (12), the estimated code amounts Sb (6), Sb (7), and Sb (8) of the unencoded areas of the pictures 6 to 8, and the pictures 5 to 5, respectively. 8 based on the generated code amounts S (5), Sa (6), Sa (7), Sa (8) of each of the encoded areas of 8 and the next encoding The transition of the buffer occupancy B (6) to B (9) at the end of encoding of each picture 9 that starts is estimated.

さらに、式(9)〜(12)は、次式(13)として表すことができる。式(13)は、あるピクチャnの符号化終了時点において、そのピクチャn以降に符号化が開始された符号化途中ピクチャ、又は、次に符号化を開始するピクチャであるピクチャiの符号化終了時点におけるデコーダ側の仮想バッファのバッファ占有量を算出する式となる。なお、式(13)に上述した式(9)のケースを当てはめた場合は、(Sa(5)+Sb(5))=S(5)となる。ピクチャ5は、符号化が終了しているため、Sa(5)=S(5)となり、Sb(5)=0となるからである。また、B(1)は、仮想バッファサイズの大きさまでの値で任意の値に設定する。例えば、仮想バッファサイズから適当なマージンを差し引いた値にする。   Furthermore, Formula (9)-(12) can be represented as following Formula (13). The expression (13) is obtained when the encoding of a picture n is completed, or the picture i that is in the middle of encoding after the picture n or the picture i that is the next picture to be encoded is ended. This is an equation for calculating the buffer occupation amount of the virtual buffer on the decoder side at the time. In addition, when the case of the above-mentioned formula (9) is applied to the formula (13), (Sa (5) + Sb (5)) = S (5). This is because the picture 5 has been encoded and therefore Sa (5) = S (5) and Sb (5) = 0. B (1) is set to an arbitrary value up to the size of the virtual buffer size. For example, a value obtained by subtracting an appropriate margin from the virtual buffer size.

Figure 0005706759
Figure 0005706759

符号量制御装置24は、バッファ占有量予測装置23によって推定されたバッファ占有量に基づいて、仮想バッファが破綻しないように符号量制御を行う。例えば、推定されたバッファ占有量が大きく、オーバーフローが発生する可能性がある場合は、発生符号量を増加させるように制御する。逆に、推定されたバッファ占有量が小さく、アンダーフローが発生する可能性がある場合は、発生符号量を低減するように制御する。発生符号量の制御は、上述したように、量子化パラメタを調整することによって行う。   The code amount control device 24 performs code amount control based on the buffer occupancy estimated by the buffer occupancy prediction device 23 so that the virtual buffer does not fail. For example, if the estimated buffer occupancy is large and an overflow may occur, control is performed to increase the generated code amount. Conversely, if the estimated buffer occupancy is small and underflow may occur, control is performed to reduce the amount of generated code. As described above, the amount of generated code is controlled by adjusting the quantization parameter.

符号量制御装置24は、オーバーフローが発生する可能性がある否かを、例えば、B(i)が、予め定められた仮想バッファのバッファサイズより大きいか否か判定する。つまり、符号量制御装置24は、B(i)がバッファサイズより大きい場合に、オーバーフローが発生する可能性があると判定する。また、オーバーフローが発生する可能性がある否かは、B(i)とバッファサイズとの差分が予め定めた閾値よりも小さいか否かによって判定するようにしてもよい。つまり、B(i)とバッファサイズとの差分が予め定めた閾値よりも小さい場合に、オーバーフローが発生する可能性があると判定する。   The code amount control device 24 determines whether or not there is a possibility of overflow, for example, whether or not B (i) is larger than the buffer size of a predetermined virtual buffer. That is, the code amount control device 24 determines that an overflow may occur when B (i) is larger than the buffer size. Further, whether or not there is a possibility of overflow may be determined based on whether or not the difference between B (i) and the buffer size is smaller than a predetermined threshold. That is, when the difference between B (i) and the buffer size is smaller than a predetermined threshold value, it is determined that there is a possibility of overflow.

また、符号量制御装置24は、アンダーフローが発生する可能性がある否かを、例えば、仮想バッファからピクチャを引き抜いた後におけるバッファ占有量が、0未満となるか否かによって判定する。つまり、符号量制御装置24は、仮想バッファからピクチャを引き抜いた後のバッファ占有量が、バッファサイズより小さい場合に、アンダーフローが発生する可能性があると判定する。また、アンダーフローが発生する可能性がある否かは、仮想バッファからピクチャ引き抜いた後のバッファ占有量が予め定めた閾値よりも小さいか否かによって判定するようにしてもよい。つまり、仮想バッファからピクチャ引き抜いた後のバッファ占有量が予め定めた閾値よりも小さい場合に、アンダーフローが発生する可能性があると判定する。   Further, the code amount control device 24 determines whether or not underflow may occur, for example, based on whether or not the buffer occupancy after extracting a picture from the virtual buffer is less than zero. That is, the code amount control device 24 determines that underflow may occur when the buffer occupation amount after extracting a picture from the virtual buffer is smaller than the buffer size. Further, whether or not there is a possibility of underflow may be determined based on whether or not the buffer occupation amount after the picture is extracted from the virtual buffer is smaller than a predetermined threshold. That is, it is determined that there is a possibility that underflow may occur when the buffer occupancy after extracting a picture from the virtual buffer is smaller than a predetermined threshold.

ここで、仮想バッファからのピクチャ引き抜き後のバッファ占有量は、B(i)−(Sa(i)+Sb(i))となる。つまり、仮想バッファからのピクチャ引き抜き後のバッファ占有量は、次式(14)によって表すことができる。   Here, the buffer occupation amount after the picture is extracted from the virtual buffer is B (i) − (Sa (i) + Sb (i)). That is, the buffer occupancy after drawing a picture from the virtual buffer can be expressed by the following equation (14).

Figure 0005706759
Figure 0005706759

よって、符号量制御装置24は、例えば、未符号化領域の推定符号量が、未符号化領域の目標符号量よりも大きい場合であっても、オーバーフローが発生する可能性があるときは、発生符号量を低減させないように制御する。また、符号量制御装置24は、例えば、未符号化領域の推定符号量が、未符号化領域の目標符号量よりも小さい場合であっても、アンダーフローが発生する可能性があるときは、発生符号量を増加させないように制御するようにしてもよい。   Therefore, the code amount control device 24 generates, for example, when there is a possibility of overflow even when the estimated code amount of the uncoded region is larger than the target code amount of the uncoded region. Control is performed so as not to reduce the code amount. Also, the code amount control device 24, for example, when underflow may occur even when the estimated code amount of the uncoded region is smaller than the target code amount of the uncoded region, Control may be made so as not to increase the generated code amount.

なお、本実施の形態5にかかる画像符号化装置5におけるその他の符号化における処理内容については、図12を参照して説明した実施の形態3にかかる画像符号化装置3の処理と同様となるため、説明を省略する。   The processing contents in other encodings in the image encoding device 5 according to the fifth embodiment are the same as those of the image encoding device 3 according to the third embodiment described with reference to FIG. Therefore, the description is omitted.

以上に説明したように、本実施の形態5では、バッファの占有量の推移において、バッファから符号化中フレームを引き抜いたときのバッファの占有量を、符号化中フレームの符号化済み領域の符号量と、発生符号量予測装置22によってその符号化済み領域の符号量から推定された未符号化領域の符号量とに基づいて算出した符号化中フレームの符号量によって推定するようにしている。   As described above, in the fifth embodiment, in the transition of the buffer occupancy, the buffer occupancy when the encoded frame is extracted from the buffer is used as the code of the encoded area of the encoded frame. It is estimated by the code amount of the frame being encoded that is calculated based on the amount and the code amount of the uncoded region estimated from the code amount of the encoded region by the generated code amount prediction device 22.

これによれば、発生符号量が確定している符号化済み領域の発生符号量と、発生符号量予測装置22によって高い精度で推定された未符号化領域の推定符号量とに基づいて、ピクチャの発生符号量を高い精度で算出することができる。よって、仮想デコーダにおけるバッファの占有量の推移を高い精度で推定することができる。そのため、推定されたバッファ占有量の推移に基づいて、仮想デコーダにおけるバッファが破綻しないように、より正確に符号量制御を行うことができる。   According to this, based on the generated code amount of the encoded region for which the generated code amount is fixed and the estimated code amount of the uncoded region estimated with high accuracy by the generated code amount prediction device 22, Can be calculated with high accuracy. Therefore, the transition of the buffer occupancy in the virtual decoder can be estimated with high accuracy. Therefore, the code amount control can be performed more accurately based on the estimated transition of the buffer occupancy so that the buffer in the virtual decoder does not fail.

つまり、MPEG−2及びH.264等の動画像符号化の規格に定められた仮想デコーダのバッファの制約を考慮して、規格に対応したビットストリームを生成することができる。言い換えると、規格の制約を順守しつつ、適切な符号量制御が可能となる。   That is, MPEG-2 and H.264. A bit stream corresponding to the standard can be generated in consideration of a virtual decoder buffer restriction defined in a moving picture coding standard such as H.264. In other words, appropriate code amount control can be performed while complying with the restrictions of the standard.

なお、上述した本実施の形態5では、発生符号量予測装置22が、実施の形態3にかかる発生符号量予測装置18と同様にして、符号化途中ピクチャの未符号化領域の発生符号量を推定する場合について例示したが、これに限られない。例えば、発生符号量予測装置22が、実施の形態1にかかる発生符号量予測装置12と同様に、符号化済みピクチャの発生符号量と、符号化途中ピクチャの符号化済み領域の発生符号量とに基づいて、符号化途中ピクチャの未符号化領域の発生符号量を推定するものであってもよい。また、発生符号量予測装置22が、実施の形態2にかかる発生符号量予測装置17と同様に、符号化途中ピクチャの符号化済み領域の発生符号量と、符号化途中ピクチャの特徴量とに基づいて、符号化途中ピクチャの未符号化領域の発生符号量を推定するものであってもよい。また、発生符号量予測装置22が、実施の形態4にかかる発生符号量予測装置21と同様に、符号化済みピクチャの発生符号量と、符号化途中ピクチャの符号化済み領域の発生符号量と、符号化途中ピクチャの動き量とに基づいて、符号化途中ピクチャの未符号化領域の発生符号量を推定するものであってもよい。   In the fifth embodiment described above, the generated code amount prediction device 22 determines the generated code amount of the uncoded area of the picture being encoded in the same manner as the generated code amount prediction device 18 according to the third embodiment. Although illustrated about the case where it estimates, it is not restricted to this. For example, similarly to the generated code amount prediction device 12 according to the first exemplary embodiment, the generated code amount prediction device 22 generates the generated code amount of the encoded picture, and the generated code amount of the encoded region of the intermediate picture. Based on the above, the generated code amount of the unencoded area of the picture being encoded may be estimated. Similarly to the generated code amount prediction device 17 according to the second exemplary embodiment, the generated code amount prediction device 22 converts the generated code amount in the encoded region of the in-encoding picture and the feature amount of the in-encoding picture. Based on this, the generated code amount of the unencoded area of the picture being encoded may be estimated. Similarly to the generated code amount prediction apparatus 21 according to the fourth embodiment, the generated code amount prediction apparatus 22 generates the generated code amount of the encoded picture, and the generated code amount of the encoded area of the intermediate picture. The generated code amount of the unencoded area of the picture being coded may be estimated based on the amount of motion of the picture being coded.

発明の実施の形態6.
続いて、図19を参照して、本発明の実施の形態6にかかる画像符号化装置6の構成について説明する。図19は、本発明の実施の形態6にかかる画像符号化装置6の構成図である。なお、実施の形態1〜5と同様の構成要素については、同一の符号を付して、説明を省略する。
Embodiment 6 of the Invention
Subsequently, the configuration of the image encoding device 6 according to the sixth embodiment of the present invention will be described with reference to FIG. FIG. 19 is a configuration diagram of the image encoding device 6 according to the sixth embodiment of the present invention. In addition, about the component similar to Embodiment 1-5, the same code | symbol is attached | subjected and description is abbreviate | omitted.

画像符号化装置6は、フレームバッファ10、発生符号量記憶装置11、事前解析装置19、解析結果記憶装置20、発生符号量予測装置22、バッファ占有量予測装置23、符号量制御装置24、初期遅延量計算装置25、ストリーム修正位置記憶装置26、ストリーム結合装置27、エンコーダ30〜33、及びストリームバッファ40〜43を有する。   The image encoding device 6 includes a frame buffer 10, a generated code amount storage device 11, a pre-analysis device 19, an analysis result storage device 20, a generated code amount prediction device 22, a buffer occupation amount prediction device 23, a code amount control device 24, an initial value The apparatus includes a delay amount calculation device 25, a stream correction position storage device 26, a stream combination device 27, encoders 30 to 33, and stream buffers 40 to 43.

初期遅延量計算装置25は、デコーダ側の仮想バッファにおけるピクチャの初期遅延量の確定後に、確定した正しいピクチャの初期遅延量を計算する。初期遅延量計算装置25は、計算した正しい初期遅延量をストリーム結合装置27に出力する。   The initial delay amount calculation device 25 calculates the determined initial delay amount of the correct picture after the initial delay amount of the picture in the virtual buffer on the decoder side is determined. The initial delay amount calculation device 25 outputs the calculated correct initial delay amount to the stream combination device 27.

ストリーム修正位置記憶装置26は、ストリームバッファ40〜43上において、初期遅延量データの記録が開始されている位置を示す初期遅延量データ開始位置データと、初期遅延量データがとり得る最大のビット量を示す初期遅延量データビット量とが格納されている。ストリーム修正位置記憶装置26は、初期遅延量データ開始位置データ及び初期遅延量データビット量を記憶するための任意の記憶装置を含む。   In the stream correction position storage device 26, the initial delay amount data start position data indicating the position where the recording of the initial delay amount data is started on the stream buffers 40 to 43, and the maximum bit amount that the initial delay amount data can take. Is stored as an initial delay amount data bit amount. The stream correction position storage device 26 includes an arbitrary storage device for storing the initial delay amount data start position data and the initial delay amount data bit amount.

ストリーム結合装置27は、実施の形態1〜5のそれぞれにおけるストリーム結合装置14と同様に、ストリームバッファ40〜43のそれぞれに記憶されたビットストリームを結合して1つのビットストリームを生成するが、さらにビットストリーム中の初期遅延量データを、初期遅延量計算装置25から出力された正しい初期遅延量に置き換える。ストリーム結合装置27は、ビットストリームを結合するための作業用の任意の記憶装置を含むようにしてもよい。   The stream combiner 27 generates a single bitstream by combining the bitstreams stored in the stream buffers 40 to 43 as in the stream combiner 14 in each of the first to fifth embodiments. The initial delay amount data in the bitstream is replaced with the correct initial delay amount output from the initial delay amount calculation device 25. The stream combining device 27 may include an arbitrary storage device for working for combining the bit streams.

続いて、図20及び図21を参照して、MPEG−2及びH.264等の動画符号化規格においてビットストリームを生成する際における問題点について説明する。図20は、MPEG−2等の動画符号化規格における1ピクチャのビットストリームの構成を示す図である。図21は、図2に示す場合において、ピクチャ5の符号化終了時点で推定された仮想バッファのバッファ占有量の推移と、ピクチャ8の符号化終了によって確定した実際の仮想バッファのバッファ占有量の推移とを示す図である。   Subsequently, referring to FIG. 20 and FIG. Problems in generating a bitstream in the moving picture coding standard such as H.264 will be described. FIG. 20 is a diagram showing the configuration of a bit stream of one picture in the moving picture coding standard such as MPEG-2. FIG. 21 shows the transition of the buffer occupancy of the virtual buffer estimated at the end of encoding of picture 5 and the buffer occupancy of the actual virtual buffer determined by the end of encoding of picture 8 in the case shown in FIG. It is a figure which shows transition.

図20に示すように、MPEG−2では、1ピクチャのビットストリームには、ピクチャヘッダと、マクロブロック符号領域とが含まれる。ピクチャヘッダには、初期遅延量データが格納される初期遅延データ領域が含まれている。初期遅延量データは、仮想デコーダ・モデルにおけるピクチャの初期遅延量を示す。マクロブロック符号領域は、符号化されたマクロブロックのデータが格納される。つまり、マクロブロック符号領域には、ピクチャを符号化したデータが格納される。H.264でも同様に、補助的な付加情報として初期遅延量データを含むデータ領域が、マクロブロック符号領域の前に配置される。なお以下の説明では、マクロブロック符号領域の前に配置されており、H.264で定義されているピクチャパラメタセットや補助的な付加情報等のように、ピクチャ層に関する情報が符号化されたデータを含むデータ領域を、ピクチャヘッダと呼ぶことにする。   As shown in FIG. 20, in MPEG-2, a bit stream of one picture includes a picture header and a macroblock code area. The picture header includes an initial delay data area in which initial delay amount data is stored. The initial delay amount data indicates the initial delay amount of the picture in the virtual decoder model. The macro block code area stores encoded macro block data. That is, data obtained by coding a picture is stored in the macroblock code area. H. Similarly, in H.264, a data area including initial delay amount data as auxiliary additional information is arranged in front of the macroblock code area. In the following description, it is arranged before the macroblock code area. A data area including data in which information relating to a picture layer is encoded, such as a picture parameter set defined in H.264 and auxiliary additional information, is referred to as a picture header.

このように、MPEG−2及びH.264等の動画符号化規格では、初期遅延量データがピクチャヘッダに含まれている。また、このような動画符号化規格では、初期遅延量データは、予め定められたビット数で表現される固定長のデータか、あるいは、初期遅延量を表現可能な最小限のビット数で表現される可変長のデータとなる。初期遅延量データが可変長のデータとして表現される場合、初期遅延量データ領域は、初期遅延量データに応じたサイズとなる。したがって、初期遅延量データ領域が含まれるピクチャヘッダも、初期遅延量データに応じたサイズとなる。   Thus, MPEG-2 and H.264 In a moving picture coding standard such as H.264, initial delay amount data is included in a picture header. In addition, in such a moving picture coding standard, the initial delay amount data is expressed by a fixed-length data expressed by a predetermined number of bits or a minimum number of bits that can express the initial delay amount. Variable length data. When the initial delay amount data is expressed as variable length data, the initial delay amount data area has a size corresponding to the initial delay amount data. Therefore, the picture header including the initial delay amount data area also has a size corresponding to the initial delay amount data.

ここで、規格では、ピクチャヘッダは、1バイト単位でアライメントされる。つまり、ピクチャヘッダのビット量は、8ビット(1バイト)の倍数となる。例えば、上述したピクチャ層に関する情報のような、ピクチャヘッダに含まれるデータが87ビットで表現可能な場合、ピクチャヘッダにおける残りの1ビットは、スタッフィングビットで埋められる。つまり、ピクチャヘッダのうち、スタッフィングビットを除いたデータが、ピクチャの復号及び再生等に利用される有効なデータとなる。以下、ピクチャヘッダのうち、有効なデータについて「ピクチャヘッダデータ」と呼ぶことにする。もちろん、ピクチャヘッダのサイズと、ピクチャヘッダデータのサイズが等しくなる場合もある。この場合は、ピクチャヘッダにスタッフィングビットは含まれない。なお、初期遅延量データ領域の開始位置は、8ビット(1バイト)単位の位置とは限らない。言い換えると、初期遅延量データ領域の開始位置は、アライメント境界になるとは限らない。   Here, in the standard, picture headers are aligned in units of 1 byte. That is, the bit amount of the picture header is a multiple of 8 bits (1 byte). For example, when the data included in the picture header such as the information on the picture layer described above can be expressed by 87 bits, the remaining 1 bit in the picture header is filled with stuffing bits. In other words, the data excluding the stuffing bits in the picture header is effective data used for decoding and reproduction of the picture. Hereinafter, valid data in the picture header is referred to as “picture header data”. Of course, the size of the picture header may be equal to the size of the picture header data. In this case, the stuffing bit is not included in the picture header. Note that the start position of the initial delay amount data area is not necessarily a position in units of 8 bits (1 byte). In other words, the start position of the initial delay amount data area is not necessarily an alignment boundary.

ここで、エンコーダによってビットストリームを生成するときに、ビットストリーム中のデータを出力順に生成していくことで、ビットストリームを生成する処理を単純にすることができる。具体的には、まず、ピクチャヘッダを作成して、ピクチャヘッダに続けて、マクロブロックを符号化したデータを、マクロブロックを符号化する毎につなげていく。このように最初にピクチャヘッダを作成しておけば、後は符号化したマクロブロックをつなげていくのみで、ビットストリームを生成することができる。   Here, when the bit stream is generated by the encoder, the processing for generating the bit stream can be simplified by generating the data in the bit stream in the output order. Specifically, first, a picture header is created, and after the picture header, data obtained by encoding a macroblock is connected every time the macroblock is encoded. If the picture header is created first in this way, the bit stream can be generated only by connecting the encoded macro blocks.

しかし、図2に示す時刻tのような、エンコーダ30でのピクチャ5の符号化終了し、ピクチャ9の符号化を開始する前の時点では、ピクチャ9の符号化終了時点の仮想バッファのバッファ占有量が確定していない。言い換えると、デコーダ側において仮想バッファからピクチャ9を引き抜いてデコードする前のデコーダ側の仮想バッファのバッファ占有量が確定していない。よって、この時点では、確定したピクチャ9の初期遅延量を、ピクチャヘッダに格納することはできない。ここで、ピクチャ9の符号化終了時における仮想バッファのバッファ占有量は、ピクチャ8の符号化終了時点で確定する。具体的には、図21に示すように、ピクチャ8の符号化終了時点には、ピクチャ8の符号化終了時点におけるバッファ占有量B(8)が分かり、ピクチャ8の発生符号量S(8)も確定している。そのため、後述するように、予め定められたビットレートによって、確定したピクチャ9の符号化終了時における仮想バッファのバッファ占有量を算出することができるからである。   However, as shown in FIG. 2, when the encoding of the picture 5 in the encoder 30 is completed and before the encoding of the picture 9 is started, the buffer occupation of the virtual buffer at the end of the encoding of the picture 9 is performed. The amount is not fixed. In other words, the buffer occupation amount of the virtual buffer on the decoder side before the picture 9 is extracted from the virtual buffer and decoded on the decoder side is not fixed. Therefore, at this time, the determined initial delay amount of the picture 9 cannot be stored in the picture header. Here, the buffer occupation amount of the virtual buffer at the end of the encoding of the picture 9 is determined at the end of the encoding of the picture 8. Specifically, as shown in FIG. 21, at the end of encoding of picture 8, the buffer occupancy B (8) at the end of encoding of picture 8 is known, and the generated code amount S (8) of picture 8 is obtained. Has also been confirmed. Therefore, as will be described later, the buffer occupancy of the virtual buffer at the end of encoding of the fixed picture 9 can be calculated at a predetermined bit rate.

そこで、ピクチャ5の符号化が終了し、ピクチャ9の符号化を開始する前の時点では、ピクチャ9の初期遅延量を推定してピクチャ9のピクチャヘッダに格納しておき、ピクチャ8の符号化が終了した時点で、ピクチャ9のピクチャヘッダに格納された推定初期遅延量を、確定した正しい初期遅延量に置き換える方法も考えられる。   Therefore, at the time when encoding of picture 5 is finished and before encoding of picture 9 is started, the initial delay amount of picture 9 is estimated and stored in the picture header of picture 9, and encoding of picture 8 is performed. It is also conceivable to replace the estimated initial delay amount stored in the picture header of the picture 9 with the determined correct initial delay amount at the time when the process is completed.

しかし、図21に示すように、推定した初期遅延量と、正しい初期遅延量とは、必ずしも同じ値となるとは限らない。つまり、推定した初期遅延量を示す初期遅延量データと、正しい初期遅延量を示す初期遅延量データとで、初期遅延量データのサイズが異なってしまう場合がある。この場合、上述した方法では、ピクチャヘッダのサイズが変わってしまうため、それに合わせてビットストリームにおけるピクチャヘッダ及びマクロブロック符号領域の配置を再構成して、ビットストリームのサイズを変更する必要がでてしまうという問題がある。そのため、複数のエンコーダで並列にビットストリームを生成した場合に、それらのビットストリームを単純に結合するのみで1つのビットストリームを生成することができなくなってしまう。つまり、ビットストリームを生成する処理が複雑になってしまうという問題がある。   However, as shown in FIG. 21, the estimated initial delay amount and the correct initial delay amount are not necessarily the same value. In other words, the initial delay amount data indicating the estimated initial delay amount may be different from the initial delay amount data indicating the correct initial delay amount. In this case, since the size of the picture header changes in the above-described method, it is necessary to reconfigure the arrangement of the picture header and the macroblock code area in the bit stream and change the size of the bit stream accordingly. There is a problem of end. Therefore, when bit streams are generated in parallel by a plurality of encoders, one bit stream cannot be generated by simply combining the bit streams. That is, there is a problem that the process of generating the bitstream becomes complicated.

そこで、本実施の形態6では、初期遅延量データ領域を、初期遅延量データがとり得る最大値の初期遅延量データビット量で確保しておく。つまり、ピクチャヘッダを、ピクチャヘッダがとり得る最大サイズとしておく。そして、正しい初期遅延量が確定した後に、正しい初期遅延量を示す初期遅延量データで置き換えるようにする。このときに、必要に応じてスタッフィングビットをピクチャヘッダに追加的に含めるようにすることで、初期遅延量データの置き換え前後で、ピクチャヘッダのサイズを同一サイズに維持するようにする。以下、エンコーダ30において生成されるピクチャ9のビットストリームを例に挙げて説明するが、エンコーダ30〜33のそれぞれにおいて生成される他のピクチャのビットストリームについても同様の処理が行われる。   Therefore, in the sixth embodiment, the initial delay amount data area is secured with the maximum initial delay amount data bit amount that the initial delay amount data can take. That is, the picture header is set to the maximum size that the picture header can take. Then, after the correct initial delay amount is determined, the initial delay amount data indicating the correct initial delay amount is replaced. At this time, stuffing bits are additionally included in the picture header as necessary, so that the size of the picture header is maintained to be the same before and after replacement of the initial delay amount data. Hereinafter, the bit stream of the picture 9 generated in the encoder 30 will be described as an example, but the same processing is performed on the bit streams of other pictures generated in the encoders 30 to 33, respectively.

図21を参照して説明すると、エンコーダ30は、ピクチャ9の符号化開始時には、ピクチャ9のピクチャヘッダの初期遅延量データ領域を、初期遅延量データがとり得る最大のサイズで確保しておく。つまり、エンコーダ30は、ストリームバッファ40にピクチャヘッダを格納する際に、初期遅延量データがとり得る最大のサイズの仮の初期遅延量データを格納する。仮の初期遅延量データとしては、例えば、スタッフィングビットで埋められたデータを使用する。エンコーダ30は、ピクチャヘッダに続けてフレームを符号化したデータを、フレームの符号化に応じて順次、ストリームバッファ40に格納していく。   Referring to FIG. 21, the encoder 30 reserves the initial delay amount data area of the picture header of the picture 9 with the maximum size that the initial delay amount data can take when the encoding of the picture 9 is started. That is, when storing the picture header in the stream buffer 40, the encoder 30 stores temporary initial delay amount data of the maximum size that can be taken by the initial delay amount data. As the temporary initial delay amount data, for example, data filled with stuffing bits is used. The encoder 30 sequentially stores data obtained by encoding a frame following the picture header in the stream buffer 40 according to the encoding of the frame.

その後、ピクチャ8の符号化が終了したとき、ピクチャ9の符号化終了時点のデコーダ側の仮想バッファのバッファ占有量が確定する。そのため、ピクチャ8の符号化が終了したときに、初期遅延量計算装置25は、ピクチャ9の正しい初期遅延量を計算する。   Thereafter, when the encoding of picture 8 is completed, the buffer occupation amount of the decoder-side virtual buffer at the end of encoding of picture 9 is determined. Therefore, when the encoding of the picture 8 is completed, the initial delay amount calculation device 25 calculates the correct initial delay amount of the picture 9.

なお、このときのピクチャ9の初期遅延量D(9)は、次式(15)によって算出する。また、式(16)中のピクチャ9の符号化終了時点におけるバッファ占有量B(9)は、次式(16)によって算出する。ここで、Rは、予め定められたビットレートであり、S(x)は、ピクチャxの発生符号量であり、Rtは、ビットレートRと、ピクチャ符号化終了間隔Δtとを乗じた値である。なお、初期遅延量計算装置25は、ピクチャ8の発生符号量S(8)を発生符号量記憶装置11から取得する。   Note that the initial delay amount D (9) of the picture 9 at this time is calculated by the following equation (15). Also, the buffer occupancy B (9) at the end of encoding of picture 9 in equation (16) is calculated by the following equation (16). Here, R is a predetermined bit rate, S (x) is a generated code amount of picture x, and Rt is a value obtained by multiplying bit rate R and picture encoding end interval Δt. is there. The initial delay amount calculation device 25 acquires the generated code amount S (8) of the picture 8 from the generated code amount storage device 11.

Figure 0005706759
Figure 0005706759

さらに、式(15)は、次式(17)で表すことができ、式(16)は、次式(18)で表すことができる。iは、ピクチャ番号である。例えば、D(i)は、ピクチャiの初期遅延量を示す。なお、B(i−1)は、ピクチャi−2の符号化が終了したときに算出されていることになるため、それを使用すればよい。また、B(1)は、仮想バッファサイズの大きさまでの値で任意の値に設定する。例えば、仮想バッファサイズから適当なマージンを差し引いた値にする。   Furthermore, Formula (15) can be represented by the following Formula (17), and Formula (16) can be represented by the following Formula (18). i is a picture number. For example, D (i) indicates the initial delay amount of picture i. Note that B (i-1) is calculated when the encoding of the picture i-2 is completed, so that it may be used. B (1) is set to an arbitrary value up to the size of the virtual buffer size. For example, a value obtained by subtracting an appropriate margin from the virtual buffer size.

Figure 0005706759
Figure 0005706759

初期遅延量計算装置25は、計算したピクチャ9の正しい初期遅延量を、ストリーム結合装置27に出力する。   The initial delay amount calculation device 25 outputs the calculated correct initial delay amount of the picture 9 to the stream combination device 27.

一方、ストリーム修正位置記憶装置26は、発生符号量記憶装置11に格納された発生符号量に基づいて、ストリームバッファ40におけるピクチャ9の初期遅延量データ開始位置を算出する。ここで、ストリームバッファ40〜43のそれぞれは、ビットストリームが生成順に循環的に記憶されていくバッファであるものとする。この場合、ピクチャ9の1つ前に符号化されるピクチャ5の発生符号量が分かれば、ストリームバッファ40におけるピクチャ9のピクチャヘッダの開始位置が分かる。その理由は、ピクチャ5の発生符号量が分かれば、ピクチャ5のビットストリームのマクロブロック符号領域のサイズが分かり、それにピクチャヘッダのサイズを加算することによってピクチャ5のビットストリームのサイズが分かるからである。つまり、ピクチャ9のピクチャヘッダの開始位置となる、ピクチャ5のビットストリームの終端位置が分かるからである。なお、ピクチャヘッダのサイズは、ストリーム修正位置記憶装置26に予め記憶しておけばよい。   On the other hand, the stream correction position storage device 26 calculates the initial delay amount data start position of the picture 9 in the stream buffer 40 based on the generated code amount stored in the generated code amount storage device 11. Here, it is assumed that each of the stream buffers 40 to 43 is a buffer in which the bit stream is cyclically stored in the generation order. In this case, if the generated code amount of the picture 5 encoded immediately before the picture 9 is known, the start position of the picture header of the picture 9 in the stream buffer 40 can be known. The reason is that if the generated code amount of picture 5 is known, the size of the macroblock code area of the bit stream of picture 5 can be found, and the size of the bit stream of picture 5 can be found by adding the size of the picture header to it. is there. That is, the end position of the bit stream of picture 5 that is the start position of the picture header of picture 9 is known. Note that the size of the picture header may be stored in the stream correction position storage device 26 in advance.

このようにして、ストリーム修正位置記憶装置26は、発生符号量記憶装置11に格納されたピクチャ5の発生符号量を参照することで、ピクチャ9のピクチャヘッダの開始位置を算出する。そして、ストリーム修正位置記憶装置26は、算出したピクチャ9のピクチャヘッダの開始位置を基準として、ピクチャ9の初期遅延量データ開始位置を算出する。ストリーム修正位置記憶装置26は、算出したピクチャ9の初期遅延量データ開始位置を示す初期遅延量データ開始位置データを記憶する。なお、初期遅延量データ開始位置は、初期遅延量データ開始位置のピクチャヘッダ先頭からの相対的な位置を、ストリーム修正位置記憶装置26に予め記憶しておくことによって算出可能とする。また、初期遅延量データビット量についても、初期遅延量データがとり得る最大値として固定的に予め決まっているため、ストリーム修正位置記憶装置26に予め記憶しておけばよい。   In this way, the stream correction position storage device 26 calculates the start position of the picture header of the picture 9 by referring to the generated code amount of the picture 5 stored in the generated code amount storage device 11. Then, the stream correction position storage device 26 calculates the initial delay amount data start position of the picture 9 based on the calculated start position of the picture header of the picture 9. The stream correction position storage device 26 stores initial delay amount data start position data indicating the calculated initial delay amount data start position of the picture 9. Note that the initial delay amount data start position can be calculated by storing the relative position from the head of the picture header of the initial delay amount data start position in the stream correction position storage device 26 in advance. Further, the initial delay amount data bit amount is also fixed in advance as the maximum value that the initial delay amount data can take, and therefore may be stored in the stream correction position storage device 26 in advance.

そして、ストリーム結合装置27は、ストリーム結合時に、ストリーム修正位置記憶装置26に記憶された、ピクチャ9の初期遅延量データ開始位置データ及び初期遅延量データビット量を取得する。ストリーム結合装置27は、初期遅延量データ開始位置データが示すピクチャ9の初期遅延量データ開始位置から、初期遅延量データビット量分の領域のデータを、ピクチャ9の初期遅延量データ領域として特定する。ストリーム結合装置27は、特定した領域におけるピクチャ9の初期遅延量データを、初期遅延量計算装置25から出力されたピクチャ9の正しい初期遅延量を示す初期遅延量データに置き換える。   Then, the stream combination device 27 acquires the initial delay amount data start position data and the initial delay amount data bit amount of the picture 9 stored in the stream correction position storage device 26 at the time of stream combination. The stream combining device 27 specifies the data of the area corresponding to the initial delay amount data bit amount from the initial delay amount data start position of the picture 9 indicated by the initial delay amount data start position data as the initial delay amount data area of the picture 9. . The stream combination device 27 replaces the initial delay amount data of the picture 9 in the specified area with the initial delay amount data indicating the correct initial delay amount of the picture 9 output from the initial delay amount calculation device 25.

ここで、ストリーム結合装置27は、正しい初期遅延量データの先頭が、初期遅延量データ開始位置に位置するように、初期遅延量データ開始位置から正しい初期遅延量データを配置する。このとき、置き換え後の初期遅延量データのサイズが、置き換え前の初期遅延量データのサイズよりも小さくなる場合、単純に初期遅延量データのみを置き換えるようにすると、初期遅延量データと、初期遅延量データに後続するデータとの間で隙間が発生してしまう。よって、この場合、データ間の隙間の発生を防止するために、ストリーム結合装置27は、後続するデータを初期遅延量データの直後に続くように移動する。   Here, the stream combination device 27 arranges the correct initial delay amount data from the initial delay amount data start position so that the head of the correct initial delay amount data is positioned at the initial delay amount data start position. At this time, if the size of the initial delay amount data after the replacement is smaller than the size of the initial delay amount data before the replacement, simply replacing only the initial delay amount data, the initial delay amount data and the initial delay amount A gap is generated between the data following the amount data. Therefore, in this case, in order to prevent the occurrence of a gap between the data, the stream combining device 27 moves the subsequent data so that it immediately follows the initial delay amount data.

しかし、そのようにすると、ピクチャヘッダデータの終端が、前方に移動することになる。そのため、ストリーム結合装置27は、ピクチャヘッダにおいて、新たなピクチャヘッダデータの終端以降に、移動前のデータの一部が残らないようにするため、新たなピクチャヘッダデータの終端から、少なくともデータの移動量に相当するビット数分のビットをスタッフィングビットに置き換える。つまり、置き換え後の初期遅延量データのサイズが置き換え前の初期遅延量データよりも小さくなる場合は、置き換え後の初期遅延量データの終端から、置き換え前のピクチャヘッダデータの終端までのデータも置き換える必要がある。   However, when doing so, the end of the picture header data moves forward. For this reason, the stream combining device 27 moves at least data from the end of the new picture header data in order to prevent a part of the data before the movement from remaining after the end of the new picture header data in the picture header. Bits corresponding to the number of bits are replaced with stuffing bits. That is, if the size of the initial delay amount data after replacement is smaller than the initial delay amount data before replacement, the data from the end of the initial delay amount data after replacement to the end of the picture header data before replacement is also replaced. There is a need.

なお、ストリーム結合装置27は、アライメント単位で、仮の初期遅延量データを、正しい初期遅延量データに置き換える。ここで、置き換え前後で初期遅延量データのサイズが変わらない場合、データを置き換える範囲は、アライメント単位のサイズであり、かつ初期遅延量データを含む範囲であれば、どのような範囲としてもよい。   The stream combining device 27 replaces the temporary initial delay amount data with the correct initial delay amount data in the alignment unit. Here, if the size of the initial delay amount data does not change before and after the replacement, the data replacement range may be any range as long as it is the size of the alignment unit and includes the initial delay amount data.

例えば、初期遅延量データのサイズが16ビット(2バイト)であり、初期遅延量データ領域の開始位置がアライメント境界に位置する場合、最小限のサイズで初期遅延量データを置き換えるのであれば、16ビット(2バイト)の初期遅延量データのみを置き換えればよい。また、初期遅延量データのサイズが16ビット(2バイト)であるが、初期遅延量データ領域の開始位置がアライメント境界に位置しない場合は、最小限のサイズで初期遅延量データを置き換えるのであれば、初期遅延量データを含む24ビット(3バイト)のデータを置き換えればよい。この場合、初期遅延量データが3つのアライメントに跨ることになるからである。さらに、この場合は、初期遅延量データを除いた合計8ビット(1バイト)分のデータは、置き換え前と同一のデータとすればよい。   For example, if the initial delay amount data size is 16 bits (2 bytes) and the start position of the initial delay amount data area is located at the alignment boundary, if the initial delay amount data is replaced with a minimum size, 16 It is only necessary to replace the initial delay amount data of bits (2 bytes). If the initial delay amount data size is 16 bits (2 bytes), but the start position of the initial delay amount data area is not located at the alignment boundary, the initial delay amount data can be replaced with a minimum size. The 24-bit (3-byte) data including the initial delay amount data may be replaced. This is because the initial delay amount data extends over three alignments. Further, in this case, the data for a total of 8 bits (1 byte) excluding the initial delay amount data may be the same data as before the replacement.

また、これらの場合で、最小限のサイズ以外のサイズで初期遅延量データを置き換えるのであれば、例えば、初期遅延量データの開始位置から、ピクチャヘッダデータの終端までが含まれる範囲を置き換え対象としてもよく、ピクチャヘッダのうち、ピクチャヘッダデータ全体を置き換え対象としてもよく、ピクチャヘッダ全体を置き換え対象としてもよい。なお、ピクチャヘッダデータ全体又はピクチャヘッダ全体を置き換え対象とする場合、例えば、ストリーム修正位置記憶装置26に、初期遅延量データ開始位置に代えて、ピクチャヘッダ開始位置を示すデータを記憶することで、ストリーム結合装置27が置き換え対象となる領域を特定するようにする。   Also, in these cases, if the initial delay amount data is replaced with a size other than the minimum size, for example, a range including from the start position of the initial delay amount data to the end of the picture header data is to be replaced. Of the picture headers, the entire picture header data may be the replacement target, or the entire picture header may be the replacement target. When the entire picture header data or the entire picture header is to be replaced, for example, by storing data indicating the picture header start position instead of the initial delay amount data start position in the stream correction position storage device 26, The stream combination device 27 identifies an area to be replaced.

なお、上述したように、置き換え後に初期遅延量データのサイズが小さくなる場合は、置き換え前のピクチャヘッダデータの終端までデータを置き換える必要がある。そのため、この場合、データを置き換える範囲は、アライメント単位のサイズであり、初期遅延量データの先頭から、置き換え前のピクチャヘッダデータの終端までのデータを含む範囲であれば、どのようなサイズとしてもよい。   As described above, when the size of the initial delay amount data becomes small after replacement, it is necessary to replace the data up to the end of the picture header data before replacement. Therefore, in this case, the data replacement range is the size of the alignment unit, and any size is acceptable as long as it includes data from the beginning of the initial delay amount data to the end of the picture header data before replacement. Good.

ここで、置き換え後に初期遅延量データのサイズが小さくなる場合も、そうでない場合も、置き換え前のピクチャヘッダデータの終端以降の範囲は、スタッフィングビットで埋められたままとなる。ただし、これは、ピクチャヘッダのサイズと、ピクチャヘッダデータのサイズとが等しくない場合に限る。また、置き換え後に初期遅延量データのサイズが小さくなる場合は、上述したように、置き換え前のピクチャヘッダデータが残らないようにスタッフィングビットへの置き換えが行われる。したがって、ピクチャヘッダのうち、スタッフィングビットで埋められた範囲を除いた範囲のピクチャヘッダデータを、正しい初期遅延量データを含むデータとして取得することができる。   Here, whether the size of the initial delay amount data becomes small after replacement or not, the range after the end of the picture header data before replacement remains filled with stuffing bits. However, this is limited to the case where the size of the picture header is not equal to the size of the picture header data. When the size of the initial delay amount data becomes small after replacement, replacement with stuffing bits is performed so that the picture header data before replacement does not remain as described above. Therefore, picture header data in a range excluding the range filled with stuffing bits in the picture header can be acquired as data including correct initial delay amount data.

なお、本実施の形態6にかかる画像符号化装置6におけるその他の符号化における処理内容については、図12を参照して説明した実施の形態3にかかる画像符号化装置3の処理と同様となるため、説明を省略する。   The processing contents in other encodings in the image encoding device 6 according to the sixth embodiment are the same as the processing of the image encoding device 3 according to the third embodiment described with reference to FIG. Therefore, the description is omitted.

以上に説明したように、本実施の形態6によれば、エンコーダ30〜33のそれぞれは、フレームを符号化してストリームデータを生成するときに、初期遅延量データがとり得る最大のサイズの仮初期遅延量データを含めたピクチャヘッダをストリームバッファ40〜43のそれぞれに格納してから、当該フレームの符号化に応じて、当該フレームの符号化データを、ストリームバッファ40〜43のそれぞれに格納していくようにしている。そして、ストリーム結合装置27は、フレームの初期遅延量の確定後に、仮初期遅延量データを、確定した初期遅延量を示す初期遅延量データに置き換えるときに、前記置き換え後の初期遅延量データのサイズが前記置き換え前の仮初期遅延量データのサイズよりも減少する場合、減少するサイズ分のデータに代えてスタッフィングビットをヘッダデータに含めることで、前記初期遅延量データの置き換え前後でヘッダデータのサイズを同一とするようにしている。   As described above, according to the sixth embodiment, each of the encoders 30 to 33, when encoding a frame and generating stream data, has a temporary initial of the maximum size that the initial delay amount data can take. After the picture header including the delay amount data is stored in each of the stream buffers 40 to 43, the encoded data of the frame is stored in each of the stream buffers 40 to 43 in accordance with the encoding of the frame. I am going to go. Then, when the stream combining device 27 replaces the temporary initial delay amount data with the initial delay amount data indicating the determined initial delay amount after the determination of the initial delay amount of the frame, the size of the initial delay amount data after the replacement. Is smaller than the size of the provisional initial delay amount data before replacement, the header data size is included before and after replacement of the initial delay amount data by including stuffing bits in the header data instead of the reduced size data. Are the same.

これによれば、確定した正しい初期遅延量データに置き換えても、ピクチャヘッダのサイズが変わらないようにすることができる。そのため、ビットストリームにおけるピクチャヘッダ及びマクロブロック符号領域の配置を再構成して、ビットストリームのサイズを変更する必要がなく、ビットストリームを生成する処理を単純にすることができる。つまり、複数のエンコーダで並列にビットストリームを生成した場合に、それらのビットストリームを単純に結合するのみで1つのビットストリームを生成することができる。   According to this, it is possible to prevent the size of the picture header from changing even when the data is replaced with the determined correct initial delay amount data. Therefore, it is not necessary to reconfigure the arrangement of the picture header and the macroblock code area in the bit stream to change the size of the bit stream, and the process of generating the bit stream can be simplified. That is, when bit streams are generated in parallel by a plurality of encoders, one bit stream can be generated by simply combining the bit streams.

なお、上述した実施の形態6では、仮の初期遅延量データとして、スタッフィングビットで埋められたデータを使用する場合について例示したが、これに限られない。例えば、推定した初期遅延量データを含む、初期遅延量データがとり得る最大のサイズのデータを、仮の初期遅延量データとしてもよい。なお、このときに、推定した初期遅延量データのサイズが、仮の初期遅延量データのサイズに満たない場合は、足りない分をスタッフィングビットで埋め合わせるようにすればよい。   In the above-described sixth embodiment, the case where data filled with stuffing bits is used as the temporary initial delay amount data is exemplified, but the present invention is not limited to this. For example, data of the maximum size that can be taken by the initial delay amount data including the estimated initial delay amount data may be used as the temporary initial delay amount data. At this time, if the estimated size of the initial delay amount data is less than the size of the temporary initial delay amount data, the missing amount may be compensated by stuffing bits.

なお、上述した本実施の形態6では、実施の形態5の構成に対して、さらに、初期遅延量計算装置25及びストリーム修正位置記憶装置26を有し、ストリーム結合装置14に代えてストリーム結合装置27を有する場合について例示したが、これに限られない。実施の形態1〜5のいずれか又はそれらのうちの任意の2つ以上の実施の形態の組み合わせに対して、同様に適用するようにしてもよい。   In the sixth embodiment described above, the initial delay amount calculation device 25 and the stream correction position storage device 26 are further added to the configuration of the fifth embodiment, and the stream combining device is replaced with the stream combining device 14. Although illustrated about the case where it has 27, it is not restricted to this. You may make it apply similarly with respect to either of Embodiment 1-5, or the combination of two or more arbitrary embodiments among them.

発明の実施の形態7.
続いて、図22を参照して、本発明の実施の形態7にかかる画像符号化装置7の構成について説明する。図22は、本発明の実施の形態7にかかる画像符号化装置7の構成図である。なお、実施の形態1〜6と同様の構成要素については、同一の符号を付して、説明を省略する。
Embodiment 7 of the Invention
Next, the configuration of the image encoding device 7 according to the seventh embodiment of the present invention will be described with reference to FIG. FIG. 22 is a configuration diagram of the image encoding device 7 according to the seventh embodiment of the present invention. In addition, about the component similar to Embodiment 1-6, the same code | symbol is attached | subjected and description is abbreviate | omitted.

本実施の形態7では、画像符号化装置7が、トランスコーダである場合について例示する。つまり、本実施の形態7では、画像符号化装置7に入力される入力画像が、符号化済みの画像である場合について例示する。入力画像は、例えば、MPEG−2及びH.264等の動画符号化規格に従って、符号化されている。本実施の形態7では、事前解析結果として、トランスコードにおけるデコードにおいて取得される情報を利用する。   In this Embodiment 7, the case where the image coding apparatus 7 is a transcoder is illustrated. That is, Embodiment 7 exemplifies a case where the input image input to the image encoding device 7 is an encoded image. Input images are, for example, MPEG-2 and H.264. It is encoded according to a moving image encoding standard such as H.264. In the seventh embodiment, information acquired in decoding in transcoding is used as a preliminary analysis result.

画像符号化装置7は、フレームバッファ10、発生符号量記憶装置11、発生符号量予測装置22、バッファ占有量予測装置23、符号量制御装置24、初期遅延量計算装置25、ストリーム修正位置記憶装置26、ストリーム結合装置27、デコーダ28、デコード情報記憶装置29、エンコーダ30〜33、及びストリームバッファ40〜43を有する。   The image encoding device 7 includes a frame buffer 10, a generated code amount storage device 11, a generated code amount prediction device 22, a buffer occupancy amount prediction device 23, a code amount control device 24, an initial delay amount calculation device 25, and a stream correction position storage device. 26, a stream combination device 27, a decoder 28, a decode information storage device 29, encoders 30 to 33, and stream buffers 40 to 43.

デコーダ28は、入力画像を復号化する。デコーダ28は、入力画像の復号化前に、入力画像の復号化単位毎の符号量を、特徴量としてデコード情報記憶装置29に格納する。ここで、復号化単位とは、例えば、マクロブロックライン、又は、マクロブロックペアラインである。また、入力画像がMPEG−2及びH.264等の動画符号化規格に従って符号化されている場合、入力画像には、マクロブロック毎の動き量を示す情報が含まれている。この情報は、例えば、復号処理において補償フレーム間予測に使用される動きベクトルである。デコーダ28は、その情報に基づいて、1画像を予め定めた大きさに分割した単位毎に動き量を算出してデコード情報記憶装置29に格納する。具体的には、例えば、マクロブロックライン単位、又は、マクロブロックペアライン単位毎の動き量が格納される。   The decoder 28 decodes the input image. The decoder 28 stores the code amount for each decoding unit of the input image in the decode information storage device 29 as a feature amount before decoding the input image. Here, the decoding unit is, for example, a macroblock line or a macroblock pair line. The input image is MPEG-2 and H.264. When encoded in accordance with a moving image encoding standard such as H.264, the input image includes information indicating the amount of motion for each macroblock. This information is, for example, a motion vector used for compensation inter-frame prediction in the decoding process. Based on the information, the decoder 28 calculates a motion amount for each unit obtained by dividing one image into a predetermined size, and stores it in the decode information storage device 29. Specifically, for example, the amount of motion for each macroblock line unit or macroblock pair line unit is stored.

デコード情報記憶装置29は、入力画像の特徴量が事前解析結果として一時的に記憶される。また、デコード情報記憶装置29は、入力画像の動き量が一時的に記憶される。デコード情報記憶装置29は、特徴量及び動き量を記憶するための任意の記憶装置を含む。   In the decode information storage device 29, the feature amount of the input image is temporarily stored as a pre-analysis result. The decode information storage device 29 temporarily stores the amount of motion of the input image. The decode information storage device 29 includes an arbitrary storage device for storing feature amounts and motion amounts.

したがって、発生符号量予測装置22がデコード情報記憶装置29に格納された特徴量を使用して、符号化途中ピクチャの未符号化領域の発生符号量を推定することになる。なお、本実施の形態7にかかる画像符号化装置7におけるその他の符号化における処理内容については、図12を参照して説明した実施の形態3にかかる画像符号化装置3の処理と同様となるため、説明を省略する。   Therefore, the generated code amount prediction device 22 uses the feature amount stored in the decode information storage device 29 to estimate the generated code amount of the unencoded area of the picture being encoded. The processing contents in other encodings in the image encoding device 7 according to the seventh embodiment are the same as those of the image encoding device 3 according to the third embodiment described with reference to FIG. Therefore, the description is omitted.

なお、ここでは、実施の形態6の構成に対して、事前解析装置19及び解析結果記憶装置20に代えて、デコーダ28及びデコード情報記憶装置29を有する場合について例示したが、これに限られない。実施の形態2〜5のいずれか又はそれらのうちの任意の2つ以上の実施の形態の組み合わせに対して、同様に適用するようにしてもよい。   Note that, here, the configuration of the sixth embodiment has been illustrated for the case where the decoder 28 and the decode information storage device 29 are provided instead of the pre-analysis device 19 and the analysis result storage device 20, but the present invention is not limited thereto. . You may make it apply similarly to either of Embodiment 2-5, or the combination of arbitrary 2 or more of those embodiments.

そのときに、例えば、実施の形態2及び3のように、符号量推定において動き量を使用しなくてもよいものに適用する場合は、デコーダ28において、動き量を検出しないようにしてもよく、実施の形態4のように、符号量推定において特徴量を使用しなくてもよいものに適用する場合は、デコーダ28において、特徴量を検出しないようにしてもよい。例えば、実施の形態4に適用した場合、発生符号量予測装置21は、デコード情報記憶装置29に格納された動き量を使用して、符号化途中ピクチャの未符号化領域の発生符号量を推定することになる。   At that time, for example, in the case where the present invention is applied to the one that does not require the use of the motion amount in the code amount estimation as in the second and third embodiments, the decoder 28 may not detect the motion amount. In the case where the present invention is applied to the case where the feature amount does not need to be used in the code amount estimation as in the fourth embodiment, the decoder 28 may not detect the feature amount. For example, when applied to the fourth embodiment, the generated code amount prediction device 21 uses the motion amount stored in the decode information storage device 29 to estimate the generated code amount of the uncoded region of the picture being encoded. Will do.

以上に説明したように本実施の形態7では、複数のフレームからなる動画像データを再符号化する際に、復号前のフレームの符号量を、符号量推定に使用されるフレームの特徴量として検出するようにしている。また、復号処理により算出されるフレームの動き量を、符号量推定に使用されるフレームの動き量として検出するようにしている。   As described above, in the seventh embodiment, when moving image data including a plurality of frames is re-encoded, the code amount of the frame before decoding is used as the feature amount of the frame used for the code amount estimation. I try to detect it. Further, the amount of motion of the frame calculated by the decoding process is detected as the amount of motion of the frame used for code amount estimation.

これによれば、動画像データを再符号化する際に取得される情報を、未符号化領域の発生符号量の推定に利用する特徴量及び動き量としているため、別途それらを検出する処理が不要となり、処理を簡略化することができる。   According to this, since the information acquired when re-encoding the moving image data is the feature amount and the motion amount used for the estimation of the generated code amount of the uncoded region, a process for separately detecting them is performed. It becomes unnecessary and the processing can be simplified.

発明の他の実施の形態.
上述した各実施の形態では、一例として、4つのエンコーダを有するようにして、4並列でピクチャを符号化する場合について説明したが、これに限らない。例えば、2つのエンコーダを有するようにして2並列でピクチャを符号化するようにしてもよく、3つのエンコーダを有するようにして3並列でピクチャを符号化するようにしてもよい。また、4つ以上のエンコーダを有するようにして、4つ以上のピクチャを並列に符号化するようにしてもよい。
Another embodiment of the invention.
In each of the above-described embodiments, as an example, a case has been described where four pictures are encoded in parallel with four encoders, but the present invention is not limited thereto. For example, a picture may be encoded in two parallels with two encoders, or a picture may be encoded in three parallels with three encoders. Further, four or more pictures may be encoded in parallel by having four or more encoders.

上述した各実施の形態では、推定符号量の算出及びそれに応じた符号量制御パラメタの更新を、マクロブロックライン又はマクロブロックペアラインを符号化する毎に実施する場合について例示したが、これに限られない。推定符号量の算出及び符号量制御パラメタの更新をするタイミングは、マクロブロックを符号化する毎としてもよく、複数のマクロブロックからなるマクロブロックグループを符号化する毎としてもよい。また、複数のマクロブロックラインからなるマクロブロックライングループを符号化する毎としてもよい。ピクチャを分割した単位のそれぞれで符号化の進行速度がほぼ同じとなるのであれば、ピクチャを任意に等分割した単位を符号化する毎としてもよい。また、これらのようなピクチャを符号化する区切りに限られず、任意のタイミングとしてもよい。   In each embodiment described above, the calculation of the estimated code amount and the update of the code amount control parameter corresponding to the calculation are exemplified for each encoding of the macroblock line or the macroblock pair line. I can't. The timing for calculating the estimated code amount and updating the code amount control parameter may be every time a macroblock is encoded, or every time a macroblock group including a plurality of macroblocks is encoded. Moreover, it is good whenever it encodes the macroblock line group which consists of a some macroblock line. As long as the progress of encoding is substantially the same in each unit obtained by dividing a picture, a unit obtained by arbitrarily equally dividing a picture may be encoded. Moreover, it is not restricted to the division | segmentation which codes such a picture, It is good also as arbitrary timings.

事前解析結果や符号化済み画像の発生符号量を記憶する単位は、符号化処理単位と一致していなくてもよい。つまり、マクロブロックライン単位や、マクロブロックペアライン単位に記憶しなくてもよい。例えば、これらの単位よりも画面の分割数が少なく、分割された領域が大きくなっていいてもよい。この場合、処理単位に応じて比例配分とする。   The unit for storing the pre-analysis result and the generated code amount of the encoded image may not coincide with the encoding processing unit. That is, it does not have to be stored in units of macroblock lines or macroblock pair lines. For example, the number of screen divisions may be smaller than these units, and the divided areas may be larger. In this case, proportional distribution is made according to the processing unit.

例えば、図23に示すように、符号化済みピクチャの発生符号量が、それぞれx、y、zで示す3つの領域毎に記憶するようにしてもよい。この場合に、xで示す範囲の発生符号量がSxであり、yで示す範囲の発生符号量がSyであり、zで示す範囲の発生符号量がzである場合、次式(19)及び(20)によって、aで示す範囲の発生符号量S'a及びbで示す範囲の発生符号量S'bを計算する。つまり、式(19)によって算出されたS'a及び式(20)によって算出されたS'bのそれぞれは、式(1)におけるS'a及びS'bとして使用される。   For example, as shown in FIG. 23, the generated code amount of an encoded picture may be stored for each of three areas indicated by x, y, and z, respectively. In this case, when the generated code amount in the range indicated by x is Sx, the generated code amount in the range indicated by y is Sy, and the generated code amount in the range indicated by z is z, the following equation (19) and By (20), the generated code amount S′a in the range indicated by a and the generated code amount S′b in the range indicated by b are calculated. That is, S′a calculated by Expression (19) and S′b calculated by Expression (20) are used as S′a and S′b in Expression (1), respectively.

Figure 0005706759
Figure 0005706759

これによれば、1つの符号化済みピクチャに対して、発生符号量のデータを3つ記憶するのみで済む。つまり、発生符号量のデータをマクロブロックライン毎又はマクロブロックペアライン毎に記憶する必要がなくなる。よって、記憶するデータ量を少なくできるため、記憶装置の規模を小さくでき、画像符号化装置全体の規模を小さくできる。   According to this, it is only necessary to store three pieces of generated code amount data for one encoded picture. That is, it is not necessary to store the generated code amount data for each macroblock line or each macroblock pair line. Therefore, since the amount of data to be stored can be reduced, the size of the storage device can be reduced, and the overall size of the image encoding device can be reduced.

これは、事前解析結果である特徴量についても同様に適用してもよい。また、特徴量について適用することによって、画像のスケーリングが行われてしまい、事前解析したときの画像サイズと、符号化するときの画像サイズが異なってしまった場合に対応することができる。つまり、特徴量を算出した後に、画像のアップスケーリングが行われて、その後、その画像の符号化を行う場合であっても、符号化途中ピクチャの符号化済み領域及び未符号化領域のそれぞれに対応する領域における発生符号量を正確に算出することができる。   This may be similarly applied to the feature amount that is the result of the prior analysis. Further, by applying the feature amount, it is possible to cope with the case where the image is scaled and the image size when pre-analysis is different from the image size when encoding. In other words, after the feature amount is calculated, the image is upscaled, and then the image is encoded. The generated code amount in the corresponding region can be accurately calculated.

また、図24に示すように、式(1)において、aで示す範囲を符号化途中ピクチャの符号化済み領域全体のうちの一部の領域とし、bで示す範囲を符号化途中ピクチャの未符号化領域全体のうちの一部の領域としてもよい。この場合、推定符号量Sbと比較する目標符号量は、未符号化領域に割り当て可能な目標符号量のうち、bで示す範囲当たりの符号量と比較する。つまり、符号化中フレームに含まれる未符号化領域と言った場合、符号化中フレームに含まれる未符号化領域全体のうちの一部の領域も含まれ、符号化中フレームに含まれる符号化済み領域と言った場合、符号化中フレームに含まれる符号化済み領域全体のうちの一部の領域も含まれる。   Also, as shown in FIG. 24, in equation (1), the range indicated by a is a partial area of the entire encoded area of the in-encoding picture, and the range indicated by b is the unencoded area of the in-encoding picture. It is good also as a partial area | region of the whole encoding area | region. In this case, the target code amount to be compared with the estimated code amount Sb is compared with the code amount per range indicated by b among the target code amounts that can be assigned to the uncoded area. That is, when it is referred to as an unencoded area included in the frame being encoded, a part of the entire unencoded area included in the frame being encoded is also included, and the encoding included in the frame being encoded is included. When it is referred to as a completed area, a part of the entire encoded area included in the frame being encoded is also included.

なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。   Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention.

1、2、3、4、5、6、7 画像符号化装置
10 フレームバッファ
11 発生符号量記憶装置
12、17、18、21、22 発生符号量予測装置
13、24 符号量制御装置
14、27 ストリーム結合装置
15、19 事前解析装置
16、20 解析結果記憶装置
23 バッファ占有量予測装置
25 初期遅延量計算装置
26 ストリーム修正位置記憶装置
28 デコーダ
29 デコード情報記憶装置
30、31、32、33 エンコーダ
40、41、42、43 ストリームバッファ
1, 2, 3, 4, 5, 6, 7 Image encoding device 10 Frame buffer 11 Generated code amount storage device 12, 17, 18, 21, 22 Generated code amount prediction device 13, 24 Code amount control devices 14, 27 Stream combiners 15 and 19 Pre-analyzers 16 and 20 Analysis result storage device 23 Buffer occupancy prediction device 25 Initial delay amount calculation device 26 Stream correction position storage device 28 Decoder 29 Decode information storage devices 30, 31, 32, and 33 Encoder 40 , 41, 42, 43 Stream buffer

Claims (25)

複数のフレームからなる動画像データを符号化する画像符号化装置であって、
前記フレームを符号化する符号化部と、
前記符号化された符号化済みフレームの符号量と、前記符号化部による符号化途中である符号化中フレームに含まれる符号化済み領域の符号量とが格納される符号量記憶部と、
前記符号量記憶部に格納された、符号化済みフレームの符号量及び符号化中フレームの符号量に基づき、前記符号化中フレームに含まれる未符号化領域の符号量を推定する符号量推定部と、
前記推定された前記未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定する符号量制御部と、を備え、
前記符号化部は、前記符号化中フレームに含まれる未符号化領域を、前記決定された符号量制御パラメタに基づいて符号化するものであって、
前記符号量推定部は、前記符号化中フレームに時間的に近接する符号化済みフレームにおける、当該符号化中フレームに含まれる符号化済み領域及び未符号化領域のそれぞれに対応する領域の符号量である第1の符号量及び第2の符号量の比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を推定する、
画像符号化装置。
An image encoding device for encoding moving image data composed of a plurality of frames,
An encoding unit for encoding the frame;
A code amount storage unit that stores a code amount of the encoded frame that has been encoded and a code amount of an encoded region that is included in a frame that is being encoded by the encoding unit;
A code amount estimation unit that estimates the code amount of an unencoded area included in the encoding frame based on the encoding amount of the encoded frame and the encoding amount of the encoding frame stored in the code amount storage unit When,
A code amount control unit that determines a code amount control parameter of the uncoded region based on the estimated code amount of the uncoded region and a code amount that can be assigned to the uncoded region; Prepared,
The encoding unit encodes an unencoded area included in the frame being encoded based on the determined code amount control parameter,
The code amount estimation unit includes a code amount of a region corresponding to each of an encoded region and an unencoded region included in the encoded frame in an encoded frame that is temporally adjacent to the encoded frame. Based on the ratio of the first code amount and the second code amount, the code amount of the uncoded region is estimated from the code amount of the encoded region.
Image encoding device.
前記画像符号化装置は、前記符号化されるフレームの特徴量を検出する特徴量検出部を備え、
前記符号量推定部は、さらに、前記検出された特徴量に基づき、前記未符号化領域の符号量を推定するものであって、
前記符号量推定部は、前記符号化済みフレームと前記符号化中フレームとの間に、所定の変化がある場合、前記符号化中フレームに含まれる符号化済み領域の特徴量と、前記符号化中フレームに含まれる未符号化領域の特徴量との比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を推定し、前記符号化済みフレームと前記符号化中フレームとの間に、前記所定の変化がない場合は、前記第1の符号量及び前記第2の符号量の比率に基づいて、前記符号化済み領域の符号量から前記未符号化領域の符号量を推定する、
請求項1に記載の画像符号化装置。
The image encoding device includes a feature amount detection unit that detects a feature amount of the frame to be encoded,
The code amount estimation unit further estimates a code amount of the uncoded region based on the detected feature amount,
The code amount estimation unit, when there is a predetermined change between the encoded frame and the encoded frame, a feature amount of an encoded area included in the encoded frame, and the encoding Based on the ratio with the feature amount of the unencoded area included in the middle frame, the code amount of the unencoded area is estimated from the code amount of the encoded area, and the encoded frame and the encoded frame When there is no predetermined change between frames, the code amount of the uncoded region is calculated from the code amount of the encoded region based on the ratio of the first code amount and the second code amount. Estimate the quantity,
The image encoding device according to claim 1.
前記画像符号化装置は、前記符号化フレームの動き量を検出する動き量検出部を備え、
前記符号量推定部は、前記検出された前記符号化中フレームの動き量に基づいて、前記符号化中フレームに動きがあると判定した場合、前記符号化済み領域及び前記未符号化領域のそれぞれに対応する領域の位置を、当該符号化中フレームにおける動き量に応じて補正する、
請求項1又は2に記載の画像符号化装置。
The image coding apparatus includes a motion amount detecting section for detecting the motion amount of the frame in the coding,
When the code amount estimation unit determines that there is motion in the encoded frame based on the detected motion amount of the encoded frame, each of the encoded region and the unencoded region The position of the region corresponding to is corrected according to the amount of motion in the frame being encoded,
The image coding apparatus according to claim 1 or 2.
前記符号量推定部は、前記符号化中フレームの未符号化領域に動きがあると判定した場合、前記符号化済み領域及び前記未符号化領域のそれぞれに対応する領域の位置を、当該符号化中フレームの未符号化領域における動き量に応じて補正する、
請求項3に記載の画像符号化装置。
When the code amount estimation unit determines that there is a motion in an unencoded area of the frame being encoded, the code amount estimation unit determines the position of an area corresponding to each of the encoded area and the uncoded area. Correct according to the amount of motion in the uncoded area of the middle frame,
The image encoding device according to claim 3.
前記符号量推定部は、前記符号化中フレームに動きがあると判定した場合、前記符号化済み領域の符号量と、当該符号化済み領域に対応する領域の符号量とのいずれか一方の領域の符号量を、他方の領域の面積と略同一面積当たりの符号量となるように補正するもしくは、前記未符号化領域の符号量と、当該未符号化領域に対応する領域の符号量とのいずれか一方の領域の符号量を、他方の領域の面積と略同一面積当たりの符号量となるように補
前記略同一面積は、前記他方の領域の面積との差が、前記他方の領域の面積の数パーセント以内となる面積である、
請求項3又は4に記載の画像符号化装置。
Said code amount estimation unit, if it is determined that there is motion in the frame the encoding, and the code amount of the encoded region, of either the sign-weight area corresponding to the encoded region the code amount of area, corrects the amount of codes and such so that the area and per approximately the same area of the other regions, or, marks of the the code amount of uncoded regions, regions corresponding to the non-coding region the code amount of one of the regions of the issue amount to compensation such that the code amount of approximately per same area as the area of the other regions,
The substantially same area is an area where the difference from the area of the other region is within a few percent of the area of the other region.
The image encoding device according to claim 3 or 4.
前記画像符号化装置は、前記符号量記憶部に格納された符号量と、前記符号量推定部によって推定された符号量とに基づいて、仮想デコーダ・モデルにおけるバッファの占有量の推移を推定するバッファ占有量推定部を備え、
前記バッファ占有量推定部は、前記バッファの占有量の推移において、前記バッファから前記符号化中フレームを引き抜いたときのバッファの占有量を、当該符号化中フレームに含まれる符号化済み領域の符号量と、当該符号化済み領域の符号量から推定された未符号化領域の符号量とに基づいて算出した当該符号化中フレームの符号量によって推定し、
前記符号量制御部は、前記バッファ占有量推定部によって推定されたバッファの占有量の推移に基づいて、前記バッファが破綻しないように前記符号量制御パラメタを決定する、
請求項1乃至5のいずれか1項に記載の画像符号化装置。
The image encoding device estimates transition of buffer occupancy in a virtual decoder model based on a code amount stored in the code amount storage unit and a code amount estimated by the code amount estimation unit. A buffer occupancy estimation unit;
The buffer occupancy estimation unit is configured to calculate the buffer occupancy when the encoded frame is extracted from the buffer in the transition of the buffer occupancy, and the code of the encoded region included in the encoded frame. Estimated based on the amount of code and the amount of code of the unencoded region estimated from the amount of code of the encoded region,
The code amount control unit determines the code amount control parameter based on a transition of the buffer occupancy estimated by the buffer occupancy estimation unit so that the buffer does not fail.
The image encoding device according to any one of claims 1 to 5.
前記画像符号化装置は、前記フレームの符号化フォーマットとして、仮想デコーダ・モデルにおける前記フレームの初期遅延量を示し、かつ当該初期遅延量に応じたサイズとなる初期遅延量データを含むヘッダデータと、当該ヘッダデータに続いて当該フレームが符号化された符号化データと、を有するストリームデータを規定する符号化規格に従って、前記フレームを符号化して前記ストリームデータを生成するものであって、
前記画像符号化装置は、前記ストリームデータが格納されるデータ記憶部を備え、
前記符号化部は、前記フレームを符号化して前記ストリームデータを生成するときに、前記初期遅延量データがとり得る最大のサイズの仮初期遅延量データを含めたヘッダデータを前記データ記憶部に格納してから、当該フレームの符号化に応じて、当該フレームの符号化データを前記データ記憶部に格納し、
前記画像符号化装置は、前記フレームの初期遅延量の確定後に、前記仮初期遅延量データを、確定した初期遅延量を示す初期遅延量データに置き換える置換部を備え、
前記置換部は、前記置き換え後の初期遅延量データのサイズが前記置き換え前の仮初期遅延量データのサイズよりも減少する場合、減少するサイズ分のデータに代えてスタッフィングビットをヘッダデータに含めることで、前記初期遅延量データの置き換え前後でヘッダデータのサイズを同一とする、
請求項1乃至5のいずれか1項に記載の画像符号化装置。
The image encoding device, as an encoding format of the frame, indicates initial delay amount of the frame in a virtual decoder model, and includes header data including initial delay amount data having a size corresponding to the initial delay amount; Encoding the frame according to an encoding standard that defines stream data including the header data and the encoded data obtained by encoding the frame, and generating the stream data,
The image encoding device includes a data storage unit in which the stream data is stored,
When the encoding unit generates the stream data by encoding the frame, the encoding unit stores header data including temporary initial delay amount data having a maximum size that the initial delay amount data can take in the data storage unit. Then, according to the encoding of the frame, the encoded data of the frame is stored in the data storage unit,
The image encoding device includes a replacement unit that replaces the temporary initial delay amount data with initial delay amount data indicating the determined initial delay amount after the initial delay amount of the frame is determined,
When the size of the initial delay amount data after the replacement is smaller than the size of the temporary initial delay amount data before the replacement, the replacement unit includes stuffing bits in the header data instead of the data of the reduced size. Thus, the header data size is the same before and after replacement of the initial delay amount data.
The image encoding device according to any one of claims 1 to 5.
前記画像符号化装置は、前記フレームの初期遅延量を、当該フレームの符号化が終了したときにおける、前記仮想デコーダ・モデルのバッファの占有量から、予め定められたビットレートを除算することによって算出する初期遅延量算出部を備えた、
請求項7に記載の画像符号化装置。
The image encoding apparatus calculates the initial delay amount of the frame by dividing a predetermined bit rate from the buffer occupation amount of the virtual decoder model when the encoding of the frame is completed. With an initial delay amount calculation unit
The image encoding device according to claim 7.
前記動画像データに含まれる複数のフレームは、それぞれ符号化されており、
前記画像符号化装置は、前記動画像データを再符号化するトランスコーダであって、
前記特徴量検出部は、前記フレームを復号化するとともに、当該復号前のフレームの符号量を当該フレームの特徴量として検出し、
前記符号化部は、前記特徴量検出部によって復号化されたフレームを符号化する、
請求項2に記載の画像符号化装置。
Each of the plurality of frames included in the moving image data is encoded,
The image encoding device is a transcoder that re-encodes the moving image data,
The feature amount detection unit decodes the frame and detects a code amount of the frame before decoding as a feature amount of the frame,
The encoding unit encodes the frame decoded by the feature amount detection unit;
The image encoding device according to claim 2.
前記動画像データに含まれる複数のフレームは、それぞれ符号化されており、
前記画像符号化装置は、前記動画像データを再符号化するトランスコーダであって、
前記動き量検出部は、前記フレームを復号化するとともに、当該フレームの復号化において算出される動き量を、当該フレームの動き量として検出し、
前記符号化部は、前記動き量検出部によって復号化されたフレームを符号化する、
請求項3乃至5のいずれか1項に記載の画像符号化装置。
Each of the plurality of frames included in the moving image data is encoded,
The image encoding device is a transcoder that re-encodes the moving image data,
The motion amount detection unit decodes the frame and detects a motion amount calculated in decoding the frame as a motion amount of the frame,
The encoding unit encodes the frame decoded by the motion amount detection unit;
The image encoding device according to any one of claims 3 to 5.
前記符号化済みフレームは、前記符号化中フレームと同じピクチャタイプのフレームである、
請求項1乃至10のいずれか1項に記載の画像符号化装置。
The encoded frame is a frame of the same picture type as the encoded frame.
The image encoding device according to any one of claims 1 to 10.
複数のフレームからなる動画像データを画像符号化装置が符号化する画像符号化方法であって、
前記画像符号化装置が、前記フレームを符号化する符号化工程と、
前記画像符号化装置が、前記符号化された符号化済みフレームの符号量と、符号化途中である符号化中フレームに含まれる符号化済み領域の符号量とを符号量記憶部に格納する格納工程と、
前記画像符号化装置が、前記符号量記憶部に格納された、符号化済みフレームの符号量及び符号化中フレームの符号量に基づき、前記符号化中フレームに含まれる未符号化領域の符号量を推定する符号量推定工程と、
前記画像符号化装置が、前記推定された未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定するパラメタ決定工程と、を有し、
前記符号量推定工程では、前記符号化中フレームに時間的に近接する符号化済みフレームにおける、当該符号化中フレームに含まれる符号化済み領域及び未符号化領域のそれぞれに対応する領域の符号量である第1の符号量及び第2の符号量の比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を前記画像符号化装置が推定
前記符号化工程では、前記符号化中フレームに含まれる未符号化領域、前記決定された符号量制御パラメタに基づいて前記画像符号化装置が符号化する
画像符号化方法。
An image encoding method in which moving image data consisting of a plurality of frames is encoded by an image encoding device ,
An encoding step in which the image encoding device encodes the frame;
Storing said image encoding apparatus, which stores the code amount of the encoded encoded frame, and a code amount of encoded area included in the frame during the encoding in the middle encoded code amount storage unit Process,
Based on the code amount of the encoded frame and the code amount of the frame being encoded, which is stored in the code amount storage unit by the image encoding device, the code amount of the unencoded area included in the frame being encoded A code amount estimation step for estimating
The image encoding device determines a code amount control parameter for the uncoded region based on the estimated code amount of the uncoded region and the code amount that can be assigned to the uncoded region. A determination step,
In the code amount estimation step, the code amount of an area corresponding to each of an encoded area and an unencoded area included in the encoded frame in an encoded frame that is temporally close to the encoded frame in it based on the ratio of the first code amount and the second code amount, the code amount of the uncoded region from the code amount of the encoded region image coding apparatus estimates,
In the encoding process, the non-coding region contained in the frame during the coding, the image coding apparatus for encoding based on the determined code amount control parameter,
Image coding method.
複数のフレームからなる動画像データ、又は、1枚のフレームからなる静止画像データを符号化する画像符号化装置であって、
符号化するフレームの特徴量を検出する特徴量検出部と、
前記フレームを符号化する符号化部と、
前記符号化部による符号化途中である符号化中フレームに含まれる符号化済み領域の符号量が格納される符号量記憶部と、
前記検出された特徴量と、前記格納された符号量とに基づき、前記符号化中フレームに含まれる符号化領域の符号量を推定する符号量推定部と、
前記推定された未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定する符号量制御部と、を備え、
前記符号化部は、前記符号化中フレームに含まれる未符号化領域を、前記決定された符号量制御パラメタに基づいて符号化するものであって、
前記符号量推定部は、前記符号化中フレームに含まれる符号化済み領域の特徴量と、前記符号化中フレームに含まれる未符号化領域の特徴量との比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を推定する、
画像符号化装置。
An image encoding device for encoding moving image data consisting of a plurality of frames or still image data consisting of a single frame,
A feature amount detection unit for detecting a feature amount of a frame to be encoded;
An encoding unit for encoding the frame;
A code amount storage unit for storing a code amount of an encoded area included in a frame being encoded that is being encoded by the encoding unit;
And the detected feature quantity, and the based on the stored code amount, the code amount estimator for estimating the code amount of unencoded area included in the frame in the coding,
A code amount control unit that determines a code amount control parameter of the uncoded region based on the estimated code amount of the uncoded region and a code amount that can be assigned to the uncoded region. ,
The encoding unit encodes an unencoded area included in the frame being encoded based on the determined code amount control parameter,
The code amount estimation unit is based on a ratio between a feature amount of an encoded region included in the frame being encoded and a feature amount of an unencoded region included in the frame being encoded. Estimating the code amount of the uncoded region from the code amount of the region,
Image encoding device.
前記画像符号化装置は、前記動画像データ及び前記静止画像データのうち、前記動画像データを符号化するものであって、
前記符号量記憶部は、さらに、前記符号化された符号化済みフレームの符号量が格納され、
前記符号量推定部は、前記符号化済みフレームと前記符号化中フレームとの間に、所定の変化がある場合、前記特徴量の比率に基づいて、前記符号化済み領域の符号量から前記未符号化領域の符号量を推定し、前記符号化済みフレームと前記符号化中フレームとの間に、前記所定の変化がない場合は、前記符号化中フレームに時間的に近接する符号化済みフレームにおける、当該符号化中フレームに含まれる符号化済み領域及び未符号化領域のそれぞれに対応する領域の符号量である第1の符号量及び第2の符号量の比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を推定する、
請求項13に記載の画像符号化装置。
The image encoding device encodes the moving image data out of the moving image data and the still image data,
The code amount storage unit further stores a code amount of the encoded frame that has been encoded,
When there is a predetermined change between the encoded frame and the encoded frame, the code amount estimation unit calculates the uncoded amount from the code amount of the encoded region based on the feature amount ratio. An encoded frame that estimates the code amount of the encoding area and is temporally adjacent to the encoding frame if there is no predetermined change between the encoded frame and the encoding frame , Based on the ratio of the first code amount and the second code amount, which are the code amounts of the regions corresponding to each of the encoded region and the unencoded region included in the encoded frame, The code amount of the uncoded region is estimated from the code amount of the completed region,
The image encoding device according to claim 13.
前記画像符号化装置は、前記符号化フレームの動き量を検出する動き量検出部を備え、
前記符号量推定部は、前記検出された前記符号化中フレームの動き量に基づいて、前記符号化中フレームに動きがあると判定した場合、前記符号化済み領域及び前記未符号化領域のそれぞれに対応する領域の位置を、前記符号化中フレームにおける動き量に応じて補正する、
請求項14に記載の画像符号化装置。
The image coding apparatus includes a motion amount detecting section for detecting the motion amount of the frame in the coding,
When the code amount estimation unit determines that there is motion in the encoded frame based on the detected motion amount of the encoded frame, each of the encoded region and the unencoded region The position of the region corresponding to is corrected according to the amount of motion in the frame being encoded,
The image encoding device according to claim 14.
前記符号量推定部は、前記符号化中フレームの未符号化領域に動きがあると判定した場合、前記符号化済み領域及び前記未符号化領域のそれぞれに対応する領域の位置を、前記符号化中フレームの未符号化領域における動き量に応じて補正する、
請求項15に記載の画像符号化装置。
When the code amount estimation unit determines that there is a motion in the unencoded area of the frame being encoded, the code amount estimation unit determines the position of the area corresponding to each of the encoded area and the uncoded area. Correct according to the amount of motion in the uncoded area of the middle frame,
The image encoding device according to claim 15.
前記符号量推定部は、前記符号化中フレームに動きがあると判定した場合、前記符号化済み領域の符号量と、当該符号化済み領域に対応する領域の符号量とのいずれか一方の領域の符号量を、他方の領域の面積と略同一面積当たりの符号量となるように補正するもしくは、前記未符号化領域の符号量と、当該未符号化領域に対応する領域の符号量とのいずれか一方の領域の符号量を、他方の領域の面積と略同一面積当たりの符号量となるように補
前記略同一面積は、前記他方の領域の面積との差が、前記他方の領域の面積の数パーセント以内となる面積である、
請求項15又は16に記載の画像符号化装置。
Said code amount estimation unit, if it is determined that there is motion in the frame the encoding, and the code amount of the encoded region, of either the sign-weight area corresponding to the encoded region the code amount of area, corrects the amount of codes and such so that the area and per approximately the same area of the other regions, or, marks of the the code amount of uncoded regions, regions corresponding to the non-coding region the code amount of one of the regions of the issue amount to compensation such that the code amount of approximately per same area as the area of the other regions,
The substantially same area is an area where the difference from the area of the other region is within a few percent of the area of the other region.
The image encoding device according to claim 15 or 16.
前記画像符号化装置は、前記動画像データ及び前記静止画像データのうち、前記動画像データを符号化するものであって、
前記画像符号化装置は、前記符号量記憶部に格納された符号量と、前記符号量推定部によって推定された符号量とに基づいて、仮想デコーダ・モデルにおけるバッファの占有量の推移を推定するバッファ占有量推定部を備え、
前記バッファ占有量推定部は、前記バッファの占有量の推移において、前記バッファから前記符号化中フレームを引き抜いたときのバッファの占有量を、当該符号化中フレームに含まれる符号化済み領域の符号量と、当該符号化済み領域の符号量から推定された未符号化領域の符号量とに基づいて算出した当該符号化中フレームの符号量によって推定し、
前記符号量制御部は、前記バッファ占有量推定部によって推定されたバッファの占有量の推移に基づいて、前記バッファが破綻しないように前記符号量制御パラメタを決定する、
請求項13に記載の画像符号化装置。
The image encoding device encodes the moving image data out of the moving image data and the still image data,
The image encoding device estimates transition of buffer occupancy in a virtual decoder model based on a code amount stored in the code amount storage unit and a code amount estimated by the code amount estimation unit. A buffer occupancy estimation unit;
The buffer occupancy estimation unit is configured to calculate the buffer occupancy when the encoded frame is extracted from the buffer in the transition of the buffer occupancy, and the code of the encoded region included in the encoded frame. Estimated based on the amount of code and the amount of code of the unencoded region estimated from the amount of code of the encoded region,
The code amount control unit determines the code amount control parameter based on a transition of the buffer occupancy estimated by the buffer occupancy estimation unit so that the buffer does not fail.
The image encoding device according to claim 13.
前記画像符号化装置は、前記動画像データ及び前記静止画像データのうち、前記動画像データを符号化するものであって、前記フレームの符号化フォーマットとして、仮想デコーダ・モデルにおける前記フレームの初期遅延量を示し、かつ当該初期遅延量に応じたサイズとなる初期遅延量データを含むヘッダデータと、当該ヘッダデータに続いて当該フレームが符号化された符号化データと、を有するストリームデータを規定する符号化規格に従って、前記フレームを符号化して前記ストリームデータを生成し、
前記画像符号化装置は、前記ストリームデータが格納されるデータ記憶部を備え、
前記符号化部は、前記フレームを符号化して前記ストリームデータを生成するときに、前記初期遅延量データがとり得る最大のサイズの仮初期遅延量データを含めたヘッダデータを前記データ記憶部に格納してから、当該フレームの符号化に応じて、当該フレームの符号化データを前記データ記憶部に格納し、
前記画像符号化装置は、前記フレームの初期遅延量の確定後に、前記仮初期遅延量データを、当該確定した初期遅延量を示す初期遅延量データに置き換える置換部を備え、
前記置換部は、前記置き換え後の初期遅延量データのサイズが前記置き換え前の仮初期遅延量データのサイズよりも減少する場合、減少するサイズ分のデータに代えてスタッフィングビットをヘッダデータに含めることで、前記初期遅延量データの置き換え前後でヘッダデータのサイズを同一とする、
請求項13に記載の画像符号化装置。
The image encoding device encodes the moving image data out of the moving image data and the still image data, and an initial delay of the frame in a virtual decoder model as an encoding format of the frame This defines stream data having header data including initial delay amount data indicating the amount and having a size corresponding to the initial delay amount, and encoded data obtained by encoding the frame following the header data. According to an encoding standard, the frame is encoded to generate the stream data,
The image encoding device includes a data storage unit in which the stream data is stored,
When the encoding unit generates the stream data by encoding the frame, the encoding unit stores header data including temporary initial delay amount data having a maximum size that the initial delay amount data can take in the data storage unit. Then, according to the encoding of the frame, the encoded data of the frame is stored in the data storage unit,
The image encoding device includes a replacement unit that replaces the temporary initial delay amount data with initial delay amount data indicating the determined initial delay amount after the initial delay amount of the frame is determined,
When the size of the initial delay amount data after the replacement is smaller than the size of the temporary initial delay amount data before the replacement, the replacement unit includes stuffing bits in the header data instead of the data of the reduced size. Thus, the header data size is the same before and after replacement of the initial delay amount data.
The image encoding device according to claim 13.
前記画像符号化装置は、前記フレームの初期遅延量を、当該フレームの符号化が終了したときにおける、前記仮想デコーダ・モデルのバッファの占有量から、予め定められたビットレートを除算することによって算出する初期遅延量算出部を備えた、
請求項19に記載の画像符号化装置。
The image encoding apparatus calculates the initial delay amount of the frame by dividing a predetermined bit rate from the buffer occupation amount of the virtual decoder model when the encoding of the frame is completed. With an initial delay amount calculation unit
The image encoding device according to claim 19.
前記動画像データに含まれる複数のフレームは、それぞれ符号化されており、
前記画像符号化装置は、前記動画像データ及び前記静止画像データのうち、前記動画像データを再符号化するトランスコーダであって、
前記特徴量検出部は、前記フレームを復号化するとともに、当該復号前のフレームの符号量を当該フレームの特徴量として検出し、
前記符号化部は、前記特徴量検出部によって復号化されたフレームを符号化する、
請求項13乃至20のいずれか1項に記載の画像符号化装置。
Each of the plurality of frames included in the moving image data is encoded,
The image encoding device is a transcoder that re-encodes the moving image data out of the moving image data and the still image data,
The feature amount detection unit decodes the frame and detects a code amount of the frame before decoding as a feature amount of the frame,
The encoding unit encodes the frame decoded by the feature amount detection unit;
The image encoding device according to any one of claims 13 to 20.
前記動画像データに含まれる複数のフレームは、それぞれ符号化されており、
前記画像符号化装置は、前記動画像データ及び前記静止画像データのうち、前記動画像データを再符号化するトランスコーダであって、
前記動き量検出部は、前記フレームを復号化するとともに、当該フレームの復号化において算出される動き量を、当該フレームの動き量として検出し、
前記符号化部は、前記動き量検出部によって復号化されたフレームを符号化する、
請求項15乃至17のいずれか1項に記載の画像符号化装置。
Each of the plurality of frames included in the moving image data is encoded,
The image encoding device is a transcoder that re-encodes the moving image data out of the moving image data and the still image data,
The motion amount detection unit decodes the frame and detects a motion amount calculated in decoding the frame as a motion amount of the frame,
The encoding unit encodes the frame decoded by the motion amount detection unit;
The image encoding device according to any one of claims 15 to 17.
前記特徴量検出部は、それぞれの種類が異なる複数の特徴量を検出し、
前記符号量推定部は、前記複数の特徴量のうち、前記符号化中フレームのピクチャタイプに応じた特徴量を使用する、
請求項13乃至22のいずれか1項に記載の画像符号化装置。
The feature amount detection unit detects a plurality of feature amounts of different types,
The code amount estimation unit uses a feature amount corresponding to a picture type of the frame being encoded among the plurality of feature amounts.
The image encoding device according to any one of claims 13 to 22.
複数のフレームからなる動画像データを符号化する画像符号化装置であって、
符号化するフレームの特徴量を検出する特徴量検出部と、
前記フレームを符号化する符号化部と、
前記符号化部による符号化途中である符号化中フレームに含まれる符号化済み領域の符号量が格納される符号量記憶部と、
前記検出された特徴量と、前記格納された符号量とに基づき、前記符号化中フレームに含まれる符号化領域の符号量を推定する符号量推定部と、
前記推定された未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定する符号量制御部と、を備え、
前記符号化部は、前記符号化中フレームに含まれる未符号化領域を、前記決定された符号量制御パラメタに基づいて符号化するものであって、
前記符号量推定部は、前記符号化中フレームに時間的に近接するフレームにおける、当該符号化中フレームに含まれる符号化済み領域及び未符号化領域のそれぞれに対応する領域の特徴量である第1の特徴量及び第2の特徴量の比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を推定する、
画像符号化装置。
An image encoding device for encoding moving image data composed of a plurality of frames,
A feature amount detection unit for detecting a feature amount of a frame to be encoded;
An encoding unit for encoding the frame;
A code amount storage unit for storing a code amount of an encoded area included in a frame being encoded that is being encoded by the encoding unit;
And the detected feature quantity, and the based on the stored code amount, the code amount estimator for estimating the code amount of unencoded area included in the frame in the coding,
A code amount control unit that determines a code amount control parameter of the uncoded region based on the estimated code amount of the uncoded region and a code amount that can be assigned to the uncoded region. ,
The encoding unit encodes an unencoded area included in the frame being encoded based on the determined code amount control parameter,
The code amount estimation unit is a feature amount of a region corresponding to each of an encoded region and an unencoded region included in the frame being encoded in a frame that is temporally adjacent to the frame being encoded. Based on the ratio of the feature quantity of 1 and the second feature quantity, the code quantity of the uncoded area is estimated from the code quantity of the coded area.
Image encoding device.
複数のフレームからなる動画像データ、又は、1枚のフレームからなる静止画像データを画像符号化装置が符号化する画像符号化方法であって、
前記画像符号化装置が、符号化するフレームの特徴量を検出する特徴量検出工程と、
前記画像符号化装置が、前記フレームを符号化する符号化工程と、
前記画像符号化装置が、符号化途中である符号化中フレームに含まれる符号化済み領域の符号量を符号量記憶部に格納する格納工程と、
前記画像符号化装置が、前記検出された特徴量と、前記格納された符号量とに基づき、前記符号化中フレームに含まれる未符号化領域の符号量を推定する符号量推定工程と、
前記画像符号化装置が、前記推定された未符号化領域の符号量と、当該未符号化領域に割り当て可能な符号量とに基づいて、当該未符号化領域の符号量制御パラメタを決定するパラメタ決定工程と、を有し、
前記符号量推定工程では、前記符号化中フレームに含まれる符号化済み領域の特徴量と、前記符号化中フレームに含まれる未符号化領域の特徴量との比率に基づいて、当該符号化済み領域の符号量から当該未符号化領域の符号量を前記画像符号化装置が推定
前記符号化工程では、前記符号化中フレームに含まれる未符号化領域、前記決定された符号量制御パラメタに基づいて前記画像符号化装置が符号化する
画像符号化方法。
An image encoding method in which an image encoding device encodes moving image data consisting of a plurality of frames or still image data consisting of a single frame,
A feature amount detecting step in which the image encoding device detects a feature amount of a frame to be encoded;
An encoding step in which the image encoding device encodes the frame;
A storage step in which the image encoding device stores in the code amount storage unit the code amount of the encoded region included in the encoding frame that is being encoded;
A code amount estimating step in which the image encoding device estimates a code amount of an unencoded area included in the frame being encoded based on the detected feature amount and the stored code amount;
The image encoding device determines a code amount control parameter for the uncoded region based on the estimated code amount of the uncoded region and the code amount that can be assigned to the uncoded region. A determination step,
In the code amount estimation step, the encoded amount is calculated based on the ratio between the feature amount of the encoded region included in the encoded frame and the feature amount of the unencoded region included in the encoded frame. the code amount of the uncoded region the image encoding apparatus estimates the code amount of area,
In the encoding process, the non-coding region contained in the frame during the coding, the image coding apparatus for encoding based on the determined code amount control parameter,
Image coding method.
JP2011123654A 2011-06-01 2011-06-01 Image coding apparatus and image coding method Expired - Fee Related JP5706759B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011123654A JP5706759B2 (en) 2011-06-01 2011-06-01 Image coding apparatus and image coding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011123654A JP5706759B2 (en) 2011-06-01 2011-06-01 Image coding apparatus and image coding method

Publications (2)

Publication Number Publication Date
JP2012253516A JP2012253516A (en) 2012-12-20
JP5706759B2 true JP5706759B2 (en) 2015-04-22

Family

ID=47525924

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011123654A Expired - Fee Related JP5706759B2 (en) 2011-06-01 2011-06-01 Image coding apparatus and image coding method

Country Status (1)

Country Link
JP (1) JP5706759B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014241507A (en) * 2013-06-11 2014-12-25 ソニー株式会社 Image processing apparatus, method and program, and imaging apparatus
JP2015005939A (en) 2013-06-24 2015-01-08 ソニー株式会社 Image processing apparatus and method, program, and imaging apparatus
JP6435822B2 (en) * 2014-12-04 2018-12-12 富士通株式会社 Moving picture coding apparatus, moving picture coding method, and moving picture coding computer program
JP6470191B2 (en) * 2016-01-06 2019-02-13 日本電信電話株式会社 Video encoding method, video encoding apparatus, and video encoding program
EP3816925A4 (en) * 2019-03-18 2022-05-04 Verisilicon Microelectronics (Chengdu) Co., Ltd. Coordinated access method and system for external memory, and coordinated access architecture

Also Published As

Publication number Publication date
JP2012253516A (en) 2012-12-20

Similar Documents

Publication Publication Date Title
JP5072893B2 (en) Image encoding method and image decoding method
KR101172430B1 (en) Method and apparatus for bit rate control
US9071841B2 (en) Video transcoding with dynamically modifiable spatial resolution
JP3866538B2 (en) Video coding method and apparatus
US20160073106A1 (en) Techniques for adaptive video streaming
EP2403248B1 (en) Moving picture encoding device, moving picture encoding method, and moving picture encoding computer program
JP4358215B2 (en) Video encoding apparatus and method
JP5286581B2 (en) Moving picture coding control method, moving picture coding apparatus, and moving picture coding program
JP5706759B2 (en) Image coding apparatus and image coding method
JP2002010259A (en) Image encoding apparatus and its method and recording medium recording image encoding program
TWI483617B (en) Moving picture encoding control method, moving picture encoding apparatus, and moving picture encoding program
US10165272B2 (en) Picture-level QP rate control performance improvements for HEVC encoding
JP5100572B2 (en) Encoder
JP2002199392A (en) Method and device for encoding image
JP4285431B2 (en) Video information editing apparatus, method and program
JPWO2008053557A1 (en) Moving image re-encoding device, moving image re-encoding method, moving image re-encoding program, and recording medium storing moving image re-encoding program
WO2013147997A1 (en) Method and system for generating side information at a video encoder to differentiate packet data
JP4254784B2 (en) Moving picture coding apparatus, method and program
JP4231045B2 (en) Video coding method and apparatus
JP5871602B2 (en) Encoder
JP4871848B2 (en) Video re-encoding device
US20150010061A1 (en) Video encoding method, device and program
KR101197094B1 (en) Method and apparatus for controlling bitrate based on statistical model for h.264/avc
CN115550656A (en) I frame code rate control method and device suitable for hardware implementation
CN116437092A (en) Code rate control method and device for avoiding generation of oversized I frame

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140217

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141008

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141209

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150203

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20150224

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150227

R150 Certificate of patent or registration of utility model

Ref document number: 5706759

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees