Skip to content

Bump to libavif 1.1.1#742

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

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

Conversation

@madebr

@madebr madebr commented May 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #740

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

sezero commented May 3, 2026

Copy link
Copy Markdown
Contributor

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

@sezero

sezero commented May 3, 2026

Copy link
Copy Markdown
Contributor

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

sezero commented May 3, 2026

Copy link
Copy Markdown
Contributor

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

madebr commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

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

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

@sezero

sezero commented May 3, 2026

Copy link
Copy Markdown
Contributor

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

madebr commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

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

sezero commented May 3, 2026

Copy link
Copy Markdown
Contributor

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

sezero commented May 3, 2026

Copy link
Copy Markdown
Contributor

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

madebr commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

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

sezero commented May 4, 2026

Copy link
Copy Markdown
Contributor

Perhaps pthreads is only needed on non-Windows?

Sounds like it

@sezero

sezero commented May 4, 2026

Copy link
Copy Markdown
Contributor

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

slouken commented May 4, 2026

Copy link
Copy Markdown
Collaborator

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

sezero commented May 4, 2026

Copy link
Copy Markdown
Contributor

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

sezero commented May 4, 2026

Copy link
Copy Markdown
Contributor

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

madebr commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks sezero for taking care of this

@slouken

slouken commented May 4, 2026

Copy link
Copy Markdown
Collaborator

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