CN115713567A - Picture coding method, device and equipment and computer readable storage medium - Google Patents

Picture coding method, device and equipment and computer readable storage medium Download PDF

Info

Publication number
CN115713567A
CN115713567A CN202211448084.6A CN202211448084A CN115713567A CN 115713567 A CN115713567 A CN 115713567A CN 202211448084 A CN202211448084 A CN 202211448084A CN 115713567 A CN115713567 A CN 115713567A
Authority
CN
China
Prior art keywords
data block
data
compressed
compression
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211448084.6A
Other languages
Chinese (zh)
Inventor
何民花
林剑森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Goke Microelectronics Co Ltd
Original Assignee
Hunan Goke Microelectronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Goke Microelectronics Co Ltd filed Critical Hunan Goke Microelectronics Co Ltd
Priority to CN202211448084.6A priority Critical patent/CN115713567A/en
Publication of CN115713567A publication Critical patent/CN115713567A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses a picture coding method, which relates to the technical field of coding and comprises the following steps: acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks, and determining the category of each data block; compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression; and integrating the compressed data to obtain a compressed picture. The method can reduce the storage space of the picture and improve the picture coding and decoding efficiency while ensuring the picture quality. The application also discloses a picture coding device, equipment and a computer readable storage medium, which have the technical effects.

Description

Picture coding method, device and equipment and computer readable storage medium
Technical Field
The present application relates to the field of coding technologies, and in particular, to a picture coding method; it also relates to a picture coding device, an apparatus and a computer readable storage medium.
Background
PNG (Portable Network Graphics) is a bitmap format for data compression by using a lossless LZ77 algorithm, and is widely used. Lossless compression means that the file obtained by decompressing the compressed file is completely consistent with the file before compression. The larger the size of the PNG picture using lossless compression, the more storage resources need to be occupied. The picture has a large size, the opening and storing speed is slow, and the encoding or decoding needs to consume more CPU resources or hardware resources. If one wants to process the PNG pictures with larger sizes faster, one needs better CPU performance or hardware resources. In practical applications, some data in the picture that does not affect the picture quality is subjected to lossless compression, which results in time and space waste.
In view of this, how to save resource overhead and cost while ensuring picture quality has become a technical problem to be urgently solved by those skilled in the art.
Disclosure of Invention
The purpose of the present application is to provide a picture coding method, which can save resource overhead and cost while guaranteeing picture quality. Another object of the present application is to provide a picture coding apparatus, a device and a computer readable storage medium, all having the above technical effects.
In order to solve the above technical problem, the present application provides a picture coding method, including:
acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks, and determining the category of each data block;
compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression;
and integrating the compressed data to obtain a compressed picture.
Optionally, the determining the category of each data block includes:
and determining the category of each data block according to the content of each data block, wherein the category of the data block comprises an unimportant data block, a reusable data block and an important data block.
Optionally, compressing, according to the category of each data block, each data block by using the compression manner corresponding to the category includes:
if the data block is an unimportant data block, compressing the data block by adopting a lossy compression mode;
if the data block is a reusable data block, setting the size of a sliding window of a lossless compression algorithm as the size of the reusable data, performing lossless compression on the reusable data block, and representing the same data block as the reusable data block by using an index value;
and if the data block is an important data block, compressing the data block according to a preset compression strategy.
Optionally, the compressing the data block according to a preset compression policy includes:
dividing the important data blocks into preset sizes, and determining the similarity between the data blocks with the preset sizes;
and compressing the data blocks with the preset size in a corresponding compression mode according to the similarity between the data blocks with the preset size.
Optionally, the determining the similarity between the data blocks with the preset size includes:
calculating a preset characteristic value of the data block with the preset size;
calculating the hamming distance between the data blocks with the preset size according to the preset characteristic value;
calculating the ratio of the hamming distance to the preset size;
and determining the similarity between the data blocks with the preset sizes according to the ratio.
Optionally, the compressing the data blocks of the preset size in a corresponding compression manner according to the similarity between the data blocks of the preset size includes:
if the similarity between the current data block with the preset size and the previous data block with the preset size is larger than a first preset threshold, continuing to use the compression result of the previous data block with the preset size; the first data block with the preset size is compressed in a lossless mode;
if the similarity between the current data block with the preset size and the last data block with the preset size is larger than a second preset threshold and smaller than the first preset threshold, compressing the current data block with the preset size by adopting a lossy compression mode;
and if the similarity between the current data block with the preset size and the last data block with the preset size is smaller than the second preset threshold, compressing the current data block with the preset size by adopting a lossless compression mode.
Optionally, the integrating the compressed data to obtain a compressed picture includes:
integrating the compressed data and the image data block to obtain the compressed image; the image data block records the type, compression mode, similarity and length of the compressed data of the data block.
In order to solve the above technical problem, the present application further provides a picture encoding device, including:
the device comprises a category determining module, a compressing module and a compressing module, wherein the category determining module is used for acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks and determining the category of each data block;
the data compression module is used for compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression;
and the data integration module is used for integrating the compressed data to obtain a compressed picture.
In order to solve the above technical problem, the present application further provides a picture coding apparatus, including:
a memory for storing a computer program;
a processor for implementing the steps of the picture coding method as described in any one of the above when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the picture coding method as described in any one of the above.
The picture coding method provided by the application comprises the following steps: acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks, and determining the category of each data block; compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression; and integrating the compressed data to obtain a compressed picture.
Therefore, the picture coding method provided by the application divides the picture to be compressed into a plurality of data blocks, classifies the data blocks, compresses the data blocks of different categories in a corresponding compression mode, and compresses the data blocks of different categories in a non-lossless compression mode, namely compresses the data blocks in a non-lossless compression mode, so that the picture quality is guaranteed, the storage space is reduced, and the coding and decoding efficiency is improved.
The picture coding device, the equipment and the computer readable storage medium provided by the application have the technical effects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the prior art and the embodiments are briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a picture encoding method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a data block classification according to an embodiment of the present application;
FIG. 3 is a schematic representation of data provided by an embodiment of the present application;
fig. 4 is a schematic diagram of an encoding output result provided in the embodiment of the present application;
fig. 5 is a schematic diagram of a picture coding apparatus according to an embodiment of the present application;
fig. 6 is a schematic diagram of a picture coding apparatus according to an embodiment of the present application.
Detailed Description
The core of the application is to provide a picture coding method, which can save resource overhead and cost while guaranteeing picture quality. Another core of the present application is to provide a picture coding apparatus, a device and a computer readable storage medium, all having the above technical effects.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a picture encoding method according to an embodiment of the present application, and referring to fig. 1, the method includes:
s101: acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks, and determining the category of each data block;
after the data to be compressed is obtained, the data to be compressed can be firstly divided into data blocks with different sizes, the category of each data block is determined, and then the data blocks of different categories are compressed in a corresponding compression mode. The category of the data block may reflect how important the data block is to the picture display.
Wherein, in some embodiments, the determining the category of each of the data blocks comprises:
and determining the category of each data block according to the content of each data block, wherein the category of the data block comprises an unimportant data block, a reusable data block and an important data block.
In this embodiment, the data block categories include three types, i.e., an unimportant data block, a reusable data block, and an important data block. The unimportant data block refers to a data block that does not affect picture display or a data block that is insensitive to human eyes. A reusable data block refers to a contiguous block of the same data. The important data block is a key data block in a picture, and the data block which is relatively concerned by human eyes in picture display.
For example, if the data to be compressed includes background and other content, the background is considered to be an insignificant data block, and the other content may be considered to be significant data. If there is a large amount of ARGB consistent data in the data to be compressed, it is considered a reusable data block. It should be noted that the categories of the data blocks divided from the whole picture do not necessarily include all the categories, and may include only one of the categories, two of the categories, or three of the categories. For example, refer to the data block partitioning case shown in fig. 2, which includes three categories.
S102: compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression;
in this embodiment, the correspondence between the category of the data block and the compression method is preset, and on the basis of classifying the data block, the data block can be compressed by using the compression method corresponding to the category to which the data block belongs. Wherein, the compression modes corresponding to different categories are not all lossless compression.
In some embodiments, the compressing, according to the category of each of the data blocks, each of the data blocks in a compression manner corresponding to the category includes:
if the data block is an unimportant data block, compressing the data block by adopting a lossy compression mode;
if the data block is a reusable data block, setting the size of a sliding window of a lossless compression algorithm as the size of the reusable data, performing lossless compression on the reusable data block, and representing the same data block as the reusable data block by using an index value;
and if the data block is an important data block, compressing the data block according to a preset compression strategy.
For the case where the category of the data block includes three types, i.e., the unimportant data block, the reusable data block, and the important data block, the present embodiment sets a different compression method for each category. And if the data block is an unimportant data block, compressing the data block by adopting a lossy compression mode. For example, after sampling the data, a plurality of pixels are represented by one pixel or an average value of a plurality of pixels.
And if the data block is the reusable data block, compressing the data block by adopting a lossless compression mode. Wherein the size of the sliding window in the lossless compression algorithm is equal to the size of the data block. Each subsequent data block identical to the data block is directly represented by an index value.
For example, there are m pixels, and the subsequent (N-1) × m pixels are all the same as the m pixels. During the compression of each channel, the size of the sliding window in the LZ77 algorithm is first adjusted to m, and the subsequent (N-1) × m pixels are directly represented by an index value (1, m), which indicates that the pixels are the same as the first row, which has m pixels, and the storage format in the uncompressed data block is shown in fig. 3. The results of the reusable data block saved using the STATUS CHUNK update are shown in Table 1.
TABLE 1
Figure BDA0003951094300000061
And if the data block is an important data block, compressing the important data block according to a preset compression strategy, namely the preset compression strategy.
Wherein, in some embodiments, compressing the data block according to a preset compression policy comprises:
dividing the important data blocks into preset sizes, and determining the similarity between the data blocks with the preset sizes;
and compressing the data blocks with the preset size in a corresponding compression mode according to the similarity between the data blocks with the preset size.
In the embodiment, the compression strategy is to further divide the important data blocks, determine the similarity between the divided data blocks with preset sizes on the basis, and then perform compression processing on the data blocks with preset sizes with different similarities in a corresponding compression manner.
The storage space can be further reduced by dividing important data blocks and performing compression processing according to the similarity between the data blocks.
It will be appreciated that other compression strategies may be employed in addition to the compression strategies described above. For example, in order to accelerate the compression rate of the important data blocks, the entire important data blocks can be compressed directly in a lossless compression manner.
In some embodiments, the determining the similarity between the data blocks of the preset size includes:
calculating a preset characteristic value of the data block with the preset size;
calculating the hamming distance between the data blocks with the preset size according to the preset characteristic value;
calculating the ratio of the hamming distance to the preset size;
and determining the similarity between the data blocks with the preset sizes according to the ratio.
The preset characteristic value may be a pixel difference value of the data block, or may be a hash value of the data block.
When the preset feature value is a hash value of the data block, the important data block may be further divided into data blocks of m × n (n rows and m columns), and a difference value between pixels in adjacent rows is calculated in the divided data blocks of m × n. The following description is given by way of example of a single channel:
and subtracting the pixel value of the previous row from the pixel value of the current row, calculating N-1 times from the 2 nd row to the N (N-1) th row, finally obtaining a difference matrix N of m x N, and solving the average value a of the difference matrix.
Traversing each pixel in the difference matrix N from left to right and from top to bottom, and if the j column element N > = a in the ith row in the difference matrix, marking the position pixel value as 1; otherwise, marking the hash value as 0, and finally obtaining the hash value of the current data block, wherein the length of the hash value is m × n.
Similarly, the hash value of the next data block can be obtained, the hash values of the two data blocks are compared, the hamming distance x between the two data blocks with the size of m × n is calculated, and x/(m × n) is calculated.
For example, the hash value of data block 1 is: 1001 1100 1111 1000 1011 0010 1001 0100;
the hash value of data block 2 is: 1001 1100 1111 1000 1011 0110 1001 0000;
then the hamming distance between data block 1 and data block 2 is 2.
x/(m*n)=2/32=6.25%。
When the preset feature value is a pixel difference value of the data block, the important data block can be further divided into data blocks of m × n size, and a difference value of adjacent pixels is calculated in the divided data blocks of m × n size, so that (m-1) × n difference values can be obtained. If the former pixel is larger than the latter pixel, the value is recorded as 1, otherwise, the value is recorded as 0.
The hamming distance x between the data blocks of size m x n is calculated, and x/(m x n) is calculated.
For example, the difference values of the neighboring pixels of data block 1 are: 1001 1100 1111 1000 1011 0010 1001 0100;
the difference between the adjacent pixels of data block 2 is: 1001 1100 1111 1000 1011 0110 1001 0000;
then the hamming distance between data block 1 and data block 2 is 2.
x/(m*n)=2/32=6.25%。
The interval capable of reflecting the similarity between the data blocks can be preset, and after the ratio is calculated, the similarity between the data blocks with the preset size is determined according to the ratio.
In a specific embodiment, determining the similarity between the data blocks of the preset size according to the ratio may be subtracting the ratio from 1 to obtain the similarity, that is, the similarity = 1-ratio.
If the ratio is equal to 6.25% in the above example, the similarity of 1 minus 6.25% is equal to 93.75%, which indicates that data block 1 is consistent with data block 2, and data block 2 can be directly represented by data block 1, i.e., the smaller the ratio, the greater the similarity, which indicates that the data block is consistent.
In some embodiments, the compressing, according to the similarity between the data blocks of the preset size, the data blocks of the preset size in a corresponding compression manner includes:
if the similarity between the current data block with the preset size and the previous data block with the preset size is larger than a first preset threshold, continuing to use the compression result of the previous data block with the preset size; the compression mode of the first data block with the preset size is lossless compression;
if the similarity between the current data block with the preset size and the previous data block with the preset size is greater than a second preset threshold and smaller than the first preset threshold, compressing the current data block with the preset size by adopting a lossy compression mode;
and if the similarity between the current data block with the preset size and the last data block with the preset size is smaller than the second preset threshold, compressing the current data block with the preset size by adopting a lossless compression mode.
For example, the first preset threshold may be set to 90%, and the second preset threshold may be set to 50%.
If the similarity between the current data block with the preset size and the previous data block with the preset size is greater than 90%, that is, 0< = x/(m × n) < =10%, the current data block with the preset size is highly similar to the previous data block with the preset size, and the current data block with the preset size and the previous data block with the preset size are basically repeated data, at this time, the compression processing on the current data block with the preset size may not be performed, but the compression result of the previous data block with the preset size is adopted.
If the similarity between the current data block with the preset size and the previous data block with the preset size is smaller than 90% and larger than 50%, namely 10% < x/(m × n) < =50%, and the current data block with the preset size is partially similar to the previous data block with the preset size, compressing the current data block with the preset size by adopting a lossy compression mode.
If the similarity between the current data block with the preset size and the previous data block with the preset size is less than 50%, namely 50% < x/(m × n) < =1, the similarity between the current data block with the preset size and the previous data block with the preset size is low, and the change between the data blocks is severe, compressing the current data block with the preset size by adopting a lossless compression mode.
S103: and integrating the compressed data to obtain a compressed picture.
The step aims to integrate the compressed data after the compression is finished to obtain a final compressed picture.
Wherein, the integrating the compressed data to obtain a compressed picture comprises:
integrating the compressed data and the image data block to obtain the compressed image; the image data block records the type, compression mode, similarity and length of the compressed data of the data block.
Specifically, referring to fig. 4, a STATUS flag block (STATUS check shown in fig. 4) for recording the class information of the data block, the compression method information, and the length of the compressed data can be customized. After the data compression is completed, the image data block (idatchunk shown in fig. 4) is inserted. An image data block may contain 0, 1, or two or more status flag blocks. The IHDR of the picture, i.e. the header data, is added with the flag of the hybrid coding, i.e. the coding mode adopted, and the IEND of the picture, i.e. the picture end data, remains unchanged. The composition of the status flag block can be referred to table 2:
TABLE 2
Figure BDA0003951094300000091
The decompression process of the compressed picture is opposite to the compression process, and the reverse push can be performed based on the compression process, which is not described herein again.
In summary, the picture coding method provided by the present application divides a picture to be compressed into a plurality of data blocks, classifies the data blocks, and compresses the data blocks of different categories in a corresponding compression manner, and the compression manners corresponding to different categories are not all lossless compression, that is, the data blocks are not all compressed in a lossless compression manner, so that the picture quality is ensured, the storage space is reduced, and the coding and decoding efficiency is improved.
The present application also provides a picture coding apparatus, which may be referred to in correspondence with the above-described method. Referring to fig. 5, fig. 5 is a schematic diagram of a picture coding apparatus according to an embodiment of the present disclosure, and with reference to fig. 5, the apparatus includes:
the category determining module 10 is configured to acquire a picture to be compressed, divide the picture to be compressed into a plurality of data blocks, and determine a category of each data block;
a data compression module 20, configured to compress each data block in a compression manner corresponding to the type of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression;
and a data integration module 30, configured to integrate the compressed data to obtain a compressed picture.
On the basis of the foregoing embodiment, as a specific implementation manner, the category determining module 10 is specifically configured to:
and determining the category of each data block according to the content of each data block, wherein the category of the data block comprises an unimportant data block, a reusable data block and an important data block.
On the basis of the foregoing embodiment, as a specific implementation manner, the data compression module 20 includes:
the first compression unit is used for compressing the data block by adopting a lossy compression mode if the data block is an unimportant data block;
a second compression unit, configured to set a size of a sliding window of a lossless compression algorithm to a size of the reusable data if the data block is a reusable data block, perform lossless compression on the reusable data block, and use an index value to indicate a data block that is the same as the reusable data block;
and the third compression unit is used for compressing the data block according to a preset compression strategy if the data block is an important data block.
On the basis of the above embodiment, as a specific implementation, the third compressing unit includes:
the similarity determining unit is used for dividing the important data blocks into preset sizes and determining the similarity between the data blocks with the preset sizes;
and the data compression unit is used for compressing the data blocks with the preset size by adopting a corresponding compression mode according to the similarity between the data blocks with the preset size.
On the basis of the foregoing embodiment, as a specific implementation manner, the similarity determination unit includes:
the characteristic value operator unit is used for calculating a preset characteristic value of the data block with the preset size;
a hamming distance calculating subunit, configured to calculate a hamming distance between the data blocks of the preset size according to the preset feature value;
the ratio operator unit is used for calculating the ratio of the hamming distance to the preset size;
and the similarity determining subunit is configured to determine, according to the ratio, a similarity between the data blocks of the preset size.
On the basis of the above embodiment, as a specific implementation manner, the data compression unit includes:
a first processing subunit, configured to continue to use a compression result of a previous data block of the preset size if a similarity between a current data block of the preset size and a previous data block of the preset size is greater than a first preset threshold; the first data block with the preset size is compressed in a lossless mode;
a second processing subunit, configured to compress the current data block of the preset size in a lossy compression manner if a similarity between the current data block of the preset size and a previous data block of the preset size is greater than a second preset threshold and smaller than the first preset threshold;
and the third processing subunit is configured to, if the similarity between the current data block of the preset size and the previous data block of the preset size is smaller than the second preset threshold, compress the current data block of the preset size in a lossless compression manner.
On the basis of the foregoing embodiment, as a specific implementation manner, the data integration module 30 is specifically configured to:
integrating the compressed data and the image data block to obtain the compressed image; the image data block records the type, compression mode, similarity and length of compressed data of the data block.
The picture coding device divides a picture to be compressed into a plurality of data blocks, classifies the data blocks, compresses the data blocks of different categories in a corresponding compression mode, and does not adopt the lossless compression mode to the compression modes corresponding to the different categories, namely compresses the data blocks in a lossless compression mode, so that the picture quality is guaranteed, the storage space is reduced, and the coding and decoding efficiency is improved.
The present application also provides a picture coding apparatus, which, as shown with reference to fig. 6, includes a memory 1 and a processor 2.
A memory 1 for storing a computer program;
a processor 2 for executing a computer program to implement the steps of:
acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks, and determining the category of each data block; compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression; and integrating the compressed data to obtain a compressed picture.
For the introduction of the device provided in the present application, please refer to the above method embodiment, which is not described herein again.
The present application further provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks, and determining the category of each data block; compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression; and integrating the compressed data to obtain a compressed picture.
The computer-readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
For the introduction of the computer-readable storage medium provided in the present application, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive mode in the specification, the emphasis of each embodiment is on the difference from the other embodiments, and the same and similar parts among the embodiments can be referred to each other. The device, the apparatus and the computer-readable storage medium disclosed by the embodiments correspond to the method disclosed by the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above provides a detailed description of the picture coding method, apparatus, device and computer readable storage medium provided in the present application. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A picture coding method, comprising:
acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks, and determining the category of each data block;
compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression;
and integrating the compressed data to obtain a compressed picture.
2. The picture coding method according to claim 1, wherein the determining the category of each of the data blocks comprises:
and determining the category of each data block according to the content of each data block, wherein the category of the data block comprises an unimportant data block, a reusable data block and an important data block.
3. The picture coding method according to claim 2, wherein compressing each of the data blocks in the compression manner corresponding to the category according to the category of each of the data blocks comprises:
if the data block is an unimportant data block, compressing the data block by adopting a lossy compression mode;
if the data block is a reusable data block, setting the size of a sliding window of a lossless compression algorithm as the size of the reusable data, performing lossless compression on the reusable data block, and representing the same data block as the reusable data block by using an index value;
and if the data block is an important data block, compressing the data block according to a preset compression strategy.
4. The picture coding method according to claim 3, wherein the compressing the data block according to a preset compression policy comprises:
dividing the important data blocks into preset sizes, and determining the similarity between the data blocks with the preset sizes;
and compressing the data blocks with the preset size by adopting a corresponding compression mode according to the similarity between the data blocks with the preset size.
5. The picture coding method according to claim 4, wherein the determining the similarity between the data blocks of the preset size comprises:
calculating a preset characteristic value of the data block with the preset size;
calculating the hamming distance between the data blocks with the preset size according to the preset characteristic value;
calculating the ratio of the hamming distance to the preset size;
and determining the similarity between the data blocks with the preset sizes according to the ratio.
6. The method according to claim 5, wherein compressing the data blocks of the preset size in a corresponding compression manner according to the similarity between the data blocks of the preset size comprises:
if the similarity between the current data block with the preset size and the previous data block with the preset size is larger than a first preset threshold, continuing to use the compression result of the previous data block with the preset size; the first data block with the preset size is compressed in a lossless mode;
if the similarity between the current data block with the preset size and the previous data block with the preset size is greater than a second preset threshold and smaller than the first preset threshold, compressing the current data block with the preset size by adopting a lossy compression mode;
and if the similarity between the current data block with the preset size and the last data block with the preset size is smaller than the second preset threshold, compressing the current data block with the preset size by adopting a lossless compression mode.
7. The method of claim 1, wherein the integrating the compressed data to obtain a compressed picture comprises:
integrating the compressed data and the image data block to obtain the compressed image; the image data block records the type, compression mode, similarity and length of the compressed data of the data block.
8. A picture coding apparatus, comprising:
the device comprises a category determining module, a compressing module and a compressing module, wherein the category determining module is used for acquiring a picture to be compressed, dividing the picture to be compressed into a plurality of data blocks and determining the category of each data block;
the data compression module is used for compressing each data block by adopting a compression mode corresponding to the category according to the category of each data block to obtain compressed data; the compression modes corresponding to different categories are not all lossless compression;
and the data integration module is used for integrating the compressed data to obtain a compressed picture.
9. A picture encoding device characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the picture coding method according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the picture coding method according to one of claims 1 to 7.
CN202211448084.6A 2022-11-18 2022-11-18 Picture coding method, device and equipment and computer readable storage medium Pending CN115713567A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211448084.6A CN115713567A (en) 2022-11-18 2022-11-18 Picture coding method, device and equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211448084.6A CN115713567A (en) 2022-11-18 2022-11-18 Picture coding method, device and equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115713567A true CN115713567A (en) 2023-02-24

Family

ID=85233766

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211448084.6A Pending CN115713567A (en) 2022-11-18 2022-11-18 Picture coding method, device and equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115713567A (en)

Similar Documents

Publication Publication Date Title
CN107886560B (en) Animation resource processing method and device
US7257264B2 (en) Image processing apparatus and method for compression-encoding image area information
JP5399416B2 (en) Video coding system with reference frame compression
KR101367777B1 (en) Adaptive predictive image compression system and method thereof
US20070195106A1 (en) Detecting Doctored JPEG Images
US20100118947A1 (en) Decoder for selectively decoding predetermined data units from a coded bit stream
CN116193130B (en) Method and system for improving transmission efficiency of image data in network
KR20140027040A (en) Adaptive predictive image compression system and method thereof
US7031541B2 (en) System, method and program for improved color image signal quantization
CN108182712B (en) Image processing method, device and system
US8428381B2 (en) Image compression method with variable quantization parameter
CN115713567A (en) Picture coding method, device and equipment and computer readable storage medium
DE102012111405A1 (en) Method for efficiently decoding variable length codes
US20130011061A1 (en) Image compression method with fixed compression ratio, image decompression method, and electronic device thereof
WO2022141461A1 (en) Point cloud encoding and decoding method, encoder, decoder and computer storage medium
CN113473150B (en) Image processing method and device and computer readable storage device
US9020291B2 (en) Resized image compression based on frequency content
US20150245029A1 (en) Image processing system and method
WO2024119420A1 (en) Encoding method, decoding method, code stream, encoder, decoder, and storage medium
WO2024007843A1 (en) Encoding method and apparatus, decoding method and apparatus, and computer device
US11515961B2 (en) Encoding data arrays
CN110099279B (en) Method for adjusting lossy compression based on hardware
CN112887729B (en) Image coding and decoding method and device
JPS61149126A (en) Medical image data compression and expansion system
US10893297B2 (en) Processing image data using tiered bit-layers

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination