Skip to content

Commit 7cd5b40

Browse files
Merge pull request #594 from tguilbert-google/opus_params
Add OpusEncoderConfig parameters
2 parents faa91a7 + 419a72f commit 7cd5b40

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

opus_codec_registration.src.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,21 @@
132132
dictionary OpusEncoderConfig {
133133
OpusBitstreamFormat format = "opus";
134134
[EnforceRange] unsigned long frameDuration;
135+
[EnforceRange] unsigned long complexity;
136+
[EnforceRange] unsigned long packetlossperc = 0;
137+
boolean useinbandfec = false;
138+
boolean usedtx = false;
135139
};
136140
</xmp>
137141
</pre>
138142

139143
To check if an {{OpusEncoderConfig}} is valid, run these steps:
140144
1. If {{OpusEncoderConfig/frameDuration}} is not a valid `ptime` value,
141145
which is described in Section 6.1 of [[RFC7587]], return `false`.
146+
1. If {{OpusEncoderConfig/complexity}} is specified and not within the range of
147+
`0` and `10` inclusively, return `false`.
148+
1. If {{OpusEncoderConfig/packetlossperc}} is specified and not within the range of
149+
`0` and `100` inclusively, return `false`.
142150
2. Return `true`.
143151

144152
<dl>
@@ -151,6 +159,32 @@
151159
<dd>
152160
Configures the frame duration, in milliseconds, of output {{EncodedAudioChunk}}s.
153161
</dd>
162+
<dt><dfn dict-member for=OpusEncoderConfig>complexity</dfn></dt>
163+
<dd>
164+
Configures the encoder's computational complexity, as described in section 2.1.9.
165+
of [[RFC6716]]. The valid range is `0` to `10`, with `10` representing the highest
166+
complexity. If no value is specificied, the default value is platform-specific:
167+
User Agents <em class="rfc2119">SHOULD</em> set a default of `5` for mobile
168+
platforms, and a default of `9` for all other platforms.
169+
</dd>
170+
<dt><dfn dict-member for=OpusEncoderConfig>packetlossperc</dfn></dt>
171+
<dd>
172+
Configures the encoder's expected packet loss percentage. The valid range is
173+
`0` to `100`.
174+
175+
NOTE: The packet loss percentage might be updated over the course of an
176+
encoding, and it is recommended for User Agents to support these reconfigurations.
177+
</dd>
178+
<dt><dfn dict-member for=OpusEncoderConfig>useinbandfec</dfn></dt>
179+
<dd>
180+
Specifies whether the encoder provides Opus in-band Forward Error Correction
181+
(FEC), as described by section 2.1.7. of [[RFC6716]].
182+
</dd>
183+
<dt><dfn dict-member for=OpusEncoderConfig>usedtx</dfn></dt>
184+
<dd>
185+
Specifies if the encoder uses Discontinuous Transmission (DTX), as described
186+
by section 2.1.9. of [[RFC6716]].
187+
</dd>
154188
</dl>
155189

156190
OpusBitstreamFormat {#opus-bitstream-format}

0 commit comments

Comments
 (0)