Video encoding method, device, electronic equipment and computer storage medium

By obtaining the subjective quality value and original bitrate of the target video file, and utilizing the pre-defined correspondence between the subjective quality value and the maximum bitrate change, the bitrate of the video file is reduced, thus solving the problem of discrepancies between objective evaluation indicators and subjective perception, and ensuring that the subjective quality of the video encoding result remains unchanged.

CN114885169BActive Publication Date: 2025-11-07BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110160933.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-05
Publication Date
2025-11-07
Estimated Expiration
2041-02-05

Smart Images

  • Figure CN114885169B_ABST
    Figure CN114885169B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a video coding method, device, electronic equipment and computer storage medium, the video coding method comprising: obtaining a subjective quality value and an original code rate of a target video file; determining, based on a preset correspondence relationship between subjective quality values and maximum code rate variations, a maximum code rate variation of the target video file according to the subjective quality value of the target video file; and performing a code rate reduction process on the target video file according to the original code rate and the maximum code rate variation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the technical field of video, and more particularly, to a video encoding method and device, electronic equipment and computer storage medium. BACKGROUND

[0002] In a video encoding process, the code rate of a video file is reduced, which can easily result in low image quality and video image distortion of the decoded video file. Video quality evaluation is an evaluation of image information of a video file. The evaluation result of the video quality evaluation can be used to guide video encoding to avoid the situation of video image distortion after decoding.

[0003] At present, the objective evaluation index (such as peak signal-to-noise ratio, mean square error, and structural similarity index, etc.) of a video file is calculated according to the objective evaluation method in the video quality evaluation, and the video encoding is guided according to the objective evaluation index. In actual situations, the degree of coincidence between the objective evaluation index and the subjective feeling of a person is large, which leads to the result of the video encoding guided by the objective evaluation index being difficult to meet the expectation. SUMMARY

[0004] An object of embodiments of the present disclosure is to provide a new technical solution for video encoding.

[0005] According to a first aspect of the present disclosure, a video encoding method is provided, comprising: obtaining a subjective quality value and an original code rate of a target video file; determining a maximum code rate variation of the target video file according to the subjective quality value of the target video file based on a preset correspondence between subjective quality values and maximum code rate variations; and performing a code rate reduction processing on the target video file according to the original code rate and the maximum code rate variation.

[0006] Optionally, before determining the maximum code rate variation of the target file according to the subjective quality value of the target video file based on the correspondence between the subjective quality values and the maximum code rate variations, the method further comprises: obtaining a plurality of sample video files; and performing a code rate reduction test on each sample video file, wherein the code rate reduction test comprises: obtaining an original code rate and a subjective quality value of the sample video file; gradually increasing the code rate variation to gradually reduce the code rate of the sample video file according to the code rate variation; obtaining the subjective quality value of the sample video file after each code rate reduction; taking the maximum code rate variation that does not affect the subjective quality value of the sample video file as the maximum code rate variation of the sample video file; and establishing the correspondence between the subjective quality values and the maximum code rate variations according to the subjective quality values of the plurality of sample video files and the maximum code rate variations of the plurality of sample video files.

[0007] Optionally, the correspondence between the subjective quality value and the maximum code rate variation is established according to the subjective quality values of the plurality of sample video files and the maximum code rate variations of the plurality of sample video files, including: fitting a relationship curve of the subjective quality value and the maximum code rate variation according to the subjective quality values of the plurality of sample video files and the maximum code rate variations of the plurality of sample video files.

[0008] Optionally, the code rate of the target video file is adjusted according to the original code rate and the maximum code rate variation, including: obtaining a segment subjective quality value of each segment of the target video file; determining a target segment as a segment whose segment subjective quality value is higher than the subjective quality value of the target video file; and adjusting the code rate of the target segment according to the original code rate and the maximum code rate variation of the target video file.

[0009] Optionally, the code rate of the target segment is adjusted according to the original code rate and the maximum code rate variation of the target video file, including: reducing the original code rate by the maximum code rate variation to obtain a first encoding code rate; and reducing the code rate of the target segment to the first encoding code rate in a case where the first encoding code rate is greater than or equal to a preset threshold.

[0010] Optionally, the file type of the sample video file is the same as the file type of the target video file; and the same file type includes at least one of the following: the same base color, the same brightness, the same color vividness, and the same scene element complexity.

[0011] Optionally, the subjective quality value of the target video file is obtained according to a preset subjective evaluation index.

[0012] Optionally, the preset subjective evaluation index includes at least one of the following: visual fidelity, detail loss, and time information.

[0013] According to a second aspect of the present disclosure, a video encoding apparatus is also provided, including: an obtaining module configured to obtain a subjective quality value and an original code rate of a target video file; a determining module configured to determine a maximum code rate variation of the target video file according to the subjective quality value of the target video file obtained by the obtaining module based on a correspondence between the subjective quality value and the maximum code rate variation; and a processing module configured to adjust the code rate of the target video file according to the original code rate obtained by the obtaining module and the maximum code rate variation obtained by the determining module.

[0014] Optionally, the video encoding apparatus further comprises: a sample obtaining module, configured to obtain a plurality of sample video files; a rate reduction test module, configured to perform a rate reduction test on each sample video file; wherein the rate reduction test comprises: obtaining an original code rate and a subjective quality value of the sample video file; gradually increasing a code rate change amount to gradually reduce the code rate of the sample video file according to the code rate change amount; obtaining the subjective quality value of the sample video file after each code rate reduction; taking the maximum code rate change amount that does not affect the subjective quality value of the sample video file as the maximum code rate change amount of the sample video file; and a relationship processing module, configured to establish a corresponding relationship between the subjective quality value and the maximum code rate change amount according to the subjective quality values of the plurality of sample video files and the maximum code rate change amounts of the plurality of sample video files.

[0015] Optionally, the relationship processing module is configured to: fit a relationship curve between the subjective quality value and the maximum code rate change amount according to the subjective quality values of the plurality of sample video files and the maximum code rate change amounts of the plurality of sample video files.

[0016] Optionally, the processing module comprises: an obtaining submodule, configured to obtain a segment subjective quality value of each segment of the target video file; a determining submodule, configured to determine a segment whose segment subjective quality value is higher than the subjective quality value of the target video file as a target segment; and a processing submodule, configured to reduce the code rate of the target segment according to the original code rate and the maximum code rate change amount of the target video file.

[0017] Optionally, the processing submodule is configured to: reduce the original code rate by the maximum code rate change amount to obtain a first encoding code rate; and reduce the code rate of the target segment to the first encoding code rate in a case where the first encoding code rate is greater than or equal to a preset threshold.

[0018] Optionally, the sample video file has the same file type as the target video file; and the same file type comprises at least one of the following: same base color, same brightness, same color vividness, and same scene element complexity.

[0019] Optionally, the obtaining module is configured to: obtain the subjective quality value of the target video file according to a preset subjective evaluation index.

[0020] Optionally, the preset subjective evaluation index comprises at least one of the following: visual fidelity, detail loss, and time information.

[0021] According to a third aspect of the present disclosure, an electronic device is also provided, comprising a memory and a processor, the memory is configured to store a computer program, and the processor is configured to execute the computer program to implement the method according to the first aspect of the present disclosure.

[0022] According to a fourth aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method according to the first aspect of the present disclosure.

[0023] An advantage of the embodiments of the present disclosure is that the maximum code rate variation of the target video file can be determined based on the subjective quality value of the target video file, and the code rate of the target video file is adjusted based on the original code rate of the target video file and the maximum code rate variation, so as to achieve the purpose of reducing the code rate of the target video file without affecting the subjective quality value of the target video file. Since the subjective quality value is highly consistent with the subjective feeling of a person, the result of encoding the target video file based on the subjective quality value is highly consistent with the subjective feeling of a person, and is more desirable.

[0024] Other features and advantages of the embodiments of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0025] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the embodiments of the present disclosure.

[0026] Figure 1 is a flowchart of a video encoding method according to some embodiments of the present disclosure;

[0027] Figure 2 is a flowchart of a video encoding method according to some other embodiments of the present disclosure;

[0028] Figure 3 is a flowchart of a video encoding method according to some other embodiments of the present disclosure;

[0029] Figure 4 is a diagram showing the relationship between the subjective quality value and the code rate variation of a sample video file according to some embodiments of the present disclosure;

[0030] Figure 5A is a diagram showing a relationship curve between the subjective quality value and the maximum code rate variation according to some embodiments of the present disclosure;

