fraunhoferhhi / vvdec

VVdeC, the Fraunhofer Versatile Video Decoder
https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html
BSD 3-Clause Clear License
453 stars 91 forks source link

Need to be able to control the level of SIMD through cmake options #9

Closed yurivict closed 3 years ago

yurivict commented 3 years ago

When the package is built it should be built for the lowest common SIMD level supported everywhere, even though the build server might support a higher level. Individual users might want to build individually for their own hardware.

The project should have configuration options to choose the level of SIMD.

Ideally, there should be boolean options:

Otherwise the package built on a server with high SIMD level would crash on an older CPU with lower SIMD support.

1480c1 commented 3 years ago

I think it would also be good to have a dispatcher so that a higher simd level does not get called on systems without it, so it would be okay to copy a binary between two different machines

adamjw24 commented 3 years ago

The decoder detects the highest available SIMD extension it can use during runtime. So differences between build and runtime machines should not be a problem.

Did you have a specific problem with that? Could you specify more detail about the exact used build/runtime computers?

For testing purposes, it is still possible to restrict SIMD in the code by setting cVVDecParameter.m_eSIMD_Extension in vvdecapp.cpp (there is not cmd parameter because this is not your everyday usecase).

yurivict commented 3 years ago
  1. Here https://github.com/fraunhoferhhi/vvdec/blob/master/source/Lib/vvdec/CMakeLists.txt#L72 SSE-4.1/SSE-4.2 are enabled which aren't generally available.

  2. Build on powerpc64 failed because of unconditional SSE options. Normally SIMD options should be used only on architectures where they are supported, and generic code should be used elsewhere.

adamjw24 commented 3 years ago

As it says in the README.md, VVdeC is a x86 VVC decoder. So if you are compiling on a powerpc64, you should use a cross-compiler with x86 target architecture, in which case the compiler should support the options.

But I guess, since the codebase actually supports it, we might adapt the build process appropriately. This will never be non-experimental and properly tested, though, and low-priority for now.