Image encoding method and apparatus, image decoding method and apparatus, and device and medium

By dividing the image into multiple data packets and encoding it, the problem of excessive load on the data transmission bus in traditional technology is solved, and the image data compression and the improvement of the number and gray scale of the LED array are achieved.

WO2025130609A1PCT designated stage expired Publication Date: 2025-06-26NANNING LIAOWANG AUTOMOTIVE LAMPS CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/136683
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-22
Filing Date
2024-12-04
Publication Date
2025-06-26

AI Technical Summary

Technical Problem

In traditional technology, each pixel corresponds to one byte and must include a positional relationship of pixels, resulting in the number and grayscale order of the LEDs of the LED array being limited by the full load load of the data transmission bus, which is difficult to increase.

Method used

By acquiring the image to be transmitted and dividing the image into several first regions based on the packet size and pixel encoding value size of the communication protocol, each region corresponds to a data packet, encodes and decodes, reducing the number of bits encoded at the position, and realizing the compression of image data.

Benefits of technology

This method reduces the transmission amount of image data, increases the number of LED arrays and the gray scale, and solves the problem of excessive load on the data transmission bus in traditional technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024136683_26062025_PF_FP_ABST
    Figure CN2024136683_26062025_PF_FP_ABST
Patent Text Reader

Abstract

An image encoding method, comprising: acquiring an image to be transmitted; acquiring a target quantity, and dividing said image into a plurality of first areas on the basis of the target quantity, wherein each first area corresponds to one data packet, each data packet has a unique identifier, and the target quantity is obtained on the basis of the size of a data packet of a communication protocol and an encoded value of one pixel; and encoding pixels in each first area, and placing encoding results of the pixels in each first area into the corresponding data packet to obtain an image encoded packet.
Need to check novelty before this filing date? Find Prior Art

Description

Image encoding method, image decoding method, device, equipment and medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on December 22, 2023, with application number 2023117875866 and application name “Image encoding method, image decoding method, device, equipment and medium”, and the Chinese patent application filed with the China Patent Office on December 22, 2023, with application number 2023117857321 and application name “Image transmission method, device, equipment and medium”, all contents of which are incorporated by reference into this application. Technical Field

[0003] The present application provides an image encoding method, an image decoding method, an apparatus, a computer device, a storage medium, and a computer-readable instruction product. Background Art

[0004] With the development of intelligent and interactive vehicles, more and more automotive components are undergoing intelligent innovation to keep pace with this trend. In exterior design, a growing number of products with intelligent interaction are emerging, including digital projection headlights, intelligent interactive taillights, and intelligent interactive welcome lights. Combined with the increasing number of cameras and radars in vehicles, as well as more user-friendly and personalized graphic displays, the development of intelligent interaction has entered a new chapter. To better achieve human-computer interaction, higher requirements are being placed on display brightness, color, and detail.

[0005] However, the inventors realized that in traditional technology, each pixel corresponds to one byte, and the positional relationship of the pixels must be included to ensure the accuracy of encoding and decoding. Since the number of LEDs and grayscale levels of the LED array are limited by the full load of the data transmission bus, and the amount of image data is increasing, it is difficult to increase the number of LED arrays and grayscale levels under the existing data transmission bus. Summary of the Invention

[0006] According to various embodiments disclosed in the present application, an image encoding method, an image decoding method, an apparatus, a computer device, a computer-readable storage medium, and a computer-readable instruction product are provided.

[0007] Provided is an image encoding method, comprising:

[0008] Obtaining the image to be transmitted;

[0009] Obtaining a target number, and dividing the image to be transmitted into a plurality of first regions based on the target number, each first region corresponding to a data packet, each data packet having a unique identifier, the target number being obtained based on the size of a data packet of a communication protocol and the size of a coded value of a pixel; and

[0010] Pixels in each first area are encoded, and encoding results of the pixels in each first area are placed in a corresponding data packet to obtain an image encoding packet.

[0011] In one embodiment, encoding the pixels in each first region and placing the encoding results of the pixels in each first region in a corresponding data packet to obtain an image encoding packet includes:

[0012] Obtaining an association between a preset pixel position and a byte in a data packet and a bit in the byte;

[0013] Reading pixel values ​​from the first area according to a preset pixel position sequence; and

[0014] The pixel value is encoded, and based on the association relationship, the encoded pixel value is stored in a corresponding bit of the corresponding byte of the corresponding data packet.

[0015] In one embodiment, before dividing the image to be transmitted into a plurality of first areas, the method further includes:

[0016] Acquire a maximum grayscale of pixels of the image to be transmitted, and determine the number of bits of the encoding value of each pixel based on the maximum grayscale;

[0017] determining a first number of code values ​​of the pixel that can be stored in one byte based on the number of bits;

[0018] Obtaining a second number of bytes contained in a data packet corresponding to the communication protocol;

[0019] determining a third number of pixels corresponding to the data packet based on the first number and the second number; and

[0020] Based on the third number and the arrangement order of the pixels in the image to be transmitted, a pixel position corresponding to each data packet is determined, and the first area is determined based on the pixel position.

[0021] In one embodiment, the method further comprises:

[0022] When the number of bits corresponding to the code value of the last pixel in a byte is less than the size of the code value of the pixel, the remaining number of bits of the code value of the last pixel is stored in the next byte; and

[0023] When the number of remaining bits of the last byte of a data packet is insufficient to store the coded value of a pixel, the number of remaining bits is set to a corresponding value.

[0024] In one embodiment, encoding the pixels in each first region and placing the encoding results of the pixels in each first region in a corresponding data packet to obtain an image encoding packet includes:

[0025] Obtaining the number of refresh controllers of the display terminal corresponding to the image to be transmitted;

[0026] Dividing the image to be transmitted based on the number to obtain a plurality of second areas; and the second areas include a plurality of the first areas; and

[0027] The image coding packets corresponding to the first area are sequentially acquired from the second area and transmitted to the display end.

[0028] In one embodiment, sequentially acquiring the image coding packets corresponding to the first area from the second area and transmitting them to the display terminal includes:

[0029] sorting the second regions;

[0030] Based on the sorting result, determining the current second region, obtaining the image coding packet corresponding to the first region from the current second region, and transmitting the image coding packet to the display end; and

[0031] Based on the sorting result, the next second area is determined, and after the next second area is used as the current second area, the steps of obtaining the image coding package corresponding to the first area from the current second area and transmitting it to the display end are continued until the image coding packages corresponding to the image to be transmitted are all transmitted to the display end.

[0032] In one embodiment, the acquiring of the image coding packets corresponding to the first area from the second area in sequence and transmitting the image coding packets to the display end includes:

[0033] After all the data packets of the image to be transmitted have been sent, a refresh code packet with a preset fixed identifier is obtained; and

[0034] The refresh code packet with the fixed identifier is sent to the display end, where the refresh code packet with the fixed identifier is used to instruct the display end to refresh the screen.

[0035] In one embodiment, the method further comprises:

[0036] receiving an image coding packet of an image to be transmitted sent by an image sending end;

[0037] determining, based on the identifier of the image coding packet, a first region in the second region to which the image coding packet belongs; and

[0038] The image coding packet is decoded to obtain pixel values, and the obtained pixel values ​​are updated to the first area.

[0039] In one embodiment, the method further comprises:

