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:
authorTimothy B. Terriberry <tterribe@xiph.org>2011-10-18 01:20:55 +0400
committerGregory Maxwell <greg@xiph.org>2011-10-18 07:31:20 +0400
commit6559d36a46cbc72ecb2c055a943ff1d35696533f (patch)
tree2adb0f9717409318ddb00cd84ad0a14aae992623 /silk/float/encode_frame_FLP.c
parentf2d6480f90b47ff942b590f7a4194ba381029702 (diff)
Remove redundant mid-only flag when side VAD flag is set.
If there is activity in a regular, side SILK frame, then it must be coded, so we don't need to send a mid-only flag.
Diffstat (limited to 'silk/float/encode_frame_FLP.c')
-rw-r--r--silk/float/encode_frame_FLP.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/silk/float/encode_frame_FLP.c b/silk/float/encode_frame_FLP.c
index d1056428..6c9e322e 100644
--- a/silk/float/encode_frame_FLP.c
+++ b/silk/float/encode_frame_FLP.c
@@ -40,38 +40,15 @@ static inline void silk_LBRR_encode_FLP(
opus_int condCoding /* I The type of conditional coding used so far for this frame */
);
-/****************/
-/* Encode frame */
-/****************/
-opus_int silk_encode_frame_FLP(
- silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- opus_int32 *pnBytesOut, /* O Number of payload bytes */
- ec_enc *psRangeEnc, /* I/O compressor data structure */
- opus_int condCoding /* I The type of conditional coding to use */
+void silk_encode_do_VAD_FLP(
+ silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */
)
{
- silk_encoder_control_FLP sEncCtrl;
- opus_int i, ret = 0;
- silk_float *x_frame, *res_pitch_frame;
- silk_float xfw[ MAX_FRAME_LENGTH ];
- silk_float res_pitch[ 2 * MAX_FRAME_LENGTH + LA_PITCH_MAX ];
-
-TIC(ENCODE_FRAME)
-
- psEnc->sCmn.indices.Seed = psEnc->sCmn.frameCounter++ & 3;
-
- /**************************************************************/
- /* Setup Input Pointers, and insert frame in input buffer */
- /*************************************************************/
- /* pointers aligned with start of frame to encode */
- x_frame = psEnc->x_buf + psEnc->sCmn.ltp_mem_length; /* start of frame to encode */
- res_pitch_frame = res_pitch + psEnc->sCmn.ltp_mem_length; /* start of pitch LPC residual frame */
-
/****************************/
/* Voice Activity Detection */
/****************************/
TIC(VAD)
- ret = silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1 );
+ silk_VAD_GetSA_Q8( &psEnc->sCmn, psEnc->sCmn.inputBuf + 1 );
TOC(VAD)
/**************************************************/
@@ -96,6 +73,34 @@ TOC(VAD)
psEnc->sCmn.indices.signalType = TYPE_UNVOICED;
psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesEncoded ] = 1;
}
+}
+
+/****************/
+/* Encode frame */
+/****************/
+opus_int silk_encode_frame_FLP(
+ silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ opus_int32 *pnBytesOut, /* O Number of payload bytes */
+ ec_enc *psRangeEnc, /* I/O compressor data structure */
+ opus_int condCoding /* I The type of conditional coding to use */
+)
+{
+ silk_encoder_control_FLP sEncCtrl;
+ opus_int i, ret = 0;
+ silk_float *x_frame, *res_pitch_frame;
+ silk_float xfw[ MAX_FRAME_LENGTH ];
+ silk_float res_pitch[ 2 * MAX_FRAME_LENGTH + LA_PITCH_MAX ];
+
+TIC(ENCODE_FRAME)
+
+ psEnc->sCmn.indices.Seed = psEnc->sCmn.frameCounter++ & 3;
+
+ /**************************************************************/
+ /* Setup Input Pointers, and insert frame in input buffer */
+ /*************************************************************/
+ /* pointers aligned with start of frame to encode */
+ x_frame = psEnc->x_buf + psEnc->sCmn.ltp_mem_length; /* start of frame to encode */
+ res_pitch_frame = res_pitch + psEnc->sCmn.ltp_mem_length; /* start of pitch LPC residual frame */
/***************************************/
/* Ensure smooth bandwidth transitions */