Visually lossless image processing method, device and display system

By dividing the image into image blocks and selecting an appropriate compression method according to lossless compression conditions, the problem that the image processing method in the prior art consumes a lot of host resources and is difficult to control the compression ratio in real time is solved, and the effect of reducing power consumption and transmission bandwidth is achieved.

CN119767019APending Publication Date: 2025-04-04SHENZHEN AIXIESHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411900906.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing image processing methods occupy a lot of host resources, complex algorithms, and consume resources in the display driver circuit, and it is difficult to control the compression ratio in real time and accurately and perform local refreshes, resulting in high transmission bandwidth and power consumption.

Method used

By dividing the image into N*M pixel image blocks, the image block is compressed using a preset compression ratio, and a first lossless compression or a second compression method (including RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg 2+1 component interpolation method and RGB 2 set 3 component interpolation method) is selected according to whether the lossless compression conditions are met.

Benefits of technology

Real-time and precise control of the compression ratio is achieved, which significantly reduces the host resource consumption and power consumption, reduces the storage space and transmission bandwidth usage, and improves cost-effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119767019A_ABST
    Figure CN119767019A_ABST
Patent Text Reader

Abstract

The present application relates to a visually lossless image processing method, device and display system. The method comprises: dividing an image into image blocks of N*M pixels; compressing the image blocks at a preset compression ratio to obtain compressed coding blocks, and obtaining compressed image blocks by decompressing the coding blocks; judging whether the compressed image blocks meet the conditions of lossless compression; if they meet the conditions, performing a first lossless compression on each compressed image block; if they do not meet the conditions, performing a second compression on each compressed image block. By dividing the image into image blocks for compression, and each image block has a fixed compression ratio, and there is no dependency between image blocks, it is convenient to design circuits in parallel, realize the windowing function, and facilitate local updates. By using image blocks, visually lossless quality can be achieved, the algorithm is simple, and it is convenient for real-time circuit implementation, which can reduce storage space and power consumption, reduce the occupation of resources and transmission bandwidth, and has high cost performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a visually lossless image processing method, device and display system. Background Art

[0002] With the large-scale popularization of portable mobile electronic devices such as smart phones, tablets and wearable devices, the resolution of screen display systems is getting higher and higher, which puts higher requirements on the transmission bandwidth and internal storage capacity of display driver circuits, and poses a relatively large challenge to the power consumption, performance and cost in the design of display driver circuits.

[0003] In some screen display systems, due to the limitation of transmission bandwidth, image data needs to be compressed before being transmitted to the driver chip. The decompression circuit decompresses the image data to drive the display screen, such as Figure 1 As shown, in video mode (video mode means that real-time pixel stream is used for transmission from the host to the peripheral device), this can save the communication bandwidth and power consumption between module 13 and module 15. In addition, in order to reduce the occupation of host resources, some screen display systems need to use image memory when the display screen driving circuit drives the display screen, and only transmit the updated content when the image needs to be updated. If the image has no updated content, no data needs to be transmitted, such as Figure 2 As shown, in the Command mode (the Command mode refers to sending commands and data to a controller with a display cache), only when the image content is updated, modules 25 and 27 perform data transmission. If local updates can be achieved, only local data can be transmitted, saving bandwidth and power consumption, and greatly reducing the occupation of host CPU resources. Existing image processing methods either occupy a lot of host resources, have complex algorithms, and consume resources, or are not convenient for real-time circuit implementation, and have high requirements on the transmission bandwidth and internal storage capacity of the display driver circuit.

[0004] In summary, there is an urgent need for a visually lossless image processing method that can accurately control the compression ratio in real time and can perform local refresh to significantly reduce host resource consumption and power consumption. Summary of the invention

[0005] Based on this, it is necessary to provide a visually lossless image processing method, device and display system that can accurately control the compression ratio in real time and perform local refresh to significantly reduce host resource consumption and power consumption in response to the above technical problems.

[0006] A visually lossless image processing method, the method comprising:

[0007] Divide the image into image blocks of N*M pixels, where N and M are positive integers;

[0008] Compressing the image block at a preset compression ratio to obtain a compressed coding block, and decompressing the coding block to obtain a compressed image block;

[0009] Determining whether the compressed image block meets the condition of lossless compression;

[0010] If the lossless compression condition is met, performing a first lossless compression on each of the compressed image blocks;

[0011] If the condition of lossless compression is not met, a second compression is performed on each compressed image block, and the second compression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg 2+1 component interpolation method and RGB2 set 3-component interpolation method.

[0012] In one embodiment, if the condition of lossless compression is not met, performing a second compression on each compressed image block comprises:

[0013] An error evaluation value is calculated, and the second compression corresponding to the minimum error evaluation value is selected as the optimal encoding method.

[0014] In one embodiment, the RGB single component interpolation method is specifically:

[0015] Respectively taking the R component, the G component, and the B component in the compressed image block as separate variables, respectively obtaining two points in the R space, the G space, and the B space as first endpoints, respectively adding two points equidistantly between the first endpoints, including the two endpoints, a total of four first interpolation points, and numbering the first interpolation points;

[0016] Obtaining a first interpolation point having the shortest distance between the R component, the G component, and the B component of each pixel and the corresponding four first interpolation points in the R space, the G space, and the B space, and recording the number of the first interpolation point having the shortest distance;

[0017] If the serial number of the first pixel is greater than 1, the minimum and maximum values ​​of the first endpoints are exchanged, and each pixel is inverted by two binary bits to ensure that the highest bit of the first position pixel is 0, and the highest bit does not need to be encoded.

[0018] In one embodiment, the RGB 2+1 component interpolation method is specifically:

[0019] According to the characteristics of the compressed image block, RG / B or GB / R or RB / G is determined as an optimal component combination for RGB 2+1 component interpolation, wherein:

[0020] Interpolation with RG / B component combination is as follows:

[0021] Align the R / B component and the G component, where RG / B refers to the two color components R and G forming a two-dimensional space to determine the second endpoint of the R / G space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points and number the second interpolation points;

[0022] Record the number of the second interpolation point closest to each pixel in the R / G space;

[0023] Determine two third endpoints of the B space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points, and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the B space; or

[0024] Interpolation with GB / R component combination is as follows:

[0025] Align the G / R component with the R component, where the G / R refers to the two color components G and B forming a two-dimensional space to determine the second endpoint of the G / B space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points, and number the second interpolation points;

[0026] Recording the number of the second interpolation point closest to each pixel in the G / B space;

[0027] Determine two third endpoints of the R space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the R space; or

[0028] Interpolation with RB / G component combination is as follows:

[0029] Align the R / G component with the B component, where RB / G refers to the two color components R and B forming a two-dimensional space, determine the second endpoint of the R / G space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points, and number the second interpolation points;

[0030] Record the number of the second interpolation point closest to each pixel in the R / G space;

[0031] Determine two third endpoints of the G space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the G space.

[0032] In one embodiment, the YCoCg 2+1 component interpolation method is specifically:

[0033] Align the R / B components with the G component and transform R, G, and B to the YCoCg color domain;

[0034] Perform YCoCg 2+1 component interpolation compression in the YCoCg color domain to obtain a YCoCg reconstruction value, and convert the YCoCg reconstruction value into RGB.

[0035] In one embodiment, the RGB2 set 3-component interpolation method specifically:

[0036] Align the R / B component with the G component, change the effective number of bits of the R and B components to 6 bits, and divide the pixels of the pixel block into 2 sets;

[0037] Consider each pixel as a point in the RGB three-dimensional space, find two fourth endpoints in each of the sets, the effective number of bits R, G, B of the fourth endpoints are 5 bits, 6 bits, 5 bits respectively, and discretely interpolate 6 fourth interpolation points between the fourth endpoints, including 2 endpoints, for a total of 8 fourth interpolation points, and number the fourth interpolation points;

[0038] Record the serial number of each pixel in the set that is closest to the fourth interpolation point, and ensure that the highest bit of the first pixel serial number in the set is 0.

[0039] In one embodiment, determining whether the image block meets the condition of lossless compression includes:

[0040] According to the minimum and maximum values ​​of the R, G, and B components, the R component difference, the G component difference, and the B component difference are calculated respectively;

[0041] If the sum of the number of bits corresponding to the R component difference, the G component difference and the B component difference is less than or equal to 6, the condition for lossless compression is met; otherwise, the condition for lossless compression is not met.

[0042] In one embodiment, the first lossless compression and decompression of each compressed image block is specifically:

[0043] R=Rmin+DiffR

[0044] G=Gmin+DiffG

[0045] B=Bmin+DiffB

[0046] Among them, Rmin, Gmin, Bmin are the minimum values ​​of R, G, B components and R, G, B components, DiffR = R-Rmin, DiffG = G-Gmin, DiffB = B-Bmin, MaxBitR is the number of bits corresponding to the R component difference, MaxBitG is the number of bits corresponding to the G component difference, and MaxBitB is the number of bits corresponding to the B component difference.

[0047] A visually lossless image processing device, comprising:

[0048] An image block division module, used to divide the image into image blocks of N*M pixels, where N and M are positive integers;

[0049] An image block processing module, used for compressing the image block at a preset compression ratio to obtain a compressed coding block, and decompressing the coding block to obtain a compressed image block;

[0050] A compression judgment module, used to judge whether the compressed image block meets the conditions of lossless compression;

[0051] A first compression module, configured to perform a first lossless compression on each of the compressed image blocks if a lossless compression condition is met;

[0052] The second compression module is used to perform a second compression on each of the compressed image blocks if the condition of lossless compression is not met, and the second compression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg2+1 component interpolation method and RGB2 set 3-component interpolation method.

[0053] A display system includes a memory and a processor, wherein the memory stores an algorithm or a computer program, and the processor implements the following steps when executing the algorithm or the computer program:

[0054] Divide the image into image blocks of N*M pixels, where N and M are positive integers;

[0055] Compressing the image block at a preset compression ratio to obtain a compressed coding block, and decompressing the coding block to obtain a compressed image block;

[0056] Determining whether the compressed image block meets the condition of lossless compression;

[0057] If the lossless compression condition is met, performing a first lossless compression on each of the compressed image blocks;

[0058] If the condition of lossless compression is not met, a second compression is performed on each compressed image block, and the second compression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg 2+1 component interpolation method and RGB 2 set 3 component interpolation method.

[0059] The above-mentioned visually lossless image processing method, device and display system divide the image into image blocks of N*M pixels, where N and M are positive integers; compress the image blocks at a preset compression ratio to obtain compressed coding blocks, and obtain compressed image blocks by decompressing the coding blocks; determine whether the compressed image blocks meet the conditions for lossless compression; if the conditions for lossless compression are met, perform a first lossless compression on each compressed image block; if the conditions for lossless compression are not met, perform a second compression on each compressed image block, and the second compression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg2+1 component interpolation method and RGB2 set 3-component interpolation method. By dividing the image into image blocks for compression, and each image block has a fixed compression ratio, there is no dependency between image blocks, which can facilitate parallel circuit design, realize windowing function, facilitate local update, adopt image blocks, can achieve visual lossless quality, have a simple algorithm, require small resources, and are convenient for real-time circuit implementation, can reduce storage space and power consumption, reduce resource and transmission bandwidth occupation, and have high cost performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a structural schematic diagram of a display driving circuit in a video mode in the background technology of this application;

[0061] Figure 2 It is a structural diagram of a display driving circuit in Command mode in the background technology of this application;

[0062] Figure 3 is a schematic flow chart of a visually lossless image processing method in one embodiment;

[0063] Figure 4 is a schematic diagram of an RGB component interpolation method in one embodiment;

[0064] Figure 5 is a schematic diagram of an RGB 2+1 and YCoCg 2+1 component interpolation method in one embodiment;

[0065] Figure 6 is a schematic diagram of an RGB 2-component 3-component interpolation method in one embodiment;

[0066] Figure 7 is a schematic diagram of functional submodules of an image processing device in one embodiment;

[0067] Figure 8 The figure shows the internal structure of the system in one embodiment. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0069] The visually lossless image processing method provided by this application can be applied to Figure 1 Or in a display system including a display driving circuit as shown in 2. Wherein, the display system includes portable mobile electronic devices such as smart phones, tablet computers and wearable devices.

[0070] In one embodiment, Figure 3 As shown, a visually lossless image processing method is provided, and the method is applied to a display system as an example for description. The following embodiments use RGB565 format image compression and decompression as an example for description, but are not limited to the RGB565 format. The method includes the following steps:

[0071] Step S301, dividing the image into image blocks of N*M pixels, where N and M are positive integers.

[0072] In this embodiment, the image is divided into image blocks of N*M pixels before compression, where N and M are positive integers. For the convenience of explanation, N and M are both 4 for detailed description below. Before compression, the image is divided into image blocks of 4X4 ​​pixels, and each image block is compressed separately. The 4x4 pixel block is shown in Table 1 below:

[0073]

[0074] Step S302: compress the image block at a preset compression ratio to obtain a compressed coding block, and decompress the coding block to obtain a compressed image block.

[0075] In this embodiment, the 4X4 pixel block has a total of 16*16=256 bits. If the preset compression ratio is 1 / 2, after compression at the preset compression ratio of 1 / 2, the size of each compressed coding block is 128 bits.

[0076] Step S303, determining whether the compressed image block meets the condition of lossless compression.

[0077] In this embodiment, after decompression, it is determined whether the compressed image block meets the condition of lossless compression.

[0078] Specifically, determining whether the image block meets the condition for lossless compression includes:

[0079] According to the minimum and maximum values ​​of the R, G, and B components, the R component difference, G component difference, and B component difference are calculated respectively; among them, MinR, MaxR, MinG, MaxG, MinB, and MaxB are the minimum and maximum values ​​of the R, G, and B components respectively, the R component difference DelaR=MaxR-MinR, the G component difference DeltaG=MaxG-MinG, and the B component difference DeltaB=MaxB-MinB.

[0080] If the sum of the number of bits corresponding to the maximum difference of the R component, the maximum difference of the G component, and the maximum difference of the B component is less than or equal to 6, the condition of lossless compression is met, and step S304 is executed; otherwise, the condition of lossless compression is not met, and step S305 is executed. The number of bits corresponding to the R component difference is MaxBitR, the number of bits corresponding to the G component difference is MaxBitG, and the number of bits corresponding to the B component difference is MaxBitB. If MaxBitR+MaxBitG+MaxBitB≤6, the condition of lossless compression can be met; otherwise, MaxBitR+MaxBitG+MaxBitB>6, otherwise, the condition of lossless compression is not met, and the first lossless compression is performed on each of the compressed image blocks.

[0081] Step S304: If the lossless compression condition is met, a first lossless compression is performed on each compressed image block.

[0082] In this embodiment, if the condition of lossless compression is met, the first lossless compression is performed on each compressed image block. The first lossless compression and decompression of each compressed image block is specifically:

[0083] R=Rmin+DiffR

[0084] G=Gmin+DiffG

[0085] B=Bmin+DiffB

[0086] Among them, Rmin, Gmin, Bmin are the differences between the R, G, B components and the minimum values ​​of the R, G, B components, DiffR = R-Rmin, DiffG = G-Gmin, DiffB = B-Bmin, MaxBitR is the number of bits corresponding to the R component difference, MaxBitG is the number of bits corresponding to the G component difference, and MaxBitB is the number of bits corresponding to the B component difference.

[0087] Step S305: If the condition for lossless compression is not met, a second decompression is performed on each of the compressed image blocks.

[0088] In this embodiment, the second decompression includes: RGB single-component interpolation method, RGB 2+1 component interpolation method, YCoCg2+1 component interpolation method and RGB 2-component 3-component interpolation method.

[0089] Specifically, in the first case, the RGB single component interpolation method is specifically:

[0090] The R component, the G component, and the B component in the compressed image block are respectively used as separate variables, and two points in the R space, the G space, and the B space are respectively obtained as first endpoints, and two points are added equidistantly between the first endpoints, including the two endpoints, so as to have a total of four first interpolation points, and the first interpolation points are numbered;

[0091] Obtaining a first interpolation point having the shortest distance between the R component, the G component, and the B component of each pixel and the corresponding four first interpolation points in the R space, the G space, and the B space, and recording the number of the first interpolation point having the shortest distance;

[0092] If the number of the first pixel is greater than 1, the minimum and maximum values ​​of the first endpoints are swapped, and the two binary bits of each pixel are inverted to ensure that the highest bit of the first position pixel is 0. The highest bit does not need to be encoded, and only 1 bit is needed to encode the low bit. The encoding method is shown in the following table:

[0093]

[0094] In the second case, the RGB 2+1 component interpolation method is specifically:

[0095] According to the characteristics of the compressed image block, RG / B or GB / R or RB / G is determined as an optimal component combination for RGB 2+1 component interpolation, wherein:

[0096] Interpolation with RG / B component combination is as follows:

[0097] Align the R / B component and the G component, where RG / B refers to the two color components R and G forming a two-dimensional space to determine the second endpoint of the R / G space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points, and number the second interpolation points;