[0031] Figure 5B is a diagram showing another relationship curve between the subjective quality value and the maximum code rate variation according to some embodiments of the present disclosure;

[0032] Figure 6 is a flowchart of a video encoding method according to some other embodiments of the present disclosure;

[0033] Figure 7is a functional block diagram of a video encoding apparatus according to some embodiments of the present disclosure;

[0034] Figure 8 is a functional block diagram of an electronic device according to some embodiments. DETAILED DESCRIPTION

[0035] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of the components and steps set forth in the embodiments, numerical expressions, and numerical values are not limiting to the scope of the present disclosure unless specifically stated otherwise.

[0036] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the scope of the application and its applications or uses.

[0037] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail herein, but should be considered as part of the specification, where appropriate.

[0038] In all examples shown and discussed herein, any specific values should be interpreted as merely illustrative and not as a limitation. Thus, other examples of the exemplary embodiments can have different values.

[0039] It should be noted that like numbers and letters refer to like items throughout the drawings, and that, when a part is designated by both a number and a letter, the part is designated by both the number and the letter in the drawings, and no further discussion of the part is necessary in subsequent drawings.

[0040] Before introducing the embodiments of the present disclosure, a brief introduction is first given to the method of video quality evaluation. The method of video quality evaluation includes objective evaluation method and subjective evaluation method. The objective evaluation method can calculate the objective evaluation index of the video file, such as peak signal-to-noise ratio, mean square error, structural similarity index, etc. In actual situations, the degree of coincidence between the objective evaluation index and the subjective feeling of a person is quite large, resulting in that the consistency between the result obtained after the video encoding guided by the objective evaluation index and the subjective feeling of a person is poor. The subjective evaluation method can calculate the subjective evaluation index of the video file. Compared with the objective evaluation index, the subjective evaluation index has a higher degree of coincidence with the subjective feeling of a person and is more reliable.

[0041] Next, various embodiments and examples according to the present disclosure are described with reference to the accompanying drawings.

[0042] <Method Embodiment One>

[0043] Figure 1 is a flowchart of a video encoding method according to some embodiments of the present disclosure. As shown in Figure 1As shown, the video encoding method of the embodiment of the present disclosure can include the following steps S110-S130: step S110, obtaining a subjective quality value and an original code rate of a target video file.

[0044] The target video file is a video file to be encoded. For example, the target video file is a video file that has not been encoded and currently needs to be encoded; for another example, the target video file is a video file that has been encoded once and currently needs to be encoded twice.

[0045] The content of the target video file can be any type of content. For example, food content, animation content, sports content, landscape content, or news content, etc. The embodiment of the present disclosure does not limit the type of content of the target video file.

[0046] The original code rate of the target video file is the current code rate of the target video file. The subjective quality value of the target video file is obtained according to the subjective evaluation index of the target video file.

[0047] In some embodiments, the subjective evaluation index includes: VIF (visual quality fidelity, visual quality fidelity), DLM (detail loss measure, detail loss measure), and TI (temporal information, temporal information).

[0048] When obtaining the subjective quality value of the target video file, the subjective quality value of the target video file can be calculated according to the score of the preset subjective evaluation index.

[0049] For example, the score of the at least one subjective evaluation index of the target video file is obtained according to the VMAF (video multimethod assessment fusion) algorithm of the VQA (video quality assessment), and the at least one subjective evaluation index is fused and calculated. The calculation result is used as the subjective quality value of the target video file.

[0050] It can be understood that the embodiment of the present disclosure includes but is not limited to calculating the subjective quality value of the target video file according to the VMAF algorithm of the VQA, and other algorithms of the VQA can also be used to obtain the subjective quality value of the target video file. The embodiment of the present disclosure does not limit the algorithm of the VQA used to calculate the subjective quality value of the target video file.

[0051] Step S120, based on the preset corresponding relationship between the subjective quality value and the maximum code rate change, the maximum code rate change of the target video file is determined according to the subjective quality value of the target video file.

[0052] In the preset correspondence between the subjective quality value and the maximum code rate variation, each subjective quality value corresponds to a maximum code rate variation. The preset correspondence between the subjective quality value and the maximum code rate variation can be, for example, a curve of the subjective quality value and the maximum code rate variation.

