Skip to content

High distortion with SVT-AV1 in CI Windows #3255

Closed

Description

@y-guyon

tests/gtest/avifcodectest.cc fails at head. It was passing 3 days ago.

Expected: (testutil::GetPsnr(*image, *decoded)) > (32.0), actual: 12 vs 32
[ RUN      ] All/CodecTest.EncodeDecode/6
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]:	SVT-AV1 Encoder Lib v3.1.2
Svt[info]: SVT [build]  :	Visual Studio 2022 64 bit
Svt[info]: -------------------------------------------
Svt[info]: Level of Parallelism: 1
Svt[info]: Number of PPCS 74
Svt[info]: [asm level on system : up to avx2]
Svt[info]: [asm level selected : up to avx2]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile	tier (auto)	level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator 		: 64 / 64 / 60000 / 1000
Svt[info]: SVT [config]: bit-depth / color format 					: 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct 					: 8 / PSNR / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type 			: 321 / 32 / key frame
Svt[info]: SVT [config]: BRC mode / rate factor 					: CRF / 6 
Svt[info]: SVT [config]: AQ mode / Variance Boost 					: 2 / 0
Svt[info]: SVT [config]: sharpness / luminance-based QP bias 				: 0 / 0
Svt[info]: -------------------------------------------
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]:	SVT-AV1 Encoder Lib v3.1.2
Svt[info]: SVT [build]  :	Visual Studio 2022 64 bit
Svt[info]: -------------------------------------------
Svt[info]: Level of Parallelism: 1
Svt[info]: Number of PPCS 74
Svt[info]: [asm level on system : up to avx2]
Svt[info]: [asm level selected : up to avx2]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile	tier (auto)	level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator 		: 64 / 64 / 60000 / 1000
Svt[info]: SVT [config]: bit-depth / color format 					: 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct 					: 8 / PSNR / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type 			: 321 / 32 / key frame
Svt[info]: SVT [config]: BRC mode / rate factor 					: CRF / 6 
Svt[info]: SVT [config]: AQ mode / Variance Boost 					: 2 / 0
Svt[info]: SVT [config]: sharpness / luminance-based QP bias 				: 0 / 0
Svt[info]: -------------------------------------------
Svt[info]: Only a single picture was passed in. Consider setting avif=1 for improved efficiency and reduced memory usage.
Svt[info]: Only a single picture was passed in. Consider setting avif=1 for improved efficiency and reduced memory usage.
D:\a\libavif\libavif\tests\gtest\avifcodectest.cc(48): error: Expected: (testutil::GetPsnr(*image, *decoded)) > (32.0), actual: 12.445797037453715 vs 32

[  FAILED  ] All/CodecTest.EncodeDecode/6, where GetParam() = (5, 1) (63 ms)

(log)

Activity

  1. y-guyon commented on Jun 15, 2026

    @y-guyon
    ContributorAuthor

    #2974 does not provide any hint on what changed from SVT-AV1 v3.1.2 to v4.0.0 with regard to libavif.

  2. y-guyon commented on Jun 15, 2026

    @y-guyon
    ContributorAuthor

    I do not think it is tied to the version of SVT-AV1. In #3254 the CI fails even with SVT-AV1 v4.1.0:

    error: Expected: (testutil::GetPsnr(*image, *decoded)) > (20.0), actual: 12 vs 20
    [ RUN      ] All/SvtAv1Test.EncodeDecodeStillImage/1
    Svt[info]: -------------------------------------------
    Svt[info]: SVT [version]:	SVT-AV1 Encoder Lib v4.1.0
    Svt[info]: SVT [build]  :	Visual Studio 2022 64 bit
    Svt[info]: LIB Build date: Jun 15 2026 08:49:11
    Svt[info]: -------------------------------------------
    Svt[warn]: Screen-content detection is disabled for all-intra coding; forcing NSC path
    Svt[warn]: TPL is disabled for all-intra coding
    Svt[info]: Level of Parallelism: 1
    Svt[info]: Number of PPCS 4
    Svt[info]: [asm level on system : up to avx2]
    Svt[info]: [asm level selected : up to avx2]
    Svt[info]: -------------------------------------------
    Svt[info]: SVT [config]: main profile	tier (auto)	level (auto)
    Svt[info]: SVT [config]: width / height / fps numerator / fps denominator 		: 64 / 64 / 60000 / 1000
    Svt[info]: SVT [config]: bit-depth / color format 					: 8 / YUV420
    Svt[info]: SVT [config]: preset / tune / pred struct 					: 8 / PSNR / all intra
    Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type 			: 1 / 4 / key frame
    Svt[info]: SVT [config]: BRC mode / CQP Assignment 					: CQP / 63.00 
    Svt[info]: SVT [config]: AQ mode / Variance Boost 					: 2 / 0
    Svt[info]: SVT [config]: sharpness / luminance-based QP bias 				: 0 / 0
    Svt[info]: SVT [config]: QP scale compress strength 					: 0
    Svt[info]: -------------------------------------------
    D:\a\libavif\libavif\tests\gtest\avifsvttest.cc(63): error: Expected: (testutil::GetPsnr(*image, *decoded)) > (20.0), actual: 12.637999545951971 vs 20
    
    [  FAILED  ] All/SvtAv1Test.EncodeDecodeStillImage/1, where GetParam() = (0) (7 ms)
    

    (log)

    However it only fails with avifsvttest. avifcodectest passes, surprisingly.

  3. changed the title [-]High distortion with SVT-AV1 3.1.2 in CI Windows Installed[/-] [+]High distortion with SVT-AV1 in CI Windows Installed[/+] on Jun 15, 2026
  4. changed the title [-]High distortion with SVT-AV1 in CI Windows Installed[/-] [+]High distortion with SVT-AV1 in CI Windows[/+] on Jun 15, 2026
  5. y-guyon commented on Jun 15, 2026

    @y-guyon
    ContributorAuthor
    [ RUN      ] All/CodecTest.EncodeDecode/0
    Svt[info]: SVT [version]:	SVT-AV1 Encoder Lib v3.1.2
    Svt[info]: SVT [build]  :	Visual Studio 2022 64 bit
    [...]
    D:\a\libavif\libavif\tests\gtest\avifcodectest.cc(52):
      error: Expected: (testutil::GetPsnr(*image, *decoded)) > (32.0), actual: 12.445797037453715 vs 32
    [  FAILED  ] All/CodecTest.EncodeDecode/0, where GetParam() = (5, 1) (69 ms)
    
    Original Expected decoded Actual encoded Actual decoded
    Image Image Image Image
  6. y-guyon commented on Jun 15, 2026

    @y-guyon
    ContributorAuthor

    -DAVIF_FUZZTEST=LOCAL does not work in ci-windows.yml ("Compiler MSVC is not supported").

  7. y-guyon commented on Jun 15, 2026

    @y-guyon
    ContributorAuthor

    https://gitlab.com/AOMediaCodec/SVT-AV1/-/work_items/2322 seems quite relevant.

    However the newly failing workflow "CI Windows Installed" relies on vcpkg svt-av1 being 3.1.2 built with Visual Studio 2022 according to the runtime Svt[info]: SVT [build] log.
    The other newly failing workflow "CI Windows" builds SVT-AV1 4.1.0 from source with Visual Studio 2022 according to the runtime Svt[info]: SVT [build] log.
    What surprises me is that I just merged #3254 because it was complaining about the missing "Visual Studio 17 2022" generator, so I am doubtful that Visual Studio 2022 was used to build SVT-AV1. Or is that the SDK's version or something?

    The CMake step says -- Building for: Visual Studio 18 2026 -- The C compiler identification is MSVC 19.51.36246.0.

  8. dimitry-unified-streaming commented on Jun 15, 2026

    @dimitry-unified-streaming

    As far as I could determine in https://gitlab.com/AOMediaCodec/SVT-AV1/-/work_items/2322, compiler versions >= 19.50 (those are confusingly called "MSVC Build Tools v14.50 for x64/x86" and higher in the Visual Studio Installer) expose a problem with inlining a few AVX2 intrinsics.

    If you are using Visual Studio 2026, you can install an older version of the compiler by selecting "MSVC v143 - VS 2022 C++ x64/x86 build tools (v14.44-17.14)", and activate it via vcvarsall.bat, to use it instead. The problem should then go away.

    Alternatively, you could try the diff I have put in https://gitlab.com/AOMediaCodec/SVT-AV1/-/work_items/2322#note_3455144085. But some more investigation is needed to narrow down a test case to report to Microsoft.

  9. kmilos commented on Jun 16, 2026

    @kmilos
    Contributor

    What surprises me is that I just merged #3254 because it was complaining about the missing "Visual Studio 17 2022" generator, so I am doubtful that Visual Studio 2022 was used to build SVT-AV1.

    FYI, the GHA runners started transitioning from VS 2022 to VS 2026 by default during this week, so some builds might have very well used VS 2022, and some VS 2026... Don't know about GitLab runners...

  10. wantehchang commented on Jun 16, 2026

    @wantehchang
    Member

    In both SVT-AV1 v3.1.2 and SVT-AV1 v4.1.0, the Visual Studio version detection is limited to Visual Studio 2022 or older:

    Source/Lib/Globals/enc_handle.c:

    EB_API void svt_av1_print_version(void) {
        SVT_INFO("-------------------------------------------\n");
        SVT_INFO("SVT [version]:\tSVT-AV1 Encoder Lib %s\n", SVT_AV1_CVS_VERSION);
        const char* compiler =
    #if defined(__clang__)
            __VERSION__ "\t"
    #elif defined(__GNUC__)
            "GCC " __VERSION__ "\t"
    #elif defined(_MSC_VER) && (_MSC_VER >= 1930)
            "Visual Studio 2022"
    #elif defined(_MSC_VER) && (_MSC_VER >= 1920)
            "Visual Studio 2019"
    #elif defined(_MSC_VER) && (_MSC_VER >= 1910)
            "Visual Studio 2017"
    #elif defined(_MSC_VER) && (_MSC_VER >= 1900)
            "Visual Studio 2015"
    #elif defined(_MSC_VER)
            "Visual Studio (old)"
    #else
            "unknown compiler"
    #endif
            ;
        SVT_INFO("SVT [build]  :\t%s %zu bit\n", compiler, sizeof(void*) * 8);
    ...
    
    Therefore the line
    
    

    Svt[info]: SVT [build] : Visual Studio 2022 64 bit

    
    in the test output should be interpreted as Visual Studio 2022 or newer.
    
  11. added a commit that references this issue on Jun 17, 2026
  12. dimitry-unified-streaming commented on Jul 28, 2026

    @dimitry-unified-streaming
  13. wantehchang commented on Jul 28, 2026

    @wantehchang
    Member

    Dimitry: Thank you for the update. We forgot to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions