A video signal compression transmission method based on KVM device

By employing image region classification and adaptive compression strategies, the problem of excessive bandwidth consumption or unclear image quality in KVM device video signal transmission is solved, achieving efficient and high-quality video signal transmission and ensuring lossless compression and real-time performance of image edge details.

CN122496635APending Publication Date: 2026-07-31GUANGDONG AVCIT TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG AVCIT TECH HLDG CO LTD
Filing Date
2026-04-20
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing KVM devices have difficulty flexibly switching between lossy high compression and lossless high quality strategies at the frame level or even the block level in video signal transmission, resulting in problems such as excessive bandwidth consumption or unclear image quality.

Method used

An image region classification method is used to label static, solid color, edge detail, and texture regions. Adaptive compression strategies are adopted for different regions, such as skipping static region data, lossless encoding of edge details, simplified encoding of solid color regions, and encoding of bandwidth-limited texture regions. Combined with JPEG2000 encoding technology, encoded data that meets bandwidth limitations is generated.

Benefits of technology

It achieves lossless compression of image edge details, maintains a compression ratio of 5:1, and transmits compressed data in real time with a maximum latency of no more than 0.25ms, meeting the real-time and high-quality requirements of computer screen transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122496635A_ABST
    Figure CN122496635A_ABST
Patent Text Reader

Abstract

This invention discloses a video signal compression and transmission method based on a KVM device, comprising: not transmitting data when the difference metric between the current frame's image block to be processed and the previous frame is less than a first threshold; performing a two-dimensional integer wavelet transform on the remaining image blocks to be processed, and if the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than a second threshold, performing bit-plane decomposition and arithmetic coding on its complete wavelet coefficient set to generate edge detail coding data; calculating the standard deviation of pixel values ​​of each color component for the remaining image blocks to be processed, and if all are less than a third threshold, marking the image block to be processed as a near-pure color region, and generating near-pure color region coding data containing only a single representative color value; marking the remaining image blocks to be processed as texture regions; generating texture region coding data that conforms to bandwidth limitations; and packaging the generated coding data, the region coordinates corresponding to the image blocks to be processed, and the compression type identifier and sending them to the receiving end in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video signal processing and data compression technology, and in particular to a video signal compression and transmission method based on KVM devices. Background Technology

[0002] With the rapid development of cloud computing and data center technologies, KVM (Keyboard, Video, Mouse) switches and remote desktop control technologies have become core infrastructure for IT operations and maintenance management. In KVM application scenarios, server-side video signals need to be acquired, compressed, and transmitted to clients for display via network or dedicated links in real time. Because the content transmitted by KVM is highly diverse—including slowly changing static documents and code editor interfaces, as well as rapidly changing video playback, dynamic charts, and high-frequency mouse cursor movements—extremely stringent requirements are placed on compression algorithms. Summary of the Invention

[0003] To address at least one of the aforementioned technical problems, this disclosure proposes a video signal compression and transmission method based on a KVM device in a first aspect, comprising: (a) dividing the current frame image and the previous frame image into multiple image blocks according to a fixed block size; if the difference metric between the current frame image block to be processed and the reference image block at the same position in the previous frame is less than a first threshold, marking the image block to be processed as a static region and not transmitting data; otherwise, marking it as a non-static region; (b) performing a two-dimensional integer wavelet transform on the image block to be processed marked as a non-static region; if the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than a second threshold, marking the image block to be processed as an edge detail region, and performing bit-plane decomposition and arithmetic coding on its complete wavelet coefficient set to generate edge detail coded data; (c) Exclude edge detail regions in the non-static region, calculate the standard deviation of pixel values ​​for each color component for the remaining image blocks to be processed, and if all are less than the third threshold, mark the image block to be processed as a near-pure color region. Generate a single representative color value based on the pixel statistical features within the image block to be processed, and generate near-pure color region encoding data containing only the single representative color value; (d) Exclude edge detail regions and near-pure color regions in the non-static region, and mark the remaining image blocks to be processed as texture regions; calculate the remaining available bitrate of the current frame based on the bitrate already used in steps (b) and (c), determine the maximum bitstream length of JPEG2000 encoding based on the remaining available bitrate, truncate the bitstream of the texture region, and generate texture region encoding data that meets the bandwidth limit; (e) Pack the encoding data generated in steps (b)-(d), the region coordinates corresponding to the image blocks to be processed, and the compression type identifier, and send them to the receiving end in real time.

[0004] Preferably, the difference metric is the sum of the absolute pixel differences between the image block to be processed in the current frame and the reference image block at the same position in the previous frame, or the difference metric is the difference in hash check values ​​between the image block to be processed in the current frame and the reference image block at the same position in the previous frame.

[0005] Preferably, the result of performing a two-dimensional integer wavelet transform on the image block to be processed, which is marked as a non-static region, includes a low-frequency sub-band and a high-frequency sub-band. The high-frequency sub-band includes a horizontal high-frequency sub-band, a vertical high-frequency sub-band, and a diagonal high-frequency sub-band. The second threshold is an adaptive threshold, the value of which is dynamically adjusted according to the local brightness variance of the current non-static region to adapt to text edges with different contrasts.

[0006] Preferably, the complete set of wavelet coefficients corresponding to the image block to be processed in the edge detail region is decomposed from high bit to low bit by bit plane, the occurrence probability of each bit is statistically calculated using the context model, and entropy encoding is performed using the MQ arithmetic encoder. The decoded and reconstructed pixel values ​​are completely consistent with the original pixel values ​​point by point.

[0007] Preferably, the receiving end decodes the encoded data according to the region coordinates and compression type identifier. For near-pure color regions, during decoding, a single representative color value is filled into all pixels of the corresponding coordinate region.

[0008] Preferably, the compressed type identifier includes a 2-bit type label, where: 00 represents a static region, 01 represents an edge detail region, 10 represents a near-solid color region, and 11 represents a texture region.

[0009] Preferably, determining the maximum bitstream length of JPEG2000 encoding based on the remaining available bitrate includes: using a rate-distortion optimized truncation algorithm to determine the optimal truncation point, and allocating the remaining available bitrate to each texture region according to a preset ratio.

[0010] Preferably, each color component includes the R, G, and B components of the RGB color space, or the Y, U, and V components of the YUV color space, and the pixel statistical features are the pixel mean or mode of each color component.

[0011] This disclosure provides a video signal compression and transmission apparatus based on a KVM device in its second aspect, comprising: (a) an inter-frame static detection module, used to divide the current frame image and the previous frame image into multiple image blocks according to a fixed block size; if the difference metric value between the current frame image block to be processed and the reference image block at the same position in the previous frame is less than a first threshold, the image block to be processed is marked as a static region and no data is transmitted; otherwise, it is marked as a non-static region; (b) an edge detail lossless coding module, used to perform a two-dimensional integer wavelet transform on the image block to be processed marked as a non-static region; if the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than a second threshold, the image block to be processed is marked as an edge detail region, and bit-plane decomposition and arithmetic coding are performed on its complete wavelet coefficient set to generate edge detail coded data; (c) near-solid color region. The simplified encoding module is used to exclude edge detail regions in non-static regions, calculate the standard deviation of pixel values ​​of each color component for the remaining image blocks to be processed, and if all are less than the third threshold, mark the image block to be processed as a near-pure color region. Based on the pixel statistical features in the image block to be processed, generate a single representative color value, and generate near-pure color region encoding data containing only the single representative color value; (d) Texture region bitrate control encoding module is used to exclude edge detail regions and near-pure color regions in non-static regions, mark the remaining image blocks to be processed as texture regions; calculate the remaining available bitrate of the current frame based on the bitrate already occupied in steps (b) and (c), determine the maximum bitstream length of JPEG2000 encoding based on the remaining available bitrate, truncate the bitstream of the texture region, and generate texture region encoding data that meets the bandwidth limit; (e) Packet assembly module, used to package the encoded data generated in steps (b) to (d), the region coordinates corresponding to the image block to be processed, and the compression type identifier and send them to the receiving end in real time.

[0012] In a third aspect, this disclosure provides a computer-readable medium storing a computer program that is loaded and executed by a processor to implement the steps of any of the methods described above.

[0013] Some technical advantages of this disclosure are as follows: This invention provides a video signal compression and transmission method based on a KVM device, comprising: (a) dividing the current frame image and the previous frame image into multiple image blocks according to a fixed block size; if the difference metric between the current frame image block to be processed and the reference image block at the same position in the previous frame is less than a first threshold, marking the image block to be processed as a static region and not transmitting data; otherwise, marking it as a non-static region; (b) performing a two-dimensional integer wavelet transform on the image block to be processed marked as a non-static region; if the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than a second threshold, marking the image block to be processed as an edge detail region, and performing bit-plane decomposition and arithmetic coding on its complete wavelet coefficient set to generate edge detail coded data; (c) (d) Exclude edge detail regions from the non-static region, calculate the standard deviation of pixel values ​​for each color component for the remaining image block to be processed. If all are less than the third threshold, mark the image block to be processed as a near-pure color region. Generate a single representative color value based on the pixel statistical features within the image block to be processed, and generate near-pure color region encoded data containing only the single representative color value; (e) Exclude edge detail regions and near-pure color regions from the non-static region, and mark the remaining image blocks to be processed as texture regions; calculate the remaining available bitrate of the current frame based on the bitrate already used in steps (b) and (c), determine the maximum bitstream length of JPEG2000 encoding based on the remaining available bitrate, truncate the bitstream of the texture region, and generate texture region encoded data that meets the bandwidth limit; (f) Pack the encoded data generated in steps (b)-(d), the region coordinates corresponding to the image block to be processed, and the compression type identifier, and send them to the receiving end in real time. This method can both ensure the lossless processing of important edge information of the computer screen and meet the real-time requirements of computer transmission, while significantly reducing the transmission rate requirement. It achieves lossless compression of image edge details, maintains a compression ratio of 5:1, and transmits compressed data in real time with a maximum latency of no more than 0.25ms. Attached Figure Description

