Commit c0c8853f authored by jm's avatar jm
Browse files

Patch by Jim Crichton updating TI DSP support for the library split.


git-svn-id: http://svn.xiph.org/trunk/speex@14280 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent eca7c8c8
...@@ -38,6 +38,13 @@ ...@@ -38,6 +38,13 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef OS_SUPPORT_CUSTOM
#include "os_support_custom.h"
#endif
/** 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 */ NOTE: speex_alloc needs to CLEAR THE MEMORY */
#ifndef OVERRIDE_SPEEX_ALLOC #ifndef OVERRIDE_SPEEX_ALLOC
......
/* Copyright (C) 2005 Psi Systems, Inc. /* Copyright (C) 2005 Psi Systems, Inc.
File: config.h File: config.h
Main Speex option include file for TI C64xx, C54xx and C55xx processors Main Speex option include file for TI C64xx, C54xx and C55xx processors
for use with TI Code Composer (TM) DSP development tools. for use with TI Code Composer (TM) DSP development tools.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions
are met: are met:
- Redistributions of source code must retain the above copyright - Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer. notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright - Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its - Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from contributors may be used to endorse or promote products derived from
this software without specific prior written permission. this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#define FIXED_POINT #define FIXED_POINT
#define FRAME_SIZE 160 #define FRAME_SIZE 160
#define DISABLE_WIDEBAND #define DISABLE_WIDEBAND
/* Disable DC block if doing SNR testing */
#define DISABLE_HIGHPASS
/* Allow for 2 20ms narrowband blocks per frame, plus a couple of bytes */ /* Allow for 2 20ms narrowband blocks per frame, plus a couple of bytes */
#define MAX_CHARS_PER_FRAME (42/BYTES_PER_CHAR) #define MAX_CHARS_PER_FRAME (42/BYTES_PER_CHAR)
/* for debug */ /* for debug */
#undef DECODE_ONLY #undef DECODE_ONLY
#define VERBOSE_ALLOC
/* EITHER Allocate from fixed array (C heap not used) */ /* EITHER Allocate from fixed array (C heap not used) */
/* Enable VERBOSE_ALLOC to see how much is used */ /* Enable VERBOSE_ALLOC to see how much is used */
#define MANUAL_ALLOC #define MANUAL_ALLOC
#define USER_MISC #define OS_SUPPORT_CUSTOM
#define VERBOSE_ALLOC
/* OR Use CALLOC (heap size must be increased in linker command file) */ /* OR Use CALLOC (heap size must be increased in linker command file) */
//#undef MANUAL_ALLOC //#undef MANUAL_ALLOC
//#undef USER_MISC //#undef OS_SUPPORT_CUSTOM
#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) #if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
//#define PRECISION16 //#define PRECISION16
// These values determined by analysis for 8kbps narrowband // These values determined by analysis for 8kbps narrowband
#define SPEEXENC_PERSIST_STACK_SIZE 5000 #define SPEEXENC_PERSIST_STACK_SIZE 1000
#define SPEEXENC_SCRATCH_STACK_SIZE 3000 #define SPEEXENC_SCRATCH_STACK_SIZE 3000
#define SPEEXDEC_PERSIST_STACK_SIZE 2500 #define SPEEXDEC_PERSIST_STACK_SIZE 1000
#define SPEEXDEC_SCRATCH_STACK_SIZE 1000 #define SPEEXDEC_SCRATCH_STACK_SIZE 1000
#else /* C6X */ #else /* C6X */
#define NO_LONGLONG #define NO_LONGLONG
#define SPEEXENC_PERSIST_STACK_SIZE 10000 #define SPEEXENC_PERSIST_STACK_SIZE 2000
#define SPEEXENC_SCRATCH_STACK_SIZE 6000 #define SPEEXENC_SCRATCH_STACK_SIZE 6000
#define SPEEXDEC_PERSIST_STACK_SIZE 5000 #define SPEEXDEC_PERSIST_STACK_SIZE 2000
#define SPEEXDEC_SCRATCH_STACK_SIZE 2000 #define SPEEXDEC_SCRATCH_STACK_SIZE 2000
#endif #endif
#define SPEEX_PERSIST_STACK_SIZE (SPEEXENC_PERSIST_STACK_SIZE + SPEEXDEC_PERSIST_STACK_SIZE) #define SPEEX_PERSIST_STACK_SIZE (SPEEXENC_PERSIST_STACK_SIZE + SPEEXDEC_PERSIST_STACK_SIZE)
......
; Code Composer Project File, Version 2.0 (do not modify or remove this line) ; Code Composer Project File, Version 2.0 (do not modify or remove this line)
[Project Settings] [Project Settings]
ProjectDir="C:\speex_11234\ti\speex_C54_test\" ProjectDir="C:\Speex\speex_14274\ti\speex_C54_test\"
ProjectType=Executable ProjectType=Executable
CPUFamily=TMS320C54XX CPUFamily=TMS320C54XX
Tool="Compiler" Tool="Compiler"
...@@ -27,8 +27,6 @@ Source="..\..\libspeex\lpc.c" ...@@ -27,8 +27,6 @@ Source="..\..\libspeex\lpc.c"
Source="..\..\libspeex\lsp.c" Source="..\..\libspeex\lsp.c"
Source="..\..\libspeex\lsp_tables_nb.c" Source="..\..\libspeex\lsp_tables_nb.c"
Source="..\..\libspeex\ltp.c" Source="..\..\libspeex\ltp.c"
Source="..\..\libspeex\math_approx.c"
Source="..\..\libspeex\misc.c"
Source="..\..\libspeex\modes.c" Source="..\..\libspeex\modes.c"
Source="..\..\libspeex\nb_celp.c" Source="..\..\libspeex\nb_celp.c"
Source="..\..\libspeex\quant_lsp.c" Source="..\..\libspeex\quant_lsp.c"
......
; Code Composer Project File, Version 2.0 (do not modify or remove this line) ; Code Composer Project File, Version 2.0 (do not modify or remove this line)
[Project Settings] [Project Settings]
ProjectDir="C:\speex_11234\ti\speex_C55_test\" ProjectDir="C:\Speex\speex_14274\ti\speex_C55_test\"
ProjectType=Executable ProjectType=Executable
CPUFamily=TMS320C55XX CPUFamily=TMS320C55XX
Tool="Compiler" Tool="Compiler"
...@@ -27,8 +27,6 @@ Source="..\..\libspeex\lpc.c" ...@@ -27,8 +27,6 @@ Source="..\..\libspeex\lpc.c"
Source="..\..\libspeex\lsp.c" Source="..\..\libspeex\lsp.c"
Source="..\..\libspeex\lsp_tables_nb.c" Source="..\..\libspeex\lsp_tables_nb.c"
Source="..\..\libspeex\ltp.c" Source="..\..\libspeex\ltp.c"
Source="..\..\libspeex\math_approx.c"
Source="..\..\libspeex\misc.c"
Source="..\..\libspeex\modes.c" Source="..\..\libspeex\modes.c"
Source="..\..\libspeex\nb_celp.c" Source="..\..\libspeex\nb_celp.c"
Source="..\..\libspeex\quant_lsp.c" Source="..\..\libspeex\quant_lsp.c"
......
; Code Composer Project File, Version 2.0 (do not modify or remove this line) ; Code Composer Project File, Version 2.0 (do not modify or remove this line)
[Project Settings] [Project Settings]
ProjectDir="C:\speex_11234\ti\speex_C64_test\" ProjectDir="C:\Speex\speex_14274\ti\speex_C64_test\"
ProjectType=Executable ProjectType=Executable
CPUFamily=TMS320C64XX CPUFamily=TMS320C64XX
Tool="Compiler" Tool="Compiler"
...@@ -12,7 +12,7 @@ Config="Debug" ...@@ -12,7 +12,7 @@ Config="Debug"
Config="Release" Config="Release"
[Source Files] [Source Files]
Source="..\..\..\CCStudio_v3.1\C6000\cgtools\lib\rts6400.lib" Source="..\..\..\..\CCStudio_v3.1\C6000\cgtools\lib\rts6400.lib"
Source="..\..\libspeex\bits.c" Source="..\..\libspeex\bits.c"
Source="..\..\libspeex\cb_search.c" Source="..\..\libspeex\cb_search.c"
Source="..\..\libspeex\exc_10_16_table.c" Source="..\..\libspeex\exc_10_16_table.c"
...@@ -28,8 +28,6 @@ Source="..\..\libspeex\lpc.c" ...@@ -28,8 +28,6 @@ Source="..\..\libspeex\lpc.c"
Source="..\..\libspeex\lsp.c" Source="..\..\libspeex\lsp.c"
Source="..\..\libspeex\lsp_tables_nb.c" Source="..\..\libspeex\lsp_tables_nb.c"
Source="..\..\libspeex\ltp.c" Source="..\..\libspeex\ltp.c"
Source="..\..\libspeex\math_approx.c"
Source="..\..\libspeex\misc.c"
Source="..\..\libspeex\modes.c" Source="..\..\libspeex\modes.c"
Source="..\..\libspeex\nb_celp.c" Source="..\..\libspeex\nb_celp.c"
Source="..\..\libspeex\quant_lsp.c" Source="..\..\libspeex\quant_lsp.c"
......
...@@ -184,10 +184,17 @@ void main() ...@@ -184,10 +184,17 @@ void main()
tmp=1; /* Lowest */ tmp=1; /* Lowest */
speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp); speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay); #ifdef DISABLE_HIGHPASS
speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp); /* Turn this off if you want to measure SNR (on by default) */
skip_group_delay += tmp; tmp=0;
fprintf (stderr, "decoder lookahead = %d\n", skip_group_delay); speex_encoder_ctl(st, SPEEX_SET_HIGHPASS, &tmp);
speex_decoder_ctl(dec, SPEEX_SET_HIGHPASS, &tmp);
#endif
speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay);
speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp);
skip_group_delay += tmp;
fprintf (stderr, "decoder lookahead = %ld\n", skip_group_delay);
#ifdef DECODE_ONLY #ifdef DECODE_ONLY
bitsFile = "c:\\speextrunktest\\samples\\malebitsin.dat"; bitsFile = "c:\\speextrunktest\\samples\\malebitsin.dat";
......
/* Copyright (C) 2005 Psi Systems, Inc. /* Copyright (C) 2005 Psi Systems, Inc.
Author: Jean-Marc Valin Author: Jean-Marc Valin
File: testenc-TI-C64x.c File: testenc-TI-C64x.c
Encoder/Decoder Loop Main file for TI TMS320C64xx processor Encoder/Decoder Loop Main file for TI TMS320C64xx processor
for use with TI Code Composer (TM) DSP development tools. for use with TI Code Composer (TM) DSP development tools.
Modified from speexlib/testenc.c Modified from speexlib/testenc.c
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions
are met: are met:
- Redistributions of source code must retain the above copyright - Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer. notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright - Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its - Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from contributors may be used to endorse or promote products derived from
this software without specific prior written permission. this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
...@@ -146,9 +146,16 @@ void main() ...@@ -146,9 +146,16 @@ void main()
tmp=1; /* Lowest */ tmp=1; /* Lowest */
speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp); speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &tmp);
speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay); #ifdef DISABLE_HIGHPASS
speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp); /* Turn this off if you want to measure SNR (on by default) */
skip_group_delay += tmp; tmp=0;
speex_encoder_ctl(st, SPEEX_SET_HIGHPASS, &tmp);
speex_decoder_ctl(dec, SPEEX_SET_HIGHPASS, &tmp);
#endif
speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &skip_group_delay);
speex_decoder_ctl(dec, SPEEX_GET_LOOKAHEAD, &tmp);
skip_group_delay += tmp;
fprintf (stderr, "decoder lookahead = %d\n", skip_group_delay); fprintf (stderr, "decoder lookahead = %d\n", skip_group_delay);
#ifdef DECODE_ONLY #ifdef DECODE_ONLY
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment