Image coding method, module, device, storage medium and program product

By performing frequency domain transformation and encoding of images, the problem of insufficient redundant information removal capability of image bandwidth compression in the prior art is solved, and more efficient data compression and hardware bandwidth management are achieved.

CN119364003BActive Publication Date: 2025-03-28MOORE THREADS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411903424.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-03-28
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

When existing image bandwidth compression technologies reduce the bandwidth requirements of hardware image processors, there is a problem of insufficient redundant information removal capabilities, especially in block-level compression, the redundant information reduction of the airspace residual data is limited.

Method used

By dividing the image, frequency domain transformation in at least one direction is performed, high-frequency and low-frequency components are separated, and target image blocks are encoded to generate an encoded code stream.

Benefits of technology

Compared with the traditional airspace difference method, the redundant information of the image can be more effectively removed through frequency domain transformation and encoding, reducing the amount of data and reducing the bandwidth requirements of hardware devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119364003B_ABST
    Figure CN119364003B_ABST
Patent Text Reader

Abstract

The present application discloses an image encoding method, module, device, storage medium and program product, wherein the method is applied to an image encoding module, and the method includes: dividing an image to obtain at least one initial image block; performing a frequency domain transformation on the initial image block in at least one direction to obtain a target image block corresponding to the initial image block; the frequency domain transformation is used to achieve separation of high-frequency components and low-frequency components in the direction; encoding at least one of the target image blocks to obtain an encoded code stream of the image. In this way, by performing a frequency domain transformation on the initial image block in at least one direction, separating redundant information of the image in the frequency domain, and encoding the target image block after high- and low-frequency separation, the method has a better ability to remove redundancy than the traditional spatial domain difference method.
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 an image encoding method, an image decoding method, a module, a device, a storage medium and a program product. Background Art

[0002] Image bandwidth compression technology has always been an effective solution to reduce the communication bandwidth between Internet Protocol (IP) addresses of hardware image processors. Image bandwidth compression can compress redundant information of two-dimensional or multi-dimensional images in the spatial domain, reduce the amount of image data in transmission, and reduce the bandwidth of hardware devices.

[0003] Traditional image bandwidth compression technologies are divided into row-level compression and block-level compression. The principle of row-level compression is that the current pixel searches for the difference between the previous pixel and the current pixel, and uses the exponential Columbus to encode the residual between the previous pixel and the current pixel to obtain the coded bitstream to be transmitted. Row-level bandwidth compression can effectively utilize the redundancy of pixel space and reduce the amount of image data.

[0004] The principle of block-level compression is to encode the image block. By selecting the pixel with fixed coordinates in the image block as the basis, the remaining pixels are subtracted from the pixel to obtain the spatial residual data in the image block. The spatial residual data is exponentially encoded to obtain the encoded bitstream to be transmitted. The advantage of block-level bandwidth compression is that it can reduce the hardware layout and line buffer size. Summary of the invention

[0005] In view of this, the embodiments of the present application at least provide an image encoding method, an image decoding method, a module, a device, a storage medium and a program product.

[0006] The technical solution of the embodiment of the present application is implemented as follows:

[0007] On the one hand, an embodiment of the present application provides an image encoding method, which is applied to an image encoding module, and the method includes: dividing the image to obtain at least one initial image block; performing a frequency domain transform on the initial image block in at least one direction to obtain a target image block corresponding to the initial image block; the frequency domain transform is used to achieve separation of high-frequency components and low-frequency components in the direction; encoding at least one of the target image blocks to obtain an encoded code stream of the image.

[0008] In the embodiment of the present application, the image is divided to obtain at least one initial image block; the initial image block is subjected to frequency domain transformation in at least one direction to obtain a target image block corresponding to the initial image block; the frequency domain transformation is used to achieve separation of high-frequency components and low-frequency components in the direction; at least one of the target image blocks is encoded to obtain an encoded bit stream of the image. In this way, by performing frequency domain transformation in at least one direction on the initial image block, redundant information of the image is separated in the frequency domain, and the target image block after high- and low-frequency separation is encoded, the method has a better ability to remove redundancy than the traditional method of making a difference in the spatial domain.

[0009] On the other hand, an embodiment of the present application provides an image decoding method, which is applied to an image decoding module, and the method includes: decoding the encoded code stream of the image to obtain at least one target image block; performing a frequency domain restoration transform on the target image block in at least one direction to obtain an initial image block corresponding to the target image block; the frequency domain restoration transform is an inverse transform of the frequency domain transform, and the frequency domain transform is used to achieve separation of high-frequency components and low-frequency components in the direction; and combining at least one of the initial image blocks to obtain the image.

[0010] In the embodiment of the present application, the coded bitstream of the image is decoded to obtain at least one target image block; the target image block is subjected to frequency domain restoration transformation in at least one direction to obtain an initial image block corresponding to the target image block; and the at least one initial image block is combined to obtain an image. In this way, by performing frequency domain restoration transformation in at least one direction on the target image block, an accurate initial image block can be obtained.

[0011] On the other hand, an embodiment of the present application provides an image encoding module, which includes: a division unit, used to divide an image to obtain at least one initial image block; a transformation unit, used to perform a frequency domain transformation on the initial image block in at least one direction to obtain a target image block corresponding to the initial image block; the frequency domain transformation is used to achieve separation of high-frequency components and low-frequency components in the direction; and an encoding unit, used to encode at least one of the target image blocks to obtain an encoded code stream of the image.

[0012] On the other hand, an embodiment of the present application provides an image decoding module, which includes: a decoding unit, used to decode the encoded code stream of the image to obtain at least one target image block; a restoration transformation unit, used to perform a frequency domain restoration transformation on the target image block in at least one direction to obtain an initial image block corresponding to the target image block; the frequency domain restoration transformation is an inverse transformation of the frequency domain transformation, and the frequency domain transformation is used to achieve separation of high-frequency components and low-frequency components in the direction; a combination unit, used to combine at least one of the initial image blocks to obtain the image.

[0013] On the other hand, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0014] On the other hand, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements part or all of the steps in the above method when executed by a processor.

[0015] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements some or all of the steps in the above method.

[0016] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0018] Figure 1 A schematic diagram of an implementation process of an image encoding method provided in an embodiment of the present application Figure 1 ;

[0019] Figure 2 A schematic diagram of an implementation process of an image encoding method provided in an embodiment of the present application Figure 2 ;

[0020] Figure 3 A schematic diagram of an implementation process of an image encoding method provided in an embodiment of the present application Figure 3 ;

[0021] Figure 4 A schematic diagram of an implementation process of an image encoding method provided in an embodiment of the present application Figure 4 ;

[0022] Figure 5 A schematic diagram of an implementation process of an image decoding method provided in an embodiment of the present application Figure 1 ;

[0023] Figure 6 A schematic diagram of an implementation process of an image decoding method provided in an embodiment of the present application Figure 2 ;

[0024] Figure 7 A schematic diagram of an implementation process of an image decoding method provided in an embodiment of the present application Figure 3 ;

[0025] Figure 8 A schematic diagram of an implementation process of an image decoding method provided in an embodiment of the present application Figure 4 ;

[0026] Fig. 9 A schematic diagram of row-level bandwidth compression provided in an embodiment of the present application;

[0027] Fig.10 A schematic diagram of frequency domain conversion in the horizontal direction provided in an embodiment of the present application;

[0028] Fig.11 A schematic diagram of frequency domain conversion in a vertical direction provided in an embodiment of the present application;

[0029] Fig.12 A schematic diagram of a transformed image block provided in an embodiment of the present application;

[0030] Fig.13 A schematic diagram of pipeline processing in hardware provided in an embodiment of the present application;

[0031] Fig.14 A schematic diagram of the structure of an image encoding device provided in an embodiment of the present application;

[0032] Fig.15 A schematic diagram of the structure of an image decoding device provided in an embodiment of the present application;

[0033] Fig.16 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0035] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific order for the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this application and are not intended to limit this application.

[0037] In related technologies, row-level bandwidth compression can effectively utilize the redundancy of pixel space and reduce the amount of image data, but it needs to store a row of image data as a reference, which requires the hardware device to cache a row of image data before starting pipeline processing, increasing the hardware layout and row cache size. Block-level bandwidth compression can reduce hardware layout and row cache size, but the block information is less, and the redundant information that can be reduced by doing subtraction in the spatial domain is less.

[0038] The embodiment of the present application provides an image encoding method, which is applied to an image encoding module. The image is divided to obtain at least one initial image block; the initial image block is subjected to a frequency domain transformation in at least one direction to obtain a target image block corresponding to the initial image block; the frequency domain transformation is used to achieve the separation of high-frequency components and low-frequency components in the direction; at least one of the target image blocks is encoded to obtain an encoded code stream of the image. In this way, by performing a frequency domain transformation in at least one direction on the initial image block, the redundant information of the image is separated in the frequency domain, and the target image block after high- and low-frequency separation is encoded, which has a better ability to remove redundancy than the traditional spatial domain difference method.

[0039] The embodiment of the present application provides an image encoding method, which can be executed by a processor of a computer device. The computer device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device), or other device with data processing capabilities.

[0040] Figure 1 A schematic diagram of an implementation process of an image encoding method provided in an embodiment of the present application Figure 1 , the method is applied to an image coding module, such as Figure 1 As shown, the method includes the following steps S101 to S103:

[0041] Step S101: Divide the image to obtain at least one initial image block.

[0042] The execution subjects of the encoding method and the decoding method are different modules in the hardware device. Here, the image encoding module is used to run the image encoding method, encode the image, and obtain the encoded code stream of the image. The image encoding module can be any module with image encoding function. Exemplarily, the image encoding module is a module in a server, a laptop computer, or a tablet computer.

[0043] The initial image block is a partial image block in the image, and all the initial image blocks together constitute the image. The divided initial image block can be a regular square block or a regular rectangular block. Exemplarily, the size of the initial image block is 4*4, including 4 rows and 4 columns with a total of 16 pixels.

[0044] In some embodiments, during the image encoding process, the image is first divided into a plurality of image blocks, and then the plurality of image blocks are encoded respectively to obtain an encoded code stream of the image.

[0045] In some embodiments, during the image encoding process, it is not necessary to divide the image, and the image is directly encoded to obtain an encoded code stream of the image.

[0046] The size of the initial image block after division is not fixed and can be set according to the requirements of image coding.

[0047] Step S102: performing a frequency domain transformation on the initial image block in at least one direction to obtain a target image block corresponding to the initial image block; the frequency domain transformation is used to separate high-frequency components and low-frequency components in the direction.

[0048] Among them, the frequency domain transformation is an operation performed on the pixels in the image block in a preset direction. The frequency domain transformation refers to not processing the pixels at the first position of the image block before the transformation along the preset direction, directly using them as the pixels at the corresponding position of the transformed image block, and performing residual operation on the pixels at the second position of the image block before the transformation along the preset direction and the reference pixel, and using the residual operation result as the pixel at the corresponding position of the transformed image block. Since the pixels at the first position in the transformed image block are basic pixels and have not been processed, they can be used as the low-frequency components of the transformed image block; the pixels at the second position in the transformed image block are the residual operation results, which are the residuals between the pixels at the second position of the image block before the transformation and the reference pixel, reflecting the difference between the pixels, so the pixels at the second position in the transformed image block can be used as the high-frequency components of the transformed image block. The first position and the second position in the image block before the transformation are separated from each other in the preset direction, and it can be obtained that the pixels at the first position and the pixels at the second position in the transformed image block are separated from each other in the preset direction, that is, the frequency domain transformation can achieve the separation of high-frequency components and low-frequency components.

[0049] Among them, the high-frequency component in the image refers to the place where the image intensity (brightness / grayscale) changes dramatically, that is, the edge (contour); the low-frequency component in the image refers to the place where the image intensity (brightness / grayscale) changes smoothly, that is, the large color blocks.

[0050] The at least one direction includes at least one of the following: a first direction and a second direction. Exemplarily, the first direction is a horizontal direction, and the second direction is a vertical direction.

[0051] In some embodiments, the frequency domain transformation in the horizontal direction is performed on the initial image block to obtain the target image block corresponding to the initial image block: the pixel at the first position of each row in the initial image block is used as the pixel at the first position of the corresponding row in the target image block; the residual operation result between the pixel at the nth position of each row in the initial image block and the pixel at at least one other position is used as the pixel at the nth position of the corresponding row in the target image block; 1<n≤N, N is an integer greater than or equal to 2. The pixel at the first position of each row in the target image block is a low-frequency component, and the pixels at the remaining positions of each row are high-frequency components.

[0052] In some embodiments, the frequency domain transformation in the vertical direction is performed on the initial image block to obtain the target image block corresponding to the initial image block: the pixel at the first position of each column in the initial image block is used as the pixel at the first position of the corresponding column in the target image block; the residual operation result between the pixel at the mth position of each column in the initial image block and the pixel at at least one other position is used as the pixel at the mth position of the corresponding column in the target image block; 1<m≤M, M is an integer greater than or equal to 2. The pixel at the first position of each column in the target image block is a low-frequency component, and the pixels at the remaining positions of each column are high-frequency components.

[0053] In some embodiments, the frequency domain transformation of the initial image block in the horizontal direction and the vertical direction is sequentially performed to obtain the target image block corresponding to the initial image block in the following manner: the pixel at the first position (the first one on the left) of each row in the initial image block is used as the pixel at the first position of the corresponding row in the intermediate image block; the residual operation result between the pixel at the nth position of each row in the initial image block and the pixel at at least one other position is used as the pixel at the nth position of the corresponding row in the intermediate image block; the pixel at the first position (the first one on the upper side) of each column in the intermediate image block is used as the pixel at the first position of the corresponding column in the target image block; the residual operation result between the pixel at the mth position of each column in the intermediate image block and the pixel at at least one other position is used as the pixel at the mth position of the corresponding column in the target image block; 1<n≤N, N is an integer greater than or equal to 2; 1<m≤M, M is an integer greater than or equal to 2. The pixel at the upper left corner of the target image block is a low-frequency component, and the pixels at the remaining positions are high-frequency components.

[0054] In some embodiments, performing frequency domain transformation on the initial image block in at least one direction in sequence may refer to first performing transformation on the initial image block in the horizontal direction and then performing transformation on the vertical direction (or first performing transformation on the initial image block in the vertical direction and then performing transformation on the horizontal direction). Here, by limiting the order of sequential execution, a more thorough separation of low-frequency components and high-frequency components in the initial image block can be achieved (for example, the low-frequency component is in the upper left corner and the high-frequency component is in the lower right corner).

[0055] Step S103: Encode at least one target image block to obtain an encoded bitstream of the image.

[0056] The coded code stream is the coded data of all target image blocks of the image.

[0057] In some embodiments, the image corresponds to one target image block, and the target image block is encoded to obtain an encoded code stream of the image.

[0058] In some embodiments, the image corresponds to at least two target image blocks, and the at least two target image blocks are encoded in sequence to obtain an encoded code stream of the image.

[0059] In some embodiments, at least one target image block is encoded using an exponential Golomb code to obtain an encoded bitstream of the image.

[0060] In some embodiments, the target image block is divided into a first image sub-block and at least one second image sub-block. The identifier of the first bit depth in the fixed-length code table and the second bit depth of the second image sub-block are encoded to obtain encoded bit depth data; the first image sub-block is encoded by the first bit depth in the fixed-length code table to obtain first encoded data; and the at least one second image sub-block is encoded by the second bit depth to obtain second encoded data.

