Video encoding method and device

By classifying and adjusting the correlation coefficients of CTU in video encoding, the problems of too small order of magnitude and poor fitting effect in the prior art are solved, and the rate distortion optimization effect of video encoding is improved.

CN114222144BActive Publication Date: 2025-04-11BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111566422.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-04-11
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

In the existing video encoding technology, the correlation coefficient calculation method based on VMAF and SSE causes the correlation coefficient to be too small, and the coding tree unit (CTU) is not effectively processed, resulting in poor coding effect.

Method used

By determining the first correlation coefficient of each CTU in the precoded frame and classifying it into the first and second CTUs, adjusting the correlation coefficients based on these classifications to calculate a more accurate rate distortion cost.

Benefits of technology

Improves the calculation accuracy of rate distortion cost, alleviates the VMAF problem caused by improper benchmark selection, and enhances the encoding effect, especially when dealing with CTUs with poor fitting effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114222144B_ABST
    Figure CN114222144B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a video encoding method and device, and the video encoding method includes: determining a first correlation coefficient of each coding tree unit CTU in a pre-encoded frame, wherein the first correlation coefficient represents the correlation between a first objective evaluation index and a second objective evaluation index at a CTU level, and the pre-encoded frame is any frame in a pre-encoded video; determining a first type of CTU and a second type of CTU according to the first correlation coefficient of each CTU and a preset threshold; obtaining a second correlation coefficient of the pre-encoded frame according to the first correlation coefficient of the second type of CTU, wherein the second correlation coefficient represents the correlation between the first objective evaluation index and the second objective evaluation index at a frame level; adjusting the first correlation coefficient of the first type of CTU according to the second correlation coefficient of the pre-encoded frame; obtaining a rate-distortion cost of each CTU based on the first correlation coefficient of each CTU and the second correlation coefficient of the pre-encoded frame; and encoding the pre-encoded frame according to the rate-distortion cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of video coding and decoding, and in particular to a video coding method and device. Background Art

[0002] The video coding standard uses a rate-distortion optimization method to encode the video. In the related art, a method based on Video Multimethod Assessment Fusion (VMAF) is used to perform rate-distortion optimization. The correlation coefficient between the VMAF score and the sum of square errors (SSE) is obtained, and then the correlation coefficient is applied to the calculation of the rate-distortion cost, and then the video is encoded by the rate-distortion cost. However, this method will make the order of magnitude of the correlation coefficient too small, and the coding tree unit (CTU) with poor fitting effect is not processed. Summary of the invention

[0003] The present disclosure provides a video encoding method and device to at least solve the above-mentioned problems in the related art, or may not solve any of the above-mentioned problems. The technical solution of the present disclosure is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, a video encoding method is provided, including: determining a first correlation coefficient of each coding tree unit CTU in a pre-coded frame, wherein the first correlation coefficient represents the correlation between a first objective evaluation index and a second objective evaluation index at a CTU level, and the pre-coded frame is any frame in a pre-coded video; determining a first type of CTU and a second type of CTU according to the first correlation coefficient of each CTU and a preset threshold; obtaining a second correlation coefficient of the pre-coded frame according to the first correlation coefficient of the second type of CTU, wherein the second correlation coefficient represents the correlation between a first objective evaluation index and a second objective evaluation index at a frame level; adjusting the first correlation coefficient of the first type of CTU according to the second correlation coefficient of the pre-coded frame; obtaining a rate-distortion cost of each CTU based on the first correlation coefficient of each CTU and the second correlation coefficient of the pre-coded frame; and encoding the pre-coded frame according to the rate-distortion cost.

[0005] Optionally, determining the first correlation coefficient of each coding tree unit CTU in the pre-coded frame includes: obtaining a constant rate factor crf list of the pre-coded video; encoding each CTU according to the crf list to obtain the first correlation coefficient of each CTU.

[0006] Optionally, obtaining a constant rate factor CRF list of a pre-encoded video includes: obtaining an initial CRF list of the pre-encoded video, wherein at least one CRF in the initial CRF list is arranged in ascending order of numerical value; determining an initial baseline CRF in the initial CRF list; determining a first subset in the initial CRF list based on the initial baseline CRF; determining a baseline CRF from the first subset; and obtaining the CRF list based on the baseline CRF.

[0007] Optionally, determining a benchmark CRF from the first subset includes: sequentially using the CRFs in the first subset to encode to obtain a first objective evaluation index for each frame in the pre-encoded video, and determining whether the first objective evaluation index of the frame in the pre-encoded video meets a predetermined condition, wherein if the first objective evaluation index of more than a preset number of frames is in a first preset numerical range, it is determined that the predetermined condition is met; and the CRF used when the predetermined condition is met is used as the benchmark CRF.

[0008] Optionally, the using the CRF used when the predetermined condition is satisfied as the reference CRF includes: if encoding using multiple CRFs in the first subset all satisfy the predetermined condition, using the first CRF used when the predetermined condition is satisfied as the reference CRF.

[0009] Optionally, the using the CRF used when the predetermined condition is satisfied as the reference CRF includes: if encoding using all CRFs in the first subset does not satisfy the predetermined condition, using the last CRF in the first subset as the reference CRF.

[0010] Optionally, obtaining the CRF list based on the benchmark CRF includes: in the initial CRF list, obtaining all CRFs within a second preset numerical range, wherein the second preset numerical range is determined based on a difference between the benchmark CRF and a first preset value and a sum of the benchmark CRF and a second preset value; obtaining the CRF list based on all CRFs within the second preset numerical range, wherein the CRF list includes the benchmark CRF and at least one conventional CRF.

[0011] Optionally, encoding each CTU according to the CRF list to obtain the first correlation coefficient of each CTU includes: encoding each CTU according to the benchmark CRF to obtain a benchmark first objective evaluation index and a benchmark second objective evaluation index of each CTU; encoding each CTU according to the at least one conventional CRF to obtain at least one conventional first objective evaluation index and at least one conventional second objective evaluation index of each CTU; obtaining the first correlation coefficient of each CTU by the least squares method according to the benchmark first objective evaluation index, the benchmark second objective evaluation index, the at least one conventional first objective evaluation index and the at least one conventional second objective evaluation index.

[0012] Optionally, determining the first correlation coefficient of each coding tree unit CTU in the pre-coded frame includes: obtaining a baseline first objective evaluation index, a baseline second objective evaluation index, at least one conventional first objective evaluation index and at least one conventional second objective evaluation index of each CTU through Gaussian blur calculation according to the first feature information of each CTU in the pre-coded frame; and obtaining the first correlation coefficient of each CTU through the least squares method according to the baseline first objective evaluation index, the baseline second objective evaluation index, the at least one conventional first objective evaluation index and the at least one conventional second objective evaluation index.

[0013] Optionally, adjusting the first correlation coefficient of the first type CTU according to the second correlation coefficient of the precoded frame includes: adjusting the values ​​of the first correlation coefficients of the first type CTU to the values ​​of the second correlation coefficient of the precoded frame.

[0014] Optionally, before obtaining the rate-distortion cost of each CTU based on the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame, it also includes: adjusting the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame to a third preset numerical range.

[0015] Optionally, obtaining the rate-distortion cost of each CTU based on the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame includes: calculating the ratio of the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame; and calculating the rate-distortion cost based on the ratio.

[0016] According to a second aspect of an embodiment of the present disclosure, a video encoding device is provided, comprising: a first determining unit, configured to determine a first correlation coefficient of each coding tree unit CTU in a pre-coded frame, wherein the first correlation coefficient represents the correlation between a first objective evaluation index and a second objective evaluation index at a CTU level, and the pre-coded frame is any frame in a pre-coded video; a classification unit, configured to determine a first type of CTU and a second type of CTU according to the first correlation coefficient of each CTU and a preset threshold; a second determining unit, configured to obtain a second correlation coefficient of the pre-coded frame according to the first correlation coefficient of the second type of CTU, wherein the second correlation coefficient represents the correlation between the first objective evaluation index and the second objective evaluation index at a frame level; a first adjusting unit, configured to adjust the first correlation coefficient of the first type of CTU according to the second correlation coefficient of the pre-coded frame; a cost calculating unit, configured to obtain a rate-distortion cost of each CTU based on the first correlation coefficient of each CTU and the second correlation coefficient of the pre-coded frame; and an encoding unit, configured to encode the pre-coded frame according to the rate-distortion cost.

[0017] Optionally, the first determination unit is configured to: obtain a constant rate factor crf list of the pre-encoded video; encode each CTU according to the crf list to obtain a first correlation coefficient of each CTU.

[0018] Optionally, the first determination unit is configured to: obtain an initial CRF list of the pre-encoded video, wherein at least one CRF in the initial CRF list is arranged in ascending order of numerical value; determine an initial baseline CRF in the initial CRF list; determine a first subset in the initial CRF list based on the initial baseline CRF; determine a baseline CRF from the first subset; and obtain the CRF list based on the baseline CRF.

[0019] Optionally, the first determination unit is configured to: sequentially use the CRFs in the first subset to encode to obtain a first objective evaluation index for each frame in the pre-encoded video, and determine whether the first objective evaluation index of the frame in the pre-encoded video meets a predetermined condition, wherein if the first objective evaluation index of more than a preset number of frames is in a first preset numerical range, it is determined that the predetermined condition is met; and the CRF used when the predetermined condition is met is used as a benchmark CRF.

[0020] Optionally, the first determining unit is configured to: if encoding using multiple CRFs in the first subset all meets the predetermined condition, use the first CRF used when the predetermined condition is met as the reference CRF.

[0021] Optionally, the first determining unit is configured to: if encoding using all CRFs in the first subset does not satisfy the predetermined condition, use the last CRF in the first subset as a reference CRF.

[0022] Optionally, the first determination unit is configured to: in the initial CRF list, obtain all CRFs within a second preset numerical range, wherein the second preset numerical range is determined based on the difference between the benchmark CRF and the first preset value and the sum of the benchmark CRF and the second preset value; obtain the CRF list based on all CRFs within the second preset numerical range, wherein the CRF list includes the benchmark CRF and at least one conventional CRF.

[0023] Optionally, the first determination unit is configured to: encode each CTU according to the benchmark crf to obtain a benchmark first objective evaluation indicator and a benchmark second objective evaluation indicator of each CTU; encode each CTU according to the at least one conventional crf to obtain at least one conventional first objective evaluation indicator and at least one conventional second objective evaluation indicator of each CTU; obtain the first correlation coefficient of each CTU by the least squares method according to the benchmark first objective evaluation indicator, the benchmark second objective evaluation indicator, the at least one conventional first objective evaluation indicator and the at least one conventional second objective evaluation indicator.

[0024] Optionally, the first determination unit is configured to: obtain a baseline first objective evaluation index, a baseline second objective evaluation index, at least one conventional first objective evaluation index and at least one conventional second objective evaluation index of each CTU through Gaussian blur calculation according to the first feature information of each CTU in the pre-coded frame; and obtain the first correlation coefficient of each CTU through the least squares method according to the baseline first objective evaluation index, the baseline second objective evaluation index, the at least one conventional first objective evaluation index and the at least one conventional second objective evaluation index.

[0025] Optionally, the first adjustment unit is configured to: adjust the values ​​of the first correlation coefficients of the first type of CTU to the values ​​of the second correlation coefficients of the precoded frame.

[0026] Optionally, a second adjustment unit is further included, configured to adjust the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame to a third preset value range.

[0027] Optionally, the cost calculation unit is configured to: calculate a ratio of a first correlation coefficient of each CTU to a second correlation coefficient of the precoded frame; and calculate the rate-distortion cost based on the ratio.

[0028] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, cause the at least one processor to execute a video encoding method according to the present disclosure.

[0029] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the video encoding method according to the present disclosure.

[0030] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, which implement the video encoding method according to the present disclosure when executed by at least one processor.

[0031] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0032] According to the video encoding method and device disclosed in the present invention, CTUs can be classified, and then the first correlation coefficient can be adjusted based on the classified CTUs, and then the rate-distortion cost can be calculated. CTUs with poor fitting effects can be taken into account in the calculation of the rate-distortion cost, so that the calculation result is more accurate.

[0033] In addition, according to the video encoding method and device disclosed in the present invention, the benchmark can be adaptively adjusted to calculate and fit the first correlation coefficient with a more appropriate crf list, thereby alleviating the problem that the VMAF is always 100 and the first correlation coefficient is not well fitted due to improper benchmark selection.

