CN114724567A - Dynamic switching method for lossy or lossless compression of fixed bandwidth audio-visual data - Google Patents
Dynamic switching method for lossy or lossless compression of fixed bandwidth audio-visual data Download PDFInfo
- Publication number
- CN114724567A CN114724567A CN202011500408.7A CN202011500408A CN114724567A CN 114724567 A CN114724567 A CN 114724567A CN 202011500408 A CN202011500408 A CN 202011500408A CN 114724567 A CN114724567 A CN 114724567A
- Authority
- CN
- China
- Prior art keywords
- data
- frame
- audio data
- original audio
- lossy
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000006835 compression Effects 0.000 title claims abstract description 139
- 238000007906 compression Methods 0.000 title claims abstract description 139
- 238000000034 method Methods 0.000 title claims abstract description 66
- 230000005236 sound signal Effects 0.000 claims description 13
- 230000008030 elimination Effects 0.000 claims description 7
- 238000003379 elimination reaction Methods 0.000 claims description 7
- OVOUKWFJRHALDD-UHFFFAOYSA-N 2-[2-(2-acetyloxyethoxy)ethoxy]ethyl acetate Chemical compound CC(=O)OCCOCCOCCOC(C)=O OVOUKWFJRHALDD-UHFFFAOYSA-N 0.000 claims 1
- 230000006837 decompression Effects 0.000 description 17
- 238000010586 diagram Methods 0.000 description 11
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
- G10L19/0017—Lossless audio signal coding; Perfect reconstruction of coded audio signal by transmission of coding error
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
- G10L19/02—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using spectral analysis, e.g. transform vocoders or subband vocoders
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Human Computer Interaction (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
技术领域technical field
本申请涉及音信数据流的压缩方法,特别是涉及一种固定带宽音信数据的有损或无损压缩的动态切换方法。The present application relates to a method for compressing audio information data streams, in particular to a dynamic switching method for lossy or lossless compression of fixed bandwidth audio information data.
背景技术Background technique
数字音信数据通常以一帧帧(frame)方式编码后经由有线或无线网络传送到接收端译码后播放。编码的方法分为有损压缩(lossy compression)和无损压缩(losslesscompression)二种。无损压缩在解压后可以得到和压缩前完全一致的音信数据,但相对有损压缩,无损压缩的压缩效率通常较差,有损压缩则把人耳通常无法辨别的声音细微差异移除。一般的使用者在意使用方便和稳定,而追求高音质的音乐爱好者则希望音信失真的程度越小越好,最好能达到原音重现。The digital audio data is usually encoded in a frame-by-frame (frame) manner and then transmitted to the receiving end via a wired or wireless network for decoding and playback. There are two types of coding methods: lossy compression and lossless compression. Lossless compression can obtain audio data that is exactly the same as before compression after decompression, but it is relatively lossy compression. The compression efficiency of lossless compression is usually poor, and lossy compression removes the subtle differences in sound that the human ear usually cannot discern. The average user cares about the convenience and stability of use, while the music lovers who pursue high sound quality hope that the degree of audio distortion is as small as possible, and it is best to reproduce the original sound.
为解决前述问题,MPEG-4SLS提出一个混合有损与无损压缩的方法以满足二种使用者的不同需求,其在有损压缩的基底上再把与原始音信数据差异部分附加上去,播放时可以根据需求只传送有损压缩的部分或是全部的数据,如进阶音信编码(Advanced AudioCoding,AAC)有损压缩的基底附加差异部分来完成无损压缩。然而,MPEG-4SLS相比于AAC的带宽128Kbps大幅增加,也不再是固定带宽了,反而增加了网络传输及处理的复杂度与不稳定。In order to solve the aforementioned problems, MPEG-4SLS proposes a method of mixing lossy and lossless compression to meet the different needs of the two users. It adds the difference from the original audio data to the base of the lossy compression. According to the requirement, only part or all of the data of lossy compression is transmitted, such as Advanced Audio Coding (AAC) lossy compression base additional difference part to complete lossless compression. However, compared with AAC, the bandwidth of MPEG-4SLS is greatly increased by 128Kbps, and it is no longer a fixed bandwidth. Instead, it increases the complexity and instability of network transmission and processing.
发明内容SUMMARY OF THE INVENTION
基于此,本申请所要解决的技术问题在于,针对现有技术的不足提供一种固定带宽音信数据的有损或无损压缩的动态切换方法,其包含以下步骤:依据设定带宽,计算多个帧中的各帧可无损压缩的预定最大能量值;读取各帧的原始音信数据;计算各帧的原始音信数据的能量值;以及判断各帧的原始音信数据的能量值是否大于预定最大能量值,若是,将帧的原始音信数据进行有损压缩以产生音信有损压缩数据,若否,将帧的原始音信数据进行无损压缩以产生音信无损压缩数据。Based on this, the technical problem to be solved by the present application is to provide a dynamic switching method for lossy or lossless compression of audio information data with a fixed bandwidth in view of the deficiencies of the prior art, which includes the following steps: calculating a plurality of frames according to the set bandwidth The predetermined maximum energy value that each frame in can be lossless compression; read the original audio data of each frame; calculate the energy value of the original audio data of each frame; and judge whether the energy value of the original audio data of each frame is greater than the predetermined maximum energy value If yes, perform lossy compression on the original audio data of the frame to generate audio lossy compressed data, if not, perform lossless compression on the original audio data of the frame to generate audio lossless compressed data.
根据示例实施例,所述固定带宽音信数据的有损或无损压缩的动态切换方法还包含以下步骤:计算各帧的原始音信数据的音信信号的多个波形中的各波形的振幅的平方值;将多个波形分别的多个平方值进行加总,以产生能量总值;以及将能量总值除以多个波形的数量,以取得平均能量值,取平均能量值的对数值,以计算出各帧的原始音信资料的能量,以下列方程式表示:E=log((x1 2+x2 2+…+xn 2)/n),其中E代表各帧的原始音信资料的能量,x1至xn分别代表多个波形分别的多个振幅,n代表多个波形的数量。According to an example embodiment, the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio signal data further comprises the steps of: calculating the square value of the amplitude of each waveform in the plurality of waveforms of the audio signal signal of the original audio signal data of each frame; summing the respective squared values of the plurality of waveforms to generate a total energy value; and dividing the total energy value by the number of the plurality of waveforms to obtain an average energy value, and taking the logarithm of the average energy value to calculate The energy of the original audio data of each frame is expressed by the following equation: E=log((x 1 2 +x 2 2 +...+x n 2 )/n), where E represents the energy of the original audio data of each frame, x 1 to x n represent the respective amplitudes of the plurality of waveforms, and n represents the number of the plurality of waveforms.
根据示例实施例,所述固定带宽音信数据的有损或无损压缩的动态切换方法还包含以下步骤:判断各帧的原始音信资料的能量值是否大于预定最大能量值,若是,将帧的原始音信数据进行有损压缩以产生音信有损压缩数据,若否,执行下一步骤;判断目前帧的上一帧是否为无损压缩,若是,将目前帧的原始音信数据进行无损压缩以产生音信无损压缩数据,不执行后续步骤,若否,依序执行后续步骤;将上一帧的原始音信资料套用改进的离散余弦变换(Modified Discrete Cosine Transform,MDCT)的窗函数(window function),根据时域混迭消除法(Time-Domain Aliasing Cancellation,TDAC),以计算出函数音信数据;以及将函数音信数据与目前帧的原始音信数据进行无损压缩,以产生音信无损压缩数据。According to an exemplary embodiment, the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio data further includes the following steps: judging whether the energy value of the original audio data of each frame is greater than a predetermined maximum energy value, and if so, converting the original audio data of the frame Perform lossy compression on the data to generate audio lossy compressed data, if not, perform the next step; determine whether the previous frame of the current frame is lossless compression, if so, perform lossless compression on the original audio data of the current frame to generate audio lossless compression Data, do not perform the subsequent steps, if not, perform the subsequent steps in sequence; apply the window function of the Modified Discrete Cosine Transform (MDCT) to the original audio data of the previous frame, according to the time domain mixing. Time-Domain Aliasing Cancellation (TDAC) is used to calculate the function audio data; and the function audio data and the original audio data of the current frame are subjected to lossless compression to generate audio lossless compressed data.
根据示例实施例,所述固定带宽音信数据的有损或无损压缩的动态切换方法还包含以下步骤:依据设定带宽,计算出各帧的原始音信数据压缩后允许的一预定最大长度;判断各帧的音信无损压缩数据的数据长度是否大于预定最大长度,若否,保留音信无损压缩数据,若是,将帧的原始音信数据进行有损压缩以产生音信有损压缩数据,取代具有数据长度大于预定最大长度的音信无损压缩数据。According to an exemplary embodiment, the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data further includes the steps of: calculating a predetermined maximum length allowed after compression of the original audio information data of each frame according to the set bandwidth; Whether the data length of the audio information lossless compressed data of the frame is greater than the predetermined maximum length, if not, keep the audio information lossless compressed data, if so, perform lossy compression on the original audio information data of the frame to generate audio information lossy compressed data, replace the data with a data length greater than the predetermined length. Lossless compressed data of the maximum length of the message.
根据示例实施例,所述固定带宽音信数据的有损或无损压缩的动态切换方法还包含以下步骤:将上一帧的原始音信数据进行有损压缩;决定将目前帧的原始音信数据进行有损压缩;将上一帧的原始音信资料以及目前帧的原始音信数据,套用窗函数后进行改进的离散余弦变换,计算出函数音信数据;以及将函数音信数据进行有损压缩,以产生音信有损压缩数据。According to an exemplary embodiment, the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data further includes the following steps: performing lossy compression on the original audio information data of the previous frame; deciding to perform lossy compression on the original audio information data of the current frame Compression; the original audio data of the previous frame and the original audio data of the current frame are subjected to improved discrete cosine transform after applying the window function to calculate the functional audio data; and lossy compression of the functional audio data to generate audio lossy Compressed data.
根据示例实施例,所述固定带宽音信数据的有损或无损压缩的动态切换方法还包含以下步骤:将上一帧的原始音信数据进行有损压缩;决定将目前帧的原始音信数据进行无损压缩;将上一帧的原始音信资料,套用改进的离散余弦变换的窗函数,根据时域混迭消除法,以计算出函数音信数据;以及将函数音信数据与目前帧的完整原始音信数据一起进行无损压缩,以产生音信无损压缩数据。According to an exemplary embodiment, the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data further includes the steps of: performing lossy compression on the original audio information data of the previous frame; deciding to perform lossless compression on the original audio information data of the current frame ; Apply the window function of the improved discrete cosine transform to the original audio data of the previous frame, and calculate the functional audio data according to the time-domain aliasing elimination method; and perform the function audio data with the complete original audio data of the current frame. Lossless compression to produce audio lossless compressed data.
根据示例实施例,所述固定带宽音信数据的有损或无损压缩的动态切换方法还包含以下步骤:将上一帧的原始音信数据进行无损压缩,以产生上一帧的音信无损压缩数据;以及决定将目前帧的原始音信数据进行无损压缩,以产生目前帧的音信无损压缩数据。According to an example embodiment, the method for dynamically switching between lossy or lossless compression of fixed bandwidth audio data further comprises the steps of: performing lossless compression on the original audio data of the previous frame to generate lossless compressed audio data of the previous frame; and It is decided to perform lossless compression on the original audio data of the current frame to generate lossless compressed audio data of the current frame.
根据示例实施例,所述固定带宽音信数据的有损或无损压缩的动态切换方法还包含以下步骤:将上一帧的原始音信数据进行无损压缩,以产生音信无损压缩数据;决定将上一帧的原始音信资料以及目前帧的原始音信数据,套用窗函数后进行改进的离散余弦变换,计算出一函数音信数据;以及将函数音信数据进行有损压缩。According to an exemplary embodiment, the method for dynamically switching between lossy or lossless compression of fixed-bandwidth audio information data further includes the steps of: compressing the original audio information data of the previous frame losslessly to generate audio information lossless compressed data; The original audio data of the current frame and the original audio data of the current frame are applied with a window function, and then an improved discrete cosine transform is performed to calculate a function audio data; and the function audio data is subjected to lossy compression.
附图说明Description of drawings
图1为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法的压缩步骤流程图。FIG. 1 is a flow chart of compression steps of a dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention.
图2为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法的解压缩步骤流程图。FIG. 2 is a flow chart of decompression steps of a dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention.
图3为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法的多个帧的原始音信数据相互重迭的示意图。3 is a schematic diagram of overlapping original audio data of multiple frames of a dynamic switching method for lossy or lossless compression of fixed bandwidth audio data according to an embodiment of the present invention.
图4为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法,有损压缩的上一帧、目前帧的解压缩示意图。FIG. 4 is a schematic diagram of decompression of a previous frame and a current frame of lossy compression according to a dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention.
图5为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法,有损压缩的上一帧、无损压缩的目前帧的解压缩示意图。5 is a schematic diagram of decompression of a lossy compressed previous frame and a lossless compressed current frame according to a dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention.
图6为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法,无损压缩的上一帧、目前帧的解压缩示意图。FIG. 6 is a schematic diagram of a method for dynamically switching between lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention, and a schematic diagram of decompression of a lossless compressed previous frame and a current frame.
图7为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法,无损压缩的上一帧以及有损压缩的目前帧的解压缩示意图。FIG. 7 is a schematic diagram of a method for dynamically switching between lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention, and a schematic diagram of decompression of the previous frame of lossless compression and the current frame of lossy compression.
具体实施方式Detailed ways
请参阅图1,其为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法的压缩步骤流程图。如图1所示,本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法可包含步骤S101至S115,这些步骤的执行顺序、内容、次数可以依据实际需求做调整。对多个帧的每一帧皆执行这些步骤S101至S115,以在一预设带宽/固定带宽下,个别判断每一帧采用有损压缩还是无损压缩。不同的帧可能采用不同的压缩方式,例如但不限于上一帧采用有损压缩,目前帧动态切换为采用无损压缩。为方便说明,在下文中,将目前处理的帧简称为目前帧。Please refer to FIG. 1 , which is a flow chart of compression steps of a dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention. As shown in FIG. 1 , the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention may include steps S101 to S115 , and the execution order, content, and times of these steps can be adjusted according to actual needs. These steps S101 to S115 are performed for each frame of the plurality of frames, so as to individually determine whether each frame adopts lossy compression or lossless compression under a preset bandwidth/fixed bandwidth. Different frames may adopt different compression methods, for example, but not limited to, the previous frame adopts lossy compression, and the current frame is dynamically switched to adopt lossless compression. For the convenience of description, hereinafter, the currently processed frame is simply referred to as the current frame.
在步骤S101,计算目前帧的原始音信资料的能量值。举例而言,计算各帧的原始音信数据的音信信号的多个波形中的各波形的振幅的平方值。接着,将多个波形分别的多个平方值进行加总,以产生一能量总值。将能量总值除以多个波形的数量,以取得一平均能量值。接着,取平均能量值的对数值,以计算出各帧的原始音信数据的能量。以下列方程式表示:E=log((x1 2+x2 2+…+xn 2)/n),其中E代表各帧的原始音信资料的能量,x1至xn分别代表多个波形分别的多个振幅,n代表多个波形的数量/取得的多个振幅的数量。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 of the multiple waveforms of the audio signal of the original audio data of each frame is calculated. Next, the respective squared values of the plurality of waveforms are summed to generate an energy total value. Divide the total energy by the number of waveforms to obtain an average energy value. Next, the logarithm of the average energy value is taken to calculate the energy of the original audio data of each frame. It is expressed by the following equation: E=log((x 1 2 +x 2 2 +...+x n 2 )/n), where E represents the energy of the original audio data of each frame, and x 1 to x n respectively represent a plurality of waveforms The respective multiple amplitudes, n represents the number of multiple waveforms/number of multiple acquired multiple amplitudes.
在步骤S103,依据一设定带宽,以计算可无损压缩的预定最大能量值,判断目前帧的原始音信资料的能量值是否大于预定最大能量值。若目前帧的原始音信资料的能量值大于预定最大能量值时,即E>Emax(其中E代表目前帧的原始音信资料的能量值,而Emax代表预定最大能量值),决定选择有损压缩方式,接着执行步骤S105。相反地,若目前帧的原始音信资料的能量值不大于(即等于或小于)预定最大能量值时,则决定选择无损压缩方式,接着执行步骤S107。In step S103, according to a preset bandwidth, a predetermined maximum energy value that can be losslessly compressed is calculated, 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), the lossy compression method is decided to be selected. , and then step S105 is executed. Conversely, if the energy value of the original audio data of the current frame is not greater than (ie equal to or smaller than) the predetermined maximum energy value, it is decided to select the lossless compression mode, and then step S107 is executed.
在步骤S105,将具有能量值大于预定最大能量值的目前帧的原始音信数据进行有损压缩,以产生一音信有损压缩数据。如此,可避免在原始音信数据的能量值过大时,仍尝试无损压缩,而导致浪费运算时间的情形发生。若有需要,接着可执行步骤S115。In step S105, lossy compression is performed on the original audio data of the current frame with an energy value greater than a predetermined maximum energy value, so as to generate lossy compressed audio data. In this way, when the energy value of the original audio data is too large, the lossless compression is still attempted, resulting in a waste of computing time. If necessary, then step S115 can be executed.
在步骤S107,判断目前帧的上一帧的原始音信数据是否采用无损压缩的方式进行压缩。In step S107, it is determined whether the original audio information data of the previous frame of the current frame is compressed in a lossless compression manner.
若上一帧的原始音信数据采用有损压缩,为了在解压缩时能顺利还原出完整的上一帧的原始音信数据,需取得此上一帧的上一帧和目前帧的原始音信资料。因此,若上一帧的原始音信数据采用有损压缩时,在执行目前帧的原始音信数据的无损压缩时,需执行步骤S109后,接着再执行步骤S111。If the original audio data of the previous frame adopts lossy compression, in order to restore the complete original audio data of the previous frame smoothly during decompression, it is necessary to obtain the original audio data of the previous frame and the current frame of the previous frame. Therefore, if the original audio data of the previous frame adopts lossy compression, when the lossless compression of the original audio data of the current frame is performed, step S109 needs to be performed, and then step S111 is performed.
在步骤S109,将上一帧的原始音信数据(例如上一帧B),套用改进的离散余弦变换(Modified Discrete Cosine Transform,MDCT)的窗函数(window function),根据时域混迭消除法(Time-Domain Aliasing Cancellation,TDAC),以计算出一函数音信数据。In step S109, the original audio information data of the previous frame (for example, the previous frame B) is applied to the window function (window function) of the Modified Discrete Cosine Transform (MDCT), according to the time domain aliasing elimination method ( Time-Domain Aliasing Cancellation, TDAC) to calculate a function of audio data.
若上一帧的原始音信数据采用有损压缩方式进行压缩,需将目前帧的无损压缩范围往前延伸到目前帧与上一帧重迭(overlap)部分。因此,在执行步骤S109后,接着执行步骤S111,以将此函数音信数据与目前帧的完整原始音信数据一起进行无损压缩,以产生一音信无损压缩数据。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 overlap portion of the current frame and the previous frame. Therefore, after step S109 is performed, step S111 is then performed to perform lossless compression on the audio data of the function and the complete original audio data of the current frame to generate a lossless compressed audio data.
相反地,若决定上一帧和目前帧的原始音信资料皆采用无损压缩,则在对目前帧的原始音信资料进行无损压缩时,不需将目前帧的压缩范围往前延伸到至上一帧(即不需执行步骤S109),而是直接接着执行步骤S111,以将目前帧的原始音信数据本身直接进行无损压缩即可。Conversely, if it is determined that the original audio data of the previous frame and the current frame are all compressed by lossless, then when the original audio data of the current frame is compressed losslessly, it is not necessary to extend the compression range of the current frame to the previous frame ( That is, it is not necessary to perform step S109), but step S111 is directly performed to directly perform lossless compression on the original audio data of the current frame.
在步骤S113,依据设定带宽,以计算出各帧无损压缩后允许的一预定最大长度,判断目前帧的音信无损压缩数据的数据长度是否大于预定最大长度。In step S113, according to the set bandwidth, a predetermined maximum length allowed after lossless compression of each frame is calculated, and it is judged whether the data length of the audio signal lossless compressed data of the current frame is greater than the predetermined maximum length.
若目前帧的音信无损压缩数据的数据长度不大于预定最大长度时,即L≤Lmax时(其中L代表目前帧的音信无损压缩数据的数据长度,Lmax代表预定最大长度),可接着执行步骤S115。相反地,若目前帧的音信无损压缩数据的数据长度大于预定最大长度时,执行步骤S105以将目前帧的原始音信数据进行有损压缩后,始执行步骤S115。If the data length of the audio signal lossless compressed data of the current frame is not greater than the predetermined maximum length, that is, when L≤Lmax (where L represents the data length of the audio signal lossless compressed data of the current frame, and Lmax represents the predetermined maximum length), then step S115 can be executed. . Conversely, if the data length of the audio signal lossless compressed 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.
在步骤S115,传输压缩后的音信数据,即音信有损压缩数据或音信无损压缩数据。In step S115, the compressed audio data, ie audio lossy compressed data or audio lossless compressed data, is transmitted.
请参阅图2,其为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法的解压缩步骤流程图。Please refer to FIG. 2 , which is a flowchart of the decompression steps of the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention.
如图2所示,本实施例的固定带宽音信数据的有损或无损压缩的动态切换方法可包含步骤S201至S213。As shown in FIG. 2 , the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data in this embodiment may include steps S201 to S213.
在步骤S201,读取目前帧的压缩音信数据的表头。In step S201, the header of the compressed audio data of the current frame is read.
在步骤S203,依据读取到的内容,判断目前帧是否采用无损压缩(即是否为上述音信无损压缩数据)。若是,接着执行步骤S205。若否,接着执行步骤S207。In step S203, according to the read content, it is determined whether the current frame adopts lossless compression (ie, whether it is the above-mentioned audio signal lossless compression data). If yes, then step S205 is executed. If not, then step S207 is executed.
在步骤S205,对目前帧的原始音信数据进行无损解压缩。In step S205, lossless decompression is performed on the original audio data of the current frame.
在步骤S207,对目前帧的原始音信数据进行有损解压缩,以及改进的离散余弦逆变换。In step S207, lossy decompression and improved inverse discrete cosine transform are performed on the original audio data of the current frame.
在步骤S209,判断目前帧的上一帧的压缩音信数据是否采用无损压缩。若上一帧采用无损压缩,则不需透过时域混迭消除法(TDAC)以消除目前帧与上一帧相互重迭的部分,以还原出上一帧,因此接着执行步骤S213。相反地,若上一帧为有损压缩,接着依序执行步骤S211、S213。In step S209, it is judged whether the compressed audio data of the previous frame of the current frame adopts lossless compression. If the previous frame adopts lossless compression, it is not necessary to remove the overlapping part of the current frame and the previous frame through time domain aliasing cancellation (TDAC) to restore the previous frame, so step S213 is executed next. Conversely, if the previous frame is lossy compression, then steps S211 and S213 are performed in sequence.
在步骤S211,根据时域混迭消除法(TDAC),将目前帧的解压缩资料的前半部,与上一帧改进的离散余弦逆变换结果的后半部相迭加,即可还原出上一帧的原始音信数据。In step S211, according to the Time Domain Aliasing Elimination (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 previous frame. A frame of raw audio data.
在步骤S213,输出上一帧解压后的音信原始音信数据。In step S213, the decompressed original audio data of the previous frame is output.
在反复执行本发明实施例的上述步骤后,在固定带宽下,可依据每帧的特征,个别选择采用有损压缩或无损压缩,使得连续帧所采用的压缩方式也可能相同或不同。本发明的主要目的在于,连续帧所采用的压缩方式可以不同,例如上一帧采用无损压缩,但此上一帧的下一帧(即目前帧)可能动态切换成有损压缩,目前帧的下一帧可能又动态切换成无损压缩,在此仅举例说明,本发明不以此为限。如下更详细读说明。After repeatedly performing the above steps of the embodiments of the present invention, under a fixed bandwidth, lossy compression or lossless compression can be individually selected according to the characteristics of each frame, so that the compression methods used for consecutive frames may also be the same or different. The main purpose of the present invention is that the compression methods used in consecutive frames can be different. For example, the previous frame adopts lossless compression, but the next frame (ie, the current frame) of the previous frame may be dynamically switched to lossy compression. The next frame may be dynamically switched to lossless compression, which is only illustrated here, and the present invention is not limited to this. Read the description in more detail below.
请参阅图4,其为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法,有损压缩的上一帧、目前帧的解压缩示意图。Please refer to FIG. 4 , which is a schematic diagram of decompression of the previous frame and the current frame of lossy compression according to the dynamic switching method of lossy or lossless compression of fixed bandwidth audio information data according to an embodiment of the present invention.
本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法所包含的步骤S101至S115、S201至S213适用于如图4所示的皆采用有损压缩的上一帧B、上一帧的上一帧A、以及目前帧C。The steps S101 to S115 and S201 to S213 included in the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to the embodiment of the present invention are applicable to the previous frame B, the previous frame B, the above frame B, The previous frame A of a frame, and the current frame C.
首先,如图4所示,将上一帧B改进的离散余弦逆变换结果的后半部,与目前帧C改进的离散余弦逆变换结果的前半部,根据时域混迭消除法(TDAC),相迭加,即可还原出上一帧的原始音信数据。First, as shown in Figure 4, the second half of the improved inverse discrete cosine transform result of the previous frame B and the first half of the improved inverse discrete cosine transform result of the current frame C are combined according to the time domain aliasing cancellation method (TDAC). , superimposed to restore the original audio data of the previous frame.
如图3所示的上一帧B套用通用的MDCT的窗函数,根据时域混迭消除法,运算如下:IMDCT(MDCT(WA,WRB))的后半部为WR(WRB+(WRB)R)=WR 2B+WWRBR,而IMDCT(MDCT(WB,WRC))的前半部为W(WB-WRBR)=W2B–WWRBR,将二个半部相加(WR 2B+WWRBR)+(W2B–WWRBR)=(WR 2+W2)B=B,其中(WR 2+W2)=1,其中B代表上一帧的原始音信资料(即上述的上一帧),R代表反向(inverse),BR代表B波形的反向波形。As shown in Figure 3, the previous frame B applies the general MDCT window function. According to the time domain aliasing elimination method, the operation is as follows: The second half of IMDCT(MDCT(WA, W R B)) is W R (W R B+(W R B) R )=W R 2 B+WW R B R , and the first half of IMDCT(MDCT(WB,WR C)) is W(WB-W R B R ) =W 2 B-WW R B R , add the two halves (WR 2 B+WW R B R )+(W 2 B-WW R B R ) =(WR 2 +W 2 ) B = B , where (WR 2 +W 2 )=1, where B represents the original audio data of the previous frame (ie, the previous frame), R represents the inverse, and B R represents the inverse waveform of the B waveform.
如上所述,采用有损压缩的每一帧的音信数据,在进行还原时,皆需与连续的上一帧和下一帧的原始音信数据进行TDAC的运算,始能还原出采用有损压缩的每一帧。As mentioned above, when the audio data of each frame of lossy compression is used, when restoring, it is necessary to perform TDAC operation with the original audio data of the continuous previous frame and the next frame, so that the lossy compression can be restored. of each frame.
请参阅图5,其为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法,有损压缩的上一帧、无损压缩的目前帧的解压缩示意图。Please refer to FIG. 5 , which is a schematic diagram of decompression of a lossy compressed previous frame and a lossless compressed current frame according to a dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention.
本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法所包含的步骤S101至S115、S201至S213适用于如图5所示的采用有损压缩的上一帧B、以及采用无损压缩的目前帧C。Steps S101 to S115 and S201 to S213 included in the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to the embodiment of the present invention are applicable to the previous frame B using lossy compression as shown in FIG. Lossless compressed current frame C.
首先,如图5所示,将上一帧B进行有损解压缩,以及改进的离散余弦逆变换,其中变换结果的后半部为WR 2B+WWRBR。First, as shown in FIG. 5 , the previous frame B is subjected to lossy decompression and improved inverse discrete cosine transform, wherein the second half of the transform result is WR 2 B+WW R B R .
将目前帧C进行无损压缩,得到目前帧C的原始音信数据以及先前于步骤S109中,上一帧B原始音信资料套用改进的离散余弦变换的窗函数,而转换得到W2B–WWRBR。The current frame C is subjected to lossless compression to obtain the original audio information data of the current frame C and previously in step S109, the window function of the improved discrete cosine transform is applied to the original audio information data of the previous frame B, and converted to obtain W 2 B-WW R B R.
根据时域混迭消除法,将WR 2B+WWRBR与W2B–WWRBR相加运算后,还原出上一帧B完整的原始音信数据。According to the time-domain aliasing elimination method, after adding W R 2 B+WW R B R and W 2 B-WW R B R , the complete original audio data of the previous frame B is restored.
请参阅图6,其为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法,无损压缩的上一帧、目前帧的解压缩示意图。Please refer to FIG. 6 , which is a schematic diagram illustrating the decompression of the lossless compressed previous frame and the current frame according to a dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention.
本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法所包含的步骤S101至S115、S201至S213适用于如图6所示的皆采用无损压缩的上一帧B、以及目前帧C。The steps S101 to S115 and S201 to S213 included in the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to the embodiment of the present invention are applicable to the previous frame B shown in FIG. frame C.
首先,如图6所示,若上一帧B的音信资料为无损压缩,且目前帧C的音信数据亦为无损压缩,则将上一帧的音信无损压缩数据进行解压缩,即可还原出上一帧B的原始音信数据。First, as shown in Figure 6, if the audio data of the previous frame B is lossless compressed, and the audio data of the current frame C is also lossless compressed, then the audio data of the previous frame is decompressed to restore the lossless compression data. The original audio data of the previous frame B.
如上所述,采用无损压缩的每一帧的原始音信数据,可直接在解压缩后还原出帧的原始音信数据,而无需与连续的上一帧和下一帧的原始音信数据进行MDCT的运算。As mentioned above, by adopting the original audio data of each frame of lossless compression, the original audio data of the frame can be directly restored after decompression, and it is not necessary to perform the MDCT operation with the original audio data of the continuous previous frame and the next frame. .
请参阅图7,其为本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法,无损压缩的上一帧及有损压缩的下一帧的解压缩示意图。Please refer to FIG. 7 , which is a schematic diagram of decompression of a lossless compressed previous frame and a lossy compressed next frame according to a dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to an embodiment of the present invention.
本发明实施例的固定带宽音信数据的有损或无损压缩的动态切换方法所包含的步骤S101至S115、S201至S213适用于如图7所示的采用无损压缩的上一帧B以及采用有损压缩的目前帧C。Steps S101 to S115 and S201 to S213 included in the dynamic switching method for lossy or lossless compression of fixed-bandwidth audio information data according to the embodiment of the present invention are applicable to the previous frame B using lossless compression as shown in FIG. Compressed current frame C.
若上一帧B的音信资料为无损压缩,而目前帧C的音信数据为有损压缩,则将上一帧的音信无损压缩数据进行解压缩,即可还原出上一帧B的原始音信数据。If the audio data of the previous frame B is lossless compressed, and the audio data of the current frame C is lossy compression, then the audio data of the previous frame is decompressed, and the original audio data of the previous frame B can be restored. .
如上所述,采用无损压缩的每一帧的原始音信数据,可直接在解压缩后还原出完整的原始音信数据,而无需与连续的此帧的上一帧和下一帧的原始音信数据进行TDAC的运算。然而,采用有损压缩的帧的原始音信数据,在还原时,皆需与连续的上一帧的原始音信数据和下一帧的原始音信数据进行TDAC的运算,始能还原出采用有损压缩的每一帧。As mentioned above, using the original audio data of each frame of lossless compression, the complete original audio data can be directly restored after decompression, without the need to perform continuous processing with the original audio data of the previous and next frames of this frame. Operation of TDAC. However, when restoring the original audio data of a frame with lossy compression, it is necessary to perform TDAC operation with the original audio data of the previous frame and the original audio data of the next frame, so that the lossy compression can be restored. of each frame.
综上所述,本发明提供一种固定带宽音信数据的有损或无损压缩的动态切换方法,其具有以下主要特点:In summary, the present invention provides a dynamic switching method for lossy or lossless compression of fixed bandwidth audio signal data, which has the following main features:
在固定带宽下动态切换有损无损压缩方式;Dynamically switch lossy and lossless compression methods under fixed bandwidth;
支持改进的离散余弦变换(MDCT);Support for Modified Discrete Cosine Transform (MDCT);
依据能量大小过滤掉在固定带宽内无法做到无损压缩的帧,不需每帧尝试无损压缩,降低压缩运算耗时;Filter out the frames that cannot be compressed losslessly within a fixed bandwidth according to the amount of energy, and do not need to try lossless compression for each frame, reducing the time-consuming of compression operations;
本发明直接以无损压缩一帧的原始音信数据,非如市面上大部分的无损压缩方式是计算原始音信数据与有损压缩还原的差值。The present invention directly compresses the original audio data of one frame without loss, unlike most of the lossless compression methods on the market, which calculate the difference between the original audio data and the lossy compression restoration.
为使能更进一步了解本发明的特征及技术内容,请参阅以下有关本发明的详细说明与图式,然而所提供的图式仅用于提供参考与说明,并非用来对本发明加以限制。For a further understanding of the features and technical content of the present invention, please refer to the following detailed descriptions 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.
以上所公开的内容仅为本发明的优选可行实施例,并非因此局限本发明的权利要求书,所以凡是运用本发明说明书及图式内容所做的等效技术变化,均包含于本发明的权利要求书内。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, any equivalent technical changes made by using the contents of the description and drawings of the present invention are included in the rights of the present invention. in the request.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011500408.7A CN114724567A (en) | 2020-12-18 | 2020-12-18 | Dynamic switching method for lossy or lossless compression of fixed bandwidth audio-visual data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011500408.7A CN114724567A (en) | 2020-12-18 | 2020-12-18 | Dynamic switching method for lossy or lossless compression of fixed bandwidth audio-visual data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114724567A true CN114724567A (en) | 2022-07-08 |
Family
ID=82229873
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011500408.7A Pending CN114724567A (en) | 2020-12-18 | 2020-12-18 | Dynamic switching method for lossy or lossless compression of fixed bandwidth audio-visual data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114724567A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5819215A (en) * | 1995-10-13 | 1998-10-06 | Dobson; Kurt | Method and apparatus for wavelet based data compression having adaptive bit rate control for compression of digital audio or other sensory data |
US20020016161A1 (en) * | 2000-02-10 | 2002-02-07 | Telefonaktiebolaget Lm Ericsson (Publ) | Method and apparatus for compression of speech encoded parameters |
US20040044521A1 (en) * | 2002-09-04 | 2004-03-04 | Microsoft Corporation | Unified lossy and lossless audio compression |
CN101490748A (en) * | 2006-07-24 | 2009-07-22 | 汤姆森许可贸易公司 | Method and apparatus for lossless encoding of a source signal, using a lossy encoded data stream and a lossless extension data stream |
CN101784976A (en) * | 2007-09-07 | 2010-07-21 | 高通股份有限公司 | Power efficient batch-frame audio decoding apparatus, system and method |
US20120290306A1 (en) * | 2011-05-12 | 2012-11-15 | Cambridge Silicon Radio Ltd. | Hybrid coded audio data streaming apparatus and method |
CN109147805A (en) * | 2018-06-05 | 2019-01-04 | 安克创新科技股份有限公司 | Audio sound quality enhancing based on deep learning |
CN110265043A (en) * | 2019-06-03 | 2019-09-20 | 同响科技股份有限公司 | Adaptively damage or lossless message compression and decompression calculation method |
TW202223881A (en) * | 2020-12-11 | 2022-06-16 | 同響科技股份有限公司 | Method of dynamically switching lossy compression and lossless compression that will be performed on audio data in constant bandwidth |
-
2020
- 2020-12-18 CN CN202011500408.7A patent/CN114724567A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5819215A (en) * | 1995-10-13 | 1998-10-06 | Dobson; Kurt | Method and apparatus for wavelet based data compression having adaptive bit rate control for compression of digital audio or other sensory data |
US20020016161A1 (en) * | 2000-02-10 | 2002-02-07 | Telefonaktiebolaget Lm Ericsson (Publ) | Method and apparatus for compression of speech encoded parameters |
US20040044521A1 (en) * | 2002-09-04 | 2004-03-04 | Microsoft Corporation | Unified lossy and lossless audio compression |
CN101490748A (en) * | 2006-07-24 | 2009-07-22 | 汤姆森许可贸易公司 | Method and apparatus for lossless encoding of a source signal, using a lossy encoded data stream and a lossless extension data stream |
CN101784976A (en) * | 2007-09-07 | 2010-07-21 | 高通股份有限公司 | Power efficient batch-frame audio decoding apparatus, system and method |
US20120290306A1 (en) * | 2011-05-12 | 2012-11-15 | Cambridge Silicon Radio Ltd. | Hybrid coded audio data streaming apparatus and method |
CN109147805A (en) * | 2018-06-05 | 2019-01-04 | 安克创新科技股份有限公司 | Audio sound quality enhancing based on deep learning |
CN110265043A (en) * | 2019-06-03 | 2019-09-20 | 同响科技股份有限公司 | Adaptively damage or lossless message compression and decompression calculation method |
TW202223881A (en) * | 2020-12-11 | 2022-06-16 | 同響科技股份有限公司 | Method of dynamically switching lossy compression and lossless compression that will be performed on audio data in constant bandwidth |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CA2697830C (en) | A method and an apparatus for processing a signal | |
RU2555221C2 (en) | Complex transformation channel coding with broadband frequency coding | |
JP6026678B2 (en) | Compression and decompression apparatus and method for reducing quantization noise using advanced spectrum expansion | |
JP4084990B2 (en) | Encoding device, decoding device, encoding method and decoding method | |
EP3762923B1 (en) | Audio coding | |
JP2006011456A (en) | Method and device for coding/decoding low-bit rate and computer-readable medium | |
JP4021124B2 (en) | Digital acoustic signal encoding apparatus, method and recording medium | |
WO1999003096A1 (en) | Information decoder and decoding method, information encoder and encoding method, and distribution medium | |
JPH1084284A (en) | Signal reproducing method and device | |
JP4657570B2 (en) | Music information encoding apparatus and method, music information decoding apparatus and method, program, and recording medium | |
TWI826754B (en) | Method of dynamically switching lossy compression and lossless compression that will be performed on audio data in constant bandwidth | |
CN114724567A (en) | Dynamic switching method for lossy or lossless compression of fixed bandwidth audio-visual data | |
US10650834B2 (en) | Audio processing method and non-transitory computer readable medium | |
US6463405B1 (en) | Audiophile encoding of digital audio data using 2-bit polarity/magnitude indicator and 8-bit scale factor for each subband | |
JP4645869B2 (en) | DIGITAL SIGNAL PROCESSING METHOD, LEARNING METHOD, DEVICE THEREOF, AND PROGRAM STORAGE MEDIUM | |
JP4347634B2 (en) | Encoding apparatus and encoding method | |
JP2003280691A (en) | Voice processing method and voice processor | |
JP5491193B2 (en) | Speech coding method and apparatus | |
JP4538705B2 (en) | Digital signal processing method, learning method and apparatus, and program storage medium | |
JP3510493B2 (en) | Audio signal encoding / decoding method and recording medium recording the program | |
JP2009151183A (en) | Multi-channel voice sound signal coding device and method, and multi-channel voice sound signal decoding device and method | |
JP4556866B2 (en) | High efficiency encoding program and high efficiency encoding apparatus | |
JP4530567B2 (en) | Digital audio decoding device | |
WO2025009378A1 (en) | Decoding device, decoding method, program, and encoding device | |
CN115188394A (en) | Sound mixing method, sound mixing device, electronic equipment and storage medium |
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 |