A method and system for coding unit level lagrange multiplier adjustment

By adjusting the Lagrange multipliers at the coding unit level, calculating the temporal distortion propagation factor and weights, and optimizing the coding mode, the problem that the CTU-level method fails to fully utilize the rate distortion dependency difference is solved, thus improving the compression performance of the video encoder.

CN116456104BActive Publication Date: 2026-04-17HONGHE UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONGHE UNIVERSITY
Filing Date
2023-04-24
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing CTU-level adaptive Lagrange multiplier selection methods fail to fully utilize the rate-distortion dependency differences in different regions within the coding unit in VVC encoders, thus limiting the improvement of compression performance of video encoders.

Method used

By adjusting the Lagrange multipliers at the coding unit level, the temporal distortion propagation factor and Lagrange weight of the pixel block are calculated. Based on these factors and weights, the Lagrange multipliers at the coding unit level are calculated to determine the final coding mode, including Skip mode, Merge mode, AMVP mode and intra-frame prediction mode, thereby optimizing the coding process of the coding tree unit.

Benefits of technology

The compression performance of the video encoder has been improved, and more efficient video compression has been achieved by making better use of the rate-distortion dependency differences within the coding unit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116456104B_ABST
    Figure CN116456104B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for adjusting Lagrange multipliers at the coding unit level, relating to the field of video coding. The method includes dividing each coding tree unit in the frame to be coded into coding units; calculating the coding unit-level Lagrange multiplier of the coding unit based on the Lagrange weights of the pixel blocks corresponding to the coding unit; calculating the rate-distortion cost in each prediction mode using the coding unit-level Lagrange multiplier; determining the final coding mode of the coding tree unit based on the rate-distortion cost; and encoding the coding tree unit using the final coding mode. This invention determines the final coding mode by using the coding unit-level Lagrange multiplier and the rate-distortion cost of the coding units within the coding tree unit, fully utilizing the rate-distortion dependency differences of the coding units for coding optimization, thereby improving video compression performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video coding technology, and in particular to a method and system for adjusting Lagrange multipliers at the coding unit level. Background Technology

[0002] With the continuous development of video technology, people have increasingly higher requirements for video quality and transmission speed. Video encoding plays a crucial role in video transmission. Video encoding is the process of compressing and converting the original video signal, aiming to reduce the bandwidth and storage space required for transmission and storage. In video encoding, the Lagrange multiplier is a very important parameter, used to balance the output bitrate and the quality of the reconstructed compressed video. A smaller Lagrange multiplier results in a higher bitrate and better video reconstruction quality. Conversely, a larger Lagrange multiplier results in a lower bitrate and poorer video reconstruction quality.

[0003] To improve encoder compression performance by leveraging rate-distortion dependencies in video coding, some researchers have proposed a CTU-level adaptive Lagrange multiplier selection method for HEVC encoders. The underlying idea of ​​this method can also be applied to the latest VVC encoders. However, the CTU-level adaptive Lagrange multiplier selection method optimizes encoding on a per-CTU basis, limiting the potential for improved compression performance. In particular, for VVC encoders using larger CTUs, the CTU-level adaptive Lagrange multiplier selection method cannot effectively utilize rate-distortion dependencies for encoding optimization. Therefore, a method is urgently needed that can fully utilize the differences in rate-distortion dependencies across different regions within the CTU for encoding optimization and to improve the compression performance of video encoders. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for adjusting Lagrange multipliers at the coding unit level, which can improve video compression performance.

[0005] To achieve the above objectives, the present invention provides the following solution:

[0006] A method for adjusting Lagrange multipliers at the coding unit level, the method comprising:

[0007] For each frame of the video to be encoded, perform the following steps:

[0008] Determine the initial quantization parameters and frame-level Lagrange multipliers of the frame to be encoded; predict the reconstruction distortion and motion compensation prediction error of each pixel block in the frame to be encoded based on the initial quantization parameters and frame-level Lagrange multipliers.

[0009] For each pixel block in the frame to be encoded, the temporal distortion propagation factor of the pixel block is calculated based on the reconstruction distortion and motion compensation prediction error of the pixel block; the temporal distortion propagation factor characterizes the degree of influence of the encoding distortion of the pixel block on the encoding distortion of subsequent frames;

[0010] The Lagrange weight of each pixel block in the frame to be encoded is calculated based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded; the Lagrange weight represents the relative insignificance of the encoding quality of the pixel block in the frame to be encoded.

[0011] For each coding tree unit in the frame to be encoded, the coding tree unit is divided to obtain one first coding unit or multiple second coding units; the coding unit-level Lagrange multiplier of the first coding unit is calculated based on the Lagrange weights of the pixel blocks corresponding to the first coding unit; the first rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the first coding unit; the first optimal prediction mode of the coding tree unit is determined based on all the first rate-distortion costs; for each second coding unit, the coding unit-level Lagrange multiplier of the second coding unit is calculated based on the Lagrange weights of the pixel blocks corresponding to the second coding unit, and the second rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the second coding unit; the second optimal prediction mode of the coding tree unit is determined based on all the second rate-distortion costs; the final coding mode of the coding tree unit is determined based on the second rate-distortion cost corresponding to the second optimal prediction mode and the first rate-distortion cost corresponding to the first optimal prediction mode, and the coding tree unit is encoded using the final coding mode; the prediction modes include Skip mode, Merge mode, AMVP mode, and intra-frame prediction mode.

[0012] Optionally, dividing the coding tree unit to obtain one first coding unit or multiple second coding units specifically includes:

[0013] The coding tree unit is divided according to a first partitioning method to obtain a first coding unit; the size of the first coding unit is equal to the size of the coding tree unit.

[0014] The coding tree unit is divided using a second partitioning method to obtain multiple second coding units; the size of the second coding unit is smaller than the size of the coding tree unit.

[0015] Optionally, the expression for the coding unit-level Lagrange multipliers of the first coding unit is:

[0016]

[0017] Where, λ CTU ω is the coding unit-level Lagrange multiplier of the first coding unit; L is the number of pixel blocks covered by the first coding unit; j λ is the Lagrangian weight of the j-th pixel block covered by the first coding unit; F It is a frame-level Lagrange multiplier.

[0018] Optionally, the step of calculating the first rate-distortion cost corresponding to each prediction mode based on the coding unit-level Lagrange multipliers of the first coding unit specifically includes:

[0019] For each prediction mode, the coding tree unit is encoded with the prediction mode to obtain the reconstruction distortion and code rate corresponding to the prediction mode; the first rate distortion cost corresponding to the prediction mode is calculated based on the reconstruction distortion and code rate corresponding to the prediction mode and the coding unit-level Lagrange multiplier of the first coding unit.

[0020] Optionally, determining the first optimal prediction mode of the coding tree unit based on all the first rate-distortion costs specifically includes:

[0021] The prediction mode corresponding to the smallest median first rate-distortion cost among all the first rate-distortion costs is taken as the first best prediction mode of the coding tree unit.

[0022] Optionally, the expression for the coding unit-level Lagrange multipliers of the second coding unit is:

[0023]

[0024] Where, λ CU ω represents the coding unit-level Lagrange multiplier of the second coding unit; N is the number of pixel blocks covered by the second coding unit; n represents the nth pixel block covered by the second coding unit; ω n The Lagrange weights of the nth pixel block covered by the second coding unit; β n It is the ratio of the nth pixel block covered by the second coding unit to be contained in the second coding unit; λ F is the frame-level Lagrange multiplier of the frame to be encoded.

[0025] Optionally, determining the second optimal prediction mode of the coding tree unit based on all the second rate-distortion costs specifically includes:

[0026] A third optimal prediction mode is determined for each of the second coding units based on all the second rate-distortion costs;

[0027] The second best prediction mode of the coding tree unit is determined based on the third best prediction mode of all the second coding units.

[0028] Optionally, the expression for the time-domain distortion propagation factor is:

[0029]

[0030] Where, p i d i and e i These are the temporal distortion propagation factor, motion compensation prediction error, and reconstruction distortion of the i-th pixel block in the frame to be encoded, respectively.

[0031] Optionally, calculating the Lagrange weight of each pixel block in the frame to be encoded based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded specifically includes:

[0032] Calculate intermediate weight variables based on the temporal distortion propagation factors of all pixel blocks in the frame to be encoded;

[0033] For each pixel block, the Lagrange weight of the pixel block is calculated based on the intermediate weight variable and the temporal distortion propagation factor of the pixel block.

[0034] The present invention also provides a Lagrange multiplier adjustment system at the coding unit level, comprising:

[0035] The parameter determination module is used to determine the initial quantization parameters and frame-level Lagrange multipliers of each frame to be encoded in the video to be encoded; and to predict the reconstruction distortion and motion compensation prediction error of each pixel block in the frame to be encoded based on the initial quantization parameters and frame-level Lagrange multipliers.

[0036] The temporal distortion propagation factor calculation module is used to calculate the temporal distortion propagation factor of each pixel block in the frame to be encoded based on the reconstruction distortion and motion compensation prediction error of the pixel block; the temporal distortion propagation factor characterizes the degree of influence of the encoding distortion of the pixel block on the encoding distortion of subsequent frames;

[0037] The Lagrange weight calculation module is used to calculate the Lagrange weight of each pixel block in the frame to be encoded based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded; the Lagrange weight represents the relative unimportance of the encoding quality of the pixel block in the frame to be encoded;

[0038] The final coding mode determination module is configured to: divide each coding tree unit in the frame to be encoded into one first coding unit or multiple second coding units; calculate the coding unit-level Lagrange multiplier of the first coding unit based on the Lagrange weights of the pixel blocks corresponding to the first coding unit; calculate the first rate-distortion cost corresponding to each prediction mode based on the coding unit-level Lagrange multipliers of the first coding unit; determine the first optimal prediction mode of the coding tree unit based on all the first rate-distortion costs; and for each second coding unit, calculate the first rate-distortion cost corresponding to the pixel blocks corresponding to the second coding unit based on the Lagrange weights of the pixel blocks corresponding to the second coding unit. The coding unit-level Lagrange multipliers of the second coding unit are recalculated, and the second rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the second coding unit. The second optimal prediction mode of the coding tree unit is determined based on all the second rate-distortion costs. The final coding mode of the coding tree unit is determined based on the second rate-distortion cost corresponding to the second optimal prediction mode and the first rate-distortion cost corresponding to the first optimal prediction mode. The coding tree unit is then encoded using the final coding mode. The prediction modes include Skip mode, Merge mode, AMVP mode, and intra-frame prediction mode.

[0039] According to specific embodiments provided by the present invention, the following technical effects are disclosed: The present invention provides a method and system for adjusting Lagrange multipliers at the coding unit level. The method includes: predicting the reconstruction distortion and motion compensation prediction error of pixel blocks based on initial quantization parameters and frame-level Lagrange multipliers; calculating the temporal distortion propagation factor of pixel blocks based on the reconstruction distortion and motion compensation prediction error; calculating the Lagrange weight of pixel blocks based on the temporal distortion propagation factor; dividing coding tree units to obtain coding units; calculating the coding unit-level Lagrange multipliers of the coding unit based on the Lagrange weights of the pixel blocks corresponding to the coding unit; calculating the rate-distortion cost in each prediction mode using the coding unit-level Lagrange multipliers of the coding unit; determining the final coding mode of the coding tree unit based on the rate-distortion cost; and encoding the coding tree unit using the final coding mode. The present invention determines the final coding mode by using the coding unit-level Lagrange multipliers and rate-distortion cost of the coding units in the coding tree unit, fully utilizing the rate-distortion dependency differences of the coding units for coding optimization, thereby improving video compression performance. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 A schematic diagram of the Lagrange multiplier adjustment method at the coding unit level provided in this embodiment of the invention;

[0042] Figure 2 A schematic diagram illustrating the bitrate savings of the method of the present invention and existing coding tree unit-level methods compared to the VVC baseline encoder under a low-latency B-frame encoding configuration provided in the embodiments of the present invention.

[0043] Figure 3 A schematic diagram illustrating the bitrate savings of the method of the present invention and existing coding tree unit-level methods compared to the VVC baseline encoder under a low-latency P-frame encoding configuration provided in the embodiments of the present invention.

[0044] Figure 4 A comparative diagram of rate-distortion curves obtained by the video encoder provided in this embodiment of the invention and the VVC benchmark encoder encoding test sequence BasketballDrill under a low-latency B-frame encoding configuration;

[0045] Figure 5 This is a schematic diagram comparing the rate-distortion curves obtained by the video encoder provided in this embodiment of the invention and the ArenaOfValor encoding test sequence of the VVC benchmark encoder under a low-latency P-frame encoding configuration. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] Video coding involves a trade-off between video quality and transmission speed. Achieving better video quality typically requires a higher bitrate, but this leads to higher transmission latency and greater bandwidth demands. Conversely, reducing transmission latency and bandwidth demands necessitates lower video quality, which impacts clarity and detail. To continuously improve video compression efficiency, since the release of the first video coding standard, MPEG-1, in the 1980s, video coding standardization organizations have successively released multiple video coding standards, including MPEG-2, MPEG-4, H.264 / AVC, H.265 / HEVC, and H.266 / VVC. Typically, each subsequent standard can reduce the bitrate by 50% compared to its predecessor while maintaining the same compressed video quality. Current video coding standards all employ a block-based hybrid video coding framework. The encoder divides a frame into many non-overlapping pixel blocks for prediction, transformation, quantization, and entropy coding operations to remove temporal, spatial, and visual redundancy in the video, minimizing the amount of data required to represent the video. In the H.264 encoder, the pixel blocks processed individually are called macroblocks, with a size of 16×16. In HEVC and VVC encoders, the pixel blocks used for individual processing are called Coding Tree Units (CTUs). The size of a CTU in HEVC is 64×64, while the size of a CTU in VVC is increased to 128×128. Based on the characteristics of the video content, CTUs are further divided into smaller units for processing, which are called Coding Units (CUs).

