diff mbox series

[FFmpeg-devel] doc/encoders/libopus: clarify lowdelay and cutoff options

Message ID 20230826134841.161129-1-stefasab@gmail.com
State Accepted
Commit 00eb4966aa8a71a70c4758254027fdc6925f8f86
Headers show
Series [FFmpeg-devel] doc/encoders/libopus: clarify lowdelay and cutoff options | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Stefano Sabatini Aug. 26, 2023, 1:48 p.m. UTC
Extend descriptions for the application=lowdelay and cutoff options.
Based on notes by Mingye Wang.

Address issue:
http://trac.ffmpeg.org/ticket/10330
---
 doc/encoders.texi       | 7 +++++--
 libavcodec/libopusenc.c | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

Comments

Stefano Sabatini Oct. 6, 2023, 7:55 a.m. UTC | #1
On date Saturday 2023-08-26 15:48:41 +0200, Stefano Sabatini wrote:
> Extend descriptions for the application=lowdelay and cutoff options.
> Based on notes by Mingye Wang.
> 
> Address issue:
> http://trac.ffmpeg.org/ticket/10330
> ---
>  doc/encoders.texi       | 7 +++++--
>  libavcodec/libopusenc.c | 2 +-
>  2 files changed, 6 insertions(+), 3 deletions(-)

Applied.
diff mbox series

Patch

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 25c40a6486..96250fe3fe 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -977,14 +977,17 @@  Favor improved speech intelligibility.
 @item audio
 Favor faithfulness to the input (the default).
 @item lowdelay
-Restrict to only the lowest delay modes.
+Restrict to only the lowest delay modes by disabling voice-optimized
+modes.
 @end table
 
 @item cutoff (N.A.)
 Set cutoff bandwidth in Hz. The argument must be exactly one of the
 following: 4000, 6000, 8000, 12000, or 20000, corresponding to
 narrowband, mediumband, wideband, super wideband, and fullband
-respectively. The default is 0 (cutoff disabled).
+respectively. The default is 0 (cutoff disabled). Note that libopus
+forces a wideband cutoff for bitrates < 15 kbps, unless CELT-only
+(@option{application} set to @samp{lowdelay}) mode is used.
 
 @item mapping_family (@emph{mapping_family})
 Set channel mapping family to be used by the encoder. The default value of -1
diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index 5a0786f32f..f395d84af5 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -547,7 +547,7 @@  static const AVOption libopus_options[] = {
     { "application",    "Intended application type",           OFFSET(application),    AV_OPT_TYPE_INT,   { .i64 = OPUS_APPLICATION_AUDIO }, OPUS_APPLICATION_VOIP, OPUS_APPLICATION_RESTRICTED_LOWDELAY, FLAGS, "application" },
         { "voip",           "Favor improved speech intelligibility",   0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_VOIP },                0, 0, FLAGS, "application" },
         { "audio",          "Favor faithfulness to the input",         0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_AUDIO },               0, 0, FLAGS, "application" },
-        { "lowdelay",       "Restrict to only the lowest delay modes", 0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_RESTRICTED_LOWDELAY }, 0, 0, FLAGS, "application" },
+        { "lowdelay",       "Restrict to only the lowest delay modes, disable voice-optimized modes", 0, AV_OPT_TYPE_CONST, { .i64 = OPUS_APPLICATION_RESTRICTED_LOWDELAY }, 0, 0, FLAGS, "application" },
     { "frame_duration", "Duration of a frame in milliseconds", OFFSET(frame_duration), AV_OPT_TYPE_FLOAT, { .dbl = 20.0 }, 2.5, 120.0, FLAGS },
     { "packet_loss",    "Expected packet loss percentage",     OFFSET(packet_loss),    AV_OPT_TYPE_INT,   { .i64 = 0 },    0,   100,  FLAGS },
     { "fec",             "Enable inband FEC. Expected packet loss must be non-zero",     OFFSET(fec),    AV_OPT_TYPE_BOOL,   { .i64 = 0 }, 0, 1, FLAGS },