CN113256747A - Bitmap index compression method, decompression method, equipment and medium - Google Patents

Bitmap index compression method, decompression method, equipment and medium Download PDF

Info

Publication number
CN113256747A
CN113256747A CN202110380599.6A CN202110380599A CN113256747A CN 113256747 A CN113256747 A CN 113256747A CN 202110380599 A CN202110380599 A CN 202110380599A CN 113256747 A CN113256747 A CN 113256747A
Authority
CN
China
Prior art keywords
index
values
color
data
value
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.)
Granted
Application number
CN202110380599.6A
Other languages
Chinese (zh)
Other versions
CN113256747B (en
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.)
Fujian Centerm Information Co Ltd
Original Assignee
Fujian Centerm Information 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 Fujian Centerm Information Co Ltd filed Critical Fujian Centerm Information Co Ltd
Priority to CN202110380599.6A priority Critical patent/CN113256747B/en
Publication of CN113256747A publication Critical patent/CN113256747A/en
Application granted granted Critical
Publication of CN113256747B publication Critical patent/CN113256747B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/40Tree coding, e.g. quadtree, octree
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention provides a bitmap index compression method, a bitmap index decompression method, equipment and a medium, wherein the compression method comprises the following steps: establishing an index table, determining the corresponding relation between color values and index values, corresponding the color values to the index values from small to large according to the frequency of occurrence, and representing the color values by the codes from short to long of variable word length codes; and replacing color values in the image with variable word length coding sequences according to the created index table to obtain picture coding data, and storing the index table data and the picture coding data as compressed data, wherein the index table data comprises table length and color values. The decompression method comprises the following steps: acquiring the index table data and the picture coding data; sequentially reading picture coding data; and sequentially inquiring the index table data, and restoring each coded value in the picture coded data to a corresponding color value in the index table. The invention can realize the lossless compression of bitmaps with various colors, reduce the memory occupation and improve the bitmap compression and decompression efficiency.

Description

Bitmap index compression method, decompression method, equipment and medium
Technical Field
The present invention relates to the field of picture compression, and in particular, to a bitmap index compression method, decompression method, device, and medium.
Background
Common lossless compression algorithms used for bitmap compression include RLE (run-length encoding), Huffman (Huffman encoding), LZ77, and the like. Among them, Huffman is currently the most widely used Variable Length Coding (VLC).
In the existing bitmap compression, an index is commonly used to replace a color value to compress an image, in most application scenarios, Huffman is applied to the occasion where the number of coded objects is not greater than 256, and if the number of coded objects is too large (exceeds 256), the compression effect will be poor, but because the number of colors adopted by a single image at present is large and the probability exceeds 256, in order to achieve a better compression effect, a common solution is to cut down the number of codes, that is, the number of colors, to a certain extent. For example, colors that are used less frequently in an image are replaced with similar color values. However, the disadvantage of this solution is obvious in that the compression is lossy, i.e. the compressed image is not identical to the original image.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a bitmap index compression method, decompression method, device and medium, which can achieve lossless compression, reduce memory occupation, and improve bitmap compression and decompression efficiency.
In a first aspect, the present invention provides a bitmap index compression method, including:
step 10, establishing an index table, determining a corresponding relation between color values and index values, and corresponding the color values to the index values from small to large according to the frequency of occurrence, wherein the index values from small to large are represented by variable word length codes from short to long;
and 20, replacing color values in the image with variable word length coding sequences according to the created index table to obtain picture coding data, and storing the index table data and the picture coding data as compressed data, wherein the index table data comprises table length and color values.
Further, the step 10 further includes:
sequentially traversing color values in the bitmap, recording the occurrence frequency of each color value, and filling the color values into an index table;
arranging all color values from large to small according to the occurrence frequency;
and filling corresponding index values into the sorted color values, wherein the index values are sorted from small to large and are 0,1,2,3, … and M in sequence.
Further, the step 10 further includes optimizing an index table, where the optimized index table includes a single index table and multiple index tables;
recording all color values with the frequency of 1 in the single index table, and arranging according to the appearance sequence of the traversal pixel values, wherein the index values of the color values in all the single index tables are the same;
expressing all color values with the occurrence frequency of 1 by using a virtual color value RGBx, and accumulating the number of the color values with the occurrence frequency of 1 as the occurrence frequency of the virtual color value RGBx;
in the multiple index table, all color value data with all appearance frequencies greater than 1, include virtual color value data, according to color value appearance frequencies, arrange from big to small, the order that appears when appearance frequency is the same when according to traversing RGB is arranged, correspond to the color value of arranging and establish index value, index value is arranged from small to big, index value begins from 0, fills in 0,1,2,3, …, K in proper order to fill in the single index table with the index value that virtual color value RGBx corresponds wherein, be the index value of the color value of 1 as all appearance frequencies.
Further, the virtual color value RGBx is replaced with any one color value in the one-time index table in advance.
Further, the variable word length code is a custom variable word length code cv, and the variable word length code cv has a structure:
head c + tail v;
the head c is used for indicating the number of bits occupied by the tail v, the number n of the tail is c +1, cv forms a complete coded value, and the variable-length code cv can represent the maximum number of cv code valuesL is sigma 21+22+...+2nAnd the index values arranged from small to large correspond to cv code values arranged from small to large, so that the bitmap color index values are coded.
Further, before the step 10, the method further includes compressing the bitmap by using RLE.
In a second aspect, the present invention provides a bitmap index decompression method, including:
acquiring index table data and picture coding data in the method of the first aspect;
sequentially reading picture coding data;
and sequentially inquiring the index table data, and restoring each coded value in the picture coded data to a corresponding color value in the index table.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of the first aspect when executing the program.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
1. the encoding and decoding process is simple, the speed is high, the image data only needs to be traversed twice in the compression process and is respectively used for establishing an index table and color value encoding and replacing, and the encoding only needs to be restored into color values by looking up the table in the decompression process;
2. the cv coding adopted by the invention has a simple structure and a better compression effect, and is determined coding compared with Huffman coding, namely the cv coding value and the index value are in a predetermined corresponding relation, Huffman needs to create a binary tree according to the occurrence probability of color values, and the corresponding relation between the coding and the index value can be determined only after VLC coding is generated according to the tree, in the cv coding, after c is determined, each bit of v is added (the bit number of v is n after one bit is added), the coding number is increased by 2n, namely, the coding increment can be increased by a large amount, the compression ratio is slightly influenced by the index number, the lossless compression effect is better, compared with RLE coding, the index compression of the invention does not require the same color to continuously appear, and the application range is wider;
3. the method has the advantages that the memory is not consumed basically, a cv code lookup table can be read to obtain the color value, then a decoding file is written once, only one code memory is needed for decompression under the limit condition, and the method can meet the requirement of a small embedded system with limited resources;
4. the vc code of the invention can also be used in combination with other algorithms to carry out secondary compression, so as to achieve better compression effect and have flexible application.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flowchart illustrating a bitmap index compression method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a bitmap index decompression method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the invention;
fig. 4 is a schematic structural diagram of a medium according to a fourth embodiment of the present invention.
Detailed Description
The embodiment of the application provides a bitmap index compression method, a decompression method, equipment and a medium, and is used for solving the problems that the existing variable word length coding cannot realize lossless compression and high-definition reduction of bitmaps with various colors (more than 256), realizing lossless compression, reducing memory occupation, improving bitmap compression and decompression efficiency and obtaining a better compression effect.
The overall structural design of the compression in this application is shown in table a below:
TABLE A
Figure BDA0003012794070000041
In the process of creating the index table, the index value, the color value and the coding value are in sequence one-to-one correspondence, and the color value and the table length of the index table are only required to be recorded and stored. For the optimized index table (a multi-index table and two sub-tables of a single-index table), the multi-index table is arranged from large to small according to the repeated occurrence times of the color values, namely the more the occurrence times are, the smaller the index value is, after the sorting is finished, only the table length and the color data need to be recorded, the single-index table is arranged according to the sequence appearing when the RGB data is traversed, the color values in the table correspond to the same index, and the table length and the color data only need to be recorded. And reducing the data storage space of the index table.
The picture coding data is that corresponding coding data is stored according to the traversal sequence of the color data of each pixel point in the picture and is compactly arranged in sequence (if the data part is less than the multiple part of 8, the multiple part is automatically filled to be the multiple of 8, namely the filling is aligned according to bytes). The total bit length of the picture coding data and the coding value of each pixel point need to be recorded.
For better understanding of the above technical solutions, the following detailed descriptions will be provided in conjunction with the drawings and the detailed description of the embodiments.
Example one
The present embodiment provides a bitmap index compression method, as shown in fig. 1, the method includes:
step 10, establishing an index table, determining a corresponding relation between color values and index values, and corresponding the color values to the index values from small to large according to the frequency of occurrence, wherein the index values from small to large are represented by variable word length codes from short to long; the variable word length coding is corresponding to the index value from small to large according to the numerical value;
and 20, replacing color values in the image with variable word length coding sequences according to the created index table to obtain picture coding data, and storing the index table data and the picture coding data as compressed data, wherein the index table data comprises table length and color values.
In this embodiment, the step 10 further includes:
sequentially traversing color values in the bitmap, recording the occurrence frequency of each color value, and filling the color values into an index table;
arranging all color values from large to small according to the occurrence frequency;
and filling corresponding index values into the sorted color values, wherein the index values are sorted from small to large and are 0,1,2,3, … and M in sequence.
For example, when traversing bitmap data, such as RGB values of pixels, table 1 is generated:
TABLE 1
Color value of pixel Number of occurrences
RGBa1 CNTa1
RGBa2 CNTa2
... ...
RGBaM CNTaM
The pixel values are sorted according to the occurrence times from large to small, and the sorted list is recorded as table 2:
TABLE 2
Color value of pixel Number of occurrences
RGBb1 CNTb1
RGBb2 CNTb2
... ...
RGBbM CNTbM
The index values corresponding to the pixel values are arranged from small to large to obtain table 3:
TABLE 3
Color value of pixel Index value
RGBb1 0
RGBb2 1
... ...
RGBbM M
In this embodiment, the bitmap data overall structure is represented as color data before compression, and as an index table and index data after compression. Storing index data according to the traversal sequence of the color data, and compactly arranging indexes according to bits. The total bit length of the index data needs to be recorded, and if the data part is less than the multiple of 8, the data part is automatically filled to be the multiple of 8, namely the data part is filled to be aligned by bytes.
Preferably, the step 10 further includes optimizing an index table, where the optimized index table includes a single index table and multiple index tables;
recording all color values with the frequency of 1 in the single index table, and arranging according to the appearance sequence of the traversal pixel values, wherein the index values of the color values in all the single index tables are the same;
expressing all color values with the occurrence frequency of 1 by using a virtual color value RGBx, and accumulating the number of the color values with the occurrence frequency of 1 as the occurrence frequency of the virtual color value RGBx;
in the multiple index table, all color value data with all appearance frequencies greater than 1, include virtual color value data, according to color value appearance frequencies, arrange from big to small, the order that appears when appearance frequency is the same when according to traversing RGB is arranged, correspond to the color value of arranging and establish index value, index value is arranged from small to big, index value begins from 0, fills in 0,1,2,3, …, K in proper order to fill in the single index table with the index value that virtual color value RGBx corresponds wherein, be the index value of the color value of 1 as all appearance frequencies.
For example, a color value with the number of occurrences of 1 is recorded in the single index table 4, (the pixel values in the table are required to be arranged according to the order of occurrence):
TABLE 4
Color value of pixel Number of occurrences
RGBd1 1
RGBd2 1
... 1
RGBdk 1
Color values with a number of occurrences other than 1 are recorded in the multiple index table 5:
TABLE 5
Color value of pixel Number of occurrences
RGBc1 CNTc1
RGBc2 CNTc2
... ...
RGBcK-1 CNTcK-1
All pixel values with the number of occurrences of 1 are uniformly recorded as virtual color value data RGBxThe number is recorded as CNTxAnd importing the data into a multi-index table 5 to obtain a multi-index table 6:
TABLE 6
Figure BDA0003012794070000071
Figure BDA0003012794070000081
The multiple index table 7 is obtained after the occurrence times are arranged from large to small:
TABLE 7
Color value of pixel Number of occurrences Index value
RGBc1 CNTc1 0
RGBc2 CNTc2 1
... ... ...
RGBx CNTx x
... ... ...
RGBcK CNTcK K
That is, the maximum value of the optimized index value corresponds to the size obtained by subtracting the number of pixels appearing only 1 time. Because the index value adopts a variable length representation method, the smaller the maximum value of the index is, the fewer bits are required for representation, and the better the compression effect is naturally. Therefore, introducing the above optimization can reduce the index maximum.
After the optimization, an optimized single index table (as shown in the following table 8) and an optimized multiple index table (as shown in the following table 9) are obtained:
TABLE 8
Color value of pixel Index value
RGBc1 0
RGBc2 1
... ...
RGBx x
... ...
RGBcK K
TABLE 9
Figure BDA0003012794070000082
Figure BDA0003012794070000091
Since the storage sequence of the color values in the table indicates the index value corresponding to the color, and the index value and the cv code are in a fixed corresponding relationship, the corresponding relationship between the color values and the coded values is determined in the table building process, so that only the color values need to be stored when the data of the index table is finally stored, and the data do not need to be sent againThe index value and the coding value corresponding to each color value are saved, and the occupied space of index table data is greatly reduced. For the multi-index table, only the length (i.e. the number of color values to be recorded) and the color data are required to be recorded, i.e. "length + color 1+ color 2+ color 3+ … …", the corresponding index value is automatically counted from 0, i.e. the RGB values in the table correspond to 0, 1. For the one-time index table, all color values correspond to the same index value x, and all color values are pointed to a virtual color value, the virtual color value RGBx is replaced by any color value in the one-time index table in advance, and the first color value in the one-time index table is generally adopted as the virtual color value to be filled in the multi-time index table (for example, RGBx in table 8 is equal to RGBd in table 9)1). Therefore, the single index table only needs the length of the record table (i.e. the number of the color values to be recorded) and the color data. The structure of the final index table data obtained by the optimization method is shown in table 10 below.
Watch 10
Length of multitime meter RGBc1~RGBcK Length of single watch RGBd1~RGBdk
Preferably, the variable word length code is a custom variable word length code cv, and the variable word length code cv is structured as follows:
head c + tail v;
the header c is used to indicate the number of bits occupied by the tail v, where n is c +1, and cv constitutes a complete codeThe number M of cv code values which can be represented at most by the variable-word-length code cv is sigma 21+22+...+2nAnd the index values arranged from small to large correspond to cv code values arranged from small to large, so that the bitmap color index values are coded.
When the bit number of the header c is m, the value of the header c is 0-2m-1, and since n ═ c +1, n is at most 2mTherefore, the number of the variable coded cv code values is at most
Figure BDA0003012794070000101
Taking a 24-bit color bitmap as an example, the total color is 224I.e., 16,777,216. Therefore, not only the compression effect of the color with the large number of appearances but also the enlargement effect of the color with the small number of appearances are considered.
If the number of bits in the header c is m, the number of bits that the header c can represent is in the range of 0 to 2m-1, 2 in totalmThe number of bits n of the tail v is 1-2m. The number of indexes which can be actually expressed corresponding to the cv coding structure is sigma 21+22+...+2n
Expressed in tabular form, as specified in table 11 below:
TABLE 11
Figure BDA0003012794070000102
Example (c):
when the head bit number m is 1, the bit width n of the tail portion can be expressed up to 21And (4) respectively. Then the number of data that this data structure can express is ∑ 21+22I.e. 6, are binary numbers:
0b00,0b01,0b100,0b101,0b110,0b111;
the index structure represents values of 0-5 in the order from small to large, namely the corresponding relationship is as the following table 12:
TABLE 12
Data structure Structural bit width Representative value
0b00 2 0
0b01 2 1
0b100 3 2
0b101 3 3
0b110 3 4
0b111 3 5
When the number m of the head bits is 2, the bit width n of the tail part which can be expressed is 2 at most2And (4) respectively. Then the number of data that this data structure can express is ∑ 21+22+23+24I.e. 30, each being binaryNumber:
0b000,0b001,0b0100,0b0101,0b0110,0b0111
0b10000,0b10001,0b10010,0b10011,0b10100,0b10101,0b10110,0b10111,
0b110000,...,0b111111;
therefore, by adopting the cv code of the invention to code the index value, the compression requirement of bitmaps with various color values can be met, the lossless compression is realized, the coding bit width can be greatly reduced, the memory is reduced, and the compression and decompression efficiency is improved.
In this embodiment, the present invention may also use RLE to compress the bitmap before performing step 10. Other algorithms can be incorporated into the algorithm of the present invention to further optimize the compression effect.
Based on the same inventive concept, the present application further provides a bitmap decompression method corresponding to the bitmap compression method in the first embodiment, which is described in detail in the second embodiment.
Example two
This embodiment provides a bitmap index decompression method, as shown in fig. 2, the method includes:
acquiring index table data and picture coding data in the method of the first aspect;
sequentially reading picture coding data;
and sequentially inquiring the index table data, and restoring each coded value in the picture coded data to a corresponding color value in the index table. Thereby obtaining the color value of each pixel point in the picture and completing the decompression process. In the bitmap index decompression method, each coded value in the picture coded data is traversed in sequence, and the corresponding color value can be inquired from the index table according to the one-to-one correspondence relationship between the coded value and the color value sequence, so that the picture decompression is completed.
Based on the same inventive concept, the application provides an electronic device embodiment corresponding to the first embodiment, which is detailed in the third embodiment.
EXAMPLE III
The embodiment provides an electronic device, as shown in fig. 3, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any one of the first embodiment modes may be implemented.
Since the electronic device described in this embodiment is a device used for implementing the method in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a specific implementation of the electronic device in this embodiment and various variations thereof can be understood by those skilled in the art, and therefore, how to implement the method in the first embodiment of the present application by the electronic device is not described in detail herein. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium, as shown in fig. 4, on which a computer program is stored, and when the computer program is executed by a processor, any one of the embodiments can be implemented.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages: the coding and decoding process of the invention is simple, the compression ratio is high, the memory occupation is small, it can be applied to the small embedded system with limited resources, it solves the problem of the small embedded system caused by the card pause generated by the decompression picture, and it can realize the lossless compression by adopting the coding algorithm of the invention to compress the bitmap, especially when the bitmap with various colors can not be compressed by Huffman coding, it can realize the lossless compression by adopting the compression method of the invention, at the same time, it does not need to require the continuity of similar colors, it does not need to create binary tree, the speed is fast, the compression ratio is little influenced by the number of indexes, the compression effect is good, besides, the coding method of the invention can also be used in combination with other algorithms to carry on the secondary compression, it can improve the compression effect, for example, RLE is used to compress the bitmap first, then the cv coding is applied to the color value part to carry on the secondary compression, further optimization of the compression effect may also be achieved.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (9)

1. A bitmap index compression method is characterized in that: the method comprises the following steps:
step 10, establishing an index table, determining a corresponding relation between color values and index values, and corresponding the color values to the index values from small to large according to the frequency of occurrence, wherein the index values from small to large are represented by variable word length codes from short to long;
and 20, replacing color values in the image with variable word length coding sequences according to the created index table to obtain picture coding data, and storing the index table data and the picture coding data as compressed data, wherein the index table data comprises table length and color values.
2. The bitmap index compression method of claim 1, wherein: the step 10 further comprises:
sequentially traversing color values in the bitmap, recording the occurrence frequency of each color value, and filling the color values into an index table;
arranging all color values from large to small according to the occurrence frequency;
and filling corresponding index values into the sorted color values, wherein the index values are sorted from small to large and are 0,1,2,3, … and M in sequence.
3. A bitmap index compression method according to claim 2, characterized in that: the step 10 further comprises optimizing the index table, wherein the optimized index table comprises a single index table and a multi-index table;
recording all color values with the frequency of 1 in the single index table, and arranging according to the appearance sequence of the traversal pixel values, wherein the index values of the color values in all the single index tables are the same;
expressing all color values with the occurrence frequency of 1 by using a virtual color value RGBx, and accumulating the number of the color values with the occurrence frequency of 1 as the occurrence frequency of the virtual color value RGBx;
in the multiple index table, all color value data with all appearance frequencies greater than 1, include virtual color value data, according to color value appearance frequencies, arrange from big to small, the order that appears when appearance frequency is the same when according to traversing RGB is arranged, correspond to the color value of arranging and establish index value, index value is arranged from small to big, index value begins from 0, fills in 0,1,2,3, …, K in proper order to fill in the single index table with the index value that virtual color value RGBx corresponds wherein, be the index value of the color value of 1 as all appearance frequencies.
4. A bitmap index compression method according to claim 3, wherein: the virtual color value RGBx is replaced with any one color value in the one-time index table in advance.
5. The bitmap index compression method of claim 1, wherein: the variable word length code is a self-defined variable word length code cv, and the variable word length code cv has the structure that:
head c + tail v;
the head c is used for indicating the number of bits occupied by the tail v, the number n of the tail is c +1, cv forms a complete coded value, and the number L of cv code values which can be represented at most by the variable-length code cv is sigma 21+22+...+2nAnd the index values arranged from small to large correspond to cv code values arranged from small to large, so that the bitmap color index values are coded.
6. The bitmap index compression method of claim 1, wherein: step 10 is preceded by compressing the bitmap using RLE.
7. A method of bitmap index decompression, characterized by: the method comprises the following steps:
acquiring index table data and picture coding data in the bitmap index compression method according to any one of claims 1 to 6;
sequentially reading picture coding data;
and sequentially inquiring the index table data, and restoring each coded value in the picture coded data to a corresponding color value in the index table.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 6 when executing the program.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
CN202110380599.6A 2021-04-09 2021-04-09 Bitmap index compression method, bitmap index decompression equipment and bitmap index medium Active CN113256747B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110380599.6A CN113256747B (en) 2021-04-09 2021-04-09 Bitmap index compression method, bitmap index decompression equipment and bitmap index medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110380599.6A CN113256747B (en) 2021-04-09 2021-04-09 Bitmap index compression method, bitmap index decompression equipment and bitmap index medium

Publications (2)

Publication Number Publication Date
CN113256747A true CN113256747A (en) 2021-08-13
CN113256747B CN113256747B (en) 2023-10-20

Family

ID=77221710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110380599.6A Active CN113256747B (en) 2021-04-09 2021-04-09 Bitmap index compression method, bitmap index decompression equipment and bitmap index medium

Country Status (1)

Country Link
CN (1) CN113256747B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5680129A (en) * 1995-07-18 1997-10-21 Hewlett-Packard Company System and method for lossless image compression
US20010024293A1 (en) * 2000-02-24 2001-09-27 Johan Ville Image data compression
CN101489019A (en) * 2009-01-22 2009-07-22 北京航空航天大学 Method for compression and decompression of lossless bitmap
CN103873868A (en) * 2012-12-13 2014-06-18 比亚迪股份有限公司 Bitmap data compression method
CN104575427A (en) * 2015-01-23 2015-04-29 浙江工业大学 High-compression-ratio lossless image compression method suitable for embedded system decoding
JP2015103982A (en) * 2013-11-26 2015-06-04 株式会社シキノハイテック Image encoding device
CN107801031A (en) * 2017-11-09 2018-03-13 广州物启科技有限公司 A kind of lossless compression-encoding method to pure three primary colors image data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5680129A (en) * 1995-07-18 1997-10-21 Hewlett-Packard Company System and method for lossless image compression
US20010024293A1 (en) * 2000-02-24 2001-09-27 Johan Ville Image data compression
CN101489019A (en) * 2009-01-22 2009-07-22 北京航空航天大学 Method for compression and decompression of lossless bitmap
CN103873868A (en) * 2012-12-13 2014-06-18 比亚迪股份有限公司 Bitmap data compression method
JP2015103982A (en) * 2013-11-26 2015-06-04 株式会社シキノハイテック Image encoding device
CN104575427A (en) * 2015-01-23 2015-04-29 浙江工业大学 High-compression-ratio lossless image compression method suitable for embedded system decoding
CN107801031A (en) * 2017-11-09 2018-03-13 广州物启科技有限公司 A kind of lossless compression-encoding method to pure three primary colors image data

Also Published As

Publication number Publication date
CN113256747B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
US11044495B1 (en) Systems and methods for variable length codeword based data encoding and decoding using dynamic memory allocation
US10979071B2 (en) Systems and methods for variable length codeword based, hybrid data encoding and decoding using dynamic memory allocation
CN101039374B (en) Image lossless compression method
US20140185668A1 (en) Method for adaptive entropy coding of tree structures
US7764202B2 (en) Lossless data compression with separated index values and literal values in output stream
WO2013026210A1 (en) Hierarchical entropy encoding and decoding
CN115955569B (en) Monitoring video data transmission method for animal epidemic prevention quarantine center
CN115866287B (en) Efficient data transmission method for intelligent campus management platform
CN111093081A (en) Lossless image compression method and system
CN112968706B (en) Data compression method, FPGA chip and FPGA online upgrading method
CN108737976A (en) A kind of compression transmitting method based on Big Dipper short message
WO2021031877A1 (en) Methods and apparatus for image coding and decoding, and chip
CN1134167C (en) Data efficient quantization table for digital video signal processor
US9503760B2 (en) Method and system for symbol binarization and de-binarization
CN110971904B (en) Control method for image compression
CN114726926A (en) Self-adaptive variable length coding method for Laplace information source
CN113256747B (en) Bitmap index compression method, bitmap index decompression equipment and bitmap index medium
CN110518915B (en) Bit counting coding and decoding method
CN110191341B (en) Depth data coding method and decoding method
CN112740707A (en) Point cloud encoding and decoding method and device
US5708431A (en) Method for compression coding of potentially unbounded integers
CN110572664A (en) Novel BMP image compression method and system
WO2001082628A2 (en) Efficient video data access using fixed ratio compression
US20220005229A1 (en) Point cloud attribute encoding method and device, and point cloud attribute decoding method and devcie
CN115913246A (en) Lossless data compression algorithm based on self-adaptive instantaneous entropy

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
GR01 Patent grant
GR01 Patent grant