Skip to content
Snippets Groups Projects
Commit 013498ba authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov Committed by Michael Niedermayer
Browse files

aacenc: Adjust the initial offset for PNS values


This commit adjusts the intial offset for PNS values, introduced
with commit f7f71b57 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: default avatarMichael Niedermayer <michaelni@gmx.at>
parent 42a144f2
No related branches found
No related tags found
No related merge requests found
...@@ -143,6 +143,7 @@ typedef struct PredictorState { ...@@ -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 256 ///< preamble for NOISE_BT, put in bitstream with the first noise band
#define NOISE_PRE_BITS 9 ///< length of preamble #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 * Long Term Prediction
......
...@@ -388,7 +388,7 @@ static void encode_band_info(AACEncContext *s, SingleChannelElement *sce) ...@@ -388,7 +388,7 @@ static void encode_band_info(AACEncContext *s, SingleChannelElement *sce)
static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s, static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
SingleChannelElement *sce) 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 noise_flag = 1;
int i, w; int i, w;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment