CN111918062B - High-compression-rate high-reducibility present frame data compression and decompression method - Google Patents

High-compression-rate high-reducibility present frame data compression and decompression method Download PDF

Info

Publication number
CN111918062B
CN111918062B CN202010724132.4A CN202010724132A CN111918062B CN 111918062 B CN111918062 B CN 111918062B CN 202010724132 A CN202010724132 A CN 202010724132A CN 111918062 B CN111918062 B CN 111918062B
Authority
CN
China
Prior art keywords
data
quantization
compression
bits
bit stream
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.)
Active
Application number
CN202010724132.4A
Other languages
Chinese (zh)
Other versions
CN111918062A (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.)
Shanghai Dingjiukang Technology Co ltd
Original Assignee
Shanghai Dingjiukang Technology 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 Shanghai Dingjiukang Technology Co ltd filed Critical Shanghai Dingjiukang Technology Co ltd
Priority to CN202010724132.4A priority Critical patent/CN111918062B/en
Publication of CN111918062A publication Critical patent/CN111918062A/en
Application granted granted Critical
Publication of CN111918062B publication Critical patent/CN111918062B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/184Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream

Abstract

The invention discloses a method for compressing and decompressing the data of the frame with high compression rate and high reducibility, which comprises a compression method and a decompression method; the compression method comprises the steps of receiving a data frame to be processed, carrying out differential processing, carrying out WHT conversion on a differential result, carrying out coefficient interception on data subjected to WHT conversion, carrying out stepped quantization on data reserved after interception, carrying out bit stream recombination on a quantization result, obtaining byte stream data subjected to bit stream recombination, compressing the byte stream data by using a compression code, obtaining final compressed data and outputting the final compressed data. The decompression method is reverse operation and obtains decompressed data. The compression and decompression method of the frame data has the characteristics of high compression rate and high reduction rate, improves the compression rate and the reduction performance by simplifying the data processing unit, thereby reducing the occupied capacity in the storage and transmission processes, improving the transmission rate, shortening the transmission time and ensuring the real-time performance and the stability of the data.

Description

High-compression-rate high-reducibility present frame data compression and decompression method
Technical Field
The invention relates to the field of data compression, in particular to a method for compressing and decompressing data of a frame with high compression rate and high reducibility.
Background
Data compression is a technique for reducing the amount of data by re-encoding redundant information in a signal or by performing a component trade-off on a signal.
In the fields of computer science and information science, compression algorithms are used in large quantities to reduce the storage cost and the transmission cost of data, so that the aims of improving the transmission efficiency and saving the cost are fulfilled. Particularly in applications of long-distance wireless signal transmission, high-efficiency data compression enables many applications to perform transmission tasks at low bandwidth. Since the data compression technology can help reduce operation costs such as storage space or connection bandwidth, the data compression technology is a hot spot for research and technology implementation.
Data compression techniques can be divided into lossless compression and lossy compression. Lossless compression means that original data can be completely decompressed and restored through compressed data, an original data frame is completely the same as a decompressed signal, and no information is lost; lossy compression refers to the compression algorithm discarding some information during the algorithm process, so that the decompression algorithm cannot completely recover the original data from the compressed data.
In a conventional data signal compression algorithm, the compression rate is further improved by using the correlation between data frames, for example, in the h.264 encoding and decoding method, a video frame is divided into an I frame (initial frame) and a P frame (predicted frame). However, this technique has a disadvantage that when packet loss occurs during data transmission, all frames from the latest I frame to the current time need to be retransmitted for decoding, otherwise, the original signal cannot be recovered only by the P frame, thereby reducing the real-time performance of signal decompression.
In the application of medical monitoring, taking electrocardio signals as an example, if multi-lead signals are continuously collected, lead signal data generated every day can reach nearly 1 GB. Without data compression, application systems would be a great challenge for reliability of data signal transmission and management of storage consumption. Meanwhile, the huge communication traffic also increases the power consumption of the system and shortens the endurance time of the portable equipment. In addition, for the application scenario of medical monitoring, the real-time performance of data is highly required. For example, when an electrocardiographic signal of a patient is diseased, the electrocardiographic signal needs to be found in time and reported quickly, and if a non-frame compression and decompression method is adopted, once a data packet is lost, extra time delay is caused, so that the timeliness of diagnosis and discovery of the disease cannot be guaranteed. Therefore, in such application scenarios, the compression of the present frame of data is crucial to guarantee the real-time performance of the data.
Disclosure of Invention
In order to overcome the technical defects of the prior art, the application provides a method for compressing and decompressing the frame data with high compression rate and high reducibility, which is used for solving the problem that the reliability, the real-time performance and the reducibility cannot be ensured during data compression and transmission in the prior art.
The embodiment of the application provides a compression and decompression method of the frame data, which comprises a compression method and a decompression method; the compression method comprises the following steps:
s110: receiving a pending data frame X 0 ={x 1 ,...,x i ,...,x m H, the length of m;
s120: processing the data frame by using a first-order backward difference method to obtain an initial value x of the data 1 And difference result X 1 ={0,x 2 -x 1 ,...,x i -x i-1 ,...,x m -x m-1 };
S130: for difference result X 1 Performing WHT conversion to obtain Y 1 =WHT(X 1 )={y 1 ,y 2 ,...,y m-1 ,y m }; wherein WHT transform represents Y 1 =H m X 1
S140: for WHT transform coefficient Y 1 Intercepting is carried out, and when the ratio of the intercepted WHT retention coefficient energy to the original coefficient energy is not lower than a preset threshold value alpha, an intercepted retention coefficient set Y is obtained 2 ,Y 2 ={y 1 ,y 2 ,...,y k-1 ,y k }; wherein the threshold value alpha is one of the input parameters,
Figure BDA0002601063510000021
s150: collecting the truncated retention coefficient set Y 2 Dividing the coefficient into multiple sections, performing stepwise quantization to obtain quantization result Y 3
S160: for the quantization result Y in step S150 3 Respectively carrying out bit stream recombination on the data of the multiple sections of intervals to ensure that the length of the recombined bit stream is multiple of 8, and acquiring byte stream data Y after the bit stream recombination 4
S170: using LZ77 encoding and huffman encoding algorithm to reconstruct byte stream data Y in step S160 4 Performing compression coding to obtain final compressed data Y 5
S180: outputting the final compressed data Y 5
The decompression method comprises the following steps:
s190: receiving the final compressed data Y in step S180 5 For the final compressed numberAccording to Y 5 Performing reverse decompression operation and outputting decompressed data frame X' 0
Further, in the step S130, the WHT transform transforms the differential signal by using a set of orthogonal bases from the Hadamard matrix.
Further, the step S150 further includes: will Y 2 Dividing the data into n sections for step quantization; when n is 3, Y 2 The result after segmentation is
Figure BDA0002601063510000031
Namely that
Figure BDA0002601063510000032
Wherein, the first and the second end of the pipe are connected with each other,
will be provided with
Figure BDA0002601063510000033
Quantized to 16 bits length;
will be provided with
Figure BDA0002601063510000034
Quantized to 12 bits length;
will be provided with
Figure BDA0002601063510000035
Quantized to 8 bits length;
a=round(k×β),b=round(k×γ),0<β<γ<1, round is a rounded rounding function; using a quantization formula:
Figure BDA0002601063510000036
obtaining Y 3
Wherein B is the target digit of quantization, namely according to different segment numbers, B is respectively 16, 12 and 8, and the quantization result Y is obtained 3
Figure BDA0002601063510000037
Further, the step S160 further includes:
after the quantization result is obtained, bit stream recombination is respectively carried out on the data of the quantization result, after the data is split by taking 4bit as a unit, the data is sequentially arranged, recombined and complemented from high order to low order, the length of the recombined bit stream is multiple of 8, and byte stream data after the bit stream recombination is obtained.
Further, the step S160 further includes:
obtaining a quantization result
Figure BDA0002601063510000038
I.e. Y 3 Included
Figure BDA0002601063510000039
And
Figure BDA00026010635100000310
to pair
Figure BDA00026010635100000311
And
Figure BDA00026010635100000312
respectively performing bit stream recombination on the data in (1), wherein Y is obtained 4 In (1)
Figure BDA00026010635100000313
The method for bit stream reorganization comprises the following steps:
s161: splitting each 12-bit data y into: high 4bit y h Middle 4bit y m Low 4 bits y l
S162: recombining bit streams to make the high 4 bits of all data arranged together, and then arranging the middle 4 bits and low 4 bits of data in sequence;
s163: recombining the bit stream obtained in the step S162 into a data unit according to 8 bits to obtain a series of data z with the length of 8 bits; when the last bit is less than 8 bits, using bit0 to complete the process and obtain Y 4 In (1)
Figure BDA0002601063510000041
In accordance with the steps S161-S163,respectively reacquire
Figure BDA0002601063510000042
And
Figure BDA0002601063510000043
then, the byte stream data after bit stream recombination is respectively recorded as:
Figure BDA0002601063510000044
and
Figure BDA0002601063510000045
obtaining byte stream data Y after bit stream recombination 4
Figure BDA0002601063510000046
Further, the compression method further comprises:
saving the length m of original data; saving initial value x of data obtained during differential processing 1 (ii) a Saving the offset value of each interval in the step quantization process during quantization
Figure BDA0002601063510000047
Scaling values
Figure BDA0002601063510000048
Figure BDA0002601063510000049
Target quantization bit number B.
Further, the step S190 further includes:
s191: receiving the final compressed data Y 5
S192: final compressed data Y using LZ77 decoding algorithm 5 Decoding to obtain decoded data stream
Figure BDA00026010635100000410
S193: for decoded data stream
Figure BDA00026010635100000411
And
Figure BDA00026010635100000412
carrying out data stream inverse recombination to obtain quantized original data
Figure BDA00026010635100000413
And
Figure BDA00026010635100000414
s194: according to the offset value, the scaling value and the target quantization digit of each quantization interval stored in the received compression process, the recovery quantization formula is used as follows:
Figure BDA00026010635100000415
restoring data values prior to quantization
Figure BDA00026010635100000416
And
Figure BDA00026010635100000417
to obtain
Figure BDA00026010635100000418
S195: according to the length m of the original data stored in the received compression process, in Y 2 To obtain Y 'by supplementing 0 at the end of' 1 So that Y' 1 The data length of (1) is m;
s196: to Y' 1 Performing WHT inverse transformation to obtain
Figure BDA00026010635100000419
S197: to X' 1 Integration, initial value x saved in post-receiving compression process 1 To give X' 0 ,X′ 0 =cumsum(X′ 1 )+x 1 Wherein cumsum is a cumulative sum function;
s198: outputting decompressed data frame X' 0
The present frame data compression and decompression method with high compression rate and high reducibility provided in the embodiment of the present application has at least one of the following technical effects:
1. the data frame to be processed is subjected to differential processing by adopting a first-order backward difference method, so that the distribution concentration of data values is improved, the method is favorably applied to signal data processing such as electrocardiosignals, motion acceleration signals, respiratory signals and the like, the data which embody time sequences has certain continuity between adjacent data, the difference data is more concentrated in a small value range, and the integrity of the data is ensured.
2. As the WHT conversion is adopted, only addition and subtraction are involved, the operation rate is improved, the operation unit is simplified, the WHT conversion is compatible with integer signals, and compared with floating point operation, the speed of the WHT conversion operation is improved by 2 times to 4 times by integer calculation of an embedded operation unit; and, the WHT transform has a butterfly acceleration algorithm similar to FFT, i.e., fast WHT (fwht); in addition, the WHT transformation reduces the amplitude of the transformed signal, has the effect similar to difference, and has the characteristic of concentrated energy of frequency domain signals.
3. Due to the adoption of the step-type quantized data, the data resolution precision is reduced.
4. As the bit stream recombination technology is adopted, more data correlation is caused, so that the entropy value of data is reduced, for most data, adjacent data have the same amplitude value and are reflected on bit data, namely, the high-order data are the same, but the low-order data are different, therefore, the high-order data are gathered together by the bit stream recombination method, and finally, the generated byte stream data have a plurality of data with the same value in a high-order area, so that the efficiency of subsequent compression coding is improved.
5. Because the adopted compression and decompression technology falls the data value on the binary bit, the compression rate is flexibly controlled to improve the compression rate and the high recovery rate, all data are processed into the binary bit, and the method is irrelevant to the original data format, thereby expanding the data processing range and improving the applicability of data processing.
Drawings
Fig. 1 is a schematic flow chart of a present frame data compression and decompression method in the embodiment of the present application;
FIG. 2 shows an example of the present application in which 12 bits are long
Figure BDA0002601063510000051
A schematic diagram of bit stream recombination;
FIG. 3 is a flowchart of an exemplary decompression process
Figure BDA0002601063510000061
The schematic diagram of the bit stream arrangement of (a);
FIG. 4 shows an exemplary decompression process
Figure BDA0002601063510000062
The permutation schematic of the reordering recovery of (1);
fig. 5 is a schematic diagram illustrating comparison between original electrocardiographic data and decompressed electrocardiographic data according to an embodiment of the present application.
Detailed Description
In order to better understand the technical solution of the present invention, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Example one
Referring to fig. 1, the present embodiment provides a present frame data compression and decompression method with high compression rate and high reducibility, which includes a compression method and a decompression method. The compression method comprises the following steps:
step S110: receiving a pending data frame X 0 ={x 1 ,...,x i ,...,x m H, the length of m. In this step, an input data frame of a specified length m is received.
Step S120: processing the data frame by using a first-order backward difference method to obtain an initial value x of the data 1 And a differential signal X 1 ={0,x 2 -x 1 ,...,x i -x i-1 ,...,x m -x m-1 }。
In this step, the initial value x of the data is calculated 1 Stored in the header data of the packet.
In this step, the data frame is processed by a first-order backward difference method, so as to improve the distribution concentration in the data value. In some application scenarios, for example, electrocardio signals, motion acceleration signals, respiration signals, etc., the data stored in time series have certain continuity between adjacent data, and the difference data is more concentrated in a small value range, so that the first-order backward difference method is adopted in the step to improve the distribution concentration of the data values.
Step S130: for difference result X 1 Performing WHT conversion to obtain Y 1 =WHT(X 1 )={y 1 ,y 2 ,...,y m-1 ,y m }; wherein WHT transform represents Y 1 =H m X 1
In this step, WHT transform is denoted as Walsh-Hadamard transform (WHT). The WHT transform transforms the differential signal using a set of orthogonal bases from a Hadamard matrix. Further, the Hadamard matrix is a square matrix with ± 1 as elements and two arbitrary rows orthogonal to each other, and is defined by a recursive method as follows: h 1 =1,
Figure BDA0002601063510000063
The size of rows and columns of the Hadamard matrix must be a power of 2, and when the input length is not a power of 2, the input length is converted into a power of 2 by complementing 0; and is
Figure BDA0002601063510000071
Wherein I is a unit matrix of NxN, and the inverse transformation matrix of WHT is
Figure BDA0002601063510000072
Deriving the WHT transform can be expressed as: y is 1 =H m X 1
For example,
Figure BDA0002601063510000073
obviously, the size of the rows and columns of a Hadamard matrix must be a power of 2, e.g.If the length of the input signal is not the power of 2, the problem can be solved by complementing 0. And the number of the first and second electrodes,
Figure BDA0002601063510000074
where I is an NxN unit matrix, the inverse transformation matrix of WHT is thus
Figure BDA0002601063510000075
It follows that the WHT transform can be expressed as: y is 1 =H m X 1
The WHT transform is adopted in this step, instead of the conventional DCT transform, and is mainly based on the following reasons. Firstly, the WHT only involves addition and subtraction, and the DCT involves trigonometric function and multiplication and addition of floating point, so compared with the DCT, the operation rate of the WHT is faster on a general CPU or an embedded operation unit, and the operation unit required by calculation is much simpler; secondly, the WHT conversion is compatible with integer signals, and the integer calculation of an embedded operation unit can be as fast as 2 times to 4 times compared with floating point operation; again, the WHT transform has a butterfly acceleration algorithm similar to FFT, i.e., Fast WHT (FWHT). On the other hand, the WHT transform is also used to further reduce the amplitude of the transformed signal, because ± 1 in the WHT transform matrix actually performs a differential-like effect and has a characteristic of energy concentration of the frequency domain signal.
Step S140: for WHT transform coefficient Y 1 Intercepting, and when the ratio of the intercepted WHT retention coefficient energy to the original coefficient energy is not lower than a preset threshold value alpha, acquiring an intercepted retention coefficient Y 2 ={y 1 ,y 2 ,...,y k-1 ,y k }; wherein, the threshold value alpha is one of the input parameters,
Figure BDA0002601063510000076
step S150: collecting the truncated retention coefficient set Y 2 Dividing the coefficient into multiple sections, performing stepwise quantization to obtain quantization result Y 3
In this step, for the number processed in time seriesIt is said that after the WHT conversion, the energy thereof is concentrated in the middle and low frequency part, i.e., Y 2 The coefficients in (a) will show a decreasing trend with increasing frequency. In order to quantize the WHT transform coefficient more effectively, the present embodiment adopts a step quantization method by utilizing the characteristic that the WHT coefficient decreases in amplitude with the increase in frequency.
The method further comprises the following steps: will Y 2 The step quantization is performed in n segments, preferably n is 3, i.e. when n is 3, Y is selected 2 The result after segmentation is
Figure BDA0002601063510000081
Then
Figure BDA0002601063510000082
Wherein, will
Figure BDA0002601063510000083
Quantized to 16 bits length; will be provided with
Figure BDA0002601063510000084
Quantized to 12 bits length; will be provided with
Figure BDA0002601063510000085
Quantized to 8 bits length; where a is round (k × β), b is round (k × γ), 0<β<γ<1, round is a rounded rounding function.
In this step, a quantization formula is used:
Figure BDA0002601063510000086
and Y is obtained. Wherein B is the quantization target digit, namely according to different segment numbers, B is respectively 16, 12 and 8, and the quantization result is obtained: y is 3
Figure BDA0002601063510000087
In this step, the obtained offset value, scaling value, and quantization target bit number are stored in header data of the packet, and decompression is performed using information stored in the header data.
Step S160: for the quantization result Y in step S150 3 Respectively carrying out bit stream recombination on the data of the multiple sections of intervals to ensure that the length of the recombined bit stream is a multiple of 8, and acquiring byte stream data Y after the bit stream recombination 4
Step S160 further includes: after the quantization result is obtained, bit stream recombination is respectively carried out on the data of the quantization result, after the data is split by taking 4 bits as a unit, the data is sequentially arranged, recombined and complemented from high bits to low bits, the length of the recombined bit stream is made to be multiple of 8, and byte stream data after the bit stream recombination is obtained. Wherein the length of the recombined bit stream is made to be a multiple of 8, so that the subsequent access can be performed according to bytes.
In this embodiment, step S160 further includes:
obtaining a quantization result
Figure BDA0002601063510000088
I.e. Y 3 Included
Figure BDA0002601063510000089
And
Figure BDA00026010635100000810
to pair
Figure BDA00026010635100000811
And
Figure BDA00026010635100000812
wherein the data in (1) is subjected to bit stream reconstruction respectively, wherein the data has a length of 12 bits
Figure BDA00026010635100000813
For example, referring to FIG. 2, Y is obtained 4 In (1)
Figure BDA00026010635100000814
The method for reconstructing a bitstream of (1) comprises the following steps.
Step S161: splitting each 12-bit data y into: high 4bit y h Middle 4bit y m Low 4 bits y l
Step S162: the bit streams are recombined so that the upper 4 bits of all data are arranged together, followed by the middle 4 bits and lower 4 bits of data arranged in sequence.
Step S163: recombining the bit streams obtained in the step S162 by taking 8 bits as a data unit to obtain a series of data z with the length of 8 bits; wherein, when the last bit is less than 8 bits, it is filled up by using bit0, and the process can be understood by using FIG. 2, and Y is obtained 4 In (1)
Figure BDA0002601063510000091
In this step, the purpose of bit stream reorganization is mainly to create more data dependencies to reduce the entropy of the data. For most data, the adjacent data have the same amplitude, which is reflected in the bit data, that is, the high-order data are the same, but the low-order data are different, so that the high-order data are gathered together by the bit stream recombination means in the step, and finally, the generated byte stream data has many data with the same value in the high-order area, which is beneficial to improving the efficiency of subsequent compression coding.
According to steps S161-S163, respectively reacquires
Figure BDA0002601063510000092
And
Figure BDA0002601063510000093
specifically, according to step S161, the method comprises
Figure BDA0002601063510000094
And
Figure BDA0002601063510000095
carrying out a resolution wherein
Figure BDA0002601063510000096
Is split into high 4 bits y h Middle 4bit y m1 、y m2 Low 4 bits y l (ii) a Will be provided with
Figure BDA0002601063510000097
Is split into high 4 bits y h Low 4 bits y l
Further according to step S162: recombining bit streams to make the high 4 bits of all data arranged together, and then arranging the middle 4 bits and low 4 bits of data in sequence; or all the upper 4 bits of data are arranged together and then the lower 4 bits of data are arranged in sequence.
Still further, according to step S163: recombining the bit stream obtained in the step S162 into a data unit according to 8 bits to obtain a series of data z with the length of 8 bits; wherein, when the last bit is less than 8 bits, using bit0 to complete the process; respectively obtain Y 4 In (1)
Figure BDA0002601063510000098
And
Figure BDA0002601063510000099
therefore, in this embodiment, according to steps S161 to S163, the data is acquired again
Figure BDA00026010635100000910
And
Figure BDA00026010635100000911
then, the byte stream data after bit stream recombination is respectively recorded as:
Figure BDA00026010635100000912
and
Figure BDA00026010635100000913
obtaining byte stream data Y after bit stream recombination 4 Memory for recording
Figure BDA00026010635100000914
Step S170: the byte stream data Y reconstructed in step S160 is subjected to LZ77 (adaptive dictionary model) encoding and huffman encoding algorithm 4 Performing compression encoding to obtain final pressureReduced data Y 5
In this embodiment, in the whole compression process, the main objective of the WHT transformation in steps S120-S130 is to increase the concentration of data distribution, so that the data amplitude in the time domain is concentrated toward 0 value, and the data in the frequency domain is concentrated toward the middle and low frequencies. Steps 140 and 150 are the main sources of lossy compression, step 140 truncates the data in the frequency domain, and step 150 actually reduces the data resolution accuracy. Step 160 and step 170 are compression encoding parts, and step 160 recombines the code stream to reduce the entropy value, which can be regarded as the preparation work of step 160.
S180: outputting the final compressed data Y 5
In this step, the final compressed data Y is outputted 5 Instead of just transmitting and storing the data packets, the data packets in this embodiment comprise at least two parts, the final compressed data Y 5 And header data formed by storing and combining in the compression process.
Therefore, the compression method in this step further includes: saving the length m of original data; saving initial value x of data obtained during differential processing 1 (ii) a Saving the offset value of each interval in the step quantization process during quantization
Figure BDA0002601063510000101
Scaling values
Figure BDA0002601063510000102
Target quantization bit number B. Further using the stored original data length m and the data initial value x 1 Target quantization bit number B, offset value offset B And scale value scale B The header data of the data packet is composed. Further, the scaling values scale of the three quantization intervals in the present embodiment B Including scale 16 ,scale 12 ,scale 8 (ii) a Offset value offset B Including offset 16 ,offset 12 ,offset 8
Based on the compression algorithm described above, the present embodiment also provides a decompression method corresponding thereto. The decompression method in this embodiment includes the following steps:
step S190: receiving the final compressed data Y in step S180 5 For the final compressed data Y 5 Carries out backward decompression and outputs decompressed data frame X' 0
In this step, the final compressed data Y is received 5 The method also comprises receiving data packet, splitting data packet, respectively receiving header data and final compressed data Y 5 . Wherein, the receiving head data further comprises the length m of the original data and the initial value x of the data stored in the receiving and compressing process 1 Target quantization bit number B, offset value offset B And scale value scale B
Step S190 further includes:
step S191: receiving the final compressed data Y 5
Step S192: final compressed data Y using LZ77 decoding algorithm 5 Decoding to obtain decoded data stream
Figure BDA0002601063510000103
Step S193: for decoded data stream
Figure BDA0002601063510000104
And
Figure BDA0002601063510000105
carrying out data stream inverse recombination to obtain quantized original data
Figure BDA0002601063510000106
And
Figure BDA0002601063510000107
wherein, in order
Figure BDA0002601063510000108
For example, by rearranging the bit streams shown in fig. 3, the procedure returns to fig. 4, and three sets of quantized data are obtained by this step 193:
Figure BDA0002601063510000111
and
Figure BDA0002601063510000112
step S194: according to the offset value, the scaling value and the target quantization bit number of each quantization interval stored in the received compression process, the recovery quantization formula is used as follows:
Figure BDA0002601063510000113
restoring data values prior to quantization
Figure BDA0002601063510000114
And
Figure BDA0002601063510000115
to obtain
Figure BDA0002601063510000116
Step S195: according to the length m of the original data stored in the received compression process, in Y 2 To obtain Y 'by supplementing 0 at the end of' 1 So that Y' 1 Has a data length of m.
Step S196: to Y' 1 Performing WHT inverse transformation to obtain
Figure BDA0002601063510000117
Step S197: to X' 1 Integrating and then receiving the initial value x stored in the compression process 1 Obtaining decompressed data frame X' 0 ,X′ 0 =cumsum(X′ 1 )+x 1 Where cumsum is the cumulative sum function.
Step S198: outputting decompressed data frame X' 0 . And ending the decompression.
Referring to fig. 5, it is a comparison chart of the present embodiment for compression and decompression, where the received data frame is the collected electrocardiographic data, and the electrocardiographic data is compressed. Wherein the electrocardiogram numberThe data window frame size m is 2048 according to the bit width of 24 bits. After differential processing is performed by using a first-order backward difference method, WHT transformation is performed, in this application example, a system interception threshold α of WHT transformation is 0.67, and the coefficient length after interception is 900. The truncated reserved coefficients are quantized in a stepwise manner, with a quantization range coefficient β of 0.05 and γ of 0.1, thereby obtaining a of 50 and b of 100. The data compression ratio in this embodiment is 14% to 15%. After decompression, the error value of the original data and the decompressed data is about 1%, and the error calculation formula is as follows:
Figure BDA0002601063510000118
wherein x is i As raw data, y i Is decompressed data.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (6)

1. A high compression rate high reducing performance frame data compression decompression method, characterized by, including compression method and decompression method; the compression method comprises the following steps:
s110: receiving a pending data frame X 0 ={x 1 ,...,x i ,...,x m H, the length of m;
s120: processing the data frame by using a first-order backward difference method to obtain an initial value x of the data 1 And difference result X 1 ={0,x 2 -x 1 ,...,x i -x i-1 ,...,x m -x m-1 };
S130: for difference result X 1 Performing WHT conversion to obtain Y 1 =WHT(X 1 )={y 1 ,y 2 ,...,y m-1 ,y m }; wherein WHT transform represents Y 1 =H m X 1
S140: for WHT transform coefficient Y 1 Intercepting is carried out, and when the ratio of the intercepted WHT retention coefficient energy to the original coefficient energy is not lower than a preset threshold value alpha, an intercepted retention coefficient set Y is obtained 2 ,Y 2 ={y 1 ,y 2 ,...,y k-1 ,y k }; wherein the threshold value alpha is one of the input parameters,
Figure FDA0003538812800000011
s150: collecting the truncated retention coefficient set Y 2 Dividing the coefficient into multiple sections, performing stepwise quantization to obtain quantization result Y 3
The step S150 further includes: will Y 2 Dividing the data into n sections to carry out step-type quantization; when n is 3, Y 2 The result after segmentation is
Figure FDA0003538812800000012
Namely, it is
Figure FDA0003538812800000013
Wherein, the first and the second end of the pipe are connected with each other,
will be provided with
Figure FDA0003538812800000014
Quantized to 16 bits length;
will be provided with
Figure FDA0003538812800000015
Quantized to 12 bits length;
will be provided with
Figure FDA0003538812800000016
Quantized to 8 bits length;
a=round(k×β),b=round(k×γ),0<β<γ<1, round is a rounded rounding function; using a quantization formula:
Figure FDA0003538812800000017
obtaining Y 3
B is a quantization target digit, and B is 16, 12 and 8 respectively according to different segment numbers to obtain a quantization result Y 3
Figure FDA0003538812800000018
S160: for the quantization result Y in step S150 3 Respectively carrying out bit stream recombination on the data of the multiple sections of intervals to enable the length of the recombined bit stream to be multiple of 8, and acquiring byte stream data Y after the bit stream recombination 4
S170: using LZ77 encoding and Huffman encoding algorithm to the byte stream data Y recombined in step S160 4 Performing compression coding to obtain final compressed data Y 5
S180: outputting the final compressed data Y 5
The decompression method comprises the following steps:
s190: receiving the final compressed data Y in step S180 5 For the final compressed data Y 5 Performing reverse decompression operation and outputting decompressed data frame X' 0
2. The method of claim 1, wherein the WHT transform transforms the differential signal using a set of orthogonal bases from a Hadamard matrix in step S130.
3. The method of claim 1, wherein the step S160 further comprises:
after the quantization result is obtained, bit stream recombination is respectively carried out on the data of the quantization result, after the data is split by taking 4 bits as a unit, the data is sequentially arranged, recombined and complemented from high bits to low bits, the length of the recombined bit stream is made to be multiple of 8, and byte stream data after the bit stream recombination is obtained.
4. The method of claim 3, wherein the step S160 further comprises:
obtaining a quantization result
Figure FDA0003538812800000021
I.e. Y 3 Included
Figure FDA0003538812800000022
And with
Figure FDA0003538812800000023
To pair
Figure FDA0003538812800000024
And
Figure FDA0003538812800000025
respectively performing bit stream recombination on the data in (1), wherein Y is obtained 4 In
Figure FDA0003538812800000026
The method for bit stream reorganization comprises the following steps:
s161: splitting each 12-bit data y into: high 4bit y h Middle 4bit y m Low 4 bits y l
S162: recombining bit streams to make the high 4 bits of all data arranged together, and then arranging the middle 4 bits and low 4 bits of data in sequence;
s163: recombining the bit stream obtained in the step S162 into a data unit according to 8 bits to obtain a series of data z with the length of 8 bits; when the last bit is less than 8 bits, the Y is obtained by utilizing bit0 for complement 4 In (1)
Figure FDA0003538812800000027
According to steps S161-S163, respectively reacquires
Figure FDA0003538812800000028
And
Figure FDA0003538812800000029
then, the byte stream data after bit stream recombination is respectively recorded as:
Figure FDA00035388128000000210
and
Figure FDA00035388128000000211
obtaining byte stream data Y after bit stream recombination 4
Figure FDA00035388128000000212
5. The method of claim 2, wherein the compression method further comprises: saving the length m of original data; saving initial value x of data obtained during differential processing 1 (ii) a Saving the offset value of each interval in the step quantization process during quantization
Figure FDA00035388128000000313
Scaling values
Figure FDA0003538812800000031
Figure FDA0003538812800000032
Target quantization bit number B.
6. The method of claim 5, wherein the step S190 further comprises:
s191: receiving the final compressed data Y 5
S192: final compressed data Y using LZ77 decoding algorithm 5 Decoding to obtain decoded data stream
Figure FDA0003538812800000033
S193: for decoded data stream
Figure FDA0003538812800000034
And
Figure FDA0003538812800000035
carrying out data stream inverse recombination to obtain quantized original data
Figure FDA0003538812800000036
And
Figure FDA0003538812800000037
s194: according to the offset value, the scaling value and the target quantization digit of each quantization interval stored in the received compression process, the recovery quantization formula is used as follows:
Figure FDA0003538812800000038
restoring data values prior to quantization
Figure FDA0003538812800000039
And
Figure FDA00035388128000000310
to obtain
Figure FDA00035388128000000311
S195: according to the length m of the original data stored in the received compression process, in Y 2 To obtain Y 'by supplementing 0 at the end of' 1 So that Y' 1 The data length of (1) is m;
s196: to Y' 1 Performing WHT inverse transformation to obtain
Figure FDA00035388128000000312
S197: to X' 1 Integration, and initial value x saved in post-receiving compression process 1 To give X' 0 ,X′ 0 =cumsum(X′ 1 )+x 1 Wherein cumsum is a cumulative sum function;
s198: outputting decompressed data frame X' 0
CN202010724132.4A 2020-07-24 2020-07-24 High-compression-rate high-reducibility present frame data compression and decompression method Active CN111918062B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010724132.4A CN111918062B (en) 2020-07-24 2020-07-24 High-compression-rate high-reducibility present frame data compression and decompression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010724132.4A CN111918062B (en) 2020-07-24 2020-07-24 High-compression-rate high-reducibility present frame data compression and decompression method

Publications (2)

Publication Number Publication Date
CN111918062A CN111918062A (en) 2020-11-10
CN111918062B true CN111918062B (en) 2022-08-05

Family

ID=73280436

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010724132.4A Active CN111918062B (en) 2020-07-24 2020-07-24 High-compression-rate high-reducibility present frame data compression and decompression method

Country Status (1)

Country Link
CN (1) CN111918062B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105100810B (en) * 2014-05-16 2018-02-13 中国科学院声学研究所 Compression of images decompressing method and system in a kind of imaging sonar real time processing system
JPWO2017183448A1 (en) * 2016-04-19 2019-02-21 ソニー株式会社 Data processing apparatus, data processing method, and program
CN106331719B (en) * 2016-09-28 2019-04-26 武汉大学 A kind of image data compression method split based on the Karhunen-Loeve transformation error space
CN106791858B (en) * 2017-01-09 2019-06-04 国家新闻出版广电总局电影数字节目管理中心 A kind of high sampling rate rgb video data lossless compression method
CN110149514B (en) * 2019-05-31 2023-05-05 上海联影医疗科技股份有限公司 Compression method and device of scanning data, acquisition system and medical imaging system

Also Published As

Publication number Publication date
CN111918062A (en) 2020-11-10

Similar Documents

Publication Publication Date Title
CN107832837B (en) Convolutional neural network compression method and decompression method based on compressed sensing principle
JP4906855B2 (en) Efficient coding and decoding of transform blocks
US11074723B2 (en) Lossless compression of fragmented image data
JP5052541B2 (en) Method for compressing SAR data and apparatus for encoding SAR data
Giorgi A combined approach for real-time data compression in wireless body sensor networks
CN110021369B (en) Gene sequencing data compression and decompression method, system and computer readable medium
WO2021027487A1 (en) Encoding method and related device
CN111669588B (en) Ultra-high definition video compression coding and decoding method with ultra-low time delay
CN114520659A (en) Method for lossless compression and decoding of data by combining rANS and LZ4 encoding
CN105163130B (en) A kind of Lossless Image Compression Algorithm method based on discrete Tchebichef orthogonal polynomial
CN111918062B (en) High-compression-rate high-reducibility present frame data compression and decompression method
CN113873094A (en) Chaotic compressed sensing image encryption method
Solís-Rosas et al. An enhanced run length encoding using an elegant pairing function for medical image compression
Kadhim et al. An improved image compression technique using ezw and sphit algorithms
Tornekar et al. Comparative study of lossless ECG signal compression techniques for wireless networks
CN108600750A (en) Multiple description coded, coding/decoding method based on KSVD and system
CN105472395B (en) A kind of Lossless Image Compression Algorithm method based on discrete Krawtchouk orthogonal polynomial
Ibrahim et al. A Chinese Remainder Theorem based enhancements of Lempel-Ziv-Welch and Huffman coding image compression
Elaskary et al. Hybrid DCT/Quantized Huffman compression for electroencephalography data
KR100462789B1 (en) method and apparatus for multi-symbol data compression using a binary arithmetic coder
Ashraf et al. A low-power area-efficient design and comparative analysis for high-resolution neural data compression
CN110708561A (en) Underwater information acquisition and transmission method based on compressed sensing and channel coding
Asolkar et al. Review of data compression and different techniques of data compression
Al-Busaidi et al. Packet-size-controlled ECG compression algorithm based on discrete wavelet transform and running length encoding
Yu et al. Lossless compression of multi-dimensional medical image data using binary-decomposed high-order entropy coding

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