mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Subject: [ptxdist] [PATCH] opus: add machine learning options
Date: Tue, 26 Mar 2024 09:24:00 +0100	[thread overview]
Message-ID: <20240326082400.2458682-1-p.zabel@pengutronix.de> (raw)

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 <p.zabel@pengutronix.de>
---
 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




             reply	other threads:[~2024-03-26  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26  8:24 Philipp Zabel [this message]
2024-04-08 11:05 ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240326082400.2458682-1-p.zabel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox