FFmpeg
Loading...
Searching...
No Matches
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
22#include <libavutil/common.h>
23
24#include "vf_idetdsp.h"
25
26int 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
39int 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
57{
59#if ARCH_X86 && HAVE_X86ASM
60 ff_idet_dsp_init_x86(dsp, depth);
61#endif
62}
common internal and external API header
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition common.h:74
int a
#define b
Definition input.c:43
Macro definitions for various function/variable attributes.
#define av_cold
Definition attributes.h:117
uint8_t w
Definition llvidencdsp.c:39
ff_idet_filter_func filter_line
Definition vf_idetdsp.h:27
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
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
void av_cold ff_idet_dsp_init(IDETDSPContext *dsp, int depth)
Definition vf_idetdsp.c:56
void ff_idet_dsp_init_x86(IDETDSPContext *idet, int depth)
static double c[64]