[0061] Exemplarily, the image includes 8*8 pixels, and the image is divided to obtain 4 4*4 initial image blocks. The initial image blocks are sequentially transformed in the horizontal and vertical directions. In the horizontal direction, the pixel at the first position of each row in the initial image block is directly used as the pixel at the first position of the corresponding row in the intermediate image block, and the pixels at the second to fourth positions of each row in the initial image block are respectively subtracted from the previous pixel to obtain a residual result, and the residual result is used as the pixels at the second to fourth positions of the corresponding row in the intermediate image block; in the vertical direction, the pixel at the first position of each column in the intermediate image block is directly used as the pixel at the first position of the corresponding column in the target image block, and the pixels at the second to fourth positions of each column in the intermediate image block are respectively subtracted from the previous pixel to obtain a residual result, and the residual result is used as the pixels at the second to fourth positions of the corresponding column in the target image block. The four target image blocks after the frequency domain transformation are fixed-length encoded to obtain the encoded bitstream of the image.

[0062] In the embodiment of the present application, the image is divided to obtain at least one initial image block; the initial image block is subjected to frequency domain transformation in at least one direction to obtain a target image block corresponding to the initial image block; the frequency domain transformation is used to achieve separation of high-frequency components and low-frequency components in the direction; at least one of the target image blocks is encoded to obtain an encoded bit stream of the image. In this way, by performing frequency domain transformation in at least one direction on the initial image block, redundant information of the image is separated in the frequency domain, and the target image block after high- and low-frequency separation is encoded, the method has a better ability to remove redundancy than the traditional method of making a difference in the spatial domain.

[0063] In some embodiments, the frequency domain transformation in at least one direction includes at least one transformation process performed sequentially in an execution order; the frequency domain transformation in one direction includes one or more of the transformation processes; a transformation process is used to achieve separation of a high-frequency component and a low-frequency component in the corresponding direction.

[0064] Among them, at least one frequency domain transformation process can be performed in any direction, that is, the frequency domain transformation in one direction includes one or more transformation processes. Exemplarily, at least one direction includes a horizontal direction and a vertical direction, the frequency domain transformation in the horizontal direction includes one transformation process, and the frequency domain transformation in the vertical direction includes two transformation processes.

[0065] One transformation process is used to separate high-frequency components from low-frequency components in a corresponding direction. For example, two transformation processes are performed in the horizontal direction to separate high-frequency components from low-frequency components twice in the horizontal direction.

[0066] The frequency domain transformation in at least one direction includes at least one transformation process, and all the transformation processes are performed in sequence according to the execution order. The execution order refers to the execution order of all the transformation processes. When performing the frequency domain transformation, the target transformation process is executed in sequence according to the execution order, and the target transformation process is the first transformation process that has not been executed in the execution order.

[0067] Exemplarily, at least one direction includes a horizontal direction and a vertical direction, the frequency domain transform in the horizontal direction includes two transform processes, and the frequency domain transform in the vertical direction includes two transform processes. The execution order may be frequency domain transform in the horizontal direction, frequency domain transform in the vertical direction, frequency domain transform in the horizontal direction, and frequency domain transform in the vertical direction, that is, the frequency domain transform is performed in the horizontal direction for the first time, the frequency domain transform is performed in the vertical direction for the second time, the frequency domain transform is performed in the horizontal direction for the third time, and finally the frequency domain transform is performed in the vertical direction.

[0068] In the embodiment of the present application, the frequency domain transformation in at least one direction includes at least one transformation process performed in sequence according to the execution order; the frequency domain transformation in one direction includes one or more transformation processes; one transformation process is used to achieve the separation of the high-frequency component and the low-frequency component in the corresponding direction. In this way, by performing multiple transformation processes in one direction, the deep separation of the high-frequency component and the low-frequency component can be achieved in this direction; performing the frequency domain transformation in the execution order can achieve a more thorough separation of the high-frequency component and the low-frequency component in the target image block.

[0069] In some embodiments, performing a frequency domain transform in at least one direction on the initial image block to obtain a target image block corresponding to the initial image block includes: performing a target transformation process on a first image block to obtain a second image block; wherein the first image block is the initial image block or an image block output by a previous transformation process of the target transformation process in the execution sequence, the second image block is an image block output by the target transformation process, and the target image block is an image block output by the last transformation process in the execution sequence.

[0070] The target transformation process is the transformation process that needs to be currently executed in the execution sequence. When performing frequency domain transformation in at least one direction, the first frequency domain transformation corresponds to the first transformation process in the execution sequence, and so on, the last frequency domain transformation corresponds to the last transformation process in the execution sequence.

[0071] Among them, a target transformation process is performed on the first image block to obtain a second image block; the first image block is an initial image block or an image block output by a previous transformation process of the target transformation process in the execution sequence, the second image block is an image block output by the target transformation process, and the target image block is an image block output by the last transformation process in the execution sequence.

[0072] Exemplarily, the first image block is an initial image block, the target transformation process is the first transformation process in the execution order, and the first transformation process is performed on the initial image block to obtain an image block output by the first transformation process.

[0073] Exemplarily, the first image block is an image block output by a previous transformation process of the target transformation process in the execution order, and the target transformation process is performed on the first image block to obtain a second image block, which is an image block output by the target transformation process.

[0074] Exemplarily, the target transformation process is the last transformation process in the execution order, and the target transformation process is performed on the first image block to obtain a target image block.

[0075] In the embodiment of the present application, the target transformation process is performed on the first image block to obtain the second image block. The first image block is the initial image block or the image block output by the previous transformation process of the target transformation process in the execution sequence, the second image block is the image block output by the target transformation process, and the target image block is the image block output by the last transformation process in the execution sequence. In this way, it is possible to perform multiple frequency domain transformations on the initial image block in different directions to obtain an accurate target image block.

[0076] Figure 2 This is a schematic diagram of an implementation process of an image encoding method provided in an embodiment of the present application. Figure 2 , the method can be executed by a processor of a computer device. Figure 1 , Figure 1 The S102 in can be updated to S201, which will be combined with Figure 2 The steps shown are explained.

[0077] Step S201, for pixels at N positions along a target direction in a first image block, the pixel at the first position in the first image block is used as the pixel at the first position in a second image block; and the residual operation result between the pixel at the nth position in the first image block and the pixel at at least one other position is used as the pixel at the nth position in the second image block; 1<n≤N, N is an integer greater than or equal to 2; the target direction is the direction corresponding to the target transformation process.

[0078] The target direction is the direction corresponding to the target transformation process. Exemplarily, if the target transformation process is a frequency domain transformation in the horizontal direction, the target direction is the horizontal direction.

[0079] In some embodiments, the direction includes at least one of the following: a first direction and a second direction; the first direction and the second direction are perpendicular to each other. Exemplarily, the first direction is a horizontal direction, and the second direction is a vertical direction. Taking a two-dimensional initial image block as an example, the initial image block is a rectangle or a square, the direction parallel to the upper edge of the initial image block is the horizontal direction, and the direction parallel to the left edge of the initial image block is the vertical direction.

[0080] In some embodiments, the direction further includes a third direction, and the third direction is perpendicular to the first direction and the second direction. Exemplarily, the third direction is a depth direction. Taking a three-dimensional initial image block as an example, the initial image block is a cube or a cuboid, starting from a vertex, the direction parallel to the side where the length of the initial image block is located is the horizontal direction, the direction parallel to the side where the width of the initial image block is located is the vertical direction, and the direction parallel to the side where the height of the initial image block is located is the depth direction.

[0081] The directions may also include a fourth direction, a fifth direction, and so on. The dimensions of the directions are not limited to the above dimensions, and are determined according to actual needs.

[0082] In the embodiment of the present application, the direction includes a first direction and a second direction, and the first direction and the second direction are perpendicular to each other. In this way, by sequentially performing frequency domain transformation in the first direction and the second direction, the low-frequency components of the target image block can be concentrated in fixed corner positions, and the high-frequency components can be concentrated in other corner positions.

[0083] Among them, when the target direction is horizontal, the pixels at the N positions along the target direction can be N positions from left to right, or N positions from right to left; when the target direction is vertical, the pixels at the N positions along the target direction can be N positions from top to bottom, or N positions from bottom to top.

[0084] The residual operation refers to a difference operation between pixels. For example, the residual operation between pixel A and pixel B may be AB; the residual operation between pixel A and pixels B and C may be A-(B+C) / 2.

[0085] In some embodiments, the residual operation result may be a negative value. In order to facilitate the subsequent encoding of the residual result, when the residual operation result is a negative value, the negative value is adjusted based on the bit depth of the pixel, and the negative value is adjusted to a positive value. Exemplarily, the bit depth of the pixel is 8, which can represent 256 pixel values ​​(0 to 255), and the residual operation result is -2. The value 254 obtained by adding -2 to 256 is used as the adjusted residual operation result.

[0086] Each of the N positions along the target direction corresponds to at least one pixel. Exemplarily, the first image block is an image block of 2*2 size, and N is 2. Each of the two positions along the horizontal direction corresponds to 2 pixels, and these two pixels are pixels at corresponding positions of adjacent rows; each of the two positions along the vertical direction corresponds to 2 pixels, and these two pixels are pixels at corresponding positions of adjacent columns.

[0087] Among them, the pixel at the first position in the first image block is used as the pixel at the first position in the second image block. The pixel at the first position is used as the basic pixel and can be used as the low-frequency component in the second image block without any processing; the pixel at the nth position in the second image block is the residual operation result between the pixel at the nth position in the first image block and the pixel at at least one other position. The residual operation result represents the difference between different pixels and can be used as the high-frequency component in the second image block.

[0088] In some embodiments, the implementation method of using the residual operation result between the pixel at the nth position in the first image block and the pixel at at least one other position as the pixel at the nth position in the second image block may be to use the residual operation result between the pixel at the nth position in the first image block and the pixel at the n-1th position as the pixel at the nth position in the second image block.

[0089] Exemplarily, for a row of pixels (10, 20, 50, 80) along the horizontal direction in the first image block, the pixel 10 at the first position is used as the pixel at the first position in the second image block, the difference 10 between the pixel 20 at the second position and the pixel 10 at the first position is used as the pixel at the second position in the second image block, the difference 30 between the pixel 50 at the third position and the pixel 20 at the second position is used as the pixel at the third position in the second image block, and the difference 30 between the pixel 80 at the fourth position and the pixel 50 at the third position is used as the pixel at the fourth position in the second image block. Therefore, a row of pixels (10, 10, 30, 30) along the horizontal direction of the second image block is obtained.

[0090] In some embodiments, the implementation method of using the residual operation result between the pixel at the nth position in the first image block and the pixels at at least one other position as the pixel at the nth position in the second image block may be to use the residual operation result between the pixel at the nth position in the first image block and the pixels at the n-1th position and the pixels at the n+1th position as the pixel at the nth position in the second image block.

[0091] Exemplarily, for a row of pixels (10, 20, 50, 80) along the horizontal direction in the first image block, the pixel 10 at the first position is used as the pixel at the first position in the second image block; the pixel mean 30 of the first and third positions is calculated, and the difference -10 between the pixel 20 at the second position and the mean 30 is used as the pixel at the second position in the second image block; the pixel mean 50 of the second and fourth positions is calculated, and the difference 0 between the pixel 50 at the third position and the mean 50 is used as the pixel at the second position in the second image block; the difference 30 between the pixel 80 at the fourth position and the pixel 50 at the third position is used as the pixel at the fourth position in the second image block. Therefore, a row of pixels (10, -10, 0, 0) along the horizontal direction of the second image block is obtained.

[0092] In some embodiments, a frequency domain transform is performed on the initial image block in the horizontal direction to directly obtain a target image block. In this case, the first image block is the initial image block, and the second image block is the target image block.

[0093] In some embodiments, the initial image block is sequentially subjected to frequency domain transformation in the horizontal and vertical directions. During the frequency domain transformation in the horizontal direction, the first image block is the initial image block, and the second image block is the image block output by the frequency domain transformation in the horizontal direction; during the frequency domain transformation in the vertical direction, the first image block is the image block output by the frequency domain transformation in the horizontal direction, and the second image block is the target image block.

[0094] In the embodiment of the present application, for the pixels at N positions along the target direction in the first image block, the pixel at the first position in the first image block is used as the pixel at the first position in the second image block; and the residual operation result between the pixel at the nth position in the first image block and the pixel at at least one other position is used as the pixel at the nth position in the second image block. In this way, the pixel at the first position in the second image block is used as the basic pixel, which is not processed and is used as the low-frequency component, and the pixel at the nth position is the residual operation result, which reflects the difference between pixels and is used as the high-frequency component. Through the frequency domain transformation in at least one direction, the separation of the high-frequency component and the low-frequency component of the target image block in the corresponding direction is achieved.

[0095] In some embodiments, the direction includes a first direction and a second direction; the initial image block includes pixels at four positions in both the first direction and the second direction; the method of using the residual operation result between the pixel at the nth position in the first image block and the pixel at at least one other position as the pixel at the nth position in the second image block includes: using the residual operation result between the pixel at the third position in the first image block and the pixel at the first position as the pixel at the third position in the second image block; using the residual operation result between the pixel at the fourth position in the first image block and the pixel at the third position as the pixel at the fourth position in the second image block; using the residual operation result between the pixel at the second position, the pixel at the first position and the pixel at the third position in the first image block as the pixel at the second position in the second image block.

[0096] The first direction and the second direction are two directions perpendicular to each other in the two-dimensional plane. Exemplarily, the first direction is a horizontal direction, and the second direction is a vertical direction.

[0097] The initial image block includes pixels at 4 positions in both the first direction and the second direction. Exemplarily, the size of the initial image block is 4*4, including 4 rows and 4 columns with a total of 16 pixels.

[0098] In some embodiments, the pixel at the first position is used as the basic pixel, and the residual operation result between the pixel at the third position in the first image block and the pixel at the first position is used as the pixel at the third position in the second image block, so the third position in the second image block stores the difference between the pixel at the position and the basic pixel. Exemplarily, the pixel at the first position is subtracted from the pixel at the third position to obtain the residual operation result.

[0099] In some embodiments, considering that the fourth position and the first position in the first image block are far apart, the correlation between the pixels at these two positions is weak, and therefore the residual operation result between the pixel at the fourth position and the pixel at the third position in the first image block is used as the pixel at the fourth position in the second image block. The correlation between the pixel at the fourth position and the pixel at the third position is high. Exemplarily, the pixel at the third position is subtracted from the pixel at the fourth position to obtain the residual operation result.

[0100] In some embodiments, considering that the pixel at the second position in the first image block has a high correlation with the pixel at the first position and the pixel at the third position, the residual operation result between the pixel at the second position in the first image block, the pixel at the first position and the pixel at the third position is used as the pixel at the second position in the second image block. Exemplarily, the mean of the pixel at the first position and the pixel at the third position is first calculated, and the mean is subtracted from the pixel at the second position to obtain the residual operation result.

[0101] In the embodiment of the present application, the residual operation result between the pixel at the third position and the pixel at the first position in the first image block is used as the pixel at the third position in the second image block; the residual operation result between the pixel at the fourth position and the pixel at the third position in the first image block is used as the pixel at the fourth position in the second image block; the residual operation result between the pixel at the second position, the pixel at the first position and the pixel at the third position in the first image block is used as the pixel at the second position in the second image block. In this way, by performing residual operation in different ways on pixels at different positions, diversified residual operation results are obtained, which not only considers the correlation between the current pixel and the previous pixel, but also considers the correlation between the current pixel and the two adjacent pixels. The second image block obtained by the above residual operation can more accurately reduce the redundancy between pixels and improve the ability to remove redundancy.

[0102] In some embodiments, the target image block includes a high-frequency component and a low-frequency component, and the encoded code stream includes image block encoding data of each of the target image blocks; encoding at least one of the target image blocks to obtain the encoded code stream of the image includes: encoding the high-frequency component and the low-frequency component based on a preset number of bits to obtain the image block encoding data of the target image block.

