aacenc: Adjust the initial offset for PNS values

This commit adjusts the intial offset for PNS values, introduced
with commit f7f71b5795 earlier. This
commit shifts the value in such a way that no further offsets are
required in the aaccoder.c file. Earlier version of the PNS patch had 2 offsets in both the aaccoder and aacenc.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Rostislav Pehlivanov 2015-04-14 00:33:51 +01:00 committed by Michael Niedermayer
parent 42a144f2c8
commit 013498ba15
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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;