JP2024022374A - Encoding device, decoding device, and program - Google Patents

Encoding device, decoding device, and program Download PDF

Info

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
Application number
JP2022125917A
Other languages
Japanese (ja)
Inventor
雄一 近藤
裕一 日下部
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Japan Broadcasting Corp
Original Assignee
Japan Broadcasting Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Japan Broadcasting Corp filed Critical Japan Broadcasting Corp
Priority to JP2022125917A priority Critical patent/JP2024022374A/en
Publication of JP2024022374A publication Critical patent/JP2024022374A/en
Pending legal-status Critical Current

Links

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, Paragraph 2 of the Patent Act 1. Published by Yuichi Kondo, Yasuko Sugito, Atsuro Ichigaya, and others in the FIT2021 20th Information Science and Technology Forum lecture proceedings on August 12, 2021. 2. Published by Yuichi Kondo, Yasuko Sugito, Atsuro Ichigaya, and others at the 20th Information Science and Technology Forum of FIT2021 on August 27, 2021. 3. https://www. nhk. or. jp/strl/publica/giken_dayori/205/4. html Published by Yuichi Kondo in the Giken Newsletter April 2022 issue on April 1, 2022.

本発明は、符号化装置、復号装置、及びプログラムに関する。 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.

レート制御は、フレームに割り当てられた目標ビットレートRで符号化できるように、ビットレートを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.

ここでは、フレーム単位のビット割り当ては済んでおり、フレーム内の各ブロックにビット割り当てを行う場合を例に説明する。ビット割当処理では、消費したビットレートRを監視しながら、フレームに割り当てられた目標ビットレートRを超えないようにビットを割り当てる。図4は、斜線を付した7ブロックが符号化を終了し、残りの5ブロックが符号化前の状態を示している。最も簡単なビット割当処理手法の1つは、消費ビットレートRから利用可能なビットレートR(R=R-R)を導出し、Rを残りのブロックへ一定の割合で割り当てる方法である。図4に示す例では、残りの5ブロックに対しする1ブロック当たりの割当ビットは、R/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. .

Figure 2024022374000002
Figure 2024022374000002

ここで、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).

Figure 2024022374000003
Figure 2024022374000003

また、非特許文献2には、テイラー展開を用いた近似や、近似で発生する誤差の削減処理などを行うことでビット割当処理を実現することが開示されている。 Furthermore, Non-Patent Document 2 discloses that bit allocation processing is realized by performing approximation using Taylor expansion, processing to reduce errors generated in approximation, and the like.

大久保榮、「H265/HEVC教科書」、初版、インプレスジャパン、2013年10月21日発行Sakae Okubo, "H265/HEVC Textbook", first edition, Impress Japan, published October 21, 2013 Li et al., “Optimal Bit Allocation for CTU Level Rate Control in HEVC,” IEEE Trans. Circuits Syst. Video Technol., 2017Li et al., “Optimal Bit Allocation for CTU Level Rate Control in HEVC,” IEEE Trans. Circuits Syst. Video Technol., 2017

前述のビット割当処理は、ビットを各ブロックで均等に割り当てているが、ブロックごとに割り当てるビットを制御することで画面全体の画質を改善することが可能である。以下にその手法を述べる。 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を最小化することである。ただし、すべてのブロックのビットレートの和は、そのフレームに割り当てられたビットレートRを超えてはいけない。これを数式で表現すると、式(3)となる。ここで、添え字iはブロック番号を表しておりd,rはそれぞれ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.

Figure 2024022374000004
Figure 2024022374000004

式(3)を満たすようなrを求めたい。式(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 .

Figure 2024022374000005
Figure 2024022374000005

双曲線モデルのRD曲線は、式(5)で表される。c,k(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).

Figure 2024022374000006
Figure 2024022374000006

コスト関数Jを最小化するときrによる偏微分は0なので、式(6)が成立する。 When minimizing the cost function J, the partial differential with respect to r i is 0, so Equation (6) holds true.

Figure 2024022374000007
Figure 2024022374000007

Figure 2024022374000008
であり、rの総和がフレームに割り当てられたビットレートRとなることから、式(7)が成り立たなければならない。
Figure 2024022374000008
Since the sum of r i is the bit rate R t assigned to the frame, equation (7) must hold.

Figure 2024022374000009
Figure 2024022374000009

式(7)を解いてλOBAが求まると、式(6)で求まるrによりi番目のブロックのビットレートを決定することができる。しかし、c,kはブロックごとに値が異なるため、式(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 Document 2, bit allocation processing is realized by approximation using Taylor expansion to solve equation (7) and processing to reduce errors generated in the approximation, but the processing is complicated. There was a problem that it became

かかる事情に鑑みてなされた本発明の目的は、映像を所要ビットレートで符号化する際に、計算処理を軽量化しつつ、画質及び符号化効率を向上させることが可能な符号化装置、復号装置、及びプログラムを提供することにある。 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.

一実施形態に係る符号化装置の構成例を示すブロック図である。FIG. 1 is a block diagram illustrating a configuration example of an encoding device according to an embodiment. 一実施形態に係る符号化装置におけるレート制御部の構成例を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration example of a rate control unit in an encoding device according to an embodiment. 一実施形態に係る復号装置の構成例を示すブロック図である。FIG. 1 is a block diagram illustrating a configuration example of a decoding device according to an embodiment. 従来のブロックごとにビット割り当てを行う例を示す図である。FIG. 3 is a diagram illustrating an example of conventional bit allocation for each block.

以下、一実施形態について、図面を参照して詳細に説明する。 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 addition section 17, a storage section 18, a prediction section 19, an entropy encoding section 20, and an encoded data storage/output section 21.

符号化装置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 block dividing unit 11 generates a block image by dividing the video frame into encoding target areas in units of blocks, and outputs the block image to the subtracting unit 12 and the predicting unit 19.

減算部12は、ブロック分割部11から入力したブロック画像の各画素値から、後述する予測部19から入力した予測ブロック画像の各画素値を減算して、ブロック画像と予測ブロック画像との差を示す残差ブロック画像を生成し、変換部13に出力する。 The subtraction unit 12 subtracts each pixel value of the predicted block image input from the prediction unit 19 (described later) from each pixel value of the block image input from the block division unit 11, and calculates the difference between the block image and the predicted block image. The residual block image shown in FIG.

変換部13は、減算部12から入力した残差ブロック画像に対して、直交変換などの変換処理を行って変換係数を算出し、量子化部14に出力する。 The transformation unit 13 performs transformation processing such as orthogonal transformation on the residual block image input from the subtraction unit 12 to calculate transformation coefficients, and outputs them to the quantization unit 14 .

レート制御部10は、残差ブロック画像の量子化を行う際の量子化パラメータを適切に決定することにより、レート制御を行う。レート制御部10の処理の詳細については後述する。レート制御部10は、決定した量子化パラメータを量子化部14及びエントロピー
符号化部20に出力する。
The rate control unit 10 performs rate control by appropriately determining a quantization parameter when quantizing a residual block image. Details of the processing by the rate control unit 10 will be described later. The rate control unit 10 outputs the determined quantization parameter to the quantization unit 14 and the entropy encoding unit 20.

量子化部14は、変換部13から入力した変換係数を、レート制御部10から入力した量子化パラメータに対応する量子化ステップ(例えば、量子化パラメータと量子化ステップの対数が比例するように対応付けられる。)で除算して量子化することにより量子化係数を生成し、逆量子化部15及びエントロピー符号化部20に出力する。量子化部14により、データ量の削減が行われる。 The quantization unit 14 converts the transformation coefficients input from the conversion unit 13 into quantization steps corresponding to the quantization parameters input from the rate control unit 10 (for example, the quantization parameters are arranged so that the logarithms of the quantization steps are proportional to each other). ) and quantization to generate a quantization coefficient, which is output to the inverse quantization section 15 and the entropy encoding section 20. The quantization unit 14 reduces the amount of data.

逆量子化部15は、量子化部14から入力した量子化係数に対して、量子化ステップを乗ずることにより変換係数を復元し、逆変換部16に出力する。 The inverse quantization section 15 multiplies the quantization coefficients input from the quantization section 14 by the quantization step to restore transform coefficients, and outputs the restored transform coefficients to the inverse transform section 16 .

逆変換部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 inverse quantizer 15 to restore a residual block image, and the adder 16 restores the residual block image. Output to 17. For example, when the transform unit 13 performs a discrete cosine transform, the inverse transform unit 16 performs an inverse discrete cosine transform.

加算部17は、逆変換部16から入力した残差ブロック画像と、予測部19から入力した予測画像とを加算し、符号化画像として記憶部18に出力する。 The addition unit 17 adds the residual block image input from the inverse transformation unit 16 and the predicted image input from the prediction unit 19, and outputs the result to the storage unit 18 as an encoded image.

逆量子化部15、逆変換部16、及び加算部17により、符号化画像生成部(局所復号部)を構成する。すなわち、符号化画像生成部は、量子化係数に対して量子化ステップを乗じて変換係数を復元し、該変換係数に対して逆変換処理を行って残差ブロック画像を復元し、該残差ブロック画像とイントラ予測画像又は動き補償予測画像とを加算して符号化画像を生成する。 The inverse quantization section 15, the inverse transformation section 16, and the addition section 17 constitute a coded image generation section (local decoding section). That is, the encoded image generation unit restores the transform coefficient by multiplying the quantization coefficient by the quantization step, performs inverse transform processing on the transform coefficient to restore the residual block image, and restores the residual block image by multiplying the quantization coefficient by the quantization step. A coded image is generated by adding the block image and the intra-predicted image or the motion-compensated predicted image.

符号化装置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 addition unit 17 and then output the encoded image to the storage unit 18 .

記憶部18は、加算部17から入力した符号化画像を記憶する。 The storage unit 18 stores the encoded image input from the addition unit 17.

予測部19は、イントラ予測(画面内予測)、又はインター予測(画面間予測、動き補償予測)を行う。イントラ予測では、記憶部18に記憶された符号化画像に対して、イントラ予測モードに従ってイントラ予測したイントラ予測画像を生成する。インター予測では、記憶部18に記憶された符号化画像に対して、動きベクトルに従って動き補償予測した動き補償予測画像を生成する。予測部19は、イントラ予測画像と動き補償予測画像とを切替えて予測ブロック画像とし、減算部12及び加算部17に出力する。予測部19は、予測処理に用いられた予測パラメータ(イントラ予測モード及び動きベクトル情報)をエントロピー符号化部20に出力する。 The prediction unit 19 performs intra prediction (intra-screen prediction) or inter prediction (inter-screen prediction, motion compensation prediction). In intra prediction, an intra prediction image is generated by performing intra prediction on the encoded image stored in the storage unit 18 according to an intra prediction mode. In inter prediction, a motion-compensated predicted image is generated by performing motion-compensated prediction on the encoded image stored in the storage unit 18 according to a motion vector. The prediction unit 19 switches between the intra-predicted image and the motion-compensated predicted image to form a predicted block image, and outputs it to the subtraction unit 12 and addition unit 17 . The prediction unit 19 outputs prediction parameters (intra prediction mode and motion vector information) used in the prediction process to the entropy encoding unit 20.

エントロピー符号化部20は、量子化部14から入力した量子化係数、レート制御部10から入力した量子化パラメータ、及び予測部19から入力した予測パラメータに対してエントロピー符号化を行い、データ圧縮を行って符号化データを生成し、符号化データ記憶・出力部21に出力する。エントロピー符号化は、0次指数ゴロム符号やコンテキスト適応型2値算術符号(CABAC:Context-based Adaptive Binary Arithmetic Coding)など、任意のエントロピー符号化方式を用いることができる。 The entropy encoding unit 20 performs entropy encoding on the quantization coefficient input from the quantization unit 14, the quantization parameter input from the rate control unit 10, and the prediction parameter input from the prediction unit 19, and performs data compression. to generate encoded data and output it to the encoded data storage/output section 21. For entropy encoding, any entropy encoding method such as zero-order exponential Golomb code or context-based adaptive binary arithmetic coding (CABAC) can be used.

符号化データ記憶・出力部21は、レート制御部10により決定された最適符号化モードを用いて符号化された符号化データを、符号化装置1の外部に出力する。 The encoded data storage/output unit 21 outputs encoded data encoded using the optimal encoding mode determined by the rate control unit 10 to the outside of the encoding device 1.

(レート制御部)
次に、レート制御部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 rate control unit 10 will be explained. FIG. 2 shows an example of the configuration of the rate control section 10. The rate control section 10 shown in FIG. 2 includes a bit allocation section 101, a quantization parameter calculation section 102, and an RD optimization section 103. Hereinafter, the Lagrange multiplier λ OBA will be referred to as a first Lagrange multiplier, and the Lagrange multiplier λ RDO will be referred to as a second Lagrange multiplier. Further, the RD curve used by the bit allocation section 101 is referred to as a first RD curve, and the RD curve used by the quantization parameter calculation section 102 is referred to as a second RD curve.

ビット割当部101は、フレームに割り当てられたビットRを超えないように、フレームを構成するブロックにビットを割り当てる処理を行う。i番目のブロックに割り当てられたビットレート(以下、「ブロックレート」という。)をr、i番目のブロックの符号化歪み(以下、「ブロック歪み」という。)をdとし、フレーム内のブロック数をMとする。フレーム全体の画質を最も高品質化(符号化歪みを最小化)するとき、第2ラグランジュ乗数λRDOを用いて、上述した式(4)を満たすようにコスト関数Jを最小化する予測モードを選べばよい。 The bit allocation unit 101 performs a process of allocating bits to blocks constituting a frame so as not to exceed the bits Rt allocated to the frame. Let r i be the bit rate assigned to the i-th block (hereinafter referred to as "block rate"), and let d i be the encoding distortion of the i-th block (hereinafter referred to as "block distortion"), and Let M be the number of blocks. To maximize the image quality of the entire frame (minimize coding distortion), use the second Lagrangian multiplier λ RDO to select a prediction mode that minimizes the cost function J so as to satisfy the above equation (4). All you have to do is choose.

上述したように、従来の式(5)で表される双曲線モデルのRD曲線を用いた場合、ブロックレートrを解析的に解くことができない、又は処理が複雑化する。そこで、本発明では対数関数又は指数関数を利用する。第1RD曲線をブロックレートrの対数関数又は指数関数を用いて近似することにより、式(4)を簡単に解くことができ、ブロックレートrを解析的に解くことが可能となる。 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曲線を対数関数を用いて近似する場合には、ブロック歪みdとブロックレートrの関係は式(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).

Figure 2024022374000010
Figure 2024022374000010

第1RD曲線を指数関数を用いて近似する場合には、ブロック歪みdとブロックレートrの関係は式(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).

Figure 2024022374000011
Figure 2024022374000011

以下では、第1RD曲線を対数関数を用いて近似する場合について説明する。c’,k’(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).

Figure 2024022374000012
Figure 2024022374000012

コスト関数Jを最小化するときブロックレートrによる偏微分は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.

Figure 2024022374000013
Figure 2024022374000013

Figure 2024022374000014
なので、式(13)が成立する。すると、第1ラグランジュ乗数λOBAは式(14)により簡単に求めることができて、ブロックレートrは式(15)により求まる。
Figure 2024022374000014
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).

