summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-04-20 18:38:15 +0000
committerBenny Prijono <bennylp@teluu.com>2009-04-20 18:38:15 +0000
commite9770fb6f2b66e939984b8887137d28b24b25799 (patch)
tree9a77ad27a2dbfe8c6a2f7405ab16bcda3f3d05d9 /third_party
parentf8ca7b03d701cd46ead9a61ee18c17d232a616a1 (diff)
More ticket #774: replaced dependency to STL
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2623 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/build/g7221/Makefile2
-rw-r--r--third_party/build/g7221/libg7221codec.dsp25
-rw-r--r--third_party/build/g7221/libg7221codec.vcproj96
-rw-r--r--third_party/g7221/common/basic_op.c (renamed from third_party/g7221/common/stl-files/basop32.c)57
-rw-r--r--third_party/g7221/common/basic_op.h (renamed from third_party/g7221/common/stl-files/basop32.h)31
-rw-r--r--third_party/g7221/common/basic_op_i.h (renamed from third_party/g7221/common/stl-files/basop32_i.h)4
-rw-r--r--third_party/g7221/common/count.h (renamed from third_party/g7221/common/stl-files/count.h)2
-rw-r--r--third_party/g7221/common/defs.h4
-rw-r--r--third_party/g7221/common/stl-files/typedef.h74
-rw-r--r--third_party/g7221/common/typedef.h32
-rw-r--r--third_party/g7221/decode/decoder.c3
-rw-r--r--third_party/g7221/encode/encoder.c4
12 files changed, 77 insertions, 257 deletions
diff --git a/third_party/build/g7221/Makefile b/third_party/build/g7221/Makefile
index 12529699..60590307 100644
--- a/third_party/build/g7221/Makefile
+++ b/third_party/build/g7221/Makefile
@@ -21,7 +21,7 @@ export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
export G7221_CODEC_SRCDIR = ../../g7221
export G7221_CODEC_OBJS = common/common.o common/huff_tab.o common/tables.o \
- common/stl-files/basop32.o \
+ common/basic_op.o \
decode/coef2sam.o decode/dct4_s.o decode/decoder.o \
encode/dct4_a.o encode/sam2coef.o encode/encoder.o
diff --git a/third_party/build/g7221/libg7221codec.dsp b/third_party/build/g7221/libg7221codec.dsp
index 3567a07d..82cc644a 100644
--- a/third_party/build/g7221/libg7221codec.dsp
+++ b/third_party/build/g7221/libg7221codec.dsp
@@ -43,7 +43,6 @@ RSC=rc.exe
F90=df.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../.." /I "../../g7221/common" /I "../../g7221/common/stl-files" /I "../../../pjlib/include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /c
-# SUBTRACT CPP /Z<none>
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -89,33 +88,29 @@ LIB32=link.exe -lib
# Begin Group "common"
# PROP Default_Filter ""
-# Begin Group "stl-files"
-
-# PROP Default_Filter ""
# Begin Source File
-SOURCE="..\..\g7221\common\stl-files\basop32.c"
+SOURCE=..\..\g7221\common\basic_op.c
# End Source File
# Begin Source File
-SOURCE="..\..\g7221\common\stl-files\basop32.h"
+SOURCE=..\..\g7221\common\basic_op.h
# End Source File
# Begin Source File
-SOURCE="..\..\g7221\common\stl-files\basop32_i.h"
+SOURCE=..\..\g7221\common\basic_op_i.h
# End Source File
# Begin Source File
-SOURCE="..\..\g7221\common\stl-files\count.h"
+SOURCE=..\..\g7221\common\common.c
# End Source File
# Begin Source File
-SOURCE="..\..\g7221\common\stl-files\typedef.h"
+SOURCE=..\..\g7221\common\count.h
# End Source File
-# End Group
# Begin Source File
-SOURCE=..\..\g7221\common\common.c
+SOURCE=..\..\g7221\common\defs.h
# End Source File
# Begin Source File
@@ -137,6 +132,10 @@ SOURCE=..\..\g7221\common\tables.c
SOURCE=..\..\g7221\common\tables.h
# End Source File
+# Begin Source File
+
+SOURCE=..\..\g7221\common\typedef.h
+# End Source File
# End Group
# Begin Group "decode"
@@ -182,10 +181,6 @@ SOURCE=..\..\g7221\encode\sam2coef.c
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\..\g7221\common\defs.h
-# End Source File
# End Group
# End Target
# End Project
diff --git a/third_party/build/g7221/libg7221codec.vcproj b/third_party/build/g7221/libg7221codec.vcproj
index 881f8963..fed93a5a 100644
--- a/third_party/build/g7221/libg7221codec.vcproj
+++ b/third_party/build/g7221/libg7221codec.vcproj
@@ -849,6 +849,18 @@
Name="common"
>
<File
+ RelativePath="..\..\g7221\common\basic_op.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\g7221\common\basic_op.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\g7221\common\basic_op_i.h"
+ >
+ </File>
+ <File
RelativePath="..\..\g7221\common\common.c"
>
<FileConfiguration
@@ -907,6 +919,10 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\..\g7221\common\count.h"
+ >
+ </File>
+ <File
RelativePath="..\..\g7221\common\huff_def.h"
>
</File>
@@ -1034,84 +1050,10 @@
RelativePath="..\..\g7221\common\tables.h"
>
</File>
- <Filter
- Name="stl-files"
+ <File
+ RelativePath="..\..\g7221\common\typedef.h"
>
- <File
- RelativePath="..\..\g7221\common\stl-files\basop32.c"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release-Dynamic|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release-Static|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug-Static|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug-Dynamic|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\..\g7221\common\stl-files\basop32.h"
- >
- </File>
- <File
- RelativePath="..\..\g7221\common\stl-files\basop32_i.h"
- >
- </File>
- <File
- RelativePath="..\..\g7221\common\stl-files\count.h"
- >
- </File>
- <File
- RelativePath="..\..\g7221\common\stl-files\typedef.h"
- >
- </File>
- </Filter>
+ </File>
</Filter>
<Filter
Name="decode"
diff --git a/third_party/g7221/common/stl-files/basop32.c b/third_party/g7221/common/basic_op.c
index efd5c204..1a7347cd 100644
--- a/third_party/g7221/common/stl-files/basop32.c
+++ b/third_party/g7221/common/basic_op.c
@@ -1,61 +1,6 @@
-/* v.1.0 - 26.Jan.2000
- =============================================================================
-
- U U GGG SSSS TTTTT
- U U G S T
- U U G GG SSSS T
- U U G G S T
- UUU GG SSS T
-
- ========================================
- ITU-T - USER'S GROUP ON SOFTWARE TOOLS
- ========================================
-
- =============================================================
- COPYRIGHT NOTE: This source code, and all of its derivations,
- is subject to the "ITU-T General Public License". Please have
- it read in the distribution disk, or in the ITU-T
- Recommendation G.191 on "SOFTWARE TOOLS FOR SPEECH AND AUDIO
- CODING STANDARDS".
- =============================================================
-
-MODULE: BASOP, BASIC OPERATORS
-
-ORIGINAL BY:
- Incorporated from anonymous contributions for
- ETSI Standards as well as G.723.1, G.729, and G.722.1
-
-DESCRIPTION:
- This file contains the definition of 16- and 32-bit basic
- operators to be used in the implementation of signal
- processing algorithms. The basic operators try to resemble
- assembly language instructions that are commonly found in
- digital signal processor (DSP) CPUs, thus allowing algorithm
- C-code implementations more directly mapeable to DSP assembly
- code.
-
- *********************************************************
- NOTE: so far, this module does not have a demo program!
- *********************************************************
-
-FUNCTIONS:
- Defined in basop.h. Self-documentation within each function.
-
-HISTORY:
- 26.Jan.00 v1.0 Incorporated to the STL from updated G.723.1/G.729
- basic operator library (based on basicop2.c) and
- G.723.1's basop.c [L_mls(), div_l(), i_mult()]
- 05.Jul.00 v1.1 Added 32-bit shiftless accumulation basic
- operators (L_msu0, L_mac0, L_mult0). Improved
- documentation for i_mult().
- =============================================================================
-*/
-
/*___________________________________________________________________________
| |
| Basic arithmetic operators. |
- | |
- | $Id $
|___________________________________________________________________________|
*/
@@ -68,7 +13,7 @@ HISTORY:
#include <stdio.h>
#include <stdlib.h>
#include "typedef.h"
-#include "basop32.h"
+#include "basic_op.h"
#if (WMOPS)
#include "count.h"
diff --git a/third_party/g7221/common/stl-files/basop32.h b/third_party/g7221/common/basic_op.h
index 14da776d..93febd1f 100644
--- a/third_party/g7221/common/stl-files/basop32.h
+++ b/third_party/g7221/common/basic_op.h
@@ -1,22 +1,5 @@
-/*
- ===========================================================================
- File: BASOP.H v.1.1 - 05.Jul.2000
- ===========================================================================
-
- ITU-T STL BASIC OPERATORS
-
- GLOBAL FUNCTION PROTOTYPES
-
- History:
- 26.Jan.00 v1.0 Incorporated to the STL from updated G.723.1/G.729
- basic operator library (based on basic_op.h) and
- G.723.1's basop.h.
- 05.Jul.00 v1.1 Added 32-bit shiftless mult/mac/msub operators
- ============================================================================
-*/
-
-#ifndef BASOP_H_DEFINED
-#define BASOP_H_DEFINED 110
+#ifndef __BASIC_OP_H__
+#define __BASIC_OP_H__
/*___________________________________________________________________________
| |
@@ -26,14 +9,11 @@
|___________________________________________________________________________|
*/
-extern Flag Overflow;
-extern Flag Carry;
-
#define MAX_32 (Word32)0x7fffffffL
#define MIN_32 (Word32)0x80000000L
#define MAX_16 (Word16)0x7fff
-#define MIN_16 ((Word16)0x8000)
+#define MIN_16 (Word16)(pj_uint16_t)0x8000
#define UMAX_32 (Word32)0xffffffffL
#define UMIN_32 (Word32)0x00000000L
@@ -126,11 +106,10 @@ PJ_INLINE(Word16) saturate (Word32 L_var1);
# define GET_CARRY() 0
#endif
-#include "basop32_i.h"
+#include "basic_op_i.h"
-#endif /* BASOP_H_DEFINED */
+#endif /* __BASIC_OP_H__ */
-/* ************************* END OF BASIC_OP.H ************************* */
diff --git a/third_party/g7221/common/stl-files/basop32_i.h b/third_party/g7221/common/basic_op_i.h
index ca61ed0b..8eba815e 100644
--- a/third_party/g7221/common/stl-files/basop32_i.h
+++ b/third_party/g7221/common/basic_op_i.h
@@ -658,12 +658,12 @@ PJ_INLINE(Word16) abs_s (Word16 var1)
#if 1
if (var1 >= 0)
return var1;
- else if (var1 == (Word16)0x8000)
+ else if (var1 == MIN_16)
return MAX_16;
else
return (Word16)-var1;
#else
- if (var1 == (Word16) 0x8000)
+ if (var1 == MIN_16)
{
return MAX_16;
}
diff --git a/third_party/g7221/common/stl-files/count.h b/third_party/g7221/common/count.h
index 5081595c..791145e8 100644
--- a/third_party/g7221/common/stl-files/count.h
+++ b/third_party/g7221/common/count.h
@@ -1,4 +1,4 @@
-/* $Id: config.h 2427 2009-01-22 20:30:32Z bennylp $ */
+/* $Id$ */
/*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
*
diff --git a/third_party/g7221/common/defs.h b/third_party/g7221/common/defs.h
index 40db16fb..d4c7aa2e 100644
--- a/third_party/g7221/common/defs.h
+++ b/third_party/g7221/common/defs.h
@@ -13,8 +13,8 @@
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
-#include "g7221/common/stl-files/typedef.h"
-#include "g7221/common/stl-files/basop32.h"
+#include "g7221/common/typedef.h"
+#include "g7221/common/basic_op.h"
#define PI 3.141592653589793238462
diff --git a/third_party/g7221/common/stl-files/typedef.h b/third_party/g7221/common/stl-files/typedef.h
deleted file mode 100644
index 9b0ef44c..00000000
--- a/third_party/g7221/common/stl-files/typedef.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- ===========================================================================
- File: TYPEDEF.H v.1.0 - 26.Jan.2000
- ===========================================================================
-
- ITU-T STL BASIC OPERATORS
-
- TYPE DEFINITION PROTOTYPES
-
- History:
- 26.Jan.00 v1.0 Incorporated to the STL from updated G.723.1/G.729
- basic operator library (based on basic_op.h)
- ============================================================================
-*/
-
-#ifndef TYPEDEF_H
-#define TYPEDEF_H "$Id $"
-
-#if 1
-
-/* Use PJLIB types definitions (for PJLIB sync'd platforms compatibility?
- * e.g: mingw32 was not supported by the original version).
- */
-#include <pj/types.h>
-
-typedef pj_int8_t Word8;
-typedef pj_int16_t Word16;
-typedef pj_int32_t Word32;
-typedef pj_uint16_t UWord16;
-typedef pj_uint32_t UWord32;
-typedef int Flag;
-
-#else
-
-#include <limits.h>
-
-#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(_MSC_VER) || defined(__ZTC__) || defined(__CYGWIN__)
-typedef signed char Word8;
-typedef short Word16;
-typedef long Word32;
-typedef int Flag;
-
-#elif defined(__sun)
-typedef signed char Word8;
-typedef short Word16;
-typedef long Word32;
-typedef int Flag;
-
-#elif defined(__unix__) || defined(__unix)
-typedef signed char Word8;
-typedef short Word16;
-typedef int Word32;
-typedef int Flag;
-
-#endif
-
-/* define 16 bit unsigned types for G.722.1 */
-#if INT_MAX == 32767
-typedef unsigned int UWord16;
-#elif SHRT_MAX == 32767
-typedef unsigned short UWord16;
-#endif
-
-/* define 32 bit unsigned types for G.722.1 */
-#if INT_MAX == 2147483647L
-typedef unsigned int UWord32;
-#elif LONG_MAX == 2147483647L
-typedef unsigned long UWord32;
-#endif
-
-#endif /* if 0 */
-
-#endif /* TYPEDEF_H */
-
diff --git a/third_party/g7221/common/typedef.h b/third_party/g7221/common/typedef.h
new file mode 100644
index 00000000..09ddaba4
--- /dev/null
+++ b/third_party/g7221/common/typedef.h
@@ -0,0 +1,32 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef TYPEDEF_H
+#define TYPEDEF_H
+
+#include <pj/types.h>
+
+typedef pj_int8_t Word8;
+typedef pj_int16_t Word16;
+typedef pj_int32_t Word32;
+typedef pj_uint16_t UWord16;
+typedef pj_uint32_t UWord32;
+typedef int Flag;
+
+#endif /* TYPEDEF_H */
+
diff --git a/third_party/g7221/decode/decoder.c b/third_party/g7221/decode/decoder.c
index d642a910..43aabc54 100644
--- a/third_party/g7221/decode/decoder.c
+++ b/third_party/g7221/decode/decoder.c
@@ -472,8 +472,8 @@ void decode_vector_quantized_mlt_indices(Bit_Obj *bitobj,
Word16 vec_dim;
Word16 num_vecs;
Word16 index;
- Word16 signs_index;
Word16 bit;
+ Word16 signs_index;
Word16 num_sign_bits;
Word16 ran_out_of_bits_flag;
Word16 *decoder_table_ptr;
@@ -559,6 +559,7 @@ void decode_vector_quantized_mlt_indices(Bit_Obj *bitobj,
test();
if (temp >= 0)
{
+
test();
if (num_sign_bits != 0)
{
diff --git a/third_party/g7221/encode/encoder.c b/third_party/g7221/encode/encoder.c
index 82fad3e1..2d878cc4 100644
--- a/third_party/g7221/encode/encoder.c
+++ b/third_party/g7221/encode/encoder.c
@@ -230,7 +230,7 @@ void bits_to_words(UWord32 *region_mlt_bits,
UWord32 *in_word_ptr;
UWord32 current_word;
- Word32 acca;
+ Word32 acca = 0;
Word32 accb;
Word16 temp;
@@ -1010,7 +1010,7 @@ Word16 vector_huffman(Word16 category,
* The next two lines are new to Release 1.2
*/
- mytemp = acca & 0x3;
+ mytemp = (Word16)(acca & 0x3);
acca = L_shr_nocheck(acca,2);
inv_of_step_size_times_std_dev = extract_l(acca);