Patent ID: 7725313

Claim:
A method of allocating bits in perceptual audio encoders comprising: computing a target Mask-to-Noise Ratio (MNR) for all critical bands in a frame using a target bit rate and associated SMRs by an encoder, wherein the target MNR is computed using the equation: target MNR =(6 TB −Σ NB SMR b 1 b )/ N, wherein TB is the Target bit rate, SMR b is the signal-to-mask ratio of a critical band b, N is the number of frequency lines in the frame, NB is the number of the critical bands in the frame, and 1 b is the number of frequency lines in the critical band b; computing associated SNRs for the critical bands in the frame using the target MNR and the associated SMRs by the encoder, wherein the SNRs for the critical bands in the frame are computed using the equation: SNR b =target MNR+SMR b , wherein SNR b is the signal-to-noise ratio of the critical band b, and MNR is the target MNR; and allocating bits to the critical bands based on the associated SNRs by the encoder, wherein allocating the bits to the critical bands based on the associated SNRs comprises: determining whether any of the SNRs associated with the critical bands are negative; if not, allocating the bits to the critical bands based on the associated SNRs; if so, sorting the critical bands in the frame in a descending order of associated SMRs to form a sorted critical band array; performing a binary search on the sorted critical band array to determine a critical band boundary such that the SNR of a critical band at the critical band boundary is positive and when a critical band to the right of the determined critical band boundary is included in the bit allocation the SNR of the critical band at the critical band boundary becomes negative and computing a final target MNR; removing the critical bands that fall to the right of the determined critical band boundary from the sorted critical band array to form a revised sorted critical band array; computing revised SNRs for associated critical bands in the revised sorted critical band array using the final target MNR and the associated SMRs; and allocating bits to the critical bands in the revised sorted critical band array based on the associated revised SNRs.