[xiph-commits] r14110 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Thu Nov 8 00:51:08 PST 2007


Author: jm
Date: 2007-11-08 00:51:07 -0800 (Thu, 08 Nov 2007)
New Revision: 14110

Modified:
   trunk/speex/libspeex/nb_celp.c
   trunk/speex/libspeex/os_support.h
Log:
minor cleanup/comments


Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c	2007-11-08 07:44:39 UTC (rev 14109)
+++ trunk/speex/libspeex/nb_celp.c	2007-11-08 08:51:07 UTC (rev 14110)
@@ -1563,11 +1563,9 @@
             /*Fixed codebook contribution*/
             SUBMODE(innovation_unquant)(innov, SUBMODE(innovation_params), st->subframeSize, bits, stack, &st->seed);
             /* De-normalize innovation and update excitation */
-#ifdef FIXED_POINT
+
             signal_mul(innov, innov, ener, st->subframeSize);
-#else
-            signal_mul(innov, innov, ener, st->subframeSize);
-#endif
+
             /* Decode second codebook (only for some modes) */
             if (SUBMODE(double_codebook))
             {

Modified: trunk/speex/libspeex/os_support.h
===================================================================
--- trunk/speex/libspeex/os_support.h	2007-11-08 07:44:39 UTC (rev 14109)
+++ trunk/speex/libspeex/os_support.h	2007-11-08 08:51:07 UTC (rev 14110)
@@ -38,10 +38,14 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free */
+/** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free 
+    NOTE: speex_alloc needs to CLEAR THE MEMORY */
 #ifndef OVERRIDE_SPEEX_ALLOC
 static inline void *speex_alloc (int size)
 {
+   /* WARNING: this is not equivalent to malloc(). If you want to use malloc() 
+      or your own allocator, YOU NEED TO CLEAR THE MEMORY ALLOCATED. Otherwise
+      you will experience strange bugs */
    return calloc(size,1);
 }
 #endif
@@ -50,6 +54,7 @@
 #ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH
 static inline void *speex_alloc_scratch (int size)
 {
+   /* Scratch space doesn't need to be cleared */
    return calloc(size,1);
 }
 #endif



More information about the commits mailing list