diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-05-19 21:14:40 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-06-16 20:01:40 +0300 |
commit | d7ce091b1c459eafcbbb43a3e15c2590f5657b24 (patch) | |
tree | b158cda83622f8d3a5cd855636632f665ab1895d /silk | |
parent | e0c6eae8cc789b1d80babe5219d505fbf9d91a88 (diff) |
Don't run the DRED encoder unless DRED is enabled
Diffstat (limited to 'silk')
-rw-r--r-- | silk/control.h | 3 | ||||
-rw-r--r-- | silk/enc_API.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/silk/control.h b/silk/control.h index b76ec33c..8d2392d3 100644 --- a/silk/control.h +++ b/silk/control.h @@ -77,6 +77,9 @@ typedef struct { /* I: Flag to enable in-band Forward Error Correction (FEC); 0/1 */ opus_int useInBandFEC; + /* I: Flag to enable in-band Deep REDundancy (DRED); 0/1 */ + opus_int useDRED; + /* I: Flag to actually code in-band Forward Error Correction (FEC) in the current packet; 0/1 */ opus_int LBRR_coded; diff --git a/silk/enc_API.c b/silk/enc_API.c index 45d67877..bdb858af 100644 --- a/silk/enc_API.c +++ b/silk/enc_API.c @@ -469,8 +469,12 @@ opus_int silk_Encode( /* O Returns error co silk_encode_do_VAD_Fxx( &psEnc->state_Fxx[ 0 ], activity ); #ifdef ENABLE_NEURAL_FEC - /* DRED Encoder */ - dred_process_silk_frame( &psEnc->state_Fxx[ 0 ].sCmn.dred_encoder, &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[0] ); + if ( encControl->useDRED ) { + /* DRED Encoder */ + dred_process_silk_frame( &psEnc->state_Fxx[ 0 ].sCmn.dred_encoder, &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[0] ); + } else { + psEnc->state_Fxx[ 0 ].sCmn.dred_encoder.latents_buffer_fill = 0; + } #endif /* Encode */ |