An adaptive video encoding method, apparatus, device and medium
By using an adaptive video coding method, the coding units and parameters are dynamically adjusted, solving the problem that existing video coding schemes cannot adapt to dynamic network environments. This achieves efficient video coding and optimized bandwidth utilization, thereby improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG RONGBO TECH CO LTD
- Filing Date
- 2025-04-23
- Publication Date
- 2026-04-21
AI Technical Summary
Existing video encoding schemes cannot effectively adapt to dynamic network environments, resulting in low network bandwidth utilization and poor user viewing experience, especially with frequent stuttering or resource waste when network bandwidth fluctuates.
By using an adaptive video coding method, the coding unit, frame rate, and resolution are dynamically adjusted. Combined with entropy coding and gradient information evaluation, the video coding parameters are optimized based on the real-time network status, enabling flexible coding adjustments.
It improves the adaptability and efficiency of video encoding, reduces network bandwidth pressure, ensures smooth video playback and optimizes bandwidth utilization, thereby enhancing the user experience.
Smart Images

Figure CN120390089B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video coding technology, and specifically to an adaptive video coding method, apparatus, device, and medium. Background Technology
[0002] In today's digital age, the network environment exhibits continuous and complex dynamic changes, which undoubtedly presents more severe challenges to the field of video coding. Most current video coding schemes adopt a fixed bitrate control strategy, ignoring the fluctuating characteristics of real-time network bandwidth. In actual network transmission, the network state is constantly changing. For example, when network congestion occurs, because the coding parameters cannot be dynamically adjusted according to the decrease in bandwidth, video transmission will frequently experience stuttering, greatly affecting the user's viewing experience. On the other hand, when network bandwidth is sufficient, fixed bitrate control cannot make full use of the excess bandwidth resources, resulting in unnecessary bandwidth waste. This limitation of the fixed bitrate control strategy makes it difficult for current coding schemes to adapt to dynamic network environments. Therefore, there is an urgent need for a scheme that can adaptively perform video coding based on real-time network bandwidth to optimize video transmission quality and bandwidth utilization. Summary of the Invention
[0003] To address the shortcomings of the prior art, this invention proposes an adaptive video coding method.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0005] An adaptive video coding method includes: acquiring a video frame sequence and segmenting the video frame sequence to obtain a coding unit set; predicting the coding unit set according to a preset prediction mode to obtain a prediction error; performing binary coding calculation based on the prediction error, preset quantization parameters, and preset probability intervals to obtain entropy coding; acquiring real-time link status information and historical network traffic data; evaluating the network bandwidth status based on the link status information and historical network traffic data; calculating the frame rate and resolution based on the network bandwidth status and a preset gradient information evaluation formula; and adaptively adjusting the coding unit set based on the frame rate, entropy coding, and resolution to obtain video coding.
[0006] In this embodiment, during the segmentation stage, 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 stage, a deeply optimized intra-frame prediction mode is adopted, which significantly improves the ability to mine the spatial correlation of pixels, accurately predicts pixel values, improves coding efficiency and reduces prediction errors. By reasonably setting quantization parameters and probability intervals, coding is performed in accordance with the data distribution pattern, effectively improving coding efficiency and reducing transmission bandwidth and cost. In terms of network state adaptation, the frame rate and resolution can be reduced in time when the network is congested to avoid stuttering; when the bandwidth is sufficient, the frame rate and resolution can be increased to make full use of resources. Finally, by adaptively adjusting the coding unit set based on frame rate, entropy coding and resolution, video coding adapted to network conditions is generated, realizing efficient use 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, and can better adapt to various changes in the dynamic network environment and make reasonable coding adjustments.
[0007] Further, the step of predicting the coding unit set according to the preset prediction mode to obtain the 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 using a motion estimation method to obtain a matching block set and a mapping relationship; calculating a motion vector based on the matching block set and the mapping relationship; calculating a pixel range based on the reference pixel set; obtaining the weight coefficients of the prediction mode, and predicting the coding unit set according to the weight coefficients, the pixel range, the motion vector, and the preset coordinate system to obtain the prediction error. Starting with a reference pixel set derived from the already encoded portion of the current frame within the coding unit, this method provides a solid data foundation for subsequent motion estimation and prediction operations. By constructing a matching block set and mapping relationship, conditions are created for calculating motion vectors, thereby reflecting changes in object motion in the video. The pixel range calculated based on the reference pixel set is significant in the quantization and prediction stages. It not only helps determine a reasonable quantization step size to achieve a balance between data compression and information preservation but also standardizes the range of predicted values, keeping it within a reasonable range. By obtaining weight coefficients and combining them with pixel ranges, motion vectors, and a preset coordinate system to predict the coding unit set, redundant information between coding units can be deeply mined, thereby improving coding efficiency. In practical applications, this method can effectively reduce video data transmission volume, alleviate network bandwidth pressure, ensure smooth video playback, and maintain high image quality in complex and diverse network environments, comprehensively improving the user viewing experience and enhancing the adaptability and stability of the video coding system.
[0008] Furthermore, the process of evaluating network broadband status based on link status information and historical network traffic data includes: calculating optional paths based on link status information and a preset network topology; acquiring network traffic characteristic data and predicting the network traffic characteristic data based on a preset neural network model to obtain traffic status; acquiring historical network traffic data and filtering optional paths based on a preset routing function and historical network traffic data to obtain the optimal path; and evaluating network broadband status based on the optimal path, optional paths, and traffic status. In path planning, all optional paths are calculated to provide a reference for optimal path selection. In traffic status prediction, network traffic data covering packet size, sending and receiving rates, and latency characteristics are analyzed using a neural network model trained on a large amount of historical data, ensuring that the predicted traffic status highly matches the actual situation and effectively reducing misjudgments. In the path filtering stage, the optimal path is determined from the optional paths based on historical network traffic data and a preset routing function. This process continuously optimizes the distance set through iterative calculations to ensure the efficiency of the selected path. Finally, integrating the optimal path, optional paths, and traffic status to evaluate network broadband status provides a more comprehensive and accurate understanding of the actual network situation.
[0009] Furthermore, the step of performing binary encoding calculation based on the prediction error, preset quantization parameters, and preset probability interval to obtain entropy encoding includes: performing 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 high-frequency transform coefficients according to the quantization parameters to obtain quantization coefficients and quantization step size; adjusting the probability interval according to the quantization coefficients and quantization step size to obtain an optimized interval; and performing binary encoding calculation on the quantization coefficients based on the optimized interval to obtain entropy encoding. To further improve encoding efficiency, binary arithmetic encoding is used. When encoding the binary symbols of the quantization coefficients, the probability of each symbol appearing is first obtained from the pre-trained probability model. Based on the probability distribution characteristics, symbols with high probability of occurrence are represented with shorter codes, while symbols with low probability of occurrence are presented with longer codes. Through this method of allocating code length according to probability, the quantization coefficients can be efficiently encoded, thereby generating the final entropy encoding. The outstanding advantage of entropy encoding is that it can adapt to the statistical characteristics of the data, thereby achieving further data compression and greatly improving the efficiency of data encoding.
[0010] Further, the step of calculating the frame rate and resolution based on the network bandwidth status and a preset gradient information evaluation formula includes: obtaining color video frames from the video frame sequence to obtain a color frame dataset; converting the color frame dataset into a grayscale frame dataset; obtaining the center pixel coordinates in the grayscale frame dataset, and performing noise reduction processing on the grayscale frame dataset based on a preset Gaussian function and the center pixel coordinates to obtain a noise-reduced dataset; performing gradient calculation on the noise-reduced dataset 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 based on 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; and calculating the frame rate and resolution based on the gradient information evaluation value and the network bandwidth status. A dataset is constructed by extracting color frames from a video frame sequence and then converting it into a grayscale frame dataset, significantly reducing data complexity and laying a solid foundation for subsequent processing. Noise reduction of the grayscale frames is achieved using a Gaussian function combined with the center point pixel coordinates. The positions of neighboring pixels are determined based on the center point, and noise is removed through weighted averaging, providing clean data for gradient calculation and improving calculation accuracy. Next, the Sobel algorithm is used to calculate horizontal and vertical gradients, obtaining the direction and intensity information of object edges and details, and then calculating the gradient magnitude set and gradient direction set, providing detailed data for evaluating video content complexity. The gradient information evaluation value is obtained based on the gradient information evaluation formula, which comprehensively reflects the video frame complexity. Finally, considering network bandwidth, when 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 picture; when bandwidth is insufficient, the frame rate and resolution are reduced to prioritize smooth playback and avoid stuttering, comprehensively improving the user viewing experience and enhancing the video's adaptability under different network conditions.
[0011] Further, the step of calculating the frame rate and resolution based on the gradient information evaluation value, network bandwidth status, a preset first bandwidth threshold, and a preset second bandwidth threshold includes: analyzing the network bandwidth status based on the preset first bandwidth threshold and the preset second bandwidth threshold to obtain an analysis result; when the analysis result indicates that the network bandwidth status is less than or equal to the first bandwidth threshold, calculating the frame rate based on the preset first frame rate calculation formula and the gradient information evaluation value; when the analysis result indicates that the network bandwidth status is greater than the first bandwidth threshold and less than or equal to the second bandwidth threshold, calculating the frame rate based on the preset second frame rate calculation formula and the gradient information evaluation value; and calculating the resolution based on the frame rate and the network bandwidth status. By setting a first and second bandwidth threshold, the system accurately analyzes network bandwidth status, providing a basis for adjusting video parameters. Depending on the bandwidth range, the frame rate is determined using a frame rate calculation formula combined with gradient information evaluation values. Under low bandwidth conditions, coefficients are adjusted appropriately to avoid network congestion and ensure smooth video playback. Under medium to high bandwidth conditions, coefficients are adjusted based on available bandwidth, balancing smoothness and quality. After determining the frame rate, the resolution is flexibly adjusted according to network bandwidth status; if bandwidth is available, clarity is increased; if bandwidth is limited, smoothness is maintained. This system dynamically adapts video frame rate and resolution under various network conditions, significantly improving the viewing experience and avoiding stuttering and blurring. Simultaneously, it efficiently utilizes network resources, allocating resources rationally under different bandwidth conditions. It also enhances video encoding adaptability, adapting to various video content and application scenarios, such as online playback and video conferencing, improving overall performance.
[0012] Further, the step of adaptively adjusting the coding unit set according to 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; performing feature calculations on the first coding set and the second coding set respectively to obtain a first feature parameter and a second feature parameter; adaptively adjusting the first coding set according to 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 frame rate, entropy coding, resolution, and the second feature parameter to obtain a second optimized coding set; and generating video coding based on the first optimized coding set and the second optimized coding set. The system divides the encoding unit set according to a preset video encoding standard, providing a reliable basis for the division. Then, feature parameters, such as pixel value variance and motion vector distribution, are calculated for each encoding set to accurately grasp the characteristics of the video content within each set. Based on this, the encoding sets are adaptively adjusted according to the feature parameters, considering frame rate, entropy coding, and resolution. For encoding sets with rapid motion, high frame rate, and high resolution, the number of encoding bits can be increased to ensure clear and smooth images. For relatively static encoding sets, the number of encoding bits can be reduced to save bitrate. Finally, the encoding sets are integrated and optimized to generate video encoding. The entire process effectively improves encoding efficiency, avoids resource waste, and reduces bitrate requirements. It comprehensively improves video quality, ensuring high-quality presentation of different content. It enhances system adaptability, enabling it to easily handle changes in frame rate and resolution, as well as diverse and complex video content, significantly improving video encoding performance.
[0013] Furthermore, an adaptive video coding apparatus includes: a segmentation module for acquiring a video frame sequence and segmenting the video frame sequence to obtain a coding unit set; an error prediction module for predicting the coding unit set according to a preset prediction mode to obtain a prediction error; an entropy coding calculation module for performing binary coding calculation based on the prediction error, preset quantization parameters, and preset probability intervals to obtain entropy coding; a data acquisition module for acquiring real-time link status information and historical network traffic data; a status evaluation module for evaluating the network bandwidth status based on the link status information and historical network traffic data; a parameter calculation module for calculating the frame rate and resolution based on the network bandwidth status and a preset gradient information evaluation formula; and a video coding module for adaptively adjusting the coding unit set according to the frame rate, entropy coding, and resolution to obtain coded video. During the segmentation stage, coding units can be dynamically and accurately divided according to the complexity of 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 stage, a deeply optimized intra-frame prediction mode is adopted, which significantly improves the ability to mine pixel spatial correlations, accurately predicts pixel values, improves coding efficiency and reduces prediction errors. By reasonably setting quantization parameters and probability intervals, coding is performed in accordance with the data distribution pattern, effectively improving coding efficiency and reducing transmission bandwidth and costs. In terms of network condition adaptation, the frame rate and resolution can be reduced in time when the network is congested to avoid stuttering; when the bandwidth is sufficient, the frame rate and resolution can be increased to make full use of resources. Finally, by adaptively adjusting the coding unit set based on frame rate, entropy coding and resolution, video codes adapted to network conditions are generated, achieving efficient use 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, and can better adapt to various changes in the dynamic network environment and make reasonable coding adjustments.
[0014] Furthermore, an adaptive video coding apparatus includes: a memory and at least one processor, the memory storing instructions; at least one of the processors invokes the instructions in the memory to cause the adaptive video coding method to perform the steps of the adaptive video coding method as described in any one of the above descriptions.
[0015] Furthermore, a computer-readable storage medium stores instructions that, when executed by a processor, implement the steps of an adaptive video coding method as described in any one of the preceding descriptions.
[0016] The beneficial effects of the adaptive video coding method of the present invention are as follows:
[0017] During the segmentation stage, coding units can be dynamically and accurately divided according to the complexity of 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 stage, a deeply optimized intra-frame prediction mode is adopted, which significantly improves the ability to mine pixel spatial correlations, accurately predicts pixel values, improves coding efficiency and reduces prediction errors. By reasonably setting quantization parameters and probability intervals, coding is performed in accordance with the data distribution pattern, effectively improving coding efficiency and reducing transmission bandwidth and costs. In terms of network condition adaptation, the frame rate and resolution can be reduced in time when the network is congested to avoid stuttering; when the bandwidth is sufficient, the frame rate and resolution can be increased to make full use of resources. Finally, by adaptively adjusting the coding unit set based on frame rate, entropy coding and resolution, video codes adapted to network conditions are generated, achieving efficient use 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, and can better adapt to various changes in the dynamic network environment and make reasonable coding adjustments. Attached Figure Description
[0018] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0019] Figure 1 This is a first flowchart of an adaptive video coding method provided in an embodiment of the present invention;
[0020] Figure 2 This is a second flowchart of an adaptive video coding method provided in an embodiment of the present invention;
[0021] Figure 3 A third flowchart of an adaptive video coding method provided in an embodiment of the present invention;
[0022] Figure 4 A fourth flowchart of an adaptive video coding method provided in an embodiment of the present invention;
[0023] Figure 5 A fifth flowchart of an adaptive video coding method provided in an embodiment of the present invention;
[0024] Figure 6 A sixth flowchart of an adaptive video coding method provided in an embodiment of the present invention;
[0025] Figure 7 A seventh flowchart of an adaptive video coding method provided in an embodiment of the present invention;
[0026] Figure 8 This is a schematic diagram of an adaptive video coding device provided in an embodiment of the present invention;
[0027] Figure 9 This is a schematic diagram of an adaptive video encoding device provided in an embodiment of the present invention. Detailed Implementation
[0028] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 An embodiment of an adaptive video coding method according to the present invention includes:
[0031] 101. Obtain the video frame sequence and perform segmentation operations on the video frame sequence to obtain the coding unit set;
[0032] In this embodiment, the video frame sequence can be segmented using a quadtree recursive segmentation method, a graph cut algorithm, and a mean shift method. This allows for dynamic and precise division of coding units based on the complexity of the video content. Quadtree recursive segmentation flexibly adapts to details in different regions, the graph cut algorithm optimizes the energy function to achieve optimal segmentation, and mean shift, based on density clustering, handles non-uniform content, effectively reducing redundancy, lowering computational complexity, and improving coding efficiency and video quality. This lays a solid foundation for subsequent adaptive adjustment of coding parameters. When the quadtree recursive segmentation method is used to segment the video frame sequence, the size of the resulting coding units (CUs) ranges from 64×64 to 8×8 pixels.
[0033] 102. Predict the coding unit set according to the preset prediction mode to obtain the prediction error;
[0034] In this embodiment, the prediction mode adopted is a deeply optimized and improved intra-frame prediction mode. This mode effectively improves the ability to mine the spatial correlation of pixels in the current frame by performing a series of operations such as algorithm adjustment and parameter optimization on 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, thus showing significant advantages in improving coding efficiency and reducing prediction error.
[0035] 103. Based on the prediction error, preset quantization parameters, and preset probability interval, perform binary encoding calculations to obtain entropy encoding;
[0036] In this embodiment, the quantization parameter determines the fineness of data quantization, affecting the data compression ratio and reconstruction quality. Entropy coding is lossless coding. By performing binary encoding calculation on the quantization coefficients within this probability interval, the encoding process can better conform to the data distribution pattern. For example, for the quantization coefficients of high-frequency parts in the video, the codewords can be reasonably allocated through the probability interval. The quantization coefficients that occur with a high probability can obtain shorter codewords, thereby reducing the overall encoding length, effectively improving encoding 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. The network bandwidth status is assessed based on link status information and historical network traffic data;
[0039] 106. The frame rate and resolution are calculated based on the network bandwidth status and the preset gradient information evaluation formula;
[0040] In this embodiment, when network congestion and bandwidth decrease, the frame rate and resolution can be dynamically reduced in a timely manner based on the network bandwidth status and the preset gradient information evaluation formula. This reduces the amount of video data during the adaptive adjustment of the coding unit set, avoids stuttering due to the data volume exceeding the network carrying capacity, and significantly improves the user viewing experience. When network bandwidth is sufficient, the frame rate and resolution can be increased by using the network bandwidth status evaluation results, making full use of the excess bandwidth resources.
[0041] 107. Adaptively adjust the coding unit set according to frame rate, entropy coding, and resolution to obtain the coded video;
[0042] In this embodiment, by adaptively adjusting the coding unit set based on frame rate, entropy coding, and resolution, a video code that is more suitable for network conditions is generated, avoiding bandwidth waste and making efficient use of network bandwidth.
[0043] In this embodiment, during the segmentation stage, 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 stage, a deeply optimized intra-frame prediction mode is adopted, which significantly improves the ability to mine the spatial correlation of pixels, accurately predicts pixel values, improves coding efficiency and reduces prediction errors. By reasonably setting quantization parameters and probability intervals, coding is performed in accordance with the data distribution pattern, effectively improving coding efficiency and reducing transmission bandwidth and cost. In terms of network state adaptation, the frame rate and resolution can be reduced in time when the network is congested to avoid stuttering; when the bandwidth is sufficient, the frame rate and resolution can be increased to make full use of resources. Finally, by adaptively adjusting the coding unit set based on frame rate, entropy coding and resolution, video coding adapted to network conditions is generated, realizing efficient use 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, and can better adapt to various changes in the dynamic network environment and make reasonable coding adjustments.
[0044] Please see Figure 2 A second embodiment of an adaptive video coding method according to 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 is typically derived from the coded portion of the current frame, providing the basis data for subsequent motion estimation and prediction operations;
[0047] 202. A matching operation is performed on the coding unit set and the reference pixel set using motion estimation methods to obtain the matching block set and 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 similarity indices (such as absolute difference and SAD, mean square error MSE, etc.) between them, finds the block with the highest similarity, and these blocks form a matching block set. At the same time, a mapping relationship between the coding unit and its corresponding matching block is established, that is, the matching block position information of each coding unit in the reference pixel set is recorded.
[0049] 203. Calculate the motion vector based on the matching block set and mapping relationship;
[0050] In this embodiment, the motion vector reflects the movement of objects in the video. For consecutive video frames, if an object moves, the position of its corresponding coding unit will change between different frames, and the motion vector reflects this change.
[0051] 204. Calculate the pixel range based on the reference pixel set;
[0052] In this embodiment, during the quantization process, the quantization step size needs to be determined based on the pixel range to ensure that the quantized result can effectively compress the data while preserving as much important video information as possible. During prediction, 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 to record the minimum pixel value (the initial value can be set to a large number, such as 255), and the other to record the maximum pixel value (the initial value can be set to a small number, such as 0); during the traversal of the pixel set, for each pixel value, if it is less than the currently recorded minimum pixel value, the minimum pixel value is updated to that pixel value; if it is greater than the currently recorded maximum pixel value, the maximum pixel value is updated to that pixel value. After traversing the reference pixel set, the obtained minimum and maximum pixel values define the pixel range of the 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 coefficients of the prediction mode, and predict the coding unit set based on the weight coefficients, pixel range, motion vector and preset coordinate system to obtain the prediction error;
[0054] In this embodiment, by obtaining weighting coefficients and combining them with pixel range, motion vectors, and a preset coordinate system for prediction, the characteristics and spatial relationships of video content can be accurately considered. The prediction error is calculated using a formula, which can fully exploit redundant information between coding units, effectively improving coding efficiency. In practical applications, it can reduce video data transmission volume and alleviate network bandwidth pressure under different network environments, ensuring smooth video playback while maintaining good image quality, greatly improving the user viewing experience. The prediction error can be calculated using 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, and P ref (x+i, y+j) is the motion vector obtained after mapping the pixel reference values, w ijHere, represents the weight coefficients 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 encoding 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, and y represents the coordinate position of the current pixel to be predicted in the vertical direction (row direction) of the image (the specific value range of x and y is determined by the pixel range and mapped to the coordinate system), P pred (x, y) represents the current predicted pixel value;
[0058] In this embodiment, the method begins with a reference pixel set, derived from the already encoded portion of the current frame within the coding unit, providing a solid data foundation for subsequent motion estimation and prediction operations. By constructing a matching block set and mapping relationship, conditions are created for calculating motion vectors, thereby reflecting changes in object motion in the video. The pixel range calculated based on the reference pixel set is significant in the quantization and prediction stages, not only helping to determine a reasonable quantization step size to achieve a balance between data compression and information preservation, but also standardizing the range of predicted values to keep them within a reasonable range. By obtaining weight coefficients and combining them with pixel range, motion vectors, and a preset coordinate system to predict the coding unit set, redundant information between coding units can be deeply mined, thereby improving coding efficiency. In practical application scenarios, this method can effectively reduce video data transmission volume, alleviate network bandwidth pressure, ensure smooth video playback, maintain high image quality, comprehensively improve the user viewing experience, and enhance the adaptability and stability of the video coding system in complex and diverse network environments.
[0059] Please see Figure 3 A third embodiment of an adaptive video coding method according to the present invention includes:
[0060] 301. Calculate the available paths based on link status information and the preset network topology;
[0061] In this embodiment, the link status information covers the bandwidth, latency, and other conditions of each link in the network, while the preset network topology describes the connection methods 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 selection.
[0062] 302. Obtain network traffic characteristic data, and predict the network traffic characteristic data based on the preset neural network model to obtain the traffic status;
[0063] In this embodiment, network traffic characteristic data includes: packet size, sending rate, receiving rate, and latency characteristics. These data reflect the current operating status of the network. The neural network model is trained using 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 more accurately fit the characteristics of historical network traffic data, making the predicted values more consistent with the real situation, reducing misjudgments, 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 filter the available paths based on the preset routing function and historical network traffic data to obtain the optimal path;
[0065] In this embodiment, the network topology is represented by graph G = (V, E), where V is the set of nodes for the optional paths and E is the set of edges. The routing function starts from the source node s of the optional paths and maintains a distance set d. Initially, d[s] = 0. For other nodes v ∈ V\{s}, d[v] = ∞. In each iteration of the routing function calculation, the node u with the smallest distance and whose shortest path is not yet determined is selected based on historical network traffic data, and the distance of its adjacent node v is updated until the shortest path of all nodes is determined to obtain the optimal path.
[0066] 304. The network bandwidth status is obtained based on the optimal path, alternative paths, and traffic status assessment.
[0067] In this embodiment, the optimal path represents the best transmission path considering historical network traffic data, the optional path provides more transmission possibilities, and the traffic status reflects the current network congestion level. By combining these three factors, the broadband status of the network can be assessed more accurately.
[0068] In this embodiment, regarding path planning, all possible paths are calculated to provide a reference for selecting the optimal path. Regarding traffic status prediction, network traffic data covering packet size, sending and receiving rates, and latency characteristics is analyzed using a neural network model trained on a large amount of historical data. This ensures that the predicted traffic status closely matches the actual situation, effectively reducing misjudgments. In the path selection stage, the optimal path is determined from the possible paths based on historical network traffic data and a preset routing function. This process continuously optimizes the distance set through iterative calculations, ensuring the efficiency of the selected path. Finally, the optimal path, possible paths, and traffic status are integrated to evaluate the network bandwidth status, enabling a more comprehensive and accurate understanding of the actual network condition.
[0069] Please see Figure 4A fourth embodiment of an adaptive video coding method according to the present invention includes:
[0070] 401. Perform discrete cosine transform on the prediction error to obtain the low-frequency transform coefficients and high-frequency transform coefficients;
[0071] In this embodiment, the Discrete Cosine Transform (DCT) can more effectively remove spatial redundancy in small data blocks and convert 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 has less impact on vision. The DCT redistributes the prediction error data, so that most of the energy is concentrated on a few low-frequency coefficients, which facilitates subsequent compression processing.
[0072] 402. Quantize the low-frequency and high-frequency transform coefficients according to the quantization parameters to obtain the quantization coefficients and quantization step size;
[0073] In this embodiment, the quantization process rounds the transform coefficients using quantization parameters to further reduce the amount of data. Quantization significantly reduces the storage space and transmission bandwidth requirements while improving data processing efficiency. The quantization parameters determine the quantization step size, and there is a specific functional relationship between the two. The quantization step size typically increases with the increase of the quantization parameter value. In the H.264 encoding standard, the quantization step size can be obtained by looking up a predefined quantization table. Adjusting the quantization parameters allows for finding the optimal balance between compression efficiency and data quality.
[0074] 402. Adjust the probability interval according to the quantization coefficient and quantization step size to obtain the 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 coefficient and quantization step size, so that the encoding process can better fit the data distribution pattern.
[0076] 403. Perform binary encoding calculation on the quantization coefficients based on the optimization interval to obtain entropy encoding;
[0077] In this embodiment, to further improve coding efficiency, binary arithmetic coding can be used. For the binary symbol of the quantization coefficient to be encoded, the probability of the symbol appearing is obtained from the pre-trained probability model. Symbols with high probability of appearance are represented by shorter codes, and symbols with low probability of appearance are represented by longer codes. In this way, the quantization coefficient is efficiently encoded to generate the final entropy code with statistical characteristics, thereby achieving further compression of the data and greatly improving the efficiency of data coding.
[0078] In this embodiment, binary arithmetic coding is selected to further improve coding efficiency. When encoding the binary symbols of the quantization coefficients, the probability of each symbol appearing is first obtained from the pre-trained probability model. Based on the probability distribution characteristics, symbols with high probability of appearance are represented by shorter codes, while symbols with low probability of appearance are represented by longer codes. By allocating the code length according to probability, the quantization coefficients can be efficiently encoded, thereby generating the final entropy code. The outstanding advantage of 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 see Figure 5 A fifth embodiment of an adaptive video coding method according to the present invention includes:
[0080] 501. Extract color video frames from the video frame sequence to obtain a color frame dataset;
[0081] 502. Convert the color frame dataset to a grayscale frame dataset;
[0082] In this embodiment, a preset conversion formula can be used to convert the color frame dataset into a grayscale frame dataset. This is the basis for subsequent processing and reduces data complexity. The conversion formula is as follows:
[0083] Gray = 0.299R + 0.587G + 0.114B, where R, G, and B are the red, green, and blue components of the color data, respectively.
[0084] 503. Obtain the center pixel coordinates in the grayscale frame dataset, and perform noise reduction processing on the grayscale frame dataset based on the preset Gaussian function and the center pixel coordinates to obtain the noise-reduced dataset.
[0085] In this embodiment, a Gaussian function and center pixel coordinates are used to remove noise interference from the Gaussian function and center pixel coordinates to improve the accuracy of subsequent gradient calculations. Noise reduction is achieved by using a Gaussian function to perform a weighted average of each pixel and its neighboring pixels in the grayscale frame dataset, providing cleaner data for subsequent gradient calculations and improving the accuracy of gradient calculations. The weights are determined by the Gaussian function. The center pixel coordinates are the core localization reference for the noise reduction operation. Based on these coordinates, the positions of its surrounding neighboring pixels are determined, and then the relationship between the neighboring pixels and the center pixel is calculated.
[0086] 504. Based on the preset Sobel algorithm, perform gradient calculation on the denoised dataset to obtain the horizontal gradient set and the vertical gradient set;
[0087] In this embodiment, the Sobel algorithm is a discrete first-order difference operator that obtains gradient information by calculating the gray-level change rate of pixels in the horizontal and vertical directions in the denoised dataset. This gradient information reflects the direction and intensity of object edges and details in the denoised dataset.
[0088] 505. Calculate the gradient magnitude set and 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 gradient direction θ(x, y) of each pixel are calculated based on the horizontal gradient set and the vertical gradient set, providing detailed data support for subsequent evaluation of video content complexity based on gradient information. The expression for the gradient magnitude calculation formula is as follows:
[0090] In the formula, x is the horizontal coordinate of the pixel, y is the vertical coordinate of the pixel, and G... x For the horizontal gradient, G y The vertical gradient;
[0091] The formula for calculating 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 gradient direction set based on the gradient information evaluation formula to obtain the gradient information evaluation value;
[0094] In this embodiment, the gradient information evaluation value comprehensively reflects the content complexity of the video frame;
[0095] 507. The frame rate and resolution are calculated based on the gradient information evaluation value and network bandwidth status;
[0096] In this embodiment, when bandwidth is sufficient, the frame rate and resolution can be improved by combining the high gradient information evaluation value, allowing users to see clear, smooth and detailed video images; when bandwidth is insufficient, the frame rate and resolution are reduced to prioritize smooth video playback, avoid stuttering, and maintain a basic viewing experience.
[0097] In this embodiment, a dataset is constructed by obtaining color frames from a video frame sequence, and then the dataset is converted into a grayscale frame dataset, significantly reducing data complexity and laying a solid foundation for subsequent processing. Noise reduction of the grayscale frames is achieved using a Gaussian function combined with the center point pixel coordinates. The positions of neighboring pixels are determined based on the center point, and noise is removed through weighted averaging, providing clean data for gradient calculation and improving calculation accuracy. Next, the Sobel algorithm is used to calculate horizontal and vertical gradients, obtaining the direction and intensity information of object edges and details, and then calculating the gradient magnitude set and gradient direction set, providing detailed data for evaluating the complexity of video content. The gradient information evaluation value is obtained according to the gradient information evaluation formula, which comprehensively reflects the complexity of the video frames. Finally, considering the network bandwidth status, when 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 picture; when bandwidth is insufficient, the frame rate and resolution are reduced to prioritize smooth playback and avoid stuttering, comprehensively improving the user viewing experience and enhancing the adaptability of the video under different network conditions.
[0098] Please see Figure 6 A sixth embodiment of an adaptive video coding method according to the present invention includes:
[0099] 601. Analyze the network bandwidth status based on the preset first broadband threshold and the preset second broadband threshold to obtain the analysis results;
[0100] In this embodiment, the first and second bandwidth thresholds are set based on a large amount of network test data and the acceptable level of video smoothness and quality in actual application scenarios. For example, in a mobile network environment, considering factors such as signal strength and base station load, the first bandwidth threshold is set to 1 Mbps and the second bandwidth threshold is set to 5 Mbps. By comparing the current network bandwidth with these two thresholds, the bandwidth range of the network can be clearly identified, providing a basis for subsequent decisions.
[0101] 602. When the analysis result shows that the network bandwidth status is less than or equal to the first bandwidth threshold, the frame rate is calculated according to the preset first frame rate calculation formula and 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 when the bandwidth is low, and the gradient adjustment coefficient is dynamically adjusted according to the gradient information evaluation value. This avoids network congestion caused by excessive pursuit of high frame rate or high resolution, and improves the overall utilization efficiency of network resources.
[0103] 603. When the analysis result shows that the network bandwidth status is greater than the first bandwidth threshold and less than or equal to the second bandwidth threshold, the frame rate is calculated according to the preset second frame rate calculation formula and gradient information evaluation value.
[0104] In this embodiment, similar to the low bandwidth case, but because the bandwidth is relatively abundant, the values of the bandwidth adjustment coefficient and the gradient adjustment coefficient are different; when the bandwidth is sufficient, the bandwidth is fully utilized to improve video quality and improve the overall utilization efficiency of network resources.
[0105] 604. The resolution is calculated based on the frame rate and network bandwidth.
[0106] In this embodiment, given a fixed frame rate, if there is still remaining network bandwidth, the resolution can be appropriately increased to improve video clarity; if bandwidth is tight, the resolution can be 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 based on the current frame rate and network bandwidth.
[0108] In this embodiment, by setting a first bandwidth threshold and a second bandwidth threshold, the network bandwidth status is accurately analyzed, providing a basis for adjusting video parameters. Depending on the bandwidth range, the frame rate is determined using a frame rate calculation formula combined with gradient information evaluation values. Under low bandwidth conditions, coefficients are adjusted appropriately to avoid network congestion and ensure smooth video playback. Under medium to high bandwidth conditions, coefficients are adjusted based on available bandwidth, balancing smoothness and quality. After determining the frame rate, the resolution is flexibly adjusted according to the network bandwidth status; if bandwidth is available, clarity is increased; if bandwidth is limited, smoothness is maintained. This allows for dynamic adaptation of video frame rate and resolution under various network conditions, significantly improving the viewing experience and avoiding stuttering and blurring. Simultaneously, it efficiently utilizes network resources, allocating resources rationally under different bandwidth conditions. It also enhances video encoding adaptability, adapting to various video content and application scenarios, such as online playback and video conferencing, thereby improving overall performance.
[0109] Please see Figure 7 The seventh embodiment of an adaptive video coding method according to the present invention includes:
[0110] 701. Divide the coding unit set according to the preset video coding standard to obtain the first coding set and the second coding set;
[0111] In this embodiment, the video coding standard specifies the basic rules and syntax structure of the coding. The first coding set typically contains coding units with high complexity or intense motion in the video. These coding units have rich image details and large variance in pixel values, indicating high pixel value dispersion, high image detail richness, and complex motion vector distribution. The second coding set mainly contains relatively simple or static coding units in the video. Their image content changes less, and their pixel value variance is small, meaning that the pixel values are relatively concentrated and the image detail richness is low. The motion vector distribution is relatively concentrated, indicating that the object movement is not obvious and the content is relatively static.
[0112] 702. Perform feature calculations on the first coding set and the second coding set respectively to obtain the first feature parameter and the second feature parameter;
[0113] In this embodiment, feature calculations are performed on feature parameters such as the variance of pixel values (reflecting the dispersion of pixel values and the richness of image details) and the distribution of motion vectors (measuring the motion of objects) to obtain first feature parameters and second feature parameters. These feature parameters can reflect the characteristics of video content within each coding set. By dividing the coding unit set and calculating features separately, targeted adaptive adjustments are made to avoid the waste of resources caused by using a uniform coding strategy for all video content. More coding resources are allocated to complex content, while resource consumption is reduced for simple content, thereby improving coding efficiency and reducing bitrate requirements.
[0114] 703. Adaptively adjust the first coding set according to the frame rate, entropy coding, resolution, and the first feature parameter to obtain the first optimized coding set;
[0115] 704. Adaptively adjust the second coding set based on frame rate, entropy coding, resolution, and the second feature parameter to obtain the second optimized coding set;
[0116] In this embodiment, if the feature parameters of the first encoding set indicate that the scene is moving rapidly and the frame rate and resolution are high, the number of encoding bits is appropriately increased to ensure the clarity and smoothness of the moving scene. For the second encoding set, if the feature parameters indicate that the content is relatively static, the number of encoding bits can be reduced to save bitrate while ensuring basic quality. Adjustments are made according to the features of different encoding sets and factors such as frame rate and resolution to make the moving scene smoother and the details clearer, while ensuring basic quality for static scenes, thus improving the overall video viewing experience. The encoding strategy can be flexibly adjusted when the frame rate and resolution change, and when facing video content of different complexity, enhancing the adaptability of the video encoding system to various scenarios.
[0117] 705. Generate video codes based on the first and second optimized coding sets;
[0118] In this embodiment, the coding unit set is divided according to a preset video coding standard, providing a reliable basis for the division. Then, feature parameters, such as pixel value variance and motion vector distribution, are calculated for each coding set to accurately grasp the characteristics of the video content within each coding set. Based on this, the coding set is adaptively adjusted according to the feature parameters, combined with frame rate, entropy coding, and resolution. For coding sets with intense motion, high frame rate, and high resolution, the number of coding bits can be increased to ensure clear and smooth images. For relatively static coding sets, the number of coding bits can be reduced to save bitrate. Finally, the coding sets are integrated and optimized to generate video code. The entire process effectively improves coding efficiency, avoids resource waste, and reduces bitrate requirements. It comprehensively improves video quality, allowing different content to be presented in a high-quality manner. It enhances system adaptability, enabling it to easily cope with changes in frame rate and resolution, as well as diverse and complex video content, significantly improving video coding performance.
[0119] The above describes an adaptive video coding method according to an embodiment of the present invention. The following describes an adaptive video coding apparatus according to an embodiment of the present invention. Please refer to [link / reference]. Figure 8 One embodiment of the adaptive video coding apparatus of the present invention includes:
[0120] The segmentation module 1 is used to acquire a video frame sequence and perform segmentation operations on the video frame sequence to obtain a set of coding units;
[0121] Error prediction module 2 is used to predict the coding unit set according to a preset prediction mode to obtain the prediction error;
[0122] Entropy coding calculation module 3 is used to perform binary coding calculation based on prediction error, preset quantization parameters and preset probability interval to obtain entropy coding;
[0123] Data acquisition module 4 is used to acquire real-time link status information and historical network traffic data;
[0124] Status assessment module 5 assesses the network bandwidth status based on link status information and historical network traffic data;
[0125] The parameter calculation module 6 is used to calculate the frame rate and resolution based on the network bandwidth status and the preset gradient information evaluation formula.
[0126] Video encoding module 7 is used to adaptively adjust the encoding unit set according to frame rate, entropy encoding and resolution to obtain encoded video;
[0127] In this embodiment, during the segmentation stage, 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 stage, a deeply optimized intra-frame prediction mode is adopted, which significantly improves the ability to mine the spatial correlation of pixels, accurately predicts pixel values, improves coding efficiency and reduces prediction errors. By reasonably setting quantization parameters and probability intervals, coding is performed in accordance with the data distribution pattern, effectively improving coding efficiency and reducing transmission bandwidth and cost. In terms of network state adaptation, the frame rate and resolution can be reduced in time when the network is congested to avoid stuttering; when the bandwidth is sufficient, the frame rate and resolution can be increased to make full use of resources. Finally, by adaptively adjusting the coding unit set based on frame rate, entropy coding and resolution, video coding adapted to network conditions is generated, realizing efficient use 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, and can better adapt to various changes in the dynamic network environment and make reasonable coding adjustments.
[0128] Figure 9 This is a schematic diagram of the structure of an adaptive video encoding device 900 provided in an embodiment of the present invention. This adaptive video encoding device 900 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 913 (e.g., one or more processors) and a memory 920, and one or more storage media 930 (e.g., one or more mass storage devices) for storing application programs 933 or data 932. The memory 920 and storage media 930 can be temporary or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the adaptive video encoding device 900. Furthermore, 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 the adaptive video encoding device 900 to implement the steps of the adaptive video encoding method provided in the above-described method embodiments.
[0129] An adaptive video encoding 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 Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 9The illustrated adaptive video coding device structure does not constitute a limitation on an adaptive video coding device 900, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0130] A computer-readable storage medium storing instructions that, when executed by a processor, implement the steps of an adaptive video coding method as described in any one of the preceding descriptions.
[0131] The present invention and its embodiments have been described above. This description is not restrictive. The accompanying drawings are only one embodiment of the present invention. The actual content is not limited thereto. In short, if a person skilled in the art is inspired by this description and designs a similar structure and embodiment without departing from the spirit of the present invention, such design should fall within the protection scope of the present invention.
Claims
1. An adaptive video coding method, characterized in that, include: Obtain the video frame sequence and perform segmentation on the video frame sequence to obtain the coding unit set; The prediction of the coding unit set is performed according to the preset prediction mode to obtain the prediction error; Binary encoding is calculated based on prediction error, preset quantization parameters, and preset probability intervals to obtain entropy encoding; Obtain real-time link status information and historical network traffic data; The network bandwidth status is assessed based on link status information and historical network traffic data. The process of assessing network bandwidth status based on link status information and historical network traffic data includes: Optional paths are calculated based on link status information and a preset network topology. Obtain network traffic characteristic data, and predict the network traffic characteristic data based on a preset neural network model to obtain the traffic status; Obtain historical network traffic data, and filter the available paths based on the preset routing selection function and historical network traffic data to obtain the optimal path; The network bandwidth status is determined based on the optimal path, alternative paths, and traffic status. The frame rate and resolution are calculated based on the network bandwidth status and a preset gradient information evaluation formula. The coding unit set is adaptively adjusted based on frame rate, entropy coding, and resolution to obtain the video code.
2. The adaptive video coding method as described in claim 1, characterized in that, The prediction of the coding unit set according to the preset prediction mode to obtain the prediction error includes: Obtain all reference pixels from the video frame sequence to obtain the reference pixel set; A motion estimation method is used to match the coding unit set and the reference pixel set to obtain the matching block set and mapping relationship; The motion vector is calculated based on the set of matching blocks and the mapping relationship; The pixel range is calculated based on the reference pixel set; The weight coefficients of the prediction mode are obtained, and the coding unit set is predicted based on the weight coefficients, pixel range, motion vector and preset coordinate system to obtain the prediction error.
3. The adaptive video coding method as described in claim 1, characterized in that, The step of performing binary encoding calculation based on prediction error, preset quantization parameters, and preset probability intervals to obtain entropy encoding includes: The prediction error is subjected to discrete cosine transform to obtain the low-frequency transform coefficients and the high-frequency transform coefficients; The low-frequency and high-frequency transform coefficients are quantized according to the quantization parameters to obtain the quantization coefficients and quantization step size. The probability interval is adjusted based on the quantization coefficient and quantization step size to obtain the optimized interval; Binary encoding calculations are performed on the quantization coefficients based on the optimization interval to obtain entropy encoding.
4. The adaptive video coding method as described in claim 1, characterized in that, The calculation of frame rate and resolution based on network bandwidth status and a preset gradient information evaluation formula includes: Color video frames are extracted from the video frame sequence to obtain a color frame dataset; Convert the color frame dataset to a grayscale frame dataset; Obtain the center pixel coordinates in the grayscale frame dataset, and perform noise reduction on the grayscale frame dataset based on the preset Gaussian function and the center pixel coordinates to obtain the noise-reduced dataset. The gradient of the denoised dataset is calculated based on the preset Sobel algorithm to obtain the horizontal gradient set and the vertical gradient set. The gradient magnitude set and gradient direction set are calculated based on the horizontal gradient set and the vertical gradient set; The gradient magnitude set and gradient direction set are evaluated based on the gradient information evaluation formula to obtain the gradient information evaluation value; The frame rate and resolution are calculated based on the gradient information evaluation value and the network bandwidth status.
5. The adaptive video coding method as described in claim 4, characterized in that, The calculation of frame rate and resolution based on network bandwidth status and a preset gradient information evaluation formula includes: The network bandwidth status is analyzed based on the preset first broadband threshold and the preset second broadband threshold to obtain the analysis results; When the analysis result indicates that the network bandwidth status is less than or equal to the first bandwidth threshold, the frame rate is calculated according to the preset first frame rate calculation formula and the gradient information evaluation value. When the analysis result shows that the network bandwidth status is greater than the first bandwidth threshold and less than or equal to the second bandwidth threshold, the frame rate is calculated according to the preset second frame rate calculation formula and gradient information evaluation value. The resolution is calculated based on the frame rate and network bandwidth.
6. The adaptive video coding method as described in claim 1, characterized in that, The adaptive adjustment of the coding unit set based on frame rate, entropy coding, and resolution to obtain video coding includes: The coding unit set is divided to obtain the first coding set and the second coding set; The pixel value variance in the first encoding set is large; The second encoding set has a smaller variance in pixel values; Feature calculations are performed on the first encoding set and the second encoding set respectively to obtain the first feature parameter and the second feature parameter; The first coding set is adaptively adjusted based on frame rate, entropy coding, resolution, and the first feature parameter to obtain the first optimized coding set; The second coding set is adaptively adjusted based on frame rate, entropy coding, resolution, and second feature parameters to obtain the second optimized coding set; Video codes are generated based on the first and second optimized coding sets.
7. An adaptive video encoding apparatus, characterized in that, include: The segmentation module is used to acquire a video frame sequence and perform segmentation operations on the video frame sequence to obtain a set of coding units; The error prediction module is used to predict the coding unit set according to the preset prediction mode to obtain the prediction error. The entropy coding calculation module is used to perform binary coding calculations based on prediction error, preset quantization parameters, and preset probability intervals to obtain entropy codes. The data acquisition module is used to acquire real-time link status information and historical network traffic data; The status assessment module evaluates the network bandwidth status based on link status information and historical network traffic data. Specific steps include: Optional paths are calculated based on link status information and a preset network topology. Obtain network traffic characteristic data, and predict the network traffic characteristic data based on a preset neural network model to obtain the traffic status; Obtain historical network traffic data, and filter the available paths based on the preset routing selection function and historical network traffic data to obtain the optimal path; The network bandwidth status is determined based on the optimal path, alternative paths, and traffic status. The parameter calculation module is used to calculate the frame rate and resolution based on the network bandwidth status and the preset gradient information evaluation formula. The video encoding module is used to adaptively adjust the encoding unit set according to the frame rate, entropy coding, and resolution to obtain the encoded video.
8. An adaptive video encoding device, characterized in that, include: A memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause the adaptive video coding method to perform the steps of the adaptive video coding method as claimed in any one of claims 1-6.
9. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of an adaptive video coding method as described in any one of claims 1-6.
Citation Information
Patent Citations
Display method and system of mini-computer host
CN119182968A
Method for improving image quality of video call fused with scheduling system
CN119363915A