Skip to content

Bump to libavif 1.1.1#742

Merged
sezero merged 1 commit intolibsdl-org:mainfrom
madebr:bump-libavif-1.1.1
May 4, 2026
Merged

Bump to libavif 1.1.1#742
sezero merged 1 commit intolibsdl-org:mainfrom
madebr:bump-libavif-1.1.1

Conversation

@madebr
Copy link
Copy Markdown
Contributor

@madebr madebr commented May 3, 2026

Fixes #740

@madebr madebr force-pushed the bump-libavif-1.1.1 branch from 8d21192 to 64c136e Compare May 3, 2026 16:38
@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 3, 2026

Also bump aom to latest revision of v3.6.1-SDL

@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 3, 2026

P.S: Can you do the same for SDL2_image?

@madebr madebr force-pushed the bump-libavif-1.1.1 branch from 64c136e to a781546 Compare May 3, 2026 16:45
@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 3, 2026

P.S.: Does libavif properly find and use our vendored sharpyuv ?

@madebr madebr force-pushed the bump-libavif-1.1.1 branch 3 times, most recently from 150468a to d17cfa5 Compare May 3, 2026 20:04
@madebr
Copy link
Copy Markdown
Contributor Author

madebr commented May 3, 2026

P.S.: Does libavif properly find and use our vendored sharpyuv ?

It didn't at first, but now it does.

@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 3, 2026

I think this P/R (and its SDL2 counterpart) are ready for merge.

I generated x86 and x64 libavif dlls, run-tested under win11-x64.

One thing I noticed is the possible winpthreads dll dependency
in new libavif: If you think that it's no issue or can be handled later,
then feel free to merge both of the P/Rs: I'll update VisualStudio
and Xcode project files after that.

@madebr
Copy link
Copy Markdown
Contributor Author

madebr commented May 3, 2026

If you're talking about libsdl-org/libavif@3567afd, it's only added for non-Windows platforms.
Oh no, mingw too.
I think we can remove it?

@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 3, 2026

Oh no, mingw too.

Yup :)

I think we can remove it?

I guess so. I built my dlls w/o removing it, but my toolchains don't have winpthreads.

@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 3, 2026

I think we can remove it?

I guess so. I built my dlls w/o removing it, but my toolchains don't have winpthreads.

Maybe we can guard THREADS_PREFER_PTHREAD_FLAG with NOT MINGW ?

@madebr
Copy link
Copy Markdown
Contributor Author

madebr commented May 4, 2026

I think we can remove it?

I guess so. I built my dlls w/o removing it, but my toolchains don't have winpthreads.

Maybe we can guard THREADS_PREFER_PTHREAD_FLAG with NOT MINGW ?

I see this in src/format.c:

#if defined(_WIN32)
    tdata->thread = (HANDLE)_beginthreadex(/*security=*/NULL,
                                           /*stack_size=*/0,
                                           &avifImageYUVToRGBThreadWorker,
                                           tdata,
                                           /*initflag=*/0,
                                           /*thrdaddr=*/NULL);
    return tdata->thread != NULL;
#else
    // TODO: Set the thread name for ease of debugging.
    return pthread_create(&tdata->thread, NULL, &avifImageYUVToRGBThreadWorker, tdata) == 0;
#endif

On MSVC and MINGW, it uses _beginthreadex instead of pthreads. Perhaps pthreads is only needed on non-Windows?

@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 4, 2026

Perhaps pthreads is only needed on non-Windows?

Sounds like it

@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 4, 2026

Commenting out OR MINGW works for me (build tested not under SDL_image
but as stand-alone against system libraries.)

--- CMakeLists.txt~
+++ CMakeLists.txt
@@ -613,4 +613,4 @@
-if(UNIX OR MINGW)
+if(UNIX) # OR MINGW
     # Find out if we have threading available
     set(THREADS_PREFER_PTHREAD_FLAG ON)
     find_package(Threads)

@slouken
Copy link
Copy Markdown
Collaborator

slouken commented May 4, 2026

Commenting out OR MINGW works for me (build tested not under SDL_image but as stand-alone against system libraries.)

--- CMakeLists.txt~
+++ CMakeLists.txt
@@ -613,4 +613,4 @@
-if(UNIX OR MINGW)
+if(UNIX) # OR MINGW
     # Find out if we have threading available
     set(THREADS_PREFER_PTHREAD_FLAG ON)
     find_package(Threads)

Does it have an alternate Win32 threading implementation? Otherwise this will be a performance regression (assuming previous builds had threading)

@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 4, 2026

Does it have an alternate Win32 threading implementation?

Yes (see reformat.c)

Otherwise this will be a performance regression (assuming previous builds had threading)

Previous version was the same. It is some unfothpmable that that MINGW+pthread check
went into their cmake'ry.

@sezero sezero force-pushed the bump-libavif-1.1.1 branch from d17cfa5 to d9cfd8c Compare May 4, 2026 07:00
@sezero
Copy link
Copy Markdown
Contributor

sezero commented May 4, 2026

I updated libavif cmake'ry and also updated the Xcode project file along the way. (Did the same in SDL2 version.)

Will merge when the CI is all green.

@sezero sezero merged commit 9d85c35 into libsdl-org:main May 4, 2026
5 checks passed
@madebr madebr deleted the bump-libavif-1.1.1 branch May 4, 2026 10:07
@madebr
Copy link
Copy Markdown
Contributor Author

madebr commented May 4, 2026

Thanks sezero for taking care of this

@slouken
Copy link
Copy Markdown
Collaborator

slouken commented May 4, 2026

Does it have an alternate Win32 threading implementation?

Yes (see reformat.c)

Otherwise this will be a performance regression (assuming previous builds had threading)

Previous version was the same. It is some unfothpmable that that MINGW+pthread check went into their cmake'ry.

Got it, thanks for clarifying.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

upgrading libavif to v1.1.1:

3 participants