Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#7132 closed enhancement (fixed)

Add threading capabilities to overlay filter

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


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 Changed 2 years ago by cehoyos

  • Keywords overlay added
  • Priority changed from normal to wish

comment:2 Changed 2 years ago by richardpl

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

comment:3 Changed 2 years ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 2 years ago by zerodefect

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

comment:5 Changed 2 years ago by zerodefect

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

comment:6 Changed 2 years ago by richardpl

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

Note: See TracTickets for help on using tickets.