shithub: opus

Download patch

ref: 3b60e81d794733e7af54ea1557f0879ec50286bd
parent: 027ec51bfef87d7e9f2c48091a66a75bcf524152
author: Joshua Bowman <[email protected]>
date: Tue Oct 23 08:18:38 EDT 2012

Fix the MSVC build.

Updates the project files to include the new encoder source files.
Use OPUS_RESTRICT and include config.h to set the proper defines
for build under MSVC.

--- a/src/analysis.c
+++ b/src/analysis.c
@@ -142,9 +142,9 @@
     const kiss_fft_state *kfft;
     kiss_fft_cpx in[480], out[480];
     int N = 480, N2=240;
-    float * restrict A = tonal->angle;
-    float * restrict dA = tonal->d_angle;
-    float * restrict d2A = tonal->d2_angle;
+    float * OPUS_RESTRICT A = tonal->angle;
+    float * OPUS_RESTRICT dA = tonal->d_angle;
+    float * OPUS_RESTRICT d2A = tonal->d2_angle;
     float tonality[240];
     float noisiness[240];
     float band_tonality[NB_TBANDS];
--- a/src/mlp.c
+++ b/src/mlp.c
@@ -25,6 +25,9 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <math.h>
 #include "mlp.h"
--- a/src/opus.vcxproj
+++ b/src/opus.vcxproj
@@ -191,6 +191,9 @@
     </CustomBuildStep>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="analysis.c" />
+    <ClCompile Include="mlp.c" />
+    <ClCompile Include="mlp_data.c" />
     <ClCompile Include="opus.c" />
     <ClCompile Include="opus_decoder.c" />
     <ClCompile Include="opus_encoder.c" />
@@ -210,9 +213,11 @@
     <ClInclude Include="..\include\opus_types.h" />
     <ClInclude Include="..\include\opus_multistream.h" />
     <ClInclude Include="..\win32\config.h" />
+    <ClInclude Include="analysis.h" />
+    <ClInclude Include="mlp.h" />
     <ClInclude Include="opus_private.h" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
--- a/src/opus.vcxproj.filters
+++ b/src/opus.vcxproj.filters
@@ -30,6 +30,15 @@
     <ClCompile Include="opus_multistream.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="analysis.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mlp.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="mlp_data.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\win32\config.h">
@@ -69,6 +78,12 @@
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\include\opus_multistream.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="analysis.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="mlp.h">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>