Lossless compression method for removing inter-frame redundancy based on block and probability matching

CN122053839BActive Publication Date: 2026-10-20CHANGZHOU WHISPER TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610195349.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-02-11
Publication Date
2026-10-20
Estimated Expiration
2046-02-11

AI Technical Summary

Technical Problem

常见的亚像素插值或近似预测操作往往会引入不可逆的近似误差,难以保证像素级的精确重构

Benefits of technology

1、通过将图像块智能分类为七种类型,并对每种类型实施差异化编码策略,使得简单块(如单色块、完全匹配块)仅需极少的比特描述,而复杂块的残差数据也因精细处理而高度集中,从而大幅提高了整体熵编码的压缩增益,提升了编码速度;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122053839B_ABST
    Figure CN122053839B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of lossless video coding, and provides a lossless compression method for eliminating inter-frame redundancy based on block division and probability matching, which comprises the following steps: dividing a current frame into a plurality of sub-blocks, classifying each sub-block by calculating the similarity between the current block and a matching block; performing the matching coding operation of each classified sub-block through a differential processing strategy to generate compressed data; and performing entropy coding on the compressed data and outputting a lossless compression code stream; the present application combines the technical means of block processing, probability matching, multi-level classification and reversible integer prediction coding, divides the video frame into a plurality of sub-blocks, classifies the sub-blocks according to the inter-frame similarity, adopts a differential processing strategy for different types, and finally compresses the residual and motion information by using entropy coding, so that the inter-frame redundancy is effectively eliminated, the compression efficiency is significantly improved, and the robustness to fast motion and scene switching is maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of lossless video coding technology, and in particular to a lossless compression method for eliminating inter-frame redundancy based on block division and probability matching. Background Technology

[0002] In the field of video coding, significant temporal redundancy often exists between adjacent frames of a video sequence. This is mainly manifested in the highly similar pixel distribution of stationary or slowly moving objects in a scene across consecutive frames. To effectively compress video data, traditional video coding methods commonly employ inter-frame prediction techniques, which utilize this temporal correlation through motion estimation and motion compensation, thereby significantly reducing the bitrate under lossy coding conditions.

[0003] However, in applications with stringent requirements for reconstruction accuracy, such as medical image archiving, professional video archiving, and material transmission during post-production, any loss of information is unacceptable, necessitating completely lossless compression. In such lossless compression tasks, conventional inter-frame coding methods based on lossy prediction and quantization are not directly applicable; redundancy must be eliminated without altering any of the original pixel information.

[0004] Most existing continuous visual color coding methods rely on a prediction and interpolation framework. However, these methods are showing several limitations when applied to lossless inter-frame compression. Common sub-pixel interpolation or approximate prediction operations often introduce irreversible approximation errors, making it difficult to guarantee accurate pixel-level reconstruction. Furthermore, prediction errors tend to accumulate and propagate frame-by-frame in the inter-frame prediction chain, potentially leading to significant bias diffusion in long sequence coding. When prediction accuracy is insufficient, the distribution of residual data tends to become scattered, thus reducing the compression efficiency of subsequent entropy coding stages and affecting overall coding performance. Summary of the Invention

[0005] To address the above issues, this invention employs a combination of block processing, probability matching, multi-level classification, and reversible integer predictive coding to divide video frames into several sub-blocks. These sub-blocks are then classified into seven types based on inter-frame similarity, with differentiated processing strategies applied to each type. Finally, entropy coding is used to compress residual and motion information, effectively eliminating inter-frame redundancy and significantly improving compression efficiency while maintaining robustness to rapid motion and scene transitions, all while strictly ensuring pixel-level lossless reconstruction.

[0006] According to embodiments of the present invention, a lossless compression method for eliminating inter-frame redundancy based on block segmentation and probability matching is provided.

[0007] In a first aspect of the invention, a lossless compression method for eliminating inter-frame redundancy based on block segmentation and probability matching is provided. The method includes: Step S01: Divide the current frame into several sub-blocks, and classify each sub-block by calculating the similarity between the current block and the matching block. The categories include: NHB, SCB, FMDB, CDB, HSDB, LSDB, and EPB. Step S02: Perform the matching encoding operation on each classified sub-block using a differential processing strategy to generate compressed data; Step S03: Entropy encoding is performed on the compressed data to output a lossless compressed bitstream.

[0008] Furthermore, the classification described in step S01 includes NHB, SCB, FMDB, and CDB; If the current sub-block is completely identical to its neighboring sub-blocks in color identification, then it is classified as NHB; If the current sub-block contains only a single color or color mark, it is classified as SCB; If the best reference sub-unit that is exactly the same as the pixel of the current sub-block is found in the reference frame, it is classified as FMDB; If the best reference sub-unit is found in the reference frame with only a constant pixel difference between the pixels of the current sub-block and the reference sub-unit, it is classified as CDB.

[0009] Furthermore, the classification also includes HSDB, LSDB, and EPB. If the current sub-block does not belong to NHB, SCB, FMDB, or CDB, then the best reference sub-unit in the reference frame and the current sub-block are both divided into 2×2 sub-units (i.e., four-grid). If the percentage of 2×2 sub-units in the current sub-block that have exactly the same pixel value as the 2×2 sub-units in the reference frame is exactly the same, then it is classified as HSDB. If the percentage of 2×2 sub-units in the current sub-block that have the same pixel value as the corresponding 2×2 sub-units in the reference frame is ∈ [25, 50), then it is classified as LSDB. If the percentage of 2×2 sub-units in the current sub-block that have the same pixel value as the corresponding 2×2 sub-units in the reference frame is ∈ [0, 25), then it is classified as EPB.

[0010] Furthermore, the step S02, which involves performing matching encoding operations on each classified sub-block using a differentiated processing strategy, specifically includes: If the sub-block is NHB, then the category information of the sub-block is written into the data statistics; If the sub-block is an FMDB, then obtain its best reference sub-unit displacement vector in the reference frame and write it into the data statistics; If the sub-block is an SCB, then extract the pixel value at any position where the sub-block is adjacent to other blocks, and use this as the representative pixel of the sub-block, such as... Figure 9 The light blue area in the image is then subjected to pixel prediction encoding; If the sub-block is a CDB, the best reference sub-unit displacement vector is obtained and written into the data statistics. The pixel value of any position where the sub-block is connected to other blocks is extracted as the representative pixel of the sub-block, and then pixel prediction coding is performed. If the sub-block is an EPB, then pixel prediction encoding is performed after a four-grid fine discrimination process. If the sub-block is HSDB, the best reference sub-unit displacement vector and the tag index of different 2×2 sub-units are obtained and written into the data statistics. The different 2×2 sub-units are then entered into the four-grid fine discrimination process for pixel prediction encoding. If the sub-block is an LSDB, the best reference sub-unit displacement vector and the label index of the same 2×2 sub-units are obtained and written into the data statistics. Different 2×2 sub-units are then entered into the four-grid fine discrimination process for pixel prediction encoding.

[0011] Furthermore, the optimal reference sub-unit displacement vector is: the displacement of the sub-block in the current frame. The pixel obtains the optimal reference subunit. That is, the displacement vector of the optimal reference sub-element, where, , The best reference sub-unit is the sub-block in the reference frame that has the highest percentage of pixels that are the same as the current sub-block.

[0012] Furthermore, the steps of the aforementioned four-grid fine-grained discrimination process are as follows: Within each sub-block, identify non-uniform 2×2 sub-units, i.e., units with four distinct pixels; let frame B be the current frame and frame A be the reference frame; pixels are represented by row and column coordinates. express; For the 2×2 sub-unit to be processed, define the pixel vector: , in, Top-left Top-right Bottom left Bottom right; Define reference pixel vector The sub-unit marked in frame A with the same position as that in frame B is the reference pixel vector; First, intra-frame discrimination is performed on the sub-units: if the sub-unit has only one color, then one color is extracted as the representative pixel and entered into pixel predictive coding; if the sub-unit has two colors, then the pixel values ​​corresponding to the two colors are extracted as their corresponding representative pixels and entered into pixel predictive coding; if the sub-unit has three colors, then the pixel values ​​corresponding to the three colors are extracted as their corresponding representative pixels and entered into pixel predictive coding; if the sub-unit has four colors, then inter-frame discrimination is performed directly. The inter-frame discrimination is as follows: if the pixel vector of the current sub-unit is exactly the same as the reference pixel vector, the pixel vector of the current sub-unit is written into the data statistics; if the pixel vector of the sub-unit is not exactly the same as the reference pixel vector, the difference vector between the pixel vector of the current sub-unit and the reference pixel vector is calculated, and it is determined whether the difference vector is exactly the same. If they are the same, the pixel value of any adjacent sub-unit of the current sub-unit is taken as the representative pixel; otherwise, the pixel vector of the current sub-unit is taken as the representative pixel.

[0013] Furthermore, the specific steps of the pixel prediction encoding are as follows: taking the sub-block representative pixel as the local base point, check whether there is a neighborhood equivalence relationship between it and its four neighboring pixels. If there is, it is directly labeled and counted; if not, according to different cases of base point coordinates (Y,X), an applicable operator is selected from three-point average, alternative three-point average, and differential-moving average composite prediction for prediction. The predicted value is compared with the actual pixel value. If a match is found, it is written into the statistics; otherwise, the prediction error is calculated. Finally, the difference or equivalent information is sent to the data processing stage.

