Self-adaptive video coding method, device, equipment and medium
Through the adaptive video encoding method, the frame rate and resolution are dynamically adjusted, the problems of lag and resource waste caused by network bandwidth fluctuations in the prior art are solved, and efficient video encoding and high-quality user experience are achieved.
Patent Information
- Application Number
- CN202510514409.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-04-23
AI Technical Summary
The existing video encoding scheme cannot effectively adapt to the dynamic network environment, resulting in low network bandwidth utilization and poor user viewing experience, especially frequent lags or waste of resources when network bandwidth fluctuates.
Through the adaptive video encoding method, the video frame sequence is obtained and segmented, and the encoding unit is optimized using prediction mode and entropy encoding, and the network bandwidth state is evaluated in combination with real-time link state and historical traffic data, and the frame rate and resolution are dynamically adjusted to generate video encoding that adapts to network conditions.
It realizes efficient bandwidth utilization in dynamic network environments, reduces the amount of video data transmission, avoids lag, improves user viewing experience, and improves coding efficiency and resource utilization.
Smart Images

Figure CN120390089A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video coding, and particularly relates to an adaptive video coding method, apparatus, device and medium. Background Art
[0002] In today's digital age, the network environment shows a continuous and complex dynamic change trend, which undoubtedly brings more severe challenges to the field of video coding; most of the current video coding schemes adopt a fixed bitrate control strategy, ignoring the fluctuation characteristics of the real-time network bandwidth; in actual network transmission, the network state is constantly changing. For example, when network congestion occurs, due to the inability of the coding parameters to be dynamically adjusted according to the bandwidth drop, video transmission will frequently experience stuttering phenomena, greatly affecting the user's viewing experience; when the network bandwidth is abundant, the fixed bitrate control cannot make full use of the redundant bandwidth resources, resulting in unnecessary bandwidth waste. The limitations of this fixed bitrate control strategy make it difficult for the current coding schemes to adapt to the dynamic network environment. Therefore, there is an urgent need for a scheme that can perform adaptive video coding according to the real-time network bandwidth to optimize video transmission quality and bandwidth utilization. Summary of the Invention
[0003] To solve the above-mentioned drawbacks in the prior art, the present invention proposes an adaptive video coding method.
[0004] To solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0005] An adaptive video coding method includes: obtaining a video frame sequence, and performing a segmentation operation on the video frame sequence to obtain a set of coding units; predicting the set of coding units according to a preset prediction mode to obtain a prediction error; performing binary coding calculation according to the prediction error, a preset quantization parameter and a preset probability interval to obtain entropy coding; obtaining real-time link state information and historical network traffic data; evaluating the network bandwidth state according to the link state information and the historical network traffic data; calculating the frame rate and resolution according to the network bandwidth state and a preset gradient information evaluation formula; and adaptively adjusting the set of coding units according to the frame rate, entropy coding and resolution to obtain video coding.
[0006] In this embodiment, in the segmentation stage, the coding units can be dynamically and accurately divided according to the complexity of the video content, adapting to the details of different regions, reducing redundancy and lowering the computational complexity, laying a good foundation for subsequent coding; in the prediction process, a deeply optimized intra-frame prediction mode is adopted, significantly enhancing the ability to explore the spatial correlation of pixels, accurately predicting pixel values, improving the coding efficiency and reducing the prediction error; by reasonably setting the quantization parameters and probability intervals, coding in line with the data distribution law effectively improves the coding efficiency, reduces the transmission bandwidth and cost; in terms of network state adaptation, when the network is congested, the frame rate and resolution can be timely reduced to avoid freezing; when the bandwidth is sufficient, the frame rate and resolution are increased to make full use of resources; finally, through the adaptive adjustment of the coding unit set based on the frame rate, entropy coding and resolution, a video coding adapted to the network conditions is generated, realizing the efficient utilization of network bandwidth and flexibly adapting to the changes in the dynamic network environment; the entire coding process can flexibly adjust the coding parameters according to the network bandwidth state, no longer limited to a fixed bit rate, better adapting to various changes in the dynamic network environment and making reasonable coding adjustments.
[0007] Further, the predicting the coding unit set according to a preset prediction mode to obtain a prediction error includes: obtaining all reference pixels from the video frame sequence to obtain a reference pixel set; performing a matching operation on the coding unit set and the reference pixel set through a motion estimation method to obtain a set of matching blocks and a mapping relationship; calculating a motion vector according to the set of matching blocks and the mapping relationship; calculating a pixel range according to the reference pixel set; obtaining the weight coefficient of the prediction mode, and predicting the coding unit set according to the weight coefficient, the pixel range, the motion vector and a preset coordinate system to obtain a prediction error. Starting from obtaining the reference pixel set, which is derived from the already encoded part within the current frame of the coding unit, it provides a solid data foundation for subsequent motion estimation and prediction operations; by constructing a set of matching blocks and a mapping relationship, conditions are created for calculating the motion vector, thus reflecting the motion changes of objects in the video; the pixel range calculated based on the reference pixel set is of great significance in the quantization and prediction processes. It not only helps to determine a reasonable quantization step size to achieve a balance between data compression and information retention, but also standardizes the range of predicted values to keep them within a reasonable interval; by obtaining the weight coefficient and combining the pixel range, the motion vector and the preset coordinate system to predict the coding unit set, the redundant information between coding units can be deeply explored, thereby improving the coding efficiency. In practical application scenarios, this method can effectively reduce the amount of video data transmitted, relieve the network bandwidth pressure, ensure smooth video playback, maintain a high image quality, comprehensively improve the user viewing experience, and enhance the adaptability and stability of the video coding system.
[0008] Further, the evaluation of the network broadband status based on the link state information and historical network traffic data includes: calculating alternative paths according to the link state information and a preset network topology structure; obtaining network traffic feature data, and predicting the network traffic feature data based on a preset neural network model to obtain the traffic status; obtaining historical network traffic data, and screening the alternative paths based on a preset routing selection function and the historical network traffic data to obtain the optimal path; and evaluating the network broadband status according to the optimal path, the alternative paths, and the traffic status. In terms of path planning, all alternative paths are calculated to provide a reference basis for the selection of the optimal path; in terms of traffic status prediction, network traffic data covering packet size, sending and receiving rates, and delay characteristics is used and analyzed through a neural network model trained with a large amount of historical data, so that the predicted value of the traffic status highly fits the real situation and effectively reduces misjudgment; in the path screening link, based on the historical network traffic data and the preset routing selection function, the optimal path is determined from the alternative paths. This process continuously optimizes the distance set through iterative calculation to ensure the efficiency of the selected path; finally, the optimal path, the alternative paths, and the traffic status are integrated to evaluate the network broadband status, enabling a more comprehensive and accurate understanding of the actual network situation.
[0009] Further, the binary coding calculation based on the prediction error, a preset quantization parameter, and a preset probability interval to obtain the entropy coding includes: performing a discrete cosine transform on the prediction error to obtain low-frequency transform coefficients and high-frequency transform coefficients; quantizing the low-frequency transform coefficients and the high-frequency transform coefficients according to the quantization parameter to obtain quantization coefficients and quantization steps; adjusting the probability interval according to the quantization coefficients and the quantization steps to obtain an optimized interval; and performing binary coding calculation on the quantization coefficients based on the optimized interval to obtain the entropy coding. To further improve the coding efficiency, binary arithmetic coding is selected; when coding the binary symbols of the quantization coefficients, first obtain the probability of each symbol appearing from a pre-trained probability model. Based on the probability distribution characteristics, the symbols with a high occurrence probability are represented by shorter codes, while the symbols with a low occurrence probability are presented with longer codes; through this way of allocating coding lengths according to probability, efficient coding of the quantization coefficients can be achieved, and then the final entropy coding is generated; the prominent advantage of entropy coding is that it can adapt to the statistical characteristics of the data, thereby realizing further compression of the data and greatly improving the efficiency of data coding.
[0010] Further, calculating the frame rate and resolution according to the network bandwidth status and a preset gradient information evaluation formula includes: obtaining a color video frame from a video frame sequence to obtain a color frame data set; converting the color frame data set into a grayscale frame data set; obtaining the central point pixel coordinates in the grayscale frame data set, and performing noise reduction processing on the grayscale frame data set based on a preset Gaussian function and the central point pixel coordinates to obtain a noise reduction data set; performing gradient calculation on the noise reduction data set based on a preset Sobel algorithm to obtain a horizontal gradient set and a vertical gradient set; calculating a gradient magnitude set and a gradient direction set according to the horizontal gradient set and the vertical gradient set; evaluating the gradient magnitude set and the gradient direction set based on the gradient information evaluation formula to obtain a gradient information evaluation value; calculating the frame rate and resolution based on the gradient information evaluation value and the network bandwidth status. Obtaining color frames from the video frame sequence to construct a data set, and then converting the data set into a grayscale frame data set, which greatly reduces the data complexity and lays a solid foundation for subsequent processing; using the Gaussian function combined with the central point pixel coordinates to denoise the grayscale frame, determining the neighborhood pixel positions based on the central point, and removing noise through weighted averaging to provide pure data for gradient calculation and improve the calculation accuracy; then, using the Sobel algorithm to calculate the horizontal and vertical gradients, obtaining the direction and intensity information of the object edges and details, and further calculating the gradient magnitude set and the gradient direction set to provide detailed data for evaluating the video content complexity; obtaining the gradient information evaluation value according to the gradient information evaluation formula, which comprehensively reflects the complexity of the video frame; finally, combining the network bandwidth status, when the bandwidth is sufficient and the gradient information evaluation value is high, increasing the frame rate and resolution to present a clear, smooth and detailed picture; when the bandwidth is insufficient, reducing the frame rate and resolution to give priority to ensuring smooth playback, avoiding stuttering, comprehensively improving the user viewing experience, and enhancing the adaptability of the video under different network conditions.
[0011] Further, calculating the frame rate and resolution based on the gradient information evaluation value, network bandwidth status, preset first broadband threshold, and preset second broadband threshold includes: analyzing the network bandwidth status according to the preset first broadband threshold and preset second broadband threshold to obtain an analysis result; when the analysis result is that the network bandwidth status is less than or equal to the first broadband threshold, calculating the frame rate according to the preset first frame rate calculation formula and the gradient information evaluation value; when the analysis result is that the network bandwidth status is greater than the first broadband threshold and less than or equal to the second broadband threshold, calculating the frame rate according to the preset second frame rate calculation formula and the gradient information evaluation value; calculating the resolution based on the frame rate and the network bandwidth status. By setting the first broadband threshold and the second broadband threshold, the network bandwidth status is accurately analyzed, providing a basis for video parameter adjustment. According to different bandwidth intervals, the frame rate is determined by combining the frame rate calculation formula with the gradient information evaluation value; in the case of low bandwidth, the coefficient is reasonably adjusted to avoid network congestion and ensure video smoothness; in the case of medium and high bandwidth, the coefficient is adjusted according to the abundant bandwidth, taking both smoothness and quality into account. After determining the frame rate, the resolution is flexibly adjusted according to the network bandwidth status. If there is remaining bandwidth, the clarity is improved; if the bandwidth is tight, the smoothness is ensured. It can dynamically adapt the video frame rate and resolution under various network conditions, significantly improving the viewing experience, avoiding stuttering and blurring. At the same time, it efficiently utilizes network resources and reasonably allocates resources under different bandwidths. It also enhances video coding adaptability, adapts to various video contents and application scenarios, such as online playback, video conferencing, etc., and improves the overall performance.
[0012] Further, the adaptive adjustment of the coding unit set according to the frame rate, entropy coding, and resolution to obtain video coding includes: dividing the coding unit set according to a preset video coding standard to obtain a first coding set and a second coding set; respectively calculating the feature parameters of the first coding set and the second coding set to obtain a first feature parameter and a second feature parameter; adaptively adjusting the first coding set according to the frame rate, entropy coding, resolution, and the first feature parameter to obtain a first optimized coding set; adaptively adjusting the second coding set according to the frame rate, entropy coding, resolution, and the second feature parameter to obtain a second optimized coding set; generating video coding according to the first optimized coding set and the second optimized coding set. Dividing the coding unit set according to the preset video coding standard provides a reliable basis for the division; then calculating the feature parameters of the two coding sets respectively, such as the variance of pixel values and the distribution of motion vectors, so as to accurately grasp the characteristics of the video content in each coding set; on this basis, combining the frame rate, entropy coding, and resolution, and adaptively adjusting the coding set according to the feature parameters; for the coding set with intense motion, high frame rate, and large resolution, the coding bit number can be increased to ensure clear and smooth pictures; for the relatively static coding set, the coding bit number can be reduced to save the bit rate. Finally, integrating and optimizing the coding set to generate video coding, the whole process effectively improves the coding efficiency, avoids resource waste, and reduces the bit rate requirement; comprehensively improves the video quality, making different content pictures reach high-quality presentation; enhances the system adaptability, can easily handle the changes of frame rate and resolution and diverse and complex video content, and significantly improves the video coding performance.
[0013] Furthermore, an adaptive video encoding device includes: a segmentation operation module for obtaining a video frame sequence and performing a segmentation operation on the video frame sequence to obtain a set of coding units; an error prediction module for predicting the set of coding units according to a preset prediction mode to obtain a prediction error; an entropy coding calculation module for performing binary coding calculation according to the prediction error, a preset quantization parameter, and a preset probability interval to obtain entropy coding; a data acquisition module for acquiring real-time link state information and historical network traffic data; a state evaluation module for evaluating the network bandwidth state based on the link state information and the historical network traffic data; a parameter calculation module for calculating the frame rate and resolution according to the network bandwidth state and a preset gradient information evaluation formula; and a video encoding module for adaptively adjusting the set of coding units according to the frame rate, the entropy coding, and the resolution to obtain an encoded video. In the segmentation stage, the coding units can be dynamically and accurately divided according to the video content complexity, adapting to the details of different regions, reducing redundancy, and lowering the computational complexity, laying a good foundation for subsequent encoding; in the prediction process, a deeply optimized intra-frame prediction mode is adopted to significantly enhance the ability to mine the pixel spatial correlation, accurately predict the pixel values, improve the encoding efficiency, and reduce the prediction error; by reasonably setting the quantization parameter and the probability interval and coding in line with the data distribution law, the encoding efficiency is effectively improved, and the transmission bandwidth and cost are reduced; in terms of network state adaptation, the frame rate and resolution can be timely reduced in case of network congestion to avoid lags; when the bandwidth is sufficient, the frame rate and resolution are increased to make full use of resources; finally, by adaptively adjusting the set of coding units according to the frame rate, the entropy coding, and the resolution, a video encoding adapted to the network conditions is generated, realizing the efficient utilization of the network bandwidth and flexibly adapting to the changes in the dynamic network environment; the entire encoding process can flexibly adjust the encoding parameters according to the network bandwidth state, no longer limited to a fixed bit rate, can better adapt to various changes in the dynamic network environment, and can make reasonable encoding adjustments.
[0014] Furthermore, an adaptive video encoding device includes: a memory and at least one processor, wherein instructions are stored in the memory; at least one of the processors calls the instructions in the memory so that the adaptive video encoding method executes each step of an adaptive video encoding method as described in any one of the above.
[0015] Furthermore, a computer-readable storage medium stores instructions thereon, and when the instructions are executed by a processor, each step of an adaptive video encoding method as described in any one of the above is implemented.
[0016] The beneficial effects of the adaptive video encoding method of the present invention are as follows:
[0017] During the segmentation stage, the coding units can be dynamically and accurately divided according to the complexity of the video content, adapting to the details of different regions, reducing redundancy and computational complexity, and laying a good foundation for subsequent coding. In the prediction process, a deeply optimized intra-frame prediction mode is adopted to significantly enhance the ability to mine the spatial correlation of pixels, accurately predict pixel values, improve coding efficiency and reduce prediction errors. By reasonably setting quantization parameters and probability intervals and coding in line with the data distribution law, the coding efficiency is effectively improved, and the transmission bandwidth and cost are reduced. In terms of network state adaptation, the frame rate and resolution can be reduced in a timely manner when the network is congested to avoid stuttering, and the frame rate and resolution can be increased when the bandwidth is sufficient to make full use of resources. Finally, through the adaptive adjustment of the coding unit set based on the frame rate, entropy coding, and resolution, a video coding adapted to the network conditions is generated, realizing the efficient utilization of network bandwidth and flexibly adapting to changes in the dynamic network environment. The entire coding process can flexibly adjust coding parameters according to the network bandwidth status, no longer limited to a fixed bit rate, can better adapt to various changes in the dynamic network environment, and can make reasonable coding adjustments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0019] Figure 1 is the first flowchart of an adaptive video coding method provided by an embodiment of the present invention;
[0020] Figure 2 is the second flowchart of an adaptive video coding method provided by an embodiment of the present invention;
[0021] Figure 3 is the third flowchart of an adaptive video coding method provided by an embodiment of the present invention;
[0022] Figure 4 is the fourth flowchart of an adaptive video coding method provided by an embodiment of the present invention;
[0023] Figure 5 is the fifth flowchart of an adaptive video coding method provided by an embodiment of the present invention;
[0024] Figure 6 is the sixth flowchart of an adaptive video coding method provided by an embodiment of the present invention;
[0025] Figure 7 is the seventh flowchart of an adaptive video coding method provided by an embodiment of the present invention;
[0026] Figure 8 is a schematic structural diagram of an adaptive video coding device provided by an embodiment of the present invention;
[0027] Figure 9 This is a schematic structural diagram of an adaptive video coding device provided by an embodiment of the present invention. Detailed implementation manners
[0028] Next, the technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0029] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order different from that shown or described herein. In addition, the terms "comprising" or "having" and any variation thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] For ease of understanding, the specific process of the embodiment of the present invention will be described below. Please refer to Figure 1 , an embodiment of an adaptive video coding method in an embodiment of the present invention, includes:
[0031] 101. Obtain a video frame sequence and perform a segmentation operation on the video frame sequence to obtain a set of coding units;
[0032] In this embodiment, the quadtree recursive segmentation method, graph cut algorithm, and mean shift method can be used to perform a segmentation operation on the video frame sequence. The coding units can be dynamically and accurately divided according to the complexity of the video content. The quadtree recursive segmentation flexibly adapts to different regional details, the graph cut algorithm optimizes the energy function to achieve optimal segmentation, and the mean shift is based on density clustering to process non-uniform content, effectively reducing redundancy, reducing the computational complexity, improving the coding efficiency and video quality, and laying a solid foundation for the subsequent adaptive adjustment of coding parameters; when the quadtree recursive segmentation method is used to perform a segmentation operation on the video frame sequence, the size range of the obtained coding units (CUs) is in the interval of 64×64 to 8×8 pixels;
[0033] 102. Predict the set of coding units according to a preset prediction mode to obtain a prediction error;
[0034] In this embodiment, the prediction mode used is a deeply optimized and improved intra-frame prediction mode. This mode effectively improves the ability to mine the spatial correlation of pixels within the current frame by adjusting the algorithm and optimizing the parameters of the traditional intra-frame prediction mode. It can more accurately use the information of the reference coded pixel block to predict the pixel value of the current coding unit, thereby showing significant advantages in improving coding efficiency and reducing prediction error.
[0035] 103. Perform binary coding calculation according to the prediction error, a preset quantization parameter, and a preset probability interval to obtain entropy coding;
[0036] In this embodiment, the quantization parameter determines the degree of precision of data quantization, affecting the data compression ratio and reconstruction quality. Entropy coding is a lossless coding method. Binary encoding of quantization coefficients within this probability interval can make the encoding process more consistent with data distribution patterns. For example, for quantization coefficients in high-frequency parts of a video, codewords can be reasonably allocated using the probability interval. Quantization coefficients with a high probability of occurring can obtain shorter codewords, thereby reducing the overall code length, effectively improving coding efficiency, reducing the bandwidth required for video transmission, and reducing transmission costs.
[0037] 104. Obtain real-time link status information and historical network traffic data;
[0038] 105. Evaluate the network bandwidth status based on the link status information and historical network traffic data;
[0039] 106. Calculate the frame rate and resolution based on the network bandwidth status and a preset gradient information evaluation formula;
[0040] In this embodiment, when network congestion and bandwidth reduction occur, the frame rate and resolution can be dynamically reduced in a timely manner based on the network bandwidth status and a preset gradient information evaluation formula. This reduces the amount of video data during the adaptive adjustment of the coding unit set, avoiding lag caused by data exceeding the network carrying capacity, and significantly improving the user viewing experience. When network bandwidth is sufficient, the network bandwidth status evaluation results can be used to increase the frame rate and resolution, making full use of excess bandwidth resources.
[0041] 107. Adaptively adjust the coding unit set according to the frame rate, entropy coding, and resolution to obtain a coded video;
[0042] In this embodiment, by adaptively adjusting the coding unit set based on frame rate, entropy coding, and resolution, a video encoding that better meets network conditions is generated, bandwidth waste is avoided, and network bandwidth is efficiently utilized;
[0043] In this embodiment, in the segmentation stage, the coding units can be dynamically and accurately divided according to the complexity of the video content, adapting to the details of different regions, reducing redundancy and lowering the computational complexity, laying a good foundation for subsequent coding; in the prediction link, a deeply optimized intra-frame prediction mode is adopted, significantly enhancing the ability to mine the spatial correlation of pixels, accurately predicting pixel values, improving the coding efficiency and reducing the prediction error; by reasonably setting the quantization parameters and probability intervals, coding in line with the data distribution law effectively improves the coding efficiency, reduces the transmission bandwidth and cost; in terms of network state adaptation, when the network is congested, the frame rate and resolution can be timely reduced to avoid jamming; when the bandwidth is sufficient, the frame rate and resolution are increased to make full use of resources; finally, through the adaptive adjustment of the coding unit set based on the frame rate, entropy coding and resolution, a video coding adapted to the network conditions is generated, realizing the efficient utilization of network bandwidth and flexibly adapting to the changes in the dynamic network environment; the entire coding process can flexibly adjust the coding parameters according to the network bandwidth state, no longer limited to a fixed bit rate, and can better adapt to various changes in the dynamic network environment and make reasonable coding adjustments.
[0044] Please refer to Figure 2 , the second embodiment of an adaptive video coding method in the embodiments of the present invention, includes:
[0045] 201. Obtain all reference pixels from the video frame sequence to obtain a reference pixel set;
[0046] In this embodiment, the reference pixel set usually comes from the already encoded part within the current frame, which provides basic data for subsequent motion estimation and prediction operations;
[0047] 202. Perform a matching operation on the coding unit set and the reference pixel set through a motion estimation method to obtain a set of matching blocks and a mapping relationship;
[0048] In this embodiment, each coding unit contains a certain number of pixels. Motion estimation searches for blocks similar to the coding unit in the reference pixel set, calculates the similarity metrics between them (such as the sum of absolute differences SAD, mean square error MSE, etc.), finds the blocks with the highest similarity, and these blocks form the set of matching blocks. At the same time, a mapping relationship is established between the coding unit and its corresponding matching block, that is, the position information of the matching block of each coding unit in the reference pixel set is recorded;
[0049] 203. Calculate the motion vectors based on the set of matching blocks and the mapping relationship;
[0050] In this embodiment, the motion vectors reflect the motion of objects in the video. For consecutive video frames, if an object moves, then the position of its corresponding coding unit will change between different frames, and the motion vectors reflect this change;
[0051] 204. Calculate the pixel range based on the reference pixel set;
[0052] In this embodiment, during the quantization process, it is necessary to determine the quantization step according to the pixel range to ensure that the quantized result can effectively compress the data and retain as much important information of the video as possible. During the prediction process, the pixel range can also be used to limit and adjust the predicted value to keep it within a reasonable range. The process of determining the pixel range includes: setting two variables, one for recording the minimum pixel value (the initial value can be set to a relatively large number, such as 255), and the other for recording the maximum pixel value (the initial value can be set to a relatively small number, such as 0); during the process of traversing the pixel set, for each pixel value, if it is less than the currently recorded minimum pixel value, update the minimum pixel value to this pixel value; if it is greater than the currently recorded maximum pixel value, update the maximum pixel value to this pixel value. After traversing the reference pixel set, the obtained minimum pixel value and maximum pixel value define the pixel range of this reference pixel set. For example, if the minimum pixel value is 30 and the maximum pixel value is 180, then the pixel range is [30, 180];
[0053] 205. Obtain the weight coefficient of the prediction mode, and predict the coding unit set according to the weight coefficient, pixel range, motion vector, and the preset coordinate system to obtain the prediction error;
[0054] In this embodiment, by obtaining the weight coefficient and combining the pixel range, motion vector, and the preset coordinate system for prediction, the characteristics of the video content and the spatial relationship can be accurately considered. Using the formula to calculate the prediction error can fully exploit the redundant information between coding units and effectively improve the coding efficiency. In practical applications, it can reduce the amount of video data transmission, relieve the network bandwidth pressure, ensure smooth video playback, and maintain good image quality in different network environments, greatly improving the user viewing experience. The prediction error can be calculated by the following formula:
[0055] E(x, y) = P(x, y) - P pred (x, y),
[0056]
[0057] In the formula, E(x, y) is the prediction error, P ref (x + i, y + j) is the motion vector obtained after mapping and calculating the pixel reference value, w ijis the weight coefficient of the prediction mode, n is the width dimension of the preset reference pixel block, m is the height dimension of the preset reference pixel block, P(x, y) is the pixel value of the coding unit, i is the first loop variable, j is the second loop variable, x represents the coordinate position of the current pixel to be predicted in the horizontal direction (column direction) of the image, y represents the coordinate position of the current pixel to be predicted in the vertical direction (row direction) of the image, (the specific value ranges of x and y are determined by the pixel range and mapped to the coordinate system), P pred (x, y) is the current predicted pixel value;
[0058] In this embodiment, starting from obtaining the reference pixel set, which is derived from the already encoded part of the current intra-frame of the coding unit, it provides a solid data foundation for subsequent motion estimation and prediction operations; by constructing the matching block set and mapping relationship, it creates conditions for calculating the motion vector, thereby reflecting the motion changes of objects in the video; based on the pixel range calculated from the reference pixel set, it is of great significance in the quantization and prediction links. It not only helps to determine a reasonable quantization step to achieve the balance between data compression and information retention, but also standardizes the range of predicted values to keep them within a reasonable interval; by obtaining the weight coefficient and combining the pixel range, motion vector and preset coordinate system to predict the coding unit set, it can deeply mine the redundant information between coding units, thereby improving the coding efficiency. In the actual application scenario, this method can effectively reduce the video data transmission volume, relieve the network bandwidth pressure, ensure smooth video playback, and at the same time maintain high image quality, comprehensively improving the user viewing experience and enhancing the adaptability and stability of the video coding system.
[0059] Please refer to Figure 3 , the third embodiment of an adaptive video coding method in the embodiment of the present invention, includes:
[0060] 301. Calculate the optional paths according to the link state information and the preset network topology structure;
[0061] In this embodiment, the link state information covers the bandwidth, delay, etc. of each link in the network, and the preset network topology structure describes the connection mode of nodes and links in the network. By comprehensively considering this information, all possible paths from the source node to the target node can be found, providing a basis for subsequent path screening;
[0062] 302. Obtain the network traffic characteristic data, and predict the network traffic characteristic data based on the preset neural network model to obtain the traffic state;
[0063] In this embodiment, the network traffic feature data includes: packet size, sending rate, receiving rate, and delay feature. These data reflect the current operating condition of the network. The neural network model is trained with a large amount of historical network traffic data. During the training process, the parameters of the model are continuously adjusted through the backpropagation algorithm to minimize the loss function. By continuously adjusting the parameters through backpropagation, the neural network model can better fit the characteristics of historical network traffic data, making the predicted value closer to the real situation, reducing misjudgment, and providing a reliable basis for route selection; the traffic status includes normal traffic status and traffic congestion status;
[0064] 303. Obtain historical network traffic data, and screen the alternative paths based on a preset route selection function and the historical network traffic data to obtain the optimal path;
[0065] In this embodiment, the network topology structure is represented by a graph G=(V, E), where V is the set of nodes of the alternative paths, E is the set of edges. The route selection function starts from the source node s of the alternative paths, maintains a distance set d. Initially, d[s]=0. For other nodes v∈V\{s}, d[v]=∞. In each iteration calculation process of the route selection function, according to the historical network traffic data, select the node u with the smallest distance and whose shortest path has not been determined, and update the distance of its adjacent node v until the shortest paths of all nodes are determined to obtain the optimal path;
[0066] 304. Evaluate the network broadband status based on the optimal path, alternative paths, and traffic status;
[0067] In this embodiment, the optimal path represents the best transmission path considering the historical network traffic data, the alternative paths provide more transmission possibilities, and the traffic status reflects the current congestion degree of the network. By integrating these three factors, the broadband status of the network can be evaluated more accurately;
[0068] In this embodiment, in terms of path planning, calculate all alternative paths to provide a reference basis for the selection of the optimal path; in terms of traffic status prediction, use network traffic data covering packet size, sending and receiving rates, and delay features, and analyze through a neural network model trained with a large amount of historical data to make the predicted value of the traffic status highly close to the real situation and effectively reduce misjudgment; in the path screening link, based on the historical network traffic data and the preset route selection function, determine the optimal path from the alternative paths. This process continuously optimizes the distance set through iterative calculation to ensure the efficiency of the selected path; finally, integrate the optimal path, alternative paths, and traffic status to evaluate the network broadband status, and can comprehensively and accurately grasp the actual situation of the network.
[0069] Please refer to Figure 4, the fourth embodiment of an adaptive video coding method in an embodiment of the present invention, includes:
[0070] 401. Perform a discrete cosine transform on the prediction error to obtain low-frequency transform coefficients and high-frequency transform coefficients;
[0071] In this embodiment, the discrete cosine transform can more effectively remove the spatial redundancy in the data when processing small blocks of data, converting the prediction error signal in the spatial domain to the frequency domain; the low-frequency transform coefficients mainly reflect the general outline and slowly changing parts of the image, while the high-frequency transform coefficients correspond to the details and edge information in the image. In most video scenarios, the low-frequency part of the image contains the main energy, while the high-frequency part has relatively low energy and less impact on vision. The discrete cosine transform redistributes the prediction error data, making most of the energy concentrated on a few low-frequency coefficients, facilitating subsequent compression processing;
[0072] 402. Quantize the low-frequency transform coefficients and high-frequency transform coefficients according to the quantization parameter to obtain quantization coefficients and quantization step sizes;
[0073] In this embodiment, the quantization process rounds the transform coefficients through the quantization parameter to further reduce the data volume. Through quantization, the storage space and transmission bandwidth requirements of the data are significantly reduced, while the data processing efficiency is improved; the quantization parameter determines the quantization step size, and there is a specific functional relationship between the two. The quantization step size usually increases as the value of the quantization parameter increases; in the H.264 coding standard, the quantization step size can be obtained by looking up a pre-defined quantization table; adjusting the quantization parameter allows finding the best balance between compression efficiency and data quality;
[0074] 402. Adjust the probability interval according to the quantization coefficients and quantization step sizes to obtain an optimized interval;
[0075] In this embodiment, during the encoding process, the encoder maintains a probability interval, which is initially (0, 1). The initial probability interval can be optimized according to the quantization coefficients and quantization step sizes, making the encoding process more conform to the data distribution law;
[0076] 403. Perform binary coding calculation on the quantization coefficients based on the optimized interval to obtain entropy coding;
[0077] In this embodiment, to further improve the coding efficiency, binary arithmetic coding can be adopted. For the binary symbols of the quantized coefficients to be coded, the probability of the occurrence of each symbol is obtained from a pre-trained probability model; symbols with a high occurrence probability are represented by shorter codes, and symbols with a low occurrence probability are represented by longer codes. In this way, the quantized coefficients are efficiently coded to generate the final entropy coding with statistical characteristics, thereby achieving further compression of the data and greatly improving the efficiency of data coding.
[0078] In this embodiment, to further enhance the coding efficiency, binary arithmetic coding is selected; when coding the binary symbols of the quantized coefficients, first, the probability of the occurrence of each symbol is obtained from a pre-trained probability model. Based on the probability distribution characteristics, symbols with a high occurrence probability are represented by shorter codes, while symbols with a low occurrence probability are represented by longer codes. By this way of allocating the coding length according to the probability, efficient coding of the quantized coefficients can be achieved, and then the final entropy coding is generated; the outstanding advantage of the entropy coding is that it can adapt to the statistical characteristics of the data, thereby achieving further compression of the data and greatly improving the efficiency of data coding.
[0079] Please refer to Figure 5 , the fifth embodiment of an adaptive video coding method in the embodiments of the present invention, includes:
[0080] 501. Obtain a color video frame from the video frame sequence to obtain a color frame data set;
[0081] 502. Convert the color frame data set into a grayscale frame data set;
[0082] In this embodiment, a preset conversion formula can be used to convert the color frame data set into a grayscale frame data set, which is the basis for subsequent processing and reduces the data complexity. The conversion formula is:
[0083] Gray = 0.299R + 0.587G + 0.114B, where R, G, and B are the red component, green component, and blue component of the color data respectively;
[0084] 503. Obtain the central point pixel coordinates in the grayscale frame data set, and perform noise reduction processing on the grayscale frame data set based on a preset Gaussian function and the central point pixel coordinates to obtain a noise reduction data set;
[0085] In this embodiment, the Gaussian function and the central point pixel coordinates are used to remove the noise interference in the Gaussian function and the central point pixel coordinates, so as to improve the accuracy of subsequent gradient calculation; noise reduction is achieved by performing weighted averaging on each pixel point and its neighboring pixel points in the grayscale frame dataset through the Gaussian function, providing purer data for subsequent gradient calculation and enhancing the accuracy of gradient calculation, and the weights are determined by the Gaussian function; while the central point pixel coordinates are the core positioning reference for the noise reduction operation, and based on this coordinate, the positions of its surrounding neighboring pixels are determined, and then the relationship between the neighboring pixels and the central point pixel is calculated;
[0086] 504. Perform gradient calculation on the noise-reduced dataset based on the preset Sobel algorithm to obtain a horizontal gradient set and a vertical gradient set;
[0087] In this embodiment, the Sobel algorithm is a discrete first-order difference operator, which obtains gradient information by calculating the gray-scale change rate of pixel points in the horizontal and vertical directions in the noise-reduced dataset, and these gradient information reflect the direction and intensity of the object edges and details in the noise-reduced dataset;
[0088] 505. Calculate a gradient magnitude set and a gradient direction set based on the horizontal gradient set and the vertical gradient set;
[0089] In this embodiment, the gradient magnitude G(x, y) and the gradient direction θ(x, y) of each pixel point are calculated according to the horizontal gradient set and the vertical gradient set, providing detailed data support for subsequent evaluation of the video content complexity based on gradient information. The expression of the gradient magnitude calculation formula is as follows:
[0090] In the formula, x is the horizontal coordinate of the pixel point, y is the vertical coordinate of the pixel point, G x is the horizontal gradient, G y is the vertical gradient;
[0091] The expression of the calculation formula for the gradient direction is as follows:
[0092] In the formula, the return value range of the arctan function is
[0093] 506. Evaluate the gradient magnitude set and the gradient direction set based on the gradient information evaluation formula to obtain a gradient information evaluation value;
[0094] In this embodiment, the gradient information evaluation value comprehensively reflects the content complexity of the video frame;
[0095] 507. Calculate the frame rate and resolution based on the gradient information evaluation value and the network bandwidth status;
[0096] In this embodiment, when the bandwidth is sufficient, by combining the high-gradient information evaluation value, the frame rate and resolution can be increased, enabling users to see clear, smooth, and detailed video images; when the bandwidth is insufficient, the frame rate and resolution are decreased to prioritize smooth video playback, avoid stuttering, and maintain a basic viewing experience.
[0097] In this embodiment, a color frame is obtained from the video frame sequence to construct a dataset, and then the dataset is converted into a grayscale frame dataset, significantly reducing the data complexity and laying a solid foundation for subsequent processing. The grayscale frame is denoised using a Gaussian function combined with the central pixel coordinates. The neighborhood pixel positions are determined based on the center point, and the noise is removed through weighted averaging to provide pure data for gradient calculation and improve the calculation accuracy. Then, the Sobel algorithm is used to calculate the horizontal and vertical gradients to obtain the direction and intensity information of the object edges and details, and then the gradient magnitude set and gradient direction set are calculated to provide detailed data for evaluating the video content complexity. According to the gradient information evaluation formula, the gradient information evaluation value is obtained, which comprehensively reflects the complexity of the video frame. Finally, in combination with the network bandwidth status, when the bandwidth is sufficient and the gradient information evaluation value is high, the frame rate and resolution are increased to present a clear, smooth, and detailed image; when the bandwidth is insufficient, the frame rate and resolution are decreased to prioritize smooth playback, avoid stuttering, and comprehensively enhance the user viewing experience and the adaptability of the video under different network conditions.
[0098] Please refer to Figure 6 , the sixth embodiment of an adaptive video encoding method in the embodiments of the present invention, includes:
[0099] 601. Analyze the network bandwidth status according to a preset first broadband threshold and a preset second broadband threshold to obtain an analysis result;
[0100] In this embodiment, the first broadband threshold and the second broadband threshold are set according to a large amount of network test data and the acceptable degree of video smoothness and quality in the actual application scenario. For example, in a mobile network environment, considering factors such as signal strength and base station load, the first broadband threshold is set to 1 Mbps and the second broadband threshold is set to 5 Mbps. By comparing the current network bandwidth with these two thresholds, the bandwidth interval where the network is located can be determined, providing a basis for subsequent decisions;
[0101] 602. When the analysis result is that the network broadband status is less than or equal to the first broadband threshold, calculate the frame rate according to a preset first frame rate calculation formula and the gradient information evaluation value;
[0102] In this embodiment, the first frame rate calculation formula includes a bandwidth adjustment coefficient and a gradient adjustment coefficient related to the gradient information evaluation value. The bandwidth adjustment coefficient has a larger value in the case of low bandwidth, and the gradient adjustment coefficient is dynamically adjusted according to the gradient information evaluation value, avoiding network congestion caused by excessive pursuit of high frame rate or high resolution and improving the overall utilization efficiency of network resources.
[0103] 603. When the analysis result shows that the network broadband state is greater than the first broadband threshold and less than or equal to the second broadband threshold, calculate the frame rate according to the preset second frame rate calculation formula and the gradient information evaluation value.
[0104] In this embodiment, it is similar to the low bandwidth case, but due to relatively abundant bandwidth, the values of the bandwidth adjustment coefficient and the gradient adjustment coefficient are different. When the bandwidth is sufficient, make full use of the bandwidth to improve the video quality and the overall utilization efficiency of network resources.
[0105] 604. Calculate the resolution according to the frame rate and the network broadband state.
[0106] In this embodiment, when the frame rate has been determined, if there is still remaining space in the network bandwidth, the resolution can be appropriately increased to improve the video clarity; if the bandwidth is tight, the resolution is further reduced to ensure smooth video playback.
[0107] In another embodiment, a three-dimensional mapping table of bandwidth-frame rate-resolution can be established, and the corresponding recommended resolution can be found in the table according to the current frame rate and network bandwidth.
[0108] In this embodiment, by setting the first broadband threshold and the second broadband threshold, accurately analyze the network bandwidth state, provide a basis for video parameter adjustment, and determine the frame rate according to the bandwidth interval by using the frame rate calculation formula combined with the gradient information evaluation value. In the case of low bandwidth, reasonably adjust the coefficient to avoid network congestion and ensure smooth video. In the case of medium and high bandwidth, adjust the coefficient according to the abundant bandwidth, taking into account both smoothness and quality. After determining the frame rate, flexibly adjust the resolution according to the network bandwidth state. If there is remaining bandwidth, increase the clarity; if the bandwidth is tight, ensure smoothness. It can dynamically adapt the video frame rate and resolution under various network conditions, significantly improve the viewing experience, avoid stuttering and blurring, and at the same time, efficiently utilize network resources and reasonably allocate resources under different bandwidths. It also enhances the video coding adaptability, adapts to various video contents and application scenarios, such as online playback, video conferencing, etc., and improves the overall performance.
[0109] Please refer to Figure 7 , the seventh embodiment of an adaptive video coding method in the embodiments of the present invention, includes:
[0110] 701. Divide the coding unit set according to the preset video coding standard to obtain a first coding set and a second coding set.
[0111] In this embodiment, the video coding standard stipulates the basic coding rules, syntax structures, etc. The first coding set usually contains coding units with relatively high complexity or intense motion in the video. These coding units have rich picture details and a large variance of pixel values, indicating a high degree of dispersion of pixel values and a high richness of picture details, and a relatively complex distribution of motion vectors. The second coding set mainly contains coding units that are relatively simple or static in the video. The picture content thereof changes less, and the variance of pixel values is smaller, meaning that the pixel values are relatively concentrated and the richness of picture details is low. The distribution of motion vectors is relatively concentrated, indicating that the object motion is not obvious and the content is relatively static.
[0112] 702. Calculate the features of the first coding set and the second coding set respectively to obtain a first feature parameter and a second feature parameter.
[0113] In this embodiment, feature calculations such as the variance of pixel values (reflecting the dispersion degree of pixel values and embodying the richness of picture details), the distribution of motion vectors (measuring the object motion situation), etc. are performed to obtain a first feature parameter and a second feature parameter. These feature parameters can reflect the characteristics of the video content within each coding set. By dividing the coding unit set and calculating the features respectively, adaptive adjustment is carried out targeted, avoiding the waste of resources caused by adopting a unified coding strategy for all video content, giving more coding resources to complex content, reducing resource occupancy for simple content, improving the coding efficiency, and reducing the bit rate requirement.
[0114] 703. Perform adaptive adjustment on the first coding set according to the frame rate, entropy coding, resolution, and the first feature parameter to obtain a first optimized coding set.
[0115] 704. Perform adaptive adjustment on the second coding set according to the frame rate, entropy coding, resolution, and the second feature parameter to obtain a second optimized coding set.
[0116] In this embodiment, if the feature parameters of the first coding set show that the picture motion is intense and the frame rate is high and the resolution is high, the coding bit number is appropriately increased to ensure the clarity and smoothness of the motion picture. For the second coding set, if the feature parameters indicate that the content is relatively static, the coding bit number can be reduced on the premise of ensuring the basic quality to save the bit rate. Adjustment is made according to the features of different coding sets and factors such as the frame rate and resolution, making the motion picture smoother, the details clearer, and the static picture can also ensure the basic quality, overall improving the video viewing experience. When the frame rate and resolution change, and in the face of video content with different complexities, the coding strategy can be flexibly adjusted, enhancing the adaptability of the video coding system to various scenarios.
[0117] 705. Generate a video coding according to the first optimized coding set and the second optimized coding set.
[0118] In this embodiment, the coding unit set is divided according to the preset video coding standard, providing a reliable basis for the division. Then, characteristic parameters are calculated for the two coding sets respectively, such as the variance of pixel values and the distribution of motion vectors, so as to accurately grasp the characteristics of the video content within each coding set. On this basis, combined with the frame rate, entropy coding, and resolution, the coding sets are adaptively adjusted according to the characteristic parameters. For the coding set with intense motion, high frame rate, and large resolution, the coding bit number can be increased to ensure clear and smooth pictures. For the relatively static coding set, the coding bit number can be reduced to save the bit rate. Finally, the coding sets are integrated and optimized to generate video coding. The entire process effectively improves the coding efficiency, avoids resource waste, and reduces the bit rate requirement; comprehensively improves the video quality, enabling different content pictures to be presented in high quality; enhances the system adaptability, being able to calmly handle changes in frame rate, resolution, and diverse and complex video content, and significantly improving the video coding performance.
[0119] The above described an adaptive video coding method in an embodiment of the present invention. Next, an adaptive video coding device in an embodiment of the present invention will be described. Please refer to Figure 8 , an embodiment of an adaptive video coding device in an embodiment of the present invention, includes:
[0120] The segmentation operation module 1 is used to obtain the video frame sequence and perform segmentation operations on the video frame sequence to obtain the coding unit set;
[0121] The error prediction module 2 is used to predict the coding unit set according to the preset prediction mode to obtain the prediction error;
[0122] The entropy coding calculation module 3 is used to perform binary coding calculations according to the prediction error, the preset quantization parameter, and the preset probability interval to obtain the entropy coding;
[0123] The data acquisition module 4 is used to acquire real-time link state information and historical network traffic data;
[0124] The state evaluation module 5 evaluates the network broadband state based on the link state information and historical network traffic data;
[0125] The parameter calculation module 6 is used to calculate the frame rate and resolution according to the network bandwidth state and the preset gradient information evaluation formula;
[0126] The video coding module 7 is used to adaptively adjust the coding unit set according to the frame rate, entropy coding, and resolution to obtain the coded video;
[0127] In this embodiment, in the segmentation stage, the coding units can be dynamically and accurately divided according to the complexity of the video content, adapting to the details of different regions, reducing redundancy and lowering the computational complexity, laying a good foundation for subsequent coding. In the prediction process, a deeply optimized intra-frame prediction mode is adopted to significantly enhance the ability to explore the spatial correlation of pixels, accurately predict pixel values, improve the coding efficiency and reduce the prediction error. By reasonably setting the quantization parameters and probability intervals, coding in line with the data distribution law effectively improves the coding efficiency, reduces the transmission bandwidth and cost. In terms of network state adaptation, when the network is congested, the frame rate and resolution can be reduced in a timely manner to avoid jamming. When the bandwidth is sufficient, the frame rate and resolution are increased to make full use of resources. Finally, through the adaptive adjustment of the coding unit set based on the frame rate, entropy coding and resolution, a video coding adapted to the network conditions is generated, realizing the efficient utilization of network bandwidth and flexibly adapting to the changes in the dynamic network environment. The entire coding process can flexibly adjust the coding parameters according to the network bandwidth status, no longer limited to a fixed bit rate, and can better adapt to various changes in the dynamic network environment and make reasonable coding adjustments.
[0128] Figure 9 FIG. 4 is a schematic structural diagram of an adaptive video coding device provided by an embodiment of the present invention. The adaptive video coding device 900 may vary greatly due to configuration or performance differences, and may include one or more processors (central processing units, CPUs) 913 (for example, one or more processors) and a memory 920, and one or more storage media 930 (for example, one or more mass storage devices) for storing application programs 933 or data 932. Among them, the memory 920 and the storage media 930 may be transient storage or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on an adaptive video coding device 900. Further, the processor 913 may be configured to communicate with the storage media 930 and execute a series of instruction operations in the storage media 930 on an adaptive video coding device 900 to implement the steps of an adaptive video coding method provided by each of the above method embodiments.
[0129] An adaptive video coding device 900 may further include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input / output interfaces 960, and / or one or more operating systems 931, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art can understand, Figure 9The shown structure of an adaptive video coding device does not constitute a limitation on an adaptive video coding device 900, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0130] A computer-readable storage medium having instructions stored thereon, which when executed by a processor implement the respective steps of an adaptive video coding method as described in any one of the above.
[0131] The present invention and its embodiments have been described above. Such description is not restrictive. What is shown in the drawings is only one of the embodiments of the present invention, and the actual content is not limited thereto. In general, if those of ordinary skill in the art are inspired by it and, without departing from the spirit of the present invention, design similar structural modes and embodiments to the technical solution without creative efforts, they shall fall within the protection scope of the present invention.
Claims
1. An adaptive video coding method, characterized in that, Including: Obtain a sequence of video frames and perform a segmentation operation on the sequence of video frames to obtain a set of coding units; Perform prediction on the set of coding units according to a preset prediction mode to obtain a prediction error; Perform binary coding calculation according to the prediction error, a preset quantization parameter, and a preset probability interval to obtain entropy coding; Obtain real-time link state information and historical network traffic data; Evaluate the network broadband state based on the link state information and the historical network traffic data; Calculate the frame rate and resolution according to the network bandwidth state and a preset gradient information evaluation formula; Perform adaptive adjustment on the set of coding units according to the frame rate, the entropy coding, and the resolution to obtain video coding.
2. The adaptive video encoding method according to claim 1, characterized in that, The performing prediction on the set of coding units according to a preset prediction mode to obtain a prediction error includes: Obtain all reference pixels from the sequence of video frames to obtain a set of reference pixels; Perform a matching operation on the set of coding units and the set of reference pixels through a motion estimation method to obtain a set of matching blocks and a mapping relationship; Calculate a motion vector according to the set of matching blocks and the mapping relationship; Calculate a pixel range according to the set of reference pixels; Obtain a weight coefficient of the prediction mode, and perform prediction on the set of coding units according to the weight coefficient, the pixel range, the motion vector, and a preset coordinate system to obtain a prediction error.
3. An adaptive video coding method according to claim 1, characterized in that, The evaluating the network broadband state based on the link state information and the historical network traffic data includes: Calculate an alternative path according to the link state information and a preset network topology structure; Obtain network traffic feature data, and perform prediction on the network traffic feature data based on a preset neural network model to obtain a traffic state; Obtain historical network traffic data, and screen the alternative path based on a preset routing selection function and the historical network traffic data to obtain an optimal path; Evaluate the network broadband state according to the optimal path, the alternative path, and the traffic state.
4. The adaptive video coding method according to claim 1, wherein, The performing binary coding calculation according to the prediction error, a preset quantization parameter, and a preset probability interval to obtain entropy coding includes: Perform a discrete cosine transform on the prediction error to obtain a low-frequency transform coefficient and a high-frequency transform coefficient; Quantize the low-frequency transform coefficient and the high-frequency transform coefficient according to the quantization parameter to obtain a quantization coefficient and a quantization step; Adjust the probability interval according to the quantization coefficient and the quantization step to obtain an optimized interval; Perform binary coding calculation on the quantization coefficient based on the optimized interval to obtain entropy coding.
5. The adaptive video coding method according to claim 1, wherein The calculating the frame rate and resolution according to the network bandwidth state and a preset gradient information evaluation formula includes: Obtain color video frames from the sequence of video frames to obtain a set of color frames; Convert the set of color frames into a set of grayscale frames; Obtain the central point pixel coordinates in the set of grayscale frames, and perform noise reduction processing on the set of grayscale frames based on a preset Gaussian function and the central point pixel coordinates to obtain a noise reduction data set; Perform gradient calculation on the noise reduction data set based on a preset Sobel algorithm to obtain a set of horizontal gradients and a set of vertical gradients; Calculate a set of gradient magnitudes and a set of gradient directions according to the set of horizontal gradients and the set of vertical gradients; Evaluate the set of gradient magnitudes and the set of gradient directions based on the gradient information evaluation formula to obtain a gradient information evaluation value; The frame rate and resolution are calculated based on the gradient information evaluation value and the network bandwidth status.
6. An adaptive video coding method according to claim 5, characterized in that, The calculation of the frame rate and resolution according to the gradient information evaluation value, the network bandwidth status, the preset first broadband threshold, and the preset second broadband threshold includes: Analyze the network bandwidth status according to the preset first broadband threshold and the preset second broadband threshold to obtain an analysis result; When the analysis result is that the network broadband status is less than or equal to the first broadband threshold, calculate the frame rate according to the preset first frame rate calculation formula and the gradient information evaluation value; When the analysis result is that the network broadband status is greater than the first broadband threshold and less than or equal to the second broadband threshold, calculate the frame rate according to the preset second frame rate calculation formula and the gradient information evaluation value; Calculate the resolution according to the frame rate and the network bandwidth status.
7. An adaptive video coding method according to claim 1, wherein The adaptive adjustment of the coding unit set according to the frame rate, entropy coding, and resolution to obtain video coding includes: Divide the coding unit set according to the preset video coding standard to obtain a first coding set and a second coding set; Calculate the characteristics of the first coding set and the second coding set respectively to obtain a first characteristic parameter and a second characteristic parameter; Adaptive adjustment of the first coding set according to the frame rate, entropy coding, resolution, and the first characteristic parameter to obtain a first optimized coding set; Adaptive adjustment of the second coding set according to the frame rate, entropy coding, resolution, and the second characteristic parameter to obtain a second optimized coding set; Generate video coding according to the first optimized coding set and the second optimized coding set.
8. An adaptive video encoding device, characterized in that, Including: A segmentation operation module, configured to obtain a video frame sequence and perform a segmentation operation on the video frame sequence to obtain a coding unit set; An error prediction module, configured to predict the coding unit set according to a preset prediction mode to obtain a prediction error; An entropy coding calculation module, configured to perform binary coding calculation according to the prediction error, a preset quantization parameter, and a preset probability interval to obtain entropy coding; A data acquisition module, configured to acquire real-time link state information and historical network traffic data; A status evaluation module, which evaluates the network broadband status according to the link state information and the historical network traffic data; A parameter calculation module, configured to calculate the frame rate and resolution according to the network bandwidth status and a preset gradient information evaluation formula; A video coding module, configured to adaptively adjust the coding unit set according to the frame rate, entropy coding, and resolution to obtain coded video.
9. An adaptive video coding device, characterized in that, Including: A memory and at least one processor, wherein instructions are stored in the memory; At least one of the processors calls the instructions in the memory so that an adaptive video coding method executes each step of an adaptive video coding method as described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that, When the instructions are executed by the processor, each step of an adaptive video coding method as described in any one of claims 1-7 is implemented.
Citation Information
Patent Citations
Multi-network hybrid acceleration method and system
CN117914790A
A method and system for resisting weak network for audio and video transmission
CN118101941A
Double-link video transmission method, system and device and storage medium
CN118803303A
High-speed data transmission hub system and data transmission method
CN118869572A
Display method and system of mini-computer host
CN119182968A
Cited By
Visual call information processing method and system based on 5G
CN120980184A
5g-based visual call information processing method and system
CN120980184B