diff --git a/silk/silk_dec_API.c b/silk/silk_dec_API.c index 5d9502ae9e98bc993500f0aa4a70df7b56fa69cc..8b75307b1d1d68d310569df1dfface794f297f56 100644 --- a/silk/silk_dec_API.c +++ b/silk/silk_dec_API.c @@ -192,7 +192,10 @@ opus_int silk_Decode( if( channel_state[ n ].LBRR_flags[ i ] ) { opus_int pulses[ MAX_FRAME_LENGTH ]; if( decControl->nChannelsInternal == 2 && n == 0 ) { - silk_stereo_decode_pred( psRangeDec, &decode_only_middle, MS_pred_Q13 ); + silk_stereo_decode_pred( psRangeDec, MS_pred_Q13 ); + if( channel_state[ 1 ].LBRR_flags[ i ] == 0 ) { + silk_stereo_decode_mid_only( psRangeDec, &decode_only_middle ); + } } silk_decode_indices( &channel_state[ n ], psRangeDec, i, 1 ); silk_decode_pulses( psRangeDec, pulses, channel_state[ n ].indices.signalType, @@ -208,7 +211,15 @@ opus_int silk_Decode( if( lostFlag == FLAG_DECODE_NORMAL || ( lostFlag == FLAG_DECODE_LBRR && channel_state[ 0 ].LBRR_flags[ channel_state[ 0 ].nFramesDecoded ] == 1 ) ) { - silk_stereo_decode_pred( psRangeDec, &decode_only_middle, MS_pred_Q13 ); + silk_stereo_decode_pred( psRangeDec, MS_pred_Q13 ); + /* For LBRR data, only decode mid-only flag if side-channel's LBRR flag is false */ + if( lostFlag == FLAG_DECODE_NORMAL || + ( lostFlag == FLAG_DECODE_LBRR && channel_state[ 1 ].LBRR_flags[ channel_state[ 0 ].nFramesDecoded ] == 0 ) ) + { + silk_stereo_decode_mid_only( psRangeDec, &decode_only_middle ); + } else { + decode_only_middle = 0; + } } else { for( n = 0; n < 2; n++ ) { MS_pred_Q13[n] = psDec->sStereo.pred_prev_Q13[n]; diff --git a/silk/silk_enc_API.c b/silk/silk_enc_API.c index 91e08ba65f46c96dad7c303e9b9d369ac691a298..383ea7f5acf6196efce58d92ac500b9d15652fe1 100644 --- a/silk/silk_enc_API.c +++ b/silk/silk_enc_API.c @@ -283,7 +283,11 @@ opus_int silk_Encode( for( n = 0; n < encControl->nChannelsInternal; n++ ) { if( psEnc->state_Fxx[ n ].sCmn.LBRR_flags[ i ] ) { if( encControl->nChannelsInternal == 2 && n == 0 ) { - silk_stereo_encode_pred( psRangeEnc, psEnc->sStereo.ix[ i ] ); + silk_stereo_encode_pred( psRangeEnc, psEnc->sStereo.predIx[ i ] ); + /* For LBRR data there's no need to code the mid-only flag if the side-channel LBRR flag is set */ + if( psEnc->state_Fxx[ 1 ].sCmn.LBRR_flags[ i ] == 0 ) { + silk_stereo_encode_mid_only( psRangeEnc, psEnc->sStereo.mid_only_flags[ i ] ); + } } silk_encode_indices( &psEnc->state_Fxx[ n ].sCmn, psRangeEnc, i, 1 ); silk_encode_pulses( psRangeEnc, psEnc->state_Fxx[ n ].sCmn.indices_LBRR[i].signalType, psEnc->state_Fxx[ n ].sCmn.indices_LBRR[i].quantOffsetType, @@ -323,10 +327,13 @@ opus_int silk_Encode( /* Convert Left/Right to Mid/Side */ if( encControl->nChannelsInternal == 2 ) { silk_stereo_LR_to_MS( &psEnc->sStereo, psEnc->state_Fxx[ 0 ].sCmn.inputBuf, psEnc->state_Fxx[ 1 ].sCmn.inputBuf, - psEnc->sStereo.ix[ psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded ], MStargetRates_bps, TargetRate_bps, - psEnc->state_Fxx[ 0 ].sCmn.speech_activity_Q8, psEnc->state_Fxx[ 0 ].sCmn.fs_kHz, psEnc->state_Fxx[ 0 ].sCmn.frame_length ); - if (!prefillFlag) - silk_stereo_encode_pred( psRangeEnc, psEnc->sStereo.ix[ psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded ] ); + psEnc->sStereo.predIx[ psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded ], &psEnc->sStereo.mid_only_flags[ psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded ], + MStargetRates_bps, TargetRate_bps, psEnc->state_Fxx[ 0 ].sCmn.speech_activity_Q8, + psEnc->state_Fxx[ 0 ].sCmn.fs_kHz, psEnc->state_Fxx[ 0 ].sCmn.frame_length ); + if (!prefillFlag) { + silk_stereo_encode_pred( psRangeEnc, psEnc->sStereo.predIx[ psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded ] ); + silk_stereo_encode_mid_only( psRangeEnc, psEnc->sStereo.mid_only_flags[ psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded ] ); + } } else { /* Buffering */ SKP_memcpy( &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ -2 ], psEnc->sStereo.sMid, 2 * sizeof( opus_int16 ) ); diff --git a/silk/silk_main.h b/silk/silk_main.h index 92d07177b821d5492e778544010fbaf98892ec6b..9003821ec1d980a08635cd9b2a0cdc7f8efacff5 100644 --- a/silk/silk_main.h +++ b/silk/silk_main.h @@ -55,7 +55,8 @@ void silk_stereo_LR_to_MS( stereo_enc_state *state, /* I/O State */ opus_int16 x1[], /* I/O Left input signal, becomes mid signal */ opus_int16 x2[], /* I/O Right input signal, becomes side signal */ - opus_int8 ix[ 2 ][ 4 ], /* O Quantization indices */ + opus_int8 ix[ 2 ][ 3 ], /* O Quantization indices */ + opus_int8 *mid_only_flag, /* O Flag: only mid signal coded */ opus_int32 mid_side_rates_bps[], /* O Bitrates for mid and side signals */ opus_int32 total_rate_bps, /* I Total bitrate */ opus_int prev_speech_act_Q8, /* I Speech activity level in previous frame */ @@ -87,22 +88,33 @@ opus_int32 silk_stereo_find_predictor( /* O Returns predict void silk_stereo_quant_pred( stereo_enc_state *state, /* I/O State */ opus_int32 pred_Q13[], /* I/O Predictors (out: quantized) */ - opus_int8 ix[ 2 ][ 4 ] /* O Quantization indices */ + opus_int8 ix[ 2 ][ 3 ] /* O Quantization indices */ ); /* Entropy code the mid/side quantization indices */ void silk_stereo_encode_pred( ec_enc *psRangeEnc, /* I/O Compressor data structure */ - opus_int8 ix[ 2 ][ 4 ] /* I Quantization indices */ + opus_int8 ix[ 2 ][ 3 ] /* I Quantization indices */ +); + +/* Entropy code the mid-only flag */ +void silk_stereo_encode_mid_only( + ec_enc *psRangeEnc, /* I/O Compressor data structure */ + opus_int8 mid_only_flag ); /* Decode mid/side predictors */ void silk_stereo_decode_pred( ec_dec *psRangeDec, /* I/O Compressor data structure */ - opus_int *decode_only_mid, /* O Flag that only mid channel has been coded */ opus_int32 pred_Q13[] /* O Predictors */ ); +/* Decode mid-only flag */ +void silk_stereo_decode_mid_only( + ec_dec *psRangeDec, /* I/O Compressor data structure */ + opus_int *decode_only_mid /* O Flag that only mid channel has been coded */ +); + /* Encodes signs of excitation */ void silk_encode_signs( ec_enc *psRangeEnc, /* I/O Compressor data structure */ diff --git a/silk/silk_stereo_LR_to_MS.c b/silk/silk_stereo_LR_to_MS.c index 212beb135c0324c6b3af51454e27b45c20d8307f..6145b331e620eb446b6efcb99ed61fc46bd0cd68 100644 --- a/silk/silk_stereo_LR_to_MS.c +++ b/silk/silk_stereo_LR_to_MS.c @@ -36,7 +36,8 @@ void silk_stereo_LR_to_MS( stereo_enc_state *state, /* I/O State */ opus_int16 x1[], /* I/O Left input signal, becomes mid signal */ opus_int16 x2[], /* I/O Right input signal, becomes side signal */ - opus_int8 ix[ 2 ][ 4 ], /* O Quantization indices */ + opus_int8 ix[ 2 ][ 3 ], /* O Quantization indices */ + opus_int8 *mid_only_flag, /* O Flag: only mid signal coded */ opus_int32 mid_side_rates_bps[], /* O Bitrates for mid and side signals */ opus_int32 total_rate_bps, /* I Total bitrate */ opus_int prev_speech_act_Q8, /* I Speech activity level in previous frame */ @@ -120,7 +121,7 @@ void silk_stereo_LR_to_MS( pred_Q13[ 0 ] = SKP_RSHIFT( SKP_SMULBB( state->smth_width_Q14, pred_Q13[ 0 ] ), 14 ); pred_Q13[ 1 ] = SKP_RSHIFT( SKP_SMULBB( state->smth_width_Q14, pred_Q13[ 1 ] ), 14 ); - ix[ 0 ][ 3 ] = 0; + *mid_only_flag = 0; if( state->width_prev_Q14 == 0 && ( 8 * total_rate_bps < 13 * min_mid_rate_bps || SKP_SMULWB( frac_Q16, state->smth_width_Q14 ) < SILK_FIX_CONST( 0.05, 14 ) ) ) { @@ -128,7 +129,7 @@ void silk_stereo_LR_to_MS( /* Only encode mid channel */ mid_side_rates_bps[ 0 ] = total_rate_bps; mid_side_rates_bps[ 1 ] = 0; - ix[ 0 ][ 3 ] = 1; + *mid_only_flag = 1; } else if( state->width_prev_Q14 != 0 && ( 8 * total_rate_bps < 11 * min_mid_rate_bps || SKP_SMULWB( frac_Q16, state->smth_width_Q14 ) < SILK_FIX_CONST( 0.02, 14 ) ) ) { diff --git a/silk/silk_stereo_decode_pred.c b/silk/silk_stereo_decode_pred.c index 6b5fc8b78cb1af368eb0f5c92ffd14a88ec30a08..027a2368ede9af619ce9465611cc9e2b3841b599 100644 --- a/silk/silk_stereo_decode_pred.c +++ b/silk/silk_stereo_decode_pred.c @@ -34,7 +34,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Decode mid/side predictors */ void silk_stereo_decode_pred( ec_dec *psRangeDec, /* I/O Compressor data structure */ - opus_int *decode_only_mid, /* O Flag that only mid channel has been coded */ opus_int32 pred_Q13[] /* O Predictors */ ) { @@ -61,7 +60,14 @@ void silk_stereo_decode_pred( /* Subtract second from first predictor (helps when actually applying these) */ pred_Q13[ 0 ] -= pred_Q13[ 1 ]; +} +/* Decode mid-only flag */ +void silk_stereo_decode_mid_only( + ec_dec *psRangeDec, /* I/O Compressor data structure */ + opus_int *decode_only_mid /* O Flag that only mid channel has been coded */ +) +{ /* Decode flag that only mid channel is coded */ *decode_only_mid = ec_dec_icdf( psRangeDec, silk_stereo_only_code_mid_iCDF, 8 ); } diff --git a/silk/silk_stereo_encode_pred.c b/silk/silk_stereo_encode_pred.c index 51152573df451779e5a5dcfb7ab839bb1c947ffb..a2ee8f3bdda8e711fcc23fb651b8e7a7fdc06097 100644 --- a/silk/silk_stereo_encode_pred.c +++ b/silk/silk_stereo_encode_pred.c @@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Entropy code the mid/side quantization indices */ void silk_stereo_encode_pred( ec_enc *psRangeEnc, /* I/O Compressor data structure */ - opus_int8 ix[ 2 ][ 4 ] /* I Quantization indices */ + opus_int8 ix[ 2 ][ 3 ] /* I Quantization indices */ ) { opus_int n; @@ -49,7 +49,14 @@ void silk_stereo_encode_pred( ec_enc_icdf( psRangeEnc, ix[ n ][ 0 ], silk_uniform3_iCDF, 8 ); ec_enc_icdf( psRangeEnc, ix[ n ][ 1 ], silk_uniform5_iCDF, 8 ); } +} +/* Entropy code the mid-only flag */ +void silk_stereo_encode_mid_only( + ec_enc *psRangeEnc, /* I/O Compressor data structure */ + opus_int8 mid_only_flag +) +{ /* Encode flag that only mid channel is coded */ - ec_enc_icdf( psRangeEnc, ix[ 0 ][ 3 ], silk_stereo_only_code_mid_iCDF, 8 ); + ec_enc_icdf( psRangeEnc, mid_only_flag, silk_stereo_only_code_mid_iCDF, 8 ); } diff --git a/silk/silk_stereo_quant_pred.c b/silk/silk_stereo_quant_pred.c index c2e80c3784fd2af37a9819b3dca2facb6257b20e..9ff95500a9c8db80f7d9a990bb0f71b92cad16be 100644 --- a/silk/silk_stereo_quant_pred.c +++ b/silk/silk_stereo_quant_pred.c @@ -35,7 +35,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. void silk_stereo_quant_pred( stereo_enc_state *state, /* I/O State */ opus_int32 pred_Q13[], /* I/O Predictors (out: quantized) */ - opus_int8 ix[ 2 ][ 4 ] /* O Quantization indices */ + opus_int8 ix[ 2 ][ 3 ] /* O Quantization indices */ ) { opus_int i, j, n; diff --git a/silk/silk_structs.h b/silk/silk_structs.h index c8d8b8441222734b3ba36d75d8ff7b3882558d7a..341a2a96b1e3e099010fbf7c08bf7e940c8cd52c 100644 --- a/silk/silk_structs.h +++ b/silk/silk_structs.h @@ -101,7 +101,8 @@ typedef struct { opus_int32 mid_side_amp_Q0[ 4 ]; opus_int16 smth_width_Q14; opus_int16 width_prev_Q14; - opus_int8 ix[ MAX_FRAMES_PER_PACKET ][ 2 ][ 4 ]; + opus_int8 predIx[ MAX_FRAMES_PER_PACKET ][ 2 ][ 3 ]; + opus_int8 mid_only_flags[ MAX_FRAMES_PER_PACKET ]; } stereo_enc_state; typedef struct { diff --git a/src/opus.vcxproj b/src/opus.vcxproj index 5ae2988a0046832d28d892b8a30d8fa41c8ef72a..c89d59305b9e48ad9b37b2ca6d22ce39d5905fab 100644 --- a/src/opus.vcxproj +++ b/src/opus.vcxproj @@ -1,97 +1,98 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <Keyword>Win32Proj</Keyword> - <ProjectName>opus</ProjectName> - <ProjectGuid>{219EC965-228A-1824-174D-96449D05F88A}</ProjectGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <LinkIncremental>true</LinkIncremental> - <TargetName>$(ProjectName)_debug</TargetName> - <OutDir>$(SolutionDir)\bin\</OutDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>$(SolutionDir)\bin\</OutDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>../silk;../libcelt;../win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - <Optimization>Disabled</Optimization> - </ClCompile> - <Link> - <TargetMachine>MachineX86</TargetMachine> - <GenerateDebugInformation>true</GenerateDebugInformation> - <SubSystem>Console</SubSystem> - <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - <AdditionalDependencies>libcelt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>../silk;../libcelt;../win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> - </ClCompile> - <Link> - <TargetMachine>MachineX86</TargetMachine> - <GenerateDebugInformation>false</GenerateDebugInformation> - <SubSystem>Console</SubSystem> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <AdditionalDependencies>libcelt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - <LinkStatus>false</LinkStatus> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="opus_decoder.c" /> - <ClCompile Include="opus_encoder.c" /> - <ClCompile Include="test_opus.c" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="..\silk\silk_API.h" /> - <ClInclude Include="..\win32\config.h" /> - <ClInclude Include="opus.h" /> - <ClInclude Include="opus_decoder.h" /> - <ClInclude Include="opus_encoder.h" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <Keyword>Win32Proj</Keyword> + <ProjectName>opus</ProjectName> + <ProjectGuid>{219EC965-228A-1824-174D-96449D05F88A}</ProjectGuid> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + <TargetName>$(ProjectName)_debug</TargetName> + <OutDir>$(SolutionDir)\bin\</OutDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(SolutionDir)\bin\</OutDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>../silk;../libcelt;../win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <Optimization>Disabled</Optimization> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <AdditionalDependencies>libcelt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>../silk;../libcelt;../win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>libcelt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <LinkStatus>false</LinkStatus> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="opus.c" /> + <ClCompile Include="opus_decoder.c" /> + <ClCompile Include="opus_encoder.c" /> + <ClCompile Include="test_opus.c" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\silk\silk_API.h" /> + <ClInclude Include="..\win32\config.h" /> + <ClInclude Include="opus.h" /> + <ClInclude Include="opus_decoder.h" /> + <ClInclude Include="opus_encoder.h" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> </Project> \ No newline at end of file diff --git a/src/opus.vcxproj.filters b/src/opus.vcxproj.filters index 269fde85cbb267310d202fe9836ef207f19a2318..7085d0ce5a9af914b660fba8cacc8a738d5d6043 100644 --- a/src/opus.vcxproj.filters +++ b/src/opus.vcxproj.filters @@ -1,45 +1,48 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - <Filter Include="Resource Files"> - <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="opus_decoder.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="opus_encoder.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="test_opus.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="opus_decoder.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="opus_encoder.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="opus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\win32\config.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\silk\silk_API.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="opus_decoder.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="opus_encoder.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="test_opus.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="opus.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="opus_decoder.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="opus_encoder.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="opus.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\win32\config.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\silk\silk_API.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> </Project> \ No newline at end of file diff --git a/src/test_opus.c b/src/test_opus.c index d383c8164e97e25d314d9a6072b1ed6f8e452590..0413b566de494f6fb0a2bffbfb22ffbf3f907725 100644 --- a/src/test_opus.c +++ b/src/test_opus.c @@ -114,6 +114,8 @@ int main(int argc, char *argv[]) opus_uint32 enc_final_range[2]; opus_uint32 dec_final_range; int encode_only=0, decode_only=0; + int max_frame_size = 960*6; + int curr_read=0; if (argc < 7 ) { @@ -157,8 +159,8 @@ int main(int argc, char *argv[]) forcemono = 0; use_dtx = 0; packet_loss_perc = 0; - int max_frame_size = 960*6; - int curr_read=0; + max_frame_size = 960*6; + curr_read=0; args = 5; while( args < argc - 2 ) {