Dynamic switching method for lossy or lossless compression of fixed bandwidth information data

By dynamically judging the energy value of the frame in the audio data processing and switching the lossy or lossless compression method, the problem of unfixed bandwidth in the prior art is solved, and efficient audio data transmission under fixed bandwidth is realized.

CN114724567BActive Publication Date: 2025-04-15SAVITECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011500408.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-18
Publication Date
2025-04-15
Estimated Expiration
2040-12-18

AI Technical Summary

Technical Problem

When the prior art realizes lossy or lossless compression of fixed bandwidth audio data, the bandwidth is not fixed, which increases the complexity and instability of network transmission and processing.

Method used

By calculating the energy value of the original audio data of each frame, determining whether it is greater than the predetermined maximum energy value, and dynamically switching the lossy or lossless compression method. Specific steps include calculating the energy value of the frame, deciding whether to perform lossy or lossless compression, and if necessary, performing improved discrete cosine transformation and window function operations.

Benefits of technology

It realizes lossy or lossless compression dynamically switched under fixed bandwidth, reduces the time-consuming compression operation, avoids invalid lossless compression, and improves the transmission efficiency and stability of audio data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114724567B_ABST
    Figure CN114724567B_ABST
Patent Text Reader

Abstract

The present application discloses a method for dynamically switching between lossy and lossless compression of fixed bandwidth information data, comprising the following steps: calculating a predetermined maximum energy value of each frame in a plurality of frames that can be losslessly compressed according to a set bandwidth; reading original information data of each frame; calculating an energy value of the original information data of each frame; and determining whether the energy value of the original information data of each frame is greater than the predetermined maximum energy value, if so, compressing the original information data of the frame losslessly, if not, compressing the original information data of the frame losslessly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a method for compressing a message data stream, and more particularly to a method for dynamically switching between lossy or lossless compression of message data with a fixed bandwidth. Background Art

[0002] Digital audio data is usually encoded frame by frame and then transmitted to the receiving end via a wired or wireless network for decoding and playback. There are two encoding methods: lossy compression and lossless compression. Lossless compression can obtain audio data that is completely consistent with the original data after decompression, but the compression efficiency of lossless compression is usually poorer than that of lossy compression, which removes the subtle differences in sound that are usually indistinguishable to the human ear. General users care about ease of use and stability, while music lovers who pursue high sound quality hope that the degree of audio distortion is as small as possible, and it is best to achieve the original sound reproduction.

[0003] To solve the above problems, MPEG-4SLS proposes a hybrid lossy and lossless compression method to meet the different needs of two types of users. It adds the difference between the original audio data and the lossy compression base. When playing, it can only transmit part or all of the lossy compressed data according to the needs, such as Advanced Audio Coding (AAC) lossy compression base plus the difference to complete lossless compression. However, compared with AAC's bandwidth of 128Kbps, MPEG-4SLS has greatly increased, and it is no longer a fixed bandwidth, but it increases the complexity and instability of network transmission and processing. Summary of the invention

[0004] Based on this, the technical problem to be solved by the present application is to provide a method for dynamically switching between lossy or lossless compression of fixed bandwidth information data in view of the deficiencies in the prior art, which comprises the following steps: calculating a predetermined maximum energy value of each frame in a plurality of frames that can be losslessly compressed according to a set bandwidth; reading original information data of each frame; calculating an energy value of the original information data of each frame; and determining whether the energy value of the original information data of each frame is greater than the predetermined maximum energy value, if so, compressing the original information data of the frame lossily to generate information lossy compressed data, if not, compressing the original information data of the frame losslessly to generate information lossless compressed data.

