-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Fudge openmp from homebrew's GCC 7.2 #2
Conversation
I don't know a way to use Bash commands in that config, but you should use |
9a13cc5
to
8bbadee
Compare
I'm getting an error when building:
GCC 7.3.0 |
I stumbled upon an issue of yours while Googling this: rust-lang/rust#46797 |
Yup. Link with libresolv. It's in "required libraries" in the gifski xcodeproj subjproject. |
Ok now it builds, but I'm still getting an error when archiving:
|
that archiving error is bizarre, since the library is not supposed to be installed anywhere and shouldn't be in the archive. I don't know why xcode expects it there. Does the usual xcode exorcism of cleaning the build folder help? |
Hm, maybe it needs |
No |
Still the same error. |
Hacked in 86193d3 |
Now I'm getting this when archiving:
Are you not seeing these errors? |
Yes, I'm getting the same when archiving. Normal build/run works. |
The issue with archiving is worse. It doesn't even build the library when archiving :( |
No, it's even weirder. It doesn't show it's building the library in the build log, but it does build it. And then, it symlinks the library with itself!? ls -l /Users/porneL/Library/Developer/Xcode/DerivedData/Gifski-gyxlsysgukvtlzahwwnbvwsmgzzx/Build/Intermediates.noindex/ArchiveIntermediates/Gifski/BuildProductsPath/target/release/libgifski.a |
I think I've found the cause — Xcode gets confused when build_dir == build_products_dir. I'll tweak the integration to avoid that |
@kornelski Can you rebase from master and fix the merge conflict? |
I tested this PR against release build of master, and it decreases the convert time by ~25%:
|
@kornelski You said we could not use GCD as the frames have to be converted in order, I'm then curious how OpenMP is able to achieve this speed improvement. Do you know? |
OpenMP affects internals of libimagequant, e.g. remapping of pixels is done in parallel. It's more fine-grained parallelism than what GCD aims for. Still, because of the inter-frame dependency I'm hitting Amdahl's law hard. |
Do all frames depend on each other? For example, could we split the a video into two videos, process them in parallel, and then merge them at the end? |
Could also encode intraframes in parallel. This is a good read if you haven’t read it already: http://www.drdobbs.com/parallel/optimizing-video-encoding-using-threads/225600370 |
In GIFs produced by gifski every frame depends on its previous frame, by design. It's equivalent to a video without keyframes. Encoding of frames themselves is already very parallelized. Splitting input video into parts (roughly equal to number of cores), encoding parts independently and then stitching together would parallelize GIF creation quite well at cost of adding keyframe-like frames in the GIF that may have lower quality (since they won't be able to correctly reuse background from their previous frame). I've also considered encoding video in fragments, stitching fragments, and then re-encoding frames on the stitches to reduce quality loss. However, all of this considerably increases complexity. |
This should make it noticeably faster. However, it's a bit hacky since it needs to link with GCC's library, which brew puts wherever it wants. Maybe it could be improved with injection of
brew --prefix
somewhere in the config.