The invention relates to a method for coding a variable speed
audio frequency switching between adjacent high /
low speed coding
modes, which belongs to the field of audio coding and is particularly suitable for a multi-speed audio
encoder. The method is technically characterized by comprising the following steps of: coding and decoding each frame of audio signals at a high speed, making coding input signals and decoding output signals in various coding
modes at the speed pass through a sensing and
weighting filter, calculating an average segmentation
signal to
noise ratio (SNR), and selecting a coding mode with the maximum sensing and weighting average segmentation SNR; selecting a coding mode with the maximum sensing and weighting average segmentation SNR of the coding input signals and the decoding output signals at a low coding speed close to the high speed; and finally, calculating average segmentation SNR of the coding input signals and the decoding output signals relative to the coding
modes selected at the high speed and the
low speed respectively, if the average segmentation SNR in the low-speed coding mode is greater than the average segmentation SNR in the high-speed coding mode, switching to the low-speed coding mode, otherwise, switching to the high-speed coding mode. By the method, each frame of audio signals are switched among various coding modes at adjacent high / low coding speeds according to
distortion of the output signals relative to the input signals, so that high
coding quality is kept, and the average coding speed of the audio signals is reduced simultaneously; therefore, the coding efficiency of the multi-speed audio
encoder is improved.