Repository navigation
perf(avsynctest): improve video rendering performance - #161
souravpaul98 wants to merge 1 commit into
Conversation
b1b55a2 to
dc1c6dc
Compare
Every row of the v210 and UYVP test pattern is the same, so pack only the first row and copy it into the rest of the frame. At 3840x2160 on one CPU this generates frames about five to six times as fast as packing every row. Fill the stride padding after the last packing group with zeros. It previously kept whatever bytes were left in the pooled buffer, so the output now repeats exactly across restarts. A new test checks the frames, timestamps and ANC metadata across a restart. Signed-off-by: Sourav Paul <sopaul@nvidia.com> Co-authored-by: Gareth Sylvester-Bradley <garethsb@nvidia.com> Signed-off-by: Gareth Sylvester-Bradley <garethsb@nvidia.com>
dc1c6dc to
ddcefe5
Compare
|
I've force-pushed a reworked version of this onto the branch, keeping you as author. Every row of the v210 and UYVP pattern is the same, because I measured with your setup (3840×2160, 60/1, 600 frames,
The output is byte-for-byte identical to your version for both formats, at 1030×1021 and at 4K. On this laptop the threaded runs used less total CPU than the single-threaded one, so I wouldn't rely on its thread speedups. The copy-first-row version still uses one CPU and is faster. The zeroed padding and your restart test are kept. Before, the padding held whatever was left in the pooled buffer. The test no longer loops over thread counts. If we later want a pattern that varies by row, we can bring back the threaded rendering from this PR's history. |
Summary
avsyncvideotestsrccan now render v210 and UYVP frames across row ranges. The newn-threadsproperty defaults to1(the source thread). Set it to N > 1 to use up to N rendering worker threads, or0for automatic mode, which uses about one worker per megapixel, capped by the available CPUs and the frame height.Worker creation failure is reported as a GStreamer error. Packed pixels, timestamps, and ANC metadata stay the same across worker counts and across a restart.
Performance
3840×2160, 60 fps caps, release builds,
fakesink sync=false. Each case is 600 frames × 3 trials.is-live=false, so FPS is generation throughput. CPU% is process CPU (100% = one logical CPU). RAM is the highest peak resident set across the three runs.Host: Intel Xeon Silver 4514Y (16 cores / 32 threads), GStreamer 1.24.2, Rust 1.92. Automatic mode selected 8 workers.
main(single-thread)n-threads=1n-threads=0(auto)main(single-thread)n-threads=1n-threads=0(auto)Automatic mode raises median throughput by 6.85× for v210 and 4.94× for UYVP, using about 6.3 logical CPUs. Single-threaded UYVP is unchanged. Single-threaded v210 is 1.64× the previous packer. Peak RAM does not grow.