[FFmpeg-devel] [PATCH 5/8] aactab: add deemphasis tables for USAC

Lynne dev at lynne.ee
Thu May 16 13:08:15 EEST 2024


---
 libavcodec/aactab.c | 25 +++++++++++++++++++++++++
 libavcodec/aactab.h |  2 ++
 2 files changed, 27 insertions(+)

diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c
index 3718b81a07..8ce5e43974 100644
--- a/libavcodec/aactab.c
+++ b/libavcodec/aactab.c
@@ -3377,3 +3377,28 @@ const DECLARE_ALIGNED(32, int, ff_aac_eld_window_480_fixed)[1800] = {
     0xffecff1c, 0xffed391e, 0xffed740c, 0xffedafb1,
     0xffedebe1, 0xffee287d, 0xffee654e, 0xffeea23f,
 };
+
+/* As specified by ISO/IEC 23003 */
+#define USAC_EMPH_COEFF 0.68
+
+DECLARE_ALIGNED(16, const float, ff_aac_deemph_weights)[16] = {
+    USAC_EMPH_COEFF,
+    USAC_EMPH_COEFF*USAC_EMPH_COEFF,
+    USAC_EMPH_COEFF*USAC_EMPH_COEFF*USAC_EMPH_COEFF,
+    USAC_EMPH_COEFF*USAC_EMPH_COEFF*USAC_EMPH_COEFF*USAC_EMPH_COEFF,
+
+    0,
+    USAC_EMPH_COEFF,
+    USAC_EMPH_COEFF*USAC_EMPH_COEFF,
+    USAC_EMPH_COEFF*USAC_EMPH_COEFF*USAC_EMPH_COEFF,
+
+    0,
+    0,
+    USAC_EMPH_COEFF,
+    USAC_EMPH_COEFF*USAC_EMPH_COEFF,
+
+    0,
+    0,
+    0,
+    USAC_EMPH_COEFF,
+};
diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h
index e1a2d8b9a1..91262380d4 100644
--- a/libavcodec/aactab.h
+++ b/libavcodec/aactab.h
@@ -64,6 +64,8 @@ DECLARE_ALIGNED(32, extern const float, ff_aac_eld_window_480)[1800];
 DECLARE_ALIGNED(32, extern const int,   ff_aac_eld_window_480_fixed)[1800];
 // @}
 
+extern const float ff_aac_deemph_weights[16];
+
 /* Initializes data shared between float decoder and encoder. */
 void ff_aac_float_common_init(void);
 
-- 
2.43.0.381.gb435a96ce8


More information about the ffmpeg-devel mailing list