JP6916618B2 - Image coding device and its control method and program - Google Patents
Image coding device and its control method and program Download PDFInfo
- Publication number
- JP6916618B2 JP6916618B2 JP2016247009A JP2016247009A JP6916618B2 JP 6916618 B2 JP6916618 B2 JP 6916618B2 JP 2016247009 A JP2016247009 A JP 2016247009A JP 2016247009 A JP2016247009 A JP 2016247009A JP 6916618 B2 JP6916618 B2 JP 6916618B2
- Authority
- JP
- Japan
- Prior art keywords
- code amount
- block
- image
- interest
- target code
- 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.)
- Active
Links
Images
Description
本発明は動画像データの符号化技術に関するものである。 The present invention relates to a technique for encoding moving image data.
現在、デジタルビデオカメラ等、動画像を記録するデジタル機器が普及している。このようなデジタル機器では、所定の記録媒体に一定時間の動画像が記録できるよう、動画像データの圧縮符号化を行っている。 Currently, digital devices such as digital video cameras that record moving images are in widespread use. In such a digital device, the moving image data is compressed and coded so that the moving image for a certain period of time can be recorded on a predetermined recording medium.
従来の代表的な圧縮符号化方式として、H.264(H.264/ MPEG-4 Part10 : Advanced Video Coding)が知られている。このような圧縮符号化方式は、1フレーム内にて、所定画素数で構成されるブロック毎に、その動画像が有する時間冗長性と空間冗長性を利用してデータ量を圧縮するものである。 H.264 (H.264 / MPEG-4 Part10: Advanced Video Coding) is known as a conventional typical compression coding method. In such a compression coding method, the amount of data is compressed by utilizing the time redundancy and spatial redundancy of the moving image for each block composed of a predetermined number of pixels in one frame. ..
上記のH.264では、時間冗長性に対する動き検出及び動き補償、空間冗長性に対する周波数変換として離散コサイン変換(Descrete Cosine Transform;DCT) 、更に量子化やエントロピー符号化といった技術を組み合わせることで圧縮符号化を実現している。 In the above H.264, motion detection and motion compensation for time redundancy, discrete cosine transform (DCT) as frequency conversion for spatial redundancy, and compression code by combining technologies such as quantization and entropy coding. Has been realized.
ただし、ある程度以上にまで圧縮率を上げると、DCT変換特有のブロック歪みが顕著になり画像劣化が目立つようになる。そこで、JPEG2000方式等では、周波数変換として、水平方向と垂直方向に低域フィルタリングと高域フィルタリングをそれぞれ適用することで、複数のサブバンドと呼ばれる周波数帯に分解する離散ウェーブレット変換(Discrete Wavelet Transform; DWT)を採用している。DWTを用いたサブバンド符号化は、DCTを用いた符号化技術に比べ、ブロック歪みが生じにくく、高圧縮時の圧縮特性が良いといった特徴を有する。 However, if the compression rate is increased to a certain extent or more, the block distortion peculiar to the DCT transform becomes remarkable and the image deterioration becomes conspicuous. Therefore, in the JPEG2000 system, etc., the discrete wavelet transform (Discrete Wavelet Transform;) that decomposes into multiple frequency bands by applying low-frequency filtering and high-frequency filtering in the horizontal and vertical directions as frequency transforms. DWT) is adopted. Subband coding using DWT has features that block distortion is less likely to occur and compression characteristics at high compression are better than coding technology using DCT.
一般的な符号量制御は、符号化が完了しているフレームの発生符号量を元に、次に符号化するフレームの目標符号量を決定する。そして、1フレームあたりの目標符号量へ発生符号量を収束させるために、量子化に利用する量子化パラメータQpを画像の所定の領域毎に変更する量子化制御を行うことで符号量の制御を行う。なお、Qpは、その値が大きい程符号量を削減することができるパラメータである一方、画質劣化の原因になるため、出来るだけ小さく、かつ画面内で一定であることが望ましい。量子化制御により、所望の符号量へ画像データを圧縮することが可能である。 In general code amount control, the target code amount of the frame to be coded next is determined based on the generated code amount of the frame for which coding is completed. Then, in order to converge the generated code amount to the target code amount per frame, the code amount is controlled by performing quantization control in which the quantization parameter Qp used for quantization is changed for each predetermined region of the image. conduct. The larger the value of Qp, the more the code amount can be reduced. On the other hand, it causes deterioration of image quality. Therefore, it is desirable that Qp is as small as possible and constant in the screen. The quantization control makes it possible to compress the image data to a desired code amount.
上述のように、Qpは画質の観点から画面内で一定であることが望ましい。実現するためには、画像の所定の領域毎にQpが画面内で一定になるような目標符号量を設定する必要がある。Qpが大きいほど発生符号量が小さくなる関係から、画像の中でも難しく発生符号量が出る領域の目標符号量は大きく、易しく発生符号量が出ない領域の目標符号量は小さく割り当てることで、画面内でQpを一定にすることが可能である。ただし、動画の圧縮符号化にリアルタイム性が求められるため、画像内の難易度は、1フレーム前の画像からフィードバックする必要がある。 As described above, it is desirable that Qp is constant in the screen from the viewpoint of image quality. In order to realize this, it is necessary to set a target code amount so that Qp becomes constant in the screen for each predetermined area of the image. Since the larger the Qp, the smaller the generated code amount, the target code amount in the area where the generated code amount is difficult to be generated is large in the image, and the target code amount in the area where the generated code amount is not easily generated is assigned small in the screen. It is possible to make Qp constant with. However, since real-time performance is required for compression coding of moving images, it is necessary to feed back the difficulty level in the image from the image one frame before.
しかし、動画の圧縮符号化は、リアルタイムに行う必要がある。このため、例えば動画記録中にフラッシュが炊かれるようなシーンチェンジが起きると、シーンが変わっていない前提の設定値で符号量制御を行うことになるので、1フレーム当たりの目標符号量を大きく超えた発生符号量が出てしまう可能性がある。それ故、場合によっては記録メディアに書き込めなくなってしまう。 However, video compression coding needs to be done in real time. For this reason, for example, if a scene change occurs during video recording such that the flash is cooked, the code amount is controlled with the set value assuming that the scene has not changed, which greatly exceeds the target code amount per frame. There is a possibility that the amount of generated code will be output. Therefore, in some cases, it becomes impossible to write to the recording medium.
そこで、所定の領域毎に発生符号量を積算し、発生符号量が上限値よりも大きい場合、符号量を抑制するように次の領域の量子化パラメータを変更することで、符号量制御性を向上する技術が特許文献1に記載されている。
Therefore, the code amount controllability is improved by integrating the generated code amount for each predetermined area and changing the quantization parameter of the next area so as to suppress the code amount when the generated code amount is larger than the upper limit value. The technique to be improved is described in
特許文献1によれば、発生符号量を所定の値以上にしないことが可能であるため、記録メディアに書き込めないような破たんを回避することができる。
According to
しかしながら、特許文献1に記載された技術は、発生符号量の上限値を画像によらず一意に定めていることで、発生符号量を抑制しなくても良い画像でも、量子化パラメータを変更してしまう場合がある。
However, the technique described in
例えば、画像の上部は極端に難しく符号量が発生し、下部は極端に易しく符号量が発生しない画像の場合を考察する。通常、符号化は画像の上部から下部に向かうラスタースキャン順に圧縮符号化を行う際ので、上記のような画像の場合、発生符号量の上限値を一意に定める場合、量子化パラメータが画像中盤から変化してしまい、画質劣化を引き起こす可能性がある。 For example, consider the case of an image in which the upper part of the image is extremely difficult to generate a code amount and the lower part is extremely easy to generate a code amount. Normally, coding is performed when compression coding is performed in the order of raster scan from the top to the bottom of the image. Therefore, in the case of the above image, when the upper limit of the generated code amount is uniquely determined, the quantization parameter is from the middle of the image. It may change and cause deterioration of image quality.
本発明は上記の問題点に鑑み、量子化パラメータの変動を抑えて画質を保ちつつ、符号量の制御を行う技術を提供するものである。 In view of the above problems, the present invention provides a technique for controlling the amount of code while suppressing fluctuations in quantization parameters and maintaining image quality.
この課題を解決するため、例えば本発明の画像符号化装置は以下の構成を備える。すなわち、
撮像手段で撮像した動画像データを符号化する画像符号化装置であって、
前記動画像データにおける着目フレームの画像データを、予め設定されたブロック単位に、目標符号量に応じて決定される量子化パラメータに従って量子化する量子化手段と、
該量子化手段で得られた量子化後のデータを、前記ブロック単位に符号化する符号化手段と、
前記符号化手段により発生する符号量が、設定されたブロック目標符号量になるように前記量子化手段を制御する符号量制御手段とを有し、
前記符号量制御手段は、
前記着目フレームの画像と直前のフレームの画像の相関度を取得する取得手段と、
1フレームにおける先頭のブロックから最後のブロックに至る軸を水平軸、符号化データの積算量を表す軸を垂直軸とする座標空間において、予め設定されたフレーム目標符号量が示す位置が表す座標を通る符号量上限値を表す線分の傾きを、前記相関度に基づいて決定する第1の決定手段であって、前記相関度が大きければ前記線分の傾きが小さく、前記相関度が小さければ前記線分の傾きが大きくなるように前記線分の傾きを決定する第1の決定手段と、
予め設定された基準目標符号量と、着目ブロックの直前の符号化済みのブロックの複雑度とに基づき、前記着目ブロックの前記ブロック目標符号量を決定する第2の決定手段であって、前記着目ブロックの直前の符号化済みのブロックの複雑度が大きいときには前記着目ブロックの前記ブロック目標符号量が大きくなり、前記着目ブロックの直前の符号化済みのブロックの複雑度が小さいときには前記着目ブロックの前記ブロック目標符号量が小さくなるように前記着目ブロックの前記ブロック目標符号量を決定する第2の決定手段と、
前記着目フレームの先頭のブロックから前記直前のブロックまでの合計の符号量が、前記第1の決定手段で決定した前記線分が示す符号量を超えた場合、前記着目ブロックの前記ブロック目標符号量を、前記線分に沿うように変更する変更手段と、を有することを特徴とする。
In order to solve this problem, for example, the image coding apparatus of the present invention has the following configuration. That is,
An image coding device that encodes moving image data captured by an imaging means.
A quantization means for quantizing the image data of the frame of interest in the moving image data in preset block units according to a quantization parameter determined according to a target code amount.
A coding means that encodes the quantized data obtained by the quantization means in block units, and
It has a code amount control means for controlling the quantization means so that the code amount generated by the coding means becomes a set block target code amount.
The code amount control means is
Acquisition means for acquiring a pre-Symbol correlation of the image of the image and the frame immediately before the frame of interest,
In a coordinate space where the axis from the first block to the last block in one frame is the horizontal axis and the axis representing the integrated amount of coded data is the vertical axis, the coordinates represented by the position indicated by the preset frame target code amount are set. It is the first determination means for determining the slope of the line segment representing the upper limit of the amount of code to pass based on the correlation degree. If the correlation degree is large, the slope of the line segment is small, and if the correlation degree is small, the slope is small. A first determining means for determining the inclination of the line segment so that the inclination of the line segment becomes large,
It is a second determination means for determining the block target code amount of the block of interest based on a preset reference target code amount and the complexity of the coded block immediately before the block of interest, and is the focus. When the complexity of the coded block immediately before the block is high, the block target code amount of the block of interest is large, and when the complexity of the coded block immediately before the block of interest is low, the block of interest is said. A second determining means for determining the block target code amount of the block of interest so that the block target code amount becomes small,
When the total code amount from the first block of the focus frame to the immediately preceding block exceeds the code amount indicated by the line segment determined by the first determination means, the block target code amount of the focus block Is characterized by having a changing means for changing the line segment so as to follow the line segment.
本発明によれば、量子化パラメータの変動を抑えて画質を保ちつつ、符号量の制御を行うことが可能となる。 According to the present invention, it is possible to control the code amount while suppressing fluctuations in the quantization parameter and maintaining image quality.
以下図面を参照しながら本発明の好適な実施の形態を説明する。なお、実施形態で説明する画像符号化装置は、デジタルビデオカメラに代表される撮像装置に搭載されるものとして説明する。従って、符号化対象は、撮像部が所定のフレームレートで撮像して得た画像データとなる。 A preferred embodiment of the present invention will be described below with reference to the drawings. The image coding device described in the embodiment will be described as being mounted on an image pickup device typified by a digital video camera. Therefore, the coding target is the image data obtained by the imaging unit imaging at a predetermined frame rate.
[第1の実施形態]
図1は、第1の実施形態に係る画像符号化装置のブロック構成図である。図2は、図1の画像符号化部100に入力される画像データがラスタースキャン順であることを示す図である。図2のように、画像データは画素ライン単位で、ラスタ順に画像符号化部100へ供給され、圧縮符号化される。本実施形態では、1画素ライン単位で量子化パラメータを変更(更新)し、符号量制御を行う例を説明する。なお、画像データは撮像装置へ入力される画素値そのものでも、その画素値に何らかの処理を施したデータでも良い。
[First Embodiment]
FIG. 1 is a block configuration diagram of an image coding device according to the first embodiment. FIG. 2 is a diagram showing that the image data input to the
以下、図1を参照して本実施形態に係る画像符号化装置における符号化処理の概要について説明する。 Hereinafter, an outline of the coding process in the image coding apparatus according to the present embodiment will be described with reference to FIG.
画像符号化部100は、符号量制御部101により符号量制御を行う。符号量制御部101は、量子化設定部102で設定される画像の基準となる量子化パラメータ、目標符号量設定部103で設定される当該画像の画像目標符号量、及び、複雑度設定部111で設定される画像複雑度に従って画像データを圧縮符号化する。なお、量子化設定部102が設定する、画像の基準となる量子化パラメータを単に基準量子化パラメータと言う。
The
量子化部104は、量子化制御部105で出力される量子化パラメータQpを利用し、入力される画像データを1画素毎に量子化する。Qpは、その値が大きいほど符号量を削減できる一方、その値が大きいほど画質劣化が顕著になる。故に、Qpは画像劣化度を表す指標値とも言うことができる。
The
符号化部106は、量子化部104で量子化された画像データを符号化し、生成された符号化データを出力する。この際、生成された符号化データの量(符号量)が発生符号量保持部107に保持される。
The
量子化パラメータ保持部108は、基準量子化パラメータQpbase及び量子化制御部105で決定した、次に符号化するラインに用いる量子化パラメータQp[i]を保持する。なお、以降、変数iは当該符号化対象ライン番号を示し、Qp[i]は、当該フレームの第iラインのQpを意味する。
The quantization
複雑度算出部109は、次に符号化する第iラインに対し、1ライン前のラインの複雑度X[i-1]を算出する(詳細後述)。
The
目標符号量算出部110は、目標符号量設定部103で設定される画像の基準目標符号量Tn、複雑度設定部111で設定される画像複雑度Xn-1、及び、複雑度X[i-1]に従って、次に符号化する第iラインの目標符号量T[i]を算出する。ここで示すnは、符号化対象画像番号を示し、例えばTnは、第nフレームの画像目標符号量を表し、画像複雑度Xn-1は符号化対象の着目画像の1つ前の画像の複雑度を表す。
The target code
目標符号量変更部112は、符号化が完了したラインまでの発生符号量と、相関度判定部115の画像相関度からある一定条件を満たした場合、目標符号量算出部110で算出した目標符号量を変更する(詳細後述)。
When a certain condition is satisfied from the generated code amount up to the line where the coding is completed and the image correlation degree of the correlation
差分算出部113は、画素ライン毎に、発生符号量保持部107で保持されたライン発生符号量S[i-1]と、目標符号量変更部113から出力される目標符号量T’[i]の差分E[i-1]を算出し、算出結果を差分保持部114に出力する。差分保持部114は、画像の先頭ラインからの積算差分値ΣE[i-1]を保持する。
The
量子化制御部105は、差分保持部114で保持された積算差分値ΣE[i-1]と、量子化パラメータ保持部108で保持された基準量子化パラメータQpbaseを用いて、次のラインの量子化パラメータQp[i]を決定する。量子化パラメータは、当該画像の当該ラインまでの発生符号量積算量が、同目標符号量積算量へ近付くように制御される。
The
量子化制御部105は、積算差分値ΣE[i-1]の絶対値が小さくなるように、次に符号化するラインの量子化パラメータQp[i]を算出する。その詳細な算出方法は後述する。
以上により符号量を制御する。
The
The code amount is controlled by the above.
<複雑度の算出>
複雑度は、難易度を示す指標であり、画像が複雑であるほど大きく、平坦であるほど小さくなる値である。
<Calculation of complexity>
The complexity is an index indicating the difficulty level, and is a value that increases as the image becomes more complex and decreases as the image becomes flat.
複雑度算出部109は、着目ラインの目標符号量を算出するために、1つ前に符号化したラインの複雑度を算出する。
The
1ライン前の符号化に利用した量子化パラメータQp[i-1]と、その際の発生符号量S[i-1]を用いて、1ライン前の複雑度X[i-1]を次式(1)により算出する。
X[i-1] = Qp[i-1] × S[i-1] … (1)
Using the quantization parameter Qp [i-1] used for coding one line before and the code amount S [i-1] generated at that time, the complexity X [i-1] one line before is calculated as follows. Calculated by equation (1).
X [i-1] = Qp [i-1] × S [i-1]… (1)
<目標符号量の算出>
画像の難しいラインほど目標符号量を多く割り当て、易しいラインほど目標符号量を小さく割り当てることで、画質劣化度を意味するQpの変動を画面内で極力小さくすることができる。そこで、実施形態における目標符号量算出部110は、目標符号量設定部103で設定される画像の基準目標符号量Tn、複雑度設定部111で設定される画像複雑度Xn-1[i]及び、複雑度X[i-1]に従い、次に符号化する着目ラインの目標符号量T[i]を算出する。目標符号量の算出式は次式(2)の通りである。
T[i] = Tn × X[i-1] / Xn-1[i] …(2)
式(1)のように、複雑度は符号化しなければ算出できないフィードバック量であるため、次に符号化するラインの目標符号量は、1ライン前の複雑度、1フレーム前の第iラインの複雑度をフィードバック算出する。
<Calculation of target code amount>
By allocating a larger target code amount to a difficult line in an image and allocating a smaller target code amount to an easy line, the fluctuation of Qp, which means the degree of image quality deterioration, can be minimized on the screen. Therefore, the target code
T [i] = Tn × X [i-1] / Xn-1 [i]… (2)
Since the complexity is a feedback amount that cannot be calculated without coding as in equation (1), the target code amount of the line to be encoded next is the complexity of one line before and the i-th line of one frame before. Feedback calculation of complexity.
<量子化制御>
量子化パラメータ算出方法の一つに、MPEG2 Test Model 5に示された公知技術がある。このTest Model 5を参照し、実施形態では、差分保持部114で保持された積算差分値ΣE[i-1]と量子化パラメータ保持部108で保持された基準量子化パラメータQpbaseを用いて、次のラインの量子化パラメータQp[i]を次式(3)として算出する。
Qp[i]=Qpbase + r ×ΣE[i-1] …(3)
なお、式中、rは制御感度を示し、大きいほど積算差分値に応じて急峻にQp[i]を変動させて符号量の制御性が良くなるパラメータである。
<Quantization control>
As one of the quantization parameter calculation methods, there is a known technique shown in MPEG2 Test Model 5. With reference to this Test Model 5, in the embodiment, the integrated difference value ΣE [i-1] held by the
Qp [i] = Qpbase + r × ΣE [i-1]… (3)
In the equation, r indicates the control sensitivity, and the larger it is, the more steeply the Qp [i] is changed according to the integrated difference value, and the better the controllability of the code amount is.
Test Model5を利用することで、目標符号量に対して発生符号量が大きければ量子化パラメータを大きく、小さければ量子化パラメータを小さく設定し、符号量を制御することが可能である。 By using Test Model 5, it is possible to control the code amount by setting the quantization parameter to be large if the generated code amount is large with respect to the target code amount and to set the quantization parameter to be small if it is small.
<シーンチェンジ時の動作>
本実施形態におけるシーンチェンジは、1フレーム前の画像に対して着目フレームの画像難易度が乖離しているフレーム間の関係を指す。例えば、暗闇の中で動画像を撮影してN番目のフレームでフラッシュが炊かれた場合である。直前のN−1フレームでは暗闇で物体が視認できないような画像であったのに対し、Nフレームではフラッシュにより物体が視認できる画像になり、Nフレームの画像難易度はN−1フレームに対して十分に高くなる。
<Operation at the time of scene change>
The scene change in the present embodiment refers to the relationship between frames in which the image difficulty of the frame of interest deviates from the image one frame before. For example, when a moving image is taken in the dark and the flash is cooked in the Nth frame. In the previous N-1 frame, the image was such that the object could not be seen in the dark, but in the N frame, the object became visible by the flash, and the image difficulty of the N frame was higher than that of the N-1 frame. It will be high enough.
以上のような動画像におけるシーンチェンジは通常の撮影時に頻繁に起こる。このため、シーンチェンジ時における実施形態の符号量制御部101の動作を以下に説明する。
Scene changes in moving images as described above frequently occur during normal shooting. Therefore, the operation of the code
符号量制御部101は、上述のように量子化設定部102、目標符号量設定部103、複雑度設定部111の設定値に従い符号量制御を行う。動画像の圧縮符号化においては、一般的に、上記の設定値はリアルタイム処理のためフィードバック量を利用する。また、符号量制御部101内部でも、式(2)に示すように、符号化対象の着目ラインの目標符号量の算出には、フィードバック量を利用する。以上から、シーンチェンジが発生した場合、符号量制御性が悪くなる問題がある。
As described above, the code
ここで、シーンチェンジ時の問題を説明する。図3(a),(b)は、シーンチェンジ時の動作説明に用いる2種の動画像パターンA,Bを示している。図4は動画像パターンAにおけるシーンチェンジ前後のライン単位の目標符号量の推移を示している。 Here, the problem at the time of scene change will be explained. FIGS. 3A and 3B show two types of moving image patterns A and B used for explaining the operation at the time of a scene change. FIG. 4 shows the transition of the target code amount for each line before and after the scene change in the moving image pattern A.
図4を見てわかるように、図3(a)のパターンAのように突然映像に物体が入った場合、式(2)に示すXn-1は、シーンチェンジ前の画像の値を設定されているため、目標符号量積算量は画面目標符号量以上になり、上記目標符号量に追従して発生符号量は大きく発生してしまう。なお、簡単のためライン発生符号量はライン目標符号量と一致しているものとする。そこで、符号量を収束させるためには、符号量の上限値を設定しておくことが有効である。 As can be seen from FIG. 4, when an object suddenly enters the image as in pattern A of FIG. 3A, the value of the image before the scene change is set for Xn-1 shown in the equation (2). Therefore, the integrated amount of the target code amount becomes equal to or larger than the screen target code amount, and the generated code amount is greatly generated following the target code amount. For the sake of simplicity, it is assumed that the line generation code amount matches the line target code amount. Therefore, in order to converge the code amount, it is effective to set the upper limit value of the code amount.
図5(a)は、符号量上限値を設定した場合の図3(a)のパターンAにおけるライン単位の目標符号量の推移を、同図(b)はQpの推移を示している。図5(a),(b)に示すように、符号量上限値に到達した以降のライン単位の目標符号量を、符号量上限値になるように設定することで、発生符号量は画面目標符号量に収束させることができる。ただし、Qpは発生符号量を抑えるために増加する。 FIG. 5A shows the transition of the target code amount for each line in the pattern A of FIG. 3A when the upper limit value of the code amount is set, and FIG. 5B shows the transition of Qp. As shown in FIGS. 5A and 5B, by setting the target code amount for each line after reaching the code amount upper limit value to be the code amount upper limit value, the generated code amount is the screen target. It can be converged to a code amount. However, Qp is increased in order to suppress the generated code amount.
次に、符号量上限値を設定することによる問題を説明する。図6(a),(b)、図7(a,(b)に、図3(b)のパターンBにおけるライン単位の目標符号量の推移及びQpの推移を示す。図6(a),(b)は、符号量上限値を設定しない場合、図7(a)、(b)は符号量上限値を設定する場合の推移をそれぞれ示している。 Next, the problem caused by setting the upper limit of the code amount will be described. 6 (a), 6 (b) and 7 (a, (b) show the transition of the target code amount in line units and the transition of Qp in the pattern B of FIG. 3 (b). (B) shows the transition when the code amount upper limit value is not set, and FIGS. 7 (a) and 7 (b) show the transition when the code amount upper limit value is set.
図6(a),(b)に示すように、符号量上限値を設定しなければ、パターンBはシーンチェンジが起きておらず符号量制御に利用するフィードバック量が正しいため、画面目標符号量に収束する。 As shown in FIGS. 6A and 6B, if the upper limit of the code amount is not set, the scene change does not occur in the pattern B and the feedback amount used for the code amount control is correct, so that the screen target code amount is displayed. Converges to.
一方、パターンAのときと同様に符号量上限値を設定する場合、図7(a),(b)に示すように、シーンチェンジが起きていないにも関わらず、Qpが変動する可能性がある。 On the other hand, when the upper limit of the code amount is set as in the case of pattern A, as shown in FIGS. 7A and 7B, there is a possibility that Qp fluctuates even though no scene change has occurred. be.
図3(b)のパターンBを見ると、画面の上部に物体が集中しているため、図6(a)、(b)に示すように、ライン目標符号量は、前半のラインで大きく設定することが望ましい。しかし、前半のラインに目標符号量を多く割り当てるが故、発生符号量が符号量上限値を超えてしまい、以降のラインでQpを余計に増加させてしまうことで、Qpの増加により画質劣化を引き起こす。以上から画像に依らず固定的に符号量上限値を設定することは好ましくないのは理解できよう。 Looking at the pattern B in FIG. 3 (b), since the objects are concentrated on the upper part of the screen, the line target code amount is set large in the first half of the line as shown in FIGS. 6 (a) and 6 (b). It is desirable to do. However, since a large amount of target code is allocated to the first half of the line, the generated code exceeds the upper limit of the code amount, and Qp is excessively increased in the subsequent lines, resulting in deterioration of image quality due to the increase in Qp. cause. From the above, it can be understood that it is not preferable to set the upper limit of the code amount fixedly regardless of the image.
<目標符号量変更部>
上記の理由で、実施形態における目標符号量変更部112は、符号量上限値を画像相関度に応じて適応的に変更することで、符号量制御性と画質劣化の抑制を両立させる。具体的には、目標符号量変更部112は、シーンチェンジの度合いに応じて、先に示した式(2)における1ライン当たりの基準となる目標符号量Tnを変更する。
<Target code amount change unit>
For the above reason, the target code
相関度判定部115は、符号化対象の着目フレームの輝度成分の合計値を求める。そして、相関度判定部115は、着目フレームの輝度合計値と、直前のフレームの輝度合計値とを、着目フレームの符号化前に比較し、画像相関度を決定する。実施形態における画像相関度は、着目フレームと直前のフレームの輝度合計値の差が小さいほど1に近づき、差が大きいほど0に近づく値とする。このため、画像符号化部100は、符号化対象の動画像を1フレーム分だけ遅延させるためのバッファ116を有し、相関度判定部115は撮像部からのフレームを遅延無しで入力し、着目フレームの符号化に先立って、その着目フレームの輝度合計値を算出する。なお、上記説明から、相関度判定部115は、直前のフレームの輝度合計値を保持する記憶部(メモリ又はレジスタ)を有する。
The correlation
図8に、目標符号量変更部112の1フレーム当たりの処理フローを示す。以下、同図を参照して、実施形態の目標符号量変更部112の処理を説明する。
FIG. 8 shows the processing flow per frame of the target code
S801にて、目標符号量変更部112は、符号化しようとする着目フレームと符号化が完了した直前のフレームとの画像相関度を相関度判定部115から取得する。
In S801, the target code
S802で、目標符号量変更部112は、先に説明した符号量上限値を表す線分の傾きを、画像相関度が大きければ小さく、画像相関度が小さければ大きくなるように、着目フレームに対して設定する。
In S802, the target code
符号量上限値は、符号化終了間際のラインほど符号量制御可能なライン数が減っていくため、先頭ラインほど小さく、最終ラインに近づくほど大きくする。なお、本実施形態では最終ラインの符号量上限値を画像目標符号量と一致させているが、画質の観点から、画像目標符号量よりも大きい値に設定してもよい。 Since the number of lines for which the code amount can be controlled decreases as the line near the end of coding decreases, the code amount upper limit value is smaller as the head line and increases as it approaches the final line. In the present embodiment, the upper limit of the code amount of the final line is matched with the image target code amount, but from the viewpoint of image quality, a value larger than the image target code amount may be set.
S803にて、目標符号量変更部112は、最終ラインでなければS804に分岐する。S804で、目標符号量変更部112は、発生符号量積算量が符号量上限値よりも大きければS805に、そうでなければS803に分岐する。S805で、目標符号量変更部112は、目標符号量積算量が符号量上限値になるように着目ラインの目標符号量を変更する。以上の処理により、シーンチェンジ等でフィードバック量が適切でない場合も、発生符号量を画面目標符号量に近付けることができる。
In S803, the target code
<効果>
図9に画像相関度に応じた符号量上限値の傾きの違いを示す。図9に示す座標空間において水平軸はラインの位置を示し、垂直軸は総符号量を示している。図9のように画像相関度が小さいほどライン単位の目標符号量を速い段階から変更し易く、画像相関度が大きいほど変更されづらいように符号量上限値を設定する。
<Effect>
FIG. 9 shows the difference in the slope of the upper limit of the code amount according to the degree of image correlation. In the coordinate space shown in FIG. 9, the horizontal axis indicates the position of the line, and the vertical axis indicates the total code amount. As shown in FIG. 9, the lower the image correlation degree is, the easier it is to change the target code amount for each line from an early stage, and the larger the image correlation degree is, the more difficult it is to change the code amount upper limit value.
図示において、符号量上限値が表す各線分は、最後のライン位置でのフレームの目標符号量と一致するものであり、異なるのはその傾きである。なお、最後のライン位置との目標符号量が、各線分毎に異なるようにしても構わない。この場合、傾きと切片を、予め設定できるようにしても構わない。 In the figure, each line segment represented by the code amount upper limit value matches the target code amount of the frame at the last line position, and what is different is the slope thereof. The target code amount from the last line position may be different for each line segment. In this case, the slope and intercept may be preset.
目標符号量変更部112は、着目フレームと直前のフレームの輝度合計値の差が小さいほど(シーンチェンジの度合いが小さいほど)“1”に近づき、その差が大きいほど(シーンチェンジの度合いが大きいほど)“0”に近づく相関度を求めるとして説明した。目標符号量変更部112は、この相関度を図9の符号量上限値の傾きとして用いるものである。
The target code
そして実施形態における目標符号量変更部112は、先に説明した式(2)に従って次に符号化する第iラインの目標符号量を決定していくが、先頭から直前の第i−1ラインまでの実際の符号量の合計が、そのシーンに対して設定した符号量上限値の線分を超えた場合には、T[i]を、設定された符号量上限値に沿うように変更する。
Then, the target code
図10に、本実施形態を実施することによる効果を説明する動画パターンCを示す。図11に、動画像パターンCにおけるフレーム毎のライン単位の目標符号量の推移及びQpの推移を示す。 FIG. 10 shows a moving image pattern C for explaining the effect of implementing the present embodiment. FIG. 11 shows the transition of the target code amount and the transition of Qp for each line in the moving image pattern C for each frame.
Nフレーム、N+1フレームでは、シーンチェンジ等が起こっておらず、安定しているため、符号量上限値を高く設定し、発生符号量が画像目標符号量に収束し、かつQpも一定で推移する。 In the N frame and N + 1 frame, scene changes have not occurred and are stable, so the upper limit of the code amount is set high, the generated code amount converges to the image target code amount, and the Qp is also constant. Transition to.
N+2フレームでは、それ以前のN+1フレームには存在しなかった物体が画像上部に出現するため、符号量上限値を設定しない場合、発生符号量積算量が画像目標符号量より多く発生する。 In the N + 2 frame, an object that did not exist in the previous N + 1 frame appears at the top of the image, so if the upper limit of the code amount is not set, the generated code amount integration amount will be larger than the image target code amount. do.
一方で、符号量上限値を、N+1フレームに対して相関が小さいため、N+1フレームより小さく設定した場合、発生符号量積算量が符号量上限値を超える時点で目標符号量積算量を符号量上限値に変更するため、画像目標符号量に発生符号量積算量は収束する。 On the other hand, since the correlation between the upper limit of the code amount and the N + 1 frame is small, when the upper limit of the code amount is set smaller than the N + 1 frame, the target code amount integration amount is reached when the accumulated code amount exceeds the upper limit value of the code amount. Is changed to the upper limit value of the code amount, so that the integrated amount of the generated code amount converges on the image target code amount.
N+3フレームでは、N+2フレーム目に対して下部の物体が消失し、画像相関度が更に低くなる。このため、符号量上限値をN+2フレーム目よりに小さく設定する。N+3フレームでは上部が複雑な画像のため、前半ラインで発生符号量が多く発生し、符号量上限値に達することで、目標符号量積算量が符号用上限値に変更され、画像目標符号量に発生符号量は収束するものの、発生符号量を抑え込もうとQpが増加する。 In the N + 3 frame, the lower object disappears with respect to the N + 2nd frame, and the image correlation becomes even lower. Therefore, the upper limit of the code amount is set smaller than the N + 2nd frame. Since the upper part of the N + 3 frame is a complicated image, a large amount of code is generated in the first half line, and when the code amount upper limit is reached, the target code amount integration amount is changed to the code upper limit, and the image target code. Although the generated code amount converges on the quantity, Qp increases in an attempt to suppress the generated code amount.
N+4フレームでは、N+3フレームと画像相関度が非常に高い画像のため、符号量上限値は高く設定する。符号量上限値が高いため、N+3フレームのように目標符号量積算量は変更されず、Qpが一定のまま画像目標符号量に発生符号量積算量は収束する。 In the N + 4 frame, since the image has a very high image correlation with the N + 3 frame, the upper limit of the code amount is set high. Since the upper limit of the code amount is high, the target code amount integration amount is not changed as in the N + 3 frame, and the generated code amount integration amount converges on the image target code amount while the Qp remains constant.
符号量上限値が画像に依らず一定の場合、N+4フレームは画像が変化していないにも関わらずQpが増加し画像劣化の原因になる一方で、符号量上限値を画像相関度に応じて変更することで、シーンチェンジ直後のフレームを除いて、Qpの変化を小さく、画質劣化を抑制することができる。 When the upper limit of the code amount is constant regardless of the image, the Qp of the N + 4 frame increases even though the image has not changed, which causes image deterioration, while the upper limit of the code amount is used as the image correlation degree. By changing accordingly, the change in Qp can be made small and the deterioration of image quality can be suppressed except for the frame immediately after the scene change.
以上のようにすることで、Qpの変化を小さくして画質劣化を抑制し、かつ符号量制御性の高い画像符号化装置を提供することができる。 By doing so, it is possible to provide an image coding apparatus that can reduce the change in Qp, suppress the deterioration of image quality, and have high code amount controllability.
なお、相関度判定部は、当該フレームと1つ前のフレームの画像相関度を他のパラメータを利用し判定してもよい。例えば、画像の特徴を示すパラメータであるヒストグラムを比較することで、画像相関度を判定することも、本発明の範疇である。 The correlation degree determination unit may determine the image correlation degree between the frame and the previous frame by using other parameters. For example, it is also within the scope of the present invention to determine the degree of image correlation by comparing histograms, which are parameters indicating the characteristics of images.
また、上記実施例では、ライン単位に量子化、符号化を行うものとして説明した。しかし、量子化、符号化単位は、m×n画素で構成されるブロック単位として良い。この場合、目標符号量算出部110は、符号化対象の着目ブロックのブロック目標符号量算出し、目標符号量変更部112は着目ブロックに対するブロック目標符号量を変更することになる。例えば、8×8画素等のブロック単位に量子化し、その量子化後のブロックに符号化しても良い。上記実施形態での符号化単位のラインは、高さが1画素、水平方向が画像の水平方向の画素数とするブロックであると言える。かかる点は、以下に説明する各実施形態でも同じである。
Further, in the above embodiment, it has been described that the quantization and coding are performed in line units. However, the quantization and coding unit may be a block unit composed of m × n pixels. In this case, the target code
[第2の実施形態]
図12は、第2の実施形態に係る画像符号化装置のブロック構成図である。本第2の実施形態は、符号量制御部で制御する対象が、画像データに対する離散ウェーブレット変換して得られた変換係数データであり、符号量制御部101は離散ウェーブレット変換により生成されるサブバンド毎に符号量制御を行う場合を想定したものである。なお、参照符号100〜115は、第1の実施形態における構成と同じとし、その説明は省略する。
[Second Embodiment]
FIG. 12 is a block configuration diagram of the image coding device according to the second embodiment. In the second embodiment, the object to be controlled by the code amount control unit is the conversion coefficient data obtained by discrete wavelet transform on the image data, and the code
図12において、離散ウェーブレット変換部1216は、画像データを周波数領域の信号へ変換し、その変換係数をサブバンド毎に符号量制御部101の量子化部104へ出力する。
In FIG. 12, the discrete
<離散ウェーブレット変換>
図13は、離散ウェーブレット変換(DWT)に係る垂直、水平フィルタリングをそれぞれ3回実行した場合に得られるサブバンドを示している。
<Discrete wavelet transform>
FIG. 13 shows the subbands obtained when the vertical and horizontal filtering related to the discrete wavelet transform (DWT) is executed three times each.
離散ウェーブレット変換は、垂直、水平にそれぞれフィルタをかけることで画像データの周波数帯域を複数のサブバンドに分解する。そして、この変換により生成された低域サブバンドLLに対して再帰的にDWTを施すことで分解レベルを増加させ、図3に示すように、周波数分解の粒度を細かくすることができる。なお、図3における“L”,“H”はそれぞれ低域、高域を示し、その順序は、前側が水平フィルタリングを行った結果の帯域、後側が垂直フィルタリングを行った結果の帯域を示し、“Lv”の後の数字はDWTの分解レベルを示す。なお、図示のサブバンドLLに“Lv”が付かないのは、DWTを複数回行う場合には直前のDWTで得たサブバンドLLが変換対象となって、サブバンドLLは常に1つとなり、分解レベルで区別する必要がないためである。 The discrete wavelet transform decomposes the frequency band of image data into a plurality of subbands by filtering vertically and horizontally respectively. Then, by recursively applying DWT to the low frequency subband LL generated by this conversion, the decomposition level can be increased, and as shown in FIG. 3, the particle size of frequency decomposition can be made finer. In addition, "L" and "H" in FIG. 3 indicate a low region and a high region, respectively, and the order thereof indicates a band resulting from horizontal filtering on the front side and a band resulting from vertical filtering on the rear side. The number after "Lv" indicates the decomposition level of DWT. The reason why "Lv" is not attached to the illustrated sub-band LL is that when the DWT is performed a plurality of times, the sub-band LL obtained in the immediately preceding DWT is the conversion target, and the sub-band LL is always one. This is because it is not necessary to distinguish by the decomposition level.
符号量制御部101では、高域のサブバンドほど量子化パラメータを大きく、低域のサブバンドほど量子化パラメータを小さく設定し符号量制御を行うことで、人間の視覚特性上視認しづらい画像データの高域ほど発生符号量を圧縮し、符号化効率を向上させることが一般的である。
In the code
<符号量制御部の動作>
本第2の実施形態における符号量制御部101は、上記離散ウェーブレット変換により生成されるサブバンド毎に、符号量制御を行う。つまり、量子化設定部102は各サブバンドの基準量子化パラメータを設定する。また、目標符号量設定部103ではサブバンド目標符号量を設定する。そして、複雑度設定部111ではサブバンド毎に画像複雑度を設定する。そして、符号量制御部101はサブバンド毎に上記設定値に基づき、ライン(又はブロック)ごとの符号量制御を行う。
<Operation of code amount control unit>
The code
以上のようにすることで、各サブバンドの符号量制御を独立して行うことができ、Qpの変化を小さくして画質劣化を抑制し、かつ符号量制御性の高い画像符号化装置を提供することができる。 By doing so, it is possible to independently control the code amount of each subband, provide an image coding device that reduces the change in Qp, suppresses image quality deterioration, and has high code amount controllability. can do.
[第3の実施形態]
図14は、第3の実施形態に係る画像符号化装置のブロック構成図である。同図における参照符号100〜115は、第1の実施形態における構成と同じとし、その説明は省略する。
[Third Embodiment]
FIG. 14 is a block configuration diagram of the image coding device according to the third embodiment.
本第3の実施形態は、着目フレームの着目サブバンドの符号化処理を以下のように行う。 In the third embodiment, the coding process of the focused subband of the focused frame is performed as follows.
着目サブバンドの第iラインを符号化する際、その先頭ラインから第i−1ラインまでの符号量と、1つ前のフレーム(符号化済み)の同じ分解レベル、同じ種類のサブバンドの先頭ラインから第i−1ラインまでの符号量との差を求める。そして、その差が符号量差分閾値を超えた場合、符号化する着目ライン(第iライン)の目標符号量を変更する。更に、符号量差分閾値を超えたサブバンド数に応じて、他のサブバンドの閾値を小さくすることで、画像相関度に応じた目標符号量の修正を行う。 When encoding the i-th line of the sub-band of interest, the amount of coding from the first line to the i-1 line, the same decomposition level of the previous frame (encoded), and the beginning of the same type of sub-band The difference from the code amount from the line to the i-1th line is obtained. Then, when the difference exceeds the code amount difference threshold value, the target code amount of the line of interest (the i-th line) to be encoded is changed. Further, the target code amount is corrected according to the image correlation degree by reducing the threshold value of the other subbands according to the number of subbands exceeding the code amount difference threshold value.
<目標符号量変更部>
発生符号量保持部107は、直前のフレームのサブバンド毎の発生符号量積算量を保持する。或る1つのサブバンドに着目したとき、そのサブバンドの発生符号量積算量は所定のライン間隔で積算符号量を意味する。例えば、ライン間隔(ブロック数)を“8”とし、先頭ラインを第1ラインと定義する。この場合、発生符号量保持部107は、着目サブバンドの第1乃至8ラインの符号化データの合計量である積算符号量、第1乃至16ラインの積算符号量、第1乃至24ラインの積算符号量、…を保持する。以降、積算符号量として保持されるラインを符号量比較ラインと言う。
<Target code amount change unit>
The generated code
以下は、1つのサブバンドに着目した場合のものであり、単にラインと表現した場合には、そのラインは着目サブバンド内のラインを意味することに注意されたい。 It should be noted that the following is the case of focusing on one subband, and when it is simply expressed as a line, that line means a line in the subband of interest.
目標符号量変更部112は、符号化対象の着目ラインが符号量比較ライン+1(=1、9、17…のいずれか)となるとき、先頭から直前ラインまでに発生した符号量(以下、単に現符号量という)と直前フレームの該当サブバンド内の対応するラインまでの符号量積算量(以下、単に前符号量という)とを比較する。そして、現符号量が前符号量より大きい場合、目標符号量変更部112は、着目ライン以降のラインの目標符号量T’[i]を、サブバンドの目標符号量Tnに対する発生符号量積算量ΣS[i]の差に対して、まだ符号化が完了していない残りのライン数で除した値に変更する。変更後のライン目標符号量は次式(4)で与えられる。
T’ [i] = (Tn-ΣS[i]) / (itotal-icheck) …(4)
ここで、icheckは、ライン目標符号量を変更し始めるラインまでのライン数である。
The target code
T'[i] = (Tn-ΣS [i]) / (itotal-icheck)… (4)
Here, icheck is the number of lines up to the line where the line target code amount starts to be changed.
<画像相関度変更部>
画像相関度変更部1417は、相関度判定部115で設定された画像相関度を、目標符号量が変更されたサブバンドの数に応じて変更する。本第3の実施形態では、画像相関度は符号量差分閾値を示す。
<Image correlation change part>
The image correlation
符号量制御部101は、サブバンド毎に独立に符号量制御を行うため、他のサブバンドの目標符号量が変更されて、着目サブバンドの目標符号量は変更されない可能性がある。符号化終了間際のラインで目標符号量を変更しようとするほど、発生符号量を抑え込むためにQpを大きくする変化量は増加する。
Since the code
そこで、他のサブバンドで1フレーム前と着目フレームの発生符号量積算量が異なるのであれば、画像相関度は高くないと判断できるため、画像相関度変更部1417は、目標符号量が変更されたサブバンドの数に応じて各サブバンドの符号量差分閾値を小さく設定する。これにより符号化開始後早い段階で、ライン単位の目標符号量を変更することで符号量制御性を向上させる。
Therefore, if the integrated amount of generated code amount of the frame of interest is different from that of the frame of interest in the other subbands, it can be determined that the image correlation degree is not high. Therefore, the target code amount of the image correlation
以上のように、サブバンド毎の符号量制御において、各サブバンドの画像の相関度に応じて符号量差分閾値を変更することで、Qpの変化を小さくして画質劣化を抑制し、かつ符号量制御性の高い画像符号化装置を提供することができる。 As described above, in the code amount control for each subband, by changing the code amount difference threshold value according to the degree of correlation of the images of each subband, the change in Qp is reduced, the image quality deterioration is suppressed, and the code An image coding apparatus having high quantity controllability can be provided.
なお、本実施形態ではサブバンドを8等分してサブバンド発生符号量積算量を比較したが、その限りではなく、保持する容量に制限がなければ更に細かく分割することも、本実施形態の範疇である。 In the present embodiment, the sub-bands are divided into eight equal parts and the amount of integrated code amount generated by the sub-bands is compared. It is a category.
また、等分割するだけでなく、符号化開始直後のラインのみ細かく比較するような構成も、本実施形態の範疇である。 Further, not only the equal division but also the configuration in which only the lines immediately after the start of coding are compared in detail is also included in the scope of the present embodiment.
更に、符号量制御部が複数コア構成の画像符号化装置も本実施形態の範疇であり、他コアのサブバンドが目標符号量を変更した数も含めて当該コアの相関度を変更することも可能である。 Further, an image coding device in which the code amount control unit has a plurality of cores is also within the scope of the present embodiment, and the correlation degree of the core can be changed including the number of subbands of other cores changing the target code amount. It is possible.
[第4の実施形態]
本第4の実施形態は、フィードバックパラメータである複雑度を変更することでラインの目標符号量の変更を行う。本第4の実施形態における装置構成は、第1の実施形態(図1)と同じである。
[Fourth Embodiment]
In the fourth embodiment, the target code amount of the line is changed by changing the complexity which is a feedback parameter. The apparatus configuration in the fourth embodiment is the same as that in the first embodiment (FIG. 1).
式(2)に示すように、複雑度は符号化が完了しなければ取得できないパラメータであることから、目標符号量算出部110では、1つ前のフレームの複雑度Xn-1を利用してライン目標符号量を算出するため、符号量制御対象の目標符号量に目標符号量積算量が収束しない場合がある。
As shown in the equation (2), since the complexity is a parameter that cannot be acquired until the coding is completed, the target code
<目標符号量変更部>
そこで、目標符号量変更部112では、着目ラインの目標符号量を変更する場合には、Xn-1に重みづけをすることでその目標符号量を変更する。変更後の目標符号量T’[i]を、次式(5)に示す。なお、α(≧1)は上記重み付けを行うための重み付け係数である。
T’[i] = Tn × X[i-1] / (Xn-1×α) … (5)
上記の式(5)を用いることにより、画面目標符号量に必ずしも収束はしないものの、ラインの目標符号量を変更することで発生符号量積算量は、変更しない場合よりも抑制され、かつ、複雑度は、式(1)で示されることから、αの値に応じて、Qpの大きさを調整可能である。Qpの大きさを調整できるため、より画質優先の符号量制御を行うことができる。
<Target code amount change unit>
Therefore, when the target code amount of the line of interest is changed, the target code
T'[i] = Tn x X [i-1] / (Xn-1 x α)… (5)
By using the above equation (5), the screen target code amount does not necessarily converge, but the generated code amount integration amount is suppressed and complicated by changing the line target code amount as compared with the case where it is not changed. Since the degree is represented by the equation (1), the magnitude of Qp can be adjusted according to the value of α. Since the magnitude of Qp can be adjusted, it is possible to control the code amount with higher priority on image quality.
以上のようにすることで、Qpの調整を任意に行い、画質劣化を抑制しつつ、かつ符号量制御性の高い画像符号化装置を提供することができる。 By doing so, it is possible to provide an image coding apparatus that can arbitrarily adjust Qp, suppress image quality deterioration, and have high code amount controllability.
[第5の実施形態]
図15は、第5の実施形態に係る画像符号化装置のブロック構成図である。図示において、参照符号100〜115,1216は、第2の実施形態と同じであるので、その説明は省略する。
[Fifth Embodiment]
FIG. 15 is a block configuration diagram of the image coding device according to the fifth embodiment. In the illustration,
サブバンド発生符号量積算部1518は、各サブバンドの発生符号量を同一画素位置に相当するライン毎に積算する。本実施形態は、ラインごとの目標符号量の変更を、全サブバンド同時に行い、全サブバンドの符号化が並列に行われるものとする。
The sub-band generation code
<サブバンドの同一画素位置>
図16は、離散ウェーブレット変換(DWT)の垂直、水平フィルタリングをそれぞれ3回施した場合の各サブバンドの離散ウェーブレット変換前の画像が表す空間での同一画素位置の関係を示している。
<Same pixel position of subband>
FIG. 16 shows the relationship of the same pixel positions in the space represented by the image before the discrete wavelet transform of each subband when the vertical and horizontal filtering of the discrete wavelet transform (DWT) is performed three times each.
DWTは、変換前の画像の2画素ラインに対して1画素ライン分の変換係数が生成される。また、DWTはサブバンドLLに対して再帰的に行われるため、分解レベル2の1ライン分の変換係数は、分解レベル1の2画素ラインの変換係数から生成される。以降分解レベルを増やしても同様の関係である。
In DWT, a conversion coefficient for one pixel line is generated for two pixel lines of the image before conversion. Further, since the DWT is performed recursively with respect to the subband LL, the conversion coefficient for one line at the
上記の関係から、最高域であるLv1のNラインに対して、Lv2のN/2ライン、Lv3のN/4ラインが同一画素位置に相当する。DWTを3回実行する場合、図16のように、同一画素位置と見なせるラインは、Lv1の4ラインに対して、Lv2の2ライン、Lv3の1ラインである。 From the above relationship, the N / 2 line of Lv2 and the N / 4 line of Lv3 correspond to the same pixel position with respect to the N line of Lv1 which is the highest region. When DWT is executed three times, as shown in FIG. 16, the lines that can be regarded as the same pixel position are two lines of Lv2 and one line of Lv3 with respect to four lines of Lv1.
<目標符号量変更部>
目標符号量変更部112は、符号量上限値を、サブバンド合計符号量上限値として全サブバンドの発生符号量積算量に対して設定し、サブバンド発生符号量積算部1518で積算したサブバンド発生符号量積算量と比較する。サブバンド発生符号量積算量がサブバンド合計符号量上限値よりも大きければ各サブバンドの着目ラインの目標符号量T’[i]を、式(5)を用いて変更する。
<Target code amount change unit>
The target code
このように、全サブバンド一斉に目標符号量を変更することで、Qpも同様に全サブバンド一斉に変更される。Qpは一般に画像データの高域成分ほど大きく、低域成分ほど小さく設定するが、サブバンド独立で目標符号量を変更すると、上記の関係が崩れる場合がある。例えば、サブバンドHLのQpがサブバンドLHのQpより非常に大きい値であった場合、画像の縦エッジのみ極端に劣化し、主観画質の劣化が目立つ。 By changing the target code amount for all subbands at the same time in this way, Qp is also changed for all subbands at the same time. Generally, Qp is set larger for the high frequency component and smaller for the low frequency component of the image data, but if the target code amount is changed independently for each subband, the above relationship may be broken. For example, when the Qp of the sub-band HL is much larger than the Qp of the sub-band LH, only the vertical edge of the image is extremely deteriorated, and the deterioration of the subjective image quality is conspicuous.
一方で、本実施形態を適応すれば、一斉に式(5)のαを所定の値に変更できるため、画質の極端な劣化を抑制することができる。 On the other hand, if the present embodiment is applied, α of the equation (5) can be changed to a predetermined value all at once, so that extreme deterioration of image quality can be suppressed.
以上のようにすることで、各サブバンドの目標符号量の変更を同一画素位置から行うことで、Qpの変更も同様に同一画素位置から行い、画質劣化を抑制しつつ、かつ符号量制御性の高い画像符号化装置を提供することができる。 By doing the above, by changing the target code amount of each subband from the same pixel position, the Qp can also be changed from the same pixel position, while suppressing the deterioration of image quality and the code amount controllability. It is possible to provide a high-quality image coding apparatus.
なお、必ずしも全サブバンドで目標符号量を変更する必要は無く、例えば最も低域成分であるサブバンドLLは画質を優先し、目標符号量を変更しない構成も、本発明の範疇である。 It is not always necessary to change the target code amount in all subbands. For example, the subband LL, which is the lowest frequency component, gives priority to image quality and does not change the target code amount, which is also within the scope of the present invention.
以上、各実施形態について詳述したが、特定の実施形態に限定されるものではなく、特許請求の範囲に記載された範囲内において、種々の変形及び変更が可能である。また、前述した実施形態の構成要素を全部又は複数を組み合わせることも可能である。 Although each embodiment has been described in detail above, the present invention is not limited to a specific embodiment, and various modifications and changes can be made within the scope of the claims. It is also possible to combine all or a plurality of the components of the above-described embodiment.
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other Examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
100…画像符号化部、101…符号量制御部、102…量子化設定部、103…目標符号量設定部、104…量子化部、105…量子化制御部、106…符号化部、107…発生符号量保持部、108…量子化パラメータ保持部、109…複雑度算出部、110…目標符号量算出部、111…複雑度設定部、112…目標符号量変更部、113…差分算出部、114…差分保持部、115…相関度判定部、116…バッファ、1216…離散ウェーブレット変換部、1417…画像相関度変更部、1518…サブバンド発生符号量積算部 100 ... image coding unit, 101 ... coding amount control unit, 102 ... quantization setting unit, 103 ... target coding amount setting unit, 104 ... quantization unit, 105 ... quantization control unit, 106 ... coding unit, 107 ... Generated code amount holding unit, 108 ... Quantization parameter holding unit, 109 ... complexity calculation unit, 110 ... target code amount calculation unit, 111 ... complexity setting unit, 112 ... target code amount changing unit, 113 ... difference calculation unit, 114 ... Difference holding unit, 115 ... Correlation degree determination unit, 116 ... Buffer, 1216 ... Discrete wavelet transforming unit, 1417 ... Image correlation degree changing unit, 1518 ... Subband generation code amount integrating unit
Claims (10)
前記動画像データにおける着目フレームの画像データを、予め設定されたブロック単位に、目標符号量に応じて決定される量子化パラメータに従って量子化する量子化手段と、
該量子化手段で得られた量子化後のデータを、前記ブロック単位に符号化する符号化手段と、
前記符号化手段により発生する符号量が、設定されたブロック目標符号量になるように前記量子化手段を制御する符号量制御手段とを有し、
前記符号量制御手段は、
前記着目フレームの画像と直前のフレームの画像の相関度を取得する取得手段と、
1フレームにおける先頭のブロックから最後のブロックに至る軸を水平軸、符号化データの積算量を表す軸を垂直軸とする座標空間において、予め設定されたフレーム目標符号量が示す位置が表す座標を通る符号量上限値を表す線分の傾きを、前記相関度に基づいて決定する第1の決定手段であって、前記相関度が大きければ前記線分の傾きが小さく、前記相関度が小さければ前記線分の傾きが大きくなるように前記線分の傾きを決定する第1の決定手段と、
予め設定された基準目標符号量と、着目ブロックの直前の符号化済みのブロックの複雑度とに基づき、前記着目ブロックの前記ブロック目標符号量を決定する第2の決定手段であって、前記着目ブロックの直前の符号化済みのブロックの複雑度が大きいときには前記着目ブロックの前記ブロック目標符号量が大きくなり、前記着目ブロックの直前の符号化済みのブロックの複雑度が小さいときには前記着目ブロックの前記ブロック目標符号量が小さくなるように前記着目ブロックの前記ブロック目標符号量を決定する第2の決定手段と、
前記着目フレームの先頭のブロックから前記直前のブロックまでの合計の符号量が、前記第1の決定手段で決定した前記線分が示す符号量を超えた場合、前記着目ブロックの前記ブロック目標符号量を、前記線分に沿うように変更する変更手段と、
を有することを特徴とする画像符号化装置。 An image coding device that encodes moving image data captured by an imaging means.
A quantization means for quantizing the image data of the frame of interest in the moving image data in preset block units according to a quantization parameter determined according to a target code amount.
A coding means that encodes the quantized data obtained by the quantization means in block units, and
It has a code amount control means for controlling the quantization means so that the code amount generated by the coding means becomes a set block target code amount.
The code amount control means is
Acquisition means for acquiring a pre-Symbol correlation of the image of the image and the frame immediately before the frame of interest,
In a coordinate space where the axis from the first block to the last block in one frame is the horizontal axis and the axis representing the integrated amount of coded data is the vertical axis, the coordinates represented by the position indicated by the preset frame target code amount are set. It is the first determination means for determining the slope of the line segment representing the upper limit of the amount of code to pass based on the correlation degree. If the correlation degree is large, the slope of the line segment is small, and if the correlation degree is small, the slope is small. A first determining means for determining the inclination of the line segment so that the inclination of the line segment becomes large,
It is a second determination means for determining the block target code amount of the block of interest based on a preset reference target code amount and the complexity of the coded block immediately before the block of interest, and is the focus. When the complexity of the coded block immediately before the block is high, the block target code amount of the block of interest is large, and when the complexity of the coded block immediately before the block of interest is low, the block of interest is said. A second determining means for determining the block target code amount of the block of interest so that the block target code amount becomes small,
When the total code amount from the first block of the focus frame to the immediately preceding block exceeds the code amount indicated by the line segment determined by the first determination means, the block target code amount of the focus block With a changing means for changing the line segment so as to follow the line segment.
An image coding device comprising.
前記着目フレームと直前のフレームの輝度合計値との差、ヒストグラムの差、或いは、着目ブロックまでの符号量の差のいずれかに基づき、前記傾きを決定し、前記差が小さいときは前記傾きが大きくなり、前記差が大きいときは前記傾きが小さくなるように前記傾きを決定する、
ことを特徴とする請求項1に記載の画像符号化装置。 The first determination means is
The slope is determined based on either the difference between the total brightness of the frame of interest and the total brightness of the immediately preceding frame, the difference in the histogram, or the difference in the amount of code up to the block of interest. The inclination is determined so that the inclination becomes large and the difference becomes small.
The image coding apparatus according to claim 1.
前記着目ブロックを第iのブロックとし、直前の第i−1のブロックの符号化データの符号量をS[i-1]、前記第iのブロックを符号化する際に用いた量子化パラメータをQp[i-1]と定義したとき、前記複雑度を表すX[i-1]を次式により求める
X[i-1]=Qp[i-1]×S[i-1]
ことを特徴とする請求項1又は2に記載の画像符号化装置。 The second determination means is
The block of interest is the i-th block, the coding amount of the coding data of the immediately preceding i-1 block is S [i-1], and the quantization parameter used when encoding the i-th block is When defined as Qp [i-1], X [i-1] representing the complexity is obtained by the following equation. X [i-1] = Qp [i-1] × S [i-1]
The image coding apparatus according to claim 1 or 2.
前記着目ブロックまでの発生符号量の積算量が、当該着目ブロックの位置の符号量上限値に達したら、複雑度を小さなるように修正することで、前記ブロック目標符号量を決定する
ことを特徴とする請求項1又は2に記載の画像符号化装置。 The second determination means is
When the integrated amount of generated code amounts up to the block of interest reaches the upper limit of the code amount at the position of the block of interest, the block target code amount is determined by modifying the complexity so as to be small. The image coding apparatus according to claim 1 or 2.
前記量子化手段は、前記変換手段で得られた各サブバンドに対して量子化する
ことを特徴とする請求項2に記載の画像符号化装置。 Further, it has a conversion means for performing a discrete wavelet transform on the image data of the frame of interest in the moving image data.
The image coding apparatus according to claim 2 , wherein the quantization means quantizes each subband obtained by the conversion means.
当該画像相関度変更手段は、複数のサブバンドの内、符号量差分閾値を超えたサブバンドの数が多いほど画像相関度を小さく、少ないほど大きく変更する
ことを特徴とする請求項5に記載の画像符号化装置。 The code amount control means has an image correlation degree changing means.
The fifth aspect of claim 5 is the image correlation degree changing means, wherein the larger the number of subbands exceeding the code amount difference threshold value, the smaller the image correlation degree among the plurality of subbands, and the smaller the number, the larger the image correlation degree is changed. Image encoding device.
ことを特徴とする請求項4に記載の画像符号化装置。 The image coding apparatus according to claim 4 , wherein the second determining means determines the block target code amount each time the coding of a preset number of blocks is completed.
前記符号量制御手段は、1以上のサブバンドに対して量子化制御を行い、前記1以上のサブバンドごとにブロック目標符号量を決定すると共に、前記1以上のサブバンドにおける着目ブロックまでに発生した符号量の合計符号量に基づいて、各サブバンドにおける前記ブロック目標符号量を決定する
ことを特徴とする請求項5に記載の画像符号化装置。 The coding means encodes blocks at the same position in the space represented by the image in parallel in all subbands.
The code amount control means performs quantization control on one or more subbands, determines a block target code amount for each of the one or more subbands, and generates up to the block of interest in the one or more subbands. The image coding apparatus according to claim 5 , wherein the block target code amount in each subband is determined based on the total code amount of the code amounts.
前記動画像データにおける着目フレームの画像データを、予め設定されたブロック単位に、目標符号量に応じて決定される量子化パラメータに従って量子化する量子化工程と、
該量子化工程で得られた量子化後のデータを、前記ブロック単位に符号化する符号化工程と、
前記符号化工程により発生する符号量が、設定されたブロック目標符号量になるように前記量子化工程を制御する符号量制御工程とを有し、
前記符号量制御工程は、
前記着目フレームの画像と直前のフレームの画像の相関度を取得する取得工程と、
1フレームにおける先頭のブロックから最後のブロックに至る軸を水平軸、符号化データの積算量を表す軸を垂直軸とする座標空間において、予め設定されたフレーム目標符号量が示す位置が表す座標を通る符号量上限値を表す線分の傾きを、前記相関度に基づいて決定する第1の決定工程であって、前記相関度が大きければ前記線分の傾きが小さく、前記相関度が小さければ前記線分の傾きが大きくなるように前記線分の傾きを決定する第1の決定工程と、
予め設定された基準目標符号量と、着目ブロックの直前の符号化済みのブロックの複雑度とに基づき、前記着目ブロックの前記ブロック目標符号量を決定する第2の決定工程であって、前記着目ブロックの直前の符号化済みのブロックの複雑度が大きいときには前記着目ブロックの前記ブロック目標符号量が大きくなり、前記着目ブロックの直前の符号化済みのブロックの複雑度が小さいときには前記着目ブロックの前記ブロック目標符号量が小さくなるように前記着目ブロックの前記ブロック目標符号量を決定する第2の決定工程と、
前記着目フレームの先頭のブロックから前記直前のブロックまでの合計の符号量が、前記第1の決定工程で決定した前記線分が示す符号量を超えた場合、前記着目ブロックの前記ブロック目標符号量を、前記線分に沿うように変更する変更工程と、
を有することを特徴とする画像符号化装置の制御方法。 It is a control method of an image coding device that encodes moving image data captured by an imaging means.
A quantization step in which the image data of the frame of interest in the moving image data is quantized in preset block units according to a quantization parameter determined according to a target code amount.
A coding step of encoding the quantized data obtained in the quantization step in block units, and
It has a code amount control step of controlling the quantization step so that the code amount generated by the coding step becomes a set block target code amount.
The code amount control step is
An acquisition step of acquiring pre Symbol correlation of the image of the image and the frame immediately before the frame of interest,
In a coordinate space where the axis from the first block to the last block in one frame is the horizontal axis and the axis representing the integrated amount of coded data is the vertical axis, the coordinates represented by the position indicated by the preset frame target code amount are set. In the first determination step of determining the slope of the line segment representing the upper limit of the amount of code to pass based on the correlation degree, if the correlation degree is large, the slope of the line segment is small, and if the correlation degree is small, the slope is small. The first determination step of determining the inclination of the line segment so that the inclination of the line segment becomes large, and
This is a second determination step of determining the block target code amount of the block of interest based on a preset reference target code amount and the complexity of the coded block immediately before the block of interest. When the complexity of the coded block immediately before the block is high, the block target code amount of the block of interest is large, and when the complexity of the coded block immediately before the block of interest is low, the block of interest is said. A second determination step of determining the block target code amount of the block of interest so that the block target code amount becomes small, and
When the total code amount from the first block of the focus frame to the immediately preceding block exceeds the code amount indicated by the line segment determined in the first determination step, the block target code amount of the focus block With the change process of changing to follow the line segment
A method for controlling an image coding apparatus, which comprises.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016247009A JP6916618B2 (en) | 2016-12-20 | 2016-12-20 | Image coding device and its control method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016247009A JP6916618B2 (en) | 2016-12-20 | 2016-12-20 | Image coding device and its control method and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018101907A JP2018101907A (en) | 2018-06-28 |
JP6916618B2 true JP6916618B2 (en) | 2021-08-11 |
Family
ID=62714508
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016247009A Active JP6916618B2 (en) | 2016-12-20 | 2016-12-20 | Image coding device and its control method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6916618B2 (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008187571A (en) * | 2007-01-31 | 2008-08-14 | Sony Corp | Information processing device and method, and program |
KR101172430B1 (en) * | 2007-08-17 | 2012-08-08 | 삼성전자주식회사 | Method and apparatus for bit rate control |
-
2016
- 2016-12-20 JP JP2016247009A patent/JP6916618B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018101907A (en) | 2018-06-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5173837B2 (en) | Adaptive filtering to improve video encoder performance | |
US8218082B2 (en) | Content adaptive noise reduction filtering for image signals | |
JP4794987B2 (en) | Video signal processing device | |
US11082707B2 (en) | Encoding method and apparatus, image processing system, and computer-readable storage medium | |
US11012698B2 (en) | Image encoding apparatus and method for controlling the same | |
EP1821548B1 (en) | Method for pre-suppressing image noise. | |
US10776956B2 (en) | Image coding apparatus, image decoding apparatus, image coding method, image decoding method, and non-transitory computer-readable storage medium | |
JP6857973B2 (en) | Image coding device and its control method | |
US11792399B2 (en) | Systems and methods for quantization of video content | |
US10897615B2 (en) | Image encoding apparatus and control method therefor | |
US11082698B2 (en) | Image capturing apparatus having a function for encoding raw image control method therof, and non-transitory computer-readable storage medium | |
JP7001383B2 (en) | Coding device, coding method, and program | |
US11140392B2 (en) | Image encoding apparatus, image decoding apparatus, control methods thereof, and non- transitory computer-readable storage medium | |
US20170155902A1 (en) | Image encoding apparatus and method of controlling the same | |
US20230133895A1 (en) | Image encoding apparatus and method for controlling the same and non-transitory computer-readable storage medium | |
JP6916618B2 (en) | Image coding device and its control method and program | |
JP6806466B2 (en) | Image coding device and its control method | |
JP6966936B2 (en) | Image coding device and its control method and program | |
JP7016660B2 (en) | Coding device, its control method, and control program, and image pickup device. | |
JP2018011120A (en) | Imaging apparatus, control method for imaging apparatus, and program | |
JP7321237B2 (en) | Image encoding device, image encoding method, program | |
JP7469865B2 (en) | Image processing device and image processing method | |
JP7387333B2 (en) | Encoding device and its control method | |
JP2022077438A (en) | Encoder and method, imaging apparatus, program, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20191204 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20201113 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20201222 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20210103 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210113 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210210 |
|
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: 20210618 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210716 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6916618 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |