libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.53k stars 1.77k forks source link

Two testffmpeg requests with fixes included: Add final Vulkan AV1 ext and VVC support.. #9464

Closed oscarbg closed 5 months ago

oscarbg commented 5 months ago

Hi, both supported in FFMPEG 7.0..

first one replacing in testffmpeg_vulkan:

   "VK_MESA_video_decode_av1"

with: VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME present in latest Vulkan SDK..

second one adding :

    if (codecpar->codec_id == AV_CODEC_ID_VVC)
        context->strict_std_compliance = -2;

just before:

result = avcodec_open2(context, codec, NULL);

thanks..

oscarbg commented 5 months ago

I added threaded decode to vvc as it's slow:

if (codecpar->codec_id == AV_CODEC_ID_VVC)
{
    context->strict_std_compliance = -2;

    //#include <thread>
    //const auto processor_count = std::thread::hardware_concurrency();

    //context->thread_count = 16;

    #ifdef _WIN32
    SYSTEM_INFO sysinfo;
    GetSystemInfo(&sysinfo);
    int numCPU = sysinfo.dwNumberOfProcessors;
    context->thread_count = numCPU;
    #else
    context->thread_count =sysconf(_SC_NPROCESSORS_ONLN);
    #endif
    printf("using %d threads for VVC decode\n",context->thread_count);
    context->thread_type = FF_THREAD_FRAME |FF_THREAD_SLICE;
}
slouken commented 5 months ago

Here you go!

oscarbg commented 5 months ago

Thanks!

slouken commented 5 months ago

You're welcome!