A minute of 1080p video took 39.83 seconds to encode with the production-reference WebAssembly core captured for this experiment. A new SIMD candidate finished the same job in 21.08 seconds, using the same codec, preset, target bitrate and encoder thread count.
That result came from a local experiment on one Apple M2. It measures FFmpeg execution after the core has loaded, rather than the complete wait from opening a website to downloading a file. Here is what we changed, how we checked the output, and where the evidence stops.
The short answer
Our final candidate reduced encoding time by 44–48% across three test clips. It keeps software H.264 encoding inside the browser. The work changes repeated calculations in x264, the encoder used by FFmpeg, while preserving the compression settings used in the comparison.

All 16 outputs in the final validation met their size targets. The largest absolute difference in mean VMAF from the production reference was 0.094 points. That supports a useful speed improvement on these samples; it does not establish identical output under every threading configuration.
Why a SIMD-enabled build still had room to improve
SIMD stands for “single instruction, multiple data.” Instead of asking the CPU to do the same calculation separately for one pixel after another, an instruction operates on several values together. A 128-bit vector can hold sixteen 8-bit pixels, although each algorithm needs its own arrangement of loads, arithmetic and reductions.
Our existing core already supported WebAssembly SIMD. The opportunity was in the code paths doing the work. A build flag alone does not guarantee that every hot loop uses efficient vector instructions. Native assembly also cannot simply be carried into a browser build unchanged. Emscripten’s SIMD documentation describes both automatic vectorization and explicit intrinsics, along with the limits of porting native code.
We used explicit WebAssembly SIMD intrinsics for selected 8-bit x264 routines. Multithreading continued to distribute work across threads; SIMD reduced the calculations each thread needed to perform.
First, find the calculations that matter
We built a core with function names so CPU profiles could identify encoding routines instead of anonymous WebAssembly functions. In two initial profiles, reference-block interpolation and an 8×4 SATD routine together accounted for about 36–42% of samples after idle and thread-wait leaves were excluded.
Interpolation helps predict a picture from reference frames when movement falls between whole pixels. SATD scores differences between a predicted block and the actual image. Both repeat across many blocks, frames and candidate predictions.
Those percentages rank optimization targets. They are not percentages of elapsed encoding time: multiple workers can execute or wait simultaneously. We used separate, unprofiled runs to measure how long a whole encode took.
What we changed in x264
The first candidate vectorized rounded pixel averaging and the 8×4 SATD calculation. Later rounds extended that work to block SAD comparisons, chroma interpolation, quantization, and pixel sums and sums of squares. SAD is another block-difference score; quantization is part of turning transformed image information into encodable coefficients.
We also reused pixel loads across several candidate comparisons and selected common interpolation widths outside the inner loop. The aim was to preserve the integer arithmetic, including rounding, while doing less repeated work.
Independent scalar checks exercised the vector routines. We then encoded complete clips, because a faster helper is valuable only if it improves the full job. Some intermediate changes helped one clip while slowing another, which is why the final comparison uses the selected cumulative candidate rather than multiplying individual speedups.
What the benchmark measured
The experiment used FFmpeg 5.1.4, x264 core 164 and an Emscripten 4.0.22 build. Browser runs used local HTTP with cross-origin isolation and WORKERFS input. We compared the same fixtures with software libx264, the faster preset, 12 encoder threads, matched target-rate arguments and copied audio.
The production-reference JS and WASM were downloaded and checked against the original application checkout before testing. An earlier round also included a rebuilt, unpatched control to help separate patch effects from rebuilding the core.
| Fixture | Observed result |
|---|---|
| 720p · 20 seconds | Production reference: 7.10 s SIMD candidate: 3.71 s Time reduction: 47.7% |
| 1080p · 60 seconds | Production reference: 39.83 s SIMD candidate: 21.08 s Time reduction: 47.1% |
| 4K · 3 seconds | Production reference: 8.86 s SIMD candidate: 4.97 s Time reduction: 44.0% |
The candidate’s 720p and 4K times are medians of two trials. Their production-reference times, and both 1080p entries, are single trials. All were measured on the same M2 in the final comparison session. Machine load changed absolute times between sessions, so we do not mix earlier measurements into this table.
For the 1080p clip, the saving was 18.75 seconds: about 47% less execution time, or 1.89× the encoding throughput. “47% less time” and “47% faster” are different calculations. Neither describes cold-start loading, file selection or downloading the finished result.
Checking size, picture quality and equivalence
Candidate outputs were approximately 3.19–3.20 MB, 19.71 MB and 3.12 MB, below targets of 3.33 MB, 22.49 MB and 4.30 MB. Validation checked dimensions, frame counts, track codecs and durations against the reference, with a VMAF score for every output frame.
VMAF is a reference-based video quality metric. Mean VMAF stayed within 0.10 points of the production reference. Looking only at that mean would hide variation: one 720p run’s frame-level fifth-percentile score was 0.69 points lower. Two supplementary comparisons with fresh controls showed differences of −0.45 and −0.03 points. The low-scoring tail therefore deserves its own reporting.
Separate tests using one x264 encoder thread produced byte-for-byte identical MP4s from the previous SIMD and final candidate builds for the 720p, short 1080p and 4K fixtures. Those are equivalence checks between those two builds under that configuration. The speed table uses 12-thread encoding and makes no blanket claim of identical files.
The trade-offs we kept
Reducing the encoder to six or eight threads saved only another 0.6–3.8% of wall time across the screening fixtures, while increasing output size by 1.6–11.4%. We kept the measured 12-thread candidate and its original rate-control settings.
Native FFmpeg also remained ahead in the final session: the candidate took roughly 1.9–2.1 times as long across the three fixtures. That is context, not a universal browser-versus-native ratio. The native timing includes process startup and output writes, while the browser timer covers execution only.
Which jobs this work can help
The patch targets 8-bit software H.264 encoding in the multithreaded WebAssembly core. It does not directly accelerate a container-only remux, copying an audio track, or a separate WebCodecs encoding path. Browser SIMD support also does not prove that a particular job was routed through this core.
This experiment follows our earlier engine upgrade, but uses a different baseline: the production multithreaded core captured for this test. The two headline improvements should not be multiplied together.
For the separate software-versus-hardware tradeoff across tools, see our browser encoder comparison.
Frequently asked questions
Does this mean every compression job is twice as fast?
No. These measurements cover three clips on one Apple M2 and exclude loading and result readback. Different content, browsers, devices and engine routes need separate measurements.
Was the speed gain caused by a lower-quality preset?
The comparison retained the codec, preset, bitrate arguments and encoder thread count. Output checks found very similar average VMAF, with the frame-level variation described above.
Does SIMD require uploading the video?
No. SIMD instructions execute on the user’s CPU inside WebAssembly. RedPanda’s compression processes the video locally and produces an H.264 MP4. Our file-upload verification guide explains how to check local processing.
Can the same result be assumed on Windows or phones?
No. This experiment does not establish Windows or phone speedups. Compatibility, memory behavior, successful completion and fallback behavior need checking alongside speed before widening a rollout.
From a benchmark to a product
The experiment gives us a concrete result: substantially less encoding time on three M2 fixtures, with matched settings and validated outputs. It also leaves clear work: broader device testing, longer clips, cold-start measurements and production monitoring.
As of November 30, 2026, the selected core is in a limited production experiment: 20% of eligible browser profiles receive SIMD and 80% retain the original multithreaded core. This applies only where the existing routing would use that core, including eligible desktop and installed-app sessions and the isolated iOS compression pages below 200 MiB. It is not a 20% rollout across all site visitors.
If the candidate cannot load or complete a job, the application can retry with the original multithreaded core, followed by the existing legacy rescue path where applicable. Monitoring keeps the original assignment separate from the core that actually completed the task. A successful rescue demonstrates user recovery; it does not establish that the SIMD attempt was healthy.
The experiment has begun receiving real jobs, but the first short window is too small and too uneven in device and file mix to establish a real-user speed or completion-rate advantage. We are keeping those production outcomes separate from this local benchmark and checking device-specific failures, loading, output sizes and downloads before considering a wider rollout.
You can use RedPanda Compress for browser-based compression without uploading your video. This case study records the SIMD experiment; it does not promise that every visit receives the candidate core or the same speedup.

Fei is a skilled software engineer. He previously worked at Google and now at a startup. His expertise includes web media processing, cloud architecture, complex algorithms, and AI training and deployment. Beyond work, Fei enjoys diving into new knowledge and is a big fan of strategy games.
0 Comments
2 Pingbacks