Parameter adjustment method and device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-09
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]本公开实施例提供一种参数调整方法及装置,能够解决现有技术中降低 了编码的灵活性的问题
[0075]本公开实施例提供一种参数调整装置,在获取到待编码数据时,确定待 编码数据的类型,根据待编码数据的类型确定对应的目标参数调整策略,进 而根据目标参数调整策略对待编码数据进行编码。可知,本公开可根据待编 码数据的类型的不同,选用不同的目标参数调整策略,从而提高了编码的灵 活性。
Smart Images

Figure CN113038177B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image technology, and in particular to parameter adjustment methods and apparatus. Background Technology
[0002] Cloud desktops are typically used in scenarios such as cloud office work, cloud design, and cloud gaming. Each scenario has different requirements for resource configuration, user experience, and technical specifications. The core technology of cloud desktops is the image transmission protocol, which requires encoding and decoding of the screen.
[0003] In related technologies, during the encoding stage, the encoder parameters are preset, and the encoder encodes according to the preset parameters.
[0004] However, in the above technologies, the encoder parameters are fixed, which reduces the flexibility of encoding. Summary of the Invention
[0005] This disclosure provides a parameter adjustment method and apparatus, which can solve the problem of reduced coding flexibility in the prior art. The technical solution is as follows:
[0006] According to a first aspect of the present disclosure, a parameter adjustment method is provided, the method comprising:
[0007] Obtain the data to be encoded;
[0008] Determine the type of the data to be encoded;
[0009] Determine the corresponding target parameter adjustment strategy based on the type of the data to be encoded;
[0010] The data to be encoded is encoded according to the target parameter adjustment strategy.
[0011] This disclosure provides a parameter adjustment method. Upon obtaining data to be encoded, the method determines the type of the data, determines a corresponding target parameter adjustment strategy based on the data type, and then encodes the data according to the target parameter adjustment strategy. It is understood that this disclosure can select different target parameter adjustment strategies depending on the type of data to be encoded, thereby improving the flexibility of the encoding process.
[0012] In one embodiment, when the type of the data to be encoded is a design type, the step of encoding the data to be encoded according to the target parameter adjustment strategy includes:
[0013] Obtain the highest quality coefficient and minimum acceptable frame rate for visual lossless imaging;
[0014] The highest quality coefficient of visual lossless is determined as the first current quality coefficient, the minimum acceptable frame rate is determined as the first current available frame rate, and the initial frame image of the data to be encoded is encoded to obtain the first initial target bit rate;
[0015] When it is determined that the first initial target bitrate is less than the maximum bandwidth limit, the value of the first current available frame rate is increased by the first preset step value within the first preset range to obtain a new first current available frame rate;
[0016] The next frame of the data to be encoded is encoded based on the new first current available frame rate and the first current quality coefficient to obtain the first current target bit rate;
[0017] When it is determined that the first current target bitrate is less than the maximum bandwidth limit, the step of increasing the value of the first current available frame rate within the first preset range according to the first preset step value continues until the first current available frame rate increases to the maximum frame rate.
[0018] In one embodiment, it also includes:
[0019] When it is determined that the first current target bitrate is greater than the maximum bandwidth limit, the value of the first current available frame rate is reduced according to the first preset step value to obtain a new first current available frame rate, and the step of encoding the next frame image of the data to be encoded according to the new first current available frame rate and the first current quality coefficient continues to be executed.
[0020] In one embodiment, it also includes:
[0021] When it is determined that the first initial target bitrate is greater than the maximum bandwidth limit, the value of the first current quality coefficient is reduced within a second preset range according to a second preset step value to obtain a new first current quality coefficient.
[0022] The next frame of the data to be encoded is encoded according to the new first current quality coefficient and the current available frame rate to obtain the second current target bit rate;
[0023] When it is determined that the second current target bitrate is greater than the maximum bandwidth limit, the step of reducing the value of the first current quality coefficient according to the second preset step value within the second preset range continues until the first current quality coefficient is reduced to the visual lossless minimum quality coefficient.
[0024] In one embodiment, it also includes:
[0025] When it is determined that the second current target bitrate is less than the maximum bandwidth limit, the value of the first current quality coefficient is increased within the second preset range according to the second preset step value to obtain a new first current quality coefficient, and the step of encoding the next frame image of the data to be encoded according to the new first current quality coefficient and the first current available frame rate continues to be executed.
[0026] In one embodiment, it also includes:
[0027] When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded according to the visual lossless minimum quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, the value of the first current quality coefficient is reduced within the third preset range according to the third preset step value to obtain a new first current quality coefficient.
[0028] The next frame of the data to be encoded is encoded based on the new first current quality coefficient and the first current available frame rate to obtain the third current target bit rate;
[0029] When it is determined that the third current target bit rate is greater than the maximum bandwidth limit, the step of reducing the value of the first current quality coefficient within the third preset range according to the third preset step value continues until the first current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0030] In one embodiment, it also includes:
[0031] When it is determined that the third current target bitrate is less than the maximum bandwidth limit, the value of the first current quality coefficient is increased according to the third preset step value within the third preset range, and the step of encoding the next frame image of the data to be encoded according to the new first current quality coefficient and the first current available frame rate continues to be executed.
[0032] In one embodiment, it also includes:
[0033] When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded according to the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, an image encoding failure message is displayed.
[0034] In one embodiment, when the type of the data to be encoded is office-related or game-related, the step of encoding the data to be encoded according to the target parameter adjustment strategy includes:
[0035] Obtain the initial image quality score and maximum frame rate;
[0036] The initial image quality coefficient is determined as the second current quality coefficient, the maximum frame rate is determined as the second current available frame rate, and the initial frame image of the data to be encoded is encoded to obtain the second initial target bit rate;
[0037] When it is determined that the second initial target bit rate is less than the maximum bandwidth limit, the value of the second current quality coefficient is increased according to the fourth preset step value within the fourth preset range to obtain a new second current quality coefficient.
[0038] The next frame of the data to be encoded is encoded based on the new second current quality coefficient and the second current available frame rate to obtain the fourth current target bit rate;
[0039] When it is determined that the fourth current target bit rate is less than the maximum limited bandwidth, the step of increasing the value of the second current quality coefficient within the fourth preset range according to the fourth preset step value continues until the second current quality coefficient increases to the highest visual lossless quality coefficient.
[0040] In one embodiment, it also includes:
[0041] When it is determined that the fourth current target bit rate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced according to the fourth preset step value to obtain a new second current quality coefficient, and the next frame image of the data to be encoded is encoded according to the new second current quality coefficient and the second current available frame rate.
[0042] In one embodiment, when the type of the data to be encoded is office type, it further includes:
[0043] When it is determined that the second initial target bitrate is greater than the maximum bandwidth limit, the value of the second current available frame rate is reduced within the fifth preset range according to the fifth preset step value to obtain a new second current available frame rate;
[0044] The next frame of the data to be encoded is encoded according to the new second currently available frame rate and the second current quality coefficient to obtain the fifth current target bit rate;
[0045] When it is determined that the fifth current target bitrate is greater than the maximum bandwidth limit, the step of reducing the value of the second current available frame rate within the fifth preset range according to the fifth preset step value continues until the second current available frame rate is reduced to the minimum acceptable frame rate.
[0046] In one embodiment, it also includes:
[0047] When it is determined that the fifth current target bitrate is less than the maximum bandwidth limit, the value of the current available frame rate is increased within the fifth preset range according to the fifth preset step value to obtain a new second current available frame rate, and the next frame image of the data to be encoded is encoded according to the new second current available frame rate and the new second current quality coefficient.
[0048] In one embodiment, it also includes:
[0049] When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded based on the second current quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient.
[0050] The next frame of the data to be encoded is encoded according to the new second current quality coefficient and the minimum acceptable frame rate to obtain the sixth current target bitrate;
[0051] When it is determined that the sixth current target bitrate is greater than the maximum bandwidth limit, the step of reducing the value of the second current quality coefficient within the sixth preset range according to the sixth preset step value continues until the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0052] In one embodiment, it also includes:
[0053] When it is determined that the sixth current target bit rate is less than the maximum bandwidth limit, the value of the second current quality coefficient is increased within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient, and the next frame image of the data to be encoded is encoded according to the new second current quality coefficient and the minimum acceptable frame rate.
[0054] In one embodiment, it also includes:
[0055] When it is determined that the bitrate for encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, an image encoding failure message is displayed.
[0056] In one embodiment, when the type of the data to be encoded is a game type, it further includes:
[0057] When it is determined that the second initial target bitrate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient.
[0058] The next frame of the data to be encoded is encoded according to the new second current quality coefficient and the second current available frame rate to obtain the seventh current target bit rate;
[0059] When it is determined that the seventh current target bit rate is greater than the maximum bandwidth limit, the step of reducing the value of the second current quality coefficient within the seventh preset range according to the seventh preset step value continues until the value of the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0060] In one embodiment, it also includes:
[0061] When it is determined that the seventh current target bitrate is less than the maximum bandwidth limit, the value of the second current quality coefficient is increased within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient, and the step of encoding the next frame image of the data to be encoded according to the new second current quality coefficient and the second current available frame rate continues to be executed.
[0062] In one embodiment, it also includes:
[0063] When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the second current available frame rate is greater than the maximum bandwidth limit, the value of the second current available frame rate is reduced within the eighth preset range according to the eighth preset step value to obtain a new second current available frame rate;
[0064] The next frame of the data to be encoded is encoded according to the new second currently available frame rate and the minimum acceptable quality coefficient to obtain the eighth current target bit rate;
[0065] When it is determined that the eighth current target bitrate is greater than the maximum bandwidth limit, the step of reducing the value of the second current available frame rate within the eighth preset range according to the eighth preset step value continues to be executed until the second current available frame rate is reduced to the minimum acceptable frame rate.
[0066] In one embodiment, it also includes:
[0067] When it is determined that the eighth current target bitrate is less than the maximum bandwidth limit, the value of the second current available frame rate is increased by the eighth preset step value within the eighth preset range to obtain a new second current available frame rate, and the step of encoding the next frame image of the data to be encoded based on the new second current available frame rate and the minimum acceptable quality coefficient continues to be executed.
[0068] In one embodiment, it also includes:
[0069] When it is determined that the bitrate for encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, an image encoding failure message is displayed.
[0070] According to a second aspect of the present disclosure, a parameter adjustment device is provided, comprising:
[0071] The acquisition module is used to acquire the data to be encoded.
[0072] The first determining module is used to determine the type of the data to be encoded;
[0073] The second determining module is used to determine the corresponding target parameter adjustment strategy according to the type of the data to be encoded.
[0074] The encoding module is used to encode the data to be encoded according to the target parameter adjustment strategy.
[0075] This disclosure provides a parameter adjustment device that, upon acquiring data to be encoded, determines the type of the data, determines a corresponding target parameter adjustment strategy based on the data type, and then encodes the data according to the target parameter adjustment strategy. It is understood that this disclosure can select different target parameter adjustment strategies depending on the type of data to be encoded, thereby improving the flexibility of encoding.
[0076] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0077] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0078] Figure 1 This is a flowchart of a parameter adjustment method provided in an embodiment of this disclosure;
[0079] Figure 2 This is a flowchart of a parameter adjustment method provided in an embodiment of this disclosure;
[0080] Figure 3 This is a flowchart of a parameter adjustment method provided in an embodiment of this disclosure;
[0081] Figure 4 This is a flowchart of a parameter adjustment method provided in an embodiment of this disclosure;
[0082] Figure 5 This is a structural diagram of a parameter adjustment device provided in an embodiment of this disclosure. Detailed Implementation
[0083] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0084] This disclosure provides a parameter adjustment method, such as... Figure 1 As shown, the method includes the following steps:
[0085] Step 101: Obtain the data to be encoded.
[0086] Step 102: Determine the type of the data to be encoded.
[0087] For example, a pre-stored mapping between the identifier information and type of the data to be encoded is used. When the data to be encoded is obtained, the corresponding type of the data to be encoded is found based on its identifier information. The mapping between the identifier information and type of the data to be encoded includes: office type corresponding to the first identifier information, design type corresponding to the second identifier information, and game type corresponding to the third identifier information. Thus, if the identifier information of the data to be encoded is determined to be the first identifier information, then the type of the data to be encoded is determined to be office type. The specific values of the first, second, and third identifier information can be set according to actual needs, as long as they can distinguish between the various types; this disclosure does not impose any limitations on this.
[0088] Step 103: Determine the corresponding target parameter adjustment strategy based on the type of the data to be encoded.
[0089] For example, the correspondence between the types of data to be encoded and parameter adjustment strategies is stored in advance. When the type of data to be encoded is determined, the target parameter adjustment strategy corresponding to the type of data to be encoded can be found in the correspondence list.
[0090] Step 104: Encode the data to be encoded according to the target parameter adjustment strategy.
[0091] Optional, such as Figure 2 As shown, when the type of the data to be encoded is a design type, encoding the data to be encoded according to the target parameter adjustment strategy can be achieved through the following steps:
[0092] Step 1041a: Obtain the highest quality coefficient and minimum acceptable frame rate for visual losslessness.
[0093] For example, the highest visual lossless quality coefficient and the minimum acceptable frame rate are both preset by the user or customized according to the application scenario. When it is determined that the type of data to be encoded is the design type, the preset highest visual lossless quality coefficient and minimum acceptable frame rate are retrieved from the memory.
[0094] It should be noted that the highest coefficient for visual lossless quality can be set to 100 by default, and the minimum acceptable frame rate can be obtained through POC (Proof of Concept) test results.
[0095] Step 1042a: Determine the highest visual lossless quality coefficient as the first current quality coefficient, determine the minimum acceptable frame rate as the first current available frame rate, encode the initial frame image of the data to be encoded, and obtain the first initial target bit rate.
[0096] The maximum bandwidth limit is the maximum bandwidth that can be allocated, which can be set by the user or customized according to the scenario.
[0097] For example, when the highest visual lossless quality coefficient and the minimum acceptable frame rate are obtained, the highest visual lossless quality coefficient is used as the first current quality coefficient, and the minimum acceptable frame rate is used as the first current available frame rate. Then, the initial frame of the data to be encoded is encoded according to the first current quality coefficient and the first current available frame rate to obtain the first initial target bit rate.
[0098] It should be noted that the following steps will be executed differently depending on the comparison result between the first initial target bit rate and the maximum limited bandwidth. When it is determined that the first initial target bit rate is less than the maximum limited bandwidth, steps 1043a to 1046a will be executed; when it is determined that the first initial target bit rate is greater than the maximum limited bandwidth, steps 1047a to 10415a will be executed.
[0099] Step 1043a: When it is determined that the first initial target bit rate is less than the maximum bandwidth limit, the value of the first current available frame rate is increased by the first preset step value within the first preset range to obtain a new first current available frame rate.
[0100] For example, when the first initial target bitrate is obtained, the first initial target bitrate is compared with the maximum limited bandwidth. If it is determined that the first initial target bitrate is less than the maximum limited bandwidth, it indicates that the first initial target bitrate is small. The value of the first current available frame rate is increased by the first preset step value within the first preset range to obtain the new first current available frame rate.
[0101] It should be noted that the first preset step value can be set according to requirements. For example, the first preset step value is equal to 5. This disclosure does not limit this.
[0102] Step 1044a: Encode the next frame of the data to be encoded according to the new first current available frame rate and the first current quality coefficient to obtain the first current target bit rate.
[0103] Wherein, the sum of the current available frame rate and the first preset value is less than or equal to the maximum frame rate.
[0104] For example, each time a new first currently available frame rate is obtained, the next frame of data to be encoded is encoded based on the new first currently available frame rate and the first current quality coefficient to obtain the first current target bit rate.
[0105] It should be noted that the following steps will be executed differently depending on the comparison result between the first current target bitrate and the maximum limited bandwidth. If it is determined that the first current target bitrate is less than the maximum limited bandwidth, then step 1045a will be executed; if it is determined that the first current target bitrate is greater than the maximum limited bandwidth, then step 1046a will be executed.
[0106] Step 1045a: When it is determined that the first current target bitrate is less than the maximum bandwidth limit, continue to execute the step of increasing the value of the first current available frame rate according to the first preset step value within the first preset range, until the first current available frame rate increases to the maximum frame rate.
[0107] For example, when the first current target bitrate is obtained, the first current target bitrate is compared with the maximum limited bandwidth. When it is determined that the first current target bitrate is less than the maximum limited bandwidth, the step of increasing the value of the first current available frame rate within a preset range according to the first preset step value continues, that is, returning to step 1043a, and repeating the process until the first current available frame rate increases to the maximum frame rate.
[0108] Step 1046a: When it is determined that the first current target bitrate is greater than the maximum bandwidth limit, the value of the first current available frame rate is reduced according to the first preset step value to obtain a new first current available frame rate, and the step of encoding the next frame image of the data to be encoded according to the new first current available frame rate and the first current quality coefficient is continued.
[0109] For example, when it is determined that the first current target bitrate is greater than the maximum bandwidth limit, it means that the first current target bitrate is too large. At this time, the value of the first current available frame rate is reduced according to the first preset step value to obtain a new first current available frame rate, and then the process returns to step 1044a to perform the step of encoding the next frame image of the data to be encoded according to the new first current available frame rate and the first current quality coefficient.
[0110] Step 1047a: When it is determined that the first initial target bit rate is greater than the maximum limited bandwidth, the value of the first current quality coefficient is reduced within a second preset range according to a second preset step value to obtain a new first current quality coefficient.
[0111] For example, if the first initial target bit rate is determined to be greater than the maximum bandwidth limit, it means that the first current quality coefficient is too large. It is necessary to reduce the value of the first current quality coefficient within the second preset range according to the second preset step value to obtain a new first current quality coefficient.
[0112] It should be noted that the second preset step value can be set according to requirements. For example, the second preset step value is equal to 5. This disclosure does not limit this.
[0113] Step 1048a: Encode the next frame of the data to be encoded according to the new first current quality coefficient and the current available frame rate to obtain the second current target bit rate.
[0114] For example, upon obtaining a new first current quality coefficient, the next frame of the data to be encoded is encoded based on the new first current quality coefficient and the current available frame rate to obtain a second current target bitrate.
[0115] It should be noted that the following steps will be executed differently depending on the comparison result between the second current target bitrate and the maximum limited bandwidth. When it is determined that the second current target bitrate is greater than the maximum limited bandwidth, steps 1049a, 10411a to 10415a will be executed; when it is determined that the second current target bitrate is less than the maximum limited bandwidth, step 10410a will be executed.
[0116] Step 1049a: When it is determined that the second current target bit rate is greater than the maximum limited bandwidth, continue to execute the step of reducing the value of the first current quality coefficient according to the second preset step value within the second preset range, until the first current quality coefficient is reduced to the visual lossless minimum quality coefficient.
[0117] For example, when the second current target bitrate is obtained, it is compared with the maximum limited bandwidth. If the second current target bitrate is greater than the maximum limited bandwidth, it indicates that the value of the first current quality coefficient is still relatively large. The process then returns to step 1047a to reduce the value of the first current quality coefficient within a second preset range according to a second preset step value, until the first current quality coefficient decreases to the visually lossless minimum quality coefficient. This visually lossless minimum quality coefficient is preset by the user and is a lossy coding quality coefficient that is difficult for the user's vision to perceive. The specific value can be based on the POC result. This visually lossless minimum quality coefficient is less than the visually lossless maximum quality coefficient.
[0118] Step 10410a: When it is determined that the second current target bit rate is less than the maximum bandwidth limit, the value of the first current quality coefficient is increased within the second preset range according to the second preset step value to obtain a new first current quality coefficient, and the step of encoding the next frame image of the data to be encoded according to the new first current quality coefficient and the first current available frame rate continues to be executed.
[0119] For example, when it is determined that the second current target bit rate is less than the maximum bandwidth limit, it means that the value of the first current quality coefficient is still relatively small. At this time, the value of the first current quality coefficient is increased within the second preset range according to the second preset step value to obtain a new first current quality coefficient, and step 1048a is continued.
[0120] Step 10411a: When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded based on the visual lossless minimum quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, the value of the first current quality coefficient is reduced within the third preset range according to the third preset step value to obtain a new first current quality coefficient.
[0121] For example, when the minimum visual lossless quality coefficient and the minimum acceptable frame rate are obtained, the next frame of the image to be encoded is encoded according to the minimum visual lossless quality coefficient and the minimum acceptable frame rate. The actual bit rate is then compared with the maximum limited bandwidth. If it is determined that the actual bit rate is greater than the maximum limited bandwidth, it means that the first current quality coefficient is still relatively large. At this time, the value of the first current quality coefficient is reduced within the third preset range according to the third preset step value to obtain a new first current quality coefficient.
[0122] Step 10412a: Encode the next frame of the data to be encoded according to the new first current quality coefficient and the first current available frame rate to obtain the third current target bit rate.
[0123] For example, upon obtaining a new first current quality coefficient, the next frame of the image to be encoded is encoded based on the new first current quality coefficient and the minimum acceptable frame rate to obtain a third current target bit rate, and the image encoding lossy is displayed to the user.
[0124] It should be noted that the following steps will be executed differently depending on the comparison result between the third current target bitrate and the maximum limited bandwidth. When it is determined that the third current target bitrate is greater than the maximum limited bandwidth, steps 10413a and 10415a will be executed; when it is determined that the third current target bitrate is less than the maximum limited bandwidth, step 10414a will be executed.
[0125] Step 10413a: When it is determined that the third current target bit rate is greater than the maximum bandwidth limit, continue to execute the step of reducing the value of the first current quality coefficient within the third preset range according to the third preset step value, until the first current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0126] For example, when the third current target bitrate is obtained, it is compared with the maximum bandwidth limit. If the third current target bitrate is determined to be greater than the maximum bandwidth limit, it indicates that the first current command coefficient is still relatively large. At this point, the process continues to reduce the value of the first current quality coefficient within a third preset range according to a third preset step value, until the first current quality coefficient decreases to the minimum acceptable quality coefficient. This minimum acceptable quality coefficient is preset by the user, and its value can be determined based on the POC test results.
[0127] Step 10414a: When it is determined that the third current target bit rate is less than the maximum bandwidth limit, the value of the first current quality coefficient is increased within the third preset range according to the third preset step value, and the step of encoding the next frame image of the data to be encoded according to the new first current quality coefficient and the first current available frame rate continues to be executed.
[0128] For example, when it is determined that the third current target bit rate is less than the maximum bandwidth limit, it means that the first current instruction coefficient is still relatively small. At this time, the value of the first current quality coefficient is increased according to the third preset step value within the third preset range, and step 10412a is continued to be executed, that is, the step of encoding the next frame of the image to be encoded according to the new first current quality coefficient and the first current available frame rate is executed, and the image encoding loss is displayed to the user.
[0129] It should be noted that the third preset step value can be set according to requirements. For example, the third preset step value is equal to 5. This disclosure does not limit this.
[0130] Step 10415a: When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded according to the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, the image encoding failure information is displayed.
[0131] For example, when the minimum acceptable quality coefficient is obtained, the next frame of the data to be encoded is encoded according to the minimum acceptable quality coefficient and the minimum acceptable frame rate, and the obtained bit rate is compared with the maximum limited bandwidth. If it is determined that the obtained bit rate is greater than the maximum limited bandwidth, it indicates that the image encoding has failed. At this time, the image encoding failure information is displayed to remind the user to reduce the resolution of the display device or upgrade the hardware configuration.
[0132] As can be seen from the above, when the type of data to be encoded is design type, this disclosure adopts an image quality priority and frame rate progressive adjustment strategy. The initial image quality coefficient is preferentially adopted to be a value lower than the highest visual lossless quality coefficient, for example, the highest visual lossless quality coefficient is 100.
[0133] Optional, such as Figure 3 As shown, when the type of the data to be encoded is office type, encoding the data to be encoded according to the target parameter adjustment strategy can be achieved through the following steps:
[0134] Step 1041b: Obtain the initial image quality coefficient and maximum frame rate.
[0135] For example, the initial image quality coefficient and maximum frame rate are preset by the user or customized according to the application scenario. When it is determined that the type of data to be encoded is office type, the preset initial image quality coefficient and maximum frame rate are retrieved from the memory.
[0136] It should be noted that the initial image quality coefficient is the initial quality coefficient that limits the first displayed image frame. It can be set by the user or customized according to the scenario, and is usually set to 70-80. The maximum frame rate is the maximum expected encoding frame rate, which can be set by the user or customized according to the scenario. For example, by default, the maximum frame rate is 60 for design scenarios, 30 for office scenarios, and 144 for game scenarios.
[0137] Step 1042b: Determine the initial image quality coefficient as the second current quality coefficient, determine the maximum frame rate as the second current available frame rate, encode the initial frame image of the data to be encoded, and obtain the second initial target bit rate.
[0138] For example, upon obtaining the initial image quality coefficient and the maximum frame rate, the initial image quality coefficient is determined as the second current quality coefficient, and the maximum frame rate is determined as the second currently available frame rate. Then, the initial frame image of the data to be encoded is encoded based on the second current quality coefficient and the second currently available frame rate to obtain the second initial target bitrate. The visually lossless quality coefficient is a lossy coding quality coefficient that is difficult for the user's visual perception to perceive; its value is greater than the initial image quality coefficient, and the POC test results can be used as the standard.
[0139] It should be noted that the following steps will differ depending on the comparison result between the second initial target bit rate and the maximum limited bandwidth. If the second initial target bit rate is determined to be less than the maximum limited bandwidth, steps 1043b to 1046b will be executed; if the second initial target bit rate is determined to be greater than the maximum limited bandwidth, steps 1047b to 10415b will be executed.
[0140] Step 1043b: When it is determined that the second initial target bit rate is less than the maximum limited bandwidth, the value of the second current quality coefficient is increased within the fourth preset range according to the fourth preset step value to obtain a new second current quality coefficient.
[0141] For example, when the second initial target bitrate is obtained, it is compared with the maximum limited bandwidth. If the second initial target bitrate is determined to be less than the maximum limited bandwidth, it indicates that the value of the second current quality coefficient is small. At this time, the value of the second current quality coefficient is increased within the fourth preset range according to the fourth preset step value to obtain a new second current quality coefficient.
[0142] It should be noted that the fourth preset step value can be set according to requirements. For example, the fourth preset step value is equal to 5. This disclosure does not limit this.
[0143] Step 1044b: Encode the next frame of the data to be encoded according to the new second current quality coefficient and the second current available frame rate to obtain the fourth current target bit rate.
[0144] For example, upon obtaining a new second current quality coefficient, the next frame of the data to be encoded is encoded based on the new second current quality coefficient and the second current available frame rate to obtain a fourth current target bit rate.
[0145] It should be noted that the following steps will differ depending on the comparison result between the fourth current target bitrate and the maximum limited bandwidth. If the fourth current target bitrate is determined to be less than the maximum limited bandwidth, then step 1045b will be executed; if the fourth current target bitrate is determined to be greater than the maximum limited bandwidth, then step 1046b will be executed.
[0146] Step 1045b: When it is determined that the fourth current target bit rate is less than the maximum limited bandwidth, continue to execute the step of increasing the value of the second current quality coefficient within the fourth preset range according to the fourth preset step value, until the second current quality coefficient increases to the highest visual lossless quality coefficient.
[0147] For example, when the fourth current target bitrate is obtained, the fourth current target bitrate is compared with the maximum limited bandwidth. If it is determined that the fourth current target bitrate is less than the maximum limited bandwidth, it means that the value of the second current quality coefficient is small. At this time, step 1043b is continued to be executed, and the value of the second current quality coefficient is increased according to the fourth preset step value within the fourth preset range until the second current quality coefficient is increased to the highest quality coefficient of visual lossless.
[0148] Step 1046b: When it is determined that the fourth current target bit rate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced according to the fourth preset step value to obtain a new second current quality coefficient, and the next frame image of the data to be encoded is encoded according to the new second current quality coefficient and the second current available frame rate.
[0149] For example, when it is determined that the fourth current target bit rate is less than the maximum bandwidth limit, it indicates that the value of the second current quality coefficient is large. At this time, the value of the second current quality coefficient is reduced according to the fourth preset step value to obtain a new second current quality coefficient, and step 1044b is continued, that is, the step of encoding the next frame image of the data to be encoded according to the new second current quality coefficient and the second current available frame rate is performed.
[0150] Step 1047b: When it is determined that the second initial target bit rate is greater than the maximum bandwidth limit, the value of the second current available frame rate is reduced within the fifth preset range according to the fifth preset step value to obtain a new second current available frame rate.
[0151] For example, if the second initial target bitrate is determined to be greater than the maximum bandwidth limit, it indicates that the value of the second currently available frame rate is relatively large. In this case, the value of the second currently available frame rate is reduced within the fifth preset range according to the fifth preset step value to obtain a new second currently available frame rate. This second currently available frame rate is the available frame rate, which is preset by the user or customized. The available frame rate is the maximum frame rate at which the image is displayed continuously without obvious jitter, and its value is less than the maximum frame rate but greater than the minimum acceptable frame rate.
[0152] It should be noted that the fifth preset step value can be set according to requirements. For example, the fifth preset step value is equal to 5. This disclosure does not limit this.
[0153] Step 1048b: Encode the next frame of the data to be encoded according to the new second currently available frame rate and the second current quality coefficient to obtain the fifth current target bit rate.
[0154] For example, when a new second currently available frame rate is obtained, the next frame of the data to be encoded is encoded according to the new second currently available frame rate and the second current quality coefficient to obtain the fifth current target bit rate.
[0155] It should be noted that the following steps will differ depending on the comparison result between the fifth current target bitrate and the maximum limited bandwidth. When it is determined that the fifth current target bitrate is greater than the maximum limited bandwidth, steps 1049b, 10411b to 10415b will be executed; when it is determined that the fifth current target bitrate is less than the maximum limited bandwidth, step 10410b will be executed.
[0156] Step 1049b: When it is determined that the fifth current target bitrate is greater than the maximum bandwidth limit, continue to execute the step of reducing the value of the second current available frame rate within the fifth preset range according to the fifth preset step value, until the second current available frame rate is reduced to the minimum acceptable frame rate.
[0157] For example, when the fifth current target bitrate is obtained, the fifth current target bitrate is compared with the maximum limited bandwidth. If it is determined that the fifth current target bitrate is greater than the maximum limited bandwidth, it means that the value of the second current available frame rate is still relatively large. At this time, step 1047a is continued to be executed, and the value of the second current available frame rate is reduced according to the fifth preset step value within the fifth preset range until the second current available frame rate is reduced to the minimum acceptable frame rate.
[0158] Step 10410b: When it is determined that the fifth current target bit rate is less than the maximum bandwidth limit, the value of the current available frame rate is increased within the fifth preset range according to the fifth preset step value to obtain a new second current available frame rate, and the next frame image of the data to be encoded is encoded according to the new second current available frame rate and the new second current quality coefficient.
[0159] For example, when it is determined that the fifth current target bitrate is less than the maximum bandwidth limit, it means that the value of the second current available frame rate is relatively small. At this time, the value of the current available frame rate is increased within the fifth preset range according to the fifth preset step value to obtain a new second current available frame rate, and the next frame image of the data to be encoded is encoded according to the new second current available frame rate and the new second current quality coefficient.
[0160] Step 10411b: When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded based on the second current quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient.
[0161] For example, when the minimum acceptable frame rate is obtained, the next frame of the data to be encoded is encoded according to the second current quality coefficient and the minimum acceptable frame rate, and the obtained bit rate is compared with the maximum limited bandwidth. When it is determined that the obtained bit rate is greater than the maximum limited bandwidth, it indicates that the value of the second current quality coefficient is large. At this time, the value of the second current quality coefficient is reduced within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient.
[0162] It should be noted that the sixth preset step value can be set according to requirements. For example, the sixth preset step value is equal to 5. This disclosure does not limit this.
[0163] Step 10412b: Encode the next frame of the data to be encoded according to the new second current quality coefficient and the minimum acceptable frame rate to obtain the sixth current target bit rate.
[0164] For example, upon obtaining a new second current quality coefficient, the next frame of the data to be encoded is encoded based on the new second current quality coefficient and the minimum acceptable frame rate to obtain a sixth current target bit rate, and the lossy image is displayed to the user.
[0165] It should be noted that the following steps will differ depending on the comparison result between the sixth current target bitrate and the maximum limited bandwidth. When it is determined that the sixth current target bitrate is greater than the maximum limited bandwidth, steps 10413b and 10415b will be executed; when it is determined that the sixth current target bitrate is less than the maximum limited bandwidth, step 10414b will be executed.
[0166] Step 10413b: When it is determined that the sixth current target bit rate is greater than the maximum limited bandwidth, continue to execute the step of reducing the value of the second current quality coefficient within the sixth preset range according to the sixth preset step value, until the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0167] For example, when the sixth current target bitrate is obtained, the sixth current target bitrate is compared with the maximum limited bandwidth. If it is determined that the sixth current target bitrate is greater than the maximum limited bandwidth, it means that the value of the second current quality coefficient is relatively large. At this time, the value of the second current quality coefficient continues to be reduced within the sixth preset range according to the sixth preset step value until the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0168] Step 10414b: When it is determined that the sixth current target bit rate is less than the maximum bandwidth limit, the value of the second current quality coefficient is increased within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient, and the next frame image of the data to be encoded is encoded according to the new second current quality coefficient and the minimum acceptable frame rate.
[0169] For example, when it is determined that the sixth current target bit rate is less than the maximum bandwidth limit, it means that the value of the second current quality coefficient is relatively small. At this time, the value of the second current quality coefficient is increased within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient, and step 10412b is continued to be executed. The next frame image of the data to be encoded is encoded according to the new second current quality coefficient and the minimum acceptable frame rate.
[0170] Step 10415b: When it is determined that the bitrate for encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, an image encoding failure message is displayed.
[0171] For example, when the lowest acceptable quality coefficient is obtained, the next frame of the data to be encoded is encoded based on the lowest acceptable quality coefficient and the minimum acceptable frame rate. The obtained bit rate is compared with the maximum limited bandwidth. If it is determined that the obtained bit rate is greater than the maximum limited bandwidth, it indicates that the encoding has failed. At this time, a decoding failure message is displayed to remind the user to reduce the resolution of the display device or upgrade the hardware configuration.
[0172] As can be seen from the above, when the type of data to be encoded is office type, this disclosure adopts a balance adjustment strategy, and the initial image quality coefficient can be set to 75, so that the final determined target decoding frame rate meets the encoding of office scene.
[0173] Optional, such as Figure 4 As shown, when the type of the data to be encoded is a game type, encoding the data to be encoded according to the target parameter adjustment strategy can be achieved through the following steps:
[0174] Step 1041c: Obtain the initial image quality coefficient and maximum frame rate.
[0175] For example, the initial image quality coefficient and maximum frame rate are preset by the user or customized according to the application scenario. When it is determined that the type of data to be encoded is office type, the preset initial image quality coefficient and maximum frame rate are retrieved from the memory.
[0176] Step 1042c: Determine the initial image quality coefficient as the second current quality coefficient, determine the maximum frame rate as the second current available frame rate, encode the initial frame image of the data to be encoded, and obtain the second initial target bit rate.
[0177] For example, upon obtaining the initial image quality coefficient and the maximum frame rate, the initial image quality coefficient is determined as the second current quality coefficient, and the maximum frame rate is determined as the second currently available frame rate. Then, the initial frame image of the data to be encoded is encoded based on the second current quality coefficient and the second currently available frame rate to obtain the second initial target bitrate. The visually lossless quality coefficient is a lossy coding quality coefficient that is difficult for the user's visual perception to perceive; its value is greater than the initial image quality coefficient, and the POC test results can be used as the standard.
[0178] It should be noted that the following steps will be executed differently depending on the comparison result between the second initial target bit rate and the maximum limited bandwidth. When it is determined that the second initial target bit rate is less than the maximum limited bandwidth, steps 1043c to 1046c will be executed; when it is determined that the second initial target bit rate is greater than the maximum limited bandwidth, steps 1047c to 10415c will be executed.
[0179] Step 1043c: When it is determined that the second initial target bit rate is less than the maximum limited bandwidth, the value of the second current quality coefficient is increased within the fourth preset range according to the fourth preset step value to obtain a new second current quality coefficient.
[0180] For example, when the second initial target bitrate is obtained, it is compared with the maximum limited bandwidth. If the second initial target bitrate is determined to be less than the maximum limited bandwidth, it indicates that the value of the second current quality coefficient is small. At this time, the value of the second current quality coefficient is increased within the fourth preset range according to the fourth preset step value to obtain a new second current quality coefficient.
[0181] Step 1044c: Encode the next frame of the data to be encoded according to the new second current quality coefficient and the second current available frame rate to obtain the fourth current target bit rate.
[0182] For example, upon obtaining a new second current quality coefficient, the next frame of the data to be encoded is encoded based on the new second current quality coefficient and the second current available frame rate to obtain a fourth current target bit rate.
[0183] It should be noted that the following steps will be executed differently depending on the comparison result between the fourth current target bitrate and the maximum limited bandwidth. If it is determined that the fourth current target bitrate is less than the maximum limited bandwidth, then step 1045c will be executed; if it is determined that the fourth current target bitrate is greater than the maximum limited bandwidth, then step 1046c will be executed.
[0184] Step 1045c: When it is determined that the fourth current target bit rate is less than the maximum limited bandwidth, continue to execute the step of increasing the value of the second current quality coefficient within the fourth preset range according to the fourth preset step value, until the second current quality coefficient increases to the highest visual lossless quality coefficient.
[0185] For example, when the fourth current target bitrate is obtained, the fourth current target bitrate is compared with the maximum limited bandwidth. If it is determined that the fourth current target bitrate is less than the maximum limited bandwidth, it means that the value of the second current quality coefficient is small. At this time, step 1043c is continued to execute, and the value of the second current quality coefficient is increased according to the fourth preset step value within the fourth preset range until the second current quality coefficient is increased to the highest quality coefficient of visual lossless.
[0186] Step 1046c: When it is determined that the fourth current target bit rate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced according to the fourth preset step value to obtain a new second current quality coefficient, and the next frame image of the data to be encoded is encoded according to the new second current quality coefficient and the second current available frame rate.
[0187] For example, when it is determined that the fourth current target bitrate is less than the maximum bandwidth limit, it indicates that the value of the second current quality coefficient is large. At this time, the value of the second current quality coefficient is reduced according to the fourth preset step value to obtain a new second current quality coefficient, and step 1044c is continued, that is, the step of encoding the next frame of the data to be encoded according to the new second current quality coefficient and the second current available frame rate is performed.
[0188] Step 1047c: When it is determined that the second initial target bit rate is greater than the maximum limited bandwidth, the value of the second current quality coefficient is reduced within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient.
[0189] For example, if the second initial target bit rate is determined to be greater than the maximum bandwidth limit, it means that the second current quality coefficient is large. At this time, the value of the second current quality coefficient is reduced within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient.
[0190] It should be noted that the seventh preset step value can be set according to requirements. For example, the seventh preset step value is equal to 5. This disclosure does not limit this.
[0191] Step 1048c: Encode the next frame of the data to be encoded according to the new second current quality coefficient and the second current available frame rate to obtain the seventh current target bit rate.
[0192] For example, after obtaining the new second current quality coefficient, the next frame of the image to be encoded is encoded based on the new second current quality coefficient and the second current available frame rate to obtain the seventh current target bit rate, and the lossy image is displayed to the user.
[0193] It should be noted that the following steps will be executed differently depending on the comparison result between the seventh current target bitrate and the maximum limited bandwidth. When it is determined that the seventh current target bitrate is greater than the maximum limited bandwidth, steps 1049c, 10411c to 10415c will be executed; when it is determined that the seventh current target bitrate is less than the maximum limited bandwidth, step 10410c will be executed.
[0194] Step 1049c: When it is determined that the seventh current target bit rate is greater than the maximum bandwidth limit, continue to execute the step of reducing the value of the second current quality coefficient within the seventh preset range according to the seventh preset step value, until the value of the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0195] For example, when the seventh current target bitrate is obtained, the seventh current target bitrate is compared with the maximum limited bandwidth. If it is determined that the seventh current target bitrate is greater than the maximum limited bandwidth, it means that the second current quality coefficient is large. At this time, step 1047c is continued to execute, and the value of the second current quality coefficient is reduced according to the seventh preset step value within the seventh preset range until the value of the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0196] Step 10410c: When it is determined that the seventh current target bit rate is less than the maximum bandwidth limit, the value of the second current quality coefficient is increased within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient, and the step of encoding the next frame image of the data to be encoded according to the new second current quality coefficient and the second current available frame rate continues to be executed.
[0197] For example, when it is determined that the seventh current target bit rate is less than the maximum bandwidth limit, it indicates that the second current quality coefficient is small. At this time, the value of the second current quality coefficient is increased within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient. Then, step 1048c is executed to encode the next frame image of the data to be encoded according to the new second current quality coefficient and the second current available frame rate.
[0198] Step 10411c: When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the second current available frame rate is greater than the maximum bandwidth limit, the value of the second current available frame rate is reduced within the eighth preset range according to the eighth preset step value to obtain a new second current available frame rate.
[0199] For example, when the lowest acceptable quality coefficient is obtained, the next frame of the data to be encoded is encoded according to the lowest acceptable quality coefficient and the second currently available frame rate. The obtained bit rate is compared with the maximum limited bandwidth. When it is determined that the obtained bit rate is greater than the maximum limited bandwidth, it indicates that the second currently available frame rate is large. At this time, the value of the second currently available frame rate is reduced according to the eighth preset step value within the eighth preset range to obtain a new second currently available frame rate.
[0200] Step 10412c: Encode the next frame of the data to be encoded according to the new second currently available frame rate and the minimum acceptable quality coefficient to obtain the eighth current target bit rate.
[0201] For example, upon obtaining the lowest acceptable quality coefficient, the next frame of the data to be encoded is encoded based on the new second currently available frame rate and the lowest acceptable quality coefficient to obtain the eighth current target bit rate, and the lossy image is displayed to the user.
[0202] It should be noted that the following steps will be executed differently depending on the comparison result between the eighth current target bitrate and the maximum limited bandwidth. When it is determined that the eighth current target bitrate is greater than the maximum limited bandwidth, steps 10413c and 10415c will be executed; when it is determined that the eighth current target bitrate is less than the maximum limited bandwidth, step 10414c will be executed.
[0203] Step 10413c: When it is determined that the eighth current target bitrate is greater than the maximum bandwidth limit, continue to execute the step of reducing the value of the second current available frame rate within the eighth preset range according to the eighth preset step value, until the second current available frame rate is reduced to the minimum acceptable frame rate.
[0204] For example, when the eighth current target bitrate is obtained, the eighth current target bitrate is compared with the maximum limited bandwidth. If it is determined that the eighth current target bitrate is greater than the maximum limited bandwidth, it means that the second current available frame rate is large. At this time, 10411c is executed again, and the value of the second current available frame rate is reduced according to the eighth preset step value within the eighth preset range until the second current available frame rate is reduced to the minimum acceptable frame rate.
[0205] Step 10414c: When it is determined that the eighth current target bitrate is less than the maximum bandwidth limit, the value of the second current available frame rate is increased within the eighth preset range according to the eighth preset step value to obtain a new second current available frame rate, and the step of encoding the next frame image of the data to be encoded according to the new second current available frame rate and the minimum acceptable quality coefficient continues to be executed.
[0206] For example, when it is determined that the eighth current target bitrate is less than the maximum bandwidth limit, it indicates that the second current available frame rate is small. At this time, the value of the second current available frame rate is increased within the eighth preset range according to the eighth preset step value to obtain a new second current available frame rate. Then, step 10412c is executed to encode the next frame image of the data to be encoded according to the new second current available frame rate and the minimum acceptable quality coefficient.
[0207] Step 10415c: When it is determined that the bitrate for encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, an image encoding failure message is displayed.
[0208] For example, when the minimum acceptable frame rate is obtained, the next frame of the data to be encoded is encoded based on the minimum acceptable quality coefficient and the minimum acceptable frame rate. The obtained bit rate is compared with the maximum limited bandwidth. If it is determined that the obtained bit rate is greater than the maximum limited bandwidth, it indicates that the encoding has failed. At this time, a decoding failure message is displayed to remind the user to reduce the resolution of the display device or upgrade the hardware configuration.
[0209] As can be seen from the above, when the type of data to be encoded is a game, the initial image quality coefficient can be set to 80. This disclosure adopts an image frame rate priority and quality coefficient gradual adjustment strategy so that the final target decoding frame rate meets the encoding of the game scene.
[0210] It should be noted that the specific values of the above-mentioned encoding parameters, including maximum frame rate, available frame rate, minimum acceptable frame rate, highest visual lossless quality coefficient, lowest visual lossless quality coefficient, initial image quality coefficient, minimum acceptable image quality coefficient, and maximum bandwidth limit, vary depending on the encoding algorithm. For example, if the encoding algorithm is JPEG (Joint Photographic Experts Group) encoding, the quality coefficient ranges from 0 to 100, with values above 90 considered to achieve visual lossless performance. The specific correspondence between different value ranges and image quality is as follows: values below 30 are considered too poor in image quality and are generally not used; values between 30 and 90 are considered visually perceptible lossy compression; values above 90 are considered visually imperceptible lossy compression; and even 100 is lossy in JPEG, requiring other encoders such as PNG (Portable Network Graphics) to achieve true lossless compression.
[0211] This disclosure provides a parameter adjustment method. Upon obtaining data to be encoded, the method determines the type of the data, determines a corresponding target parameter adjustment strategy based on the data type, and then encodes the data according to the target parameter adjustment strategy. It is understood that this disclosure can select different target parameter adjustment strategies depending on the type of data to be encoded, thereby improving the flexibility of the encoding process.
[0212] Based on the parameter adjustment method described in the above embodiments, the following are device embodiments of this disclosure, which can be used to execute the method embodiments of this disclosure.
[0213] This disclosure provides a parameter adjustment device, such as... Figure 5 As shown, the parameter adjustment device 50 includes: an acquisition module 501, a first determination module 502, a second determination module 503, and an encoding module 504.
[0214] The acquisition module 501 is used to acquire the data to be encoded.
[0215] The first determining module 502 is used to determine the type of the data to be encoded.
[0216] The second determining module 503 is used to determine the corresponding target parameter adjustment strategy according to the type of the data to be encoded.
[0217] The encoding module 504 is used to encode the data to be encoded according to the target parameter adjustment strategy.
[0218] In one embodiment, when the type of the data to be encoded is a design type, the encoding module 504 includes a first acquisition submodule, a first encoding submodule, a first calculation submodule, a second encoding submodule, and a second calculation submodule.
[0219] The first acquisition submodule is used to acquire the highest quality coefficient and the minimum acceptable frame rate for visual losslessness.
[0220] The first encoding submodule is used to determine the highest visual lossless quality coefficient as the first current quality coefficient, determine the minimum acceptable frame rate as the first current available frame rate, and encode the initial frame image of the data to be encoded to obtain the first initial target bit rate.
[0221] The first calculation submodule is used to, when determining that the first initial target bitrate is less than the maximum bandwidth limit, increase the value of the first currently available frame rate within a first preset range according to a first preset step value to obtain a new first currently available frame rate.
[0222] The second encoding submodule is used to encode the next frame of the data to be encoded based on the new first currently available frame rate and the first current quality coefficient to obtain the first current target bit rate.
[0223] The second calculation submodule is used to continue executing the step of increasing the value of the first currently available frame rate within a first preset range according to a first preset step value when it is determined that the first current target bit rate is less than the maximum bandwidth limit, until the first current available frame rate increases to the maximum frame rate.
[0224] In one embodiment, the encoding module 504 further includes a third calculation submodule.
[0225] The third calculation submodule is used to, when it is determined that the first current target bitrate is greater than the maximum bandwidth limit, reduce the value of the first current available frame rate according to the first preset step value to obtain a new first current available frame rate, and continue to execute the step of encoding the next frame image of the data to be encoded according to the new first current available frame rate and the first current quality coefficient.
[0226] In one embodiment, the encoding module 504 further includes a fourth calculation submodule, a third encoding submodule, and a fifth calculation submodule.
[0227] The fourth calculation submodule is used to reduce the value of the first current quality coefficient within a second preset range according to a second preset step value when it is determined that the first initial target bit rate is greater than the maximum bandwidth limit, so as to obtain a new first current quality coefficient.
[0228] The third encoding submodule is used to encode the next frame of the data to be encoded based on the new first current quality coefficient and the current available frame rate to obtain the second current target bit rate.
[0229] The fifth calculation submodule is used to continue executing the step of reducing the value of the first current quality coefficient according to the second preset step value within the second preset range when it is determined that the second current target bit rate is greater than the maximum limited bandwidth, until the first current quality coefficient is reduced to the visual lossless minimum quality coefficient.
[0230] In one embodiment, the encoding module 504 further includes a sixth calculation submodule.
[0231] The sixth calculation submodule is used to, when determining that the second current target bitrate is less than the maximum bandwidth limit, increase the value of the first current quality coefficient within a second preset range according to the second preset step value to obtain a new first current quality coefficient, and continue to execute the step of encoding the next frame image of the data to be encoded according to the new first current quality coefficient and the first current available frame rate.
[0232] In one embodiment, the encoding module 504 further includes a seventh calculation submodule, a fourth encoding submodule, and an eighth calculation submodule.
[0233] The seventh calculation submodule is used to reduce the value of the first current quality coefficient within a third preset range by a third preset step value when the bit rate obtained by encoding the next frame of the data to be encoded according to the visual lossless minimum quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, so as to obtain a new first current quality coefficient.
[0234] The fourth encoding submodule is used to encode the next frame of the data to be encoded based on the new first current quality coefficient and the first current available frame rate to obtain the third current target bit rate.
[0235] The eighth calculation submodule is used to continue executing the step of reducing the value of the first current quality coefficient within a third preset range according to a third preset step value when it is determined that the third current target bit rate is greater than the maximum bandwidth limit, until the first current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0236] In one embodiment, the encoding module 504 further includes a ninth calculation submodule.
[0237] The ninth calculation submodule is used to, when determining that the third current target bitrate is less than the maximum bandwidth limit, increase the value of the first current quality coefficient within the third preset range according to the third preset step value, and continue to execute the step of encoding the next frame image of the data to be encoded according to the new first current quality coefficient and the first current available frame rate.
[0238] In one embodiment, the encoding module 504 further includes a first display submodule.
[0239] The first display submodule is configured to display image encoding failure information when it is determined that the bitrate obtained by encoding the next frame of the data to be encoded according to the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit.
[0240] In one embodiment, when the type of the data to be encoded is office type or game type, the encoding module 504 includes a second acquisition submodule, a fifth encoding submodule, a tenth calculation submodule, a sixth encoding submodule, and an eleventh calculation submodule.
[0241] The second acquisition submodule is used to acquire the initial image quality coefficient and the maximum frame rate.
[0242] The fifth encoding submodule is used to determine the initial image quality coefficient as the second current quality coefficient, determine the maximum frame rate as the second current available frame rate, and encode the initial frame image of the data to be encoded to obtain the second initial target bit rate.
[0243] The tenth calculation submodule is used to increase the value of the second current quality coefficient within a fourth preset range according to a fourth preset step value when it is determined that the second initial target bit rate is less than the maximum limited bandwidth, so as to obtain a new second current quality coefficient.
[0244] The sixth encoding submodule is used to encode the next frame of the data to be encoded based on the new second current quality coefficient and the second current available frame rate to obtain the fourth current target bit rate.
[0245] The eleventh calculation submodule is used to continue executing the step of increasing the value of the second current quality coefficient within the fourth preset range according to the fourth preset step value when it is determined that the fourth current target bit rate is less than the maximum limited bandwidth, until the second current quality coefficient is increased to the highest visual lossless quality coefficient.
[0246] In one embodiment, the encoding module 504 further includes a twelfth calculation submodule.
[0247] The twelfth calculation submodule is used to reduce the value of the second current quality coefficient according to the fourth preset step value when it is determined that the fourth current target bit rate is greater than the maximum bandwidth limit, to obtain a new second current quality coefficient, and continue to execute the step of encoding the next frame image of the data to be encoded according to the new second current quality coefficient and the second current available frame rate.
[0248] In one embodiment, when the type of the data to be encoded is office type, the encoding module 504 further includes a thirteenth calculation submodule, a seventh encoding submodule, and a fourteenth calculation submodule.
[0249] The thirteenth calculation submodule is used to reduce the value of the second currently available frame rate within a fifth preset range according to a fifth preset step value when it is determined that the second initial target bit rate is greater than the maximum bandwidth limit, so as to obtain a new second currently available frame rate.
[0250] The seventh encoding submodule is used to encode the next frame of the data to be encoded based on the new second currently available frame rate and the second current quality coefficient to obtain the fifth current target bit rate.
[0251] The fourteenth calculation submodule is used to continue executing the step of reducing the value of the second current available frame rate within the fifth preset range according to the fifth preset step value when it is determined that the fifth current target bit rate is greater than the maximum bandwidth limit, until the second current available frame rate is reduced to the minimum acceptable frame rate.
[0252] In one embodiment, the encoding module 504 further includes a fifteenth calculation submodule.
[0253] The fifteenth calculation submodule is used to, when it is determined that the fifth current target bitrate is less than the maximum bandwidth limit, increase the value of the current available frame rate within the fifth preset range according to the fifth preset step value to obtain a new second current available frame rate, and continue to execute the step of encoding the next frame image of the data to be encoded according to the new second current available frame rate and the new second current quality coefficient.
[0254] In one embodiment, the encoding module 504 further includes a sixteenth calculation submodule, an eighth encoding submodule, and a seventeenth calculation submodule.
[0255] The sixteenth calculation submodule is used to reduce the value of the second current quality coefficient within a sixth preset range according to a sixth preset step value when it is determined that the bit rate obtained by encoding the next frame of the data to be encoded based on the second current quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, so as to obtain a new second current quality coefficient.
[0256] The eighth encoding submodule is used to encode the next frame of the data to be encoded based on the new second current quality coefficient and the minimum acceptable frame rate to obtain the sixth current target bit rate.
[0257] The seventeenth calculation submodule is used to continue executing the step of reducing the value of the second current quality coefficient within a sixth preset range according to a sixth preset step value when it is determined that the sixth current target bit rate is greater than the maximum bandwidth limit, until the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0258] In one embodiment, the encoding module 504 further includes an eighteenth calculation submodule.
[0259] The eighteenth calculation submodule is used to, when it is determined that the sixth current target bit rate is less than the maximum bandwidth limit, increase the value of the second current quality coefficient within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient, and continue to execute the step of encoding the next frame image of the data to be encoded according to the new second current quality coefficient and the minimum acceptable frame rate.
[0260] In one embodiment, the encoding module 504 further includes a second display submodule.
[0261] The second display submodule is used to display image encoding failure information when it is determined that the bitrate for encoding the next frame of the data to be encoded according to the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit.
[0262] In one embodiment, when the type of the data to be encoded is a game type, the encoding module 504 further includes a nineteenth calculation submodule, a ninth encoding submodule, and a twentieth calculation submodule.
[0263] The nineteenth calculation submodule is used to reduce the value of the second current quality coefficient within a seventh preset range according to a seventh preset step value when it is determined that the second initial target bit rate is greater than the maximum bandwidth limit, so as to obtain a new second current quality coefficient.
[0264] The ninth encoding submodule is used to encode the next frame of the data to be encoded based on the new second current quality coefficient and the second current available frame rate to obtain the seventh current target bit rate.
[0265] The twentieth calculation submodule is used to continue executing the step of reducing the value of the second current quality coefficient within the seventh preset range according to the seventh preset step value when it is determined that the seventh current target bit rate is greater than the maximum bandwidth limit, until the value of the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
[0266] In one embodiment, the encoding module 504 further includes a twenty-first calculation submodule.
[0267] The twenty-first calculation submodule is used to, when it is determined that the seventh current target bitrate is less than the maximum bandwidth limit, increase the value of the second current quality coefficient within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient, and continue to execute the step of encoding the next frame image of the data to be encoded according to the new second current quality coefficient and the second current available frame rate.
[0268] In one embodiment, the encoding module 504 further includes a twenty-second calculation submodule, a tenth encoding module, and a twenty-third calculation submodule.
[0269] The twenty-second calculation submodule is used to reduce the value of the second current available frame rate within an eighth preset range according to an eighth preset step value when it is determined that the bit rate obtained by encoding the next frame image of the data to be encoded according to the minimum acceptable quality coefficient and the second current available frame rate is greater than the maximum bandwidth limit, so as to obtain a new second current available frame rate.
[0270] The tenth encoding module is used to encode the next frame of the data to be encoded based on the new second currently available frame rate and the minimum acceptable quality coefficient to obtain the eighth current target bit rate.
[0271] The twenty-third calculation submodule is used to continue executing the step of reducing the value of the second current available frame rate within the eighth preset range according to the eighth preset step value when it is determined that the eighth current target bit rate is greater than the maximum bandwidth limit, until the second current available frame rate is reduced to the minimum acceptable frame rate.
[0272] In one embodiment, the encoding module 504 further includes a twenty-fourth calculation submodule.
[0273] The twenty-fourth calculation submodule is used to, when it is determined that the eighth current target bitrate is less than the maximum bandwidth limit, increase the value of the second current available frame rate within the eighth preset range according to the eighth preset step value to obtain a new second current available frame rate, and continue to execute the step of encoding the next frame image of the data to be encoded according to the new second current available frame rate and the minimum acceptable quality coefficient.
[0274] In one embodiment, the encoding module 504 further includes a third display submodule.
[0275] The third display submodule is used to display image encoding failure information when it is determined that the bitrate for encoding the next frame of the data to be encoded according to the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit.
[0276] This disclosure provides a parameter adjustment device that, upon acquiring data to be encoded, determines the type of the data, determines a corresponding target parameter adjustment strategy based on the data type, and then encodes the data according to the target parameter adjustment strategy. It is understood that this disclosure can select different target parameter adjustment strategies depending on the type of data to be encoded, thereby improving the flexibility of encoding.
[0277] Based on the above Figure 1 In addition to the parameter adjustment method described in the corresponding embodiments, this disclosure also provides a computer-readable storage medium. For example, a non-transitory computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, magnetic tape, a floppy disk, or an optical data storage device. This storage medium stores computer instructions for executing the above-described... Figure 1 The parameter adjustment methods described in the corresponding embodiments will not be repeated here.
[0278] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0279] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
Claims
1. A parameter adjustment method, characterized in that, The method includes: Obtain the data to be encoded; Determine the type of the data to be encoded; Determine the corresponding target parameter adjustment strategy based on the type of the data to be encoded; The data to be encoded is encoded according to the target parameter adjustment strategy; When the type of the data to be encoded is a design type, the step of encoding the data to be encoded according to the target parameter adjustment strategy includes: Obtain the highest quality coefficient and minimum acceptable frame rate for visual lossless imaging; The highest quality coefficient of visual lossless is determined as the first current quality coefficient, the minimum acceptable frame rate is determined as the first current available frame rate, and the initial frame image of the data to be encoded is encoded to obtain the first initial target bit rate; When it is determined that the first initial target bitrate is less than the maximum bandwidth limit, the value of the first current available frame rate is increased by the first preset step value within the first preset range to obtain a new first current available frame rate; The next frame of the data to be encoded is encoded based on the new first current available frame rate and the first current quality coefficient to obtain the first current target bit rate; When it is determined that the first current target bitrate is less than the maximum bandwidth limit, the step of increasing the value of the first current available frame rate within the first preset range according to the first preset step value continues to be executed until the first current available frame rate increases to the maximum frame rate. The method further includes: When it is determined that the first initial target bitrate is greater than the maximum bandwidth limit, the value of the first current quality coefficient is reduced within a second preset range according to a second preset step value to obtain a new first current quality coefficient. The next frame of the data to be encoded is encoded according to the new first current quality coefficient and the current available frame rate to obtain the second current target bit rate; When it is determined that the second current target bitrate is greater than the maximum bandwidth limit, the step of reducing the value of the first current quality coefficient according to the second preset step value within the second preset range continues until the first current quality coefficient is reduced to the visual lossless minimum quality coefficient.
2. The method according to claim 1, characterized in that, Also includes: When it is determined that the first current target bitrate is greater than the maximum bandwidth limit, the value of the first current available frame rate is reduced according to the first preset step value to obtain a new first current available frame rate, and the step of encoding the next frame image of the data to be encoded according to the new first current available frame rate and the first current quality coefficient continues to be executed.
3. The method according to claim 1, characterized in that, Also includes: When it is determined that the second current target bitrate is less than the maximum bandwidth limit, the value of the first current quality coefficient is increased within the second preset range according to the second preset step value to obtain a new first current quality coefficient, and the step of encoding the next frame image of the data to be encoded according to the new first current quality coefficient and the first current available frame rate continues to be executed.
4. The method according to claim 1, characterized in that, Also includes: When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded according to the visual lossless minimum quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, the value of the first current quality coefficient is reduced within the third preset range according to the third preset step value to obtain a new first current quality coefficient. The next frame of the data to be encoded is encoded based on the new first current quality coefficient and the first current available frame rate to obtain the third current target bit rate; When it is determined that the third current target bit rate is greater than the maximum bandwidth limit, the step of reducing the value of the first current quality coefficient within the third preset range according to the third preset step value continues until the first current quality coefficient is reduced to the lowest acceptable quality coefficient.
5. The method according to claim 4, characterized in that, Also includes: When it is determined that the third current target bitrate is less than the maximum bandwidth limit, the value of the first current quality coefficient is increased according to the third preset step value within the third preset range, and the step of encoding the next frame image of the data to be encoded according to the new first current quality coefficient and the first current available frame rate continues to be executed.
6. The method according to claim 4, characterized in that, Also includes: When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded according to the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, an image encoding failure message is displayed.
7. The method according to claim 1, characterized in that, When the type of the data to be encoded is office-related or game-related, the step of encoding the data according to the target parameter adjustment strategy includes: Obtain the initial image quality score and maximum frame rate; The initial image quality coefficient is determined as the second current quality coefficient, the maximum frame rate is determined as the second current available frame rate, and the initial frame image of the data to be encoded is encoded to obtain the second initial target bit rate; When it is determined that the second initial target bit rate is less than the maximum bandwidth limit, the value of the second current quality coefficient is increased according to the fourth preset step value within the fourth preset range to obtain a new second current quality coefficient. The next frame of the data to be encoded is encoded based on the new second current quality coefficient and the second current available frame rate to obtain the fourth current target bit rate; When it is determined that the fourth current target bit rate is less than the maximum bandwidth limit, the step of increasing the value of the second current quality coefficient within the fourth preset range according to the fourth preset step value continues until the second current quality coefficient increases to the highest visual lossless quality coefficient.
8. The method according to claim 7, characterized in that, Also includes: When it is determined that the fourth current target bit rate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced according to the fourth preset step value to obtain a new second current quality coefficient, and the next frame image of the data to be encoded is encoded according to the new second current quality coefficient and the second current available frame rate.
9. The method according to claim 7, characterized in that, When the type of the data to be encoded is office type, it also includes: When it is determined that the second initial target bitrate is greater than the maximum bandwidth limit, the value of the second current available frame rate is reduced within the fifth preset range according to the fifth preset step value to obtain a new second current available frame rate; The next frame of the data to be encoded is encoded according to the new second currently available frame rate and the second current quality coefficient to obtain the fifth current target bit rate; When it is determined that the fifth current target bitrate is greater than the maximum bandwidth limit, the step of reducing the value of the second current available frame rate within the fifth preset range according to the fifth preset step value continues until the second current available frame rate is reduced to the minimum acceptable frame rate.
10. The method according to claim 9, characterized in that, Also includes: When it is determined that the fifth current target bitrate is less than the maximum bandwidth limit, the value of the current available frame rate is increased within the fifth preset range according to the fifth preset step value to obtain a new second current available frame rate, and the next frame image of the data to be encoded is encoded according to the new second current available frame rate and the new second current quality coefficient.
11. The method according to claim 9, characterized in that, Also includes: When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded based on the second current quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient. The next frame of the data to be encoded is encoded according to the new second current quality coefficient and the minimum acceptable frame rate to obtain the sixth current target bitrate; When it is determined that the sixth current target bitrate is greater than the maximum bandwidth limit, the step of reducing the value of the second current quality coefficient within the sixth preset range according to the sixth preset step value continues until the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
12. The method according to claim 11, characterized in that, Also includes: When it is determined that the sixth current target bit rate is less than the maximum bandwidth limit, the value of the second current quality coefficient is increased within the sixth preset range according to the sixth preset step value to obtain a new second current quality coefficient, and the next frame image of the data to be encoded is encoded according to the new second current quality coefficient and the minimum acceptable frame rate.
13. The method according to claim 11, characterized in that, Also includes: When it is determined that the bitrate for encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, an image encoding failure message is displayed.
14. The method according to claim 7, characterized in that, When the type of the data to be encoded is a game type, it also includes: When it is determined that the second initial target bitrate is greater than the maximum bandwidth limit, the value of the second current quality coefficient is reduced within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient. The next frame of the data to be encoded is encoded according to the new second current quality coefficient and the second current available frame rate to obtain the seventh current target bit rate; When it is determined that the seventh current target bit rate is greater than the maximum bandwidth limit, the step of reducing the value of the second current quality coefficient within the seventh preset range according to the seventh preset step value continues until the value of the second current quality coefficient is reduced to the lowest acceptable quality coefficient.
15. The method according to claim 14, characterized in that, Also includes: When it is determined that the seventh current target bitrate is less than the maximum bandwidth limit, the value of the second current quality coefficient is increased within the seventh preset range according to the seventh preset step value to obtain a new second current quality coefficient, and the step of encoding the next frame image of the data to be encoded according to the new second current quality coefficient and the second current available frame rate continues to be executed.
16. The method according to claim 14, characterized in that, Also includes: When it is determined that the bitrate obtained by encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the second current available frame rate is greater than the maximum bandwidth limit, the value of the second current available frame rate is reduced within the eighth preset range according to the eighth preset step value to obtain a new second current available frame rate; The next frame of the data to be encoded is encoded according to the new second currently available frame rate and the minimum acceptable quality coefficient to obtain the eighth current target bit rate; When it is determined that the eighth current target bitrate is greater than the maximum bandwidth limit, the step of reducing the value of the second current available frame rate within the eighth preset range according to the eighth preset step value continues to be executed until the second current available frame rate is reduced to the minimum acceptable frame rate.
17. The method according to claim 16, characterized in that, Also includes: When it is determined that the eighth current target bitrate is less than the maximum bandwidth limit, the value of the second current available frame rate is increased by the eighth preset step value within the eighth preset range to obtain a new second current available frame rate, and the step of encoding the next frame image of the data to be encoded based on the new second current available frame rate and the minimum acceptable quality coefficient continues to be executed.
18. The method according to claim 16, characterized in that, Also includes: When it is determined that the bitrate for encoding the next frame of the data to be encoded based on the minimum acceptable quality coefficient and the minimum acceptable frame rate is greater than the maximum bandwidth limit, an image encoding failure message is displayed.
19. A parameter adjustment device, characterized in that, include: The acquisition module is used to acquire the data to be encoded. The first determining module is used to determine the type of the data to be encoded; The second determining module is used to determine the corresponding target parameter adjustment strategy according to the type of the data to be encoded. The encoding module is used to encode the data to be encoded according to the target parameter adjustment strategy; When the type of the data to be encoded is a design type, the encoding module includes a first acquisition submodule, a first encoding submodule, a first calculation submodule, a second encoding submodule, and a second calculation submodule; The first acquisition submodule is used to acquire the highest quality coefficient and the minimum acceptable frame rate for visual losslessness. The first encoding submodule is used to determine the highest visual lossless quality coefficient as the first current quality coefficient, determine the minimum acceptable frame rate as the first current available frame rate, and encode the initial frame image of the data to be encoded to obtain the first initial target bit rate. The first calculation submodule is used to, when it is determined that the first initial target bitrate is less than the maximum bandwidth limit, increase the value of the first currently available frame rate within a first preset range according to a first preset step value to obtain a new first currently available frame rate; The second encoding submodule is used to encode the next frame of the data to be encoded according to the new first current available frame rate and the first current quality coefficient to obtain the first current target bit rate; The second calculation submodule is used to continue executing the step of increasing the value of the first current available frame rate within a first preset range according to a first preset step value when it is determined that the first current target bit rate is less than the maximum bandwidth limit, until the first current available frame rate increases to the maximum frame rate; The encoding module further includes a fourth calculation submodule, a third encoding submodule, and a fifth calculation submodule; The fourth calculation submodule is used to reduce the value of the first current quality coefficient within a second preset range according to a second preset step value when it is determined that the first initial target bit rate is greater than the maximum bandwidth limit, so as to obtain a new first current quality coefficient. The third encoding submodule is used to encode the next frame image of the data to be encoded according to the new first current quality coefficient and the current available frame rate to obtain the second current target bit rate; The fifth calculation submodule is used to continue executing the step of reducing the value of the first current quality coefficient according to the second preset step value within the second preset range when it is determined that the second current target bit rate is greater than the maximum limited bandwidth, until the first current quality coefficient is reduced to the visual lossless minimum quality coefficient.
Citation Information
Patent Citations
Method and device for adjusting video quality
CN103974060A
Frame rate control method and device and storage medium
CN111953978A