| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder | ||
| 3 | * Copyright (c) 2003-2011 Michael Niedermayer <michaelni@gmx.at> | ||
| 4 | * | ||
| 5 | * This file is part of FFmpeg. | ||
| 6 | * | ||
| 7 | * FFmpeg is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU Lesser General Public | ||
| 9 | * License as published by the Free Software Foundation; either | ||
| 10 | * version 2.1 of the License, or (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 GNU | ||
| 15 | * Lesser General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU Lesser General Public | ||
| 18 | * License along with FFmpeg; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | /** | ||
| 23 | * @file | ||
| 24 | * H.264 / AVC / MPEG-4 part10 DSP functions. | ||
| 25 | * @author Michael Niedermayer <michaelni@gmx.at> | ||
| 26 | */ | ||
| 27 | |||
| 28 | #include "bit_depth_template.c" | ||
| 29 | |||
| 30 | 1733094 | static void FUNCC(ff_h264_add_pixels4)(uint8_t *_dst, int16_t *_src, int stride) | |
| 31 | { | ||
| 32 | int i; | ||
| 33 | 1733094 | pixel *dst = (pixel *) _dst; | |
| 34 | 1733094 | dctcoef *src = (dctcoef *) _src; | |
| 35 | 1733094 | stride /= sizeof(pixel); | |
| 36 | |||
| 37 |
2/2✓ Branch 0 taken 3466188 times.
✓ Branch 1 taken 866547 times.
|
8665470 | for (i = 0; i < 4; i++) { |
| 38 | 6932376 | dst[0] += (unsigned)src[0]; | |
| 39 | 6932376 | dst[1] += (unsigned)src[1]; | |
| 40 | 6932376 | dst[2] += (unsigned)src[2]; | |
| 41 | 6932376 | dst[3] += (unsigned)src[3]; | |
| 42 | |||
| 43 | 6932376 | dst += stride; | |
| 44 | 6932376 | src += 4; | |
| 45 | } | ||
| 46 | |||
| 47 | 1733094 | memset(_src, 0, sizeof(dctcoef) * 16); | |
| 48 | 1733094 | } | |
| 49 | |||
| 50 | 45320 | static void FUNCC(ff_h264_add_pixels8)(uint8_t *_dst, int16_t *_src, int stride) | |
| 51 | { | ||
| 52 | int i; | ||
| 53 | 45320 | pixel *dst = (pixel *) _dst; | |
| 54 | 45320 | dctcoef *src = (dctcoef *) _src; | |
| 55 | 45320 | stride /= sizeof(pixel); | |
| 56 | |||
| 57 |
2/2✓ Branch 0 taken 181280 times.
✓ Branch 1 taken 22660 times.
|
407880 | for (i = 0; i < 8; i++) { |
| 58 | 362560 | dst[0] += (unsigned)src[0]; | |
| 59 | 362560 | dst[1] += (unsigned)src[1]; | |
| 60 | 362560 | dst[2] += (unsigned)src[2]; | |
| 61 | 362560 | dst[3] += (unsigned)src[3]; | |
| 62 | 362560 | dst[4] += (unsigned)src[4]; | |
| 63 | 362560 | dst[5] += (unsigned)src[5]; | |
| 64 | 362560 | dst[6] += (unsigned)src[6]; | |
| 65 | 362560 | dst[7] += (unsigned)src[7]; | |
| 66 | |||
| 67 | 362560 | dst += stride; | |
| 68 | 362560 | src += 8; | |
| 69 | } | ||
| 70 | |||
| 71 | 45320 | memset(_src, 0, sizeof(dctcoef) * 64); | |
| 72 | 45320 | } | |
| 73 |