FFmpeg
Loading...
Searching...
No Matches
libavfilter
vf_idetdsp.c
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2012 Michael Niedermayer <michaelni@gmx.at>
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#include <
libavutil/attributes.h
>
22
#include <
libavutil/common.h
>
23
24
#include "
vf_idetdsp.h
"
25
26
int
ff_idet_filter_line_c
(
const
uint8_t *
a
,
const
uint8_t *
b
,
const
uint8_t *
c
,
int
w
)
27
{
28
int
x;
29
int
ret=0;
30
31
for
(x=0; x<
w
; x++){
32
int
v = (*
a
++ + *
c
++) - 2 * *
b
++;
33
ret +=
FFABS
(v);
34
}
35
36
return
ret;
37
}
38
39
int
ff_idet_filter_line_c_16bit
(
const
uint8_t *
a
,
const
uint8_t *
b
,
const
uint8_t *
c
,
int
w
)
40
{
41
int
x;
42
int
ret=0;
43
44
const
uint16_t *a16 = (
const
uint16_t *)
a
;
45
const
uint16_t *b16 = (
const
uint16_t *)
b
;
46
const
uint16_t *c16 = (
const
uint16_t *)
c
;
47
48
for
(x=0; x<
w
; x++){
49
int
v = (*a16++ + *c16++) - 2 * *b16++;
50
ret +=
FFABS
(v);
51
}
52
53
return
ret;
54
}
55
56
void
av_cold
ff_idet_dsp_init
(
IDETDSPContext
*dsp,
int
depth)
57
{
58
dsp->
filter_line
= depth > 8 ?
ff_idet_filter_line_c_16bit
:
ff_idet_filter_line_c
;
59
#if ARCH_X86 && HAVE_X86ASM
60
ff_idet_dsp_init_x86
(dsp, depth);
61
#endif
62
}
common.h
common internal and external API header
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition
common.h:74
a
int a
Definition
h264pred_template.c:416
b
#define b
Definition
input.c:43
attributes.h
Macro definitions for various function/variable attributes.
av_cold
#define av_cold
Definition
attributes.h:117
w
uint8_t w
Definition
llvidencdsp.c:39
IDETDSPContext
Definition
vf_idetdsp.h:26
IDETDSPContext::filter_line
ff_idet_filter_func filter_line
Definition
vf_idetdsp.h:27
ff_idet_filter_line_c_16bit
int ff_idet_filter_line_c_16bit(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w)
Definition
vf_idetdsp.c:39
ff_idet_filter_line_c
int ff_idet_filter_line_c(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w)
Definition
vf_idetdsp.c:26
ff_idet_dsp_init
void av_cold ff_idet_dsp_init(IDETDSPContext *dsp, int depth)
Definition
vf_idetdsp.c:56
vf_idetdsp.h
ff_idet_dsp_init_x86
void ff_idet_dsp_init_x86(IDETDSPContext *idet, int depth)
c
static double c[64]
Definition
vsrc_mptestsrc.c:89
Generated on Thu Aug 27 2026 19:21:23 for FFmpeg by
1.13.2