ref: 730fd809ed594663b6b9f45d4f4f30ab6fe47812
parent: 7f1ce1d60d0d354ef465105828637be8fc921ae9
author: thebard <thebard>
date: Mon Feb 21 22:55:59 EST 2000
Makefile changes for default compile and nots on options, Also added an include so that faac.c links.
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,9 @@
+# Recomended compile options for gcc with a PentII or better for maximum speed
+# are: -O6 -fomit-frame-pointer -march=i686 -funroll-loops -finline-functions
+# Note: for fastest compilation, -funroll-loops -finline-function
+# -fomit-frame-pointer and the highest -O that is safe with your compiler
+# is STRONGLY recommended!
+
prefix = /usr/local
DESTDIR =
@@ -8,7 +14,9 @@
CC=gcc
-CC_OPTS=-DHAS_ULONG -O3 -funroll-loops -finline-functions
+#PROFILE_OPTS = -pg -a
+
+CC_OPTS=-DHAS_ULONG $(CFLAGS) $(PROFILE_OPTS)
LD_OPTS=
TARGETS=faac
@@ -16,7 +24,7 @@
all: $(TARGETS)
faac: $(OBJ) Makefile
- $(CC) $(LD_OPTS) -o faac $(OBJ) -lsndfile -lm
+ $(CC) $(LD_OPTS) -o faac $(OBJ) -lsndfile -lm $(PROFILE_OPTS)
%.o: %.c
$(CC) $(CC_OPTS) -c $< -o $@
--- a/faac.c
+++ b/faac.c
@@ -7,6 +7,7 @@
#endif
#include "aacenc.h"
+#include "bitstream.h"
#ifdef FAAC_DLL
@@ -241,16 +242,18 @@
int main(int argc, char *argv[])
{
- int i, frames, currentFrame, result, FileCount;
- char *InFileNames[100];
- char *OutFileNames[100];
-
+ int i, frames, currentFrame, result, FileCount;
+ char *InFileNames[100], *OutFileNames[100];
faacAACStream *as;
- /* timing vars */
- long begin, end;
- int nTotSecs, nSecs;
- int nMins;
+ /* System dependant types */
+#ifdef WIN32
+ long begin, end;
+ int nTotSecs, nSecs;
+ int nMins;
+#else
+ float totalSecs;
+#endif
/* create main aacstream object */
as =(faacAACStream *) malloc(sizeof(faacAACStream));
@@ -269,9 +272,8 @@
printf("0%\tBusy encoding %s.\r", InFileNames[i]);
#ifdef WIN32
begin = GetTickCount();
-#else
- begin = clock();
#endif
+
/* Init encoder core and retrieve number of frames */
if ((frames=faac_EncodeInit(as, InFileNames[i], OutFileNames[i])) < 0) {
printf("Error %d while encoding %s.\n",-frames,InFileNames[i]);
@@ -295,13 +297,15 @@
faac_EncodeFree(as);
#ifdef WIN32
end = GetTickCount();
-#else
- end = clock();
-#endif
nTotSecs = (end-begin)/1000;
nMins = nTotSecs / 60;
nSecs = nTotSecs - (60*nMins);
printf("Encoding %s took:\t%d:%.2d\t\n", InFileNames[i], nMins, nSecs);
+#else
+ totalSecs = (float)(clock())/(float)CLOCKS_PER_SEC;
+ printf("Encoding %s took:\t%d:%.2d\t\n", InFileNames[i],
+ totalSecs/(float)60, totalSecs - ((float)60 * (totalSecs/(float)60)));
+#endif
if(InFileNames[i]) free(InFileNames[i]);
if(OutFileNames[i]) free(OutFileNames[i]);
}
@@ -311,4 +315,4 @@
#endif // end of not dll
-
\ No newline at end of file
+