diff -N -u -r G729-float.orig/Makefile G729-float/Makefile
--- G729-float.orig/Makefile	2004-09-01 02:52:08.000000000 +0100
+++ G729-float/Makefile	2004-11-03 18:31:18.000000000 +0000
@@ -8,20 +8,70 @@
 OBJSFX=.o
 EXESFX=
 
+# Optional, for ICC
+#ICCLIBS=-lsvml
+
 # IPP Dependencies
-IPPINCLS=-I$(IPPROOT)/include
-IPPLIBS=-L$(IPPROOT)/sharedlib -lippsc -lippsr -lipps -lippcore -L$(IPPROOT)/sharedlib/linux32 -lguide
+#IPPINCLS=-I$(IPPROOT)/include
+#IPPLIBS=-L$(IPPROOT)/sharedlib -lippsc -lippsr -lipps -lippcore -L$(IPPROOT)/sharedlib/linux32 -lguide
+
+# Comment the above two and uncomment these
+# three lines to build statically linked version
+IPPINCLS=-I$(IPPROOT)/include -include $(IPPROOT)/tools/staticlib/ipp_$(IPPCORE).h
+IPPLIBS=-L$(IPPROOT)/lib -lippscmerged -lippsrmerged -lippsmerged -lippcore
+LDFLAGS=-static
+#-libcxa
+
+
+# Optimizations, choose one set only depending on CPU type (or debug at bottom)
+#OPTIMIZE= -O2
+#IPPCORE=
+
+# For Pentium I
+#OPTIMIZE= -O6 -march=pentium  -mcpu=pentium -ffast-math -fomit-frame-pointer
+#IPPCORE=px
+
+# For PII
+#OPTIMIZE=-O6 -march=pentium2 -mcpu=pentium2 -ffast-math -fomit-frame-pointer
+#IPPCORE=px
+
+# For PIII
+#OPTIMIZE= -O6 -mcpu=pentium3 -march=pentium3 -ffast-math -fomit-frame-pointer
+#IPPCORE=a6
+
+# For PIII no SSE
+#OPTIMIZE= -O6 -mcpu=pentium3 -march=pentium3 -ffast-math -fomit-frame-pointer -mno-sse
+#IPPCORE=a6
+
+# For P4
+OPTIMIZE= -O6 -march=pentium4 -mcpu=pentium4 -ffast-math -fomit-frame-pointer
+IPPCORE=w7
+# optional
+
+# For P4 no SSE
+#OPTIMIZE= -O6 -march=pentium4 -mcpu=pentium4 -ffast-math -fomit-frame-pointer -no-sse
+#IPPCORE=w7
+
+# For Athlon (untested)
+#OPTIMIZE= -O6 -march=athlon   -mcpu=athlon -ffast-math -fomit-frame-pointer
+#IPPCORE=a6
+
+# For debugging
+#OPTIMIZE= -O -g
+#IPPCORE=px
 
 # Compiler Specifics
-CCOPTS=-c -O2
+CCOPTS=-c $(OPTIMIZE)
 CCDEFS=-D__unix__ -Dlinux -Dlinux32 -DNDEBUG -DLINUX32 -DNO_SCRATCH_MEMORY_USED
 CCINCLS=-I./include -I./vm/include $(IPPINCLS)
 
 LNKOUT=-o
 LNKOPTS=
-LNKLIBS=$(IPPLIBS) -lpthread -lm
+LNKLIBS=$(IPPLIBS) -lpthread -lm 
+
+SOLINKOPTS=-shared $(LDFLAGS) -Xlinker -x
 