[0014] Furthermore, the data processing stage involves: calculating the prediction error... Construct a candidate residual set Define a set of pattern categories. For candidate residual sets Pattern matching is performed on the corresponding differences in the data, and the results are written into the data statistics. like If they are completely identical, they are determined to be identical and recorded as... ; like If the first two values ​​are the same, then it is determined that they are recorded as follows: ; like If the first and last values ​​are the same, then it is determined that the first and last values ​​are the same, and recorded as follows. ; like If the last two values ​​are consistent, then it is determined that they are recorded as follows: ; like If the first digit is smaller and the last two digits are larger and equal, then it is recorded as follows: ; like If the first and last digits are smaller and equal, then it is recorded as follows: ; like If the last digit is larger, it is determined to be recorded as follows: ; like If they are not equal, then they are determined to have no special equivalence and are recorded as follows: .

[0015] In a second aspect of the invention, a lossless compression apparatus for eliminating inter-frame redundancy based on block partitioning and probability matching is provided. The apparatus includes: Sub-block classification module: used to divide the current frame into several sub-blocks, and classify each sub-block by calculating the similarity between the current block and the matching block; Differential encoding module: Used to perform matching encoding operations on each classified sub-block through a differential processing strategy to generate compressed data; Entropy encoding module: Used to entropy encode compressed data and output lossless compressed bitstream.

[0016] This invention uses a combination of block processing, probability matching, multi-level classification, and reversible integer predictive coding to divide video frames into several sub-blocks. Based on inter-frame similarity, the sub-blocks are classified into seven types, and different processing strategies are adopted for different types. Finally, entropy coding is used to compress residual and motion information, thereby effectively eliminating inter-frame redundancy and significantly improving compression efficiency while strictly ensuring pixel-level lossless reconstruction, and maintaining robustness to fast motion and scene switching.

[0017] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description.

[0018] The beneficial effects of this invention are: 1. By intelligently classifying image blocks into seven types and implementing differentiated coding strategies for each type, simple blocks (such as monochrome blocks and perfectly matched blocks) require only a few bits for description, while the residual data of complex blocks are highly concentrated due to fine processing, thereby significantly improving the compression gain of overall entropy coding and increasing coding speed. 2. It automatically selects the appropriate processing path based on the image content. Whether it is a static background, slow motion or fast scene switching, it can effectively deal with it through the classification mechanism, avoiding the problem of sudden drop in compression efficiency caused by motion estimation failure or sudden scene change. 3. By employing integer reversible operations and deterministic matching, lossy operations such as quantization and floating-point interpolation are completely avoided, ensuring that the decoding end can accurately reconstruct the original image at the pixel level, which meets the needs of professional scenarios with extremely high fidelity requirements, such as medical imaging and scientific data storage. Attached Figure Description

[0019] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. Wherein: Figure 1 A flowchart of a lossless compression method for eliminating inter-frame redundancy based on block division and probability matching according to an embodiment of the present invention is shown. Figure 2 A flowchart according to an embodiment of the present invention is shown; Figure 3 A schematic diagram of NHB discrimination according to an embodiment of the present invention is shown; Figure 4 A schematic diagram of SCB discrimination according to an embodiment of the present invention is shown; Figure 5 A schematic diagram of FMDB discrimination according to an embodiment of the present invention is shown; Figure 6 A schematic diagram of CDB discrimination according to an embodiment of the present invention is shown; Figure 7 A schematic diagram of HSDB discrimination according to an embodiment of the present invention is shown; Figure 8 A schematic diagram of LSDB discrimination according to an embodiment of the present invention is shown; Figure 9 A schematic diagram of EPB discrimination according to an embodiment of the present invention is shown; Figure 10 A flowchart of a four-grid fine discrimination process according to an embodiment of the present invention is shown; Figure 11 A schematic diagram of a sub-unit color according to an embodiment of the present invention is shown; Figure 12 A schematic diagram of two sub-unit colors according to an embodiment of the present invention is shown; Figure 13 A schematic diagram of the colors of three sub-units according to an embodiment of the present invention is shown; Figure 14 A schematic diagram of four sub-unit colors according to an embodiment of the present invention is shown; Figure 15 A block diagram of an apparatus for a lossless compression method based on block division and probability matching to eliminate inter-frame redundancy according to an embodiment of the present invention is shown. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of 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.

[0021] According to an embodiment of the present invention, a lossless compression method for eliminating inter-frame redundancy based on block segmentation and probability matching is proposed. By combining block processing, probability matching, multi-level classification and reversible integer predictive coding, the video frame is divided into several sub-blocks. The sub-blocks are classified into 7 types according to the inter-frame similarity, and different processing strategies are adopted for different types. Finally, entropy coding is used to compress the residual and motion information, thereby effectively eliminating inter-frame redundancy and significantly improving compression efficiency while maintaining robustness to fast motion and scene switching, under the premise of strictly ensuring pixel-level lossless reconstruction.

[0022] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments.

[0023] Figure 1 This is a schematic flowchart of a lossless compression method for eliminating inter-frame redundancy based on block segmentation and probability matching according to an embodiment of the present invention. The method includes: Step S01: Divide the current frame into several sub-blocks, and classify each sub-block by calculating the similarity between the current block and the matching block; Step S02: Perform the matching encoding operation on each classified sub-block using a differential processing strategy to generate compressed data; Step S03: Entropy encoding is performed on the compressed data to output a lossless compressed bitstream.

[0024] It should be noted that although the operation of the method of the present invention has been described in a specific order in the above embodiments and figures, this does not require or imply that the operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0025] To provide a clearer explanation of the lossless compression method for eliminating inter-frame redundancy based on block division and probability matching, a specific embodiment will be used for illustration below. However, it is worth noting that this embodiment is only for better illustrating the present invention and does not constitute an improper limitation of the present invention.

[0026] The following example will further illustrate the lossless compression method based on block division and probability matching to eliminate inter-frame redundancy in more detail. Figure 2 As shown.

[0027] In this embodiment, frame 2 is taken as reference frame A, and frame 3 is taken as current frame B; similarly, when frame 3 is reference frame A and frame 4 is current frame B, taking frames 2 and 3 as examples, current frame B will be divided into sub-blocks with 8×8 pixels as units, such as... Figure 7 As shown, the orange dot represents an 8×8 sub-block. The area described in this embodiment includes the adjacent sub-blocks on the left, top, top left, and top right.

[0028] Step S01: Divide the current frame into several sub-blocks, and classify each sub-block by calculating the similarity between the current block and the matching block.

[0029] The current frame can be divided into or Sub-blocks of pixels, where and The value is a positive integer; the size of the sub-block is adaptively determined based on the resolution of the current frame image. Specifically, when the frame image resolution is high, larger sub-blocks are used for partitioning; when the frame image resolution is low, smaller sub-blocks are used. Through this adaptive partitioning strategy, the computational complexity can be optimized while ensuring the accuracy of redundancy elimination.

[0030] Specifically, the classification types include: NHB, SCB, FMDB, CDB, HSDB, LSDB, and EPB.

[0031] 1. If the current sub-block is completely identical to its neighboring sub-blocks in color identification, it is classified as NHB (Neighbor Homogeneous Block), which is used to represent cases where the spatial colors are identical and can be merged with the neighboring blocks.

[0032] like Figure 3 As shown, if the current sub-block (red line area) is completely identical to its neighboring sub-blocks in color identification, it is classified as NHB.

[0033] 2. If the current sub-block contains only a single color or color mark, it is classified as an SCB (Single-Color Block).

[0034] like Figure 4 As shown, if the current sub-block (the area with the red line) contains only a single color, it is classified as SCB.

[0035] 3. If the best reference sub-unit (with a similarity rate of 100%) that is completely identical to the pixel of the current sub-block is found in the reference frame, it is classified as FMDB (Fully-Matched Displacement Block), which means that no additional residual correction is required.

[0036] like Figure 5 As shown, if the best reference sub-unit found in the reference frame is completely consistent with the pixels of the current sub-block, it is classified as FMDB. The best reference sub-unit is (2, 2), and the best reference sub-unit displacement vector is (-4, -5).

[0037] 4. If the best reference sub-unit (e.g., overall brightness offset or uniform constant increase or decrease) is found in the reference frame with only a constant pixel difference between the pixels of the current sub-block and the reference sub-unit, it is classified as CDB (Constant-Offset Block). This type of block can be efficiently represented by the constant difference model.

[0038] like Figure 6 As shown, the sub-block found in frame A (2,2) is not a sub-block with completely identical pixels, but a sub-block with a constant pixel difference. That is, the difference between the light orange area of ​​frame B and the light orange area of ​​frame A is consistent. There is only one constant pixel difference between the current sub-block and the corresponding or similarly displaced sub-block in the reference frame, so it is classified as CDB.

[0039] If none of the above conditions apply, then the best reference sub-unit and the current sub-block in the reference frame will both be divided into 2×2 sub-units (i.e., four-grid).

[0040] 5. If the percentage of 2×2 sub-units in the current sub-block that have exactly the same pixel value as the 2×2 sub-units in the reference frame is ∈ [50%, 100%), then it is classified as HSDB (High-Similarity Displacement Block), indicating that there is obvious similarity but not complete equality.

[0041] like Figure 7 As shown, the current sub-block has 75% of the same pixels compared to the 2×2 neighborhood of the best reference sub-unit in the reference frame, and is classified as HSDB.

[0042] 6. If the percentage of 2×2 sub-units in the current sub-block that have the exact same pixel value as the corresponding sub-units in the reference frame is ∈ [25%, 50%), then it is classified as LSDB (Low-Similarity Displacement Block), indicating that there is partial similarity but limited matching degree, and more complex residual coding or additional motion candidates may be required.

[0043] like Figure 8 As shown, if the percentage of pixels in the current sub-block that are identical to those in the 2×2 neighborhood of the best reference sub-unit in the reference frame is 43.75%, then it is classified as LSDB.

[0044] 7. If the percentage of 2×2 sub-units in the current sub-block that have the exact same pixel value as the corresponding sub-units in the reference frame is ∈ [0%, 25%), then it is classified as an EPB (Extra-Processing Block), and special processing procedures should be applied to it subsequently (such as more refined search, independent encoding, or interpolation reconstruction).

