diff -Naur amr/decoder.c amr.patched/decoder.c --- amr/decoder.c Mon May 26 09:56:36 2003 +++ amr.patched/decoder.c Wed Feb 2 15:00:11 2005 @@ -14,6 +14,7 @@ #include #include "interf_dec.h" #include "typedef.h" +#include "sp_dec.h" #ifndef ETSI #ifndef IF2 @@ -83,14 +84,22 @@ /* Process command line options */ if (argc == 3){ + char *ifname = argv[1]; + char *ofname = argv[2]; - file_speech = fopen(argv[2], "wb"); + if (strcmp(ofname, "-") == 0) + file_speech = stdout; + else + file_speech = fopen(argv[2], "wb"); if (file_speech == NULL){ fprintf ( stderr, "%s%s%s\n","Use: ",argv[0], " input.file output.file " ); return 1; } - file_analysis = fopen(argv[1], "rb"); + if (strcmp(ifname, "-") == 0) + file_analysis = stdin; + else + file_analysis = fopen(argv[1], "rb"); if (file_analysis == NULL){ fprintf ( stderr, "%s%s%s\n","Use: ",argv[0], " input.file output.file " ); fclose(file_speech); diff -Naur amr/encoder.c amr.patched/encoder.c --- amr/encoder.c Mon May 26 09:57:02 2003 +++ amr.patched/encoder.c Wed Feb 2 15:00:11 2005 @@ -121,17 +121,27 @@ /* Process command line options */ if ((argc == 5) || (argc == 4)){ - file_encoded = fopen(argv[argc - 1], "wb"); + char *ofname = argv[argc - 1]; + char *ifname = argv[argc - 2]; + + if (strcmp(ofname, "-") == 0) + file_encoded = stdout; + else + file_encoded = fopen(ofname, "wb"); if (file_encoded == NULL){ Usage(argv); return 1; } - file_speech = fopen(argv[argc - 2], "rb"); - if (file_speech == NULL){ - fclose(file_encoded); - Usage(argv); - return 1; - } + if (strcmp(ifname, "-") == 0) + file_speech = stdin; + else + file_speech = fopen(argv[argc - 2], "rb"); + + if (file_speech == NULL){ + fclose(file_encoded); + Usage(argv); + return 1; + } if (strncmp(argv[argc - 3], "-modefile=", 10) == 0){ file_mode = fopen(&argv[argc - 3][10], "rt"); if (file_mode == NULL){ diff -Naur amr/makefile.gcc amr.patched/makefile.gcc --- amr/makefile.gcc Fri Feb 8 00:00:02 2002 +++ amr.patched/makefile.gcc Wed Feb 2 15:02:02 2005 @@ -53,7 +53,7 @@ # # compiler flags (for normal, DEBUG compilation) # -CFLAGS_NORM = -O4 -DETSI +CFLAGS_NORM = -O4 #-DIF2 CFLAGS_DEBUG = -g -DDEBUG -DETSI CFLAGS = -Wall -I. $(CFLAGS_$(MODE)) -D$(VAD) @@ -78,14 +78,14 @@ # # default target: build standalone speech encoder and decoder # -default: clean_all encoder decoder +default: clean_all amrencoder amrdecoder -encoder: $(ENCODER_OBJS) - $(CC) -o encoder $(CFLAGS) $(ENCODER_OBJS) $(LDFLAGS) -lm +amrencoder: $(ENCODER_OBJS) + $(CC) -o $@ $(CFLAGS) $(ENCODER_OBJS) $(LDFLAGS) -lm -decoder: $(DECODER_OBJS) - $(CC) -o decoder $(CFLAGS) $(DECODER_OBJS) $(LDFLAGS) +amrdecoder: $(DECODER_OBJS) + $(CC) -o $@ $(CFLAGS) $(DECODER_OBJS) $(LDFLAGS) # # how to compile a .c file into a .o @@ -114,7 +114,7 @@ rm -f *.o core clean_all: clean - rm -f encoder decoder + rm -f amrencoder amrdecoder # DO NOT DELETE THIS LINE -- make depend depends on it. encoder.o: encoder.c typedef.h interf_enc.h sp_enc.h