shithub: opus

Download patch

ref: 445d5f485333db9fe55599201386491464d5a781
parent: 080620047cb68a2adebf5b68b74ecb8ec2bfa3a7
author: Jean-Marc Valin <[email protected]>
date: Wed Mar 9 09:15:32 EST 2011

Draft Makefile update

--- a/Makefile.draft
+++ b/Makefile.draft
@@ -1,5 +1,20 @@
-FIXED_POINT=1
+#################### COMPILE OPTIONS #######################
 
+#Uncomment this for fixed-point build
+#FIXED_POINT=1
+
+#If you have a C99 compiler, you don't need this
+CFLAGS += -Drestrict= 
+
+#It is strongly recommended to uncomment one of these
+#VAR_ARRAYS: Use C99 variable-length arrays for stack allocation
+#USE_ALLOCA: Use alloca() for stack allocation
+#If none is defined, then the fallback is a non-threadsafe global array
+#CFLAGS += -DUSE_ALLOCA
+#CFLAGS += -DVAR_ARRAYS
+
+###################### END OF OPTIONS ######################
+
 include silk_sources.mk
 include celt_sources.mk
 include opus_sources.mk
@@ -21,9 +36,9 @@
 ldlibs-from-libs                = $(addprefix -l,$(1))
 
 WARNINGS = -Wall -W -Wstrict-prototypes -Wextra -Wcast-align -Wnested-externs -Wshadow -Wno-parentheses -Wno-unused-parameter -Wno-sign-compare
-CFLAGS  += -O2 -g $(WARNINGS) -DOPUS_BUILD -Drestrict=
+CFLAGS  += -O2 -g $(WARNINGS) -DOPUS_BUILD
 ifdef FIXED_POINT
-CFLAGS += -DFIXED_POINT=1
+CFLAGS += -DFIXED_POINT=1 -DDISABLE_FLOAT_API
 endif
 
 CFLAGS  += $(call cppflags-from-defines,$(CDEFINES))
--- /dev/null
+++ b/README.draft
@@ -1,0 +1,43 @@
+To build this source code, simply type:
+
+% make
+
+If this does not work, or to change the default configuration (e.g. compile for
+a fixed-point architecture), simply edit the options in the Makefile
+
+To build from the git repository instead of using this draft, the following 
+steps are necessary
+
+1) Clone the repository:
+
+% git clone git://git.xiph.org/users/jm/ietfcodec.git
+% cd ietfcodec
+
+2) Get the celt and silk submodules:
+
+% git submodule update --init
+
+3) Compile
+
+% ./autogen.sh
+% ./configure --disable-shared
+% make
+
+
+Once you have compiled the codec, there will be a test_opus executable in
+the src/ directory. This can be in the following way:
+
+% ./test_opus <mode (0/1/2)> <sampling rate (Hz)> <channels> <bits per second>  [options] <input> <output>
+
+mode: 0 for audo, 1 for voice, 2 for audio:
+options:
+-cbr                 : enable constant bitrate; default: VBR
+-bandwidth <NB|MB|WB|SWB|FB>  : audio bandwidth (from narrowband to fullband); default: sampling rate
+-framesize <2.5|5|10|20|40|60>  : frame size in ms; default: 20 
+-max_payload <bytes> : maximum payload size in bytes, default: 1024
+-complexity <comp>   : complexity, 0 (lowest) ... 10 (highest); default: 10
+-inbandfec           : enable SILK inband FEC
+-dtx                 : enable SILK DTX
+-loss <perc>         : simulate packet loss, in percent (0-100); default: 0
+
+input and output are 16-bit PCM files (machine endian)
--- a/doc/build_draft.sh
+++ b/doc/build_draft.sh
@@ -3,7 +3,6 @@
 echo packaging source code
 rm -rf opus_source
 cat opus_sources.mk celt_sources.mk silk_sources.mk opus_headers.txt celt_headers.txt silk_headers.txt | grep '\.[ch]' | sed -e 's/^.*=//' -e 's/\\//' > all_files.txt
-cat opus_extra.txt >> all_files.txt
 tar czf tmp_draft.tar.gz `cat all_files.txt`
 
 mkdir opus_source
@@ -13,6 +12,8 @@
 cp ../opus_sources.mk .
 cp ../celt_sources.mk .
 cp ../silk_sources.mk .
+cp ../README.draft README
+cp ../COPYING COPYING
 
 cd ..
 tar czf opus_source.tar.gz opus_source
--- a/opus_extra.txt
+++ /dev/null
@@ -1,2 +1,0 @@
-README
-COPYING