[0053] In some embodiments, there are multiple preset correspondences between the subjective quality value and the maximum code rate variation, and the multiple correspondences (i.e., the preset correspondences between the subjective quality value and the maximum code rate variation) respectively correspond to multiple reference video files one by one. In this case, a mapping table can be preset, in which the multiple correspondences respectively correspond to the multiple reference video files one by one.

[0054] When step S120 is performed, a matching reference video file corresponding to the target video file can be searched from the multiple reference video files in the mapping table. The matching reference video file satisfies the following condition: the matching reference video file and the target video file are of the same file type.

[0055] For example, the same file type includes at least one of the following: the same background color, the same brightness, the same color saturation, and the same scene element complexity.

[0056] The background color refers to the background color of the images in the video file. For example, if the difference between the RGB values of the background colors of two video files is within a preset color deviation range, the two video files can be regarded as video files of the same background color. Alternatively, if the background colors of multiple video files are the same, then the difference between the RGB values of the background colors of any two video files in the multiple video files is within a preset color deviation range.

[0057] The brightness refers to the brightness of the images in the video file. For example, if the difference between the brightness of the images of two video files is within a preset brightness deviation range, the two video files can be regarded as video files of the same brightness. Alternatively, if the brightness of multiple video files is the same, then the difference between the brightness of any two video files in the multiple video files is within a preset brightness deviation range.

[0058] The color saturation refers to the saturation of the colors, for example, if the difference between the saturation of the colors of two video files is within a preset color saturation deviation range, the two video files can be regarded as video files of the same color saturation. Alternatively, if the color saturation of multiple video files is the same, then the difference between the saturation of the colors of any two video files in the multiple video files is within a preset color saturation deviation range.

[0059] The scene displayed in the video image always contains one or more elements, for example, the video file includes the sea and the beach in the picture, then the sea and the beach are the scene elements of the video file, and the number of scene elements is 2 (i.e., the sea and the beach 2). In this case, the number of scene elements can be used as the scene element complexity. In this case, if the difference in scene element complexity of two video files is within the preset element complexity deviation range, the two video files can be considered as video files with the same scene element complexity; or it can also be considered that if the scene element complexity of a plurality of video files is the same, then the difference in scene element complexity of any two video files in the plurality of video files is within the preset scene element complexity deviation range.

[0060] It can be understood that the color deviation range, the brightness deviation range, the color vividness deviation range, and the scene element complexity deviation range described above can be set by those skilled in the art according to actual conditions, and the embodiments of the present disclosure are not limited thereto.

[0061] It should be noted that the file types of any two reference video files in the plurality of reference video files of the mapping table are different.

[0062] It should be noted that in the subsequent steps S210-S230, a corresponding relationship between the subjective quality value and the maximum code rate change amount is obtained according to the plurality of sample video files, and in this case, the corresponding reference video file corresponding to the corresponding relationship in the mapping table can be one of the plurality of sample video files, or the reference video file has the same file type as the plurality of sample video files.

[0063] When searching for a matching reference video file, the file types of each reference video file in the mapping table and the target video file can be sequentially judged, and if the file types are the same, the reference video file is used as the matching reference video file.

[0064] It should be noted that as long as the file types of the matching reference video file and the target video file are the same, the embodiments of the present disclosure do not limit the way of judging whether the file types of each reference video file and the target video file are the same.

[0065] After that, in the mapping table, the corresponding relationship corresponding to the matching reference video file is obtained, and in the corresponding relationship, the maximum code rate change amount corresponding to the subjective quality value of the target video file is searched, and the maximum code rate change amount is used as the maximum code rate change amount of the target video file.

[0066] For example, if the number of preset corresponding relationships between subjective quality values and maximum code rate variation amounts is three, which are corresponding relationship A, corresponding relationship B and corresponding relationship C; in the mapping table, corresponding relationship A corresponds to reference video file X, corresponding relationship B corresponds to reference video file Y, and corresponding relationship C corresponds to reference video file Z, that is, the mapping table has the following mapping relationship: To obtain the maximum code rate variation amount corresponding to the target video file, whether the file types of the reference video file and the target video file in the mapping table are the same is judged in sequence, if the judgment result is that the file types of the reference video file Y and the target video file are the same, the corresponding relationship corresponding to the reference video file Y in the mapping table is corresponding relationship B, then in corresponding relationship B, the maximum code rate variation amount corresponding to the subjective quality value of the target video file is found as the maximum code rate variation amount of the target video file.

