annotate ppc/dsputil_h264_altivec.c @ 3567:1f8730f62765 libavcodec

r5954 broke fft on cpus with 3dnow but without mm3dnow.h
author lorenm
date Thu, 10 Aug 2006 18:49:47 +0000
parents 8bb61d9a2c40
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
1 /*
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
2 * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org>
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
3 *
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
4 * This library is free software; you can redistribute it and/or
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
5 * modify it under the terms of the GNU Lesser General Public
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
8 *
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
12 * Lesser General Public License for more details.
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
13 *
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
14 * You should have received a copy of the GNU Lesser General Public
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
15 * License along with this library; if not, write to the Free Software
3036
0b546eab515d Update licensing information: The FSF changed postal address.
diego
parents: 2979
diff changeset
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
17 */
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
18
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
19 #include "../dsputil.h"
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
20
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
21 #include "gcc_fixes.h"
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
22
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
23 #include "dsputil_altivec.h"
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
24
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
25 #define PUT_OP_U8_ALTIVEC(d, s, dst) d = s
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
26 #define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s)
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
27
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
28 #define OP_U8_ALTIVEC PUT_OP_U8_ALTIVEC
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
29 #define PREFIX_h264_chroma_mc8_altivec put_h264_chroma_mc8_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
30 #define PREFIX_h264_chroma_mc8_num altivec_put_h264_chroma_mc8_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
31 #define PREFIX_h264_qpel16_h_lowpass_altivec put_h264_qpel16_h_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
32 #define PREFIX_h264_qpel16_h_lowpass_num altivec_put_h264_qpel16_h_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
33 #define PREFIX_h264_qpel16_v_lowpass_altivec put_h264_qpel16_v_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
34 #define PREFIX_h264_qpel16_v_lowpass_num altivec_put_h264_qpel16_v_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
35 #define PREFIX_h264_qpel16_hv_lowpass_altivec put_h264_qpel16_hv_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
36 #define PREFIX_h264_qpel16_hv_lowpass_num altivec_put_h264_qpel16_hv_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
37 #include "dsputil_h264_template_altivec.c"
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
38 #undef OP_U8_ALTIVEC
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
39 #undef PREFIX_h264_chroma_mc8_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
40 #undef PREFIX_h264_chroma_mc8_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
41 #undef PREFIX_h264_qpel16_h_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
42 #undef PREFIX_h264_qpel16_h_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
43 #undef PREFIX_h264_qpel16_v_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
44 #undef PREFIX_h264_qpel16_v_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
45 #undef PREFIX_h264_qpel16_hv_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
46 #undef PREFIX_h264_qpel16_hv_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
47
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
48 #define OP_U8_ALTIVEC AVG_OP_U8_ALTIVEC
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
49 #define PREFIX_h264_chroma_mc8_altivec avg_h264_chroma_mc8_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
50 #define PREFIX_h264_chroma_mc8_num altivec_avg_h264_chroma_mc8_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
51 #define PREFIX_h264_qpel16_h_lowpass_altivec avg_h264_qpel16_h_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
52 #define PREFIX_h264_qpel16_h_lowpass_num altivec_avg_h264_qpel16_h_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
53 #define PREFIX_h264_qpel16_v_lowpass_altivec avg_h264_qpel16_v_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
54 #define PREFIX_h264_qpel16_v_lowpass_num altivec_avg_h264_qpel16_v_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
55 #define PREFIX_h264_qpel16_hv_lowpass_altivec avg_h264_qpel16_hv_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
56 #define PREFIX_h264_qpel16_hv_lowpass_num altivec_avg_h264_qpel16_hv_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
57 #include "dsputil_h264_template_altivec.c"
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
58 #undef OP_U8_ALTIVEC
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
59 #undef PREFIX_h264_chroma_mc8_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
60 #undef PREFIX_h264_chroma_mc8_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
61 #undef PREFIX_h264_qpel16_h_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
62 #undef PREFIX_h264_qpel16_h_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
63 #undef PREFIX_h264_qpel16_v_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
64 #undef PREFIX_h264_qpel16_v_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
65 #undef PREFIX_h264_qpel16_hv_lowpass_altivec
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
66 #undef PREFIX_h264_qpel16_hv_lowpass_num
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
67
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
68 #define H264_MC(OPNAME, SIZE, CODETYPE) \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
69 static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, int stride){\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
70 OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
71 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
72 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
73 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
74 DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
75 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
76 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
77 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
78 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
79 static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
80 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(dst, src, stride, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
81 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
82 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
83 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
84 DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
85 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
86 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
87 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
88 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
89 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
90 DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
91 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
92 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
93 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
94 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
95 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
96 OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(dst, src, stride, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
97 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
98 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
99 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
100 DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
101 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
102 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
103 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
104 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
105 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
106 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
107 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
108 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
109 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
110 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
111 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
112 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
113 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
114 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
115 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
116 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
117 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
118 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
119 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
120 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
121 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
122 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
123 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
124 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
125 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
126 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
127 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
128 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
129 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
130 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
131 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
132 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
133 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
134 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
135 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
136 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
137 static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
138 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
139 OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(dst, tmp, src, stride, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
140 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
141 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
142 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
143 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
144 DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
145 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
146 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
147 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
148 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
149 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
150 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
151 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
152 DECLARE_ALIGNED_16(uint8_t, halfH[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
153 DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
154 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
155 put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
156 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
157 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
158 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
159 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
160 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
161 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
162 DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
163 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
164 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
165 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
166 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
167 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
168 \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
169 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
3544
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
170 DECLARE_ALIGNED_16(uint8_t, halfV[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
171 DECLARE_ALIGNED_16(uint8_t, halfHV[SIZE*SIZE]);\
8bb61d9a2c40 avoid alignment hacks, luckly gcc does the right thing on arches different from x86
lu_zero
parents: 3337
diff changeset
172 DECLARE_ALIGNED_16(int16_t, tmp[SIZE*(SIZE+8)]);\
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
173 put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
174 put_h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(halfHV, tmp, src, SIZE, SIZE, stride);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
175 OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
176 }\
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
177
3337
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
178 static inline void put_pixels16_l2_altivec( uint8_t * dst, const uint8_t * src1,
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
179 const uint8_t * src2, int dst_stride,
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
180 int src_stride1, int h)
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
181 {
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
182 int i;
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
183 vector unsigned char a, b, d, tmp1, tmp2, mask, mask_, edges, align;
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
184
3337
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
185 mask_ = vec_lvsl(0, src2);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
186
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
187 for (i = 0; i < h; i++) {
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
188
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
189 tmp1 = vec_ld(i * src_stride1, src1);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
190 mask = vec_lvsl(i * src_stride1, src1);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
191 tmp2 = vec_ld(i * src_stride1 + 15, src1);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
192
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
193 a = vec_perm(tmp1, tmp2, mask);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
194
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
195 tmp1 = vec_ld(i * 16, src2);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
196 tmp2 = vec_ld(i * 16 + 15, src2);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
197
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
198 b = vec_perm(tmp1, tmp2, mask_);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
199
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
200 tmp1 = vec_ld(0, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
201 mask = vec_lvsl(0, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
202 tmp2 = vec_ld(15, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
203
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
204 d = vec_avg(a, b);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
205
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
206 edges = vec_perm(tmp2, tmp1, mask);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
207
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
208 align = vec_lvsr(0, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
209
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
210 tmp1 = vec_perm(edges, d, align);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
211 tmp2 = vec_perm(d, edges, align);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
212
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
213 vec_st(tmp2, 15, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
214 vec_st(tmp1, 0 , dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
215
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
216 dst += dst_stride;
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
217 }
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
218 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
219
3337
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
220 static inline void avg_pixels16_l2_altivec( uint8_t * dst, const uint8_t * src1,
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
221 const uint8_t * src2, int dst_stride,
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
222 int src_stride1, int h)
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
223 {
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
224 int i;
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
225 vector unsigned char a, b, d, tmp1, tmp2, mask, mask_, edges, align;
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
226
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
227 mask_ = vec_lvsl(0, src2);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
228
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
229 for (i = 0; i < h; i++) {
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
230
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
231 tmp1 = vec_ld(i * src_stride1, src1);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
232 mask = vec_lvsl(i * src_stride1, src1);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
233 tmp2 = vec_ld(i * src_stride1 + 15, src1);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
234
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
235 a = vec_perm(tmp1, tmp2, mask);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
236
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
237 tmp1 = vec_ld(i * 16, src2);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
238 tmp2 = vec_ld(i * 16 + 15, src2);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
239
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
240 b = vec_perm(tmp1, tmp2, mask_);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
241
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
242 tmp1 = vec_ld(0, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
243 mask = vec_lvsl(0, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
244 tmp2 = vec_ld(15, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
245
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
246 d = vec_avg(vec_perm(tmp1, tmp2, mask), vec_avg(a, b));
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
247
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
248 edges = vec_perm(tmp2, tmp1, mask);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
249
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
250 align = vec_lvsr(0, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
251
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
252 tmp1 = vec_perm(edges, d, align);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
253 tmp2 = vec_perm(d, edges, align);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
254
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
255 vec_st(tmp2, 15, dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
256 vec_st(tmp1, 0 , dst);
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
257
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
258 dst += dst_stride;
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
259 }
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
260 }
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
261
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
262 /* Implemented but could be faster
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
263 #define put_pixels16_l2_altivec(d,s1,s2,ds,s1s,h) put_pixels16_l2(d,s1,s2,ds,s1s,16,h)
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
264 #define avg_pixels16_l2_altivec(d,s1,s2,ds,s1s,h) avg_pixels16_l2(d,s1,s2,ds,s1s,16,h)
3337
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
265 */
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
266
3337
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
267 H264_MC(put_, 16, altivec)
bec1eb6d3746 put_pixels16_l2_altivec and avg_pixels16_l2_altivec
lu_zero
parents: 3089
diff changeset
268 H264_MC(avg_, 16, altivec)
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
269
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
270 void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
271
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
272 #ifdef HAVE_ALTIVEC
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
273 if (has_altivec()) {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
274 c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
275 c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec;
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
276
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
277 #define dspfunc(PFX, IDX, NUM) \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
278 c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
279 c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
280 c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
281 c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
282 c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
283 c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
284 c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
285 c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
286 c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
287 c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
288 c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
289 c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
290 c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
291 c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
292 c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_altivec; \
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
293 c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
294
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
295 dspfunc(put_h264_qpel, 0, 16);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
296 dspfunc(avg_h264_qpel, 0, 16);
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
297 #undef dspfunc
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
298
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
299 } else
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
300 #endif /* HAVE_ALTIVEC */
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
301 {
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
302 // Non-AltiVec PPC optimisations
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2236
diff changeset
303
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
304 // ... pending ...
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
305 }
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents:
diff changeset
306 }