A hybrid image lossless coding method and system based on frame-level rearrangement

By combining frame-level rearrangement and lossless coding methods with a three-level decision mechanism based on hand-designed and learned features, the problem of feature difference adaptation in mixed images sub-blocks was solved, improving coding efficiency and image integrity, and achieving lossless encoding and decoding of ultra-high-definition mixed images.

CN121309828BActive Publication Date: 2026-07-24SHAOXING UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHAOXING UNIVERSITY
Filing Date
2025-12-10
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies lack sub-block classification algorithms for efficient coding, making it difficult to accurately adapt to the feature differences of sub-blocks in mixed images. Furthermore, the absence of frame-level reordering technology means that traditional coding techniques cannot meet the coding efficiency requirements of ultra-high-definition mixed images.

Method used

A hybrid image lossless encoding and decoding method based on frame-level rearrangement is adopted. The image sub-blocks are classified through a three-level decision mechanism with manually designed and learned features, and then frame-level rearrangement and lossless encoding are performed to generate a bitstream containing frame-level rearrangement information.

Benefits of technology

It improves the accuracy of image sub-block classification, significantly enhances coding efficiency, and ensures that the decoded image is completely consistent with the original image in terms of structure and content, meeting the coding requirements of ultra-high-definition hybrid images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121309828B_ABST
    Figure CN121309828B_ABST
Patent Text Reader

Abstract

The application provides a hybrid image lossless coding and decoding method and system based on frame-level rearrangement, relates to the technical field of image processing, and the coding method comprises the following steps: acquiring a hybrid image; performing block preprocessing on the hybrid image to obtain a plurality of subblocks; classifying the plurality of subblocks based on manually designed features and learning features to determine a classification result; performing frame-level rearrangement on the hybrid image according to the classification result to obtain a rearranged image; and performing lossless encoding on the rearranged image through a lossless encoding algorithm to generate a code stream containing frame-level rearrangement information. The hybrid image lossless decoding is realized, the super-high-definition hybrid image coding efficiency is effectively improved, the complexity is increased little, the open-source encoder is compatible, and the practical application is easy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a lossless encoding and decoding method and system for hybrid images based on frame-level rearrangement. Background Technology

[0002] Ultra-high-definition hybrid images are characterized by ultra-high resolution and rich hybrid features, resulting in a surge in data volume. Traditional coding techniques are struggling to cope with this, highlighting the problem of low coding efficiency. New solutions are needed to overcome these bottlenecks.

[0003] Current research on hybrid content coding began with static composite image coding, and falls into two categories: hierarchical partitioning techniques (such as MRC dividing images into foreground / background / masking layers, and text recognition dividing them into text / background layers); and sub-block partitioning techniques (classifying and encoding sub-blocks based on manually designed features, learned features, or fused features). Internationally and domestically, there are mainstream coding standards such as VVC and AVS3, as well as coding tools such as IBC and ISC. Some research improves efficiency through rearrangement of coding units.

[0004] However, existing technologies lack sub-block classification algorithms for efficient coding, making it difficult to accurately adapt to the feature differences of sub-blocks in mixed images. In addition, since there is no frame-level reordering technology, and the only existing coding unit reordering technology has limited optimization for spatial redundancy of ultra-high-definition mixed images, traditional coding technologies as a whole are unable to match the new features of ultra-high-definition mixed images, and the coding efficiency cannot meet the requirements. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a lossless encoding and decoding method and system for hybrid images based on frame-level rearrangement. This addresses the lack of efficient sub-block classification algorithms in existing technologies, which makes it difficult to accurately adapt to the feature differences of hybrid image sub-blocks. Furthermore, the absence of frame-level rearrangement technology, coupled with the limited optimization of spatial redundancy in existing coding unit rearrangement techniques for ultra-high-definition hybrid images, makes it difficult for traditional coding techniques to match the new features of ultra-high-definition hybrid images, resulting in insufficient coding efficiency.

[0006] A first aspect of this invention proposes a lossless coding method for hybrid images based on frame-level rearrangement, comprising: S1: Obtain the blended image.

[0007] S2: Perform block preprocessing on the mixed image to obtain multiple sub-blocks.

[0008] S3: Based on manual design, classify multiple sub-blocks and determine the pre-classification results of the manual design.

[0009] S4: Based on the learned features, classify multiple sub-blocks and determine the pre-classification results.

[0010] S5: A three-level decision-making mechanism based on confidence levels determines the classification result based on the results of manual pre-classification and the results of learned pre-classification.

[0011] S6: Based on the classification results, perform frame-level rearrangement on the mixed images to obtain rearranged images.

[0012] S7: The rearranged image is losslessly encoded using a lossless coding algorithm to generate a bitstream containing frame-level rearrangement information.

[0013] A second aspect of this invention proposes a lossless decoding method for hybrid images based on frame-level rearrangement, comprising: S11: Obtain the bitstream containing frame-level rearrangement information.

[0014] S12: Perform lossless decoding on the bitstream containing frame-level rearrangement information.

[0015] S13: Perform frame-level rearrangement on the decoded image to obtain the final decoded image.

[0016] A third aspect of this invention provides a hybrid image lossless encoding and decoding system based on frame-level rearrangement, comprising: a processor and a memory.

[0017] The memory stores programs or instructions that can run on the processor, and when the program or instructions are executed by the processor, they implement the steps of the lossless hybrid image encoding method based on frame-level rearrangement of the first aspect or the lossless hybrid image decoding method based on frame-level rearrangement of the second aspect.

[0018] A fourth aspect of the present invention provides a readable storage medium storing a program or instructions, which, when executed by a processor, implement the steps of the lossless hybrid image encoding method based on frame-level rearrangement of the first aspect or the lossless hybrid image decoding method based on frame-level rearrangement of the second aspect.

[0019] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: (1) In this embodiment of the invention, the present invention proposes an image sub-block classification algorithm that integrates hand-designed and learned features for efficient coding. Through a three-level decision mechanism based on confidence, it judges whether the pre-classification results are consistent, which can improve the classification accuracy and accurately adapt to the feature differences of mixed image sub-blocks. In addition, the lossless image coding algorithm based on frame-level rearrangement encodes similar sub-blocks in a concentrated manner according to the sub-block classification results, which significantly improves the spatial redundancy of adjacent coding units and can accurately match the new features of ultra-high-definition mixed images, effectively improving coding efficiency.

[0020] (2) In this embodiment of the invention, the decoded image is rearranged at the frame level, which can accurately restore the blocks to the spatial position of the original image based on the rearrangement information in the bitstream, eliminate the structural changes caused by the rearrangement during encoding, ensure that the final decoded image is completely consistent with the original ultra-high-definition mixed image in terms of structure and content, ensure the integrity and usability of the image, and provide accurate original data for subsequent applications. Attached Figure Description

[0021] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0022] Figure 1 This is a flowchart illustrating a lossless encoding method for hybrid images based on frame-level rearrangement provided in an embodiment of the present invention.

[0023] Figure 2 This is a flowchart illustrating a lossless decoding method for hybrid images based on frame-level rearrangement provided in an embodiment of the present invention.

[0024] Figure 3 This is a schematic diagram of the structure of a hybrid image lossless encoding and decoding system based on frame-level rearrangement provided in an embodiment of the present invention. Detailed Implementation

[0025] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions 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, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0026] The lossless image coding method based on frame-level rearrangement provided by the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0027] Reference manual attached Figure 1 The diagram illustrates a flowchart of a lossless image coding method based on frame-level rearrangement provided by an embodiment of the present invention.

[0028] This invention provides a lossless encoding method for hybrid images based on frame-level rearrangement, which may include the following steps: S1: Obtain the blended image.

[0029] S2: Perform block preprocessing on the mixed image to obtain multiple sub-blocks.

[0030] Block preprocessing refers to dividing the original image into sub-blocks with a width and height of M×N pixels.

[0031] Furthermore, if the size of the sub-block is less than M×N, then the sub-block is filled.

[0032] In this embodiment of the invention, the mixed image is preprocessed by segmentation, which decomposes the ultra-high-definition large-size image into sub-blocks with uniform pixels. This reduces the complexity of subsequent sub-block feature extraction and classification, and provides standardized units for accurate identification and centralized arrangement of similar sub-blocks, ensuring the efficiency and consistency of subsequent processing. This is the basis for achieving frame-level rearrangement and coding optimization.

[0033] S3: Based on manually designed features and learned features, classify multiple sub-blocks to determine the final classification result.

[0034] In one possible implementation, S3 specifically includes sub-steps S301 to S303: S301: Based on manual design, classify multiple sub-blocks and determine the pre-classification results of manual design.

[0035] Among them, manual design refers to the traditional method of classifying image sub-blocks based on manually preset feature dimensions and regularized calculation logic. The core is to achieve sub-block category division through interpretable physical features and threshold determination, without relying on data training.

[0036] In one possible implementation, S301 specifically includes sub-steps S3011 to S3016: S3011: Divide each sub-block into multiple micro-blocks.

[0037] It should be noted that dividing sub-blocks into multiple micro-blocks can capture local image features in smaller units, avoiding information ambiguity caused by the mixing of different features in large-sized sub-blocks. This provides more accurate micro-based basis for subsequent operations such as hash value calculation and hash hit count statistics, significantly improving the detail and accuracy of manually designed feature classification, and laying a reliable foundation for sub-block category determination.

[0038] S3012: Calculate the hash value of each microblock.

[0039] Among them, hash value refers to the comprehensive value obtained by quantifying and integrating the multi-dimensional visual and structural features of micro-blocks through a specific formula. It is used to accurately characterize the feature differences of micro-blocks and is the core quantitative indicator for manually designed feature classification.

[0040] Furthermore, the specific formula for calculating the hash value of a micro-block is as follows: Among them, H HachValue The hash value of a microblock, e evermess T represents the uniformity of the micro-pieces. TTcolor g represents the number of different brightness values ​​of the micro-particles. gradXsp s represents the corresponding vertical gradient of the micro-block. gradTsp Represents luminance Y and chromaticity C b C r The horizontal gradient exceeding the threshold α, a angDC This represents the average value of the brightness Y.

[0041] It should be noted that when calculating the hash value of a micro-block, multiple dimensions of features such as uniformity, number of different brightness values, gradient, and average brightness are integrated to quantify the visual and structural information of the micro-block into a unified value. This not only fully preserves the key features that distinguish micro-blocks in natural and computer images, but also achieves a concise representation of the features. This provides an accurate and comparable basis for subsequent hash hit statistics and sub-block classification, significantly improving the accuracy and stability of manually designed feature classification.

[0042] S3013: Count the total number of occurrences of hash values ​​in microblocks to determine the hash hit count.

[0043] It should be noted that counting the total occurrences of hash values ​​within micro-blocks to determine the hash hit count accurately quantifies the repetitive patterns of pixels within a micro-block. Furthermore, this statistical process is based on objective data calculations, free from subjective human bias. This provides accurate and verifiable micro-level data support for subsequent threshold comparison-based determination of micro-block categories, ensuring the objectivity and reliability of manually designed feature classification.

[0044] S3014: Determine if the hash hit count is less than the preset number. If yes, classify the micro-block as a natural image micro-block. Otherwise, classify the micro-block as a computer image micro-block.

[0045] It should be noted that those skilled in the art can set the number of preset judgments according to actual needs, and this invention does not limit this.

[0046] It should be noted that classifying micro-blocks by comparing the number of hash hits with a preset threshold can accurately match the essential differences in characteristics between natural micro-blocks (low hash hit count) and computer-generated micro-blocks (high hash hit count). The judgment logic is simple and intuitive, with low computational cost. Furthermore, the judgment standard based on a fixed threshold is uniform and free from subjective bias. This provides a precise and consistent micro-classification basis for subsequent statistical analysis of the proportion of micro-blocks within sub-blocks and output of manually designed pre-classification results, effectively ensuring the efficiency and accuracy of manually designed feature classification.

[0047] S3015: The number of natural image micro-blocks in the statistical sub-block.

[0048] S3016: Determine whether the proportion of the number of natural image micro-blocks in the sub-block relative to the total number of all micro-blocks is greater than or equal to a preset proportion. If yes, determine the manually designed pre-classification result as a natural image or a generative image. Otherwise, determine the manually designed pre-classification result as a computer image.

[0049] It should be noted that those skilled in the art can set the size of the preset ratio according to actual needs, and this invention does not limit this.

[0050] It should be noted that the sub-block category is determined by comparing the proportion of natural image micro-blocks within the sub-block with the preset proportion. The fixed proportion standard is uniform and free from subjective bias. It not only matches the feature differences between natural or generative sub-blocks and computer sub-blocks, but also provides an accurate and reliable manual design pre-classification basis for the subsequent three-level decision-making that integrates with the learning pre-classification results, effectively ensuring the overall accuracy of sub-block classification.

