| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 | 44524 | 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 | 44524 | int ret=0; | |
| 30 | |||
| 31 |
2/2✓ Branch 0 taken 15671328 times.
✓ Branch 1 taken 44524 times.
|
15715852 | for(x=0; x<w; x++){ |
| 32 | 15671328 | int v = (*a++ + *c++) - 2 * *b++; | |
| 33 | 15671328 | ret += FFABS(v); | |
| 34 | } | ||
| 35 | |||
| 36 | 44524 | 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 | 31 | void av_cold ff_idet_dsp_init(IDETDSPContext *dsp, int depth) | |
| 57 | { | ||
| 58 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 31 times.
|
31 | dsp->filter_line = depth > 8 ? ff_idet_filter_line_c_16bit : ff_idet_filter_line_c; |
| 59 | #if ARCH_X86 && HAVE_X86ASM | ||
| 60 | 31 | ff_idet_dsp_init_x86(dsp, depth); | |
| 61 | #endif | ||
| 62 | 31 | } | |
| 63 |