[0103] The initial image block is subjected to frequency domain transformation in at least one direction, and the separation of high-frequency components and low-frequency components is achieved in the obtained target image block. Exemplarily, the initial image block is first subjected to frequency domain transformation in the horizontal direction, and then subjected to frequency domain transformation in the vertical direction, so that the low-frequency component is at the upper left corner of the target image block, and the remaining positions are high-frequency components.

[0104] Wherein, based on the preset bit number, the high frequency component and the low frequency component are encoded to obtain the image block encoding data of the target image block. The preset bit number is the preset number of bits required to encode each pixel. Exemplarily, the preset bit number is 8, and each pixel of the high frequency component and the low frequency component is encoded with 8 bits.

[0105] In some embodiments, each pixel of the high-frequency component and the low-frequency component is encoded using the same preset bit number to obtain image block encoding data of the target image block.

[0106] In some embodiments, the preset bit depth includes a first bit depth and a second bit depth, each pixel of the high-frequency component is encoded based on the first bit depth, and each pixel of the low-frequency component is encoded based on the second bit depth to obtain image block encoding data.

[0107] In the embodiment of the present application, based on the preset bit number, the high frequency component and the low frequency component are encoded to obtain the image block encoding data of the target image block. In this way, the target image block can be fixed-length encoded to improve the encoding efficiency.

[0108] Figure 3 This is a schematic diagram of an implementation process of an image encoding method provided in an embodiment of the present application. Figure 3 , the method can be executed by a processor of a computer device. Figure 1 , the low-frequency component includes a first image sub-block, the high-frequency component includes at least one second image sub-block, the image block encoding data includes encoding bit depth data, first encoding data corresponding to the first image sub-block and second encoding data corresponding to the at least one second image sub-block; the preset number of bits includes a first bit depth and a second bit depth; Figure 1 S103 in can be updated to S301 to S303, which will be combined Figure 3 The steps shown are explained.

[0109] Step S301: Encode the identifier of the first bit depth in the fixed-length code table and the second bit depth of the second image sub-block to obtain the encoded bit depth data.

[0110] The target image block is divided to obtain a first image sub-block and at least one second image sub-block, wherein the first image sub-block corresponds to a low-frequency component in the target image block and the second image sub-block corresponds to a high-frequency component in the target image block.

[0111] Wherein, the fixed-length code table is used to provide at least two preset bit depths. The preset bit depth is a preset number of bits used to encode an image block. The preset bit depth includes at least one pixel depth, and the pixel depth is used to encode a single pixel. Exemplarily, the fixed-length code table is {0, 3, 5, 7, 8}, and the fixed-length code table includes 5 preset bit depths, each of which includes a pixel depth. Exemplarily, the fixed-length code table is {{0, 0, 0}, {2, 1, 1}, {4, 3, 5}, {8, 8, 8}}, and the fixed-length code table includes 4 preset bit depths, each of which includes 3 pixel depths.

[0112] Among them, the first bit depth is a preset bit depth to be selected that meets the encoding requirements of pixels in the first image sub-block and has the smallest length. The preset bit depth to be selected is a preset bit depth that meets the encoding requirements of pixels in the first image sub-block. Exemplarily, the fixed-length code table is {0, 3, 5, 7, 8}, and pixel 50 in the first image sub-block is encoded based on the fixed-length code table. Pixel 50 requires at least 6 bits to be encoded. The preset bit depths 7 and 8 can meet the encoding requirements of pixel 50. Therefore, the preset bit depths to be selected are 7 and 8. The preset bit depth 7 to be selected is used as the first bit depth, that is, pixel 50 is encoded with 7 bits.

[0113] The identifier is the position of the preset bit depth in the fixed-length code table. For example, the fixed-length code table is {0, 3, 5, 7, 8}, the identifier of the preset bit depth 0 is 0, the identifier of the preset bit depth 3 is 1, and so on, the identifier of the preset bit depth 8 is 4.

[0114] The second bit depth is the maximum pixel bit depth required by the pixels of the second image sub-block. Exemplarily, the second image sub-block includes 4 pixels (48, 47, 49, 126), and the pixel bit depths required to encode these 4 pixels are 6, 6, 6, and 7, respectively. Therefore, the second bit depth is 7, and each pixel of the second image sub-block can be encoded by 7 bits.

[0115] In the related technology, row-level bandwidth compression and block-level bandwidth compression use exponential Golomb codes during encoding. Before decoding the next pixel, the previous pixel needs to be decoded to determine how many bits of data need to be selected from the bit stream. This places certain limitations on the throughput of the decoding algorithm and is not in line with the high throughput and low latency characteristics required by the bandwidth compression algorithm.

[0116] In some embodiments, the target image block is encoded by fixed-length coding, the first image sub-block is encoded based on a first bit depth, and the second image sub-block is encoded based on a second bit depth. Since the bit depths required for encoding different image sub-blocks are different, when decoding, in order to accurately decode the encoded code stream of the image, when encoding the target image block, the bit depth required for the target image block needs to be encoded.

[0117] The first bit depth is a preset bit depth in the fixed-length code table. By encoding the identifier of the first bit depth and the second bit depth in the fixed-length code table, the bit depth required for the target image block is encoded. During decoding, the identifier of the first bit depth is decoded to obtain the identifier; based on the identifier, the corresponding first bit depth is searched in the fixed-length code table. The bit depth required for the target image block is obtained by decoding the second bit depth.

[0118] In some embodiments, the encoded bit depth data includes first bit depth data corresponding to a first bit depth and second bit depth data corresponding to a second bit depth; encoding the first bit depth identifier of the second image sub-block in the fixed-length code table to obtain the encoded bit depth data includes: encoding the identifier based on a preset third bit depth to obtain the first bit depth data; encoding the second bit depth based on a preset fourth bit depth to obtain the second bit depth data.

[0119] The third bit depth is the number of bits required to encode the identifier, and the fourth bit depth is the number of bits required to encode the second bit depth.

[0120] The preset third bit depth is determined according to the range of the identifier. For example, there are 8 preset bit depths in the fixed-length code table, and the identifiers are 0 to 7. All identifiers can be encoded by 3 bits, so the third bit depth is set to 3.

[0121] The preset fourth bit depth is determined according to the range of the second bit depth. Exemplarily, the value range of the pixels in the second image sub-block is 0 to 255, and all pixels in the second image sub-block can be encoded by 8 bits, so the maximum second bit depth is 8, so the second bit depth can be encoded by 4 bits, and the fourth bit depth is set to 4.

[0122] Exemplarily, the third bit depth is 3, the identifier corresponding to the first bit depth is 5, and the identifier 5 is encoded by 3 bits to obtain the first bit depth data 101; the fourth bit depth is 4, and the second bit depth 7 is encoded by 4 bits to obtain the second bit depth data 0111.

[0123] In some embodiments, the second bit depth is one, and based on a preset fourth bit depth, the second bit depth is encoded to obtain second bit depth data.

[0124] In some embodiments, the second bit depth is at least two, and based on a preset fourth bit depth, at least two second bit depths are encoded respectively to obtain second bit depth data.

[0125] In some embodiments, the identifier and the second bit depth are encoded based on a preset fixed bit number. Exemplarily, the fixed bit number is 4, and the identifier and the second bit depth are encoded by 4 bits.

[0126] In the embodiment of the present application, based on the preset third bit depth, the identifier is encoded to obtain the first bit depth data; based on the preset fourth bit depth, the second bit depth is encoded to obtain the second bit depth data. In this way, the encoded bit depth data can be accurately obtained to achieve the encoding of the bit depth required for the image sub-block.

[0127] Step S302: Encode the first image sub-block based on the first bit depth corresponding to the identifier to obtain first encoded data.

[0128] In some embodiments, the first bit depth includes a pixel bit depth, based on which all pixels in the first image sub-block are encoded to obtain first encoded data. Exemplarily, the first bit depth is 6, and each pixel in the first image sub-block is encoded using 6 bits.

[0129] In some embodiments, the first bit depth includes at least two pixel bit depths, and the number of pixel bit depths is consistent with the number of pixels in the first image sub-block. Each pixel in the first image sub-block is encoded by each pixel bit depth of the first bit depth to obtain first encoded data. Exemplarily, the first bit depth is {3, 5, 5, 6}, the first image sub-block includes 4 pixels (7, 20, 22, 51), the first pixel 7 is encoded with 3 bits, the second pixel 20 is encoded with 5 bits, the third pixel 22 is encoded with 5 bits, and the fourth pixel 51 is encoded with 6 bits.

[0130] Step S303: Encode at least one second image sub-block based on the second bit depth to obtain second encoded data.

[0131] In some embodiments, the second bit depth includes the second bit depth corresponding to each second image sub-block; encoding at least one second image sub-block based on the second bit depth to obtain second encoded data includes: encoding each second image sub-block based on the second bit depth corresponding to each second image sub-block to obtain second encoded data; the second bit depth is the maximum pixel depth required by the pixels of the second image sub-block.

[0132] The number of pixels in different second image sub-blocks may be the same or different. The second image sub-blocks may be obtained by dividing the target image block according to actual conditions. Based on the second bit depth, all pixels in the second image sub-blocks are encoded.

[0133] Wherein, based on the pixels in the second image sub-block, a suitable second bit depth is pre-determined. All pixels in the second image sub-block can be represented by the second bit depth. The pixel bit depth required for each pixel in the second image sub-block is obtained, and the maximum pixel bit depth is determined as the second bit depth.

[0134] In some embodiments, the number of the second image sub-block is one, and based on a second bit depth corresponding to the second image sub-block, the second image sub-block is encoded to obtain second encoded data.

[0135] In some embodiments, there are at least two second image sub-blocks, a second bit depth corresponding to each second image sub-block is determined, and the at least two second image sub-blocks are encoded based on the at least two second bit depths to obtain second encoded data.

[0136] Exemplarily, there are three second image sub-blocks, the second bit depth is {7, 6, 6}, the first second image sub-block is encoded with 7 bits, the second second image sub-block is encoded with 6 bits, and the third second image sub-block is encoded with 6 bits.

[0137] In the embodiment of the present application, each second image sub-block is encoded based on the second bit depth corresponding to each second image sub-block to obtain second encoded data. In this way, all second image sub-blocks can be accurately encoded.

[0138] In some embodiments, the second bit depth is a bit depth corresponding to all second image sub-blocks, and based on the second bit depth, all second image sub-blocks are encoded to obtain second encoded data. Exemplarily, the second bit depth is 6, there are 3 second image sub-blocks, and each pixel of the second image sub-block is encoded using 6 bits.

[0139] In an embodiment of the present application, the identifier of the first bit depth in the fixed-length code table and the second bit depth of the second image sub-block are encoded to obtain encoded bit depth data; based on the first bit depth corresponding to the identifier, the first image sub-block is encoded to obtain first encoded data; based on the second bit depth, at least one second image sub-block is encoded to obtain second encoded data. In this way, the encoded code stream includes the encoded bit depth data of each target image block and the encoded data corresponding to the image sub-block, so as to achieve fixed-length encoding of the target image block and improve the integrity of the encoded data. Compared with the exponential Golomb coding, the fixed-length coding method is adopted. By reading the fixed-length encoded bit depth data during decoding, the encoding length of the entire target image block can be obtained, thereby improving the throughput of the decoding algorithm. By selecting a suitable bit depth for encoding each image sub-block, the number of encoded bits can be compressed as a whole.

[0140] Figure 4This is a schematic diagram of an implementation process of an image encoding method provided in an embodiment of the present application. Figure 4 , the method can be executed by a processor of a computer device. Figure 3 , the first encoded data includes a first portion of data and a second portion of data; the first image sub-block includes a first pixel and at least one second pixel; Figure 3 S302 in can be updated to S401 to S402, which will be combined Figure 4 The steps shown are explained.

[0141] Step S401: Encode a first pixel based on the pixel bit depth to obtain a first portion of data.

[0142] The pixel bit depth is a fixed number of bits for encoding a pixel. The pixel bit depth is determined according to the value range of the pixel. For example, the pixel value range in the image is 0 to 255, so the pixel bit depth is set to 8, and any pixel within the pixel value range can be encoded.

[0143] The first pixel is a basic pixel in the first image sub-block. After the initial image block is transformed in frequency domain in at least one direction to obtain the target image block, the first image sub-block corresponds to the low-frequency component in the target image block, and at least one second image sub-block corresponds to the high-frequency component in the target image block. The pixel at the first position in the first image sub-block has not changed relative to the pixel at the corresponding position in the initial image block, and is taken as the first pixel and encoded separately.

[0144] Exemplarily, the pixel bit depth is 8, the first pixel is 30, and the first pixel is encoded with 8 bits to obtain the first part of data 00011110.

[0145] Step S402: Encode the at least one second pixel based on the first bit depth to obtain a second portion of data.

[0146] The second pixel is the remaining pixels in the first image sub-block except the first pixel.

[0147] The first bit depth is a preset bit depth that meets the encoding requirements of all second pixels in the first image sub-block.

[0148] In some embodiments, the first bit depth includes a pixel bit depth corresponding to each of the second pixels; encoding the at least one second pixel based on the first bit depth to obtain the second portion of data includes: encoding each of the second pixels based on the pixel bit depth corresponding to each of the second pixels to obtain the second portion of data.

[0149] Among them, the pixel bit depth is the number of bits required to encode a single second pixel, and the number of pixel bit depths is consistent with the number of second pixels. Based on at least one second pixel, a first bit depth is predetermined in a fixed-length code table; based on each pixel bit depth in the first bit depth, each second pixel is encoded. Exemplarily, the first bit depth is {3, 5, 6}, at least one second pixel includes 7, 30, 50, pixel 7 is encoded as 111 with 3 bits, pixel 30 is encoded as 11110 with 5 bits, and pixel 50 is encoded as 110010 with 6 bits, and the second part of data is 11111110110010.

[0150] In the embodiment of the present application, each second pixel is encoded based on the pixel bit depth corresponding to each second pixel to obtain the second portion of data. In this way, the second pixel can be accurately encoded.

[0151] In some embodiments, the first bit depth is a pixel bit depth corresponding to all second pixels, and each second pixel is encoded based on the pixel bit depth to obtain the second portion of data. Exemplarily, the first bit depth is 6, and at least one second pixel includes 7, 30, and 50. Pixel 7 is encoded as 000111 with 6 bits, pixel 30 is encoded as 011110 with 6 bits, and pixel 50 is encoded as 110010 with 6 bits, and the second portion of data is 000111011110110010.

[0152] In the embodiment of the present application, based on the pixel bit depth, the first pixel is encoded to obtain the first part of data; based on the first bit depth, at least one second pixel is encoded to obtain the second part of data. In this way, different pixels of the first image sub-block are encoded by different encoding methods to meet the encoding requirements of the first image sub-block.

[0153] In some embodiments, the fixed-length code table is used to provide at least two preset bit depths, and the method further includes: determining at least one to-be-selected preset bit depth among the at least two preset bit depths that meets the encoding requirements of each of the second pixels in the first image sub-block; and determining the to-be-selected preset bit depth with the smallest length as the first bit depth.

[0154] The fixed-length code table provides at least two preset bit depths, and the number of bits corresponding to different preset bit depths is different. In the fixed-length code table, not all preset bit depths can meet the encoding requirements of the second pixel, so it is necessary to select a suitable preset bit depth from the fixed-length code table as the first bit depth.

[0155] The fixed-length code table is predetermined, and the preset bit depth in the fixed-length code table is determined based on the pixel bit depth, and the fixed-length code table at least includes a preset bit depth composed of the pixel bit depth. Exemplarily, the pixel bit depth is 8, and when the preset bit depth includes three pixel depths, the fixed-length code table at least includes the preset bit depth {8, 8, 8}. In this way, it can be ensured that there is at least one preset bit depth, and all second pixels in the first image sub-block can be encoded.

[0156] When the pixel bit depth changes, the preset bit depth in the fixed-length code table is expanded accordingly. Exemplarily, the pixel bit depth is 10, and the fixed-length code table at least includes the preset bit depth {10, 10, 10}.

[0157] The preset bit depth includes the pixel bit depth corresponding to each pixel. Exemplarily, the preset bit depth is {8, 8, 8}, that is, the preset bit depth includes 3 pixel bit depths.

[0158] According to the order of each preset bit depth in the fixed-length code table, it is determined in turn whether the second pixel in the first image sub-block can be represented by the preset bit depth, and a candidate preset bit depth that can encode all the second pixels is determined from at least two preset bit depths. The number of bits of different candidate preset bit depths is different. In order to reduce the total number of encoding bits, the candidate preset bit depth with the smallest length is determined as the first bit depth.

[0159] Exemplarily, the fixed-length code table is {{0, 0, 0}, {2, 1, 1}, {2, 3, 3}, {4, 3, 5}, {4, 5, 3}, {6, 5, 5}, {6, 7, 7}, {8, 8, 8}}. The second pixel in the first image subblock is {43, 19, 29}, pixel 43 requires 6 bits, pixel 19 requires 5 bits, and pixel 29 requires 5 bits. Therefore, the second pixel can be represented by {6, 5, 5}, {6, 7, 7} or {8, 8, 8}. {6, 5, 5}, {6, 7, 7} and {8, 8, 8} are the preset bit depths to be selected. The bit length of {6, 5, 5} is 16, which is the smallest length. {6, 5, 5} is used as the first bit depth.

[0160] In the embodiment of the present application, at least one preset bit depth to be selected that meets the encoding requirements of each second pixel in the first image sub-block is determined from at least two preset bit depths; and the preset bit depth to be selected with the smallest length is determined as the first bit depth. In this way, a suitable first bit depth can be selected from the fixed-length code table to encode the second pixel.

[0161] In some embodiments, the image encoding module is used to parallelly process the frequency domain transformation process and the encoding process of at least two initial image blocks based on a multi-stage pipeline method; the image encoding module includes a frequency domain transformation processing unit and an encoding processing unit, wherein the frequency domain transformation processing unit is used to process the frequency domain transformation process of the i-th initial image block; the encoding processing unit is used to process the encoding process of the target image block corresponding to the i-1-th initial image block, where i is a positive integer.

[0162] The encoding process of the target image block includes encoding the identifier of the first bit depth, the second bit depth, and all pixels in the target image block.

[0163] The multi-stage pipeline method includes two stages of pipelines, the first stage pipeline is used to implement the frequency domain transformation process of the initial image block, and the second stage pipeline is used to implement the encoding process of the target image block. In the first stage pipeline, each initial image block is transformed in the frequency domain in turn to obtain the target image block corresponding to the initial image block. In the second stage pipeline, each target image block is encoded in turn to obtain the encoding code stream of the target image block.

[0164] Among them, the frequency domain transformation processing unit performs a primary pipeline to process the frequency domain transformation process of the initial image block; and the encoding processing unit performs a secondary pipeline to process the encoding process of the target image block corresponding to the initial image block.

[0165] In some embodiments, the primary pipeline and the secondary pipeline can be processed in parallel. In the process of encoding at least two initial image blocks after image division, after the first initial image block completes the frequency domain transformation to obtain the target image block, the encoding process of the first target image block can be processed in parallel with the frequency domain transformation process of the second initial image block, and so on, the frequency domain transformation process of the i-th initial image block can be processed in parallel with the encoding process of the i-1-th target image block. Therefore, when the frequency domain transformation processing unit processes the frequency domain transformation process of the i-th initial image block, the encoding processing unit can process in parallel the encoding process of the target image block corresponding to the i-1-th initial image block.

[0166] In the embodiment of the present application, the frequency domain transformation process and the encoding process of at least two initial image blocks are processed in parallel by the image encoding module based on a multi-stage pipeline method. In this way, the multi-stage pipeline method is used to process multiple image blocks at the same clock, thereby improving the encoding efficiency of the image encoding module.

[0167] In some embodiments, the image encoding module is used to parallelly process the frequency domain transformation process, bit depth data encoding process and image data encoding process of at least three initial image blocks based on a multi-stage pipeline method; the image encoding module includes a frequency domain transformation processing unit, a bit depth data encoding processing unit and an image data encoding processing unit, wherein the frequency domain transformation processing unit is used to process the frequency domain transformation process of the i-th initial image block; the bit depth data encoding processing unit is used to process the bit depth data encoding process of the target image block corresponding to the i-1-th initial image block; the image data encoding processing unit is used to process the image data encoding process of the target image block corresponding to the i-2-th initial image block, where i is a positive integer.

[0168] The bit depth data encoding process refers to encoding the identifier of the first bit depth and the second bit depth required by the target image block to obtain the encoded bit depth data.

[0169] The image data encoding process refers to encoding all pixels in the target image block to obtain image block encoding data.

[0170] Among them, the multi-stage pipeline method includes three-stage pipeline, the first stage pipeline is used to realize the frequency domain transformation process of the initial image block, the second stage pipeline is used to realize the bit depth data encoding process of the target image block, and the third stage pipeline is used to realize the image data encoding process of the target image block. In the first stage pipeline, each initial image block is transformed in the frequency domain in turn to obtain the target image block corresponding to each initial image block. In the second stage pipeline, the identifier of the first bit depth and the second bit depth required for each target image block are encoded in turn to obtain the encoded bit depth data of each target image block. In the third stage pipeline, the pixels of each target image block are encoded in turn to obtain the image block encoding data of each target image block.

[0171] Among them, a first-level pipeline is executed through the frequency domain transformation processing unit to process the frequency domain transformation process of the initial image block; a second-level pipeline is executed through the bit depth data encoding processing unit to process the bit depth data encoding process of the target image block; and a third-level pipeline is executed through the image data encoding processing unit to process the image data encoding process of the target image block.

[0172] In some embodiments, the first-level pipeline, the second-level pipeline, and the third-level pipeline can be processed in parallel. In the process of encoding at least three initial image blocks after the image is divided, after the first initial image block completes the frequency domain transformation to obtain the target image block, the bit depth data encoding process of the first target image block can be processed in parallel with the frequency domain transformation process of the second initial image block; after the first target image block completes the bit depth data encoding process and the second initial image block completes the frequency domain transformation process, the image data encoding process of the first target image block can be processed in parallel with the bit depth data encoding process of the second target image block and the frequency domain transformation process of the third initial image block; and so on, the frequency domain transformation process of the i-th initial image block can be processed in parallel with the bit depth data encoding process of the i-1th target image block and the image data encoding process of the i-2th target image block. Therefore, the frequency domain transformation processing unit processes the frequency domain transformation process of the i-th initial image block; the bit depth data encoding processing unit processes the bit depth data encoding process of the target image block corresponding to the i-1th initial image block in parallel; and the image data encoding processing unit processes the image data encoding process of the target image block corresponding to the i-2th initial image block in parallel.

[0173] In the embodiment of the present application, the frequency domain transformation process, the bit depth data encoding process and the image data encoding process of at least three initial image blocks are processed in parallel by the image encoding module based on a multi-stage pipeline method. In this way, the multi-stage pipeline method is used to process multiple image blocks at the same clock, thereby improving the encoding efficiency of the image encoding module.

[0174] The embodiment of the present application provides an image decoding method, which can be executed by a processor of a computer device. The computer device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device), or other device with data processing capabilities.

[0175] Figure 5 A schematic diagram of an implementation process of an image decoding method provided in an embodiment of the present application Figure 1 , the method is applied to the image decoding module, such as Figure 5 As shown, the method includes the following steps S501 to S503:

[0176] Step S501: Decode the coded bitstream of the image to obtain at least one target image block.

[0177] The image decoding module is used to run the image decoding method to decode the coded code stream to obtain an image. The image decoding module can be any module with an image decoding function. Exemplarily, the image decoding module is a module in a server, a laptop, or a tablet computer.

[0178] The coded code stream is the coded data of all target image blocks of the image.

[0179] In some embodiments, the image corresponds to one target image block, and the encoded code stream of the image is decoded to obtain the target image block.

[0180] In some embodiments, the image corresponds to at least two target image blocks, and the encoded code stream of the image is decoded to obtain at least two target image blocks.

[0181] In some embodiments, the target image block includes a first image sub-block and at least one second image sub-block, the encoded code stream includes image block encoding data of each target image block, the image block encoding data includes encoding bit depth data, first encoding data corresponding to the first image sub-block and second encoding data corresponding to at least one second image sub-block; the encoding bit depth data is decoded to obtain an identifier of a first bit depth in a fixed-length code table and a second bit depth of the second image sub-block; based on the first bit depth corresponding to the identifier, the first encoded data is decoded to obtain the first image sub-block; based on the second bit depth, the second encoded data is decoded to obtain the at least one second image sub-block.

[0182] Step S502: performing a frequency domain restoration transformation on the target image block in at least one direction to obtain an initial image block corresponding to the target image block; the frequency domain restoration transformation is an inverse transformation of the frequency domain transformation, and the frequency domain transformation is used to achieve separation of high-frequency components and low-frequency components in the direction.

[0183] Among them, the frequency domain restoration transform is a restoration operation performed on the pixels in the image block in a preset direction, and the frequency domain restoration transform is the inverse transform of the frequency domain transform. The frequency domain restoration transform means that the pixels at the first position of the image block before the transformation along the preset direction are not processed, and are directly used as the pixels at the corresponding position of the image block after the transformation, and the pixels at the second position of the image block before the transformation along the preset direction and the reference pixels are restored, and the restoration result is used as the pixels at the corresponding position of the image block after the transformation. The frequency domain restoration transform restores the target image block with separated high and low frequency components to the initial image block. The restoration operation is the inverse operation of the residual operation.

[0184] The at least one direction includes at least one of the following: a first direction and a second direction. Exemplarily, the first direction is a horizontal direction, and the second direction is a vertical direction.

[0185] In some embodiments, a frequency domain restoration transformation is performed on a target image block in a horizontal direction to obtain an initial image block corresponding to the target image block: the pixel at the first position of each row in the target image block is used as the pixel at the first position of the corresponding row in the initial image block; the restoration operation result between the pixel at the nth position of each row in the target image block and the pixel at at least one other position is used as the pixel at the nth position of the corresponding row in the initial image block; 1<n≤N, N is an integer greater than or equal to 2.

[0186] In some embodiments, a frequency domain restoration transformation is performed on a target image block in a vertical direction to obtain an initial image block corresponding to the target image block: the pixel at the first position of each column in the target image block is used as the pixel at the first position of the corresponding column in the initial image block; the restoration operation result between the pixel at the mth position of each column in the target image block and the pixel at at least one other position is used as the pixel at the mth position of the corresponding column in the initial image block; 1<m≤M, M is an integer greater than or equal to 2.

[0187] In some embodiments, the target image block is sequentially subjected to frequency domain restoration transformation in the horizontal and vertical directions to obtain an initial image block corresponding to the target image block in the following manner: the pixel at the first position (the first one on the left) of each row in the target image block is used as the pixel at the first position of the corresponding row in the intermediate image block; the restoration operation result between the pixel at the nth position of each row in the target image block and the pixel at at least one other position is used as the pixel at the nth position of the corresponding row in the intermediate image block; the pixel at the first position (the first one on the top) of each column in the intermediate image block is used as the pixel at the first position of the corresponding column in the initial image block; the restoration operation result between the pixel at the mth position of each column in the intermediate image block and the pixel at at least one other position is used as the pixel at the mth position of the corresponding column in the initial image block; 1<n≤N, N is an integer greater than or equal to 2; 1<m≤M, M is an integer greater than or equal to 2.

[0188] Step S503: combine at least one of the initial image blocks to obtain the image.

[0189] The initial image block is a partial image block in the image, and all the initial image blocks together constitute the image.

[0190] In some embodiments, during the image decoding process, the number of initial image blocks is one, which is directly used as the image.

[0191] In some embodiments, there are at least two decoded initial image blocks, and the at least two initial image blocks are combined to obtain an image.

[0192] Exemplarily, the coded bitstream of the image is decoded to obtain four target image blocks of 4*4 size. The target image blocks are subjected to frequency domain restoration transformation in the horizontal direction. In the horizontal direction, the pixel at the first position of each row in the target image block is directly used as the pixel at the first position of the corresponding row in the initial image block; the pixel at the second position of each row in the target image block is added to the previous pixel to obtain a restoration result, and the restoration result is used as the pixel at the second position of the corresponding row in the initial image block; the pixel at the third position of each row in the target image block is added to the restored pixel at the previous position to obtain a restoration result, and the restoration result is used as the pixel at the third position of the corresponding row in the initial image block; the pixel at the fourth position of each row in the target image block is added to the restored pixel at the previous position to obtain a restoration result, and the restoration result is used as the pixel at the fourth position of the corresponding row in the initial image block. The four initial image blocks after the frequency domain restoration transformation are combined to obtain an image.

[0193] In the embodiment of the present application, the coded bitstream of the image is decoded to obtain at least one target image block; the target image block is sequentially subjected to frequency domain restoration transformation in at least one direction to obtain an initial image block corresponding to the target image block; and the at least one initial image block is combined to obtain an image. In this way, by performing frequency domain restoration transformation in at least one direction on the target image block, an accurate initial image block can be obtained.

[0194] In some embodiments, the frequency domain restoration transform in at least one direction includes at least one inverse transformation process performed in sequence in an inverse execution order; the inverse execution order is the inverse order of the execution order; the frequency domain restoration transform in one direction includes one or more of the inverse transformation processes; the inverse transformation process is the inverse process of the transformation process, and one transformation process is used to achieve the separation of a high-frequency component and a low-frequency component in the corresponding direction.

[0195] Among them, at least one inverse transformation process of the frequency domain restoration transformation can be performed in any direction, that is, the frequency domain restoration transformation in one direction includes one or more inverse transformation processes.

[0196] The inverse transformation process is the inverse process of the transformation process, and one transformation process is used to separate the primary high-frequency component and the low-frequency component in the corresponding direction.

[0197] The frequency domain restoration transformation in at least one direction includes at least one inverse transformation process, and all inverse transformation processes are performed in sequence according to the inverse execution order. The inverse execution order refers to the execution order of all inverse transformation processes. When performing the frequency domain restoration transformation, the target restoration transformation process is executed in sequence according to the inverse execution order, and the target restoration transformation process is the first inverse transformation process that has not been executed in the inverse execution order.

[0198] In some embodiments, performing a frequency domain restoration transform on the target image block in at least one direction to obtain an initial image block corresponding to the target image block includes: performing a target restoration transform process on a third image block to obtain a fourth image block; wherein the third image block is the target image block or an image block output by a previous inverse transform process of the target restoration transform process in the inverse execution sequence, the fourth image block is an image block output by the target restoration transform process, and the target image block is an image block output by the last inverse transform process in the inverse execution sequence.

[0199] The target restoration transformation process is the inverse transformation process that needs to be currently executed in the inverse execution sequence. When performing frequency domain restoration transformation in at least one direction, the first frequency domain restoration transformation corresponds to the first inverse transformation process in the inverse execution sequence, and so on, the last frequency domain restoration transformation corresponds to the last inverse transformation process in the inverse execution sequence.

[0200] Among them, the target restoration transformation process is performed on the third image block to obtain the fourth image block; the third image block is the target image block or the image block output by the previous inverse transformation process of the target restoration transformation process in the inverse execution order, the fourth image block is the image block output by the target restoration transformation process, and the initial image block is the image block output by the last inverse transformation process in the inverse execution order.

[0201] Figure 6 This is a schematic diagram of an implementation process of an image decoding method provided in an embodiment of the present application. Figure 2 , the method can be executed by a processor of a computer device. Figure 5 , Figure 5 The S502 in can be updated to S601, which will be combined with Figure 6 The steps shown are explained.

