fraunhoferhhi / vvenc

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

Update AVX512 intrinsics for MSVC compatibility #353

Closed zyrill closed 4 months ago

zyrill commented 4 months ago

Hey guys, thanks for the great work on VVenC. I've just downloaded and compiled the latest commit and noticed the warning the build throws with the current MSVC version. I investigated where the problems are coming from and found this thread on the visual studio forum.

Specifically, please check the following post by Victor Tong: Post.

Seems the incompatibility stems from inconsistent AVX optimizations. The fix they propose seems not too difficult to implement. Maybe the code could be fixed as per the forum it is unlikely any future MSVC version will roll back this behaviour.

adamjw24 commented 4 months ago

Dear zyrill. You can override the build problem as described in the Wiki using either the VVENC_OVERRIDE_COMPILER_CHECK CMake variable or override-compiler-check=1 makefile flag. Our problem is not related to the one you found, since we do not use AVX512 intrinsics. Either way, if we were, I would expect the compiler to throw an error and not start optimizing the whole file for AVX512, if appropriate compiler flags are not used.

zyrill commented 4 months ago

Dear adamjw24. Thanks for the prompt reply and the help and explanation provided. You wrote the problems aren't related - which sounds like it's known where the issues with current MSVC versions are coming from. I'm curious, and if you had the leisure to explain, I'd be interested. Fully buy into your position btw. that compilers should show conservative behavior.

adamjw24 commented 4 months ago

Please check: https://developercommunity.visualstudio.com/t/Invalid-AVX512-instructions-generated-wh/10521872