Method and system for determining parameters of coding tree unit

文档序号:196266 发布日期:2021-11-02 浏览:27次 中文

阅读说明:本技术 一种编码树单元的参数确定方法及系统 (Method and system for determining parameters of coding tree unit ) 是由 郭红伟 刘婷 于 2021-08-20 设计创作,主要内容包括:本发明提供了一种编码树单元的参数确定方法及系统,方法包括:确定对当前待编码视频帧进行编码时的多个编码树单元;将每个编码树单元分别划分为多个像素块;分别获取每个像素块的编码失真和运动补偿预测误差;根据编码失真和运动补偿预测误差,利用反向传播算法确定每个像素块的时域传播因子;根据时域传播因子和每个编码树单元划分的像素块数量,确定每个编码树单元的权重系数;根据权重系数,确定每个编码树单元的参数;编码树单元的参数包括量化参数和拉格朗日乘子。本发明基于失真反向传播算法确定编码树单元的参数,使编码时无需缓存后续未编码帧,减小视频编码时压缩的内存以提升视频编码率失真性能。(The invention provides a method and a system for determining parameters of a coding tree unit, wherein the method comprises the following steps: determining a plurality of coding tree units when a current video frame to be coded is coded; dividing each coding tree unit into a plurality of pixel blocks respectively; respectively acquiring coding distortion and motion compensation prediction error of each pixel block; determining a time domain propagation factor of each pixel block by using a back propagation algorithm according to coding distortion and a motion compensation prediction error; determining a weight coefficient of each coding tree unit according to the time domain propagation factor and the number of pixel blocks divided by each coding tree unit; determining the parameters of each coding tree unit according to the weight coefficients; the parameters of the coding tree unit include quantization parameters and lagrangian multipliers. The invention determines the parameters of the coding tree unit based on the distortion back propagation algorithm, so that the subsequent uncoded frames do not need to be cached during coding, and the compressed memory during video coding is reduced to improve the distortion performance of the video coding rate.)

1. A method for determining parameters of a coding tree unit, the method comprising:

determining a plurality of coding tree units when a current video frame to be coded is coded;

dividing each coding tree unit into a plurality of pixel blocks respectively;

respectively acquiring coding distortion and motion compensation prediction error of each pixel block;

determining a time domain propagation factor of each pixel block by using a back propagation algorithm according to coding distortion and a motion compensation prediction error;

determining a weight coefficient of each coding tree unit according to the time domain propagation factor and the number of pixel blocks divided by each coding tree unit;

determining the parameters of each coding tree unit according to the weight coefficients; the parameters of the coding tree unit comprise quantization parameters and Lagrange multipliers.

2. The method of claim 1, wherein prior to said determining the plurality of coding tree units when encoding the current video frame to be encoded, further comprising:

dividing a video to be coded into a plurality of video frames to be coded;

and determining any video frame to be coded as the current video frame to be coded.

3. The method of claim 1, wherein each of said plurality of pixel blocks is a 16x16 pixel block.

4. The method of claim 1, wherein the time-domain propagation factor is calculated by the following formula:

wherein k isjThe time domain propagation factor of the jth pixel block in the ith coding tree unit; dt、Dt-1And Dt-2Coding distortion of a jth pixel block in an ith coding tree unit in the tth video frame, the tth video frame and the tth video frame respectively;andthe motion compensated prediction error for the jth pixel block in the ith coding tree unit in the tth, tth-1 and tth-2 video frames, respectively.

5. The method of claim 4, wherein the formula of the weighting factor of the coding tree unit is:

wherein, WiThe weight coefficient of the ith coding tree unit in the current video frame to be coded; l isiAnd the number of pixel blocks divided for the ith coding tree unit in the current video frame to be coded.

6. The method according to claim 5, wherein the determining the parameters of each coding tree unit according to the weight coefficients specifically comprises:

using a formula based on the weight coefficientDetermining a Lagrange multiplier for each coding tree unit;

according to the Lagrange multiplier, using formula QPi=α·ln(λi) + β, determining a quantization parameter for each coding tree unit;

wherein λ isiFor the lagrange multiplier of the ith coding tree unit in the current video frame to be coded,to be adjusted afterThe weighting coefficient of the ith coding tree unit in the current video frame to be coded,m is the number of coding tree units in the current video frame to be coded; lambda [ alpha ]PA frame-level Lagrange multiplier set in an encoder; QPiAnd alpha and beta are fitting constants of quantization parameters of the ith coding tree unit in the current video frame to be coded.

7. The method of claim 1, further comprising, after determining the parameters of each coding tree unit according to the weighting coefficients:

and coding each coding tree unit in the current video frame to be coded according to the quantization parameter and the Lagrange multiplier.

8. A system for determining parameters of a coding tree unit, the system comprising:

the encoding tree unit determining module is used for determining a plurality of encoding tree units when the current video frame to be encoded is encoded;

the pixel block dividing module is used for dividing each coding tree unit into a plurality of pixel blocks;

the data acquisition module is used for respectively acquiring coding distortion and motion compensation prediction error of each pixel block;

the time domain propagation factor determining module is used for determining the time domain propagation factor of each pixel block by utilizing a back propagation algorithm according to the coding distortion and the motion compensation prediction error;

the weight coefficient determining module is used for determining the weight coefficient of each coding tree unit according to the time domain propagation factor and the number of pixel blocks divided by each coding tree unit;

the parameter determining module is used for determining the parameter of each coding tree unit according to the weight coefficient; the parameters of the coding tree unit comprise quantization parameters and Lagrange multipliers.

9. The system for determining parameters of a coding tree unit according to claim 8, further comprising:

the video frame dividing module to be coded is used for dividing the video to be coded into a plurality of video frames to be coded;

and the current video frame to be coded determining module is used for determining any video frame to be coded as the current video frame to be coded.

10. The system of claim 8, wherein each of said plurality of pixel blocks is a 16x16 pixel block.

Technical Field

The present invention relates to the field of video coding, and in particular, to a method and a system for determining parameters of a coding tree unit.

Background

With the development of internet and multimedia information processing technology, the amount of digital video data has increased explosively. Video data requires a large amount of storage space and network transmission bandwidth compared to audio and still image signals. In order to reduce video storage and transmission costs, the industry has introduced several video coding standards in the last 30 years, such as: advanced Video Coding (AVC), High Efficiency Video Coding (HEVC), and general Video Coding (VVC) h.266. In order to remove the redundancy and realize efficient data compression, the current video coding standard adopts a block-based hybrid coding framework which comprises modules of prediction, transformation, quantization, entropy coding and the like. In video coding, an input video sequence is hierarchically divided into a number of subtasks, such as: group of pictures (GOP), coded frame, and basic coding unit. The basic Coding Unit in h.264 is a Macroblock (MB), and the basic Coding units in HEVC and VVC are Coding Tree Units (CTUs). In video encoders of various standards, a Rate-Distortion Optimization (RDO) method based on lagrange multipliers is adopted to select an optimal encoding mode for a basic encoding unit to achieve optimal Rate-Distortion performance.

Rate-distortion theory is the theoretical basis for video coding, which gives the maximum limit to which a source can be compressed, allowing for some distortion. Accordingly, rate-distortion optimization is a very critical technique in the current hybrid video coding framework based on prediction, transform, quantization and entropy coding modules, which extends throughout the video coding system. In the test models of video coding standards h.264, HEVC and VVC, rate distortion optimization traverses all mode combinations of one basic coding unit, quantizes and entropy-encodes residual transform coefficients according to a given Quantization Parameter (QP), calculates a rate distortion cost based on a lagrange multiplier λ, and takes a mode with the minimum rate distortion cost as a current coding Parameter set. Thus, QP and λ are two parameters that are very critical in the video encoding process. The existing video encoder adopts the assumption that an encoding unit is independent, so that the rate distortion optimization method based on the Lagrange multiplier is easy to realize at an encoding end, but the independent optimization cannot enable the video encoding to achieve the optimal rate distortion performance.

Disclosure of Invention

The invention aims to provide a method and a system for determining parameters of a coding tree unit, which are used for determining the parameters of the coding tree unit based on a distortion back propagation algorithm, so that a subsequent uncoded frame is not required to be cached during coding, and a compressed memory during video coding is reduced to improve the distortion performance of a video coding rate.

In order to achieve the purpose, the invention provides the following scheme:

a method for determining parameters of a coding tree unit, comprising:

determining a plurality of coding tree units when a current video frame to be coded is coded;

dividing each coding tree unit into a plurality of pixel blocks respectively;

respectively acquiring coding distortion and motion compensation prediction error of each pixel block;

determining a time domain propagation factor of each pixel block by using a back propagation algorithm according to coding distortion and a motion compensation prediction error;

determining a weight coefficient of each coding tree unit according to the time domain propagation factor and the number of pixel blocks divided by each coding tree unit;

determining the parameters of each coding tree unit according to the weight coefficients; the parameters of the coding tree unit comprise quantization parameters and Lagrange multipliers.

Optionally, before the determining a plurality of coding tree units when the current video frame to be coded is coded, the method further includes:

dividing a video to be coded into a plurality of video frames to be coded;