[0034] In addition, according to the video encoding method and device disclosed in the present invention, the first correlation coefficient and the second correlation coefficient can be adjusted to a third preset numerical range, thereby preventing the problem of the encoding effect being affected by the correlation coefficients being too large or too small, alleviating the problem of small benefits caused by the small order of magnitude of the correlation coefficients in the related technology, and improving the benefits of rate-distortion optimization.

[0035] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0037] Figure 1 The figure is a flowchart of a video encoding method according to an exemplary embodiment.

[0038] Figure 2 is a schematic diagram showing fitting the first correlation coefficient by the least square method according to an exemplary embodiment.

[0039] Figure 3 The invention is a block diagram of a video encoding device according to an exemplary embodiment.

[0040] Figure 4 is a block diagram of an electronic device 400 according to an exemplary embodiment. DETAILED DESCRIPTION

[0041] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.

[0043] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0044] The video coding standard uses rate-distortion optimization technology to encode videos. Rate-distortion optimization technology requires the calculation of distortion cost. The widely used calculation method is based on SSE. However, there is a big difference between the distortion measurement based on SSE and the subjective quality. VMAF is the current mainstream objective video quality assessment algorithm. However, VMAF can only be calculated for the entire frame and cannot be calculated for each CTU, so it is difficult to apply it to the rate-distortion cost calculation of video coding.

[0045] Based on this, the related technology first used the block-by-block local fitting method to study the correlation between VMAF and SSE, and obtained the correlation coefficient of △VMAF and △SSE of each CTU by calculating block by block, and then processed the correlation coefficient offline and applied it to the encoding process.

[0046] First, the video is encoded using multiple different quantization parameters (QP), QP = 25 is used as the base QP, the pre-encoding result of the base QP is the base reconstruction, and the pre-encoding results of the other QPs are the conventional reconstruction. This method calculates the rate-distortion cost by establishing the relationship between VMAF distortion and SSE.

[0047] For example, the baseline / conventional reconstruction V(V) can be established by the following equations (1) and (2): b / V r ) has an approximate linear relationship with the SSE:

[0048] V=100-VMAF (1)

[0049] V r =V b +ΔV,ΔV≈k i *SSE i,r (2)

[0050] Where V is VMAF distortion, VMAF is VMAF score, and V r is the VMAF distortion of conventional reconstruction, V b is the VMAF distortion of the baseline reconstruction, ΔV is V r and V b The deviation of k i is the correlation coefficient.

[0051] The correlation coefficient establishes the connection between the frame-level perceptual distortion and the block-level conventional distortion, which will be used in the subsequent rate-distortion optimization to encode the video with the rate-distortion cost. By assuming that ΔV is generated independently by each coding block, the correlation coefficient of each coding block can be obtained by the following substitution method: when deriving the correlation coefficient of the i-th block, only the corresponding block of the reference reconstruction is replaced by the same position block in the conventional reconstruction to generate a temporary frame. At this time, V r This is the V of the temporary frame, and then according to V bThe corresponding correlation coefficient is obtained by using the SSE. The △VMAF and △SSE of each CTU are calculated by replacing the CTU at the same position multiple times, and the least squares method is used for linear fitting to obtain the correlation coefficient (ratio) between the two. The fitted correlation coefficient is applied to the rate-distortion optimization process: first, the fitted correlation coefficient is processed, and the values ​​with negative correlation coefficients and 0 are removed. The frame-level λ and CTU-level k are calculated through the cleaned correlation coefficient to calculate the rate-distortion cost.

[0052] However, this method will make the correlation coefficient too small in magnitude, between 10-5 and 10-10. Applying the correlation coefficient directly to the calculation of the rate-distortion cost will result in small gains due to the large difference in magnitude, and CTUs with poor fitting effects will not be processed. In addition, the correlation coefficients of CTUs in different bitrate ranges are different, and using the same benchmark for all CTUs will result in the problem of VMAF always being 100.

[0053] In order to solve the problems existing in the above-mentioned related technologies, the present disclosure proposes a video encoding method and device, which can classify CTUs, and then adjust the first correlation coefficient based on the classified CTUs, and then calculate the rate-distortion cost. In the calculation of the rate-distortion cost, CTUs with poor fitting effects can be taken into account, so that the calculation results are more accurate.

[0054] Next, we will refer to Figures 1 to 4 The video encoding method and apparatus according to the present disclosure are described in detail.

[0055] Figure 1 is a flowchart of a video encoding method according to an exemplary embodiment. Figure 1 In step 101, a first correlation coefficient of each coding tree unit CTU in a pre-coded frame may be determined, wherein the first correlation coefficient represents a correlation between a first objective evaluation indicator and a second objective evaluation indicator at a CTU level, and the pre-coded frame is any frame in a pre-coded video.

[0056] According to an exemplary embodiment of the present disclosure, the first objective evaluation index may be VMAF, and the second objective evaluation index may be SSE.

[0057] According to an exemplary embodiment of the present disclosure, a constant rate factor (crf) list of a pre-encoded video may be first obtained, and then each CTU may be encoded according to the crf list to obtain a first correlation coefficient of each CTU.

[0058] According to an exemplary embodiment of the present disclosure, for obtaining a constant rate factor CRF list of a pre-encoded video, an initial CRF list of the pre-encoded video may be obtained first, wherein at least one CRF in the initial CRF list is arranged in ascending order of numerical value. Then an initial reference CRF may be determined in the initial CRF list. Next, a first subset may be determined in the initial CRF list based on the initial reference CRF. Then a reference CRF may be determined from the first subset. Finally, a CRF list may be obtained based on the reference CRF. It should be noted that the first subset includes an initial reference CRF and a preset number of CRFs after the initial reference CRF.

[0059] According to an exemplary embodiment of the present disclosure, for determining a reference CRF from the first subset, the CRFs in the first subset may be used to encode in sequence to obtain a first objective evaluation index for each frame in the pre-encoded video, and it is determined whether the first objective evaluation index of the frame in the pre-encoded video meets a predetermined condition, wherein if the first objective evaluation index of more than a preset number of frames is within a first preset value interval, it is determined that the predetermined condition is met. Then, the CRF used when the predetermined condition is met may be used as the reference CRF.

[0060] Here, if multiple CRFs in the first subset are used for encoding and all meet the predetermined condition, the first CRF used when the predetermined condition is met is used as the reference CRF. If all CRFs in the first subset are used for encoding and none of them meet the predetermined condition, the last CRF in the first subset is used as the reference CRF.

