[opus] [RFC PATCH v2] Encode optimize using libNe10

Timothy B. Terriberry tterribe at xiph.org
Wed Feb 25 17:54:34 PST 2015


Viswanath Puttagunta wrote:
> Can we please have review on RFCv2? We have quite a few optimizations
> (Eg: ifft/mdct_backwards, fixed point fft/ifft mdct_forward/backward
> etc) that are in my pipeline that depend on this patch series being
> accepted.

So, trying to make progress on this...

On an armv7l board running Ubuntu, you've broken the build with just 
--enable-intrinsics (without the NE10 options):

   CC       celt/tests/test_unit_dft.o
In file included from ../celt/tests/test_unit_dft.c:47:0:
../celt/kiss_fft.c: In function 'opus_fft_free':
../celt/kiss_fft.c:507:51: warning: unused parameter 'arch' 
[-Wunused-parameter]
  void opus_fft_free(const kiss_fft_state *cfg, int arch)
                                                    ^
   CCLD     celt/tests/test_unit_dft
celt/tests/test_unit_dft.o: In function `_celt_autocorr':
/home/tterribe/src/xiph/git/xiph/opus/build/../celt/celt_lpc.c:285: 
undefined reference to `CELT_PITCH_XCORR_IMPL'
/home/tterribe/src/xiph/git/xiph/opus/build/../celt/celt_lpc.c:285: 
undefined reference to `CELT_PITCH_XCORR_IMPL'
celt/tests/test_unit_dft.o: In function `pitch_search':
/home/tterribe/src/xiph/git/xiph/opus/build/../celt/pitch.c:358: 
undefined reference to `CELT_PITCH_XCORR_IMPL'
/home/tterribe/src/xiph/git/xiph/opus/build/../celt/pitch.c:358: 
undefined reference to `CELT_PITCH_XCORR_IMPL'
collect2: error: ld returned 1 exit status


The configure test fails with the NE10 options, because the test program 
is not being linked against $LIBM:

configure:13471: gcc -std=gnu99 -o conftest 
-I/home/tterribe/src/xiph/git/arm/Ne10/inc   conftest.c 
-L/home/tterribe/src/xiph/git/arm/Ne10/build/modules -lNE10 >&5
/home/tterribe/src/xiph/git/arm/Ne10/build/modules/libNE10.a(NE10_fft.c.o): 
In function `ne10_fft_generate_twiddles_line_int32':
NE10_fft.c:(.text+0x6e): undefined reference to `sincos'
NE10_fft.c:(.text+0x82): undefined reference to `floor'
NE10_fft.c:(.text+0x96): undefined reference to `floor'
/home/tterribe/src/xiph/git/arm/Ne10/build/modules/libNE10.a(NE10_fft.c.o): 
In function `ne10_fft_generate_twiddles_line_float32':
NE10_fft.c:(.text+0x138): undefined reference to `sincos'
collect2: error: ld returned 1 exit status


Forcing it to be enabled, linking against libNE10 fails:

   CCLD     libopus.la
/usr/bin/ld: 
/home/tterribe/src/xiph/git/arm/Ne10/build/modules/libNE10.a(NE10_fft_generic_float32.neonintrinsic.cpp.o): 
relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be 
used when making a shared object; recompile with -fPIC
/home/tterribe/src/xiph/git/arm/Ne10/build/modules/libNE10.a: error 
adding symbols: Bad value
collect2: error: ld returned 1 exit status


Then attempting to build libNE10 with -DNE10_BUILD_SHARED fails:

/usr/bin/ld: CMakeFiles/NE10_shared.dir/imgproc/NE10_boxfilter.c.o: 
relocation R_ARM_THM_MOVW_ABS_NC against `stderr' can not be used when 
making a shared object; recompile with -fPIC
CMakeFiles/NE10_shared.dir/imgproc/NE10_boxfilter.c.o: error adding 
symbols: Bad value
collect2: error: ld returned 1 exit status


The instructions for building libNE10 in doc/BuildingNe10.txt are also 
incorrect. I don't know if -DGNULINUX_PLATFORM=ON does anything, but I 
needed to specify -DNE10_LINUX_TARGET_ARCH=armv7 to avoid cmake failing 
with a 'syntax error' at line 83.


In short, this needs some work.


More information about the opus mailing list