| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at> | ||
| 3 | * Copyright (c) 2014 Arwa Arif <arwaarif1994@gmail.com> | ||
| 4 | * | ||
| 5 | * This file is part of FFmpeg. | ||
| 6 | * | ||
| 7 | * FFmpeg is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * FFmpeg is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with FFmpeg; if not, write to the Free Software Foundation, Inc., | ||
| 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef AVFILTER_PP7DSP_H | ||
| 23 | #define AVFILTER_PP7DSP_H | ||
| 24 | |||
| 25 | #include <stdint.h> | ||
| 26 | |||
| 27 | #include "config.h" | ||
| 28 | |||
| 29 | typedef struct PP7DSPContext { | ||
| 30 | void (*dctB)(int16_t *restrict dst, const int16_t *restrict src); | ||
| 31 | } PP7DSPContext; | ||
| 32 | |||
| 33 | void ff_pp7dsp_init_x86(PP7DSPContext *pp7dsp); | ||
| 34 | |||
| 35 | 912388 | static void dctB_c(int16_t *restrict dst, const int16_t *restrict src) | |
| 36 | { | ||
| 37 |
2/2✓ Branch 0 taken 3649552 times.
✓ Branch 1 taken 912388 times.
|
4561940 | for (int i = 0; i < 4; i++) { |
| 38 | 3649552 | int s0 = src[0 * 4] + src[6 * 4]; | |
| 39 | 3649552 | int s1 = src[1 * 4] + src[5 * 4]; | |
| 40 | 3649552 | int s2 = src[2 * 4] + src[4 * 4]; | |
| 41 | 3649552 | int s3 = src[3 * 4]; | |
| 42 | 3649552 | int s = s3 + s3; | |
| 43 | 3649552 | s3 = s - s0; | |
| 44 | 3649552 | s0 = s + s0; | |
| 45 | 3649552 | s = s2 + s1; | |
| 46 | 3649552 | s2 = s2 - s1; | |
| 47 | 3649552 | dst[0 * 4] = s0 + s; | |
| 48 | 3649552 | dst[2 * 4] = s0 - s; | |
| 49 | 3649552 | dst[1 * 4] = 2 * s3 + s2; | |
| 50 | 3649552 | dst[3 * 4] = s3 - 2 * s2; | |
| 51 | 3649552 | src++; | |
| 52 | 3649552 | dst++; | |
| 53 | } | ||
| 54 | 912388 | } | |
| 55 | |||
| 56 | 15 | static inline void ff_pp7dsp_init(PP7DSPContext *pp7dsp) | |
| 57 | { | ||
| 58 | 15 | pp7dsp->dctB = dctB_c; | |
| 59 | |||
| 60 | #if ARCH_X86 && HAVE_X86ASM | ||
| 61 | 15 | ff_pp7dsp_init_x86(pp7dsp); | |
| 62 | #endif | ||
| 63 | 15 | } | |
| 64 | |||
| 65 | #endif /* AVFILTER_PP7DSP_H */ | ||
| 66 |