Figure 2024022374000015
Figure 2024022374000015

このように、ビット割当部101は、映像フレームに割り当てられたビットレートRと、符号化済みブロックから算出された第1RD曲線のパラメータとを用いて、コスト関数Jを最小化する第1ラグランジュ乗数λOBA(式(14)参照)、及びブロックレートr(式(15)参照)を算出する。そして、算出したブロックレートrを量子化パラメータ算出部102に出力する。ビット割当部101は、従来の双曲線モデルではなく、対数モデル又は指数モデルを用いることにより、符号化済みの結果から得られたc’iを用いて、式(15)から簡単にブロックレートrを決定することができ、解析的に解くことが可能となる。 In this way, the bit allocation unit 101 uses the bit rate Rt allocated to the video frame and the parameters of the first RD curve calculated from the encoded block to calculate the first Lagrangian that minimizes the cost function J. The multiplier λ OBA (see equation (14)) and the block rate r i (see equation (15)) are calculated. Then, the calculated block rate r i is output to the quantization parameter calculation unit 102. By using a logarithmic model or an exponential model instead of a conventional hyperbolic model, the bit allocation unit 101 easily calculates the block rate r i from equation (15) using c′ i obtained from the encoded result. can be determined and solved analytically.

量子化パラメータ算出部102は、第2RD曲線として従来のRD曲線を使用する場合には、式(6)にブロックレートrを代入することで第2ラグランジュ乗数λRDOを算出する。また、第2RD曲線として第1RD曲線と同じRD曲線を使用する場合には、式(12)にブロックレートrを代入することで第2ラグランジュ乗数λRDOを算出する。 When using the conventional RD curve as the second RD curve, the quantization parameter calculation unit 102 calculates the second Lagrangian multiplier λ RDO by substituting the block rate r i into equation (6). Furthermore, when using the same RD curve as the first RD curve as the second RD curve, the second Lagrangian multiplier λ RDO is calculated by substituting the block rate r i into equation (12).

