Video source compression quality analysis method and device based on video frame information
By analyzing the frame -level configuration parameters of the video frame, the motion vector, quantitative parameter and frame type, solve the problem of low video quality assessment flexibility in existing technologies, and achieve more efficient video source compression quality analysis.
Patent Information
- Application Number
- CN202210928192.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-03
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-08-03
AI Technical Summary
The prior art has low flexibility in evaluating video quality, making it difficult to quickly and efficiently analyze video source compression quality.
By determining the frame level configuration parameters of each frame in the target video, analyze the motion vector, quantitative parameter and frame type of each frame, and then calculate the compression quality of the video.
It improves the flexibility and efficiency of video frame information acquisition, and enhances the flexibility and accuracy of video source compression quality analysis.
Smart Images

Figure CN115442589B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital video technology, and in particular to a method and device for analyzing video source compression quality based on video frame information. Background Art
[0002] With the rapid development of digital information technology, multimedia technology is widely used in people's daily lives, and people have more and more demands for various entertainment activities. Among them, video is one of people's daily entertainment activities. More and more users are paying attention to live or recorded videos on the Internet, and users' requirements for video quality are also increasing.
[0003] At present, improving the user's viewing experience of videos has become the main competitive factor of video services. There are many factors that affect video quality, but the current evaluation of video quality is usually done by repeatedly testing the video to evaluate the quality of the video, which leads to the problem of low flexibility in the evaluation of video quality. It can be seen that it is particularly important to provide a new video source compression quality analysis method to improve the flexibility of analyzing video quality. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and device for analyzing video source compression quality based on video frame information, which can improve the flexibility and efficiency of obtaining video frame information of the target video by determining the frame-level configuration parameters corresponding to each frame in the target video, thereby being conducive to improving the flexibility and efficiency of determining the video source compression quality of the target video based on the video frame information.
[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a video source compression quality analysis method based on video frame information, the method comprising:
[0006] Determine frame information statistics configuration information of the target video, wherein the frame information statistics configuration information includes frame-level configuration parameters corresponding to each frame in the target video, and the target video is a video that needs to be subjected to video source compression quality analysis;
[0007] For at least one target frame in the target video, according to the frame-level configuration parameters of the target frame, perform an analysis operation on the target frame to obtain a target analysis result corresponding to the target frame;
[0008] The video analysis result of the target video is determined according to the target analysis results corresponding to all the target frames, wherein the video analysis result is used to represent the quality of the target video.
[0009] As an optional implementation manner, in the first aspect of the present invention, for at least one target frame in the target video, performing an analysis operation on the target frame to obtain a target analysis result corresponding to the target frame includes:
[0010] According to the frame-level configuration parameters of the target frame, judging whether the target frame meets the preset hardware analysis condition, obtaining a judgment result, and determining the target execution object according to the judgment result, wherein when the judgment result is yes, the target execution object is a hardware decoder; when the judgment result is no, the target execution object is a software driver;
[0011] The target execution object performs an analysis operation on the target frame to obtain a target analysis result corresponding to the target frame.
[0012] As an optional implementation, in the first aspect of the present invention, when the target execution object is the hardware decoder, for at least one target frame in the target video, performing an analysis operation on the target frame by the target execution object to obtain a target analysis result corresponding to the target frame includes:
[0013] Performing initialization processing on the target frame by the hardware decoder, and traversing all target decoding units in the target frame by the hardware decoder to obtain target data of the target frame, and determining a target analysis result corresponding to the target frame according to the target data of the target frame;
[0014] And, when the target execution object is the software driver, for at least one target frame in the target video, performing an analysis operation on the target frame by the target execution object to obtain a target analysis result corresponding to the target frame includes:
[0015] Performing the initialization processing on the target frame through the software driver, configuring the target data cache address through the software driver and sending the target data cache address to the hardware decoder, so as to trigger the hardware decoder to perform the operation of traversing all target decoding units in the target frame, obtaining the target data of the target frame, and inputting the target data of the target frame into the target data cache address;
[0016] The software driver determines the target analysis result corresponding to the target frame according to the target data of the target frame included in the target data cache address.
[0017] As an optional implementation manner, in the first aspect of the present invention, the analysis operation includes one or more of a motion vector analysis operation, a quantization parameter analysis operation, and a frame type statistical analysis operation;
[0018] Wherein, when the analysis operation includes the motion vector analysis operation, the target data includes a motion vector triplet, and the target analysis result includes a motion vector analysis result;
[0019] When the analysis operation includes the quantization parameter analysis operation, the target data includes a quantization parameter triplet, and the target analysis result includes a quantization parameter analysis result;
[0020] When the analysis operation includes the frame type statistical analysis operation, the target data includes frame type parameters, and the target analysis result includes a frame type statistical analysis result.
[0021] As an optional implementation manner, in the first aspect of the present invention, for at least one target frame in the target video, when the analysis operation includes the motion vector analysis operation, the traversing all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame includes:
[0022] According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the intra-frame prediction units of the target frame, and when the judgment result is yes, all decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a first traversal result; when the judgment result is no, all decoding units in the target frame except the intra-frame prediction unit are determined as target decoding units and a traversal operation is performed to obtain a first traversal result, and the first traversal result includes a motion vector maximum value of the target frame, wherein the motion vector maximum value includes a motion vector maximum value and a motion vector minimum value;
[0023] Determine whether the target frame satisfies the condition that the maximum value of the motion vector adopts the absolute value, and when the determination result is yes, determine the absolute value of the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame; when the determination result is no, determine the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame;
[0024] Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average motion vector of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average motion vector of the target frame according to the actual decoding unit of the target frame;
[0025] Determine whether the target frame satisfies the condition that the motion vector average value adopts an absolute value, and when the determination result is yes, determine the absolute value of the motion vector average value of the target frame as the target motion vector average value of the target frame; when the determination result is no, determine the motion vector average value of the target frame as the target motion vector average value of the target frame;
[0026] A motion vector triplet of the target frame is determined according to a maximum value of the target motion vector of the target frame and an average value of the target motion vector of the target frame.
[0027] As an optional implementation manner, in the first aspect of the present invention, for at least one target frame in the target video, when the analysis operation includes the quantization parameter analysis operation, the traversing all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame includes:
[0028] According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the non-quantized decoding units of the target frame, and when the judgment result is yes, all decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result; when the judgment result is no, all decoding units except the non-quantized decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result, and the second traversal result includes a maximum value of a quantization parameter of the target frame, wherein the maximum value of the quantization parameter includes a maximum value of the quantization parameter and a minimum value of the quantization parameter;
[0029] Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average value of the quantization parameter of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average value of the quantization parameter of the target frame according to the actual decoding unit of the target frame;
[0030] A quantization parameter triplet of the target frame is determined according to a maximum quantization parameter value and an average quantization parameter value of the target frame.
[0031] As an optional implementation manner, in the first aspect of the present invention, for at least one target frame in the target video, when the analysis operation includes the frame type statistical analysis operation, the traversing all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame includes:
[0032] According to the frame-level configuration parameters of the frame, whether the frame type of the frame is a preset target frame type is determined, and when the judgment result is yes, the frame type parameter of the target frame is determined as a preset target value; when the judgment result is no, all decoding units in the target frame are determined as target decoding units, and a traversal operation is performed on all the target decoding units to obtain the encoding data of each of the target decoding units in the target frame, wherein the encoding data of each of the target decoding units includes first data or second data, and for each of the target decoding units, when the encoding data is the first data, it indicates that the target decoding unit adopts skip mode encoding, and when the encoding data is the second data, it indicates that the target decoding unit does not adopt skip mode encoding;
[0033] The frame type parameter of the target frame is determined according to the encoded data of all the target decoding units in the target frame.
[0034] A second aspect of the present invention discloses a video source compression quality analysis device based on video frame information, the device comprising:
[0035] A first determination module is used to determine frame information statistics configuration information of the target video, wherein the frame information statistics configuration information includes frame-level configuration parameters corresponding to each frame in the target video, and the target video is a video that needs to be subjected to video source compression quality analysis;
[0036] An analysis module, configured to perform an analysis operation on at least one target frame in the target video according to a frame-level configuration parameter of the target frame, and obtain a target analysis result corresponding to the target frame;
[0037] The second determination module is used to determine the video analysis result of the target video according to the target analysis results corresponding to all the target frames, wherein the video analysis result is used to represent the compression quality of the target video source.
[0038] As an optional implementation, in the second aspect of the present invention, the analysis module includes:
[0039] A judgment submodule, used for judging whether at least one target frame in the target video meets a preset hardware analysis condition according to a frame-level configuration parameter of the target frame, and obtaining a judgment result;
[0040] A determination submodule, configured to determine a target execution object according to the judgment result, wherein when the judgment result is yes, the target execution object is a hardware decoder; when the judgment result is no, the target execution object is a software driver;
[0041] The analysis submodule is used to perform an analysis operation on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame.
[0042] As an optional implementation, in the second aspect of the present invention, when the target execution object is the hardware decoder, for at least one target frame in the target video, the analysis submodule performs an analysis operation on the target frame through the target execution object, and obtains the target analysis result corresponding to the target frame in the following manner:
[0043] Performing initialization processing on the target frame by the hardware decoder, and traversing all target decoding units in the target frame by the hardware decoder to obtain target data of the target frame, and determining a target analysis result corresponding to the target frame according to the target data of the target frame;
[0044] And, when the target execution object is the software driver, for at least one target frame in the target video, the analysis submodule performs an analysis operation on the target frame through the target execution object, and obtains the target analysis result corresponding to the target frame in the following manner:
[0045] Performing the initialization processing on the target frame through the software driver, configuring the target data cache address through the software driver and sending the target data cache address to the hardware decoder, so as to trigger the operation of traversing all target decoding units in the target frame through the hardware decoder, obtaining the target data of the target frame, and inputting the target data of the target frame into the target data cache address;
[0046] The software driver determines the target analysis result corresponding to the target frame according to the target data of the target frame included in the target data cache address.
[0047] As an optional implementation manner, in the second aspect of the present invention, the analysis operation includes one or more of a motion vector analysis operation, a quantization parameter analysis operation, and a frame type statistical analysis operation;
[0048] Wherein, when the analysis operation includes the motion vector analysis operation, the target data includes a motion vector triplet, and the target analysis result includes a motion vector analysis result;
[0049] When the analysis operation includes the quantization parameter analysis operation, the target data includes a quantization parameter triplet, and the target analysis result includes a quantization parameter analysis result;
[0050] When the analysis operation includes the frame type statistical analysis operation, the target data includes frame type parameters, and the target analysis result includes a frame type statistical analysis result.
[0051] As an optional implementation, in the second aspect of the present invention, for at least one target frame in the target video, when the analysis operation includes the motion vector analysis operation, the analysis submodule executes the traversal of all target decoding units in the target frame through the hardware decoder to obtain the target data of the target frame in the following manner:
[0052] According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the intra-frame prediction units of the target frame, and when the judgment result is yes, all decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a first traversal result; when the judgment result is no, all decoding units in the target frame except the intra-frame prediction unit are determined as target decoding units and a traversal operation is performed to obtain a first traversal result, and the first traversal result includes a motion vector maximum value of the target frame, wherein the motion vector maximum value includes a motion vector maximum value and a motion vector minimum value;
[0053] Determine whether the target frame satisfies the condition that the maximum value of the motion vector adopts the absolute value, and when the determination result is yes, determine the absolute value of the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame; when the determination result is no, determine the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame;
[0054] Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average motion vector of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average motion vector of the target frame according to the actual decoding unit of the target frame;
[0055] Determine whether the target frame satisfies the condition that the motion vector average value adopts an absolute value, and when the determination result is yes, determine the absolute value of the motion vector average value of the target frame as the target motion vector average value of the target frame; when the determination result is no, determine the motion vector average value of the target frame as the target motion vector average value of the target frame;
[0056] A motion vector triplet of the target frame is determined according to a maximum value of the target motion vector of the target frame and an average value of the target motion vector of the target frame.
[0057] As an optional implementation, in the second aspect of the present invention, for at least one target frame in the target video, when the analysis operation includes the quantization parameter analysis operation, the analysis submodule executes the traversal of all target decoding units in the target frame through the hardware decoder to obtain the target data of the target frame in the following manner:
[0058] According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the non-quantized decoding units of the target frame, and when the judgment result is yes, all decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result; when the judgment result is no, all decoding units except the non-quantized decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result, and the second traversal result includes a maximum value of a quantization parameter of the target frame, wherein the maximum value of the quantization parameter includes a maximum value of the quantization parameter and a minimum value of the quantization parameter;
[0059] Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average value of the quantization parameter of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average value of the quantization parameter of the target frame according to the actual decoding unit of the target frame;
[0060] A quantization parameter triplet of the target frame is determined according to a maximum quantization parameter value and an average quantization parameter value of the target frame.
[0061] As an optional implementation, in the second aspect of the present invention, for at least one target frame in the target video, when the analysis operation includes the frame type statistical analysis operation, the analysis submodule executes the traversal of all target decoding units in the target frame through the hardware decoder to obtain the target data of the target frame in the following manner:
[0062] According to the frame-level configuration parameters of the frame, whether the frame type of the frame is a preset target frame type is determined, and when the judgment result is yes, the frame type parameter of the target frame is determined as a preset target value; when the judgment result is no, all decoding units in the target frame are determined as target decoding units, and a traversal operation is performed on all the target decoding units to obtain the encoding data of each of the target decoding units in the target frame, wherein the encoding data of each of the target decoding units includes first data or second data, and for each of the target decoding units, when the encoding data is the first data, it indicates that the target decoding unit adopts skip mode encoding, and when the encoding data is the second data, it indicates that the target decoding unit does not adopt skip mode encoding;
[0063] The frame type parameter of the target frame is determined according to the encoded data of all the target decoding units in the target frame.
[0064] The third aspect of the present invention discloses another video source compression quality analysis device based on video frame information, the device comprising:
[0065] A memory storing executable program code;
[0066] a processor coupled to the memory;
[0067] The processor calls the executable program code stored in the memory to execute the video source compression quality analysis method based on video frame information disclosed in the first aspect of the present invention.
[0068] The fourth aspect of the present invention discloses a computer storable medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the video source compression quality analysis method based on video frame information disclosed in the first aspect of the present invention.
[0069] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0070] In an embodiment of the present invention, frame information statistics configuration information of a target video is determined, the frame information statistics configuration information includes frame-level configuration parameters corresponding to each frame in the target video, and for at least one target frame in the target video, a video analysis result of the target video is determined according to target analysis results corresponding to all target frames, wherein the video analysis result is used to represent the quality of the target video. It can be seen that the implementation of the present invention can be beneficial to improving the flexibility of obtaining video frame information, and can be beneficial to improving the efficiency of obtaining video frame information. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0072] Figure 1 It is a flow chart of a method for analyzing video source compression quality based on video frame information disclosed in an embodiment of the present invention;
[0073] Figure 2 It is a flow chart of another method for analyzing video source compression quality based on video frame information disclosed in an embodiment of the present invention;
[0074] Figure 3 It is a structural schematic diagram of a video source compression quality analysis device based on video frame information disclosed in an embodiment of the present invention;
[0075] Figure 4 It is a structural schematic diagram of another video source compression quality analysis device based on video frame information disclosed in an embodiment of the present invention;
[0076] Figure 5It is a structural schematic diagram of another video source compression quality analysis device based on video frame information disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0077] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0078] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.
[0079] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0080] The present invention discloses a video source compression quality analysis method and device based on video frame information, which can help improve the flexibility of obtaining video frame information and can help improve the efficiency of obtaining video frame information. The following are detailed descriptions.
[0081] Embodiment 1
[0082] See also Figure 1 , Figure 1 1 is a flow chart of a method for analyzing video source compression quality based on video frame information disclosed in an embodiment of the present invention. Figure 1 The described video source compression quality analysis method based on video frame information can be applied to a video quality analysis device based on video frame information, and can also be applied to a cloud server or a local server for video source compression quality analysis based on video frame information, and the embodiments of the present invention are not limited thereto. Figure 1 As shown, the video source compression quality analysis method based on video frame information may include the following operations:
[0083] 101. Determine frame information statistics configuration information of a target video.
[0084] In the embodiment of the present invention, the frame information statistics configuration information includes frame-level configuration parameters corresponding to each frame in the target video.
[0085] In the embodiment of the present invention, the target video is a video that needs to be analyzed for video source compression quality. Further, optionally, the target video includes at least one frame.
[0086] In the embodiment of the present invention, optionally, the frame-level configuration parameters corresponding to each frame in the target video may be externally configurable control parameters, which are set according to actual usage, thereby improving the flexibility of frame information statistics and the accuracy of video source quality assessment.
[0087] 102. For at least one target frame in the target video, perform an analysis operation on the target frame according to a frame-level configuration parameter of the target frame to obtain a target analysis result corresponding to the target frame.
[0088] In an embodiment of the present invention, optionally, the frame-level configuration parameters of each target frame may include one or more of a hardware statistical motion vector switch Mv-Hw-Enable, a hardware statistical quantization parameter switch Qp-Hw-Enable, and a hardware statistical SkipRatio switch Skip-Hw-Enable. Further optionally, the frame-level configuration parameters of each target frame may also include one or more of a minimum decoding unit statistics switch Min-Block-Flag, a MV statistics whether to skip intra-frame blocks switch Mv-Intra-Skip-Flag, a motion vector maximum value comparison whether to use an absolute value switch Mv-MaxMin-Abs-Flag, a motion vector mean calculation whether to use an absolute value switch Mv-Avg-Abs-Flag, and a QP statistics whether to skip non-quantized decoding unit switch Qp-Skip-Flag. It should be noted that the switch can be a Boolean variable, and there are two values, 0 and 1, respectively. When the Boolean variable is 0, it indicates that the switch is in the off state; when the Boolean variable is 1, it indicates that the switch is in the on state.
[0089] In the embodiment of the present invention, optionally, the target frame may be all frames in the target video, or may be a part of frames in the target video, and the number of the target frame is at least one.
[0090] 103. Determine a video analysis result of the target video according to the target analysis results corresponding to all target frames.
[0091] In the embodiment of the present invention, the video analysis result is used to represent the video source compression quality of the target video, wherein the video source compression quality is the quality of the target video after compression.
[0092] In the embodiment of the present invention, optionally, the target analysis result corresponding to each target frame includes the motion vector analysis result, quantization parameter analysis result, and frame type statistical analysis result of the target frame. Further optionally, the motion vector analysis result may include the maximum motion vector, the minimum motion vector, and the average motion vector; the quantization parameter analysis result may include the maximum quantization parameter, the minimum quantization parameter, and the average quantization parameter; the frame type statistical analysis result may include the ratio between the number of blocks using skip coding and the number of blocks not using skip coding in the target frame.
[0093] In the embodiment of the present invention, determining the video analysis result of the target video according to the target analysis results corresponding to all the target frames may include: determining the video analysis result of the target video according to the target analysis results corresponding to all the target frames by using a preset target algorithm, wherein the target algorithm is:
[0094]
[0095] Among them, Qcod is the video analysis result of the target video, FrameType is the frame type of the target video, TotalBytesPerFrame is the frame bit rate of the target video, Qp is the quantization parameter analysis result, MV is the motion vector analysis result, SkipRatio is the frame type statistical analysis result, Qp_max is the maximum value of the frame-level quantization parameter, Qp_avg is the average value of the frame-level quantization parameter, Qp_min is the minimum value of the frame-level quantization parameter, MV_max is the maximum value of the frame-level motion vector, MV_avg is the average value of the frame-level motion vector, and MV_min is the minimum value of the frame-level motion vector. In this way, the video analysis result of the target video can be determined by a pre-set target algorithm and according to the target analysis results corresponding to all target frames, which can help improve the accuracy and reliability of the video analysis results of the target video.
[0096] It can be seen that implementation Figure 1The described video source compression quality analysis method based on video frame information can analyze a target video that needs to undergo video source compression quality analysis, and obtain frame information statistical configuration information of the target video, wherein the frame information statistical configuration information includes frame-level configuration parameters corresponding to each frame in the target video, and for at least one target frame in the target video, an analysis operation is performed on the target frame according to the frame-level configuration parameters of the target frame to obtain a target analysis result corresponding to the target frame, and a video analysis result of the target video is determined according to the target analysis results corresponding to all target frames, wherein the video analysis result is used to represent the quality of the target video, which can be beneficial for analyzing the quality of the video based on the video frame information, can be beneficial for improving the flexibility and efficiency of obtaining the video analysis result, and further can be beneficial for improving the flexibility and efficiency of video source compression quality analysis.
[0097] Embodiment 2
[0098] See also Figure 2 , Figure 2 1 is a flow chart of a method for analyzing video source compression quality based on video frame information disclosed in an embodiment of the present invention. Figure 2 The described video source compression quality analysis method based on video frame information can be applied to a video source compression quality analysis device based on video frame information, and can also be applied to a cloud server or a local server for video source compression quality analysis based on video frame information, and the embodiments of the present invention are not limited thereto. Figure 2 As shown, the video source compression quality analysis method based on video frame information may include the following operations:
[0099] 201. Determine frame information statistics configuration information of a target video.
[0100] 202. For at least one target frame in the target video, determine whether the target frame meets a preset hardware analysis condition according to a frame-level configuration parameter of the target frame, obtain a determination result, and determine a target execution object according to the determination result.
[0101] In the embodiment of the present invention, when the judgment result is yes, the target execution object is a hardware decoder; when the judgment result is no, the target execution object is a software driver.
[0102] In an embodiment of the present invention, optionally, determining whether the target frame meets preset hardware analysis conditions may include: determining whether a hardware statistical motion vector switch Mv-Hw-Enable of the target frame is turned on, and when it is determined to be turned on, the determination result is yes; when it is determined to be not turned on, the determination result is no.
[0103] 203. Perform an analysis operation on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame.
[0104] In the embodiment of the present invention, the target execution object is a hardware decoder or a software driver.
[0105] 204. Determine a video analysis result of the target video according to the target analysis results corresponding to all target frames.
[0106] In the embodiment of the present invention, for other descriptions of step 201 and step 204, please refer to the detailed description of step 101 and step 103 in the first embodiment, and the embodiment of the present invention will not be repeated.
[0107] It can be seen that implementation Figure 2 The described video source compression quality analysis method based on video frame information can analyze the target video that needs to perform video source compression quality analysis, obtain the frame information statistical configuration information of the target video, and for at least one target frame in the target video, judge whether the target frame meets the preset hardware analysis conditions according to the frame-level configuration parameters of the target frame to obtain a judgment result. If the judgment result is yes, the target execution object is a hardware decoder; if the judgment result is no, the target execution object is a software driver, and an analysis operation is performed on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame. According to the target analysis results corresponding to all target frames, the video analysis result of the target video is determined. By determining the target execution object and performing the analysis operation on the target frame through the target execution object, it can be beneficial to improve the accuracy and flexibility of performing the analysis operation on the target frame, thereby being beneficial to improve the accuracy and flexibility of obtaining the target analysis result, and further being beneficial to improve the accuracy and flexibility of determining the video analysis result.
[0108] In an optional embodiment, when the target execution object is a hardware decoder, for at least one target frame in the target video, performing an analysis operation on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame includes:
[0109] Performing initialization processing on the target frame through a hardware decoder, and traversing all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame, and determining a target analysis result corresponding to the target frame according to the target data of the target frame;
[0110] And, when the target execution object is a software driver, for at least one target frame in the target video, performing an analysis operation on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame, including:
[0111] Initialize the target frame through the software driver, configure the target data cache address through the software driver and send the target data cache address to the hardware decoder to trigger the hardware decoder to perform the operation of traversing all target decoding units in the target frame, obtaining the target data of the target frame, and inputting the target data of the target frame into the target data cache address;
[0112] The software driver determines the target analysis result corresponding to the target frame according to the target data of the target frame included in the target data cache address.
[0113] In this optional embodiment, optionally, the software driver configures the target data cache address and sends it, which may include: calculating, by the software driver, the size of the memory space required to store the data of the entire target frame based on the frame-level encoding information of the target frame, and determining the target data cache address based on the memory usage of the current program.
[0114] It can be seen that the implementation of this optional embodiment can, when the target execution object is a hardware decoder, perform initialization processing on the target frame through the hardware decoder, and traverse all target decoding units in the target frame through the hardware decoder to obtain the target data of the target frame, and determine the target analysis result corresponding to the target frame according to the target data of the target frame; when the target execution object is a software driver, perform initialization processing on the target frame through the software driver, and configure the target data cache address through the software driver and send it to the hardware decoder to trigger the hardware decoder to perform the operation of traversing all target decoding units in the target frame to obtain the target data of the target frame, and input the target data of the target frame into the target data cache address, the software driver determines the target analysis result corresponding to the target frame according to the target data of the target frame in the target data cache address, and can determine the operation matching the target execution object according to different target execution objects, which can help improve the flexibility and accuracy of performing analysis operations on the target frame through the target execution object, thereby helping to improve the flexibility and accuracy of determining the target analysis result corresponding to the target frame, and further help to improve the flexibility and accuracy of subsequent video analysis results.
[0115] In another optional embodiment, the analysis operation includes one or more of a motion vector analysis operation, a quantization parameter analysis operation, and a frame type statistics analysis operation;
[0116] Wherein, when the analysis operation includes a motion vector analysis operation, the target data includes a motion vector triplet, and the target analysis result includes a motion vector analysis result;
[0117] When the analysis operation includes a quantization parameter analysis operation, the target data includes a quantization parameter triplet, and the target analysis result includes a quantization parameter analysis result;
[0118] When the analysis operation includes a frame type statistical analysis operation, the target data includes a frame type ratio parameter, and the target analysis result includes a frame type statistical analysis result.
[0119] In this optional embodiment, the motion vector triplet includes a maximum motion vector, a minimum motion vector, and an average motion vector; the quantization parameter triplet includes a maximum quantization parameter, a minimum quantization parameter, and an average quantization parameter.
[0120] In this optional embodiment, optionally, the analysis operation may simultaneously include a motion vector analysis operation, a quantization parameter analysis operation, and a frame type statistics analysis operation.
[0121] In this optional embodiment, optionally, when the analysis operation includes a motion vector analysis operation and the target execution object is a software driver, the target data includes original motion vector data, wherein the original motion vector is the motion vector data currently possessed by each decoding unit block in the target frame; when the analysis operation includes a quantization parameter analysis operation and the target execution object is a software driver, the target data includes original quantization data, wherein the original quantization data is the quantization parameter data currently possessed by each decoding unit in the target frame; when the analysis operation includes a frame type statistical analysis operation and the target execution object is a software driver, the target data includes original skip mode data of all decoding unit blocks of the target frame, the original skip mode data is the data of the encoding mode currently adopted by each decoding unit block in the target frame, and the original skip mode data is used to represent the encoding mode of each decoding unit block in the target frame.
[0122] It can be seen that implementing this optional embodiment can obtain different target data when including different analysis operations, and further obtain different target analysis results, wherein the analysis operation may include one or more of a motion vector analysis operation, a quantization parameter analysis operation, and a frame type statistical analysis operation, which can help improve the accuracy of determining the target data based on the analysis operation, and can help improve the flexibility and intelligence of determining the target data based on the analysis operation, thereby helping to improve the flexibility and accuracy of determining the target analysis results, and further can help to improve the flexibility and accuracy of determining the video analysis results.
[0123] In yet another optional embodiment, for at least one target frame in the target video, when the analysis operation includes a motion vector analysis operation, traversing all target decoding units in the target frame through a hardware decoder to obtain target data of the target frame includes:
[0124] According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the intra-frame prediction units of the target frame, and when the judgment result is yes, all decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a first traversal result; when the judgment result is no, all decoding units except the intra-frame prediction units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a first traversal result, and the first traversal result includes a motion vector maximum value of the target frame, wherein the motion vector maximum value includes a motion vector maximum value and a motion vector minimum value;
[0125] Determine whether the target frame satisfies the condition that the maximum value of the motion vector adopts the absolute value, and when the determination result is yes, determine the absolute value of the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame; when the determination result is no, determine the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame;
[0126] Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average motion vector of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average motion vector of the target frame according to the actual decoding unit of the target frame;
[0127] Determine whether the target frame satisfies the condition that the motion vector average value adopts an absolute value, and when the determination result is yes, determine the absolute value of the motion vector average value of the target frame as the target motion vector average value of the target frame; when the determination result is no, determine the motion vector average value of the target frame as the target motion vector average value of the target frame;
[0128] A motion vector triplet of the target frame is determined according to a maximum value of the target motion vector of the target frame and an average value of the target motion vector of the target frame.
[0129] In this optional embodiment, optionally, the prediction mode of the decoding unit includes one of an intra-frame prediction unit and an inter-frame prediction unit, wherein the intra-frame prediction unit is a unit whose reference pixels come from the current target frame, that is, the neighborhood pixels; the inter-frame prediction unit is a unit whose reference pixels come from other encoded frames.
[0130] In this optional embodiment, optionally, determining whether it is necessary to count the intra-frame prediction unit of the target frame may include: determining whether the switch Mv-Intra-Skip-Flag for MV statistics skipping intra-frame blocks is turned on; if it is turned on, the determination result is no; if it is not turned on, the determination result is yes.
[0131] In this optional embodiment, optionally, determining whether the target frame satisfies the condition that the motion vector maximum value adopts an absolute value may include: determining whether a switch Mv-MaxMin-Abs-Flag for comparing the motion vector maximum value and adopting an absolute value is turned on, if turned on, the determination result is yes; if not turned on, the determination result is no. The motion vector maximum value includes the motion vector maximum value and the motion vector minimum value.
[0132] In this optional embodiment, optionally, determining whether the target frame satisfies the minimum decoding unit statistics condition may include: determining whether the minimum decoding unit statistics switch Min-Block-Flag is turned on, if it is turned on, the determination result is yes; if it is not turned on, the determination result is no. It should be noted that the minimum decoding unit is determined by the decoding standard itself. For example, for the H.264 decoding standard, the corresponding minimum decoding unit is a 4*4 block, and the size of the actual decoding unit needs to be obtained through the decoding step.
[0133] In this optional embodiment, optionally, determining whether the target frame satisfies the condition that the motion vector average uses an absolute value may include: determining whether a switch Mv-Avg-Abs-Flag for calculating the motion vector average using an absolute value is turned on; if so, the determination result is yes; if not, the determination result is no.
[0134] In this optional embodiment, further optionally, after calculating the frame-level motion vector cumulative value and the decoding unit count value of the target frame, the method may also include: sending the motion vector cumulative value and the decoding unit count value to the software driver to trigger the software driver to calculate the frame-level motion vector average value of the target frame.
[0135] It can be seen that the implementation of this optional embodiment can determine whether it is necessary to count the intra-frame prediction units of the target frame, determine whether the target frame satisfies the condition that the maximum value of the motion vector is in absolute value, determine whether the target frame satisfies the minimum decoding unit statistics condition, and determine whether the target frame satisfies the condition that the average value of the motion vector is in absolute value, so as to obtain multiple judgment results, and comprehensively determine the maximum value of the target motion vector and the average value of the target motion vector of the target frame based on all the judgment results, thereby determining the motion vector triplet of the target frame, which can help improve the accuracy and flexibility of determining the motion vector triplet of the target frame, thereby helping to improve the accuracy and flexibility of determining the target analysis result of the target frame, and further helping to improve the accuracy and flexibility of determining the video analysis result of the target frame.
[0136] In an optional embodiment, for at least one target frame in the target video, when the analysis operation includes a quantization parameter analysis operation, traversing all target decoding units in the target frame through a hardware decoder to obtain target data of the target frame includes:
[0137] According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the non-quantized decoding units of the target frame, and when the judgment result is yes, all the decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result; when the judgment result is no, all the decoding units except the non-quantized decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result, and the second traversal result includes a maximum value of a quantization parameter of the target frame, wherein the maximum value of the quantization parameter includes a maximum value of the quantization parameter and a minimum value of the quantization parameter;
[0138] Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average value of the quantization parameter of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average value of the quantization parameter of the target frame according to the actual decoding unit of the target frame;
[0139] A quantization parameter triplet of the target frame is determined according to a maximum quantization parameter value and an average quantization parameter value of the target frame.
[0140] In this optional embodiment, optionally, when it is determined that the target frame satisfies the minimum decoding unit statistical condition and the target execution object is a software driver, the size information of each decoding unit in the target frame is obtained, and the size information of all decoding units is input into the target data cache address. It should be noted that the size information of each decoding unit in the target frame is obtained through the decoding step.
[0141] In this optional embodiment, optionally, determining whether it is necessary to count the non-quantized decoding unit of the target frame may include: determining whether the QP statistics skip the non-quantized decoding unit switch Qp-Skip-Flag is turned on, if it is turned on, the judgment result is no, if not turned on, the judgment result is yes.
[0142] In this optional embodiment, optionally, determining whether the target frame satisfies the minimum decoding unit statistical condition may include: determining whether the minimum decoding unit statistical switch Min-Block-Flag is turned on, if it is turned on, the determination result is yes, if not turned on, the determination result is no.
[0143] In this optional embodiment, optionally, the method may also include: calculating the frame-level quantization parameter cumulative value and the decoding unit count value based on the maximum value of the quantization parameter and the minimum value of the quantization parameter, and sending the calculated frame-level quantization parameter cumulative value and the decoding unit count value to the software driver to trigger the software driver to calculate the frame-level quantization parameter average value of the target frame.
[0144] In this optional embodiment, optionally, after determining the quantization parameter triplet of the target frame, the method may further include: sending the quantization parameter triplet of the target frame to a software driver to trigger the software driver to output the quantization parameter triplet of the target frame.
[0145] It can be seen that the implementation of this optional embodiment can determine whether it is necessary to count the non-quantized decoding units of the target frame and perform a traversal operation to obtain a second traversal result based on the frame-level configuration parameters of the target frame, and determine whether the target frame meets the minimum decoding unit statistical condition, and calculate the quantization parameter average value of the target frame according to the judgment result, and determine the quantization parameter triplet of the target frame based on the maximum quantization parameter value, the minimum quantization parameter value and the average quantization parameter value of the target frame, which can help improve the accuracy and flexibility of determining the quantization parameter triplet of the target frame, thereby helping to improve the accuracy and flexibility of determining the target analysis result of the target frame, and further helping to improve the accuracy and flexibility of determining the video analysis result of the target frame.
[0146] In yet another optional embodiment, for at least one target frame in the target video, when the analysis operation includes a frame type statistical analysis operation, traversing all target decoding units in the target frame through a hardware decoder to obtain target data of the target frame includes:
[0147] According to the frame-level configuration parameters of the frame, whether the frame type of the frame is a preset target frame type is determined, and when the judgment result is yes, the frame type ratio parameter of the target frame is determined as a preset target value; when the judgment result is no, all decoding units in the target frame are determined as target decoding units, and a traversal operation is performed on all target decoding units to obtain encoding data of each target decoding unit in the target frame, wherein the encoding data of each target decoding unit includes first data or second data, and for each target decoding unit, when the encoding data is the first data, it indicates that the target decoding unit adopts skip mode encoding, and when the encoding data is the second data, it indicates that the target decoding unit does not adopt skip mode encoding;
[0148] The frame type parameter of the target frame is determined according to the encoded data of all target decoding units in the target frame.
[0149] In this optional embodiment, the preset target frame type may be an I frame type, the non-preset target frame type may be a P frame and / or a B frame, and the preset target value is 0. It should be noted that all pixel blocks in the I frame type are in intra-frame coding mode, that is, the ratio between the number of blocks in the I frame type that use skip coding and the number of blocks that do not use skip coding is always 0.
[0150] In this optional embodiment, optionally, the first data can be 1, and the second data can be 0. For each target decoding unit, when the encoded data is 1, it indicates that the target decoding unit adopts skip mode encoding, and when the encoded data is 0, it indicates that the target decoding unit does not adopt skip mode encoding.
[0151] In this optional embodiment, the frame type parameters of the target frame are determined based on the skip mode data of all target decoding units in the target frame, including: when the target execution object is a software driver and the target frame satisfies the minimum decoding unit statistical condition, obtaining the size information of each target decoding unit included in the target frame, and determining the frame type parameters of the target frame based on the size information of all target decoding units in the target frame and the skip mode data of all target decoding units in the target frame; when the target execution object is a software driver and the target frame does not satisfy the minimum decoding unit statistical condition, determining the frame type parameters of the target frame based on the skip mode data of all target decoding units in the target frame.
[0152] In this optional embodiment, optionally, determining whether the target frame satisfies the minimum decoding unit statistical condition may include: determining whether the minimum decoding unit statistical switch Min-Block-Flag is turned on, if it is turned on, the determination result is yes, if not turned on, the determination result is no.
[0153] In this optional embodiment, the method may further include: when it is determined that the frame type ratio parameter of the target frame meets the minimum decoding unit statistical condition, calculating the skipratio of the target frame according to the minimum decoding unit; when it is determined that the frame type ratio parameter of the target frame does not meet the minimum decoding unit statistical condition, calculating the skipratio of the target frame according to the actual decoding unit. Wherein, skipratio is the ratio of the number of blocks in the target frame that use skip coding to the number of blocks in the target frame that do not use skip coding.
[0154] In this optional embodiment, the method may further include: calculating the frame-level skip cumulative value and the frame decoding unit count value of the target frame according to the frame-level mode ratio information, and sending the frame-level skip cumulative value and the frame decoding unit count value to the software driver to trigger the software driver to calculate the frame-level skip and non-skip mode ratio of the target frame. The frame-level skip cumulative value is the number of blocks using skip coding in the target frame, and the frame-level skip and non-skip mode ratio is the ratio of the number of blocks using skip coding in the target frame to the number of blocks not using skip coding in the target frame.
[0155] It can be seen that the implementation of this optional embodiment can determine whether the frame type of the frame is a preset target frame type according to the frame-level configuration parameters of the frame. If so, the frame type ratio parameter of the target frame is determined as a preset target value. If not, it is determined whether the target frame satisfies the minimum decoding unit statistical condition, and the frame mode ratio information of the target frame is determined according to the judgment result, and the frame type ratio parameter of the target frame is determined according to the frame mode ratio information, which can help improve the accuracy and flexibility of determining the frame type ratio parameter of the target frame, thereby helping to improve the accuracy and flexibility of determining the target analysis result of the target frame, and further helping to improve the accuracy and flexibility of determining the video analysis result of the target frame.
[0156] Embodiment 3
[0157] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram of the structure of another video source compression quality analysis device based on video frame information disclosed in an embodiment of the present invention. Figure 3 As shown, the video source compression quality analysis device based on video frame information may include:
[0158] A first determination module 301 is used to determine frame information statistics configuration information of a target video, where the frame information statistics configuration information includes frame-level configuration parameters corresponding to each frame in the target video, and the target video is a video that needs to be subjected to video source compression quality analysis;
[0159] The analysis module 302 is used to perform an analysis operation on at least one target frame in the target video according to the frame-level configuration parameters of the target frame to obtain a target analysis result corresponding to the target frame;
[0160] The second determination module 303 is used to determine the video analysis result of the target video according to the target analysis results corresponding to all the target frames, wherein the video analysis result is used to indicate the quality of the target video.
[0161] It can be seen that implementation Figure 3The described device can analyze a target video that requires video source compression quality analysis, and obtain frame information statistical configuration information of the target video, wherein the frame information statistical configuration information includes frame-level configuration parameters corresponding to each frame in the target video, and for at least one target frame in the target video, an analysis operation is performed on the target frame according to the frame-level configuration parameters of the target frame to obtain a target analysis result corresponding to the target frame, and a video analysis result of the target video is determined according to the target analysis results corresponding to all target frames, wherein the video analysis result is used to represent the quality of the target video, which can be beneficial for analyzing the quality of the video based on the video frame information, can be beneficial for improving the flexibility and efficiency of obtaining video frame information, and further can be beneficial for improving the flexibility and efficiency of obtaining video analysis results.
[0162] In an optional embodiment, if Figure 4 As shown, the analysis module 302 includes:
[0163] The judgment submodule 3021 is used to judge whether at least one target frame in the target video meets the preset hardware analysis conditions according to the frame-level configuration parameters of the target frame, and obtain a judgment result;
[0164] The determination submodule 3022 is used to determine the target execution object according to the judgment result, wherein when the judgment result is yes, the target execution object is a hardware decoder; when the judgment result is no, the target execution object is a software driver;
[0165] The analysis submodule 3023 is used to perform an analysis operation on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame.
[0166] It can be seen that implementation Figure 4 The described device can analyze a target video that needs to be subjected to video source compression quality analysis, obtain frame information statistics configuration information of the target video, and for at least one target frame in the target video, determine whether the target frame meets preset hardware analysis conditions based on the frame-level configuration parameters of the target frame to obtain a judgment result. If the judgment result is yes, the target execution object is a hardware decoder; if the judgment result is no, the target execution object is a software driver, and an analysis operation is performed on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame. Based on the target analysis results corresponding to all target frames, a video analysis result of the target video is determined. By determining the target execution object and performing an analysis operation on the target frame through the target execution object, the accuracy and flexibility of performing analysis operations on the target frame can be improved, thereby the accuracy and flexibility of obtaining the target analysis result can be improved, and further the accuracy and flexibility of determining the video analysis result can be improved.
[0167] In another optional embodiment, Figure 4 As shown, when the target execution object is a hardware decoder, for at least one target frame in the target video, the analysis submodule 3023 performs an analysis operation on the target frame through the target execution object, and obtains the target analysis result corresponding to the target frame in the following manner:
[0168] Performing initialization processing on the target frame through a hardware decoder, and traversing all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame, and determining a target analysis result corresponding to the target frame according to the target data of the target frame;
[0169] Furthermore, when the target execution object is a software driver, for at least one target frame in the target video, the analysis submodule 3023 performs an analysis operation on the target frame through the target execution object, and obtains the target analysis result corresponding to the target frame in the following manner:
[0170] Initialize the target frame through the software driver, configure the target data cache address through the software driver and send the target data cache address to the hardware decoder to trigger the hardware decoder to perform an operation of traversing all target decoding units in the target frame, obtaining the target data of the target frame, and inputting the target data of the target frame into the target data cache address;
[0171] The software driver determines the target analysis result corresponding to the target frame according to the target data of the target frame included in the target data cache address.
[0172] It can be seen that implementation Figure 4 The described device can, when the target execution object is a hardware decoder, perform initialization processing on the target frame through the hardware decoder, and traverse all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame, and determine the target analysis result corresponding to the target frame according to the target data of the target frame; when the target execution object is a software driver, perform initialization processing on the target frame through the software driver, and configure the target data cache address through the software driver and send it to the hardware decoder to trigger the hardware decoder to perform the operation of traversing all target decoding units in the target frame to obtain the target data of the target frame, and input the target data of the target frame into the target data cache address, the software driver determines the target analysis result corresponding to the target frame according to the target data of the target frame in the target data cache address, and can determine the operation matching the target execution object according to different target execution objects, which can help improve the flexibility and accuracy of performing analysis operations on the target frame through the target execution object, thereby helping to improve the flexibility and accuracy of determining the target analysis result corresponding to the target frame, and further helping to improve the flexibility and accuracy of subsequently obtaining video analysis results.
[0173] In yet another optional embodiment, the analysis operation includes one or more of a motion vector analysis operation, a quantization parameter analysis operation, and a frame type statistics analysis operation;
[0174] Wherein, when the analysis operation includes a motion vector analysis operation, the target data includes a motion vector triplet, and the target analysis result includes a motion vector analysis result;
[0175] When the analysis operation includes a quantization parameter analysis operation, the target data includes a quantization parameter triplet, and the target analysis result includes a quantization parameter analysis result;
[0176] When the analysis operation includes a frame type statistical analysis operation, the target data includes a frame type ratio parameter, and the target analysis result includes a frame type statistical analysis result.
[0177] It can be seen that implementation Figure 4 The described device can obtain different target data when including different analysis operations, and further obtain different target analysis results, wherein the analysis operation may include one or more of a motion vector analysis operation, a quantization parameter analysis operation, and a frame type statistical analysis operation, which can help improve the accuracy of determining the target data based on the analysis operation, and can help improve the flexibility and intelligence of determining the target data based on the analysis operation, thereby helping to improve the flexibility and accuracy of determining the target analysis results, and further helping to improve the flexibility and accuracy of determining the video analysis results.
[0178] In yet another optional embodiment, Figure 4 As shown, for at least one target frame in the target video, when the analysis operation includes a motion vector analysis operation, the analysis submodule 3023 traverses all target decoding units in the target frame through the hardware decoder to obtain the target data of the target frame in the following manner:
[0179] According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the intra-frame prediction units of the target frame, and when the judgment result is yes, all decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a first traversal result; when the judgment result is no, all decoding units except the intra-frame prediction units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a first traversal result, and the first traversal result includes a motion vector maximum value of the target frame, wherein the motion vector maximum value includes a motion vector maximum value and a motion vector minimum value;
[0180] Determine whether the target frame satisfies the condition that the maximum value of the motion vector adopts the absolute value, and when the determination result is yes, determine the absolute value of the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame; when the determination result is no, determine the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame;
[0181] Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average motion vector of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average motion vector of the target frame according to the actual decoding unit of the target frame;
[0182] Determine whether the target frame satisfies the condition that the motion vector average value adopts an absolute value, and when the determination result is yes, determine the absolute value of the motion vector average value of the target frame as the target motion vector average value of the target frame; when the determination result is no, determine the motion vector average value of the target frame as the target motion vector average value of the target frame;
[0183] A motion vector triplet of the target frame is determined according to a maximum value of the target motion vector of the target frame and an average value of the target motion vector of the target frame.
[0184] It can be seen that implementation Figure 4 The described device can determine whether it is necessary to count the intra-frame prediction units of the target frame, determine whether the target frame satisfies the condition that the maximum value of the motion vector is in absolute value, determine whether the target frame satisfies the minimum decoding unit statistics condition, and determine whether the target frame satisfies the condition that the average value of the motion vector is in absolute value according to the frame-level configuration parameters of the target frame to obtain multiple judgment results, and comprehensively determine the maximum value of the target motion vector and the average value of the target motion vector of the target frame according to all the judgment results, thereby determining the motion vector triplet of the target frame, which can help improve the accuracy and flexibility of determining the motion vector triplet of the target frame, thereby helping to improve the accuracy and flexibility of determining the target analysis result of the target frame, and further helping to improve the accuracy and flexibility of determining the video analysis result of the target frame.
[0185] In yet another optional embodiment, for at least one target frame in the target video, when the analysis operation includes a quantization parameter analysis operation, the analysis submodule 3023 traverses all target decoding units in the target frame through a hardware decoder to obtain target data of the target frame in the following manner:
[0186] According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the non-quantized decoding units of the target frame, and when the judgment result is yes, all the decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result; when the judgment result is no, all the decoding units except the non-quantized decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result, and the second traversal result includes a maximum value of a quantization parameter of the target frame, wherein the maximum value of the quantization parameter includes a maximum value of the quantization parameter and a minimum value of the quantization parameter;
[0187] Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average value of the quantization parameter of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average value of the quantization parameter of the target frame according to the actual decoding unit of the target frame;
[0188] A quantization parameter triplet of the target frame is determined according to a maximum quantization parameter value and an average quantization parameter value of the target frame.
[0189] It can be seen that implementation Figure 4 The described device can determine whether it is necessary to count the non-quantized decoding units of the target frame and perform a traversal operation to obtain a second traversal result based on the frame-level configuration parameters of the target frame, and determine whether the target frame meets the minimum decoding unit statistical condition, and calculate the quantization parameter average value of the target frame according to the judgment result, and determine the quantization parameter triplet of the target frame based on the maximum quantization parameter value, the minimum quantization parameter value and the average quantization parameter value of the target frame, which can help improve the accuracy and flexibility of determining the quantization parameter triplet of the target frame, thereby helping to improve the accuracy and flexibility of determining the target analysis result of the target frame, and further helping to improve the accuracy and flexibility of determining the video analysis result of the target frame.
[0190] In yet another optional embodiment, for at least one target frame in the target video, when the analysis operation includes a frame type statistical analysis operation, the analysis submodule 3023 traverses all target decoding units in the target frame through a hardware decoder to obtain target data of the target frame in the following manner:
[0191] According to the frame-level configuration parameters of the frame, whether the frame type of the frame is a preset target frame type is determined, and when the judgment result is yes, the frame type parameter of the target frame is determined as a preset target value; when the judgment result is no, all decoding units in the target frame are determined as target decoding units, and a traversal operation is performed on all target decoding units to obtain encoding data of each target decoding unit in the target frame, wherein the encoding data of each target decoding unit includes first data or second data, and for each target decoding unit, when the encoding data is the first data, it indicates that the target decoding unit adopts skip mode encoding, and when the encoding data is the second data, it indicates that the target decoding unit does not adopt skip mode encoding;
[0192] The frame type parameter of the target frame is determined according to the encoded data of all target decoding units in the target frame.
[0193] It can be seen that implementation Figure 4 The described device can determine whether the frame type of the frame is a preset target frame type based on the frame-level configuration parameters of the frame. If so, the frame type ratio parameter of the target frame is determined as a preset target value. If not, it is determined whether the target frame meets the minimum decoding unit statistical condition, and the frame mode ratio information of the target frame is determined based on the judgment result. The frame type ratio parameter of the target frame is determined based on the frame mode ratio information, which can help improve the accuracy and flexibility of determining the frame type ratio parameter of the target frame, thereby helping to improve the accuracy and flexibility of determining the target analysis result of the target frame, and further helping to improve the accuracy and flexibility of determining the video analysis result of the target frame.
[0194] Embodiment 4
[0195] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of the structure of another video source compression quality analysis device based on video frame information disclosed in an embodiment of the present invention. Figure 5 As shown, the video source compression quality analysis based on video frame information may include:
[0196] A memory 401 storing executable program codes;
[0197] a processor 402 coupled to the memory 401;
[0198] The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the video source compression quality analysis method based on video frame information described in the first embodiment of the present invention or the second embodiment of the present invention.
[0199] Embodiment 5
[0200] An embodiment of the present invention discloses a computer storable medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the video source compression quality analysis method based on video frame information described in Embodiment 1 or Embodiment 2 of the present invention.
[0201] Embodiment 6
[0202] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the video source compression quality analysis method based on video frame information described in Embodiment 1 or Embodiment 2.
[0203] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0204] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0205] Finally, it should be noted that the video source compression quality analysis method and device based on video frame information disclosed in the embodiment of the present invention discloses only the preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A video source compression quality analysis method based on video frame information, characterized in that: The method comprises: Determine frame information statistics configuration information of a target video, wherein the frame information statistics configuration information includes frame-level configuration parameters corresponding to each frame in the target video, and the target video is a video that needs to be subjected to video source compression quality analysis; For at least one target frame in the target video, according to the frame-level configuration parameters of the target frame, perform an analysis operation on the target frame to obtain a target analysis result corresponding to the target frame; Determine a video analysis result of the target video according to the target analysis results corresponding to all the target frames, wherein the video analysis result is used to represent the video source compression quality of the target video; For at least one target frame in the target video, performing an analysis operation on the target frame to obtain a target analysis result corresponding to the target frame includes: According to the frame-level configuration parameters of the target frame, judging whether the target frame meets the preset hardware analysis condition, obtaining a judgment result, and determining the target execution object according to the judgment result, wherein when the judgment result is yes, the target execution object is a hardware decoder; when the judgment result is no, the target execution object is a software driver; Performing an analysis operation on the target frame by the target execution object to obtain a target analysis result corresponding to the target frame; When the target execution object is the hardware decoder, for at least one target frame in the target video, performing an analysis operation on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame includes: Performing initialization processing on the target frame by the hardware decoder, and traversing all target decoding units in the target frame by the hardware decoder to obtain target data of the target frame, and determining a target analysis result corresponding to the target frame according to the target data of the target frame; And, when the target execution object is the software driver, for at least one target frame in the target video, performing an analysis operation on the target frame by the target execution object to obtain a target analysis result corresponding to the target frame includes: Performing the initialization processing on the target frame through the software driver, configuring the target data cache address through the software driver and sending the target data cache address to the hardware decoder, so as to trigger the hardware decoder to perform the operation of traversing all target decoding units in the target frame, obtaining the target data of the target frame, and inputting the target data of the target frame into the target data cache address; The software driver determines the target analysis result corresponding to the target frame according to the target data of the target frame included in the target data cache address.
2. The video source compression quality analysis method based on video frame information according to claim 1, characterized in that: The analysis operation includes one or more of a motion vector analysis operation, a quantization parameter analysis operation, and a frame type statistical analysis operation; Wherein, when the analysis operation includes the motion vector analysis operation, the target data includes a motion vector triplet, and the target analysis result includes a motion vector analysis result; When the analysis operation includes the quantization parameter analysis operation, the target data includes a quantization parameter triplet, and the target analysis result includes a quantization parameter analysis result; When the analysis operation includes the frame type statistical analysis operation, the target data includes frame type parameters, and the target analysis result includes a frame type statistical analysis result.
3. The video source compression quality analysis method based on video frame information according to claim 2 is characterized in that: For at least one target frame in the target video, when the analysis operation includes the motion vector analysis operation, traversing all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame includes: According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the intra-frame prediction units of the target frame, and when the judgment result is yes, all decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a first traversal result; when the judgment result is no, all decoding units in the target frame except the intra-frame prediction unit are determined as target decoding units and a traversal operation is performed to obtain a first traversal result, and the first traversal result includes a motion vector maximum value of the target frame, wherein the motion vector maximum value includes a motion vector maximum value and a motion vector minimum value; Determine whether the target frame satisfies the condition that the maximum value of the motion vector adopts the absolute value, and when the determination result is yes, determine the absolute value of the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame; when the determination result is no, determine the maximum value of the motion vector of the target frame as the maximum value of the target motion vector of the target frame; Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average motion vector of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average motion vector of the target frame according to the actual decoding unit of the target frame; Determine whether the target frame satisfies the condition that the motion vector average value adopts an absolute value, and when the determination result is yes, determine the absolute value of the motion vector average value of the target frame as the target motion vector average value of the target frame; when the determination result is no, determine the motion vector average value of the target frame as the target motion vector average value of the target frame; A motion vector triplet of the target frame is determined according to a maximum value of the target motion vector of the target frame and an average value of the target motion vector of the target frame.
4. The video source compression quality analysis method based on video frame information according to claim 3 is characterized in that: For at least one target frame in the target video, when the analysis operation includes the quantization parameter analysis operation, traversing all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame includes: According to the frame-level configuration parameters of the target frame, it is determined whether it is necessary to count the non-quantized decoding units of the target frame, and when the judgment result is yes, all decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result; when the judgment result is no, all decoding units except the non-quantized decoding units in the target frame are determined as target decoding units and a traversal operation is performed to obtain a second traversal result, and the second traversal result includes a maximum value of a quantization parameter of the target frame, wherein the maximum value of the quantization parameter includes a maximum value of the quantization parameter and a minimum value of the quantization parameter; Determine whether the target frame meets the minimum decoding unit statistical condition, and when the determination result is yes, calculate the average value of the quantization parameter of the target frame according to the minimum decoding unit; when the determination result is no, calculate the average value of the quantization parameter of the target frame according to the actual decoding unit of the target frame; A quantization parameter triplet of the target frame is determined according to a maximum quantization parameter value and an average quantization parameter value of the target frame.
5. The video source compression quality analysis method based on video frame information according to claim 3 is characterized in that: For at least one target frame in the target video, when the analysis operation includes the frame type statistical analysis operation, traversing all target decoding units in the target frame through the hardware decoder to obtain target data of the target frame includes: According to the frame-level configuration parameters of the frame, whether the frame type of the frame is a preset target frame type is determined, and when the judgment result is yes, the frame type parameter of the target frame is determined as a preset target value; when the judgment result is no, all decoding units in the target frame are determined as target decoding units, and a traversal operation is performed on all the target decoding units to obtain the encoding data of each of the target decoding units in the target frame, wherein the encoding data of each of the target decoding units includes first data or second data, and for each of the target decoding units, when the encoding data is the first data, it indicates that the target decoding unit adopts skip mode encoding, and when the encoding data is the second data, it indicates that the target decoding unit does not adopt skip mode encoding; The frame type parameter of the target frame is determined according to the encoded data of all the target decoding units in the target frame.
6. A video source compression quality analysis device based on video frame information, characterized in that: The device comprises: A first determination module is used to determine frame information statistics configuration information of a target video, wherein the frame information statistics configuration information includes frame-level configuration parameters corresponding to each frame in the target video, and the target video is a video that needs to be subjected to video source compression quality analysis; An analysis module, configured to perform an analysis operation on at least one target frame in the target video according to a frame-level configuration parameter of the target frame, and obtain a target analysis result corresponding to the target frame; A second determination module is used to determine a video analysis result of the target video according to the target analysis results corresponding to all the target frames, wherein the video analysis result is used to indicate the quality of the target video; The analysis module comprises: A judgment submodule, used for judging whether at least one target frame in the target video meets a preset hardware analysis condition according to a frame-level configuration parameter of the target frame, and obtaining a judgment result; A determination submodule, configured to determine a target execution object according to the judgment result, wherein when the judgment result is yes, the target execution object is a hardware decoder; when the judgment result is no, the target execution object is a software driver; An analysis submodule, configured to perform an analysis operation on the target frame through the target execution object to obtain a target analysis result corresponding to the target frame; When the target execution object is the hardware decoder, for at least one target frame in the target video, the analysis submodule performs an analysis operation on the target frame through the target execution object, and obtains the target analysis result corresponding to the target frame in the following manner: Performing initialization processing on the target frame by the hardware decoder, and traversing all target decoding units in the target frame by the hardware decoder to obtain target data of the target frame, and determining a target analysis result corresponding to the target frame according to the target data of the target frame; And, when the target execution object is the software driver, for at least one target frame in the target video, the analysis submodule performs an analysis operation on the target frame through the target execution object, and obtains the target analysis result corresponding to the target frame in the following manner: Performing the initialization processing on the target frame through the software driver, configuring the target data cache address through the software driver and sending the target data cache address to the hardware decoder, so as to trigger the operation of traversing all target decoding units in the target frame through the hardware decoder, obtaining the target data of the target frame, and inputting the target data of the target frame into the target data cache address; The software driver determines the target analysis result corresponding to the target frame according to the target data of the target frame included in the target data cache address.
7. A video source compression quality analysis device based on video frame information, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the video source compression quality analysis method based on video frame information as described in any one of claims 1-5.
8. A computer storage medium, characterized in that The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the video source compression quality analysis method based on video frame information as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and device for acquiring video code compression quality
CN104780369A