[0048] The purpose of this invention is to provide a method and system for adjusting the Lagrange multiplier at the coding unit level. By using the coding unit-level Lagrange multiplier and rate-distortion cost of the coding unit in the coding tree unit, the final coding mode is determined. The method fully utilizes the rate-distortion dependency differences (temporal distortion propagation factor) of different regions (coding units) within the CTU for coding optimization, which can further improve the compression performance of the video encoder.

[0049] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0050] like Figure 1 As shown, the present invention provides a method for adjusting Lagrange multipliers at the coding unit level, the method comprising:

[0051] For each frame of the video to be encoded, perform the following steps:

[0052] S1: Determine the initial quantization parameters and frame-level Lagrange multipliers of the frame to be encoded; predict the reconstruction distortion and motion compensation prediction error of each pixel block in the frame to be encoded based on the initial quantization parameters and frame-level Lagrange multipliers.

[0053] S2: For each pixel block in the frame to be encoded, calculate the temporal distortion propagation factor of the pixel block based on the reconstruction distortion and motion compensation prediction error of the pixel block; the temporal distortion propagation factor characterizes the degree of influence of the encoding distortion of the pixel block on the encoding distortion of subsequent frames.

[0054] S3: Calculate the Lagrange weight of each pixel block in the frame to be encoded based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded; the Lagrange weight represents the relative unimportance of the encoding quality of the pixel block in the frame to be encoded.

[0055] S4: For each coding tree unit in the frame to be encoded, the coding tree unit is divided to obtain one first coding unit or multiple second coding units; the coding unit-level Lagrange multiplier of the first coding unit is calculated based on the Lagrange weights of the pixel blocks corresponding to the first coding unit; the first rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the first coding unit; the first optimal prediction mode of the coding tree unit is determined based on all the first rate-distortion costs; for each second coding unit, the first optimal prediction mode is calculated based on the Lagrange weights of the pixel blocks corresponding to the second coding unit. The coding unit-level Lagrange multiplier of the second coding unit is used to calculate the second rate-distortion cost corresponding to each prediction mode; the second optimal prediction mode of the coding tree unit is determined based on all the second rate-distortion costs; the final coding mode of the coding tree unit is determined based on the second rate-distortion cost corresponding to the second optimal prediction mode and the first rate-distortion cost corresponding to the first optimal prediction mode; and the coding tree unit is encoded using the final coding mode; the prediction modes include Skip mode, Merge mode, AMVP mode, and intra-frame prediction mode, etc.

[0056] Specifically, step S1 is as follows:

[0057] First, each frame of the video to be encoded is read in. Based on the video encoder configuration, frame-level quantization parameters and Lagrange multipliers, among other encoding parameters, are initialized. The relevant calculation formulas are as follows:

[0058] QP = QP input +ΔQP.

[0059] λ F =W·2 (QP-12) / 3 .

[0060] Where QP is the initial quantization parameter of the frame to be encoded (the initialized frame-level quantization parameter); QP input λ represents the input quantization parameter value of the encoder; ΔQP represents the quantization parameter compensation value of the frame to be encoded; λ F is the frame-level Lagrange multiplier; W is the pre-set computation weight of the encoder.

[0061] Each frame to be encoded is divided into several pixel blocks of size M×M. Inter-frame predictive coding is performed using M×M pixel blocks, and the motion compensation prediction error e and reconstruction distortion d of each pixel block after inter-frame predictive coding are recorded. Here, M is an integer smaller than the coding tree unit size, with a size of 2^M. m And m can be set to an integer such as 3, 4, 5 or 6.

[0062] Then, using the motion compensation prediction error e and reconstruction distortion d of the pixel block obtained above, the temporal distortion propagation factor of the pixel block is calculated. The expression for the temporal distortion propagation factor is:

[0063]

[0064] Where, p i d i and e i These are the temporal distortion propagation factor, motion compensation prediction error, and reconstruction distortion of the i-th pixel block in the frame to be encoded, respectively.

[0065] Specifically, step S3, which calculates the Lagrange weight of each pixel block in the frame to be encoded based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded, includes:

[0066] The intermediate weight variable is calculated based on the temporal distortion propagation factor of all the pixel blocks in the frame to be encoded.

[0067] For each pixel block, the Lagrange weight of the pixel block is calculated based on the intermediate weight variable and the temporal distortion propagation factor of the pixel block.

[0068] The formula for calculating the Lagrange weights is:

[0069]

[0070]

[0071] Where ψ is the intermediate weight variable, and N M×M ω is the number of M×M pixel blocks contained in a frame to be encoded. i It is the Lagrange weight of the i-th pixel block.

[0072] Step S4 involves dividing the coding tree unit to obtain one first coding unit or multiple second coding units, specifically including:

[0073] The coding tree unit is divided according to a first partitioning method to obtain a first coding unit; the size of the first coding unit is equal to the size of the coding tree unit.

[0074] The coding tree unit is divided using a second partitioning method to obtain multiple second coding units; the size of the second coding unit is smaller than the size of the coding tree unit.

[0075] The first rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the first coding unit, specifically including:

[0076] For each prediction mode, the coding tree unit is encoded with the prediction mode to obtain the reconstruction distortion and code rate corresponding to the prediction mode; the first rate distortion cost corresponding to the prediction mode is calculated based on the reconstruction distortion and code rate corresponding to the prediction mode and the coding unit-level Lagrange multiplier of the first coding unit.

[0077] The step of determining the first optimal prediction mode of the coding tree unit based on all the first rate-distortion costs specifically includes:

[0078] The prediction mode corresponding to the smallest first rate-distortion cost among all the first rate-distortion costs is taken as the first best prediction mode of the coding tree unit.

[0079] Specifically, when the partition depth is 0, i.e., when the first partitioning method is used to partition the current coding tree unit, the coding unit-level Lagrange multiplier of the first coding unit is calculated, and its formula is:

[0080]

[0081] Where, λ CTU ω is the coding unit-level Lagrange multiplier of the first coding unit; L is the number of pixel blocks covered by the first coding unit; j λ is the Lagrangian weight of the j-th pixel block covered by the first coding unit; F This is the frame-level Lagrange multiplier. At this point, the coding unit-level Lagrange multiplier of the first coding unit is the coding tree unit-level Lagrange multiplier of the current coding tree unit.

[0082] Through the coding unit level Lagrange multiplier λ of the first coding unit CTUThe optimal prediction mode for the first coding unit is determined by encoding the current coding tree unit using multi-frame prediction modes. The encoder obtains the reconstruction distortion and bitrate corresponding to each prediction mode. The first rate-distortion cost (FDDC) for each prediction mode is then obtained from the reconstruction distortion and bitrate. The prediction mode with the smallest FDDC cost among the FDDC values ​​is selected as the first optimal prediction mode. At this point, the FDDC cost J corresponding to the first optimal prediction mode is... depth=0 The calculation formula is:

[0083] J depth=0 =D+λ CTU ·R.

[0084] Where D and R are the reconstruction distortion and bit rate corresponding to the first best prediction mode of the first coding unit.

[0085] When the partition depth is set to 1, meaning the current coding tree unit is partitioned using the second partitioning method, the coding unit-level Lagrange multiplier of the second coding unit is calculated, and its expression is:

[0086]

[0087] Where, λ CU ω represents the coding unit-level Lagrange multiplier of the second coding unit; N is the number of pixel blocks covered by the second coding unit; n represents the nth pixel block covered by the second coding unit; ω n The Lagrangian weights of the nth pixel block covered by the second coding unit; λ F β is the frame-level Lagrange multiplier of the frame to be encoded. n β is the ratio of the nth pixel block covered by the second coding unit to the pixels contained in the second coding unit. For example, if half of the pixels in the nth pixel block are contained in the current coding unit, then β... n =0.5.

[0088] The step of determining the second optimal prediction mode of the coding tree unit based on all the second rate-distortion costs specifically includes:

[0089] The third optimal prediction mode for each of the second coding units is determined based on all the second rate-distortion costs.

[0090] The second best prediction mode of the coding tree unit is determined based on the third best prediction mode of all the second coding units.

[0091] Using the coding unit-level Lagrange multiplier λ of the current coding unit CUThe process involves determining the prediction mode and further partitioning modes for the current coding unit, ultimately identifying the optimal coding mode (including partitioning and prediction modes) for that unit. For each second coding unit, multiple prediction modes are used to encode it. The second rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers. The prediction mode with the lowest second rate-distortion cost is selected as the third optimal prediction mode for the second coding unit. The second optimal prediction mode for the current coding tree unit is determined using the third optimal prediction modes for all second coding units. It should be noted that further iterative partitioning stops when the CU (coding unit) size corresponding to the partitioning depth reaches the minimum allowed coding unit size of the encoder. At this point, the maximum partitioning depth can be 6.

[0092] The second rate distortion cost J corresponding to the second best prediction model depth=1 That is, the rate-distortion cost when depth=1 is:

[0093]

