/src/ffmpeg/libavcodec/h264addpx_template.c
Line | Count | 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 | | static void FUNCC(ff_h264_add_pixels4)(uint8_t *_dst, int16_t *_src, int stride) |
31 | 1.29M | { |
32 | 1.29M | int i; |
33 | 1.29M | pixel *dst = (pixel *) _dst; |
34 | 1.29M | dctcoef *src = (dctcoef *) _src; |
35 | 1.29M | stride /= sizeof(pixel); |
36 | | |
37 | 6.47M | for (i = 0; i < 4; i++) { |
38 | 5.18M | dst[0] += (unsigned)src[0]; |
39 | 5.18M | dst[1] += (unsigned)src[1]; |
40 | 5.18M | dst[2] += (unsigned)src[2]; |
41 | 5.18M | dst[3] += (unsigned)src[3]; |
42 | | |
43 | 5.18M | dst += stride; |
44 | 5.18M | src += 4; |
45 | 5.18M | } |
46 | | |
47 | 1.29M | memset(_src, 0, sizeof(dctcoef) * 16); |
48 | 1.29M | } h264dsp.c:ff_h264_add_pixels4_16_c Line | Count | Source | 31 | 929k | { | 32 | 929k | int i; | 33 | 929k | pixel *dst = (pixel *) _dst; | 34 | 929k | dctcoef *src = (dctcoef *) _src; | 35 | 929k | stride /= sizeof(pixel); | 36 | | | 37 | 4.64M | for (i = 0; i < 4; i++) { | 38 | 3.71M | dst[0] += (unsigned)src[0]; | 39 | 3.71M | dst[1] += (unsigned)src[1]; | 40 | 3.71M | dst[2] += (unsigned)src[2]; | 41 | 3.71M | dst[3] += (unsigned)src[3]; | 42 | | | 43 | 3.71M | dst += stride; | 44 | 3.71M | src += 4; | 45 | 3.71M | } | 46 | | | 47 | 929k | memset(_src, 0, sizeof(dctcoef) * 16); | 48 | 929k | } |
h264dsp.c:ff_h264_add_pixels4_8_c Line | Count | Source | 31 | 366k | { | 32 | 366k | int i; | 33 | 366k | pixel *dst = (pixel *) _dst; | 34 | 366k | dctcoef *src = (dctcoef *) _src; | 35 | 366k | stride /= sizeof(pixel); | 36 | | | 37 | 1.83M | for (i = 0; i < 4; i++) { | 38 | 1.46M | dst[0] += (unsigned)src[0]; | 39 | 1.46M | dst[1] += (unsigned)src[1]; | 40 | 1.46M | dst[2] += (unsigned)src[2]; | 41 | 1.46M | dst[3] += (unsigned)src[3]; | 42 | | | 43 | 1.46M | dst += stride; | 44 | 1.46M | src += 4; | 45 | 1.46M | } | 46 | | | 47 | 366k | memset(_src, 0, sizeof(dctcoef) * 16); | 48 | 366k | } |
|
49 | | |
50 | | static void FUNCC(ff_h264_add_pixels8)(uint8_t *_dst, int16_t *_src, int stride) |
51 | 1.22M | { |
52 | 1.22M | int i; |
53 | 1.22M | pixel *dst = (pixel *) _dst; |
54 | 1.22M | dctcoef *src = (dctcoef *) _src; |
55 | 1.22M | stride /= sizeof(pixel); |
56 | | |
57 | 11.0M | for (i = 0; i < 8; i++) { |
58 | 9.80M | dst[0] += (unsigned)src[0]; |
59 | 9.80M | dst[1] += (unsigned)src[1]; |
60 | 9.80M | dst[2] += (unsigned)src[2]; |
61 | 9.80M | dst[3] += (unsigned)src[3]; |
62 | 9.80M | dst[4] += (unsigned)src[4]; |
63 | 9.80M | dst[5] += (unsigned)src[5]; |
64 | 9.80M | dst[6] += (unsigned)src[6]; |
65 | 9.80M | dst[7] += (unsigned)src[7]; |
66 | | |
67 | 9.80M | dst += stride; |
68 | 9.80M | src += 8; |
69 | 9.80M | } |
70 | | |
71 | 1.22M | memset(_src, 0, sizeof(dctcoef) * 64); |
72 | 1.22M | } h264dsp.c:ff_h264_add_pixels8_16_c Line | Count | Source | 51 | 1.00M | { | 52 | 1.00M | int i; | 53 | 1.00M | pixel *dst = (pixel *) _dst; | 54 | 1.00M | dctcoef *src = (dctcoef *) _src; | 55 | 1.00M | stride /= sizeof(pixel); | 56 | | | 57 | 9.07M | for (i = 0; i < 8; i++) { | 58 | 8.06M | dst[0] += (unsigned)src[0]; | 59 | 8.06M | dst[1] += (unsigned)src[1]; | 60 | 8.06M | dst[2] += (unsigned)src[2]; | 61 | 8.06M | dst[3] += (unsigned)src[3]; | 62 | 8.06M | dst[4] += (unsigned)src[4]; | 63 | 8.06M | dst[5] += (unsigned)src[5]; | 64 | 8.06M | dst[6] += (unsigned)src[6]; | 65 | 8.06M | dst[7] += (unsigned)src[7]; | 66 | | | 67 | 8.06M | dst += stride; | 68 | 8.06M | src += 8; | 69 | 8.06M | } | 70 | | | 71 | 1.00M | memset(_src, 0, sizeof(dctcoef) * 64); | 72 | 1.00M | } |
h264dsp.c:ff_h264_add_pixels8_8_c Line | Count | Source | 51 | 217k | { | 52 | 217k | int i; | 53 | 217k | pixel *dst = (pixel *) _dst; | 54 | 217k | dctcoef *src = (dctcoef *) _src; | 55 | 217k | stride /= sizeof(pixel); | 56 | | | 57 | 1.95M | for (i = 0; i < 8; i++) { | 58 | 1.73M | dst[0] += (unsigned)src[0]; | 59 | 1.73M | dst[1] += (unsigned)src[1]; | 60 | 1.73M | dst[2] += (unsigned)src[2]; | 61 | 1.73M | dst[3] += (unsigned)src[3]; | 62 | 1.73M | dst[4] += (unsigned)src[4]; | 63 | 1.73M | dst[5] += (unsigned)src[5]; | 64 | 1.73M | dst[6] += (unsigned)src[6]; | 65 | 1.73M | dst[7] += (unsigned)src[7]; | 66 | | | 67 | 1.73M | dst += stride; | 68 | 1.73M | src += 8; | 69 | 1.73M | } | 70 | | | 71 | 217k | memset(_src, 0, sizeof(dctcoef) * 64); | 72 | 217k | } |
|