Video frame coding method and device, electronic equipment and computer program product
By predicting the decoding complexity of video frames and adjusting the encoding strategy, the problem of high decoding complexity of mobile videos is solved, and the decoding complexity and decoding efficiency are achieved while ensuring encoding quality.
Patent Information
- Application Number
- CN202411668302.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-18
AI Technical Summary
During online video decoding and playback, the mobile terminal has limited performance, resulting in high decoding complexity, and problems such as decoding loss, lag, and heating are encountered. The existing technology is difficult to effectively reduce the decoding complexity.
By predicting the decoding complexity of the current video frame, obtaining the decoding complexity comparison coefficient, calculating the decoding complexity adjustment coefficient, and adjusting the complexity adjustment degree index according to the adjustment coefficient to encode the video frame.
While ensuring encoding quality, it effectively reduces the decoding complexity of video frames, improves decoding efficiency, and reduces the load on the decoding end.
Smart Images

Figure CN119484838A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method for encoding a video frame, a device for encoding a video frame, an electronic device, and a computer program product. Background Art
[0002] During online video decoding and playback, due to the low performance ceiling of the mobile terminal, for video frames with high decoding complexity, decoding frame loss, freezes, heat generation, etc. usually occur during video decoding and playback.
[0003] Currently, there is limited room for optimizing decoders. The complexity of video decoding at the decoding end is relatively high, and it is also difficult to reduce the complexity of decoding.
[0004] In view of this, there is an urgent need in the art for a method that can reasonably reduce the decoding complexity of video frames while ensuring encoding quality.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a video frame encoding method, a video frame encoding device, an electronic device and a computer program product, so as to reasonably reduce the decoding complexity of the video frame while ensuring the encoding quality at least to a certain extent.
[0007] According to a first aspect of the present disclosure, a method for encoding a video frame is provided, comprising:
[0008] Predicting the decoding complexity of the current video frame, and obtaining a decoding complexity comparison coefficient of the current video frame;
[0009] Obtaining a decoding complexity adjustment coefficient of the current video frame according to the predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient;
[0010] The complexity adjustment degree index of the current video frame is adjusted according to the decoding complexity adjustment coefficient of the current video frame, and the current video frame is encoded according to the adjusted complexity adjustment degree index.
[0011] In an exemplary embodiment of the present disclosure, the method further includes:
[0012] Determine the number of references for each coding block in the current video frame by other coding blocks for inter-frame coding reference;
[0013] An importance coefficient of the coding block is determined according to the reference number of the coding block, and a complexity adjustment degree index of the current video frame is adjusted according to the importance coefficient of the coding block.
[0014] In an exemplary embodiment of the present disclosure, predicting the decoding complexity of the current video frame includes:
[0015] Pre-encoding a coding block in the current video frame to obtain a predicted value of decoding complexity corresponding to the coding block;
[0016] According to the predicted value of the decoding complexity corresponding to the coding block, a predicted value of the decoding complexity of the current video frame is obtained.
[0017] In an exemplary embodiment of the present disclosure, pre-encoding a coding block in the current video frame to obtain a predicted value of decoding complexity corresponding to the coding block includes:
[0018] Acquire multiple candidate coding modes corresponding to the coding block, wherein each of the candidate coding modes has a corresponding decoding complexity;
[0019] Determining a target coding mode combination corresponding to the current video frame according to the decoding complexity corresponding to each of the candidate coding modes;
[0020] According to the coding mode included in the target coding mode combination, the coding block in the current video frame is pre-encoded to obtain a predicted value of decoding complexity corresponding to the coding block.
[0021] In an exemplary embodiment of the present disclosure, predicting the decoding complexity of the current video frame includes:
[0022] Acquire a reference frame list of the current video frame, wherein the reference frames in the reference frame list are encoded frames;
[0023] Determine a decoding complexity corresponding to a reference frame in the reference frame list;
[0024] A predicted value of the decoding complexity of the current video frame is obtained according to the decoding complexity corresponding to the reference frame.
[0025] In an exemplary embodiment of the present disclosure, obtaining a predicted value of the decoding complexity of the current video frame according to the decoding complexity corresponding to the reference frame includes:
[0026] A predicted value of the decoding complexity of the current video frame is obtained according to an average value of the decoding complexities corresponding to all the reference frames.
[0027] In an exemplary embodiment of the present disclosure, obtaining a predicted value of the decoding complexity of the current video frame according to the decoding complexity corresponding to the reference frame includes:
[0028] The decoding complexity corresponding to the reference frame in the reference frames that is closest to the timestamp of the current video frame is obtained as a predicted value of the decoding complexity of the current video frame.
[0029] In an exemplary embodiment of the present disclosure, obtaining a predicted value of the decoding complexity of the current video frame according to the decoding complexity corresponding to the reference frame includes:
[0030] Acquire a first reference frame in the reference frames that is adjacent to the timestamp of the current video frame;
[0031] A predicted value of the decoding complexity of the current video frame is obtained according to an average value of the decoding complexity corresponding to the first reference frame.
[0032] In an exemplary embodiment of the present disclosure, obtaining a decoding complexity comparison coefficient of the current video frame includes:
[0033] According to the hierarchy category of the current video frame, a decoding complexity comparison coefficient of the current video frame is obtained.
[0034] In an exemplary embodiment of the present disclosure, obtaining a decoding complexity comparison coefficient of the current video frame according to the hierarchy category of the current video frame includes:
[0035] If the current video frame is a bottom layer frame, determining a decoding complexity comparison coefficient of the current video frame as a first comparison coefficient;
[0036] If the current video frame is a high-layer frame, the decoding complexity comparison coefficient of the current video frame is determined as a second comparison coefficient, and the second comparison coefficient is greater than the first comparison coefficient.
[0037] In an exemplary embodiment of the present disclosure, the decoding complexity adjustment coefficient of the current video frame includes a first decoding complexity adjustment coefficient, and the adjusting the complexity adjustment degree index of the current video frame according to the decoding complexity adjustment coefficient of the current video frame includes:
[0038] The complexity adjustment degree index of the current video frame is adjusted according to the first decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is proportional to the video complexity.
[0039] In an exemplary embodiment of the present disclosure, the decoding complexity adjustment coefficient of the current video frame includes a second decoding complexity adjustment coefficient, and the adjusting the complexity adjustment degree index of the current video frame according to the decoding complexity adjustment coefficient of the current video frame includes:
[0040] The complexity adjustment degree index of the current video frame is adjusted according to the second decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is inversely proportional to the video complexity.
[0041] According to a second aspect of the present disclosure, there is provided a video frame encoding device, comprising:
[0042] A decoding complexity prediction module is configured to predict the decoding complexity of the current video frame and obtain a decoding complexity comparison coefficient of the current video frame;
[0043] An adjustment coefficient determination module is configured to obtain a decoding complexity adjustment coefficient of the current video frame according to a predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient;
[0044] The adjustment degree determination module is configured to adjust the complexity adjustment degree index of the current video frame according to the decoding complexity adjustment coefficient of the current video frame, and encode the current video frame according to the adjusted complexity adjustment degree index.
[0045] In an exemplary embodiment of the present disclosure, the video frame encoding device further includes an importance coefficient adjustment module, the module including:
[0046] A reference number determination unit, configured to determine the reference number of each coding block in the current video frame that is referenced by other coding blocks for inter-frame coding;
[0047] The importance coefficient adjustment unit is configured to determine the importance coefficient of the coding block according to the reference number of the coding block, and adjust the complexity adjustment degree index of the current video frame according to the importance coefficient of the coding block.
[0048] In an exemplary embodiment of the present disclosure, the decoding complexity prediction module includes:
[0049] A coding block precoding unit, configured to perform precoding on a coding block in the current video frame to obtain a predicted value of decoding complexity corresponding to the coding block;
[0050] The decoding complexity prediction unit is configured to execute the prediction value of the decoding complexity corresponding to the coding block to obtain the prediction value of the decoding complexity of the current video frame.
[0051] In an exemplary embodiment of the present disclosure, the coding block precoding unit includes:
[0052] A candidate coding mode acquisition unit is configured to acquire a plurality of candidate coding modes corresponding to the coding block, wherein each of the candidate coding modes has a corresponding decoding complexity;
[0053] A target mode determination unit is configured to determine a target coding mode combination corresponding to the current video frame according to the decoding complexity corresponding to each of the candidate coding modes;
[0054] The target mode precoding unit is configured to perform precoding on the coding block in the current video frame according to the coding mode included in the target coding mode combination, and obtain a predicted value of the decoding complexity corresponding to the coding block.
[0055] In an exemplary embodiment of the present disclosure, the decoding complexity prediction module further includes:
[0056] A reference frame list acquisition unit is configured to acquire a reference frame list of the current video frame, wherein the reference frames in the reference frame list are encoded frames;
[0057] A reference frame complexity determination unit, configured to determine a decoding complexity corresponding to a reference frame in the reference frame list;
[0058] The reference frame complexity prediction unit is configured to obtain a predicted value of the decoding complexity of the current video frame according to the decoding complexity corresponding to the reference frame.
[0059] In an exemplary embodiment of the present disclosure, the reference frame complexity prediction unit includes:
[0060] The reference frame complexity averaging unit is configured to obtain a predicted value of the decoding complexity of the current video frame based on an average value of the decoding complexities corresponding to all the reference frames.
[0061] In an exemplary embodiment of the present disclosure, the reference frame complexity prediction unit further includes:
[0062] The nearest reference frame determination unit is configured to obtain the decoding complexity corresponding to the reference frame closest to the timestamp of the current video frame among the reference frames as a prediction value of the decoding complexity of the current video frame.
[0063] In an exemplary embodiment of the present disclosure, the reference frame complexity prediction unit further includes:
[0064] A first reference frame determining unit is configured to execute acquiring a first reference frame in the reference frames that is adjacent to the timestamp of the current video frame;
[0065] The first reference frame averaging unit is configured to obtain a predicted value of the decoding complexity of the current video frame according to an average value of the decoding complexity corresponding to the first reference frame.
[0066] In an exemplary embodiment of the present disclosure, the decoding complexity prediction module further includes:
[0067] The layer category determination unit is configured to obtain a decoding complexity comparison coefficient of the current video frame according to the layer category of the current video frame.
[0068] In an exemplary embodiment of the present disclosure, the hierarchical category determination unit includes:
[0069] A bottom layer frame comparison coefficient determination unit, configured to determine the decoding complexity comparison coefficient of the current video frame as a first comparison coefficient if the current video frame is a bottom layer frame;
[0070] The high-level frame comparison coefficient determination unit is configured to determine the decoding complexity comparison coefficient of the current video frame as a second comparison coefficient if the current video frame is a high-level frame, and the second comparison coefficient is greater than the first comparison coefficient.
[0071] In an exemplary embodiment of the present disclosure, the adjustment degree determination module includes:
[0072] The proportional adjustment degree determination unit is configured to adjust the complexity adjustment degree index of the current video frame according to the first decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is proportional to the video complexity.
[0073] In an exemplary embodiment of the present disclosure, the adjustment degree determination module further includes:
[0074] The inverse adjustment degree determination unit is configured to adjust the complexity adjustment degree index of the current video frame according to the second decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is inversely proportional to the video complexity.
[0075] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement any one of the above-described methods for encoding video frames.
[0076] According to a fourth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above-described methods for encoding video frames.
[0077] The exemplary embodiments of the present disclosure may have the following beneficial effects:
[0078] In the encoding method of the video frame in the example implementation of the present disclosure, the decoding complexity of the current video frame is predicted, and the decoding complexity adjustment coefficient of the current video frame is obtained according to the predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient, and then the complexity adjustment degree index of the current video frame is adjusted according to the decoding complexity adjustment coefficient of the current video frame, and the current video frame is encoded according to the adjusted complexity adjustment degree index. The encoding method of the video frame in the example implementation of the present disclosure adjusts the complexity adjustment degree index of the current video frame by predicting the decoding complexity of the current video frame, so that the encoding end can use the most suitable encoding method that is conducive to reducing the decoding complexity of the decoding end for encoding video frames of different qualities based on different complexity adjustment degree indexes, thereby reducing the decoding complexity of the decoding end and improving the decoding efficiency while ensuring the encoding quality.
[0079] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0081] Figure 1 A schematic diagram of a process for reducing video decoding complexity in a related embodiment of the present disclosure is shown;
[0082] Figure 2 A schematic diagram showing a flow chart of a method for encoding a video frame according to an exemplary embodiment of the present disclosure;
[0083] Figure 3 A schematic diagram showing a flow chart of predicting the decoding complexity of a current video frame by pre-coding according to an exemplary embodiment of the present disclosure;
[0084] Figure 4 A schematic diagram of a process of determining a predicted value of decoding complexity corresponding to a coding block according to an exemplary embodiment of the present disclosure is shown;
[0085] Figure 5 A schematic diagram showing a flow chart of predicting the decoding complexity of a current video frame through a reference frame according to an exemplary embodiment of the present disclosure;
[0086] Figure 6 A schematic diagram of a process of adjusting a complexity adjustment degree index according to the importance of a coding block in an exemplary embodiment of the present disclosure is shown;
[0087] Figure 7 A block diagram showing an apparatus for encoding a video frame according to an exemplary embodiment of the present disclosure is shown;
[0088] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0089] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0090] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein.
[0091] The following example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0092] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0093] In some related embodiments, the Figure 1 In the method shown, the decoding complexity of each candidate coding mode combination is calculated to obtain a rate-distortion comparison value, and the coding mode combination with the best performance is screened out according to the rate-distortion comparison value, and the coding mode included in the optimal coding mode combination is used for encoding processing, so that the coding mode that is beneficial to reducing the decoding complexity of the decoding end can be accurately selected for video encoding, thereby further reducing the complexity of video decoding at the decoding end.
[0094] However, the method of reducing video decoding complexity in the above-mentioned related embodiments still has certain problems. First, in the actual consumption of video content, a part of the video content has complex texture, resulting in a high decoding complexity of the selected mode. While the other part of the video content is simple and has a low decoding complexity. The scheme in the above-mentioned related embodiments uses the same processing method for both videos, resulting in insufficient decoding benefits for complex videos, while the decoding complexity of simple videos does not require much decoding complexity benefits. Secondly, reducing decoding complexity will bring certain coding losses to the image coding quality, and there is a trade-off between decoding complexity benefits and coding quality benefits.
[0095] Based on the above problems, this exemplary embodiment first provides a method for encoding a video frame. Figure 2 As shown, the above-mentioned video frame encoding method may include the following steps:
[0096] Step S210: Predict the decoding complexity of the current video frame, and obtain a decoding complexity comparison coefficient of the current video frame.
[0097] Step S220: Obtain a decoding complexity adjustment coefficient of the current video frame according to the predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient.
[0098] Step S230: Adjust the complexity adjustment degree index of the current video frame according to the decoding complexity adjustment coefficient of the current video frame, and encode the current video frame according to the adjusted complexity adjustment degree index.
[0099] In the encoding method of the video frame in the example implementation of the present disclosure, the decoding complexity of the current video frame is predicted, and the decoding complexity adjustment coefficient of the current video frame is obtained according to the predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient, and then the complexity adjustment degree index of the current video frame is adjusted according to the decoding complexity adjustment coefficient of the current video frame, and the current video frame is encoded according to the adjusted complexity adjustment degree index. The encoding method of the video frame in the example implementation of the present disclosure adjusts the complexity adjustment degree index of the current video frame by predicting the decoding complexity of the current video frame, so that the encoding end can use the most suitable encoding method that is conducive to reducing the decoding complexity of the decoding end for encoding video frames of different qualities based on different complexity adjustment degree indexes, thereby reducing the decoding complexity of the decoding end and improving the decoding efficiency while ensuring the encoding quality.
[0100] Next, combine Figures 3 to 6 The above steps of this exemplary embodiment are described in more detail.
[0101] In step S210, the decoding complexity of the current video frame is predicted, and a decoding complexity comparison coefficient of the current video frame is obtained.
[0102] In this example implementation, the decoding complexity of the current video frame is predicted before the current video frame is formally encoded, and the predicted value of the decoding complexity of the current video frame is used to adjust the decoding complexity during encoding.
[0103] In this example implementation, the decoding complexity of the current video frame can be predicted by pre-encoding the coding blocks in the current video frame. Figure 3 As shown, predicting the decoding complexity of the current video frame may include the following steps:
[0104] Step S310: Pre-encode the coding block in the current video frame to obtain a predicted value of the decoding complexity corresponding to the coding block.
[0105] The same video frame is divided into multiple coding blocks, and the coding combination and decoding complexity of each coding block are different. All coding blocks in the current video frame can be pre-encoded, that is, informally encoded, to obtain the predicted value of the decoding complexity.
[0106] In this example implementation, Figure 4 As shown, the coding block in the current video frame is pre-coded to obtain a predicted value of the decoding complexity corresponding to the coding block, which may specifically include the following steps:
[0107] Step S410: Obtain multiple candidate coding modes corresponding to the coding block, wherein each candidate coding mode has a corresponding decoding complexity.
[0108] Coding mode refers to various parameter modes such as different prediction methods and quantization methods that can be selected by the coding block. For example, the coding block can choose the intra-frame prediction mode or the inter-frame prediction mode. If it is the intra-frame prediction mode, it can be divided into several angle predictions, DC (directional angle prediction) prediction, planer (smooth) prediction mode, etc. The inter-frame prediction mode includes ordinary unidirectional and bidirectional interpolation, AFFINE (Affine motion compensated prediction) and other prediction modes. Each candidate coding mode corresponds to a parameter of decoding complexity.
[0109] Step S420: Determine a target coding mode combination corresponding to the current video frame according to the decoding complexity corresponding to each candidate coding mode.
[0110] The decoding complexities corresponding to the candidate coding modes are added together to determine a target coding mode combination that minimizes the decoding complexity of the current video frame.
[0111] Step S430: Pre-encode the coding block in the current video frame according to the coding mode included in the target coding mode combination to obtain a predicted value of the decoding complexity corresponding to the coding block.
[0112] According to each coding mode in the target coding mode combination, each coding block is pre-coded respectively, and a predicted value of the decoding complexity corresponding to the coding block can be obtained.
[0113] Step S320: Obtain a predicted value of the decoding complexity of the current video frame according to the predicted value of the decoding complexity corresponding to the coding block.
[0114] Each coding block selects the corresponding mode to calculate the decoding complexity, and the decoding complexity of all coding blocks of the current video frame is added up to obtain the decoding complexity of the current video frame as the predicted value of the decoding complexity of the formal encoding.
[0115] In this example implementation, the decoding complexity of the current video frame can also be predicted by using the reference frame of the current video frame. Figure 5 As shown, predicting the decoding complexity of the current video frame may include the following steps:
[0116] Step S510: Obtain a reference frame list of the current video frame, wherein the reference frames in the reference frame list are encoded frames.
[0117] Each video frame has its corresponding reference frame list, and the frames in the reference frame list are all encoded.
[0118] Step S520: Determine the decoding complexity corresponding to the reference frame in the reference frame list.
[0119] In this example implementation, the decoding complexity corresponding to the coding block in the reference frame may be determined, and the decoding complexity corresponding to the reference frame may be obtained according to the decoding complexity corresponding to the coding block.
[0120] According to the coding mode corresponding to each coding block, the decoding complexity corresponding to the coding block in the reference frame can be determined, and the decoding complexity corresponding to the reference frame can be obtained by adding the decoding complexities corresponding to the coding blocks.
[0121] Step S530: Obtain a predicted value of the decoding complexity of the current video frame according to the decoding complexity corresponding to the reference frame.
[0122] After the decoding complexity of all reference frames is obtained, the decoding complexity of the reference frames can be used to predict the decoding complexity of the current video frame.
[0123] In this example implementation, the predicted value of the decoding complexity of the current video frame may be obtained according to the average value of the decoding complexity corresponding to all reference frames.
[0124] In this example implementation, the decoding complexity corresponding to the reference frame closest to the timestamp of the current video frame in the reference frames may also be obtained as the prediction value of the decoding complexity of the current video frame.
[0125] In this example implementation, a first reference frame adjacent to the timestamp of the current video frame in the reference frames may also be obtained; and a predicted value of the decoding complexity of the current video frame may be obtained based on the average value of the decoding complexity corresponding to the first reference frame.
[0126] The first reference frame may include one or more frames before and after the timestamp of the current video frame. The predicted value of the decoding complexity of the current video frame may be obtained by using the average decoding complexity of the N frames before and after in the reference frame list.
[0127] In this example implementation, the decoding complexity comparison coefficient is used to compare with the predicted value to adjust the decoding complexity. The decoding complexity comparison coefficient is a parameter that can be adjusted by the encoder. The decoding complexity comparison coefficient can be manually adjusted using an empirical value, or a suitable decoding complexity comparison coefficient can be obtained by training using decoded frames of videos actually consumed online.
[0128] In this example implementation, the decoding complexity comparison coefficient of the current video frame can be obtained according to the hierarchical category of the current video frame. Specifically, if the current video frame is a bottom layer frame, the decoding complexity comparison coefficient of the current video frame is determined as a first comparison coefficient; if the current video frame is a high layer frame, the decoding complexity comparison coefficient of the current video frame is determined as a second comparison coefficient, and the second comparison coefficient is greater than the first comparison coefficient.
[0129] The decoding complexity comparison coefficient parameters of video frames at different levels are different. The decoding complexity comparison coefficient of the bottom layer frame can be smaller, and the decoding complexity comparison coefficient of the high layer frame can be larger to reduce the greater decoding complexity.
[0130] In step S220, a decoding complexity adjustment coefficient of the current video frame is obtained according to the predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient.
[0131] The decoding complexity adjustment coefficient is used to adjust the complexity adjustment degree index of the current video frame.
[0132] In this example implementation, the first decoding complexity adjustment coefficient of the current video frame can be obtained according to the ratio of the predicted value of the decoding complexity of the current video frame to the decoding complexity comparison coefficient. The second decoding complexity adjustment coefficient of the current video frame can also be obtained according to the inverse of the ratio of the predicted value of the decoding complexity of the current video frame to the decoding complexity comparison coefficient. The first decoding complexity adjustment coefficient and the second decoding complexity adjustment coefficient have different adjustment methods for the complexity adjustment degree index.
[0133] In step S230, the complexity adjustment degree index of the current video frame is adjusted according to the decoding complexity adjustment coefficient of the current video frame, and the current video frame is encoded according to the adjusted complexity adjustment degree index.
[0134] In this example implementation, the complexity adjustment index is a parameter used to adjust the decoding complexity of the frame. The larger the complexity adjustment index is, the greater the intensity of reducing the decoding complexity is, that is, the more the decoding complexity is reduced.
[0135] According to the comparison result between the predicted value of decoding complexity and the decoding complexity comparison coefficient, the complexity adjustment degree index of the current video frame can be adjusted, and the current video frame can be encoded according to the adjusted complexity adjustment degree index.
[0136] In this example implementation, if the decoding complexity adjustment coefficient of the previous video frame is the first decoding complexity adjustment coefficient, the complexity adjustment degree index of the current video frame is adjusted according to the first decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is proportional to the video complexity.
[0137] According to the product of the first decoding complexity adjustment coefficient of the current video frame and the complexity adjustment index of the current video frame, an adjusted complexity adjustment index can be obtained, wherein the adjusted complexity adjustment index is proportional to the video complexity. The ratio of the decoding complexity of the current video frame and the decoding complexity comparison coefficient is multiplied by the first decoding complexity adjustment coefficient, so that the more complex the video, the greater the corresponding adjustment strength.
[0138] In this example implementation, if the decoding complexity adjustment coefficient of the previous video frame is the second decoding complexity adjustment coefficient, the complexity adjustment degree index of the current video frame is adjusted according to the second decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is inversely proportional to the video complexity.
[0139] According to the product of the second decoding complexity adjustment coefficient of the current video frame and the complexity adjustment index of the current video frame, an adjusted complexity adjustment index can be obtained, wherein the adjusted complexity adjustment index is inversely proportional to the video complexity. The inverse of the ratio of the current video frame decoding complexity and the decoding complexity comparison coefficient is multiplied by the second decoding complexity adjustment coefficient, so that the more complex the video, the smaller the corresponding adjustment intensity.
[0140] In this example implementation, the intensity of reducing decoding complexity can also be adaptively adjusted according to the importance of the coding block. Figure 6 As shown, the method for adjusting the complexity adjustment degree index of the current video frame may also include the following steps:
[0141] Step S610: Determine the number of times each coding block in the current video frame is referenced by other coding blocks for inter-frame coding.
[0142] During the encoding process, the coding block will make inter-frame coding references. Each coding block will refer to several coding blocks of the current video frame or other frames. By counting the number of times the pixels in each coding block are referenced by other coding blocks, the importance of the coding block can be determined. The more times, the more important the coding block is, and the fewer times, the less important the coding block is.
[0143] Step S620: Determine the importance coefficient of the coding block according to the reference number of the coding block, and adjust the complexity adjustment degree index of the current video frame according to the importance coefficient of the coding block.
[0144] In the pre-analysis module, the reference times of all coding blocks are counted, and the importance coefficient of the coding block is determined according to the reference times of the coding block. For coding blocks with higher importance, the intensity of adjusting the decoding complexity is reduced. For coding blocks with higher importance, the intensity of adjusting the decoding complexity is increased.
[0145] Since some coding blocks are referenced by other coding blocks many times, the required coding quality will be higher, so the intensity of adjusting the decoding complexity can be reduced, making the coding quality better. On the other hand, some coding blocks are rarely referenced by other coding blocks, and the required coding quality is lower, which can further reduce the decoding complexity.
[0146] In actual tests, the encoding method of video frames in this example implementation was tested on the average value of 100 1080p videos, where the decoding complexity of the frame-level video frames was adaptively adjusted, and the decoding complexity of the video frames could be reduced by 2-5% according to the different intensity of the adjustment. The decoding complexity of the block-level video frames was adaptively adjusted, and the decoding complexity of the video frames could be reduced by 2-5% according to the different intensity of the adjustment. It can be seen that the encoding method of video frames in this example implementation can effectively reduce the decoding complexity of video frames.
[0147] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0148] Furthermore, the present disclosure also provides a video frame encoding device. Figure 7 As shown, the encoding device of the video frame may include a decoding complexity prediction module 710, an adjustment coefficient determination module 720 and an adjustment degree determination module 730. Among them:
[0149] The decoding complexity prediction module 710 is configured to predict the decoding complexity of the current video frame and obtain a decoding complexity comparison coefficient of the current video frame;
[0150] The adjustment coefficient determination module 720 is configured to obtain a decoding complexity adjustment coefficient of the current video frame according to the predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient;
[0151] The adjustment degree determination module 730 is configured to adjust the complexity adjustment degree index of the current video frame according to the decoding complexity adjustment coefficient of the current video frame, and encode the current video frame according to the adjusted complexity adjustment degree index.
[0152] In some exemplary embodiments of the present disclosure, a video frame encoding device provided by the present disclosure may further include an importance coefficient adjustment module, which may include a reference number determination unit and an importance coefficient adjustment unit.
[0153] The reference number determination unit is configured to determine the number of references for each coding block in the current video frame to be referenced by other coding blocks for inter-frame coding;
[0154] The importance coefficient adjustment unit is configured to determine the importance coefficient of the coding block according to the reference number of the coding block, and adjust the complexity adjustment degree index of the current video frame according to the importance coefficient of the coding block.
[0155] In some exemplary embodiments of the present disclosure, the decoding complexity prediction module 710 may include a coding block precoding unit and a decoding complexity prediction unit.
[0156] The coding block precoding unit is configured to precode the coding block in the current video frame to obtain a predicted value of the decoding complexity corresponding to the coding block;
[0157] The decoding complexity prediction unit is configured to obtain a predicted value of the decoding complexity of the current video frame according to the predicted value of the decoding complexity corresponding to the coding block.
[0158] In some exemplary embodiments of the present disclosure, the coding block precoding unit may include a candidate coding mode acquisition unit, a target mode determination unit, and a target mode precoding unit.
[0159] The candidate coding mode acquisition unit is configured to acquire multiple candidate coding modes corresponding to the coding block, wherein each candidate coding mode has a corresponding decoding complexity;
[0160] The target mode determination unit is configured to determine a target coding mode combination corresponding to the current video frame according to the decoding complexity corresponding to each candidate coding mode;
[0161] The target mode precoding unit is configured to precode the coding block in the current video frame according to the coding mode included in the target coding mode combination to obtain a predicted value of the decoding complexity corresponding to the coding block.
[0162] In some exemplary embodiments of the present disclosure, the decoding complexity prediction module 710 may further include a reference frame list acquisition unit, a reference frame complexity determination unit, and a reference frame complexity prediction unit.
[0163] The reference frame list acquisition unit is configured to acquire a reference frame list of the current video frame, wherein the reference frames in the reference frame list are encoded frames;
[0164] The reference frame complexity determination unit is configured to determine the decoding complexity corresponding to the reference frame in the reference frame list;
[0165] The reference frame complexity prediction unit is configured to obtain a predicted value of the decoding complexity of the current video frame according to the decoding complexity corresponding to the reference frame.
[0166] In some exemplary embodiments of the present disclosure, the reference frame complexity prediction may include a reference frame complexity averaging unit configured to obtain a predicted value of the decoding complexity of the current video frame according to an average value of the decoding complexities corresponding to all reference frames.
[0167] In some exemplary embodiments of the present disclosure, the reference frame complexity prediction unit may further include a nearest reference frame determination unit, which is configured to obtain the decoding complexity corresponding to the reference frame in the reference frame that is nearest to the timestamp of the current video frame as a predicted value of the decoding complexity of the current video frame.
[0168] In some exemplary embodiments of the present disclosure, the reference frame complexity prediction unit may further include a first reference frame determination unit and a first reference frame averaging unit.
[0169] The first reference frame determination unit is configured to obtain a first reference frame in the reference frames that is adjacent to the timestamp of the current video frame;
[0170] The first reference frame averaging unit is configured to obtain a predicted value of the decoding complexity of the current video frame according to an average value of the decoding complexity corresponding to the first reference frame.
[0171] In some exemplary embodiments of the present disclosure, the decoding complexity prediction module 710 may further include a hierarchy category determination unit configured to obtain a decoding complexity comparison coefficient of the current video frame according to the hierarchy category of the current video frame.
[0172] In some exemplary embodiments of the present disclosure, the hierarchical category determination unit may include a bottom-layer frame comparison coefficient determination unit and a high-layer frame comparison coefficient determination unit.
[0173] The bottom layer frame comparison coefficient determination unit is configured to determine the decoding complexity comparison coefficient of the current video frame as the first comparison coefficient if the current video frame is a bottom layer frame;
[0174] The high-level frame comparison coefficient determination unit is configured to determine the decoding complexity comparison coefficient of the current video frame as a second comparison coefficient if the current video frame is a high-level frame, and the second comparison coefficient is greater than the first comparison coefficient.
[0175] In some exemplary embodiments of the present disclosure, the adjustment degree determination module 730 may include a proportional adjustment degree determination unit, which is configured to adjust the complexity adjustment degree index of the current video frame according to the first decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is proportional to the video complexity.
[0176] In some exemplary embodiments of the present disclosure, the adjustment degree determination module 730 may further include an inverse adjustment degree determination unit, which is configured to adjust the complexity adjustment degree index of the current video frame according to the second decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is inversely proportional to the video complexity.
[0177] The specific details of each module / unit in the above-mentioned video frame encoding device have been described in detail in the corresponding method embodiment part, and will not be repeated here.
[0178] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown.
[0179] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0180] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0181] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0182] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present disclosure are executed.
[0183] The exemplary embodiment of the present disclosure also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the information prompt method for reward redemption is implemented.
[0184] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0185] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0186] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0187] The computer program may be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. The electronic device may convert the signal carrying the computer program into a digital signal, thereby running the computer program. When the computer program is run on the electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device may execute) the method steps of various exemplary embodiments of the present disclosure, such as the information prompt method for reward redemption described above.
[0188] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0189] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules described above can be concretized in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be concretized.
[0190] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0191] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for encoding a video frame, characterized in that: include: Predicting the decoding complexity of the current video frame, and obtaining a decoding complexity comparison coefficient of the current video frame; Obtaining a decoding complexity adjustment coefficient of the current video frame according to the predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient; The complexity adjustment degree index of the current video frame is adjusted according to the decoding complexity adjustment coefficient of the current video frame, and the current video frame is encoded according to the adjusted complexity adjustment degree index.
2. The video frame encoding method according to claim 1, characterized in that: The method further comprises: Determine the number of references for each coding block in the current video frame by other coding blocks for inter-frame coding reference; An importance coefficient of the coding block is determined according to the reference number of the coding block, and a complexity adjustment degree index of the current video frame is adjusted according to the importance coefficient of the coding block.
3. The video frame encoding method according to claim 1, characterized in that: The predicting the decoding complexity of the current video frame includes: Pre-encoding a coding block in the current video frame to obtain a predicted value of decoding complexity corresponding to the coding block; According to the predicted value of the decoding complexity corresponding to the coding block, a predicted value of the decoding complexity of the current video frame is obtained.
4. The video frame encoding method according to claim 3, characterized in that: The pre-encoding the coding block in the current video frame to obtain a predicted value of the decoding complexity corresponding to the coding block includes: Acquire multiple candidate coding modes corresponding to the coding block, wherein each of the candidate coding modes has a corresponding decoding complexity; Determining a target coding mode combination corresponding to the current video frame according to the decoding complexity corresponding to each of the candidate coding modes; According to the coding mode included in the target coding mode combination, the coding block in the current video frame is pre-encoded to obtain a predicted value of decoding complexity corresponding to the coding block.
5. The video frame encoding method according to claim 1, characterized in that: The predicting the decoding complexity of the current video frame includes: Acquire a reference frame list of the current video frame, wherein the reference frames in the reference frame list are encoded frames; Determine a decoding complexity corresponding to a reference frame in the reference frame list; A predicted value of the decoding complexity of the current video frame is obtained according to the decoding complexity corresponding to the reference frame.
6. The video frame encoding method according to claim 5, characterized in that: The obtaining, according to the decoding complexity corresponding to the reference frame, a predicted value of the decoding complexity of the current video frame, comprises: A predicted value of the decoding complexity of the current video frame is obtained according to an average value of the decoding complexities corresponding to all the reference frames.
7. The video frame encoding method according to claim 5, characterized in that: The obtaining, according to the decoding complexity corresponding to the reference frame, a predicted value of the decoding complexity of the current video frame, comprises: The decoding complexity corresponding to the reference frame in the reference frames that is closest to the timestamp of the current video frame is obtained as a predicted value of the decoding complexity of the current video frame.
8. The video frame encoding method according to claim 5, characterized in that: The obtaining, according to the decoding complexity corresponding to the reference frame, a predicted value of the decoding complexity of the current video frame, comprises: Acquire a first reference frame in the reference frames that is adjacent to the timestamp of the current video frame; A predicted value of the decoding complexity of the current video frame is obtained according to an average value of the decoding complexity corresponding to the first reference frame.
9. The video frame encoding method according to claim 1, characterized in that: The obtaining the decoding complexity comparison coefficient of the current video frame includes: According to the hierarchy category of the current video frame, a decoding complexity comparison coefficient of the current video frame is obtained.
10. The video frame encoding method according to claim 9, characterized in that: The step of obtaining a decoding complexity comparison coefficient of the current video frame according to the hierarchy category of the current video frame includes: If the current video frame is a bottom layer frame, determining a decoding complexity comparison coefficient of the current video frame as a first comparison coefficient; If the current video frame is a high-layer frame, the decoding complexity comparison coefficient of the current video frame is determined as a second comparison coefficient, and the second comparison coefficient is greater than the first comparison coefficient.
11. The video frame encoding method according to claim 1, characterized in that: The decoding complexity adjustment coefficient of the current video frame includes a first decoding complexity adjustment coefficient, and the step of adjusting the complexity adjustment degree index of the current video frame according to the decoding complexity adjustment coefficient of the current video frame includes: The complexity adjustment degree index of the current video frame is adjusted according to the first decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is proportional to the video complexity.
12. The video frame encoding method according to claim 1, characterized in that: The decoding complexity adjustment coefficient of the current video frame includes a second decoding complexity adjustment coefficient, and the step of adjusting the complexity adjustment degree index of the current video frame according to the decoding complexity adjustment coefficient of the current video frame includes: The complexity adjustment degree index of the current video frame is adjusted according to the second decoding complexity adjustment coefficient of the current video frame, and the adjusted complexity adjustment degree index is inversely proportional to the video complexity.
13. A video frame encoding device, characterized in that: include: A decoding complexity prediction module is configured to predict the decoding complexity of the current video frame and obtain a decoding complexity comparison coefficient of the current video frame; An adjustment coefficient determination module is configured to obtain a decoding complexity adjustment coefficient of the current video frame according to a predicted value of the decoding complexity of the current video frame and the decoding complexity comparison coefficient; The adjustment degree determination module is configured to adjust the complexity adjustment degree index of the current video frame according to the decoding complexity adjustment coefficient of the current video frame, and encode the current video frame according to the adjusted complexity adjustment degree index.
14. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the video frame encoding method according to any one of claims 1 to 12.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for encoding a video frame according to any one of claims 1 to 12 is implemented.