[0098] Record the number of the second interpolation point closest to each pixel in the R / G space;

[0099] Determine two third endpoints of the B space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points, and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the B space; or

[0100] Interpolation with GB / R component combination is as follows:

[0101] Align the G / R component with the R component, where the G / R refers to the two color components G and B forming a two-dimensional space to determine the second endpoint of the G / B space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points, and number the second interpolation points;

[0102] Recording the number of the second interpolation point closest to each pixel in the G / B space;

[0103] Determine two third endpoints of the R space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the R space; or

[0104] Interpolation with RB / G component combination is as follows:

[0105] Align the R / G component with the B component, where RB / G refers to the two color components R and B forming a two-dimensional space, determine the second endpoint of the R / G space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points, and number the second interpolation points;

[0106] Record the number of the second interpolation point closest to each pixel in the R / G space;

[0107] Determine two third endpoints of the G space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the G space. The specific interpolation method is as follows Figure 4 The encoding is as follows:

[0108]

[0109] The 2-component + 1-component interpolation of RGB of RB / G and GB / R is performed, and the specific component combination is selected based on the minimum error evaluation value.

[0110] In the third case, the YCoCg 2+1 component interpolation method is specifically:

[0111] Align the R / B component with the G component. At this time, the effective number of the R and B components becomes 6 bits. Convert R, G, and B to the Y, Co, and Cg color domain. The conversion formula is as follows:

[0112]

[0113] The inverse transformation formula is as follows:

[0114]

[0115] The YCoCg 2+1 component interpolation method is used to compress the Y, Co, Cg color domain, similar to the third case above, to obtain the Y, Co, Cg reconstruction value, and convert the reconstruction value into R, G, B. The specific interpolation method is as follows Figure 5 As shown in the figure, C1, C2, C3 correspond to the optimal combination of Y, Co, Cg. The encoding mode is as follows:

[0116]

[0117] In the fourth case, the RGB 2 set 3 component interpolation method is specifically:

[0118] Align the R / B component with the G component, the effective number of bits of the R and B components are both 6 bits, and the effective number of bits of the R and B components are both 6 bits, and the pixels of the pixel block are divided into 2 sets accordingly;

[0119] Consider each point as a point in the RGB three-dimensional space, consider each pixel as a point in the RGB three-dimensional space, find two fourth endpoints in each of the sets, the effective number of bits R, G, B of the fourth endpoints are 5 bits, 6 bits, 5 bits respectively, discretely interpolate 6 points between the fourth endpoints, including 2 endpoints, a total of 8 fourth interpolation points, and number the fourth interpolation points as 0, 1, 2, 3, 4, 5, 6, 7, 8;

[0120] Record the number of the pixel in each set that is closest to the fourth interpolation point, and ensure that the highest bit of the first pixel number in the set is 0. The specific interpolation method is as follows Figure 6 As shown, the encoding mode is as follows:

[0121]

[0122] Preferably, after step S305, the method further includes:

[0123] The error evaluation value is calculated, and the second decompression corresponding to the minimum error evaluation value is selected as the optimal encoding mode, that is, as the final encoding mode when the lossless mode is not satisfied.

[0124] In the above-mentioned visually lossless image processing method, an image is divided into image blocks of N*M pixels, where N and M are positive integers; the image blocks are compressed at a preset compression ratio to obtain compressed coding blocks, and compressed image blocks are obtained by decompressing the coding blocks; it is determined whether the compressed image blocks meet the conditions for lossless compression; if the conditions for lossless compression are met, a first lossless compression is performed on each compressed image block; if the conditions for lossless compression are not met, a second compression is performed on each compressed image block, and the second compression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg 2+1 component interpolation method and RGB2 set 3-component interpolation method. By dividing the image into image blocks for compression, and each image block has a fixed compression ratio, there is no dependency between image blocks, which can facilitate parallel design of circuits, realize windowing function, facilitate local update, adopt image blocks, and obtain visually lossless quality. The algorithm is simple, requires small resources, is convenient for real-time circuit implementation, can reduce storage space and power consumption, reduce resource and transmission bandwidth occupation, and has high cost performance.

[0125] It should be understood that although Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0126] In one embodiment, Figure 7 As shown, a visually lossless image processing device is provided, comprising: an image block division module 71, an image block processing module 72, a decompression judgment module 73, a first decompression module 74 and a second decompression module 75, wherein:

[0127] An image block division module 71 is used to divide the image into image blocks of N*M pixels, where N and M are positive integers;

[0128] An image block processing module 72, configured to compress the image block at a preset compression ratio to obtain a compressed coding block, and obtain a compressed image block by decompressing the coding block;

[0129] A decompression judgment module 73, used to judge whether the compressed image block meets the conditions of lossless compression;

[0130] A first decompression module 74, configured to perform first lossless compression and decompression on each compressed image block if the lossless compression condition is met;

[0131] The second decompression module 75 is used to perform a second decompression on each of the compressed image blocks if the condition for lossless compression is not met, wherein the second decompression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg 2+1 component interpolation method and RGB 2 set 3 component interpolation method.

[0132] Furthermore, the device also includes:

[0133] The error evaluation module 76 is used to calculate an error evaluation value, and then select the second decompression corresponding to the minimum error evaluation value as the optimal encoding method.

[0134] Furthermore, the RGB single component interpolation method is specifically:

[0135] Respectively taking the R component, the G component, and the B component in the compressed image block as separate variables, respectively obtaining two points in the R space, the G space, and the B space as first endpoints, respectively adding two points equidistantly between the first endpoints, including the two endpoints, a total of four first interpolation points, and numbering the first interpolation points;

[0136] Obtaining a first interpolation point with the shortest distance between the R component, the G component, and the B component of each pixel and the corresponding four first interpolations of the R space, the G space, and the B space, and recording the number of the first interpolation point with the shortest distance;

[0137] If the number value range of the pixel at the first position is greater than 1, the minimum value and the maximum value of the first endpoint are exchanged, and each pixel is inverted by two binary bits to ensure that the high bit of the first position does not need to be encoded.

[0138] Furthermore, the RGB 2+1 component interpolation method is specifically:

[0139] According to the characteristics of the compressed image block, RG / B or GB / R or RB / G is determined as an optimal component combination for RGB 2+1 component interpolation, wherein:

[0140] Interpolation with RG / B component combination is as follows:

[0141] Align the R / B component and the G component, where RG / B refers to the two color components R and G forming a two-dimensional space to determine the second endpoint of the R / G space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points and number the second interpolation points;

[0142] Record the number of the second interpolation point closest to each pixel in the R / G space;

[0143] Determine two third endpoints of the B space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points, and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the B space; or

[0144] Interpolation with GB / R component combination is as follows:

[0145] Align the G / R component with the R component, where the G / R refers to the two color components G and B forming a two-dimensional space to determine the second endpoint of the G / B space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points, and number the second interpolation points;

[0146] Recording the number of the second interpolation point closest to each pixel in the G / B space;

[0147] Determine two third endpoints of the R space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the R space; or

[0148] Interpolation with RB / G component combination is as follows:

[0149] Align the R / G component with the B component, where RB / G refers to the two color components R and B forming a two-dimensional space, determine the second endpoint of the R / G space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 points between the second endpoints, including 2 endpoints, a total of 8 second interpolation points, and number the second interpolation points;

[0150] Record the number of the second interpolation point closest to each pixel in the R / G space;

[0151] Determine two third endpoints of the G space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 2 endpoints, a total of 8 third interpolation points and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the G space.

[0152] Furthermore, the YCoCg component interpolation method is specifically:

[0153] Align the R / B components with the G component and transform R, G, and B to the YCoCg color domain;

[0154] Perform YCoCg 2+1 component interpolation compression in the YCoCg color domain to obtain a YCoCg reconstruction value, and convert the YCoCg reconstruction value into RGB.

[0155] Furthermore, the RGB 2-set 3-component set method specifically:

[0156] Align the R / B component with the G component, change the effective number of the R and B components to 6 bits, and divide the pixels into 2 sets accordingly;

[0157] Consider each pixel as a point in the RGB three-dimensional space, find two fourth endpoints in each of the sets, the effective number of bits R, G, B of the fourth endpoints are 5 bits, 6 bits, 5 bits respectively, and discretely interpolate 6 points between the fourth endpoints, including 2 endpoints, for a total of 8 fourth interpolation points, and number the fourth interpolation points;

[0158] Record the serial number of each pixel in the set that is closest to the fourth interpolation point, and ensure that the highest bit of the first pixel serial number in the set is 0.

[0159] Furthermore, the decompression judgment module 73 is specifically used to calculate the R component difference, the G component difference and the B component difference respectively according to the minimum value and the maximum value of the R, G and B components;