-build: prepare_directory build_encoder build_decoder; @echo "Done"
+build: prepare_directory build_codec ; @echo "Done"
 
 ##### api object #####
 CPPSRC_API=$(wildcard ./api/*$(CPPSFX))
@@ -30,9 +80,19 @@
 CPPSRC_VM=$(wildcard ./vm/src/*$(CPPSFX))
 OBJECT_VM=$(patsubst %$(CPPSFX), %$(OBJSFX), $(CPPSRC_VM))
 
+############ Asterisk Codec ############
+OBJECT_CODEC=./bin/codec_g729.so
+CPPSRC_CODEC=$(wildcard ./samples/util_e$(CPPSFX) ./samples/util_d$(CPPSFX) ./samples/codec_g729.c )
+OBJSRC_CODEC=$(patsubst %$(CPPSFX), %$(OBJSFX), $(CPPSRC_CODEC))
+
+build_codec:	$(OBJECT_CODEC) ; @echo "done Asterisk codec"
+
+$(OBJECT_CODEC):	$(OBJSRC_CODEC) $(OBJECT_API)
+	$(CC) $(SOLINKOPTS) -o $@ $^ $(LNKLIBS)
+
 ##### link encoder example programs #####
 OBJECT_ENCODER=./bin/g729fpencoder$(EXESFX)
-CPPSRC_ENCODER=$(wildcard ./samples/encoder$(CPPSFX) ./samples/util_e$(CPPSFX) )
+CPPSRC_ENCODER=$(wildcard ./samples/encoder$(CPPSFX) ./samples/util_e$(CPPSFX) ./samples/my_enc.c)
 OBJSRC_ENCODER=$(patsubst %$(CPPSFX), %$(OBJSFX), $(CPPSRC_ENCODER))
 
 build_encoder: $(OBJECT_ENCODER) ; @echo "done encoder"
@@ -42,7 +102,7 @@
 
 ##### link decoder example programs #####
 OBJECT_DECODER=./bin/g729fpdecoder$(EXESFX)
-CPPSRC_DECODER=$(wildcard ./samples/decoder$(CPPSFX) ./samples/util_d$(CPPSFX) )
+CPPSRC_DECODER=$(wildcard ./samples/decoder$(CPPSFX) ./samples/util_d$(CPPSFX) ./samples/my_dec.c)
 OBJSRC_DECODER=$(patsubst %$(CPPSFX), %$(OBJSFX), $(CPPSRC_DECODER))
 
 build_decoder: $(OBJECT_DECODER) ; @echo "done decoder"
@@ -51,7 +111,7 @@
 	$(CC) -o$@ $(LNKOPTS) $^ $(LNKLIBS)
 
 ##### compile encoder & decoder objects all together #####
-OBJECTS=$(OBJECT_API)  $(OBJECT_VM)$(OBJSRC_ENCODER) $(OBJSRC_DECODER)
+OBJECTS=$(OBJECT_API)  $(OBJECT_VM) $(OBJSRC_CODEC)
 $(OBJECTS): %$(OBJSFX): %$(CPPSFX)
 	$(CC) $(CCINCLS) $(CCDEFS) $(CCOPTS) -o$@ $<
 
diff -N -u -r G729-float.orig/samples/codec_g729.c G729-float/samples/codec_g729.c
--- G729-float.orig/samples/codec_g729.c	1970-01-01 01:00:00.000000000 +0100
+++ G729-float/samples/codec_g729.c	2004-11-03 15:30:05.000000000 +0000
@@ -0,0 +1,355 @@
+/*
+ * G729 codec for Asterisk
+ *
+ * Based on sample applications from Intel Performance Primitives (IPP)
+ * libraries.
+ *
+ * For Intel IPP licensing, see http://www.intel.com
+ *
+ * For G.729(,A,B) royalty payments, see http://www.sipro.com 
+ *   WARNING: please make sure you are sitting down before looking
+ *            at their price list.
+ *
+ * This source file is Copyright (C) 2004 Ready Technology Limited
+ * This code is provided for educational purposes and is not warranted
+ * to be fit for commercial use.  There is no warranty of any kind.
+ * 
+ * Author: daniel@readytechnology.co.uk
+ */
+
+#define _GNU_SOURCE
+
+#include <asterisk/lock.h>
+#include <asterisk/translate.h>
+#include <asterisk/module.h>
+#include <asterisk/logger.h>
+#include <asterisk/channel.h>
+#include <pthread.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "usc.h"
+#include <ippcore.h>
+#include <ipps.h>
+#include <ippsc.h>
+#include "encoder.h"
+#include "decoder.h"
+
+#include "slin_g729_ex.h"
+#include "g729_slin_ex.h"
+
+AST_MUTEX_DEFINE_STATIC(localuser_lock);
+
+static int localusecnt=0;
+
+static char *tdesc = "G729/PCM16 (signed linear) Codec Translator, based on IPP";
+
+static USC_Fxns *USC_CODEC_Fxns;
+
+struct ast_translator_pvt {
+
+	struct ast_frame f;
+
+	USC_CodecInfo pInfo;
+
+	USC_Handle codec;	/* the encoder or decoder handle */
+	USC_MemBank* pBanks;
+
+
+	USC_PCMStream pcmStream;	/* Signed linear data */
+	USC_Bitstream bitStream;	/* G.729 bits */
+
+	int nbanks;
+	int maxbitsize;
+  	int inFrameSize;
+   	int outFrameSize;
+
+	short pcm_buf[8000];
+	unsigned char bitstream_buf[1000];
+
+	int tail;
+};
+
+#define g729_coder_pvt ast_translator_pvt
+
+static struct ast_translator_pvt *lintog729_new(void) {
+	int i;
+	struct g729_coder_pvt *tmp;
+	tmp = malloc(sizeof(struct g729_coder_pvt));
+	if(tmp) {
+		USC_CODEC_Fxns->std.GetInfo((USC_Handle)NULL, &tmp->pInfo);
+		((USC_Option*)tmp->pInfo.params)->modes.truncate = 1;
+  		((USC_Option*)tmp->pInfo.params)->direction = 0;
+  		((USC_Option*)tmp->pInfo.params)->modes.vad = 0;
+		USC_CODEC_Fxns->std.NumAlloc(tmp->pInfo.params, &(tmp->nbanks));
+		tmp->pBanks = (USC_MemBank*)ippsMalloc_8u(sizeof(USC_MemBank)*(tmp->nbanks));
+		USC_CODEC_Fxns->std.MemAlloc(tmp->pInfo.params, tmp->pBanks);
+		for(i=0; i<tmp->nbanks;i++) {
+			if(!(tmp->pBanks[i].pMem = ippsMalloc_8u(tmp->pBanks->nbytes))) {
+				printf("\nLow memory: %d bytes not allocated\n",tmp->pBanks->nbytes);
+				return NULL;
+			}
+		}
+
+		tmp->inFrameSize = getInFrameSize();
+		tmp->outFrameSize = getOutFrameSize();
+
+		/* tmp->bitstream_buf = ippsMalloc_8s(tmp->pInfo.maxbitsize); */
+
+		tmp->pcmStream.bitrate = tmp->pInfo.params->modes.bitrate;
+  		tmp->maxbitsize = tmp->pInfo.maxbitsize;
+  		USC_CODEC_Fxns->std.Init(tmp->pInfo.params, tmp->pBanks, &(tmp->codec));
+
+  		ippCoreSetFlushToZero( 1, NULL );
+  		tmp->pcmStream.pcmType.bitPerSample = tmp->pInfo.pcmType->bitPerSample;
+  		tmp->pcmStream.pcmType.sample_frequency = tmp->pInfo.pcmType->sample_frequency;
+  		tmp->bitStream.nbytes  = tmp->maxbitsize;
+  		tmp->bitStream.pBuffer = tmp->bitstream_buf;
+
+		USC_CODEC_Fxns->std.Reinit(&((USC_Option*)tmp->pInfo.params)->modes, tmp->codec);
+
+		tmp->tail = 0;
+		localusecnt++;
+	}
+	return tmp;
+}
+
+static struct ast_translator_pvt *g729tolin_new(void) {
+	int i;
+	struct g729_coder_pvt *tmp;
+	tmp = malloc(sizeof(struct g729_coder_pvt));
+	if(tmp) {
+		USC_CODEC_Fxns->std.GetInfo((USC_Handle)NULL, &(tmp->pInfo));	
+		((USC_Option*)tmp->pInfo.params)->modes.bitrate = 0;
+  		((USC_Option*)tmp->pInfo.params)->modes.truncate = 1;
+  		((USC_Option*)tmp->pInfo.params)->direction = 1;
+
+		/* tmp->bitstream_buf = ippsMalloc_8s(size); */
+		
+		USC_CODEC_Fxns->std.NumAlloc(tmp->pInfo.params, &tmp->nbanks);
+		tmp->pBanks = (USC_MemBank*)ippsMalloc_8u(sizeof(USC_MemBank)*(tmp->nbanks));
+		USC_CODEC_Fxns->std.MemAlloc(tmp->pInfo.params, tmp->pBanks);
+		for(i=0; i<tmp->nbanks;i++) {
+			if(!(tmp->pBanks[i].pMem = ippsMalloc_8u(tmp->pBanks->nbytes))) {
+				printf("\nLow memory: %d bytes not allocated\n", tmp->pBanks->nbytes);
+				return NULL;
+			}
+		}
+
+		tmp->outFrameSize = getOutFrameSize();
+
+		/* pcm_buf ippsMalloc_8s(getOutFrameSize()); */
+
+		tmp->maxbitsize = tmp->pInfo.maxbitsize;
+		USC_CODEC_Fxns->std.Init(tmp->pInfo.params, tmp->pBanks, &(tmp->codec));
+
+		ippCoreSetFlushToZero( 1, NULL );
+
+		tmp->bitStream.nbytes  = tmp->maxbitsize;
+	  	tmp->bitStream.bitrate = 0;
+	        tmp->bitStream.frametype = 3;
+	        tmp->pcmStream.pBuffer = tmp->pcm_buf;
+		tmp->pcmStream.pcmType.bitPerSample = 0;
+	        tmp->pcmStream.pcmType.sample_frequency = 0;
+
+	        USC_CODEC_Fxns->std.Reinit(&((USC_Option*)tmp->pInfo.params)->modes, tmp->codec);
+
+		tmp->tail = 0;
+		localusecnt++;
+	}
+	return tmp;
+}
+
+static struct ast_frame *lintog729_sample(void) {
+	static struct ast_frame f;
+	f.frametype = AST_FRAME_VOICE;
+	f.subclass = AST_FORMAT_SLINEAR;
+	f.datalen = sizeof(slin_g729_ex);
+	f.samples = sizeof(slin_g729_ex) / 2;
+	f.mallocd = 0;
+	f.offset = 0;
+	f.src = __PRETTY_FUNCTION__;
+	f.data = slin_g729_ex;
+	return &f;
+}
+
+static struct ast_frame *g729tolin_sample(void) {
+	static struct ast_frame f;
+	f.frametype = AST_FRAME_VOICE;
+	f.subclass = AST_FORMAT_G729A;
+	f.datalen = sizeof(g729_slin_ex);
+	f.samples = 240;
+	f.mallocd = 0;
+	f.offset = 0;
+	f.src = __PRETTY_FUNCTION__;
+	f.data = g729_slin_ex;
+	return &f;
+}
+
+/**
+ * Retrieve a frame that has already been decompressed
+ */
+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *tmp) {
+	if(!tmp->tail)
+		return NULL;
+	tmp->f.frametype = AST_FRAME_VOICE;
+	tmp->f.subclass = AST_FORMAT_SLINEAR;
+	tmp->f.datalen = tmp->tail * 2;
+	tmp->f.samples = tmp->tail;
+	tmp->f.mallocd = 0;
+	tmp->f.offset = AST_FRIENDLY_OFFSET;
+	tmp->f.src = __PRETTY_FUNCTION__;
+	tmp->f.data = tmp->pcm_buf;
+	tmp->tail = 0;
+	return &tmp->f;
+}
+
+/**
+ * Accept a frame and decode it at the end of the current buffer
+ */
+static int g729tolin_framein(struct ast_translator_pvt *tmp, struct ast_frame *f) {
+	int x, i;
+	int frameSize = 0;
+	
+/*	if(f->datalen % 10) {
+		ast_log(LOG_WARNING, "Received a G.729 frame that was %d bytes from %s\n", f->datalen, f->src);
+		return -1;
+	} */
+
+	for(x = 0; x < f->datalen; x += frameSize) {
+		if((f->datalen - x) == 2)
+			frameSize = 2;   /* VAD frame */
+		else
+			frameSize = 10;  /* Regular frame */
+		if(tmp->tail + 80 < sizeof(tmp->pcm_buf) / 2) {
+			/* decode the frame */
+			tmp->bitStream.pBuffer = f->data + x;
+			tmp->pcmStream.pBuffer = tmp->pcm_buf + tmp->tail;
+			USC_CODEC_Fxns->std.Decode (tmp->codec, &tmp->bitStream, &tmp->pcmStream);
+
+			tmp->tail += 80;
+		} else {
+			ast_log(LOG_WARNING, "Out of G.729 buffer space\n");
+			return -1;
+		}
+	}
+	return 0;
+}
+
+static int lintog729_framein(struct ast_translator_pvt *tmp, struct ast_frame *f) {
+	if(tmp->tail + f->datalen/2 < sizeof(tmp->pcm_buf) / 2) {
+		memcpy((tmp->pcm_buf + tmp->tail), f->data, f->datalen);
+		tmp->tail += f->datalen/2;
+	} else {
+		ast_log(LOG_WARNING, "Out of buffer space\n");
+		return -1;
+	}
+	return 0;
+}
+
+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *tmp) {
+
+
+	int x = 0, i;
+	if(tmp->tail < 80)
+		return NULL;
+	tmp->f.frametype = AST_FRAME_VOICE;
+	tmp->f.subclass = AST_FORMAT_G729A;
+	tmp->f.mallocd = 0;
+	tmp->f.offset = AST_FRIENDLY_OFFSET;
+	tmp->f.src = __PRETTY_FUNCTION__;
+	tmp->f.data = tmp->bitstream_buf;
+	while(tmp->tail >= 80) {
+		if((x+1) * 10 >= sizeof(tmp->bitstream_buf)) {
+			ast_log(LOG_WARNING, "Out of buffer space\n");
+			break;
+		}
+		/* Copy the frame to workspace, then encode it */
+		tmp->pcmStream.pBuffer = tmp->pcm_buf;
+		tmp->bitStream.pBuffer = tmp->bitstream_buf + (x * 10);
+		USC_CODEC_Fxns->std.Encode (tmp->codec, &tmp->pcmStream, &tmp->bitStream);
+
+		tmp->tail -= 80;
+		if(tmp->tail)
+			memmove(tmp->pcm_buf, tmp->pcm_buf + 80, tmp->tail * 2);
+		x++;
+	}
+	tmp->f.datalen = x * 10;
+	tmp->f.samples = x * 80;
+
+
+	return &(tmp->f);
+}
+
+static void g729_release(struct ast_translator_pvt *pvt) {
+	int i;
+	for(i = 0; i < pvt->nbanks; i++) {
+		if(!pvt->pBanks[i].pMem)
+			ippsFree(pvt->pBanks[i].pMem);	
+		pvt->pBanks[i].pMem=NULL;
+	}
+	if(!pvt->pBanks)
+		ippsFree(pvt->pBanks);
+	free(pvt);
+	localusecnt--;
+}
+
+static struct ast_translator g729tolin = {
+	"g729tolin",
+	AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
+	g729tolin_new,
+	g729tolin_framein,
+	g729tolin_frameout,
+	g729_release,
+	g729tolin_sample };
+
+static struct ast_translator lintog729 = {
+	"lintog729",
+	AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
+	lintog729_new,
+	lintog729_framein,
+	lintog729_frameout,
+	g729_release,
+	lintog729_sample };
+
+int load_module(void) {
+	USC_CODEC_Fxns = USC_GetCodecByName ();
+	int res;
+	res = ast_register_translator(&g729tolin);
+	if(!res)
+		res = ast_register_translator(&lintog729);
+	else
+		ast_unregister_translator(&g729tolin);
+	return res;
+}
+
+int unload_module(void) {
+	int res;
+	ast_mutex_lock(&localuser_lock);
+	res = ast_unregister_translator(&lintog729);
+	if(!res)
+		res = ast_unregister_translator(&g729tolin);
+	if(localusecnt)
+		res = -1;
+	ast_mutex_unlock(&localuser_lock);
+	return res;
+}
+
+char *description(void) {
+	return tdesc;
+}
+
+int usecount(void) {
+	int res;
+	STANDARD_USECOUNT(res);
+	return res;
+}
+
+char *key() {
+	return ASTERISK_GPL_KEY;
+}
+
diff -N -u -r G729-float.orig/samples/decoder.c G729-float/samples/decoder.c
--- G729-float.orig/samples/decoder.c	2004-09-01 02:52:08.000000000 +0100
+++ G729-float/samples/decoder.c	2004-11-02 09:51:36.000000000 +0000
@@ -161,7 +161,7 @@
 //     Purpose: process command line and run multiple decode threads 
 */
 
-int main(int argc, char *argv[])
+int main1(int argc, char *argv[])
 {
    int n_repeat = 1;
    int n_thread = 1;
diff -N -u -r G729-float.orig/samples/encoder.c G729-float/samples/encoder.c
--- G729-float.orig/samples/encoder.c	2004-09-01 02:52:08.000000000 +0100
+++ G729-float/samples/encoder.c	2004-11-02 09:51:36.000000000 +0000
@@ -172,7 +172,7 @@
 //  USC encoder main program :
 //     Purpose: process command line and run multiple encode threads 
 */
-int main(int argc, char *argv[])
+int main1(int argc, char *argv[])
 {
    int n_repeat = 1;
    int n_thread = 1;
diff -N -u -r G729-float.orig/samples/g729_slin_ex.h G729-float/samples/g729_slin_ex.h
--- G729-float.orig/samples/g729_slin_ex.h	1970-01-01 01:00:00.000000000 +0100
+++ G729-float/samples/g729_slin_ex.h	2004-11-02 09:51:36.000000000 +0000
@@ -0,0 +1,7 @@
+/*
+ * One frame of raw G729 data
+ */
+
+static unsigned char g729_slin_ex[] = {
+  0xf9, 0xa3, 0xc9, 0xe0, 0x0, 0xfa, 0xdd, 0xa9, 0x97, 0x7d };
+
diff -N -u -r G729-float.orig/samples/gen_test.c G729-float/samples/gen_test.c
--- G729-float.orig/samples/gen_test.c	1970-01-01 01:00:00.000000000 +0100
+++ G729-float/samples/gen_test.c	2004-11-02 09:51:36.000000000 +0000
@@ -0,0 +1,16 @@
+
+#include <stdio.h>
+
+int main(int argc, char *argv[]) {
+
+	int i;
+
+	FILE *f = fopen("test1.g729", "r");
+	for(i = 0; i < 10; i++)
+		printf("0x%x, ", fgetc(f));
+	fclose(f);
+
+  	return 0;
+
+}
+
diff -N -u -r G729-float.orig/samples/my_dec.c G729-float/samples/my_dec.c
--- G729-float.orig/samples/my_dec.c	1970-01-01 01:00:00.000000000 +0100
+++ G729-float/samples/my_dec.c	2004-11-02 09:51:36.000000000 +0000
@@ -0,0 +1,94 @@
+
+#include <stdio.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <string.h>
+#include "usc.h"
+#include <ippcore.h>
+#include <ipps.h>
+#include <ippsc.h>
+#include "decoder.h"
+
+
+int main(int argc, char *argv[]) {
+
+  char *bitstream_buf;
+  char *buf_out;
+  char *p;
+  char *f;
+  long file_size;
+  int i;
+
+  USC_Fxns *USC_CODEC_Fxns;
+  USC_CodecInfo pInfo;
+  USC_Handle decoder;
+
+  USC_Bitstream in;
+  USC_PCMStream out;
+  USC_MemBank* pBanks;
+
+  int nbanks = 0;
+  int maxbitsize;
+  int inFrameSize = 10;
+  int outFrameSize;
+
+  USC_CODEC_Fxns = USC_GetCodecByName ();
+  USC_CODEC_Fxns->std.GetInfo((USC_Handle)NULL, &pInfo); /* codec info */
+
+  ((USC_Option*)pInfo.params)->modes.bitrate = 0;
+  ((USC_Option*)pInfo.params)->modes.truncate = 1;
+  ((USC_Option*)pInfo.params)->direction = 1;
+
+  FILE *f_in = fopen("test2.g729", "r");
+  FILE *f_out = fopen("test2.raw", "w");
+
+  fseek(f_in, 0, SEEK_END);
+  file_size = ftell(f_in);
+  fseek(f_in, 0, SEEK_SET);
+
+  bitstream_buf = ippsMalloc_8s(file_size);
+  fread(bitstream_buf, file_size, 1, f_in);
+  p = bitstream_buf;
+  f = bitstream_buf + file_size;
+
+  USC_CODEC_Fxns->std.NumAlloc(pInfo.params, &nbanks);
+  pBanks = (USC_MemBank*)ippsMalloc_8u(sizeof(USC_MemBank)*nbanks);
+  USC_CODEC_Fxns->std.MemAlloc(pInfo.params, pBanks);
+  for(i=0; i<nbanks;i++) {
+    if(!(pBanks[i].pMem = ippsMalloc_8u(pBanks->nbytes))) {
+      printf("\nLow memory: %d bytes not allocated\n",pBanks->nbytes);
+      return -1;
+    }
+  }
+
+  outFrameSize = getOutFrameSize();
+
+  buf_out = ippsMalloc_8s(getOutFrameSize());
+
+  maxbitsize = pInfo.maxbitsize;
+  USC_CODEC_Fxns->std.Init(pInfo.params, pBanks, &decoder);
+
+  ippCoreSetFlushToZero( 1, NULL );
+
+  in.nbytes  = maxbitsize;
+  in.bitrate = 0;
+  in.frametype = 3;
+  out.pBuffer = buf_out;
+  out.pcmType.bitPerSample = 0;
+  out.pcmType.sample_frequency = 0;
+
+  USC_CODEC_Fxns->std.Reinit(&((USC_Option*)pInfo.params)->modes, decoder);
+
+  while(p < f) {
+    in.pBuffer = p;
+    USC_CODEC_Fxns->std.Decode (decoder, &in, &out);
+    fwrite(out.pBuffer, outFrameSize, 1, f_out);
+
+    p += inFrameSize;
+  }
+  
+  fclose(f_out);
+  fclose(f_in);
+
+}
+
diff -N -u -r G729-float.orig/samples/my_enc.c G729-float/samples/my_enc.c
--- G729-float.orig/samples/my_enc.c	1970-01-01 01:00:00.000000000 +0100
+++ G729-float/samples/my_enc.c	2004-11-02 09:51:36.000000000 +0000
@@ -0,0 +1,93 @@
+
+#include <stdio.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <string.h>
+#include "usc.h"
+#include <ippcore.h>
+#include <ipps.h>
+#include <ippsc.h>
+#include "encoder.h"
+
+
+int main(int argc, char *argv[]) {
+
+  char *buf_in;
+  char *bitstream_buf;
+  char *p;
+  char *f;
+  long file_size;
+  int i;
+
+  USC_Fxns *USC_CODEC_Fxns;
+  USC_CodecInfo pInfo;
+  USC_Handle encoder;
+
+  USC_PCMStream in;
+  USC_Bitstream out;
+  USC_MemBank* pBanks;
+
+  int nbanks = 0;
+  int maxbitsize;
+  int inFrameSize;
+  int outFrameSize = 0;
+
+  USC_CODEC_Fxns = USC_GetCodecByName ();
+  USC_CODEC_Fxns->std.GetInfo((USC_Handle)NULL, &pInfo); /* codec info */
+  ((USC_Option*)pInfo.params)->modes.truncate = 1;
+  ((USC_Option*)pInfo.params)->direction = 0;
+  ((USC_Option*)pInfo.params)->modes.vad = 0;
+
+  FILE *f_in = fopen("test1.raw", "r");
+  FILE *f_out = fopen("test1.g729", "w");
+
+  fseek(f_in, 0, SEEK_END);
+  file_size = ftell(f_in);
+  fseek(f_in, 0, SEEK_SET);
+
+  buf_in = ippsMalloc_8s(file_size);
+  fread(buf_in, file_size, 1, f_in);
+  p = buf_in;
+  f = buf_in + file_size;
+
+  USC_CODEC_Fxns->std.NumAlloc(pInfo.params, &nbanks);
+  pBanks = (USC_MemBank*)ippsMalloc_8u(sizeof(USC_MemBank)*nbanks);
+  USC_CODEC_Fxns->std.MemAlloc(pInfo.params, pBanks);
+  for(i=0; i<nbanks;i++) {
+    if(!(pBanks[i].pMem = ippsMalloc_8u(pBanks->nbytes))) {
+      printf("\nLow memory: %d bytes not allocated\n",pBanks->nbytes);
+      return -1;
+    }
+  }
+
+  inFrameSize = getInFrameSize();
+  outFrameSize = getOutFrameSize();
+
+  bitstream_buf = ippsMalloc_8s(pInfo.maxbitsize);
+
+  in.bitrate = pInfo.params->modes.bitrate;
+  maxbitsize = pInfo.maxbitsize;
+  USC_CODEC_Fxns->std.Init(pInfo.params, pBanks, &encoder);
+
+  ippCoreSetFlushToZero( 1, NULL );
+  in.pcmType.bitPerSample = pInfo.pcmType->bitPerSample;
+  in.pcmType.sample_frequency = pInfo.pcmType->sample_frequency;
+  out.nbytes  = maxbitsize;
+  out.pBuffer = bitstream_buf;
+
+  USC_CODEC_Fxns->std.Reinit(&((USC_Option*)pInfo.params)->modes, encoder);
+
+  while(p < f) {
+    in.pBuffer = p;
+    USC_CODEC_Fxns->std.Encode (encoder, &in, &out);
+    fwrite(out.pBuffer, 10, 1, f_out);
+    p += inFrameSize; 
+  }
+
+  fclose(f_out);
+  fclose(f_in);
+
+  return 0;
+}
+
+
diff -N -u -r G729-float.orig/samples/slin_g729_ex.h G729-float/samples/slin_g729_ex.h
--- G729-float.orig/samples/slin_g729_ex.h	1970-01-01 01:00:00.000000000 +0100
+++ G729-float/samples/slin_g729_ex.h	2004-11-02 09:51:36.000000000 +0000
@@ -0,0 +1,30 @@
+/*
+ * Signed 16 bit audio data
+ *
+ */
+static signed short slin_g729_ex[] = {
+0x0873, 0x06d9, 0x038c, 0x0588, 0x0409, 0x033d, 0x0311, 0xff6c, 0xfeef, 0xfd3e,
+0xfdff, 0xff7a, 0xff6d, 0xffec, 0xff36, 0xfd62, 0xfda7, 0xfc6c, 0xfe67, 0xffe1,
+0x003d, 0x01cc, 0x0065, 0x002a, 0xff83, 0xfed9, 0xffba, 0xfece, 0xff42, 0xff16,
+0xfe85, 0xff31, 0xff02, 0xfdff, 0xfe32, 0xfe3f, 0xfed5, 0xff65, 0xffd4, 0x005b,
+0xff88, 0xff01, 0xfebd, 0xfe95, 0xff46, 0xffe1, 0x00e2, 0x0165, 0x017e, 0x01c9,
+0x0182, 0x0146, 0x00f9, 0x00ab, 0x006f, 0xffe8, 0xffd8, 0xffc4, 0xffb2, 0xfff9,
+0xfffe, 0x0023, 0x0018, 0x000b, 0x001a, 0xfff7, 0x0014, 0x000b, 0x0004, 0x000b,
+0xfff1, 0xff4f, 0xff3f, 0xff42, 0xff5e, 0xffd4, 0x0014, 0x0067, 0x0051, 0x003b,
+0x0034, 0xfff9, 0x000d, 0xff54, 0xff54, 0xff52, 0xff3f, 0xffcc, 0xffe6, 0x00fc,
+0x00fa, 0x00e4, 0x00f3, 0x0021, 0x0011, 0xffa1, 0xffab, 0xffdb, 0xffa5, 0x0009,
+0xffd2, 0xffe6, 0x0007, 0x0096, 0x00e4, 0x00bf, 0x00ce, 0x0048, 0xffe8, 0xffab,
+0xff8f, 0xffc3, 0xffc1, 0xfffc, 0x0002, 0xfff1, 0x000b, 0x00a7, 0x00c5, 0x00cc,
+0x015e, 0x00e4, 0x0094, 0x0029, 0xffc7, 0xffc3, 0xff86, 0xffe4, 0xffe6, 0xffec,
+0x000f, 0xffe3, 0x0028, 0x004b, 0xffaf, 0xffcb, 0xfedd, 0xfef8, 0xfe83, 0xfeba,
+0xff94, 0xff94, 0xffbe, 0xffa8, 0xff0d, 0xff32, 0xff58, 0x0021, 0x0087, 0x00be,
+0x0115, 0x007e, 0x0052, 0xfff0, 0xffc9, 0xffe8, 0xffc4, 0x0014, 0xfff0, 0xfff5,
+0xfffe, 0xffda, 0x000b, 0x0010, 0x006f, 0x006f, 0x0052, 0x0045, 0xffee, 0xffea,
+0xffcb, 0xffdf, 0xfffc, 0xfff0, 0x0012, 0xfff7, 0xfffe, 0x0018, 0x0050, 0x0066,
+0x0047, 0x0028, 0xfff7, 0xffe8, 0xffec, 0x0007, 0x001d, 0x0016, 0x00c4, 0x0093,
+0x007d, 0x0052, 0x00a5, 0x0091, 0x003c, 0x0041, 0xffd1, 0xffda, 0xffc6, 0xfff0,
+0x001d, 0xfffe, 0x0024, 0xffee, 0xfff3, 0xfff0, 0xffea, 0x0012, 0xfff3, 0xfff7,
+0xffda, 0xffca, 0xffda, 0xffdf, 0xfff3, 0xfff7, 0xff54, 0xff7c, 0xff8c, 0xffb9,
+0x0012, 0x0012, 0x004c, 0x0007, 0xff50, 0xff66, 0xff54, 0xffa9, 0xffdc, 0xfff9,
+0x0038, 0xfff9, 0x00d2, 0x0096, 0x008a, 0x0079, 0xfff5, 0x0019, 0xffad, 0xfffc };
+
diff -N -u -r G729-float.orig/samples/util_e.c G729-float/samples/util_e.c
--- G729-float.orig/samples/util_e.c	2004-09-01 02:52:08.000000000 +0100
+++ G729-float/samples/util_e.c	2004-11-02 09:51:36.000000000 +0000
@@ -26,7 +26,7 @@
 */
 #include "util_e.h"
 
-USC_Fxns* USC_GetCodecByName (void)
+USC_Fxns* USC_GetCodecByName_xx2 (void)
 {
     return &USC_G729FP_Fxns;
 }
@@ -68,7 +68,7 @@
     return 0;
 }
 
-int text2rate(char *strRate, char **rat_buff, int *nRates, USC_CodecInfo *pInfo)
+int text2rate_xx1(char *strRate, char **rat_buff, int *nRates, USC_CodecInfo *pInfo)
 {
      if(!strcmp(strRate,"A")){
         ((USC_Option*)pInfo->params)->modes.bitrate=G729A_CODEC;
@@ -128,7 +128,7 @@
   return(G729_SPEECH_FRAME*sizeof(short));
 }
                     
-int getOutFrameSize(void)
+int getOutFrameSize_xx3(void)
 {
   return(BITSTREAM_FILE_FRAME_SIZE*sizeof(short));
 }
diff -N -u -r G729-float.orig/samples/util_e.h G729-float/samples/util_e.h
--- G729-float.orig/samples/util_e.h	2004-09-01 02:52:08.000000000 +0100
+++ G729-float/samples/util_e.h	2004-11-02 09:51:36.000000000 +0000
@@ -85,11 +85,11 @@
 /*
    GetCodecByName() - quest codec functions table by codec name
 */
-USC_Fxns* USC_GetCodecByName(void);
-int text2rate(char *strRate, char **rat_buff, int *nRates, USC_CodecInfo *pInfo);
+USC_Fxns* USC_GetCodecByName_xx2(void);
+int text2rate_xx1(char *strRate, char **rat_buff, int *nRates, USC_CodecInfo *pInfo);
 int checkVad(char *strVad, int *mode);
 int getInFrameSize(void);
-int getOutFrameSize(void);
+int getOutFrameSize_xx3(void);
 int Bits2Ref(USC_PCMStream in, USC_Bitstream out, char *out_buff_cur);
 
 #endif /*UTIL_E_H*/

