diff --git a/COPYING b/COPYING index ca0f52cfc719046293e5db9b937a62358af2db35..6df9b09d2c1de510e8deca20d4f657bc8ccda946 100644 --- a/COPYING +++ b/COPYING @@ -26,7 +26,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Copyright (c) 2006-2010, Skype Limited. All rights reserved. +Copyright (c) 2006-2011, Skype Limited. All rights reserved. Redistribution and use in source and binary forms, with or without modification, (subject to the limitations in the disclaimer below) diff --git a/autogen.sh b/autogen.sh old mode 100755 new mode 100644 diff --git a/doc/build_draft.sh b/doc/build_draft.sh old mode 100755 new mode 100644 diff --git a/opus.sln b/opus.sln index 660e2427090f8758af888e78a018f947773dab29..75253085d5f46b03aa38a3b8b0fa10fbad0b4a2d 100644 --- a/opus.sln +++ b/opus.sln @@ -28,31 +28,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "src_FIX", "silk\src_FIX\src {950F7176-3D29-4CBF-8C40-58B918EAEBB2} = {950F7176-3D29-4CBF-8C40-58B918EAEBB2} {06D10292-A23C-4C5E-9C0F-28737769206F} = {06D10292-A23C-4C5E-9C0F-28737769206F} {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "src_FLP", "silk\src_FLP\src_FLP.vcxproj", "{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}" - ProjectSection(ProjectDependencies) = postProject - {950F7176-3D29-4CBF-8C40-58B918EAEBB2} = {950F7176-3D29-4CBF-8C40-58B918EAEBB2} - {06D10292-A23C-4C5E-9C0F-28737769206F} = {06D10292-A23C-4C5E-9C0F-28737769206F} - {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_silk_dec", "silk\test_silk_dec\test_silk_dec.vcxproj", "{8CA2DBCB-F28E-4022-ACD7-E2C23A15827F}" - ProjectSection(ProjectDependencies) = postProject - {8484C90D-1561-402F-A91D-2DB10F8C5171} = {8484C90D-1561-402F-A91D-2DB10F8C5171} - {950F7176-3D29-4CBF-8C40-58B918EAEBB2} = {950F7176-3D29-4CBF-8C40-58B918EAEBB2} - {06D10292-A23C-4C5E-9C0F-28737769206F} = {06D10292-A23C-4C5E-9C0F-28737769206F} - {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782} = {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782} - {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF} {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_silk_enc", "silk\test_silk_enc\test_silk_enc.vcxproj", "{38945839-ADA4-40CA-9C43-092FD47960A0}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "src_FLP", "silk\src_FLP\src_FLP.vcxproj", "{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}" ProjectSection(ProjectDependencies) = postProject - {8484C90D-1561-402F-A91D-2DB10F8C5171} = {8484C90D-1561-402F-A91D-2DB10F8C5171} {950F7176-3D29-4CBF-8C40-58B918EAEBB2} = {950F7176-3D29-4CBF-8C40-58B918EAEBB2} {06D10292-A23C-4C5E-9C0F-28737769206F} = {06D10292-A23C-4C5E-9C0F-28737769206F} - {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782} = {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782} {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF} {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} EndProjectSection @@ -91,14 +73,6 @@ Global {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|Win32.Build.0 = Debug|Win32 {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|Win32.ActiveCfg = Release|Win32 {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|Win32.Build.0 = Release|Win32 - {8CA2DBCB-F28E-4022-ACD7-E2C23A15827F}.Debug|Win32.ActiveCfg = Debug|Win32 - {8CA2DBCB-F28E-4022-ACD7-E2C23A15827F}.Debug|Win32.Build.0 = Debug|Win32 - {8CA2DBCB-F28E-4022-ACD7-E2C23A15827F}.Release|Win32.ActiveCfg = Release|Win32 - {8CA2DBCB-F28E-4022-ACD7-E2C23A15827F}.Release|Win32.Build.0 = Release|Win32 - {38945839-ADA4-40CA-9C43-092FD47960A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {38945839-ADA4-40CA-9C43-092FD47960A0}.Debug|Win32.Build.0 = Debug|Win32 - {38945839-ADA4-40CA-9C43-092FD47960A0}.Release|Win32.ActiveCfg = Release|Win32 - {38945839-ADA4-40CA-9C43-092FD47960A0}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/silk b/silk index 0d73d676d76f9bc9eae4d3863e0c43d2c73f943e..fcf95bac9330e8e6db1184496ae33007a7c7a9cf 160000 --- a/silk +++ b/silk @@ -1 +1 @@ -Subproject commit 0d73d676d76f9bc9eae4d3863e0c43d2c73f943e +Subproject commit fcf95bac9330e8e6db1184496ae33007a7c7a9cf diff --git a/src/opus_decoder.c b/src/opus_decoder.c index 4c7d17900618a6d9cb7df4c0a41dd65f25f09045..14ab6ccb24914fed3a1bda34bcec842ca87450c8 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -145,10 +145,6 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, if (st->stream_channels > st->channels) return OPUS_CORRUPTED_DATA; - /* FIXME: Remove this when we add SILK stereo support */ - if (st->stream_channels == 2 && mode != MODE_CELT_ONLY) - return OPUS_UNIMPLEMENTED; - if (data!=NULL && !st->prev_redundancy && mode != st->prev_mode && st->prev_mode > 0 && !(mode == MODE_SILK_ONLY && st->prev_mode == MODE_HYBRID) && !(mode == MODE_HYBRID && st->prev_mode == MODE_SILK_ONLY)) @@ -191,6 +187,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, /* Hybrid mode */ DecControl.internalSampleRate = 16000; } + DecControl.nChannels = st->channels; lost_flag = data == NULL ? 1 : 2 * decode_fec; decoded_samples = 0; @@ -198,12 +195,12 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, /* Call SILK decoder */ int first_frame = decoded_samples == 0; silk_ret = SKP_Silk_SDK_Decode( st->silk_dec, &DecControl, - lost_flag, first_frame, &dec, len, pcm_ptr, &silk_frame_size ); + lost_flag, first_frame, &dec, pcm_ptr, &silk_frame_size ); if( silk_ret ) { fprintf (stderr, "SILK decode error\n"); /* Handle error */ } - pcm_ptr += silk_frame_size; + pcm_ptr += silk_frame_size * st->channels; decoded_samples += silk_frame_size; } while( decoded_samples < frame_size ); } else { @@ -283,11 +280,13 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data, pcm[i] = ADD_SAT16(pcm[i], pcm_celt[i]); } + { const CELTMode *celt_mode; celt_decoder_ctl(st->celt_dec, CELT_GET_MODE(&celt_mode)); window = celt_mode->window; } + /* 5 ms redundant frame for SILK->CELT */ if (redundancy && !celt_to_silk) { diff --git a/src/opus_encoder.c b/src/opus_encoder.c index cf0eee178308741763a8123851a1d1334afa764b..a5f3ffd5705cbfdd49a24af5b9f967daf7c025f5 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -66,6 +66,7 @@ OpusEncoder *opus_encoder_create(int Fs, int channels) /* default SILK parameters */ st->silk_mode.API_sampleRate = st->Fs; + st->silk_mode.nChannels = channels; st->silk_mode.maxInternalSampleRate = 16000; st->silk_mode.minInternalSampleRate = 8000; st->silk_mode.payloadSize_ms = 20; @@ -154,10 +155,6 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size, st->mode = MODE_CELT_ONLY; } - /* FIXME: Remove this once SILK supports stereo */ - if (st->channels == 2) - st->mode = MODE_CELT_ONLY; - /* Bandwidth selection */ if (st->mode == MODE_CELT_ONLY) { @@ -371,7 +368,6 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size, } } - ec_enc_shrink(&enc, nb_compr_bytes); } else { nb_compr_bytes = 0; diff --git a/src/test_opus.c b/src/test_opus.c index 78115f0ebdcbe2d6344c1cc8ac9f243d691cc4fc..797c872bffc99d771436cd9d73fc348ef1ae721b 100644 --- a/src/test_opus.c +++ b/src/test_opus.c @@ -44,7 +44,7 @@ void print_usage( char* argv[] ) { fprintf(stderr, "Usage: %s <mode (0/1/2)> <sampling rate (Hz)> <channels> " "<bits per second> [options] <input> <output>\n\n", argv[0]); - fprintf(stderr, "mode: 0 for audo, 1 for voice, 2 for audio:\n" ); + fprintf(stderr, "mode: 0 for auto, 1 for voice, 2 for audio:\n" ); fprintf(stderr, "options:\n" ); fprintf(stderr, "-cbr : enable constant bitrate; default: VBR\n" ); fprintf(stderr, "-bandwidth <NB|MB|WB|SWB|FB> : audio bandwidth (from narrowband to fullband); default: sampling rate\n" ); @@ -291,7 +291,7 @@ int main(int argc, char *argv[]) return 1; } - lost = rand()%100<packet_loss_perc || len[toggle]==0; + lost = rand()%100 < packet_loss_perc || len[toggle]==0; if( count >= use_inbandfec ) { /* delay by one packet when using in-band FEC */ if( use_inbandfec ) {