OLD | NEW |
1 /* | 1 /* |
2 * GMC (Global Motion Compensation) | 2 * GMC (Global Motion Compensation) |
3 * AltiVec-enabled | 3 * AltiVec-enabled |
4 * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org> | 4 * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org> |
5 * | 5 * |
6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
7 * | 7 * |
8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
11 * version 2.1 of the License, or (at your option) any later version. | 11 * version 2.1 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * FFmpeg is distributed in the hope that it will be useful, | 13 * FFmpeg is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Lesser General Public License for more details. | 16 * Lesser General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Lesser General Public | 18 * You should have received a copy of the GNU Lesser General Public |
19 * License along with FFmpeg; if not, write to the Free Software | 19 * License along with FFmpeg; if not, write to the Free Software |
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 */ | 21 */ |
22 | 22 |
23 #include "libavcodec/dsputil.h" | 23 #include "libavcodec/dsputil.h" |
24 #include "dsputil_ppc.h" | 24 #include "dsputil_ppc.h" |
25 #include "util_altivec.h" | 25 #include "util_altivec.h" |
26 #include "types_altivec.h" | 26 #include "types_altivec.h" |
| 27 #include "dsputil_altivec.h" |
27 | 28 |
28 /* | 29 /* |
29 altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8, | 30 altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8, |
30 to preserve proper dst alignment. | 31 to preserve proper dst alignment. |
31 */ | 32 */ |
32 #define GMC1_PERF_COND (h==8) | 33 #define GMC1_PERF_COND (h==8) |
33 void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int str
ide, int h, int x16, int y16, int rounder) | 34 void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int str
ide, int h, int x16, int y16, int rounder) |
34 { | 35 { |
35 POWERPC_PERF_DECLARE(altivec_gmc1_num, GMC1_PERF_COND); | 36 POWERPC_PERF_DECLARE(altivec_gmc1_num, GMC1_PERF_COND); |
36 const DECLARE_ALIGNED_16(unsigned short, rounder_a) = rounder; | 37 const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder; |
37 const DECLARE_ALIGNED_16(unsigned short, ABCD)[8] = | 38 const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] = |
38 { | 39 { |
39 (16-x16)*(16-y16), /* A */ | 40 (16-x16)*(16-y16), /* A */ |
40 ( x16)*(16-y16), /* B */ | 41 ( x16)*(16-y16), /* B */ |
41 (16-x16)*( y16), /* C */ | 42 (16-x16)*( y16), /* C */ |
42 ( x16)*( y16), /* D */ | 43 ( x16)*( y16), /* D */ |
43 0, 0, 0, 0 /* padding */ | 44 0, 0, 0, 0 /* padding */ |
44 }; | 45 }; |
45 register const vector unsigned char vczero = (const vector unsigned char)vec
_splat_u8(0); | 46 register const vector unsigned char vczero = (const vector unsigned char)vec
_splat_u8(0); |
46 register const vector unsigned short vcsr8 = (const vector unsigned short)ve
c_splat_u16(8); | 47 register const vector unsigned short vcsr8 = (const vector unsigned short)ve
c_splat_u16(8); |
47 register vector unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC
, srcvD; | 48 register vector unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC
, srcvD; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 129 } |
129 | 130 |
130 vec_st(dstv2, 0, dst); | 131 vec_st(dstv2, 0, dst); |
131 | 132 |
132 dst += stride; | 133 dst += stride; |
133 src += stride; | 134 src += stride; |
134 } | 135 } |
135 | 136 |
136 POWERPC_PERF_STOP_COUNT(altivec_gmc1_num, GMC1_PERF_COND); | 137 POWERPC_PERF_STOP_COUNT(altivec_gmc1_num, GMC1_PERF_COND); |
137 } | 138 } |
OLD | NEW |