aacenc_tns: implement temporal noise shaping

This commit implements temporal noise shaping support in the
encoder, along with an -aac_tns option to toggle it on or off
(off by default for now). TNS will increase audio quality
and reduce quantization noise by applying a multitap FIR filter
across allowed coefficients and transmit side information to the
decoder so it could create an inverse filter.

Users are encouraged to test the new functionality by enabling
-aac_tns 1 during encoding.

No major bugs are observable at this time so after a while if no
new problems appear and if the current implementation is deemed
of high enough quality and stability it will be enabled by default,
possibly at the same time the encoder has its experimental flag
removed and becomes the standard aac encoder in ffmpeg.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
This commit is contained in:
Rostislav Pehlivanov
2015-08-21 19:27:38 +01:00
parent eab12d072e
commit a1c487e921
7 changed files with 311 additions and 6 deletions

View File

@@ -45,6 +45,7 @@
#include "aac_tablegen_decl.h"
#include "aacenc_is.h"
#include "aacenc_tns.h"
/** Frequency in Hz for lower limit of noise substitution **/
#define NOISE_LOW_LIMIT 4500
@@ -958,8 +959,10 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
search_for_quantizers_faac,
encode_window_bands_info,
quantize_and_encode_band,
encode_tns_info,
set_special_band_scalefactors,
search_for_pns,
search_for_tns,
search_for_ms,
search_for_is,
},
@@ -967,8 +970,10 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
search_for_quantizers_anmr,
encode_window_bands_info,
quantize_and_encode_band,
encode_tns_info,
set_special_band_scalefactors,
search_for_pns,
search_for_tns,
search_for_ms,
search_for_is,
},
@@ -976,8 +981,10 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
search_for_quantizers_twoloop,
codebook_trellis_rate,
quantize_and_encode_band,
encode_tns_info,
set_special_band_scalefactors,
search_for_pns,
search_for_tns,
search_for_ms,
search_for_is,
},
@@ -985,8 +992,10 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
search_for_quantizers_fast,
encode_window_bands_info,
quantize_and_encode_band,
encode_tns_info,
set_special_band_scalefactors,
search_for_pns,
search_for_tns,
search_for_ms,
search_for_is,
},