avfilter/vf_unsharp: enable slice threading

benchmarking with a simple command:
ffmpeg -i 1080p.mp4 -vf unsharp=la=3:ca=3 -an -f null /dev/null
with the patch, the fps increase from 50 to 120 on my local machine (i7-6770HQ).

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
This commit is contained in:
Ruiling Song
2019-05-07 09:46:33 +08:00
parent bbad0bc5ff
commit 94ceeba9f9
2 changed files with 82 additions and 26 deletions

View File

@@ -37,7 +37,8 @@ typedef struct UnsharpFilterParam {
int steps_y; ///< vertical step count
int scalebits; ///< bits to shift pixel
int32_t halfscale; ///< amount to add to pixel
uint32_t *sc[MAX_MATRIX_SIZE - 1]; ///< finite state machine storage
uint32_t *sr; ///< finite state machine storage within a row
uint32_t **sc; ///< finite state machine storage across rows
} UnsharpFilterParam;
typedef struct UnsharpContext {
@@ -47,6 +48,7 @@ typedef struct UnsharpContext {
UnsharpFilterParam luma; ///< luma parameters (width, height, amount)
UnsharpFilterParam chroma; ///< chroma parameters (width, height, amount)
int hsub, vsub;
int nb_threads;
int opencl;
int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out);
} UnsharpContext;