It was shared with opencl implementation.
Showing the changes to libavfilter (2 of 2 files). Show all
Unified · Split
| @@ -1,62 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com> | ||
| 3 | * Copyright (C) 2013 Lenny Wang | ||
| 4 | * | ||
| 5 | * This file is part of FFmpeg. | ||
| 6 | * | ||
| 7 | * FFmpeg is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU Lesser General Public | ||
| 9 | * License as published by the Free Software Foundation; either | ||
| 10 | * version 2.1 of the License, or (at your option) any later version. | ||
| 11 | * | ||
| 12 | * FFmpeg is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * Lesser General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU Lesser General Public | ||
| 18 | * License along with FFmpeg; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef AVFILTER_UNSHARP_H | ||
| 23 | #define AVFILTER_UNSHARP_H | ||
| 24 | |||
| 25 | #include "config.h" | ||
| 26 | #include "avfilter.h" | ||
| 27 | |||
| 28 | #define MIN_MATRIX_SIZE 3 | ||
| 29 | #define MAX_MATRIX_SIZE 63 | ||
| 30 | |||
| 31 | |||
| 32 | typedef struct UnsharpFilterParam { | ||
| 33 | int msize_x; ///< matrix width | ||
| 34 | int msize_y; ///< matrix height | ||
| 35 | int amount; ///< effect amount | ||
| 36 | int steps_x; ///< horizontal step count | ||
| 37 | int steps_y; ///< vertical step count | ||
| 38 | int scalebits; ///< bits to shift pixel | ||
| 39 | int32_t halfscale; ///< amount to add to pixel | ||
| 40 | uint32_t *sr; ///< finite state machine storage within a row | ||
| 41 | uint32_t **sc; ///< finite state machine storage across rows | ||
| 42 | } UnsharpFilterParam; | ||
| 43 | |||
| 44 | typedef struct UnsharpContext { | ||
| 45 | const AVClass *class; | ||
| 46 | int lmsize_x, lmsize_y, cmsize_x, cmsize_y; | ||
| 47 | int amsize_x, amsize_y; | ||
| 48 | float lamount, camount; | ||
| 49 | float aamount; | ||
| 50 | UnsharpFilterParam luma; ///< luma parameters (width, height, amount) | ||
| 51 | UnsharpFilterParam chroma; ///< chroma parameters (width, height, amount) | ||
| 52 | UnsharpFilterParam alpha; ///< alpha parameters (width, height, amount) | ||
| 53 | int hsub, vsub; | ||
| 54 | int nb_planes; | ||
| 55 | int bitdepth; | ||
| 56 | int bps; | ||
| 57 | int nb_threads; | ||
| 58 | int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out); | ||
| 59 | int (* unsharp_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); | ||
| 60 | } UnsharpContext; | ||
| 61 | |||
| 62 | #endif /* AVFILTER_UNSHARP_H */ | ||
| @@ -44,7 +44,39 @@ · 43 unmodified lines | |||
| 44 | #include "libavutil/mem.h" | 44 | #include "libavutil/mem.h" |
| 45 | #include "libavutil/opt.h" | 45 | #include "libavutil/opt.h" |
| 46 | #include "libavutil/pixdesc.h" | 46 | #include "libavutil/pixdesc.h" |
| 47 | #include "unsharp.h" | 47 | |
| 48 | #define MIN_MATRIX_SIZE 3 | ||
| 49 | #define MAX_MATRIX_SIZE 63 | ||
| 50 | |||
| 51 | typedef struct UnsharpFilterParam { | ||
| 52 | int msize_x; ///< matrix width | ||
| 53 | int msize_y; ///< matrix height | ||
| 54 | int amount; ///< effect amount | ||
| 55 | int steps_x; ///< horizontal step count | ||
| 56 | int steps_y; ///< vertical step count | ||
| 57 | int scalebits; ///< bits to shift pixel | ||
| 58 | int32_t halfscale; ///< amount to add to pixel | ||
| 59 | uint32_t *sr; ///< finite state machine storage within a row | ||
| 60 | uint32_t **sc; ///< finite state machine storage across rows | ||
| 61 | } UnsharpFilterParam; | ||
| 62 | |||
| 63 | typedef struct UnsharpContext { | ||
| 64 | const AVClass *class; | ||
| 65 | int lmsize_x, lmsize_y, cmsize_x, cmsize_y; | ||
| 66 | int amsize_x, amsize_y; | ||
| 67 | float lamount, camount; | ||
| 68 | float aamount; | ||
| 69 | UnsharpFilterParam luma; ///< luma parameters (width, height, amount) | ||
| 70 | UnsharpFilterParam chroma; ///< chroma parameters (width, height, amount) | ||
| 71 | UnsharpFilterParam alpha; ///< alpha parameters (width, height, amount) | ||
| 72 | int hsub, vsub; | ||
| 73 | int nb_planes; | ||
| 74 | int bitdepth; | ||
| 75 | int bps; | ||
| 76 | int nb_threads; | ||
| 77 | int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out); | ||
| 78 | int (* unsharp_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); | ||
| 79 | } UnsharpContext; | ||
| 48 | 80 | ||
| 49 | typedef struct TheadData { | 81 | typedef struct TheadData { |
| 50 | UnsharpFilterParam *fp; | 82 | UnsharpFilterParam *fp; |