[0067] Before step S120 is performed, a plurality of corresponding relationships between subjective quality values and maximum code rate variation amounts can be preset. Based on this, in some embodiments, as shown in Figure 2 Before step S120 is performed, the embodiments of the present disclosure can also perform steps S210-S230 as follows:

[0068] Step S210: Obtain a plurality of sample video files.

[0069] The file types of the plurality of sample video files are the same (see the above description about the same file types, which will not be repeated here).

[0070] The number of the plurality of video files can be set by those skilled in the art according to actual conditions, and the embodiments of the present disclosure do not limit this.

[0071] Step S220: Perform code rate reduction test on each sample video file.

[0072] For each sample video file, as shown in Figure 3 The following steps S310-S340 are performed:

[0073] Step S310: Obtain the original code rate and subjective quality value of the sample video file.

[0074] The original code rate of the sample video file is the current code rate of the sample video file.

[0075] The subjective quality value of the sample video file is obtained in the same way as the subjective quality value of the target video file, and details can be referred to the above description about the subjective quality value of the target video file, which will not be repeated here.

[0076] Step S320: gradually increase the code rate variation to gradually reduce the code rate of the sample video file according to the code rate variation.

[0077] The code rate of the sample video file is the difference between the original code rate of the sample video file and the code rate variation. That is, let the code rate of the sample video file be denoted as b, the original code rate of the sample video file be denoted as b o , and the code rate variation be denoted as Δb, the code rate of the sample video file, the original code rate of the sample video file, and the code rate variation satisfy the following relationship: b = b o - Δb.

[0078] In this case, if the code rate variation Δb is gradually increased, since the original code rate b o of the sample video file is unchanged, according to b = b o - Δb, the code rate b of the sample video file gradually decreases.

[0079] For example, the code rate variation is gradually increased by a preset step length, and then the code rate of the sample video file is also gradually reduced by the preset step length. The preset step length can be set by those skilled in the art according to actual conditions, and the present disclosure does not limit this.

[0080] Step S330: obtain the subjective quality value of the sample video file after each time the code rate is reduced.

[0081] After the code rate is reduced for the i-th time (i is a natural number and i > 1), the code rate variation after this time is denoted as Δb i (unit: kb / s), the code rate b i of the sample video file = b o - Δb i , the sample video file is encoded using the code rate b i , and the encoded video file is decoded to obtain the subjective quality value of the decoded sample video file, denoted as Q i .

[0082] Step S340: take the maximum code rate variation that does not affect the subjective quality value of the sample video file as the maximum code rate variation of the sample video file.