and determining any video frame to be coded as the current video frame to be coded.

Optionally, a plurality of the pixel blocks are 16 × 16 pixel blocks.

Optionally, the calculation formula of the time domain propagation factor is:

wherein k isjThe time domain propagation factor of the jth pixel block in the ith coding tree unit; dt、Dt-1And Dt-2Coding distortion of a jth pixel block in an ith coding tree unit in the tth video frame, the tth video frame and the tth video frame respectively;andthe motion compensated prediction error for the jth pixel block in the ith coding tree unit in the tth, tth-1 and tth-2 video frames, respectively.

Optionally, the formula of the weight coefficient of the coding tree unit is:

wherein, WiThe weight coefficient of the ith coding tree unit in the current video frame to be coded; l isiAnd the number of pixel blocks divided for the ith coding tree unit in the current video frame to be coded.

Optionally, the determining the parameter of each coding tree unit according to the weight coefficient specifically includes:

using a formula based on the weight coefficientDetermining a Lagrange multiplier for each coding tree unit;

according to the Lagrange multiplier, using formula QPi=α·ln(λi) + beta, determining each coding tree entryA quantization parameter for the element;

wherein λ isiFor the lagrange multiplier of the ith coding tree unit in the current video frame to be coded,for the adjusted weight coefficient of the ith coding tree unit in the current video frame to be coded,m is the number of coding tree units in the current video frame to be coded; lambda [ alpha ]PA frame-level Lagrange multiplier set in an encoder; QPiAnd alpha and beta are fitting constants of quantization parameters of the ith coding tree unit in the current video frame to be coded.

Optionally, after determining the parameters of each coding tree unit according to the weight coefficients, the method further includes:

and coding each coding tree unit in the current video frame to be coded according to the quantization parameter and the Lagrange multiplier.

A system for determining parameters of a coding tree unit, comprising:

the encoding tree unit determining module is used for determining a plurality of encoding tree units when the current video frame to be encoded is encoded;

the pixel block dividing module is used for dividing each coding tree unit into a plurality of pixel blocks;

the data acquisition module is used for respectively acquiring coding distortion and motion compensation prediction error of each pixel block;

the time domain propagation factor determining module is used for determining the time domain propagation factor of each pixel block by utilizing a back propagation algorithm according to the coding distortion and the motion compensation prediction error;

the weight coefficient determining module is used for determining the weight coefficient of each coding tree unit according to the time domain propagation factor and the number of pixel blocks divided by each coding tree unit;

the parameter determining module is used for determining the parameter of each coding tree unit according to the weight coefficient; the parameters of the coding tree unit comprise quantization parameters and Lagrange multipliers.

Optionally, the system further includes:

the video frame dividing module to be coded is used for dividing the video to be coded into a plurality of video frames to be coded;

and the current video frame to be coded determining module is used for determining any video frame to be coded as the current video frame to be coded.

Optionally, a plurality of the pixel blocks are 16 × 16 pixel blocks.

According to the specific embodiment provided by the invention, the invention discloses the following technical effects:

the invention provides a method and a system for determining parameters of a coding tree unit, wherein the method comprises the following steps: determining a plurality of coding tree units when a current video frame to be coded is coded; dividing each coding tree unit into a plurality of pixel blocks respectively; respectively acquiring coding distortion and motion compensation prediction error of each pixel block; determining a time domain propagation factor of each pixel block by using a back propagation algorithm according to coding distortion and a motion compensation prediction error; determining a weight coefficient of each coding tree unit according to the time domain propagation factor and the number of pixel blocks divided by each coding tree unit; determining the parameters of each coding tree unit according to the weight coefficients; the parameters of the coding tree unit include quantization parameters and lagrangian multipliers. The invention determines the parameters of the coding tree unit based on the distortion back propagation algorithm, so that the subsequent uncoded frames do not need to be cached during coding, and the compressed memory during video coding is reduced to improve the distortion performance of the video coding rate.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.

FIG. 1 is a flow chart of a method for determining parameters of a coding tree unit according to an embodiment of the present invention;

FIG. 2 is a graph comparing rate-distortion curves of a test sequence BasketbalDrill under the configurations of LDB and LDP encoders in the embodiment of the present invention; FIG. 2(a) is a graph comparing the rate-distortion curves of the test sequence BasketbalDrill in the LDB encoder configuration according to the embodiment of the present invention; FIG. 2(b) is a graph comparing the rate-distortion curves of the test sequence BasketbalDrill in the LDP encoder configuration according to the embodiment of the present invention;

