Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7132 closed enhancement (fixed)

Add threading capabilities to overlay filter

Reported by: Gavin Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords: overlay
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I've been running some (entirely unscientific) benchmarks on the overlay filter.

Compositing a frame at 1080p (YUV 422 planar) over another frame takes in the region of around 20ms on my system. Admittedly, my system isn't the latest and greatest.

Having inspected the latest source code, it feels as if the overlay filter (vf_overlay.c) could benefit from threading. The trick would be to somehow keep both the current inlining while incorporating the addition of threading. Without inlining my tests indicate that performance degrades significantly.

Change History (6)

comment:1 by Carl Eugen Hoyos, 6 years ago

Keywords: overlay added
Priority: normalwish

comment:2 by Elon Musk, 6 years ago

Threading will not help much, unless you have bunch of cores, SIMD will help much more.

comment:3 by Elon Musk, 6 years ago

Resolution: fixed
Status: newclosed

Fixed in d54014d1573ec6e958e9c9e802e613c73c7f7ba5.
Note, on average it helps only 10% with 4 cores/threads.

comment:4 by Gavin, 6 years ago

Wow, quick turnaround. Thanks. Does the percentage increase have any correlation with the size of the overlay?

comment:5 by Gavin, 6 years ago

By the way, should I create an additional ticket for adding SIMD paths?

comment:6 by Elon Musk, 6 years ago

SIMD added to overlay filter, for case when main has no alpha and alpha is straight.

Note: See TracTickets for help on using tickets.