[0083] Referring to FIG. 3, Figure 4 , Figure 4 the horizontal coordinate in the figure is the code rate variation Δb i , Figure 4 the vertical coordinate is the subjective quality value Q i of the sample video file. In the case of Δb i = 0, the subjective quality value of the sample video file is Q (i.e., in the case of the code rate of the sample video file being the original code rate b oIn this case, the subjective quality value of the sample video file starts to decrease. In this case, Δb i After Δb i is increased to a critical value Δb i , the subjective quality value of the sample video file starts to decrease. In this case, Δb i is increased to a critical value Δb max , the subjective quality value of the sample video file starts to decrease. In this case, Δb i is increased to a critical value Δb max , the subjective quality value of the sample video file starts to decrease. In this case, Δb j is increased to a critical value Δb maxj , the subjective quality value of the sample video file starts to decrease. In this case, Δb j is increased to a critical value Δb maxj , the subjective quality value of the sample video file starts to decrease. In this case, Δb maxj is increased to a critical value Δb j , the subjective quality value of the sample video file starts to decrease. In this case, Δb

[0084] Step S230: According to the subjective quality values of the plurality of sample video files and the maximum bit rate variation amounts of the plurality of sample video files, a corresponding relationship between the subjective quality values and the maximum bit rate variation amounts is established.

[0085] If the number of the plurality of sample video files is n (n is a natural number and n > 1), according to the subjective quality value of each sample video file obtained in step S220 and the maximum bit rate variation amount of the sample video file, the subjective quality value of the jth (j is a natural number and n ≥ j ≥ 1) sample video file is denoted as Q , and the maximum bit rate variation amount of the jth sample video file is denoted as Δb

[0001] . By corresponding the subjective quality value of each sample video file in the plurality of sample video files to the maximum bit rate variation amount of the sample video file, the corresponding relationship between the subjective quality values and the maximum bit rate variation amounts can be established.

[0086] For example, according to the subjective quality values of the plurality of sample video files and the maximum bit rate variation amounts of the plurality of sample video files, a relationship curve between the subjective quality values and the maximum bit rate variation amounts is fitted in a plane coordinate system.

[0087] For example, as shown in FIG. 2 and FIG. 3, Figure 5A and Figure 5B , the abscissa of the plane coordinate system represents the subjective quality value Q j of the sample video file, and the ordinate represents the maximum bit rate variation amount Δb maxj of the sample video file, so that the corresponding coordinates of the n sample video files in the plane coordinate system can be obtained. For example, the coordinates of the jth sample video file in the plane coordinate system are (Δb maxj , Q j ). By plotting the coordinates of the n sample video files in the plane coordinate system, a plurality of discrete points in the plane coordinate system can be plotted. By fitting the variation relationship of the plurality of discrete points, the relationship curve between the subjective quality values and the maximum bit rate variation amounts can be obtained.

[0088] It should be noted that Figure 5A and Figure 5B The shape of the relationship curve shown is only exemplary. The shape of the relationship curve between the subjective quality value and the maximum code rate change amount varies according to the file type of the plurality of sample video files. In the embodiment of the present disclosure, the relationship curve between the subjective quality value and the maximum code rate change amount includes, but is not limited to Figure 5A and Figure 5B The shape of the relationship curve shown in the above.

[0089] Step S130, according to the original code rate and the maximum code rate change amount, the code rate of the target video file is reduced.

[0090] In the process of encoding the target video segment, the target video file will be divided into multiple segments (for example, GOP (group of picture, picture group)), and each segment is independently encoded. In this case, as Figure 6 shown, the execution process of step S130 can include steps S610-S630 as follows:

[0091] Step S610: Obtain the segment subjective quality value of each segment of the target video file.

[0092] The acquisition method of the segment subjective quality value is the same as the acquisition method of the subjective quality value of the target video file, and the specific description can be referred to the corresponding description in step S110, which will not be repeated here.

[0093] Step S620: Determine the segment whose segment subjective quality value is higher than the subjective quality value of the target video file as the target segment.

[0094] For example, it is judged in turn whether the segment subjective quality value of each segment is greater than or equal to the subjective quality value of the target video file. If the judgment result is yes, the segment is the target segment, otherwise the segment is not the target segment.

[0095] Step S630: According to the original code rate and the maximum code rate change amount of the target video file, the code rate of the target segment is reduced.

[0096] The original code rate is reduced by the maximum code rate variation to obtain a first encoding code rate. In a case where the first encoding code rate is greater than or equal to a preset threshold, the code rate of the target segment is reduced to the first encoding code rate, and the target segment is encoded according to the first encoding code rate. In this way, the segment subjective quality value of the target segment can be reduced to the subjective quality value of the target video file. In a case where the first encoding code rate is less than the preset threshold, the target segment is encoded according to the original code rate. The preset threshold satisfies that when the code rate of one of all the target segments is less than the preset threshold, the subjective quality value of the target video file starts to decrease. In this case, after the target video file is re-evaluated according to the preset subjective evaluation index, the subjective quality value of the target video file obtained will not change, and therefore the change of reducing the segment subjective quality value of the target segment to the subjective quality value of the target video file will not be perceived, thereby achieving the purpose of saving the encoding code rate while not affecting the subjective quality value of the target video file.

[0097] It can be understood that for other segments except the target segment, the other segments can be encoded according to the original code rate, or each of the other segments can be regarded as a target video file, and the steps in steps S110-S120 are re-executed to obtain the maximum code rate variation corresponding to each of the other segments. In this case, for each of the other segments, the difference between the original code rate and the maximum code rate variation corresponding to the segment is obtained as a second encoding code rate, and the segment is encoded according to the second encoding code rate.

[0098] <Device Embodiment>

[0099] Figure 7 is a principle block diagram of a video encoding device according to some embodiments of the present disclosure. As shown in Figure 7 , the video encoding device 70 can include an obtaining module 71, a determining module 72 and a processing module 73.

[0100] The obtaining module 71 is configured to obtain the subjective quality value of the target video file and the original code rate.

[0101] The determining module 72 is configured to determine the maximum code rate variation of the target file according to the subjective quality value of the target video file obtained by the obtaining module 71 based on the correspondence between the subjective quality value and the maximum code rate variation.

[0102] The processing module 73 is configured to perform a reduction processing on the code rate of the target video file according to the original code rate obtained by the obtaining module 71 and the maximum code rate variation obtained by the determining module 72.

[0103] The video encoding device 70 can be, for example, a chip in a video encoder for encoding a video.

[0104] In some embodiments, the video encoding device 70 further includes:

[0105] a sample obtaining module configured to obtain a plurality of sample video files.

[0106] a rate down test module configured to perform a rate down test on each of the sample video files, wherein the rate down test comprises: obtaining an original rate and a subjective quality value of the sample video file; gradually increasing a rate change amount to gradually reduce the rate of the sample video file according to the rate change amount; obtaining the subjective quality value of the sample video file after each rate reduction; and taking the maximum rate change amount that does not affect the subjective quality value of the sample video file as the maximum rate change amount of the sample video file.

[0107] a relationship processing module configured to establish a corresponding relationship between the subjective quality value and the maximum rate change amount according to the subjective quality values of the plurality of sample video files and the maximum rate change amounts of the plurality of sample video files.

[0108] In some embodiments, the relationship processing module is configured to fit a relationship curve between the subjective quality value and the maximum rate change amount according to the subjective quality values of the plurality of sample video files and the maximum rate change amounts of the plurality of sample video files.

[0109] In some embodiments, the processing module 73 includes:

[0110] an obtaining sub-module configured to obtain a segment subjective quality value of each segment of the target video file.

[0111] a determining sub-module configured to determine a segment whose segment subjective quality value is higher than the subjective quality value of the target video file as a target segment.

[0112] a processing sub-module configured to reduce the rate of the target segment according to the original rate and the maximum rate change amount of the target video file.

[0113] In some embodiments, the processing sub-module is configured to: reduce the original rate by the maximum rate change amount to obtain a first encoding rate; and reduce the rate of the target segment to the first encoding rate in a case where the first encoding rate is greater than or equal to a preset threshold.

[0114] In some embodiments, the sample video file has the same file type as the target video file, and the same file type includes at least one of the following: same base color, same brightness, same color vibrancy, and same scene element complexity.

[0115] In some embodiments, the obtaining module 71 is configured to obtain the subjective quality value of the target video file according to a preset subjective evaluation index.

[0116] In some embodiments, the preset subjective evaluation metrics include at least one of the following: applied visual fidelity, loss of detail, and time information.

[0117] The specific structure and working principle of each of the above modules can be found in the description of the corresponding steps in the method embodiment, and will not be repeated here.

[0118] Figure 8 This is a schematic diagram of the hardware structure of an electronic device according to some embodiments of the present disclosure.

[0119] like Figure 8 As shown, the electronic device 800 includes a processor 810 and a memory 820, the memory 820 for storing an executable computer program, and the processor 810 for executing methods as described in any of the above method embodiments under the control of the computer program.

[0120] The electronic device 800 may be, for example, a device used to encode video, such as a video encoder.

[0121] Each module of the above electronic device 800 can be implemented by the processor 810 in this embodiment executing the computer program stored in the memory 820, or it can be implemented by other circuit structures, which are not limited here.

[0122] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.

[0123] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0124] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0125] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, for example, through the Internet using an Internet Service Provider. In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0126] The computer readable program instructions can also be loaded onto a computing / processing device, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computing / processing device, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computing / processing device, other programmable apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0127] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include a non-transitory computer readable storage medium that can be a computer- readable storage medium having no data, programs, program modules, e.g., instructions for operation, or digital content stored thereon or therein for a short time or not at all. The computer readable storage medium can also have instructions stored thereon or therein which may