[0202] Step S601, for pixels at M positions along a target direction in a third image block, use the pixel at the first position in the third image block as the pixel at the first position in a fourth image block; and use the restoration operation result between the pixel at the mth position in the third image block and the pixel at at least one other position as the pixel at the mth position in the fourth image block; 1<m≤M, M is an integer greater than or equal to 2; the target direction is the direction corresponding to the target restoration transformation process.

[0203] The target direction is the direction corresponding to the target restoration transformation process. Exemplarily, if the target restoration transformation process is a frequency domain restoration transformation in the horizontal direction, the target direction is the horizontal direction.

[0204] In some embodiments, the direction includes at least one of the following: a first direction and a second direction; the first direction and the second direction are perpendicular to each other. Exemplarily, the first direction is a horizontal direction, and the second direction is a vertical direction. Taking a two-dimensional target image block as an example, the target image block is a rectangle or a square, the direction parallel to the upper edge of the target image block is the horizontal direction, and the direction parallel to the left edge of the target image block is the vertical direction.

[0205] In some embodiments, the direction further includes a third direction, and the third direction is perpendicular to the first direction and the second direction. Exemplarily, the third direction is a depth direction.

[0206] The directions may also include a fourth direction, a fifth direction, and so on. The dimensions of the directions are not limited to the above dimensions, and are determined according to actual needs.

[0207] In the embodiment of the present application, the direction includes a first direction and a second direction, and the first direction and the second direction are perpendicular to each other. In this way, by performing frequency domain restoration transformation in the first direction and the second direction in sequence, the target image block separated by high and low frequencies can be accurately restored to the initial image block.

[0208] Among them, when the target direction is horizontal, the pixels at the M positions along the target direction can be M positions from left to right, or M positions from right to left; when the target direction is vertical, the pixels at the M positions along the target direction can be M positions from top to bottom, or M positions from bottom to top.

[0209] The restoration operation refers to the inverse operation of the residual operation. Exemplarily, the pixel at the second position along the target direction in the initial image block is subtracted from the pixel at the first position to obtain the residual operation result at the second position, which is used as the pixel at the second position of the target image block. When the target image block is subjected to the restoration operation in the target direction, the pixel at the second position of the target image block is added to the pixel at the first position to obtain the restoration operation result, which is used as the pixel at the second position of the initial image block. The pixel at the first position along the target direction in the initial image block is consistent with the pixel at the first position along the target direction in the target image block.

[0210] In some embodiments, during encoding, the residual operation result may be a negative value. When the residual operation result is a negative value, the negative value is adjusted based on the bit depth of the pixel, and the negative value is adjusted to a positive value. Then, in the process of performing the restoration operation, it is necessary to consider how to perform the restoration operation so that the restoration operation result is the true result. At this time, it is only necessary to determine whether the restoration operation result is the true result by whether the restoration operation result is within the value range of the pixel. When the bit depth of the pixel is 8, the value range of the pixel is 0 to 255. Exemplarily, during the residual operation, the pixel 20 at the third position is subtracted from the pixel 30 at the second position to obtain the residual operation result -10, and the residual operation result is adjusted by adding 256 to obtain the adjusted residual operation result 246. During the restoration operation, consider adding 30 to 246 to obtain 276. Obviously, 276 is greater than 255, and 276 is not the true restoration operation result. At this time, subtract 256 from 246 and add 30 to get 20. 20 satisfies the pixel value range, so the actual restoration result of the third position is 20.

[0211] Each of the M positions along the target direction corresponds to at least one pixel.

[0212] In some embodiments, a method for implementing the restoration operation result between the pixel at the mth position in the third image block and the pixels at at least one other position as the pixel at the mth position in the fourth image block may be to use the restoration operation result between the pixel at the mth position in the third image block and the pixels at the m-1th position and the pixel at the 1st position as the pixel at the mth position in the fourth image block.

[0213] In some embodiments, a method for implementing the restoration operation result between the pixel at the mth position in the third image block and the pixels at at least one other position as the pixel at the mth position in the fourth image block may be to use the restoration operation result between the pixel at the mth position in the third image block and the pixel at the m-1th position, the pixel at the m+1th position, and the pixel at the 1st position as the pixel at the mth position in the fourth image block.

[0214] Among them, when performing the restoration operation, the pixel at the first position in the third image block must be used. This is because the pixel at the first position in the third image block is used as the basic pixel. When performing the frequency domain restoration transformation, the pixel at the first position in the third image block is consistent with the pixel at the first position in the fourth image block. The pixel at each position in the fourth image block needs to refer to the pixel at the first position in the third image block to be determined.

[0215] In some embodiments, a frequency domain restoration transformation is performed on the target image block in the horizontal direction to directly obtain an initial image block. In this case, the third image block is the target image block, and the fourth image block is the initial image block.

[0216] In some embodiments, the target image block is sequentially subjected to frequency domain restoration transformation in the horizontal and vertical directions. When the frequency domain restoration transformation is performed in the horizontal direction, the third image block is the target image block, and the fourth image block is the image block output by the frequency domain restoration transformation in the horizontal direction; when the frequency domain restoration transformation is performed in the vertical direction, the third image block is the image block output by the frequency domain restoration transformation in the horizontal direction, and the fourth image block is the initial image block.

[0217] In the embodiment of the present application, for the pixels at M positions along the target direction in the third image block, the pixel at the first position in the third image block is used as the pixel at the first position in the fourth image block; and the restoration operation result between the pixel at the mth position in the third image block and the pixel at at least one other position is used as the pixel at the mth position in the fourth image block. In this way, the target image block with high and low frequency separation is accurately restored to the initial image block through frequency domain restoration transformation in at least one direction.

[0218] In some embodiments, the direction includes a first direction and a second direction; the target image block includes pixels at four positions in both the first direction and the second direction; the method of using the restoration operation result between the pixel at the mth position in the third image block and the pixel at at least one other position as the pixel at the mth position in the fourth image block includes: using the restoration operation result between the pixel at the third position in the third image block and the pixel at the first position as the pixel at the third position in the fourth image block; using the restoration operation result between the pixel at the fourth position, the pixel at the third position and the pixel at the first position in the third image block as the pixel at the fourth position in the fourth image block; using the restoration operation result between the pixel at the second position, the pixel at the first position and the pixel at the third position in the third image block as the pixel at the second position in the fourth image block.

[0219] The first direction and the second direction are two directions perpendicular to each other in the two-dimensional plane. Exemplarily, the first direction is a horizontal direction, and the second direction is a vertical direction.

[0220] The target image block includes pixels at 4 positions in both the first direction and the second direction. Exemplarily, the size of the target image block is 4*4, including 4 rows and 4 columns with a total of 16 pixels.

[0221] In some embodiments, during encoding, the pixel at the first position is used as the base pixel, and the residual operation result between the pixel at the third position in the first image block and the pixel at the first position is used as the pixel at the third position in the second image block. Correspondingly, during decoding, the restoration operation result between the pixel at the third position in the third image block and the pixel at the first position is used as the pixel at the third position in the fourth image block. Exemplarily, the pixel at the third position is added to the pixel at the first position to obtain the restoration operation result.

[0222] In some embodiments, during encoding, the residual operation result between the pixel at the 4th position and the pixel at the 3rd position in the first image block is used as the pixel at the 4th position in the second image block. Correspondingly, during decoding, the restoration operation result between the pixel at the 4th position, the pixel at the 3rd position and the pixel at the 1st position in the third image block is used as the pixel at the 4th position in the fourth image block. Exemplarily, the pixel at the 4th position is added to the pixel at the 3rd position, and then to the pixel at the 1st position, to obtain the restoration operation result of the 4th position.

[0223] In some embodiments, during encoding, the residual operation result between the pixel at the second position, the pixel at the first position, and the pixel at the third position in the first image block is used as the pixel at the second position in the second image block. Correspondingly, during decoding, the restoration operation result between the pixel at the second position, the pixel at the first position, and the pixel at the third position in the third image block is used as the pixel at the second position in the fourth image block. Exemplarily, the pixels at the first position and the third position in the fourth image block are first calculated, the mean is calculated, and then the pixel at the second position in the third image block is added with the mean to obtain the restoration operation result of the second position.

[0224] In the embodiment of the present application, the restoration operation result between the pixel at the third position and the pixel at the first position in the third image block is used as the pixel at the third position in the fourth image block; the restoration operation result between the pixel at the fourth position, the pixel at the third position and the pixel at the first position in the third image block is used as the pixel at the fourth position in the fourth image block; the restoration operation result between the pixel at the second position, the pixel at the first position and the pixel at the third position in the third image block is used as the pixel at the second position in the fourth image block. In this way, an accurate initial image block can be obtained through frequency domain restoration transformation.

[0225] In some embodiments, the target image block includes a high-frequency component and a low-frequency component, and the encoded code stream includes image block encoding data of each of the target image blocks; decoding the encoded code stream of the image to obtain at least one target image block includes: based on a preset number of bits, decoding the image block encoding data to obtain the high-frequency component and the low-frequency component.

[0226] Wherein, based on the preset bit number, the image block coded data is decoded to obtain the high frequency component and the low frequency component. The preset bit number is the preset number of bits required to encode each pixel. Exemplarily, the preset bit number is 8, and each pixel of the high frequency component and the low frequency component is encoded with 8 bits.

[0227] In some embodiments, each pixel of the image block encoding data is decoded using the same preset bit number to obtain a high-frequency component and a low-frequency component of the target image block.

[0228] In some embodiments, the preset bit depth includes a first bit depth and a second bit depth, and the encoded data of the high-frequency component is decoded based on the first bit depth to obtain the high-frequency component, and the encoded data of the low-frequency component is decoded based on the second bit depth to obtain the low-frequency component.

[0229] Figure 7 This is a schematic diagram of an implementation process of an image decoding method provided in an embodiment of the present application. Figure 3 , the method can be executed by a processor of a computer device. Figure 5 , the low-frequency component includes a first image sub-block, the high-frequency component includes at least one second image sub-block, the image block encoding data includes encoding bit depth data, first encoding data corresponding to the first image sub-block and second encoding data corresponding to the at least one second image sub-block; the preset number of bits includes a first bit depth and a second bit depth; Figure 5 S501 in can be updated to S701 to S703, which will be combined with Figure 7 The steps shown are explained.

[0230] S701. Decode the coded bit depth data to obtain an identifier of a first bit depth in a fixed-length code table and a second bit depth of a second image sub-block.

[0231] The fixed-length code table is used to provide at least two preset bit depths. The preset bit depth is a preset number of bits used to encode an image block. The preset bit depth includes at least one pixel depth, and the pixel depth is used to encode a single pixel.

[0232] The first bit depth is a preset bit depth to be selected that meets the encoding requirements of pixels in the first image sub-block and has the smallest length. The preset bit depth to be selected is a preset bit depth that meets the encoding requirements of pixels in the first image sub-block.

[0233] The identifier is the position of the preset bit depth in the fixed-length code table.

[0234] The second bit depth is the maximum pixel bit depth required by the pixels of the second image sub-block.

[0235] In some embodiments, the encoded bit depth data includes first bit depth data corresponding to a first bit depth and second bit depth data corresponding to a second bit depth; the decoding of the encoded bit depth data to obtain an identifier of the first bit depth in a fixed-length code table and a second bit depth of the second image sub-block includes: based on a preset third bit depth, decoding the first bit depth data to obtain the identifier; based on a preset fourth bit depth, decoding the second bit depth data to obtain the second bit depth.

[0236] The third bit depth is the number of bits required to encode the identifier, and the fourth bit depth is the number of bits required to encode the second bit depth.

[0237] The preset third bit depth is determined according to the identified range.

[0238] The preset fourth bit depth is determined according to the range of the second bit depth.

[0239] Exemplarily, the third bit depth is 3, 3 bits of data are read, and the first bit depth data 101 is obtained. After decoding, the identifier corresponding to the first bit depth is 5; the fourth bit depth is 4, 4 bits of data are read, and the second bit depth data 0111 is obtained. After decoding, the second bit depth 7 is obtained.

[0240] In some embodiments, based on a preset fixed number of bits, the coded bit depth data is decoded to obtain an identifier of the first bit depth in the fixed-length code table and a second bit depth of the second image sub-block. Exemplarily, the fixed number of bits is 4, and the identifier is obtained by reading 4 bits of data, and then 4 bits of data are read and decoded to obtain the second bit depth.

[0241] In the embodiment of the present application, based on the preset third bit depth, the first bit depth data is decoded to obtain the identifier; based on the preset fourth bit depth, the second bit depth data is decoded to obtain the second bit depth. In this way, the identifier and the second bit depth can be accurately obtained to achieve the decoding of the bit depth required for the image sub-block.

[0242] S702: Decode the first encoded data based on a first bit depth corresponding to the identifier to obtain the first image sub-block.

[0243] In some embodiments, the first bit depth includes a pixel bit depth, and the first encoded data is decoded based on the pixel bit depth to obtain all pixels in the first image sub-block.

[0244] In some embodiments, the first bit depth includes at least two pixel bit depths, and the number of pixel bit depths is consistent with the number of pixels in the first image sub-block. The first encoded data is decoded by each pixel bit depth of the first bit depth to obtain each pixel in the first image sub-block.

[0245] S703: Decode the second encoded data based on the second bit depth to obtain the at least one second image sub-block.

[0246] In some embodiments, the second bit depth includes the second bit depth corresponding to each second image sub-block; the decoding of the second encoded data based on the second bit depth to obtain the at least one second image sub-block includes: decoding the second encoded data based on the second bit depth corresponding to each second image sub-block to obtain each second image sub-block; the second bit depth is the maximum pixel depth required by the pixels of the second image sub-block.

[0247] Wherein, all pixels in the second image sub-block are decoded based on the second bit depth.

[0248] In some embodiments, the number of the second image sub-block is one, and based on a second bit depth corresponding to the second image sub-block, the second encoded data is read and decoded to obtain the second image sub-block.

[0249] In some embodiments, there are at least two second image sub-blocks, a second bit depth corresponding to each second image sub-block is determined, and second encoded data is read and decoded based on the at least two second bit depths to obtain at least two second image sub-blocks.

[0250] Exemplarily, there are 3 second image sub-blocks, the second bit depth is {7, 6, 6}, 7 bits of data are read and decoded to obtain the first second image sub-block, 6 bits of data are read and decoded to obtain the second second image sub-block, and 6 bits of data are read and decoded to obtain the third second image sub-block.

[0251] In the embodiment of the present application, based on the second bit depth corresponding to each second image sub-block, the second coded data is decoded to obtain each second image sub-block. In this way, the decoded second image sub-block can be accurately obtained.

[0252] In some embodiments, the second bit depth is a bit depth corresponding to all second image sub-blocks, and based on the second bit depth, the second encoded data is decoded to obtain all second image sub-blocks. Exemplarily, the second bit depth is 6, there are 3 second image sub-blocks, and 3 6-bit data are read in sequence to obtain 3 second image sub-blocks.

[0253] In the embodiment of the present application, the coded bit depth data is decoded to obtain an identifier of the first bit depth in the fixed-length code table and the second bit depth of the second image sub-block; based on the first bit depth corresponding to the identifier, the first coded data is decoded to obtain the first image sub-block; based on the second bit depth, the second coded data is decoded to obtain at least one second image sub-block. In this way, the image sub-block can be accurately decoded to obtain the decoded target image block. Compared with the exponential Golomb coding, the fixed-length coding method can be used to obtain the coding length of the entire target image block by reading the fixed-length coded bit depth data during decoding, thereby improving the throughput of the decoding algorithm.

[0254] Figure 8 This is a schematic diagram of an implementation process of an image decoding method provided in an embodiment of the present application. Figure 4 , the method can be executed by a processor of a computer device. Figure 7 , the first encoded data includes a first portion of data and a second portion of data; the first image sub-block includes a first pixel and at least one second pixel; Figure 7 S702 in can be updated to S801 to S802, which will be combined Figure 8 The steps shown are explained.

