Addresses a bitstream bug for stereo FEC and minor fixes that make Opus compile again...
authorKoen Vos <koen.vos@skype.net>
Thu, 25 Aug 2011 17:50:21 +0000 (13:50 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 26 Aug 2011 13:42:18 +0000 (09:42 -0400)
silk/silk_dec_API.c
silk/silk_enc_API.c
silk/silk_main.h
silk/silk_stereo_LR_to_MS.c
silk/silk_stereo_decode_pred.c
silk/silk_stereo_encode_pred.c
silk/silk_stereo_quant_pred.c
silk/silk_structs.h
src/opus.vcxproj
src/opus.vcxproj.filters
src/test_opus.c

index 5d9502a..8b75307 100644 (file)
@@ -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 ) {
                     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,
                         }
                         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 ) )
         {
         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];
         } else {
             for( n = 0; n < 2; n++ ) {
                 MS_pred_Q13[n] = psDec->sStereo.pred_prev_Q13[n];
index 91e08ba..383ea7f 100644 (file)
@@ -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 ) {
                     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,
                             }
                             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,
             /* 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 ) );
             } else {
                 /* Buffering */
                 SKP_memcpy( &psEnc->state_Fxx[ 0 ].sCmn.inputBuf[ -2 ], psEnc->sStereo.sMid, 2 * sizeof( opus_int16 ) );
index 92d0717..9003821 100644 (file)
@@ -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     */
     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     */
     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)                 */
 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                   */
 );
 
 /* 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                   */
 );
 
 /* 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                                  */
 );
 
     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                   */
 /* Encodes signs of excitation */
 void silk_encode_signs(
     ec_enc                      *psRangeEnc,                        /* I/O  Compressor data structure                   */
index 212beb1..6145b33 100644 (file)
@@ -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     */
     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     */
     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 );
 
     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 ) ) )
     {
     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;
         /* 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 ) ) )
     {
     } 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 ) ) )
     {
index 6b5fc8b..027a236 100644 (file)
@@ -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                   */
 /* 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                                  */
 )
 {
     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 ];
 
     /* 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 );
 }
     /* Decode flag that only mid channel is coded */
     *decode_only_mid = ec_dec_icdf( psRangeDec, silk_stereo_only_code_mid_iCDF, 8 );
 }
index 5115257..a2ee8f3 100644 (file)
@@ -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                   */
 /* 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;
 )
 {
     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 );
     }
         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 */
     /* 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 );
 }
 }
index c2e80c3..9ff9550 100644 (file)
@@ -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)                 */
 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;
 )
 {
     opus_int   i, j, n;
index c8d8b84..341a2a9 100644 (file)
@@ -101,7 +101,8 @@ typedef struct {
     opus_int32                   mid_side_amp_Q0[ 4 ];
     opus_int16                   smth_width_Q14;
     opus_int16                   width_prev_Q14;
     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 {
 } stereo_enc_state;
 
 typedef struct {
index 5ae2988..c89d593 100644 (file)
@@ -1,97 +1,98 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <ItemGroup Label="ProjectConfigurations">\r
-    <ProjectConfiguration Include="Debug|Win32">\r
-      <Configuration>Debug</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Release|Win32">\r
-      <Configuration>Release</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-  </ItemGroup>\r
-  <PropertyGroup Label="Globals">\r
-    <Keyword>Win32Proj</Keyword>\r
-    <ProjectName>opus</ProjectName>\r
-    <ProjectGuid>{219EC965-228A-1824-174D-96449D05F88A}</ProjectGuid>\r
-  </PropertyGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
-    <ConfigurationType>Application</ConfigurationType>\r
-    <UseDebugLibraries>true</UseDebugLibraries>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
-    <ConfigurationType>Application</ConfigurationType>\r
-    <UseDebugLibraries>false</UseDebugLibraries>\r
-  </PropertyGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
-  <ImportGroup Label="ExtensionSettings">\r
-  </ImportGroup>\r
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
-  </ImportGroup>\r
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
-  </ImportGroup>\r
-  <PropertyGroup Label="UserMacros" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <LinkIncremental>true</LinkIncremental>\r
-    <TargetName>$(ProjectName)_debug</TargetName>\r
-    <OutDir>$(SolutionDir)\bin\</OutDir>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <LinkIncremental>false</LinkIncremental>\r
-    <OutDir>$(SolutionDir)\bin\</OutDir>\r
-  </PropertyGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <ClCompile>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../silk;../libcelt;../win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
-      <WarningLevel>Level3</WarningLevel>\r
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-      <Optimization>Disabled</Optimization>\r
-    </ClCompile>\r
-    <Link>\r
-      <TargetMachine>MachineX86</TargetMachine>\r
-      <GenerateDebugInformation>true</GenerateDebugInformation>\r
-      <SubSystem>Console</SubSystem>\r
-      <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
-      <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>\r
-    </Link>\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <ClCompile>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../silk;../libcelt;../win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
-      <WarningLevel>Level3</WarningLevel>\r
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
-    </ClCompile>\r
-    <Link>\r
-      <TargetMachine>MachineX86</TargetMachine>\r
-      <GenerateDebugInformation>false</GenerateDebugInformation>\r
-      <SubSystem>Console</SubSystem>\r
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
-      <OptimizeReferences>true</OptimizeReferences>\r
-      <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>\r
-      <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
-      <LinkStatus>false</LinkStatus>\r
-    </Link>\r
-  </ItemDefinitionGroup>\r
-  <ItemGroup>\r
-    <ClCompile Include="opus_decoder.c" />\r
-    <ClCompile Include="opus_encoder.c" />\r
-    <ClCompile Include="test_opus.c" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ClInclude Include="..\silk\silk_API.h" />\r
-    <ClInclude Include="..\win32\config.h" />\r
-    <ClInclude Include="opus.h" />\r
-    <ClInclude Include="opus_decoder.h" />\r
-    <ClInclude Include="opus_encoder.h" />\r
-  </ItemGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
-  <ImportGroup Label="ExtensionTargets">\r
-  </ImportGroup>\r
+<?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
 </Project>
\ No newline at end of file
index 269fde8..7085d0c 100644 (file)
@@ -1,45 +1,48 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <ItemGroup>\r
-    <Filter Include="Source Files">\r
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
-    </Filter>\r
-    <Filter Include="Header Files">\r
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
-    </Filter>\r
-    <Filter Include="Resource Files">\r
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>\r
-    </Filter>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ClCompile Include="opus_decoder.c">\r
-      <Filter>Source Files</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="opus_encoder.c">\r
-      <Filter>Source Files</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="test_opus.c">\r
-      <Filter>Source Files</Filter>\r
-    </ClCompile>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ClInclude Include="opus_decoder.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="opus_encoder.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="opus.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="..\win32\config.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="..\silk\silk_API.h">\r
-      <Filter>Header Files</Filter>\r
-    </ClInclude>\r
-  </ItemGroup>\r
+<?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
 </Project>
\ No newline at end of file
index d383c81..0413b56 100644 (file)
@@ -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;
     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 )
     {
 
     if (argc < 7 )
     {
@@ -157,8 +159,8 @@ int main(int argc, char *argv[])
     forcemono = 0;
     use_dtx = 0;
     packet_loss_perc = 0;
     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 ) {
 
     args = 5;
     while( args < argc - 2 ) {