[0045] like Figure 9 As shown, if the percentage of identical pixels between the current sub-block and the 2×2 neighborhood of the best reference sub-unit in the reference frame is 5%, then it is classified as EPB.

[0046] Displace the sub-block of the current frame The pixel obtains the optimal reference subunit. That is, the displacement vector of the optimal reference sub-element, where, , The best reference sub-unit is the sub-block in the reference frame that has the highest percentage of pixels that are the same as the current sub-block.

[0047] Neighborhood refers to adjacent sub-blocks, such as adjacent sub-blocks on the left, above, top left, and top right.

[0048] Step S02: Perform the matching encoding operation on each classified sub-block through the differentiation processing strategy to obtain data statistics.

[0049] If the sub-block is NHB, then the category information of the sub-block is written into the data statistics.

[0050] If the sub-block is an FMDB, then obtain its best reference sub-unit displacement vector in the reference frame and write it into the data statistics.

[0051] If the sub-block is an SCB, then extract the pixel value at any position where the sub-block is adjacent to other blocks, and use this as the representative pixel of the sub-block, such as... Figure 9 The light blue area in the image is then subjected to pixel prediction encoding.

[0052] If the sub-block is a CDB, the best reference sub-unit displacement vector is obtained and written into the data statistics. The pixel value of any position where the sub-block is connected to other blocks is extracted as the representative pixel of the sub-block, and then pixel prediction coding is performed.

[0053] If the sub-block is an EPB, then pixel prediction encoding is performed after a four-grid fine discrimination process.

[0054] If the sub-block is HSDB, the best reference sub-unit displacement vector and the tag index of different 2×2 sub-units are obtained and written into the data statistics. The different 2×2 sub-units are then entered into the four-grid fine discrimination process for pixel prediction encoding.

[0055] If the sub-block is an LSDB, the best reference sub-unit displacement vector and the label index of the same 2×2 sub-units are obtained and written into the data statistics. Different 2×2 sub-units are then entered into the four-grid fine discrimination process for pixel prediction encoding.

[0056] Specifically, such as Figure 10 As shown, the fine-grained four-grid discrimination process is as follows: Within each sub-block, non-uniform 2×2 sub-units are identified, meaning units with four pixels that are not all identical. Let frame B be the current frame and frame A be the reference frame. Pixels are represented using row and column coordinates, for example, the pixel's position... .

[0057] For the 2×2 sub-unit to be processed, define its pixel vector: , in, Top-left Top-right Bottom left It is bottom right.

[0058] Define reference pixel vector The sub-unit marked in frame A with the same position as that in frame B is the reference pixel vector.

[0059] First, intra-frame discrimination is performed on the sub-units: if the sub-unit has only one color, then one color is extracted as the representative pixel and entered into pixel predictive coding; if the sub-unit has two colors, then the pixel values ​​corresponding to the two colors are extracted as their corresponding representative pixels and entered into pixel predictive coding; if the sub-unit has three colors, then the pixel values ​​corresponding to the three colors are extracted as their corresponding representative pixels and entered into pixel predictive coding; if the sub-unit has four colors, then inter-frame discrimination is performed directly.

[0060] The inter-frame discrimination is as follows: if the pixel vector of the current sub-unit is exactly the same as the reference pixel vector, the pixel vector of the current sub-unit is written into the data statistics; if the pixel vector of the sub-unit is not exactly the same as the reference pixel vector, the difference vector between the pixel vector of the current sub-unit and the reference pixel vector is calculated, and it is determined whether the difference vector is exactly the same. If they are the same, the pixel value of any adjacent sub-unit of the current sub-unit is taken as the representative pixel; otherwise, the pixel vector of the current sub-unit is taken as the representative pixel.

[0061] like Figure 11 As shown, if a sub-unit has only one color, then the pixel value of that color is extracted as the representative pixel and entered into pixel predictive coding.

[0062] like Figure 12 As shown, if the sub-unit has two colors, the pixel values ​​corresponding to the two colors are extracted as their representative pixels and entered into pixel prediction coding.

[0063] like Figure 13 As shown, if there are three colors in the sub-unit, the pixel values ​​corresponding to the three colors are extracted as their representative pixels and entered into pixel prediction coding.

[0064] like Figure 14 As shown, if there are four colors for the sub-unit, then proceed directly to inter-frame discrimination.

[0065] For example, if the pixel vector of a 2×2 sub-unit to be processed in the current frame (called the current sub-unit) is (13, 14, 15, 16), a reference pixel vector is found in the reference frame. If the reference pixel vector is (13, 14, 15, 16), then (13, 14, 15, 16) is written into the data statistics; if the reference pixel vector is (10, 11, 12, 13), then the difference (3, 3, 3, 3) is calculated. If the differences are exactly the same, then the pixel value (5, 6, 7, 8) of any adjacent sub-unit of the current sub-unit is used as the representative pixel; if the reference pixel vector is (10, 10, 11, 13), then the difference (3, 4, 4, 3) is calculated. If the differences are not exactly the same, then the pixel vector of the current sub-unit (13, 14, 15, 16) is used as the representative pixel.

