From 5c24975c3a1e46439a37c1a8b16c10515c85d1da Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin <jmvalin@amazon.com> Date: Sun, 15 Oct 2023 02:37:54 -0400 Subject: [PATCH] Rename NEURAL_PLC to ENABLE_DEEP_PLC Signed-off-by: Jean-Marc Valin <jmvalin@amazon.com> --- CMakeLists.txt | 4 ++-- configure.ac | 10 +++++----- silk/API.h | 2 +- silk/PLC.c | 16 ++++++++-------- silk/PLC.h | 2 +- silk/dec_API.c | 4 ++-- silk/decode_frame.c | 6 +++--- silk/main.h | 2 +- silk/structs.h | 2 +- src/opus_decoder.c | 8 ++++---- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a618e7620..a0dd3479d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -373,8 +373,8 @@ endif() if (OPUS_NEURAL_FEC) target_compile_definitions(opus PRIVATE ENABLE_NEURAL_FEC) - if(NOT OPUS_NEURAL_PLC) - target_compile_definitions(opus PRIVATE NEURAL_PLC) + if(NOT OPUS_DEEP_PLC) + target_compile_definitions(opus PRIVATE ENABLE_DEEP_PLC) endif() endif() diff --git a/configure.ac b/configure.ac index 2bf4fca18..ee5fe19ec 100644 --- a/configure.ac +++ b/configure.ac @@ -170,12 +170,12 @@ AS_IF([test "$enable_neural_fec" = "yes"],[ AC_DEFINE([ENABLE_NEURAL_FEC], [1], [Neural FEC]) ]) -AC_ARG_ENABLE([neural-plc], - [AS_HELP_STRING([--enable-neural-plc], [Use neural PLC for SILK])],, - [enable_neural_plc=yes]) +AC_ARG_ENABLE([deep-plc], + [AS_HELP_STRING([--enable-deep-plc], [Use deep PLC for SILK])],, + [enable_deep_plc=yes]) -AS_IF([test "$enable_neural_plc" = "yes"],[ - AC_DEFINE([NEURAL_PLC], [1], [Neural PLC]) +AS_IF([test "$enable_deep_plc" = "yes"],[ + AC_DEFINE([ENABLE_DEEP_PLC], [1], [Deep PLC]) ]) has_float_approx=no diff --git a/silk/API.h b/silk/API.h index 918ad696c..82ae68119 100644 --- a/silk/API.h +++ b/silk/API.h @@ -114,7 +114,7 @@ opus_int silk_Decode( /* O Returns error co ec_dec *psRangeDec, /* I/O Compressor data structure */ opus_int16 *samplesOut, /* O Decoded output speech vector */ opus_int32 *nSamplesOut, /* O Number of samples decoded */ -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState *lpcnet, #endif int arch /* I Run-time architecture */ diff --git a/silk/PLC.c b/silk/PLC.c index 224b150d7..8a5e4f3b3 100644 --- a/silk/PLC.c +++ b/silk/PLC.c @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "stack_alloc.h" #include "PLC.h" -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC #include "lpcnet.h" #endif @@ -51,7 +51,7 @@ static OPUS_INLINE void silk_PLC_conceal( silk_decoder_state *psDec, /* I/O Decoder state */ silk_decoder_control *psDecCtrl, /* I/O Decoder control */ opus_int16 frame[], /* O LPC residual signal */ -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState *lpcnet, #endif int arch /* I Run-time architecture */ @@ -74,7 +74,7 @@ void silk_PLC( silk_decoder_control *psDecCtrl, /* I/O Decoder control */ opus_int16 frame[], /* I/O signal */ opus_int lost, /* I Loss flag */ -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState *lpcnet, #endif int arch /* I Run-time architecture */ @@ -91,7 +91,7 @@ void silk_PLC( /* Generate Signal */ /****************************/ silk_PLC_conceal( psDec, psDecCtrl, frame, -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC lpcnet, #endif arch ); @@ -102,7 +102,7 @@ void silk_PLC( /* Update state */ /****************************/ silk_PLC_update( psDec, psDecCtrl ); -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC if ( lpcnet != NULL && psDec->sPLC.fs_kHz == 16 ) { int k; for( k = 0; k < psDec->nb_subfr; k += 2 ) { @@ -217,7 +217,7 @@ static OPUS_INLINE void silk_PLC_conceal( silk_decoder_state *psDec, /* I/O Decoder state */ silk_decoder_control *psDecCtrl, /* I/O Decoder control */ opus_int16 frame[], /* O LPC residual signal */ -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState *lpcnet, #endif int arch /* I Run-time architecture */ @@ -396,7 +396,7 @@ static OPUS_INLINE void silk_PLC_conceal( /* Scale with Gain */ frame[ i ] = (opus_int16)silk_SAT16( silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( sLPC_Q14_ptr[ MAX_LPC_ORDER + i ], prevGain_Q10[ 1 ] ), 8 ) ) ); } -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC if ( lpcnet != NULL && psDec->sPLC.fs_kHz == 16 ) { for( k = 0; k < psDec->nb_subfr; k += 2 ) { lpcnet_plc_conceal( lpcnet, frame + k * psDec->subfr_length ); @@ -467,7 +467,7 @@ void silk_PLC_glue_frames( slope_Q16 = silk_DIV32_16( ( (opus_int32)1 << 16 ) - gain_Q16, length ); /* Make slope 4x steeper to avoid missing onsets after DTX */ slope_Q16 = silk_LSHIFT( slope_Q16, 2 ); -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC if ( psDec->sPLC.fs_kHz != 16 ) #endif { diff --git a/silk/PLC.h b/silk/PLC.h index b59f7f00b..1bebb7863 100644 --- a/silk/PLC.h +++ b/silk/PLC.h @@ -49,7 +49,7 @@ void silk_PLC( silk_decoder_control *psDecCtrl, /* I/O Decoder control */ opus_int16 frame[], /* I/O signal */ opus_int lost, /* I Loss flag */ -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState *lpcnet, #endif int arch /* I Run-time architecture */ diff --git a/silk/dec_API.c b/silk/dec_API.c index 67d1d3e52..090d6089a 100644 --- a/silk/dec_API.c +++ b/silk/dec_API.c @@ -86,7 +86,7 @@ opus_int silk_Decode( /* O Returns error co ec_dec *psRangeDec, /* I/O Compressor data structure */ opus_int16 *samplesOut, /* O Decoded output speech vector */ opus_int32 *nSamplesOut, /* O Number of samples decoded */ -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState *lpcnet, #endif int arch /* I Run-time architecture */ @@ -301,7 +301,7 @@ opus_int silk_Decode( /* O Returns error co condCoding = CODE_CONDITIONALLY; } ret += silk_decode_frame( &channel_state[ n ], psRangeDec, &samplesOut1_tmp[ n ][ 2 ], &nSamplesOutDec, lostFlag, condCoding, -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC n == 0 ? lpcnet : NULL, #endif arch); diff --git a/silk/decode_frame.c b/silk/decode_frame.c index 952a807a7..b393952ca 100644 --- a/silk/decode_frame.c +++ b/silk/decode_frame.c @@ -43,7 +43,7 @@ opus_int silk_decode_frame( opus_int32 *pN, /* O Pointer to size of output frame */ opus_int lostFlag, /* I 0: no loss, 1 loss, 2 decode fec */ opus_int condCoding, /* I The type of conditional coding to use */ -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState *lpcnet, #endif int arch /* I Run-time architecture */ @@ -91,7 +91,7 @@ opus_int silk_decode_frame( /* Update PLC state */ /********************************************************/ silk_PLC( psDec, psDecCtrl, pOut, 0, -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC lpcnet, #endif arch ); @@ -105,7 +105,7 @@ opus_int silk_decode_frame( } else { /* Handle packet loss by extrapolation */ silk_PLC( psDec, psDecCtrl, pOut, 1, -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC lpcnet, #endif arch ); diff --git a/silk/main.h b/silk/main.h index 4547b1366..c67775ef9 100644 --- a/silk/main.h +++ b/silk/main.h @@ -410,7 +410,7 @@ opus_int silk_decode_frame( opus_int32 *pN, /* O Pointer to size of output frame */ opus_int lostFlag, /* I 0: no loss, 1 loss, 2 decode fec */ opus_int condCoding, /* I The type of conditional coding to use */ -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState *lpcnet, #endif int arch /* I Run-time architecture */ diff --git a/silk/structs.h b/silk/structs.h index 0882696cf..cc85c1cac 100644 --- a/silk/structs.h +++ b/silk/structs.h @@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "entenc.h" #include "entdec.h" -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC #include "lpcnet.h" #include "lpcnet_private.h" #endif diff --git a/src/opus_decoder.c b/src/opus_decoder.c index 5c17c232a..80a8c5676 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -61,7 +61,7 @@ struct OpusDecoder { silk_DecControlStruct DecControl; int decode_gain; int arch; -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC LPCNetPLCState lpcnet; #endif @@ -156,7 +156,7 @@ int opus_decoder_init(OpusDecoder *st, opus_int32 Fs, int channels) st->prev_mode = 0; st->frame_size = Fs/400; -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC lpcnet_plc_init( &st->lpcnet, LPCNET_PLC_CODEC ); #endif st->arch = opus_select_arch(); @@ -409,7 +409,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, int first_frame = decoded_samples == 0; silk_ret = silk_Decode( silk_dec, &st->DecControl, lost_flag, first_frame, &dec, pcm_ptr, &silk_frame_size, -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC &st->lpcnet, #endif st->arch ); @@ -927,7 +927,7 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...) silk_InitDecoder( silk_dec ); st->stream_channels = st->channels; st->frame_size = st->Fs/400; -#ifdef NEURAL_PLC +#ifdef ENABLE_DEEP_PLC lpcnet_plc_reset( &st->lpcnet ); #endif } -- GitLab