JP2024022374A - Encoding device, decoding device, and program - Google Patents
Encoding device, decoding device, and program Download PDFInfo
- Publication number
- JP2024022374A JP2024022374A JP2022125917A JP2022125917A JP2024022374A JP 2024022374 A JP2024022374 A JP 2024022374A JP 2022125917 A JP2022125917 A JP 2022125917A JP 2022125917 A JP2022125917 A JP 2022125917A JP 2024022374 A JP2024022374 A JP 2024022374A
- Authority
- JP
- Japan
- Prior art keywords
- block
- encoding
- bit rate
- unit
- curve
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013139 quantization Methods 0.000 claims abstract description 76
- 238000012545 processing Methods 0.000 claims abstract description 29
- 238000004364 calculation method Methods 0.000 claims abstract description 20
- 238000005457 optimization Methods 0.000 claims abstract description 16
- 238000010586 diagram Methods 0.000 abstract description 6
- 230000006870 function Effects 0.000 description 29
- 238000000034 method Methods 0.000 description 17
- 230000009466 transformation Effects 0.000 description 14
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 description 8
- 238000012986 modification Methods 0.000 description 7
- 230000004048 modification Effects 0.000 description 7
- 238000013500 data storage Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000012805 post-processing Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Abstract
【課題】映像を所要ビットレートで符号化する際に、計算処理を軽量化しつつ、画質及び符号化効率を向上させる。【解決手段】符号化装置1は、映像フレームに割り当てられたビットレートと第1RD曲線のパラメータとを用いて、コスト関数を最小化する第1ラグランジュ乗数及び前記ブロックごとの割当ビットレートを算出するビット割当部101と、ブロックごとの割当ビットレートと第2RD曲線のパラメータとから算出される第2ラグランジュ乗数を用いて、ブロックごとの量子化パラメータを算出する量子化パラメータ算出部102と、第2ラグランジュ乗数に基づいて、コスト関数を最小化する符号化モードを決定するRD最適化部103と、を備える。第1RD曲線は、対数関数又は指数関数を用いて近似される。【選択図】図2An object of the present invention is to improve image quality and encoding efficiency while reducing the weight of calculation processing when encoding video at a required bit rate. An encoding device 1 calculates a first Lagrangian multiplier that minimizes a cost function and an allocated bit rate for each block using a bit rate allocated to a video frame and parameters of a first RD curve. a bit allocation unit 101; a quantization parameter calculation unit 102 that calculates a quantization parameter for each block using a second Lagrange multiplier calculated from the allocated bit rate for each block and the parameters of the second RD curve; and an RD optimization unit 103 that determines an encoding mode that minimizes the cost function based on the Lagrangian multiplier. The first RD curve is approximated using a logarithmic function or an exponential function. [Selection diagram] Figure 2
Description
特許法第30条第2項適用申請有り 1.近藤 雄一・杉藤 泰子・市ヶ谷 敦郎らが、2021年8月12日付で、FIT2021 第20回情報科学技術フォーラム 講演論文集において公開。 2.近藤 雄一・杉藤 泰子・市ヶ谷 敦郎らが、2021年8月27日付で、FIT2021 第20回情報科学技術フォーラムにおいて公開。 3.https://www.nhk.or.jp/strl/publica/giken_dayori/205/4.html 近藤 雄一が、2022年4月1日付で、技研だより2022年4月号において公開。Application for application of Article 30,
本発明は、符号化装置、復号装置、及びプログラムに関する。 The present invention relates to an encoding device, a decoding device, and a program.
符号化制御とは、用途や目的に見合った映像符号化を実現するための制御技術である。符号化制御には、ビットレート制約条件下で符号化品質を最大化するような処理を行うレート制御や、遅延を最小限に抑える遅延制御などがある。特にレート制御は、高画質で安定的な放送・通信サービスを行うにあたって重要な役割を果たしている。 Encoding control is a control technology for realizing video encoding that suits the application and purpose. Encoding control includes rate control that performs processing to maximize encoding quality under bit rate constraint conditions and delay control that minimizes delay. In particular, rate control plays an important role in providing stable broadcasting and communication services with high image quality.
レート制御は、フレームに割り当てられた目標ビットレートRtで符号化できるように、ビットレートをGOP(Group Of Picture)単位・フレーム単位・ブロック単位で割り当てるビット割当処理OBA(Optimal Bit Allocation)と、割り当てたビットレートの範囲内で画質を最も高品質化する(すなわち、符号化歪みを最小化する)符号化モードの選択を行うRD最適化処理RDO(Rate Distortion Optimization)の2つの処理によって実現される。 Rate control includes a bit allocation process OBA (Optimal Bit Allocation) that allocates a bit rate in units of GOP (Group Of Picture), in units of frames, and in units of blocks so that encoding can be performed at the target bit rate Rt allocated to the frame; This is achieved by two processes: RD optimization processing RDO (Rate Distortion Optimization), which selects the encoding mode that maximizes the image quality (that is, minimizes encoding distortion) within the allocated bit rate range. Ru.
ここでは、フレーム単位のビット割り当ては済んでおり、フレーム内の各ブロックにビット割り当てを行う場合を例に説明する。ビット割当処理では、消費したビットレートRcを監視しながら、フレームに割り当てられた目標ビットレートRtを超えないようにビットを割り当てる。図4は、斜線を付した7ブロックが符号化を終了し、残りの5ブロックが符号化前の状態を示している。最も簡単なビット割当処理手法の1つは、消費ビットレートRcから利用可能なビットレートRa(Ra=Rt-Rc)を導出し、Raを残りのブロックへ一定の割合で割り当てる方法である。図4に示す例では、残りの5ブロックに対しする1ブロック当たりの割当ビットは、Ra/5となる。 Here, an example will be described in which bit allocation for each frame has been completed and bit allocation is performed for each block within the frame. In the bit allocation process, bits are allocated so as not to exceed the target bit rate Rt allocated to the frame while monitoring the consumed bit rate Rc . FIG. 4 shows that seven blocks marked with diagonal lines have been encoded, and the remaining five blocks are in a state before encoding. One of the simplest bit allocation processing techniques is to derive the available bit rate R a (R a = R t − R c ) from the consumed bit rate R c and spread R a to the remaining blocks at a constant rate. This is the method of allocating. In the example shown in FIG. 4, the bits allocated per block for the remaining five blocks are R a /5.
RD最適化処理は、ビット割当処理によって割り当てられたビットレートで符号化する際に、符号化歪みが最小となる符号化モードを選択することが目的である。近年のHEVC(High Efficiency Video Coding),VVC(Versatile Video Coding)などの映像符号化規格の参照ソフトウェアHM(HEVC Test Model),VTM(VVC Test Model)では、符号量R、符号化歪みD、及びラグランジュ乗数λRDOから計算されるコスト関数J=D+λRDORを最小化するように符号化モードを選択することでこれを実現する(例えば、非特許文献1参照)。ただし、ラグランジュ乗数λRDOは、符号化映像のRD曲線と割当ビットレートを用いて算出される値である。RD曲線とは、映像符号化を行った際のビットレートRと符号化歪みDの関係を近似する曲線であり、HM,VTMでは、式(1)に示す双曲線(hyperbolic)関数を用いている。 The purpose of the RD optimization process is to select an encoding mode that minimizes encoding distortion when encoding at a bit rate allocated by the bit allocation process. In recent years, reference software HM (HEVC Test Model) and VTM (VVC Test Model) for video coding standards such as HEVC (High Efficiency Video Coding) and VVC (Versatile Video Coding) have This is achieved by selecting the encoding mode so as to minimize the cost function J=D+λ RDO R calculated from the Lagrangian multiplier λ RDO (see, for example, Non-Patent Document 1). However, the Lagrangian multiplier λ RDO is a value calculated using the RD curve of the encoded video and the allocated bit rate. The RD curve is a curve that approximates the relationship between the bit rate R and the encoding distortion D during video encoding, and in HM and VTM, the hyperbolic function shown in equation (1) is used. .
ここで、c,kは映像に応じて異なるパラメータであり、符号化処理の過程で、符号化済みのブロックの消費ビットレートRと符号化歪みDを用いて求めることができる。コスト関数Jを最小化するとき、JをRで偏微分した∂J/∂Rは0となるので、λRDOは、式(2)により求めることができる。 Here, c and k are parameters that differ depending on the video, and can be determined using the consumed bit rate R and encoding distortion D of the encoded block during the encoding process. When minimizing the cost function J, ∂J/∂R obtained by partially differentiating J with respect to R becomes 0, so λ RDO can be determined by equation (2).
また、非特許文献2には、テイラー展開を用いた近似や、近似で発生する誤差の削減処理などを行うことでビット割当処理を実現することが開示されている。
Furthermore, Non-Patent
前述のビット割当処理は、ビットを各ブロックで均等に割り当てているが、ブロックごとに割り当てるビットを制御することで画面全体の画質を改善することが可能である。以下にその手法を述べる。 In the bit allocation process described above, bits are allocated equally to each block, but by controlling the bits allocated to each block, it is possible to improve the image quality of the entire screen. The method is described below.
ビット割当処理の目的は、画面全体の符号化歪みDを最小化することである。ただし、すべてのブロックのビットレートの和は、そのフレームに割り当てられたビットレートRtを超えてはいけない。これを数式で表現すると、式(3)となる。ここで、添え字iはブロック番号を表しておりdi,riはそれぞれi番目のブロックの符号化歪みとビットレートを表す。また、Mは画面全体のブロック数を表す。 The purpose of the bit allocation process is to minimize the coding distortion D of the entire screen. However, the sum of the bit rates of all blocks must not exceed the bit rate Rt assigned to that frame. If this is expressed numerically, it becomes equation (3). Here, the subscript i represents the block number, and d i and r i represent the encoding distortion and bit rate of the i-th block, respectively. Furthermore, M represents the number of blocks on the entire screen.
式(3)を満たすようなriを求めたい。式(3)はラグランジュ乗数λOBAを用いて、式(4)に書き換えられる。 We would like to find r i that satisfies equation (3). Equation (3) can be rewritten into Equation (4) using the Lagrangian multiplier λ OBA .
双曲線モデルのRD曲線は、式(5)で表される。ci,ki(1≦i≦M)は、符号化済みフレームのブロックから式(1),(2)を用いて算出される推定値である。 The RD curve of the hyperbolic model is expressed by equation (5). c i and k i (1≦i≦M) are estimated values calculated from the blocks of the encoded frame using equations (1) and (2).
コスト関数Jを最小化するときriによる偏微分は0なので、式(6)が成立する。 When minimizing the cost function J, the partial differential with respect to r i is 0, so Equation (6) holds true.
であり、riの総和がフレームに割り当てられたビットレートRtとなることから、式(7)が成り立たなければならない。 Since the sum of r i is the bit rate R t assigned to the frame, equation (7) must hold.
式(7)を解いてλOBAが求まると、式(6)で求まるriによりi番目のブロックのビットレートを決定することができる。しかし、ci,kiはブロックごとに値が異なるため、式(7)を解析的に解くことはできない。 When λ OBA is found by solving Equation (7), the bit rate of the i-th block can be determined by r i found from Equation (6). However, since c i and k i have different values for each block, equation (7) cannot be solved analytically.
また、非特許文献2では、式(7)を解くためにテイラー展開を用いた近似や、近似で発生する誤差の削減処理などを行うことでビット割当処理を実現しているが、処理が複雑化するという問題点があった。
In addition, in Non-Patent
かかる事情に鑑みてなされた本発明の目的は、映像を所要ビットレートで符号化する際に、計算処理を軽量化しつつ、画質及び符号化効率を向上させることが可能な符号化装置、復号装置、及びプログラムを提供することにある。 In view of the above circumstances, an object of the present invention is to provide an encoding device and a decoding device that can improve image quality and encoding efficiency while reducing calculation processing when encoding video at a required bit rate. , and to provide programs.
上記課題を解決するため、一実施形態に係る符号化装置は、映像フレームを符号化対象領域に分割してブロックごとに符号化を行い、ビットレートと符号化歪みの関係を近似するRD曲線を用いてRD最適化処理を行う符号化装置であって、前記映像フレームに割り当てられたビットレートと第1RD曲線のパラメータとを用いて、コスト関数を最小化する第1ラグランジュ乗数及び前記ブロックごとの割当ビットレートを算出するビット割当部と、前記ブロックごとの割当ビットレートと第2RD曲線のパラメータとから算出される第2ラグランジュ乗数を用いて、前記ブロックごとの量子化パラメータを算出する量子化パラメータ算出部と、前記第2ラグランジュ乗数に基づいて、コスト関数を最小化する符号化モードを決定するRD最適化部と、を備え、前記第1RD曲線は、対数関数又は指数関数を用いて近似される。 In order to solve the above problem, an encoding device according to an embodiment divides a video frame into encoding target regions, performs encoding for each block, and generates an RD curve that approximates the relationship between bit rate and encoding distortion. The encoding device performs RD optimization processing using a first Lagrangian multiplier that minimizes a cost function using a bit rate assigned to the video frame and a parameter of a first RD curve, and a bit allocation unit that calculates an allocated bit rate; and a quantization parameter that calculates a quantization parameter for each block using a second Lagrangian multiplier calculated from the allocated bit rate for each block and a parameter of a second RD curve. and an RD optimization unit that determines an encoding mode that minimizes the cost function based on the second Lagrangian multiplier, and the first RD curve is approximated using a logarithmic function or an exponential function. Ru.
さらに、一実施形態において、前記ビット割当部は、ブロック単位の符号化が完了するごとに、前記映像フレーム内の未符号化ブロック全体に割り当てられたビットレートと前記第1RD曲線のパラメータとを用いて、前記第1ラグランジュ乗数及び前記ブロックごとの割当ビットレートを算出してもよい。 Furthermore, in one embodiment, the bit allocation unit uses the bit rate allocated to the entire unencoded block in the video frame and the parameters of the first RD curve every time encoding of each block is completed. Then, the first Lagrangian multiplier and the allocated bit rate for each block may be calculated.
さらに、一実施形態において、前記ビット割当部は、符号化済みブロックのビットレートと想定していたビットレートとの差が閾値を超えた場合に、前記映像フレーム内の未符号化ブロック全体に割り当てられたビットレートと第1RD曲線のパラメータとを用いて、前記第1ラグランジュ乗数及び前記ブロックごとの割当ビットレートを算出してもよい
。
Furthermore, in one embodiment, the bit allocation unit allocates all unencoded blocks in the video frame when a difference between the bit rate of the encoded block and the expected bit rate exceeds a threshold. The first Lagrangian multiplier and the allocated bit rate for each block may be calculated using the determined bit rate and the parameters of the first RD curve.
また、上記課題を解決するため、一実施形態に係る復号装置は、符号化装置の前記量子化パラメータ算出部によって算出された前記量子化パラメータを取得し、該量子化パラメータを用いて、前記符号化装置により符号化されたデータを復号する。 Further, in order to solve the above problem, a decoding device according to an embodiment obtains the quantization parameter calculated by the quantization parameter calculation unit of the encoding device, and uses the quantization parameter to The data encoded by the encoding device is decoded.
また、一実施形態係るプログラムは、コンピュータを、上記符号化装置として機能させる。 Further, a program according to an embodiment causes a computer to function as the encoding device.
また、一実施形態係るプログラムは、コンピュータを、上記復号装置として機能させる。 Further, a program according to an embodiment causes a computer to function as the decoding device.
本発明によれば、映像を所要ビットレートで符号化する際に、計算処理を軽量化しつつ、画質及び符号化効率を向上させることが可能となる。 According to the present invention, when encoding a video at a required bit rate, it is possible to improve image quality and encoding efficiency while reducing computational processing.
以下、一実施形態について、図面を参照して詳細に説明する。 Hereinafter, one embodiment will be described in detail with reference to the drawings.
(符号化装置)
図1に、本発明の一実施形態に係る符号化装置の構成例を示す。図1に示す符号化装置1は、レート制御部10と、ブロック分割部11と、減算部12と、変換部13と、量子化部14と、逆量子化部15と、逆変換部16と、加算部17と、記憶部18と、予測部19と、エントロピー符号化部20と、符号化データ記憶・出力部21と、を備える。
(encoding device)
FIG. 1 shows a configuration example of an encoding device according to an embodiment of the present invention. The encoding device 1 shown in FIG. , an
符号化装置1は、映像フレームを符号化対象領域に分割して符号化ブロック(以下、単に「ブロック」という。)ごとに符号化を行い、ビットレートRと符号化歪みDの関係を近似するRD曲線を用いてRD最適化処理を行う。その際、一定のビットレート以下となるように、ブロックごとに量子化パラメータを決定して符号化を行う。 The encoding device 1 divides a video frame into encoding target regions, performs encoding for each encoding block (hereinafter simply referred to as "block"), and approximates the relationship between bit rate R and encoding distortion D. RD optimization processing is performed using the RD curve. At this time, quantization parameters are determined for each block and encoding is performed so that the bit rate is below a certain level.
ブロック分割部11は、映像フレームをブロック単位の符号化対象領域へ分割したブロック画像を生成し、減算部12及び予測部19に出力する。
The
減算部12は、ブロック分割部11から入力したブロック画像の各画素値から、後述する予測部19から入力した予測ブロック画像の各画素値を減算して、ブロック画像と予測ブロック画像との差を示す残差ブロック画像を生成し、変換部13に出力する。
The
変換部13は、減算部12から入力した残差ブロック画像に対して、直交変換などの変換処理を行って変換係数を算出し、量子化部14に出力する。
The
レート制御部10は、残差ブロック画像の量子化を行う際の量子化パラメータを適切に決定することにより、レート制御を行う。レート制御部10の処理の詳細については後述する。レート制御部10は、決定した量子化パラメータを量子化部14及びエントロピー
符号化部20に出力する。
The
量子化部14は、変換部13から入力した変換係数を、レート制御部10から入力した量子化パラメータに対応する量子化ステップ(例えば、量子化パラメータと量子化ステップの対数が比例するように対応付けられる。)で除算して量子化することにより量子化係数を生成し、逆量子化部15及びエントロピー符号化部20に出力する。量子化部14により、データ量の削減が行われる。
The
逆量子化部15は、量子化部14から入力した量子化係数に対して、量子化ステップを乗ずることにより変換係数を復元し、逆変換部16に出力する。
The
逆変換部16は、逆量子化部15から入力した変換係数に対して、逆変換処理(変換部13で行った変換を元に戻す処理)を行って残差ブロック画像を復元し、加算部17に出力する。例えば、変換部13が離散コサイン変換を行った場合には、逆変換部16は逆離散コサイン変換を行う。
The inverse transformer 16 performs an inverse transform process (processing to undo the transformation performed by the transformer 13) on the transform coefficients input from the
加算部17は、逆変換部16から入力した残差ブロック画像と、予測部19から入力した予測画像とを加算し、符号化画像として記憶部18に出力する。
The
逆量子化部15、逆変換部16、及び加算部17により、符号化画像生成部(局所復号部)を構成する。すなわち、符号化画像生成部は、量子化係数に対して量子化ステップを乗じて変換係数を復元し、該変換係数に対して逆変換処理を行って残差ブロック画像を復元し、該残差ブロック画像とイントラ予測画像又は動き補償予測画像とを加算して符号化画像を生成する。
The
符号化装置1は、加算部17が出力する符号化画像に対してデブロッキングフィルタによるフィルタ処理などの後処理を行ってから、記憶部18に出力してもよい。
The encoding device 1 may perform post-processing such as filter processing using a deblocking filter on the encoded image output by the
記憶部18は、加算部17から入力した符号化画像を記憶する。
The storage unit 18 stores the encoded image input from the
予測部19は、イントラ予測(画面内予測)、又はインター予測(画面間予測、動き補償予測)を行う。イントラ予測では、記憶部18に記憶された符号化画像に対して、イントラ予測モードに従ってイントラ予測したイントラ予測画像を生成する。インター予測では、記憶部18に記憶された符号化画像に対して、動きベクトルに従って動き補償予測した動き補償予測画像を生成する。予測部19は、イントラ予測画像と動き補償予測画像とを切替えて予測ブロック画像とし、減算部12及び加算部17に出力する。予測部19は、予測処理に用いられた予測パラメータ(イントラ予測モード及び動きベクトル情報)をエントロピー符号化部20に出力する。
The
エントロピー符号化部20は、量子化部14から入力した量子化係数、レート制御部10から入力した量子化パラメータ、及び予測部19から入力した予測パラメータに対してエントロピー符号化を行い、データ圧縮を行って符号化データを生成し、符号化データ記憶・出力部21に出力する。エントロピー符号化は、0次指数ゴロム符号やコンテキスト適応型2値算術符号(CABAC:Context-based Adaptive Binary Arithmetic Coding)など、任意のエントロピー符号化方式を用いることができる。
The
符号化データ記憶・出力部21は、レート制御部10により決定された最適符号化モードを用いて符号化された符号化データを、符号化装置1の外部に出力する。
The encoded data storage/
(レート制御部)
次に、レート制御部10の処理について説明する。図2に、レート制御部10の構成例を示す。図2に示すレート制御部10は、ビット割当部101と、量子化パラメータ算出部102と、RD最適化部103と、を備える。以下、ラグランジュ乗数λOBAを第1ラグランジュ乗数と称し、ラグランジュ乗数λRDOを第2ラグランジュ乗数と称する。また、ビット割当部101で使用するRD曲線を第1RD曲線と称し、量子化パラメータ算出部102で使用するRD曲線を第2RD曲線と称する。
(rate control section)
Next, the processing of the
ビット割当部101は、フレームに割り当てられたビットRtを超えないように、フレームを構成するブロックにビットを割り当てる処理を行う。i番目のブロックに割り当てられたビットレート(以下、「ブロックレート」という。)をri、i番目のブロックの符号化歪み(以下、「ブロック歪み」という。)をdiとし、フレーム内のブロック数をMとする。フレーム全体の画質を最も高品質化(符号化歪みを最小化)するとき、第2ラグランジュ乗数λRDOを用いて、上述した式(4)を満たすようにコスト関数Jを最小化する予測モードを選べばよい。
The
上述したように、従来の式(5)で表される双曲線モデルのRD曲線を用いた場合、ブロックレートriを解析的に解くことができない、又は処理が複雑化する。そこで、本発明では対数関数又は指数関数を利用する。第1RD曲線をブロックレートriの対数関数又は指数関数を用いて近似することにより、式(4)を簡単に解くことができ、ブロックレートriを解析的に解くことが可能となる。 As described above, when the conventional RD curve of the hyperbolic model expressed by equation (5) is used, the block rate r i cannot be solved analytically, or the processing becomes complicated. Therefore, in the present invention, a logarithmic function or an exponential function is used. By approximating the first RD curve using a logarithmic function or an exponential function of the block rate r i , equation (4) can be easily solved, and the block rate r i can be solved analytically.
第1RD曲線を対数関数を用いて近似する場合には、ブロック歪みdiとブロックレートriの関係は式(8)で表される。 When the first RD curve is approximated using a logarithmic function, the relationship between block distortion d i and block rate r i is expressed by equation (8).
第1RD曲線を指数関数を用いて近似する場合には、ブロック歪みdiとブロックレートriの関係は式(9)で表される。 When approximating the first RD curve using an exponential function, the relationship between block distortion d i and block rate r i is expressed by equation (9).
以下では、第1RD曲線を対数関数を用いて近似する場合について説明する。c’i,k’i(1≦i≦M)は、符号化済みフレームのブロックから式(10),(11)を用いて算出される。 Below, a case will be described in which the first RD curve is approximated using a logarithmic function. c′ i and k′ i (1≦i≦M) are calculated from the blocks of the encoded frame using equations (10) and (11).
コスト関数Jを最小化するときブロックレートriによる偏微分は0になるので、式(12)が成立する。 When minimizing the cost function J, the partial differential with respect to the block rate r i becomes 0, so Equation (12) holds true.
なので、式(13)が成立する。すると、第1ラグランジュ乗数λOBAは式(14)により簡単に求めることができて、ブロックレートriは式(15)により求まる。 Therefore, equation (13) holds true. Then, the first Lagrangian multiplier λ OBA can be easily obtained using equation (14), and the block rate r i can be obtained using equation (15).
このように、ビット割当部101は、映像フレームに割り当てられたビットレートRtと、符号化済みブロックから算出された第1RD曲線のパラメータとを用いて、コスト関数Jを最小化する第1ラグランジュ乗数λOBA(式(14)参照)、及びブロックレートri(式(15)参照)を算出する。そして、算出したブロックレートriを量子化パラメータ算出部102に出力する。ビット割当部101は、従来の双曲線モデルではなく、対数モデル又は指数モデルを用いることにより、符号化済みの結果から得られたc’iを用いて、式(15)から簡単にブロックレートriを決定することができ、解析的に解くことが可能となる。
In this way, the
量子化パラメータ算出部102は、第2RD曲線として従来のRD曲線を使用する場合には、式(6)にブロックレートriを代入することで第2ラグランジュ乗数λRDOを算出する。また、第2RD曲線として第1RD曲線と同じRD曲線を使用する場合には、式(12)にブロックレートriを代入することで第2ラグランジュ乗数λRDOを算出する。
When using the conventional RD curve as the second RD curve, the quantization
そして、量子化パラメータ算出部102は、式(16)に示すように、第2ラグランジュ乗数λRDOに基づいて、ブロックごとに残差信号の量子化を行う際の量子化パラメータQPiを算出する。そして、量子化パラメータ算出部102は、算出した量子化パラメータQPiを符号化装置1の量子化部14に出力する。また、量子化パラメータ算出部102は、第2ラグランジュ乗数λRDO及び量子化パラメータQPiをRD最適化部103に出力する。
Then, the quantization
RD最適化部103は、量子化パラメータ算出部102から入力した第2ラグランジュ乗数λRDO及び量子化パラメータQPiを用いて、コスト関数Jを最小化する最適符号化モードを決定する。最適符号化モードは、符号化ツール及びパラメータ(イントラ予測
のDC予測モードなど)の組み合わせである。そして、RD最適化部103は、決定した最適符号化モードを符号化装置1の符号化データ記憶・出力部21に出力する。なお、RD最適化で使用するriは、ビット割当部101で算出したブロックレートriとは異なるものである。RD最適化では、あらゆるモードで符号化を実行し、モードごとに得られるdiとriの組み合わせをコスト関数J=di+λRDO・riに代入して、Jが最小となるモードを選択する。
The
(ビット割当処理の第1の変形例)
ビット割当部101と量子化パラメータ算出部102によって、ブロックレートriと量子化パラメータQPiは一意に定まるが、実際に符号化した時に想定どおりのビットレートになるとは限らない。そこで、フレームに割り当てられた実際のビットレートRtから大きく外れるようなことがないように、ブロック単位で割当ビット量の修正を行ってもよい。つまり、第1の変形例では、ビット割当部101は、ブロック単位の符号化が完了するごとに、フレーム内の未符号化ブロック全体に割り当てられたビットレートRjと第1RD曲線のパラメータとを用いて、第1ラグランジュ乗数λOBA及びブロックレートriを算出する。
(First modification of bit allocation processing)
Although the block rate r i and the quantization parameter QP i are uniquely determined by the
具体的には、i番目のブロックで消費したビットをbjとすると、j番目までのブロックに対する符号化が終わった時、フレーム内の未符号化ブロック全体に割り当てられたビットレートRjは式(17)で表される。そこで、ビット割当部101は、ブロックレートri(j<i≦M)を式(18)により修正する。
Specifically, if the bits consumed in the i-th block are bj , then when the encoding of blocks up to the j-th block is completed, the bit rate Rj assigned to all unencoded blocks in the frame is given by the formula It is expressed as (17). Therefore, the
(ビット割当処理の第2の変形例)
第1の変形例によりブロック単位でブロックレートriを制御すると、フレーム全体の画質が劣化する場合がある。そこで、フレーム全体の画質を考慮し、必要に応じて第1の変形例による修正を行うようにしてもよい。つまり、第2の変形例では、ビット割当部101は、符号化済みブロックのビットレートRactualと想定していたビットレートRidealとの差が閾値を超えた場合に、フレーム内の未符号化ブロック全体に割り当てられたビットレートRjと第1RD曲線のパラメータとを用いて、第1ラグランジュ乗数λOBA及びブロックレートriを算出する。
(Second modification example of bit allocation processing)
If the block rate r i is controlled on a block-by-block basis according to the first modification, the image quality of the entire frame may deteriorate. Therefore, the image quality of the entire frame may be taken into consideration, and corrections may be made according to the first modified example as necessary. In other words, in the second modification, when the difference between the bit rate R actual of the encoded block and the assumed bit rate R ideal exceeds the threshold, the
具体的には、j番目までに実際に消費したビットレートRactualが想定していたビットレートRidealからどれだけ乖離したかを基準にして制御を行う。ビット割当部101は、式(19)より、j番目までに消費されるビットレートの想定値Ridealを算出し、式(20)に示すように、乖離度合いSを(Ractual-Rideal)/Ridealの絶対値よって算出する。ビット割当部101は、ブロック符号化ごとに乖離度合いSと閾値sとを比較し、S>sとなるブロックでのみ式(18)で示したブロックレートriに修正することで、余分な制御は行わないようにすることができる。閾値sは任意に設定することができ、例えばs=0.1とする。
Specifically, control is performed based on how far the bit rate R actual actually consumed up to the j-th time deviates from the expected bit rate R ideal . The
(復号装置)
次に、本発明の一実施形態に係る復号装置について説明する。図3に、本発明の一実施形態に係る復号装置の構成例を示す。図3に示す復号装置2は、エントロピー復号部31と、逆量子化部32と、逆変換部33と、加算部34と、記憶部35と、予測部36と、を備える。
(Decoding device)
Next, a decoding device according to an embodiment of the present invention will be described. FIG. 3 shows a configuration example of a decoding device according to an embodiment of the present invention. The
復号装置2は、符号化装置1から、量子化パラメータ算出部102によって算出された量子化パラメータQPiを取得し、該量子化パラメータQPiを用いて、符号化装置1により符号化された符号化データを復号する。
The
エントロピー復号部31は、符号化装置1が出力する符号化データを復号し、量子化パラメータQPi、量子化係数、及び予測パラメータ(イントラ予測モード及び動きベクトル情報)を取得する。そして、エントロピー復号部31は、量子化パラメータQPi及び量子化係数を逆量子化部32に出力し、予測パラメータを予測部36に出力する。
The
逆量子化部32は、エントロピー復号部31から量子化係数及び量子化パラメータQPiを入力し、量子化係数に量子化パラメータQPiから導出される量子化ステップを乗算してブロックごとの直交変換係数を復元し、逆変換部33に出力する。
The
逆変換部33は、逆量子化部32から入力した直交変換係数に対して逆変換を行って残差画像を生成し、加算部34に出力する。
The
加算部34は、逆変換部33から入力した残差画像と、予測部36から入力した予測画像の各画素値を加算して復号画像を生成し、記憶部35及び復号装置2の外部に出力する。
The
復号装置2は、符号化装置1と同様に、加算部34が出力する復号画像に対してデブロッキングフィルタによるフィルタ処理などの後処理を行ってから、記憶部35に出力してもよい。
Similar to the encoding device 1, the
記憶部35は、加算部34から入力した復号画像を記憶する。
The
予測部36は、イントラ予測(画面内予測)、又はインター予測(画面間予測、動き補償予測)を行う。イントラ予測では、記憶部35に記憶された復号画像に対して、エントロピー復号部31から入力したイントラ予測モードに従ってイントラ予測したイントラ予測画像を生成する。インター予測では、記憶部35に記憶された復号画像に対して、エントロピー復号部31から入力した動きベクトル情報に従って動き補償予測した動き補償予測画像を生成する。予測部36は、イントラ予測画像と動き補償予測画像とを切替えて予測ブロック画像とし、加算部34に出力する。
The
このように、本発明は、符号化・復号方式をHEVC,VVCなどの従来の方式から変更することなく、計算処理を軽量化しつつ、画質及び符号化効率を向上させる映像を所要ビットレートで符号化する際の画質及び符号化効率を向上させることが可能となる。 As described above, the present invention can encode video at a required bit rate, reducing computational processing and improving image quality and encoding efficiency, without changing the encoding/decoding method from conventional methods such as HEVC and VVC. This makes it possible to improve image quality and encoding efficiency when converting images.
(プログラム)
上述した符号化装置1及び復号装置2として機能させるために、それぞれプログラム命令を実行可能なコンピュータを用いることも可能である。ここで、コンピュータは、汎用コンピュータ、専用コンピュータ、ワークステーション、PC(Personal Computer)、電子ノートパッドなどであってもよい。プログラム命令は、必要なタスクを実行するためのプログラムコード、コードセグメントなどであってもよい。
(program)
In order to function as the above-mentioned encoding device 1 and
コンピュータは、プロセッサと、記憶部と、入力部と、出力部と、通信インターフェースとを備える。プロセッサは、CPU(Central Processing Unit)、MPU(Micro Processing Unit)、GPU(Graphics Processing Unit)、DSP(Digital Signal Processor)、SoC(System on a Chip)などであり、同種又は異種の複数のプロセッサにより構成されてもよい。プロセッサは、記憶部からプログラムを読み出して実行することで、上記各構成の制御及び各種の演算処理を行う。なお、これらの処理内容の少なくとも一部をハードウェアで実現することとしてもよい。入力部は、ユーザの入力操作を受け付けてユーザの操作に基づく情報を取得する入力インターフェースであり、ポインティングデバイス、キーボード、マウスなどである。出力部は、情報を出力する出力インターフェースであり、ディスプレイ、スピーカなどである。通信インターフェースは、外部の装置と通信するためのインターフェースであり、例えばLAN(Local Area Network)インターフェースである。 The computer includes a processor, a storage section, an input section, an output section, and a communication interface. Processors include CPUs (Central Processing Units), MPUs (Micro Processing Units), GPUs (Graphics Processing Units), DSPs (Digital Signal Processors), and SoCs (System on a Chip). may be configured. The processor controls each of the above components and performs various calculation processes by reading and executing programs from the storage unit. Note that at least a part of these processing contents may be realized by hardware. The input unit is an input interface that receives a user's input operation and obtains information based on the user's operation, and is a pointing device, keyboard, mouse, or the like. The output unit is an output interface that outputs information, such as a display or a speaker. The communication interface is an interface for communicating with an external device, and is, for example, a LAN (Local Area Network) interface.
プログラムは、コンピュータが読み取り可能な記録媒体に記録されていてもよい。このような記録媒体を用いれば、プログラムをコンピュータにインストールすることが可能である。ここで、プログラムが記録された記録媒体は、非一過性(non-transitory)の記録媒体であってもよい。非一過性の記録媒体は、特に限定されるものではないが、例えば、CD-ROM、DVD-ROM、USB(Universal Serial Bus)メモリなどであってもよい。また、このプログラムは、ネットワークを介して外部装置からダウンロードされる形態としてもよい。 The program may be recorded on a computer readable recording medium. Using such a recording medium, it is possible to install a program on a computer. Here, the recording medium on which the program is recorded may be a non-transitory recording medium. The non-transitory recording medium is not particularly limited, and may be, for example, a CD-ROM, a DVD-ROM, a USB (Universal Serial Bus) memory, or the like. Further, this program may be downloaded from an external device via a network.
例えば、コンピュータを上記の符号化装置1として機能させるためのプログラムは、映像フレームに割り当てられたビットレートと第1RD曲線のパラメータとを用いて、コスト関数を最小化する第1ラグランジュ乗数及びブロックレートriを算出するステップと、ブロックレートriと第2RD曲線のパラメータとから算出される第2ラグランジュ乗数を用いて、コスト関数を最小化する符号化モードを決定するステップと、第2ラグランジュ乗数に基づいて、ブロックごとの量子化パラメータQPiを算出するステップと、をコンピュータに実行させ、第1RD曲線は、対数関数又は指数関数を用いて近似される。 For example, a program for making a computer function as the above-mentioned encoding device 1 includes a first Lagrangian multiplier and a block rate that minimize the cost function using the bit rate assigned to the video frame and the parameters of the first RD curve. calculating r i ; determining a coding mode that minimizes the cost function using a second Lagrange multiplier calculated from the block rate r i and the parameters of the second RD curve; and determining a second Lagrange multiplier. The first RD curve is approximated using a logarithmic function or an exponential function.
また、コンピュータを上記の復号装置2として機能させるためのプログラムは、符号化装置1から、量子化パラメータ算出部102によって算出された量子化パラメータQPiを取得するステップと、該量子化パラメータQPiを用いて、符号化装置1により符号化されたデータを復号するステップと、をコンピュータに実行させる。
Further, the program for causing a computer to function as the
上述の実施形態は代表的な例として説明したが、本発明の趣旨及び範囲内で、多くの変更及び置換ができることは当業者に明らかである。したがって、本発明は、上述の実施形態によって制限するものと解するべきではなく、特許請求の範囲から逸脱することなく、種々の変形又は変更が可能である。例えば、実施形態の構成図に記載の複数の構成ブロックを統合したり、1つの構成ブロックを分割したりすることが可能である。 Although the embodiments described above have been described as representative examples, it will be apparent to those skilled in the art that many modifications and substitutions can be made within the spirit and scope of the invention. Therefore, the present invention should not be construed as being limited to the above-described embodiments, and various modifications and changes can be made without departing from the scope of the claims. For example, it is possible to integrate a plurality of configuration blocks described in the configuration diagram of the embodiment, or to divide one configuration block.
1 符号化装置
2 復号装置
10 レート制御部
11 ブロック分割部
12 減算部
13 変換部
14 量子化部
15 逆量子化部
16 逆変換部
17 加算部
18 記憶部
19 予測部
20 エントロピー符号化部
21 符号化データ記憶・出力部
31 エントロピー復号部
32 逆量子化部
33 逆変換部
34 加算部
35 記憶部
36 予測部
101 ビット割当部
102 量子化パラメータ算出部
103 RD最適化部
1
Claims (6)
前記映像フレームに割り当てられたビットレートと第1RD曲線のパラメータとを用いて、コスト関数を最小化する第1ラグランジュ乗数及び前記ブロックごとの割当ビットレートを算出するビット割当部と、
前記ブロックごとの割当ビットレートと第2RD曲線のパラメータとから算出される第2ラグランジュ乗数を用いて、前記ブロックごとの量子化パラメータを算出する量子化パラメータ算出部と、
前記第2ラグランジュ乗数に基づいて、コスト関数を最小化する符号化モードを決定するRD最適化部と、を備え、
前記第1RD曲線は、対数関数又は指数関数を用いて近似される、符号化装置。 An encoding device that divides a video frame into encoding target regions, encodes each block, and performs RD optimization processing using an RD curve that approximates the relationship between bit rate and encoding distortion,
a bit allocation unit that calculates a first Lagrangian multiplier that minimizes a cost function and an allocated bit rate for each block using the bit rate allocated to the video frame and the parameters of the first RD curve;
a quantization parameter calculation unit that calculates a quantization parameter for each block using a second Lagrangian multiplier calculated from the allocated bit rate for each block and a parameter of a second RD curve;
an RD optimization unit that determines an encoding mode that minimizes the cost function based on the second Lagrangian multiplier,
The encoding device, wherein the first RD curve is approximated using a logarithmic function or an exponential function.
該量子化パラメータを用いて、前記符号化装置により符号化されたデータを復号する、復号装置。 Obtaining the quantization parameter calculated by the quantization parameter calculation unit of the encoding device according to any one of claims 1 to 3,
A decoding device that decodes data encoded by the encoding device using the quantization parameter.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022125917A JP2024022374A (en) | 2022-08-05 | 2022-08-05 | Encoding device, decoding device, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022125917A JP2024022374A (en) | 2022-08-05 | 2022-08-05 | Encoding device, decoding device, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2024022374A true JP2024022374A (en) | 2024-02-16 |
Family
ID=89855094
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2022125917A Pending JP2024022374A (en) | 2022-08-05 | 2022-08-05 | Encoding device, decoding device, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2024022374A (en) |
-
2022
- 2022-08-05 JP JP2022125917A patent/JP2024022374A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2006140758A (en) | Method, apparatus and program for encoding moving image | |
KR101320611B1 (en) | A method and apparatus for encoding/decoding of N bit video data with quantization parameter extension | |
JP2016134860A (en) | Dynamic image encoding device, dynamic image encoding method and dynamic image encoding computer program | |
JP7402280B2 (en) | Video decoding device, video decoding method and program | |
KR20070115551A (en) | A method and apparatus for encoding/decoding of n-bit video data | |
WO2013149154A1 (en) | Apparatuses and methods for providing quantized coefficients for video encoding | |
US9860565B1 (en) | Low cost rate-distortion computations for video compression | |
JPWO2016194380A1 (en) | Moving picture coding apparatus, moving picture coding method, and recording medium storing moving picture coding program | |
JP2024022374A (en) | Encoding device, decoding device, and program | |
US8422807B2 (en) | Encoder and image conversion apparatus | |
JP7080424B2 (en) | Deblocking filter controller and program | |
JPWO2011105231A1 (en) | Filter coefficient encoding apparatus, filter coefficient decoding apparatus, moving picture encoding apparatus, moving picture decoding apparatus, and data structure | |
JP2019102861A (en) | Moving image encoding device, moving image encoding method, and moving image encoding program | |
JP2015076666A (en) | Block structure determination circuit and information compression circuit | |
WO2019150435A1 (en) | Video encoding device, video encoding method, video decoding device, video decoding method, and video encoding system | |
JP2022183942A (en) | Encoder and program | |
JP4451759B2 (en) | Lossless video encoding device, lossless video encoding method, lossless video decoding device, lossless video decoding method, lossless video encoding program, lossless video decoding program, and recording medium for those programs | |
JP6200220B2 (en) | Image processing apparatus, encoding apparatus, decoding apparatus, and program | |
US20220303543A1 (en) | Device and method for allocating code amounts to intra prediction modes | |
JP2009021802A (en) | Moving image encoder and method | |
JP2024000443A (en) | Video image coding device and program | |
US10034011B2 (en) | Video coding apparatus | |
JPWO2015141116A1 (en) | Video encoding apparatus, video encoding method, and video encoding program | |
JP2014143515A (en) | Image processing apparatus and image processing program | |
US9948956B2 (en) | Method for encoding and decoding image block, encoder and decoder |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A80 | Written request to apply exceptions to lack of novelty of invention |
Free format text: JAPANESE INTERMEDIATE CODE: A80 Effective date: 20220829 |