Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-08-21 21:27:38 +0300
committerRostislav Pehlivanov <atomnuker@gmail.com>2015-08-21 21:27:38 +0300
commita1c487e9215c5685f0694ebde5bba07f4a07e95a (patch)
treecf7031383eb8a966eebeb2be96d22f57856c1a4c /libavcodec/aacenc_tns.h
parenteab12d072e657ec748f0259b5281bd6912dccd70 (diff)
aacenc_tns: implement temporal noise shaping
This commit implements temporal noise shaping support in the encoder, along with an -aac_tns option to toggle it on or off (off by default for now). TNS will increase audio quality and reduce quantization noise by applying a multitap FIR filter across allowed coefficients and transmit side information to the decoder so it could create an inverse filter. Users are encouraged to test the new functionality by enabling -aac_tns 1 during encoding. No major bugs are observable at this time so after a while if no new problems appear and if the current implementation is deemed of high enough quality and stability it will be enabled by default, possibly at the same time the encoder has its experimental flag removed and becomes the standard aac encoder in ffmpeg. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/aacenc_tns.h')
-rw-r--r--libavcodec/aacenc_tns.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/libavcodec/aacenc_tns.h b/libavcodec/aacenc_tns.h
new file mode 100644
index 0000000000..3b11ca03b9
--- /dev/null
+++ b/libavcodec/aacenc_tns.h
@@ -0,0 +1,45 @@
+/*
+ * AAC encoder TNS
+ * Copyright (C) 2015 Rostislav Pehlivanov
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * AAC encoder temporal noise shaping
+ * @author Rostislav Pehlivanov ( atomnuker gmail com )
+ */
+
+#ifndef AVCODEC_AACENC_TNS_H
+#define AVCODEC_AACENC_TNS_H
+
+#include "aac.h"
+
+/** Frequency in Hz for lower limit of TNS **/
+#define TNS_LOW_LIMIT 2150
+
+/** LPC settings */
+#define TNS_MIN_PRED_ORDER 0
+#define MAX_LPC_PRECISION 4 /* 4 bits ltp coeff precision */
+#define TNS_LPC_PASSES 2
+#define MAX_LPC_SHIFT 4
+
+void encode_tns_info(AACEncContext *s, SingleChannelElement *sce);
+void search_for_tns(AACEncContext *s, SingleChannelElement *sce);
+
+#endif /* AVCODEC_AACENC_TNS_H */