Skip to main content

Topic: opus compile with optimization (Read 738 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • madmax
  • [*]
opus compile with optimization
hi,

how to enable the optimization in opus? is it even possible for a windows compile?
i get always

Quote
Inline Assembly Optimizations: . No inline ASM for your platform, please send patches
after "./configure"

/Edit: ok, this seems to be normal, so it is solved. this could be moved to trash.
  • Last Edit: 23 October, 2017, 04:05:22 PM by madmax

  • kode54
  • [*][*][*][*][*]
  • Administrator
Re: opus compile with optimization
Reply #1
Yeah, just to clarify, the inline assembly optimizations are only for platforms where it's really needed to improve the speed a significant portion. Namely, ARM. Intel x86 32 and 64 bit are already significantly fast enough to use compiled C code, but someone is welcome to contribute assembly optimizations, if they think it's really necessary to beat a minimum of 30x* realtime (or 1/30th utilization for a single stream in real time) encoding speed, depending on the processor.

* Certified figure pulled out at random, no bearing on reality. Just a silly guess. But it can't be too far off the mark. I just know it encodes really fast on my powerful desktop machines, using a single core.

  • Case
  • [*][*][*][*][*]
  • Developer (Donating)
Re: opus compile with optimization
Reply #2
With GCC compiler you need to use ./configure --enable-intrinsics for opuslib and --enable-sse for opustools. Without these settings you lose 20% encoding speed and 50% decoding speed. Note that the --enable-sse flag means the compiled binaries don't work on old CPUs that lack those instructions.

  • madmax
  • [*]
Re: opus compile with optimization
Reply #3
under MinGW everything seems to be activated (runtime detection) by a simple ./configure
 (runtime detection)

Quote
checking if compiler supports SSE intrinsics... no
checking if compiler supports SSE intrinsics with -msse... yes
checking if compiler supports SSE2 intrinsics... no
checking if compiler supports SSE2 intrinsics with -msse2... yes
checking if compiler supports SSE4.1 intrinsics... no
checking if compiler supports SSE4.1 intrinsics with -msse4.1... yes
checking if compiler supports AVX intrinsics... no
checking if compiler supports AVX intrinsics with -mavx... yes


Quote
      Intrinsics Optimizations.......: x86 SSE SSE2 SSE4.1 AVX
      Run-time CPU detection: ........ x86 SSE SSE2 SSE4.1 AVX

i had to disable SSE4.1 and AVX manually.

  • kode54
  • [*][*][*][*][*]
  • Administrator
Re: opus compile with optimization
Reply #4
You may note that it only uses things which the current processor supports at run-time, for all of the displayed instruction sets. It won't use anything it can't detect, unless you turn off run-time detection, in which case it will use the best that you tell it to target at build time.