[0040] When receiving a refresh coding packet with a fixed identifier, counting the identifiers of the received non-refreshed image coding packets; and

[0041] When the number of identifiers of the received unrefreshed image coding packets is less than the number of identifiers of the standard image coding packets of the image to be transmitted, the received unrefreshed image coding packets are deleted, and the image coding packets of the image to be transmitted sent by the image sending end are continued to be received.

[0042] An image decoding method, comprising:

[0043] Get the data packet to be decoded;

[0044] Determining a corresponding first region based on an identifier of the data packet, where each data packet has a unique identifier and corresponds to a first region, and the first region is obtained by dividing the image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; and

[0045] The encoded value in the data packet is decoded to obtain a pixel value of the first area.

[0046] In one embodiment, decoding the encoded value in the data packet to obtain the pixel value of the first area includes:

[0047] Decoding the encoded value in the data packet to obtain a pixel value; and

[0048] The positions of the pixel values ​​are determined based on a correspondence between a sequence of the coded values ​​in the data packet and pixel positions of the pixels in the first area.

[0049] Provided is an image encoding apparatus, comprising:

[0050] An image to be transmitted and encoded image acquisition module is used to acquire an image to be transmitted and encoded image;

[0051] a division module, configured to obtain a target number and divide the image to be transmitted into a plurality of first regions based on the target number, each first region corresponding to a data packet, each data packet having a unique identifier, the target number being the size of a data packet based on the communication protocol and the size of a coding value of one pixel, the image to be encoded being divided into a plurality of sub-regions, each sub-region corresponding to a data packet, each data packet having a unique identifier;

[0052] The encoding module is used to encode the pixels in each first area and place the encoding results of the pixels in each first area in the corresponding data packet to obtain an image encoding packet, encode the pixels in each sub-area, and place it in the corresponding data packet.

[0053] An image decoding device, comprising:

[0054] A module for obtaining data packets to be decoded, used for obtaining data packets to be decoded;

[0055] a first region acquisition module, configured to determine a corresponding first region based on an identifier of the data packet, wherein each data packet has a unique identifier and corresponds to a first region, and the first region is obtained by dividing the image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel;

[0056] A decoding module is used to decode the encoded value in the data packet to obtain the pixel value of the first area.

[0057] A computer device includes a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processors, the one or more processors execute the steps of the method described in any one of the above embodiments.

[0058] One or more computer-readable storage media storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the method described in any one of the above embodiments.

[0059] A computer-readable instruction product includes computer-readable instructions, which, when executed by one or more processors, implement the steps of the method described in any one of the above embodiments.

[0060] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0062] FIG1 is a diagram showing an application environment of an image coding method according to an embodiment;

[0063] FIG2 is a schematic diagram of a flow chart of an image encoding method according to an embodiment;

[0064] FIG3 is a schematic diagram of a flow chart of an image transmission method according to an embodiment;

[0065] FIG4 is a schematic diagram of a flow chart of an image decoding method according to an embodiment;

[0066] FIG5 is a structural block diagram of an image encoding apparatus according to an embodiment;

[0067] FIG6 is a structural block diagram of an image decoding device according to an embodiment;

[0068] FIG7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0070] The image encoding method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. The vehicle terminal 102 communicates with the headlight control module 104 through a network. The vehicle terminal 102 can be referred to as the first image processing party, or the controller of the vehicle below; the headlight control module 104 can be referred to as the second image processing party, or the intelligent display device in the vehicle, and the intelligent display device can be implemented through an LED array. The communication method between the vehicle controller and the intelligent display device can include at least one of the CANFD 5M baud rate communication method and the in-vehicle Ethernet method, which is not specifically limited here. Data transmission through the in-vehicle Ethernet can increase the data transmission bandwidth, thereby reducing the bus load bottleneck when transmitting large amounts of data.

[0071] The vehicle terminal 102 obtains the image to be transmitted; based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel, the image to be transmitted is divided into several first areas, each first area corresponds to a data packet, and each data packet has a unique identifier; the pixels in each first area are encoded and placed in the corresponding data packet, and then the encoded data packet is sent to the headlight control module 104 for display.

[0072] The communication method between the vehicle terminal 102 and the vehicle light control module 104 can adopt a CANFD 5M baud rate communication method or an Ethernet communication method, which is not specifically limited here.

[0073] In an exemplary embodiment, as shown in FIG2 , an image encoding method is provided. The method is described by taking the vehicle terminal in FIG1 as an example, and includes the following steps 202 to 206:

[0074] S202: Acquire the image to be transmitted.

[0075] Specifically, the image to be transmitted can be a video or a static image. If it is a video, the image to be transmitted in this embodiment is illustrated by taking a frame of image in the video as an example, and the images of other video frames are processed in the same way. The processing of each video frame can be parallel processing or serial processing, which is not specifically limited here.

[0076] S204: Obtain a target number, and divide the image to be transmitted into a plurality of first areas based on the target number, each of the first areas corresponds to a data packet, and each data packet has a unique identifier. The target number is obtained based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel.

[0077] The communication protocol can be CANFD 5M baud rate or a communication protocol corresponding to Ethernet. The data packet size of the communication protocol is the size of a data packet. In this embodiment, the maximum data transmitted per CANFD data packet is 64 bytes. The size of the encoding value of a pixel is determined based on the grayscale of the pixel. For example, if the grayscale is 32, the encoding value of a pixel is 5 bits.

[0078] In this way, based on the size of the data packet and the size of the encoding value of a pixel, it can be determined how many pixel encoding values ​​a data packet can store. This number is the target number, and then the image to be transmitted is divided into several first areas based on this target number.

[0079] In this embodiment, 64 bytes / 5 bits=102 pixels, so every 102 pixels are divided into a first area.

[0080] In this embodiment, for statistical convenience, the pixels in the first region are adjacent. In an optional embodiment, the pixels in the encoded image are arranged in order from top to bottom and from left to right, and then based on the sorted pixels, every 102 pixels are divided into a first region.

[0081] In other embodiments, if the size of the data packet of the communication protocol is other values, or the grayscale of the pixel is other values, that is, the size of the pixel coding value has changed, then the number of pixel coding values ​​that a data packet can store can be re-determined, and then the image to be transmitted can be divided into several first areas based on the target number.

[0082] In an optional embodiment, the target number can be pre-calculated and stored, so that it only needs to be obtained and used directly each time. It only needs to be recalculated and stored when the size of the communication protocol data packet and / or the grayscale of the pixel changes.

[0083] S206: Encode the pixels in each first area, and put the encoding results of the pixels in each first area into a corresponding data packet to obtain an image encoding packet.

[0084] The pixels in each first region may be encoded by parallel encoding, that is, each first region corresponds to a thread and then encoded. In other embodiments, serial encoding may also be performed, that is, serial encoding is performed based on the order of arrangement of the first regions.

[0085] The encoding of each pixel in the first area can be performed in a certain order, so that each bit in the data packet represents the pixel value without representing the position of the pixel. The order can be from top to bottom and from left to right.

[0086] It should be noted that in this embodiment, one pixel value corresponds to one lamp bead of a vehicle lamp, such as an LED lamp.

[0087] The above-mentioned image encoding method, after acquiring the image to be transmitted, divides the image to be transmitted into several first areas based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel, and each first area corresponds to a data packet. In this way, there is no need to encode the position during encoding, which can reduce the number of bits of the position encoding, thereby compressing the image data, reducing the transmission amount of image data, and increasing the number of LED arrays and the grayscale level.

[0088] In one embodiment, pixels in each first area are encoded, and the encoding results of the pixels in each first area are placed in a corresponding data packet to obtain an image encoding packet, including: obtaining an association relationship between a preset pixel position and a byte in the data packet and a bit in the byte; reading pixel values ​​from the first area according to a preset pixel position order; encoding the pixel values, and based on the association relationship, storing the encoded pixel values ​​in a corresponding bit of a corresponding byte of a corresponding data packet to obtain an image encoding packet.

[0089] This association relationship is pre-set, that is, the position of the pixel is related to the order of the coding value. In an optional embodiment, the coding value in the data packet is sorted from top to bottom and from left to right according to the position of the pixel, and each pixel corresponds to 5 bits. In other embodiments, the number of bits corresponding to each pixel can be other, which is not specifically limited here.

[0090] For the sake of order in processing, pixel values ​​are read from the first area from top to bottom and from left to right, then encoded and placed in a data packet until all pixels in the first area are encoded to obtain an image encoding packet.

[0091] In other embodiments, the arrangement order may also be other orders, which is not specifically limited here.

[0092] In an optional embodiment, before dividing the image to be transmitted into several first areas, it also includes: obtaining the maximum grayscale of the pixels of the image to be transmitted, and determining the number of bits of the encoding value of each pixel based on the maximum grayscale; determining a first number of pixel encoding values ​​that can be stored in a byte based on the number of bits; obtaining a second number of bytes contained in a data packet corresponding to the communication protocol; determining a third number of pixels corresponding to the data packet based on the first number and the second number; determining the pixel position corresponding to each data packet based on the third number and the arrangement order of pixels in the image to be transmitted, and determining the first area based on the pixel position.

[0093] The maximum grayscale is the maximum grayscale of pixels in the image to be transmitted. Based on this maximum grayscale, the number of bits of the encoding value for each pixel is determined. For example, if the maximum grayscale is 32, the number of bits of the encoding value is 5; if the maximum grayscale is 16, the number of bits of the encoding value is 4. A byte is 8 bits, and a first number of pixel encoding values ​​that can be stored is determined based on the byte. For example, if a byte is 8 bits and the number of bits of the encoding value is 5, a complete pixel encoding value can be stored, leaving 3 bits remaining. Therefore, the first number is 2. A second number of bytes contained in a data packet corresponding to the communication protocol is obtained. For example, the maximum data transmitted per frame in CAN FD is 64 bytes. Based on the first and second numbers, a third number of pixels corresponding to the data packet is determined, for example, 64*8 / 5=102 pixels. Based on the third number and the order of the pixels in the image to be transmitted, the pixel position corresponding to each data packet is determined. A first region is determined based on the pixel positions, including: pixels in the first region are adjacent. In an optional embodiment, the pixels in the encoded image are arranged in order from top to bottom and from left to right, and then based on the sorted pixels, every 102 pixels are divided into a first area.

[0094] In one embodiment, the method further includes: when the number of bits corresponding to the encoding value of the last pixel in a byte is less than the size of the encoding value of the pixel, the remaining bits of the encoding value of the last pixel are stored in the next byte; when the remaining bits of the last byte of a data packet are not enough to store the encoding value of a pixel, the remaining bits are set to the corresponding value.

[0095] As mentioned above, a byte is 8 bits, and the number of bits of the encoding value is 5, which can store a complete pixel encoding value. Then there are 3 bits left, and the first 3 bits of the encoding value of the next pixel are stored through these 3 bits, and the other 2 bits are stored in the next byte. In this way, one byte can store the encoding values ​​of multiple pixels, reducing the waste of resources and thus achieving image data compression.

[0096] For ease of understanding, during encoding, a first number of pixels are first read; the first number of pixels are encoded and placed in the current byte of the current data packet; a determination is made as to whether the number of bytes reaches a second number, the second number being determined based on the size of the data packet of the communication protocol; if the number of bytes does not reach the second number, the next byte is obtained as the current byte, and the steps of reading the first number of pixels from the image to be transmitted in a preset order are continued; if the number of bytes reaches the second number, the encoding of the current data packet of the image data to be transmitted is determined to be complete. After determining that the encoding of the current data packet of the image data to be transmitted is complete, the further step includes: determining whether the data in the data packet reaches a third number, the third number being determined based on the image size and the data packet size; if the number of data packets does not reach the third number, the next data packet is obtained as the current data packet, and the steps of reading the first number of pixels from the image to be transmitted in a preset order are continued; if the number of data packets reaches the third number, the encoding of the image data to be transmitted is completed. The third number is the number of data packets required for one image to be transmitted.

[0097] It should be noted that if the remaining bits of a byte cannot hold the data of a pixel, the excess data is placed in the next byte, with the bits arranged from low to high. The data packet includes a data packet identifier, which is associated with the position of each pixel in the image to be transmitted.

[0098] The first image processor obtains the image to be transmitted and encodes it to obtain a number of image encoding packets, each corresponding to a first region of the image to be transmitted. The processor also obtains the number of refresh controllers on the display corresponding to the image to be transmitted. Based on the number of refresh controllers, the image to be transmitted is divided into a number of second regions, each of which includes a number of first regions. The processor then sequentially obtains image encoding packets corresponding to the first regions from the second regions and transmits them to the display. This data packet is associated with the pixel position, eliminating the need to encode the position during encoding. This reduces the number of bits in the position encoding, enabling image data compression, reducing the amount of image data transmitted, and increasing the number of LED arrays and grayscale levels.

[0099] In an exemplary embodiment, as shown in FIG3 , an image transmission method is provided. The method is described by taking the vehicle terminal in FIG1 as an example, and includes the following steps 302 to 306.

[0100] S302: Obtain the number of refresh controllers of the display terminal corresponding to the image to be transmitted.

[0101] In this embodiment, the display data is split into N packets of 64 bytes each. For example, a monochrome image with a resolution of 306x63 pixels and 32 grayscale levels requires 12,049 bytes of data, which needs to be split into 188 packets. These N packets are assigned fixed CAN IDs based on their corresponding display screen locations. For example, the IDs assigned to the split packets are 0x001-0x0BC.

[0102] The number of refresh controllers refers to the number of MCUs used for image display included in the second image processing unit. For example, the vehicle terminal's headlight display unit includes three MCUs for refreshing the image, and each MCU has a fixed refresh area. In other embodiments, the number of refresh controllers on the display terminal can be other numbers, which are not detailed here.

[0103] S304: Divide the image to be transmitted based on the quantity to obtain a plurality of second regions; and the second regions include a plurality of first regions.

[0104] To improve transmission efficiency, the transmitted image is divided into several second regions based on the number of MCUs. For example, if there are three MCUs, there are three second regions, and each second region includes several first regions. Since the image coding packets corresponding to each first region are fixed, the image coding packets included in the second region are also fixed.

[0105] S306: Obtain image coding packets corresponding to the first area from the second area in sequence, and transmit them to the display end.

[0106] In order to ensure processing efficiency, the coded packets are sent in turn, that is, the second areas are sorted, and then the image coded packets are obtained from the first second area in this order and sent to the display end, and then the image coded packets are obtained from the second second area and sent to the display end, until the traversal of the second area is completed, and then the image coded packets are obtained from the first second area and sent to the display end, until all the image coded packets are sent.

