Summary of the invention
The present invention provides a kind of image data compression method based on sign bit packet and device, it can reduce the absolute value peak of residual error data of existing compress mode, and realize using less bit to represent view data, thus further increase the compression ratio of view data.
On the one hand, the present invention provides a kind of image data compression method based on sign bit packet, and described method includes:
Residual error data corresponding for view data is decomposed into multiple 2 × 2 data blocks;
The data of described 2 × 2 data blocks are carried out the squeeze operation of different modes, 2 × 2 data blocks after being compressed by the composite type of the sign bit according to described 2 × 2 data blocks;
2 × 2 data blocks after the multiple compressions that will obtain synthesize, the residual error data after being compressed.
On the other hand, the present invention provides a kind of image data compressing apparatus based on sign bit packet, and described device includes decomposing module, compression module and synthesis module, wherein,
Described decomposing module, for being decomposed into multiple 2 × 2 data blocks by residual error data corresponding for view data;
The data of described 2 × 2 data blocks for the composite type according to the sign bit of described 2 × 2 data blocks, are carried out the squeeze operation of different modes, 2 × 2 data blocks after being compressed by described compression module;
Described synthesis module, 2 × 2 data blocks after the multiple compressions that will obtain synthesize, the residual error data after being compressed.
The image data compression method based on sign bit packet of present invention offer and device, be decomposed into multiple 2 × 2 data blocks by residual error data corresponding for view data;The data of described 2 × 2 data blocks are carried out the squeeze operation of different modes, 2 × 2 data blocks after being compressed by the composite type of the sign bit according to described 2 × 2 data blocks;2 × 2 data blocks after the multiple compressions that will obtain synthesize, the residual error data after being compressed.Compared with prior art, it can reduce the absolute value of residual error data of existing compress mode, to realize using less bit to represent view data, thus improves the compression ratio of view data further.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments.Based on the embodiment in the present invention, all other embodiments that those of ordinary skill in the art are obtained under not making creative work premise, broadly fall into the scope of protection of the invention.
As it is shown in figure 1, the embodiment of the present invention provides a kind of image data compression method based on sign bit packet, described method includes:
S11, residual error data corresponding for view data is decomposed into multiple 2 × 2 data blocks.
The data of described 2 × 2 data blocks are carried out the squeeze operation of different modes, 2 × 2 data blocks after being compressed by S12, composite type according to the sign bit of described 2 × 2 data blocks.
2 × 2 data blocks after S13, the multiple compressions that will obtain synthesize, the residual error data after being compressed.
The image data compression method based on sign bit packet that the embodiment of the present invention provides, is decomposed into multiple 2 × 2 data blocks by residual error data corresponding for view data;The data of described 2x2 data block are carried out the squeeze operation of different modes, 2 × 2 data blocks after being compressed by the composite type of the sign bit according to described 2 × 2 data blocks;2 × 2 data blocks after the multiple compressions that will obtain synthesize, the residual error data after being compressed.Compared with prior art, it can reduce the absolute value of residual error data of existing compress mode, to realize using less bit to represent view data, thus improves the compression ratio of view data further.
Further, as in figure 2 it is shown, embodiments provide the idiographic flow of step S12 in above-described embodiment, wherein, all combined situation of the sign bit of described 2 × 2 data blocks are as shown in table 1, here, it is stipulated that the sign bit of data zero is just.
As shown in Table 1, the sign bit of described 2 × 2 data blocks has 16 kinds of combined situation, and described 16 kinds of combined situation present 3 kinds of composite types, and described 3 kinds of composite types are as follows: three positive one is negative or three negative ones just,
Complete the most just or complete negative and two just two negative.
S21, determine the sign bit composite type of 2 × 2 data blocks the most to be compressed.
If the sign bit composite type of described 2 × 2 data blocks the most to be compressed be three positive one is negative or three negative ones just, then perform step S22 and S23;
If the sign bit composite type of described 2 × 2 data blocks the most to be compressed is for entirely just or entirely to bear, then perform step S24 and S25;
If the sign bit composite type of described 2 × 2 data blocks the most to be compressed is two just two negative, then perform step S26 and S27.
Table 1
S22, using 1 bit to represent the composite type of sign bit of described 2 × 2 data blocks, use 2 bits to represent the most different sign bit location, the most different described sign bit is minus symbol position or plus sign position to use 1 bit to represent.
S23, each data in described 2 × 2 data blocks are taken absolute value, obtain the first data block being made up of four positive numbers, and use 2 bits to represent the position of the minimum positive number in described first data block;The positive number being in other positions in described first data block is made difference with described minimum positive number and obtains corresponding three differences, and then obtain the second data block being made up of described minimum positive number and described three differences;Data in described second data block are carried out without symbol variable-length encoding, 2 × 2 data blocks after being compressed.
S24, using 2 bits to represent the composite type of sign bit of described 2 × 2 data blocks, the concrete combined situation of sign bit of described 2 × 2 data blocks is for entirely just or entirely to bear to use 1 bit to represent.
S25, each data in described 2 × 2 data blocks are taken absolute value, obtain the first data block being made up of four positive numbers, and use 2 bits to represent the position of the minimum positive number in described first data block;The positive number being in other positions in described first data block is made difference with described minimum positive number and obtains corresponding three differences, and then obtain the second data block being made up of described minimum positive number and described three differences;Data in described second data block are carried out without symbol variable-length encoding, 2 × 2 data blocks after being compressed.
S26,2 bits of employing represent the composite type of the sign bit of described 2 × 2 data blocks.
S27, the column data in described 2 × 2 data blocks deducted or obtains a new column data plus another column data, and then obtaining the 3rd data block being made up of a described new column data and another column data described;Using 1 bit to represent to operate the i-th row, the data of described i-th row carry out add operation or subtraction with the data of jth row to use 1 bit to represent, wherein, the value of i is 0 or 1, and correspondingly, the value of j is 1 or 0;Data in described 3rd data block there is symbol variable-length encoding, 2 × 2 data blocks after being compressed.
The compression method of 2 × 2 data blocks that the embodiment of the present invention provides, it is according to the composite type of 3 kinds of sign bits of described 2 × 2 data blocks, and the data of described 2 × 2 data blocks carry out the squeeze operation of different modes, 2 × 2 data blocks after being compressed.Compared with prior art, it can reduce the absolute value of residual error data of existing compress mode, to realize using less bit to represent view data, thus improves the compression ratio of view data further.
As it is shown on figure 3, the embodiment of the present invention provides a kind of image data compressing apparatus based on sign bit packet, described device includes decomposing module 31, compression module 32, synthesis module 33, wherein,
Described decomposing module 31, for being decomposed into multiple 2 × 2 data blocks by residual error data corresponding for view data;
The data of described 2 × 2 data blocks for the composite type according to the sign bit of described 2 × 2 data blocks, are carried out the squeeze operation of different modes, 2 × 2 data blocks after being compressed by described compression module 32;
Described synthesis module 33,2 × 2 data blocks after the multiple compressions that will obtain synthesize, the residual error data after being compressed.
The image data compressing apparatus based on sign bit packet that the embodiment of the present invention provides, is decomposed into multiple 2 × 2 data blocks by residual error data corresponding for view data;The data of described 2 × 2 data blocks are carried out the squeeze operation of different modes, 2 × 2 data blocks after being compressed by the composite type of the sign bit according to described 2 × 2 data blocks;2 × 2 data blocks after the multiple compressions that will obtain synthesize, the residual error data after being compressed.Compared with prior art, it can reduce the absolute value of residual error data of existing compress mode, to realize using less bit to represent view data, thus improves the compression ratio of view data further.
Further, as shown in Figure 4, the described compression module 32 in above-described embodiment includes first compression unit the 321, second compression unit the 322, the 3rd compression unit 323.
Wherein, described first compression unit 321, for being three positive negative or three negative one timings when the composite type of the sign bit of described 2 × 2 data blocks, 1 bit is used to represent the composite type of sign bit of described 2 × 2 data blocks, 2 bits are used to represent the most different sign bit location, the most different described sign bit is minus symbol position or plus sign position to use 1 bit to represent, wherein, the sign bit of data zero is just;
And for each data in described 2 × 2 data blocks are taken absolute value, obtain the first data block being made up of four positive numbers, and use 2 bits to represent the position of the minimum positive number in described first data block;The positive number being in other positions in described first data block is made difference with described minimum positive number and obtains corresponding three differences, and then obtain the second data block being made up of described minimum positive number and described three differences;Data in described second data block are carried out without symbol variable-length encoding, 2 × 2 data blocks after being compressed.
Described second compression unit 322, for when the composite type of the sign bit of described 2 × 2 data blocks is for entirely just or entirely bearing, 2 bits are used to represent the composite type of sign bit of described 2 × 2 data blocks, the concrete combined situation of sign bit of described 2 × 2 data blocks is for entirely just or entirely to bear to use 1 bit to represent, wherein, the sign bit of data zero is just;
And for each data in described 2 × 2 data blocks are taken absolute value, obtain the first data block being made up of four positive numbers, and use 2 bits to represent the position of the minimum positive number in described first data block;The positive number being in other positions in described first data block is made difference with described minimum positive number and obtains corresponding three differences, and then obtain the second data block being made up of described minimum positive number and described three differences;Data in described second data block are carried out without symbol variable-length encoding, 2 × 2 data blocks after being compressed.
Described 3rd compression unit 323, for when the composite type of sign bit of described 2 × 2 data blocks be two just two negative time, use 2 bits to represent the composite type of sign bit of described 2 × 2 data blocks, wherein, the sign bit of data zero is just;
And for being deducted by the column data in described 2 × 2 data blocks or obtaining a new column data plus another column data, and then obtain the 3rd data block being made up of a described new column data and another column data described;Using 1 bit to represent to operate the i-th row, the data of described i-th row carry out add operation or subtraction with the data of jth row to use 1 bit to represent, wherein, the value of i is 0 or 1, and correspondingly, the value of j is 1 or 0;Data in described 3rd data block there is symbol variable-length encoding, 2 × 2 data blocks after being compressed.
The data of described 2 × 2 data blocks according to the composite type of 3 kinds of sign bits of described 2 × 2 data blocks, are carried out the squeeze operation of different modes, 2 × 2 data blocks after being compressed by the compression module that the embodiment of the present invention provides.Compared with prior art, it can reduce the absolute value of residual error data of existing compress mode, to realize using less bit to represent view data, thus improves the compression ratio of view data further.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, can be by computer program and complete to instruct relevant hardware, described program can be stored in a computer read/write memory medium, this program is upon execution, it may include such as the flow process of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) or random store-memory body (RandomAccess Memory, RAM) etc..
The above; being only the detailed description of the invention of the present invention, but protection scope of the present invention is not limited thereto, any those familiar with the art is in the technical scope that the invention discloses; the change that can readily occur in or replacement, all should contain within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with scope of the claims.