Skip to content

Modified version of the ARM optimized version of SILK 1.0.8 that works with iOS/Xcode/Clang

Notifications You must be signed in to change notification settings

georgekola/silk-arm-ios

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SILK codec for ARM/iOS

This is a modified version of the SILK 1.0.8 codec with optimized ARM/NEON assembly. Compiling and running SILK turned out to be quite a hassle, so I decided to distribute the results of my work here. Note that this is really just a quick&dirty thing, I will not be able to provide any kind of support or help about this.

Patent notice

For more information regarding patents, see Skype's SILK website

How to use

The easiest way to use this code is to simply add all source files to the Xcode project. It should compile and run happily. It is also possible to create a static library file using the Makefile, but that's more of a hassle, and will probably not work out of the box.

What I did to get it to compile and run

Here are a couple of the things I found out in the process of trying to compile SILK:

http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00565.html For complaints about a missing __aeabi_idiv, it can be replaced with __divsi3. __aeabi_idiv comes from libgcc, and can't be used when using Clang.

For complaints about that arguments ought to be registries, that's a macro issue. Manually expanding those macros solves those errors.

The Makefile has to be edited rather heavily to work. The main things that have to be done are to replace $CC, $CXX, $AR and $RANLIB to be like this:

CC     = `xcrun -sdk ${IPHONE_SDK} -find clang`
[etc]

where

IPHONE_SDK = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk

I also added this:

CFLAGS += -arch armv7 -mthumb -isysroot ${IPHONE_SDK}
LDFLAGS += -arch armv7 -mthumb -isysroot ${IPHONE_SDK}
USE_NEON=yes

In addition to that, I had to short-circuit the if clause that looks like this:

ifneq (,$(TOOLCHAIN_PREFIX))

Otherwise the assembly files wouldn't get compiled.

There were also 4 byte align warnings from ld about the assembly-defined functions. At first, I ignored them, but then I got illegal instruction errors. These were fixed by adding a ".align 2" line before the ".globl" line.

Steps by George to build a fat binary with armv7 and armv7s support

  1. make clean
  2. make lib
  3. mkdir workdir
  4. cp libSKP_SILK_SDK.a workdir
  5. make clean
  6. (Manually comment/uncomment lines in the Makefile to build armv7s version)
  7. make lib
  8. cd workdir
  9. lipo ./libSKP_SILK_SDK.a ../libSKP_SILK_SDK.a -create -output test.a test.a now is a fat library

About

Modified version of the ARM optimized version of SILK 1.0.8 that works with iOS/Xcode/Clang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 78.0%
  • Assembly 11.4%
  • C++ 6.9%
  • Objective-C 2.0%
  • Shell 1.4%
  • Perl 0.3%