-
-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Update libtheora to GIT (2020.10) #66516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
It seems that some builds break due to It seems some tasks don't have env |
|
I tried to build this on Linux (with tools) and it worked just fine, any hints on what's happening with checks? I'm sure it's something to do with the buildsystem. |
The file it's looking for does not exist. Here is the folder: https://github.com/DeeJayLSP/godot/tree/update_theora/thirdparty/libtheora/x86 Note that it does exist in the "x86_vc" folder, but it's missing from the "x86" folder. |
|
Weird, it does exist on the folder I'm pushing. Will try to figure out how to force it. |
|
This is being caused by .gitignore, which has a Squashing commits as soon as macOS check passes. This can be cherry picked to 3.x if approved. |
fa61db0 to
7977d98
Compare
|
I see that /arm is also missing. Requiring it later or not, I'm going to force it too. In this current state, Godot crashes on Android when trying to play an .ogv. Maybe it will be required, a change on the buildsystem is needed. x86/x86cpu.c only gets called by platforms that define x86_vc/x86cpu.c only gets called by platforms that define We probably need a way to call it on every possible platform by matching the correct architecture, and probably arm/armcpu.c (and arm/armstate.c) if the architecture is any ARM (defining something like In the previous version there was a cpu.c included by default for all platforms. |
|
By testing the very same changes but done in 3.5, I got the conclusion that armcpu.c is not needed at all. The two previous commits can be reverted (keeping the arm folder). The crash only happens in 4.0. With or without theora update. x86cpu.c is a dependency that isn't compiled outside of Linux/macOS/Windows anyway. With this in mind, considering that it worked for 3.x on Android, I assume the problem is not being caused by this PR. Reopened for review. |
baeb443 to
e5c4fff
Compare
|
Running the binary from this PR on a phone with Vulkan support worked with no crashes and played the video just fine. I would like to say this PR is complete. |
|
Out of curiosity, does this dependency update improve decoding quality or reduce CPU usage? |
|
All I am 100% sure is that outside platforms that add either For
For As I mentioned before, Ogg Theora videos play normally other platforms that don't add any of those. And according to this 12 year old article there is a slightly higher decoding speed. I don't think devs at xiph.org are updating theora any soon, as their focus seem to be on AV1 nowadays. |
|
With further search (thanks to FNA-XNA/Theorafile, which recently updated to upstream libtheora), I now know that Unfortunately, the ARM optimizations within it (which would be amazing to have here) seem incompatible with Godot's buildsystem, since it isn't purely C/C++ (it includes GNU Assembler and Perl). Also, this optimization seems to apply only for arm32. I have not found examples of building Update 1: Apparently you have to use the perl script to generate some Update 2: I don't know how to get it to build. Update 3: libpng does something similar, but GNU Assembler files are already in the source instead of having to be generated with a Perl script. For now I'm keeping x86 and x86_vc optimizations as both were already in. I'm leaving arm implementation to anyone interested in making the changes for it to work (but only if this PR ever gets merged, because arm depends on this). |
b2bd12d to
b87584a
Compare
|
One last force push just to remove arm/ and c64x/ folders (and point out they have been removed). Both are not being used. If merged, anyone wishing to implement the arm optimizations is welcome to add the folder back, make it work and open another PR with it. This one just will just keep the current optimizations.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved in PR review meeting.
We have slight concerns about using a Git branch from a mostly dead project when their latest stable release was 1.1.1 from 2011... but apparently ffmpeg is using the Git branch for its binary releases and other projects are also using it successfully. Early test results also seem promising. So let's give it a spin and see how it goes.
As mentioned above, ARM optimizations should be added in a follow PR as we do want them for Android, iOS, macOS M1 and various Linux and Windows platforms.
|
As I said in the meeting (and forgot to mention here), the ARM optimizations in libtheora GIT only build for arm32, so like libpng, it can only be built for armv7 Android. |
|
Thanks! |
|
I forgot to mention: even Firefox uses libtheora GIT. |
As libtheora GIT (2020.10) was mentioned in #52410, I decided to take that update.
The patch folder was removed, as the newer version includes it.
As this PR mostly touches code that is unchanged from 3.x to 4.0, I believe this is cherry pickable.
By running some tests I got the conclusion that libtheora GIT is about 18% faster than 1.1.1.
I tested decoding a 1080p50 video with both 1.1.1 and GIT built from source, both results ran on the same CPU.