[0066] The specific steps of pixel predictive coding are as follows: Let The pixel intensity function is represented by row and column indices; for any processed sub-block, its representative pixel is taken as the local base point of that sub-block, and the coordinates of the local base point are denoted as... And the pixel value at that base point is recorded as Meanwhile, define relative neighborhood sample values: coordinates Pixel value, coordinates Pixel value, coordinates Pixel value, coordinates Pixel value.

[0067] Input pixel value If it exists Make Then mark the base point as a neighborhood equivalence and output the corresponding neighborhood identifier. and equal measurement And write it into the data statistics.

[0068] If it does not exist, proceed to the prediction and residual analysis sub-process: Define three types of prediction operators: based on three-point average Alternative three-point average Difference-moving average composite prediction The formula is as follows: , , , in, This is the rounding function. , , , , , , , , .

[0069] The prediction operator can be viewed as generating a set of candidate values. ,in, For pixels calculated based on candidate operators The predicted value.

[0070] Select applicable members from the following set of candidate operators and calculate the corresponding prediction errors. , : like : No predictive operator, directly As the corresponding difference Entering the data processing stage; like :and The comparison is performed; if they are different, the prediction error is calculated to obtain the corresponding difference. Entering the data processing stage; like :and The comparison is performed; if they are different, the prediction error is calculated to obtain the corresponding difference. Entering the data processing stage; like and and Then prioritize matching the pixel value of the base point with... Compare the results; if they are the same, add them to the data statistics; if they are different, compare them again. If they are the same, they will be entered into the data statistics; otherwise, they will be... Substituting the values ​​into the prediction error formula, we can calculate the prediction error and obtain the corresponding difference. It then enters the data processing stage; like and and Comparison only If they are the same, they will be entered into the data statistics; otherwise, they will be... Substitute the values ​​into the prediction error formula to calculate the prediction error and obtain the difference. It then enters the data processing stage; like and and Then prioritize comparison. If they are the same, they are entered into the data statistics; if they are different, they are compared. If they are the same, they will be entered into the data statistics; otherwise, they will be... Substituting the values ​​into the prediction error formula, we can calculate the prediction error and obtain the corresponding difference. It then enters the data processing stage; like and and Then prioritize comparison. If they are the same, they are entered into the data statistics; if they are different, they are compared. If they are the same, they are entered into the data statistics; if they are different, they are compared. If they are the same, they will be entered into the data statistics; otherwise, they will be... Substituting the values ​​into the prediction error formula, we can calculate the prediction error and obtain the corresponding difference. It then enters the data processing stage; Specifically, the data processing flow is as follows: A candidate residual set is constructed, and format discrimination and residual coding rules are applied. The calculated prediction error is then used to construct the candidate residual set. Define the set of pattern categories. For candidate residual sets Pattern matching is performed on the corresponding differences in the data, and the results are written into the data statistics. like If they are completely identical, they are determined to be identical and recorded as... ; like If the first two values ​​are the same, then it is determined that they are recorded as follows: ; like If the first and last values ​​are the same, then it is determined that the first and last values ​​are the same, and recorded as follows. ; like If the last two values ​​are consistent, then it is determined that they are recorded as follows: ; like If the first digit is smaller and the last two digits are larger and equal, then it is recorded as follows: ; like If the first and last digits are smaller and equal, then it is recorded as follows: ; like If the last digit is larger, it is determined to be recorded as follows: ; like If they are not equal, then they are determined to have no special equivalence and are recorded as follows: .

[0071] For example, taking a 5×5 sub-block as an example, its pixel values ​​are shown in Table 1: Table 1 Set base point = (1, 1), pixel value =(106, 56, 26), neighborhood value sampling =(105, 55, 25), =(101, 51, 21), =(100, 50, 20), =(102, 52, 22).

[0072] calculate : =(1, 1, 1), =(5, 5, 5), =(6, 6, 6), =(4, 4, 4), does not exist. .

[0073] The base point (1,1) belongs to and and ,calculate =(102, 52, 22), and Not equal, calculation =(103, 53, 23), and If they are not equivalent, calculate the corresponding prediction error. =(4,4,4), =(3,3,3) respectively yields =(4,4,4) The expression (=3,3,3) enters the data processing stage. It is ultimately determined to be a perfect match, and one of the records is selected as the final record. .

[0074] Step S03: Perform entropy encoding on the statistical data and output a lossless compressed bitstream.

[0075] Based on the same inventive concept, this invention also proposes a lossless compression device for eliminating inter-frame redundancy based on block partitioning and probability matching. The implementation of this device can be found in the implementation of the method described above; repeated details will not be elaborated further. Figure 15 As shown, the device 100 includes: Sub-block classification module 101: used to divide the current frame into several sub-blocks, and classify each sub-block by calculating the similarity between the current block and the matching block; Differential encoding module 102: used to perform the matching encoding operation on each classified sub-block through a differential processing strategy to generate compressed data; Entropy coding module 103: used to entropy code compressed data and output lossless compressed bitstream.