そして、量子化パラメータ算出部102は、式(16)に示すように、第2ラグランジュ乗数λRDOに基づいて、ブロックごとに残差信号の量子化を行う際の量子化パラメータQPを算出する。そして、量子化パラメータ算出部102は、算出した量子化パラメータQPを符号化装置1の量子化部14に出力する。また、量子化パラメータ算出部102は、第2ラグランジュ乗数λRDO及び量子化パラメータQPをRD最適化部103に出力する。 Then, the quantization parameter calculation unit 102 calculates the quantization parameter QP i when quantizing the residual signal for each block, based on the second Lagrangian multiplier λ RDO , as shown in equation (16). . Then, the quantization parameter calculation unit 102 outputs the calculated quantization parameter QP i to the quantization unit 14 of the encoding device 1. Further, the quantization parameter calculation unit 102 outputs the second Lagrangian multiplier λ RDO and the quantization parameter QP i to the RD optimization unit 103.

Figure 2024022374000016
Figure 2024022374000016

RD最適化部103は、量子化パラメータ算出部102から入力した第2ラグランジュ乗数λRDO及び量子化パラメータQPを用いて、コスト関数Jを最小化する最適符号化モードを決定する。最適符号化モードは、符号化ツール及びパラメータ(イントラ予測
のDC予測モードなど)の組み合わせである。そして、RD最適化部103は、決定した最適符号化モードを符号化装置1の符号化データ記憶・出力部21に出力する。なお、RD最適化で使用するrは、ビット割当部101で算出したブロックレートrとは異なるものである。RD最適化では、あらゆるモードで符号化を実行し、モードごとに得られるdとrの組み合わせをコスト関数J=d+λRDO・rに代入して、Jが最小となるモードを選択する。
The RD optimization unit 103 uses the second Lagrangian multiplier λ RDO and the quantization parameter QP i input from the quantization parameter calculation unit 102 to determine the optimal encoding mode that minimizes the cost function J. The optimal encoding mode is a combination of encoding tools and parameters (such as DC prediction mode for intra prediction). Then, the RD optimization section 103 outputs the determined optimal encoding mode to the encoded data storage/output section 21 of the encoding device 1. Note that r i used in RD optimization is different from the block rate r i calculated by bit allocation section 101. In RD optimization, encoding is performed in all modes, and the combination of d i and r i obtained for each mode is assigned to the cost function J=d iRDO・r i to find the mode in which J is the minimum. select.