FIG. 3 is a graph comparing rate-distortion curves of a test sequence FourPelle in LDB and LDP encoder configurations in accordance with an embodiment of the present invention; FIG. 3(a) is a graph comparing rate-distortion curves of a test sequence FourPelle in an LDB encoder configuration according to an embodiment of the present invention; FIG. 3(b) is a graph comparing rate-distortion curves of a test sequence FourPeople in an LDP encoder configuration according to an embodiment of the present invention;

fig. 4 is a schematic structural diagram of a system for determining parameters of a coding tree unit according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The invention aims to provide a method and a system for determining parameters of a coding tree unit, which are used for determining the parameters of the coding tree unit based on a distortion back propagation algorithm, so that a subsequent uncoded frame is not required to be cached during coding, and a compressed memory during video coding is reduced to improve the distortion performance of a video coding rate.

In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.

FIG. 1 is a flow chart of a method for determining parameters of a coding tree unit according to an embodiment of the present invention; as shown in fig. 1, the present invention provides a method for determining parameters of a coding tree unit, including:

step 101: determining a plurality of coding tree units when a current video frame to be coded is coded;

step 102: dividing each coding tree unit into a plurality of pixel blocks respectively;

step 103: respectively acquiring coding distortion and motion compensation prediction error of each pixel block;

step 104: determining a time domain propagation factor of each pixel block by using a back propagation algorithm according to coding distortion and a motion compensation prediction error;

step 105: determining a weight coefficient of each coding tree unit according to the time domain propagation factor and the number of pixel blocks divided by each coding tree unit;

step 106: determining the parameters of each coding tree unit according to the weight coefficients; the parameters of the coding tree unit include quantization parameters and lagrangian multipliers.

Before step 101, further comprising:

dividing a video to be coded into a plurality of video frames to be coded;

and determining any video frame to be coded as the current video frame to be coded.

Wherein, the pixel blocks are all 16x16 pixel blocks.

The time domain propagation factor is calculated by the formula:

wherein k isjThe time domain propagation factor of the jth pixel block in the ith coding tree unit; dt、Dt-1And Dt-2Coding distortion of a jth pixel block in an ith coding tree unit in the tth video frame, the tth video frame and the tth video frame respectively;andin the tth, t-1 and t-2 video frames respectivelyMotion compensated prediction error for the jth pixel block in the ith coding tree unit. Specifically, the tth video frame is a video frame to be encoded; the t-1 th and t-2 nd encoded video frames.

The formula of the weight coefficient of the coding tree unit is:

wherein, WiThe weight coefficient of the ith coding tree unit in the current video frame to be coded; l isiAnd the number of pixel blocks divided for the ith coding tree unit in the current video frame to be coded.

Step 106, specifically comprising:

using a formula based on the weight coefficientDetermining a Lagrange multiplier for each coding tree unit;

according to the Lagrange multiplier, using the formula QPi=α·ln(λi) + β, determining a quantization parameter for each coding tree unit;

wherein λ isiFor the lagrange multiplier of the ith coding tree unit in the current video frame to be coded,for the adjusted weight coefficient of the ith coding tree unit in the current video frame to be coded,m is the number of coding tree units in the current video frame to be coded; lambda [ alpha ]PA frame-level Lagrange multiplier set in an encoder; QPiAnd alpha and beta are fitting constants of quantization parameters of the ith coding tree unit in the current video frame to be coded.

After step 106, further comprising:

and coding each coding tree unit in the current video frame to be coded according to the quantization parameter and the Lagrange multiplier.

Specifically, the embodiment of the invention adopts a Visual Studio 2019 as a development environment, and is realized based on HEVC reference software HM 16.7. The Lagrange multiplier and quantization parameter determination method of the coding tree unit comprises the following specific implementation steps:

step 1: the method comprises the steps of pre-coding a frame to be coded by only detecting three inter-frame modes of 64 × 64, 32 × 32 and 16 × 16 by adopting the original fixed QP setting of HEVC, and recording coding distortion and motion compensation prediction errors after pre-coding. Then, the temporal propagation factor of a 16 × 16 pixel block in the frame to be encoded is obtained by the following formula.

Step 2: and calculating the Lagrange multiplier weight coefficient of the ith CTU by the following formula.

In general, LiEqual to 16, but the number of 16x16 blocks of pixels contained in the right and lower boundaries CTU of the image may be less than 16. .

Step 3: and recalculating the Lagrange multiplier weight coefficient of the adjusted ith CTU by the following formula.

Then, an adaptive lagrange multiplier and quantization parameters for encoding the ith CTU in the current frame are determined according to the following formulas.

QPi=α·ln(λi)+β,i=1,2,…,M

