2013-04-25 14:32:13 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com>
|
2013-11-08 00:15:49 +03:00
|
|
|
* Copyright (C) 2013 Lenny Wang
|
2013-04-25 14:32:13 +03:00
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AVFILTER_UNSHARP_H
|
|
|
|
#define AVFILTER_UNSHARP_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "avfilter.h"
|
|
|
|
|
|
|
|
#define MIN_MATRIX_SIZE 3
|
|
|
|
#define MAX_MATRIX_SIZE 63
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct UnsharpFilterParam {
|
|
|
|
int msize_x; ///< matrix width
|
|
|
|
int msize_y; ///< matrix height
|
|
|
|
int amount; ///< effect amount
|
|
|
|
int steps_x; ///< horizontal step count
|
|
|
|
int steps_y; ///< vertical step count
|
|
|
|
int scalebits; ///< bits to shift pixel
|
|
|
|
int32_t halfscale; ///< amount to add to pixel
|
2019-05-07 03:46:33 +02:00
|
|
|
uint32_t *sr; ///< finite state machine storage within a row
|
|
|
|
uint32_t **sc; ///< finite state machine storage across rows
|
2013-04-25 14:32:13 +03:00
|
|
|
} UnsharpFilterParam;
|
|
|
|
|
2014-04-19 19:20:17 +03:00
|
|
|
typedef struct UnsharpContext {
|
2013-04-25 14:32:13 +03:00
|
|
|
const AVClass *class;
|
|
|
|
int lmsize_x, lmsize_y, cmsize_x, cmsize_y;
|
|
|
|
float lamount, camount;
|
|
|
|
UnsharpFilterParam luma; ///< luma parameters (width, height, amount)
|
|
|
|
UnsharpFilterParam chroma; ///< chroma parameters (width, height, amount)
|
|
|
|
int hsub, vsub;
|
2019-10-14 12:27:05 +02:00
|
|
|
int bitdepth;
|
|
|
|
int bps;
|
2019-05-07 03:46:33 +02:00
|
|
|
int nb_threads;
|
2013-04-25 14:32:13 +03:00
|
|
|
int opencl;
|
|
|
|
int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out);
|
2019-10-14 12:27:05 +02:00
|
|
|
int (* unsharp_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
|
2013-04-25 14:32:13 +03:00
|
|
|
} UnsharpContext;
|
|
|
|
|
|
|
|
#endif /* AVFILTER_UNSHARP_H */
|