[opus] [PATCH] Remove SILK_DEBUG

Ralph Giles giles at thaumas.net
Tue Nov 8 04:37:22 UTC 2016


This set of patches removes the SILK_DEBUG define on Win32, fixing link
errors on opus_demo against the DLL targets. Please review.

Green on https://ci.appveyor.com/project/rillian/opus-aqrth/build/1.0.4

Thanks to Ricardo Constantino for help with the patches.

 -r

-------------- next part --------------
From b78152af4d7b3cd50e710033196cc3dce9bbd4df Mon Sep 17 00:00:00 2001
From: Ralph Giles <giles at thaumas.net>
Date: Thu, 3 Nov 2016 15:25:33 -0700
Subject: [PATCH 1/3] Remove commented-out DEBUG_STORE_DATA calls.

Also remove the SILK_DEBUG_STORE_CLOSE_FILES flush call from
opus_demo.

This is debugging code which is no longer used, but defining
the symbols for SILK_DEBUG_STORE_CLOSE_FILES and calling it
from opus_demo causes linking problems on Microsoft Visual Studio
where we have strict controls on public symbols and want to
test the compiled DLL.

Since the code isn't in active use, it's better to remove it
to avoid clutter and address the linking issue.
---
 silk/NSQ.c                 | 1 -
 silk/NSQ_del_dec.c         | 1 -
 silk/decode_core.c         | 2 --
 silk/x86/NSQ_del_dec_sse.c | 1 -
 silk/x86/NSQ_sse.c         | 1 -
 src/opus_demo.c            | 2 --
 6 files changed, 8 deletions(-)

diff --git a/silk/NSQ.c b/silk/NSQ.c
index 0e2ea50..da0217f 100644
--- a/silk/NSQ.c
+++ b/silk/NSQ.c
@@ -168,7 +168,6 @@ void silk_NSQ_c
     NSQ->lagPrev = pitchL[ psEncC->nb_subfr - 1 ];
 
     /* Save quantized speech and noise shaping signals */
-    /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[ psEncC->ltp_mem_length ], psEncC->frame_length * sizeof( opus_int16 ) ) */
     silk_memmove( NSQ->xq,           &NSQ->xq[           psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) );
     silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) );
     RESTORE_STACK;
diff --git a/silk/NSQ_del_dec.c b/silk/NSQ_del_dec.c
index 3495613..b67ac51 100644
--- a/silk/NSQ_del_dec.c
+++ b/silk/NSQ_del_dec.c
@@ -306,7 +306,6 @@ void silk_NSQ_del_dec_c(
     NSQ->lagPrev        = pitchL[ psEncC->nb_subfr - 1 ];
 
     /* Save quantized speech signal */
-    /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[psEncC->ltp_mem_length], psEncC->frame_length * sizeof( opus_int16 ) ) */
     silk_memmove( NSQ->xq,           &NSQ->xq[           psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) );
     silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) );
     RESTORE_STACK;
diff --git a/silk/decode_core.c b/silk/decode_core.c
index e569c0e..fd4e857 100644
--- a/silk/decode_core.c
+++ b/silk/decode_core.c
@@ -225,8 +225,6 @@ void silk_decode_core(
             pxq[ i ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( sLPC_Q14[ MAX_LPC_ORDER + i ], Gain_Q10 ), 8 ) );
         }
 
-        /* DEBUG_STORE_DATA( dec.pcm, pxq, psDec->subfr_length * sizeof( opus_int16 ) ) */
-
         /* Update LPC filter state */
         silk_memcpy( sLPC_Q14, &sLPC_Q14[ psDec->subfr_length ], MAX_LPC_ORDER * sizeof( opus_int32 ) );
         pexc_Q14 += psDec->subfr_length;
diff --git a/silk/x86/NSQ_del_dec_sse.c b/silk/x86/NSQ_del_dec_sse.c
index a6f84e1..1dc8485 100644
--- a/silk/x86/NSQ_del_dec_sse.c
+++ b/silk/x86/NSQ_del_dec_sse.c
@@ -301,7 +301,6 @@ void silk_NSQ_del_dec_sse4_1(
     NSQ->lagPrev        = pitchL[ psEncC->nb_subfr - 1 ];
 
     /* Save quantized speech signal */
-    /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[psEncC->ltp_mem_length], psEncC->frame_length * sizeof( opus_int16 ) ) */
     silk_memmove( NSQ->xq,           &NSQ->xq[           psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) );
     silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) );
     RESTORE_STACK;
diff --git a/silk/x86/NSQ_sse.c b/silk/x86/NSQ_sse.c
index bb3c5f1..48b9959 100644
--- a/silk/x86/NSQ_sse.c
+++ b/silk/x86/NSQ_sse.c
@@ -233,7 +233,6 @@ void silk_NSQ_sse4_1(
     NSQ->lagPrev = pitchL[ psEncC->nb_subfr - 1 ];
 
     /* Save quantized speech and noise shaping signals */
-    /* DEBUG_STORE_DATA( enc.pcm, &NSQ->xq[ psEncC->ltp_mem_length ], psEncC->frame_length * sizeof( opus_int16 ) ) */
     silk_memmove( NSQ->xq,           &NSQ->xq[           psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int16 ) );
     silk_memmove( NSQ->sLTP_shp_Q14, &NSQ->sLTP_shp_Q14[ psEncC->frame_length ], psEncC->ltp_mem_length * sizeof( opus_int32 ) );
     RESTORE_STACK;
diff --git a/src/opus_demo.c b/src/opus_demo.c
index df9e70d..bdb66bd 100644
--- a/src/opus_demo.c
+++ b/src/opus_demo.c
@@ -876,8 +876,6 @@ int main(int argc, char *argv[])
                1e-3*bits_act*sampling_rate/(1e-15+frame_size*(double)count_act));
     fprintf (stderr, "bitrate standard deviation:  %7.3f kb/s\n",
             1e-3*sqrt(bits2/count - bits*bits/(count*(double)count))*sampling_rate/frame_size);
-    /* Close any files to which intermediate results were stored */
-    SILK_DEBUG_STORE_CLOSE_FILES
     silk_TimerSave("opus_timing.txt");
     opus_encoder_destroy(enc);
     opus_decoder_destroy(dec);
-- 
2.10.2

-------------- next part --------------
From 18c93c81d9264036503137715473840b3c46677c Mon Sep 17 00:00:00 2001
From: Ralph Giles <giles at thaumas.net>
Date: Thu, 3 Nov 2016 15:40:43 -0700
Subject: [PATCH 2/3] Remove SILK_DEBUG define when _WIN32 and _DEBUG are
 defined.

This was just enabling commented-out code, setting a fixed
default removes dead code.
---
 silk/debug.h | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/silk/debug.h b/silk/debug.h
index efb6d3e..6f68c1c 100644
--- a/silk/debug.h
+++ b/silk/debug.h
@@ -39,23 +39,10 @@ extern "C"
 
 unsigned long GetHighResolutionTime(void); /* O  time in usec*/
 
-/* make SILK_DEBUG dependent on compiler's _DEBUG */
-#if defined _WIN32
-    #ifdef _DEBUG
-        #define SILK_DEBUG  1
-    #else
-        #define SILK_DEBUG  0
-    #endif
-
-    /* overrule the above */
-    #if 0
-    /*  #define NO_ASSERTS*/
-    #undef  SILK_DEBUG
-    #define SILK_DEBUG  1
-    #endif
-#else
-    #define SILK_DEBUG  0
-#endif
+/* Set to 1 to enable DEBUG_STORE_DATA() macros for dumping
+ * intermediate signals from the codec.
+ */
+#define SILK_DEBUG 0
 
 /* Flag for using timers */
 #define SILK_TIC_TOC    0
-- 
2.10.2

-------------- next part --------------
From 8e2d9b863449f748831f6c74ab5c7e47538cfc58 Mon Sep 17 00:00:00 2001
From: Ricardo Constantino <wiiaboo at gmail.com>
Date: Thu, 3 Nov 2016 22:26:56 +0000
Subject: [PATCH 3/3] vs2015: reenable DebugDLL versions of opus_demo

Signed-off-by: Ralph Giles <giles at thaumas.net>
---
 win32/VS2015/opus.sln | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/win32/VS2015/opus.sln b/win32/VS2015/opus.sln
index 017341c..7b678e7 100644
--- a/win32/VS2015/opus.sln
+++ b/win32/VS2015/opus.sln
@@ -70,9 +70,13 @@ Global
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.Debug|x64.ActiveCfg = Debug|x64
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.Debug|x64.Build.0 = Debug|x64
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.DebugDLL_fixed|Win32.ActiveCfg = DebugDLL_fixed|Win32
+		{016C739D-6389-43BF-8D88-24B2BF6F620F}.DebugDLL_fixed|Win32.Build.0 = DebugDLL_fixed|Win32
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.DebugDLL_fixed|x64.ActiveCfg = DebugDLL_fixed|x64
+		{016C739D-6389-43BF-8D88-24B2BF6F620F}.DebugDLL_fixed|x64.Build.0 = DebugDLL_fixed|x64
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
+		{016C739D-6389-43BF-8D88-24B2BF6F620F}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
+		{016C739D-6389-43BF-8D88-24B2BF6F620F}.DebugDLL|x64.Build.0 = DebugDLL|x64
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.Release|Win32.ActiveCfg = Release|Win32
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.Release|Win32.Build.0 = Release|Win32
 		{016C739D-6389-43BF-8D88-24B2BF6F620F}.Release|x64.ActiveCfg = Release|x64
-- 
2.10.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.xiph.org/pipermail/opus/attachments/20161107/c2e9acd5/attachment.sig>


More information about the opus mailing list