Commit e06578e3 authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov Committed by Michael Niedermayer

aacenc: use the new function for setting special band scalefactor indices

This commit enables the function added with commit 7c10b87b and uses that
new function for setting any special scalefactor indices. This commit does
not change the behaviour of the encoder since no bands are being marked as
either NOISE_BT(due to the previous PNS implementation removed in the
previous commit) or INTENSITY_BT2/INTENSITY_BT.
Reviewed-by: 's avatarClaudio Freire <klaussfreire@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 671bdd4b
...@@ -1222,24 +1222,28 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { ...@@ -1222,24 +1222,28 @@ AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = {
search_for_quantizers_faac, search_for_quantizers_faac,
encode_window_bands_info, encode_window_bands_info,
quantize_and_encode_band, quantize_and_encode_band,
set_special_band_scalefactors,
search_for_ms, search_for_ms,
}, },
[AAC_CODER_ANMR] = { [AAC_CODER_ANMR] = {
search_for_quantizers_anmr, search_for_quantizers_anmr,
encode_window_bands_info, encode_window_bands_info,
quantize_and_encode_band, quantize_and_encode_band,
set_special_band_scalefactors,
search_for_ms, search_for_ms,
}, },
[AAC_CODER_TWOLOOP] = { [AAC_CODER_TWOLOOP] = {
search_for_quantizers_twoloop, search_for_quantizers_twoloop,
codebook_trellis_rate, codebook_trellis_rate,
quantize_and_encode_band, quantize_and_encode_band,
set_special_band_scalefactors,
search_for_ms, search_for_ms,
}, },
[AAC_CODER_FAST] = { [AAC_CODER_FAST] = {
search_for_quantizers_fast, search_for_quantizers_fast,
encode_window_bands_info, encode_window_bands_info,
quantize_and_encode_band, quantize_and_encode_band,
set_special_band_scalefactors,
search_for_ms, search_for_ms,
}, },
}; };
...@@ -652,6 +652,9 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ...@@ -652,6 +652,9 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
s->coder->search_for_ms(s, cpe, s->lambda); s->coder->search_for_ms(s, cpe, s->lambda);
} }
} }
if (s->coder->set_special_band_scalefactors)
for (ch = 0; ch < chans; ch++)
s->coder->set_special_band_scalefactors(s, &cpe->ch[ch]);
adjust_frame_information(cpe, chans); adjust_frame_information(cpe, chans);
if (chans == 2) { if (chans == 2) {
put_bits(&s->pb, 1, cpe->common_window); put_bits(&s->pb, 1, cpe->common_window);
......
...@@ -54,6 +54,7 @@ typedef struct AACCoefficientsEncoder { ...@@ -54,6 +54,7 @@ typedef struct AACCoefficientsEncoder {
int win, int group_len, const float lambda); int win, int group_len, const float lambda);
void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size, void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
int scale_idx, int cb, const float lambda); int scale_idx, int cb, const float lambda);
void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda); void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
} AACCoefficientsEncoder; } AACCoefficientsEncoder;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment