Encoding parameter determination method, apparatus, device, storage medium, and program product

By generating test curves to determine the target parameter values ​​of the encoding parameters, the problem of not being able to accurately determine the optimal encoding parameters in traditional video encoding technology is solved, thus improving the encoding quality.

CN117412041BActive Publication Date: 2026-02-24GRANFIELD INTELLIGENT TECH (WUHAN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311258592.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2026-02-24
Estimated Expiration
2043-09-26

AI Technical Summary

Technical Problem

Traditional video coding techniques cannot accurately determine the optimal coding parameters, resulting in poor coding quality.

Method used

By obtaining the current value range of the quantization parameter, test datasets and video test sets for multiple encoding parameters are obtained. Test curves are generated using the encoder and decoder, and the target parameter value for each encoding parameter is determined based on these curves.

Benefits of technology

This allows for more accurate determination of encoding parameters within the current range of quantization parameter values, thereby improving the quality of video encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117412041B_ABST
    Figure CN117412041B_ABST
Patent Text Reader

Abstract

The application relates to a coding parameter determination method and device, a computer device, a storage medium and a computer program product. The method comprises the following steps: obtaining a first number of quantization parameters based on a current value range of the quantization parameters; obtaining a test data set, wherein the test data set comprises a plurality of coding parameters; obtaining a current parameter value range of each coding parameter; determining a parameter value corresponding to each coding parameter according to the current parameter value range of each coding parameter; obtaining a video test set, wherein the video test set comprises a plurality of types of test videos; and obtaining a plurality of test curves corresponding to each coding parameter according to the parameter value corresponding to each coding parameter and the plurality of types of test videos. The method can be used to more accurately determine a target parameter value of each coding parameter under the current value range of the quantization parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer processing technology, and in particular to a method, apparatus, computer device, storage medium, and computer program product for determining encoding parameters. Background Technology

[0002] Video encoding technology refers to the technology of encoding video using an encoder.

[0003] In traditional techniques, the optimal encoding parameters are determined by selecting a video, encoding the video using multiple encoding parameters, and then selecting the encoding parameters that best improve the encoding quality.

[0004] However, the traditional method cannot accurately determine the optimal encoding parameters. Summary of the Invention

[0005] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for determining encoding parameters that can more accurately determine the target parameter values ​​of encoding parameters, in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a method for determining encoding parameters. The method includes:

[0007] Based on the current value range of the quantization parameters, obtain the first number of quantization parameters;

[0008] Obtain a test dataset, which includes multiple encoding parameters;

[0009] Get the current value range of each encoded parameter;

[0010] Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0011] Obtain a video test set, which includes various types of test videos;

[0012] Based on the parameter values ​​corresponding to each encoding parameter and various types of test videos, multiple test curves are obtained for each encoding parameter. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it, given a first number of quantization parameters.

[0013] Based on multiple test curves corresponding to each encoding parameter, determine the target parameter value for each encoding parameter.

[0014] In one embodiment, obtaining a first number of quantization parameters based on the current value range of the quantization parameters includes:

[0015] Obtain the current value range of the quantization parameter; the value range of the quantization parameter includes the entire value range and at least two partial value ranges obtained by truncating the entire value range;

[0016] Select a first number of quantization parameters from the current value range of the quantization parameters.

[0017] In one embodiment, obtaining the current parameter value range for each encoded parameter includes:

[0018] Obtain the number of training iterations for encoding all test videos using the aforementioned encoding parameters;

[0019] If the number of training iterations for the corresponding encoding parameter is less than the number of iterations for the first time, the current parameter value range of the encoding parameter is determined as the initial parameter value range of the encoding parameter; the first number of iterations is determined based on the initial parameter value range of each encoding parameter and the initial adjustment step size corresponding to the encoding parameter; the initial adjustment step size is determined based on the initial parameter value range of the encoding parameter.

[0020] If the number of training iterations for the corresponding encoding parameter is not less than the first number of iterations, an initial target parameter value is obtained for each encoding parameter; the initial target parameter value is obtained based on the training result corresponding to the first number of training iterations for each encoding parameter.

[0021] Based on the initial target parameter value and the initial parameter value range of each encoding parameter, determine the current parameter value range of each encoding parameter.

[0022] In one embodiment, the initial parameter value range includes an initial minimum value and an initial maximum value; determining the current parameter value range for each encoding parameter based on the initial target parameter value and the initial parameter value range for each encoding parameter includes:

[0023] Based on the initial minimum value, the initial target parameter value, and the initial adjustment step size, determine the minimum value of the current parameter value range for each encoding parameter;

[0024] Based on the initial maximum value, the initial target parameter value, and the initial adjustment step size, determine the maximum value of the current parameter range for each encoding parameter.

[0025] In one embodiment, determining the parameter value corresponding to each encoding parameter based on the current parameter value range corresponding to each encoding parameter includes:

[0026] Get the current adjustment step size for each encoding parameter;

[0027] Use the minimum value of the current parameter range corresponding to each encoding parameter as the current initial parameter value;

[0028] The current initial parameter value is adjusted according to the current adjustment step size to determine multiple current parameter values ​​corresponding to each encoding parameter.

[0029] In one embodiment, obtaining multiple test curves corresponding to each encoding parameter based on the parameter value corresponding to each encoding parameter and multiple types of test videos includes:

[0030] For each current parameter value in each encoding parameter, the encoder encodes each type of test video using a first number of quantization parameters. After encoding, the decoder decodes the video to obtain a first number of pairs of bitrate and peak signal-to-noise ratio.

[0031] Based on the first pair of bitrate and peak signal-to-noise ratio, generate a test curve corresponding to each current parameter value in the encoding parameters;

[0032] Obtain multiple test curves corresponding to each encoding parameter.

[0033] In one embodiment, determining the target parameter value for each encoding parameter based on multiple test curves corresponding to each encoding parameter includes:

[0034] Obtain the reference curve;

[0035] Based on multiple test curves for each coding parameter and the reference curve, multiple coding evaluation values ​​corresponding to the multiple test curves are calculated; the coding evaluation values ​​include at least one of BD-Rate or BD-PSNR;

[0036] Based on multiple test curves corresponding to multiple coding evaluation values, the target parameter value for each coding parameter is determined.

[0037] Secondly, this application also provides an encoding parameter determination apparatus. The apparatus includes:

[0038] The quantization parameter acquisition module is used to acquire a first number of quantization parameters based on the current value range of the quantization parameters.

[0039] A test dataset acquisition module is used to acquire a test dataset, which includes multiple encoded parameters.

[0040] The current parameter value range acquisition module is used to obtain the current parameter value range for each encoded parameter;

[0041] The parameter value determination module is used to determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0042] The video test set acquisition module is used to acquire a video test set, which includes various types of test videos.

[0043] The test curve acquisition module is used to acquire multiple test curves corresponding to each encoding parameter based on the parameter value corresponding to each encoding parameter and multiple types of test videos. The multiple test curves include the curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it after acquiring a first number of quantization parameters.

[0044] The target parameter value determination module is used to determine the target parameter value for each encoding parameter based on multiple test curves corresponding to each encoding parameter.

[0045] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0046] Based on the current value range of the quantization parameters, obtain the first number of quantization parameters;

[0047] Obtain a test dataset, which includes multiple encoding parameters;

[0048] Get the current value range of each encoded parameter;

[0049] Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0050] Obtain a video test set, which includes various types of test videos;

[0051] Based on the parameter values ​​corresponding to each encoding parameter and various types of test videos, multiple test curves are obtained for each encoding parameter. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it, given a first number of quantization parameters.

[0052] Based on multiple test curves corresponding to each encoding parameter, determine the target parameter value for each encoding parameter.

[0053] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0054] Based on the current value range of the quantization parameters, obtain the first number of quantization parameters;

[0055] Obtain a test dataset, which includes multiple encoding parameters;

[0056] Get the current value range of each encoded parameter;

[0057] Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0058] Obtain a video test set, which includes various types of test videos;

[0059] Based on the parameter values ​​corresponding to each encoding parameter and various types of test videos, multiple test curves are obtained for each encoding parameter. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it, given a first number of quantization parameters.

[0060] Based on multiple test curves corresponding to each encoding parameter, determine the target parameter value for each encoding parameter.

[0061] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0062] Based on the current value range of the quantization parameters, obtain the first number of quantization parameters;

[0063] Obtain a test dataset, which includes multiple encoding parameters;

[0064] Get the current value range of each encoded parameter;

[0065] Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0066] Obtain a video test set, which includes various types of test videos;

[0067] Based on the parameter values ​​corresponding to each encoding parameter and various types of test videos, multiple test curves are obtained for each encoding parameter. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it, given a first number of quantization parameters.

[0068] Based on multiple test curves corresponding to each encoding parameter, determine the target parameter value for each encoding parameter.

[0069] The aforementioned method, apparatus, computer device, storage medium, and computer program product for determining encoding parameters acquire a first number of quantization parameters based on the current value range of the quantization parameters; acquire a test dataset including multiple encoding parameters, and acquire the current value range of each encoding parameter; determine the parameter value corresponding to each encoding parameter based on the current value range of each encoding parameter; acquire a video test set including multiple types of test videos; acquire multiple test curves corresponding to each encoding parameter based on the parameter value corresponding to each encoding parameter and the multiple types of test videos; and determine the target parameter value of each encoding parameter based on the multiple test curves corresponding to each encoding parameter. This method, using a test dataset including multiple encoding parameters and multiple types of test videos, acquires test curves for encoding each type of test video with each encoding parameter. Based on the multiple test curves corresponding to each encoding parameter, it reflects the effect of using each parameter value of each encoding parameter to encode different types of test videos, achieving more accurate determination of the target parameter value of each encoding parameter within the current value range of the quantization parameters, thus ensuring the quality of video encoding using the target parameter value of the encoding parameters. Attached Figure Description

[0070] Figure 1 This is an application environment diagram of the encoding parameter determination method in one embodiment;

[0071] Figure 2 This is a flowchart illustrating a method for determining encoding parameters in one embodiment;

[0072] Figure 3 This is a schematic diagram illustrating the process of obtaining the bit rate and peak signal-to-noise ratio corresponding to multiple encoding parameters in one embodiment;

[0073] Figure 4 This is a flowchart illustrating the method for determining encoding parameters in another embodiment;

[0074] Figure 5 This is a structural block diagram of the encoding parameter determination device in one embodiment;

[0075] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0076] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0077] The encoding parameter determination method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.

[0078] Terminal 102 can obtain a first number of quantization parameters based on the current value range of the quantization parameters; obtain a test dataset including multiple encoding parameters from server 104, and obtain the current value range of each encoding parameter; determine the parameter value corresponding to each encoding parameter based on the current value range of each encoding parameter; obtain a video test set including multiple types of test videos from server 104, and obtain multiple test curves corresponding to each encoding parameter based on the parameter value corresponding to each encoding parameter and the multiple types of test videos; determine the target parameter value of each encoding parameter based on the multiple test curves corresponding to each encoding parameter.

[0079] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0080] In one embodiment, such as Figure 2 As shown, a method for determining encoding parameters is provided, which is applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps:

[0081] Step 202: Based on the current value range of the quantization parameters, obtain the first number of quantization parameters.

[0082] The quantization parameter (QP) is a numerical value that reflects the spatial detail compression. For HEVC and H.264, the QP value ranges from 0 to 51. A smaller QP results in finer quantization, higher image quality, and a longer bitstream. A larger QP leads to some loss of detail, a lower bitrate, increased image distortion, and a decrease in quality. Adjusting the QP value is essentially a trade-off between quality and bitrate. A smaller QP value preserves more image detail and results in higher image quality, but increases the bitrate. A larger QP value leads to severe loss of image detail and a lower bitrate.

[0083] For example, the terminal can obtain the current value range of the quantization parameter, and based on the current value range of the quantization parameter, obtain a first number of quantization parameters. Specifically, the current value range of the quantization parameter is selected based on the full range of values ​​of the quantization parameter. The size of the first number is determined based on empirical values.

[0084] Step 204: Obtain the test dataset, which includes multiple encoding parameters.

[0085] The encoding parameters are the parameters required for encoding video or images in the encoder. Each encoding parameter has a corresponding range of values, and its initial maximum and minimum values ​​are determined by the bit width of the encoding parameter.

[0086] In practice, if the encoding parameter is a 16-bit unsigned number, the corresponding value range can be [0, 65535]. If the encoding parameter is an 8-bit signed number, the corresponding value range is [-128, 127].

[0087] Specifically, the multiple encoding parameters in the test dataset can be common encoding parameters, encoding parameters selected based on empirical values, or encoding parameters selected based on test requirements.

[0088] Step 206: Obtain the current parameter value range for each encoding parameter.

[0089] Each encoding parameter has an initial parameter value range. The initial parameter value range can be determined based on the bit width of the encoding parameter itself. The current parameter value range is determined based on the cumulative number of training iterations of the encoding parameter. In some cases, the current parameter value range can be the same as the initial parameter value range.

[0090] Step 208: Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter.

[0091] Each encoding parameter has multiple possible values. The value of each encoding parameter is determined based on the range of values ​​for that current parameter.

[0092] Step 210: Obtain a video test set, which includes various types of test videos.

[0093] The video test set can include various types of test videos, and there can be one or more test videos of each type. Specifically, the types of test videos can be categorized based on actual circumstances. The selected test videos in the video test set can be determined based on actual circumstances, and this invention does not impose any limitations on this.

[0094] In practice, the type of test video can be determined based on the content characteristics of the video. Specifically, test videos can be classified according to the movement of people or objects in the video. For example, for news broadcasts, the background is generally static, with only the foreground anchor making subtle movements; for videos similar to racing competitions, the video footage shows speeding race cars.

[0095] Step 212: Based on the parameter value corresponding to each encoding parameter and multiple types of test videos, obtain multiple test curves corresponding to each encoding parameter; the multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it after obtaining a first number of quantization parameters.

[0096] The test curve is obtained by encoding each test video using every value of the encoding parameters, based on a first set of quantization parameters, and then decoding the resulting video. Specifically, the first set of quantization parameters is no less than the number of points required to construct the test curve.

[0097] In practice, if the number of parameter values ​​corresponding to the encoding parameter is 10 and the number of test videos is 10, then each parameter value in the encoding parameter corresponds to 10 test curves, and the total number of test curves is 100.

[0098] Specifically, the process of obtaining a test curve can be as follows: in the encoder, a test video is encoded using the current parameter value corresponding to the encoding parameter to obtain a bitstream; the bitstream is then decoded by the decoder to obtain the test curve of the test video encoded with the current parameter value of the encoding parameter.

[0099] For example, in the codec, multiple test curves corresponding to each encoding parameter are obtained based on the parameter value corresponding to each encoding parameter and various types of test videos.

[0100] Step 214: Determine the target parameter value for each encoding parameter based on the multiple test curves corresponding to each encoding parameter.

[0101] The target parameter value for each encoding parameter is the optimal parameter value corresponding to that encoding parameter. The optimal parameter value is the parameter value that yields the best video encoding results.

[0102] For example, the target parameter value of the encoding parameter can be determined by encoding each video based on the test curve obtained by encoding multiple parameter values ​​corresponding to the encoding parameter.

[0103] In the above method for determining encoding parameters, a first number of quantization parameters are obtained based on the current value range of the quantization parameters; a test dataset including multiple encoding parameters is obtained, and the current value range of each encoding parameter is obtained; the parameter value corresponding to each encoding parameter is determined according to the current value range of each encoding parameter; a video test set including multiple types of test videos is obtained; multiple test curves corresponding to each encoding parameter are obtained based on the parameter value corresponding to each encoding parameter and the multiple types of test videos; and the target parameter value of each encoding parameter is determined based on the multiple test curves corresponding to each encoding parameter. This method, using a test dataset including multiple encoding parameters and multiple types of test videos, obtains test curves for encoding each type of test video with each encoding parameter. Based on the multiple test curves corresponding to each encoding parameter, the effect of using each parameter value of each encoding parameter to encode different types of test videos is reflected. This achieves more accurate determination of the target parameter value of each encoding parameter within the current value range of the quantization parameters, thus ensuring the quality of video encoding using the target parameter value of the encoding parameters.

[0104] In one embodiment, step 202 includes:

[0105] Step 2022: Obtain the current value range of the quantization parameter; the value range of the quantization parameter includes the entire value range and at least two partial value ranges obtained by truncating the entire value range.

[0106] The quantization parameter's value range includes the entire range and at least two partial ranges. The partial ranges are obtained by truncating the entire range. Specifically, the values ​​corresponding to the at least two partial ranges may or may not overlap.

[0107] For example, the current value range of the quantization parameter can be the entire range or one of at least two partial ranges. Specifically, the current value range of the quantization parameter can be the entire range, or it can be one of at least two partial ranges. Furthermore, the current value range of the quantization parameter can be selected based on actual needs.

[0108] Step 2024: Select a first number of quantization parameters from the current value range of the quantization parameters.

[0109] In one example, the full range of values ​​for the quantization parameter can be [0, 51]. If there are three corresponding ranges, they can be [0, 17], [18, 35], and [36, 51]. If the current range of values ​​for the quantization parameter is [18, 35], then the first number of quantization parameters can be within [18, 35] and must be an integer.

[0110] In practice, smaller quantization parameters preserve more image details and result in higher image quality, but increase the bitrate. Conversely, larger quantization parameters lead to severe loss of image details and a decrease in bitrate. Therefore, the optimal parameter value for encoding with the same encoding parameters may differ depending on the selected quantization parameters.

[0111] In the above embodiments, by obtaining the current value range of the quantization parameters, a first number of quantization parameters are selected. With the first number of quantization parameters selected, the target parameter value of the encoding parameter under the quantization parameters in the current value range is determined.

[0112] In one embodiment, step 206 includes:

[0113] Step 2062: Obtain the number of training iterations for encoding all test videos using the encoding parameters.

[0114] The training count can be the number of times all test videos are encoded using the parameter values ​​in the encoding parameters. Specifically, for a given encoding parameter, if all test videos are encoded using one of its parameter values ​​within the current parameter value range, then the corresponding training count for that encoding parameter is incremented by one. In other words, encoding all test videos using one parameter value is recorded as one training count for that encoding parameter.

[0115] Step 2064: If the number of training iterations for the corresponding encoding parameter is less than the number of iterations for the first time, determine the current parameter value range of the encoding parameter as the initial parameter value range of the encoding parameter; the first number of iterations is determined based on the initial parameter value range of each encoding parameter and the initial adjustment step size corresponding to the encoding parameter; the initial adjustment step size is determined based on the initial parameter value range of the encoding parameter.

[0116] The initial number can be determined based on the initial parameter value range and the initial adjustment step size for each encoding parameter. Therefore, for each encoding parameter, the size of the initial number will vary depending on the initial parameter value range and the initial adjustment step size.

[0117] For example, the initial adjustment step size can be determined based on the initial parameter value range of the encoding parameters. Specifically, if the initial parameter value range of the encoding parameters is relatively large, the corresponding initial adjustment step size is also relatively large; if the initial parameter value range of the encoding parameters is relatively small, the corresponding initial adjustment step size is also relatively small. Therefore, the size of the initial adjustment step size is positively correlated with the size of the initial parameter value range of the encoding parameters.

[0118] Step 2066: If the number of training iterations for the corresponding encoding parameter is not less than the first number of iterations, obtain the initial target parameter value for each encoding parameter; the initial target parameter value is obtained based on the training result corresponding to the first number of training iterations for each encoding parameter.

[0119] Step 2068: Determine the current parameter value range for each encoding parameter based on the initial target parameter value and the initial parameter value range for each encoding parameter.

[0120] The current value range of each encoding parameter is no greater than the initial value range of the corresponding encoding parameter.

[0121] For example, the initial target parameter value can be obtained from the training results corresponding to the first training iteration for each encoding parameter. Specifically, since different encoding parameters have different initial parameter value ranges, for encoding parameters with a relatively large initial parameter value range, there exists an initial target parameter value to determine the current parameter value range of the encoding parameter based on the initial target parameter value.

[0122] In practice, there are cases where the initial value range of the encoding parameter is relatively large. For example, if the value range of an encoding parameter is [0, 65535], it means that the value range of the encoding parameter is relatively large. Therefore, it means that the encoding parameter needs to first determine an initial target parameter value, and then determine the target parameter value based on the initial target parameter value.

[0123] In the above embodiments, the current value range of the encoding parameter is determined based on the number of training iterations performed on all test videos using the encoding parameter. For encoding parameters with a large number of training iterations, the value range of the encoding parameter is shortened, thereby reducing the number of training iterations and improving training efficiency.

[0124] In one embodiment, the initial parameter value range includes an initial minimum value and an initial maximum value; including: step 2068, which includes: determining the minimum value of the current parameter value range of each encoding parameter based on the initial minimum value, the initial target parameter value, and the initial adjustment step size; and determining the maximum value of the current parameter value range of each encoding parameter based on the initial maximum value, the initial target parameter value, and the initial adjustment step size.

[0125] For example, the minimum value of the current parameter value range for each encoding parameter can be determined based on the initial minimum value, the initial target parameter value, and the initial adjustment step size; the maximum value of the current parameter value range for each encoding parameter can be determined based on the initial maximum value, the initial target parameter value, and the initial adjustment step size. Specifically, the minimum value of the current parameter value range can be the maximum of the initial minimum value and the initial target parameter value minus the initial adjustment step size. The maximum value of the current parameter value range can be the minimum of the initial maximum value and the initial target parameter value plus the initial adjustment step size.

[0126] In practice, if the initial target parameter value of the encoding parameter is 600, the initial adjustment step size is 100, and the initial parameter value range is [0, 65535], then the minimum value of the current parameter value range is max(600-100, 0), which is 500; the maximum value of the current parameter value range is min(600+100, 65535), which is 700.

[0127] In the above embodiments, the current parameter value range of each encoding parameter is determined based on the initial parameter value range, the initial target parameter value, and the initial adjustment step size. This shortens the parameter value range of the encoding parameters, thereby reducing the number of training iterations and training time, and thus improving the efficiency of obtaining the target parameter value of the encoding parameters.

[0128] In one embodiment, step 208 includes:

[0129] Step 2082: Obtain the current adjustment step size for each encoding parameter.

[0130] Step 2084: Take the minimum value of the current parameter value range corresponding to each encoding parameter as the current initial parameter value.

[0131] Step 2086: Adjust the current initial parameter value according to the current adjustment step size to determine multiple current parameter values ​​corresponding to each encoding parameter.

[0132] The current adjustment step size is determined based on the current value range of the encoding parameters. Specifically, if the current value range of the encoding parameters is large, the corresponding current adjustment step size is also large; if the current value range of the encoding parameters is small, the corresponding current adjustment step size is also small. Therefore, the size of the current adjustment step size is positively correlated with the size of the current value range of the encoding parameters.

[0133] For example, for each encoding parameter, its corresponding current initial parameter value can be set to the minimum value within the current parameter value range. Then, the current initial parameter value is adjusted according to the current adjustment step size to determine multiple current parameter values ​​corresponding to each encoding parameter. Specifically, the multiple current parameter values ​​include the current initial parameter value.

[0134] In practice, if the current value range of an encoding parameter is [10, 20] and the current adjustment step size is 1, then the corresponding initial parameter value is 10, and the corresponding multiple current parameter values ​​are 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, and 20. If the current value range of an encoding parameter is [10, 25] and the current adjustment step size is 2, then the corresponding initial parameter value is 10, and the corresponding multiple current parameter values ​​are 10, 12, 14, 16, 18, 20, 22, 24, and 25. That is, when the current parameter value is 24, the parameter value obtained by adjusting the current parameter value through the current adjustment step size is 26. Since 26 is greater than 25, the value of the last parameter value among the multiple current parameter values ​​is set to the maximum value of the current parameter value range. Therefore, multiple current parameter values ​​can include the maximum value of the current parameter value range.

[0135] In the above embodiments, the current parameter value of the encoding parameter is gradually adjusted by adjusting the current step size and the current parameter value range, so as to cover the parameter values ​​in the current parameter value range as much as possible during training.

[0136] In one embodiment, step 212 includes: for each current parameter value in each encoding parameter, encoding each type of test video using an encoder with a first number of quantization parameters, and decoding using a decoder after encoding to obtain a first number of pairs of bitrate and peak signal-to-noise ratio; generating a test curve corresponding to each current parameter value in the encoding parameters based on the first number of pairs of bitrate and peak signal-to-noise ratio; and obtaining multiple test curves corresponding to each encoding parameter.

