Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-08-10 01:17:06 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-08-10 01:25:52 +0300
commit0886828eed7a293f556ad45a70d8d7ab04325c9d (patch)
tree7be20cfb60b2db1d26f2fa0836554823518ca9b9 /src/opus_encoder.c
parent5160d7fdfada61e48d4c3df110cd773ec5e9ce7e (diff)
Making it easier to remove DRED experimental ID
When ready, change DRED_EXTENSION_ID to the final ID, remove DRED_EXPERIMENTAL_VERSION completely, and change DRED_EXPERIMENTAL_BYTES to zero (eventually remove it).
Diffstat (limited to 'src/opus_encoder.c')
-rw-r--r--src/opus_encoder.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 3933ab27..e8be50f4 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -2259,16 +2259,18 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
/* Remaining space for DRED, accounting for cost the 3 extra bytes for code 3, padding length, and extension number. */
dred_bytes_left = IMIN(DRED_MAX_DATA_SIZE, max_data_bytes-ret-3);
/* Check whether we actually have something to encode. */
- if (dred_chunks >= 1 && dred_bytes_left >= DRED_MIN_BYTES+2) {
+ if (dred_chunks >= 1 && dred_bytes_left >= DRED_MIN_BYTES+DRED_EXPERIMENTAL_BYTES) {
int dred_bytes;
+#ifdef DRED_EXPERIMENTAL_VERSION
/* Add temporary extension type and version.
These bytes will be removed once extension is finalized. */
buf[0] = 'D';
- buf[1] = DRED_VERSION;
- dred_bytes = dred_encode_silk_frame(&st->dred_encoder, buf+2, dred_chunks, dred_bytes_left-2);
- dred_bytes += 2;
+ buf[1] = DRED_EXPERIMENTAL_VERSION;
+#endif
+ dred_bytes = dred_encode_silk_frame(&st->dred_encoder, buf+DRED_EXPERIMENTAL_BYTES, dred_chunks, dred_bytes_left-DRED_EXPERIMENTAL_BYTES);
+ dred_bytes += DRED_EXPERIMENTAL_BYTES;
celt_assert(dred_bytes <= dred_bytes_left);
- extension.id = 127;
+ extension.id = DRED_EXTENSION_ID;
extension.frame = 0;
extension.data = buf;
extension.len = dred_bytes;