Image coding method and device, electronic equipment and storage medium
This image compression method, which extracts inter-frame differences and uses preset encoding rules, solves the problems of network congestion and latency in high-resolution image transmission, and achieves efficient encoding under low CPU resource conditions. It is suitable for desktop sharing and remote collaboration scenarios.
Patent Information
- Application Number
- CN202511268688.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-11-14
AI Technical Summary
Existing technologies have limited compression rates when compressing images, especially at high resolutions, leading to network congestion and increased transmission latency.
By determining the image data stream of the frame to be processed, inter-frame difference extraction processing is performed to obtain a difference marker sequence, including the length of unchanged pixel segments and/or changed pixel data blocks, and then encoding processing is performed according to preset encoding rules to obtain differential compressed data packets.
It achieves efficient image compression encoding with low CPU resource consumption, significantly reducing network congestion and transmission latency, and is suitable for real-time operation on general processors or even low-power embedded chips.
Smart Images

Figure CN120956904A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image encoding technology, and in particular to an image encoding method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, in related technologies, images are typically compressed and encoded before transmission to reduce transmission bandwidth requirements.
[0003] However, when compressing and encoding images in related technologies, simple image encoding is generally used for direct transmission. This results in limited compression rates at high resolutions such as 4K, which can easily lead to network congestion and increased transmission latency. Summary of the Invention
[0004] This invention provides an image encoding method, an image encoding device, a computer program product, and an electronic device, which can, to a certain extent, achieve efficient image encoding and reduce network congestion and transmission delay.
[0005] According to a first aspect of the present invention, an image encoding method is provided, the method comprising:
[0006] Determine the image data stream of the frame to be processed;
[0007] The frame image data stream to be processed is subjected to inter-frame difference extraction processing to obtain a difference marker sequence for each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or the changed pixel data blocks;
[0008] The differential marker sequence of each frame image is encoded according to a preset encoding rule to obtain a differential compressed data packet.
[0009] In one possible implementation, determining the frame image data stream to be processed includes:
[0010] Determine the preset frame rate;
[0011] The current desktop to be processed is captured by taking a screenshot according to the preset frame rate, and the image data stream of the frame to be processed is obtained.
[0012] In one possible implementation, inter-frame difference extraction processing is performed on the frame image data stream to be processed to obtain a difference marker sequence for each frame image in the frame image data stream to be processed, including:
[0013] For the frame images in the frame image data stream excluding the first frame, perform the following operations:
[0014] Determine the first frame image of the current frame and the second frame image of the previous frame of the current frame;
[0015] The first frame image and the second frame image are compared pixel by pixel in the order of row from left to right and top to bottom to determine the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image.
[0016] The difference marker sequence of the first frame image is determined based on the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image.
[0017] In one possible implementation, the difference marker sequence of each frame image is encoded according to a preset encoding rule to obtain a differentially compressed data packet, including:
[0018] First compressed data determining the length of the unchanged pixel segment in each frame image; and / or,
[0019] Determine the second compressed data for the changed pixel data blocks in each frame image;
[0020] Based on the obtained first compressed data and / or second compressed data, a differential compressed data packet is determined.
[0021] In one possible implementation, determining first compressed data for the length of the unchanged pixel segment in each frame image includes:
[0022] Determine the first flag bit for the length of the unchanged pixel segment in each frame image;
[0023] Determine the length information of the unchanged pixel segment in each frame image;
[0024] The first flag bit and length information of the unchanged pixel segment in each frame image are compressed to determine the first compressed data of the unchanged pixel segment length in each frame image.
[0025] In one possible implementation, determining the second compressed data of the changed pixel data block in each frame image includes:
[0026] Determine the second flag bit of the changed pixel data block for each frame image;
[0027] Determine the number of pixels in the changed pixel data block of each frame image and the color value of each pixel corresponding to the number of pixels;
[0028] The second flag bit, the number of pixels, and the color value of each pixel corresponding to the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
[0029] In one possible implementation, the second flag bit, the number of pixels, and the color value of each pixel corresponding to the number of pixels in each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image, including:
[0030] If it is determined that the number of pixels in the changed pixel data block of each frame image is greater than a preset threshold, then the color value of each pixel corresponding to the number of pixels is compressed using a lossless algorithm to obtain compressed data of the number of pixels.
[0031] The second flag bit, the number of pixels, and the compressed data of the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
[0032] According to a second aspect of the present invention, an image encoding apparatus is provided, the apparatus comprising:
[0033] The determining unit is used to determine the image data stream of the frame to be processed;
[0034] The first processing unit is configured to perform inter-frame difference extraction processing on the frame image data stream to be processed, and obtain a difference marker sequence for each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks.
[0035] The second processing unit is used to encode the difference marker sequence of each frame image according to a preset encoding rule to obtain a differential compressed data packet.
[0036] In one possible implementation, the determining unit is configured to:
[0037] Determine the preset frame rate;
[0038] The current desktop to be processed is captured by taking a screenshot according to the preset frame rate, and the image data stream of the frame to be processed is obtained.
[0039] In one possible implementation, the first processing unit is configured to:
[0040] For the frame images in the frame image data stream excluding the first frame, perform the following operations:
[0041] Determine the first frame image of the current frame and the second frame image of the previous frame of the current frame;
[0042] The first frame image and the second frame image are compared pixel by pixel in the order of row from left to right and top to bottom to determine the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image.
[0043] The difference marker sequence of the first frame image is determined based on the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image.
[0044] In one possible implementation, the second processing unit is configured to:
[0045] First compressed data determining the length of the unchanged pixel segment in each frame image; and / or,
[0046] Determine the second compressed data for the changed pixel data blocks in each frame image;
[0047] Based on the obtained first compressed data and / or second compressed data, a differential compressed data packet is determined.
[0048] In one possible implementation, the second processing unit is configured to:
[0049] Determine the first flag bit for the length of the unchanged pixel segment in each frame image;
[0050] Determine the length information of the unchanged pixel segment in each frame image;
[0051] The first flag bit and length information of the unchanged pixel segment in each frame image are compressed to determine the first compressed data of the unchanged pixel segment length in each frame image.
[0052] In one possible implementation, the second processing unit is configured to:
[0053] Determine the second flag bit of the changed pixel data block for each frame image;
[0054] Determine the number of pixels in the changed pixel data block of each frame image and the color value of each pixel corresponding to the number of pixels;
[0055] The second flag bit, the number of pixels, and the color value of each pixel corresponding to the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
[0056] In one possible implementation, the second processing unit is specifically used for:
[0057] If it is determined that the number of pixels in the changed pixel data block of each frame image is greater than a preset threshold, then the color value of each pixel corresponding to the number of pixels is compressed using a lossless algorithm to obtain compressed data of the number of pixels.
[0058] The second flag bit, the number of pixels, and the compressed data of the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
[0059] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps included in any of the methods in the first aspect.
[0060] Fourthly, embodiments of the present invention provide a computer-readable storage medium including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps included in any of the methods in the first aspect.
[0061] Fifthly, embodiments of the present invention provide a computer program product, the computer program product comprising: computer program code, which, when executed on an electronic device, causes the electronic device to perform the steps included in any of the methods in the first aspect.
[0062] The technical solutions provided by the embodiments of the present invention bring at least the following beneficial effects:
[0063] In this embodiment of the invention, a frame image data stream to be processed can be determined, and then inter-frame difference extraction processing can be performed on the frame image data stream to be processed to obtain a difference marker sequence for each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks; the difference marker sequence of each frame image is encoded according to a preset encoding rule to obtain a differential compressed data packet; the differential compressed data packet is encapsulated to obtain a frame data packet.
[0064] As can be seen, in this embodiment of the invention, by combining preset encoding rules with an inter-frame difference comparison strategy (i.e., the determined difference marker sequence includes the length of unchanged pixel segments and / or the changed pixel data blocks), only the changed pixel segments transmit new pixel information, and only the length of unchanged pixel segments and / or the changed pixel data blocks are compressed. This means the overall compression process does not require complex transformations, motion searches, or other operations, resulting in low computational complexity. Furthermore, the encoding process primarily involves memory operations (e.g., comparison, counting, copying), placing extremely low demands on CPU capabilities. This makes it suitable for real-time operation on general processors and even low-power embedded chips. Therefore, efficient image compression encoding can be achieved with low CPU resource consumption, significantly reducing the amount of data that needs to be transmitted, thereby achieving efficient image encoding to a certain extent and reducing network congestion and transmission latency.
[0065] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practice. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.
[0066] 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 the invention. Attached Figure Description
[0067] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention, but do not constitute an undue limitation of the invention.
[0068] Figure 1 This illustration shows a schematic diagram of an application scenario in this exemplary embodiment;
[0069] Figure 2 A flowchart illustrating an image encoding method in this exemplary embodiment is shown.
[0070] Figure 3 This illustration shows a process for determining a differential marker sequence in this exemplary embodiment;
[0071] Figure 4 This illustration shows a process for determining differentially compressed data packets in this exemplary embodiment.
[0072] Figure 5 This diagram illustrates the structure of an image encoding apparatus according to this exemplary embodiment.
[0073] Figure 6 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation
[0074] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention. Without conflict, the embodiments and features in the embodiments of this invention can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here. The term "comprising" and any variations thereof in the specification and claims of this invention are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0075] In this embodiment of the invention, "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0076] Furthermore, unless otherwise stated, the ordinal numbers such as "first" and "second" mentioned in the embodiments of the present invention are used to distinguish multiple objects and are not used to limit the size, content, order, timing, priority, or importance of multiple objects. For example, "first frame image" and "second frame image" are only used to distinguish frame images and do not indicate that the two frame images are different in size, priority, or importance.
[0077] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These are to be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of the present invention, references may be made to existing industry solutions such as software, components, and models. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of the present invention, and do not imply that the applicant has already used or necessarily used such solutions.
[0078] In the technical solution of this invention, the acquisition, transmission, and use of images all comply with the requirements of relevant national laws and regulations.
[0079] To facilitate understanding of the technical solutions provided in the embodiments of the present invention, some key terms used in the embodiments of the present invention will be explained here first:
[0080] 4K: refers to an ultra-high-definition display standard with a resolution of approximately 3840×2160 pixels, totaling about 8.3 million pixels.
[0081] Central Processing Unit (CPU) utilization: The percentage of time a processor is used to execute a specific task, reflecting the computational resources consumed by the algorithm.
[0082] Frames Per Second (FPS): The number of frames transmitted or displayed per second. For example, 15 fps.
[0083] Key Frame: In this invention, a key frame is a frame that can be fully decoded without referencing the previous frame and is used for initialization or resynchronization after frame loss.
[0084] The preset encoding rule (RLX encoding) is the improved run-length encoding proposed in this invention. Specifically, it records the run-length for unchanged pixel segments and directly outputs the pixel value for changed pixel segments. The encoding format consists of a segment flag + length + data triplet, thus maintaining lossless encoding while ensuring extremely low CPU complexity.
[0085] Run-Length Encoding (RLE): A basic lossless compression method that uses consecutive identical data values plus a counter to replace repeated data sequences. It is the core idea behind RLX encoding.
[0086] As mentioned earlier, when compressing and encoding images in related technologies, simple image encoding is generally used for direct transmission. However, the compression rate is limited at high resolutions such as 4K, which can easily lead to network congestion and increased transmission latency.
[0087] In view of this, the present invention provides an image encoding method, which can determine the frame image data stream to be processed, and then perform inter-frame difference extraction processing on the frame image data stream to be processed to obtain the difference marker sequence of each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks; the difference marker sequence of each frame image is encoded according to a preset encoding rule to obtain a differential compressed data packet; the differential compressed data packet is encapsulated to obtain a frame data packet.
[0088] As can be seen, in this embodiment of the invention, by combining preset encoding rules with an inter-frame difference comparison strategy (i.e., the determined difference marker sequence includes the length of unchanged pixel segments and / or the changed pixel data blocks), only the changed pixel segments transmit new pixel information, and only the length of unchanged pixel segments and / or the changed pixel data blocks are compressed. This means the overall compression process does not require complex transformations, motion searches, or other operations, resulting in low computational complexity. Furthermore, the encoding process primarily involves memory operations (e.g., comparison, counting, copying), placing extremely low demands on CPU capabilities. This makes it suitable for real-time operation on general processors and even low-power embedded chips. Therefore, efficient image compression encoding can be achieved with low CPU resource consumption, significantly reducing the amount of data that needs to be transmitted, thereby achieving efficient image encoding to a certain extent and reducing network congestion and transmission latency.
[0089] To better understand the technical solutions provided by the embodiments of the present invention, the following is a brief introduction to the application scenarios applicable to the technical solutions provided by the embodiments of the present invention. It should be noted that the application scenarios described below are only for illustrating the embodiments of the present invention and are not intended to limit the scope. In specific implementation, the technical solutions provided by the embodiments of the present invention can be flexibly applied according to actual needs.
[0090] In this embodiment of the invention, image encoding technology is applied to desktop sharing and remote collaboration scenarios, such as enterprise office and team collaboration business scenarios, technical support and operation and maintenance service business scenarios, education and training and knowledge transfer business scenarios, etc. This embodiment of the invention does not limit this application.
[0091] Please see Figure 1 As shown, Figure 1 This is an application scenario to which the technical solution of this embodiment of the invention can be applied. The schematic diagram of this scenario includes a first device 110 and a second device 120. The first device 110 and the second device 120 can be directly or indirectly connected via one or more networks 130.
[0092] In this embodiment of the invention, both the first device and the second device can be understood as either a control end (sender) device or a controlled end (receiver) device. For example, in a sharing scenario, if device 1 corresponding to customer A shares an image with device 2 corresponding to customer B, then device 1 can be understood as the sender device, and device 2 can be understood as the receiver device. As another example, if device 2 corresponding to customer B shares an image with device 1 corresponding to customer A, then device 1 can be understood as the receiver device, and device 2 can be understood as the sender device.
[0093] In this embodiment of the invention, the first device 110 can determine the frame image data stream to be processed, perform inter-frame difference extraction processing on the frame image data stream to be processed, and obtain the difference marker sequence of each frame image in the frame image data stream to be processed; encode the difference marker sequence of each frame image according to a preset encoding rule to obtain a differential compressed data packet; encode the unchanged continuous pixel sequence and the changed pixel sequence in the difference marker sequence respectively according to the preset encoding rule; encapsulate the differential compressed data packet to obtain a frame data packet, and send the frame data packet to the second device 120 through a preset universal serial interface, so that the second device 120 can decode the frame data packet to obtain the frame image data stream to be processed, thereby realizing image sharing between the first device 110 and the second device 120.
[0094] In this embodiment of the invention, the first device 110 and the second device 120 can be each other's control (transmitting) end and controlled (receiving) end. For example, when the first device 110 shares an image with the second device 120, the second device 120 is the controlled end (receiving end), and when the second device 120 shares an image with the first device 110, the first device is the controlled end (receiving end).
[0095] In this embodiment of the invention, the sending device runs a remote desktop service program, which allows users to remotely access the desktop, applications, and files of another computer via a network. The receiving device runs a remote desktop client program. Since the remote desktop client program connects to and controls the remote computer / server desktop via a network, it can work in conjunction with the sending device's remote desktop service program, thereby breaking physical location limitations and enabling visual operations on remote devices (such as viewing files, running software, and debugging the system).
[0096] In an embodiment of the present invention, Figure 1 The first device 110 and the second device 120 can be mobile phones, tablets (PADs), personal computers (PCs), smart TVs, smartwatches, smart speakers, smart in-vehicle devices, and wearable devices, but are not limited to these. These devices can have image sharing and transmission functions.
[0097] Of course, the method provided in the embodiments of the present invention is not limited to... Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present invention do not impose limitations.
[0098] To further illustrate the technical solutions provided by the embodiments of the present invention, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of the present invention provide method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on conventional or non-inventive methods. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided by the embodiments of the present invention. In actual processing or when the device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.
[0099] Please see Figure 2 , Figure 2 An image encoding method is provided as an embodiment of the present invention. The method comprises an electronic device, such as... Figure 1 The first device 110 or the second device 120 is used, but this is not limited in the embodiments of the present invention.
[0100] Step 201: Determine the image data stream of the frame to be processed.
[0101] In this embodiment of the invention, the device corresponding to the sending end can determine a preset frame rate, capture screenshots of the current desktop to be processed according to the preset frame rate, obtain a continuous frame image data stream, and use the frame image data stream as the frame image data stream to be processed.
[0102] In this embodiment of the invention, the preset frame rate can be adjusted according to the actual implementation. For example, the preset frame rate can be dynamically adjusted according to bandwidth and processing capabilities. In other words, the preset frame rate can be dynamically adjusted based on bandwidth and processing capabilities and is updatable.
[0103] For example, with a bandwidth limit of USB 2.0, the preset frame rate can be automatically adjusted to an upper limit of approximately 15fps, thus meeting the smoothness requirements of PPT presentations and general remote operations. As another example, with a bandwidth limit of USB 3.0 or a gigabit network, the preset frame rate can be automatically adjusted to 30fps or even higher. Conversely, when bandwidth is extremely low or the system is busy, the preset frame rate can be automatically adjusted to decrease to ensure the integrity of each frame transmission. Because the encoding latency of the solution provided by this invention is very low, the preset frame rate adjustment has minimal impact on interaction, thus improving the user experience to a certain extent.
[0104] In this embodiment of the invention, if the remote desktop service program running on the device corresponding to the sending end is running continuously, the device corresponding to the sending end can continuously collect data at a preset frame rate, thereby continuously acquiring a continuous stream of frame image data until the remote desktop service program running on the device corresponding to the sending end stops running, or the current session of the remote desktop service program running on the device corresponding to the sending end stops.
[0105] For example, if session 1 of the remote desktop service program running on the sending device starts at 13:00:00 on August 15, 2025 and ends at 14:00:00 on August 15, 2025, then the sending device can continuously capture the current desktop image of the remote computer at a preset frame rate starting at 13:00:00 on August 15, 2025, until 14:00:00 on August 15, 2025.
[0106] In this embodiment of the invention, a remote computer is connected via a network, and its desktop is automatically and continuously captured according to a pre-defined "number of desktop screenshots per second" (i.e., a preset frame rate). If the remote computer is using a 4K monitor, each captured desktop screenshot will be a high-definition image of 3840×2160 pixels. These consecutive high-definition screenshots will be sequentially arranged into a "video stream" (i.e., the aforementioned data stream). For example, if the preset frame rate is 15fps, the remote computer can acquire a 3840×2160 resolution image approximately every 66 milliseconds.
[0107] In this embodiment of the invention, after obtaining the image data stream of the frame to be processed, the image data stream of the frame to be processed can be temporarily stored in the frame buffer area for subsequent encoding processing.
[0108] Step 202: Perform inter-frame difference extraction processing on the frame image data stream to be processed to obtain the difference marker sequence of each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of the unchanged pixel segment and / or the changed pixel data block.
[0109] In this embodiment of the invention, the device corresponding to the sending end can perform the following operations on the frame images in the frame image data stream to be processed, excluding the first frame: determine the first frame image of the current frame and the second frame image of the previous frame of the current frame; compare the color values of the first frame image and the second frame image in a row-by-row order from left to right and from top to bottom, determine the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image, and then determine the difference marker sequence of the first frame image based on the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image.
[0110] In an embodiment of the present invention, see Figure 3 As shown, for the first frame image, since there are no preceding frames for comparison, it can be marked as a keyframe and directly encoded subsequently. Furthermore, for frame images other than the first frame, if the frame image is periodically refreshed or experiences significant scene changes, it can also be set as a keyframe and directly encoded subsequently. That is, in this embodiment of the invention, the difference extraction process for keyframes can be skipped. Of course, the difference marker sequence of the keyframe image can also be recorded as a difference marker sequence that only includes changed pixel data blocks.
[0111] In this embodiment of the invention, for non-key frames other than the first frame, if the first frame of the current frame has a reference frame image of the previous frame (i.e., the second frame image), the difference extraction process can be performed on the first frame image.
[0112] In this embodiment of the invention, when the device corresponding to the sending end performs difference extraction processing on the first frame image, it can traverse the image data of the first frame image and the second frame image pixel by pixel, compare whether the color values of the corresponding pixels are the same, and generate a difference marker sequence for the first frame image (i.e., the frame image of the current frame).
[0113] In this embodiment of the invention, the comparison of the first frame image and the second frame image is performed row by row from left to right and from top to bottom, and change information is recorded when a pixel change is detected; and when consecutive pixels remain unchanged, only the counter is incremented without recording them one by one, that is, the length information of the unchanged pixel length is recorded. In this way, two types of basic information can be obtained: the length of the unchanged pixel segment (indicating how many pixels are exactly the same as the previous frame starting from a certain starting pixel) and the changed pixel data block (indicating that a segment of consecutive pixels has changed, and the new values of these pixels need to be recorded). It can be seen that the difference marker sequence includes the length of the unchanged pixel segment and the changed pixel data block.
[0114] Optionally, to improve image encoding efficiency, the changed pixel data block can be further compressed. For example, if the color appears repeatedly within the changed pixel data block, simple run-length compression can be performed, but in principle, the block will provide a new color value pixel by pixel to ensure lossless restoration. Run-length compression is a fundamental data compression algorithm. The core idea of run-length compression is to represent a segment (i.e., a run) consisting of consecutively occurring identical elements in a data sequence using the value of that element and the length of the run, thereby reducing the storage of duplicate data and achieving data compression. Based on the aforementioned processing, a "differential description" of the current frame relative to the previous frame can be obtained, which is an incremental update record that skips unchanged areas and only captures the changed content.
[0115] Step 203: Encode the difference marker sequence of each frame image according to the preset encoding rules to obtain differential compressed data packets.
[0116] In this embodiment of the invention, after the difference marker sequence is determined, the difference marker sequence of each frame image can be encoded according to the preset encoding rules to obtain differential compressed data packets, i.e., compact compressed bitstream output.
[0117] In this embodiment of the invention, the difference marker sequence is considered to include unchanged pixel segment lengths and / or changed pixel data blocks. For example, some frame images do not have pixel changes compared to the previous frame image (i.e., the reference frame image), so the difference marker sequence corresponding to that frame image only includes unchanged pixel segment lengths. As another example, if the current frame is a periodically refreshed frame image or a frame image that has encountered significant scene changes, meaning that all pixel data in the current frame are changed pixels, then difference extraction processing can be omitted for that current frame, and all data in the current frame can be directly processed as changed pixel data blocks. That is, the difference marker sequence only includes changed pixel data blocks.
[0118] Therefore, see Figure 4 As shown, first compressed data of the length of unchanged pixel segments in each frame image can be determined; and / or, second compressed data of changed pixel data blocks in each frame image can be determined, thereby determining differential compressed data packets based on the obtained first compressed data and / or second compressed data.
[0119] In one possible implementation, a first flag bit of the length of the unchanged pixel segment in each frame image can be determined; length information of the length of the unchanged pixel segment in each frame image can be determined; and then the first flag bit and length information of the length of the unchanged pixel segment in each frame image are compressed to determine the first compressed data of the length of the unchanged pixel segment in each frame image.
[0120] In one possible implementation, a second flag bit of the changed pixel data block of each frame image can be determined; the number of pixels of the changed pixel data block of each frame image and the color value of each pixel corresponding to the number of pixels can be determined; then, the second flag bit, the number of pixels, and the color value of each pixel corresponding to the number of pixels of the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
[0121] Optionally, if it is determined that the number of pixels in the changed pixel data block of each frame image is greater than a preset threshold, then the color value of each pixel corresponding to the number of pixels is compressed using a lossless algorithm to obtain compressed data of the number of pixels; the second flag bit, the number of pixels, and the compressed data of the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
[0122] In this embodiment of the invention, a set of simple and efficient RLX encoding rules, namely the aforementioned preset encoding rules, are defined. The preset encoding rules, for example, use a flag bit + length + data encoding method.
[0123] Specifically, a flag can be used to distinguish between "unchanged pixel segments" and "changed pixel segments." For example, 0 indicates that it is followed by an unchanged segment length value, and 1 indicates that it is followed by changed segment data. For unchanged pixel segments, the segment length (number of pixels) can be stored directly. Since USB transmission is suitable for byte alignment, the length can be stored in one or two bytes, which is sufficient to represent a fairly long identical area. For changed pixel segments, the number of pixels in the segment can be stored first, and then the new color value of each pixel in the segment can be stored sequentially (for example, represented by two bytes of RGB565).
[0124] Alternatively, if there are many pixels within the variable pixel segment, compression can be performed before storage. For example, a simple lossless algorithm (such as the RLE algorithm, the Lempel-Ziv (LZ) algorithm, etc.) can be used to further compress the color data to reduce its length.
[0125] In one possible implementation, an image compression rule can be directly set, and the first and second frame images can be compressed directly based on this rule (e.g., RLX encoding). In other words, the image compression rule includes two processing schemes: difference extraction processing and encoding processing.
[0126] The pseudocode example of the image compression rule is as follows:
[0127] Input: CurrFrame (the pixel array of the current frame, i.e., the first frame image), PrevFrame (the pixel array of the previous frame, i.e., the second frame image)
[0128] Output: EncodedStream (a byte stream encoded with RLX)
[0129] Initialize EncodedStream to empty
[0130] Set index i = 0
[0131] while i < total number of pixels:
[0132] If CurrFrame[i] is the same as PrevFrame[i]:
[0133] / / Enter the unchanged area
[0134] count = 0
[0135] while i < total number of pixels AND CurrFrame[i] == PrevFrame[i] AND count < maximum count value:
[0136] count+=1
[0137] i+=1
[0138] Output flag 0 to EncodedStream
[0139] Output count to EncodedStream / / This indicates that count pixels have not changed else:
[0140] / / Entering the changed area
[0141] change_data=[]
[0142] while i < total number of pixels AND CurrFrame[i]! = PrevFrame[i]:
[0143] Add the pixel value of CurrFrame[i] to the change_data list.
[0144] i+=1
[0145] Output flag 1 to EncodedStream
[0146] Output length(change_data) to EncodedStream / / Number of changed pixels Output all pixel values in the change_data list to EncodedStream
[0147] End of while
[0148] The pseudocode above describes the process of comparing pixels one by one and outputting RLX compressed data, i.e., differential compressed data.
[0149] Optionally, adjacent sequences of unchanged and changed pixels can be cyclically merged to effectively avoid sending redundant information pixel by pixel. It should be noted that, in order to prevent long continuous segments from causing the length field to become too large in extreme cases, a "maximum count value" can be set to make the block encoding of an unchanged or changed segment controllable, for example, encoding a maximum of 65535 pixels, and then splitting the encoding into multiple segments.
[0150] In this embodiment of the disclosure, the frame data size of the differential compressed data depends on the degree of image change. Specifically, for static areas of the image (i.e., unchanged pixel segments), only a small flag and count bytes are generated; for changed areas of the image (i.e., changed pixel segments), new values are output pixel by pixel.
[0151] In this embodiment of the invention, for the frame image of a keyframe, that is, when the entire frame changes completely, the encoding result is equivalent to adding a small amount of identification overhead before each pixel, and the data volume is slightly larger than that of the uncompressed image. However, in general desktop sharing scenarios, it is rare for the image to change completely, and a large number of adjacent pixels often have the same or similar content, which can be merged into the changed segment for further compression.
[0152] As can be seen, the image compression rules provided by the embodiments of the present invention can provide a considerable compression ratio with low complexity. Specifically, the image compression rules provided by the embodiments of the present invention are based on simple pixel comparison and run-length compression, without the need for complex transformations, motion searches, or other operations, resulting in low computational complexity. The encoding process mainly involves memory operations (such as performing comparisons, counting, and copying), requiring very little CPU power, making it suitable for real-time operation on general processors or even low-power embedded chips. Furthermore, thanks to the pixel comparison (i.e., difference extraction processing) scheme between frame images, the scheme provided by the embodiments of the present invention only transmits necessary update information, reducing bandwidth consumption and improving resource utilization.
[0153] Furthermore, the image compression rules provided in this invention are easy to implement in software and can also be accelerated with minimal hardware resources. Their logic is clear, the encoder is small, and they are suitable for integration into existing shared software or device firmware, reducing image encoding and transmission costs.
[0154] Based on the same inventive concept, embodiments of the present invention provide an image encoding device capable of implementing the functions corresponding to the aforementioned image encoding method. This image encoding device can be a hardware structure, a software module, or a hardware structure plus a software module. The image encoding device can be implemented by a chip system, which can consist of chips or include chips and other discrete components. Please refer to [link to previous text]. Figure 5 As shown, the image encoding device includes:
[0155] An exemplary embodiment of the present invention also provides an image encoding apparatus. (See reference...) Figure 5 As shown, the image encoding device 500 includes the following program units:
[0156] Determining unit 501 is used to determine the frame image data stream to be processed;
[0157] The first processing unit 502 is used to perform inter-frame difference extraction processing on the frame image data stream to be processed to obtain a difference marker sequence for each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks.
[0158] The second processing unit 503 is used to encode the difference marker sequence of each frame image according to a preset encoding rule to obtain a differential compressed data packet.
[0159] In one possible implementation, the determining unit 501 is configured to:
[0160] Determine the preset frame rate;
[0161] The current desktop to be processed is captured by taking a screenshot according to the preset frame rate, and the image data stream of the frame to be processed is obtained.
[0162] In one possible implementation, the first processing unit 502 is configured to:
[0163] For the frame images in the frame image data stream excluding the first frame, perform the following operations:
[0164] Determine the first frame image of the current frame and the second frame image of the previous frame of the current frame;
[0165] The first frame image and the second frame image are compared pixel by pixel in the order of row from left to right and top to bottom to determine the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image.
[0166] The difference marker sequence of the first frame image is determined based on the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image.
[0167] In one possible implementation, the second processing unit 503 is configured to:
[0168] First compressed data determining the length of the unchanged pixel segment in each frame image; and / or,
[0169] Determine the second compressed data for the changed pixel data blocks in each frame image;
[0170] Based on the obtained first compressed data and / or second compressed data, a differential compressed data packet is determined.
[0171] In one possible implementation, the second processing unit 503 is configured to:
[0172] Determine the first flag bit for the length of the unchanged pixel segment in each frame image;
[0173] Determine the length information of the unchanged pixel segment in each frame image;
[0174] The first flag bit and length information of the unchanged pixel segment in each frame image are compressed to determine the first compressed data of the unchanged pixel segment length in each frame image.
[0175] In one possible implementation, the second processing unit 503 is configured to:
[0176] Determine the second flag bit of the changed pixel data block for each frame image;
[0177] Determine the number of pixels in the changed pixel data block of each frame image and the color value of each pixel corresponding to the number of pixels;
[0178] The second flag bit, the number of pixels, and the color value of each pixel corresponding to the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
[0179] In one possible implementation, the second processing unit 503 is configured to:
[0180] If it is determined that the number of pixels in the changed pixel data block of each frame image is greater than a preset threshold, then the color value of each pixel corresponding to the number of pixels is compressed using a lossless algorithm to obtain compressed data of the number of pixels.
[0181] The second flag bit, the number of pixels, and the compressed data of the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
[0182] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.
[0183] It should be noted that although several modules or units of the device for performing actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0184] An exemplary embodiment of the present invention also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the image encoding method described above.
[0185] In one embodiment, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing the computer program, such as read-only memory, NAND flash memory, etc.
[0186] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.
[0187] Computer program code can be written in one or more programming languages. Examples of programming languages include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).
[0188] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic radiation, and infrared radiation. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to cause the electronic device to execute (more specifically, the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present invention, such as the image encoding method described above, which includes the following steps: Step 201: Determine the frame image data stream to be processed; Step 202: Perform inter-frame difference extraction processing on the frame image data stream to be processed to obtain a difference marker sequence for each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks; Step 203: Encode the difference marker sequence of each frame image according to a preset encoding rule to obtain a differential compressed data packet.
[0189] By implementing the above method steps through a computer program, the frame image data stream to be processed can be determined. Then, inter-frame difference extraction processing is performed on the frame image data stream to be processed to obtain the difference marker sequence of each frame image in the frame image data stream to be processed. The difference marker sequence includes the length of the unchanged pixel segment and / or the changed pixel data block. The difference marker sequence of each frame image is encoded according to the preset encoding rules to obtain the differential compressed data packet.
[0190] As can be seen, in this embodiment of the invention, by combining preset encoding rules with an inter-frame difference comparison strategy (i.e., the determined difference marker sequence includes the length of unchanged pixel segments and / or the changed pixel data blocks), only the changed pixel segments transmit new pixel information, and only the length of unchanged pixel segments and / or the changed pixel data blocks are compressed. This means the overall compression process does not require complex transformations, motion searches, or other operations, resulting in low computational complexity. Furthermore, the encoding process primarily involves memory operations (e.g., comparison, counting, copying), placing extremely low demands on CPU capabilities. This makes it suitable for real-time operation on general processors and even low-power embedded chips. Therefore, efficient image compression encoding can be achieved with low CPU resource consumption, significantly reducing the amount of data that needs to be transmitted, thereby achieving efficient image encoding to a certain extent and reducing network congestion and transmission latency.
[0191] An exemplary embodiment of the present invention also provides an electronic device, which may include a processor and a memory. The memory stores executable instructions of the processor, such as computer programs. The processor executes the executable instructions to perform the method steps of various exemplary embodiments of the present invention.
[0192] The following is for reference. Figure 6 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 6 The electronic device 600 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0193] like Figure 6 As shown, the electronic device 600 may include: a processor 610, a memory 620, a bus 630, an I / O (input / output) interface 640, and a network adapter 650.
[0194] The memory 620 may include volatile memory, such as RAM 621 and cache unit 622, and may also include non-volatile memory, such as ROM 623. The memory 620 may also include one or more program modules 624, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 624 may include the modules described above.
[0195] The processor 610 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).
[0196] The processor 610 can be used to execute executable instructions stored in the memory 620, such as the image encoding method described above, which includes the following steps: Step 201: Determine the frame image data stream to be processed; Step 202: Perform inter-frame difference extraction processing on the frame image data stream to be processed to obtain the difference marker sequence of each frame image in the frame image data stream to be processed; The difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks; Step 203: Encode the difference marker sequence of each frame image according to a preset encoding rule to obtain a differential compressed data packet.
[0197] By executing the above method steps by the processor 610, the frame image data stream to be processed can be determined, and then the frame image data stream to be processed is subjected to inter-frame difference extraction processing to obtain the difference marker sequence of each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks; the difference marker sequence of each frame image is encoded according to the preset encoding rules to obtain differential compressed data packets.
[0198] As can be seen, in this embodiment of the invention, by combining preset encoding rules with an inter-frame difference comparison strategy (i.e., the determined difference marker sequence includes the length of unchanged pixel segments and / or the changed pixel data blocks), only the changed pixel segments transmit new pixel information, and only the length of unchanged pixel segments and / or the changed pixel data blocks are compressed. This means the overall compression process does not require complex transformations, motion searches, or other operations, resulting in low computational complexity. Furthermore, the encoding process primarily involves memory operations (e.g., comparison, counting, copying), placing extremely low demands on CPU capabilities. This makes it suitable for real-time operation on general processors and even low-power embedded chips. Therefore, efficient image compression encoding can be achieved with low CPU resource consumption, significantly reducing the amount of data that needs to be transmitted, thereby achieving efficient image encoding to a certain extent and reducing network congestion and transmission latency.
[0199] Bus 630 is used to connect different components of electronic device 600 and may include a data bus, an address bus and a control bus.
[0200] Electronic device 600 can communicate with one or more external devices 700 (such as keyboard, mouse, external controller, etc.) through I / O interface 640.
[0201] Electronic device 600 can communicate with one or more networks via network adapter 650. For example, network adapter 650 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 650 can communicate with other modules of electronic device 600 via bus 630.
[0202] although Figure 6 Other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, may also be configured in the electronic device 600.
[0203] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium including program code, which, when the program product is run on an electronic device, is used to cause the electronic device to perform the steps of the aforementioned image encoding method.
[0204] In some possible implementations, various aspects of the image encoding method provided by the present invention can also be implemented as a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the steps of the image encoding method according to various exemplary embodiments of the present invention described above.
[0205] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0206] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable display device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable display device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0207] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable display device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0208] These computer program instructions may also be loaded onto a computer or other programmable display device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0209] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. An image encoding method, characterized in that, The method includes: Determine the image data stream of the frame to be processed; The frame image data stream to be processed is subjected to inter-frame difference extraction processing to obtain a difference marker sequence for each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks; The differential marker sequence of each frame image is encoded according to a preset encoding rule to obtain a differential compressed data packet.
2. The method according to claim 1, characterized in that, Determine the image data stream of the frame to be processed, including: Determine the preset frame rate; The current desktop to be processed is captured by taking a screenshot according to the preset frame rate, and the image data stream of the frame to be processed is obtained.
3. The method according to claim 2, characterized in that, The inter-frame difference extraction process is performed on the image data stream to be processed to obtain a difference marker sequence for each frame image in the image data stream to be processed, including: For the frame images in the frame image data stream excluding the first frame, perform the following operations: Determine the first frame image of the current frame and the second frame image of the previous frame of the current frame; The first frame image and the second frame image are compared pixel by pixel in the order of row from left to right and top to bottom to determine the length of the unchanged pixel segment and / or the changed pixel data block corresponding to the first frame image. Based on the length of the unchanged pixel segment and the changed pixel data block corresponding to the first frame image, the difference marker sequence of the first frame image is determined.
4. The method according to any one of claims 1-3, characterized in that, The difference marker sequence of each frame image is encoded according to a preset encoding rule to obtain a differential compressed data packet, including: First compressed data determining the length of the unchanged pixel segment in each frame image; and / or, Determine the second compressed data for the changed pixel data blocks in each frame image; Based on the obtained first compressed data and / or second compressed data, a differential compressed data packet is determined.
5. The method according to claim 4, characterized in that, The first compressed data for determining the length of the unchanged pixel segment in each frame image includes: Determine the first flag bit for the length of the unchanged pixel segment in each frame image; Determine the length information of the unchanged pixel segment in each frame image; The first flag bit and length information of the unchanged pixel segment in each frame image are compressed to determine the first compressed data of the unchanged pixel segment length in each frame image.
6. The method according to claim 4, characterized in that, Determining the second compressed data of the changed pixel data block in each frame image includes: Determine the second flag bit of the changed pixel data block for each frame image; Determine the number of pixels in the changed pixel data block of each frame image and the color value of each pixel corresponding to the number of pixels; The second flag bit, the number of pixels, and the color value of each pixel corresponding to the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
7. The method according to claim 6, characterized in that, The second flag bit, the number of pixels, and the color value of each pixel corresponding to the number of pixels in each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image, including: If it is determined that the number of pixels in the changed pixel data block of each frame image is greater than a preset threshold, then the color value of each pixel corresponding to the number of pixels is compressed using a lossless algorithm to obtain compressed data of the number of pixels. The second flag bit, the number of pixels, and the compressed data of the number of pixels in the changed pixel data block of each frame image are compressed to determine the second compressed data of the changed pixel data block in each frame image.
8. An image encoding device, characterized in that, The device includes: The determining unit is used to determine the frame image data stream to be processed. The first processing unit is used to perform inter-frame difference extraction processing on the frame image data stream to be processed to obtain a difference marker sequence for each frame image in the frame image data stream to be processed; the difference marker sequence includes the length of unchanged pixel segments and / or changed pixel data blocks. The second processing unit is used to encode the difference marker sequence of each frame image according to a preset encoding rule to obtain a differential compressed data packet.
9. An electronic device, characterized in that, The computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the method as described in any one of claims 1-7.
10. A computer-readable storage medium comprising program code that, when the program product is run on an electronic device, causes the electronic device to perform the method described in any one of claims 1-7.