summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-12-06 13:32:40 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2015-12-06 20:16:48 +0000
commitb32e989e6c65ec9ec206ad938a1decdf2e0da07b (patch)
tree96e9dba1b2642e83372f286489656e2375a5dce4 /libavcodec/aacenc.c
parent45b451c89239b85aec02f946aca4b67894a027b2 (diff)
aacenc: move the TNS search and filtering before PNS
The original plan was to have TNS use data from the PNS search to better tune itself to noise but this was never used nor necessary. This should slightly boost the PNS accuracy if TNS was used. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r--libavcodec/aacenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 7220ddc4d7..2156fc03e1 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -678,14 +678,14 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
for (ch = 0; ch < chans; ch++) { /* TNS and PNS */
sce = &cpe->ch[ch];
s->cur_channel = start_ch + ch;
- if (s->options.pns && s->coder->search_for_pns)
- s->coder->search_for_pns(s, avctx, sce);
if (s->options.tns && s->coder->search_for_tns)
s->coder->search_for_tns(s, sce);
if (s->options.tns && s->coder->apply_tns_filt)
s->coder->apply_tns_filt(s, sce);
if (sce->tns.present)
tns_mode = 1;
+ if (s->options.pns && s->coder->search_for_pns)
+ s->coder->search_for_pns(s, avctx, sce);
}
s->cur_channel = start_ch;
if (s->options.intensity_stereo) { /* Intensity Stereo */