-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Replace stb_vorbis with libvorbis #52406
Conversation
96292e7
to
1d4d1f5
Compare
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.
You need to update the documentation for the CI checks to pass.
This is looking extremely good so far! |
I switched the names around, moved OGGPacketSequence to its own file in the ogg module, switched to using cache-friendlier data structures for the ogg packet data, and generally cleaned things up a bit. What this PR really needs right now is testing, not necessarily an in-depth review. Happy to respond to comments but what I'm most concerned about right now is it not actually working with some ogg files due to something I missed in the spec. It works with anything created with ffmpeg from my experience. I'll put this in the PR description too but storing the ogg bitstream as a list of packets in a variant array does result in a size penalty compared to storing it unprocessed. The penalty is fairly severe before compression (25%+), but seems to be about 2-4% after re-compressing the saved
edit: There are architectural issues with reusing the OGGPacketSequence code, so it might need to be duplicated in an opus plugin. Still, keeping it separate from the vorbis code makes logical sense to me. |
42424ab
to
4b9f078
Compare
I think (hope?) I've addressed all the CI issues. This should be ready to review now. |
PCK files don't use compression to speed up random file access, but ZIP archives exported by Godot do. Nonetheless, the vast majority of users use PCK files. |
Good to know. Let's wait to merge this until I figure out how to reduce the size penalty. I think I have some ideas. |
The size penalty for the new imported type (oggvorbisstr) now seems to be around 5% over the old imported type (oggstr), which is pretty good. I'm discarding some information to accomplish this then reconstructing it:
There's one additional caveat to this PR:
|
Looks really good! Please squash commits so I can review and eventually merge. |
This looks amazing, awesome job! |
Fixes a variety of crashing bugs in stb_vorbis, and I think it also fixes #26964 but I will have to do a bit more testing to confirm that.
This introduces a size penalty of approximately 5% over the old internal representation of ogg files, but I think getting rid of stb_vorbis is worth it.
Important: If this gets merged and we ever want to revert it or switch to a new library or something, it's critical that we keep the change I made to editor_file_system.cpp otherwise whatever
.ogg
importer we replace this one with won't be run, and the engine will just crash instead.