In this embodiment, the values of α and β are 4.2005 and 13.7122, respectively.

Step 4: lagrange multiplier lambda determined using the above stepsiAnd quantization parameter QPiAnd coding each coding tree unit in the current frame.

The bitstream generated by the coding of the invention conforms to the syntax format of the HEVC standard, and the generated bitstreams can be decoded by a standard HEVC decoder. Coding experiments are carried out according to the HEVC general test conditions, two encoder configurations of a Low-Delay B frame (LDB) and a Low-Delay P frame (LDP) are tested, and all 20 YUV sequences in ClassB, ClassC, ClassD, ClassE and ClassF suggested by the HEVC general test conditions are adopted for a test video sequence. The invention is a schematic diagram for saving code rate compared with the original HEVC encoder HM16.7, and (1)Delta bit-rate, BD-rate) which indicates the percentage of code rate saving of the test method relative to the reference encoder under the same objective quality, positive values indicate rate distortion performance loss, and negative values indicate rate distortion performance improvement. The rate saving rate of an encoder using the parameter determination method of the coding tree unit of the present invention in LDB coding configuration with respect to the original HEVC encoder HM16.7 is shown in table 1:

table 1 encoder of the present application BD-rate relative to the original HEVC encoder HM16.7 in LDB coding configuration

In the table, BasketballDrill et al is the YUV sequence video name.

The rate saving rate of an encoder using the parameter determination method of the coding tree unit of the present invention in LDP coding configuration with respect to the original HEVC encoder HM16.7 is shown in table 2:

table 2 encoder of the present application BD-rate relative to the original HEVC encoder hml6.7 in LDP coding configuration

From tables 1-2, it can be seen that the Y, U and V components of the present invention achieve average code rate savings of 4.4%, 4.6%, and 2.5% respectively under LDB encoder configuration; according to the invention, under the LDP encoder configuration, average code rate savings of 4.3%, 4.1% and 2.1% are respectively obtained for Y, U and V components.

FIG. 2 is a graph comparing rate-distortion curves of a test sequence BasketbalDrill under the configurations of LDB and LDP encoders in the embodiment of the present invention; FIG. 2(a) is a graph comparing the rate-distortion curves of the test sequence BasketbalDrill in the LDB encoder configuration according to the embodiment of the present invention; FIG. 2(b) is a graph comparing the rate-distortion curves of the test sequence BasketbalDrill in the LDP encoder configuration according to the embodiment of the present invention; FIG. 3 is a graph comparing rate-distortion curves of a test sequence FourPelle in LDB and LDP encoder configurations in accordance with an embodiment of the present invention; FIG. 3(a) is a graph comparing rate-distortion curves of a test sequence FourPelle in an LDB encoder configuration according to an embodiment of the present invention; FIG. 3(b) is a graph comparing the rate-distortion curves of the test sequence FourPeople in the LDP encoder configuration according to the embodiment of the present invention. In FIGS. 2-3, the abscissa bitrate is the code rate in kbps; the ordinate Y-PSNR is the peak signal-to-noise ratio of the video brightness component, and the unit is dB; as shown in fig. 2-3, the video coding quality of the method of the present invention is better than that of the original HEVC encoder HM16.7 at the same output bitrate.

Fig. 4 is a schematic structural diagram of a system for determining parameters of a coding tree unit according to an embodiment of the present invention. As shown in fig. 4, the present invention further provides a system for determining parameters of a coding tree unit, including:

a coding tree unit determining module 601, configured to determine multiple coding tree units when a current video frame to be coded is coded;

a pixel block dividing module 602, configured to divide each coding tree unit into a plurality of pixel blocks;

a data obtaining module 603, configured to obtain coding distortion and motion compensated prediction error of each pixel block respectively;

a time domain propagation factor determining module 604, configured to determine a time domain propagation factor of each pixel block by using a back propagation algorithm according to the coding distortion and the motion compensated prediction error;

a weight coefficient determining module 605, configured to determine a weight coefficient of each coding tree unit according to the time domain propagation factor and the number of pixel blocks divided by each coding tree unit;

a parameter determining module 606, configured to determine a parameter of each coding tree unit according to the weight coefficient; the parameters of the coding tree unit include quantization parameters and lagrangian multipliers.

The parameter determination system of the coding tree unit provided by the invention also comprises:

the video frame dividing module to be coded is used for dividing the video to be coded into a plurality of video frames to be coded;

and the current video frame to be coded determining module is used for determining any video frame to be coded as the current video frame to be coded.

Specifically, the plurality of pixel blocks are 16 × 16 pixel blocks.

The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.

The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用于实时控制具有多个流的远程视频制作的系统及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类