summaryrefslogtreecommitdiff
path: root/silk/enc_API.c
diff options
context:
space:
mode:
authorKoen Vos <koen.vos@skype.net>2011-10-09 12:53:59 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2011-10-09 12:53:59 -0400
commit42f1e3d6a7251bc78e6c5a43d268994a02667798 (patch)
tree0c36a7997ee7fe519dbe0fd45730a8750b9f1841 /silk/enc_API.c
parent1f65994ef428520534630d5d706c91fb1d690938 (diff)
downloadopus-42f1e3d6a7251bc78e6c5a43d268994a02667798.tar.gz
Two minor SILK fixes
- increases the max pitch lag by 1 (the thing Tim pointed out). this brings the decoder in sync with the old one - avoids that the first stereo frame is collapsed to mono
Diffstat (limited to 'silk/enc_API.c')
-rw-r--r--silk/enc_API.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/silk/enc_API.c b/silk/enc_API.c
index cd4d960c..7eb212f3 100644
--- a/silk/enc_API.c
+++ b/silk/enc_API.c
@@ -154,7 +154,10 @@ opus_int silk_Encode(
ret += silk_init_encoder( &psEnc->state_Fxx[ 1 ] );
silk_memset( psEnc->sStereo.pred_prev_Q13, 0, sizeof( psEnc->sStereo.pred_prev_Q13 ) );
silk_memset( psEnc->sStereo.sSide, 0, sizeof( psEnc->sStereo.sSide ) );
- silk_memset( psEnc->sStereo.mid_side_amp_Q0, 0, sizeof( psEnc->sStereo.mid_side_amp_Q0 ) );
+ psEnc->sStereo.mid_side_amp_Q0[ 0 ] = 0;
+ psEnc->sStereo.mid_side_amp_Q0[ 1 ] = 1;
+ psEnc->sStereo.mid_side_amp_Q0[ 2 ] = 0;
+ psEnc->sStereo.mid_side_amp_Q0[ 3 ] = 1;
psEnc->sStereo.width_prev_Q14 = 0;
psEnc->sStereo.smth_width_Q14 = SILK_FIX_CONST( 1, 14 );
if( psEnc->nChannelsAPI == 2 ) {
@@ -232,7 +235,7 @@ opus_int silk_Encode(
if( encControl->nChannelsAPI == 2 && encControl->nChannelsInternal == 2 ) {
int id = psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded;
for( n = 0; n < nSamplesFromInput; n++ ) {
- buf[ n+delay ] = samplesIn[ 2 * n ];
+ buf[ n+delay ] = samplesIn[ 2 * n ];
}
silk_memcpy(buf, &psEnc->state_Fxx[ 0 ].sCmn.delayBuf[MAX_ENCODER_DELAY-delay], delay*sizeof(opus_int16));
/* Making sure to start both resamplers from the same state when switching from mono to stereo */