A high-definition video low-delay compression method and system based on adaptive adjustment
By employing an adaptive high-definition video low-latency compression method, which utilizes frame-level feature analysis and a two-dimensional compression strategy, the adaptive and latency issues in high-definition video transmission are resolved. This achieves low-latency, high-efficiency video compression and reconstruction, meeting the needs of low-latency scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGSHA CHAOCHUANG ELECTRONICS TECH
- Filing Date
- 2025-11-28
- Publication Date
- 2026-06-26
AI Technical Summary
Existing high-definition video compression methods suffer from weak adaptability, high transmission latency, and insufficient matching between bitrate and bandwidth, failing to meet the requirements for low-latency high-definition video transmission.
A high-definition video low-latency compression method based on adaptive adjustment is adopted. Video feature parameters are extracted through frame-level feature analysis, a two-dimensional adaptive compression strategy is constructed, and parallel frame segmentation and simplified adaptive arithmetic coding are combined to perform low-latency encoding and fast inverse transformation and quantization recovery at the decoding end, so as to achieve dynamic matching of video quality and bandwidth.
It achieves low-latency transmission of high-definition video, with a total encoding and decoding latency of ≤50ms, a compression ratio of 25-30 times, a reconstructed video PSNR of ≥35dB, image quality fluctuation of ≤3%, and a bitrate matching degree of ≥90% when network bandwidth fluctuates, meeting the needs of low-latency scenarios such as remote surgical guidance and real-time video conferencing.
Smart Images

Figure CN121603658B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of high-definition video signal processing and data compression technology, and in particular to a method and system for low-latency compression of high-definition video based on adaptive adjustment. Background Technology
[0002] With the widespread adoption of high-definition video applications, the amount of video data is growing exponentially. In order to meet the low latency requirements of some high-definition video transmission scenarios (such as remote monitoring, 1080P / 4K video live streaming, video conferencing, cloud gaming, remote surgical guidance, etc.), while ensuring high-definition image quality, it is necessary to reduce transmission bandwidth through compression technology and dynamically match network bandwidth fluctuations to achieve efficient transmission.
[0003] However, existing high-definition video compression methods have core defects such as insufficient adaptability, excessive encoding / decoding latency, and low bitrate-bandwidth matching.
[0004] Specifically, the lack of adaptive capability is reflected in the fact that traditional compression methods (such as H.264 / AVC, H.265 / HEVC) often use fixed frame type intervals (such as a fixed I-frame interval of 30 frames) or fixed quantization parameters (QP), which cannot be dynamically adjusted according to the characteristics of video content. When using a fixed high QP for complex texture areas (such as text and detailed textures) in high-definition videos, block artifacts and distortion are likely to occur; when using a fixed low QP for simple texture areas (such as solid color backgrounds), bandwidth is wasted and compression efficiency is low.
[0005] Specifically, the excessive encoding and decoding latency is reflected in the fact that the existing encoding standard relies on complex context-adaptive binary arithmetic coding (CABAC), which requires real-time iterative updates to the probability model, and the encoding latency usually exceeds 100ms; the decoding end needs to perform additional transformation type recognition and iterative quantization recovery, further increasing the latency, which cannot meet the requirements of low-latency scenarios such as remote surgery (≤30ms) and real-time interaction (≤50ms).
[0006] Specifically, the low matching degree between bitrate and bandwidth is reflected in the lack of a dynamic bitrate control mechanism based on real-time bandwidth. When the bandwidth drops sharply, the bitstream is prone to overflow, resulting in packet loss and causing video stuttering. When the bandwidth is idle, the bandwidth is not fully utilized to improve image quality, resulting in resource waste.
[0007] To address the aforementioned shortcomings, this invention aims to overcome existing technological bottlenecks by employing frame-level feature analysis and other related technologies, providing a highly reliable, low-latency multi-dimensional data transmission solution for urban fire emergency rescue scenarios. Summary of the Invention
[0008] The purpose of this invention is to propose a low-latency compression method and system for high-definition video based on adaptive adjustment, addressing the shortcomings of existing high-definition video compression methods, such as weak adaptability, high transmission latency, and insufficient matching between bitrate and bandwidth conditions. From the perspective of real-time scenario requirements, this invention reduces the total encoding and decoding latency by designing a two-dimensional adaptive strategy based on video frame-level features (such as texture complexity, motion intensity, and scene switching) and real-time bandwidth conditions, thereby improving the video compression ratio. Simultaneously, to ensure the quality of the compressed video, a fast inverse transform and quantization recovery are performed based on the adaptive compression strategy parameters transmitted synchronously at the encoding end. Combined with inter-frame motion compensation optimization, high-definition video frames are reconstructed, achieving effective compression and reconstruction while meeting the requirements of low-latency transmission of high-definition video.
[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0010] In a first aspect of the present invention, a method for low-latency compression of high-definition video based on adaptive adjustment is provided, comprising the following steps:
[0011] S10. Acquire a high-definition video stream, wherein the high-definition video stream is a digital video stream with a resolution of not less than 1920×1080 (1080P), and simultaneously collect real-time network bandwidth parameters.
[0012] S20. Perform frame-level feature analysis on the high-definition video stream and extract video feature parameters, including intra-frame texture complexity, inter-frame motion intensity and scene switching frequency.
[0013] S30. Based on the video feature parameters and real-time network bandwidth parameters, a two-dimensional adaptive compression strategy is constructed. The strategy includes frame type dynamic allocation rules, adaptive transformation coding method, and quantization parameter (QP) dynamic adjustment model.
[0014] S40. Based on the dual-dimensional adaptive compression strategy, perform low-latency coding processing: perform block-level transformation on video frames through adaptive transform coding, combine quantization parameters to dynamically adjust the model to complete quantization, and use a parallel frame segmentation mechanism and simplified adaptive arithmetic coding to generate the initial encoded bitstream.
[0015] S50. Based on real-time network bandwidth parameters, adaptive bitrate control is performed on the initial encoded bitstream, and a low-latency, packet-loss-resistant bitstream is generated through bitrate overflow warning and intra-frame bit allocation optimization.
[0016] S60. At the decoding end, the low-latency, packet-loss-resistant bitstream is received, and based on the adaptive compression strategy parameters synchronously transmitted at the encoding end, fast inverse transformation and quantization recovery are performed. Combined with inter-frame motion compensation optimization, high-definition video frames are reconstructed.
[0017] In a second aspect of the invention, a high-definition video low-latency compression system based on adaptive adjustment is provided, characterized by comprising: a high-definition video and bandwidth acquisition module, used to acquire a high-definition video stream with a resolution of not less than 1920×1080 (1080P), and simultaneously collect real-time network bandwidth parameters; a video feature analysis module, used to perform frame-level feature analysis on the high-definition video stream, and extract video feature parameters such as intra-frame texture complexity, inter-frame motion intensity, and scene switching frequency; and an adaptive compression strategy construction module, used to construct a system based on the video feature parameters and real-time network bandwidth parameters, including frame type dynamic allocation rules, adaptive transform coding methods, and... The system employs a two-dimensional adaptive compression strategy for dynamically adjusting quantization parameters; a low-latency coding module, which performs adaptive transformation, dynamic quantization, parallel frame fragmentation, and simplified adaptive arithmetic coding based on the two-dimensional adaptive compression strategy to generate an initial encoded bitstream; an adaptive bitrate control module, which performs bitrate overflow warning and intra-frame bit allocation optimization on the initial encoded bitstream based on real-time network bandwidth parameters to generate a low-latency, packet-loss-resistant bitstream; and a fast decoding and reconstruction module, which receives the low-latency, packet-loss-resistant bitstream and performs fast inverse transformation, quantization recovery, and inter-frame motion compensation optimization based on the adaptive compression strategy parameters synchronously transmitted at the encoding end to reconstruct high-definition video frames.
[0018] In a third aspect of the invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor performs the adaptive adjustment-based high-definition video low-latency compression method of the first aspect.
[0019] In a fourth aspect of the invention, a computer-readable storage medium is provided having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements the adaptive adjustment-based high-definition video low-latency compression method of the first aspect.
[0020] Compared to the prior art, the beneficial effects of this disclosure are as follows:
[0021] 1) This disclosure addresses the core pain points of existing high-definition video compression technologies in real-time transmission scenarios, such as insufficient adaptive adjustment capabilities (e.g., distortion in high-texture areas or bandwidth waste in low-texture areas caused by fixed frame type intervals and quantization parameters), excessive encoding and decoding latency (relying on complex context-adaptive binary arithmetic coding, with overall latency often exceeding 100ms, failing to meet real-time interactive requirements), and low bitrate-to-network bandwidth matching (e.g., bitstream overflow, packet loss, stuttering, or unused bandwidth when bandwidth fluctuates). It proposes a high-definition video low-latency compression method and system based on adaptive adjustment.
[0022] 2) This disclosure employs the Sobel gradient operator, optical flow estimation algorithm, and frame-level features such as the absolute value of inter-frame pixel difference and the extraction of intra-frame texture complexity, inter-frame motion intensity, and scene switching frequency to construct a two-dimensional adaptive compression strategy that integrates video features and bandwidth. Combined with parallel frame segmentation and simplified adaptive arithmetic coding, low-latency coding is achieved, which significantly enhances the adaptive compression capability of video.
[0023] 3) This disclosure achieves adaptive bitrate control through bitrate overflow warning and priority bit allocation in key intra-frame regions, generating a low-latency, packet-loss-resistant bitstream. Finally, at the decoding end, fast inverse transformation, quantization recovery, and motion compensation optimization are performed based on the strategy parameters transmitted synchronously at the encoding end, achieving fast and acceptable video recovery and effectively overcoming the shortcomings of traditional technologies.
[0024] 4) This disclosure not only achieves a total encoding and decoding latency of ≤50ms, meeting the needs of low-latency scenarios such as remote surgical guidance, real-time video conferencing, and cloud gaming, but also achieves a high compression ratio of 25-30 times (reducing the original 1.5Gbps bitrate of 1080P video to 50-60Mbps), a reconstructed video PSNR of ≥35dB and a subjective image quality score of ≥4.0 (out of 5), with image quality fluctuation of ≤3%, and a bitrate matching degree of ≥90% when the network bandwidth fluctuates by ±30%. This not only avoids packet loss and stuttering caused by sudden bandwidth drops, but also prevents resource waste caused by idle bandwidth, providing an efficient, stable, and robust solution for high-definition video compression and low-latency transmission.
[0025] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure.
[0026] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0027] Figure 1 A flowchart of a high-definition video low-latency compression method based on adaptive adjustment is provided for embodiments of the present invention;
[0028] Figure 2 This is a block diagram of a high-definition video low-latency compression system based on adaptive adjustment, provided for an embodiment of the present invention. Detailed Implementation
[0029] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0030] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0031] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0032] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0033] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions in the embodiments of the invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0034] Example 1
[0035] Based on the above ideas, this disclosure proposes a method for low-latency compression of high-definition video based on adaptive adjustment. Figure 1 A flowchart of a high-definition video low-latency compression method based on adaptive adjustment is shown. The method includes:
[0036] S10. Acquire a high-definition video stream, wherein the high-definition video stream is a digital video stream with a resolution of not less than 1920×1080 (1080P), and simultaneously collect real-time network bandwidth parameters.
[0037] S20. Perform frame-level feature analysis on the high-definition video stream and extract video feature parameters, including intra-frame texture complexity, inter-frame motion intensity and scene switching frequency.
[0038] S30. Based on the video feature parameters and real-time network bandwidth parameters, a two-dimensional adaptive compression strategy is constructed. The strategy includes a frame type dynamic allocation rule, an adaptive transformation coding method, and a quantization parameter dynamic adjustment model.
[0039] S40. Based on the dual-dimensional adaptive compression strategy, perform low-latency coding processing: perform block-level transformation on video frames through adaptive transform coding, combine quantization parameters to dynamically adjust the model to complete quantization, and use a parallel frame segmentation mechanism and simplified adaptive arithmetic coding to generate the initial encoded bitstream.
[0040] S50. Based on real-time network bandwidth parameters, adaptive bitrate control is performed on the initial encoded bitstream, and a low-latency, packet-loss-resistant bitstream is generated through bitrate overflow warning and intra-frame bit allocation optimization.
[0041] S60. At the decoding end, the low-latency, packet-loss-resistant bitstream is received, and based on the adaptive compression strategy parameters synchronously transmitted at the encoding end, fast inverse transformation and quantization recovery are performed. Combined with inter-frame motion compensation optimization, high-definition video frames are reconstructed.
[0042] The acquisition of high-definition video streams and real-time acquisition of network bandwidth parameters includes the following steps and the definition of technical parameters for each step:
[0043] High-definition video stream parameter definition resolution ,in , Frame rate FPS, in YUV420 format.
[0044] Real-time bandwidth acquisition is performed using a sliding window sampling method, with the window duration set to... This window length ensures both timely sampling and avoids excessive data fluctuations due to an excessively short window. Data is collected within each window. Secondary bandwidth value The unit is Mbps, and the formula for calculating real-time bandwidth B is:
[0045]
[0046] Specifically, by taking the arithmetic mean of the K bandwidth samples within a single sliding window, network jitter interference that may exist in a single sample is eliminated, making the calculated real-time bandwidth B closer to the actual network transmission capacity. This provides a stable and reliable bandwidth data foundation for the subsequent construction of adaptive compression strategies. K=5 is the optimal number of samples verified by experiments. Too few samples will lead to strong data randomness, while too many samples will increase the computation delay. Five samples can achieve a balance between accuracy and efficiency.
[0047] Frame-level feature analysis is performed on high-definition video streams to extract intra-frame texture complexity C, inter-frame motion intensity M, and scene switching frequency S. The specific steps are as follows:
[0048] For the t-th video frame x and y represent the horizontal and vertical coordinates of a pixel within a frame, respectively.
[0049] Intra-frame texture complexity C is calculated based on the Sobel gradient operator to quantify the richness of intra-frame detail:
[0050] The horizontal gradient describes the gray-level change of a pixel in the horizontal direction, while the vertical gradient describes the gray-level change of a pixel in the vertical direction. The calculation formulas are as follows:
[0051]
[0052]
[0053] in, , These represent the horizontal gradient and the vertical gradient, respectively. The coordinates of the t-th video frame are... pixel values, The coordinates of the t-th video frame are... pixel values, The coordinates of the t-th video frame are... pixel values, The coordinates of the t-th video frame are... The pixel value.
[0054] Pixel grayscale change rate The formula for calculating the overall grayscale change of a single pixel is as follows: It combines the horizontal and vertical gradients.
[0055]
[0056] Calculate statistical variance ,in , which is the average grayscale change rate of all pixels in the entire frame.
[0057] variance By calculating the grayscale change rate of all pixels and the average value of the entire frame The average of the squared deviations is used to quantize the dispersion of pixel grayscale changes within the frame. The larger the value, the more significant the difference in grayscale changes in different areas within the frame, that is, the more complex the texture within the frame (such as a picture containing text and detailed textures). The smaller the value, the smoother the grayscale changes within the frame, meaning the simpler the texture (such as a solid color background).
[0058] The texture complexity is normalized, with values ranging from [0, 10]. Larger values indicate more complex textures. The normalization formula is as follows:
[0059]
[0060] Specifically, the above normalization formula will reduce the variance Compress to the range [0,10] to avoid issues caused by resolution differences (such as the different total number of pixels in 1080P and 4K frames). A large numerical range facilitates the subsequent unified setting of texture complexity thresholds (such as the criteria for classifying low and high textures), thereby improving the adaptability of the strategy.
[0061] The inter-frame motion intensity M is based on the Lucas-Kanade optical flow estimation algorithm and is used to quantify the intensity of object motion between adjacent frames. The calculation steps are as follows:
[0062] Divide the frame into 4×4 blocks to obtain the motion vector set. ,in The horizontal component represents the horizontal offset of the 4×4 block relative to the previous frame. The vertical component represents the vertical offset of the 4×4 block relative to the previous frame.
[0063] The motion vector amplitude, combined with the horizontal and vertical offset, yields the motion distance of a single 4×4 block, expressed as:
[0064]
[0065] The average amplitude is expressed as:
[0066] Average amplitude By summing the motion vector amplitudes of all 4×4 blocks, multiplying by 4×4 (the number of pixels within a block), and then dividing by the total number of pixels in the frame (W×H), a weighted average of the motion amplitude for the entire frame is achieved. This calculation method ensures that each pixel contributes equally to the motion intensity, avoiding excessive amplification of local motion caused by block division. The larger the value, the farther the average movement distance of the object in the whole frame, and the more intense the movement.
[0067] Directional distribution entropy ,in This represents the total number of blocks. Since each block is 4×4 pixels, the total number of blocks is the number of frame pixels divided by 16. This is the vector number for the k-th direction interval (0-45°,...,315-360°, a total of 8 intervals, each interval being 45°).
[0068] Directional distribution entropy Used to quantify the dispersion of motion vector directions. When all motion vectors are concentrated in a few directions (such as when an object translates in a single direction), The value of H is small when it approaches 1 in some intervals and approaches 0 in others; when the motion vectors are dispersed (e.g., multiple objects moving in different directions), The average amplitude is relatively evenly distributed across all intervals, and the H value is relatively large. The introduction of H can compensate for the deficiency that the average amplitude alone cannot reflect the diversity of motion directions, and more comprehensively describe the motion state between frames.
[0069] The intensity of motion, M, is determined by the average amplitude reflecting the intensity of motion. Entropy of directional distribution, reflecting the diversity of motion directions The weighted average is obtained as follows:
[0070]
[0071] The weights of 0.6 and 0.4 in the above weighted formula are the optimal ratios determined through extensive experiments covering different motion scenarios, such as slow translation, rapid rotation, and cluttered motion of multiple objects. Because the amplitude of motion has a more significant impact on the compression strategy, such as large-scale motion requiring more bits to retain details, the average motion amplitude is given a higher weight to ensure that the M value can accurately guide the subsequent frame type allocation. For example, during intense motion, I-frames need to be inserted more frequently to reduce inter-frame prediction errors.
[0072] The scene switching frequency S is based on the sum of the absolute values of the pixel differences between frames, and can identify whether the content of the scene has changed drastically, such as when the camera is switching.
[0073] The SAD calculation formulas for frame t and frame t-1 are expressed as follows:
[0074]
[0075] The SAD value quantifies the overall difference between two frames by calculating the sum of the absolute values of the differences in the grayscale values of corresponding pixels in two adjacent frames. When there is no scene transition and the content is continuous, most pixel grayscale values change little, and the SAD value is small; when a scene transition occurs, a large number of pixel grayscale values change abruptly, and the SAD value increases sharply. Therefore, SAD is the core indicator for scene transition recognition.
[0076] Set threshold (e.g., 1080P video) ),when Furthermore, if the condition is met for 3 consecutive frames, it is considered as one valid scene switch;
[0077] threshold It is designed based on the characteristics of human vision. When the sum of grayscale differences between adjacent frames exceeds 10 grayscale levels per pixel (an 8-bit grayscale image has 256 levels, and 10 levels of difference can be clearly perceived by the human eye), it can be determined that the image has changed significantly. At the same time, it requires that "three consecutive frames meet the requirement" in order to exclude the sudden increase of SAD caused by instantaneous noise due to screen flicker, avoid misjudging scene switching, and ensure recognition accuracy.
[0078] Scene switching frequency is expressed as:
[0079] Unit: times / second;
[0080] This formula defines the scene switching frequency S as the number of effective scene transitions per unit time, and its value directly reflects the degree of dynamic change in the scene content. The higher the S value (such as in fast-cut videos), the more frequent the scene transitions. In this case, it is necessary to shorten the I-frame interval to reduce inter-frame prediction distortion, because the reference value of the previous frame is greatly reduced after a scene transition.
[0081] Based on the extracted video feature parameters and real-time network bandwidth parameters, a two-dimensional adaptive compression strategy is constructed, including dynamic frame type allocation, adaptive transform coding, and a dynamic adjustment model for quantization parameters, comprising the following steps:
[0082] Specifically, the frame type is dynamically allocated to set the initial I-frame interval. Frames are used at industry-standard intervals to balance compression ratio and image quality, with a P-frame ratio. ;
[0083] when ( (indicating low texture) and ( (indicating low motion) , .
[0084] This means extending the I-frame interval to 1.5 times the initial value (e.g., from 30 frames to 45 frames). This indicates an increase in the proportion of P-frames. Because the content differences between frames are small in low-texture, low-motion scenes, the inter-frame prediction error of P-frames is small. Even if the I-frame interval is extended, the image quality can still be guaranteed, while reducing the high bit consumption of I-frames and improving compression efficiency.
[0085] when ( (Times per second indicates high-frequency switching) frame( (minimum interval)
[0086] The I-frame interval is shortened to a minimum of 10 frames because during high-frequency scene transitions, the previous frame has very little reference value for the current frame. Frequent insertion of I-frames can avoid image quality degradation caused by the accumulation of inter-frame prediction errors. At the same time, the minimum interval of 10 frames has been experimentally verified. Too short an interval (such as 5 frames) will lead to an excessively high proportion of I-frames and a sharp increase in bitrate; too long an interval (such as 15 frames) will not effectively suppress prediction errors. 10 frames can achieve a balance between image quality and bitrate.
[0087] The adaptive transform coding section, specifically, is designed for low-texture ( , ): 4×4 Adaptive Integer DCT Transform, Transformation Matrix :
[0088] (Normalization process)
[0089] 4×4 Adaptive Integer DCT Transform Matrix The design follows the principle of "energy concentration". Through orthogonal transformation, the coefficients in the matrix can concentrate the energy of low-texture frames (with smooth pixel grayscale changes) onto a few low-frequency coefficients, while high-frequency coefficients approach zero. This makes it easier to discard high-frequency coefficients in the subsequent quantization process to achieve a high compression ratio. At the same time, integer transformation avoids floating-point operations, reduces computational complexity, and improves encoding speed. Normalization ensures that the range of transformed data is uniform, which is convenient for the adaptation of subsequent quantization parameters.
[0090] For high texture ( ), 2×2 lightweight integer transformation, transformation matrix :
[0091]
[0092] 2×2 Lightweight Integer Transformation Matrix The computational cost is only 1 / 4 of that of the 4×4 DCT transform, which can significantly improve the encoding speed of high-texture frames (such as those containing a lot of text and detailed textures). High-texture frames have drastic changes in pixel grayscale and dispersed energy. The energy concentration effect of the 4×4 transform is limited, while the 2×2 transform, although slightly lower in compression ratio, can meet the low latency requirement by reducing computational latency. The coefficient design in the matrix can effectively preserve the edge details of high-texture areas and avoid texture blurring caused by the transform.
[0093] The model part of the quantization parameter dynamic adjustment has a preset bandwidth threshold. (Based on the standard bandwidth requirements for real-time 1080P video transmission):
[0094] when When the bandwidth is sufficient: ,Base ;
[0095] when When this happens, it indicates insufficient bandwidth. ( (This is for the adjustment coefficient), and the adjustment step size. ;
[0096] in, As a basic quantization parameter, its core function is to provide an initial benchmark for dynamic adjustment of QP, avoid the QP value from drifting without an anchor point when bandwidth fluctuates, ensure the stability of image quality adjustment, and limit the QP value to the range of [20,28] when bandwidth is sufficient, thus balancing high image quality and reasonable compression ratio. This refers to the quantization parameter used for encoding the current frame, i.e., the QP value before this dynamic adjustment was performed. It can be the QP value of the previous frame. new Or initial QP base . The adjusted quantization parameter refers to the quantization parameter used for encoding the current frame or the next frame, calculated based on real-time network bandwidth changes. Its value is dynamically determined by the bandwidth gap. Its core function is to adapt to real-time bandwidth changes. When bandwidth is low, it increases the QP to reduce the bitstream and improve the compression ratio. When bandwidth is sufficient, it decreases the QP to preserve image details, thus achieving a dynamic balance between bandwidth and image quality.
[0097] This QP adjustment formula addresses bandwidth gaps. With bandwidth threshold The ratio is used to adjust the QP value proportionally. The larger the ratio, the more insufficient the bandwidth, the more the QP increases, the larger the quantization step size, and the higher the compression ratio, in order to adapt to low-bandwidth environments. Among them, 12 is the maximum adjustment range determined by experiments (when B=0, the QP increases by a maximum of 12, from 24 to 36, to avoid excessive QP causing serious image quality distortion). The limitation of adjustment step size ≤ 4 is to prevent image quality fluctuations caused by sudden changes in QP between adjacent frames (such as a sudden increase in QP from 24 to 32 will cause the image to become blurry), ensuring the consistency of subjective image quality.
[0098] For the two-dimensional adaptive compression strategy, low-latency coding processing is performed: video frames undergo block-level transformation through adaptive transform coding, and quantization is completed by dynamically adjusting the model based on quantization parameters. An initial encoded bitstream is generated using a parallel frame fragmentation mechanism and simplified adaptive arithmetic coding. The specific steps are as follows:
[0099] Specifically, in the parallel frame fragmentation stage, let N = 4 (an integer power of 2, ... The frame is divided into 4 segments by line. The range of the k-th segment's line is: [ (e.g., 1080P frame segments are lines 1-270, 271-540, 541-810, and 811-1080).
[0100] Choosing N=4 (an integer power of 2) is to adapt to the parallel processing architecture of the CPU (e.g., a 4-core CPU can process 4 slices simultaneously with no idle resources), while avoiding an increase in slice "overhead" caused by N being too large (e.g., N=8). (The more slices there are, the greater the boundary processing overhead between slices. When N>8, the overhead accounts for more than 10%, which reduces coding efficiency.) Slicing by line is because the intra-line pixel correlation of video frames is stronger, the transformation and quantization processing within the slice is more efficient, and the line range division method is simple, which facilitates the synchronization and alignment between the encoding and decoding ends.
[0101] During the dynamic quantization stage, the regions are divided into high-texture areas and low-texture areas:
[0102] In high texture areas ( Select quantization step size , ( =2, basic step size);
[0103] In low-texture areas ( Select quantization step size ;
[0104] This quantization step size adjustment formula is optimized for the characteristics of different texture regions. In high-texture areas (such as text and details) where image quality is critical, the formula reduces the quantization step size (from the base of 2 to 1.6) to reduce quantization distortion and retain more texture details. In low-texture areas (such as solid color backgrounds) where the human eye is less sensitive to distortion, the formula increases the quantization step size (from the base of 2 to 2.4) to improve the compression ratio without significantly affecting subjective image quality. This achieves a differentiated quantization strategy of "less compression in quality-priority areas and more compression in non-sensitive areas."
[0105] Adaptive rate control is performed on the initial encoded bitstream, and a low-latency, packet-loss-resistant bitstream is generated through rate overflow warning and intra-frame bit allocation optimization. The specific steps are as follows:
[0106] Statistical instantaneous bitrate, with a sliding window length of L=5 frames, instantaneous bitrate at time t:
[0107] ,in is the number of encoded bytes for the i-th frame, 8 is the Byte→bit coefficient, and L / F is the window duration (seconds).
[0108] This formula calculates the instantaneous bitrate by dividing the total number of encoded bits for L=5 frames within the sliding window by the window duration (L / F, e.g., at 30fps, the duration of 5 frames is 5 / 30 seconds). The choice of L=5 frames is because this window length can reflect the real-time changes in bitrate (if the window is too short, such as L=2 frames, the bitrate fluctuates greatly; if the window is too long, such as L=10 frames, it cannot respond to bandwidth changes in time), and it can also smooth out random fluctuations in the bitrate of a single frame (if a frame has a sudden increase in bitrate due to complex texture, averaging over 5 frames can avoid misjudgment); the Byte→bit coefficient of 8 is because computer storage is in bytes (Byte), while bitrate is in bits (bit), so unit conversion is required.
[0109] Specifically, intra-frame bit allocation considers critical regions, non-critical regions, and dynamic redundancy.
[0110] In key areas ( 5. Top 30% of regions). ;
[0111] In non-critical areas ( 5) ;
[0112] Dynamic redundancy: ;
[0113] in, The total amount of bits that can be allocated during the encoding process of a single frame of high-definition video is the baseline total amount of bits allocated within the frame. Its value is determined by the real-time network bandwidth, the texture complexity of the video frame, and the target compression bitrate. Its core function is to define the total amount of bit allocation for critical and non-critical areas, ensuring that the single-frame encoding bitrate does not exceed the real-time bandwidth carrying capacity and avoiding packet loss problems caused by bitstream overflow. Bit resources allocated to critical regions within a frame, Bit resources allocated to non-critical regions within a frame.
[0114] This bit allocation formula is based on the principle of "visual importance," which means that critical areas (the top 30% of texture complexity, such as the main subject and detailed areas of the image) are allocated ≥50% of the total bits to ensure clear image quality; non-critical areas (areas with simple textures) are limited to ≤30% of the total bits to avoid bandwidth waste; and 20% of dynamic redundant bits are used to deal with unexpected situations (such as when the encoding error of a critical area in a frame exceeds the threshold, resources can be allocated from the redundant bits to further optimize the image quality). This allocation ratio was determined through subjective image quality scoring experiments. When the proportion of bits in critical areas is <50%, the image quality score will drop from above 4.0 to below 3.5, and the human eye can clearly perceive the loss of detail. Therefore, ≥50% is set as the minimum standard.
[0115] To efficiently recover compressed video at the decoding end and ensure video quality after rapid transmission, a motion compensation optimization method is adopted. The specific steps are as follows:
[0116] Let the transmission motion vector Actual vector The error is expressed as:
[0117]
[0118] when The adjacent vector interpolation method is used, which can be expressed by the following formula:
[0119]
[0120] The error 'e' is calculated using Euclidean distance to quantize the deviation between the transmitted motion vector and the actual motion vector. e_{th}=2 is set based on the human eye's sensitivity to motion blur. When e<2, the image shift caused by the motion vector deviation is imperceptible to the human eye and requires no compensation. When e≥2, the shift will cause noticeable ghosting, requiring correction through adjacent vector interpolation (taking the average of the motion vectors from the left and right 4×4 blocks). This interpolation method is simple and efficient, with a calculation latency ≤1ms, while accurately approximating the actual motion vector, improving the inter-frame coherence of the reconstructed frames, and avoiding image jitter caused by vector errors.
[0121] Example 2
[0122] As another aspect of the embodiments of this disclosure, a high-definition video low-latency compression system based on adaptive adjustment is also provided, such as... Figure 2 As shown, it includes the following core modules:
[0123] The high-definition video and bandwidth acquisition module 1 includes a video acquisition unit (CMOS sensor, supporting 1080P@60fps) and a bandwidth detection unit (based on TCP detection, sampling frequency 5Hz), outputting W×H video stream and real-time bandwidth B;
[0124] Video feature analysis module 2 has a built-in Sobel calculation unit, optical flow estimation unit, and SAD calculation unit, and outputs C, M, and S parameters;
[0125] Adaptive compression strategy construction module 3 includes a frame type decision unit, a transformation selection unit, and a quantization parameter calculation unit, and outputs a two-dimensional compression strategy.
[0126] Low-latency coding module 4 integrates a parallel fragmentation unit and a simplified arithmetic coding unit, and outputs the initial encoded bitstream;
[0127] The adaptive bit rate control module 5 includes an instantaneous bit rate statistics unit and a bit allocation unit, and outputs a low-latency, packet-loss-resistant bit stream.
[0128] The fast decoding and reconstruction module 6 includes an inverse transform unit, a quantization recovery unit, and a motion compensation unit, which outputs reconstructed high-definition video frames.
[0129] Without causing contradictions, the above-described modules in the system of the present disclosure embodiments can implement any of the above-described methods.
[0130] Based on the description of the above embodiments, it can be seen that the embodiments of this disclosure can achieve the following technical effects:
[0131] 1) This disclosure addresses the core pain points of existing high-definition video compression technologies in real-time transmission scenarios, such as insufficient adaptive adjustment capabilities (e.g., distortion in high-texture areas or bandwidth waste in low-texture areas caused by fixed frame type intervals and quantization parameters), excessive encoding and decoding latency (relying on complex context-adaptive binary arithmetic coding, with overall latency often exceeding 100ms, failing to meet real-time interactive requirements), and low bitrate-to-network bandwidth matching (e.g., bitstream overflow, packet loss, stuttering, or unused bandwidth when bandwidth fluctuates). It proposes a high-definition video low-latency compression method and system based on adaptive adjustment.
[0132] 2) This disclosure employs the Sobel gradient operator, optical flow estimation algorithm, and frame-level features such as the absolute value of inter-frame pixel difference and the extraction of intra-frame texture complexity, inter-frame motion intensity, and scene switching frequency to construct a two-dimensional adaptive compression strategy that integrates video features and bandwidth. Combined with parallel frame segmentation and simplified adaptive arithmetic coding, low-latency coding is achieved, which significantly enhances the adaptive compression capability of video.
[0133] 3) This disclosure achieves adaptive bitrate control through bitrate overflow warning and priority bit allocation in key intra-frame regions, generating a low-latency, packet-loss-resistant bitstream. Finally, at the decoding end, fast inverse transformation, quantization recovery, and motion compensation optimization are performed based on the strategy parameters transmitted synchronously at the encoding end, achieving fast and acceptable video recovery and effectively overcoming the shortcomings of traditional technologies.
[0134] 4) This disclosure not only achieves a total encoding and decoding latency of ≤50ms, meeting the needs of low-latency scenarios such as remote surgical guidance, real-time video conferencing, and cloud gaming, but also achieves a high compression ratio of 25-30 times (reducing the original 1.5Gbps bitrate of 1080P video to 50-60Mbps), a reconstructed video PSNR of ≥35dB and a subjective image quality score of ≥4.0 (out of 5), with image quality fluctuation of ≤3%, and a bitrate matching degree of ≥90% when the network bandwidth fluctuates by ±30%. This not only avoids packet loss and stuttering caused by sudden bandwidth drops, but also prevents resource waste caused by idle bandwidth, providing an efficient, stable, and robust solution for high-definition video compression and low-latency transmission.
[0135] This disclosure also proposes an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to the aforementioned adaptive adjustment-based high-definition video low-latency compression method. The electronic device can be provided as a terminal, a server, or other type of device.
[0136] This disclosure also proposes a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the aforementioned adaptive adjustment-based high-definition video low-latency compression method. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0137] Those skilled in the art will understand that, in the above-described adaptive adjustment-based high-definition video low-latency compression method and system of specific implementation, the order of writing each step does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0138] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0139] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
[0140] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be within the scope of protection of the present invention.
Claims
1. A method for low-latency compression of high-definition video based on adaptive adjustment, characterized in that, Includes the following steps: S10. Acquire a high-definition video stream, wherein the high-definition video stream is a digital video stream with a resolution of not less than 1920×1080, and simultaneously collect real-time network bandwidth parameters. S20. Perform frame-level feature analysis on the high-definition video stream and extract video feature parameters, including intra-frame texture complexity, inter-frame motion intensity and scene switching frequency. S30. Based on the video feature parameters and real-time network bandwidth parameters, a two-dimensional adaptive compression strategy is constructed. The strategy includes frame type dynamic allocation rules, adaptive transformation coding method and quantization parameter QP dynamic adjustment model. The step S30 involves constructing a dual-dimensional adaptive compression strategy, including: when the intra-frame texture complexity is ≤ a first preset threshold and the inter-frame motion intensity is ≤ a second preset threshold, a frame type dynamic allocation rule of "I-frame interval extension + P-frame proportion increase" is adopted; when the scene switching frequency is ≥ a third preset threshold, I-frame insertion optimization is triggered to shorten the I-frame interval to a preset minimum interval; when the intra-frame texture complexity is low, a 4×4 adaptive integer DCT transform is selected; when the intra-frame texture complexity is high, a 2×2 lightweight integer transform is switched to form an adaptive transform coding method; a dynamic adjustment model for quantization parameters is constructed based on real-time network bandwidth and intra-frame texture complexity: when the bandwidth is ≥ a preset bandwidth threshold, the QP value is controlled in the range of 20-28; when the bandwidth is < a preset bandwidth threshold, the QP value is dynamically adjusted according to the bandwidth attenuation ratio, and the adjustment step size is ≤ 4 to avoid sudden changes in image quality; S40. Based on the dual-dimensional adaptive compression strategy, perform low-latency coding processing: perform block-level transformation on video frames through adaptive transform coding, combine the quantization parameter QP to dynamically adjust the model to complete quantization, and use a parallel frame segmentation mechanism and simplified adaptive arithmetic coding to generate the initial encoded bitstream. S50. Based on real-time network bandwidth parameters, adaptive bitrate control is performed on the initial encoded bitstream, and a low-latency, packet-loss-resistant bitstream is generated through bitrate overflow warning and intra-frame bit allocation optimization. S60. At the decoding end, the low-latency, packet-loss-resistant bitstream is received, and based on the adaptive compression strategy parameters synchronously transmitted at the encoding end, fast inverse transformation and quantization recovery are performed. Combined with inter-frame motion compensation optimization, high-definition video frames are reconstructed.
2. The method according to claim 1, characterized in that, In step S20, frame-level feature analysis is performed on the high-definition video stream to extract video feature parameters, including: using the Sobel gradient operator to calculate the pixel grayscale change rate of each frame of video, and quantizing the statistical variance of the grayscale change rate into an intra-frame texture complexity value; obtaining the set of motion vectors between adjacent frames through an optical flow field estimation algorithm, calculating the average amplitude and direction distribution entropy of the motion vectors to characterize the inter-frame motion intensity; calculating the absolute value of the inter-frame pixel difference and SAD of consecutive frames, and determining a scene switch when the SAD value exceeds a preset threshold and the number of consecutive frames is ≥3, and counting the number of scene switches per unit time as the scene switch frequency.
3. The method according to claim 1, characterized in that, The low-latency coding process in step S40 includes: dividing the video frame into N non-overlapping segments by row using a parallel frame segmentation mechanism, where N is an integer power of 2 and N≤8; each segment independently performs transformation and quantization, and the segments reduce computational redundancy by sharing the transformation basis matrix; simplifying adaptive arithmetic coding by pre-constructing a probability model specific to the video frame type, omitting real-time probability updates during the coding process, and updating the probability model only when the frame type is switched; during quantization, the quantization step size is smoothly adjusted for regions with high texture complexity within the frame to avoid block artifacts, and the quantization step size is appropriately increased for regions with low texture complexity within the frame to improve the compression ratio.
4. The method according to claim 1, characterized in that, The adaptive bitrate control of the initial encoded bitstream based on real-time network bandwidth parameters in step S50 includes: statistically analyzing the instantaneous bitrate of the initial encoded bitstream through a sliding window; triggering a bitrate overflow warning when the instantaneous bitrate is ≥ 90% of the real-time network bandwidth, reducing the quantization parameter adjustment step size of the current frame, and simultaneously reducing the bit allocation in non-critical regions within the frame; constructing an intra-frame bit allocation optimization model: dividing the intra-frame region into critical and non-critical regions according to texture complexity, with the bit allocation ratio of critical regions ≥ 50% of the total intra-frame bits, the bit allocation ratio of non-critical regions ≤ 30% of the total intra-frame bits, and the remaining 20% of bits used for dynamic adjustment redundancy.
5. The method according to claim 1, characterized in that, Step S60 involves performing fast inverse transform and quantization recovery, including: the decoder receiving the transform type, quantization parameters, and frame fragmentation information synchronously transmitted by the encoder; directly calling the corresponding inverse transform matrix based on the transform type, omitting the transform type identification step; during quantization recovery, using the inverse mapping table of the encoder's quantization step size, directly restoring the quantization value to the transform coefficients, avoiding iterative calculations; and inter-frame motion compensation optimization by correcting the error of the motion vector transmitted by the encoder. When the motion vector error is ≥ a preset error threshold, adjacent motion vector interpolation compensation is used to improve the inter-frame coherence of the reconstructed frame.
6. A high-definition video low-latency compression system based on adaptive adjustment, characterized in that, include: The high-definition video and bandwidth acquisition module is used to acquire high-definition video streams with a resolution of no less than 1920×1080, and at the same time collect real-time network bandwidth parameters. The video feature analysis module is used to perform frame-level feature analysis on the high-definition video stream and extract video feature parameters such as intra-frame texture complexity, inter-frame motion intensity, and scene switching frequency. An adaptive compression strategy construction module is used to construct a two-dimensional adaptive compression strategy based on the video feature parameters and real-time network bandwidth parameters. This strategy includes dynamic allocation rules for frame types, adaptive transform coding methods, and a dynamic adjustment model for quantization parameters. The two-dimensional adaptive compression strategy includes: when the intra-frame texture complexity is ≤ a first preset threshold and the inter-frame motion intensity is ≤ a second preset threshold, a dynamic frame type allocation rule of "extending the I-frame interval + increasing the proportion of P-frames" is adopted; when the scene switching frequency is ≥ a third preset threshold, I-frame insertion optimization is triggered, shortening the I-frame interval to a preset minimum interval; when the intra-frame texture complexity is low, a 4×4 adaptive integer DCT transform is selected; when the intra-frame texture complexity is high, a 2×2 lightweight integer transform is switched to form an adaptive transform coding method; a dynamic adjustment model for quantization parameters is constructed based on real-time network bandwidth and intra-frame texture complexity: when the bandwidth is ≥ a preset bandwidth threshold, the QP value is controlled in the range of 20-28; when the bandwidth is < a preset bandwidth threshold, the QP value is... The value is dynamically adjusted according to the bandwidth attenuation ratio, and the adjustment step size is ≤4 to avoid sudden changes in image quality; the low-latency encoding module is used to perform adaptive transformation, dynamic quantization, parallel frame fragmentation processing and simplified adaptive arithmetic coding according to the dual-dimensional adaptive compression strategy to generate an initial encoded bitstream; the adaptive bitrate control module is used to perform bitrate overflow warning and intra-frame bit allocation optimization on the initial encoded bitstream based on real-time network bandwidth parameters to generate a low-latency, packet-loss-resistant bitstream; the fast decoding and reconstruction module is used to receive the low-latency, packet-loss-resistant bitstream and, based on the adaptive compression strategy parameters synchronously transmitted at the encoding end, perform fast inverse transformation, quantization recovery and inter-frame motion compensation optimization to reconstruct high-definition video frames.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the adaptive adjustment-based high-definition video low-latency compression method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the adaptive adjustment-based high-definition video low-latency compression method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Visual call information processing method and system based on 5G
CN120980184A