Image processing method, device, equipment, system and readable storage medium
By selecting the encoding mode based on the contrast range of the pixel group in image compression encoding and decoding, the dependence between image data is reduced, the problems of complex calculations and high hardware overhead in the existing technology are solved, and visually lossless image compression and high efficiency are achieved. hardware resource utilization.
Patent Information
- Application Number
- CN202310221752.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
AI Technical Summary
In the existing image compression encoding and decoding methods, the dependence between image data is strong, resulting in complex calculations and increasing the hardware overhead of the LCOS projection display system.
Encoding modes with different compression errors are selected based on the contrast range of pixel groups to encode and decode image data. Group coding is used to reduce the dependence between blocks, simplify the algorithm and reduce storage bandwidth and computing overhead.
It achieves visually lossless image compression, reduces the hardware resources required for encoding and decoding, and improves image transmission quality and compression efficiency.
Smart Images

Figure CN118555378A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to an image processing method, apparatus, device, system and readable storage medium. Background Art
[0002] Liquid Crystal on Silicon (LCOS) is a reflective micron light emitting diode (MICROLCD) projection technology. With the development of LCOS high-definition projection display technology, high-definition display has become a basic requirement. Higher resolution also means the storage and transmission of larger amounts of data. The current mainstream image compression and decoding methods (H26x series and JPEG series) are based on wavelet transform or discrete cosine transform (DCT). DCT transform or wavelet transform is required to process the data, and the dependence between the previous and next data is strong, resulting in relatively complex calculations, which brings large hardware overhead (such as storage bandwidth, calculation, etc.) to the LCOS projection display driver system. Summary of the invention
[0003] The embodiments of the present application provide an image processing method, apparatus, device, system and readable storage medium, which can solve the problem of strong dependence between image data and relatively complex calculations in encoding and decoding.
[0004] In a first aspect, an image processing method is provided. The image processing method is applied to a coding device, and includes: obtaining image data including at least one block, each block including multiple pixel groups, for each pixel group, using a coding mode corresponding to the contrast range of the pixel group to encode to obtain a coding value, the compression error of different coding modes increases with the increase of the contrast range, and then outputting a whole image code stream based on the coding value of each pixel group. The whole image code stream includes the coding values and control identifiers of all pixel groups of all blocks in the image data, and the control identifier is used to indicate the coding mode / decoding mode of the pixel group.
[0005] Based on the image processing method, different coding modes with compression errors are selected based on the contrast range of the pixel group to encode multiple pixel groups respectively. The compression error varies with the error detectable threshold of the human eye, thereby achieving visual lossless compression of the image data. Compared with multi-level wavelet transformation or DCT transformation of image data to extract high-frequency and low-frequency information of the image, the dependence of the previous and next data of different blocks and pixel groups is weak. The image data is compressed by using group coding. The image data of different blocks can be compressed independently based on different coding modes. Therefore, the image compression algorithm is simplified without reducing the visual quality of the image, and the hardware overhead such as storage bandwidth and calculation required for encoding and decoding is reduced.
[0006] As a possible implementation, each of the multiple pixel groups includes a base pixel and at least one non-base pixel. When encoding, the encoding device determines the contrast range of the multiple pixel groups according to the change amplitude of the non-base pixels relative to the base pixels in each pixel group before encoding the multiple pixel groups respectively. In this way, the contrast range is determined based on the change amplitude between the pixel values of the pixels in the pixel group by utilizing the visual feature that the human eye is more sensitive to brightness changes, so that in the subsequent steps, the encoding mode of the pixel group is selected according to the contrast range, and the encoding mode with a larger compression error is used to compress and encode the pixel group with a larger pixel value amplitude, so as to ensure that the image data is visually lossless to the human eye after encoding and compression.
[0007] Optionally, when the encoding device determines the contrast range of the first pixel group among the multiple pixel groups, the absolute value of the difference between the pixel value of each non-base pixel in the first pixel group and the pixel value of the base pixel is calculated, and then the maximum value among the multiple absolute values in the first pixel group is determined. The larger the maximum value, the greater the change amplitude of the non-base pixel relative to the base pixel in the first pixel group. The contrast range of the first pixel group is determined according to the numerical interval to which the maximum value belongs. Different contrast ranges have different numerical intervals.
[0008] As a possible implementation manner, the encoding device performs differential pulse code modulation or pulse code modulation on the pixel groups according to different encoding modes.
[0009] For example, when the boundary value of the contrast range of the first pixel group is less than or equal to a preset threshold, the encoding device performs differential pulse code modulation on the first pixel group to obtain a coding value of the first pixel group, wherein the boundary value is the maximum absolute value in the numerical interval included in the contrast range.
[0010] For another example, when the boundary value of the contrast range of the first pixel group is greater than a preset threshold, the encoding device performs pulse code modulation on the first pixel group to obtain a coding value of the first pixel group.
[0011] In this way, by utilizing the characteristic that the compression ratio of differential pulse code modulation is higher than that of pulse code modulation, differential pulse code modulation is used to encode pixel groups with a smaller contrast range, and pulse code modulation is used to encode pixel groups with a larger contrast range, thereby improving the compression ratio of the encoded entire image bitstream, reducing the bandwidth requirement when decoding the entire image bitstream, and reducing hardware overhead such as bandwidth resources on the decoding side.
[0012] Optionally, in addition to using differential pulse code modulation or the difference of pulse code modulation, different coding modes can also set multiple gears in differential pulse code modulation. Optionally, multiple gears are divided according to the contrast range, and different gears correspond to different coding modes.
[0013] For example, when the boundary value of the contrast range of the first pixel group is less than or equal to a preset threshold, the encoding device divides the difference between the pixel value of each non-base pixel in the first pixel group and the pixel value of the base pixel by m to obtain the compressed coding value of each non-base pixel in the first pixel group, and then determines the coding value of the first pixel group according to the compressed coding value of each non-base pixel in the first pixel group. Wherein, m is a positive integer that increases with the increase of the boundary value, and the value of m is different in different encoding modes.
[0014] In the above-mentioned gear division scheme, pulse code modulation can also be set with a corresponding gear, which is different from the gear included in differential pulse code modulation, that is, all situations when the boundary value of the contrast range of the first pixel group is greater than the preset threshold correspond to this gear.
[0015] For example, when the boundary value of the contrast range of the first pixel group is greater than a preset threshold, the encoding device divides the high bit sampling value of the pixel value of each non-base pixel in the first pixel group by m to obtain the compressed coding value of each non-base pixel in the first pixel group, and determines the coding value of the first pixel group according to the compressed coding value of each non-base pixel in the first pixel group. Wherein, m is a positive integer that increases with the increase of the boundary value, and the value of m is different in different encoding modes.
[0016] In this way, according to the different contrast ranges of pixel groups, differential pulse code modulation and pulse code modulation with different compression errors are used to group and encode each pixel group of the image data to complete compression. In the case of differential pulse code modulation, each pixel group adopts a coding mode with different compression errors, that is, different m values, based on the different gears corresponding to the contrast range. Therefore, through simple group coding, the compression error of the pixel group in each contrast range is made to conform to the visual habits of the human eye. At the same time, the image data is not compressed at multiple levels, which reduces the computational complexity and the hardware overhead of encoding.
[0017] As a possible implementation, the plurality of pixel groups include a base pixel group and at least one non-base pixel group, the base pixel group includes at least one base pixel of the non-base pixel group, and the whole image code stream also includes pixel values of the base pixels of the base pixel group. In this way, when compressing and encoding a base pixel group and all non-base pixel groups of image data, the whole image code stream of the image data can be obtained based on the base pixel of the base pixel group as the only direct current component and combined with the difference component of the non-base pixel of each pixel group, thereby improving the compression efficiency of the whole image code stream.
[0018] As a possible implementation method, the code length of the encoding value of each pixel in the entire image code stream is a fixed value. In this way, using a fixed code length for compression encoding avoids the stream dependency of the code stream during the decoding process, provides favorable conditions for the independence and parallelism of the decoding operation, and thus improves the subsequent decoding efficiency.
[0019] In a second aspect, an image processing method is provided. The image processing method is applied to a decoding device, and includes: obtaining a whole image code stream, the whole image code stream includes the encoding values of multiple pixel groups contained in the image data and the control identifiers of the multiple pixel groups, the control identifier is used to indicate the decoding mode of the pixel group, and then according to the control identifiers of the multiple pixel groups, respectively using the decoding modes corresponding to the contrast ranges of the multiple pixel groups to decode the encoding values of the multiple pixel groups, to obtain the decoding values of the multiple pixel groups, and then outputting the image data according to the decoding values of the pixel groups contained in the whole image code stream. Among them, the compression error of different decoding modes increases with the increase of the contrast range.
[0020] Based on the image processing method, the decoding mode corresponding to each pixel group is selected based on the control identifier to decode each pixel group respectively. Compared with multi-level data processing using inverse DCT transform or inverse wavelet transform, the decoding independence and parallelism of each block and pixel group are guaranteed, and the decoding algorithm is simplified, and the computational complexity of decoding is reduced, thereby reducing the hardware overhead such as storage bandwidth and calculation required for decoding. Moreover, since the compression error corresponding to different decoding modes increases with the increase of the contrast range when the pixel group is encoded, it is guaranteed that the compression error of the image conforms to the visual habits of the human eye, thereby ensuring the image transmission quality.
[0021] As a possible implementation, each pixel group in the multiple pixel groups includes a base pixel and at least one non-base pixel. When decoding the multiple pixel groups respectively, the decoding device determines the decoding values of the base pixels of the multiple pixel groups, and based on the decoding values of the base pixels of the multiple pixel groups, respectively uses the decoding modes corresponding to the control identifiers of the multiple pixel groups to decode the encoding values of the multiple pixel groups to obtain the decoding values of the multiple pixel groups. In this way, the decoding device independently decodes the multiple pixel groups according to the decoding modes indicated by the control identifiers of each pixel group. Compared with performing multi-level wavelet transformation or DCT transformation on the image data to extract the high-frequency and low-frequency information of the image, the dependence of the previous and next data of different blocks and pixel groups is weak. At the same time, the compression error of different decoding modes varies with the contrast range of the pixel group, thereby simplifying the image compression algorithm without reducing the visual quality of the image, and reducing the hardware overhead such as storage bandwidth and calculation required for encoding and decoding.
[0022] As a possible implementation, the encoding values of the multiple pixel groups include the encoding values of a base pixel group and the encoding values of at least one non-base pixel group. The decoding device decodes the base pixel group based on the encoding values of the base pixels of the base pixel group using the decoding mode corresponding to the control identifier of the base pixel group to obtain the decoded value of the base pixel group. Among them, the non-base pixels of the base pixel group are base pixels of at least one non-base pixel group. In this way, the decoding device can subsequently decode all pixel values of the entire block according to the DC component of the pixel value of the base pixel of the base pixel group, thereby reducing the bandwidth required for decoding and reducing the hardware overhead of bandwidth resources.
[0023] As a possible implementation, when the control identifier indicates that the boundary value of the contrast range of the image data is less than or equal to a preset threshold value, the decoding mode corresponding to the control identifier includes: the decoding device multiplies the encoding value of the non-base pixel of the first pixel group by m respectively to obtain the encoding product of each non-base pixel, and then adds the encoding value of the base pixel of the first pixel group to the encoding product of each non-base pixel respectively to obtain the decoding value of each non-base pixel. Wherein, the first pixel group is one of the multiple pixel groups, m is a positive integer that increases as the encoding compression error increases, and the value of m is different in different decoding modes.
[0024] As another possible implementation method, when the control identifier indicates that the boundary value of the contrast range of the image data is greater than a preset threshold, the decoding mode corresponding to the control identifier also includes: the decoding device multiplies the encoded values of the pixels of the first pixel group by m respectively to obtain the decoded value of each pixel.
[0025] Optionally, the decoding device compensates for the compression loss during decoding, that is, the decoding device adds the encoded value of the base pixel of the first pixel group to the encoded product of each non-base pixel and the compensation value to obtain the decoded value of each non-base pixel. In this way, the output image has a smaller loss within the perceptible range of the human eye, thereby improving the image transmission quality.
[0026] For example, the compensation value is the mean value corresponding to the compression loss caused by dividing the pixel value by m.
[0027] In a third aspect, an image processing device is provided, the image processing device includes a module for implementing the image processing method provided by any one of the implementation methods in the first aspect. Exemplarily, the image processing device includes: a transceiver module and a processing module. The transceiver module is used to obtain image data, the image data includes at least one block, and each block in the at least one block includes multiple pixel groups. The processing module is used to encode the multiple pixel groups using coding modes corresponding to the contrast ranges of the multiple pixel groups, respectively, to obtain the coding values of the multiple pixel groups, and the compression error of different coding modes increases with the increase of the contrast range. The transceiver module is also used to output a whole image code stream, the whole image code stream includes the coding values of the multiple pixel groups and the control identifiers of the multiple pixel groups, the control identifiers corresponding to the contrast ranges of different pixel groups are different, and the control identifier is used to indicate the coding mode / decoding mode of the pixel group.
[0028] As a possible implementation manner, each pixel group in the multiple pixel groups includes a base pixel and at least one non-base pixel, and the processing module is also used to: determine the contrast range of the multiple pixel groups respectively according to the change amplitude of the non-base pixel in each pixel group relative to the base pixel.
[0029] As a possible implementation method, the processing module is specifically used to: calculate the absolute value of the difference between the pixel value of each non-base pixel in the first pixel group and the pixel value of the base pixel, the first pixel group being one of multiple pixel groups; determine the maximum value among the absolute values, the larger the maximum value is, the greater the change amplitude of the non-base pixel relative to the base pixel in the first pixel group is; determine the contrast range of the first pixel group according to the numerical interval to which the maximum value belongs, different contrast ranges contain different numerical intervals.
[0030] As a possible implementation method, the processing module is specifically used to: when the boundary value of the contrast range of the first pixel group is less than or equal to a preset threshold, perform differential pulse code modulation on the first pixel group to obtain a coding value of the first pixel group, and the boundary value is the maximum absolute value in the numerical interval included in the contrast range; when the boundary value of the contrast range of the first pixel group is greater than the preset threshold, perform pulse code modulation on the first pixel group to obtain a coding value of the first pixel group.
[0031] As a possible implementation method, the processing module is specifically used to: when the boundary value is less than or equal to a preset threshold, divide the difference between the pixel value of each non-base pixel in the first pixel group and the pixel value of the base pixel by m to obtain the compressed coding value of each non-base pixel in the first pixel group, where m is a positive integer that increases with the increase of the boundary value, and the value of m is different in different coding modes; determine the coding value of the first pixel group according to the compressed coding value of each non-base pixel in the first pixel group.
[0032] As a possible implementation manner, the multiple pixel groups include a base pixel group and at least one non-base pixel group, the base pixel group includes base pixels of at least one non-base pixel group, and the entire image code stream also includes pixel values of the base pixels of the base pixel group.
[0033] As a possible implementation manner, the code length of the encoding value of each pixel in the entire image code stream is a fixed value.
[0034] In a fourth aspect, an image processing device is provided, the image processing device comprising a module for implementing the image processing method provided by any one of the implementation methods in the second aspect. Exemplarily, the image processing device comprises: a transceiver module and a processing module. The transceiver module is used to obtain a whole-image code stream, the whole-image code stream includes the encoding values of multiple pixel groups contained in the image data and the control identifiers of the multiple pixel groups, the control identifier is used to indicate the decoding mode of the pixel group. The processing module is used to decode the encoding values of the multiple pixel groups using the decoding modes corresponding to the contrast ranges of the multiple pixel groups according to the control identifiers of the multiple pixel groups, to obtain the decoding values of the multiple pixel groups, and the compression errors of different decoding modes increase with the increase of the contrast range. The transceiver module is also used to output image data according to the decoding values of the pixel groups contained in the whole-image code stream.
[0035] As a possible implementation method, each pixel group in the multiple pixel groups includes a base pixel and at least one non-base pixel, and the processing module is specifically used to: determine the decoding values of the base pixels of the multiple pixel groups; based on the decoding values of the base pixels of the multiple pixel groups, respectively use the decoding modes corresponding to the control identifiers of the multiple pixel groups to decode the encoded values of the multiple pixel groups to obtain the decoding values of the multiple pixel groups.
[0036] As a possible implementation method, the coding values of multiple pixel groups include the coding values of a base pixel group and the coding values of at least one non-base pixel group, and the entire image code stream also includes the coding values of base pixels of the base pixel group. The processing module is specifically used to: based on the coding values of the base pixels of the base pixel group, use the decoding mode corresponding to the control identifier of the base pixel group to decode the base pixel group to obtain the decoding value of the base pixel group, and the non-base pixels of the base pixel group are the base pixels of at least one non-base pixel group.
[0037] As a possible implementation method, the decoding mode corresponding to the control identifier includes: multiplying the coding values of the non-basis pixels of the first pixel group by m respectively to obtain the coding product of each non-basis pixel, where m is a positive integer that increases as the coding compression error increases, and the value of m is different in different decoding modes; adding the coding value of the base pixel of the first pixel group to the coding product of each non-basis pixel respectively to obtain the decoding value of each non-basis pixel.
[0038] As a possible implementation method, the processing module is specifically used to: add the coding value of the base pixel of the first pixel group to the coding product of each non-base pixel and the compensation value to obtain the decoded value of each non-base pixel, the compensation value increases as the coding compression error increases, and the compensation value is different in different decoding modes.
[0039] Optionally, the image processing device provided in the embodiment of the present application further includes: a display unit, used to display the image obtained after decoding the entire image code stream.
[0040] It should be noted that the data processing device described in the third aspect or the fourth aspect may be a terminal device or a network device, or a chip (system) or other parts or components that can be set in the terminal device or the network device, or a device that includes a terminal device or a network device, and this application does not limit this.
[0041] In a fifth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory is used to store a set of computer instructions, and when the processor executes the set of computer instructions, it is used to execute the operating steps of the image processing method in any possible design in the first aspect or the second aspect.
[0042] Exemplarily, the electronic device refers to an encoding device or a decoding device, etc.
[0043] In a sixth aspect, a computer system is provided, comprising an encoding device and a decoding device, wherein the encoding device is communicatively connected to the decoding device, the decoding device is used to implement the method described in any one of the implementation modes of the first aspect, and the encoding device is used to implement the method described in any one of the implementation modes of the second aspect.
[0044] In addition, the technical effects of the image processing apparatus described in the third aspect, the image processing apparatus described in the fourth aspect, the computing device described in the fifth aspect, and the computer system described in the sixth aspect can refer to the technical effects of the image processing method described in the first aspect or the second aspect, and will not be repeated here.
[0045] In a seventh aspect, a computer-readable storage medium is provided, comprising: computer software instructions; when the computer software instructions are executed in a computer, the computer executes the operating steps of the method described in any possible implementation of the first aspect or the second aspect.
[0046] In an eighth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the operation steps of the method described in any possible implementation manner of the first aspect or the second aspect.
[0047] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a data flow diagram of a LCOS projection display system in the prior art;
[0049] Figure 2 It is a schematic diagram of a JPEG encoding and decoding module in the prior art;
[0050] Figure 3 It is a schematic diagram of the pretreatment process in the prior art;
[0051] Figure 4 A schematic diagram of a computer system provided in an embodiment of the present application;
[0052] Figure 5 A schematic diagram of a video encoding and decoding system provided in an embodiment of the present application;
[0053] Figure 6 A schematic diagram of the structure of an encoder and a decoder provided in an embodiment of the present application;
[0054] Figure 7 A schematic diagram of an image processing method provided in an embodiment of the present application Figure 1 ;
[0055] Figure 8 A schematic diagram of a pixel group division method provided in an embodiment of the present application;
[0056] Fig. 9 A schematic diagram of a flow chart of a coding mode determination step provided in an embodiment of the present application;
[0057] Fig.10 A schematic diagram of pixel encoding conversion provided in an embodiment of the present application;
[0058] Fig.11 A schematic diagram of a code stream encapsulation format provided in an embodiment of the present application;
[0059] Fig.12 A schematic diagram of an image processing method provided in an embodiment of the present application Figure 2 ;
[0060] Fig.13 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application Figure 1 ;
[0061] Fig.14 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application Figure 2 ;
[0062] Fig.15A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the description of the following embodiments clear and concise, an introduction to the related art is first given.
[0064] (1) Liquid Crystal on Silicon
[0065] The structural principle of Liquid Crystal on Silicon (LCOS) is to use semiconductor processes to make a driving panel on a silicon wafer, then grind the transistor flat through grinding technology and plate it with aluminum as a reflector to form a CMOS substrate. The CMOS substrate is then bonded to a glass substrate containing a transparent electrode, and liquid crystal is injected for packaging testing.
[0066] The data flow of the LCOS projection display system is as follows Figure 1 As shown in the figure, the data input is algorithm-driven, and the projection device can only input bit plane (BP) coded data, and bit plane coding requires decoding the same frame multiple times. Therefore, the LCOS projection display system needs to use the bit plane coding to complete the whole set of bit plane coding before a frame of image is completed. Figure 1 The "Storage" section in caches the entire frame of image information.
[0067] Among them, bit plane coding is also called bit plane coding, which is an effective technology to reduce inter-pixel redundancy by processing the bit plane of the image separately. It decomposes a multi-level image into a series of binary images and compresses each binary image using several well-known binary image compression methods.
[0068] Taking caching a whole frame of uncompressed data as an example, assuming 10 bits per channel, a hardware storage overhead of 29.66MB is required, which is unacceptable for the driver chip of the LCOS projection display system. Therefore, it is necessary to compress and encode the input data before storage, and then store it after reducing the amount of data. Accordingly, after the data is read out, compression and decoding must be completed before it can be transmitted to subsequent functional modules for use. The current common compression standards, such as JPEG, are compatible with compression with a large compression ratio (for example, 40), so DCT transform or wavelet transform is needed to process the data, resulting in relatively complex operations, a large number of multiplexers in the encoding and decoding circuits, and a large dependency between different data during decoding, resulting in a long decoding time.
[0069] (2) Image compression coding
[0070] Image compression coding can be divided into two categories: one type of compression is reversible, that is, the original image can be completely restored from the compressed data, and there is no information loss, which is called lossless compression coding; the other type of compression is irreversible, that is, the original image cannot be completely restored from the compressed data, and there is a certain amount of information loss, which is called lossy compression coding.
[0071] There are many ways to compress images. Commonly used encoding methods include bitmap (BMP) encoding, PCX (PC Paintbrush Exchange) encoding, tag image file format (TIFF) encoding, graphics interchange format (GIF) encoding and Joint Photographic Experts Group (JPEG) encoding. Take JPEG as an example. Figure 2 As shown in the figure below, the JPEG encoding and decoding module consists of five modules: preprocessing, wavelet transform, quantization, arithmetic coding and bitstream organization.
[0072] Preprocessing provides a unified interface for different types of images, making it easier to use the same encoder for subsequent processing, such as Figure 3 As shown, it includes steps such as image segmentation, DC shift and component transformation. Specifically, the image is first divided into several small blocks, and the subsequent compression process is encoded independently in units of blocks. When processing each block, the input data is first DC shifted to convert the unsigned input into signed data. Next, the data in the red-green-blue (RGB) color space is converted into data in the YCuCv color space.
[0073] Wavelet transform is to perform multi-level wavelet transform on the converted data to fully extract the high-frequency and low-frequency information of the image. Subsequent quantization, arithmetic coding and code stream organization are realized on the basis of wavelet transform.
[0074] Among them, arithmetic coding is embedded block coding with optimized truncation (EBCOT), which has a large computational overhead and is usually implemented using embedded system solutions. For example, embedded block coding is based on bit plane coding, and its object is a relatively small code block composed of frequency domain coefficients after wavelet transform. The coefficients in the code block contain sign information and amplitude information with many different weights. The idea of bit plane coding is to encode the most important information first, that is, to encode the amplitude information with larger weights first, so that the final code stream can obtain the characteristics of progressive transmission in combination with the subsequent code stream organization.
[0075] Although the existing compression coding technology has a high compression ratio, it often cannot achieve visual losslessness, and the coding process is complicated. It requires multiple levels of operations to obtain the final compressed code stream, which consumes a lot of hardware resources. Due to the need for multi-level wavelet transform, the blocks cannot be too small, and the dependency between the previous and next data between single blocks leads to a long decoding delay.
[0076] Based on the existing compression coding technology, the encoding and decoding process is complicated due to factors such as multi-level operations, and the hardware resource overhead is large. For example, the LCOS projection display system will frequently decompress the same frame image, such as decoding the same frame image 50 times. With an input frame rate requirement of 120 frames, the frame rate on the decompression side will be as high as 6000Hz, which will lead to a sharp expansion of the bandwidth on the decompression side, resulting in a sharp increase in the decoder area and power consumption, and a large amount of hardware resources will be consumed. Therefore, it is necessary to minimize the complexity of the compression algorithm, especially the decompression algorithm, while ensuring visual losslessness and a fixed compression ratio upper limit.
[0077] The present application provides an image processing method, wherein the encoding device determines the encoding mode adopted by the pixel group according to the contrast range of each pixel group of each block of the image data, the compression error of different encoding modes increases with the increase of the contrast range, and each pixel group is encoded using the encoding mode corresponding to the pixel group, thereby obtaining a whole image code stream. Since the compression error of the encoding mode increases with the increase of the contrast range of the pixel group, it is ensured that the compression error of the image conforms to the visual habits of the human eye, and the image transmission quality is ensured. Moreover, compared with performing multi-level wavelet transformation or DCT transformation on the image data to extract the high-frequency and low-frequency information of the image, the encoding device encodes each pixel group based on the contrast range using different encoding modes, and the dependence of the front and back data of different blocks and pixel groups is weak, and the compression of the image data is completed by using group coding, and the image data of different blocks can be compressed independently and / or in parallel, thereby simplifying the image compression algorithm without reducing the visual quality of the image, and reducing the hardware overhead such as storage bandwidth and calculation required for encoding and decoding.
[0078] The present application also provides an image processing method, in which a decoding device determines the decoding mode corresponding to the coding value of each pixel group according to the control identifier corresponding to each pixel group in the whole image code stream, and the compression error of different decoding modes increases with the increase of the contrast range. The decoding mode corresponding to the coding value of the pixel group is used to decode the coding value of each pixel group, thereby obtaining image data. Since the compression error of the decoding mode increases with the increase of the contrast range of the pixel group, the compression error of the decoded image is reduced, so that the compression error conforms to the visual habits of the human eye, and the image transmission quality is guaranteed. Moreover, compared with multi-level processing of data using inverse DCT transform or inverse wavelet transform, the decoding device performs group decoding on each pixel group according to the control identifier, which ensures the decoding independence and parallelism of each block and pixel group, reduces the dependence of the previous and next data, simplifies the decoding algorithm, reduces the computational complexity of decoding, and thus reduces the hardware overhead such as storage bandwidth and calculation required for decoding.
[0079] Figure 4 A schematic diagram of a computer system provided in an embodiment of the present application Figure 1 , which can be a video transmission system, the video processing process includes video acquisition, video encoding, video transmission, video decoding and display process, and the video transmission system includes multiple terminal devices (such as Figure 4 The terminal devices 411 to 415 are shown) and a network, wherein the network can realize the function of video transmission, and the network may include one or more network devices, which may be routers or switches, etc.
[0080] Figure 4 The terminal device shown may be, but is not limited to, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device may be a mobile phone (such as Figure 4 ), a tablet computer, a computer with wireless transceiver function (such as the terminal device 414 shown in Figure 4 ), a virtual reality (VR) terminal device (such as a terminal device 415 shown in Figure 4 The terminal device 413 shown in the figure), augmented reality (AR) terminal device, wireless terminal in industrial control, wireless terminal in self driving, wireless terminal in smart city, wireless terminal in smart home, etc.
[0081] like Figure 4As shown, in different video processing processes, the terminal devices are different. For example, in the video acquisition process, the terminal device 411 can be a camera device (such as a video camera, a camera, etc.) for road monitoring, a mobile phone, a tablet computer or a smart wearable device with a video acquisition function, etc. For another example, in the video encoding process, the terminal device 412 can be a server or a data center, and the data center can include one or more physical devices with encoding functions, such as a server, a mobile phone, a tablet computer or other encoding devices. For another example, in the video decoding and display process, the terminal device 413 can be a VR glasses, and the user can control the viewing angle range by turning; the terminal device 414 can be a mobile phone, and the user can control the viewing angle range on the mobile phone 414 by touch operation or air operation, etc.; the terminal device 415 can be a personal computer, and the user can control the viewing angle range displayed on the display screen by input devices such as a mouse or keyboard.
[0082] It can be understood that video is a general term, and a video includes an image sequence of multiple continuous frames, where one frame corresponds to one image.
[0083] Figure 4 This is just a schematic diagram. The video transmission system may also include other devices. Figure 4 The embodiments of the present application do not limit the number and type of terminal devices included in the system.
[0084] exist Figure 4 The video transmission system shown is based on Figure 5 A schematic diagram of a video coding and decoding system provided in an embodiment of the present application is shown. The video coding and decoding system 500 includes an encoding device 510 and a decoding device 520 . The encoding device 510 establishes a communication connection with the decoding device 520 via a communication channel 530 .
[0085] The above-mentioned encoding device 510 can realize the function of video encoding, such as Figure 5 As shown, the encoding device 510 may be a terminal device 512, and the encoding device 510 may also be a data center with video encoding capabilities, for example, the data center includes multiple servers.
[0086] The encoding device 510 may include a data source 511 , a pre-processing module 512 , an encoder 513 , and a communication interface 514 .
[0087] The data source 511 may include or may be any type of electronic device for capturing video, and / or any type of source video generating device, such as a computer graphics processor for generating computer animation scenes or any type of device for acquiring and / or providing source video, or computer-generated source video. The data source 511 may be any type of memory or storage for storing the above-mentioned source video. The above-mentioned source video may include multiple video streams or images captured by multiple video capture devices (such as cameras).
[0088] The preprocessing module 512 is used to receive the source video and preprocess the source video to obtain multiple frames of images. The preprocessing performed by the preprocessing module 512 may include color format conversion (for example, from RGB to YCbCr), data structuring, video splicing, etc.
[0089] For example, the preprocessing module 512 divides each frame of the image data into blocks, and then divides each block into a plurality of pixel groups, wherein the plurality of pixel groups include a base pixel group and at least one non-base pixel group. Each pixel group includes a base pixel and at least one non-base pixel, and each pixel in the base pixel group is a base pixel of the non-base pixel group.
[0090] The encoder 513 is used to receive a video or an image, and encode the image or the image to obtain encoded data, that is, the encoder 513 encodes the video to obtain a basic layer code stream and an enhancement layer code stream, etc. In some optional situations, the encoded code stream may also be called a bit stream.
[0091] For example, the encoder 513 encodes the multiple pixel groups using encoding modes corresponding to the contrast ranges of the multiple pixel groups, respectively, to obtain encoding values of the multiple pixel groups, and the compression errors of different encoding modes increase as the contrast range increases. The encoder 513 is also used to output a whole-image bitstream, which includes encoding values of the multiple pixel groups and control identifiers of the multiple pixel groups, and the control identifiers corresponding to the contrast ranges of different pixel groups are different, and the control identifiers are used to indicate the encoding mode / decoding mode of the pixel group.
[0092] The coding mode indicated by the control flag can be encoded using PCM or DPCM, so the encoder 513 is as follows: Figure 6 As shown, it may include a mode control unit 610, a DPCM encoding unit 620, a PCM encoding unit 630 and a code stream encapsulation unit 640.
[0093] The mode control unit 610 is used to determine the encoding mode of the pixel group according to the contrast range of the pixel group, the DPCM encoding unit 620 is used to encode the pixel group using DPCM encoding, and the PCM encoding unit 630 is used to encode the pixel group using PCM encoding.
[0094] The communication interface 514 in the encoding device 510 can be used to receive encoded data such as a whole picture code stream, and send the encoded data (or a version of the encoded data after any other processing) to another device such as the decoding device 520 or any other device through the communication channel 530 for storage, display or direct reconstruction, etc.
[0095] Optionally, the encoding device 510 includes a bitstream buffer, which is used to store bitstreams corresponding to one or more encoding units.
[0096] The above-mentioned decoding device 520 can realize the functions of image decoding or video decoding, such as Figure 4 As shown, the decoding device 520 may be Figure 4 Any one of the terminal devices 413 to 415 is shown.
[0097] The decoding device 520 may include a display device 521 , a post-processing module 522 , a decoder 523 , and a communication interface 524 .
[0098] The communication interface 524 in the decoding device 520 is used to receive the encoded data (or a version of the encoded data after any other processing is performed on the encoded data) from the encoding device 510 or from any other encoding device such as a storage device.
[0099] Communication interface 514 and communication interface 524 can be used to send or receive encoded data through a direct communication link between the encoding device 510 and the decoding device 520, such as a direct wired or wireless connection, or through any type of network, such as a wired network, a wireless network or any combination thereof, any type of private network and public network or any type of combination thereof.
[0100] The communication interface 524 corresponds to the communication interface 514, for example, and can be used to receive transmission data and process the transmission data using any type of corresponding transmission decoding or processing and / or decapsulation to obtain encoded data.
[0101] The communication interface 524 and the communication interface 514 can be configured as follows: Figure 5 A unidirectional communication interface, or a bidirectional communication interface, indicated by an arrow pointing from the encoding device 510 to the corresponding communication channel 530 of the decoding device 520, and can be used to send and receive messages, etc. to establish a connection, confirm and exchange any other information related to the communication link, or data transmission such as encoded compressed data transmission, etc.
[0102] The decoder 523 is used to receive encoded data and decode the encoded data to obtain decoded data (image or video, etc.).
[0103] For example, the decoder 523 is used to receive the entire image code stream from the communication interface 524, and decode the encoded values of the multiple pixel groups using decoding modes corresponding to the contrast ranges of the multiple pixel groups according to the control identifiers of the multiple pixel groups to obtain decoded data of the multiple pixel groups, such as decoded values.
[0104] The coding mode indicated by the control flag can be encoded using PCM or DPCM, so decoding 523 is as follows Figure 6 As shown, it may include a code stream decapsulation unit 650 , a mode control unit 660 , a DPCM decoding unit 670 , a PCM decoding unit 680 and a data shaping unit 690 .
[0105] The mode control unit 660 is used to determine the decoding mode of the pixel group according to the control identifier of the pixel group, the DPCM decoding unit 670 is used to decode the pixel group using DPCM coding, and the PCM decoding unit 680 is used to decode the pixel group using PCM coding.
[0106] The post-processing module 522 is used to post-process the decoded data after decoding to obtain post-processed data (such as image data waiting to display an image). The post-processing performed by the post-processing module 522 may include, for example, color format conversion (such as conversion from YCbCr to RGB), data reconstruction, video splitting and fusion, etc., or any other processing for generating data for display by the display device 521, etc.
[0107] The display device 521 is used to receive the post-processing data for display to a user or viewer, etc. The display device 521 can be or include any type of display for displaying the reconstructed image, such as an integrated or external display screen or display. For example, the display screen can include a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS), a digital light processor (DLP), or any other type of display screen.
[0108] As an optional implementation, the encoding device 510 and the decoding device 520 may transmit the encoded data via a data forwarding device, such as a router or a switch.
[0109] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0110] Here, the image processing method of the embodiment of the present application is as follows: Figure 5 The encoding device 510 shown is used as an example for explanation. Figure 7 A schematic diagram of an image processing method provided in an embodiment of the present application Figure 1 , the image processing method includes the following steps 710 to 730.
[0111] Step 710: The encoding device 510 obtains image data.
[0112] The encoding device 510 receives image data sent by the terminal device, and each frame of the image data is divided into independent blocks and input into the encoding device 510.
[0113] As a possible implementation, the encoding device 510 divides the multiple pixels contained in each block into a base pixel group and at least one non-base pixel group. Each pixel group includes a base pixel and at least one non-base pixel, and each pixel in the base pixel group is a base pixel of each non-base pixel group in the same block. Figure 7 This is just a reference example. The pixels that each dotted circle passes through belong to the same pixel group. For the specific division method, please refer to Figure 8 The relevant description in will not be repeated here.
[0114] Optionally, the size of the block can be set according to the performance of the encoding device 510 and the decoding device 520 and the image transmission bandwidth requirements, such as 2*2, 4*4, 5*5, 8*8, etc., wherein 2, 4, 5, etc. represent the number of pixels, and 2*2 represents a block with a length and width of 2 pixels each, containing a total of 4 pixels.
[0115] In this embodiment, the image data sent by the terminal device is in RGB format, and each pixel has pixel values of three channels: red, green, and blue. When the encoding device 510 divides each block into pixel groups, it processes the data of the three channels at the same time.
[0116] Step 720 : The encoding device 510 encodes the multiple pixel groups using encoding modes corresponding to the contrast ranges of the multiple pixel groups, respectively, to obtain encoding values of the multiple pixel groups.
[0117] The encoding device 510 first determines the encoding modes corresponding to the respective pixel groups according to the contrast ranges of the plurality of pixel groups, and then encodes the respective pixel groups using the encoding modes corresponding to the respective pixel groups to obtain encoding values of the plurality of pixel groups.
[0118] As a possible implementation manner, in each pixel group, the encoding device 510 determines the contrast range of the pixel group according to the change amplitude of the non-base pixels of the pixel group relative to the base pixels of the pixel group.
[0119] Optionally, taking one pixel group among the plurality of pixel groups, namely the first pixel group, as an example, the step of determining the contrast range may be as follows:
[0120] Step 721 : The encoding device 510 calculates the absolute value of the difference between the pixel value of each non-base pixel and the pixel value of the base pixel in the first pixel group.
[0121] Step 722: The encoding device 510 determines the maximum value among the absolute values.
[0122] The encoding apparatus 510 compares the magnitudes of absolute values of differences between pixel values of each non-base pixel and pixel value of the base pixel in the first pixel group, and determines a maximum value among a plurality of absolute values.
[0123] The larger the maximum absolute value is, the larger the change amplitude of the non-base pixels relative to the base pixels in the first pixel group is.
[0124] Step 723: The encoding device 510 determines a contrast range of the first pixel group according to the numerical interval to which the maximum value belongs.
[0125] The encoding device 510 determines the numerical interval to which the maximum value belongs, and then determines the contrast range of the first pixel group according to the association relationship between the numerical interval and the contrast range.
[0126] Different contrast ranges contain different numerical intervals, that is, the correlation between the numerical intervals and the contrast ranges is that different numerical intervals correspond to different contrast ranges.
[0127] In some possible implementations, the contrast range is preset to have an associated relationship with the coding mode, and the coding device 510 determines the coding mode corresponding to each pixel group based on the associated relationship between the contrast range and the coding mode. For example, different contrast ranges correspond to different control identifiers, and the control identifier is used to indicate different coding modes or decoding modes. The coding device 510 and the decoding device 520 determine the coding mode or decoding mode of each pixel group by identifying the control identifier.
[0128] In this embodiment, the compression error of different coding modes increases with the increase of contrast range. For pixel groups with a larger contrast range, the coding device 510 uses the characteristic that the larger the contrast change, the larger the error detectable threshold of the human eye, and adopts a coding mode with a larger compression error to encode the pixel groups with a larger contrast range. In this way, the compression error changes with the error detectable threshold of the human eye, thereby achieving visual lossless compression of image data, and ensuring image quality while improving the compression ratio.
[0129] Optionally, the above different coding modes may use DPCM coding and PCM coding. For example, the coding mode in this embodiment includes multiple levels of DPCM coding with increasing compression errors, and one or more levels of PCM coding. When the control identifier is used to represent the control mode, the specific division method of the coding mode can refer to the relevant description in step 940, which will not be repeated here.
[0130] Step 730: The encoding device 510 outputs a whole-image code stream according to the encoding values of the plurality of pixel groups.
[0131] The encoding device 510 performs code stream encapsulation on the encoding values of the plurality of pixel groups and outputs a whole-image code stream.
[0132] The whole image code stream includes the coded values of multiple pixel groups and the control flags corresponding to the multiple pixel groups. The specific format of the whole image code stream can be referred to Fig.11 And related descriptions will not be repeated here.
[0133] Based on the above steps 710 to 730, the image processing method selects encoding modes with different compression errors based on the contrast range of the pixel group to encode multiple pixel groups respectively. Since the compression error of the encoding mode increases with the increase of the contrast range of the pixel group, it is ensured that the compression error of the image conforms to the visual habits of the human eye and the image transmission quality is guaranteed. Moreover, compared with performing multi-level wavelet transformation or DCT transformation on the image data to extract the high-frequency and low-frequency information of the image, the dependence of the front and back data of different blocks and pixel groups is weak. By using group coding to complete the compression of image data, the image data of different blocks can be compressed independently based on different encoding modes, which is conducive to the independent operation and parallelization of the compression operation of the image data of each block. Therefore, the image compression algorithm is simplified without reducing the visual quality of the image, the compression efficiency is improved, and the hardware overhead such as storage bandwidth and calculation required for encoding and decoding is reduced.
[0134] Combination of the above Figure 7 The process of encoding by the encoding device 510 performing the image processing method is generally described. Figure 8 The method of dividing pixel groups into blocks in image data is specifically explained.
[0135] The encoding device 510 divides the image data input by the terminal device into a plurality of blocks, and divides each block into a plurality of pixel groups. Figure 8Taking the block of size 4*4 as an example, the block includes 5 pixel groups, and the first to fifth pixel groups are {C1, C2, C3, C4}, {C1, P11, P12, P13}, {C2, P21, P22, P23}, {C3, P31, P32, P33}, {C4, P41, P42, P43}, which can also be called the center group, upper left group, upper right group, lower left group and lower right group, respectively.
[0136] There is a base pixel in each pixel group, namely, C1 of the first pixel group, C1 of the second pixel group, C2 of the third pixel group, C3 of the fourth pixel group, and C4 of the fifth pixel group.
[0137] Continue with the above Figure 8 As an example, the pixel group division method shown in FIG. Fig. 9 The specific steps of the encoding device 510 determining the control flag according to the contrast range of the first pixel group, thereby determining the encoding mode of the first pixel group are described in detail. The steps may include the following steps 910 to 950.
[0138] Step 910 : The encoding device 510 calculates a contrast range of the first pixel group.
[0139] The encoding device 510 inputs the pixel values of the first pixel group into the mode control unit 610. The mode control unit 610 uses the pixel values of the base pixels of the first pixel group to subtract the pixel values of the non-base pixels of the first pixel group, and takes the maximum value in the difference to represent the contrast range of the first pixel group.
[0140] The maximum value of the difference refers to the difference with the largest absolute value.
[0141] For example, in the first pixel group, since the image data has three color channels, the mode control unit 610 calculates C2 minus C1, C3 minus C1, and C4 minus C1 in the three channels respectively, obtains 9 signed differences, and selects the maximum value from the absolute values of the 9 differences. The larger the maximum value, the greater the change in the non-base pixel relative to the base pixel in the first pixel group.
[0142] Step 920: The encoding device 510 determines the numerical interval to which the maximum value belongs, and determines the contrast range of the first pixel group according to the association relationship between the numerical interval and the contrast range.
[0143] Exemplarily, in this embodiment, there are 7 different contrast ranges, that is, including 7 different value intervals:
[0144] (1) Contrast range 1; value interval 1: -16 to 15; the control flag of the coding mode is 1;
[0145] (2) Contrast range 2; value interval 2: -32 to -17 or 16 to 31; the control indicator of the coding mode is 2;
[0146] (3) Contrast range 3; value interval 3: -64 to -33 or 32 to 63; the control indicator of the coding mode is 3;
[0147] (4) Contrast range 4; value range 4: -128 to -65 or 64 to 127; the control flag of the encoding mode is 4;
[0148] (5) Contrast range 5; value range 5: -256 to -129 or 128 to 255; the control flag of the encoding mode is 5;
[0149] (6) Contrast range 6; value range 6: -384 to -257 or 256 to 383; the control flag of the encoding mode is 6;
[0150] (7) Contrast range 7; value interval 7: -∞~-385 or 384~+∞; the control mark of the encoding mode is 7.
[0151] The numerical value intervals and control marks in the above 7 contrast ranges are merely examples provided in this embodiment, and do not limit the division method of the numerical value intervals and the numerical value setting method of the control mark.
[0152] Based on the above 7 contrast ranges, if the maximum value of the absolute values of the 9 differences of the first pixel group is 12, since 12 belongs to the numerical interval 1, the mode control unit 610 in the encoding device 510 determines that the contrast range of the first pixel group is contrast range 1.
[0153] Step 930: The encoding device 510 determines a control flag of the first pixel group according to a contrast range of the first pixel group.
[0154] The encoding device 510 determines the control identifier of the first pixel group according to the contrast range of the first pixel group and the association relationship between the contrast range and the control identifier.
[0155] Among them, the association relationship between the contrast range and the control identifier can be shown as the content of the above 7 contrast ranges. Each contrast range corresponds to a control identifier, that is, each numerical interval corresponds to a control identifier, and different control identifiers are used to represent different encoding modes.
[0156] For example, the mode control unit 610 of the encoding device 510 determines the control identifier of the first pixel group according to the contrast range of the first pixel group and the correspondence between the contrast range 1 to the contrast range 7 and the control identifiers 1 to 7.
[0157] In some possible embodiments, if the control identifier increases with the increase of the contrast range, the encoding device 510 can also determine the control identifiers corresponding to the pixel values of multiple non-basis pixels respectively according to the numerical interval to which the absolute value of the difference between the pixel value of the base pixel in the first pixel group and the pixel values of each non-basis pixel in the first pixel group belongs, and determine the control identifier of the first pixel group as the control identifier with the largest numerical value among the control identifiers corresponding to the pixel values of the multiple non-basis pixels.
[0158] Step 940: The encoding device 510 determines an encoding mode of the first pixel group according to the control identifier of the first pixel group.
[0159] The encoding device 510 determines the encoding mode of the first pixel group based on the control identifier of the first pixel group and the association between the control identifier and the encoding mode.
[0160] The mode control unit 610 of the encoding device 510 determines the encoding mode of the first pixel group according to the control identifier of the first pixel group and the correspondence between the control identifier 1 to the control identifier 7 and the encoding modes 1 to 7 .
[0161] Exemplarily, the correspondence between control identifiers 1 to 7 and coding modes 1 to 7 is as follows:
[0162] (1) Control flag 1; Coding mode 1: The difference value (signed number) of each pixel is used as the compressed coding value;
[0163] (2) Control flag 2; Coding mode 2: Divide the difference of each pixel (signed number) by the quotient of 2 (excluding the remainder)
[0164] As a compression encoding value;
[0165] (3) Control flag 3; Coding mode 3: Divide the difference of each pixel (signed number) by the quotient of 4 (excluding the remainder)
[0166] As a compression encoding value;
[0167] (4) Control flag 4; Coding mode 4: Divide the difference of each pixel (signed number) by the quotient of 8 (excluding the remainder)
[0168] As a compression encoding value;
[0169] (5) Control flag 5; Coding mode 5: The quotient (excluding the remainder) of the difference value (signed number) of each pixel divided by 16 is used as the compressed coding value;
[0170] (6) Control flag 6; Coding mode 6: The quotient (excluding the remainder) of the difference value (signed number) of each pixel point divided by 32 is used as the compressed coding value;
[0171] (7) Control flag 7; Coding mode 7: The quotient (excluding the remainder) of dividing the pixel value (unsigned number) of each pixel by 32 is used as the compressed coding value.
[0172] Among them, coding mode 1 to coding mode 5 use DPCM coding, and coding mode 6 and coding mode 7 use PCM coding.
[0173] The above 7 coding modes are only examples provided by this embodiment, and do not limit the specific coding methods in the coding modes. For example, in this embodiment, coding modes 1 to 5 use DPCM coding, and coding modes 6 and 7 use PCM coding. In other possible embodiments, coding modes 1 to 6 use DPCM coding, and coding mode 7 uses PCM coding. For example, in this embodiment, in order to improve the coding operation efficiency, the divisor in the coding process is set to a power of 2. In other possible embodiments, the divisor can be any number other than a power of 2.
[0174] In this embodiment, the code length of the compression coding of each coding mode, such as coding mode 1 to coding mode 7, can be a fixed value, such as 5 bits, 6 bits, etc., thereby avoiding the serial dependence of the code stream during the decoding process and greatly improving the decoding efficiency.
[0175] Optionally, in coding mode 7, the quotient of dividing the pixel value of each pixel by 32 is used as the compression coding value, and the quotient of dividing the high-bit sampling value of each pixel by 32 is used as the compression coding value. The sampling method of the high-bit sampling value can be determined according to the code length of the compression coding. For example, when the code length of the compression coding is 5 bits, the high-bit sampling value refers to the highest 5-bit sampling value.
[0176] Step 950: The encoding device 510 encodes the first pixel group using the encoding mode corresponding to the control identifier of the first pixel group to obtain an encoding value of the first pixel group.
[0177] The encoding device 510 compresses and encodes the pixel value of at least one non-base pixel included in the first pixel group using the encoding mode corresponding to the control identifier of the first pixel group to obtain the encoding value of the first pixel group.
[0178] The encoding device 510 uses the DPCM encoding unit 620 or the PCM encoding unit 630 to compress and encode the pixel value of at least one non-base pixel included in the first pixel group according to the control identifier of the first pixel group to obtain the encoding value of the first pixel group.
[0179] like Fig.10As shown, based on the above 7 coding modes, the mode control unit 610 in the coding device 510 determines that the control identifier A0 of the first pixel group is 1, and its coding mode is coding mode 1. It can be seen that the difference between the pixel values of C2, C3, C4 and C1 in the first pixel group ranges from -16 to 15, and a 5-bit signed number is sufficient to losslessly represent the difference, so the original 10-bit pixel value of each pixel point is represented by a 5-bit signed difference. After the DPCM coding unit 620 encodes the pixel value of C2 using coding mode 1, the coded value of C2 is C2-C1.
[0180] If the mode control unit 610 in the encoding device 510 determines that the control identifier A0 of the first pixel group is 2 and its encoding mode is encoding mode 2, then after the DPCM encoding unit 620 encodes the pixel value of C2 using encoding mode 1, the encoding value of C2 is (C2-C1) / 2. In this way, under different encoding modes, the error does not exceed 1 / 16 of the original pixel value, thereby ensuring the quality of the image.
[0181] When there is a non-base pixel in the first pixel group whose pixel value difference with the base pixel is too large, that is, when the control identifier A0 is 6 or 7, the 5-bit difference is not sufficient to losslessly encode the pixel value of the non-base pixel, then the PCM encoding unit 630 adopts encoding mode 6 or encoding mode 7 to encode the pixel value of C2, that is, the sampling value of the high 5 bits of the color scale of the original pixel value itself is used to encode, and the encoded value of the pixel value of the non-base pixel is obtained.
[0182] After compressing and encoding the multiple pixel groups of the blocks respectively, the encoding device 510 outputs a whole-image code stream according to the compressed code values of each pixel group. The whole-image code stream includes the compressed code values of all pixel groups contained in each of the multiple blocks of the image data, the pixel values of the base pixels of the base pixel group of each block, and the control identifiers of all pixel groups.
[0183] Next, combine Fig.11 ,by Figure 8 Taking the blocks shown in as an example, the code stream encapsulation format of each block in the whole image code stream is described in detail.
[0184] The code stream of this block includes control identifiers of each pixel group, namely A0, A1, A2, A3, A4, a base pixel group, namely the pixel value C0 of the base pixel of the first pixel group, and compressed coding values of each pixel group of the three color channels.
[0185] In this way, in each 4*4 block, C1 needs to be stored losslessly as the DC component of the entire block. It can be seen that each block needs to consume 5*3+10*35*5=270 bits. The overall input pixel is 16*3*10=480 bits. Then the compression rate of this algorithm is 1.78, which is lower than the compression rate in the prior art. It improves the overall compression rate of image data, requires less hardware resources such as bandwidth and computing during data transmission and processing, and reduces the hardware consumption of display systems such as LCOS projection display drive systems.
[0186] Next, the image processing method of the embodiment of the present application is described as follows. Figure 5 The decoding device 520 shown is used as an example for explanation. Fig.12 A schematic diagram of an image processing method provided in an embodiment of the present application Figure 2 , the image processing method includes the following steps 1210 to 1230.
[0187] Step 1210: The decoding device 520 obtains the entire image code stream.
[0188] The decoding device 520 transmits the entire image code stream received from the encoding device 510 to the decoder 523. The code stream encapsulation format of the entire image code stream is as follows: Fig.11 As shown, no further details are given here.
[0189] Step 1220 : The decoding device 520 decodes the coded values of the multiple pixel groups using decoding modes corresponding to the contrast ranges of the multiple pixel groups according to the control identifiers of the multiple pixel groups to obtain decoded values of the multiple pixel groups.
[0190] The mode control unit 660 of the decoding device 520 first determines the decoding mode corresponding to each pixel group according to the control identifiers of the multiple pixel groups, and then decodes the encoded values of each pixel group respectively using the decoding mode corresponding to each pixel group through the DPCM decoding unit 670 or the PCM decoding unit 680 to obtain the decoded values of the multiple pixel groups.
[0191] As a possible implementation, for each block of the code stream in the whole image code stream, the decoder 523 of the decoding device 520 first parses the control identifier of each pixel group and the pixel value of the base pixel group from the code stream, then parses the pixel value of each pixel of the base pixel group, and then parses the pixel value of each non-base pixel group based on the control identifier of each non-base pixel group and the pixel value of the base pixel. The pixel value of each pixel point parsed by the decoder 523 is the decoded value.
[0192] In this embodiment, the control flag not only indicates the encoding mode, but also indicates the decoding mode. For example, the corresponding relationship between the control flag 1 to the control flag 7 and the decoding mode 1 to the decoding mode 7 is as follows:
[0193] (1) Control flag 1; Decoding mode 1: The decoded value is the sum of the pixel value of the base pixel and the compressed coded value;
[0194] (2) Control flag 2; Decoding mode 2: The decoded value is the sum of the pixel value of the base pixel and the 2-fold compressed coded value;
[0195] (3) Control flag 3; Decoding mode 3: The decoded value is the sum of the pixel value of the base pixel and the 4-fold compressed coded value;
[0196] (4) Control flag 4; Decoding mode 4: The decoded value is the sum of the pixel value of the base pixel and the 8-fold compressed coded value;
[0197] (5) Control flag 5; Decoding mode 5: The decoded value is the sum of the pixel value of the base pixel and the 16-fold compressed coded value;
[0198] (6) Control flag 6; Decoding mode 6: The decoded value is 32 times the compressed encoded value;
[0199] (7) Control flag 7; decoding mode 7: the decoded value is 32 times the compressed encoded value.
[0200] Among them, decoding modes 1 to 5 use DPCM decoding, and decoding modes 6 and 7 use PCM decoding.
[0201] The above 7 decoding modes are only examples provided by this embodiment, and do not limit the specific decoding methods in the decoding modes. The decoding modes can correspond to the encoding modes. For example, in this embodiment, decoding modes 1 to 5 use DPCM encoding, and decoding modes 6 and 7 use PCM encoding. In other possible embodiments, decoding modes 1 to 6 use DPCM encoding, and decoding mode 7 uses PCM encoding. For example, in this embodiment, in order to improve the decoding operation efficiency, the multiple in the decoding process is set to a power of 2. In other possible embodiments, the multiple can be any number other than a power of 2.
[0202] Optionally, since the remainder after the difference value is divided is discarded during encoding, there is a compression error, so in order to compensate for the compression error during decoding to improve image transmission quality, the decoder 523 can add a compensation value in each decoding mode, and the compensation value can be the average of the remainder after the difference value is divided during encoding. For example, the compensation values corresponding to the above decoding modes 1 to 7 are 0, 1, 2, 4, 8, 8, and 24, respectively.
[0203] Step 1230: The decoding device 520 outputs image data according to the decoded values of the pixel groups included in the entire image code stream.
[0204] The decoder 523 of the decoding device 520 outputs the decoded values of all pixel groups of each block of the entire image code stream to the post-processing module 522 for post-processing to obtain image data.
[0205] Based on the above steps 1210 to 1230, the decoding mode corresponding to each pixel group is selected based on the control identifier to decode each pixel group respectively, which ensures the decoding independence and parallelism of each block and pixel group, simplifies the decoding algorithm, and reduces the computational complexity of decoding compared to multi-level processing of data using inverse DCT transform or inverse wavelet transform, thereby reducing the hardware overhead such as storage bandwidth and calculation required for decoding. Moreover, since the compression error corresponding to different decoding modes increases with the increase of the contrast range when the pixel group is encoded, it is ensured that the compression error of the image conforms to the visual habits of the human eye, thereby ensuring the image transmission quality.
[0206] The following is an explanation of the image information loss caused by compressing, transmitting and decompressing image data using the above-mentioned image processing method provided in the embodiment of the present application in conjunction with Table 1.
[0207] Taking Peak Signal to Noise Ratio (PSNR) as the loss standard, it is generally believed that a PSNR value of 30 decimal Bell (dB) or above can be considered visually lossless. The PSNR values of example images such as image number 1 to image number 10 are shown in Table 1:
[0208] Table 1
[0209]
[0210] The above example images are a set of images with a resolution of 2K. For images with relatively smooth pictures, the PSNR value can reach more than 65. For images with more details, the PSNR value can also reach more than 35, which meets the requirements of visual losslessness for human vision.
[0211] It is understandable that, in order to implement the functions in the above embodiments, the encoding device and the decoding device include hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0212] Fig.13 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application Figure 1, the image processing device can be used to implement the function of the encoding device in the above method embodiment, and thus can also achieve the beneficial effects of the above image processing method embodiment for encoding. In the embodiment of the present application, the image processing device can be as follows Figure 4 The terminal device 412 shown may also be Figure 5 The encoding device 510 shown may also be a module (such as a chip) applied to an encoding device.
[0213] like Fig.13 As shown, the image processing device 1300 includes: a transceiver module 1310 and a processing module 1320. The transceiver module 1310 is used to obtain image data, the image data includes at least one block, and each block in the at least one block includes multiple pixel groups. The processing module 1320 is used to encode multiple pixel groups using coding modes corresponding to the contrast ranges of the multiple pixel groups, respectively, to obtain coding values of the multiple pixel groups, and the compression error of different coding modes increases with the increase of the contrast range. The transceiver module 1310 is also used to output a whole image code stream, the whole image code stream includes the coding values of the multiple pixel groups and the control identifiers of the multiple pixel groups, the contrast ranges of different pixel groups correspond to different control identifiers, and the control identifier is used to indicate the coding mode / decoding mode of the pixel group.
[0214] The image processing device 1300 can be used to implement the operation steps corresponding to each method in the above-mentioned image processing method embodiment, and thus can also achieve corresponding beneficial effects, which will not be described in detail here. For more information about the transceiver module 1310 and the processing module 1320, please refer to the content of the above-mentioned image processing method embodiment, which will not be described in detail here.
[0215] Accordingly, the embodiment of the present application also provides an image processing device for decoding, such as Fig.14 As shown, Fig.14 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application Figure 2 , the image processing device can be used to implement the function of the decoding device in the above method embodiment, and thus can also achieve the beneficial effects of the above image processing method embodiment applied to decoding. In the embodiment of the present application, the image processing device can be as follows Figure 4 Any of the terminal devices 413 to 415 shown in the figure may also be as follows Figure 5 The decoding device 520 shown may also be a module (such as a chip) applied to a decoding device.
[0216] like Fig.14As shown, the image processing device 1400 includes: a transceiver module 1410 and a processing module 1420. The transceiver module 1410 is used to obtain a whole image code stream, which includes the encoding values of multiple pixel groups contained in the image data and the control identifiers of the multiple pixel groups, and the control identifier is used to indicate the decoding mode of the pixel group. The processing module 1420 is used to decode the encoding values of the multiple pixel groups using the decoding modes corresponding to the contrast ranges of the multiple pixel groups according to the control identifiers of the multiple pixel groups, and obtain the decoded values of the multiple pixel groups. The compression error of different decoding modes increases with the increase of the contrast range. The transceiver module 1410 is also used to output image data according to the decoded values of the pixel groups contained in the whole image code stream.
[0217] The image processing device 1400 can be used to implement the operation steps corresponding to each method in the above-mentioned image processing method embodiment for decoding, and thus can also achieve corresponding beneficial effects, which will not be described in detail here. For more information about the transceiver module 1410 and the processing module 1420, please refer to the content of the above-mentioned image processing method embodiment, which will not be described in detail here.
[0218] For a more detailed description of the above-mentioned image processing device 1300 or image processing device 1400, reference can be made to the relevant description in the embodiments shown in the aforementioned figures, which will not be repeated here. It can be understood that the image processing device 1300 or image processing device 1400 shown in the aforementioned figures is only an example provided in this embodiment, and the image processing device 1300 or image processing device 1400 may include more or fewer units, which is not limited in this application.
[0219] When the image processing device 1300 or the image processing device 1400 is implemented by hardware, the hardware may be implemented by a processor or a chip. The chip includes an interface circuit and a control circuit. The interface circuit is used to receive data from other devices other than the processor and transmit it to the control circuit, or to send data from the control circuit to other devices other than the processor.
[0220] The control circuit and the interface circuit are used to implement any possible implementation method in the above embodiments through logic circuits or execution code instructions. The beneficial effects can be found in the description of any aspect of the above embodiments, which will not be repeated here.
[0221] In addition, the image processing device 1300 or the image processing device 1400 may also be implemented by an electronic device, where the electronic device may refer to the encoding device or the decoding device in the aforementioned embodiment, or, when the electronic device is a chip or a chip system applied to a server, the image processing device 1300 or the image processing device 1400 may also be implemented by a chip or a chip system.
[0222] like Fig.15 As shown, Fig.15The electronic device 1500 is a schematic diagram of a structure of an electronic device provided in an embodiment of the present application, and includes: a processor 1510, a bus 1520, a memory 1530, a memory unit 1550 (also referred to as a main memory unit), and a communication interface 1540. The processor 1510, the memory 1530, the memory unit 1550, and the communication interface 1540 are connected via the bus 1520.
[0223] It should be understood that in this embodiment, the processor 1510 may be a CPU, and the processor 1510 may also be other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0224] The communication interface 1540 is used to implement communication between the electronic device 1500 and an external device or component. In this embodiment, the communication interface 1540 is used to perform data exchange with other electronic devices.
[0225] The bus 1520 may include a path for transmitting information between the above components (such as the processor 1510, the memory unit 1550, and the memory 1530). In addition to the data bus, the bus 1520 may also include a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus 1520 in the figure. The bus 1520 may be a Peripheral Component Interconnect Express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc.
[0226] As an example, the electronic device 1500 may include multiple processors. The processor may be a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions).
[0227] It is worth mentioning that Fig.15In the example, an electronic device 1500 including one processor 1510 and one memory 1530 is taken as an example. Here, the processor 1510 and the memory 1530 are respectively used to indicate a type of device or equipment. In a specific embodiment, the number of each type of device or equipment can be determined according to business requirements.
[0228] The memory unit 1550 may correspond to the storage medium for storing information such as pre-upgrade data in the above method embodiment. The memory unit 1550 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0229] The memory 1530 is used to store bit streams or coding units to be encoded, etc., and can be a solid state drive or a mechanical hard disk.
[0230] It should be understood that the electronic device 1500 may be a DPU. The electronic device 1500 according to this embodiment may correspond to the image processing device 1300 or the image processing device 1400 in this embodiment, and may correspond to the device that executes the image processing according to Figure 5 The above and other operations and / or functions of the various modules in the image processing device 1300 or the image processing device 1400 are respectively for implementing the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not repeated here.
[0231] The method steps in this embodiment can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also exist as discrete components in a network device or a terminal device.
[0232] The present application also provides a chip system, which includes a processor for implementing the functions of the encoding device or the decoding device in the above method. In one possible design, the chip system also includes a memory for storing program instructions and / or data. The chip system can be composed of a chip, or can include a chip and other discrete devices.
[0233] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).
[0234] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An image processing method, characterized in that: include: Acquire image data, the image data comprising at least one block, each of the at least one block comprising a plurality of pixel groups; encoding the plurality of pixel groups using encoding modes corresponding to contrast ranges of the plurality of pixel groups respectively to obtain encoding values of the plurality of pixel groups, wherein compression errors of different encoding modes increase as the contrast range increases; Output a whole-image code stream, wherein the whole-image code stream includes the coding values of the multiple pixel groups and the control identifiers of the multiple pixel groups, the contrast ranges of different pixel groups correspond to different control identifiers, and the control identifier is used to indicate the coding mode / decoding mode of the pixel group.
2. The method according to claim 1, characterized in that Each pixel group in the plurality of pixel groups includes a base pixel and at least one non-base pixel. Before respectively encoding the plurality of pixel groups using encoding modes corresponding to contrast ranges of the plurality of pixel groups to obtain encoding values of the plurality of pixel groups, the method further includes: The contrast ranges of the plurality of pixel groups are respectively determined according to the variation amplitude of the non-base pixel relative to the base pixel in each pixel group.
3. The method according to claim 2, characterized in that The step of respectively determining the contrast ranges of the plurality of pixel groups according to the variation range of the non-base pixels relative to the base pixels in each pixel group comprises: calculating an absolute value of a difference between a pixel value of each non-base pixel in a first pixel group and a pixel value of a base pixel, the first pixel group being one of the plurality of pixel groups; determining a maximum value among the absolute values, wherein a larger maximum value indicates a larger change amplitude of the non-base pixels relative to the base pixels in the first pixel group; The contrast range of the first pixel group is determined according to the numerical interval to which the maximum value belongs, and different contrast ranges contain different numerical intervals.
4. The method according to claim 3, characterized in that The step of respectively encoding the plurality of pixel groups using encoding modes corresponding to the contrast ranges of the plurality of pixel groups to obtain encoding values of the plurality of pixel groups includes: When the boundary value of the contrast range of the first pixel group is less than or equal to a preset threshold, differential pulse code modulation is performed on the first pixel group to obtain a code value of the first pixel group, and the boundary value is the maximum absolute value in the numerical interval included in the contrast range; When the boundary value of the contrast range of the first pixel group is greater than the preset threshold, pulse code modulation is performed on the first pixel group to obtain a code value of the first pixel group.
5. The method according to claim 4, characterized in that When the boundary value of the contrast range of the first pixel group is less than or equal to a preset threshold, performing differential pulse code modulation on the first pixel group to obtain a code value of the first pixel group includes: When the boundary value is less than or equal to the preset threshold, respectively dividing the difference between the pixel value of each non-base pixel in the first pixel group and the pixel value of the base pixel by m, to obtain a compressed coding value of each non-base pixel in the first pixel group, where m is a positive integer that increases as the boundary value increases, and the value of m is different in different coding modes; The encoding value of the first pixel group is determined according to the compressed encoding value of each non-base pixel in the first pixel group.
6. The method according to claim 5, characterized in that When the boundary value of the contrast range of the first pixel group is greater than the preset threshold, pulse code modulation is performed on the first pixel group to obtain a code value of the first pixel group, including: When the boundary value is greater than the preset threshold, respectively dividing the high bit sampling value of the pixel value of each non-base pixel in the first pixel group by m to obtain a compressed coding value of each non-base pixel in the first pixel group, where m is a positive integer that increases as the boundary value increases, and the value of m is different in different coding modes; The encoding value of the first pixel group is determined according to the compressed encoding value of each non-base pixel in the first pixel group.
7. The method according to any one of claims 1 to 6, characterized in that The multiple pixel groups include a base pixel group and at least one non-base pixel group, the base pixel group includes base pixels of the at least one non-base pixel group, and the entire image code stream also includes pixel values of the base pixels of the base pixel group.
8. The method according to any one of claims 1 to 7, characterized in that The code length of the encoding value of each pixel in the entire image code stream is a fixed value.
9. An image processing method, characterized in that: include: Acquire a whole-image code stream, where the whole-image code stream includes encoding values of a plurality of pixel groups included in the image data and control identifiers of the plurality of pixel groups, where the control identifier is used to indicate a decoding mode of the pixel groups; Decoding the coded values of the plurality of pixel groups using decoding modes corresponding to contrast ranges of the plurality of pixel groups according to the control identifiers of the plurality of pixel groups to obtain decoded values of the plurality of pixel groups, wherein compression errors of different decoding modes increase as the contrast range increases; Image data is output according to the decoded values of the pixel groups included in the entire image code stream.
10. The method according to claim 9, characterized in that Each of the plurality of pixel groups includes a base pixel and at least one non-base pixel, and decoding the coded values of the plurality of pixel groups using decoding modes corresponding to contrast ranges of the plurality of pixel groups according to control identifiers of the plurality of pixel groups to obtain decoded values of the plurality of pixel groups includes: determining decoded values of basis pixels of the plurality of pixel groups; Based on the decoded values of the base pixels of the plurality of pixel groups, the encoded values of the plurality of pixel groups are decoded respectively using the decoding modes corresponding to the control identifiers of the plurality of pixel groups to obtain the decoded values of the plurality of pixel groups.
11. The method according to claim 10, characterized in that The coded values of the multiple pixel groups include coded values of a base pixel group and coded values of at least one non-base pixel group, the entire image code stream also includes coded values of base pixels of the base pixel group, and determining decoded values of the base pixels of the multiple pixel groups includes: Based on the encoded value of the base pixel of the base pixel group, the base pixel group is decoded using a decoding mode corresponding to a control identifier of the base pixel group to obtain a decoded value of the base pixel group, and the non-base pixel of the base pixel group is a base pixel of at least one non-base pixel group.
12. The method according to claim 10 or 11, characterized in that: The decoding modes corresponding to the control identifiers include: Multiplying the code values of the non-basis pixels of the first pixel group by m respectively to obtain a code product of each non-basis pixel, where m is a positive integer that increases as the coding compression error increases, and the value of m is different in different decoding modes; The encoded value of the basis pixel of the first pixel group is added to the encoded product of each non-basis pixel to obtain a decoded value of each non-basis pixel.
13. The method according to claim 12, characterized in that The step of adding the encoded value of the base pixel of the first pixel group to the encoded product of each non-base pixel to obtain a decoded value of each non-base pixel includes: The coding value of the base pixel of the first pixel group is added to the coding product of each non-base pixel and the compensation value to obtain the decoding value of each non-base pixel. The compensation value increases as the coding compression error increases, and the compensation value is different in different decoding modes.
14. An image processing device, characterized in that: include: A transceiver module, used for acquiring image data, wherein the image data includes at least one block, and each block in the at least one block includes a plurality of pixel groups; A processing module, configured to respectively encode the plurality of pixel groups using encoding modes corresponding to contrast ranges of the plurality of pixel groups to obtain encoding values of the plurality of pixel groups, wherein compression errors of different encoding modes increase as the contrast range increases; The transceiver module is also used to output a whole-image code stream, wherein the whole-image code stream includes the coding values of the multiple pixel groups and the control identifiers of the multiple pixel groups, the contrast ranges of different pixel groups correspond to different control identifiers, and the control identifier is used to indicate the encoding mode / decoding mode of the pixel group.
15. An image processing device, characterized in that: include: A transceiver module, used to obtain a whole-image code stream, wherein the whole-image code stream includes encoding values of multiple pixel groups included in the image data and control identifiers of the multiple pixel groups, wherein the control identifier is used to indicate a decoding mode of the pixel group; a processing module, configured to decode the coded values of the plurality of pixel groups using decoding modes corresponding to contrast ranges of the plurality of pixel groups according to control identifiers of the plurality of pixel groups, to obtain decoded values of the plurality of pixel groups, wherein compression errors of different decoding modes increase as the contrast range increases; The transceiver module is further used to output image data according to the decoded values of the pixel groups included in the entire image code stream.
16. A computing device, characterized in that The computing device includes a memory and a processor, wherein the memory is used to store a set of computer instructions; when the processor executes the set of computer instructions, the operation steps of any one of the methods described in claims 1-13 are performed.
17. A computer system, characterized in that: The computer system includes an encoding device and a decoding device, the encoding device is used to execute the steps of the method described in any one of claims 1 to 8 to output a whole picture code stream to the decoding device, and the decoding device is used to execute the steps of the method described in any one of claims 9 to 13 to obtain image data based on the whole picture code stream.
18. A readable storage medium, characterized in that: The readable storage medium includes a computer program or instructions, and when the computer program or instructions are executed on a computer, the computer is caused to execute the operation steps of any one of the methods described in claims 1 to 13.