[0160] If the sum of the number of bits corresponding to the R component difference, the G component difference and the B component difference is less than or equal to 6, the condition for lossless compression is met; otherwise, the condition for lossless compression is not met.

[0161] Furthermore, the first decompression module 74 is specifically used for:

[0162] R=Rmin+DiffR

[0163] G=Gmin+DiffG

[0164] B=Bmin+DiffB

[0165] Among them, Rmin, Gmin, Bmin are the number of bits corresponding to the difference between the R, G, B components and the minimum value of the R, G, B components, DiffR = R-Rmin, DiffG = G-Gmin, DiffB = B-Bmin, MaxBitR is the number of bits corresponding to the R component difference, MaxBitG is the number of bits corresponding to the G component difference, and MaxBitB is the number of bits corresponding to the B component difference.

[0166] For the specific definition of the visually lossless image processing device, please refer to the definition of the visually lossless image processing method above, which will not be repeated here. The various modules in the above-mentioned visually lossless image processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the display system in the form of hardware, or can be stored in the memory of the display system in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0167] In one embodiment, a display system is provided. The internal structure diagram of the display system can be as follows: Figure 8 As shown. The display system includes a processor and a memory connected via a system bus. The processor of the display system is used to provide computing and control capabilities. The memory of the display system includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores a computer program. The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a visually lossless image processing method is implemented.

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

[0169] In one embodiment, a display system is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0170] Divide the image into image blocks of N*M pixels, where N and M are positive integers;

[0171] Compressing the image block at a preset compression ratio to obtain a compressed coding block, and decompressing the coding block to obtain a compressed image block;

[0172] Determining whether the compressed image block meets the condition of lossless compression;

[0173] If the lossless compression condition is met, performing a first lossless compression and decompression on each of the compressed image blocks;

[0174] If the condition of lossless compression is not met, a second decompression is performed on each compressed image block, and the second decompression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg 2+1 component interpolation method and RGB2 set 3 component set method.

[0175] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through circuits or computer programs. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

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

[0177] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A visually lossless image compression and decompression method, characterized in that: The method comprises: Divide the image into image blocks of N*M pixels, where N and M are positive integers; Compressing the image block at a preset compression ratio to obtain a compressed coding block, and decompressing the coding block to obtain a compressed image block; Determining whether the compressed image block meets the condition of lossless compression; If the lossless compression condition is met, performing a first lossless compression on each of the compressed image blocks; If the condition of lossless compression is not met, a second compression is performed on each compressed image block, and the second compression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg 2+1 component interpolation method and RGB2 set 3-component interpolation method.

2. The method according to claim 1, characterized in that If the condition of lossless compression is not met, performing a second compression on each compressed image block, the method further includes: An error evaluation value is calculated, and the second compression corresponding to the minimum error evaluation value is selected as the optimal encoding method.

3. The method according to claim 1 or 2, characterized in that: The RGB single component interpolation method is specifically: The R component, the G component, and the B component in the compressed image block are respectively used as separate variables, and two points in the R space, the G space, and the B space are respectively obtained as first endpoints, and two points are added equidistantly between the first endpoints, including the two first endpoints, for a total of four first interpolation points, and the first interpolation points are numbered; Obtaining a first interpolation point having the shortest distance between the R component, the G component, and the B component of each pixel and the corresponding four first interpolation points in the R space, the G space, and the B space, and recording the number of the first interpolation point having the shortest distance; If the serial number of the first pixel is greater than 1, the minimum and maximum values ​​of the first endpoints are exchanged, and each pixel is inverted by two binary bits to ensure that the highest bit of the first position pixel is 0, and the highest bit does not need to be encoded.

4. The method according to claim 1 or 2, characterized in that: The RGB 2+1 component interpolation method is specifically: According to the characteristics of the compressed image block, RG / B or GB / R or RB / G is determined as an optimal component combination for RGB2+1 component interpolation, wherein: Interpolation with RG / B component combination is as follows: Align the R / B component and the G component, where RG / B refers to the two color components R and G forming a two-dimensional space to determine the second endpoint of the R / G space, and retain 5 bits of valid digits of the second endpoint, equidistantly interpolate 6 interpolation points between the second endpoints, including the two endpoints, for a total of 8 second interpolation points, and number the second interpolation points; Record the number of the second interpolation point closest to each pixel in the R / G space; Determine two third endpoints of the B space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 8 third interpolation points in total for the two endpoints, and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the B space; or Interpolation with GB / R component combination is as follows: Align the G / R component with the R component, where G / R refers to the two color components G and B forming a two-dimensional space to determine the second endpoint of the G / B space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 second interpolation points between the second endpoints, including the endpoints, and number the second interpolation points; Recording the number of the second interpolation point closest to each pixel in the G / B space; Determine two third endpoints of the R space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 8 third interpolation points in total for the two endpoints, and number the third interpolation points, and record the number of the third interpolation point that is closest to each pixel in the R space; or Interpolation with RB / G component combination is as follows: Align the R / G component with the B component, where RB / G refers to the two color components R and B forming a two-dimensional space, determine the second endpoint of the R / G space, and retain 5 bits of valid digits of the second endpoint, interpolate 6 between the second endpoints, including 8 second interpolation points in total including 2 endpoints, and number the second interpolation points; Record the number of the second interpolation point closest to each pixel in the R / G space; Determine two third endpoints of the G space and retain 5 bits of valid digits of the third endpoints, and interpolate 6 points between the third endpoints, including 8 third interpolation points in total for the 2 endpoints and number the third interpolation points, and record the number of the third interpolation point closest to each pixel in the G space.

5. The method according to claim 1 or 2, characterized in that: The YCoCg 2+1 component interpolation method is specifically: Align the R / B components with the G component and transform R, G, and B to the YCoCg color domain; Perform YCoCg 2+1 component interpolation compression in the YCoCg color domain to obtain a YCoCg reconstruction value, and convert the YCoCg reconstruction value into RGB.

6. The method according to claim 1 or 2, characterized in that: The RGB 2-set 3-component interpolation method is specifically: Align the R, B and G components, and change the effective number of the R and B components to 6 bits, and divide the pixels into 2 sets accordingly; Consider each pixel as a point in the RGB three-dimensional space, find two fourth endpoints in each of the sets, the effective number of bits R, G, B of the fourth endpoints are 5 bits, 6 bits, 5 bits respectively, interpolate 6 points between the fourth endpoints, including the endpoints, a total of 8 fourth interpolation points and number the fourth interpolation points; Record the number of the pixel in each of the sets that is closest to the fourth interpolation point, and ensure that the highest bit of the pixel number at the first position in the set is 0.

7. The method according to claim 1 or 2, characterized in that: The determining whether the image block meets the condition of lossless compression includes: According to the minimum and maximum values ​​of the R, G, and B components, the R component difference, the G component difference, and the B component difference are calculated respectively; If the sum of the number of bits corresponding to the R component difference, the G component difference and the B component difference is less than or equal to 6, the condition for lossless compression is met; otherwise, the condition for lossless compression is not met.

8. The method according to claim 1, characterized in that The first lossless compression of each compressed image block is specifically performed as follows: R=Rmin+DiffR G=Gmin+DiffG B=Bmin+DiffB Among them, Rmin, Gmin, Bmin are the minimum values ​​of R, G, and B components, DiffR, DiffG, and DiffR are the differences between R, G, and B components and Rmin, Gmin, and Bmin, MaxBitR is the number of bits corresponding to the maximum difference of the R component, MaxBitG is the number of bits corresponding to the maximum difference of the G component, and MaxBitB is the number of bits corresponding to the maximum difference of the B component.

9. A visually lossless image processing device, characterized in that: The device comprises: An image block division module, used to divide the image into image blocks of N*M pixels, where N and M are positive integers; An image block processing module, used for compressing the image block at a preset compression ratio to obtain a compressed coding block, and obtaining a compressed image block by decompressing the coding block; A compression judgment module, used to judge whether the compressed image block meets the conditions of lossless compression; A first compression module, configured to perform a first lossless compression on each of the compressed image blocks if a lossless compression condition is met; The second compression module is used to perform a second compression on each of the compressed image blocks if the condition for lossless compression is not met, and the second compression includes: RGB single component interpolation method, RGB 2+1 component interpolation method, YCoCg2+1 component interpolation method and RGB 2 set 3 component interpolation method.

10. A display system, comprising a memory and a processor, wherein the memory stores an algorithm or a computer program, wherein: When the processor executes the algorithm or computer program, the steps of the method according to any one of claims 1 to 8 are implemented.