Hello,
I've noticed, when using filters like deblock and/or the denoiser, that one core is pegged at 100% use while the 3 other cores have a 50-80% use. Until now, what I've done to mitigate this sub-par CPU use it to launch a couple encodes in parallel.
I guess most (if not all) image filters are single threaded and only process images in sequence, but I wonder if there would be a way to parallel/thread the image processing pass. This would allow better CPU use, especially now that quad cores are going from "mainstream" to "entry level" - encoding a file on a Ryzen 5 or 7 with image processing enabled would be a waste.
Any thought?
Parallel filtering of multiple frames
Re: Parallel filtering of multiple frames
Sure, merely a matter of algorithm and software development.
Some filters are multi-threaded. Some decoders are too.
Some filters are multi-threaded. Some decoders are too.
- JohnAStebbins
- HandBrake Team
- Posts: 5726
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Parallel filtering of multiple frames
Code: Select all
I guess most (if not all) image filters are single threaded
It's really just a matter of finding a developer that is interested in doing so. I don't have much interested in fixing either deblock or hqdn3d denoise myself. I don't use either of them. nlmeans is a better denoiser, so I use that when I need a denoiser. deblock should only be used on sources that were badly encoded and have blocky edges. I never use such poor quality sources. Similar argument for deinterlace, decomb is better. cropscale, rotate and pad are fast enough that they don't need to be threaded. Detelecine is the only filter I occasionally use that would benefit from threading.
Re: Parallel filtering of multiple frames
Thanks for the details - I'll change the filters I use to the multithreaded ones.
Re: Parallel filtering of multiple frames
Ok, so I tried using NLMeans instead of deblock, and using decomb. And now I remember why I prefer using deblock: on sources that are only slightly noisy (like animation from a DVD), even single-threaded decomb is MUCH faster than NLMean on 4 cores.
I'll take for example my latest DVD backup (x264, animation preset, high profile, level 4.2, RF20) :
- unfiltered : 110 fps (all CPUs around 98%)
- using decomb/default and deblock/5: 46 fps (1 CPU@100%, all 3 others@50%)
- using decomb/default and NLMeans/Light/Animation : 11 fps (all CPUs around 98%)
That's... a bit much when all I want is cleaning up some MPEG-2 artifacts and noise.
I'll take for example my latest DVD backup (x264, animation preset, high profile, level 4.2, RF20) :
- unfiltered : 110 fps (all CPUs around 98%)
- using decomb/default and deblock/5: 46 fps (1 CPU@100%, all 3 others@50%)
- using decomb/default and NLMeans/Light/Animation : 11 fps (all CPUs around 98%)
That's... a bit much when all I want is cleaning up some MPEG-2 artifacts and noise.