[0107] In an optional embodiment, image coding packets corresponding to the first area are sequentially obtained from the second area and transmitted to the display end, including: sorting each second area; determining the current second area based on the sorting result, and obtaining the image coding packet corresponding to the first area from the current second area, and transmitting it to the display end; determining the next second area based on the sorting result, and taking the next second area as the current second area, and continuing to execute the steps of obtaining the image coding packet corresponding to the first area from the current second area and transmitting it to the display end, until all image coding packets corresponding to the image to be transmitted are transmitted to the display end.

[0108] For example, when sending CANFD data packets, the three MCUs receive the CAN IDs in turn. For example, MCU1 receives CAN IDs 0x001-0x03E, MCU2 receives CAN IDs 0x03F-0x07E, and MCU3 receives CAN IDs 0x07F-0x0BC. The CAN IDs sent on the transmitter are in the following order: 0x03F, 0x001, 0x07F, 0x040, 0x002, 0x080, and so on. That is, the coded packet 0x03F is sent to MCU1 first, then the coded packet 0x001 is sent to MCU1, then the coded packet 0x07F is sent to MCU3, the coded packet 0x040 is sent to MCU1 first, then the coded packet 0x002 is sent to MCU2, and finally the 0x080 is sent to MCU3.

[0109] The above-mentioned image transmission method obtains the image to be transmitted, and obtains several image coding packets after encoding the image to be transmitted, each of the image coding packets corresponds to a first area of ​​the image to be transmitted; obtains the number of refresh controllers of the display end corresponding to the image to be transmitted; divides the image to be transmitted based on the number to obtain several second areas; and the second areas include several first areas; obtains the image coding packets corresponding to the first areas from the second areas in turn, and transmits them to the display end, so that the data packets are related to the position of the pixel, so that the position does not need to be encoded during encoding, which can reduce the number of bits of the position encoding, thereby being able to compress the image data, reduce the transmission amount of the image data, and increase the number and grayscale level of the LED array.

[0110] In an optional embodiment, the image coding packets corresponding to the first area are obtained from the second area in sequence and transmitted to the display end, which includes: after all the data packets of the image to be transmitted are sent, obtaining a refresh coding packet with a preset fixed identifier; sending the refresh coding packet with the fixed identifier to the display end, and the refresh coding packet with the fixed identifier is used to instruct the display end to refresh the screen.

[0111] The refresh code packet with a fixed identifier is used to instruct the display end to refresh the screen. It is sent to each refresh controller of the display end, that is, three MCUs, so that the three MCUs can refresh the page at the same time.

[0112] After a frame of picture data is sent, that is, after the first image processing party determines that all data packets of the image to be transmitted have been sent, it obtains a refresh coding packet with a pre-set fixed identifier and sends a refresh frame with a fixed identifier. After receiving this control instruction, the MCUs of the three display ends refresh the screen at the same time to complete the screen display.

[0113] In one embodiment, an image coding packet of an image to be transmitted sent by an image transmitting end is received; a first area in a second area to which the image coding packet belongs is determined based on an identifier of the image coding packet; the image coding packet is decoded to obtain pixel values, and the obtained pixel values ​​are updated to the first area.

[0114] This embodiment describes a processing method for a display terminal in a vehicle, which is used to display an image. The display terminal determines the first region of the second region to which the image coding packet belongs based on the identifier of the image coding packet. Because the identifier of the image coding packet is associated with the first region, and the first region is associated with the second region, the corresponding refresh controller can be determined based on the image coding packet. The refresh controller then decodes the image coding packet to obtain pixel values ​​and updates each obtained pixel value to the corresponding position in the first region. Each data packet's identifier corresponds to a first region, meaning that each first region corresponds to a data packet. Each data packet has a unique identifier, such as a CAN ID number. This allows the location corresponding to the stored coded value to be determined based on the packet identifier. Data packets are associated with pixel positions, so decoding is performed by decoding the coded values ​​in the data packet to obtain the pixel values ​​of the subregion. The pixel position is related to the order of the coded values. In an optional embodiment, the coded values ​​in the data packet are ordered from top to bottom and left to right based on pixel position, with each pixel corresponding to 5 bits. In other embodiments, the number of bits corresponding to each pixel can be other, and this is not specifically limited here. Based on this order, each coded value in the data packet is decoded according to 5 bits per pixel, and the position of the corresponding pixel is determined according to the decoding order, thereby achieving decoding.

[0115] In one embodiment, the method further includes: when a refresh coding packet with a fixed identifier is received, counting the identifiers of the received unrefreshed image coding packets; when the number of identifiers of the received unrefreshed image coding packets is less than the number of identifiers of the standard image coding packets of the images to be transmitted, deleting the received unrefreshed image coding packets, and continuing to receive the image coding packets of the images to be transmitted sent by the image sending end.

[0116] In this embodiment, if the number of canids of the received data packets in a certain frame is less, all data packets in the frame are deleted and not displayed. Therefore, in this embodiment, the display terminal counts the number of identifiers of the received unrefreshed image coding packets. If this number is less than the number of identifiers of the standard image coding packets of the image to be transmitted, the received unrefreshed image coding packets are deleted.

[0117] In the above embodiment, the order of the pixel coding values ​​includes the pixel position information, so there is no need to occupy the coding bits, and one byte can include the coding values ​​of multiple pixels, which greatly reduces the data volume of the image and can reduce the bus load during data transmission.

[0118] In an exemplary embodiment, as shown in FIG4 , an image decoding method is provided. The method is described by taking the vehicle light control module in FIG1 as an example, and includes the following steps 402 to 406.

[0119] S402: Obtain a data packet to be decoded.

[0120] The data packets to be decoded are sent by the vehicle terminal to the headlight control module. After receiving the data packets to be decoded, the headlight control module first caches the data packets to be decoded and then processes them in sequence.

[0121] S404: Determine the corresponding first area based on the identifier of the data packet, each data packet has a unique identifier, each data packet corresponds to a first area, and the first area is obtained by dividing the image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel.

[0122] The identifier of each data packet corresponds to a first area, that is, each first area corresponds to a data packet, and each data packet has a unique identifier, such as a CAN ID number, so that the position corresponding to the stored coding value can be determined based on the identifier of the data packet.

[0123] S406: Decode the coded value in the data packet to obtain the pixel value of the first area.

[0124] The data packet is related to the position of the pixel, so the coded value in the data packet is decoded to obtain the pixel value of the first area, thereby achieving decoding.

[0125] In the above-mentioned image decoding method, the identifier of the data packet corresponds to the first region of the encoded image, so that the first region can be determined based on the identifier of the data packet and then decoded.

[0126] In an optional embodiment, decoding the coded values ​​in the data packet to obtain pixel values ​​of the first area includes: decoding the coded values ​​in the data packet to obtain pixel values; and determining the position of the pixel values ​​based on the correspondence between the sequence of the coded values ​​in the data packet and the pixel positions of the pixels in the first area.

[0127] The position of the pixel is related to the order of the code value. In an optional embodiment, the code value in the data packet is sorted from top to bottom and from left to right according to the position of the pixel, and each pixel corresponds to 5 bits. In other embodiments, the number of bits corresponding to each pixel can be other, which is not specifically limited here.

[0128] Based on this order, each coded value in the data packet is decoded according to 5 bits per pixel, and the position of the corresponding pixel is determined according to the decoding order, thereby achieving decoding.

[0129] In one embodiment, for ease of understanding, the following explanation is provided: This embodiment uses CANFD 5M baud rate communication for data transmission. For the real-time transmission of data from the LED array, the data sending node compresses the data according to different animation content. The data compression method is:

[0130] First, the image is broken down into its first regions, from left to right and top to bottom. Each first region contains the same number of pixels as can be represented by 64 bytes (the maximum data transmitted per CAN FD frame is 64 bytes). For example, a monochrome image with 32 grayscale levels and a resolution of 306*63 pixels requires 5 bits of data per 32-grayscale pixel. With 64 bytes per CAN FD frame, 102 pixels can be transmitted. Therefore, we divide the image's total of 19,584 pixels into 192 regions, each of which has a unique CAN ID number.

[0131] The brightness data of the pixels in the image are arranged and reorganized according to the areas divided above. The arrangement is carried out from left to right and from top to bottom. The reorganized pixel data are combined into bytes in sequence. Every 5 bits represent the brightness of a pixel. If the remaining bits of a byte cannot hold the data of a pixel, the excess data is placed in the next byte, and the bits are arranged from low to high.

[0132] For example, the first byte of the reorganized image data is 0x3F, and the second byte is 0xFF, which is represented by binary as 00111111, 11111111. This data indicates that the first pixel of the image has a brightness of 32 grayscales, the second pixel has a brightness of 20 grayscales, and the third pixel has a brightness of 32 grayscales.

[0133] In other embodiments, data transmission may be performed using in-vehicle Ethernet to increase the data transmission bandwidth, thereby reducing the bus load bottleneck when transmitting large amounts of data.

[0134] In the above embodiment, a 306*63 black-and-white image with 32 grayscale brightness levels is used as a reference. Without a compression algorithm, each pixel requires one byte to represent, and the data size of the image is 18.8 KB. After using the data compression algorithm, the data size of the image is reduced to 11.7 KB, a 38% reduction in data volume. Furthermore, when sending and decoding, packets do not need to be sent one by one in sequence. During decoding, the display position is determined based on the ID of the CAN packet, and then the bytes in the packet are decoded in sequence. This avoids the need to decode the previous packet first, improving efficiency.

[0135] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0136] Based on the same inventive concept, embodiments of the present application also provide an image coding device for implementing the aforementioned image coding method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more of the following image coding device embodiments can be found in the above-mentioned limitations on the image coding method and will not be further elaborated here.

[0137] In an exemplary embodiment, as shown in FIG5 , an image encoding apparatus is provided, including: an image acquisition module 501 for transmission, a division module 502 and an encoding module 503.

[0138] The image to be transmitted acquisition module 501 is used to acquire the image to be transmitted;

[0139] a division module 502 configured to obtain a target number and divide the image to be transmitted into a plurality of first regions based on the target number, each first region corresponding to a data packet, each data packet having a unique identifier, the target number being obtained based on the size of a data packet of the communication protocol and the size of a coded value of a pixel;

[0140] The encoding module 503 is configured to encode the pixels in each first region and place the encoding result of the pixels in each first region in a corresponding data packet to obtain an image encoding packet.

[0141] In one embodiment, the encoding module 503 is further used to obtain the association between the preset pixel positions and the bytes in the data packet and the bits in the bytes; read the pixel values ​​from the first area according to the preset pixel position order; encode the pixel values, and based on the association relationship, store the encoded pixel values ​​in the corresponding bits of the corresponding bytes of the corresponding data packet.

[0142] In one embodiment, the above-mentioned device also includes a first area determination module, which is used to obtain the maximum grayscale of the pixels of the image to be transmitted, determine the number of bits of the encoding value of each pixel based on the maximum grayscale; determine the first number of pixel encoding values ​​that can be stored in a byte based on the number of bits; obtain the second number of bytes contained in the data packet corresponding to the communication protocol; determine the third number of pixels corresponding to the data packet based on the first number and the second number; determine the pixel position corresponding to each data packet based on the third number and the arrangement order of pixels in the image to be transmitted, and determine the first area based on the pixel position.

[0143] In one embodiment, the above-mentioned encoding module 503 is also used to store the remaining bits of the encoding value of the last pixel in a byte in the next byte when the number of bits corresponding to the encoding value of the last pixel in a byte is less than the size of the encoding value of the pixel; when the remaining bits of the last byte of a data packet are not enough to store the encoding value of a pixel, the remaining bits are set to the corresponding value.

[0144] In one embodiment, the above device further includes

[0145] A first quantity acquisition module is used to acquire the number of refresh controllers of the display terminal corresponding to the image to be transmitted;

[0146] a dividing module, configured to divide the image to be transmitted based on the quantity to obtain a plurality of second regions; wherein the second regions include the plurality of first regions;

[0147] The transmission module is used to sequentially obtain the image coding packets corresponding to the first area from the second area and transmit them to the display end.

[0148] In one embodiment, the transmission module is also used to sort the second areas; based on the sorting result, the current second area is determined, and the image coding package corresponding to the first area is obtained from the current second area and transmitted to the display end; based on the sorting result, the next second area is determined, and after the next second area is used as the current second area, the steps of obtaining the image coding package corresponding to the first area from the current second area and transmitting it to the display end are continued until all the image coding packages corresponding to the image to be transmitted are transmitted to the display end.

[0149] In one embodiment, the above-mentioned device also includes a refresh module, which is used to obtain a refresh coding package with a preset fixed identifier after all data packets of the image to be transmitted are sent; and send the refresh coding package with the fixed identifier to the display end, and the refresh coding package with the fixed identifier is used to instruct the display end to refresh the screen.

[0150] In one embodiment, the above-mentioned device also includes a receiving module for receiving an image coding package of an image to be transmitted sent by an image sending end; determining the first area in the second area to which the image coding package belongs based on an identifier of the image coding package; decoding the image coding package to obtain pixel values, and updating the obtained pixel values ​​to the first area.

[0151] In one embodiment, the above-mentioned device also includes a coding packet processing module, which is used to count the identifiers of the received unrefreshed image coding packets when a refresh coding packet with a fixed identifier is received; when the number of identifiers of the received unrefreshed image coding packets is less than the number of identifiers of the standard image coding packets of the images to be transmitted, delete the received unrefreshed image coding packets, and continue to receive the image coding packets of the images to be transmitted sent by the image sending end.

[0152] In an exemplary embodiment, as shown in FIG6 , an image decoding apparatus is provided, including: a to-be-decoded data packet acquisition module 601, a first region acquisition module 602, and a decoding module 603.

[0153] The to-be-decoded data packet acquisition module 601 is used to acquire the to-be-decoded data packet;

[0154] A first region acquisition module 602 is configured to determine a corresponding first region based on an identifier of a data packet. Each data packet has a unique identifier and corresponds to a first region. The first region is obtained by dividing the image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel.

[0155] The decoding module 603 is configured to decode the coded value in the data packet to obtain the pixel value of the first area.

[0156] In one embodiment, the decoding module 603 is further configured to decode the coded values ​​in the data packet to obtain pixel values; and determine the positions of the pixel values ​​based on the correspondence between the sequence of the coded values ​​in the data packet and the positions of the pixels in the first area.

[0157] Each module in the above-mentioned image coding apparatus may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0158] In an exemplary embodiment, a computer device is provided, which may be a vehicle terminal. Its internal structure may be shown in FIG7 . The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, while the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, where the wireless means may be implemented via Wi-Fi, a mobile cellular network, NFC (near field communication), or other technologies. When executed by the processor, the computer-readable instructions implement an image encoding method. The display unit of the computer device is used to produce a visually visible image and may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.

[0159] Those skilled in the art will understand that the structure shown in FIG7 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0160] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein computer-readable instructions are stored in the memory, and the processor implements the following steps when executing the computer-readable instructions: obtaining an image to be transmitted; obtaining a target number, and dividing the image to be transmitted into a plurality of first areas based on the target number, each of the first areas corresponding to a data packet, each data packet having a unique identifier, and the target number being obtained based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; encoding the pixels in each first area, and placing the encoding results of the pixels in each first area in the corresponding data packet to obtain an image encoding packet.

[0161] In one embodiment, the encoding of pixels in each first area implemented when the processor executes computer-readable instructions and placing the encoding results of the pixels in each first area in a corresponding data packet to obtain an image encoding packet includes: obtaining an association relationship between a preset pixel position and a byte in the data packet and a bit in the byte; reading pixel values ​​from the first area according to a preset pixel position order; encoding the pixel values, and based on the association relationship, storing the encoded pixel values ​​in a corresponding bit of a corresponding byte in a corresponding data packet.

[0162] In one embodiment, before the processor executes the computer-readable instructions to divide the image to be transmitted into several first areas, it also includes: obtaining the maximum grayscale of the pixels of the image to be transmitted, and determining the number of bits of the encoding value of each pixel based on the maximum grayscale; determining a first number of pixel encoding values ​​that can be stored in a byte based on the number of bits; obtaining a second number of bytes contained in a data packet corresponding to the communication protocol; determining a third number of pixels corresponding to the data packet based on the first number and the second number; determining the pixel position corresponding to each data packet based on the third number and the arrangement order of pixels in the image to be transmitted, and determining the first area based on the pixel position.

[0163] In one embodiment, when the processor executes the computer-readable instructions, it also implements the following steps: when the number of bits corresponding to the encoding value of the last pixel in a byte is less than the size of the encoding value of the pixel, the remaining bits of the encoding value of the last pixel are stored in the next byte; when the remaining bits of the last byte of a data packet are not enough to store the encoding value of a pixel, the remaining bits are set to the corresponding value.

[0164] In one embodiment, when the processor executes the computer-readable instructions, it also implements the following steps: obtaining the number of refresh controllers of the display end corresponding to the image to be transmitted; dividing the image to be transmitted based on the number to obtain several second areas; and the second area includes several first areas; obtaining the image coding packets corresponding to the first area from the second area in sequence, and transmitting them to the display end.

[0165] In one embodiment, the steps of sequentially obtaining image coding packets corresponding to the first area from the second area and transmitting them to the display end implemented when the processor executes computer-readable instructions include: sorting the second areas; determining the current second area based on the sorting result, obtaining the image coding packet corresponding to the first area from the current second area, and transmitting it to the display end; determining the next second area based on the sorting result, and taking the next second area as the current second area, and continuing to obtain the image coding packet corresponding to the first area from the current second area and transmitting it to the display end, until all image coding packets corresponding to the image to be transmitted are transmitted to the display end.

[0166] In one embodiment, the processor executes computer-readable instructions to sequentially obtain image coding packets corresponding to the first area from the second area and transmit them to the display end, including: after all data packets of the image to be transmitted are sent, obtaining a refresh coding packet with a preset fixed identifier; sending the refresh coding packet with the fixed identifier to the display end, and the refresh coding packet with the fixed identifier is used to instruct the display end to refresh the screen.

[0167] In one embodiment, when the processor executes the computer-readable instructions, it further implements the following steps: receiving an image coding packet of an image to be transmitted sent by an image sending end; determining the first area in the second area to which the image coding packet belongs based on an identifier of the image coding packet; decoding the image coding packet to obtain pixel values, and updating the obtained pixel values ​​to the first area.

[0168] In one embodiment, when the processor executes computer-readable instructions, it also implements the following steps: when a refresh coding packet with a fixed identifier is received, the identifiers of the received unrefreshed image coding packets are counted; when the number of identifiers of the received unrefreshed image coding packets is less than the number of identifiers of the standard image coding packets of the images to be transmitted, the received unrefreshed image coding packets are deleted, and the image coding packets of the images to be transmitted sent by the image sending end are continued to be received.

[0169] In one embodiment, the processor executes computer-readable instructions to encode an image to be transmitted to obtain a plurality of image coding packets, including: obtaining the image to be transmitted; dividing the image to be transmitted into a plurality of sub-regions based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel, each sub-region corresponding to an image data packet, and each image data packet having a unique identifier; encoding the pixels in each sub-region and placing them in the corresponding image data packet.

[0170] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the following steps when executing the computer-readable instructions: obtaining a data packet to be decoded; determining a corresponding first area based on an identifier of the data packet, wherein each data packet has a unique identifier, each data packet corresponds to a first area, and the first area is obtained by dividing an image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; decoding the encoding value in the data packet to obtain a pixel value of the first area.

[0171] In one embodiment, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the following steps are implemented: obtaining an image to be transmitted; obtaining a target number, and dividing the image to be transmitted into a plurality of first areas based on the target number, each of the first areas corresponds to a data packet, each data packet has a unique identifier, and the target number is obtained based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; encoding the pixels in each first area, and placing the encoding results of the pixels in each first area in the corresponding data packet to obtain an image encoding packet.

[0172] In one embodiment, the computer-readable instructions implemented when executed by the processor encode the pixels in each first area and place the encoding results of the pixels in each first area in a corresponding data packet to obtain an image encoding packet, including: obtaining an association relationship between a preset pixel position and a byte in the data packet and a bit in the byte; reading pixel values ​​from the first area according to a preset pixel position order; encoding the pixel values, and based on the association relationship, storing the encoded pixel values ​​in the corresponding bit of the corresponding byte of the corresponding data packet.

[0173] In one embodiment, before the computer-readable instructions are executed by the processor to implement dividing the image to be transmitted into several first areas, they also include: obtaining the maximum grayscale of the pixels of the image to be transmitted, and determining the number of bits of the encoding value of each pixel based on the maximum grayscale; determining a first number of pixel encoding values ​​that can be stored in a byte based on the number of bits; obtaining a second number of bytes contained in a data packet corresponding to the communication protocol; determining a third number of pixels corresponding to the data packet based on the first number and the second number; determining the pixel position corresponding to each data packet based on the third number and the arrangement order of pixels in the image to be transmitted, and determining the first area based on the pixel position.

[0174] In one embodiment, when the computer-readable instructions are executed by the processor, the following steps are also implemented: when the number of bits corresponding to the encoding value of the last pixel in a byte is less than the size of the encoding value of the pixel, the remaining bits of the encoding value of the last pixel are stored in the next byte; when the remaining bits of the last byte of a data packet are not enough to store the encoding value of a pixel, the remaining bits are set to the corresponding value.

[0175] In one embodiment, when the computer-readable instructions are executed by the processor, the following steps are also implemented: obtaining the number of refresh controllers of the display end corresponding to the image to be transmitted; dividing the image to be transmitted based on the number to obtain several second areas; and the second area includes several first areas; obtaining the image coding packets corresponding to the first area from the second area in sequence, and transmitting them to the display end.

[0176] In one embodiment, the computer-readable instructions implemented when executed by the processor sequentially obtain image coding packets corresponding to the first area from the second area and transmit them to the display end, including: sorting each second area; determining the current second area based on the sorting result, and obtaining the image coding packet corresponding to the first area from the current second area, and transmitting it to the display end; determining the next second area based on the sorting result, and taking the next second area as the current second area, and continuing to execute the steps of obtaining the image coding packet corresponding to the first area from the current second area and transmitting it to the display end, until all image coding packets corresponding to the image to be transmitted are transmitted to the display end.

[0177] In one embodiment, the computer-readable instructions implemented when executed by the processor sequentially obtain image coding packets corresponding to the first area from the second area and transmit them to the display end, including: after all data packets of the image to be transmitted are sent, obtaining a refresh coding packet with a preset fixed identifier; sending the refresh coding packet with the fixed identifier to the display end, and the refresh coding packet with the fixed identifier is used to instruct the display end to refresh the screen.

[0178] In one embodiment, when the computer-readable instructions are executed by the processor, the following steps are further implemented: receiving an image coding packet of an image to be transmitted sent by an image sending end; determining the first area in the second area to which the image coding packet belongs based on an identifier of the image coding packet; decoding the image coding packet to obtain pixel values, and updating the obtained pixel values ​​to the first area.

[0179] In one embodiment, when the computer-readable instructions are executed by the processor, the following steps are also implemented: when a refresh coding packet with a fixed identifier is received, the identifiers of the received unrefreshed image coding packets are counted; when the number of identifiers of the received unrefreshed image coding packets is less than the number of identifiers of the standard image coding packets of the images to be transmitted, the received unrefreshed image coding packets are deleted, and the image coding packets of the images to be transmitted sent by the image sending end are continued to be received.

[0180] In one embodiment, the computer-readable instructions, when executed by a processor, encode an image to be transmitted to obtain a plurality of image coding packets, including: obtaining the image to be transmitted; dividing the image to be transmitted into a plurality of sub-regions based on the size of the data packet of the communication protocol and the size of the coding value of a pixel, each sub-region corresponding to an image data packet, and each image data packet having a unique identifier; encoding the pixels in each sub-region and placing them in the corresponding image data packet.

[0181] In one embodiment, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the following steps are implemented: obtaining a data packet to be decoded; determining a corresponding first area based on an identifier of the data packet, each data packet has a unique identifier, each data packet corresponds to a first area, and the first area is obtained by dividing the image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; decoding the encoding value in the data packet to obtain a pixel value of the first area.

[0182] In one embodiment, the computer-readable instructions implemented when the processor executes the encoded values ​​in the data packet to obtain pixel values ​​of the first area include: decoding the encoded values ​​in the data packet to obtain pixel values; and determining the position of the pixel values ​​based on the correspondence between the sequence of the encoded values ​​in the data packet and the pixel positions of the pixels in the first area.

[0183] In one embodiment, a computer-readable instruction product is provided, comprising computer-readable instructions, which, when executed by a processor, implement the following steps: obtaining an image to be transmitted; obtaining a target number, and dividing the image to be transmitted into a plurality of first areas based on the target number, each of the first areas corresponding to a data packet, each data packet having a unique identifier, the target number being obtained based on the size of a data packet of a communication protocol and the size of a coding value of a pixel; encoding pixels in each first area, and placing the coding results of the pixels in each first area in a corresponding data packet to obtain an image coding packet.

[0184] In one embodiment, the computer-readable instructions implemented when executed by the processor encode the pixels in each first area and place the encoding results of the pixels in each first area in a corresponding data packet to obtain an image encoding packet, including: obtaining an association relationship between a preset pixel position and a byte in the data packet and a bit in the byte; reading pixel values ​​from the first area according to a preset pixel position order; encoding the pixel values, and based on the association relationship, storing the encoded pixel values ​​in the corresponding bit of the corresponding byte of the corresponding data packet.

[0185] In one embodiment, before the computer-readable instructions are executed by the processor to implement dividing the image to be transmitted into several first areas, they also include: obtaining the maximum grayscale of the pixels of the image to be transmitted, and determining the number of bits of the encoding value of each pixel based on the maximum grayscale; determining a first number of pixel encoding values ​​that can be stored in a byte based on the number of bits; obtaining a second number of bytes contained in a data packet corresponding to the communication protocol; determining a third number of pixels corresponding to the data packet based on the first number and the second number; determining the pixel position corresponding to each data packet based on the third number and the arrangement order of pixels in the image to be transmitted, and determining the first area based on the pixel position.

[0186] In one embodiment, when the computer-readable instructions are executed by the processor, the following steps are also implemented: when the number of bits corresponding to the encoding value of the last pixel in a byte is less than the size of the encoding value of the pixel, the remaining bits of the encoding value of the last pixel are stored in the next byte; when the remaining bits of the last byte of a data packet are not enough to store the encoding value of a pixel, the remaining bits are set to the corresponding value.

[0187] In one embodiment, when the computer-readable instructions are executed by the processor, the following steps are also implemented: obtaining the number of refresh controllers of the display end corresponding to the image to be transmitted; dividing the image to be transmitted based on the number to obtain several second areas; and the second area includes several first areas; obtaining the image coding packets corresponding to the first area from the second area in sequence, and transmitting them to the display end.

[0188] In one embodiment, the computer-readable instructions implemented when executed by the processor sequentially obtain image coding packets corresponding to the first area from the second area and transmit them to the display end, including: sorting each second area; determining the current second area based on the sorting result, and obtaining the image coding packet corresponding to the first area from the current second area, and transmitting it to the display end; determining the next second area based on the sorting result, and taking the next second area as the current second area, and continuing to execute the steps of obtaining the image coding packet corresponding to the first area from the current second area and transmitting it to the display end, until all image coding packets corresponding to the image to be transmitted are transmitted to the display end.

[0189] In one embodiment, the computer-readable instructions implemented when executed by the processor sequentially obtain image coding packets corresponding to the first area from the second area and transmit them to the display end, including: after all data packets of the image to be transmitted are sent, obtaining a refresh coding packet with a preset fixed identifier; sending the refresh coding packet with the fixed identifier to the display end, and the refresh coding packet with the fixed identifier is used to instruct the display end to refresh the screen.

[0190] In one embodiment, when the computer-readable instructions are executed by the processor, the following steps are further implemented: receiving an image coding packet of an image to be transmitted sent by an image sending end; determining the first area in the second area to which the image coding packet belongs based on an identifier of the image coding packet; decoding the image coding packet to obtain pixel values, and updating the obtained pixel values ​​to the first area.

[0191] In one embodiment, when the computer-readable instructions are executed by the processor, the following steps are also implemented: when a refresh coding packet with a fixed identifier is received, the identifiers of the received unrefreshed image coding packets are counted; when the number of identifiers of the received unrefreshed image coding packets is less than the number of identifiers of the standard image coding packets of the images to be transmitted, the received unrefreshed image coding packets are deleted, and the image coding packets of the images to be transmitted sent by the image sending end are continued to be received.

[0192] In one embodiment, the computer-readable instructions, when executed by a processor, encode an image to be transmitted to obtain a plurality of image coding packets, including: obtaining the image to be transmitted; dividing the image to be transmitted into a plurality of sub-regions based on the size of the data packet of the communication protocol and the size of the coding value of a pixel, each sub-region corresponding to an image data packet, and each image data packet having a unique identifier; encoding the pixels in each sub-region and placing them in the corresponding image data packet.

[0193] In one embodiment, a computer-readable instruction product is provided, comprising computer-readable instructions, which, when executed by a processor, implement the following steps: obtaining a data packet to be decoded; determining a corresponding first area based on an identifier of the data packet, wherein each data packet has a unique identifier, each data packet corresponds to a first area, and the first area is obtained by dividing an image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; and decoding the encoding value in the data packet to obtain a pixel value of the first area.

[0194] In one embodiment, the computer-readable instructions implemented when the processor executes the encoded values ​​in the data packet to obtain pixel values ​​of the first area include: decoding the encoded values ​​in the data packet to obtain pixel values; and determining the position of the pixel values ​​based on the correspondence between the sequence of the encoded values ​​in the data packet and the pixel positions of the pixels in the first area.

[0195] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0196] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0197] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for encoding an image, wherein: The method comprises: Acquire the image to be transmitted; Obtaining a target number, and dividing the image to be transmitted into a plurality of first areas based on the target number, each of the first areas corresponds to a data packet, each data packet has a unique identifier, and the target number is obtained based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; The pixels in each first area are encoded, and the encoding results of the pixels in each first area are placed in a corresponding data packet to obtain an image encoding packet.

2. The method according to claim 1, wherein: The step of encoding the pixels in each first region and placing the encoding result of the pixels in each first region in a corresponding data packet to obtain an image encoding packet includes: Obtaining an association relationship between a preset pixel position and a byte in a data packet and a bit in the byte; Reading pixel values ​​from the first area according to a preset pixel position sequence; The pixel value is encoded, and based on the association relationship, the encoded pixel value is stored in the corresponding bit of the corresponding byte of the corresponding data packet to obtain an image encoding packet.

3. The method according to claim 2, wherein: Before dividing the image to be transmitted into a plurality of first areas, the method further includes: Acquire the maximum grayscale of the pixels of the image to be transmitted, and determine the number of bits of the encoding value of each pixel based on the maximum grayscale; Determine a first number of encoded values ​​of the pixel that can be stored in one byte based on the number of bits; Obtaining a second number of bytes contained in a data packet corresponding to the communication protocol; Determine a third number of pixels corresponding to the data packet based on the first number and the second number; Based on the third number and the arrangement order of the pixels in the image to be transmitted, a pixel position corresponding to each data packet is determined, and based on the pixel position, the first area is determined.

4. The method according to claim 3, wherein: The method further comprises: When the number of bits corresponding to the encoding value of the last pixel in a byte is smaller than the size of the encoding value of the pixel, the remaining number of bits of the encoding value of the last pixel is stored in the next byte; When the remaining number of bits of the last byte of a data packet is insufficient to store the coded value of a pixel, the remaining number of bits is set to a corresponding value.

5. The method according to claim 1, wherein: The step of encoding the pixels in each first region and placing the encoding result of the pixels in each first region in a corresponding data packet to obtain an image encoding packet includes: Acquire the number of refresh controllers of the display terminal corresponding to the image to be transmitted; Dividing the image to be transmitted based on the number to obtain a plurality of second areas; and the second areas include a plurality of the first areas; The image coding packets corresponding to the first area are sequentially acquired from the second area, and transmitted to the display end.

6. The method according to claim 5, wherein: The acquiring the image coding packets corresponding to the first area from the second area in sequence and transmitting them to the display end includes: sorting each of the second regions; Based on the sorting result, determine the current second area, obtain the image coding packet corresponding to the first area from the current second area, and transmit it to the display end; Based on the sorting result, the next second area is determined, and after the next second area is used as the current second area, the step of obtaining the image coding package corresponding to the first area from the current second area and transmitting it to the display end is continued until the image coding packages corresponding to the image to be transmitted are all transmitted to the display end.

7. The method according to claim 5, wherein: The step of sequentially acquiring the image coding packets corresponding to the first area from the second area and transmitting the image coding packets to the display end includes: When all the data packets of the image to be transmitted are sent, a refresh coding packet with a preset fixed identifier is obtained; The refresh code packet with the fixed identifier is sent to the display end, and the refresh code packet with the fixed identifier is used to instruct the display end to refresh the screen.

8. The method according to any one of claims 5 to 7, wherein: The method further comprises: Receiving an image coding packet of an image to be transmitted sent by an image sending end; Determine, based on the identifier of the image coding packet, a first region in the second region to which the image coding packet belongs; The image coding packet is decoded to obtain pixel values, and each of the obtained pixel values ​​is updated to the first area.

9. The method according to claim 8, wherein: The method further comprises: When receiving a refresh coding packet with a fixed identifier, counting the identifiers of the received image coding packets that have not been refreshed; When the number of identifiers of the received unrefreshed image coding packets is less than the number of identifiers of the standard image coding packets of the image to be transmitted, the received unrefreshed image coding packets are deleted, and the image coding packets of the image to be transmitted sent by the image sending end are continuously received.

10. An image decoding method, wherein: The method comprises: Get the data packet to be decoded; Determine a corresponding first area based on an identifier of the data packet, each data packet has a unique identifier, each data packet corresponds to a first area, and the first area is obtained by dividing the image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; The encoded value in the data packet is decoded to obtain a pixel value of the first area.

11. The method according to claim 10, wherein: The decoding of the coded value in the data packet to obtain the pixel value of the first area includes: Decoding the encoded value in the data packet to obtain a pixel value; The positions of the pixel values ​​are determined based on the correspondence between the sequence of the coded values ​​in the data packet and the pixel positions of the pixels in the first area.

12. An image transmission device, wherein: The device comprises: The module for acquiring the image to be transmitted is used to acquire the image to be transmitted; a division module, used for obtaining a target number, and dividing the image to be transmitted into a plurality of first areas based on the target number, each of the first areas corresponds to a data packet, each data packet has a unique identifier, and the target number is obtained based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; and The encoding module is used to encode the pixels in each first area, and put the encoding results of the pixels in each first area in a corresponding data packet to obtain an image encoding packet.

13. An image decoding device, wherein: The device comprises: A module for acquiring data packets to be decoded, used for acquiring data packets to be decoded; A first region acquisition module, configured to determine a corresponding first region based on an identifier of the data packet, each data packet having a unique identifier, each data packet corresponding to a first region, and the first region is obtained by dividing the image to be transmitted based on the size of the data packet of the communication protocol and the size of the encoding value of a pixel; and A decoding module is used to decode the coded value in the data packet to obtain the pixel value of the first area.

14. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, wherein: When the processor executes the computer-readable instructions, the steps of the method according to any one of claims 1 to 11 are implemented.

15. A computer-readable storage medium having computer-readable instructions stored thereon, wherein: When the computer readable instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

16. A computer-readable instruction product comprising computer-readable instructions, wherein: When the computer readable instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Image transmission method, device and equipment

    CN109788313A

  • Image encoding and decoding method and device

    CN112422969A

  • Image coding method and device and image decoding method and device

    CN116668707A

  • Ultra-low delay image coding system, method and device and storage medium

    CN116684595A

  • Image transmission method and device, computer equipment, storage medium and program product

    CN118042140A