diff --git a/build-libopus.sh b/build-libopus.sh index dcdc910..ab0828e 100644 --- a/build-libopus.sh +++ b/build-libopus.sh @@ -22,8 +22,8 @@ ########################################################################### # Choose your libopus version and your currently-installed iOS SDK version: # -VERSION="1.1.2" -SDKVERSION="9.2" +VERSION="1.1.3" +SDKVERSION="9.3" MINIOSVERSION="8.0" ########################################################################### @@ -86,6 +86,11 @@ echo "Using opus-${VERSION}.tar.gz" tar zxf opus-${VERSION}.tar.gz -C $SRCDIR cd "${SRCDIR}/opus-${VERSION}" +if [ -e "${REPOROOT}/decode_core.patch-${VERSION}" ]; then + echo "Patching decode_core.patch-${VERSION}" + patch silk/decode_core.c < ${REPOROOT}/decode_core.patch-${VERSION} +fi + set +e # don't bail out of bash script if ccache doesn't exist CCACHE=`which ccache` if [ $? == "0" ]; then diff --git a/decode_core.patch-1.1.3 b/decode_core.patch-1.1.3 new file mode 100644 index 0000000..ccabbc9 --- /dev/null +++ b/decode_core.patch-1.1.3 @@ -0,0 +1,10 @@ +--- decode_core copy.c 2016-09-05 16:08:12.000000000 +0800 ++++ decode_core.c 2016-09-05 16:06:45.000000000 +0800 +@@ -172,6 +172,7 @@ + if( signalType == TYPE_VOICED ) { + /* Set up pointer */ + pred_lag_ptr = &sLTP_Q15[ sLTP_buf_idx - lag + LTP_ORDER / 2 ]; ++ #pragma clang loop vectorize(disable) interleave(disable) + for( i = 0; i < psDec->subfr_length; i++ ) { + /* Unrolled loop */ + /* Avoids introducing a bias because silk_SMLAWB() always rounds to -inf */ diff --git a/pack-framework b/pack-framework new file mode 100644 index 0000000..5d11a0c --- /dev/null +++ b/pack-framework @@ -0,0 +1,25 @@ +#!/bin/bash + +FWNAME=opus + +if [ ! -d dependencies ]; then + echo "Please run build-libopus.sh first!" + exit 1 +fi + +if [ -d $FWNAME.framework ]; then + echo "Removing previous $FWNAME.framework copy" + rm -rf $FWNAME.framework +fi + +if [ "$1" == "dynamic" ]; then + LIBTOOL_FLAGS="-dynamic -undefined dynamic_lookup" +else + LIBTOOL_FLAGS="-static" +fi + +echo "Creating $FWNAME.framework" +mkdir -p $FWNAME.framework/Headers +libtool -no_warning_for_no_symbols $LIBTOOL_FLAGS -o $FWNAME.framework/$FWNAME dependencies/lib/libopus.a +cp -r dependencies/include/* $FWNAME.framework/Headers/ +echo "Created $FWNAME.framework"