[0137] The test curve can be the RD curve obtained by fitting the Bjontegaard model. Specifically, the Bjontegaard model can approximate a smooth RD curve based on some bit rate and the corresponding peak signal-to-noise ratio (PSNR).

[0138] One of the test curves can be obtained by fitting the first order of magnitude of the bit rate and peak signal-to-noise ratio. In practice, the expression for the RD curve in the Bjontegaard model is as follows:

[0139] ;

[0140] Where R represents the bit rate, This represents the peak signal-to-noise ratio (PSNR) corresponding to the bit rate; a, b, c, and d are fitting coefficients. Therefore, to determine the magnitude of the fitting coefficients, four sets of bit rates and PSNRs are needed. Hence, the first number should not be less than 4.

[0141] In practice, when encoding a test video using the current values ​​of the encoding parameters, to prevent errors in the target parameter values ​​due to encoding or decoding issues, decoding is necessary after encoding to obtain a YUV file. The decoded YUV file is then compared to the reconstructed YUV file output from the encoding process to determine if any encoding or decoding problems have occurred. If the YUV file matches the reconstructed YUV file, then the encoding or decoding process is successful. Specifically, the file data and size of the YUV file and the reconstructed YUV file can be compared to determine if an encoding or decoding problem has arisen.

[0142] In one example, the average peak signal-to-noise ratio (PSNR) for each quantization parameter can be calculated based on the decoded YUV file. Specifically, the PSNR of the three components Y, U, and V can be calculated, and these three components can be categorized to obtain preset weight ratios for calculating the average PSNR. The preset weight ratios can be 6, 1, and 1, or can be set according to actual conditions.

[0143] In the above embodiments, a test curve is constructed using a first number of pairs of bitrate and peak signal-to-noise ratio. Based on the test curve, the video encoding effect of using the current parameter value of the encoding parameter to encode the video is determined.

[0144] In one embodiment, step 214 includes:

[0145] Step 2142: Obtain the reference curve.

[0146] The reference curve can be a curve pre-constructed based on any parameter value within the range corresponding to the encoding parameters. Specifically, the reference curve needs to be constructed with the same quantization parameters as the test curve, so that the target parameter value of the encoding parameters can be determined more accurately under the same quantization parameters.

[0147] In one example, taking the determination of a reference curve using an encoding parameter as an example, a quantization parameter is selected, and a parameter value is chosen from the current range of values ​​for that encoding parameter. The encoder reads the parameter value corresponding to that encoding parameter, and all test videos are encoded using that parameter value to obtain the corresponding encoded bitstream. The decoder is then called to decode the encoded bitstream to obtain a YUV file. Based on the YUV file, the bitrate and peak signal-to-noise ratio (PSNR) are obtained. Based on the bitrate and PSNR, the reference curve corresponding to the video is generated. That is, for a given encoding parameter, the number of corresponding reference curves is the same as the number of test videos that need to be encoded.

[0148] Step 2144: Calculate multiple coding evaluation values ​​corresponding to the multiple test curves for each coding parameter and the reference curve; the coding evaluation values ​​include at least one of BD-Rate or BD-PSNR.

[0149] The coding evaluation value is used to assess the quality of encoding using the parameter values ​​corresponding to the test curve and the parameter values ​​corresponding to the reference curve. The coding evaluation value can include at least one of BD-Rate or BD-PSNR. BD-Rate represents the difference in relative bitrate between the same encoder and the same distortion. A BD-Rate less than 0 indicates that the encoding quality using the parameter values ​​corresponding to the test curve is better than that using the parameter values ​​corresponding to the reference curve; a smaller negative value is better, or in other words, a larger absolute negative value is better, meaning more bitrate is saved under the same distortion.

[0150] BD-PSNR represents the difference in peak signal-to-noise ratio at the same bit rate. A BD-PSNR greater than 0 indicates that the encoding quality using the parameter values ​​corresponding to the test curve is better than that using the parameter values ​​of the reference curve.

[0151] In one example, when solving for the BD-Rate, the curve interval between the reference curve and the test curve is selected for the solution. The lower limit of the curve interval is the maximum of the minimum peak signal-to-noise ratios (PSNRs) of the two curves; the upper limit of the curve interval is the minimum of the maximum PSNRs of the two curves.

[0152] In another example, when calculating BD-PSNR, a curve interval between the reference curve and the test curve is selected for the calculation. The lower limit of the curve interval is the maximum of the minimum logarithms of the bitrates of the two curves; the upper limit of the curve interval is the minimum of the maximum logarithms of the bitrates of the two curves.

[0153] Step 2146: Determine the target parameter value for each coding parameter based on the multiple coding evaluation values ​​corresponding to the multiple test curves.

[0154] The target parameter value for each encoding parameter is the optimal parameter value corresponding to that encoding parameter. The optimal parameter value is the parameter value that yields the best video encoding results.

[0155] In one example, if there are 5 test videos participating in the encoding test, then there are 5 test curves corresponding to a single parameter value of the encoding parameter. For the encoding evaluation values ​​corresponding to these 5 curves, the average of these 5 curves can be calculated based on the pre-set weights of the test videos to obtain the final evaluation value. In this way, the final evaluation value for all parameter values ​​of each encoding parameter is calculated, and the target parameter value for each encoding parameter is determined based on the magnitude of the evaluation value. If the encoding evaluation value is BD-Rate, then the parameter value corresponding to the minimum final evaluation value for each encoding parameter is the target parameter value. If the encoding evaluation value is BD-PSNR, then the parameter value corresponding to the maximum final evaluation value for each encoding parameter is the target parameter value. If the encoding evaluation value is both BD-Rate and BD-PSNR, only one type of encoding evaluation value needs to be calculated to determine the target parameter value for each encoding parameter value.

[0156] In the above embodiments, by using the encoding evaluation value to evaluate multiple parameter values ​​in each encoding parameter, the target parameter value of each encoding parameter can be determined more accurately within the current value range of the quantization parameter.

[0157] To better understand the process of obtaining the code rate and peak signal-to-noise ratio for multiple coding parameters in the embodiments of the present invention, a complete example is provided for illustration. (Refer to...) Figure 3 This diagram illustrates the process of obtaining the bitrate and peak signal-to-noise ratio for multiple encoding parameters. Here, i represents the order of the encoding parameters being tested. Specifically, if there are 10 encoding parameters to be tested, they are sorted according to requirements, with a corresponding order of 1-10.

[0158] Step 302: Obtain the number of encoding parameters and the current value range of each encoding parameter.

[0159] Step 304, set i=1. This starts the test corresponding to the first encoded parameter, which is sorted according to the preset order.

[0160] Step 306: Determine whether i is greater than the total number of encoded parameters (Num) participating in the test.

[0161] Step 308: Set the current parameter value to the minimum value within the current parameter's range.

[0162] Step 310: Determine whether the current parameter value A is greater than the maximum value in the current parameter value range. If the current parameter value A is not greater than the maximum value in the current parameter value range, proceed to step 312; if the current parameter value A is greater than the maximum value in the current parameter value range, proceed to step 316.

[0163] Step 312: Call the codec to encode and decode all test videos, and calculate the bitrate and peak signal-to-noise ratio corresponding to the current parameter value A.

[0164] Step 314, A = A + step, where A is the current parameter value and step is the current adjustment step size.

[0165] Step 316, i = i + 1.

[0166] In practice, in response to the need to determine the target parameter value, the current value range of the quantization parameter, the encoding parameters to be included, and the video test set can be obtained, thereby automatically obtaining the peak signal-to-noise ratio and bit rate corresponding to the corresponding parameter values ​​in the encoding parameters.

[0167] In one embodiment, to measure improvements to the encoding algorithm in the encoder, two identical encoders are used, and the encoding algorithm of one of the encoders is modified. The encoder with the unmodified algorithm is set as the reference encoder, and the encoder with the modified algorithm is set as the test encoder. With the same quantization parameters selected, all test videos are encoded using the target parameter values ​​corresponding to the same encoding parameters to obtain the corresponding bitrate and peak signal-to-noise ratio (PSNR). Based on the bitrate and PSNR, curves are constructed to calculate BD-Rate or BD-PSNR to evaluate the improvement of the algorithm in the encoder.

[0168] To better understand the complete process of determining the encoding parameters in the embodiments of the present invention, a complete example is provided for illustration. (Refer to...) Figure 4 The diagram illustrates a flowchart of the encoding parameter determination process in another embodiment, including the following steps:

[0169] Step 402: Obtain the current value range of the quantization parameter, and select the first number of quantization parameters from the current value range of the quantization parameter.

[0170] Step 404: Obtain a test dataset that includes multiple encoding parameters.

[0171] Step 406: Obtain the number of training iterations for encoding all test videos using the encoding parameters.

[0172] Step 408: If the number of training iterations for the encoding parameters is less than the number of iterations in the first iteration, determine the current range of values ​​for the encoding parameters as the initial range of values ​​for the encoding parameters.

[0173] Step 410: If the number of training iterations for the corresponding encoding parameters is not less than the number of iterations in the first iteration, obtain the initial target parameter value for each encoding parameter; determine the minimum value of the current parameter value range for each encoding parameter based on the initial minimum value, the initial target parameter value, and the initial adjustment step size; determine the maximum value of the current parameter value range for each encoding parameter based on the initial maximum value, the initial target parameter value, and the initial adjustment step size.

[0174] Step 412: Obtain the current adjustment step size for each encoding parameter; take the minimum value of the current parameter value range corresponding to each encoding parameter as the current initial parameter value; adjust the current initial parameter value according to the current adjustment step size to determine multiple current parameter values ​​corresponding to each encoding parameter.

[0175] Step 414: Obtain a video test set that includes various types of test videos.

[0176] Step 416: For each current parameter value in each encoding parameter, use the encoder to encode each type of test video using the first number of quantization parameters. After encoding, use the decoder to decode to obtain the first number of pairs of bitrate and peak signal-to-noise ratio. Based on the first number of pairs of bitrate and peak signal-to-noise ratio, generate a test curve corresponding to each current parameter value in the encoding parameters. Obtain multiple test curves corresponding to each encoding parameter.

[0177] Step 418: Obtain the reference curve; calculate multiple coding evaluation values ​​corresponding to the multiple test curves based on the multiple test curves and the reference curve for each coding parameter; determine the target parameter value for each coding parameter based on the multiple coding evaluation values ​​corresponding to the multiple test curves.

[0178] In this embodiment, a first number of quantization parameters are obtained based on the current value range of the quantization parameters; a test dataset including multiple encoding parameters is obtained, and the current value range of each encoding parameter is obtained; the parameter value corresponding to each encoding parameter is determined according to the current value range of each encoding parameter; a video test set including multiple types of test videos is obtained; multiple test curves corresponding to each encoding parameter are obtained based on the parameter value corresponding to each encoding parameter and the multiple types of test videos; and the target parameter value of each encoding parameter is determined based on the multiple test curves corresponding to each encoding parameter. This method, using a test dataset including multiple encoding parameters and multiple types of test videos, obtains test curves for encoding each type of test video with each encoding parameter. Based on the multiple test curves corresponding to each encoding parameter, the effect of using each parameter value of each encoding parameter to encode different types of test videos is reflected. This achieves more accurate determination of the target parameter value of each encoding parameter within the current value range of the quantization parameters, thus ensuring the quality of video encoding using the target parameter value of the encoding parameters.

[0179] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0180] Based on the same inventive concept, this application also provides an encoding parameter determination apparatus for implementing the encoding parameter determination method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more encoding parameter determination apparatus embodiments provided below can be found in the limitations of the encoding parameter determination method described above, and will not be repeated here.

[0181] In one embodiment, such as Figure 5 As shown, an encoding parameter determination device is provided, including: a quantization parameter acquisition module 502, a test dataset acquisition module 504, a current parameter value range acquisition module 506, a parameter value determination module 508, a video test set acquisition module 510, a test curve acquisition module 512, and a target parameter value determination module 514, wherein:

[0182] The quantization parameter acquisition module 502 is used to acquire a first number of quantization parameters based on the current value range of the quantization parameters;

[0183] The test dataset acquisition module 504 is used to acquire a test dataset, which includes multiple encoding parameters;

[0184] The current parameter value range acquisition module 506 is used to acquire the current parameter value range for each encoded parameter;

[0185] The parameter value determination module 508 is used to determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0186] The video test set acquisition module 510 is used to acquire a video test set, which includes various types of test videos.

[0187] The test curve acquisition module 512 is used to acquire multiple test curves corresponding to each encoding parameter based on the parameter value corresponding to each encoding parameter and multiple types of test videos. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it after acquiring a first number of quantization parameters.

[0188] The target parameter value determination module 514 is used to determine the target parameter value of each encoding parameter based on multiple test curves corresponding to each encoding parameter.

[0189] In some embodiments, the quantization parameter acquisition module 502 includes:

[0190] The current value range acquisition unit for quantization parameters is used to acquire the current value range of quantization parameters; the value range of quantization parameters includes the entire value range and at least two partial value ranges obtained by truncating the entire value range;

[0191] The quantization parameter selection unit is used to select a first number of quantization parameters from the current value range of the quantization parameters.

[0192] In some embodiments, the current parameter value range acquisition module 506 includes:

[0193] The training count acquisition unit is used to acquire the number of training counts for encoding all test videos using the encoding parameters;

[0194] The first current value range acquisition unit is used to determine the current parameter value range of the encoding parameter as the initial parameter value range of the encoding parameter when the number of training iterations of the corresponding encoding parameter is less than the first iteration number; the first iteration number is determined based on the initial parameter value range of each encoding parameter and the initial adjustment step size corresponding to the encoding parameter; the initial adjustment step size is determined based on the initial parameter value range of the encoding parameter.

[0195] The initial target parameter value acquisition unit acquires the initial target parameter value for each encoding parameter when the number of training iterations for the corresponding encoding parameter is not less than the first number of iterations; the initial target parameter value is obtained based on the training result corresponding to the first number of training iterations for each encoding parameter;

[0196] The second current value range acquisition unit is used to determine the current parameter value range of each encoding parameter based on the initial target parameter value and the initial parameter value range of each encoding parameter.

[0197] In some embodiments, the initial parameter value range includes an initial minimum value and an initial maximum value; the second current value range acquisition unit is specifically used to determine the minimum value of the current parameter value range of each encoding parameter based on the initial minimum value, the initial target parameter value, and the initial adjustment step size; and to determine the maximum value of the current parameter value range of each encoding parameter based on the initial maximum value, the initial target parameter value, and the initial adjustment step size.

[0198] In some embodiments, the parameter value determination module 508 includes:

[0199] The current adjustment step size acquisition unit is used to acquire the current adjustment step size for each encoding parameter;

[0200] The current initial parameter value unit is used to take the minimum value of the current parameter value range corresponding to each encoded parameter as the current initial parameter value;

[0201] Multiple current parameter value determination units are used to adjust the current initial parameter value according to the current adjustment step size and determine multiple current parameter values ​​corresponding to each encoding parameter.

[0202] In some embodiments, the test curve acquisition module 512 includes:

[0203] The bitrate and peak signal-to-noise ratio (PSNR) obtaining unit is used to encode each type of test video using an encoder for each current parameter value in each encoding parameter, through a first number of quantization parameters, and then decoded using a decoder to obtain a first number of pairs of bitrate and PSNR.

[0204] The test curve generation unit is used to generate a test curve corresponding to each current parameter value in the encoding parameters based on the first number of pairs of bit rate and peak signal-to-noise ratio.

[0205] The multiple test curve acquisition unit is used to acquire multiple test curves corresponding to each encoding parameter.

[0206] In some embodiments, the target parameter value determination module 514 includes:

[0207] Reference curve acquisition unit, used to acquire reference curves;

[0208] The coding evaluation value calculation unit is used to calculate multiple coding evaluation values ​​corresponding to multiple test curves based on multiple test curves for each coding parameter and the reference curve; the coding evaluation value includes at least one of BD-Rate or BD-PSNR;

[0209] The target parameter value determination unit is used to determine the target parameter value of each coding parameter based on multiple coding evaluation values ​​corresponding to multiple test curves.

[0210] Each module in the aforementioned encoding parameter determination device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0211] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores test datasets and video test sets. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a method for determining encoding parameters.

[0212] The display unit of this computer device is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of this computer device can be a touch layer covering the display screen, or buttons, a trackball, or a touchpad set on the casing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0213] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0214] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0215] Based on the current value range of the quantization parameters, obtain the first number of quantization parameters;

[0216] Obtain a test dataset, which includes multiple encoding parameters;

[0217] Get the current value range of each encoded parameter;

[0218] Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0219] Obtain a video test set, which includes various types of test videos;

[0220] Based on the parameter values ​​corresponding to each encoding parameter and various types of test videos, multiple test curves are obtained for each encoding parameter. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it, given a first number of quantization parameters.

[0221] Based on multiple test curves corresponding to each encoding parameter, determine the target parameter value for each encoding parameter.

[0222] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0223] Based on the current value range of the quantization parameters, obtain the first number of quantization parameters;

[0224] Obtain a test dataset, which includes multiple encoding parameters;

[0225] Get the current value range of each encoded parameter;

[0226] Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0227] Obtain a video test set, which includes various types of test videos;

[0228] Based on the parameter values ​​corresponding to each encoding parameter and various types of test videos, multiple test curves are obtained for each encoding parameter. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it, given a first number of quantization parameters.

[0229] Based on multiple test curves corresponding to each encoding parameter, determine the target parameter value for each encoding parameter.

[0230] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0231] Based on the current value range of the quantization parameters, obtain the first number of quantization parameters;

[0232] Obtain a test dataset, which includes multiple encoding parameters;

[0233] Get the current value range of each encoded parameter;

[0234] Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter;

[0235] Obtain a video test set, which includes various types of test videos;

[0236] Based on the parameter values ​​corresponding to each encoding parameter and various types of test videos, multiple test curves are obtained for each encoding parameter. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it, given a first number of quantization parameters.

[0237] Based on multiple test curves corresponding to each encoding parameter, determine the target parameter value for each encoding parameter.

[0238] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0239] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0240] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0241] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for determining encoding parameters, characterized in that, The method includes: Based on the current value range of the quantization parameters, obtain the first number of quantization parameters; Obtain a test dataset, which includes multiple encoding parameters; Obtain the number of training iterations for encoding all test videos using the encoding parameters; the number of training iterations is the number of times all test videos are encoded using the parameter values ​​in the encoding parameters. If the number of training iterations for the corresponding encoding parameter is less than the number of iterations for the first time, the current parameter value range of the encoding parameter is determined as the initial parameter value range of the encoding parameter; the first number of iterations is determined based on the initial parameter value range of each encoding parameter and the initial adjustment step size corresponding to the encoding parameter; the initial adjustment step size is positively correlated with the size of the initial parameter value range of the encoding parameter; the initial parameter value range includes an initial minimum value and an initial maximum value; If the number of training iterations for the corresponding encoding parameter is not less than the first number of iterations, an initial target parameter value is obtained for each encoding parameter; the initial target parameter value is obtained based on the training result corresponding to the first number of training iterations for each encoding parameter. Based on the initial target parameter value and the initial parameter value range of each encoding parameter, determine the current parameter value range of each encoding parameter; Determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter; Obtain a video test set, which includes multiple types of test videos; one or more test videos of one type are included. Based on the parameter values ​​corresponding to each encoding parameter and various types of test videos, multiple test curves are obtained for each encoding parameter. The multiple test curves include curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it, given a first number of quantization parameters. Based on multiple test curves corresponding to each encoding parameter, determine the target parameter value for each encoding parameter.

2. The method according to claim 1, characterized in that, The process of obtaining a first number of quantization parameters based on the current value range of the quantization parameters includes: Obtain the current value range of the quantization parameter; the value range of the quantization parameter includes the entire value range and at least two partial value ranges obtained by truncating the entire value range; Select a first number of quantization parameters from the current value range of the quantization parameters.

3. The method according to claim 2, characterized in that, The step of determining the current parameter value range for each encoding parameter based on the initial target parameter value and the initial parameter value range for each encoding parameter includes: Based on the initial minimum value, the initial target parameter value, and the initial adjustment step size, determine the minimum value of the current parameter value range for each encoding parameter; Based on the initial maximum value, the initial target parameter value, and the initial adjustment step size, determine the maximum value of the current parameter range for each encoding parameter.

4. The method according to claim 3, characterized in that, The step of determining the parameter value corresponding to each encoding parameter based on the current parameter value range corresponding to each encoding parameter includes: Get the current adjustment step size for each encoding parameter; Use the minimum value of the current parameter range corresponding to each encoding parameter as the current initial parameter value; The current initial parameter value is adjusted according to the current adjustment step size to determine multiple current parameter values ​​corresponding to each encoding parameter.

5. The method according to claim 4, characterized in that, The process involves obtaining multiple test curves corresponding to each encoding parameter based on the parameter value corresponding to each encoding parameter and various types of test videos, including: For each current parameter value in each encoding parameter, the encoder encodes each type of test video using a first number of quantization parameters. After encoding, the decoder decodes the video to obtain a first number of pairs of bitrate and peak signal-to-noise ratio. Based on the first pair of bitrate and peak signal-to-noise ratio, generate a test curve corresponding to each current parameter value in the encoding parameters; Obtain multiple test curves corresponding to each encoding parameter.

6. The method according to claim 1, characterized in that, The step of determining the target parameter value for each encoding parameter based on multiple test curves corresponding to each encoding parameter includes: Obtain the reference curve; Based on multiple test curves for each coding parameter and the reference curve, multiple coding evaluation values ​​corresponding to the multiple test curves are calculated; the coding evaluation values ​​include at least one of BD-Rate or BD-PSNR; Based on multiple test curves corresponding to multiple coding evaluation values, the target parameter value for each coding parameter is determined.

7. A device for determining encoding parameters, characterized in that, The device includes: The quantization parameter acquisition module is used to acquire a first number of quantization parameters based on the current value range of the quantization parameters. A test dataset acquisition module is used to acquire a test dataset, which includes multiple encoded parameters. The current parameter value range acquisition module is used to acquire the number of training iterations for encoding all test videos using the encoding parameters. The number of training iterations is the number of times all test videos are encoded using the parameter values ​​in the encoding parameters. If the number of training iterations for a given encoding parameter is less than the first iteration, the current parameter value range of the encoding parameter is determined as the initial parameter value range of the encoding parameter. The first iteration is determined based on the initial parameter value range of each encoding parameter and the initial adjustment step size corresponding to the encoding parameter. The initial adjustment step size is positively correlated with the size of the initial parameter value range of the encoding parameter, and the initial parameter value range includes an initial minimum value and an initial maximum value. If the number of training iterations for a given encoding parameter is not less than the first iteration, an initial target parameter value is acquired for each encoding parameter. The initial target parameter value is obtained based on the training result corresponding to the first iteration of training for each encoding parameter. The current parameter value range of each encoding parameter is determined based on its initial target parameter value and initial parameter value range. The parameter value determination module is used to determine the parameter value corresponding to each encoding parameter based on the current parameter value range of each encoding parameter; The video test set acquisition module is used to acquire a video test set, which includes multiple types of test videos; one or more test videos of a certain type are included. The test curve acquisition module is used to acquire multiple test curves corresponding to each encoding parameter based on the parameter value corresponding to each encoding parameter and multiple types of test videos. The multiple test curves include the curves obtained by encoding each type of test video using each parameter value of the encoding parameter and then decoding it after acquiring a first number of quantization parameters. The target parameter value determination module is used to determine the target parameter value for each encoding parameter based on multiple test curves corresponding to each encoding parameter.

8. The apparatus according to claim 7, characterized in that, The quantization parameter acquisition module includes: The current value range acquisition unit for quantization parameters is used to acquire the current value range of quantization parameters; the value range of quantization parameters includes the entire value range and at least two partial value ranges obtained by truncating the entire value range; The quantization parameter selection unit is used to select a first number of quantization parameters from the current value range of the quantization parameters.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Encoder evaluation method and device, computer equipment and storage medium

    CN112601073A

  • View angle-based VR video coding method and device, storage medium and electronic equipment

    CN115834899A

  • Camera parameter testing method and device, computer equipment and storage medium

    CN116248855A