[0005] According to an exemplary embodiment, the method for dynamically switching between lossy or lossless compression of fixed bandwidth audio data further comprises the following steps: calculating the square value of the amplitude of each waveform in the multiple waveforms of the audio signal of the original audio data of each frame; summing up the multiple square values ​​of the multiple waveforms to generate a total energy value; and dividing the total energy value by the number of the multiple waveforms to obtain an average energy value, taking the logarithm of the average energy value to calculate the energy of the original audio data of each frame, which is expressed by the following equation: E=log((x1 2 +x2 2 +…+x n 2 ) / n), where E represents the energy of the original audio data of each frame, x1 to x n Respectively represent multiple amplitudes of the multiple waveforms, and n represents the number of the multiple waveforms.

[0006] According to an exemplary embodiment, the method for dynamically switching between lossy or lossless compression of fixed bandwidth audio data further comprises the following steps: determining whether the energy value of the original audio data of each frame is greater than a predetermined maximum energy value, if so, performing lossy compression on the original audio data of the frame to generate lossy compressed audio data, if not, executing the next step; determining whether the previous frame of the current frame is lossless compressed, if so, performing lossless compression on the original audio data of the current frame to generate lossless compressed audio data without executing subsequent steps, if not, executing subsequent steps in sequence; applying a window function of a modified discrete cosine transform (MDCT) to the original audio data of the previous frame, and calculating function audio data according to a time-domain aliasing cancellation (TDAC) method; and performing lossless compression on the function audio data and the original audio data of the current frame to generate lossless compressed audio data.

[0007] According to an exemplary embodiment, the method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data further comprises the following steps: calculating a predetermined maximum length allowed after compression of the original audio data of each frame according to the set bandwidth; determining whether the data length of the lossless compressed audio data of each frame is greater than the predetermined maximum length, if not, retaining the lossless compressed audio data; if so, performing lossy compression on the original audio data of the frame to generate lossy compressed audio data, replacing the lossless compressed audio data having a data length greater than the predetermined maximum length.

[0008] According to an exemplary embodiment, the method for dynamically switching between lossy and lossless compression of fixed bandwidth information data further comprises the following steps: compressing the original information data of the previous frame in a lossy manner; determining to compress the original information data of the current frame in a lossy manner; applying a window function to the original information data of the previous frame and the original information data of the current frame, performing a modified discrete cosine transform, and calculating function information data; and compressing the function information data in a lossy manner to generate information lossy compressed data.

[0009] According to an exemplary embodiment, the method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data further comprises the following steps: compressing the original audio data of the previous frame losslessly; determining to compress the original audio data of the current frame losslessly; applying a window function of a modified discrete cosine transform to the original audio data of the previous frame to calculate function audio data according to a time domain anti-aliasing method; and losslessly compressing the function audio data together with the complete original audio data of the current frame to generate audio lossless compressed data.

[0010] According to an exemplary embodiment, the method for dynamically switching between lossy or lossless compression of fixed bandwidth audio data further comprises the following steps: losslessly compressing the original audio data of the previous frame to generate lossless compressed audio data of the previous frame; and determining to losslessly compress the original audio data of the current frame to generate lossless compressed audio data of the current frame.

[0011] According to an exemplary embodiment, the method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data further comprises the following steps: losslessly compressing the original audio data of the previous frame to generate lossless compressed audio data; applying a window function to the original audio data of the previous frame and the original audio data of the current frame, and performing a modified discrete cosine transform to calculate a function audio data; and lossily compressing the function audio data. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 FIG. 4 is a flow chart of compression steps of a method for dynamically switching lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention.

[0013] Figure 2 The present invention is a flowchart of the decompression steps of the method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data according to an embodiment of the present invention.

[0014] Figure 3 FIG. 1 is a schematic diagram of overlapping original audio data of multiple frames in a method for dynamically switching lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention.

[0015] Figure 4The present invention is a method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data, and a schematic diagram of decompression of a lossy compressed previous frame and a current frame.

[0016] Figure 5 The invention is a method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data according to an embodiment of the present invention, and a schematic diagram of decompression of a lossy compressed previous frame and a lossless compressed current frame.

[0017] Figure 6 The invention is a method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data, and a schematic diagram of decompression of a lossless compressed previous frame and a current frame.

[0018] Figure 7 The invention is a schematic diagram of a method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data, and decompression of a previous frame of lossless compression and a current frame of lossy compression. DETAILED DESCRIPTION

[0019] See also Figure 1 , which is a compression step flow chart of a method for dynamically switching lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention. Figure 1 As shown, the method for dynamically switching lossy or lossless compression of fixed bandwidth audio data of an embodiment of the present invention may include steps S101 to S115, and the execution order, content, and number of these steps can be adjusted according to actual needs. These steps S101 to S115 are executed for each of the multiple frames to individually determine whether each frame uses lossy compression or lossless compression under a preset bandwidth / fixed bandwidth. Different frames may use different compression methods, for example but not limited to the previous frame using lossy compression, and the current frame dynamically switches to using lossless compression. For the convenience of explanation, the currently processed frame is referred to as the current frame in the following.

[0020] In step S101, the energy value of the original audio data of the current frame is calculated. For example, the square value of the amplitude of each waveform in the multiple waveforms of the audio signal of the original audio data of each frame is calculated. Then, the multiple square values ​​of the multiple waveforms are summed up to generate a total energy value. The total energy value is divided by the number of the multiple waveforms to obtain an average energy value. Then, the logarithm of the average energy value is taken to calculate the energy of the original audio data of each frame. It can be expressed as the following equation: E=log((x1 2 +x2 2 +…+x n 2 ) / n), where E represents the energy of the original audio data of each frame, x1 to x n Respectively represent a plurality of amplitudes of a plurality of waveforms, and n represents the number of the plurality of waveforms / the number of the plurality of amplitudes obtained.

[0021] In step S103, a predetermined maximum energy value that can be losslessly compressed is calculated according to a set bandwidth, and it is determined whether the energy value of the original audio data of the current frame is greater than the predetermined maximum energy value. If the energy value of the original audio data of the current frame is greater than the predetermined maximum energy value, that is, E>Emax (where E represents the energy value of the original audio data of the current frame, and Emax represents the predetermined maximum energy value), it is determined to select a lossy compression method, and then step S105 is executed. On the contrary, if the energy value of the original audio data of the current frame is not greater than (i.e., equal to or less than) the predetermined maximum energy value, it is determined to select a lossless compression method, and then step S107 is executed.

[0022] In step S105, the original audio data of the current frame having an energy value greater than the predetermined maximum energy value is lossily compressed to generate audio lossy compressed data. In this way, it is possible to avoid the situation where lossless compression is still attempted when the energy value of the original audio data is too large, resulting in a waste of computing time. If necessary, step S115 can be executed next.

[0023] In step S107, it is determined whether the original audio data of the previous frame of the current frame is compressed using a lossless compression method.

[0024] If the original audio data of the previous frame is compressed with loss, in order to successfully restore the complete original audio data of the previous frame during decompression, the original audio data of the previous frame and the current frame need to be obtained. Therefore, if the original audio data of the previous frame is compressed with loss, when performing lossless compression of the original audio data of the current frame, step S109 needs to be executed before step S111.

[0025] In step S109, the original audio data of the previous frame (eg, the previous frame B) is applied with a window function of a modified discrete cosine transform (MDCT) to calculate a function audio data according to a time-domain aliasing cancellation (TDAC).

[0026] If the original audio data of the previous frame is compressed using a lossy compression method, the lossless compression range of the current frame needs to be extended forward to the overlapped portion of the current frame and the previous frame. Therefore, after executing step S109, step S111 is then executed to losslessly compress the function audio data together with the complete original audio data of the current frame to generate audio lossless compressed data.

[0027] On the contrary, if it is determined that the original audio data of the previous frame and the current frame are both subjected to lossless compression, then when the original audio data of the current frame is subjected to lossless compression, it is not necessary to extend the compression range of the current frame forward to the previous frame (i.e., it is not necessary to execute step S109), but step S111 is directly executed to directly perform lossless compression on the original audio data of the current frame itself.

[0028] In step S113, a predetermined maximum length allowed after lossless compression of each frame is calculated according to the set bandwidth, and it is determined whether the data length of the lossless compressed audio data of the current frame is greater than the predetermined maximum length.

[0029] If the data length of the lossless compressed audio data of the current frame is not greater than the predetermined maximum length, that is, L≤Lmax (where L represents the data length of the lossless compressed audio data of the current frame, and Lmax represents the predetermined maximum length), step S115 can be executed. On the contrary, if the data length of the lossless compressed audio data of the current frame is greater than the predetermined maximum length, step S105 is executed to perform lossy compression on the original audio data of the current frame, and then step S115 is executed.

[0030] In step S115, the compressed information data, that is, the information lossy compressed data or the information lossless compressed data, is transmitted.

[0031] See also Figure 2 , which is a flow chart of the decompression steps of the method for dynamically switching lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention.

[0032] like Figure 2 As shown, the method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data of this embodiment may include steps S201 to S213.

[0033] In step S201, the header of the compressed audio data of the current frame is read.

[0034] In step S203, based on the read content, it is determined whether the current frame adopts lossless compression (ie, whether it is the above-mentioned lossless compression data of the audio signal). If so, then step S205 is executed. If not, then step S207 is executed.

[0035] In step S205, the original audio data of the current frame is losslessly decompressed.

[0036] In step S207, lossy decompression and improved inverse discrete cosine transform are performed on the original audio data of the current frame.

[0037] In step S209, it is determined whether the compressed audio data of the previous frame of the current frame is lossless compressed. If the previous frame is lossless compressed, it is not necessary to eliminate the overlapping parts of the current frame and the previous frame through the time domain aliasing elimination method (TDAC) to restore the previous frame, so step S213 is then executed. On the contrary, if the previous frame is lossy compressed, steps S211 and S213 are then executed in sequence.

[0038] In step S211, according to the time domain aliasing cancellation (TDAC) method, the first half of the decompressed data of the current frame is superimposed with the second half of the improved inverse discrete cosine transform result of the previous frame to restore the original audio data of the previous frame.

[0039] In step S213, the original information data of the previous frame of decompressed information is output.

[0040] After repeatedly executing the above steps of the embodiment of the present invention, under a fixed bandwidth, lossy compression or lossless compression can be selected individually according to the characteristics of each frame, so that the compression methods used by consecutive frames may be the same or different. The main purpose of the present invention is that the compression methods used by consecutive frames can be different. For example, the previous frame uses lossless compression, but the next frame of the previous frame (i.e., the current frame) may be dynamically switched to lossy compression, and the next frame of the current frame may be dynamically switched to lossless compression. This is only an example, and the present invention is not limited to this. The following is a more detailed description.

[0041] See also Figure 4 , which is a method for dynamically switching between lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention, and a schematic diagram of decompression of the previous frame and the current frame of lossy compression.

[0042] The method for dynamically switching lossy or lossless compression of fixed bandwidth audio data according to the embodiment of the present invention comprises steps S101 to S115 and S201 to S213 which are applicable to the following embodiments: Figure 4 Shown are the previous frame B, the previous frame A, and the current frame C, all of which use lossy compression.

[0043] First, if Figure 4 As shown, the second half of the improved inverse discrete cosine transform result of the previous frame B is superimposed with the first half of the improved inverse discrete cosine transform result of the current frame C according to the time domain aliasing elimination method (TDAC), so as to restore the original audio data of the previous frame.

[0044] like Figure 3 The previous frame B shown in FIG. 1 is subjected to a general MDCT window function. According to the time domain aliasing elimination method, the calculation is as follows: IMDCT(MDCT(WA,W R The second half of B) is W R (W R B+(WR B) R )=W R 2 B+WW R B R , and IMDCT(MDCT(WB,W R The first half of C) is W(WB-W R B R )=W 2 B–WW R B R , add the two halves together (W R 2 B+WW R B R )+(W 2 B–WW R B R )=(W R 2 +W 2 )B=B, where (W R 2 +W 2 )=1, where B represents the original audio data of the previous frame (i.e. the previous frame mentioned above), R represents inverse, and B R Represents the inverse waveform of the B waveform.

[0045] As mentioned above, when restoring the audio data of each frame using lossy compression, it is necessary to perform TDAC operation with the original audio data of the previous frame and the next frame in order to restore each frame using lossy compression.

[0046] See also Figure 5 , which is a dynamic switching method for lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention, and a schematic diagram of decompression of a lossy compressed previous frame and a lossless compressed current frame.

[0047] The method for dynamically switching lossy or lossless compression of fixed bandwidth audio data according to the embodiment of the present invention comprises steps S101 to S115 and S201 to S213 which are applicable to the following embodiments: Figure 5 The previous frame B shown uses lossy compression, and the current frame C uses lossless compression.

[0048] First, if Figure 5 As shown, the previous frame B is losslessly decompressed and improved inverse discrete cosine transform is performed, where the second half of the transform result is W R 2 B+WW R B R .

[0049] The current frame C is losslessly compressed to obtain the original audio data of the current frame C and the original audio data of the previous frame B is converted into W by applying the window function of the improved discrete cosine transform in step S109. 2 B–WW R B R .

[0050] According to the time domain aliasing elimination method, W R 2 B+WW R B R With W 2 B–WW R B R After the addition operation, the complete original audio data of the previous frame B is restored.

[0051] See also Figure 6 , which is a dynamic switching method for lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention, and a schematic diagram of decompression of the previous frame and the current frame of lossless compression.

[0052] The method for dynamically switching lossy or lossless compression of fixed bandwidth audio data according to the embodiment of the present invention comprises steps S101 to S115 and S201 to S213 which are applicable to the following embodiments: Figure 6 Shown are the previous frame B and the current frame C, both of which use lossless compression.

[0053] First, if Figure 6 As shown, if the information data of the previous frame B is losslessly compressed, and the information data of the current frame C is also losslessly compressed, the information losslessly compressed data of the previous frame is decompressed to restore the original information data of the previous frame B.

[0054] As described above, the original information data of each frame using lossless compression can be directly restored after decompression, without the need to perform MDCT calculations with the original information data of the previous frame and the next frame.

[0055] See also Figure 7 , which is a dynamic switching method for lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention, and a schematic diagram of decompression of a previous frame of lossless compression and a next frame of lossy compression.

[0056] The method for dynamically switching lossy or lossless compression of fixed bandwidth audio data according to the embodiment of the present invention comprises steps S101 to S115 and S201 to S213 which are applicable to the following embodiments: Figure 7 Shown is a previous frame B using lossless compression and a current frame C using lossy compression.

[0057] If the information data of the previous frame B is losslessly compressed, and the information data of the current frame C is lossily compressed, the information losslessly compressed data of the previous frame is decompressed to restore the original information data of the previous frame B.

[0058] As mentioned above, the original audio data of each frame using lossless compression can be directly restored to the complete original audio data after decompression, without the need to perform TDAC operation with the original audio data of the previous frame and the next frame of the frame. However, the original audio data of the frame using lossy compression, when restored, needs to perform TDAC operation with the original audio data of the previous frame and the original audio data of the next frame, so as to restore each frame using lossy compression.

[0059] In summary, the present invention provides a method for dynamically switching lossy or lossless compression of fixed bandwidth audio data, which has the following main features:

[0060] Dynamically switch between lossy and lossless compression methods under fixed bandwidth;

[0061] Supports modified discrete cosine transform (MDCT);

[0062] Filter out frames that cannot be losslessly compressed within a fixed bandwidth based on energy size, eliminating the need to attempt lossless compression for each frame, thus reducing compression operation time.

[0063] The present invention directly compresses one frame of original audio data in a lossless manner, unlike most lossless compression methods on the market which calculate the difference between the original audio data and the lossy compression restoration.

[0064] To further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are only for reference and description and are not intended to limit the present invention.

[0065] The contents disclosed above are only preferred feasible embodiments of the present invention, and are not intended to limit the claims of the present invention. Therefore, all equivalent technical changes made using the description and drawings of the present invention are included in the claims of the present invention.

Claims

1. A method for dynamically switching between lossy and lossless compression of fixed bandwidth audio data, characterized in that: The method comprises the following steps: Calculating a predetermined maximum energy value of each of the plurality of frames that can be losslessly compressed according to the set bandwidth; Read the original information data of each frame; Calculating the energy value of the original audio data of each of the frames; And determine whether the energy value of the original information data of each frame is greater than the predetermined maximum energy value. If so, perform lossy compression on the original information data of the frame to generate information lossy compressed data. If not, perform lossless compression on the original information data of the frame to generate information lossless compressed data.

2. The method according to claim 1, characterized in that The method further comprises the following steps: Calculating the square value of the amplitude of each of the plurality of waveforms of the audio signal of the original audio data of each of the frames; summing up the plurality of square values ​​of the plurality of waveforms to generate a total energy value; The total energy value is divided by the number of the plurality of waveforms to obtain an average energy value, and the logarithm of the average energy value is taken to calculate the energy of the original audio data of each frame, which is expressed by the following equation: E=log((x1 2 +x2 2 +…+x n 2 ) / n), where E represents the energy of the original audio data of each frame, x1 to x n Respectively represent the multiple amplitudes of the multiple waveforms, and n represents the number of the multiple waveforms.

3. The method according to claim 1, characterized in that The method further comprises the following steps: Determine whether the energy value of the original audio data of each frame is greater than the predetermined maximum energy value, if so, perform lossy compression on the original audio data of the frame to generate the audio lossy compressed data, if not, execute the next step; Determine whether the previous frame of the current frame is losslessly compressed, if so, perform lossless compression on the original audio data of the current frame to generate the audio lossless compressed data, and do not perform subsequent steps, if not, perform subsequent steps in sequence; Applying a window function of a modified discrete cosine transform (MDCT) to the original signal data of the previous frame, and calculating function signal data according to a time-domain aliasing cancellation (TDAC) method; And the function information data and the original information data of the current frame are losslessly compressed to generate the information losslessly compressed data.

4. The method according to claim 1, characterized in that: The method further comprises the following steps performed after determining whether the energy value of the original audio signal data of each frame is greater than the predetermined maximum energy value: If it is determined that the energy value of the original audio data of the current frame is greater than the predetermined maximum energy value, lossy compressing the original audio data of the current frame to generate the audio lossy compressed data; If it is determined that the energy value of the original signal data of the current frame is not greater than the predetermined maximum energy value, determine whether the original signal data of the previous frame of the current frame adopts lossless compression, if so, perform lossless compression on the original signal data of the current frame to generate the signal lossless compressed data, if not, apply the window function of the improved discrete cosine transform to the original signal data of the previous frame of the current frame, calculate the function signal data according to the time domain aliasing elimination method, and perform lossless compression on the function signal data together with the complete original signal data of the current frame to generate the signal lossless compressed data; as well as After generating the lossless compressed audio data, determine whether the data length of the lossless compressed audio data is greater than the predetermined maximum length. If not, retain the lossless compressed audio data. If so, perform lossy compression on the original audio data of the current frame to generate the lossy compressed audio data, replacing the lossless compressed audio data having a data length greater than the predetermined maximum length.

Citation Information

Patent Citations

  • Method of dynamically switching lossy compression and lossless compression that will be performed on audio data in constant bandwidth

    TW202223881A