[0255] S801. Decode the first part of data based on a pixel bit depth to obtain a first pixel.

[0256] The pixel bit depth is a fixed number of bits for encoding a pixel. The pixel bit depth is determined according to the value range of the pixel. For example, the pixel value range in the image is 0 to 255, so the pixel bit depth is set to 8, and any pixel within the pixel value range can be encoded.

[0257] Exemplarily, the pixel bit depth is 8, and the 8-bit first part data 00011110 is read and decoded to obtain the first pixel 30.

[0258] S802: Decode the second portion of data based on the first bit depth to obtain at least one second pixel.

[0259] The second pixel is the remaining pixels in the first image sub-block except the first pixel.

[0260] The first bit depth is a preset bit depth that meets the encoding requirements of all second pixels in the first image sub-block.

[0261] In some embodiments, the first bit depth includes a pixel bit depth corresponding to each of the second pixels; and decoding the second portion of data based on the first bit depth to obtain at least one second pixel includes: decoding the second portion of data based on the pixel bit depth corresponding to each of the second pixels to obtain each of the second pixels.

[0262] Wherein, the pixel bit depth is the number of bits required to encode a single second pixel, and the number of pixel bit depths is consistent with the number of second pixels. Based on each pixel bit depth in the first bit depth, the second portion of data is read and decoded to obtain each second pixel. Exemplarily, the first bit depth is {3, 5, 6}, 3 bits of data 111 are read, and pixel 7 is decoded, 5 bits of data 11110 are read, and pixel 30 is decoded, and 6 bits of data 110010 are read, and pixel 50 is decoded. Therefore, the second portion of data is decoded to obtain three second pixels 7, 30, and 50.

[0263] In the embodiment of the present application, the second portion of data is decoded based on the pixel bit depth corresponding to each second pixel to obtain each second pixel. In this way, the second portion of data can be accurately decoded to obtain the second pixel.

[0264] In some embodiments, the first bit depth is a pixel bit depth corresponding to all second pixels, and the second portion of data is decoded based on the pixel bit depth to obtain each second pixel.

[0265] In the embodiment of the present application, the first part of data is decoded based on the pixel bit depth to obtain a first pixel, and the second part of data is decoded based on the first bit depth to obtain at least one second pixel. In this way, the pixels after decoding the first image sub-block can be accurately obtained.

[0266] In some embodiments, the fixed-length code table is used to provide at least two preset bit depths, the first bit depth is a candidate preset bit depth with the smallest length, and the candidate preset bit depth includes at least one candidate preset bit depth determined from the at least two preset bit depths that meets the encoding requirements of each of the second pixels in the first image sub-block.

[0267] The fixed-length code table provides at least two preset bit depths, and the number of bits corresponding to different preset bit depths is different. In the fixed-length code table, not all preset bit depths can meet the encoding requirements of the second pixel, so it is necessary to select a suitable preset bit depth from the fixed-length code table as the first bit depth.

[0268] The fixed-length code table is predetermined, and a preset bit depth in the fixed-length code table is determined based on the pixel bit depth. The fixed-length code table at least includes a preset bit depth composed of the pixel bit depth.

[0269] According to the order of each preset bit depth in the fixed-length code table, it is determined in turn whether the second pixel in the first image sub-block can be represented by the preset bit depth, and a candidate preset bit depth that can encode all the second pixels is determined from at least two preset bit depths. The number of bits of different candidate preset bit depths is different. In order to reduce the total number of encoding bits, the candidate preset bit depth with the smallest length is determined as the first bit depth.

[0270] In the embodiment of the present application, the first bit depth is a candidate preset bit depth with the smallest length, and the candidate preset bit depth includes at least one candidate preset bit depth determined from at least two preset bit depths that satisfies the encoding requirements of each second pixel in the first image sub-block. In this way, a suitable first bit depth can be selected from the fixed-length code table to decode the second pixel.

[0271] In some embodiments, the image decoding module is used to parallelly process the frequency domain restoration transformation process and the decoding process of at least two target image blocks based on a multi-stage pipeline method; the image decoding module includes a frequency domain restoration transformation processing unit and a decoding processing unit, wherein the decoding processing unit is used to process the decoding process of the target image block corresponding to the j-th initial image block; the frequency domain restoration transformation processing unit is used to process the frequency domain restoration transformation process of the j-1th target image block, where j is a positive integer.

[0272] The decoding process of the target image block includes decoding the identifier of the first bit depth, the second bit depth and all pixels in the target image block.

[0273] The multi-stage pipeline method includes two stages of pipelines, the first stage pipeline is used to implement the decoding process of the target image block, and the second stage pipeline is used to implement the frequency domain restoration transformation process of the target image block. In the first stage pipeline, each target image block is decoded in turn to obtain the decoded target image block. In the second stage pipeline, each target image block is subjected to frequency domain restoration transformation in turn to obtain the initial image block corresponding to the target image block.

[0274] Among them, a first-level pipeline is executed through the decoding processing unit to process the decoding process of the target image block; and a second-level pipeline is executed through the frequency domain restoration transformation processing unit to process the frequency domain restoration transformation process of the target image block.

[0275] In some embodiments, the primary pipeline and the secondary pipeline can be processed in parallel. In the process of decoding the encoded code stream of the image, when the first target image block is decoded, the frequency domain restoration transformation process of the first target image block can be processed in parallel with the decoding process of the second target image block, and so on, the decoding process of the jth target image block can be processed in parallel with the frequency domain restoration transformation process of the j-1th target image block. Therefore, when the decoding processing unit processes the decoding process of the target image block corresponding to the jth initial image block, the frequency domain restoration transformation processing unit can process the frequency domain restoration transformation process of the j-1th target image block in parallel.

[0276] In the embodiment of the present application, the frequency domain restoration transformation process and the decoding process of at least two target image blocks are processed in parallel by the image decoding module based on a multi-stage pipeline method. In this way, the multi-stage pipeline method is used to process multiple image blocks at the same clock, thereby improving the decoding efficiency of the image decoding module.

[0277] In some embodiments, the image decoding module is used to parallelly process the frequency domain restoration transformation process, the bit depth data decoding process and the image data decoding process of at least three target image blocks based on a multi-stage pipeline method; the image decoding module includes a frequency domain restoration transformation processing unit, a bit depth data decoding processing unit and an image data decoding processing unit, wherein the bit depth data decoding processing unit is used to process the bit depth data decoding process of the target image block corresponding to the j-th initial image block; the image data decoding processing unit is used to process the image data decoding process of the target image block corresponding to the j-1th initial image block; the frequency domain restoration transformation processing unit is used to process the frequency domain restoration transformation process of the j-2th target image block, where j is a positive integer.

[0278] The bit depth data decoding process refers to decoding the encoded bit depth data to obtain the first bit depth identifier and the second bit depth required by the target image block.

[0279] The image data decoding process refers to decoding the image block coded data to obtain all pixels in the target image block.

[0280] Among them, the multi-stage pipeline method includes three stages of pipeline, the first stage pipeline is used to implement the bit depth data decoding process of the target image block, the second stage pipeline is used to implement the image data decoding process of the target image block, and the third stage pipeline is used to implement the frequency domain restoration transformation process of the target image block. In the first stage pipeline, the coded bit depth data of each target image block is decoded in turn to obtain the first bit depth identifier and the second bit depth required for each target image block. In the second stage pipeline, the image block coded data of each target image block is decoded in turn to obtain all the pixels in each target image block. In the third stage pipeline, each target image block is subjected to frequency domain restoration transformation in turn to obtain the initial image block corresponding to each target image block.

[0281] Among them, a first-level pipeline is executed through the bit depth data decoding processing unit to process the bit depth data decoding process of the target image block; a second-level pipeline is executed through the image data decoding processing unit to process the image data decoding process of the target image block; and a third-level pipeline is executed through the frequency domain restoration transformation processing unit to process the frequency domain restoration transformation process of the target image block.

[0282] In some embodiments, the primary pipeline, the secondary pipeline and the tertiary pipeline can be processed in parallel. In the process of decoding the encoded code stream of the image, after the first target image block completes the bit depth data decoding process, the image data decoding process of the first target image block can be processed in parallel with the bit depth data decoding process of the second target image block; after the first target image block completes the image data decoding process and the second target image block completes the bit depth data decoding process, the frequency domain restoration transformation process of the first target image block can be processed in parallel with the image data decoding process of the second target image block and the bit depth data decoding process of the third target image block; and so on, the bit depth data decoding process of the jth target image block can be processed in parallel with the image data decoding process of the j-1th target image block and the frequency domain restoration transformation process of the j-2th target image block. Therefore, the bit depth data decoding processing unit processes the bit depth data decoding process of the target image block corresponding to the jth initial image block; the image data decoding processing unit processes the image data decoding process of the target image block corresponding to the j-1th initial image block; and the frequency domain restoration transformation processing unit processes the frequency domain restoration transformation process of the j-2th target image block.

[0283] In the embodiment of the present application, the frequency domain restoration transformation process, the bit depth data decoding process and the image data decoding process of at least three target image blocks are processed in parallel by the image decoding module based on a multi-stage pipeline method. In this way, the multi-stage pipeline method is used to process multiple image blocks at the same clock, thereby improving the decoding efficiency of the image decoding module.

[0284] The following describes the application of the image encoding method and image decoding method provided in the embodiments of the present application in actual scenarios.

[0285] Fig. 9 A schematic diagram of row-level bandwidth compression provided by an embodiment of the present application. Fig. 9 As shown, row-level bandwidth compression needs to store a row of image data (corresponding to the pixels in the above embodiment) as a reference, and the length of a row of image data is the image width. Row-level bandwidth compression generally requires a combination of the left pixel and the upper pixel to be referenced as a reference pixel. This requires the hardware device to cache a row of image data before it can start pipeline processing. For example, Fig. 9 In FIG. 9 , the reference pixel of the current pixel 901 is determined based on the left pixel 902, the upper left pixel 903, the upper pixel 904, and the upper right pixel 905. The reference pixel ref=F (left pixel, upper left pixel, upper pixel, upper right pixel), where F is a calculation function.

[0286] Row-level bandwidth compression uses exponential Golomb coding. During decoding, it is necessary to read a bit in the code stream (corresponding to the encoded code stream in the above embodiment) in real time to determine whether the bit is an exponential Golomb cutoff, and then read the next bit to determine whether it is an exponential Golomb cutoff. In the case of identifying an exponential Golomb cutoff, the number of bits of the pixel is determined (corresponding to the pixel bit depth in the above embodiment) to complete the decoding of the pixel. Since the encoding uses exponential Golomb coding, decoding the next pixel requires waiting for the previous pixel to be decoded before determining how many bits need to be selected from the code stream. This imposes certain limitations on the throughput of the decompression algorithm, which is not in line with the high throughput and low latency characteristics required by the bandwidth compression algorithm.

[0287] In block-level bandwidth compression, there is less block information, and the redundant information that can be reduced by making a difference in the spatial domain is less. However, since the encoding end uses exponential Golomb coding, there are certain limitations on the throughput of the decoding algorithm.

[0288] In the embodiment of the present application, the low-frequency and high-frequency signals (corresponding to the low-frequency component and the high-frequency component in the above embodiment) of the image block are split by frequency domain operation of the image block (corresponding to the frequency domain transformation in the above embodiment). The low-frequency signal and the high-frequency signal are respectively encoded using a fixed-length encoding code table (corresponding to the fixed-length code table in the above embodiment) to obtain a code stream to be transmitted.

[0289] First, the high-frequency and low-frequency signals of the two-dimensional spatial domain image data need to be separated. The basic encoding unit (corresponding to the initial image block in the above embodiment) is a 4*4 image block. First, the horizontal frequency domain conversion is performed:

[0290] Fig.10 A schematic diagram of a horizontal frequency domain conversion provided in an embodiment of the present application. Fig.10 As shown, the 4*4 image block data on the left is transformed in the horizontal direction to obtain the transformed image block on the right.

[0291] For the first pixel of each row, as the basic pixel, no processing is done (corresponding to Fig.10 in [0]);

[0292] For the third pixel in each row, calculate the difference between this pixel and the first pixel in each row to get the residual at that position (corresponding to Fig.10 [2]-[0] in ();

[0293] For the fourth pixel in each row, calculate the difference between this pixel and the third pixel in each row to get the residual at that position (corresponding to Fig.10 [3]-[2] in [3]);

[0294] For the second pixel in each row, the reference pixel pre is equal to the average of the first pixel in each row and the third pixel in each row, and the residual data at this position (corresponding to the residual operation result in the above embodiment) is obtained by calculating the difference between the current pixel and the reference pixel (corresponding to Fig.10 [1]-pre in).

[0295] The residual data at each position is not a negative value. When the difference between two pixels is a negative value, the difference is adjusted by adding 256 to obtain the final residual data.

[0296] For example, for the first row, the first pixel 23 is not processed; the reference pixel of the second pixel is the average value 35 of pixels 23 and 47, the data calculation method of the second position is to calculate the difference between pixels 13 and 35, and adjust the difference (that is, 13-35+256=234), the data calculation method of the third position is to calculate the difference between pixels 47 and 23 (that is, 47-23=24), and the data calculation method of the fourth position is to calculate the difference between pixels 23 and 47, and adjust the difference (that is, 23-47+256=232). Through the above calculation method, Fig.10 The first row of pixels on the left [23 13 47 23] is converted to the first row of pixels on the right [23 234 24 232], the second row of pixels on the left [19 13 11 45] is converted to the second row of pixels on the right [19254 248 34], the third row of pixels on the left [35 32 45 11] is converted to the third row of pixels on the right [35 248 10222], and the fourth row of pixels on the left [98 97 98 98] is converted to the fourth row of pixels on the right [98 255 0 0].

[0297] After the horizontal calculation is completed, the data needs to be processed vertically to separate the high and low frequency signals in the vertical direction:

[0298] Fig.11A schematic diagram of a vertical frequency domain conversion provided in an embodiment of the present application. Fig.11 As shown, the image block on the upper side is the image block after horizontal transformation, and the image block on the upper side is transformed in the vertical direction to obtain the image block on the lower side after transformation.

[0299] For the first pixel in each column, as the basic pixel, no processing is done (corresponding to Fig.11 in [0]);

[0300] For the third pixel in each column, calculate the difference between this pixel and the first pixel in each column to get the residual at that position (corresponding to Fig.11 [2]-[0] in ();

[0301] For the fourth pixel in each column, calculate the difference between this pixel and the third pixel in each column to get the residual at that position (corresponding to Fig.11 [3]-[2] in [3]);

[0302] For the second pixel in each column, the reference pixel pre is equal to the average of the first pixel in each column and the third pixel in each column. The residual data at this position is obtained by calculating the difference between the current pixel and the reference pixel (corresponding to Fig.11 in [1]-[pre]).

[0303] For example, for the first column, the first pixel 23 is not processed; the reference pixel of the second pixel is the average value 29 of pixels 23 and 35, the data calculation method of the second position is to calculate the difference between pixels 19 and 29, and adjust the difference (that is, 19-29+256=246), the data calculation method of the third position is to calculate the difference between pixels 35 and 23 (that is, 35-23=12), and the data calculation method of the fourth position is to calculate the difference between pixels 98 and 35 (that is, 98-35=63). Through the above calculation method, Fig.11 The first row of pixels on the upper side [23 234 24 232] is converted to the first row of pixels on the lower side [23 234 24232], the second row of pixels on the upper side [19 254 248 34] is converted to the second row of pixels on the lower side [246 13 231 63], the third row of pixels on the upper side [35 248 10 222] is converted to the third row of pixels on the lower side [12 14 242 246], and the fourth row of pixels on the upper side [98 255 0 0] is converted to the fourth row of pixels on the lower side [63 7 246 34].

[0304] In some embodiments, the basic encoding unit is an 8*8 image block, and when performing horizontal frequency domain conversion:

[0305] The first pixel of each row is used as the base pixel and is not processed;

[0306] For the second pixel in each row, the reference pixel is the average of the first pixel in each row and the third pixel in each row, and the residual data at this position is obtained by calculating the difference between the reference pixel and the second pixel;

[0307] For the third pixel in each row, the reference pixel is the average of the first pixel in each row and the fifth pixel in each row, and the residual data at this position is obtained by calculating the difference between the reference pixel and the third pixel;

[0308] For the fourth pixel in each row, the reference pixel is equal to the average of the third pixel in each row and the fifth pixel in each row, and the residual data at this position is obtained by calculating the difference between the reference pixel and the fourth pixel;

[0309] For the fifth pixel in each row, calculate the difference between this pixel and the first pixel in each row to get the residual at that position;

[0310] For the sixth pixel in each row, the reference pixel is equal to the average of the fifth pixel in each row and the seventh pixel in each row, and the residual data at this position is obtained by calculating the difference between the reference pixel and the sixth pixel;

[0311] For the seventh pixel in each row, calculate the difference between the pixel and the fifth pixel in each row to obtain the residual at that position;

[0312] For the eighth pixel in each row, the difference between the pixel and the seventh pixel in each row is calculated to obtain the residual at that position.

[0313] For an 8*8 image block, the frequency domain conversion in the vertical direction is similar to the frequency domain conversion in the horizontal direction.

[0314] Fig.12 Schematic diagram of a transformed image block provided in an embodiment of the present application. Fig.12 As shown, the 4*4 transformed image block (corresponding to the target image block in the above embodiment) is divided into 4 2*2 image blocks. The first image block 1201 contains pixels [23 43 19 26], the second image block 1202 contains pixels [48 47 49 126], the third image block 1203 contains pixels [24 28 126 14], and the fourth image block 1204 contains pixels [27 19 19 68]. Encoding is performed using a fixed-length code table. The first pixel in the upper left corner of the first 2*2 image block 1201 is encoded according to the bit depth of the pixel; illustratively, for pixel 23, the encoded value is 00010111. For the other three pixels of the first 2*2 image block, they are encoded according to the following fixed-length code table LookUpTable (taking 8-bit bit depth as an example, other bit depths are expanded according to corresponding multiples):

[0315] LookUpTable[8][3]={{0,0,0},{2,1,1},{2,3,3},{4,3,5},{4,5,3},{6,5,5},{6,7,7},{8,8,8}}.

[0316] The second, third, and fourth values ​​of the first 2*2 image block can be encoded by which bit length table in the LookUpTable (corresponding to the first bit depth in the above embodiment), and the position of the LookUpTable where the bit length table is located is transmitted during encoding (corresponding to the identifier in the above embodiment). Fig.12 Among them, 43, 19, and 26 can be represented by {6, 5, 5}, so {6, 5, 5} is passed at position 5 of the LookUpTable during encoding.

[0317] For the second, third, and fourth 2*2 image blocks (1202 to 1204), the bit depth required to encode the maximum value in each 2*2 image block is selected as the bit depth for encoding each pixel of the current 2*2 image block, and its bit depth length is encoded in the bitstream header ( Fig.12 The maximum bit depth of the second image block 1202 is 7 bits, the maximum bit depth of the third image block 1203 is 7 bits, and the maximum bit depth of the fourth image block 1204 is 7 bits).

[0318] Exemplarily, for the second 2*2 image block, the bit depth required for encoding 126 is 7, and 7 is encoded in the bitstream header; for the third 2*2 image block, the bit depth required for encoding 126 is 7, and 7 is encoded in the bitstream header; for the fourth 2*2 image block, the bit depth required for encoding 68 is 7, and 7 is encoded in the bitstream header.

[0319] In the final encoding, first encode the encoding length of the first 2*2 image block, for example, encode the transmitted value 5; then encode the maximum bit depth values ​​of the second, third, and fourth 2*2 image blocks in sequence (corresponding to the second bit depth in the above embodiment), for example, encode the three values ​​7, 7, and 7; then encode the value of the first pixel of the 4*4 image block, for example, encode the first pixel 23 at 8 bits; then encode the other three pixels of the first 2*2 image block through the encoding length table of the first 2*2 block (corresponding to the first bit depth in the above embodiment), for example, {6, 5, 5}, for example, encode 43, 19, and 26 with 6 bits, 5 bits, and 5 bits respectively. Then, in the order of the second, third, and fourth 2*2 image blocks, encode the pixels in each 2*2 image block in sequence to complete the encoding process of the current 4*4 image block, for example, each pixel in the second, third, and fourth 2*2 image blocks is encoded with 7 bits.

[0320] The decoding process is the reverse process of the encoding process. Due to the fixed-length coding method, each 4*4 image block only needs to decode the fixed first few bits of the coding length, for example, the bits occupied by 5, 7, 7, 7 transmitted during encoding can tell how many bits the current block occupies in the code stream.

[0321] At the beginning of decoding, 3 bits of data are first read (corresponding to the third bit depth in the above embodiment), and the coding length table offset of the first 2*2 block (corresponding to the identifier in the above embodiment) is calculated. For example, Fig.12 , that is, 5, and then read three groups of 4-bit data (corresponding to the fourth bit depth in the above embodiment) in sequence to obtain the encoding length of each pixel of the second, third, and fourth 2*2 image blocks (corresponding to the second bit depth in the above embodiment), for example, three encoding lengths of 7, 7, and 7. In this way, the number of bits occupied by the current 4*4 image block is calculated.

[0322] Exemplarily, after decoding the coding length table offset value 5, the bit length table corresponding to 5 (corresponding to the first bit depth in the above embodiment) {6, 5, 5} is searched in the fixed-length code table, and it is calculated that the number of bits occupied by the first image block is 8+(6+5+5)=24bit; after decoding the coding length of each pixel of the second, third, and fourth 2*2 image blocks to be 7, 7, and 7 respectively, the number of bits occupied by the second, third, and fourth image blocks is 7*4*3=84bit.

[0323] Fig.13 This is a schematic diagram of pipeline processing in hardware provided in the embodiment of the present application. Fig.13 As shown, the hardware can be processed in parallel in a multi-stage pipeline. In the first-stage pipeline, the coding length of the data block is read (corresponding to the coding bit depth data in the above embodiment), and the coding lengths of block 0, block 1, block 2 and block 3 are read in sequence; in the second-stage pipeline, the data code stream is read (corresponding to the first coding data and the second coding data in the above embodiment), the data of the data block is decoded, and the data of block 0, block 1 and block 2 are decoded in sequence; in the third-stage pipeline, the data of the data block is reversely transformed (corresponding to the frequency domain restoration transformation process in the above embodiment), and the data of block 0 and block 1 are reversely transformed in sequence. A periodic clock signal is set, and when the clock signal arrives, the tasks in the multi-stage pipeline are processed in parallel. After reading the code streams of the first few coding lengths, the hardware can make an offset to obtain the starting address of the code stream corresponding to the next 4*4 image block. The hardware processes multiple image blocks at the same time, and can quickly decode multiple 4*4 image blocks in a pipeline manner.

[0324] The embodiment of the present application divides the image into regular 4*4 (or other square size) blocks, performs horizontal and vertical high and low frequency signal separation transformations in the image blocks, and obtains a transformation block with the low frequency signal in the upper left corner of the image and the high frequency signal in the lower right corner of the image. The transformation block (corresponding to the target image block in the above embodiment) is encoded using a fixed-length code table. At the decoding end, only the fixed-length coding length information needs to be read to obtain the coding length of the entire coding block. In hardware design, a multi-stage pipeline can be used to process multiple image blocks with the same clock to complete decoding.

[0325] The embodiment of the present application separates the redundant information of the image in the frequency domain by separating the high and low frequency signals of the image block, and has a better ability to remove redundancy than the traditional spatial domain difference method. When encoding, a fixed-length code table is used instead of the traditional exponential Columbus encoding. When decoding, the coding length of the entire image block can be obtained by reading the fixed-length coding length code stream, without having to wait until the entire block image data is read to know the starting point of the code stream of the next image block. In terms of hardware design, a pipeline method can be used, and multiple image blocks can be processed in one clock. At the same time, due to the use of image block data, compared with row-level compression, the opening of the hardware device linebuffer is reduced, the layout of the hardware device data is reduced, and the data throughput is improved compared to the existing coding method.

[0326] Based on the foregoing embodiments, the embodiments of the present application provide an image encoding module and an image decoding module, which can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0327] Fig.14 A schematic diagram of the composition structure of an image encoding module provided in an embodiment of the present application is shown in FIG. Fig.14 As shown, the image coding module 1400 includes: a division unit 1410, a transformation unit 1420, and a coding unit 1430, wherein:

[0328] A dividing unit 1410 is used to divide the image to obtain at least one initial image block;

[0329] A transform unit 1420 is configured to perform a frequency domain transform on the initial image block in at least one direction to obtain a target image block corresponding to the initial image block; the frequency domain transform is configured to separate high-frequency components and low-frequency components in the direction;

[0330] The encoding unit 1430 is used to encode at least one of the target image blocks to obtain an encoded code stream of the image.

[0331] In some embodiments, the frequency domain transformation in at least one direction includes at least one transformation process performed sequentially in an execution order; the frequency domain transformation in one direction includes one or more of the transformation processes; a transformation process is used to achieve separation of a high-frequency component and a low-frequency component in the corresponding direction.

[0332] In some embodiments, the transformation unit 1420 is further used to perform a target transformation process on the first image block to obtain a second image block; wherein the first image block is the initial image block or an image block output by a previous transformation process of the target transformation process in the execution order, the second image block is an image block output by the target transformation process, and the target image block is an image block output by the last transformation process in the execution order.

[0333] In some embodiments, the transformation unit 1420 is further used to use the pixel at the first position in the first image block as the pixel at the first position in the second image block for the pixels at N positions along the target direction in the first image block; and use the residual operation result between the pixel at the nth position in the first image block and the pixel at at least one other position as the pixel at the nth position in the second image block; 1<n≤N, N is an integer greater than or equal to 2; the target direction is the direction corresponding to the target transformation process.

[0334] In some embodiments, the direction includes at least one of the following: a first direction and a second direction; the first direction and the second direction are perpendicular to each other.

[0335] In some embodiments, the direction includes a first direction and a second direction; the initial image block includes pixels at four positions in both the first direction and the second direction; the transformation unit 1420 is further used to use the residual operation result between the pixel at the third position and the pixel at the first position in the first image block as the pixel at the third position in the second image block; use the residual operation result between the pixel at the fourth position and the pixel at the third position in the first image block as the pixel at the fourth position in the second image block; use the residual operation result between the pixel at the second position, the pixel at the first position and the pixel at the third position in the first image block as the pixel at the second position in the second image block.

[0336] In some embodiments, the target image block includes a high-frequency component and a low-frequency component, and the encoded code stream includes image block encoding data of each of the target image blocks; the encoding unit 1430 is also used to encode the high-frequency component and the low-frequency component based on a preset bit number to obtain the image block encoding data of the target image block.

[0337] In some embodiments, the low-frequency component includes a first image sub-block, the high-frequency component includes at least one second image sub-block, and the image block encoding data includes encoding bit depth data, first encoding data corresponding to the first image sub-block, and second encoding data corresponding to the at least one second image sub-block; the preset number of bit positions includes a first bit depth and a second bit depth; the encoding unit 1430 is also used to encode the first bit depth identifier and the second bit depth of the second image sub-block in the fixed-length code table to obtain the encoding bit depth data; based on the first bit depth corresponding to the identifier, the first image sub-block is encoded to obtain first encoding data; based on the second bit depth, at least one second image sub-block is encoded to obtain second encoding data.

[0338] In some embodiments, the first encoded data includes a first portion of data and a second portion of data; the first image sub-block includes a first pixel and at least one second pixel; the encoding unit 1430 is also used to encode the first pixel based on the pixel bit depth to obtain the first portion of data; based on the first bit depth, encode the at least one second pixel to obtain the second portion of data.

[0339] In some embodiments, the first bit depth includes a pixel bit depth corresponding to each of the second pixels; the encoding unit 1430 is further used to encode each of the second pixels based on the pixel bit depth corresponding to each of the second pixels to obtain the second portion of data.

[0340] In some embodiments, the fixed-length code table is used to provide at least two preset bit depths; the encoding unit 1430 is also used to determine at least one candidate preset bit depth that meets the encoding requirements of each of the second pixels in the first image sub-block among the at least two preset bit depths; and determine the candidate preset bit depth with the smallest length as the first bit depth.

[0341] In some embodiments, the second bit depth includes the second bit depth corresponding to each second image sub-block; the encoding unit 1430 is further used to encode each second image sub-block based on the second bit depth corresponding to each second image sub-block to obtain second encoded data; the second bit depth is the maximum pixel depth required by the pixels of the second image sub-block.

[0342] In some embodiments, the encoded bit depth data includes first bit depth data corresponding to a first bit depth and second bit depth data corresponding to a second bit depth; the encoding unit 1430 is further used to encode the identifier based on a preset third bit depth to obtain the first bit depth data; based on a preset fourth bit depth, encode the second bit depth to obtain the second bit depth data.

[0343] In some embodiments, the image encoding module 1400 is used to parallelly process the frequency domain transformation process and the encoding process of at least two initial image blocks based on a multi-stage pipeline method; the transformation unit 1420 is also used to process the frequency domain transformation process of the i-th initial image block; the encoding unit 1430 is also used to process the encoding process of the target image block corresponding to the i-1-th initial image block, where i is a positive integer.

[0344] In some embodiments, the image encoding module 1400 is also used to parallelly process the frequency domain transformation process, the bit depth data encoding process and the image data encoding process of at least three initial image blocks based on a multi-stage pipeline method; the transformation unit 1420 is also used to process the frequency domain transformation process of the i-th initial image block; the encoding unit 1430 is also used to process the bit depth data encoding process of the target image block corresponding to the i-1-th initial image block; the encoding unit 1430 is also used to process the image data encoding process of the target image block corresponding to the i-2-th initial image block, where i is a positive integer.

[0345] Fig.15 A schematic diagram of the composition structure of an image decoding module provided in an embodiment of the present application is shown in FIG. Fig.15 As shown, the image decoding module 1500 includes: a decoding unit 1510, a restoration conversion unit 1520, and a combination unit 1530, wherein:

[0346] The decoding unit 1510 is used to decode the coded bitstream of the image to obtain at least one target image block;

[0347] A restoration transform unit 1520 is used to perform a frequency domain restoration transform on the target image block in at least one direction to obtain an initial image block corresponding to the target image block; the frequency domain restoration transform is an inverse transform of the frequency domain transform, and the frequency domain transform is used to separate the high-frequency component and the low-frequency component in the direction;

[0348] The combining unit 1530 is configured to combine at least one of the initial image blocks to obtain the image.

[0349] In some embodiments, the frequency domain restoration transform in at least one direction includes at least one inverse transformation process performed in sequence in an inverse execution order; the inverse execution order is the inverse order of the execution order; the frequency domain restoration transform in one direction includes one or more of the inverse transformation processes; the inverse transformation process is the inverse process of the transformation process, and one transformation process is used to achieve the separation of a high-frequency component and a low-frequency component in the corresponding direction.

[0350] In some embodiments, the restoration transformation unit 1520 is further used to perform a target restoration transformation process on the third image block to obtain a fourth image block; wherein the third image block is the target image block or an image block output by the previous inverse transformation process of the target restoration transformation process in the inverse execution order, the fourth image block is an image block output by the target restoration transformation process, and the target image block is an image block output by the last inverse transformation process in the inverse execution order.

[0351] In some embodiments, the restoration transformation unit 1520 is further used to use the pixel at the first position in the third image block as the pixel at the first position in the fourth image block for the pixels at M positions along the target direction in the third image block; and use the restoration operation result between the pixel at the mth position in the third image block and the pixel at at least one other position as the pixel at the mth position in the fourth image block; 1<m≤M, M is an integer greater than or equal to 2; the target direction is the direction corresponding to the target restoration transformation process.

[0352] In some embodiments, the direction includes at least one of the following: a first direction and a second direction; the first direction and the second direction are perpendicular to each other.

[0353] In some embodiments, the direction includes a first direction and a second direction; the target image block includes pixels at four positions in both the first direction and the second direction; the restoration transformation unit 1520 is further used to use the restoration operation result between the pixel at the third position and the pixel at the first position in the third image block as the pixel at the third position in the fourth image block; use the restoration operation result between the pixel at the fourth position, the pixel at the third position and the pixel at the first position in the third image block as the pixel at the fourth position in the fourth image block; use the restoration operation result between the pixel at the second position, the pixel at the first position and the pixel at the third position in the third image block as the pixel at the second position in the fourth image block.

[0354] In some embodiments, the target image block includes a high-frequency component and a low-frequency component, and the encoded code stream includes image block encoding data of each of the target image blocks; the decoding unit 1510 is also used to decode the image block encoding data based on a preset bit number to obtain the high-frequency component and the low-frequency component.

[0355] In some embodiments, the low-frequency component includes a first image sub-block, the high-frequency component includes at least one second image sub-block, and the image block encoding data includes encoding bit depth data, first encoding data corresponding to the first image sub-block, and second encoding data corresponding to the at least one second image sub-block; the preset number of bit positions includes a first bit depth and a second bit depth; the decoding unit 1510 is further used to decode the encoding bit depth data to obtain an identifier of the first bit depth in the fixed-length code table and the second bit depth of the second image sub-block; based on the first bit depth corresponding to the identifier, the first encoding data is decoded to obtain the first image sub-block; based on the second bit depth, the second encoding data is decoded to obtain the at least one second image sub-block.

[0356] In some embodiments, the first encoded data includes a first portion of data and a second portion of data; the first image sub-block includes a first pixel and at least one second pixel; the decoding unit 1510 is also used to decode the first portion of data based on the pixel bit depth to obtain the first pixel; based on the first bit depth, decode the second portion of data to obtain at least one second pixel.

[0357] In some embodiments, the first bit depth includes a pixel bit depth corresponding to each of the second pixels; the decoding unit 1510 is further used to decode the second portion of data based on the pixel bit depth corresponding to each of the second pixels to obtain each of the second pixels.

[0358] In some embodiments, the fixed-length code table is used to provide at least two preset bit depths, the first bit depth is a candidate preset bit depth with the smallest length, and the candidate preset bit depth includes at least one candidate preset bit depth determined from the at least two preset bit depths that meets the encoding requirements of each of the second pixels in the first image sub-block.

[0359] In some embodiments, the second bit depth includes the second bit depth corresponding to each second image sub-block; the decoding unit 1510 is further used to decode the second encoded data based on the second bit depth corresponding to each second image sub-block to obtain each second image sub-block; the second bit depth is the maximum pixel depth required by the pixels of the second image sub-block.

[0360] In some embodiments, the encoded bit depth data includes first bit depth data corresponding to a first bit depth and second bit depth data corresponding to a second bit depth; the decoding unit 1510 is further used to decode the first bit depth data based on a preset third bit depth to obtain the identifier; and decode the second bit depth data based on a preset fourth bit depth to obtain the second bit depth.

[0361] In some embodiments, the image decoding module 1500 is used to parallelly process the frequency domain restoration transformation process and the decoding process of at least two target image blocks based on a multi-stage pipeline method; the decoding unit 1510 is also used to process the decoding process of the target image block corresponding to the j-th initial image block; the restoration transformation unit 1520 is also used to process the frequency domain restoration transformation process of the j-1-th target image block, where j is a positive integer.

[0362] In some embodiments, the image decoding module 1500 is also used to parallelly process the frequency domain restoration transformation process, the bit depth data decoding process and the image data decoding process of at least three target image blocks based on a multi-stage pipeline method; the decoding unit 1510 is also used to process the bit depth data decoding process of the target image block corresponding to the j-th initial image block; the decoding unit 1510 is also used to process the image data decoding process of the target image block corresponding to the j-1-th initial image block; the restoration transformation unit 1520 is also used to process the frequency domain restoration transformation process of the j-2-th target image block, where j is a positive integer.

[0363] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiment of the present application can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0364] It should be noted that in the embodiments of the present application, if the above-mentioned image encoding method and image decoding method are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present application are not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.

[0365] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0366] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.

[0367] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.

[0368] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented in hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0369] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.

[0370] Fig.16 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown in FIG. Fig.16 As shown, the hardware entity of the computer device 1600 includes: a processor 1601 and a memory 1602, wherein the memory 1602 stores a computer program that can be run on the processor 1601, and the processor 1601 implements the steps in the method of any of the above embodiments when executing the program.

[0371] The memory 1602 stores a computer program that can be run on the processor. The memory 1602 is configured to store instructions and applications executable by the processor 1601. It can also cache data to be processed or processed by the processor 1601 and various modules in the computer device 1600 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0372] When the processor 1601 executes the program, the steps of any of the above-mentioned image encoding methods and image decoding methods are implemented. The processor 1601 generally controls the overall operation of the computer device 1600.

[0373] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the image encoding method and the image decoding method of any of the above embodiments.

[0374] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0375] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, and the embodiments of the present application do not specifically limit this.

[0376] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0377] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. An image coding method, characterized in that: Applied to an image encoding module, the method comprises: Dividing the image to obtain at least one initial image block; Performing a frequency domain transformation on the initial image block in at least one direction to obtain a target image block corresponding to the initial image block; wherein the frequency domain transformation in the direction is based on a residual operation between pixels in the initial image block in the direction to achieve separation of high-frequency components and low-frequency components in the direction, the low-frequency components in the direction include pixels that are not processed in the direction, and the high-frequency components in the direction include a result of a residual operation between pixels in the direction; Encode at least one of the target image blocks to obtain an encoded bitstream of the image.

2. The method according to claim 1, characterized in that The frequency domain transformation in at least one direction includes at least one transformation process performed in sequence according to the execution order; the frequency domain transformation in one direction includes one or more of the transformation processes; a transformation process is used to achieve the separation of a high-frequency component and a low-frequency component in the corresponding direction.

3. The method according to claim 2, characterized in that The performing frequency domain transformation on the initial image block in at least one direction to obtain a target image block corresponding to the initial image block includes: Performing a target transformation process on the first image block to obtain a second image block; Among them, the first image block is the initial image block or the image block output by the previous transformation process of the target transformation process in the execution order, the second image block is the image block output by the target transformation process, and the target image block is the image block output by the last transformation process in the execution order.

4. The method according to claim 3, characterized in that The step of performing a target transformation process on the first image block to obtain a second image block includes: For pixels at N positions along a target direction in a first image block, the pixel at the first position in the first image block is used as the pixel at the first position in a second image block; and the residual operation result between the pixel at the nth position in the first image block and the pixel at at least one other position is used as the pixel at the nth position in the second image block; 1<n≤N, N is an integer greater than or equal to 2; the target direction is the direction corresponding to the target transformation process.

5. The method according to claim 1, characterized in that The direction includes at least one of the following: a first direction and a second direction; the first direction and the second direction are perpendicular to each other.

6. The method according to claim 4, characterized in that The direction includes a first direction and a second direction; the initial image block includes pixels at four positions in both the first direction and the second direction; and using a residual operation result between a pixel at the nth position in the first image block and a pixel at at least one other position as a pixel at the nth position in the second image block, comprises: Using a residual operation result between a pixel at the third position and a pixel at the first position in the first image block as a pixel at the third position in the second image block; Using a residual operation result between a pixel at the fourth position and a pixel at the third position in the first image block as a pixel at the fourth position in the second image block; A residual operation result among the pixel at the second position, the pixel at the first position, and the pixel at the third position in the first image block is used as the pixel at the second position in the second image block.

7. The method according to claim 1, characterized in that The target image block includes a high-frequency component and a low-frequency component, and the coded code stream includes image block coding data of each of the target image blocks; The step of encoding at least one of the target image blocks to obtain an encoded bitstream of the image includes: Based on a preset number of bits, the high-frequency component and the low-frequency component are encoded to obtain image block encoding data of the target image block.

8. The method according to claim 7, characterized in that The low-frequency component includes a first image sub-block, the high-frequency component includes at least one second image sub-block, the image block encoding data includes encoding bit depth data, first encoding data corresponding to the first image sub-block, and second encoding data corresponding to the at least one second image sub-block; the preset number of bits includes a first bit depth and a second bit depth; encoding the high-frequency component and the low-frequency component based on the preset number of bits to obtain the image block encoding data of the target image block includes: Encoding the identifier of the first bit depth in the fixed-length code table and the second bit depth of the second image sub-block to obtain the encoded bit depth data; Encoding the first image sub-block based on a first bit depth corresponding to the identifier to obtain first encoded data; Based on the second bit depth, at least one second image sub-block is encoded to obtain second encoded data.

9. The method according to claim 8, characterized in that The first coded data includes a first portion of data and a second portion of data; the first image sub-block includes a first pixel and at least one second pixel; and encoding the first image sub-block based on a first bit depth corresponding to the identifier to obtain the first coded data includes: Encoding the first pixel based on the pixel bit depth to obtain a first portion of data; Based on the first bit depth, the at least one second pixel is encoded to obtain a second portion of data.

10. The method according to claim 9, characterized in that The first bit depth includes a pixel bit depth corresponding to each second pixel; and encoding the at least one second pixel based on the first bit depth to obtain the second portion of data includes: Based on the pixel bit depth corresponding to each second pixel, each second pixel is encoded to obtain the second portion of data.

11. The method according to claim 9, characterized in that The fixed-length code table is used to provide at least two preset bit depths, and the method further includes: Determine, among the at least two preset bit depths, at least one to-be-selected preset bit depth that satisfies a coding requirement of each of the second pixels in the first image sub-block; The candidate preset bit depth with the smallest length is determined as the first bit depth.

12. The method according to claim 8, characterized in that The second bit depth includes a second bit depth corresponding to each second image sub-block; and encoding at least one second image sub-block based on the second bit depth to obtain second encoded data includes: Based on the second bit depth corresponding to each second image sub-block, each second image sub-block is encoded to obtain second encoded data; the second bit depth is the maximum pixel bit depth required by the pixels of the second image sub-block.

13. The method according to claim 8, characterized in that The coded bit depth data includes first bit depth data corresponding to the first bit depth and second bit depth data corresponding to the second bit depth; the encoding of the first bit depth identifier and the second bit depth of the second image sub-block in the fixed-length code table to obtain the coded bit depth data includes: Based on a preset third bit depth, encoding the identifier to obtain the first bit depth data; Based on a preset fourth bit depth, the second bit depth is encoded to obtain the second bit depth data.

14. The method according to any one of claims 1 to 13, characterized in that: The image encoding module is used to process the frequency domain transformation process and the encoding process of at least two initial image blocks in parallel based on a multi-stage pipeline method; the image encoding module includes a frequency domain transformation processing unit and an encoding processing unit, wherein: The frequency domain transformation processing unit is used to process the frequency domain transformation process of the i-th initial image block; The encoding processing unit is used to process the encoding process of the target image block corresponding to the i-1th initial image block, where i is a positive integer.

15. The method according to any one of claims 1 to 13, characterized in that The image encoding module is used to process the frequency domain transformation process, the bit depth data encoding process and the image data encoding process of at least three initial image blocks in parallel based on a multi-stage pipeline mode; the image encoding module includes a frequency domain transformation processing unit, a bit depth data encoding processing unit and an image data encoding processing unit, wherein: The frequency domain transformation processing unit is used to process the frequency domain transformation process of the i-th initial image block; The bit depth data encoding processing unit is used to process the bit depth data encoding process of the target image block corresponding to the i-1th initial image block; The image data encoding processing unit is used to process the image data encoding process of the target image block corresponding to the i-2th initial image block, where i is a positive integer.

16. An image decoding method, characterized in that: Applied to an image decoding module, the method comprises: Decoding the coded bitstream of the image to obtain at least one target image block; Performing a frequency domain restoration transformation on the target image block in at least one direction to obtain an initial image block corresponding to the target image block; the frequency domain restoration transformation is an inverse transformation of the frequency domain transformation, wherein the frequency domain transformation in the direction is based on a residual operation between pixels in the direction in the initial image block to achieve separation of high-frequency components and low-frequency components in the direction, the low-frequency components in the direction include pixels that are not processed in the direction, and the high-frequency components in the direction include a result of a residual operation between pixels in the direction; At least one of the initial image blocks is combined to obtain the image.

17. The method according to claim 16, characterized in that The image decoding module is used to process the frequency domain restoration transformation process and the decoding process of at least two target image blocks in parallel based on a multi-stage pipeline method; the image decoding module includes a frequency domain restoration transformation processing unit and a decoding processing unit, wherein: The decoding processing unit is used to process the decoding process of the target image block corresponding to the j-th initial image block; The frequency domain restoration transformation processing unit is used to process the frequency domain restoration transformation process of the j-1th target image block, where j is a positive integer.

18. The method according to claim 16, characterized in that The image decoding module is used to process the frequency domain restoration transformation process, the bit depth data decoding process and the image data decoding process of at least three target image blocks in parallel based on a multi-stage pipeline method; the image decoding module includes a frequency domain restoration transformation processing unit, a bit depth data decoding processing unit and an image data decoding processing unit, wherein, The bit depth data decoding processing unit is used to process the bit depth data decoding process of the target image block corresponding to the jth initial image block; The image data decoding processing unit is used to process the image data decoding process of the target image block corresponding to the j-1th initial image block; The frequency domain restoration transformation processing unit is used to process the frequency domain restoration transformation process of the j-2 th target image block, where j is a positive integer.

19. An image encoding module, characterized in that: The modules include: A division unit, used for dividing the image to obtain at least one initial image block; A transform unit, configured to perform a frequency domain transform on the initial image block in at least one direction to obtain a target image block corresponding to the initial image block; wherein the frequency domain transform in the direction is based on a residual operation between pixels in the initial image block in the direction to achieve separation of high-frequency components and low-frequency components in the direction, the low-frequency components in the direction include pixels that are not processed in the direction, and the high-frequency components in the direction include a result of a residual operation between pixels in the direction; The encoding unit is used to encode at least one of the target image blocks to obtain an encoded code stream of the image.

20. An image decoding module, characterized in that: The modules include: A decoding unit, used for decoding the coded code stream of the image to obtain at least one target image block; A restoration transformation unit, configured to perform a frequency domain restoration transformation on the target image block in at least one direction to obtain an initial image block corresponding to the target image block; the frequency domain restoration transformation is an inverse transformation of the frequency domain transformation, wherein the frequency domain transformation in the direction is based on a residual operation between pixels in the initial image block in the direction to achieve separation of high-frequency components and low-frequency components in the direction, the low-frequency components in the direction include pixels that are not processed in the direction, and the high-frequency components in the direction include a result of a residual operation between pixels in the direction; A combining unit is used to combine at least one of the initial image blocks to obtain the image.

21. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the processor implements the steps of the method according to any one of claims 1 to 15, or implements the steps of the method according to any one of claims 16 to 18.

22. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 15, or implements the steps of the method according to any one of claims 16 to 18.

23. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method described in any one of claims 1 to 15 are implemented, or the steps of the method described in any one of claims 16 to 18 are implemented.

Citation Information

Patent Citations

  • Encoding device, decoding device and method

    CN101860740A

  • Image coding method and apparatus

    US5949912A