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

jm at svn.xiph.org jm at svn.xiph.org
Sun Oct 23 03:39:31 PDT 2005


Author: jm
Date: 2005-10-23 03:39:27 -0700 (Sun, 23 Oct 2005)
New Revision: 10264

Modified:
   trunk/speex/libspeex/arch.h
   trunk/speex/libspeex/bits.c
   trunk/speex/libspeex/misc.c
Log:
misc.c overriding patch (mainly for TI C5X and C6X) from Jim Crichton


Modified: trunk/speex/libspeex/arch.h
===================================================================
--- trunk/speex/libspeex/arch.h	2005-10-23 10:14:46 UTC (rev 10263)
+++ trunk/speex/libspeex/arch.h	2005-10-23 10:39:27 UTC (rev 10264)
@@ -48,6 +48,8 @@
 typedef spx_int32_t   spx_word32_t;
 #ifdef _MSC_VER
 typedef __int64      spx_word64_t;
+#elif defined NO_LONGLONG
+typedef double    spx_word64_t;
 #else
 typedef long long    spx_word64_t;
 #endif

Modified: trunk/speex/libspeex/bits.c
===================================================================
--- trunk/speex/libspeex/bits.c	2005-10-23 10:14:46 UTC (rev 10263)
+++ trunk/speex/libspeex/bits.c	2005-10-23 10:39:27 UTC (rev 10264)
@@ -39,16 +39,18 @@
 #include <speex/speex_bits.h>
 #include "misc.h"
 
-/** Maximum size of the bit-stream (for fixed-size allocation) */
-#define MAX_BYTES_PER_FRAME (2000/BYTES_PER_CHAR)
+/* Maximum size of the bit-stream (for fixed-size allocation) */
+#ifndef MAX_CHARS_PER_FRAME
+#define MAX_CHARS_PER_FRAME (2000/BYTES_PER_CHAR)
+#endif
 
 void speex_bits_init(SpeexBits *bits)
 {
-   bits->chars = (char*)speex_alloc(MAX_BYTES_PER_FRAME);
+   bits->chars = (char*)speex_alloc(MAX_CHARS_PER_FRAME);
    if (!bits->chars)
       return;
 
-   bits->buf_size = MAX_BYTES_PER_FRAME;
+   bits->buf_size = MAX_CHARS_PER_FRAME;
 
    bits->owner=1;
 

Modified: trunk/speex/libspeex/misc.c
===================================================================
--- trunk/speex/libspeex/misc.c	2005-10-23 10:14:46 UTC (rev 10263)
+++ trunk/speex/libspeex/misc.c	2005-10-23 10:39:27 UTC (rev 10264)
@@ -39,6 +39,10 @@
 #include <stdio.h>
 #include "misc.h"
 
+#ifdef USER_MISC
+#include "user_misc.h"
+#endif
+
 #ifdef BFIN_ASM
 #include "misc_bfin.h"
 #endif
@@ -127,28 +131,40 @@
 }
 #endif
 
+#ifndef OVERRIDE_SPEEX_ALLOC
 void *speex_alloc (int size)
 {
    return calloc(size,1);
 }
+#endif
+
+#ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH
 void *speex_alloc_scratch (int size)
 {
    return calloc(size,1);
 }
+#endif
 
+#ifndef OVERRIDE_SPEEX_REALLOC
 void *speex_realloc (void *ptr, int size)
 {
    return realloc(ptr, size);
 }
+#endif
 
+#ifndef OVERRIDE_SPEEX_FREE
 void speex_free (void *ptr)
 {
    free(ptr);
 }
+#endif
+
+#ifndef OVERRIDE_SPEEX_FREE_SCRATCH
 void speex_free_scratch (void *ptr)
 {
    free(ptr);
 }
+#endif
 
 #ifndef OVERRIDE_SPEEX_MOVE
 void *speex_move (void *dest, void *src, int n)
@@ -157,21 +173,27 @@
 }
 #endif
 
+#ifndef OVERRIDE_SPEEX_ERROR
 void speex_error(const char *str)
 {
    fprintf (stderr, "Fatal error: %s\n", str);
    exit(1);
 }
+#endif
 
+#ifndef OVERRIDE_SPEEX_WARNING
 void speex_warning(const char *str)
 {
    fprintf (stderr, "warning: %s\n", str);
 }
+#endif
 
+#ifndef OVERRIDE_SPEEX_WARNING_INT
 void speex_warning_int(const char *str, int val)
 {
    fprintf (stderr, "warning: %s %d\n", str, val);
 }
+#endif
 
 #ifdef FIXED_POINT
 spx_word32_t speex_rand(spx_word16_t std, spx_int32_t *seed)
@@ -207,8 +229,10 @@
    return 3*std*((((float)rand())/RAND_MAX)-.5);
 }*/
 
+#ifndef OVERRIDE_SPEEX_PUTC
 void _speex_putc(int ch, void *file)
 {
    FILE *f = (FILE *)file;
    fprintf(f, "%c", ch);
 }
+#endif



More information about the commits mailing list