[0061] According to an exemplary embodiment of the present disclosure, for obtaining a CRF list according to a reference CRF, first, all CRFs within a second preset numerical range may be obtained in the initial CRF list, wherein the second preset numerical range is determined according to a difference between the reference CRF and the first preset value and a sum of the reference CRF and the second preset value. Then, a CRF list may be obtained according to all CRFs within the second preset numerical range, wherein the CRF list includes the reference CRF and at least one conventional CRF.

[0062] For example, first, the initial crf list {17, 19, 21, 23, 25, 27, 29, 31, 33, 35} of the pre-encoded video can be obtained. Then, the initial reference crf = 25 can be determined in the initial crf list. Next, the first subset {25, 27, 29} can be determined in the initial crf list according to the initial reference crf. Then, the crf in the first subset can be used in sequence to encode the VMAF of each frame in the pre-encoded video, and it is determined whether the VMAF of the frame in the pre-encoded video meets the predetermined condition, wherein if the VMAF of more than 90% of the frames is in [85, 99], it is determined that the predetermined condition is met. Next, the crf used when the predetermined condition is met can be used as the reference crf. Here, if the predetermined condition is met when multiple crfs in the first subset are used for encoding, the first crf used when the predetermined condition is met is used as the reference crf. If the predetermined condition is not met when all crfs in the first subset are used for encoding, the last crf in the first subset, i.e., crf = 29, is used as the reference crf. Then, all the CRFs in [29-6, 29+6] can be obtained from the initial CRF list. Finally, the CRF list {23, 25, 27, 29, 31, 33, 35} can be obtained based on all the CRFs in [29-6, 29+6].

[0063] According to an exemplary embodiment of the present disclosure, it can be determined that a predetermined condition is met when the first objective evaluation index of frames not exceeding a first preset number is in a fourth preset numerical range, wherein the first preset number may be 10% of the frames in the pre-encoded video, and the fourth preset numerical range may be (99, 100].

[0064] According to an exemplary embodiment of the present disclosure, each CTU may be firstly encoded according to a benchmark crf to obtain a benchmark first objective evaluation index and a benchmark second objective evaluation index of each CTU. Then, each CTU may be encoded according to at least one conventional crf to obtain at least one conventional first objective evaluation index and at least one conventional second objective evaluation index of each CTU. Finally, a first correlation coefficient of each CTU may be obtained by a least squares method according to the benchmark first objective evaluation index, the benchmark second objective evaluation index, at least one conventional first objective evaluation index, and at least one conventional second objective evaluation index.

[0065] For example, each CTU may be firstly encoded according to a reference CRF to obtain a reference VMAF and a reference SSE of each CTU. Then, each CTU may be encoded according to at least one conventional CRF to obtain at least one conventional VMAF and at least one conventional SSE of each CTU. Finally, a first correlation coefficient of each CTU may be obtained by a least square method according to the reference VMAF, the reference SSE, at least one conventional VMAF and at least one conventional SSE.

[0066] According to an exemplary embodiment of the present disclosure, ΔVMAF between a reference VMAF and each of at least one conventional VMAF, and ΔSSE between a reference SSE and each of at least one conventional SSE may be calculated.

[0067] For example, the first correlation coefficient of each CTU obtained by the least square method can be expressed as the following equations (3) and (4):

[0068]

[0069]

[0070] in, is the first correlation coefficient of the i-th CTU.

[0071] According to an exemplary embodiment of the present disclosure, the first correlation coefficient of each CTU can be obtained by Gaussian blur calculation through the first feature information of each CTU in the pre-coded frame. The first feature information may include, but is not limited to, YUV information.

[0072] For example, first, according to the first feature information of each CTU in the pre-coded frame, a base first objective evaluation index, a base second objective evaluation index, at least one regular first objective evaluation index, and at least one regular second objective evaluation index of each CTU can be obtained by Gaussian blur calculation. Then, according to the base first objective evaluation index, the base second objective evaluation index, at least one regular first objective evaluation index, and at least one regular second objective evaluation index, a first correlation coefficient of each CTU can be obtained by the least squares method.

[0073] According to an exemplary embodiment of the present disclosure, first, the second feature information of each CTU of the pre-coded frame may be obtained. Then, the second feature information of each CTU of the pre-coded frame may be input into the coefficient prediction model to obtain the first correlation coefficient of each CTU of the pre-coded frame. The second feature information may be any one of the pixel value, variance, edge information, gradient information and motion information of the Y component.

[0074] Here, the untrained coefficient prediction model can be trained by using the second feature information of multiple CTUs of multiple videos and the true values ​​of the first correlation coefficients of multiple CTUs as a training data set. The coefficient prediction model can be a convolutional neural network CNN. The calculation method of the true value of the first correlation coefficient refers to formulas (3) and (4).

[0075] In step 102, a first-category CTU and a second-category CTU may be determined according to a first correlation coefficient of each CTU and a preset threshold.

[0076] According to an exemplary embodiment of the present disclosure, a CTU whose first correlation coefficient is less than or equal to a preset threshold may be confirmed as a first-category CTU, and a CTU whose first correlation coefficient is greater than the preset threshold may be confirmed as a second-category CTU. Here, the preset threshold may be set to 0. For example, the first correlation coefficient of the first-category CTU is less than or equal to 0, and the first correlation coefficient of the second-category CTU is greater than 0.

[0077] Figure 2 is a schematic diagram showing a method of fitting a first correlation coefficient by least square method according to an exemplary embodiment. Figure 2 , sub-figures (a), (b) and (c) are schematic diagrams of the first correlation coefficient of the fitting of exemplary CTUs, the abscissas of sub-figures (a), (b) and (c) are ΔVMAF, and the ordinates of sub-figures (a), (b) and (c) are ΔSSE. In sub-figure (a), the first correlation coefficient is less than or equal to 0, and the fitting effect is very poor. In sub-figure (b), the first correlation coefficient is 8.33E-07, the first correlation coefficient is small (less than or equal to half of the mean of the first correlation coefficient of each CTU), and the fitting effect is good. In sub-figure (c), the first correlation coefficient is 1.26E-05, the first correlation coefficient is large (greater than half of the mean of the first correlation coefficient of each CTU), and the fitting effect is good. The CTU represented by (a) can be determined as a first-class CTU, and the CTUs represented by (b) and (c) can be determined as second-class CTUs.

[0078] In step 103, a second correlation coefficient of the precoded frame may be obtained according to the first correlation coefficient of the second type CTU, wherein the second correlation coefficient represents the correlation between the first objective evaluation index and the second objective evaluation index at the frame level.

[0079] According to an exemplary embodiment of the present disclosure, a second correlation coefficient of the precoded frame may be obtained according to the first correlation coefficient of the second type CTU and the number of the second type CTU.

[0080] For example, the second correlation coefficient of the precoded frame can be obtained by the following equations (5) and (6):

[0081]

[0082]

[0083] Where k is the second correlation coefficient of the precoded frame, is the first correlation coefficient of the i-th CTU, E represents the set of the second type of CTU, and |E| is the number of the second type of CTU.

[0084] In step 104, the first correlation coefficient of the first type of CTU may be adjusted according to the second correlation coefficient of the precoded frame.

[0085] According to an exemplary embodiment of the present disclosure, the values ​​of the first correlation coefficients of the first type of CTUs may be adjusted to the values ​​of the second correlation coefficients of the precoded frame.

[0086] In step 105, a rate-distortion cost of each CTU may be obtained based on a first correlation coefficient of each CTU and a second correlation coefficient of the precoded frame.

[0087] According to an exemplary embodiment of the present disclosure, before obtaining the rate-distortion cost of each CTU based on the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame, the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame may be adjusted (clipped) to a third preset numerical interval. For example, the third preset numerical interval may be [0.5, 3].

[0088] According to an exemplary embodiment of the present disclosure, a ratio of a first correlation coefficient of each CTU to a second correlation coefficient of a precoded frame may be calculated first, and then a rate-distortion cost may be calculated based on the ratio.

[0089] According to an exemplary embodiment of the present disclosure, the rate-distortion cost may be calculated according to the ratio, the SSE of each CTU, the encoding parameter, and the code rate of each CTU.

[0090] For example, the calculation formula of the rate-distortion cost is as follows (7):

[0091]

[0092] Among them, RDCost is the rate distortion cost, is the ratio of the i-th CTU, SSE i is the SSE of the ith CTU, is the encoding parameter, r i is the bit rate of the i-th CTU.

[0093] At step 106, the pre-coded frame may be encoded according to the rate-distortion cost.

[0094] According to an exemplary embodiment of the present disclosure, the following steps may be performed on each frame in the pre-encoded video: Figure 1 The process shown completes the encoding of the pre-encoded video.

[0095] Figure 3 is a block diagram of a video encoding device according to an exemplary embodiment. Figure 3 The video encoding device 300 includes a first determining unit 301, a classifying unit 302, a second determining unit 303, a first adjusting unit 304, a cost calculating unit 305 and an encoding unit 306.

[0096] The first determination unit 301 can determine a first correlation coefficient of each coding tree unit CTU in a pre-coded frame, wherein the first correlation coefficient represents a correlation between a first objective evaluation index and a second objective evaluation index at a CTU level, and the pre-coded frame is any frame in a pre-coded video.

[0097] According to an exemplary embodiment of the present disclosure, the first objective evaluation index may be VMAF, and the second objective evaluation index may be SSE.

[0098] According to an exemplary embodiment of the present disclosure, first, the first determination unit 301 may obtain a constant rate factor (crf) list of the pre-encoded video. Then, the first determination unit 301 may encode each CTU according to the crf list to obtain a first correlation coefficient of each CTU.

[0099] According to an exemplary embodiment of the present disclosure, first, the first determination unit 301 may obtain an initial CRF list of a pre-encoded video, wherein at least one CRF in the initial CRF list is arranged in ascending order of numerical value. Then, the first determination unit 301 may determine an initial reference CRF in the initial CRF list. Next, the first determination unit 301 may determine a first subset in the initial CRF list based on the initial reference CRF. Then, the first determination unit 301 may determine a reference CRF from the first subset. Finally, the first determination unit 301 may obtain a CRF list based on the reference CRF. It should be noted that the first subset includes an initial reference CRF and a preset number of CRFs after the initial reference CRF.

[0100] According to an exemplary embodiment of the present disclosure, first, the first determination unit 301 may sequentially use the CRFs in the first subset to encode and obtain the first objective evaluation index of each frame in the pre-encoded video, and determine whether the first objective evaluation index of the frame in the pre-encoded video meets the predetermined condition, wherein if the first objective evaluation index of more than a preset number of frames is in the first preset value interval, it is determined that the predetermined condition is met. Then, the first determination unit 301 may use the CRF used when the predetermined condition is met as the reference CRF.

[0101] Here, if the predetermined condition is satisfied when multiple CRFs in the first subset are used for encoding, the first determining unit 301 may use the first CRF used when the predetermined condition is satisfied as the reference CRF. If the predetermined condition is not satisfied when all CRFs in the first subset are used for encoding, the first determining unit 301 may use the last CRF in the first subset as the reference CRF.

[0102] According to an exemplary embodiment of the present disclosure, first, the first determination unit 301 may obtain all CRFs within a second preset numerical interval in the initial CRF list, wherein the second preset numerical interval is determined according to the difference between the reference CRF and the first preset value and the sum of the reference CRF and the second preset value. Then, the first determination unit 301 may obtain a CRF list according to all CRFs within the second preset numerical interval, wherein the CRF list includes the reference CRF and at least one conventional CRF.

[0103] For example, first, the first determination unit 301 may obtain an initial CRF list {17, 19, 21, 23, 25, 27, 29, 31, 33, 35} of the pre-encoded video. Then, the first determination unit 301 may determine an initial reference CRF=25 in the initial CRF list. Next, the first determination unit 301 may determine a first subset {25, 27, 29} in the initial CRF list according to the initial reference CRF. Then, the first determination unit 301 may sequentially use the CRFs in the first subset to encode and obtain the VMAF of each frame in the pre-encoded video, and determine whether the VMAF of the frame in the pre-encoded video meets a predetermined condition, wherein if the VMAF of more than 90% of the frames is in [85, 99], it is determined that the predetermined condition is met. Next, the first determination unit 301 may use the CRF used when the predetermined condition is met as the reference CRF. Here, if the encoding using multiple CRFs in the first subset meets the predetermined condition, the first determination unit 301 uses the first CRF used when the predetermined condition is met as the reference CRF. If encoding using all CRFs in the first subset does not meet the predetermined condition, the first determination unit 301 uses the last CRF in the first subset, i.e., CRF=29, as the reference CRF. Then the first determination unit 301 can obtain all CRFs in [29-6, 29+6] in the initial CRF list. Finally, the first determination unit 301 can obtain the CRF list {23, 25, 27, 29, 31, 33, 35} according to all CRFs in [29-6, 29+6].

[0104] According to an exemplary embodiment of the present disclosure, the first determination unit 301 may determine that a predetermined condition is met when the first objective evaluation index of frames not exceeding a first preset number is in a fourth preset numerical range, wherein the first preset number may be 10% of the frames in the pre-encoded video, and the fourth preset numerical range may be (99, 100].

[0105] According to an exemplary embodiment of the present disclosure, first, the first determination unit 301 may encode each CTU according to the benchmark CRF to obtain a benchmark first objective evaluation index and a benchmark second objective evaluation index of each CTU. Then, the first determination unit 301 may encode each CTU according to at least one conventional CRF to obtain at least one conventional first objective evaluation index and at least one conventional second objective evaluation index of each CTU. Finally, the first determination unit 301 may obtain a first correlation coefficient of each CTU by the least squares method according to the benchmark first objective evaluation index, the benchmark second objective evaluation index, at least one conventional first objective evaluation index, and at least one conventional second objective evaluation index.

[0106] For example, first, the first determination unit 301 may encode each CTU according to the reference CRF to obtain a reference VMAF and a reference SSE of each CTU. Then, the first determination unit 301 may encode each CTU according to at least one conventional CRF to obtain at least one conventional VMAF and at least one conventional SSE of each CTU. Finally, the first determination unit 301 may obtain a first correlation coefficient of each CTU by the least square method according to the reference VMAF, the reference SSE, the at least one conventional VMAF and the at least one conventional SSE.

[0107] According to an exemplary embodiment of the present disclosure, the first determination unit 301 may calculate ΔVMAF between a reference VMAF and each of at least one regular VMAF, and ΔSSE between a reference SSE and each of at least one regular SSE.

[0108] For example, the first correlation coefficient of each CTU obtained by the least square method can be expressed as the above equations (3) and (4).

[0109] According to an exemplary embodiment of the present disclosure, the first determination unit 301 may obtain the first correlation coefficient of each CTU by Gaussian blur calculation based on the first feature information of each CTU in the pre-coded frame. The first feature information may include, but is not limited to, YUV information.

[0110] For example, first, the first determination unit 301 may obtain a reference first objective evaluation index, a reference second objective evaluation index, at least one conventional first objective evaluation index, and at least one conventional second objective evaluation index of each CTU by Gaussian blur calculation according to the first feature information of each CTU in the pre-coded frame. Then, the first determination unit 301 may obtain a first correlation coefficient of each CTU by least square method according to the reference first objective evaluation index, the reference second objective evaluation index, at least one conventional first objective evaluation index, and at least one conventional second objective evaluation index.

[0111] According to an exemplary embodiment of the present disclosure, first, the first determination unit 301 may obtain the second feature information of each CTU of the pre-coded frame. Then, the first determination unit 301 may input the second feature information of each CTU of the pre-coded frame into the coefficient prediction model to obtain the first correlation coefficient of each CTU of the pre-coded frame. The second feature information may be any one of the pixel value, variance, edge information, gradient information and motion information of the Y component.

[0112] The classification unit 302 may determine a first-category CTU and a second-category CTU according to a first correlation coefficient of each CTU and a preset threshold.

[0113] According to an exemplary embodiment of the present disclosure, the classification unit 302 may identify a CTU whose first correlation coefficient is less than or equal to a preset threshold as a first-category CTU, and the classification unit 302 may identify a CTU whose first correlation coefficient is greater than the preset threshold as a second-category CTU. Here, the preset threshold may be set to 0. For example, the first correlation coefficient of the first-category CTU is less than or equal to 0, and the first correlation coefficient of the second-category CTU is greater than 0.

[0114] The second determination unit 303 may obtain a second correlation coefficient of the precoded frame according to the first correlation coefficient of the second type CTU, wherein the second correlation coefficient represents the correlation between the first objective evaluation index and the second objective evaluation index at the frame level.

[0115] According to an exemplary embodiment of the present disclosure, the second determination unit 303 may obtain a second correlation coefficient of the precoded frame according to the first correlation coefficient of the second type CTU and the number of the second type CTU.

[0116] For example, the second correlation coefficient of the precoded frame can be obtained by the above equations (5) and (6):

[0117] The first adjustment unit 304 may adjust the first correlation coefficient of the first type of CTU according to the second correlation coefficient of the precoded frame.

[0118] According to an exemplary embodiment of the present disclosure, the first adjustment unit 304 may adjust the values ​​of the first correlation coefficients of the first type of CTUs to the values ​​of the second correlation coefficients of the precoded frame.

[0119] The cost calculation unit 305 may obtain a rate-distortion cost of each CTU based on the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame.

[0120] According to an exemplary embodiment of the present disclosure, the cost calculation unit 305 may first calculate a ratio of a first correlation coefficient of each CTU to a second correlation coefficient of a precoded frame, and then calculate a rate-distortion cost based on the ratio.

[0121] According to an exemplary embodiment of the present disclosure, the cost calculation unit 305 may calculate the rate-distortion cost according to the ratio, the SSE of each CTU, the encoding parameter, and the code rate of each CTU.

[0122] For example, the calculation formula of the rate-distortion cost is the above formula (7).

[0123] According to an exemplary embodiment of the present disclosure, a second adjustment unit is further included, which can adjust (clip) the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame to a third preset numerical interval. For example, the third preset numerical interval can be [0.5, 3].

[0124] Specifically, the second adjustment unit may clip the first correlation coefficient of each CTU and the second correlation coefficient of the pre-coded frame to a third preset value interval before the cost calculation unit 305 is executed.

[0125] The encoding unit 306 may encode the pre-encoded frame according to the rate-distortion cost.

[0126] Figure 4 is a block diagram of an electronic device 400 according to an exemplary embodiment.