[0051] In this embodiment of the invention, a hierarchical process of "micro-block decomposition - feature quantification - statistical judgment - sub-block integration" is adopted to integrate multi-dimensional manual features and accurately capture the essential differences between natural and computer images. Determining the sub-block category based on proportion can dilute the impact of misclassification of single micro-blocks. The rules are clear, computationally efficient, and standardized, providing reliable manual pre-classification results for subsequent classification fusion and ensuring the accuracy and robustness of the overall classification.

[0052] S302: Based on the learned features, classify multiple sub-blocks and determine the pre-classification results.

[0053] Among them, the learning features are deep features automatically learned from sub-block images by deep learning models (such as CNN convolutional neural networks). These features do not require manual pre-setting of rules, but are autonomously extracted by the model from a large amount of labeled training data, and can capture complex, implicit pattern differences in images.

[0054] In one possible implementation, S302 specifically includes sub-steps S3021 and S3022: S3021: Calculate the computer image confidence score and natural image confidence score of sub-blocks using a CNN convolutional neural network model.

[0055] Among them, the CNN convolutional neural network model refers to a deep learning model specifically designed to extract deep features of image sub-blocks and output classification confidence scores. It is the core tool for achieving "learned feature" classification.

[0056] Specifically, this model uses an end-to-end neural network (NN-E2E) encoding framework combined with the PyTorch deep learning framework, consisting of 5 neural network layers: convolutional layers, pooling layers, and fully connected layers. The final output is two-dimensional features, which are converted into confidence scores in the interval (0, 1) using the sigmoid activation function, thus obtaining the computer image confidence score G. C confidence level G of natural images M .

[0057] It should be noted that by using a CNN convolutional neural network model to calculate the two-class confidence scores of sub-blocks, the deep and complex features of the sub-blocks can be automatically learned, overcoming the limitations of manually designed features. The output quantified confidence scores provide accurate numerical basis for subsequent classification decisions, effectively improving the classification adaptability and discrimination accuracy of mixed image sub-blocks.

[0058] S3022: Determine if the confidence score of the computer image is greater than that of the natural image. If so, determine that the pre-classification result is the computer image and output the computer image confidence score as the classification confidence score. Otherwise, learn the pre-classification result as the natural image and output the natural image confidence score as the classification confidence score.

[0059] It should be noted that directly determining the sub-block category by comparing the confidence scores of computer images and natural images is logically intuitive and free from subjective bias. The output classification confidence score provides a quantitative basis for subsequent three-level decision-making, facilitating the evaluation of classification reliability and effectively improving the accuracy and practicality of pre-classification learning.

[0060] In this embodiment of the invention, CNN is used to automatically learn the deep and complex features of sub-blocks, and the category is accurately determined by confidence comparison. The output classification confidence quantifies the reliability of the result, which not only breaks through the limitations of manually designed features, but also provides clear numerical basis for subsequent three-level decision-making, effectively improving the adaptability and accuracy of classification of mixed image sub-blocks.

[0061] S303: A three-level decision-making mechanism based on confidence, which determines the classification result based on the results of manual pre-classification and the results of learned pre-classification.

[0062] The three-level decision-making mechanism refers to a logical system that dynamically integrates the two types of results in three levels to determine the final classification of the sub-block, based on the consistency between the manually designed pre-classification results and the learned pre-classification results, combined with the classification confidence of the learned features. The core is to improve the classification accuracy by combining the advantages of the two features through hierarchical judgment.

[0063] In one possible implementation, S303 specifically includes sub-steps S3031 to S3033: S3031: When the results of manual pre-classification and the results of learning pre-classification are the same, the result of manual pre-classification or the result of learning pre-classification shall be used as the classification result.

[0064] It should be noted that when the results of manual design and pre-classification are consistent, the result is directly adopted. This not only greatly reduces the probability of misclassification due to the consensus reached between the two types of features, but also saves the extra decision-making calculation step, improving efficiency. This provides a stable and reliable initial category basis for subsequent frame-level re-sorting, effectively ensuring the accuracy and smoothness of the overall encoding process.

[0065] S3032: When the manually designed pre-classification result is a natural image or a generative image, and the learned pre-classification result is a computer image, calculate the fusion confidence based on the classification confidence, and determine the classification result based on the fusion confidence.

[0066] In one possible implementation, S3032 specifically includes sub-steps S30321 to S30324: S30321: When the classification confidence is lower than the first preset confidence value, calculate the fusion confidence: Among them, G r denoted by fusion confidence, and G represents classification confidence.

[0067] It should be noted that those skilled in the art can set the magnitude of the first preset confidence level according to actual needs, and this invention does not limit this.

[0068] It should be noted that when the classification confidence is lower than the first preset confidence value, the stability of the manually designed features is incorporated with a high weight (0.8) by fusing the confidence formula (0.8 + 0.2 × G), while retaining the effective information of the learned features (0.2 × G). This achieves the complementary advantages of the two types of features, avoids the risk of misjudgment under low confidence of the learned features, improves the reliability of the confidence, and provides a more reasonable quantitative basis for subsequent classification decisions.

[0069] Furthermore, the values ​​of 0.8 and 0.2 are set based on the confidence levels obtained from the learned features and the differences in classification between the handcrafted features and the learned features. The basis for setting these values ​​in this invention is to maximize the advantages of either the handcrafted features or the learned features.

[0070] S30322: Determine whether the fusion confidence score is greater than or equal to the second preset confidence score. If yes, use the manually designed pre-classification result as the classification result. Otherwise, use the learned pre-classification result as the classification result.

[0071] It should be noted that those skilled in the art can set the value of the second preset confidence level according to actual needs, and this invention does not limit this.

[0072] It should be noted that by making decisions by comparing the fusion confidence score with the second pre-set confidence score, the stability of hand-designed features and the effective information of learned features are integrated with the fusion confidence score. At the same time, more reliable classification results are selected dynamically through thresholds, avoiding misjudgments under low confidence of a single feature. This significantly improves the accuracy and robustness of the final classification and provides a reliable basis for frame-level re-ranking.

[0073] S30323: When the classification confidence score is higher than the first preset confidence score, calculate the fusion confidence score: It should be noted that those skilled in the art can set the magnitude of the first preset confidence level according to actual needs, and this invention does not limit this.

[0074] It should be noted that when the classification confidence is higher than the first preset confidence value, the high weight (0.8) is assigned to the high reliability of the learned feature confidence by the formula for fusing confidence, while the auxiliary weight (0.2) of the hand-designed feature is retained. This highlights the advantage of the learned feature in capturing complex features in high-confidence scenarios, and also supplements the stability by hand-designed features, so as to achieve accurate fusion of the two types of features, provide a more scenario-appropriate quantitative basis for subsequent classification decisions, and improve the rationality and accuracy of the final classification.

[0075] S30324: Determine whether the fusion confidence score is greater than or equal to the second preset confidence score. If yes, use the learned pre-classification result as the classification result. Otherwise, use the manually designed pre-classification result as the classification result.

[0076] It should be noted that those skilled in the art can set the value of the second preset confidence level according to actual needs, and this invention does not limit this.

[0077] It should be noted that by combining the confidence score (high-weighted learning features) with the second pre-set confidence score for comparison and decision-making, the advantages of learning features in capturing complex features are highlighted, while manual features are used to assist in verification, and more reliable results are dynamically selected. This effectively reduces misjudgments in high-confidence scenarios and significantly improves the accuracy and scenario adaptability of the final classification.

[0078] In this embodiment of the invention, for scenarios where the results of manual classification and learning pre-classification are inconsistent, the fusion confidence is first calculated with different weights according to the confidence level of the learning classification. Then, the final result is selected by judging the second pre-set confidence value. This not only achieves the complementary advantages of the two types of features, but also dynamically adapts to different confidence scenarios, effectively avoids the risk of misjudgment by a single feature, significantly improves the accuracy and scenario adaptability of the final classification, and provides a reliable category basis for frame-level re-ranking.

[0079] S3033: When the manually designed pre-classification result is a computer image, and the learned pre-classification result is a natural image or a generative image, calculate the fusion confidence based on the classification confidence, and determine the classification result based on the fusion confidence.

[0080] In one possible implementation, S3033 specifically includes sub-steps S30331 and S30332: S30331: Calculate the fusion confidence based on the classification confidence: Among them, G r denoted by fusion confidence, and G represents classification confidence.

[0081] S30332: Determine whether the fusion confidence score is greater than or equal to the second preset confidence score. If yes, use the learned pre-classification result as the classification result. Otherwise, use the manually designed pre-classification result as the classification result.

