For the inference part, the old Selfie Segmentation using tflite has been replaced by the modern MediaPipe vision tasks API, which runs on GPU if available (otherwise gracefully falls back to wasm/CPU).
For compositing (applying the mask), a new custom WebGL2 compositor performs all work directly on GPU (completely avoiding CPU-GPU back & forth); if WebGL2 is not available, the old canvas compositing is used.
This change introduces significant gains in CPU usage during video calls that use blurring/backgrounds, since the CPU is now mostly idle and all work is done on GPU.
As a bonus, virtual backgrounds are now also available on Safari (WebGL compositor only).
The old JitsiStreamBackgroundEffect class has been replaced by the new VideoStreamBackgroundEffect.
Signed-off-by: Dimitris Kazakos <nemphys@gmail.com>