[0014] To better understand the technical solutions of this disclosure, the following accompanying drawings, which are used to assist in the illustration of the prior art or embodiments, can be referred to. These drawings selectively illustrate the products or methods involved in the prior art or some embodiments of this disclosure. The basic information of these drawings is as follows: Figure 1 This is a flowchart of an embodiment of a video signal compression and transmission method based on a KVM device according to this application. Detailed Implementation

[0015] The following will further describe the technical means or effects involved in this disclosure. Obviously, the provided embodiments (or implementation methods) are only some of the implementation methods covered by this disclosure, and not all of them. Based on the embodiments in this disclosure and the explicit or implicit descriptions in the figures and text, all other embodiments that can be obtained by those skilled in the art without creative effort will be within the scope of protection claimed in this disclosure.

[0016] Existing KVM compression technologies are mainly divided into two categories: The first category is based on traditional video coding standards, such as H.264 / H.265. These schemes achieve high compression ratios through inter-frame prediction, but they are inherently lossy compression. When processing static text and fine lines, they are prone to ringing effects and blurring, and the encoding and decoding latency is relatively high, making it difficult to meet the "pixel-level perfect reproduction" requirements of high-end KVM scenarios.

[0017] The second category is based on lossless compression algorithms, such as PNG, RLE, and simple differential coding. While these schemes can guarantee lossless image quality, they often apply a uniform compression strategy to the entire screen: for large areas of solid color background, such as a white document background, simple differential coding is still efficient; however, for areas containing complex textures or high-frequency noise, the compression rate drops sharply, leading to excessive bandwidth consumption and even transmission stuttering.

[0018] Furthermore, there are significant shortcomings in handling "mixed content." For example, in the field of security monitoring, the screen of an operator controlled by a KVM device may simultaneously display a static window and a video monitoring window that is playing. Existing technologies typically struggle to flexibly switch between "lossy high compression" and "lossless high quality" strategies at the frame level or even the block level. If the entire frame uses lossless compression, bandwidth is insufficient; if the entire frame uses lossy compression, the text becomes illegible.

[0019] Therefore, this application proposes to classify image regions, such as static regions, solid color regions, and edge detail regions, and adaptively match the optimal compression strategy for different regions, such as skip, light color compression, and fully reversible compression methods, and achieve efficient and high-quality transmission of KVM signals with extremely low latency.

[0020] like Figure 1 The present disclosure provides a video signal compression and transmission method based on a KVM device, which includes: S10: (a) Divide the current frame image and the previous frame image into multiple image blocks according to a fixed block size. If the difference metric value between the current frame image block to be processed and the reference image block at the same position in the previous frame is less than the first threshold, mark the image block to be processed as a static region and do not transmit data; otherwise, mark it as a non-static region. S20: (b) Perform two-dimensional integer wavelet transform on the image block to be processed, which is marked as a non-static region. If the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than the second threshold, mark the image block to be processed as an edge detail region, and perform bit-plane decomposition and arithmetic coding on its complete wavelet coefficient set to generate edge detail coded data. S30: (c) Exclude edge detail regions in non-static regions, calculate the standard deviation of pixel values ​​for each color component for the remaining image blocks to be processed, and if all are less than the third threshold, mark the image block to be processed as a near-pure color region, generate a single representative color value based on the pixel statistical features in the image block to be processed, and generate near-pure color region encoding data containing only the single representative color value. S40: (d) Exclude edge detail areas and near-solid color areas in non-static areas, and mark the remaining image blocks to be processed as texture areas; calculate the remaining available bitrate of the current frame based on the bitrate already occupied in steps (b) and (c), determine the maximum bitstream length of JPEG2000 encoding based on the remaining available bitrate, truncate the bitstream of the texture area, and generate texture area encoded data that meets the bandwidth limit. S50: (e) The encoded data generated in packaging steps (b)-(d), the region coordinates corresponding to the image block to be processed, and the compression type identifier are sent to the receiving end in real time.

[0021] S10: (a) Divide the current frame image and the previous frame image into multiple image blocks according to a fixed block size. If the difference metric value between the current frame image block to be processed and the reference image block at the same position in the previous frame is less than the first threshold, mark the image block to be processed as a static region and do not transmit data; otherwise, mark it as a non-static region. First, the current frame image and the previous frame image are divided into multiple image blocks of a fixed block size. Image block preprocessing is performed to obtain the RGB or YUV format video data of the current frame. The entire frame image, for example, a resolution of 1920×1080, is divided into several fixed-size image blocks to be processed. In this embodiment, the preferred image block size is 32×32 pixels or 64×64 pixels. This size ensures sufficient spatial frequency analysis accuracy while controlling the complexity of transform calculations. If the image edge is smaller than a block size, it is padded using mirroring or repeated padding. At the same time, a reference frame image, i.e., the previous frame image, is maintained. This reference frame image is initialized as the decoded image of the previous frame or a completely black image.

[0022] Next, static regions are detected and skipped, and a difference metric is calculated between each image block to be processed in the current frame and a reference image block at the same position in the previous frame. The difference metric is the sum of the absolute pixel differences between the image block to be processed in the current frame and the reference image block at the same position in the previous frame, or the difference metric is the difference in hash checksums between the image block to be processed in the current frame and the reference image block at the same position in the previous frame. The difference metric can be the Hamming distance between the sum of the absolute pixel differences or the hash values. A first threshold is set to 0, or, when a small amount of noise fluctuation is allowed, the first threshold can be any other very small value. If the difference metric between the image block to be processed in the current frame and the reference image block at the same position in the previous frame is less than the first threshold, the image block to be processed is determined to be a static region. The image block to be processed is then marked as a static region. The content of a static region remains unchanged between the current frame and the previous frame, such as a static desktop background or an unscrolled document area. In one embodiment, the image block to be processed is marked as "SKIP". In the generated transmission stream, only a short control symbol, such as "Type=0, BlockID=x", is written, without containing any pixel data. Upon receiving this instruction, the receiving end directly retains the old data from the previous frame at that position in the decoding buffer. For long static frames common in KVM scenarios, this step can eliminate more than 90% of the data volume with zero computational latency.

[0023] If the difference metric between the image block to be processed in the current frame and the reference image block at the same position in the previous frame is not less than the first threshold, the image block to be processed is determined to be a non-static region. The image block to be processed is then marked as a non-static region.

[0024] S20: (b) Perform two-dimensional integer wavelet transform on the image block to be processed, which is marked as a non-static region. If the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than the second threshold, mark the image block to be processed as an edge detail region, and perform bit-plane decomposition and arithmetic coding on its complete wavelet coefficient set to generate edge detail coded data. A two-dimensional integer wavelet transform is performed on the image patch to be processed, which is marked as a non-static region. The integer wavelet can be either a 5 / 3 wavelet or a 9 / 7 wavelet. The transform process includes dividing the signal into odd and even sequences, using the even-numbered terms to predict the odd-numbered terms to obtain high-frequency detail coefficients, and using the high-frequency coefficients to update the even-numbered terms to obtain low-frequency approximation coefficients. After the transform, the original image patch is decomposed into four sub-bands, each half the size of the original patch (16×16). If the original patch is 32×32, the four sub-bands are: Low-frequency sub-band LL: low-frequency components, representing the average brightness and smooth contours of the image, containing the main energy and contours of the image; High-frequency sub-band LH: horizontal low-frequency and vertical high-frequency, representing horizontal edges (horizontal lines); High-frequency sub-band HL: horizontal high-frequency and vertical low-frequency, representing vertical edges (vertical lines); High-frequency sub-band HH: high-frequency components, representing diagonal edges, corners, and high-frequency noise.

[0025] The three high-frequency sub-bands mentioned above are used to determine edge saliency. If the absolute value of the high-frequency coefficient is large, it indicates that there is a sharp gray-level jump in the region, i.e., there is a sharp edge, such as the strokes of text. Specifically, all coefficients in the three high-frequency sub-bands LH, HL, and HH are traversed. If the absolute value of any coefficient in the transformed high-frequency sub-band is greater than the second threshold, the image block to be processed is marked as an edge detail region. Bit-plane decomposition and arithmetic coding are then performed on its complete wavelet coefficient set to generate edge detail coded data. The second threshold is an adaptive threshold, dynamically adjusted based on the local brightness variance of the current non-static region to adapt to text edges with varying contrast. First, the brightness variance of the current non-static image block, such as a 64×64 pixel block, is calculated to measure the contrast strength of that region. Then, the variance of the grayscale values ​​of all pixels within the image block is calculated. Using the calculated local brightness variance, a second threshold is dynamically generated through a linear or non-linear mapping function. For example, if the local brightness variance of a high-contrast region with black text on a white background is large, the corresponding second threshold automatically increases, ensuring that only very sharp edges are selected, effectively filtering out minor noise or compression artifacts in the background. Conversely, if the local variance of a low-contrast region with dark text is small, the corresponding second threshold automatically decreases, lowering the judgment threshold and allowing even visually visible "weak edges" with small grayscale differences to be detected, preventing broken text strokes. This solves the problem of traditional fixed thresholds "missing" text edges in dark backgrounds or shadow areas. By lowering the threshold in low-variance regions, the system can sensitively capture subtle text strokes, ensuring the integrity of document content.

[0026] For image blocks marked as edge detail regions, a lossless encoding mode is used to ensure absolute clarity of text and lines, without quantization truncation. For image blocks marked as "edge detail regions," pixel-level losslessness must be guaranteed to ensure clear text and sharp lines. The complete wavelet coefficient set corresponding to the image block to be processed in the edge detail region is decomposed bit-plane from high to low bit. The occurrence probability of each bit is statistically analyzed using a context model, and entropy encoding is performed using an MQ arithmetic encoder. The decoded and reconstructed pixel values ​​are completely consistent with the original pixel values ​​point by point. A complete wavelet coefficient set containing all coefficients of the low-frequency subband LL and the high-frequency subbands LH, HL, and HH is extracted. Each integer coefficient in the complete wavelet coefficient set is expanded bit-by-bit; for example, if the coefficient is a 16-bit integer, it is decomposed into 16 bit planes. The highest bit plane contains the main structural information of the image. The lowest bit plane contains subtle noise or precision information. All bit planes from the most significant bit plane to the least significant bit plane are retained without discarding any. Context-based adaptive binary arithmetic coding is employed, including: traversing each bit in the bit plane according to a specific scanning order, such as layered scanning; constructing a context model based on the state of the coefficients surrounding the current bit, such as whether they are zero or whether the symbols are consistent, to predict the probability of the current bit being 0 or 1; and using an arithmetic encoder to represent highly probable symbols with an extremely short bitstream. Edge detail encoded data is then generated. Since no quantization or truncation is performed, the receiver (decoder) can accurately reconstruct the original image patch bit by bit through inverse arithmetic coding and inverse integer wavelet transform, ensuring that the edges in the image are free of jaggedness and blurring.

[0027] S30: (c) Exclude edge detail regions in non-static regions, calculate the standard deviation of pixel values ​​for each color component for the remaining image blocks to be processed, and if all are less than the third threshold, mark the image block to be processed as a near-pure color region, generate a single representative color value based on the pixel statistical features in the image block to be processed, and generate near-pure color region encoding data containing only the single representative color value. First, a color uniformity analysis is performed on the image patch to be processed. To accurately reflect human color perception, the pixel value distribution of the image patch in each color component is calculated, such as the R, G, B channels in the RGB color space, or the Y, U, V channels in the YUV color space. Each color component includes the R, G, B components in the RGB color space, or the Y, U, V components in the YUV color space. The pixel statistical characteristics are the pixel mean or mode of each color component. The standard deviation is used as an indicator to measure the degree of color dispersion. The smaller the standard deviation, the more clustered the pixel values ​​and the purer the color; the larger the standard deviation, the more chaotic the color and the richer the texture. A third threshold is set, for example, 10-15 in 8-bit quantization. Only when the standard deviation of all color components is less than this threshold is the area determined to be a "near-pure color area". At this time, the original pixel matrix is ​​no longer retained, and a single representative color value that can represent the overall visual effect of the area is extracted. A single representative color value can be calculated by averaging the arithmetic mean of all pixels within the region across all channels, or by selecting the most frequently occurring pixel value from a statistical histogram. This generates near-pure color region encoded data containing only the single representative color value. Upon receiving the data, the receiving end simply performs a padding operation, filling all pixels in the corresponding coordinate region with the single representative color value. The receiving end decodes the encoded data based on the region coordinates and compression type identifier; for near-pure color regions, decoding involves filling all pixels in the corresponding coordinate region with the single representative color value.

[0028] S40: (d) Exclude edge detail areas and near-solid color areas in non-static areas, and mark the remaining image blocks to be processed as texture areas; calculate the remaining available bitrate of the current frame based on the bitrate already occupied in steps (b) and (c), determine the maximum bitstream length of JPEG2000 encoding based on the remaining available bitrate, truncate the bitstream of the texture area, and generate texture area encoded data that meets the bandwidth limit. The remaining portion of the non-static region after excluding edge detail areas and near-solid color areas is marked as texture regions, and a JPEG2000 bitstream truncation strategy based on the remaining bandwidth is adopted. Texture regions typically contain rich frequency components and are neither simple lines nor flat color blocks; they represent the natural image textures that JPEG2000 excels at processing. Before encoding the texture regions, a bandwidth budget is calculated. Since the edge details in step (b) and the near-solid colors in step (c) are usually encoded using lossless or high-priority methods, their bitrates are relatively fixed and must be prioritized. The remaining available bitrate after subtracting the encoded data generated from the edge details in step (b) and the near-solid colors in step (c) from the total bandwidth budget of the current frame is allocated to the texture regions. Determining the maximum bitstream length for JPEG2000 encoding based on the remaining available bitrate includes: using a rate-distortion optimized truncation algorithm to determine the optimal truncation point, and allocating the remaining available bitrate to each texture region according to a preset ratio.

[0029] Utilizing the embedded bitstream feature of the JPEG2000 standard, texture regions are encoded and truncated. Discrete wavelet transform is performed on image blocks in the texture regions, followed by first-level encoding with embedded block coding and optimized truncation. At this point, the encoder generates bitstream segments ordered by importance, from the most important low-frequency information to the least important detail information. The maximum bitstream length for JPEG2000 encoding is determined based on the remaining available bitrate. In the generated embedded bitstream, tail data exceeding the length is directly discarded. Since the JPEG2000 bitstream is organized from high to low bit planes, truncating the tail is equivalent to discarding the highest frequency detail information, i.e., coarse quantization, but the retained low-frequency components can still reconstruct the complete image contour. This generates texture region encoded data that conforms to bandwidth limitations.

[0030] S50: (e) The encoded data generated in packaging steps (b)-(d), the region coordinates corresponding to the image block to be processed, and the compression type identifier are sent to the receiving end in real time.

[0031] To decode the aforementioned mixed encoded data at the receiving end, a packet header is generated for each processed image patch or set of patches. This header contains key metadata required for decoding. Each data unit consists of header information and a payload. The header information includes at least the following fields: region coordinates and compression type identifier. The region coordinates are used to locate the position of the image patch within the entire frame. The compression type identifier indicates the encoding format of the payload. The compression type identifier includes a 2-bit type label, where: 00 represents a static region, 01 represents an edge detail region, 10 represents a near-solid color region, and 11 represents a texture region. For example: 0x01 represents edge detail (lossless wavelet), 0x02 represents near-solid color (monochrome value), and 0x03 represents texture (JPEG2000 truncated stream).

[0032] Different types of data streams are integrated into a single output bitstream. A block-based serial multiplexing method is employed. Following a preset scanning order (e.g., top to bottom, left to right), the header information and payload of each image block are sequentially written to the output buffer. After all image blocks are packaged, a special end-of-frame marker is appended to notify the receiver that the current frame data transmission is complete and decoding and display can begin immediately, meeting real-time requirements. The encapsulated bitstream is then transmitted in real-time to the receiver (decoder) via a communication interface.

[0033] Because the near-pure color encoding in step (c) and the edge encoding in step (b) are processed extremely quickly, data from these critical areas can be sent first, allowing the receiving end to first present the image's outline and main color, and then gradually refine the texture details (if progressive transmission is used), thus achieving extremely low subjective latency. Based on the unique characteristics of computer signals, the method integrates multiple compression algorithms to achieve lossless compression of image edge details, maintaining a compression ratio of 5:1. All the compressed data is transmitted in real time, with a maximum latency of no more than 0.25ms. The method disclosed in this paper can both preserve important edge information of the computer screen and meet the real-time requirements of computer transmission, while significantly reducing the required transmission rate.

[0034] In one embodiment, a user connects to and controls a high-performance office host via a KVM switch (Keyboard, Video, Mouse Switch). The KVM device has a built-in image encoding module as described in this invention, which acquires the host's video signal in real time. The KVM device acquires the host's screen via an HDMI interface, with a resolution of 1920×1080 and a refresh rate of 60fps. The user is using the host for multi-window office work. Currently, there is a Word document window on the screen, and the user is editing the document. Frame N description: Top left: Word document window, white background, black text; Right side: QQ chat window, gray background; Bottom: Windows taskbar, blue background; The user has just typed the letter "A," and the cursor is blinking, indicating that this area has changed relative to frame N-1.

[0035] After the KVM device acquires the Nth frame image, it performs real-time processing according to steps (a) to (e) of this invention. First, it performs inter-frame difference detection, dividing the Nth frame into several image blocks and calculating the difference metric between each block and the (N-1)th frame. For the right-side QQ window and the bottom taskbar, since the user has not interacted with these areas, their content is completely identical to the (N-1)th frame, with extremely low difference values. These areas are marked as static areas. Data from these areas is not transmitted; the receiving end (display) directly uses the cached image from the previous frame. This significantly saves bandwidth.

[0036] For the areas where changes occur, namely the area where the letter "A" is input and the area where the cursor blinks, the high-frequency sub-band coefficients are extracted. The strokes of the letter "A" and the edge of the cursor exhibit extremely high grayscale abrupt changes, with the absolute values ​​of the high-frequency coefficients far exceeding the second threshold. These are marked as edge detail areas. Lossless encoding, namely integer wavelet transform and arithmetic coding, is used to encode these minute areas. This ensures that the edges of the text "A" transmitted to the monitor are sharp and jagged, and the cursor is clearly visible, perfectly replicating the detail of office documents.

[0037] In non-static areas, after excluding edge regions, the pixel standard deviation of the remaining variable areas is detected. In a Word document, the white background area around the letter "A" may undergo minor changes due to cursor movement or redrawing. Although judged as non-static, its pixel values ​​are very uniform, with an extremely small standard deviation. This area is marked as a near-solid color region. Only a single representative color value of white (RGB: 255, 255, 255) is extracted from this region for transmission. Even with a large amount of background pixel data to be transmitted, only a few bytes are needed to reconstruct the background.

[0038] If the image contains complex background textures, such as a Word window background that is a complex wallpaper rather than a solid color, it will be marked as a textured area. Since the edge data in step (b) and the solid color data in step (c) occupy extremely low bitrates (because the variation areas are small), the remaining available bitrate is calculated to be more than sufficient. Most of the bandwidth is allocated to potential textured areas, which are then encoded with high-quality JPEG2000 to ensure overall image clarity.

[0039] The KVM device packages the generated "edge-encoded data," "solid color values," and "coordinate information of static areas" and sends them to the receiving monitor in real time via network cable or fiber optic cable. For static and solid-color backgrounds, almost no data is transmitted; only the changing "text" and "cursor" information is transmitted, achieving millisecond-level operation response. This ensures extremely low latency. The lossless edge encoding in step (b) ensures clear text, solving the problem of blurry and indistinct text in traditional video compression, making it ideal for office and coding scenarios. In scenarios with "localized minor changes," such as document editing, bandwidth usage is only 1 / 10 or even less of traditional solutions.

[0040] This disclosure also provides a video signal compression and transmission apparatus based on a KVM device, comprising: (a) an inter-frame static detection module, used to divide the current frame image and the previous frame image into multiple image blocks according to a fixed block size; if the difference metric value between the current frame image block to be processed and the reference image block at the same position in the previous frame is less than a first threshold, the image block to be processed is marked as a static region and no data is transmitted; otherwise, it is marked as a non-static region; (b) an edge detail lossless coding module, used to perform a two-dimensional integer wavelet transform on the image block to be processed marked as a non-static region; if the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than a second threshold, the image block to be processed is marked as an edge detail region, and bit-plane decomposition and arithmetic coding are performed on its complete wavelet coefficient set to generate edge detail coded data; (c) near-pure color The region simplification encoding module is used to exclude edge detail regions in non-static regions, calculate the standard deviation of pixel values ​​for each color component for the remaining image blocks to be processed, and mark the image blocks to be processed as near-pure color regions if all are less than a third threshold. A single representative color value is generated based on the pixel statistical characteristics within the image blocks to be processed, and near-pure color region encoding data containing only the single representative color value is generated. (d) The texture region bitrate control encoding module is used to exclude edge detail regions and near-pure color regions in non-static regions, and mark the remaining image blocks to be processed as texture regions. Based on the bitrate already used in steps (b) and (c), the remaining available bitrate of the current frame is calculated, the maximum bitstream length of JPEG2000 encoding is determined according to the remaining available bitrate, the bitstream of the texture regions is truncated, and texture region encoding data conforming to bandwidth limitations is generated. (e) The packet assembly module is used to package the encoded data generated in steps (b) to (d), the region coordinates corresponding to the image blocks to be processed, and the compression type identifier, and send them to the receiving end in real time. This device can be integrated into an FPGA chip or an ASIC.

[0041] In a third aspect, this disclosure provides a computer-readable medium storing a computer program, which is loaded and executed by a processor to implement the steps of an acquisition method. Those skilled in the art will understand that all or part of the steps in the embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable medium, which may include various media capable of storing program code, such as flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0042] Within the scope of knowledge and ability of those skilled in the art, the various embodiments or technical features mentioned herein can be combined with each other as other optional embodiments without conflict. These finite number of optional embodiments, which are not listed one by one and are formed by combining a finite number of technical features, still fall within the scope of the technology disclosed herein and are also derived by those skilled in the art from the accompanying drawings and the foregoing.

[0043] In addition, the descriptions of most embodiments are based on different focuses. For further understanding of the parts not described in detail, reasonable inference can be made by referring to the relevant content of the prior art, other relevant descriptions in this document, or the inventive intent.

[0044] To reiterate, the embodiments listed above are typical and preferred embodiments of this disclosure, and are only used to describe and explain the technical solutions of this disclosure in detail to facilitate the reader's understanding. They are not intended to limit the scope or application of the protection claimed in this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure to obtain technical solutions should be covered within the scope of protection claimed in this disclosure.

Claims

1. A video signal compression and transmission method based on a KVM device, characterized in that, include: (a) Divide the current frame image and the previous frame image into multiple image blocks according to a fixed block size. If the difference metric between the current frame image block to be processed and the reference image block at the same position in the previous frame is less than the first threshold, mark the image block to be processed as a static region and do not transmit data; otherwise, mark it as a non-static region. (b) Perform two-dimensional integer wavelet transform on the image block to be processed, which is marked as a non-static region. If the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than the second threshold, mark the image block to be processed as an edge detail region, and perform bit-plane decomposition and arithmetic coding on its complete wavelet coefficient set to generate edge detail coded data. (c) Exclude edge detail areas in non-static areas, calculate the standard deviation of pixel values ​​for each color component for the remaining image blocks to be processed, and if all are less than the third threshold, mark the image block to be processed as a near-pure color area, generate a single representative color value based on the pixel statistical features in the image block to be processed, and generate near-pure color area encoding data containing only the single representative color value. (d) Exclude edge detail areas and near-solid color areas in non-static areas, and mark the remaining image blocks to be processed as texture areas; calculate the remaining available bitrate of the current frame based on the bitrate already occupied in steps (b) and (c), determine the maximum bitstream length of JPEG2000 encoding based on the remaining available bitrate, truncate the bitstream of the texture area, and generate texture area encoded data that meets the bandwidth limit. (e) The encoded data generated in steps (b)-(d), the region coordinates corresponding to the image block to be processed, and the compression type identifier are sent to the receiving end in real time.

2. The method according to claim 1, characterized in that, The difference metric is the sum of the absolute pixel differences between the image block to be processed in the current frame and the reference image block at the same position in the previous frame, or the difference metric is the difference in hash check value between the image block to be processed in the current frame and the reference image block at the same position in the previous frame.

3. The method according to claim 1, characterized in that, The result of performing a two-dimensional integer wavelet transform on the image block to be processed, which is marked as a non-static region, includes a low-frequency sub-band and a high-frequency sub-band. The high-frequency sub-band includes a horizontal high-frequency sub-band, a vertical high-frequency sub-band, and a diagonal high-frequency sub-band. The second threshold is an adaptive threshold, the value of which is dynamically adjusted according to the local brightness variance of the current non-static region to adapt to text edges with different contrasts.

4. The method according to claim 1, characterized in that, The complete set of wavelet coefficients corresponding to the image block to be processed in the edge detail region is decomposed from high bit to low bit by bit plane. The occurrence probability of each bit is statistically calculated using the context model, and entropy encoding is performed using the MQ arithmetic encoder. The decoded and reconstructed pixel values ​​are completely consistent with the original pixel values ​​point by point.

5. The method according to claim 1, characterized in that, The receiving end decodes the encoded data based on the region coordinates and compression type identifier. For near-solid color regions, a single representative color value is filled into all pixels of the corresponding coordinate region during decoding.

6. The method according to claim 1, characterized in that, The compressed type identifier includes a 2-bit type label, where: 00 represents a static region, 01 represents an edge detail region, 10 represents a near-solid color region, and 11 represents a texture region.

7. The method according to claim 1, characterized in that, Determining the maximum bitstream length of JPEG2000 encoding based on the remaining available bitrate includes: using a rate-distortion optimized truncation algorithm to determine the optimal truncation point, and allocating the remaining available bitrate to each texture region according to a preset ratio.

8. The method according to claim 1, characterized in that, Each color component includes the R, G, and B components of the RGB color space, or the Y, U, and V components of the YUV color space. The pixel statistical characteristics are the pixel mean or mode of each color component.

9. A video signal compression and transmission device based on a KVM device, characterized in that, include: (a) Inter-frame static detection module, used to divide the current frame image and the previous frame image into multiple image blocks according to a fixed block size. If the difference metric value between the current frame image block to be processed and the reference image block at the same position in the previous frame is less than the first threshold, the image block to be processed is marked as a static region and no data is transmitted; otherwise, it is marked as a non-static region. (b) Edge detail lossless coding module, used to perform two-dimensional integer wavelet transform on the image block to be processed marked as a non-static region. If the absolute value of any coefficient in the high-frequency subband obtained by the transform is greater than the second threshold, the image block to be processed is marked as an edge detail region, and bit-plane decomposition and arithmetic coding are performed on its complete wavelet coefficient set to generate edge detail coded data. (c) Near solid color region simplification encoding module, used to exclude edge detail regions in non-static regions, calculate the standard deviation of pixel values ​​of each color component for the remaining image block to be processed, if all are less than the third threshold, mark the image block to be processed as a near solid color region, generate a single representative color value based on the pixel statistical features in the image block to be processed, and generate near solid color region encoding data containing only the single representative color value. (d) Texture region bitrate control encoding module, used to exclude edge detail regions and near solid color regions in non-static regions, and mark the remaining image blocks to be processed as texture regions; calculate the remaining available bitrate of the current frame based on the bitrate already occupied in steps (b) and (c), determine the maximum bitstream length of JPEG2000 encoding according to the remaining available bitrate, truncate the bitstream of the texture region, and generate texture region encoded data that meets the bandwidth limit; (e) Packet assembly module, used to package the encoded data generated in steps (b) to (d), the region coordinates corresponding to the image block to be processed, and the compression type identifier and send them to the receiving end in real time.

10. A computer-readable medium, characterized in that: A computer-readable medium stores a computer program, which is loaded by a processor and executed to implement the steps of the method of any one of claims 1 to 8.