From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 26 Mar 2024 09:24:08 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rp26K-004v6q-2P for lore@lore.pengutronix.de; Tue, 26 Mar 2024 09:24:08 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rp26K-0000Vl-6s; Tue, 26 Mar 2024 09:24:08 +0100 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rp26D-0000VL-GC; Tue, 26 Mar 2024 09:24:01 +0100 From: Philipp Zabel To: ptxdist@pengutronix.de Date: Tue, 26 Mar 2024 09:24:00 +0100 Message-Id: <20240326082400.2458682-1-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] opus: add machine learning options X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Philipp Zabel Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Allow to use machine learning methods that improve voice quality under sporadic packet loss and at low bitrates, by enabling the deep packet loss concealment (PLC) and opus speech coding enhancement (OSCE), respectively. The speech coding enhancements are not yet standardized, but turning them on does not have compability implications, as they are purely voice quality enhancement steps done by the decoder. For details, see https://opus-codec.org/demo/opus-1.5/. Signed-off-by: Philipp Zabel --- rules/opus.in | 28 +++++++++++++++++++++++++++- rules/opus.make | 4 ++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/rules/opus.in b/rules/opus.in index d906da5e687a..df7e715690a6 100644 --- a/rules/opus.in +++ b/rules/opus.in @@ -1,9 +1,35 @@ ## SECTION=multimedia_libs -config OPUS +menuconfig OPUS tristate prompt "opus" select HOST_SYSTEM_PERL select HOST_MESON help Opus is a totally open, royalty-free, highly versatile audio codec. + +if OPUS + +config OPUS_DEEP_PLC + bool + prompt "enable deep packet loss concealment (PLC)" + help + Improves voice quality under sporadic packet loss, by using a deep + neural network to help with filling in short audio gaps in the + decoder. The decoder complexity needs to be set to 5 or more for this. + Increases binary size by about 1 MiB. + For details, see https://opus-codec.org/demo/opus-1.5/. + +config OPUS_OSCE + bool + prompt "enable opus speech coding enhancement (OSCE)" + help + Improves voice quality of low-bitrate streams by applying voice + enhancements in the decoder. + A Linear Adaptive Coding Enhancer (LACE, ~100 MFLOPS) is used at + decoder complexity setting 6, and a Non-Linear variation (NoLACE, + ~400 MFLOPS) is used at decoder complexity setting 7. + Increases binary size by about 1.6 MiB. + For details, see https://opus-codec.org/demo/opus-1.5/. + +endif diff --git a/rules/opus.make b/rules/opus.make index 0c3c659d0d43..707889c79662 100644 --- a/rules/opus.make +++ b/rules/opus.make @@ -53,10 +53,10 @@ OPUS_CONF_OPT := \ -Dcustom-modes=false \ -Ddocdir=doc/opus \ -Ddocs=disabled \ - -Denable-deep-plc=false \ + -Denable-deep-plc=$(call ptx/truefalse, PTXCONF_OPUS_DEEP_PLC) \ -Denable-dnn-debug-float=false \ -Denable-dred=false \ - -Denable-osce=false \ + -Denable-osce=$(call ptx/truefalse, PTXCONF_OPUS_OSCE) \ -Dextra-programs=disabled \ -Dfixed-point=$(call ptx/falsetrue, PTXCONF_HAS_HARDFLOAT) \ -Dfixed-point-debug=false \ -- 2.39.2