Interface for bandwidth switching
[opus.git] / src_common / SKP_Silk_control_codec.c
index 00b4cc5..79ee49d 100644 (file)
@@ -60,18 +60,20 @@ SKP_INLINE SKP_int SKP_Silk_setup_LBRR(
 SKP_int SKP_Silk_control_encoder( \r
     SKP_Silk_encoder_state_Fxx      *psEnc,             /* I/O  Pointer to Silk encoder state           */\r
     SKP_SILK_SDK_EncControlStruct   *encControl,        /* I:   Control structure                       */\r
-    const SKP_int32                 TargetRate_bps      /* I    Target max bitrate (bps)                */\r
+    const SKP_int32                 TargetRate_bps,      /* I    Target max bitrate (bps)                */\r
+    const SKP_int                   allow_bw_switch     /* I    Flag to allow switching audio bandwidth */\r
 )\r
 {\r
     SKP_int   fs_kHz, ret = 0;\r
 \r
-    psEnc->sCmn.useDTX                = encControl->useDTX;\r
-    psEnc->sCmn.useCBR                = encControl->useCBR;\r
-    psEnc->sCmn.API_fs_Hz             = encControl->API_sampleRate;\r
-    psEnc->sCmn.maxInternal_fs_Hz     = encControl->maxInternalSampleRate;\r
-    psEnc->sCmn.minInternal_fs_Hz     = encControl->minInternalSampleRate;\r
-    psEnc->sCmn.desiredInternal_fs_Hz = encControl->desiredInternalSampleRate;\r
-    psEnc->sCmn.useInBandFEC          = encControl->useInBandFEC;\r
+    psEnc->sCmn.useDTX                 = encControl->useDTX;\r
+    psEnc->sCmn.useCBR                 = encControl->useCBR;\r
+    psEnc->sCmn.API_fs_Hz              = encControl->API_sampleRate;\r
+    psEnc->sCmn.maxInternal_fs_Hz      = encControl->maxInternalSampleRate;\r
+    psEnc->sCmn.minInternal_fs_Hz      = encControl->minInternalSampleRate;\r
+    psEnc->sCmn.desiredInternal_fs_Hz  = encControl->desiredInternalSampleRate;\r
+    psEnc->sCmn.useInBandFEC           = encControl->useInBandFEC;\r
+    psEnc->sCmn.allow_bandwidth_switch = allow_bw_switch;\r
 \r
     if( psEnc->sCmn.controlled_since_last_payload != 0 && psEnc->sCmn.prefillFlag == 0 ) {\r
         if( psEnc->sCmn.API_fs_Hz != psEnc->sCmn.prev_API_fs_Hz && psEnc->sCmn.fs_kHz > 0 ) {\r