An image processing method, device and equipment applied to an off-screen image

By combining data lossless encoding and visual lossless encoding, the problem of uneven visual quality caused by the screen-off image compression ratio relying too much on all-black pixel blocks was solved, achieving a compression ratio of 8:1 and visual lossless effect, thus improving the competitiveness of AMOLED driver chips.

CN115643460BActive Publication Date: 2026-11-27SHENZHEN AIXIESHENG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211234684.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-10
Publication Date
2026-11-27
Estimated Expiration
2042-10-10

AI Technical Summary

Technical Problem

In existing AMOLED driver chips, the compression ratio of always-on images relies too heavily on all-black pixel blocks, resulting in uneven visual quality of the compressed image and low compression ratio of variable-length encoding modes.

Method used

A method combining lossless data encoding and lossless visual encoding is adopted. First, lossless data encoding is performed on the image row by row to calculate the compression ratio. If the target compression ratio is reached, the data is retained; otherwise, it is discarded. Then, lossless visual encoding is used to encode the image. The encoding process does not depend on the pixels of adjacent rows. Run-length encoding and various lossless visual encoding methods such as DXT, GR, D2, and HSV_G are used to encode image blocks.

Benefits of technology

It achieves an improved compression ratio of 8:1 without affecting image quality, reduces the need for hardware-implemented line buffer registers, and enhances the market competitiveness of AMOLED driver chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115643460B_ABST
    Figure CN115643460B_ABST
Patent Text Reader

Abstract

This invention provides an image processing method, apparatus, and device for always-on images, including an encoding method and a decoding method. The encoding method includes: acquiring an image to be encoded; performing lossless data encoding on the image to be encoded row by row in a top-to-bottom order to obtain multi-row encoded image data; calculating the compression ratio for each row of encoded image data in the multi-row encoded image data; for each row of encoded image data in the multi-row encoded image data, determining whether the compression ratio of the encoded image data reaches the target compression ratio; if the compression ratio reaches the target compression ratio, retaining the encoded image data; if the compression ratio does not reach the target compression ratio, discarding the encoded image data, and using visual lossless encoding to encode the image corresponding to the encoded image data in the image to be encoded to obtain the encoded file of the image to be encoded, thereby improving the compression ratio while meeting the requirement of visual lossless image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an image processing method, apparatus, and device for use with always-on images. Background Technology

[0002] Always-on display (AOD) refers to the display on a mobile phone or television when the screen is off during standby. That is, without illuminating the entire screen, a portion of the screen displays simple information such as the time (including the clock face), incoming call messages, push notifications, and battery usage. The always-on display contains a significant amount of black areas. For AMOLED screens, the pixels in these black areas can be turned off, thus reducing the power consumption of mobile devices to extremely low levels. Therefore, AOD is widely used in AMOLED mobile phone screens.

[0003] AMOLED driver chips typically store AOD (Always-On Display) images locally. Encoding and decoding of AOD images effectively reduces the memory cost of driver chips and enhances their market competitiveness. Currently, a patented invention discloses an AMOLED always-on display image compression and decompression method and apparatus. On a per-line basis, this patent employs lossy variable-length encoding technology, achieving an estimated overall compression ratio of approximately 6:1. However, this high compression ratio for the entire AOD image relies heavily on the extremely high compression ratio of all-black pixel blocks, potentially leading to uneven visual quality distribution in the compressed image. Furthermore, the variable-length encoding in this patent uses some encoding modes with relatively low compression ratios. Summary of the Invention

[0004] This invention provides an image processing method, apparatus, and device for use with always-on images, the purpose of which is to improve the compression ratio while meeting the requirement of lossless image quality.

[0005] To achieve the above objectives, the present invention provides an image processing method for always-on display images, including the following encoding method:

[0006] Step 1: Obtain the image to be encoded;

[0007] Step 2: Perform lossless encoding on the image to be encoded row by row in a top-to-bottom order to obtain multi-row encoded image data;

[0008] Step 3: Calculate the compression ratio for each line of coded image data in the multi-line coded image data;

[0009] Step 4: For each line of coded image data in the multi-line coded image data, determine whether the compression ratio of the coded image data has reached the target compression ratio. If the compression ratio has reached the target compression ratio, retain the coded image data. If the compression ratio has not reached the target compression ratio, discard the coded image data and encode the image corresponding to the coded image data in the image to be encoded through visual lossless encoding to obtain the encoded file of the image to be encoded.

[0010] Furthermore, step 2 includes:

[0011] The image to be encoded is converted from the primary color space to the target color space, which includes a luminance component, a first chrominance component, and a second chrominance component.

[0012] In the target color space, the image to be encoded is divided into multiple rows according to the order of luminance component, first chrominance component, and second chrominance component;

[0013] Lossless encoding of each row of images in a top-to-bottom order yields multi-row encoded image data.

[0014] Furthermore, lossless data encoding includes:

[0015] For each row of a multi-row image, the image is recorded in 9-bit units, with the first bit as a flag bit and the last 8 bits as data bits. The flag bit is set to 0, and the image is run-length encoded.

[0016] Calculate the compression ratio of each line of encoded image data. If the target compression ratio is reached, retain the encoded image data and fill the extra data bits with 0 to complete the encoding of the current line of image.

[0017] Furthermore, visual lossless coding includes:

[0018] By setting the flag to 1, the current row of the image is segmented to obtain multiple image blocks;

[0019] Each image block is pre-encoded using multiple preset encoding methods, and the target encoding method is then selected.

[0020] Each image block is encoded using a target encoding method to obtain encoded image data for multiple image blocks;

[0021] The encoded image data of multiple image blocks is padded with 0s to obtain the current row of encoded image data. The compression ratio of the encoded image data is the target compression ratio.

[0022] Furthermore, when performing lossless data encoding or visual lossless encoding on the image to be encoded, the identifier of the encoding corresponds to the identifier of the target encoding method, the number of bits stored in the identifier matches the preset number of bits, and the number of bits stored in the remaining encoding information matches the preset number of bits. The number of bits stored is 3 times the width of the image to be encoded minus 1.

[0023] Furthermore, it also includes:

[0024] Encode the identifier of the target encoding method;

[0025] For each image block, the target encoding method is used to encode the image block to obtain the encoded image data of the image block;

[0026] Encode all image blocks in the current row from left to right to obtain the encoded image data of the current row. The compression ratio of the encoded image data is the target compression ratio.

[0027] Encode all image blocks in the multi-line image to be encoded in a top-to-bottom order to obtain the encoded file of the image to be encoded.

[0028] Furthermore, the decoding method is also included as follows:

[0029] Step 5: Obtain the parameters of the encoded file during encoding;

[0030] Step 7: Determine the encoding method used for each row of encoded image data by using the row flag bit. The encoding methods include lossless data encoding and lossless visual encoding.

[0031] If the data is lossless encoded, then the encoded file is decoded according to the run-length encoding decoding method;

[0032] If it is visual lossless encoding, the target decoding method of the encoded image data of each image block is determined according to the identifier of the target encoding method, and the encoded image data of each image block is decoded according to the target decoding method to obtain the decoded image.

[0033] Furthermore, step 7 includes:

[0034] Based on the identifier of the target encoding method in the encoding file, obtain the target decoding method for each image block in the encoding file;

[0035] The encoded image data of each image block is decoded using a target decoding method to obtain the decoded image block;

[0036] The target decoding method and the target encoding method of the encoded image data for each image block correspond one-to-one.

[0037] The present invention also provides an image processing apparatus for use with always-on display images, comprising:

[0038] The acquisition module is used to acquire the image to be encoded.

[0039] The data lossless encoding module is used to perform lossless encoding of the image to be encoded line by line in a top-to-bottom order to obtain multi-line encoded image data.

[0040] The calculation module is used to calculate the compression ratio for each line of coded image data in the multi-line coded image data.

[0041] The judgment module is used to determine whether the compression ratio of each line of encoded image data in the multi-line encoded image data has reached the target compression ratio. If the compression ratio reaches the target compression ratio, the encoded image data is retained. If the compression ratio does not reach the target compression ratio, the encoded image data is discarded, and the image corresponding to the encoded image data in the image to be encoded is encoded through visual lossless encoding to obtain the encoded file of the image to be encoded.

[0042] The present invention also provides an image processing device for use with always-on display images, for implementing the above-mentioned image processing method for always-on display images, comprising: a memory and a processor;

[0043] Memory is used to store computer programs;

[0044] A processor is used to execute computer programs stored in memory.

[0045] The method described above in this invention has the following beneficial effects:

[0046] This invention first divides the image to be encoded into lines, then uses run-length encoding to perform lossless data encoding and calculates the compression ratio. It then determines whether the compression ratio of the encoded image data reaches the target compression ratio. If the compression ratio reaches the target compression ratio, the encoded image data is retained; otherwise, the encoded image data is discarded. Visual lossless encoding is then used to encode the image corresponding to the encoded image data in the image to be encoded, resulting in the encoded file of the image to be encoded. Compared with existing technologies, this invention does not require reference to any adjacent row pixels, and the hardware implementation does not require a line buffer register. It can improve the compression ratio while meeting the requirement of visual lossless image quality.

[0047] Other beneficial effects of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0048] Figure 1 This is a flowchart of an embodiment of the present invention;

[0049] Figure 2 This is a diagram illustrating the encoding process of an embodiment of the present invention;

[0050] Figure 3This refers to the bitstream composition of run-length encoded data used in the lossless encoding embodiments of the present invention;

[0051] Figure 4 This is a schematic diagram illustrating the generation of the color palette used in the preset encoding one of the visual lossless encoding in this embodiment of the invention;