(ビット割当処理の第1の変形例)
ビット割当部101と量子化パラメータ算出部102によって、ブロックレートrと量子化パラメータQPは一意に定まるが、実際に符号化した時に想定どおりのビットレートになるとは限らない。そこで、フレームに割り当てられた実際のビットレートRから大きく外れるようなことがないように、ブロック単位で割当ビット量の修正を行ってもよい。つまり、第1の変形例では、ビット割当部101は、ブロック単位の符号化が完了するごとに、フレーム内の未符号化ブロック全体に割り当てられたビットレートRと第1RD曲線のパラメータとを用いて、第1ラグランジュ乗数λOBA及びブロックレートrを算出する。
(First modification of bit allocation processing)
Although the block rate r i and the quantization parameter QP i are uniquely determined by the bit allocation section 101 and the quantization parameter calculation section 102, the expected bit rate is not necessarily obtained when actually encoding. Therefore, the amount of allocated bits may be modified on a block-by-block basis so that the actual bit rate Rt allocated to the frame does not deviate significantly. In other words, in the first modification, the bit allocation unit 101 calculates the bit rate R j allocated to all unencoded blocks in a frame and the parameters of the first RD curve every time encoding of each block is completed. is used to calculate the first Lagrangian multiplier λ OBA and the block rate r i .

具体的には、i番目のブロックで消費したビットをbとすると、j番目までのブロックに対する符号化が終わった時、フレーム内の未符号化ブロック全体に割り当てられたビットレートRは式(17)で表される。そこで、ビット割当部101は、ブロックレートr(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 bit allocation unit 101 corrects the block rate r i (j<i≦M) using equation (18).

Figure 2024022374000017
Figure 2024022374000017

(ビット割当処理の第2の変形例)
第1の変形例によりブロック単位でブロックレートrを制御すると、フレーム全体の画質が劣化する場合がある。そこで、フレーム全体の画質を考慮し、必要に応じて第1の変形例による修正を行うようにしてもよい。つまり、第2の変形例では、ビット割当部101は、符号化済みブロックのビットレートRactualと想定していたビットレートRidealとの差が閾値を超えた場合に、フレーム内の未符号化ブロック全体に割り当てられたビットレートRと第1RD曲線のパラメータとを用いて、第1ラグランジュ乗数λOBA及びブロックレートrを算出する。
(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 bit allocation unit 101 assigns A first Lagrangian multiplier λ OBA and a block rate r i are calculated using the bit rate R j assigned to the entire block and the parameters of the first RD curve.

具体的には、j番目までに実際に消費したビットレートRactualが想定していたビットレートRidealからどれだけ乖離したかを基準にして制御を行う。ビット割当部101は、式(19)より、j番目までに消費されるビットレートの想定値Ridealを算出し、式(20)に示すように、乖離度合いSを(Ractual-Rideal)/Ridealの絶対値よって算出する。ビット割当部101は、ブロック符号化ごとに乖離度合いSと閾値sとを比較し、S>sとなるブロックでのみ式(18)で示したブロックレートrに修正することで、余分な制御は行わないようにすることができる。閾値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 bit allocation unit 101 calculates the expected value R ideal of the bit rate consumed up to the jth bit rate from Equation (19), and calculates the degree of deviation S by (R actual - R ideal ) as shown in Equation (20). Calculated by the absolute value of /R ideal . The bit allocation unit 101 compares the deviation degree S and the threshold value s for each block encoding, and corrects the block rate r i shown in equation (18) only for blocks where S>s, thereby eliminating unnecessary control. You can prevent it from happening. The threshold value s can be set arbitrarily, for example, s=0.1.

Figure 2024022374000018
Figure 2024022374000018

(復号装置)
次に、本発明の一実施形態に係る復号装置について説明する。図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 decoding device 2 shown in FIG. 3 includes an entropy decoding section 31, an inverse quantization section 32, an inverse transformation section 33, an addition section 34, a storage section 35, and a prediction section 36.

復号装置2は、符号化装置1から、量子化パラメータ算出部102によって算出された量子化パラメータQPを取得し、該量子化パラメータQPを用いて、符号化装置1により符号化された符号化データを復号する。 The decoding device 2 acquires the quantization parameter QP i calculated by the quantization parameter calculation unit 102 from the encoding device 1, and uses the quantization parameter QP i to generate the code encoded by the encoding device 1. decrypt the encoded data.

エントロピー復号部31は、符号化装置1が出力する符号化データを復号し、量子化パラメータQP、量子化係数、及び予測パラメータ(イントラ予測モード及び動きベクトル情報)を取得する。そして、エントロピー復号部31は、量子化パラメータQP及び量子化係数を逆量子化部32に出力し、予測パラメータを予測部36に出力する。 The entropy decoding unit 31 decodes the encoded data output by the encoding device 1 and obtains the quantization parameter QP i , the quantization coefficient, and the prediction parameter (intra prediction mode and motion vector information). Then, the entropy decoding unit 31 outputs the quantization parameter QP i and the quantization coefficient to the inverse quantization unit 32, and outputs the prediction parameter to the prediction unit 36.

逆量子化部32は、エントロピー復号部31から量子化係数及び量子化パラメータQPを入力し、量子化係数に量子化パラメータQPから導出される量子化ステップを乗算してブロックごとの直交変換係数を復元し、逆変換部33に出力する。 The inverse quantization unit 32 inputs the quantization coefficient and the quantization parameter QP i from the entropy decoding unit 31, multiplies the quantization coefficient by the quantization step derived from the quantization parameter QP i , and performs orthogonal transformation for each block. The coefficients are restored and output to the inverse transform section 33.

逆変換部33は、逆量子化部32から入力した直交変換係数に対して逆変換を行って残差画像を生成し、加算部34に出力する。 The inverse transformer 33 performs inverse transform on the orthogonal transform coefficients input from the inverse quantizer 32 to generate a residual image, and outputs it to the adder 34 .

加算部34は、逆変換部33から入力した残差画像と、予測部36から入力した予測画像の各画素値を加算して復号画像を生成し、記憶部35及び復号装置2の外部に出力する。 The addition unit 34 adds each pixel value of the residual image input from the inverse transformation unit 33 and the predicted image input from the prediction unit 36 to generate a decoded image, and outputs the decoded image to the storage unit 35 and the outside of the decoding device 2. do.

復号装置2は、符号化装置1と同様に、加算部34が出力する復号画像に対してデブロッキングフィルタによるフィルタ処理などの後処理を行ってから、記憶部35に出力してもよい。 Similar to the encoding device 1, the decoding device 2 may perform post-processing such as filter processing using a deblocking filter on the decoded image output by the addition section 34, and then output the image to the storage section 35.

記憶部35は、加算部34から入力した復号画像を記憶する。 The storage unit 35 stores the decoded image input from the addition unit 34.

予測部36は、イントラ予測(画面内予測)、又はインター予測(画面間予測、動き補償予測)を行う。イントラ予測では、記憶部35に記憶された復号画像に対して、エントロピー復号部31から入力したイントラ予測モードに従ってイントラ予測したイントラ予測画像を生成する。インター予測では、記憶部35に記憶された復号画像に対して、エントロピー復号部31から入力した動きベクトル情報に従って動き補償予測した動き補償予測画像を生成する。予測部36は、イントラ予測画像と動き補償予測画像とを切替えて予測ブロック画像とし、加算部34に出力する。 The prediction unit 36 performs intra prediction (intra-screen prediction) or inter prediction (inter-screen prediction, motion compensation prediction). In the intra prediction, an intra prediction image is generated by performing intra prediction on the decoded image stored in the storage unit 35 according to the intra prediction mode input from the entropy decoding unit 31. In inter prediction, a motion-compensated predicted image is generated by performing motion-compensated prediction on the decoded image stored in the storage unit 35 according to motion vector information input from the entropy decoding unit 31. The prediction unit 36 switches between the intra predicted image and the motion compensated predicted image to form a predicted block image, and outputs the predicted block image to the addition unit 34 .

このように、本発明は、符号化・復号方式を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 decoding device 2, it is also possible to use a computer that can execute program instructions, respectively. Here, the computer may be a general-purpose computer, a dedicated computer, a workstation, a PC (Personal Computer), an electronic notepad, or the like. Program instructions may be program code, code segments, etc. to perform necessary tasks.

コンピュータは、プロセッサと、記憶部と、入力部と、出力部と、通信インターフェースとを備える。プロセッサは、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ラグランジュ乗数及びブロックレートrを算出するステップと、ブロックレートrと第2RD曲線のパラメータとから算出される第2ラグランジュ乗数を用いて、コスト関数を最小化する符号化モードを決定するステップと、第2ラグランジュ乗数に基づいて、ブロックごとの量子化パラメータQPを算出するステップと、をコンピュータに実行させ、第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によって算出された量子化パラメータQPを取得するステップと、該量子化パラメータQPを用いて、符号化装置1により符号化されたデータを復号するステップと、をコンピュータに実行させる。 Further, the program for causing a computer to function as the decoding device 2 described above includes the steps of acquiring the quantization parameter QP i calculated by the quantization parameter calculation unit 102 from the encoding device 1, and the step of acquiring the quantization parameter QP i calculated by the quantization parameter calculation unit 102 The computer is caused to perform the step of decoding the data encoded by the encoding device 1 using the encoder.

上述の実施形態は代表的な例として説明したが、本発明の趣旨及び範囲内で、多くの変更及び置換ができることは当業者に明らかである。したがって、本発明は、上述の実施形態によって制限するものと解するべきではなく、特許請求の範囲から逸脱することなく、種々の変形又は変更が可能である。例えば、実施形態の構成図に記載の複数の構成ブロックを統合したり、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 Encoding device 2 Decoding device 10 Rate control unit 11 Block division unit 12 Subtraction unit 13 Transformation unit 14 Quantization unit 15 Inverse quantization unit 16 Inverse transformation unit 17 Addition unit 18 Storage unit 19 Prediction unit 20 Entropy encoding unit 21 Code data storage/output unit 31 entropy decoding unit 32 inverse quantization unit 33 inverse transformation unit 34 addition unit 35 storage unit 36 prediction unit 101 bit allocation unit 102 quantization parameter calculation unit 103 RD optimization unit

Claims (6)

映像フレームを符号化対象領域に分割してブロックごとに符号化を行い、ビットレートと符号化歪みの関係を近似するRD曲線を用いてRD最適化処理を行う符号化装置であって、
前記映像フレームに割り当てられたビットレートと第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.
前記ビット割当部は、ブロック単位の符号化が完了するごとに、前記映像フレーム内の未符号化ブロック全体に割り当てられたビットレートと前記第1RD曲線のパラメータとを用いて、前記第1ラグランジュ乗数及び前記ブロックごとの割当ビットレートを算出する、請求項1に記載の符号化装置。 The bit allocation unit calculates the first Lagrangian multiplier using the bit rate allocated to the entire uncoded block in the video frame and the parameters of the first RD curve each time encoding of each block is completed. The encoding device according to claim 1, wherein the encoding device calculates an allocated bit rate for each block. 前記ビット割当部は、符号化済みブロックのビットレートと想定していたビットレートとの差が閾値を超えた場合に、前記映像フレーム内の未符号化ブロック全体に割り当てられたビットレートと第1RD曲線のパラメータとを用いて、前記第1ラグランジュ乗数及び前記ブロックごとの割当ビットレートを算出する、請求項1に記載の符号化装置。 When the difference between the bit rate of the encoded block and the expected bit rate exceeds a threshold, the bit allocation unit divides the bit rate allocated to the entire unencoded blocks in the video frame and the first RD. The encoding device according to claim 1, wherein the first Lagrangian multiplier and the allocated bit rate for each block are calculated using curve parameters. 請求項1から3のいずれか一項に記載の符号化装置の前記量子化パラメータ算出部によって算出された前記量子化パラメータを取得し、
該量子化パラメータを用いて、前記符号化装置により符号化されたデータを復号する、復号装置。
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.
コンピュータを、請求項1に記載の符号化装置として機能させるためのプログラム。 A program for causing a computer to function as the encoding device according to claim 1. コンピュータを、請求項4に記載の復号装置として機能させるためのプログラム。 A program for causing a computer to function as the decoding device according to claim 4.
JP2022125917A 2022-08-05 2022-08-05 Encoding device, decoding device, and program Pending JP2024022374A (en)

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)

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