[0076] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0077] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.

[0078] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A lossless compression method for eliminating inter-frame redundancy based on block partitioning and probability matching, characterized in that, The method includes: Step S01: Divide the current frame into several sub-blocks, and classify each sub-block by calculating the similarity between the current block and the matching block. The categories include: NHB, SCB, FMDB, CDB, HSDB, LSDB, and EPB. If the current sub-block is completely identical to its neighboring sub-blocks in color identification, then it is classified as NHB; If the current sub-block contains only a single color or color mark, it is classified as SCB; If the best reference sub-unit that is exactly the same as the pixel of the current sub-block is found in the reference frame, it is classified as FMDB; If the best reference sub-unit is found in the reference frame with only a constant pixel difference between the pixels of the current sub-block and the reference sub-unit, it is classified as CDB; If the current sub-block does not belong to NHB, SCB, FMDB, or CDB, then the best reference sub-unit in the reference frame and the current sub-block are both divided into 2×2 sub-units: If the percentage of 2×2 sub-units in the current sub-block that have the exact same pixel value as the 2×2 sub-units in the reference frame is ∈ [50, 100), then it is classified as HSDB. If the percentage of 2×2 sub-units in the current sub-block that have the same pixel value as the corresponding 2×2 sub-units in the reference frame is ∈ [25, 50), then it is classified as LSDB. If the percentage of 2×2 sub-units in the current sub-block having the same pixel value as the corresponding 2×2 sub-units in the reference frame is ∈ [0, 25), then it is classified as EPB; Step S02: Perform matching encoding operations on each classified sub-block using a differentiation processing strategy to generate compressed data; specifically: If the sub-block is NHB, then the category information of the sub-block is written into the data statistics; If the sub-block is an FMDB, then obtain its best reference sub-unit displacement vector in the reference frame and write it into the data statistics; If the sub-block is an SCB, then extract the pixel value of any position where the sub-block is connected to other blocks, and use it as the representative pixel of the sub-block, and then perform pixel predictive coding. If the sub-block is a CDB, the best reference sub-unit displacement vector is obtained and written into the data statistics. The pixel value of any position where the sub-block is connected to other blocks is extracted as the representative pixel of the sub-block, and then pixel prediction coding is performed. If the sub-block is an EPB, then pixel prediction encoding is performed after a four-grid fine discrimination process. If the sub-block is HSDB, the best reference sub-unit displacement vector and the tag index of different 2×2 sub-units are obtained and written into the data statistics. The different 2×2 sub-units are then entered into the four-grid fine discrimination process for pixel prediction encoding. If the sub-block is an LSDB, the best reference sub-unit displacement vector and the label index of the same 2×2 sub-units are obtained and written into the data statistics. Different 2×2 sub-units are entered into the four-grid fine discrimination process for pixel prediction encoding. Step S03: Entropy encoding is performed on the compressed data to output a lossless compressed bitstream.

2. The lossless compression method for eliminating inter-frame redundancy based on block segmentation and probability matching according to claim 1, characterized in that, The optimal reference sub-unit displacement vector is: the sub-block displacement of the current frame. The pixel obtains the optimal reference subunit. That is, the displacement vector of the optimal reference sub-element, where, , The best reference sub-unit is the sub-block in the reference frame that has the highest percentage of pixels that are the same as the current sub-block.

3. The lossless compression method for eliminating inter-frame redundancy based on block division and probability matching according to claim 1, characterized in that, The steps of the aforementioned four-grid fine discrimination process are as follows: Within each sub-block, identify non-uniform 2×2 sub-units, i.e., units with four distinct pixels; let frame B be the current frame and frame A be the reference frame; pixels are represented by row and column coordinates. express; For the 2×2 sub-unit to be processed, define the pixel vector: , in, Top-left Top-right Bottom left Bottom right; Define reference pixel vector The sub-unit marked in frame A with the same position as that in frame B is the reference pixel vector; First, intra-frame discrimination is performed on the sub-units: if the sub-unit has only one color, then one color is extracted as the representative pixel and entered into pixel predictive coding; if the sub-unit has two colors, then the pixel values ​​corresponding to the two colors are extracted as their corresponding representative pixels and entered into pixel predictive coding; if the sub-unit has three colors, then the pixel values ​​corresponding to the three colors are extracted as their corresponding representative pixels and entered into pixel predictive coding; if the sub-unit has four colors, then inter-frame discrimination is performed directly. The inter-frame discrimination is as follows: if the pixel vector of the current sub-unit is exactly the same as the reference pixel vector, the pixel vector of the current sub-unit is written into the data statistics; if the pixel vector of the sub-unit is not exactly the same as the reference pixel vector, the difference vector between the pixel vector of the current sub-unit and the reference pixel vector is calculated, and it is determined whether the difference vector is exactly the same. If they are the same, the pixel value of any adjacent sub-unit of the current sub-unit is taken as the representative pixel; otherwise, the pixel vector of the current sub-unit is taken as the representative pixel.

