diff options
author | Nathan Caldwell <saintdev@gmail.com> | 2011-12-17 18:45:55 -0700 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2012-01-23 11:40:46 -0800 |
commit | 025ccf1f8bd669f45b628acf51e7febcb1fddd3b (patch) | |
tree | 01729ec4ed66b3c439fe963b3c3e8a512034af31 /libavcodec/aacpsy.c | |
parent | 6381f913d19d78513bab06fad7c50548975475a3 (diff) | |
download | ffmpeg-025ccf1f8bd669f45b628acf51e7febcb1fddd3b.tar.gz |
aacenc: Request normalized float samples instead of converting s16 samples to float.
Signed-off-by: Alex Converse <alex.converse@gmail.com>
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r-- | libavcodec/aacpsy.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c index 577d8fba80..5e9e3913e8 100644 --- a/libavcodec/aacpsy.c +++ b/libavcodec/aacpsy.c @@ -776,9 +776,8 @@ static void lame_apply_block_type(AacPsyChannel *ctx, FFPsyWindowInfo *wi, int u ctx->next_window_seq = blocktype; } -static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, - const int16_t *audio, const int16_t *la, - int channel, int prev_type) +static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio, + const float *la, int channel, int prev_type) { AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data; AacPsyChannel *pch = &pctx->ch[channel]; @@ -796,7 +795,7 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, float energy_subshort[(AAC_NUM_BLOCKS_SHORT + 1) * PSY_LAME_NUM_SUBBLOCKS]; float energy_short[AAC_NUM_BLOCKS_SHORT + 1] = { 0 }; int chans = ctx->avctx->channels; - const int16_t *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN) * chans; + const float *firbuf = la + (AAC_BLOCK_SIZE_SHORT/4 - PSY_LAME_FIR_LEN) * chans; int j, att_sum = 0; /* LAME comment: apply high pass filter of fs/4 */ @@ -808,7 +807,8 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, sum1 += psy_fir_coeffs[j] * (firbuf[(i + j) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j) * chans]); sum2 += psy_fir_coeffs[j + 1] * (firbuf[(i + j + 1) * chans] + firbuf[(i + PSY_LAME_FIR_LEN - j - 1) * chans]); } - hpfsmpl[i] = sum1 + sum2; + /* NOTE: The LAME psymodel expects it's input in the range -32768 to 32768. Tuning this for normalized floats would be difficult. */ + hpfsmpl[i] = (sum1 + sum2) * 32768.0f; } /* Calculate the energies of each sub-shortblock */ |