diff --git a/libavcodec/aac.h b/libavcodec/aac.h index 2701386376bca260dd05d130f5571a295d6d8472..23ec085d8e029ef3ef8dc00b600d246f6980cbe6 100644 --- a/libavcodec/aac.h +++ b/libavcodec/aac.h @@ -143,6 +143,7 @@ typedef struct PredictorState { #define NOISE_PRE 256 ///< preamble for NOISE_BT, put in bitstream with the first noise band #define NOISE_PRE_BITS 9 ///< length of preamble +#define NOISE_OFFSET 90 ///< subtracted from global gain, used as offset for the preamble /** * Long Term Prediction diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 5288afb4a261bc299122fddacb71d77b58aa0e41..7f6f4b923d78955d100df0bd7805d3ec7095aa8a 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -388,7 +388,7 @@ static void encode_band_info(AACEncContext *s, SingleChannelElement *sce) static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce) { - int diff, off_sf = sce->sf_idx[0], off_pns = sce->sf_idx[0]; + int diff, off_sf = sce->sf_idx[0], off_pns = sce->sf_idx[0] - NOISE_OFFSET; int noise_flag = 1; int i, w;