[0127] Reference Figure 4 The electronic device 400 includes at least one memory 401 and at least one processor 402, wherein the at least one memory 401 stores a set of computer executable instructions. When the computer executable instruction set is executed by the at least one processor 402, a video encoding method according to an exemplary embodiment of the present disclosure is executed.

[0128] As an example, the electronic device 400 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 400 is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 400 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.

[0129] In the electronic device 400, the processor 402 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0130] The processor 402 may execute instructions or codes stored in the memory 401, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transmission protocol.

[0131] The memory 401 may be integrated with the processor 402, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 401 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 401 and the processor 402 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 402 can read files stored in the memory.

[0132] In addition, the electronic device 400 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 400 may be connected to each other via a bus and / or a network.

[0133] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to perform the video encoding method according to the exemplary embodiment of the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0134] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided. Instructions in the computer program product may be executed by a processor of a computer device to implement the video encoding method according to the exemplary embodiment of the present disclosure.

[0135] According to the video encoding method and device disclosed in the present invention, CTUs can be classified, and then the first correlation coefficient can be adjusted based on the classified CTUs, and then the rate-distortion cost can be calculated. CTUs with poor fitting effects can be taken into account in the calculation of the rate-distortion cost, so that the calculation result is more accurate.

[0136] In addition, according to the video encoding method and device disclosed in the present invention, the benchmark can be adaptively adjusted to calculate and fit the first correlation coefficient with a more appropriate crf list, thereby alleviating the problem that the VMAF is always 100 and the first correlation coefficient is not well fitted due to improper benchmark selection.

[0137] In addition, according to the video encoding method and device disclosed in the present invention, the first correlation coefficient and the second correlation coefficient can be adjusted to a third preset numerical range, thereby preventing the problem of the encoding effect being affected by the correlation coefficients being too large or too small, alleviating the problem of small benefits caused by the small order of magnitude of the correlation coefficients in the related technology, and improving the benefits of rate-distortion optimization.

[0138] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0139] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A video encoding method, characterized in that: include: Determine a first correlation coefficient of each coding tree unit CTU in a pre-coded frame, wherein the first correlation coefficient represents a correlation between a first objective evaluation indicator and a second objective evaluation indicator at a CTU level, and the pre-coded frame is any frame in a pre-coded video; Determine a first-category CTU and a second-category CTU according to a first correlation coefficient of each CTU and a preset threshold; Obtaining a second correlation coefficient of the precoded frame according to the first correlation coefficient of the second type of CTU and the number of the second type of CTU, wherein the second correlation coefficient represents a correlation between the first objective evaluation index and the second objective evaluation index at a frame level; Adjusting a first correlation coefficient of the first type of CTU according to a second correlation coefficient of the precoded frame; Obtaining a rate-distortion cost of each CTU based on a first correlation coefficient of each CTU and a second correlation coefficient of the precoded frame; encoding the pre-coded frame according to the rate-distortion cost; The determining of the first-category CTU and the second-category CTU according to the first correlation coefficient and the preset threshold of each CTU includes: confirming a CTU whose first correlation coefficient is less than or equal to the preset threshold as the first-category CTU, and confirming a CTU whose first correlation coefficient is greater than the preset threshold as the second-category CTU.

2. The video encoding method according to claim 1, characterized in that: The determining a first correlation coefficient of each coding tree unit CTU in the pre-coded frame includes: Get the constant rate factor crf list of pre-encoded video; According to the crf list, each CTU is encoded to obtain a first correlation coefficient of each CTU.

3. The video encoding method according to claim 2, characterized in that: The step of obtaining a constant rate factor crf list of pre-encoded videos includes: Obtaining an initial CRF list of the pre-encoded video, wherein at least one CRF in the initial CRF list is arranged in ascending order of value; Determine an initial reference crf in the initial crf list; Determining a first subset in the initial crf list according to the initial reference crf; determining a reference crf from said first subset; According to the reference CRF, the CRF list is obtained.

4. The video encoding method according to claim 3, characterized in that: The determining a reference crf from the first subset comprises: sequentially using the crfs in the first subset to encode to obtain a first objective evaluation index of each frame in the pre-encoded video, and judging whether the first objective evaluation index of the frame in the pre-encoded video satisfies a predetermined condition, wherein if the first objective evaluation index of more than a preset number of frames is within a first preset value interval, it is determined that the predetermined condition is satisfied; The CRF used when the predetermined condition is satisfied is used as the reference CRF.

5. The video encoding method according to claim 4, characterized in that: The using the CRF used when the predetermined condition is met as the reference CRF includes: If encoding using multiple CRFs in the first subset all meets the predetermined condition, the first CRF used when meeting the predetermined condition is used as the reference CRF.

6. The video encoding method according to claim 4, characterized in that: The using the CRF used when the predetermined condition is met as the reference CRF includes: If encoding using all CRFs in the first subset does not satisfy the predetermined condition, the last CRF in the first subset is used as a reference CRF.

7. The video encoding method according to claim 3, characterized in that: The step of obtaining the CRF list according to the reference CRF includes: In the initial CRF list, all CRFs within a second preset value interval are obtained, wherein the second preset value interval is determined according to a difference between the reference CRF and the first preset value and a sum of the reference CRF and the second preset value; The CRF list is obtained according to all CRFs within the second preset value range, wherein the CRF list includes the reference CRF and at least one regular CRF.

8. The video encoding method according to claim 7, characterized in that: The encoding of each CTU according to the CRF list to obtain a first correlation coefficient of each CTU includes: According to the benchmark crf, each CTU is encoded to obtain a benchmark first objective evaluation index and a benchmark second objective evaluation index of each CTU; According to the at least one conventional CRF, each CTU is encoded to obtain at least one conventional first objective evaluation index and at least one conventional second objective evaluation index of each CTU; According to the benchmark first objective evaluation index, the benchmark second objective evaluation index, the at least one conventional first objective evaluation index and the at least one conventional second objective evaluation index, a first correlation coefficient of each CTU is obtained by a least square method.

9. The video encoding method according to claim 7, characterized in that: The determining a first correlation coefficient of each coding tree unit CTU in the pre-coded frame includes: According to the first feature information of each CTU in the pre-coded frame, a benchmark first objective evaluation index, a benchmark second objective evaluation index, at least one conventional first objective evaluation index, and at least one conventional second objective evaluation index of each CTU are obtained by Gaussian blur calculation; According to the benchmark first objective evaluation index, the benchmark second objective evaluation index, the at least one conventional first objective evaluation index and the at least one conventional second objective evaluation index, a first correlation coefficient of each CTU is obtained by a least square method.

