FFmpeg
Loading...
Searching...
No Matches
libavfilter
boxblur.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2002 Michael Niedermayer <michaelni@gmx.at>
3
* Copyright (c) 2011 Stefano Sabatini
4
* Copyright (c) 2018 Danil Iashchenko
5
*
6
* This file is part of FFmpeg.
7
*
8
* FFmpeg is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
12
*
13
* FFmpeg is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with FFmpeg; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
*/
22
23
#include "
libavutil/mem.h
"
24
#include "
boxblur.h
"
25
26
static
const
char
*
const
var_names
[] = {
27
"w"
,
28
"h"
,
29
"cw"
,
30
"ch"
,
31
"hsub"
,
32
"vsub"
,
33
NULL
34
};
35
36
enum
var_name
{
37
VAR_W
,
38
VAR_H
,
39
VAR_CW
,
40
VAR_CH
,
41
VAR_HSUB
,
42
VAR_VSUB
,
43
VARS_NB
44
};
45
46
47
int
ff_boxblur_eval_filter_params
(
AVFilterLink
*inlink,
48
FilterParam
*luma_param,
49
FilterParam
*chroma_param,
50
FilterParam
*alpha_param)
51
{
52
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(inlink->
format
);
53
AVFilterContext
*
ctx
= inlink->
dst
;
54
int
w
= inlink->
w
,
h
= inlink->
h
;
55
int
cw, ch;
56
double
var_values[
VARS_NB
], res;
57
char
*expr;
58
int
ret
;
59
60
if
(!luma_param->
radius_expr
) {
<