[0052] Figure 5 This is a schematic diagram of linear interpolation in visual lossless coding in an embodiment of the present invention;

[0053] Figure 6 This is a diagram illustrating the decoding process in an embodiment of the present invention. Detailed Implementation

[0054] To make the technical problems, methods, and advantages of this invention clearer, a detailed description will be provided below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0055] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0056] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a locking connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0057] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0058] This invention addresses existing problems by providing an image processing method, apparatus, and device for always-on images, which can improve the compression ratio while meeting the requirement of lossless image quality.

[0059] like Figure 1 , 2 As shown, an embodiment of the present invention provides an image processing method for always-on display images, including the following encoding method:

[0060] Step 1: Obtain the image to be encoded;

[0061] Step 2: Perform lossless encoding on the image to be encoded row by row in a top-to-bottom order to obtain multi-row encoded image data;

[0062] Step 3: Calculate the compression ratio for each line of coded image data in the multi-line coded image data;

[0063] Step 4: For each line of coded image data in the multi-line coded image data, determine whether the compression ratio of the coded image data has reached the target compression ratio. If the compression ratio has reached the target compression ratio, retain the coded image data. If the compression ratio has not reached the target compression ratio, discard the coded image data and encode the image corresponding to the coded image data in the image to be encoded through visual lossless encoding to obtain the encoded file of the entire image to be encoded.

[0064] Specifically, step 2 includes:

[0065] The image to be encoded is converted from the primary color space to the target color space, which includes a luminance component, a first chrominance component, and a second chrominance component.

[0066] In the target color space, the image to be encoded is divided into multiple rows according to the order of luminance component, first chrominance component, and second chrominance component;

[0067] Lossless encoding of multiple rows of images is performed line by line in a top-to-bottom order to obtain multi-row encoded image data.

[0068] In this embodiment of the invention, the primary color space is the Red-Green-Blue (RGB) color space, and the target color space includes the YCoCg color space and the HSV color space. The YCoCg color space includes a luminance component (Y), a first chromaticity component, and a second chromaticity component; the first chromaticity component is an orange component (Co), and the second chromaticity component is a green component (Cg). The HSV color space includes a chromaticity component (H), a saturation component (S), and a luminance component (V). The image to be encoded is converted from the RGB color space to the YCoCg color space using the YCoCg-R standard. The specific conversion formula is as follows:

[0069] Co = RB

[0070] t = B + (Co >> 1)

[0071] Cg = Gt

[0072] Y = t + (Cg >> 1)

[0073] The data for the Y, Co, and Cg components are stored together separately and arranged in a row according to the order of Y, Co, and Cg.

[0074] Specifically, lossless data encoding includes:

[0075] For each row of images in a multi-row image, the image is recorded in 9-bit units, with the first bit as a flag bit and the last 8 bits as data bits. The flag bit is set to 0, and the image is run-length encoded.

[0076] Calculate the compression ratio of each line of encoded image data. If the target compression ratio is reached, retain the encoded image data and fill the extra data bits with 0 to complete the encoding of the current line of image.

[0077] In this embodiment of the invention, lossless data encoding is performed in the YCoCg color space, with each row as a unit. Each row of the image is recorded in 9-bit units, with the first bit as a flag and the following 8 bits as data bits. Run-length encoding is performed on the arranged images. First, 1 unit of data is used to record the first value, the flag is set to 0, and the data bits represent the first value. The run-length value is then set to 0, and subsequent images are encoded. When the value of a new data bit is the same as the previous one, the run-length value is incremented by 1. When the value of a new data bit is different from the previous one or the run-length value reaches 255, if the run-length value is not 0, 1 unit of data is used to record the run-length value, the flag is set to 1, and the data bits represent the run-length value. Then, the newly appearing data value is recorded, the flag is set to 0, and the data bits represent the newly appearing data value. If the run-length value is 0, it is not recorded, and 1 unit of data is used to record the newly appearing data value directly. After encoding a complete row of data, if the current run-length value is 0, it is not recorded; otherwise, 1 unit of data is used to record the run-length value.

[0078] Calculate the number of bits in the encoded image data generated by run-length encoding. If the target compression ratio is met, retain the encoded image data and fill the excess data bits with 0, then encode the next line; otherwise, set the line flag to 1 and perform visual lossless encoding on the current line.

[0079] Specifically, visual lossless coding includes:

[0080] By setting the flag to 1, the current row of the image is segmented to obtain multiple image blocks;

[0081] Each image block is pre-encoded using four preset encoding methods, and the target encoding method is then selected.

[0082] Each image block is encoded using a target encoding method to obtain encoded image data for multiple image blocks;

[0083] Encode image data from multiple image blocks by padding the compression length with zeros to obtain an encoded image with a compression ratio that meets the target compression ratio.

[0084] In this embodiment of the invention, visual lossless encoding is performed in blocks of 1x16 size, with some encoding methods using the HSV color space. All encoding methods do not reference pixels in any adjacent rows. The row flag is set to 1, dividing a row of image data into 1x16 image blocks. Four visual lossless encoding methods are attempted for each image block. During visual lossless encoding, due to bit limitations, when the preset bit count in each encoding method is less than the actual number of bits required to store the data (mainly when the actual data is 8 bits, and the preset bit count is 3, 4, or 6 bits), quantization is required. During quantization, the original data is shifted right by a certain number of bits until its effective bit count meets the preset bit count. During reconstruction and decoding, these data need to be dequantized. For 6-bit data, it is directly shifted left by 2 bits; for 4-bit data, the high 4 bits and low 4 bits are filled with the quantized 4-bit value; for 3-bit data, the data is first shifted left by 5 bits, then the high 3 bits are copied as the middle 3 bits, and the last 2 bits use the high 2 bits. The quantization and dequantization processes will not be described further.

[0085] The four visual lossless coding methods include: DXT, GR, D2, and HSV_G. It should be noted that DXT, GR, D2, and HSV_G are used in this embodiment of the invention for ease of distinction and are not technical terms.

[0086] Specifically, the DXT method is used to pre-encode the current block and calculate the sum of squared errors (SSE) and the visible SSE. The DXT method uses a color palette, which contains four colors: black (00) and white (11). The last pixel of the current reconstruction block is selected. If the pixel's color is not black or white, it is used as the third color; otherwise, color 10 from the previous DXT-selected reconstruction block's color palette is used as color 01 in the current color palette. Furthermore, to reduce computation, a color list for the current block is constructed. Instead of all pixels, the color with the lowest distortion rate is selected as color 10 in the color palette for encoding the current block. A diagram illustrating the generated color palette is shown below. Figure 3 As shown.

[0087] Specifically, during encoding, 4 bits are used per component to store color number 10 of the current palette, and 2 bits are used to store the palette index number of each pixel. In the actual programming implementation, the encoder sets up two palettes: `palette` and `in_palette`. `palette` is the palette used for trial encoding during pre-encoding, and `in_palette` is the palette saved when the DXT mode is selected for the current block, for reference when encoding subsequent blocks using the DXT method. Specifically, the DTX method encoding process is as follows:

[0088] ① Initialize the color palette for the current block. If the current block is the first block in the row, color palettes 00 and 01 are set to black, and color palette 11 is set to white; if the current block is not the first block in the row, the color palette of the previously reconstructed block encoded using this method is used as the initialization template.

[0089] ② Obtain the color of the last pixel of the previous reconstructed block and determine whether it is black or white. If it is, use color 10 of the color palette as color 01 of the current block's color palette; otherwise, directly use the color of that pixel as color 01 of the current block's color palette.

[0090] ③ Create a color list for the current block. By iterating through all pixels of the current block, add any colors not included in the list to the list.

[0091] ④ Sequentially assign each color in the list as color number 10 to the current block's color palette. Replace all pixel colors in the current block with the closest color in the palette, and record the index number of each pixel color in the palette after replacement. Reconstruct the current block's pixels using the current palette and the color index number of each pixel, and calculate the SSE (Score-Equalizer). Iterate through the palettes where the SSE is minimized, and record the 10th color of that palette and the palette index number of each pixel.

[0092] The pixel reconstruction process described above includes: Steps 1 and 2 are exactly the same as the aforementioned encoding steps ① and ②. Step 3 extracts color number 10 from the coded image data, performs inverse quantization, and obtains the complete color palette. Step 4 extracts the color index of each pixel from the coded image data and reconstructs the pixel information of the current block based on the color palette.

[0093] Calculate the sum of squared errors (SSE) and the visible SSE.

[0094] The formula for calculating SSE is as follows:

[0095]

[0096] In the above formula, C i This represents the reconstructed value of the component with coordinates (1, j) in a 1×16 block, Oi This represents the original value of the component at the corresponding position.

[0097] The calculation method for visual SSE is largely the same as SSE, except that it calculates a threshold based on the pixel values ​​of the current block. Only reconstructed pixels or original pixels greater than the threshold participate in the SSE calculation. The threshold is calculated as the average of all non-zero values ​​in the block.

[0098] Specifically, the GR method is used to pre-encode the current block and calculate the SSE between the reconstructed and original values. The GR method uses a base-pixel approach, where the base pixel refers to the pixel in the reconstructed image used as the base point for linear interpolation. The linear interpolation method is as follows: Figure 4 As shown, the base pixels are generally located at inflection points and extreme points of pixel changes, and the three color channels share the same base pixel. The last pixel of the previous reconstruction block in the current row is obtained; if it is the first block in the row, the last pixel of the previous reconstruction block is set to 0. In the current block, the first base pixel is selected from the first 15 pixels, and the second base pixel is selected from the last 15 pixels. The selection method is to select two pixels from 16 pixels each time as base pixels, traversing all cases, using the selected pixels as base pixels to complete image reconstruction, and selecting the case with the lowest distortion rate. The position information of each base pixel is stored using 4 bits, and the color information is stored using 18 bits. The specific encoding process includes:

[0099] ① Select two pixels from the 16 pixels of the current block as base pixels;

[0100] ② Obtain the last pixel of the previous reconstructed block;

[0101] ③ Based on the base pixel and the last pixel of the previous reconstructed block, linear interpolation is used to obtain all the reconstructed pixels of the current block, and SSE is calculated. The color of the pixels located after the second base pixel is directly adopted from the color of the second base pixel.

[0102]

[0103] Where l represents the value of the last pixel of the previous block, n and m represent the position indices of the two base points, B1 and B2 represent the pixel values ​​of the two base points, and i represents the position index of the current pixel;

[0104] ④ Iterate through all the selection cases of the base pixels. Select the case with the smallest SSE, and record the position and color information of the two base pixels in the current block.

[0105] The pixel reconstruction process is as follows: ① Obtain the position and color information of the base pixels from the coded image data and perform inverse quantization; ② Obtain the color information of the last pixel of the previous reconstruction block; ③ Reconstruct the pixel information of the current block based on linear interpolation of these three pixels. Note that the color of all pixels after the second base pixel is equal to that of the second base pixel.

[0106] Calculate the SSE of the reconstructed pixel and the original pixel.

[0107] Specifically, both the D2 method and the HSV_G method operate within the HSV color space, converting the current block to the HSV color space. This method is used for conversions from the RGB primary color space to the HSV color space, and will not be elaborated upon further. The specific conversion formulas are as follows:

[0108]

[0109]

[0110]

[0111] V = max(R, G, B)

[0112]

[0113]

[0114] If H < 0, then H = H + 360

[0115]

[0116] S = S × 255

[0117] V = V × 255

[0118] Specifically, the D2 method is used to pre-encode the current block and calculate the SSE and visible SSE of the reconstructed value compared to the original value. The D2 method, based on the HSV color space and luma palette, converts the current block to the HSV color space. Leveraging the high probability of local color consistency in AOD images, it transmits the H and S components of the current block (both stored and transmitted using 4 bits). For the V component (each value stored and transmitted using 3 bits), the highest and lowest visible V component values ​​of the current block are transmitted, and interpolation is performed on these two values ​​to obtain an intermediate value, which, along with 0, forms a 4-element luma palette. The V component of each pixel is replaced by the index (2 bits) of the closest value in the luma palette. The specific encoding process includes:

[0119] ① Record the maximum value of the V component of the current block, and record the H and S components of the pixel with the largest V component as the H and S components of the entire block;

[0120] ② Calculate the average value of the V component in the current block, excluding pixels that are 0. Use the average value as the visible brightness (V component) threshold, and find the minimum value among the brightness values ​​that are higher than the threshold.

[0121] ③ Construct a brightness panel (V component), where the value of index 0 is 0, the value of index 1 is the minimum visible value, the value of index 3 is the maximum value, and the value of index 2 is the average of indices 1 and 3.

[0122] ④ Iterate through all pixels and replace the V value of each pixel with the index of the nearest value in the brightness panel.

[0123] ⑤ Write the minimum and maximum visible values ​​of the V component, the H and S components of the current block, and the indexes of all pixels into the bitstream.

[0124] The pixel reconstruction process is as follows:

[0125] ① Obtain the H and S components of the current block and fill them into all pixels of the current block;

[0126] ② Obtain the maximum value, minimum value, and index list of the V component, and construct a brightness panel;

[0127] ③ Reconstruct the V component of the current block by referring to the brightness panel and index list;

[0128] ④ Convert the HSV color space to the RGB color space.

[0129] Calculate the SSE of the reconstructed pixel and the original pixel, and the visible SSE.

[0130] The formula for converting HSV color space to RGB color space is as follows, and will not be repeated hereafter.

[0131]

[0132]

[0133]

[0134]

[0135]

[0136] p = V × (1 - S)

[0137] q = V × (1 - f × S)

[0138] t=V×(1-(1-f)×S)

[0139]

[0140] Specifically, the HSV_G method is used to pre-encode the current block and calculate the SSE of the reconstructed pixels. The HSV_G method is based on the encoding method of the HSV color space and the base pixels. The concept of the base pixels is the same as that of the GR method. The difference is that the H and S components (both 8 bits) of the current block are transmitted by taking advantage of the high probability of local color consistency in the AOD image.

[0141] For the V component (6 bits), a linear interpolation reconstruction method based on three base pixels (3 bits of position information) is used for encoding; the specific encoding process is as follows:

[0142] ① Obtain the last pixel of the previous reconstructed block in the current row, called last_pixel, and convert it to the HSV color space;

[0143] ② Select a base pixel from pixels 0 to 7, 4 to 11, and 8 to 15 respectively, and perform linear interpolation reconstruction on the V component of the current block based on the base pixel. The value of the V component of the pixels after the third base pixel is equal to the value of the third base pixel.

[0144] The linear interpolation method is as follows:

[0145]

[0146] Where l represents the value of the last pixel of the previous block, n, m, o represent the position indices of the three base points, B1, B2, B3 represent the pixel values ​​of the three base points, and i represents the position index of the current pixel;

[0147] Calculate the SSE of the V component reconstruction results;

[0148] ③ Select the case with the minimum SSE among all cases, and record the positions of the three base pixels and the values ​​of the V component;

[0149] ④ Find the pixel with the largest V component among the three base pixels, and use its H and S component values ​​as the H and S component values ​​of the current block.

[0150] The pixel reconstruction process is as follows:

[0151] ① Get the last pixel of the previous reconstructed block in the current row, called last_pixel, get the H and S components of the current block, and get the V components and positions of the three base pixels;

[0152] ② Reconstruct each pixel. The value of V for pixels before the first base pixel is obtained by linear interpolation of the V component of last_pixel and the V component of the first base pixel. The value of V for pixels between the first and second base pixels is obtained by linear interpolation of the V components of the first and second base pixels. The value of V for pixels after the third base pixel is equal to that of the third base pixel. The linear interpolation process is the same as the linear interpolation process in Method 2.

[0153] ③ Convert the reconstructed pixels to the RGB color space.

[0154] Calculate the SSE of the reconstructed pixel and the original pixel.

[0155] The encoding method with the smallest SSE is selected as the target encoding method. If the target encoding method is the DXT or D2 method, the visible SSE of the DXT and D2 methods is compared, and the method with the smallest visible SSE is selected as the target encoding method.

[0156] The above steps complete the precoding of the current block. Clearly, the precoding stage involves sequentially testing different encoding methods to obtain the optimal encoding scheme for the current block and the necessary information for the actual encoding stage. Precoding ensures that the selected target encoding scheme is optimal each time, effectively guaranteeing the quality of the encoded image and achieving the goal of visual losslessness.

[0157] Specifically, in the above embodiments, when encoding an image in rows or 1x16 blocks, it is necessary to encode an identifier for the target encoding method corresponding to the encoding unit. The number of bits stored for this identifier matches the preset number of bits, and the number of bits stored for the remaining encoding information also matches the preset number of bits. Specifically, the number of bits stored for a row of image data is three times the width of the image to be encoded minus 1. In actual operation, if the data is less than the fixed number of bits after the entire row is encoded, zero padding is required to achieve the preset compression ratio of this invention.

[0158] Specifically, after obtaining the target encoding method through precoding, the image blocks are encoded using the target encoding method, as follows:

[0159] Encode the identifier of the target encoding method for each component;

[0160] Determine whether the DXT method satisfies the optimal encoding method for the current block. If so, use the DXT method to encode the current block.

[0161] Determine whether the GR method satisfies the optimal encoding method for the current block. If so, use the GR method to encode the current block.

[0162] Determine whether the D2 method satisfies the optimal encoding method for the current block. If so, use the D2 method to encode the current block.

[0163] Determine whether the HSV_G method satisfies the optimal encoding method for the current block. If so, use the HSV_G method to encode the current block.

[0164] The above steps complete the encoding of a 1×16 image block;

[0165] Repeat the above steps to encode all image blocks in the entire row of the image, and fill the remaining bits of the encoded image data in that row with 0;

[0166] The encoding process continues until the entire image to be encoded is completed, at which point the encoded file of the entire image to be encoded is output.

[0167] Specifically, such as Figure 5 As shown, an image processing method applied to always-on images also includes the following decoding method:

[0168] Step 5: Read the parameters of the encoded file during encoding;

[0169] Step 7: Determine the encoding method used for each row of encoded image data by using the row flag bit. The encoding methods include lossless data encoding and lossless visual encoding.

[0170] If the data is lossless encoded, the encoded file is decoded according to the run-length encoding decoding method;

[0171] If it is visual lossless encoding, the target decoding method of the encoded image data of each image block is determined according to the identifier of the target encoding method, and the encoded image data of each image block is decoded according to the target decoding method to obtain the decoded image.

[0172] In this embodiment of the invention, the row flag bit determines whether the current row uses lossless data encoding or lossless visual encoding. If it is lossless data encoding, the row is reconstructed using the decoding method corresponding to run-length encoding. Each time, 9 bits of data are read. If the flag bit is 0, the data bit represents the pixel value, which is filled into the current pixel, and then the next pixel is processed. If the flag bit is 1, the data bit is the run-length value n, and n consecutive pixels are filled with the pixel value of the previous pixel. This process is repeated until all pixels in the row are filled, and the color space is converted from the YCoCg color space to the RGB color space. The specific conversion formula is as follows:

[0173] t = Y - (Cg >> 1)

[0174] G = Cg + t

[0175] b = t - (Co >> 1)

[0176] R = B + Co

[0177] If visual lossless encoding is used, each 1x16 image block is reconstructed sequentially from left to right based on the data.

[0178] Read the decoding method of the current block;

[0179] Determine whether the DXT method satisfies the decoding method for the current block;

[0180] If so, then use this method to decode the current block;

[0181] The decoding process for each method is the reverse of the encoding process. For the first preset encoding method, the color palette number 10 from the encoding process is read sequentially, followed by the palette index list of pixels within the block. The palette is then reconstructed following the pixel reconstruction steps from the encoding process. The corresponding color in the palette is retrieved from the index list, dequantized, and then used to fill the corresponding pixels within the block. The reconstruction processes for the following methods can be deduced from the encoding processes of the corresponding methods described above, and will not be elaborated further here.

[0182] Determine whether the GR method satisfies the decoding method of the current block;

[0183] If so, then use this method to decode the current block;

[0184] Determine whether the D2 method satisfies the decoding method of the current block;

[0185] If so, then use this method to decode the current block;

[0186] Determine whether the component to be encoded is a luminance component;

[0187] If so, determine whether the HSV_G method satisfies the decoding method of the current block;

[0188] If so, then use this method to decode the current block;

[0189] The above steps complete the decoding of a 1x16 image block.

[0190] Continue decoding until all image blocks in the entire line are decoded, discarding any extra bits of data after decoding is complete;

[0191] Repeat the above steps until the encoded file is completely decoded; save the decoded image.

[0192] Specifically, step 7 includes:

[0193] Based on the identifier of the target encoding method in the encoding file, obtain the target decoding method for the encoded image data of each image block in the encoding file;

[0194] The encoded image data of each image block is decoded using a target decoding method to obtain the decoded image block;

[0195] The target decoding method and the target encoding method of the encoded image data for each image block correspond one-to-one.

[0196] This invention first divides the image to be encoded into lines, then uses run-length encoding to perform lossless data encoding and calculates the compression ratio. It then determines whether the compression ratio of the encoded image data reaches the target compression ratio of 8:1. If the compression ratio reaches the target compression ratio of 8:1, the encoded image data is retained; otherwise, the encoded image data is discarded. The corresponding image in the image to be encoded is encoded using visual lossless encoding to obtain the encoded file of the image to be encoded. Compared with the prior art, it does not require reference to any adjacent row pixels, does not require a line buffer register in hardware implementation, can improve the compression ratio to 8:1, and can also meet the requirement of visual lossless image quality.

[0197] This invention also provides an image processing apparatus for use with always-on display images, comprising:

[0198] The acquisition module is used to acquire the image to be encoded.

[0199] The data lossless encoding module is used to perform lossless encoding of the image to be encoded line by line in a top-to-bottom order to obtain multi-line encoded image data.

[0200] The calculation module is used to calculate the compression ratio for each line of coded image data in the multi-line coded image data.

[0201] The judgment module is used to determine whether the compression ratio of each line of encoded image data in the multi-line encoded image data has reached the target compression ratio. If the compression ratio reaches the target compression ratio, the encoded image data is retained. If the compression ratio does not reach the target compression ratio, the encoded image data is discarded, and the image corresponding to the encoded image data in the image to be encoded is encoded through visual lossless encoding to obtain the encoded file of the image to be encoded.

[0202] This invention also provides an image processing device for use with always-on display images, for implementing the above-described image processing method for always-on display images, comprising: a memory and a processor;

[0203] Memory is used to store computer programs;

[0204] A processor is used to execute computer programs stored in memory.

[0205] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An image processing method applied to always-on screen images, characterized in that, The encoding methods include the following: Step 1: Obtain the image to be encoded; Step 2: Perform lossless encoding on the image to be encoded row by row, from top to bottom, to obtain multi-line encoded image data, including: The image to be encoded is converted from a primary color space to a target color space, wherein the target color space includes a luminance component, a first chrominance component, and a second chrominance component. In the target color space, the image to be encoded is divided into multiple rows according to the order of the luminance component, the first chrominance component, and the second chrominance component; Each row of the multiple rows of images is losslessly encoded in a top-to-bottom order to obtain multi-row encoded image data; The lossless encoding of the data includes: For each row of the multiple images, the image is recorded in 9-bit units, with the first bit as a flag bit and the last 8 bits as data bits. The flag bit is set to 0, and the image is run-length encoded. Calculate the compression ratio of the encoded image data for each row. If the target compression ratio is reached, fill the excess data bits with 0 and retain the encoded image data to complete the encoding of the current row of images. Step 3: Calculate the compression ratio for each line of coded image data in the multiple lines of coded image data; Step 4: For each line of coded image data in the multiple lines of coded image data, determine whether the compression ratio of the coded image data reaches the target compression ratio. If the compression ratio reaches the target compression ratio, retain the coded image data; if the compression ratio does not reach the target compression ratio, discard the coded image data, and use visual lossless encoding to encode the image corresponding to the coded image data in the image to be encoded, to obtain the encoded file of the image to be encoded. The visual lossless encoding includes: By setting the flag to 1, the current row of the image is segmented to obtain multiple image blocks; Each image block is pre-encoded using multiple preset encoding methods, and the target encoding method is selected. Each image block is encoded using the target encoding method to obtain encoded image data for multiple image blocks; The encoded image data of multiple image blocks are padded with 0s to achieve a compression ratio that meets the target compression ratio.

2. The image processing method for always-on display images according to claim 1, characterized in that, When performing lossless data encoding or lossless visual encoding on the image to be encoded, the encoding corresponds to the identifier of the target encoding method, the number of bits stored in the identifier matches the preset number of bits, and the number of bits stored in the remaining encoding information matches the preset number of bits. The number of bits stored is 3 times the width of the image to be encoded minus 1.

3. The image processing method for always-on display images according to claim 2, characterized in that, Also includes: Encode the identifier of the target encoding method; For each image block, the target encoding method is used to encode the image block to obtain the encoded image data of the image block; Encode all image blocks in the current row in order from left to right to obtain the encoded image data of the current row. The compression ratio of the encoded image data is the target compression ratio. Encode all image blocks in the multiple rows of the image to be encoded in a top-to-bottom order to obtain the encoded file of the entire image to be encoded.

4. The image processing method for always-on display images according to claim 3, characterized in that, The decoding methods also include the following: Step 5: Obtain the parameters of the encoded file during encoding; Step 6: Determine the encoding method used for each row of encoded image data by using the row flag bit. The encoding method includes lossless data encoding and lossless visual encoding. If the data is lossless encoded, the encoded file is decompressed according to the run-length encoding decompression method; If it is visual lossless encoding, then the target decoding method of the image block is determined according to the identifier of the target encoding method, and the encoded file is decoded according to the target decoding method to obtain the decoded image.

5. The image processing method for always-on display images according to claim 4, characterized in that, Step 6 includes: Based on the identifier of the target encoding method in the encoding file, obtain the target decoding method for each image block in each line of the encoded image data; The encoded image data of each image block is decoded using the target decoding method to obtain the decoded image block; The target decoding method of the encoded image data of each image block corresponds one-to-one with the target encoding method.

6. An image processing apparatus for use with always-on display images, characterized in that, include: The acquisition module is used to acquire the image to be encoded. The lossless data encoding module is used to perform lossless data encoding on the image to be encoded line by line, in a top-to-bottom order, to obtain multi-line encoded image data, including: The image to be encoded is converted from a primary color space to a target color space, wherein the target color space includes a luminance component, a first chrominance component, and a second chrominance component. In the target color space, the image to be encoded is divided into multiple rows according to the order of the luminance component, the first chrominance component, and the second chrominance component; Each row of the multiple rows of images is losslessly encoded in a top-to-bottom order to obtain multi-row encoded image data; The lossless encoding of the data includes: For each row of the multiple images, the image is recorded in 9-bit units, with the first bit as a flag bit and the last 8 bits as data bits. The flag bit is set to 0, and the image is run-length encoded. Calculate the compression ratio of the encoded image data for each row. If the target compression ratio is reached, fill the excess data bits with 0 and retain the encoded image data to complete the encoding of the current row of images. The calculation module is used to calculate the compression ratio for each line of coded image data in the multiple lines of coded image data; A judgment module is used to determine, for each line of coded image data in the multiple lines of coded image data, whether the compression ratio of the coded image data has reached a target compression ratio. If the compression ratio reaches the target compression ratio, the coded image data is retained; if the compression ratio does not reach the target compression ratio, the coded image data is discarded, and visual lossless encoding is used to encode the image corresponding to the coded image data in the image to be encoded, to obtain the encoded file of the image to be encoded. The visual lossless encoding includes: By setting the flag to 1, the current row of the image is segmented to obtain multiple image blocks; Each image block is pre-encoded using multiple preset encoding methods, and the target encoding method is selected. Each image block is encoded using the target encoding method to obtain encoded image data for multiple image blocks; The encoded image data of multiple image blocks are padded with 0s to achieve a compression ratio that meets the target compression ratio.

7. An image processing apparatus for use with always-on display images, used to implement the image processing method for always-on display images as described in any one of claims 1-5, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is used to execute computer programs stored in the memory.

Citation Information

Patent Citations

  • Visual lossless ultra-low delay video compression system based on FPGA

    CN111614963A

  • AMOLED always-on display picture compression and decompression method and device

    CN113990258A