[0082] It should be noted that those skilled in the art can set the value of the second preset confidence level according to actual needs, and this invention does not limit this.

[0083] In this embodiment of the invention, for conflict scenarios where manually pre-classified images are computer images and learned pre-classified images are natural or generative images, the stability of manual features is preserved by using a high weight (0.8), and the confidence of the fusion is calculated by incorporating the learned feature information with a low weight (0.2×G). Then, the second pre-set confidence is used to judge and select the best. This not only adapts to specific conflict scenarios, but also achieves complementary advantages of the two types of features, effectively reducing misjudgments in such scenarios and improving the accuracy and reliability of the final classification.

[0084] S4: Based on the classification results, perform frame-level rearrangement on the mixed images to obtain rearranged images.

[0085] Frame-level rearrangement refers to the operation of spatially rearranging each sub-block in the frame structure of a mixed image based on the classification results of the sub-blocks (computer image sub-blocks, natural or generative image sub-blocks).

[0086] In this embodiment of the invention, frame-level rearrangement based on accurate classification results can group similar sub-blocks together, reduce interference from different types of image features, optimize the efficiency of redundancy removal in subsequent encoding, improve the processing accuracy and encoding performance of ultra-high-definition hybrid images, and lay an efficient foundation for lossless encoding.

[0087] S5: The rearranged image is losslessly encoded using a lossless coding algorithm to generate a bitstream containing frame-level rearrangement information.

[0088] Among them, lossless coding algorithm refers to coding method that can completely preserve the original image information and recover it without distortion. It is the core technology for compressing images after frame-level rearrangement.

[0089] In one possible implementation, S5 specifically includes sub-steps S501 to S505: S501: Encode the sequence number of the image block in the rearranged image using a fixed-length code.

[0090] Fixed-length code refers to an encoding method in which each symbol to be encoded corresponds to a binary codeword of fixed length, and the codeword length remains consistent regardless of the frequency of the symbol appearing in the data.

[0091] Furthermore, encoding the original number of the sub-block using a fixed-length code requires a certain number of bits for frame-level rearrangement information: Among them, B rearrarge The value represents the number of bits, W represents the width of the blended image, H represents the height of the blended image, M represents the width of the sub-block, N represents the height of the sub-block, and log represents the logarithmic function.

[0092] It should be noted that encoding the sequence numbers of rearranged image blocks using fixed-length codes is simple and efficient due to the fixed codeword length, enabling rapid sequence identification. Furthermore, the unified rules ensure lossless transmission of sequence information, providing a reliable foundation for accurately reconstructing block positions during subsequent decoding and improving the real-time performance and stability of the overall encoding process.

[0093] S502: Write the sequence number encoding result containing frame-level rearrangement information into the sequence number stream.

[0094] It should be noted that writing the sequence number encoding result containing frame-level rearrangement information into the sequence number stream can completely preserve the key position information of the block rearrangement, ensuring that the original position of each block can be accurately restored during decoding. At the same time, the sequence number stream specifically carries this information, with a clear structure, which facilitates rapid extraction in subsequent decoding stages, effectively connecting the encoding and decoding processes, and providing key support for the complete image restoration of the entire lossless encoding process.

[0095] S503: Lossless encoding is performed on the content of image blocks in the rearranged image using a lossless encoding algorithm.

[0096] It should be noted that encoding the rearranged image blocks using a lossless encoding algorithm not only completely preserves the original pixel information of the blocks, ensuring distortion-free ultra-high-definition image quality, but also optimizes redundancy removal and improves compression efficiency because similar blocks have similar characteristics after rearrangement. Furthermore, it provides a guarantee for accurate reconstruction of the block content during subsequent decoding, thus balancing quality and processing performance.

[0097] S504: Write the content encoding result containing frame-level rearrangement information into the content bitstream.

[0098] It should be noted that writing the content encoding result containing frame-level rearrangement information into the content bitstream can completely preserve the key information related to the block content and the rearrangement, ensuring accurate correspondence between content and position during decoding. The content bitstream independently carries this information, with a clear structure, facilitating rapid extraction and processing in the decoding stage, effectively ensuring the integrity of lossless encoding and the accuracy of image restoration, and improving the overall collaborative efficiency of the encoding and decoding process.

