ref: 5c24975c3a1e46439a37c1a8b16c10515c85d1da
parent: 98726c4ca61ddfb691e7fc2dff26d9e51e7fffaa
author: Jean-Marc Valin <jmvalin@amazon.com>
date: Sat Oct 14 22:37:54 EDT 2023
Rename NEURAL_PLC to ENABLE_DEEP_PLC Signed-off-by: Jean-Marc Valin <jmvalin@amazon.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -373,8 +373,8 @@
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()
--- a/configure.ac
+++ b/configure.ac
@@ -170,12 +170,12 @@
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
--- a/silk/API.h
+++ b/silk/API.h
@@ -114,7 +114,7 @@
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 */
--- a/silk/PLC.c
+++ b/silk/PLC.c
@@ -33,7 +33,7 @@
#include "stack_alloc.h"
#include "PLC.h"
-#ifdef NEURAL_PLC
+#ifdef ENABLE_DEEP_PLC
#include "lpcnet.h"
#endif
@@ -51,7 +51,7 @@
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 @@
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 @@
/* Generate Signal */
/****************************/
silk_PLC_conceal( psDec, psDecCtrl, frame,
-#ifdef NEURAL_PLC
+#ifdef ENABLE_DEEP_PLC
lpcnet,
#endif
arch );
@@ -102,7 +102,7 @@
/* 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 @@
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 @@
/* 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 @@
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
{
--- a/silk/PLC.h
+++ b/silk/PLC.h
@@ -49,7 +49,7 @@
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 */
--- a/silk/dec_API.c
+++ b/silk/dec_API.c
@@ -86,7 +86,7 @@
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 @@
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);
--- a/silk/decode_frame.c
+++ b/silk/decode_frame.c
@@ -43,7 +43,7 @@
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 @@
/* Update PLC state */
/********************************************************/
silk_PLC( psDec, psDecCtrl, pOut, 0,
-#ifdef NEURAL_PLC
+#ifdef ENABLE_DEEP_PLC
lpcnet,
#endif
arch );
@@ -105,7 +105,7 @@
} else {
/* Handle packet loss by extrapolation */
silk_PLC( psDec, psDecCtrl, pOut, 1,
-#ifdef NEURAL_PLC
+#ifdef ENABLE_DEEP_PLC
lpcnet,
#endif
arch );
--- a/silk/main.h
+++ b/silk/main.h
@@ -410,7 +410,7 @@
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 */
--- a/silk/structs.h
+++ b/silk/structs.h
@@ -34,7 +34,7 @@
#include "entenc.h"
#include "entdec.h"
-#ifdef NEURAL_PLC
+#ifdef ENABLE_DEEP_PLC
#include "lpcnet.h"
#include "lpcnet_private.h"
#endif
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -61,7 +61,7 @@
silk_DecControlStruct DecControl;
int decode_gain;
int arch;
-#ifdef NEURAL_PLC
+#ifdef ENABLE_DEEP_PLC
LPCNetPLCState lpcnet;
#endif
@@ -156,7 +156,7 @@
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 @@
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 @@
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
}
--
⑨