422dd9404f
Whenever movie frame encoding needs to be in non-RGBA format (pretty much always, e.g. H.264 uses YUV etc.), the ffmpeg code has been using sws_scale() since 2007. But that one is completely single threaded. It can be multi-threaded by passing "threads" option to SwsContext (in a cumbersome way), combined with sws_scale_frame API. Which however requires frame data buffers to be allocated via AVBuffer machinery. Rendering a 300-frame part of Sprite Fright Edit (target H.264 Medium): - Windows Ryzen 5950X: 16.1 -> 12.0 seconds (generate_video_frame part 4.7 -> 0.7 sec). - Mac M1 Max: 13.1 -> 12.5 sec. Speedup is smaller, but comparatively, entirely other part of movie rendering (audio resampling inside audaspace) is way more expensive compared to the windows machine.