[0099] S505: Merge the sequence number stream and the content stream to generate the final stream containing frame-level rearrangement information.

[0100] It should be noted that merging the sequence number stream and the content stream to generate the final stream integrates all frame-level rearrangement association information of the block sequence numbers and content, ensuring complete acquisition and accurate synchronization during decoding. A unified stream facilitates storage and transmission, improving the coordination of the entire encoding and decoding process and the completeness of image restoration.

[0101] In this embodiment of the invention, the block sequence number is efficiently encoded by fixed-length code and the content is encoded by lossless algorithm. The separate bitstreams clearly carry the frame-level rearrangement information of the sequence number and content, and are then merged into a unified bitstream. This not only ensures the lossless nature of the image and the integrity of the information, but also improves the encoding efficiency and the convenience of transmission and storage, providing comprehensive support for the accurate recovery of the original image during decoding.

[0102] Reference manual attached Figure 2 The diagram illustrates a flowchart of a lossless decoding method for hybrid images based on frame-level rearrangement provided by an embodiment of the present invention.

[0103] This invention provides a lossless decoding method for hybrid images based on frame-level rearrangement, which may include the following steps: S11: Obtain the bitstream containing frame-level rearrangement information.

[0104] S12: Perform lossless decoding on the bitstream containing frame-level rearrangement information.

[0105] In this embodiment of the invention, lossless decoding of a bitstream containing frame-level rearrangement information can accurately restore the block position and original content by relying on the sequence number and content association information in the bitstream. This ensures that the decoded image is completely consistent with the original ultra-high-definition hybrid image without any information loss, thus guaranteeing quality and realizing a closed loop of encoding and decoding, providing reliable original data for subsequent applications.

[0106] S13: Perform frame-level rearrangement on the decoded image to obtain the final decoded image.

[0107] In this embodiment of the invention, the decoded image is rearranged at the frame level, which can accurately restore the blocks to the spatial position of the original image based on the rearrangement information in the bitstream, eliminate the structural changes caused by the rearrangement during encoding, ensure that the final decoded image is completely consistent with the original ultra-high-definition hybrid image in terms of structure and content, guarantee the integrity and usability of the image, and provide accurate original data for subsequent applications.

[0108] Reference manual attached Figure 3 The diagram shows a structural schematic of a hybrid image lossless encoding and decoding system based on frame-level rearrangement provided by an embodiment of the present invention.

[0109] This invention provides a lossless hybrid image encoding and decoding system 20 based on frame-level rearrangement, comprising: a processor 201 and a memory 202; The memory 202 stores programs or instructions that can run on the processor 201. When the program or instructions are executed by the processor 201, they implement the steps of the above-described lossless encoding method for hybrid images based on frame-level rearrangement or lossless decoding method for hybrid images based on frame-level rearrangement, and can achieve the same technical effect. To avoid repetition, the present invention will not elaborate further.

[0110] It should be understood that the processor 201 in this embodiment of the invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0111] It should also be understood that the memory 202 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM).

[0112] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0113] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0114] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0115] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0116] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0117] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0118] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0119] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0120] This invention provides a readable storage medium comprising: storing a program or instructions on the readable storage medium, wherein when the program or instructions are executed by a processor, the program or instructions implement the steps of the above-described lossless encoding method for hybrid images based on frame-level rearrangement or lossless decoding method for hybrid images based on frame-level rearrangement, and can achieve the same technical effect. To avoid repetition, this invention will not elaborate further.

[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.

Claims

1. A lossless encoding method for hybrid images based on frame-level rearrangement, characterized in that, include: S1: Obtain the blended image; S2: Perform block preprocessing on the hybrid image to obtain multiple sub-blocks; S3: Based on manually designed features and learned features, classify the multiple sub-blocks and determine the classification results; S4: Based on the classification results, perform frame-level rearrangement on the mixed image to obtain a rearranged image; S5: The rearranged image is losslessly encoded using a lossless encoding algorithm to generate a bitstream containing frame-level rearrangement information; Specifically, S3 includes: S301: Based on the features of manual design, classify the multiple sub-blocks and determine the pre-classification result of manual design; S302: Based on the learned features, classify the multiple sub-blocks and determine the pre-classification results; S303: A three-level decision-making mechanism based on confidence level, which determines the classification result based on the manually designed pre-classification result and the learned pre-classification result; Specifically, S5 includes: S501: Encode the sequence number of the image block in the rearranged image using a fixed-length code; S502: Write the sequence number encoding result containing frame-level rearrangement information into the sequence number stream; S503: Lossless encoding is performed on the content of the image blocks in the rearranged image using a lossless encoding algorithm; S504: Write the content encoding result containing frame-level rearrangement information into the content bitstream; S505: Merge the sequence number stream and the content stream to generate the final stream containing frame-level rearrangement information; Specifically, S303 includes: S3031: When the manually designed pre-classification result and the learned pre-classification result are the same, the manually designed pre-classification result or the learned pre-classification result shall be used as the classification result; S3032: When the manually designed pre-classification result is a natural image or a generative image, and the learned pre-classification result is a computer image, calculate the fusion confidence based on the classification confidence, and determine the classification result based on the fusion confidence; S3033: When the manually designed pre-classification result is the computer image, and the learned pre-classification result is the natural image or the generative image, calculate the fusion confidence based on the classification confidence, and determine the classification result based on the fusion confidence; Specifically, S3032 includes: S30321: When the classification confidence level is lower than the first preset confidence level, calculate the fusion confidence level: ; Among them, G r G represents the fusion confidence level, and G represents the classification confidence level. S30322: Determine whether the fusion confidence score is greater than or equal to the second preset confidence score value; if yes, use the manually designed pre-classification result as the classification result; otherwise, use the learned pre-classification result as the classification result. S30323: When the classification confidence level is higher than the first preset confidence level value, calculate the fusion confidence level: ; S30324: Determine whether the fusion confidence is greater than or equal to the second preset confidence value; if so, use the learned pre-classification result as the classification result; otherwise, use the manually designed pre-classification result as the classification result.

2. The lossless image coding method based on frame-level rearrangement according to claim 1, characterized in that, S301 specifically includes: S3011: Divide each of the sub-blocks into multiple micro-blocks; S3012: Calculate the hash value of each of the micro-blocks; S3013: Count the total number of occurrences of the hash value in the micro-block to determine the hash hit count; S3014: Determine whether the hash hit count is less than a preset number; if yes, classify the micro-block as a natural image micro-block; otherwise, classify the micro-block as a computer image micro-block. S3015: Count the number of natural image micro-blocks in the sub-block; S3016: Determine whether the proportion of the number of natural image micro-blocks in the sub-block relative to the total number of all micro-blocks is greater than or equal to a preset proportion; if yes, determine that the manually designed pre-classification result is a natural image or a generative image; otherwise, determine that the manually designed pre-classification result is a computer image.

3. The lossless image coding method based on frame-level rearrangement according to claim 1, characterized in that, S302 specifically includes: S3021: Calculate the computer image confidence score and natural image confidence score of the sub-block using a CNN convolutional neural network model; S3022: Determine whether the confidence level of the computer image is greater than the confidence level of the natural image; if so, determine that the pre-classification result is a computer image and output the computer image confidence level as the classification confidence level; otherwise, the pre-classification result is a natural image and output the natural image confidence level as the classification confidence level.

4. The lossless image coding method based on frame-level rearrangement according to claim 1, characterized in that, Specifically, S3033 includes: S30331: Calculate the fusion confidence based on the classification confidence: ; Among them, G r G represents the fusion confidence level, and G represents the classification confidence level. S30332: Determine whether the fusion confidence is greater than or equal to the second preset confidence value; if so, use the learned pre-classification result as the classification result; otherwise, use the manually designed pre-classification result as the classification result.

5. A lossless decoding method for hybrid images based on frame-level rearrangement, characterized in that, include: S11: Obtain the bitstream containing frame-level rearrangement information, wherein the bitstream is specifically: the bitstream obtained by the lossless image coding method based on frame-level rearrangement as claimed in claim 1; S12: Perform lossless decoding on the bitstream containing frame-level rearrangement information; S13: Perform frame-level rearrangement on the decoded image to obtain the final decoded image.

6. A lossless image encoding and decoding system based on frame-level rearrangement, characterized in that, include: Processor and memory; The memory stores programs or instructions that can run on the processor, which, when executed by the processor, implement the steps of the lossless hybrid image encoding method based on frame-level rearrangement as described in any one of claims 1 to 4 or the lossless hybrid image decoding method based on frame-level rearrangement as described in claim 5.