Adaptive video coding method and device suitable for rural power grid project construction supervision
By adaptively adjusting the quantization parameters of video frames using quantization parameter prediction models in video encoding, the problems of high code rate and limitations of adaptive adjustment in the prior art are solved, and efficient video data encoding and transmission are achieved.
Patent Information
- Application Number
- CN202411896845.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-23
AI Technical Summary
The existing video encoding standards require a high code rate during the encoding process, and have limitations in adaptive adjustment, which is difficult to meet the encoding and transmission requirements of high-resolution and high-frame rate video data by rural network engineering construction supervision.
An adaptive video encoding method is provided, through the training quantization parameter prediction model, predicts the reasonable quantization parameters of each frame, intelligently adjusts the quantization parameters of different frame contents, and optimizes the encoding performance.
While ensuring that the video quality does not drop significantly, the code rate required for video encoding is reduced, which is suitable for high-resolution, high-frame rate video data encoding and transmission requirements for rural network engineering construction supervision.
Smart Images

Figure CN119363988B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video coding technology, and in particular to an adaptive video coding method and device suitable for construction supervision of rural power grid projects. Background Art
[0002] In the current context of highly developed informatization, the informatization level of rural power grid transformation construction projects is relatively low. Due to the long construction lines of rural power grids, project personnel usually need to travel by car to various project departments for field visits, which can no longer meet the needs of real-time monitoring of project processes. Therefore, the use of informatization monitoring and management methods to optimize the construction process and thus improve construction efficiency and quality is the focus of current research.
[0003] In the application scenario of rural power grid construction supervision, the construction area of rural power grid projects usually covers a wide range, the lines are extended and most of them are located in remote rural areas. In order to achieve efficient information management in such an environment, a communication technology that saves network bandwidth resources and has adaptive control capabilities is required to support the encoding and transmission of high-resolution, high-frame-rate video data such as on-site panoramic views, construction details, and material supervision during actual construction. In addition, considering that the human eye is not sensitive to some details in the video, when designing the video encoding algorithm, it is also necessary to consider that the distortion generated during the compression process is mainly concentrated in areas that are not easily perceived by the human eye, so as to achieve the goal of maintaining visual quality while reducing the video bit rate requirements.
[0004] At present, mainstream video coding standards include H.26x series, Moving Picture Expert Group (MPEG) series and Audio Video Coding Standard (AVS) series. However, the inventors found in their research that existing mainstream video coding standards such as H.264 and H.265 often require a higher bit rate during the encoding process and have limitations in adaptive adjustment. At the same time, with the rapid development of streaming media technology and the increasing popularity of ultra-high-definition video content, these traditional technologies have been unable to meet the market's demand for efficient storage and transmission of high-resolution video content.
[0005] Therefore, how to provide a video encoding method suitable for rural power grid project construction supervision to achieve more efficient video data compression and transmission and meet the needs of rural power grid project construction supervision for high-definition video surveillance is a technical problem that needs to be solved. Summary of the invention
[0006] In view of this, one of the purposes of the present invention is to provide an adaptive video encoding method and device suitable for supervision of rural power grid construction, which can adaptively adjust the quantization parameters corresponding to different frame contents, and can reduce the bit rate required for the entire video encoding while ensuring that the video quality is not significantly reduced, and is suitable for the application scenario of supervision of rural power grid construction for the needs of efficient encoding and transmission of high-resolution, high-frame-rate video data. The technical solution of the present invention can be implemented as follows:
[0007] In a first aspect, the present invention provides an adaptive video encoding method suitable for construction supervision of rural power grid projects, the method comprising: obtaining a video frame sequence to be encoded; wherein the video frame sequence comes from high-resolution and high-frame-rate video data; using a quantization parameter prediction model obtained through training to predict a reasonable quantization parameter that matches a target bit rate of a current encoding frame; wherein the current encoding frame is each frame in the video frame sequence; if the reasonable quantization parameter is inconsistent with a pre-configured quantization parameter, adjusting the pre-configured quantization parameter to the reasonable quantization parameter; encoding the current encoding frame according to the reasonable quantization parameter.
[0008] In a second aspect, the present invention provides an adaptive video encoding device suitable for construction supervision of rural power grid projects, comprising: an acquisition module, used to acquire a video frame sequence to be encoded; wherein the video frame sequence comes from video data with high resolution and high frame rate; a prediction module, used to use a quantization parameter prediction model obtained through training to predict a reasonable quantization parameter that matches a target bit rate of a current encoding frame; wherein the current encoding frame is each frame in the video frame sequence; an adjustment module, used to adjust the pre-configured quantization parameter to the reasonable quantization parameter if the reasonable quantization parameter is inconsistent with the pre-configured quantization parameter; and an encoding module, used to encode the current encoding frame according to the reasonable quantization parameter.
[0009] The adaptive video encoding method and device applicable to the construction supervision of rural power grid engineering provided by the embodiment of the present invention, first, the present invention can predict the quantization parameter matching the target bit rate for each frame for the video frame sequence to be encoded, using the quantization parameter prediction model obtained through training. This adaptive quantization parameter determination method can be adjusted intelligently according to the different frame contents, thereby optimizing the encoding performance. After predicting the reasonable quantization parameter, the embodiment of the present invention can offset the pre-set quantization parameter before encoding, and then encode according to the reasonable quantization parameter. Compared with the traditional mainstream encoding technology standards that cannot perform adaptive quantization parameter adjustment for different frame contents, resulting in the entire encoding process requiring a higher bit rate, the present invention can predict the quantization parameter matching the target bit rate for each frame for the video frame sequence to be encoded using the quantization parameter prediction model obtained through training. This method of adaptively adjusting the quantization parameter according to the frame content can reduce the bit rate required for the entire video encoding while ensuring that the video quality is not significantly reduced, and is suitable for the application scenario of rural power grid engineering construction supervision for high-resolution, high-frame rate video data for efficient encoding and transmission requirements.
[0010] In addition, by applying the adaptive video encoding method provided by the embodiment of the present invention in the application scenario of rural power grid project construction supervision, not only the information management of rural power grid project construction supervision is realized, but also the construction efficiency, project quality and operation safety are improved. At the same time, project managers can grasp the real-time situation of the construction site more timely and accurately, so as to make more reasonable and effective decisions. Finally, by adapting to the development trend of informatization, not only the competitiveness of enterprises is improved, but also it is ensured that enterprises can better adapt to the development needs of the times.
[0011] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0013] Figure 1 A schematic flow chart of an adaptive video encoding method applicable to rural power grid project construction supervision provided by an embodiment of the present invention;
[0014] Figure 2 A schematic diagram of the structure of a quantization parameter prediction model provided by an embodiment of the present invention;
[0015] Figure 3 A possible structure of a feature extraction network provided by an embodiment of the present invention;
[0016] Figure 4 A test effect diagram of the adaptive video encoding method provided by an embodiment of the present invention;
[0017] Figure 5 A functional module diagram of an adaptive video encoding device applicable to rural power grid project construction supervision provided by an embodiment of the present invention;
[0018] Figure 6 A structural block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0020] Considering that the bit rate consumption in the existing mainstream video coding standards H.264 and H.265 is usually large, and it is difficult to adaptively adjust the quantization parameters to match different video coding contents, it is not suitable for the application scenario of rural power grid construction supervision that requires high-resolution and high-frame-rate video data for encoding and transmission. Based on this, an embodiment of the present invention provides an adaptive video encoding method suitable for rural power grid construction supervision, which can meet the encoding and transmission requirements of high-resolution and high-frame-rate video data in the application scenario of rural power grid construction supervision.
[0021] The following will provide a detailed and clear introduction to the process of the adaptive video encoding method applicable to the construction supervision of rural power grid projects provided by the embodiment of the present invention in conjunction with the relevant drawings.
[0022] See also Figure 1 , Figure 1 A schematic flow chart of an adaptive video coding method applicable to the supervision of rural power grid construction provided by an embodiment of the present invention. The execution subject of the method may be a computer device with data processing capability, and the following steps are performed by the computer device:
[0023] Step S101, obtaining a video frame sequence to be encoded;
[0024] Wherein, the video frame sequence comes from high-resolution and high-frame-rate video data;
[0025] Step S102, using the quantization parameter prediction model obtained through training to predict a reasonable quantization parameter that matches the target bit rate of the current coded frame; wherein the current coded frame is each frame in the video frame sequence;
[0026] Step S103: If the reasonable quantization parameter is inconsistent with the pre-configured quantization parameter, the pre-configured quantization parameter is adjusted to the reasonable quantization parameter;
[0027] Step S104: Encode the current encoding frame according to a reasonable quantization parameter.
[0028] The method of step S101 to step S103 of the embodiment of the present invention has the following advantages: First, the present invention can predict the quantization parameters that match the target bit rate for each frame for the video frame sequence to be encoded, using the quantization parameter prediction model obtained through training. This adaptive quantization parameter determination method can be intelligently adjusted according to the different frame contents, thereby optimizing the encoding performance. After predicting reasonable quantization parameters, the embodiment of the present invention can offset the pre-set quantization parameters before encoding, and then encode according to the reasonable quantization parameters. Compared with the traditional mainstream encoding technology standards, which cannot adaptively adjust the quantization parameters for different frame contents, resulting in the entire encoding process requiring a higher bit rate. The adaptive encoding method of the embodiment of the present invention can reduce the bit rate required for the entire video encoding while ensuring that the video quality is not significantly reduced.
[0029] In addition, this adaptive video coding method can be applied to the application scenario of rural power grid construction supervision, which requires efficient coding and transmission of high-resolution and high-frame-rate video data. This not only realizes the informatization management of rural power grid construction supervision, but also improves construction efficiency, engineering quality and operation safety. At the same time, project managers can grasp the real-time situation of the construction site more timely and accurately, so as to make more reasonable and effective decisions. Ultimately, by adapting to the development trend of informatization, it not only improves the competitiveness of enterprises, but also ensures that enterprises can better adapt to the development needs of the times.
[0030] The following is the above Figure 1 Each step in the process is described in detail and clearly.
[0031] In step S101, the video frame sequence comes from high-resolution and high-frame-rate video data. For example, the video data is high-resolution and high-frame-rate video data such as on-site panoramic views, construction details, and material supervision collected during the construction process of the agricultural power grid project. The video data sequence includes multiple video frames, and these video frames have a time sequence. For each video frame, step S102 of the embodiment of the present invention can be executed to predict its reasonable quantitative parameters.
[0032] For the convenience of description, with respect to the video sequence in step S101, the embodiment of the present invention defines the current frame to be encoded as a “current encoding frame”, and uses P t Indicated by P, and the frame before this frame is defined as the "reference frame" t-1 In other words, in a video frame sequence, except for the first frame in the sequence which lacks a reference frame, each of the remaining frames can be used as a current encoding frame, and the previous frame of each frame becomes a reference frame of the current encoding frame. It should be clear that for the first frame in a video frame sequence, the embodiment of the present invention allows the first frame in the video frame sequence to be directly encoded using a preset quantization parameter to obtain the encoding result of the frame.
[0033] In the embodiment of the present invention, the encoding result includes bit rate (R) and distortion (D). Bit rate refers to the size of the encoded video or image data, usually measured in bit rate (bps). The lower the bit rate, the smaller the file, but too low a bit rate may result in reduced image quality. Distortion refers to the difference between the compressed video frame and the original video frame. The smaller the distortion, the higher the image quality.
[0034] In step 102, the embodiment of the present invention uses the quantization parameter prediction model obtained through training to predict a reasonable quantization parameter of each current coding frame.
[0035] The quantization parameter prediction model is obtained by training through the step-by-step training strategy provided by the embodiment of the present invention, and has the ability to establish a mapping relationship between the encoding result and the quantization parameter. In the process of predicting a reasonable quantization parameter, the current encoding frame P t , the current frame number (POC) and the target bit rate (R tar ) and the reference frame and the reference frame P t-1 The encoding result (R t-1 and D t-1 ) are input into the quantization parameter prediction model for prediction to obtain reasonable quantization parameters.
[0036] It is understandable that POC, R tar , P t-1 , R t-1 , D t-1 As the model input, it is mainly considered that adjacent video frames usually have a high correlation in content. Therefore, when encoding the current frame Pt When encoding, the encoding result R of the previous frame is used t-1 and D t-1 And the target bit rate R assigned to this frame tar ,The model can predict the quantization parameter that is most suitable for the current ,encoded frame based on the learned mapping relationship between the ,encoding result and the quantization parameter to optimize the encoding quality.
[0037] In one embodiment of the present invention, considering that the encoding result of the previous frame needs to be used when predicting the quantization parameter of the current encoding frame, in order to improve the processing speed, before making the prediction, that is, after obtaining the video sequence to be encoded, the embodiment of the present invention can also effectively combine two adjacent video frames in advance to form a sub-image group sequence. Each sub-image group can be represented by a symbol (P t-1 ,P t ) is used to identify, where P t-1 represents the previous frame, and P t Represents the current coded frame. This allows for quick acquisition of the reference frame and its coding result corresponding to each current coded frame, which can improve processing speed.
[0038] It can be understood that, due to the temporal continuity between video frames, the multiple sub-image groups formed by combining two adjacent video frames also follow the temporal order. Based on this order, the current encoding frame in each sub-image group is encoded. After the encoding is completed, all frames are recombined and output according to the video frame playback order, thereby generating encoded video data.
[0039] In one embodiment of the present invention, in the sub-image group (P t-1 ,P t ), the later frame P t is the current coded frame, the previous frame P in time sequence t-1 Then, in two adjacent sub-image groups, the current coded frame of the previous sub-image group is the reference frame of the next sub-image group.
[0040] For each sub-image group (P t-1 ,P t ), in predicting P t When the reasonable quantization parameters are obtained, the sub-image group and P t-1 The encoding result R t-1 and D t-1 Points and P t The target bit rate R tar The quantization parameter prediction model is input together. The quantization parameter prediction model has the ability to establish a mapping relationship between the encoding result and the quantization parameter during the training process. Therefore, based on the above information input, the current encoding frame P can be predicted. tThe target bit rate R tar Reasonable quantitative parameters for matching.
[0041] In order to facilitate understanding of the ability of the quantization parameter prediction model provided by the embodiment of the present invention to predict quantization parameters, the structure and training method of the quantization parameter prediction model are introduced in detail below.
[0042] See also Figure 2 , Figure 2 A schematic diagram of the structure of a quantization parameter prediction model provided by an embodiment of the present invention. Figure 2 As shown, the quantitative parameter prediction model includes two feature extraction networks and multiple multi-layer perceptrons.
[0043] It should be understood that Figure 2 Only five multilayer perceptrons are drawn in the figure, but this does not mean that there is any limit on the number of multilayer perceptrons included in the embodiment of the present invention. In fact, the user can flexibly adjust the number of multilayer perceptrons according to their actual needs to build the most suitable model, and the embodiment of the present invention does not limit this.
[0044] In an embodiment of the present invention, the two feature extraction networks maintain consistency in structure, and they can be composed of multiple residual blocks, the number of channels of these residual blocks increases step by step, and the feature size decreases step by step. This design not only ensures the uniformity of the network structure, but also helps to extract features efficiently. Functionally, the two feature extraction networks are responsible for extracting the spatial domain features of the current coded frame and the reference frame respectively. This design enables the model to more accurately capture the subtle differences between frames, thereby providing more accurate feature information for subsequent quantization parameter prediction.
[0045] In an optional embodiment, Figure 2 The structure of the feature extraction network in Figure 3 shown. Figure 3 A possible structure of the feature extraction network provided by the embodiment of the present invention. It should be emphasized that although Figure 3 A specific structure is shown, but this is not the only option. In practical applications, the network structure can be adjusted and optimized according to specific needs to achieve the best performance, and the present invention is not limited to this.
[0046] It is worth noting that considering the reference frame P t-1 With the current coded frame P t There is a significant correlation between them. During the training process, the embodiment of the present invention can adopt a differentiated strategy to optimize the performance of the two feature extraction networks. Specifically, one of the feature extraction networks is trained to extract P t-1 The global information of the image in the training of another network focuses on extracting P tThe detailed features related to compression coding in Pt enable it to focus on extracting features from Pt that are not yet included in the reference frame. Through this differentiated feature extraction strategy, it not only enhances the complementarity of features, but also enables the model to understand the video content more comprehensively, thereby achieving more efficient encoding while maintaining video quality, significantly improving the overall performance of video encoding.
[0047] Continue to see Figure 2 , the multilayer perceptrons (MLPs) provided in the embodiment of the present invention do not share parameters. These MLPs are responsible for mapping and transforming features. Specifically, the MLPs at the input end and the middle layer of the model (such as Figure 2 The four MLPs from left to right in the figure can adopt a network structure with fewer parameters and narrower layers, such as a 3-layer network. The main function of these MLPs is to convert auxiliary state quantities containing time series information, such as Figure 2 The POC, R tar , R t-1 and D t-1 Then, these time domain features are combined with the empty features extracted by the feature extraction network and the mean-variance normalization is performed.
[0048] The above design not only reduces the number of parameters, but also improves the efficiency of calculation. On this basis, in order to generate quantization parameters based on spatiotemporal information, the deep MLPs near the output of the model adopt wider layers and deeper network depths, and contain more parameters. The goal of these MLPs is to map the combined features into the final predicted quantization parameter (QP) output. Through this refined design, the MLPs network can effectively capture and process complex spatiotemporal features, ensuring highly accurate support in quantization parameter decisions.
[0049] Based on the above Figure 2 The model structure shown in the figure, the embodiment of the present invention provides a step-by-step training strategy to complete the model training. The step-by-step training strategy in the embodiment of the present invention is introduced below, which may include the following steps:
[0050] Step a1: Build the initial prediction network.
[0051] It is understandable that the structure of the initial prediction network is Figure 2 The structure shown will not be described in detail here.
[0052] Step a2: Perform the first step of training on the prediction network by inputting two consecutive frames each time, so that the prediction network learns the mapping relationship between the encoding result and the quantization parameter between two consecutive frames;
[0053] Step a3: Based on the first step of training, the prediction network is trained in the second step by inputting multiple frames each time and the number of frames is greater than the number of frames input last time, so that the prediction network has the ability to allocate coding resources among multiple frames;
[0054] Step a4: Based on the training in the second step, the prediction network is trained in the third step by inputting a long video frame sequence each time until a quantization parameter prediction model is obtained after the training is completed.
[0055] It can be seen from step a2 to step a4 that the step-by-step training strategy provided by the embodiment of the present invention has its own unique training focus in each step. In the first step of training, the training goal is to enable the model to learn the impact of the quantization parameter setting on the encoding result when processing two consecutive frames of encoding, and to accurately map it to the corresponding quantization parameter according to different bit rates and distortion conditions. Entering the second step of training, the training goal is to give the prediction network the ability to allocate encoding resources between multiple frames. This resource allocation is achieved by adjusting the quantization parameters at the frame level, so that the model can adapt to the multi-frame encoding scenario and optimize the allocation of encoding resources. As for the third step of training, the accuracy of the network's prediction of quantization parameters for long video sequences is enhanced by introducing more frames. The purpose of this step is to further improve the overall performance of the model and ensure that the model can provide more accurate and reliable quantization parameter predictions when processing long video sequences.
[0056] Through the above-mentioned step-by-step training strategy, the embodiment of the present invention not only ensures the learning objectives and key points of the model at different stages, but also provides the model with opportunities for gradual improvement and optimization, thereby ultimately achieving efficient and accurate video coding prediction.
[0057] The specific training process of the above three steps will be introduced in detail and clearly below.
[0058] For the first step of training, in order to give the network a mapping relationship between quantization parameters and encoding results that adapt to different frame contents, the training method is as follows:
[0059] Step a1-1: determining a plurality of frame sample groups from a video training data set; each frame sample group includes two consecutive frames; each frame sample group corresponds to a preset encoding result;
[0060] In one embodiment of the present invention, the video training data set may be, but is not limited to, a vimeo data set. The vimeo data set is obtained by randomly cropping the original vimeo video sequence (480x270) to a size of 256x256, and the length of each video sequence is 7.
[0061] Step a1-2: input a frame sample group into the preset network each time, obtain a predicted quantization parameter, and encode the frame sample group by the predicted quantization parameter to obtain an actual encoding result;
[0062] Step a1-3: Use the preset encoding result and the actual encoding result to determine the loss value of the first loss function, and update the network parameters of the prediction network based on the loss value of the first loss function until the convergence condition is reached and then stop the first step of training.
[0063] The first loss function satisfies the following relationship:
[0064]
[0065] in, is a hyperparameter; and R are the actual encoding results corresponding to the encoding of the frame to be encoded; and They are respectively preset encoding results corresponding to the encoding of the frames to be encoded;
[0066] It can be seen that the first step of training can give the network a mapping relationship between flexible parameter settings and bitrate and distortion that can adapt to different frame contents. Qualitatively, the model can effectively find a balance point during the first step of training, so that the encoded video frames can meet the target bitrate requirements while maintaining low distortion values. Through this training stage, the model can initially master the reasonable setting method of quantization parameters in simple encoding scenarios, laying the foundation for subsequent more complex training tasks.
[0067] For the second step of training, in order to enable the prediction network to have the ability to allocate coding resources among multiple frames, the training method is as follows:
[0068] Step b1-1: taking multiple frames from the video training data set each time and inputting them into the prediction network to obtain the prediction quantization parameters of each frame in the multiple frames;
[0069] In an embodiment of the present invention, the video training data set used for the second step of training can still be a vimeo data set. During the second step of training, the embodiment of the present invention aims to reduce the bit rate as much as possible while ensuring the reduction of distortion. In order to achieve this goal, the embodiment of the present invention fine-tunes the model by implementing a gradually enhanced multi-frame cascade training strategy. Among them, the multi-frame cascade training strategy refers to inputting multiple frames each time and the number of frames input each time is greater than the number of frames input last time, for example, the number of frames input in sequence is 3 frames, 5 frames, 7 frames, and so on.
[0070] Step b1-2: encoding each frame using the predicted quantization parameter of each frame in the multiple frames to obtain an actual encoding result of each frame in the multiple frames;
[0071] Step b1-3: Calculate the loss value of the second loss function using the actual encoding result of each frame in the multiple frames and the Lagrangian factor used for encoding, and update the network parameters of the prediction network based on the loss value of the second loss function until the second loss function converges and stops the second step training.
[0072] The second loss function satisfies the following relationship:
[0073]
[0074] in, is the number of frames input into the model each time; and are the actual encoding results corresponding to the t-th frame respectively; is the Lagrangian factor used in encoding the t-th frame.
[0075] It can be seen that the second step of training is to train the network by cascading multiple frames, and use the average loss function value for gradient back propagation. This method effectively adjusts the network parameters so that the model can achieve the optimal balance of rate distortion in multi-frame scenarios. In this training phase, the model not only needs to consider the encoding effect of a single frame, but also needs to learn how to reasonably allocate bit rate and quality in the temporal dimension. This allocation method is achieved by making subtle adjustments to the quantization parameters at the frame level, so that the optimal point on the bit rate-distortion graph gradually moves to the upper left corner of the graph. This trend symbolizes higher compression efficiency and lower image distortion. In the bit rate-distortion graph, each point represents a specific encoding configuration (specific bit rate and distortion). The ideal encoding configuration is located in the upper left corner of the graph, that is, the bit rate is low and the distortion is small. If the new RD curve is above the original curve, it means that the model can achieve a lower bit rate at the same distortion level, or achieve lower distortion at the same bit rate, that is, the encoding efficiency has been improved.
[0076] For the third step of training, in order to improve the accuracy of the prediction network's quantization parameters for long video sequences, the training method is as follows:
[0077] Step c1-1: taking a video frame sequence from the deep video compression training data set each time and inputting it into the prediction network to obtain the predicted quantization parameters of each frame in the video frame sequence;
[0078] In an embodiment of the present invention, the deep video compression training data set used in the third step of training is different from the video data set of the first and second steps of training. The deep video compression training data set may be, but is not limited to, a BVI-DVC data set. The BVI-DVC data set contains a large number of video sequences, each of which contains sequences with different spatial resolutions. Using the BVI-DVC database can achieve significant coding gains under the same training and evaluation configurations.
[0079] In the third step of training, video sequences can be obtained from the BVI-DVC dataset as training samples and input into the network for training. These video sequences contain frame sequences of different lengths, so as to simulate video contents of different lengths and complexities during the training process.
[0080] Step c1-2: Encode each frame in the video frame sequence using the predicted quantization parameter of each frame to obtain the actual encoding result of each frame in the video frame sequence;
[0081] Step c1-3: Use the actual encoding result of each frame in the video frame sequence and the Lagrangian factor used for encoding to calculate the loss value of the second loss function, and update the network parameters of the prediction network based on the loss value of the second loss function until the second loss function converges, and then stop the third step of training.
[0082] The third step of training uses the same loss function as the second step of training. , but the number of frames input to the model in the third step of training is much larger than the number of frames input to the model in the second step of training. In this training phase, the training data is expanded to sequences containing more frames to further improve the model's adaptability to long-term encoding scenarios. This training not only strengthens the model's performance in complex encoding scenarios, but also enhances the model's accuracy and robustness for long-term predictions.
[0083] It should be noted that before executing the above three-step training, the training parameters of each step can be appropriately set to ensure the training quality. For example, the first step of training can be 120,000 steps, and the learning rate can be 1e-4; the second step of training is 3-frame, 5-frame and 7-frame cascade training, 3-frame cascade training can be 120,000 steps, and the learning rate can be 1e-4, 5-frame cascade training can be 120,000 steps, and the learning rate is also 1e-4, 7-frame cascade training uses a learning rate of 1e-5 for 60,000 steps; the third step of training can use a learning rate of 5e-6, and can be trained for 100,000 steps. The optimizer used in each of the three steps of training uses the Adam optimizer.
[0084] Of course, the above setting method is only an example, and the user can flexibly set the training parameters according to the actual situation, which is not limited in the embodiment of the present invention.
[0085] Through the above three-step training strategy, the embodiment of the present invention finally obtains a quantization parameter model. In the process of predicting reasonable quantization parameters, a feature extraction network is used to extract the spatial domain features of the current coding frame and the reference frame. At the same time, the frame number and target bit rate of the current coding frame are input into one of the multi-layer perceptrons for feature mapping, and the distortion and bit rate corresponding to the reference frame are input into another multi-layer perceptron for feature mapping to obtain time domain features. Then, the time domain features and spatial domain features are feature fused and standardized by the multi-layer perceptron, and finally the combined features are mapped to the quantization parameter output.
[0086] Through the above three-step training strategy, the embodiment of the present invention finally trains an efficient quantization parameter prediction model. The process of the quantization parameter prediction model predicting the quantization parameter is as follows:
[0087] First, the model uses a feature extraction network to extract the spatial features of the current encoded frame and the reference frame respectively, which provides a solid foundation for subsequent predictions.
[0088] Next, the model takes the frame number and target bit rate of the current encoded frame as input and feeds it into one of the multi-layer perceptrons (MLP) for feature mapping. At the same time, the distortion and bit rate corresponding to the reference frame are also input into another multi-layer perceptron for mapping time domain features. This step ensures that the model can capture key information in the time series and provides support for accurate prediction.
[0089] Subsequently, the model uses a multi-layer perceptron to fuse and normalize temporal and spatial features. This process not only enhances the complementarity of features, but also improves the expressiveness of features, allowing the model to understand the video content more comprehensively.
[0090] Ultimately, the model maps these fused and standardized combined features into quantization parameter outputs. This output is the model's accurate prediction of the quantization parameters in the video encoding process, which is directly related to the quality and efficiency of video encoding.
[0091] exist Figure 2 In the model, different state information of the model input has different value ranges in the physical sense. They need to be normalized before being input into the network to facilitate network training. This problem may also occur when different features are merged and fused. For example, when the information containing the target bit rate needs to be retained until the final quantization parameter decision, the time domain features obtained from the target bit rate need to be standardized and input into the last multi-layer perceptron to provide constraints from the target bit rate.
[0092] It should be noted that, in the embodiment of the present invention, different information input by the model has its own physical meaning and value range. Therefore, each needs to be normalized before being input into the network to facilitate network training. In addition, this problem may also occur during feature fusion. For example, when it comes to information containing a target bit rate, the target bit rate needs to be mapped into a time domain feature and then subjected to a standardization process before being input into the last multi-layer perceptron. This process not only ensures the effective fusion of features, but also provides the model with important constraints from the target bit rate, thereby making the prediction of the quantization parameters more accurate and reliable.
[0093] After predicting the reasonable quantization parameter of the current coding frame through the above implementation, step S103 and step S104 may be executed to complete the coding of the current coding frame.
[0094] In step S103, the embodiment of the present invention first determines whether the predicted reasonable quantization parameter is the same as the quantization parameter set for the current coding frame. This set quantization parameter may be pre-set by the user based on experience or other factors, but may not be completely suitable for the target bit rate of the current coding frame. After predicting a reasonable quantization parameter, if it is found to be consistent with the quantization parameter set by the user, the model will directly use this set quantization parameter for encoding. If the predicted reasonable quantization parameter is inconsistent with the parameter set by the user, the model will take active measures to replace the quantization parameter set by the user with the predicted reasonable quantization parameter and then encode. This replacement ensures that the encoding process can be optimized according to the actual needs of the current frame, thereby improving encoding quality and efficiency.
[0095] During the encoding process, the current encoding frame can be sent to the encoder for encoding, and each current encoding frame is encoded in sequence according to the sub-image group order, and finally output in frame order to obtain encoded video data.
[0096] The encoder may be a commonly used video encoder in the prior art. The embodiment of the present invention does not make any modification to the internal structure of the encoder, but requires the video encoder to support offset setting of quantization parameters of any scale, that is, adjusting the preset quantization parameters to the predicted quantization parameters.
[0097] In the embodiment of the present invention, the offset modes of quantization parameters of encoders of different types are different.
[0098] For traditional video encoders such as VTM (Versatile Video Test Model) and HPM (High Efficiency Video Coding Test Model), frame-level quantization parameter offset functions matching their encoder structures are built in, and these functions can finely adjust the quantization parameters. Therefore, the embodiment of the present invention provides an interface provided by these encoders to receive the quantization parameters predicted by the quantization parameter prediction model and perform offset processing.
[0099] For different types of deep learning video encoders, the methods of implementing quantization parameter offset are different. Taking DVC (Deep Video Compression) as an example, it implements quantization parameter offset by training multiple trained models for different quantization parameters. Therefore, in the quantization parameter prediction model of the present invention, it is necessary to load these trained models and select between them to adapt to different quantization parameter offset requirements. The DCVC-DC encoder in the DCVC series implements offset by interpolating quantization parameters of different scales. For this type of encoder, the quantization parameter prediction model of the present invention can load only one model, and then implement quantization parameter offset by linear interpolation or logarithmic interpolation.
[0100] Finally, the embodiment of the present invention uses the quantization parameter offset capability of the encoder to adjust the preset quantization parameter to a reasonable quantization parameter of the current encoding frame before encoding. It can be seen that for each frame, the embodiment of the present invention can adaptively complete the encoding according to the quantization parameter that matches the target bit rate that matches the frame. This can ensure that the video quality will not be significantly reduced while also reducing the bit rate required for the entire video encoding. At the same time, the embodiment of the present invention also tested the performance of this adaptive video encoding method on the UVG dataset, such as Figure 4 As shown, Figure 4 This is a test effect diagram of the adaptive video encoding method provided by an embodiment of the present invention. It can be seen that the present invention can optimize the BD-Rate gain of the original encoder by -14.35%.
[0101] Based on Figure 1 With the same inventive concept, the embodiment of the present invention also provides an adaptive video encoding device suitable for monitoring the construction of rural power grid projects. Figure 5 , Figure 5 The functional module diagram of the adaptive video encoding device for supervision of rural power grid construction provided by the embodiment of the present invention. The adaptive video encoding device 50 for supervision of rural power grid construction may include: an acquisition module 501, a prediction module 502, an adjustment module 503 and an encoding module 504.
[0102] The acquisition module 501 is used to acquire a video frame sequence to be encoded; wherein the video frame sequence comes from video data with high resolution and high frame rate;
[0103] A prediction module 502 is used to predict a reasonable quantization parameter that matches a target bit rate of a current coded frame using a quantization parameter prediction model obtained through training; wherein the current coded frame is each frame in a video frame sequence;
[0104] An adjustment module 503, configured to adjust the pre-configured quantization parameter to the reasonable quantization parameter if the reasonable quantization parameter is inconsistent with the pre-configured quantization parameter;
[0105] The encoding module 504 is used to encode the current encoding frame according to a reasonable quantization parameter.
[0106] It is understandable that the acquisition module 501, the prediction module 502, the adjustment module 503 and the encoding module 504 can be executed in a coordinated manner. Figure 1 Each step in the process is performed to achieve the corresponding technical effect.
[0107] In an optional implementation, the prediction module 502 is specifically used to input the current coding frame, the current frame sequence number, the target bit rate, the reference frame and the coding result of the reference frame into the quantization parameter prediction model for prediction to obtain a reasonable quantization parameter. Wherein: the reference frame is the previous frame of the current coding frame; the quantization parameter prediction model has the ability to establish a mapping relationship between the coding result and the quantization parameter;
[0108] In an optional embodiment, the adaptive video encoding device 50 suitable for supervision of rural power grid construction may also include a training module for constructing an initial prediction network; the prediction network is trained in the first step by inputting two consecutive frames each time, so that the prediction network learns the mapping relationship between the encoding result and the quantization parameter between two consecutive frames; on the basis of the first step of training, the prediction network is trained in the second step by inputting multiple frames each time and the number of frames is greater than the number of frames input last time, so that the prediction network has the ability to allocate encoding resources among multiple frames; on the basis of the second step of training, the prediction network is trained in the third step by inputting a long video frame sequence each time, until a quantization parameter prediction model is obtained after the training is completed.
[0109] In an optional embodiment, the training module is specifically used to: determine multiple frame sample groups from a video training data set; each frame sample group contains two consecutive frames; each frame sample group corresponds to a preset encoding result; each time a frame sample group is input into the preset network, a predicted quantization parameter is obtained, and the frame sample group is encoded by the predicted quantization parameter to obtain an actual encoding result; the loss value of the first loss function is determined using the preset encoding result and the actual encoding result, and the network parameters of the prediction network are updated based on the loss value of the first loss function, until the first step of training is stopped after the convergence condition is reached.
[0110] In an optional embodiment, the training module is specifically used to: take out multiple frames from the video training data set each time and input them into the prediction network to obtain predicted quantization parameters of each frame in the multiple frames; encode each frame using the predicted quantization parameters of each frame in the multiple frames to obtain actual encoding results of each frame in the multiple frames; calculate the loss value of the second loss function using the actual encoding results of each frame in the multiple frames and the Lagrangian factors used for encoding, and update the network parameters of the prediction network based on the loss value of the second loss function until the second loss function converges, and then stop the second step of training.
[0111] In an optional embodiment, the training module is specifically used to: take out a video frame sequence from the deep video compression training data set each time and input it into the prediction network to obtain a predicted quantization parameter for each frame in the video frame sequence; encode each frame using the predicted quantization parameter for each frame in the video frame sequence to obtain an actual encoding result for each frame in the video frame sequence; calculate the loss value of the second loss function using the actual encoding result of each frame in the video frame sequence and the Lagrangian factor used for encoding, and update the network parameters of the prediction network based on the loss value of the second loss function until the second loss function converges, and then stop the third step of training.
[0112] In an optional embodiment, the first loss function used in the first step of training satisfies the following relationship: ;in, is a hyperparameter; and R are the actual encoding results corresponding to the encoding of the frame to be encoded; and are respectively the preset encoding results corresponding to the encoding of the frame to be encoded; the second loss function used in the second step training and the third step training satisfies the following relationship: ;in, is the number of frames input into the model each time; and are the actual encoding results corresponding to the t-th frame respectively; is the Lagrangian factor used in encoding the t-th frame.
[0113] In an optional embodiment, the quantization parameter prediction model includes two feature extraction networks and multiple multi-layer perceptrons; the feature extraction network is used to extract spatial domain features from the current coded frame and the reference frame; the multi-layer perceptron is used to map the current frame sequence number, the target bit rate and the coding result into time domain features, and to fuse the spatial domain features and the time domain features, and to normalize the fused features to map them into reasonable quantization parameters.
[0114] In an optional embodiment, the adaptive video encoding device 50 suitable for supervision of rural power grid project construction may also include a combination module, which is used to combine two adjacent video frames in a video frame sequence to obtain a sub-image group sequence; wherein, in the sub-image group, the frame that is later in time is the current encoding frame, and the frame that is earlier in time is the reference frame; the encoding module 504 is used to determine the next sub-image group and obtain the current encoding frame and the reference frame after encoding the current encoding frame according to reasonable quantization parameters, and return to the step of using the quantization parameter prediction model obtained through training to predict a reasonable quantization parameter that matches the target bit rate of the current encoding frame.
[0115] It should be noted that the division of modules in the above embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0116] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program executable code.
[0117] The embodiment of the present invention further provides a computer device 60, see Figure 6 , Figure 6The computer device 60 provided in the embodiment of the present invention includes a memory 601, a processor 602 and a communication interface 603. The memory 601, the processor 602 and the communication interface 603 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0118] Optionally, the bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0119] In the embodiment of the present invention, the processor 602 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiment of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor. The software module may be located in the memory 601, and the processor 602 reads the program instructions in the memory 601 and completes the steps of the above method in combination with its hardware.
[0120] In the embodiment of the present invention, the memory 601 may be a non-volatile memory, such as a hard disk (HDD) or a solid-state drive (SSD), etc., or a volatile memory (Volatile Memory), such as RAM. The memory may also be any other medium that can be used to carry or store the desired program executable code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present invention may also be a circuit or any other device that can realize a storage function, for storing instructions and / or data.
[0121] The memory 601 can be used to store software programs and modules, such as the instructions / modules of the adaptive video encoding device 50 applicable to the construction supervision of the rural power grid project provided in the embodiment of the present invention, which can be stored in the memory 601 or in the operating system (OS) of the fixed computer device 600 in the form of software or firmware. The processor 602 executes the software programs and modules stored in the memory 601 to perform various functional applications and data processing. The communication interface 603 can be used to communicate signaling or data with other node devices.
[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0123] Understandably, Figure 6 The structure shown is for illustration only. The computer device 60 may also include Figure 6 More or fewer components as shown, or with Figure 6 Different configurations are shown. Figure 6 The components shown may be implemented in hardware, software or a combination thereof.
[0124] The computer device 60 may also include network devices and / or user devices. The network devices include, but are not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.
[0125] Based on the above embodiments, the present application also provides a storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the adaptive video encoding method applicable to the construction supervision of rural power grid projects provided in the above embodiments.
[0126] Based on the above embodiments, an embodiment of the present invention further provides a computer program. When the computer program runs on a computer, the computer executes the adaptive video encoding method applicable to the construction supervision of rural power grid projects provided in the above embodiments.
[0127] Based on the above embodiments, an embodiment of the present invention further provides a chip, which is used to read a computer program stored in a memory and to execute the adaptive video encoding method applicable to the construction supervision of rural power grid projects provided in the above embodiments.
[0128] A computer program product is also provided in an embodiment of the present invention, including instructions, which, when executed on a computer, enables the computer to execute the adaptive video encoding method applicable to the construction supervision of rural power grid projects provided in the above embodiment.
[0129] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. An adaptive video coding method suitable for supervision of rural power grid construction, characterized in that: The method comprises: Acquire a video frame sequence to be encoded; wherein the video frame sequence comes from video data with high resolution and high frame rate; The quantization parameter prediction model obtained through training is used to predict a reasonable quantization parameter that matches the target bit rate of the current coding frame; wherein the current coding frame is each frame in the video frame sequence; the training method of the quantization parameter prediction model comprises: constructing an initial prediction network; performing a first step of training on the prediction network by inputting two consecutive frames each time, so that the prediction network learns the mapping relationship between the coding result and the quantization parameter between the two consecutive frames; based on the first step of training, performing a second step of training on the prediction network by inputting multiple frames each time and the number of frames is greater than the number of frames input last time, so that the prediction network has the ability to allocate coding resources between the multiple frames; based on the second step of training, performing a third step of training on the prediction network by inputting a long video frame sequence each time, until the quantization parameter prediction model is obtained after the training is completed; If the reasonable quantization parameter is inconsistent with the pre-configured quantization parameter, adjusting the pre-configured quantization parameter to the reasonable quantization parameter; The current encoding frame is encoded according to the reasonable quantization parameter.
2. The adaptive video coding method for construction supervision of rural power grid projects according to claim 1 is characterized in that: The trained quantization parameter prediction model is used to predict reasonable quantization parameters that match the target bit rate of the current encoding frame, including: Input the current coded frame, the current frame sequence number, the target bit rate, the reference frame and the coding result of the reference frame into the quantization parameter prediction model for prediction to obtain the reasonable quantization parameter; The reference frame is a frame before the current encoding frame; and the quantization parameter prediction model has the ability to establish a mapping relationship between the encoding result and the quantization parameter.
3. The adaptive video coding method for construction supervision of rural power grid projects according to claim 1 is characterized in that: The prediction network is trained in the first step by inputting two consecutive frames each time, so that the prediction network learns the mapping relationship between the encoding result and the quantization parameter between the two consecutive frames, including: Determine a plurality of frame sample groups from the video training data set; each of the frame sample groups includes the two consecutive frames; each of the frame sample groups corresponds to a preset encoding result; Inputting one of the frame sample groups into the prediction network each time to obtain a prediction quantization parameter, and encoding the frame sample group by using the prediction quantization parameter to obtain an actual encoding result; The preset encoding result and the actual encoding result are used to determine the loss value of the first loss function, and the network parameters of the prediction network are updated based on the loss value of the first loss function, until the first loss function converges and then the first step of training is stopped.
4. The adaptive video coding method applicable to the construction supervision of rural power grid engineering according to claim 1 is characterized in that: Based on the first step of training, the prediction network is trained in a second step by inputting multiple frames each time and the number of frames is greater than the number of frames input last time, so that the prediction network has the ability to allocate coding resources between the multiple frames, including: Taking multiple frames from the video training data set each time and inputting them into the prediction network to obtain the prediction quantization parameters of each frame in the multiple frames; Encoding each frame in the multiple frames using the predicted quantization parameter of each frame to obtain an actual encoding result of each frame in the multiple frames; The loss value of the second loss function is calculated using the actual encoding result of each frame in the multiple frames and the Lagrangian factor used for encoding, and the network parameters of the prediction network are updated based on the loss value of the second loss function until the second loss function converges and the second step of training is stopped; wherein the Lagrangian factor is positively correlated with the quantization parameter.
5. The adaptive video coding method applicable to the construction supervision of rural power grid engineering according to claim 1 is characterized in that: On the basis of the second step of training, the prediction network is trained in the third step by inputting a long video frame sequence each time until the quantization parameter prediction model is obtained after the training is completed, including: Each time, a video frame sequence is taken from the deep video compression training data set and input into the prediction network to obtain a predicted quantization parameter of each frame in the video frame sequence; Encoding each frame in the video frame sequence using the predicted quantization parameter of each frame to obtain an actual encoding result of each frame in the video frame sequence; The loss value of the second loss function is calculated using the actual encoding result of each frame in the video frame sequence and the Lagrangian factor used for encoding, and the network parameters of the prediction network are updated based on the loss value of the second loss function until the third step of training is stopped after the second loss function converges.
6. The adaptive video coding method applicable to the construction supervision of rural power grid engineering according to claim 3 is characterized in that: The first loss function satisfies the following relationship: in, is a hyperparameter; and R are the actual encoding results respectively; and They are preset encoding results respectively; The second loss function satisfies the following relationship: in, is the number of frames input into the model each time; and are the actual encoding results corresponding to the t-th frame respectively; is the Lagrangian factor used in encoding the t-th frame.
7. The adaptive video coding method applicable to the construction supervision of rural power grid engineering according to claim 2 is characterized in that: The quantization parameter prediction model includes two feature extraction networks and multiple multi-layer perceptrons; the feature extraction network is used to extract the spatial domain features of the current coding frame and the reference frame; the multi-layer perceptron is used to map the current frame sequence number, the target bit rate and the coding result into time domain features, and perform feature fusion on the spatial domain features and the time domain features. The fused features are normalized to be mapped into the reasonable quantization parameters.
8. The adaptive video coding method for construction supervision of rural power grid projects according to any one of claims 1 to 5, characterized in that: After obtaining the video frame sequence to be encoded, the method further includes: Combining two adjacent video frames in the video frame sequence to obtain a sub-image group sequence; wherein, in the sub-image group, a frame later in time sequence is the current coding frame, and a frame earlier in time sequence is the reference frame; After encoding the current coded frame according to the reasonable quantization parameter, determining the next sub-image group and acquiring the current coded frame and the reference frame, returning to the step of using the quantization parameter prediction model obtained through training to predict a reasonable quantization parameter that matches the target bit rate of the current coded frame.
9. An adaptive video encoding device suitable for monitoring construction of rural power grid projects, characterized in that: include: An acquisition module, used for acquiring a video frame sequence to be encoded; wherein the video frame sequence comes from video data with high resolution and high frame rate; A prediction module is used to predict a reasonable quantization parameter that matches the target bit rate of the current coding frame using a quantization parameter prediction model obtained through training; wherein the current coding frame is each frame in the video frame sequence; the training method of the quantization parameter prediction model includes: constructing an initial prediction network; performing a first step of training on the prediction network by inputting two consecutive frames each time, so that the prediction network learns the mapping relationship between the coding result and the quantization parameter between the two consecutive frames; based on the first step of training, performing a second step of training on the prediction network by inputting multiple frames each time and the number of frames is greater than the number of frames input last time, so that the prediction network has the ability to allocate coding resources between the multiple frames; based on the second step of training, performing a third step of training on the prediction network by inputting a long video frame sequence each time, until the quantization parameter prediction model is obtained after the training is completed; an adjustment module, configured to adjust the preconfigured quantization parameter to the reasonable quantization parameter if the reasonable quantization parameter is inconsistent with the preconfigured quantization parameter; The encoding module is used to encode the current encoding frame according to the reasonable quantization parameter.
Citation Information
Patent Citations
Data processing method and apparatus
US20240073420A1