Image shallow compression coding and decoding method
By parallel execution of intra-frame prediction and palette prediction paths, combined with cross-path early termination and rate-distortion optimization, the problems of high computational complexity and long decoding latency in existing technologies are solved, achieving efficient hybrid image compression and decoding.
Patent Information
- Application Number
- CN202511097417.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-10-31
AI Technical Summary
Existing image compression technologies suffer from high computational complexity and long decoding latency when processing mixed content, and fail to fully utilize the spatial continuity of image content, resulting in low coding efficiency.
The system employs parallel execution of intra-frame prediction paths and palette prediction paths, selects the optimal encoding mode through cross-path early termination and mode-dependent rate-distortion optimization mechanisms, and reduces decoding complexity through a simplified syntax structure.
It improves the efficiency of computational resource allocation and the accuracy of encoding decisions in the encoding process, reduces decoding latency, and enhances the compression adaptability and reconstruction quality of hybrid images.
Smart Images

Figure CN120881284A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image shallow compression coding and decoding technology, specifically to an image shallow compression coding and decoding method. Background Technology
[0002] With the widespread adoption of applications such as remote desktops, cloud gaming, and real-time collaboration platforms, the image content that needs to be transmitted is increasingly exhibiting hybrid characteristics. A single frame often contains both natural image content with smooth textures and complex details (such as video footage and camera backgrounds) and screen content with large flat areas, sharp edges, and a limited number of colors (such as user interfaces, text, and charts). These two types of content differ significantly in statistical properties, posing a challenge to compression algorithms to balance compression efficiency for different content types within a single framework.
[0003] To address the compression requirements of mixed content, existing image and video compression standards, such as H.265 / HEVC and its screen content coding extension, or H.266 / VVC, have integrated a variety of coding tools. On one hand, these standards retain a block-based hybrid coding framework, including core modules designed for natural images such as intra / inter-frame prediction, Discrete Cosine Transform (DCT), quantization, and entropy coding. On the other hand, to handle screen content, the standards have also introduced dedicated tools such as palette mode and intra-block copying, which leverage the limited number and high repetition of colors in screen content to achieve efficient compression. During the encoding process, the encoder typically selects the optimal tool from this set of available tools for each block of the image.
[0004] While existing technologies address mixed content compression by integrating multiple encoding tools, they still have some shortcomings in practical applications. First, when making mode decisions, existing encoders often need to perform the entire prediction, transform, quantization, and bitrate estimation process for each candidate encoding mode (e.g., dozens of intra-frame prediction modes and palette modes) in pursuit of optimal rate-distortion performance. This exhaustive search process leads to extremely high computational complexity, making it difficult to meet the requirements of real-time applications for low encoding latency and low power consumption. Second, at the decoding end, to achieve high compression rates, the bitstream syntax structure of existing technologies is usually designed to be very complex and highly dependent on context. When parsing a syntax element, the decoder needs to rely on multiple previously decoded data to determine its context model. This serial dependency hinders the parallelization of the decoding process, increases the complexity of hardware implementation, and directly leads to increased decoding latency, which is unacceptable in scenarios with extremely high requirements for real-time interactivity. Finally, the decision-making process for different types of tools (such as traditional intra-frame prediction and palette mode) in existing technologies is often isolated, failing to fully utilize the spatial continuity and correlation of image content. That is, the coding mode selection of neighboring blocks has strong reference value for the current block. Ignoring this correlation will affect the accuracy of mode decision-making, thereby affecting the final compression efficiency. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a shallow compression encoding and decoding method for images, which solves the problems of high encoding computation and high decoding latency caused by the complexity of the encoding decision process and the strong dependence of the bitstream syntax when processing images with mixed content.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] The first aspect of the present invention provides a shallow image compression coding method, which processes prediction units in an input image, including executing intra-frame prediction paths and palette prediction paths in parallel, and selecting an optimal coding mode from the two paths based on rate-distortion cost, and finally generating a compressed bitstream with a specific syntax structure.
[0008] Preferably, the image shallow compression coding method includes the following steps:
[0009] Step 1: Image block division: Divide the input image into one or more coding units of a preset size, and divide each coding unit into one or more prediction units of a preset size.
[0010] Step 2: Parallel Prediction and Early Termination: For each prediction unit, the intra-prediction path and the palette prediction path are started in parallel, and a cross-path early termination decision is executed. This decision includes:
[0011] In the intra-frame prediction path, the absolute sum of prediction residuals of one or more preset intra-frame prediction modes is calculated, and the minimum value among them is selected as its initial cost J. SAD ;
[0012] In the palette prediction path, a simplified clustering algorithm is used to generate a palette, and the sum of squared errors between the original prediction unit pixels and their corresponding palette colors is calculated as its initial cost J. SSE ;
[0013] If the initial cost of one path is significantly worse than that of the other path by a preset threshold factor, the subsequent calculation of the inferior path is terminated early.
[0014] Step 3: Full Cost Calculation: For each predicted path that was not prematurely terminated, perform full processing to calculate its distortion and bitrate:
[0015] For the intra-prediction path, the processing includes: generating prediction blocks based on the selected intra-prediction mode; calculating the residual between the original prediction unit and the prediction block; transforming and quantizing the residual to obtain the quantized transformation coefficients; and calculating the reconstruction distortion D of the path based on these coefficients. intra and estimated bit rate R intra .
[0016] The processing of the palette prediction path includes: generating a reconstruction block based on the generated palette and pixel index map, and calculating the reconstruction distortion D between the reconstruction block and the original prediction unit. palette Estimate the predicted bit rate R required to encode the palette and pixel index map. palette .
[0017] Step 4: Rate-Distortion Optimization and Decision Based on Pattern Dependency: A rate-distortion optimization method is used to select the optimal encoding pattern from the unterminated paths. This step specifically involves:
[0018] Obtain the coding modes selected by the spatially adjacent prediction units of the current prediction unit;
[0019] Based on the coding patterns of the adjacent prediction units, a cost bias factor D is set for the intra-frame prediction path and the palette prediction path of the current prediction unit, respectively. intra and β palette ;
[0020] The final weighted rate distortion cost J for each path is calculated using the following formula. mode And select the path with the lowest cost as the optimal encoding pattern:
[0021] J mode =D mode +λ·Rmode ;
[0022] In the formula, J mode Rate-distortion cost for a specific encoding mode; D mode This refers to reconstruction distortion in this mode; R mode λ is the estimated total number of bits required to encode the syntax elements of this pattern; λ is the Lagrange multiplier used to balance distortion and code rate.
[0023] Step 5: Bitstream Generation: Based on the selected optimal coding mode, generate a compressed bitstream containing a mode identifier that uniquely distinguishes the intra-prediction path from the palette prediction path. The compressed bitstream has a preset syntax structure, wherein the syntax elements related to the palette mode mostly use fixed-length coding, while the syntax elements related to the intra-prediction mode use context-adaptive variable-length coding.
[0024] A second aspect of the present invention provides a shallow compression decoding method for decoding a compressed bitstream generated by the encoding method described in the first aspect of the present invention.
[0025] Preferably, the image shallow compression decoding method includes the following steps:
[0026] Step 1: Parse the pattern identifier: Parse the pattern identifier of each prediction unit from the received compressed bit stream.
[0027] Step 2: Select Reconstruction Path: Based on the value of the mode identifier, select the corresponding reconstruction path for each prediction unit. The reconstruction path includes the intra-frame prediction reconstruction path and the palette reconstruction path.
[0028] Step 3: Data Reconstruction: If the palette reconstruction path is selected, the palette color information and pixel index map information are decoded sequentially from the bitstream, and the corresponding color value is filled for each pixel position in the prediction unit according to the palette and pixel index map to directly generate the reconstruction prediction unit.
[0029] If the intra-frame prediction reconstruction path is selected, the intra-frame prediction mode information and the quantized transform coefficient information are decoded sequentially from the bitstream. Inverse quantization and inverse transform operations are performed on the quantized transform coefficients to obtain the reconstruction residual. This reconstruction process is defined by the following equation:
[0030]
[0031] In the formula, P rec (x, y) represents the final reconstructed pixel values; These are the predicted pixel values generated through the intra-frame prediction mode; is the residual pixel value obtained from the reconstructed residual; (x,y) is the pixel coordinate.
[0032] Step 4: Image Synthesis: Arrange and combine all the reconstructed prediction units according to their original spatial positions in the image to synthesize a complete reconstructed image.
[0033] This invention provides a shallow compression encoding and decoding method for images. It has the following beneficial effects:
[0034] 1. This invention reduces the processing complexity and shortens the decoding latency by precisely and hierarchically defining the syntax structure of the compressed bitstream. Specifically, by setting fixed-length mode identifiers to distinguish different prediction modes and using fixed-length encoding extensively for metadata in the palette mode, the decoder can directly parse the bitstream bit by bit without complex context judgments. This simplifies the hardware implementation logic, reduces the computational load required for parsing, and thus achieves the effect of reducing processing latency.
[0035] 2. This invention improves the compression adaptability and reconstruction quality of mixed images containing different types of data, such as natural images and screen content, by constructing a parallel hybrid prediction coding architecture. This architecture executes an intra-frame prediction path optimized for natural textures and a palette prediction path optimized for screen content in parallel for each prediction unit, and automatically selects the optimal mode based on rate-distortion cost. This block-by-block adaptive mode selection mechanism enables the encoder to use the most suitable compression tool for the content characteristics of different regions within the image, thereby achieving universal and efficient encoding of diverse content within a single framework.
[0036] 3. This invention improves the efficiency of computational resource allocation and the accuracy of coding decisions during the encoding process by introducing cross-path early termination and pattern-dependent rate-distortion optimization mechanisms. The early termination mechanism can quickly eliminate obviously suboptimal predicted paths with low initial complexity, avoiding subsequent heavy computational overhead. Simultaneously, pattern-dependent rate-distortion optimization utilizes the spatial correlation of already encoded adjacent blocks to assist in the pattern decision of the current block. The combination of these two mechanisms reduces the overall computational load while improving the final rate-distortion performance. Attached Figure Description
[0037] Figure 1 Here is a block diagram of the encoder and decoder corresponding to the image shallow compression encoding and decoding method proposed in this invention;
[0038] Figure 2 This is a flowchart of the image shallow compression coding process of the present invention;
[0039] Figure 3 This is a schematic diagram of the five prediction modes used in the intra-frame prediction of this invention;
[0040] Figure 4The frame bitstream composition as specified in this invention;
[0041] Figure 5 The CU bitstream composition as specified in this invention;
[0042] Figure 6 This invention defines a PU bitstream composition using a palette pattern.
[0043] Figure 7 This is the composition of the PU bitstream using the intra-frame prediction mode as specified in this invention;
[0044] Figure 8 This is a flowchart of the image shallow compression decoding process of the present invention. Detailed Implementation
[0045] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] Please see the appendix Figure 1 , Figure 1 This is a system block diagram of an image shallow compression encoder and decoder according to an embodiment of the present invention.
[0047] The present invention provides an image shallow compression encoder 100, which may include: an image segmentation module 110, a parallel prediction module 120, a mode decision module 130, and an entropy coding module 140.
[0048] The image segmentation module 110 receives the raw image data and divides it into one or more coding units (CUs) according to a preset fixed size. Each coding unit is then further divided into one or more prediction units (PUs). The segmented prediction unit data is transmitted to the parallel prediction module 120.
[0049] The parallel prediction module 120 performs two independent prediction processes in parallel for each prediction unit received from the image segmentation module 110. The parallel prediction module 120 internally includes an intra-frame prediction submodule 122 and a palette prediction submodule 124. The intra-frame prediction submodule 122 performs intra-frame spatial prediction, residual calculation, and transform quantization. The palette prediction submodule 124 performs palette generation and pixel index mapping. The outputs of both submodules, including their respective reconstructed data and syntax element information required for encoding, are transmitted to the mode decision module 130.
[0050] The mode decision module 130 has its input connected to the output of the parallel prediction module 120. This module calculates and compares the costs of data from the intra-frame prediction submodule 122 and the palette prediction submodule 124 based on a preset rate-distortion optimization criterion, selecting an optimal coding mode for the currently processed prediction unit. The output of the mode decision module 130, including the identifier information of the selected optimal coding mode and the corresponding syntax elements to be encoded, is transmitted to the entropy coding module 140.
[0051] The entropy encoding module 140 has its input connected to the output of the mode decision module 130. This module is used to perform entropy encoding according to the received optimal encoding mode and its syntax elements, following preset syntax structure rules, to generate and output the final compressed bitstream.
[0052] The present invention also provides an image shallow compression decoder 200, the structure and processing flow of which correspond to the encoder 100. The decoder 200 may include: an entropy decoding module 210, a pattern recognition module 220, a branch reconstruction module 230, and an image synthesis module 240.
[0053] The entropy decoding module 210 receives the compressed bitstream generated by the encoder 100 and parses it to separate the encoded data of each prediction unit, particularly the pattern identifier used to distinguish the encoding mode and other syntax elements associated with the mode. The parsed pattern identifier and related data are transmitted to the pattern recognition module 220.
[0054] The pattern recognition module 220 has its input connected to the output of the entropy decoding module 210. This module is used to read the pattern identifier of each prediction unit and, according to the preset value of the pattern identifier, to transmit the relevant data of the prediction unit to the corresponding processing path in the branch reconstruction module 230.
[0055] The branch reconstruction module 230 has its input connected to the output of the pattern recognition module 220. Internally, this module includes an intra-frame reconstruction submodule 232 and a palette reconstruction submodule 234. If the pattern recognition module 220 determines that the current prediction unit uses intra-frame prediction mode, its data is sent to the intra-frame reconstruction submodule 232, which performs inverse quantization, inverse transform, and intra-frame prediction to reconstruct the pixel. If it determines that the palette mode is used, the data is sent to the palette reconstruction submodule 234, which performs palette and index map decoding to reconstruct the pixel. The output of the branch reconstruction module 230, i.e., the reconstructed prediction unit pixel data, is transmitted to the image synthesis module 240.
[0056] The image synthesis module 240 has its input connected to the output of the branch reconstruction module 230. This module is used to arrange and combine all the received reconstructed prediction unit data according to the correct spatial location, and finally synthesize them into a complete reconstructed image and output it.
[0057] Please see the appendix Figure 2 , Figure 2 This is a flowchart of image shallow compression coding according to an embodiment of the present invention. The initial step of the coding method of the present invention is image block division.
[0058] In one specific embodiment, the image block partitioning step logically divides the input raw image data into multiple consecutive and non-overlapping coding units (CUs). Each coding unit has a pre-defined, fixed size. For example, the size of a coding unit can be set to 8 pixels wide and 32 pixels high, i.e., 8x32 pixels. This size remains unchanged during the processing of a complete image frame.
[0059] After the image is divided into coding units, each coding unit is further divided into one or more prediction units (PUs) according to a fixed spatial layout. Prediction units are the basic processing units for subsequent coding operations such as prediction, transformation, and quantization. For example, an 8x32 pixel coding unit can be fixedly divided into four 4x16 pixel prediction units.
[0060] A key technical feature of this partitioning scheme is its non-adaptive nature. That is, the size and number of both the coding unit and the prediction unit are preset fixed values that do not change during the encoding process. This fixed, non-recursive partitioning method avoids complex block partitioning decision-making and search processes, reduces the computational overhead of the encoding front-end, and provides a foundation for subsequent low-latency processing. All subsequent encoding steps are performed on a unit-by-unit basis.
[0061] Please see the appendix Figure 3 , Figure 3 This is a schematic diagram illustrating five prediction modes employed in intra-frame prediction according to an embodiment of the present invention. The processing steps in the intra-frame prediction path are as follows:
[0062] First, spatial prediction is performed. This step selects an optimal prediction mode for the current prediction unit from a pre-defined, limited set of intra-frame prediction modes. In one specific embodiment, this set includes five prediction modes: vertical prediction mode, horizontal prediction mode, DC prediction mode, vertically right-biased prediction mode, and vertically left-biased prediction mode. These modes utilize the already encoded and reconstructed neighboring pixel values above and / or to the left of the current prediction unit to generate the prediction block for the current prediction unit.
[0063] Next, calculate the prediction residuals. This is done when generating prediction blocks. Then, the difference between it and the original prediction unit block P is calculated to obtain the residual block R. res The process is defined by the following formula:
[0064]
[0065] In the formula, (x, y) are the pixel coordinates within the prediction unit; P(x, y) is the original pixel value; To predict pixel values; R res (x,y) represents the corresponding residual value.
[0066] Next, the residual block undergoes transformation and quantization. To eliminate spatial redundancy within the residual block, a two-dimensional integer discrete cosine transform (IntegerDCT) is performed to obtain a transform coefficient block. Subsequently, the transform coefficient block is quantized using a quantization step size determined by the quantization parameter (QP) to obtain quantized transform coefficients. The quantized transform coefficients, along with the selected intra-frame prediction mode information, will be used for subsequent rate-distortion cost calculations.
[0067] In parallel with the intra-frame prediction path, the palette prediction path also processes the same prediction unit, as follows:
[0068] First, a simplified palette generation is performed. This step uses a simplified K-means clustering algorithm to generate a palette M with a limited number of colors for the current prediction unit. plt The algorithm first selects N pixels from the set of pixels in the prediction unit. plt Using an initial color as the cluster center, an initial color palette is formed.
[0069] In one specific embodiment, to reduce computational complexity, these initial cluster centers remain fixed in subsequent pixel allocation steps and are not iteratively updated. plt The size of the color palette is a preset upper limit.
[0070] Next, pixel index allocation is performed. For each pixel P(x,y) in the prediction unit, in the generated color palette M... plt In this process, based on a preset color space distance metric (such as Euclidean distance in a three-dimensional color space), the palette entry μ that is closest to its color is found. k The process is defined by the following formula:
[0071]
[0072] In the formula, idx(x,y) is the palette index value assigned to the pixel with coordinates (x,y) in the prediction unit; distance(·) is the color distance function; A mathematical operator that finds the value of parameter k that minimizes the subsequent expression; k is the index of a color entry in the palette; N plt The total number of colors in the palette generated by the current prediction unit; distance(·) is a preset color distance calculation function used to quantify the difference between two color values in a specific color space (e.g., YUV or RGB space), such as calculating their Euclidean distance; P(x,y) is the color value of the original pixel at coordinates (x,y) within the current prediction unit; μ k This refers to the specific color value of the k-th color entry in the palette generated by the current prediction unit.
[0073] Please see the appendix Figure 2 In a preferred embodiment of the present invention, after executing the intra-prediction path and the palette prediction path in parallel, the mode decision module 130 performs a mode decision step to select an optimal coding mode for the current prediction unit. In one specific embodiment, this step includes two stages: cross-path early termination and mode-dependent rate-distortion optimization.
[0074] The first stage is the cross-path early termination decision. This stage aims to quickly eliminate obviously suboptimal predicted paths through low-complexity cost evaluation, thereby reducing unnecessary computation.
[0075] First, an initial cost is calculated for each of the two paths. For the intra-prediction path, the initial cost J is... SAD The initial cost J is the minimum of the absolute sum of the prediction residuals generated by all preset intra-prediction modes in this path. For the palette prediction path, its initial cost J... SSE It is the sum of squared errors between the original prediction unit pixel and its best matching color in the generated palette.
[0076] After obtaining two initial costs J SAD and J SSE Then, they are compared. If the initial cost of one path is greater than the initial cost of another path multiplied by a preset threshold factor, that path is determined to be a disadvantageous path and terminated early, and its subsequent full cost calculation steps will not be executed. This mechanism can concentrate computational resources on the predicted path that is more likely to become the optimal pattern.
[0077] The second stage is pattern-dependent rate-distortion optimization. For all predicted paths that were not prematurely terminated (possibly one or two), a complete rate-distortion cost calculation and decision-making process is performed. First, the standard rate-distortion cost J is calculated for each path that was not terminated. mode The cost is defined by the following formula:
[0078] J mode =D mode +λ·R mode ;
[0079] In the formula, J mode Rate-distortion cost for a specific encoding mode; D mode This refers to reconstruction distortion in this mode; R mode λ is the estimated total number of bits required to encode the syntax elements of this pattern; λ is the Lagrange multiplier used to balance distortion and code rate.
[0080] Subsequently, a pattern-dependent cost bias factor β is introduced. mode To further optimize the decision-making process, this bias factor utilizes the mode information of the encoded prediction units spatially adjacent to the current prediction unit. Specifically, it queries the optimal coding modes selected by the prediction units to the left and / or above the current prediction unit. If most of the adjacent prediction units use intra-prediction modes, a bias factor β less than 1 is set for the intra-prediction path of the current prediction unit. intra At the same time, a bias factor β equal to 1 is set for the palette prediction path. palette Conversely, if many adjacent prediction units use the palette pattern, then a bias factor β less than 1 is set for the palette prediction path. palette Instead, a bias factor β equal to 1 is set for the intra-frame prediction path. intra .
[0081] Finally, the final weighted rate distortion cost J′ for each path is calculated using the bias factor. mode The path with the lowest final cost is selected as the optimal encoding mode for the current prediction unit. The final weighted rate distortion cost is defined by the following formula:
[0082] J′ mode =β mode ·(D mode +λ·R mode );
[0083] In the formula, J′ mode The final weighting rate distortion cost for a specific prediction mode; β mode The cost bias factor associated with the prediction mode (mode) is set based on the coding modes selected by spatially adjacent prediction units, and is used to reflect the spatial correlation between modes; D modeThe reconstruction distortion resulting from encoding and reconstructing prediction units using the prediction mode (mode) is typically measured by the mean square error between the original prediction unit and the reconstructed prediction unit; λ is a Lagrange multiplier, used to balance distortion and bit rate, and its value is usually uniquely determined by the currently used quantization parameters; R mode The estimated total number of bits required to encode the current prediction unit using the prediction mode mode includes the encoding mode information itself and the bits required for all relevant syntax elements (such as quantized transform coefficients or palette and index map data); mode is a variable indicating a specific prediction mode, which in one embodiment of the present invention can be an intra-frame prediction path or a palette prediction path.
[0084] The identification information of the optimal encoding mode and its corresponding syntax element to be encoded will be transmitted to the entropy encoding module 140.
[0085] See attached document Figure 4 , Figure 4 As specified in this invention, the highest level of the compressed bitstream is a frame-level structure. A complete bitstream consists of the following parts in sequence: First, a fixed-length and fixed-value frame start symbol, used to identify the beginning of a frame of data in the data stream; followed by frame information, including global information such as image width, image height, and frame-level default quantization parameters, which are encoded using fixed-length encoding; finally, the bitstream of one or more coding units (CUs) arranged sequentially according to the raster scan order.
[0086] See attached document Figure 5 , Figure 5 As defined in this invention, each coding unit (CU) has its own internal structure. Its initial part is a fixed-length QP bias field, the value of which is used to adjust the quantization level of the current CU relative to the frame-level default quantization parameters. Following this are the sub-bitstreams of all prediction units (PUs) within that CU, arranged sequentially according to a fixed raster scan order.
[0087] See attached document Figure 6 and attached Figure 7 The sub-codestream structure of the prediction unit (PU) is determined by the optimal coding mode selected by the mode decision module 130 and is distinguished by a mode identifier.
[0088] See attached document Figure 6 , Figure 6 The PU bitstream composition using the palette pattern as specified in this invention, when the optimal encoding mode is the palette prediction mode, uses a first preset value (e.g., bit "1") as the mode identifier for the PU's sub-bitstream. Subsequent syntax elements primarily employ fixed-length encoding to reduce parsing complexity. Specifically, it includes, in sequence:
[0089] A new clustering stream, which contains a field indicating the number of new palette colors and a field defining the specific color value for each of these colors;
[0090] A reuse index encoded stream, which contains fields indicating the number of adjacent palette colors reused and specific reuse index values;
[0091] A pixel index encoded stream that uses run-length encoding to compress the palette index sequence of the remaining pixels in the current PU.
[0092] See attached document Figure 7 , Figure 7 The PU bitstream, as specified in this invention, uses intra-prediction mode. When the optimal coding mode is intra-prediction mode, the sub-bitstream of this PU uses a second preset value (e.g., the bit sequence "01") as the mode identifier. Following this are independent coding streams for the three color channels: Y, U, and V. Each color channel's coding stream contains:
[0093] A bit plane and an all-zero flag stream, including multiple fixed-length flag bits describing the characteristics of the transform coefficients and a single-bit flag indicating whether all transform coefficients in the channel are zero; and a coefficient encoding stream. If the single-bit flag indicates that the coefficients are not all zero, the coefficient encoding stream uses a context-adaptive variable-length encoding method to encode the position and magnitude of the quantized non-zero transform coefficients.
[0094] Please see the appendix Figure 8 , Figure 8 This is a flowchart of a shallow image compression decoding process according to an embodiment of the present invention. The shallow image compression decoding method of the present invention is used to parse and reconstruct the compressed bitstream generated by the aforementioned encoding method.
[0095] In one specific embodiment, the initial steps of the decoding method are bitstream parsing and pattern recognition. The entropy decoding module 210 receives the compressed bitstream and parses it in the reverse order of the preset syntax structure of the encoder 100. It first identifies the start-of-frame character and decodes the frame information. Subsequently, for each coding unit (CU) data block, it decodes its QP bias value. Within each CU, it further parses the sub-bitstream of each prediction unit (PU), with the primary task being to decode the pattern identifier located at its starting position.
[0096] After receiving the pattern identifier, the pattern recognition module 220 determines the subsequent data processing path based on its value. If the pattern identifier is a first preset value (e.g., bit "1"), it is determined that the current PU uses the palette mode for encoding, and the subsequent bitstream data of the PU is guided to the palette reconstruction submodule 234 in the branch reconstruction module 230. If the pattern identifier is a second preset value (e.g., bit sequence "01"), it is determined that the current PU uses the intra-prediction mode for encoding, and the subsequent bitstream data of the PU is guided to the intra-reconstruction submodule 232 in the branch reconstruction module 230.
[0097] When an intra-frame prediction reconstruction path is selected, the intra-frame reconstruction submodule 232 performs the following operations. First, it decodes from the bitstream the specific intra-frame prediction mode information used by the PU and the quantized transform coefficients of the Y, U, and V color channels.
[0098] For the quantized coefficients, the decoding process is the inverse of context-adaptive variable-length decoding. Next, the decoded quantized coefficients are dequantized, multiplied by the corresponding quantization step size, to obtain the reconstructed transform coefficients. Then, a two-dimensional integer inverse discrete cosine transform is performed on the reconstructed transform coefficients to obtain the reconstructed residual block.
[0099] Simultaneously, the intra-frame reconstruction submodule 232 generates a prediction block based on the decoded intra-frame prediction mode information, utilizing the already decoded and reconstructed adjacent pixels above and / or to the left of the current PU. Finally, the reconstructed residual block and the predicted block are added pixel by pixel to obtain the final reconstruction prediction unit P. rec The reconstruction process is defined by the following formula:
[0100]
[0101] In the formula, P rec (x, y) represents the final reconstructed pixel values; These are the predicted pixel values generated using intra-frame prediction mode; is the residual pixel value obtained from the reconstruction residual; (x,y) are the pixel coordinates.
[0102] When a palette reconstruction path is selected, the palette reconstruction submodule 234 performs the following operations.
[0103] First, the new clustering stream and the multiplexed index encoded stream are decoded from the bitstream to reconstruct the complete palette of the PU, that is, to obtain a set of color centers containing several color values.
[0104] Subsequently, the pixel index encoded stream is decoded, which is the inverse of run-length encoding, ultimately yielding a complete pixel index map that assigns a palette index to each pixel position within the PU.
[0105] Finally, all pixel positions within the PU are traversed, and the corresponding color value is selected from the reconstructed color palette based on its index value in the pixel index map and filled into the pixel position, thereby directly generating the reconstructed prediction unit.
[0106] After all prediction units have been reconstructed through their corresponding reconstruction paths, the image synthesis module 240 arranges and combines these reconstructed prediction units according to their original spatial positions within the CU to form a complete CU. Finally, all the reconstructed CUs are arranged and combined according to their original spatial positions within the image frame to synthesize a complete reconstructed image and output it.
[0107] Test example:
[0108] This test case will compare the performance of the algorithm model implemented in this embodiment with that of two existing mainstream shallow compression standards, namely JPEG-2000 and JPEG-XS software encoders.
[0109] The test data used three types of video datasets: a video dataset mainly containing natural content (NAC), a video dataset mainly containing game and screen content (SCC), and a video dataset mainly containing text and graphics content (TEC). In the experiments, all video datasets used YUV444 video sampling format with a pixel depth of 10 bits. All encoders ran in constant bitrate mode, with target bitrates (BPP) set to 1.75, 1.50, 1.25, and 1.00, corresponding to compression ratios of approximately 17, 20, 24, and 30 times, respectively.
[0110] Peak signal-to-noise ratio (PSNR) was used to evaluate the quality of the reconstructed image, and Bjontegaard Delta-PSNR (BD-PSNR) was used to evaluate the overall compression efficiency among different encoders. All BD-PSNR calculations were based on the JPEG-XS encoding results.
[0111] Tables 1, 2, and 3 show the BD-PSNR improvement of JPEG-2000 compared to the baseline JPEG-XS on the NAC, SCC, and TEC video datasets, respectively.
[0112] Table 1: BD-PSNR Improvement (dB) on the NAC Video Dataset
[0113]
[0114]
[0115] Table 2: BD-PSNR Improvement (dB) on the SCC Video Dataset
[0116]
[0117]
[0118] Table 3: BD-PSNR Improvement (dB) on the TEC Video Dataset
[0119]
[0120]
[0121] Based on the experimental results in Tables 1 to 3, compared with the JPEG-2000 and JPEG-XS shallow compression coding standards, the method of this invention improves compression efficiency on three types of video datasets containing different content. Specifically, on the NAC video dataset, the average BD-PSNR improvement of the method of this invention is 7.55 dB, while that of JPEG-2000 is 3.27 dB; on the SCC video dataset, the average improvement of the method of this invention is 7.75 dB, while that of JPEG-2000 is 3.42 dB; and on the TEC video dataset, the average improvement of the method of this invention reaches 11.28 dB, while that of JPEG-2000 is 3.27 dB.
[0122] The three datasets comprehensively cover a variety of challenging application scenarios, including complex natural textures, dynamic screen content, and intricate text and graphics. The method of this invention demonstrates stable and superior compression efficiency across these diverse content types, proving its good versatility and applicability in various video content encoding scenarios.
[0123] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A shallow image compression coding method, characterized in that, Includes the following steps: The input image is divided into one or more coding units, and each coding unit is divided into one or more prediction units; For each prediction unit, a hybrid prediction step combining the intra-frame prediction path and the palette prediction path is executed in parallel to generate the corresponding reconstructed data and bitrate, respectively. Based on the rate-distortion cost of the intra-frame prediction path and the palette prediction path, an optimal coding mode is selected for the prediction unit. Based on the selected optimal encoding mode, a compressed bitstream containing a mode identifier is generated to distinguish the intra-prediction path from the palette prediction path.
2. The image shallow compression coding method according to claim 1, characterized in that, The bitstream structure of the prediction unit is defined by the pattern identifier: If the pattern identifier is a first preset value, indicating that the palette prediction path is used, then the subsequent bitstream sequentially includes a new clustering stream for defining palette color information and a pixel index encoding stream for defining pixel index information. If the mode identifier is a second preset value, indicating the use of the intra-frame prediction path, then the subsequent bitstream includes a Y-channel coded stream, a U-channel coded stream, and a V-channel coded stream in sequence, and each of the Y, U, and V-channel coded streams contains quantized transform coefficient information.
3. The image shallow compression coding method according to claim 1, characterized in that, The hybrid prediction step includes: In parallel, within the intra-frame prediction path, prediction blocks are generated based on adjacent reconstructed pixels and residuals are calculated, and the residuals are transformed and quantized. In parallel, in the palette prediction path, a simplified K-means clustering algorithm is used to generate a palette and pixel index map for the prediction unit; Calculate the rate-distortion cost of the intra-frame prediction path and the palette prediction path respectively; The two rate-distortion costs are compared to determine the optimal coding scheme.
4. The image shallow compression coding method according to claim 3, characterized in that, The step of calculating the rate-distortion cost of the intra-frame prediction path and the palette prediction path is defined by the following formula: J mode =D mode +λ·R mode ; In the formula, J mode Rate-distortion cost for a specific encoding mode; D mode Reconstruction distortion in this mode; R mode The estimated total number of bits required to encode this pattern's syntax elements; λ is a Lagrange multiplier used to balance distortion and bit rate.
5. The image shallow compression coding method according to claim 3, characterized in that, In the intra-frame prediction path, a prediction mode is selected from a preset limited prediction mode set including vertical, horizontal, DC, vertical to the right, and vertical to the left. In the palette prediction path, the cluster centers of the simplified K-means clustering algorithm remain unchanged during a single clustering process.
6. A shallow compression decoding method for images, characterized in that, Decoding a compressed bitstream generated by an image shallow compression coding method according to any one of claims 1-5 includes the following steps: Receive a compressed bitstream containing one or more prediction unit data; Parse the compressed bitstream to obtain the pattern identifier for each prediction unit; Based on the value of the mode identifier, a corresponding reconstruction path is selected for each prediction unit, and the reconstruction path includes an intra-frame prediction reconstruction path and a palette reconstruction path. In the selected reconstruction path, the pixel data of the prediction unit is reconstructed.
7. The image shallow compression decoding method according to claim 6, characterized in that, The steps of parsing the pattern identifier and selecting the corresponding reconstruction path include: If the pattern identifier is a first preset value, then the color palette reconstruction path is selected, and the new clustering stream and pixel index encoding stream are decoded sequentially from the bitstream; If the mode identifier is the second preset value, then the intra-frame prediction reconstruction path is selected, and the Y-channel coded stream, U-channel coded stream and V-channel coded stream are decoded sequentially from the bitstream to obtain the quantized transform coefficient information.
8. The image shallow compression decoding method according to claim 6, characterized in that, The step of reconstructing the pixel data of the prediction unit includes: If the palette reconstruction path is selected, the reconstruction prediction unit is directly generated by the decoded palette and pixel index map; If the intra-frame prediction reconstruction path is selected, the reconstruction residual is obtained by performing inverse quantization and inverse transformation on the decoded quantization transform coefficients, and then added to the prediction block generated by the decoded intra-frame prediction mode to generate a reconstruction prediction unit.
9. The image shallow compression decoding method according to claim 8, characterized in that, The step of adding the reconstructed residual to the prediction block to generate a reconstruction prediction unit is defined by the following formula: In the formula, P rec (x,y) represents the final reconstructed pixel values; These are the predicted pixel values generated through the intra-frame prediction mode; The residual pixel value is obtained from the reconstructed residual; (x,y) are pixel coordinates.
10. The image shallow compression decoding method according to claim 8, characterized in that, The step of directly generating reconstruction prediction units from the decoded palette and pixel index map includes: Decode the palette to obtain a set of color centers; Decode the pixel index map to obtain the index value of each pixel position within the prediction unit; To predict the position of each pixel within the prediction unit, a corresponding color value is selected from the color center set as the reconstructed value of the pixel based on its corresponding index value in the decoded pixel index map.