[0094] in, and The reconstruction distortion and bit rate are the values ​​corresponding to the second best prediction mode.

[0095] By comparing J depth=0 and J depth=1 The prediction mode with the smaller value is selected as the best coding mode for the current coding tree unit, and the current coding tree unit is encoded using the best coding mode.

[0096] If the current coding tree unit is not the last coding tree unit of the current coding frame, proceed to step S4 to encode the next coding tree unit; if the current coding tree unit is the last coding tree unit of the current frame, complete the encoding of the current frame and proceed to step S1 to start encoding the next frame to be encoded, until all frames to be encoded in the video to be encoded are encoded.

[0097] This embodiment uses the computer development environment Visual Studio 2019 and the reference software VTM17.0 based on the Versatile Video Coding (VVC) standard to implement the method of the present invention.

[0098] In this embodiment, the parameter M is set to 16, meaning the size of the pixel block is 16×16.

[0099] After integrating the method of this invention into the VVC reference software VTM17.0, the encoder performed video coding tests using two configurations: Low Delay B-frame (LDB) and Low Delay P-frame (LDP). The test experiments used all 20 standard-dynamic-range (SDR) videos from Class B, Class C, Class D, Class E, and Class F recommended by the VVC Common Test Conditions (CTC). Each video was tested according to the CTC test input quantization parameter QP. input The four bitrate points are 22, 27, 32, and 37. In addition to the method of this invention for video coding, the test experiments also used a VVC benchmark encoder and an existing coding tree unit-level Lagrange multiplier adjustment method (hereinafter referred to as: existing coding tree unit-level method) for video coding. The experimental results show that the method of this invention saves ( ) bitrate compared to the coding tree unit-level method using the VVC benchmark encoder. Delta bit-rate (BD-rate) is a metric that represents the percentage bit rate saving of a test method relative to a baseline encoder while maintaining the same objective quality. Positive values ​​indicate a loss in compression performance, while negative values ​​indicate an improvement in compression performance. For example... Figure 2 and Figure 3 These are schematic diagrams illustrating the bitrate savings of the proposed method and existing coding tree unit-level methods compared to the VVC baseline encoder under low-latency B-frame and low-latency P-frame encoding configurations. In the diagrams, BasketballDrive, etc., represent the names of the encoded video files. Figure 2 and Figure 3 As can be seen from the data, under LDB and LDP coding configurations, compared to the VVC benchmark encoder, the coding tree unit-level method achieves an average bitrate saving of 1.05%, while the method of this invention achieves an average bitrate saving of 1.43%. The method of this invention improves compression performance by 0.38% compared to existing coding tree unit-level methods because the coding unit-level Lagrange multiplier adjustment method can more effectively utilize the rate-distortion dependency differences among different coding units within the coding tree, thereby achieving better video compression performance.

[0100] Figure 4 This is a schematic diagram comparing the rate-distortion curves of the test video BasketballDrill obtained by the method of the present invention and the VVC benchmark encoder under LDB encoding configuration in the embodiment. Figure 5 This is a schematic diagram comparing the rate-distortion curves of the test video ArenaOfValor obtained by the method of the present invention and the VVC benchmark encoder under LDP encoding configuration in the embodiment. Figure 4 and Figure 5 In the graph, the horizontal axis represents the output bitrate, in kbps; the vertical axis, Y-PSNR, represents the peak signal-to-noise ratio of the luminance component of the reconstructed compressed video, in dB. Figure 4 and Figure 5 It can be concluded that, at the same output bitrate, the video reconstruction quality encoded by the method of the present invention is better than that encoded by the VVC benchmark encoder.

[0101] The coding unit-level Lagrange multiplier adjustment method and system provided by this invention, compared with the existing coding tree unit-level Lagrange multiplier adjustment method, can more effectively utilize the rate-distortion dependence differences of different coding units within the coding tree, thereby optimizing the coding mode selection and further improving the compression performance of the video encoder.

[0102] The present invention also provides a Lagrange multiplier adjustment system at the coding unit level, comprising:

[0103] The parameter determination module is used to determine the initial quantization parameters and frame-level Lagrange multipliers of each frame to be encoded in the video to be encoded; and to predict the reconstruction distortion and motion compensation prediction error of each pixel block in the frame to be encoded based on the initial quantization parameters and frame-level Lagrange multipliers.

[0104] The temporal distortion propagation factor calculation module is used to calculate the temporal distortion propagation factor of each pixel block in the frame to be encoded based on the reconstruction distortion and motion compensation prediction error of the pixel block; the temporal distortion propagation factor characterizes the degree of influence of the encoding distortion of the pixel block on the encoding distortion of subsequent frames.

[0105] The Lagrange weight calculation module is used to calculate the Lagrange weight of each pixel block in the frame to be encoded based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded; the Lagrange weight represents the relative unimportance of the encoding quality of the pixel block in the frame to be encoded.

[0106] The final coding mode determination module is configured to: divide each coding tree unit in the frame to be encoded into one first coding unit or multiple second coding units; calculate the coding unit-level Lagrange multiplier of the first coding unit based on the Lagrange weights of the pixel blocks corresponding to the first coding unit; calculate the first rate-distortion cost corresponding to each prediction mode based on the coding unit-level Lagrange multipliers of the first coding unit; determine the first optimal prediction mode of the coding tree unit based on all the first rate-distortion costs; and for each second coding unit, calculate the first rate-distortion cost corresponding to the pixel blocks corresponding to the second coding unit based on the Lagrange weights of the pixel blocks corresponding to the second coding unit. The coding unit-level Lagrange multipliers of the second coding unit are recalculated, and the second rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the second coding unit. The second optimal prediction mode of the coding tree unit is determined based on all the second rate-distortion costs. The final coding mode of the coding tree unit is determined based on the second rate-distortion cost corresponding to the second optimal prediction mode and the first rate-distortion cost corresponding to the first optimal prediction mode. The coding tree unit is then encoded using the final coding mode. The prediction modes include Skip mode, Merge mode, AMVP mode, and intra-frame prediction mode.

[0107] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0108] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for adjusting Lagrange multipliers at the coding unit level, characterized in that, The method includes: For each frame of the video to be encoded, perform the following steps: Determine the initial quantization parameters and frame-level Lagrange multipliers of the frame to be encoded; predict the reconstruction distortion and motion compensation prediction error of each pixel block in the frame to be encoded based on the initial quantization parameters and frame-level Lagrange multipliers. For each pixel block in the frame to be encoded, the temporal distortion propagation factor of the pixel block is calculated based on the reconstruction distortion and motion compensation prediction error of the pixel block; the temporal distortion propagation factor characterizes the degree of influence of the encoding distortion of the pixel block on the encoding distortion of subsequent frames; The Lagrange weight of each pixel block in the frame to be encoded is calculated based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded; the Lagrange weight represents the relative insignificance of the encoding quality of the pixel block in the frame to be encoded. For each coding tree unit in the frame to be encoded, the coding tree unit is divided to obtain one first coding unit or multiple second coding units; the coding unit-level Lagrange multiplier of the first coding unit is calculated based on the Lagrange weights of the pixel blocks corresponding to the first coding unit; the first rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the first coding unit; the first optimal prediction mode of the coding tree unit is determined based on all the first rate-distortion costs; for each second coding unit, the coding unit-level Lagrange multiplier of the second coding unit is calculated based on the Lagrange weights of the pixel blocks corresponding to the second coding unit, and the second rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the second coding unit; the second optimal prediction mode of the coding tree unit is determined based on all the second rate-distortion costs; the final coding mode of the coding tree unit is determined based on the second rate-distortion cost corresponding to the second optimal prediction mode and the first rate-distortion cost corresponding to the first optimal prediction mode, and the coding tree unit is encoded using the final coding mode; the prediction modes include Skip mode, Merge mode, AMVP mode, and intra-frame prediction mode.

2. The method for adjusting Lagrange multipliers at the coding unit level according to claim 1, characterized in that, The step of dividing the coding tree unit to obtain one first coding unit or multiple second coding units specifically includes: The coding tree unit is divided according to a first partitioning method to obtain a first coding unit; the size of the first coding unit is equal to the size of the coding tree unit. The coding tree unit is divided using a second partitioning method to obtain multiple second coding units; the size of the second coding unit is smaller than the size of the coding tree unit.

3. The method for adjusting Lagrange multipliers at the coding unit level according to claim 1, characterized in that, The expression for the coding unit-level Lagrange multipliers of the first coding unit is: Where, λ CTU ω is the coding unit-level Lagrange multiplier of the first coding unit; L is the number of pixel blocks covered by the first coding unit; j λ is the Lagrangian weight of the j-th pixel block covered by the first coding unit; F is the frame-level Lagrange multiplier of the frame to be encoded.

4. The method for adjusting Lagrange multipliers at the coding unit level according to claim 1, characterized in that, The step of calculating the first rate-distortion cost corresponding to each prediction mode based on the coding unit-level Lagrange multipliers of the first coding unit specifically includes: For each prediction mode, the coding tree unit is encoded with the prediction mode to obtain the reconstruction distortion and code rate corresponding to the prediction mode; the first rate distortion cost corresponding to the prediction mode is calculated based on the reconstruction distortion and code rate corresponding to the prediction mode and the coding unit-level Lagrange multiplier of the first coding unit.

5. The method for adjusting Lagrange multipliers at the coding unit level according to claim 1, characterized in that, The step of determining the first optimal prediction mode of the coding tree unit based on all the first rate-distortion costs specifically includes: The prediction mode corresponding to the smallest first rate-distortion cost among all the first rate-distortion costs is taken as the first best prediction mode of the coding tree unit.

6. The method for adjusting Lagrange multipliers at the coding unit level according to claim 1, characterized in that, The expression for the coding unit-level Lagrange multipliers of the second coding unit is: Where, λ CU ω represents the coding unit-level Lagrange multiplier of the second coding unit; N is the number of pixel blocks covered by the second coding unit; n represents the nth pixel block covered by the second coding unit; ω n The Lagrange weights of the nth pixel block covered by the second coding unit; β n It is the ratio of the nth pixel block covered by the second coding unit to be contained in the second coding unit; λ F is the frame-level Lagrange multiplier of the frame to be encoded.

7. The method for adjusting Lagrange multipliers at the coding unit level according to claim 1, characterized in that, The step of determining the second optimal prediction mode of the coding tree unit based on all the second rate-distortion costs specifically includes: A third optimal prediction mode is determined for each of the second coding units based on all the second rate-distortion costs; The second best prediction mode of the coding tree unit is determined based on the third best prediction mode of all the second coding units.

8. The method for adjusting Lagrange multipliers at the coding unit level according to claim 1, characterized in that, The expression for the time-domain distortion propagation factor is: Where, p i d i and e i These are the temporal distortion propagation factor, motion compensation prediction error, and reconstruction distortion of the i-th pixel block in the frame to be encoded, respectively.

9. The method for adjusting Lagrange multipliers at the coding unit level according to claim 1, characterized in that, The step of calculating the Lagrange weight of each pixel block in the frame to be encoded based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded specifically includes: Calculate intermediate weight variables based on the temporal distortion propagation factors of all pixel blocks in the frame to be encoded; For each pixel block, the Lagrange weight of the pixel block is calculated based on the intermediate weight variable and the temporal distortion propagation factor of the pixel block.

10. A Lagrange multiplier adjustment system at the coding unit level, characterized in that, include: The parameter determination module is used to determine the initial quantization parameters and frame-level Lagrange multipliers of each frame to be encoded in the video to be encoded. Based on the initial quantization parameters and frame-level Lagrange multipliers of the frame to be encoded, predict the reconstruction distortion and motion compensation prediction error of each pixel block in the frame to be encoded. The temporal distortion propagation factor calculation module is used to calculate the temporal distortion propagation factor of each pixel block in the frame to be encoded based on the reconstruction distortion and motion compensation prediction error of the pixel block; the temporal distortion propagation factor characterizes the degree of influence of the encoding distortion of the pixel block on the encoding distortion of subsequent frames; The Lagrange weight calculation module is used to calculate the Lagrange weight of each pixel block in the frame to be encoded based on the temporal distortion propagation factor of all pixel blocks in the frame to be encoded; the Lagrange weight represents the relative unimportance of the encoding quality of the pixel block in the frame to be encoded; The final coding mode determination module is configured to: divide each coding tree unit in the frame to be encoded into one first coding unit or multiple second coding units; calculate the coding unit-level Lagrange multiplier of the first coding unit based on the Lagrange weights of the pixel blocks corresponding to the first coding unit; calculate the first rate-distortion cost corresponding to each prediction mode based on the coding unit-level Lagrange multipliers of the first coding unit; determine the first optimal prediction mode of the coding tree unit based on all the first rate-distortion costs; and for each second coding unit, calculate the first rate-distortion cost corresponding to the pixel blocks corresponding to the second coding unit based on the Lagrange weights of the pixel blocks corresponding to the second coding unit. The coding unit-level Lagrange multipliers of the second coding unit are recalculated, and the second rate-distortion cost corresponding to each prediction mode is calculated based on the coding unit-level Lagrange multipliers of the second coding unit. The second optimal prediction mode of the coding tree unit is determined based on all the second rate-distortion costs. The final coding mode of the coding tree unit is determined based on the second rate-distortion cost corresponding to the second optimal prediction mode and the first rate-distortion cost corresponding to the first optimal prediction mode. The coding tree unit is then encoded using the final coding mode. The prediction modes include Skip mode, Merge mode, AMVP mode, and intra-frame prediction mode.

Citation Information

Patent Citations

  • Rate distortion optimization method based on HDR (High Dynamic Range)-VDP-2 (Visible Difference Predictor-2) distortion criterion

    CN108900838A

  • Video coding bit resource redistribution method

    CN112887714A