From 2f145378ef38ffb41002bac848b22215adc6cc4e Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 11 Mar 2026 08:02:10 +0100 Subject: [PATCH] vcomp/lavc: prefer libvpx-vp9 for VP9 It doesn't seem that libsvt_vp9 is better even for AVX2+ processors. From testing with i9-9820X and 9950X with `testcard2:noise:fps=200` we got 60 FPS for SVT and 72 for VPX in case of Intel and 153 and 128 for AMD. In the SVT case, the frame was significatly (250 framees) delaysed with default setting. Also, while libsvt_vp9 supports just yuv420p, libvpx-vp9 offers up to 12 bit 4:4:4 subsampled both YUV and RGB pixel formats. For the record, there has been a [patch](https://github.com/OpenVisualCloud/SVT-VP9/pull/67) for libsvt_vp9 to support pre-AVX2, but it doesn't seem to make much sense to use. --- src/video_compress/libavcodec.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index fab19a5a2..9882d6b97 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -198,13 +198,6 @@ static void print_codec_supp_pix_fmts(const enum AVPixelFormat *codec_pix_fmts); void usage(bool full); static void cleanup(struct state_video_compress_libav *s); -const char *get_vp9_encoder(bool /* rgb */) { -#ifdef __x86_64__ - return __builtin_cpu_supports("avx2") ? nullptr : "libvpx-vp9"; -#else - return nullptr; -#endif -} codec_params_t get_codec_params(codec_t ug_codec) { @@ -229,7 +222,8 @@ get_codec_params(codec_t ug_codec) case VP8: return { nullptr, 0.4, setparam_vp8_vp9, 103 }; case VP9: - return { get_vp9_encoder, 0.4, setparam_vp8_vp9, 104 }; + return { [](bool) { return "libvpx-vp9"; }, 0.4, + setparam_vp8_vp9, 104 }; case AV1: return { [](bool) { return is_arm_mac() ? "libaom-av1" : "libsvtav1"; }, 0.1,