[0128] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0129] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0130] Having described above several embodiments of the disclosure, any modifications and variations that fall within the scope of the described embodiments are also contemplated by the inventor(s). As such, the foregoing description is not intended to limit the scope of the disclosure, and it is recognized that modifications are contemplated which can provide one or more benefits and which are within the scope of the disclosure. The disclosure is defined by the appended claims.

Claims

1. A method of video coding, the method comprising: The method comprises the following steps: obtaining a subjective quality value and an original code rate of a target video file; determining a maximum code rate variation of the target video file according to the subjective quality value of the target video file based on a preset corresponding relationship between subjective quality values and maximum code rate variations; performing a code rate reduction process on the target video file according to the original code rate and the maximum code rate variation; wherein, before determining the maximum code rate variation of the target video file according to the subjective quality value of the target video file based on the preset corresponding relationship between subjective quality values and maximum code rate variations, the method further comprises the following steps: obtaining a plurality of sample video files; performing a code rate reduction test on each sample video file; wherein the code rate reduction test comprises the following steps: obtaining an original code rate and a subjective quality value of the sample video file; gradually increasing the code rate variation to gradually reduce the code rate of the sample video file according to the code rate variation; obtaining the subjective quality value of the sample video file after each code rate reduction; and taking the maximum code rate variation that does not affect the subjective quality value of the sample video file as the maximum code rate variation of the sample video file; establishing a corresponding relationship between subjective quality values and maximum code rate variations according to the subjective quality values of the plurality of sample video files and the maximum code rate variations of the plurality of sample video files.

2. The video coding method of claim 1, wherein, The step of establishing a corresponding relationship between subjective quality values and maximum code rate variations according to the subjective quality values of the plurality of sample video files and the maximum code rate variations of the plurality of sample video files comprises the following steps: fitting a relationship curve of subjective quality values and maximum code rate variations according to the subjective quality values of the plurality of sample video files and the maximum code rate variations of the plurality of sample video files.

3. The video coding method of claim 1, wherein, The step of performing a code rate reduction process on the target video file according to the original code rate and the maximum code rate variation comprises the following steps: obtaining a segment subjective quality value of each segment of the target video file; determining a target segment whose segment subjective quality value is higher than the subjective quality value of the target video file as the target segment; reducing the code rate of the target segment according to the original code rate and the maximum code rate variation of the target video file.

4. The video coding method of claim 3, wherein, The step of reducing the code rate of the target segment according to the original code rate and the maximum code rate variation of the target video file comprises the following steps: reducing the original code rate by the maximum code rate variation to obtain a first encoding code rate; in the case that the first encoding code rate is greater than or equal to a preset threshold, reducing the code rate of the target segment to the first encoding code rate.

5. The video coding method of claim 1, wherein, The file type of the sample video file is the same as the file type of the target video file. The same file type comprises at least one of the following: the same base color, the same brightness, the same color vividness, and the same scene element complexity.

6. The video coding method of claim 1, wherein, The step of obtaining a subjective quality value of a target video file comprises the following steps: obtaining a subjective quality value of the target video file according to a preset subjective evaluation index.

7. The video coding method of claim 6, wherein, The preset subjective evaluation index comprises at least one of the following: visual fidelity, detail loss, and time information.

8. A video encoding apparatus, comprising: The method comprises the following steps: an obtaining module, configured to obtain a subjective quality value and an original code rate of a target video file; The determining module is configured to determine the maximum code rate variation of the target video file according to the subjective quality value of the target video file obtained by the obtaining module based on the preset correspondence between subjective quality values and maximum code rate variations. The processing module is configured to perform rate reduction processing on the code rate of the target video file according to the original code rate obtained by the obtaining module and the maximum code rate variation obtained by the determining module. The sample obtaining module is configured to obtain a plurality of sample video files. The rate reduction testing module is configured to perform code rate reduction testing on each sample video file. The code rate reduction testing includes: obtaining the original code rate and the subjective quality value of the sample video file; gradually increasing the code rate variation to gradually reduce the code rate of the sample video file according to the code rate variation; obtaining the subjective quality value of the sample video file after each code rate reduction; and taking the maximum code rate variation that does not affect the subjective quality value of the sample video file as the maximum code rate variation of the sample video file. The relationship processing module is configured to establish the correspondence between the subjective quality value and the maximum code rate variation according to the subjective quality values of the plurality of sample video files and the maximum code rate variations of the plurality of sample video files.

9. An electronic device, comprising: The computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the video encoding method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the video encoding method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Adaptive video transcode method and device based on contents

    CN105187835A

  • Video processing method and device

    CN109286825A