10. The video encoding method according to claim 1, wherein: The adjusting the first correlation coefficient of the first type CTU according to the second correlation coefficient of the precoded frame includes: The values ​​of the first correlation coefficients of the first type of CTUs are all adjusted to the values ​​of the second correlation coefficients of the precoded frame.

11. The video encoding method according to claim 1, wherein: Before obtaining the rate-distortion cost of each CTU based on the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame, the method further includes: The first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame are adjusted to a third preset value interval.

12. The video encoding method according to claim 1, wherein: The obtaining, based on the first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame, a rate-distortion cost of each CTU, comprises: Calculating a ratio of a first correlation coefficient of each CTU to a second correlation coefficient of the precoded frame; The rate-distortion cost is calculated based on the ratio.

13. A video encoding device, characterized in that: include: A first determining unit is configured to: determine a first correlation coefficient of each coding tree unit CTU in a pre-coded frame, wherein the first correlation coefficient represents a correlation between a first objective evaluation index and a second objective evaluation index at a CTU level, and the pre-coded frame is any frame in a pre-coded video; The classification unit is configured to: determine a first-category CTU and a second-category CTU according to a first correlation coefficient of each CTU and a preset threshold; The second determining unit is configured to: obtain a second correlation coefficient of the precoded frame according to the first correlation coefficient of the second type of CTU and the number of the second type of CTU, wherein the second correlation coefficient represents the correlation between the first objective evaluation index and the second objective evaluation index at the frame level; A first adjustment unit is configured to: adjust a first correlation coefficient of the first type of CTU according to a second correlation coefficient of the precoded frame; A cost calculation unit is configured to: obtain a rate-distortion cost of each CTU based on a first correlation coefficient of each CTU and a second correlation coefficient of the precoded frame; An encoding unit, configured to: encode the pre-encoded frame according to the rate-distortion cost; The classification unit is further configured to identify a CTU whose first correlation coefficient is less than or equal to the preset threshold as a first-category CTU, and to identify a CTU whose first correlation coefficient is greater than the preset threshold as a second-category CTU.

14. The video encoding device according to claim 13, wherein: The first determining unit is configured to: Get the constant rate factor crf list of pre-encoded video; According to the crf list, each CTU is encoded to obtain a first correlation coefficient of each CTU.

15. The video encoding device according to claim 14, wherein: The first determining unit is configured to: Obtaining an initial CRF list of the pre-encoded video, wherein at least one CRF in the initial CRF list is arranged in ascending order of value; Determine an initial reference crf in the initial crf list; Determining a first subset in the initial crf list according to the initial reference crf; determining a reference crf from said first subset; According to the reference CRF, the CRF list is obtained.

16. The video encoding device according to claim 15, characterized in that: The first determining unit is configured to: sequentially using the crfs in the first subset to encode to obtain a first objective evaluation index of each frame in the pre-encoded video, and judging whether the first objective evaluation index of the frame in the pre-encoded video satisfies a predetermined condition, wherein if the first objective evaluation index of more than a preset number of frames is within a first preset value interval, it is determined that the predetermined condition is satisfied; The CRF used when the predetermined condition is satisfied is used as the reference CRF.

17. The video encoding device according to claim 16, wherein: The first determining unit is configured to: If encoding using multiple CRFs in the first subset all meets the predetermined condition, the first CRF used when meeting the predetermined condition is used as the reference CRF.

18. The video encoding device according to claim 16, wherein: The first determining unit is configured to: If encoding using all CRFs in the first subset does not satisfy the predetermined condition, the last CRF in the first subset is used as a reference CRF.

19. The video encoding device according to claim 15, wherein: The first determining unit is configured to: In the initial CRF list, all CRFs within a second preset value interval are obtained, wherein the second preset value interval is determined according to a difference between the reference CRF and the first preset value and a sum of the reference CRF and the second preset value; The CRF list is obtained according to all CRFs within the second preset value range, wherein the CRF list includes the reference CRF and at least one regular CRF.

20. The video encoding device according to claim 19, wherein: The first determining unit is configured to: According to the benchmark crf, each CTU is encoded to obtain a benchmark first objective evaluation index and a benchmark second objective evaluation index of each CTU; According to the at least one conventional CRF, each CTU is encoded to obtain at least one conventional first objective evaluation index and at least one conventional second objective evaluation index of each CTU; According to the benchmark first objective evaluation index, the benchmark second objective evaluation index, the at least one conventional first objective evaluation index and the at least one conventional second objective evaluation index, a first correlation coefficient of each CTU is obtained by a least square method.

21. The video encoding device according to claim 19, wherein: The first determining unit is configured to: According to the first feature information of each CTU in the pre-coded frame, a benchmark first objective evaluation index, a benchmark second objective evaluation index, at least one conventional first objective evaluation index, and at least one conventional second objective evaluation index of each CTU are obtained by Gaussian blur calculation; According to the benchmark first objective evaluation index, the benchmark second objective evaluation index, the at least one conventional first objective evaluation index and the at least one conventional second objective evaluation index, a first correlation coefficient of each CTU is obtained by a least square method.

22. The video encoding device according to claim 13, wherein: The first adjustment unit is configured as: The values ​​of the first correlation coefficients of the first type of CTUs are all adjusted to the values ​​of the second correlation coefficients of the precoded frame.

23. The video encoding device according to claim 13, wherein: The second adjusting unit is configured to: The first correlation coefficient of each CTU and the second correlation coefficient of the precoded frame are adjusted to a third preset value interval.

24. The video encoding device according to claim 13, wherein: The cost calculation unit is configured as: Calculating a ratio of a first correlation coefficient of each CTU to a second correlation coefficient of the precoded frame; The rate-distortion cost is calculated based on the ratio.

25. An electronic device, characterized in that: include: at least one processor; at least one memory storing computer executable instructions, Wherein, when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to perform the video encoding method according to any one of claims 1 to 12.

26. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by at least one processor, the at least one processor is prompted to perform the video encoding method according to any one of claims 1 to 12.

27. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by at least one processor, the video encoding method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Optimized coding method for improving video quality based on VMAF criterion

    CN110324618A

  • VMAF-based perception video rate distortion coding optimization method and device

    CN111970511A