4. The lossless compression method for eliminating inter-frame redundancy based on block segmentation and probability matching according to claim 1, characterized in that, The specific steps of the pixel prediction encoding are as follows: taking the sub-block representative pixel as the local base point, check whether there is a neighborhood equivalence relationship between it and its four adjacent pixels. If there is, it is directly labeled and counted; if not, according to the different cases of the base point coordinates (Y,X), an appropriate operator is selected from the three-point average, the alternative three-point average, and the differential-moving average composite prediction for prediction. The predicted value is compared with the actual pixel value. If a match is found, it is written into the statistics; otherwise, the prediction error is calculated. Finally, the difference or equivalent information is sent to the data processing stage.

5. The lossless compression method for eliminating inter-frame redundancy based on block segmentation and probability matching according to claim 4, characterized in that, The data processing stage involves: calculating the prediction error... Construct a candidate residual set Define a set of pattern categories. For candidate residual sets Pattern matching is performed on the corresponding differences in the data, and the results are written into the data statistics. like If they are completely identical, they are determined to be identical and recorded as... ; like If the first two values ​​are the same, then it is determined that they are recorded as follows: ; like If the first and last values ​​are the same, then it is determined that the first and last values ​​are the same, and recorded as follows. ; like If the last two values ​​are consistent, then it is determined that they are recorded as follows: ; like If the first digit is smaller and the last two digits are larger and equal, then it is recorded as follows: ; like If the first and last digits are smaller and equal, then it is recorded as follows: ; like If the last digit is larger, it is determined to be recorded as follows: ; like If they are not equal, then they are determined to have no special equivalence and are recorded as follows: .

6. A lossless compression device for eliminating inter-frame redundancy based on block partitioning and probability matching, characterized in that, The device implements the method as described in any one of claims 1 to 5, comprising: Sub-block classification module: used to divide the current frame into several sub-blocks, and classify each sub-block by calculating the similarity between the current block and the matching block; If the current sub-block is completely identical to its neighboring sub-blocks in color identification, then it is classified as NHB; If the current sub-block contains only a single color or color mark, it is classified as SCB; If the best reference sub-unit that is exactly the same as the pixel of the current sub-block is found in the reference frame, it is classified as FMDB; If the best reference sub-unit is found in the reference frame with only a constant pixel difference between the pixels of the current sub-block and the reference sub-unit, it is classified as CDB; If the current sub-block does not belong to NHB, SCB, FMDB, or CDB, then the best reference sub-unit in the reference frame and the current sub-block are both divided into 2×2 sub-units: If the percentage of 2×2 sub-units in the current sub-block that have the exact same pixel value as the 2×2 sub-units in the reference frame is ∈ [50, 100), then it is classified as HSDB. If the percentage of 2×2 sub-units in the current sub-block that have the same pixel value as the corresponding 2×2 sub-units in the reference frame is ∈ [25, 50), then it is classified as LSDB. If the percentage of 2×2 sub-units in the current sub-block having the same pixel value as the corresponding 2×2 sub-units in the reference frame is ∈ [0, 25), then it is classified as EPB; Differential encoding module: Used to perform matching encoding operations on each classified sub-block through a differential processing strategy to generate compressed data; Specifically: If the sub-block is NHB, then the category information of the sub-block is written into the data statistics; If the sub-block is an FMDB, then obtain its best reference sub-unit displacement vector in the reference frame and write it into the data statistics; If the sub-block is an SCB, then extract the pixel value of any position where the sub-block is connected to other blocks, and use it as the representative pixel of the sub-block, and then perform pixel predictive coding. If the sub-block is a CDB, the best reference sub-unit displacement vector is obtained and written into the data statistics. The pixel value of any position where the sub-block is connected to other blocks is extracted as the representative pixel of the sub-block, and then pixel prediction coding is performed. If the sub-block is an EPB, then pixel prediction encoding is performed after a four-grid fine discrimination process. If the sub-block is HSDB, the best reference sub-unit displacement vector and the tag index of different 2×2 sub-units are obtained and written into the data statistics. The different 2×2 sub-units are then entered into the four-grid fine discrimination process for pixel prediction encoding. If the sub-block is an LSDB, the best reference sub-unit displacement vector and the label index of the same 2×2 sub-units are obtained and written into the data statistics. Different 2×2 sub-units are entered into the four-grid fine discrimination process for pixel prediction encoding. Entropy encoding module: Used to entropy encode compressed data and output lossless compressed bitstream.

Citation Information

Patent Citations

  • Image compression method using fine division block matching

    CN104754362A

  • Image encoding method, image decoding method, related device and storage medium

    CN110545432A

  • Digital video coding with interpolation filters and offsets

    WO2010039288A1