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).
Showing the changes to libavfilter/unsharp.h (1 of 2 files). Show all
Unified · Split
| @@ -37,7 +37,8 @@ typedef struct UnsharpFilterParam { · 36 unmodified lines | ||
| 37 | 37 | int steps_y; ///< vertical step count |
| 38 | 38 | int scalebits; ///< bits to shift pixel |
| 39 | 39 | int32_t halfscale; ///< amount to add to pixel |
| 40 | − uint32_t *sc[MAX_MATRIX_SIZE - 1]; ///< finite state machine storage | |
| 40 | + uint32_t *sr; ///< finite state machine storage within a row | |
| 41 | + uint32_t **sc; ///< finite state machine storage across rows | |
| 41 | 42 | } UnsharpFilterParam; |
| 42 | 43 | |
| 43 | 44 | typedef struct UnsharpContext { |
| @@ -47,6 +48,7 @@ typedef struct UnsharpContext { · 3 unmodified lines | ||
| 47 | 48 | UnsharpFilterParam luma; ///< luma parameters (width, height, amount) |
| 48 | 49 | UnsharpFilterParam chroma; ///< chroma parameters (width, height, amount) |
| 49 | 50 | int hsub, vsub; |
| 51 | + int nb_threads; | |
| 50 | 52 | int opencl; |
| 51 | 53 | int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out); |
| 52 | 54 | } UnsharpContext; |