annotate x86/h264dsp_mmx.c @ 12435:fe78a4548d12 libavcodec

Put ff_ prefix on non-static {put_signed,put,add}_pixels_clamped_mmx() functions.
author rbultje
date Mon, 30 Aug 2010 16:22:27 +0000
parents 3fc4c625b6f3
children b242eb86ea9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1 /*
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2 * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
3 *
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
4 * This file is part of FFmpeg.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
5 *
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
10 *
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
14 * Lesser General Public License for more details.
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
15 *
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
19 */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
20
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
21 #include "dsputil_mmx.h"
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
22 #include "libavcodec/h264pred.h"
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
23
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
24 DECLARE_ALIGNED(8, static const uint64_t, ff_pb_3_1 ) = 0x0103010301030103ULL;
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
25 DECLARE_ALIGNED(8, static const uint64_t, ff_pb_7_3 ) = 0x0307030703070307ULL;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
26
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
27 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
28 /* IDCT */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
29
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
30 #define SUMSUB_BADC( a, b, c, d ) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
31 "paddw "#b", "#a" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
32 "paddw "#d", "#c" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
33 "paddw "#b", "#b" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
34 "paddw "#d", "#d" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
35 "psubw "#a", "#b" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
36 "psubw "#c", "#d" \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
37
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
38 #define SUMSUBD2_AB( a, b, t ) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
39 "movq "#b", "#t" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
40 "psraw $1 , "#b" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
41 "paddw "#a", "#b" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
42 "psraw $1 , "#a" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
43 "psubw "#t", "#a" \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
44
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
45 #define IDCT4_1D( s02, s13, d02, d13, t ) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
46 SUMSUB_BA ( s02, d02 )\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
47 SUMSUBD2_AB( s13, d13, t )\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
48 SUMSUB_BADC( d13, s02, s13, d02 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
49
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
50 #define STORE_DIFF_4P( p, t, z ) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
51 "psraw $6, "#p" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
52 "movd (%0), "#t" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
53 "punpcklbw "#z", "#t" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
54 "paddsw "#t", "#p" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
55 "packuswb "#z", "#p" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
56 "movd "#p", (%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
57
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
58 static void ff_h264_idct_add_mmx(uint8_t *dst, int16_t *block, int stride)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
59 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
60 /* Load dct coeffs */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
61 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
62 "movq (%0), %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
63 "movq 8(%0), %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
64 "movq 16(%0), %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
65 "movq 24(%0), %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
66 :: "r"(block) );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
67
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
68 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
69 /* mm1=s02+s13 mm2=s02-s13 mm4=d02+d13 mm0=d02-d13 */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
70 IDCT4_1D( %%mm2, %%mm1, %%mm0, %%mm3, %%mm4 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
71
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
72 "movq %0, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
73 /* in: 1,4,0,2 out: 1,2,3,0 */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
74 TRANSPOSE4( %%mm3, %%mm1, %%mm0, %%mm2, %%mm4 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
75
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
76 "paddw %%mm6, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
77
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
78 /* mm2=s02+s13 mm3=s02-s13 mm4=d02+d13 mm1=d02-d13 */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
79 IDCT4_1D( %%mm4, %%mm2, %%mm3, %%mm0, %%mm1 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
80
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
81 "pxor %%mm7, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
82 :: "m"(ff_pw_32));
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
83
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
84 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
85 STORE_DIFF_4P( %%mm0, %%mm1, %%mm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
86 "add %1, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
87 STORE_DIFF_4P( %%mm2, %%mm1, %%mm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
88 "add %1, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
89 STORE_DIFF_4P( %%mm3, %%mm1, %%mm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
90 "add %1, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
91 STORE_DIFF_4P( %%mm4, %%mm1, %%mm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
92 : "+r"(dst)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
93 : "r" ((x86_reg)stride)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
94 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
95 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
96
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
97 static inline void h264_idct8_1d(int16_t *block)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
98 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
99 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
100 "movq 112(%0), %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
101 "movq 80(%0), %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
102 "movq 48(%0), %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
103 "movq 16(%0), %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
104
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
105 "movq %%mm0, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
106 "movq %%mm5, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
107 "psraw $1, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
108 "psraw $1, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
109 "paddw %%mm0, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
110 "paddw %%mm5, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
111 "paddw %%mm7, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
112 "paddw %%mm0, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
113 "psubw %%mm5, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
114 "paddw %%mm3, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
115
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
116 "psubw %%mm3, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
117 "psubw %%mm3, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
118 "paddw %%mm7, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
119 "psubw %%mm7, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
120 "psraw $1, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
121 "psraw $1, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
122 "psubw %%mm3, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
123 "psubw %%mm7, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
124
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
125 "movq %%mm4, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
126 "movq %%mm1, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
127 "psraw $2, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
128 "psraw $2, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
129 "paddw %%mm5, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
130 "psraw $2, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
131 "paddw %%mm0, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
132 "psraw $2, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
133 "psubw %%mm4, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
134 "psubw %%mm0, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
135
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
136 "movq 32(%0), %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
137 "movq 96(%0), %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
138 "movq %%mm2, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
139 "movq %%mm6, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
140 "psraw $1, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
141 "psraw $1, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
142 "psubw %%mm0, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
143 "paddw %%mm2, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
144
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
145 "movq (%0), %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
146 "movq 64(%0), %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
147 SUMSUB_BA( %%mm0, %%mm2 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
148 SUMSUB_BA( %%mm6, %%mm0 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
149 SUMSUB_BA( %%mm4, %%mm2 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
150 SUMSUB_BA( %%mm7, %%mm6 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
151 SUMSUB_BA( %%mm5, %%mm4 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
152 SUMSUB_BA( %%mm3, %%mm2 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
153 SUMSUB_BA( %%mm1, %%mm0 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
154 :: "r"(block)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
155 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
156 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
157
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
158 static void ff_h264_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
159 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
160 int i;
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
161 DECLARE_ALIGNED(8, int16_t, b2)[64];
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
162
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
163 block[0] += 32;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
164
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
165 for(i=0; i<2; i++){
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
166 DECLARE_ALIGNED(8, uint64_t, tmp);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
167
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
168 h264_idct8_1d(block+4*i);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
169
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
170 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
171 "movq %%mm7, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
172 TRANSPOSE4( %%mm0, %%mm2, %%mm4, %%mm6, %%mm7 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
173 "movq %%mm0, 8(%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
174 "movq %%mm6, 24(%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
175 "movq %%mm7, 40(%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
176 "movq %%mm4, 56(%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
177 "movq %0, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
178 TRANSPOSE4( %%mm7, %%mm5, %%mm3, %%mm1, %%mm0 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
179 "movq %%mm7, (%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
180 "movq %%mm1, 16(%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
181 "movq %%mm0, 32(%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
182 "movq %%mm3, 48(%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
183 : "=m"(tmp)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
184 : "r"(b2+32*i)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
185 : "memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
186 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
187 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
188
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
189 for(i=0; i<2; i++){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
190 h264_idct8_1d(b2+4*i);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
191
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
192 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
193 "psraw $6, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
194 "psraw $6, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
195 "psraw $6, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
196 "psraw $6, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
197 "psraw $6, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
198 "psraw $6, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
199 "psraw $6, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
200 "psraw $6, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
201
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
202 "movq %%mm7, (%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
203 "movq %%mm5, 16(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
204 "movq %%mm3, 32(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
205 "movq %%mm1, 48(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
206 "movq %%mm0, 64(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
207 "movq %%mm2, 80(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
208 "movq %%mm4, 96(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
209 "movq %%mm6, 112(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
210 :: "r"(b2+4*i)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
211 : "memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
212 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
213 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
214
12435
fe78a4548d12 Put ff_ prefix on non-static {put_signed,put,add}_pixels_clamped_mmx()
rbultje
parents: 12414
diff changeset
215 ff_add_pixels_clamped_mmx(b2, dst, stride);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
216 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
217
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
218 #define STORE_DIFF_8P( p, d, t, z )\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
219 "movq "#d", "#t" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
220 "psraw $6, "#p" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
221 "punpcklbw "#z", "#t" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
222 "paddsw "#t", "#p" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
223 "packuswb "#p", "#p" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
224 "movq "#p", "#d" \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
225
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
226 #define H264_IDCT8_1D_SSE2(a,b,c,d,e,f,g,h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
227 "movdqa "#c", "#a" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
228 "movdqa "#g", "#e" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
229 "psraw $1, "#c" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
230 "psraw $1, "#g" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
231 "psubw "#e", "#c" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
232 "paddw "#a", "#g" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
233 "movdqa "#b", "#e" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
234 "psraw $1, "#e" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
235 "paddw "#b", "#e" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
236 "paddw "#d", "#e" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
237 "paddw "#f", "#e" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
238 "movdqa "#f", "#a" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
239 "psraw $1, "#a" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
240 "paddw "#f", "#a" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
241 "paddw "#h", "#a" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
242 "psubw "#b", "#a" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
243 "psubw "#d", "#b" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
244 "psubw "#d", "#f" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
245 "paddw "#h", "#b" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
246 "psubw "#h", "#f" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
247 "psraw $1, "#d" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
248 "psraw $1, "#h" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
249 "psubw "#d", "#b" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
250 "psubw "#h", "#f" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
251 "movdqa "#e", "#d" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
252 "movdqa "#a", "#h" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
253 "psraw $2, "#d" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
254 "psraw $2, "#h" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
255 "paddw "#f", "#d" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
256 "paddw "#b", "#h" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
257 "psraw $2, "#f" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
258 "psraw $2, "#b" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
259 "psubw "#f", "#e" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
260 "psubw "#a", "#b" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
261 "movdqa 0x00(%1), "#a" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
262 "movdqa 0x40(%1), "#f" \n"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
263 SUMSUB_BA(f, a)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
264 SUMSUB_BA(g, f)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
265 SUMSUB_BA(c, a)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
266 SUMSUB_BA(e, g)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
267 SUMSUB_BA(b, c)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
268 SUMSUB_BA(h, a)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
269 SUMSUB_BA(d, f)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
270
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
271 static void ff_h264_idct8_add_sse2(uint8_t *dst, int16_t *block, int stride)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
272 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
273 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
274 "movdqa 0x10(%1), %%xmm1 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
275 "movdqa 0x20(%1), %%xmm2 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
276 "movdqa 0x30(%1), %%xmm3 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
277 "movdqa 0x50(%1), %%xmm5 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
278 "movdqa 0x60(%1), %%xmm6 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
279 "movdqa 0x70(%1), %%xmm7 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
280 H264_IDCT8_1D_SSE2(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
281 TRANSPOSE8(%%xmm4, %%xmm1, %%xmm7, %%xmm3, %%xmm5, %%xmm0, %%xmm2, %%xmm6, (%1))
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
282 "paddw %4, %%xmm4 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
283 "movdqa %%xmm4, 0x00(%1) \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
284 "movdqa %%xmm2, 0x40(%1) \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
285 H264_IDCT8_1D_SSE2(%%xmm4, %%xmm0, %%xmm6, %%xmm3, %%xmm2, %%xmm5, %%xmm7, %%xmm1)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
286 "movdqa %%xmm6, 0x60(%1) \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
287 "movdqa %%xmm7, 0x70(%1) \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
288 "pxor %%xmm7, %%xmm7 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
289 STORE_DIFF_8P(%%xmm2, (%0), %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
290 STORE_DIFF_8P(%%xmm0, (%0,%2), %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
291 STORE_DIFF_8P(%%xmm1, (%0,%2,2), %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
292 STORE_DIFF_8P(%%xmm3, (%0,%3), %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
293 "lea (%0,%2,4), %0 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
294 STORE_DIFF_8P(%%xmm5, (%0), %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
295 STORE_DIFF_8P(%%xmm4, (%0,%2), %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
296 "movdqa 0x60(%1), %%xmm0 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
297 "movdqa 0x70(%1), %%xmm1 \n"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
298 STORE_DIFF_8P(%%xmm0, (%0,%2,2), %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
299 STORE_DIFF_8P(%%xmm1, (%0,%3), %%xmm6, %%xmm7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
300 :"+r"(dst)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
301 :"r"(block), "r"((x86_reg)stride), "r"((x86_reg)3L*stride), "m"(ff_pw_32)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
302 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
303 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
304
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
305 static void ff_h264_idct_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
306 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
307 int dc = (block[0] + 32) >> 6;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
308 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
309 "movd %0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
310 "pshufw $0, %%mm0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
311 "pxor %%mm1, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
312 "psubw %%mm0, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
313 "packuswb %%mm0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
314 "packuswb %%mm1, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
315 ::"r"(dc)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
316 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
317 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
318 "movd %0, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
319 "movd %1, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
320 "movd %2, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
321 "movd %3, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
322 "paddusb %%mm0, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
323 "paddusb %%mm0, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
324 "paddusb %%mm0, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
325 "paddusb %%mm0, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
326 "psubusb %%mm1, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
327 "psubusb %%mm1, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
328 "psubusb %%mm1, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
329 "psubusb %%mm1, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
330 "movd %%mm2, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
331 "movd %%mm3, %1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
332 "movd %%mm4, %2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
333 "movd %%mm5, %3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
334 :"+m"(*(uint32_t*)(dst+0*stride)),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
335 "+m"(*(uint32_t*)(dst+1*stride)),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
336 "+m"(*(uint32_t*)(dst+2*stride)),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
337 "+m"(*(uint32_t*)(dst+3*stride))
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
338 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
339 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
340
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
341 static void ff_h264_idct8_dc_add_mmx2(uint8_t *dst, int16_t *block, int stride)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
342 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
343 int dc = (block[0] + 32) >> 6;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
344 int y;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
345 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
346 "movd %0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
347 "pshufw $0, %%mm0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
348 "pxor %%mm1, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
349 "psubw %%mm0, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
350 "packuswb %%mm0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
351 "packuswb %%mm1, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
352 ::"r"(dc)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
353 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
354 for(y=2; y--; dst += 4*stride){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
355 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
356 "movq %0, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
357 "movq %1, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
358 "movq %2, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
359 "movq %3, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
360 "paddusb %%mm0, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
361 "paddusb %%mm0, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
362 "paddusb %%mm0, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
363 "paddusb %%mm0, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
364 "psubusb %%mm1, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
365 "psubusb %%mm1, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
366 "psubusb %%mm1, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
367 "psubusb %%mm1, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
368 "movq %%mm2, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
369 "movq %%mm3, %1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
370 "movq %%mm4, %2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
371 "movq %%mm5, %3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
372 :"+m"(*(uint64_t*)(dst+0*stride)),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
373 "+m"(*(uint64_t*)(dst+1*stride)),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
374 "+m"(*(uint64_t*)(dst+2*stride)),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
375 "+m"(*(uint64_t*)(dst+3*stride))
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
376 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
377 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
378 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
379
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
380 //FIXME this table is a duplicate from h264data.h, and will be removed once the tables from, h264 have been split
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
381 static const uint8_t scan8[16 + 2*4]={
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
382 4+1*8, 5+1*8, 4+2*8, 5+2*8,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
383 6+1*8, 7+1*8, 6+2*8, 7+2*8,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
384 4+3*8, 5+3*8, 4+4*8, 5+4*8,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
385 6+3*8, 7+3*8, 6+4*8, 7+4*8,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
386 1+1*8, 2+1*8,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
387 1+2*8, 2+2*8,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
388 1+4*8, 2+4*8,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
389 1+5*8, 2+5*8,
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
390 };
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
391
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
392 static void ff_h264_idct_add16_mmx(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
393 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
394 for(i=0; i<16; i++){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
395 if(nnzc[ scan8[i] ])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
396 ff_h264_idct_add_mmx(dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
397 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
398 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
399
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
400 static void ff_h264_idct8_add4_mmx(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
401 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
402 for(i=0; i<16; i+=4){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
403 if(nnzc[ scan8[i] ])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
404 ff_h264_idct8_add_mmx(dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
405 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
406 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
407
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
408
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
409 static void ff_h264_idct_add16_mmx2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
410 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
411 for(i=0; i<16; i++){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
412 int nnz = nnzc[ scan8[i] ];
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
413 if(nnz){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
414 if(nnz==1 && block[i*16]) ff_h264_idct_dc_add_mmx2(dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
415 else ff_h264_idct_add_mmx (dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
416 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
417 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
418 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
419
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
420 static void ff_h264_idct_add16intra_mmx(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
421 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
422 for(i=0; i<16; i++){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
423 if(nnzc[ scan8[i] ] || block[i*16])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
424 ff_h264_idct_add_mmx(dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
425 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
426 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
427
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
428 static void ff_h264_idct_add16intra_mmx2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
429 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
430 for(i=0; i<16; i++){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
431 if(nnzc[ scan8[i] ]) ff_h264_idct_add_mmx (dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
432 else if(block[i*16]) ff_h264_idct_dc_add_mmx2(dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
433 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
434 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
435
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
436 static void ff_h264_idct8_add4_mmx2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
437 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
438 for(i=0; i<16; i+=4){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
439 int nnz = nnzc[ scan8[i] ];
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
440 if(nnz){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
441 if(nnz==1 && block[i*16]) ff_h264_idct8_dc_add_mmx2(dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
442 else ff_h264_idct8_add_mmx (dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
443 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
444 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
445 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
446
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
447 static void ff_h264_idct8_add4_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
448 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
449 for(i=0; i<16; i+=4){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
450 int nnz = nnzc[ scan8[i] ];
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
451 if(nnz){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
452 if(nnz==1 && block[i*16]) ff_h264_idct8_dc_add_mmx2(dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
453 else ff_h264_idct8_add_sse2 (dst + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
454 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
455 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
456 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
457
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
458 static void ff_h264_idct_add8_mmx(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
459 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
460 for(i=16; i<16+8; i++){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
461 if(nnzc[ scan8[i] ] || block[i*16])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
462 ff_h264_idct_add_mmx (dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
463 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
464 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
465
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
466 static void ff_h264_idct_add8_mmx2(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
467 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
468 for(i=16; i<16+8; i++){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
469 if(nnzc[ scan8[i] ])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
470 ff_h264_idct_add_mmx (dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
471 else if(block[i*16])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
472 ff_h264_idct_dc_add_mmx2(dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
473 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
474 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
475
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8519
diff changeset
476 #if CONFIG_GPL && HAVE_YASM
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
477 static void ff_h264_idct_dc_add8_mmx2(uint8_t *dst, int16_t *block, int stride)
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
478 {
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
479 __asm__ volatile(
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
480 "movd %0, %%mm0 \n\t" // 0 0 X D
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
481 "punpcklwd %1, %%mm0 \n\t" // x X d D
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
482 "paddsw %2, %%mm0 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
483 "psraw $6, %%mm0 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
484 "punpcklwd %%mm0, %%mm0 \n\t" // d d D D
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
485 "pxor %%mm1, %%mm1 \n\t" // 0 0 0 0
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
486 "psubw %%mm0, %%mm1 \n\t" // -d-d-D-D
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
487 "packuswb %%mm1, %%mm0 \n\t" // -d-d-D-D d d D D
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
488 "pshufw $0xFA, %%mm0, %%mm1 \n\t" // -d-d-d-d-D-D-D-D
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
489 "punpcklwd %%mm0, %%mm0 \n\t" // d d d d D D D D
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
490 ::"m"(block[ 0]),
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
491 "m"(block[16]),
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
492 "m"(ff_pw_32)
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
493 );
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
494 __asm__ volatile(
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
495 "movq %0, %%mm2 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
496 "movq %1, %%mm3 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
497 "movq %2, %%mm4 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
498 "movq %3, %%mm5 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
499 "paddusb %%mm0, %%mm2 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
500 "paddusb %%mm0, %%mm3 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
501 "paddusb %%mm0, %%mm4 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
502 "paddusb %%mm0, %%mm5 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
503 "psubusb %%mm1, %%mm2 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
504 "psubusb %%mm1, %%mm3 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
505 "psubusb %%mm1, %%mm4 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
506 "psubusb %%mm1, %%mm5 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
507 "movq %%mm2, %0 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
508 "movq %%mm3, %1 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
509 "movq %%mm4, %2 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
510 "movq %%mm5, %3 \n\t"
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
511 :"+m"(*(uint64_t*)(dst+0*stride)),
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
512 "+m"(*(uint64_t*)(dst+1*stride)),
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
513 "+m"(*(uint64_t*)(dst+2*stride)),
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
514 "+m"(*(uint64_t*)(dst+3*stride))
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
515 );
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
516 }
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
517
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
518 extern void ff_x264_add8x4_idct_sse2(uint8_t *dst, int16_t *block, int stride);
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
519
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
520 static void ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
521 int i;
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
522 for(i=0; i<16; i+=2)
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
523 if(nnzc[ scan8[i+0] ]|nnzc[ scan8[i+1] ])
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
524 ff_x264_add8x4_idct_sse2 (dst + block_offset[i], block + i*16, stride);
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
525 }
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
526
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
527 static void ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
528 int i;
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
529 for(i=0; i<16; i+=2){
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
530 if(nnzc[ scan8[i+0] ]|nnzc[ scan8[i+1] ])
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
531 ff_x264_add8x4_idct_sse2 (dst + block_offset[i], block + i*16, stride);
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
532 else if(block[i*16]|block[i*16+16])
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
533 ff_h264_idct_dc_add8_mmx2(dst + block_offset[i], block + i*16, stride);
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
534 }
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
535 }
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
536
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
537 static void ff_h264_idct_add8_sse2(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
538 int i;
8758
93980b03673e fix typo in h264dsp_mmx (no effect currently as the function is not used), approved by Dark Shikari on IRC
bcoudurier
parents: 8590
diff changeset
539 for(i=16; i<16+8; i+=2){
8510
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
540 if(nnzc[ scan8[i+0] ]|nnzc[ scan8[i+1] ])
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
541 ff_x264_add8x4_idct_sse2 (dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
542 else if(block[i*16]|block[i*16+16])
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
543 ff_h264_idct_dc_add8_mmx2(dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
544 }
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
545 }
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
546 #endif
cea216e44ee3 Add x264 SSE2 iDCT functions to H.264 decoder.
darkshikari
parents: 8430
diff changeset
547
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
548 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
549 /* deblocking */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
550
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
551 // out: o = |x-y|>a
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
552 // clobbers: t
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
553 #define DIFF_GT_MMX(x,y,a,o,t)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
554 "movq "#y", "#t" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
555 "movq "#x", "#o" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
556 "psubusb "#x", "#t" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
557 "psubusb "#y", "#o" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
558 "por "#t", "#o" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
559 "psubusb "#a", "#o" \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
560
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
561 // out: o = |x-y|>a
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
562 // clobbers: t
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
563 #define DIFF_GT2_MMX(x,y,a,o,t)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
564 "movq "#y", "#t" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
565 "movq "#x", "#o" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
566 "psubusb "#x", "#t" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
567 "psubusb "#y", "#o" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
568 "psubusb "#a", "#t" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
569 "psubusb "#a", "#o" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
570 "pcmpeqb "#t", "#o" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
571
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
572 // in: mm0=p1 mm1=p0 mm2=q0 mm3=q1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
573 // out: mm5=beta-1, mm7=mask
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
574 // clobbers: mm4,mm6
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
575 #define H264_DEBLOCK_MASK(alpha1, beta1) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
576 "pshufw $0, "#alpha1", %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
577 "pshufw $0, "#beta1 ", %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
578 "packuswb %%mm4, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
579 "packuswb %%mm5, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
580 DIFF_GT_MMX(%%mm1, %%mm2, %%mm4, %%mm7, %%mm6) /* |p0-q0| > alpha-1 */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
581 DIFF_GT_MMX(%%mm0, %%mm1, %%mm5, %%mm4, %%mm6) /* |p1-p0| > beta-1 */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
582 "por %%mm4, %%mm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
583 DIFF_GT_MMX(%%mm3, %%mm2, %%mm5, %%mm4, %%mm6) /* |q1-q0| > beta-1 */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
584 "por %%mm4, %%mm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
585 "pxor %%mm6, %%mm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
586 "pcmpeqb %%mm6, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
587
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
588 // in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
589 // out: mm1=p0' mm2=q0'
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
590 // clobbers: mm0,3-6
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
591 #define H264_DEBLOCK_P0_Q0(pb_01, pb_3f)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
592 "movq %%mm1 , %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
593 "pxor %%mm2 , %%mm5 \n\t" /* p0^q0*/\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
594 "pand "#pb_01" , %%mm5 \n\t" /* (p0^q0)&1*/\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
595 "pcmpeqb %%mm4 , %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
596 "pxor %%mm4 , %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
597 "pavgb %%mm0 , %%mm3 \n\t" /* (p1 - q1 + 256)>>1*/\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
598 "pavgb "MANGLE(ff_pb_3)" , %%mm3 \n\t" /*(((p1 - q1 + 256)>>1)+4)>>1 = 64+2+(p1-q1)>>2*/\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
599 "pxor %%mm1 , %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
600 "pavgb %%mm2 , %%mm4 \n\t" /* (q0 - p0 + 256)>>1*/\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
601 "pavgb %%mm5 , %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
602 "paddusb %%mm4 , %%mm3 \n\t" /* d+128+33*/\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
603 "movq "MANGLE(ff_pb_A1)" , %%mm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
604 "psubusb %%mm3 , %%mm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
605 "psubusb "MANGLE(ff_pb_A1)" , %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
606 "pminub %%mm7 , %%mm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
607 "pminub %%mm7 , %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
608 "psubusb %%mm6 , %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
609 "psubusb %%mm3 , %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
610 "paddusb %%mm3 , %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
611 "paddusb %%mm6 , %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
612
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
613 // in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask) %8=ff_bone
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
614 // out: (q1addr) = av_clip( (q2+((p0+q0+1)>>1))>>1, q1-tc0, q1+tc0 )
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
615 // clobbers: q2, tmp, tc0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
616 #define H264_DEBLOCK_Q1(p1, q2, q2addr, q1addr, tc0, tmp)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
617 "movq %%mm1, "#tmp" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
618 "pavgb %%mm2, "#tmp" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
619 "pavgb "#tmp", "#q2" \n\t" /* avg(p2,avg(p0,q0)) */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
620 "pxor "q2addr", "#tmp" \n\t"\
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
621 "pand %9, "#tmp" \n\t" /* (p2^avg(p0,q0))&1 */\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
622 "psubusb "#tmp", "#q2" \n\t" /* (p2+((p0+q0+1)>>1))>>1 */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
623 "movq "#p1", "#tmp" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
624 "psubusb "#tc0", "#tmp" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
625 "paddusb "#p1", "#tc0" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
626 "pmaxub "#tmp", "#q2" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
627 "pminub "#tc0", "#q2" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
628 "movq "#q2", "q1addr" \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
629
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
630 static inline void h264_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
631 {
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
632 DECLARE_ALIGNED(8, uint64_t, tmp0)[2];
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
633
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
634 __asm__ volatile(
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
635 "movq (%2,%4), %%mm0 \n\t" //p1
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
636 "movq (%2,%4,2), %%mm1 \n\t" //p0
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
637 "movq (%3), %%mm2 \n\t" //q0
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
638 "movq (%3,%4), %%mm3 \n\t" //q1
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
639 H264_DEBLOCK_MASK(%7, %8)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
640
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
641 "movd %6, %%mm4 \n\t"
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
642 "punpcklbw %%mm4, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
643 "punpcklwd %%mm4, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
644 "pcmpeqb %%mm3, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
645 "movq %%mm4, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
646 "pcmpgtb %%mm3, %%mm4 \n\t"
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
647 "movq %%mm6, %1 \n\t"
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
648 "pand %%mm4, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
649 "movq %%mm7, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
650
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
651 /* filter p1 */
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
652 "movq (%2), %%mm3 \n\t" //p2
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
653 DIFF_GT2_MMX(%%mm1, %%mm3, %%mm5, %%mm6, %%mm4) // |p2-p0|>beta-1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
654 "pand %%mm7, %%mm6 \n\t" // mask & |p2-p0|<beta
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
655 "pand %1, %%mm7 \n\t" // mask & tc0
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
656 "movq %%mm7, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
657 "psubb %%mm6, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
658 "pand %%mm4, %%mm6 \n\t" // mask & |p2-p0|<beta & tc0
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
659 H264_DEBLOCK_Q1(%%mm0, %%mm3, "(%2)", "(%2,%4)", %%mm6, %%mm4)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
660
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
661 /* filter q1 */
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
662 "movq (%3,%4,2), %%mm4 \n\t" //q2
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
663 DIFF_GT2_MMX(%%mm2, %%mm4, %%mm5, %%mm6, %%mm3) // |q2-q0|>beta-1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
664 "pand %0, %%mm6 \n\t"
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
665 "movq %1, %%mm5 \n\t" // can be merged with the and below but is slower then
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
666 "pand %%mm6, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
667 "psubb %%mm6, %%mm7 \n\t"
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
668 "movq (%3,%4), %%mm3 \n\t"
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
669 H264_DEBLOCK_Q1(%%mm3, %%mm4, "(%3,%4,2)", "(%3,%4)", %%mm5, %%mm6)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
670
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
671 /* filter p0, q0 */
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
672 H264_DEBLOCK_P0_Q0(%9, unused)
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
673 "movq %%mm1, (%2,%4,2) \n\t"
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
674 "movq %%mm2, (%3) \n\t"
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
675
10955
fdddf3d4238f Use two separate memory arguments since 8+() is invalid gas syntax
conrad
parents: 10953
diff changeset
676 : "=m"(tmp0[0]), "=m"(tmp0[1])
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
677 : "r"(pix-3*stride), "r"(pix), "r"((x86_reg)stride),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
678 "m"(*tmp0/*unused*/), "m"(*(uint32_t*)tc0), "m"(alpha1), "m"(beta1),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
679 "m"(ff_bone)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
680 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
681 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
682
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
683 static void h264_v_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
684 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
685 if((tc0[0] & tc0[1]) >= 0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
686 h264_loop_filter_luma_mmx2(pix, stride, alpha-1, beta-1, tc0);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
687 if((tc0[2] & tc0[3]) >= 0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
688 h264_loop_filter_luma_mmx2(pix+8, stride, alpha-1, beta-1, tc0+2);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
689 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
690 static void h264_h_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
691 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
692 //FIXME: could cut some load/stores by merging transpose with filter
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
693 // also, it only needs to transpose 6x8
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
694 DECLARE_ALIGNED(8, uint8_t, trans)[8*8];
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
695 int i;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
696 for(i=0; i<2; i++, pix+=8*stride, tc0+=2) {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
697 if((tc0[0] & tc0[1]) < 0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
698 continue;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
699 transpose4x4(trans, pix-4, 8, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
700 transpose4x4(trans +4*8, pix, 8, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
701 transpose4x4(trans+4, pix-4+4*stride, 8, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
702 transpose4x4(trans+4+4*8, pix +4*stride, 8, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
703 h264_loop_filter_luma_mmx2(trans+4*8, 8, alpha-1, beta-1, tc0);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
704 transpose4x4(pix-2, trans +2*8, stride, 8);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
705 transpose4x4(pix-2+4*stride, trans+4+2*8, stride, 8);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
706 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
707 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
708
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
709 static inline void h264_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
710 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
711 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
712 "movq (%0), %%mm0 \n\t" //p1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
713 "movq (%0,%2), %%mm1 \n\t" //p0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
714 "movq (%1), %%mm2 \n\t" //q0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
715 "movq (%1,%2), %%mm3 \n\t" //q1
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
716 H264_DEBLOCK_MASK(%4, %5)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
717 "movd %3, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
718 "punpcklbw %%mm6, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
719 "pand %%mm6, %%mm7 \n\t" // mm7 = tc&mask
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
720 H264_DEBLOCK_P0_Q0(%6, %7)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
721 "movq %%mm1, (%0,%2) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
722 "movq %%mm2, (%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
723
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
724 :: "r"(pix-2*stride), "r"(pix), "r"((x86_reg)stride),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
725 "r"(*(uint32_t*)tc0),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
726 "m"(alpha1), "m"(beta1), "m"(ff_bone), "m"(ff_pb_3F)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
727 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
728 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
729
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
730 static void h264_v_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
731 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
732 h264_loop_filter_chroma_mmx2(pix, stride, alpha-1, beta-1, tc0);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
733 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
734
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
735 static void h264_h_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
736 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
737 //FIXME: could cut some load/stores by merging transpose with filter
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
738 DECLARE_ALIGNED(8, uint8_t, trans)[8*4];
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
739 transpose4x4(trans, pix-2, 8, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
740 transpose4x4(trans+4, pix-2+4*stride, 8, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
741 h264_loop_filter_chroma_mmx2(trans+2*8, 8, alpha-1, beta-1, tc0);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
742 transpose4x4(pix-2, trans, stride, 8);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
743 transpose4x4(pix-2+4*stride, trans+4, stride, 8);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
744 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
745
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
746 // p0 = (p0 + q1 + 2*p1 + 2) >> 2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
747 #define H264_FILTER_CHROMA4(p0, p1, q1, one) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
748 "movq "#p0", %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
749 "pxor "#q1", %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
750 "pand "#one", %%mm4 \n\t" /* mm4 = (p0^q1)&1 */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
751 "pavgb "#q1", "#p0" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
752 "psubusb %%mm4, "#p0" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
753 "pavgb "#p1", "#p0" \n\t" /* dst = avg(p1, avg(p0,q1) - ((p0^q1)&1)) */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
754
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
755 static inline void h264_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha1, int beta1)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
756 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
757 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
758 "movq (%0), %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
759 "movq (%0,%2), %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
760 "movq (%1), %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
761 "movq (%1,%2), %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
762 H264_DEBLOCK_MASK(%3, %4)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
763 "movq %%mm1, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
764 "movq %%mm2, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
765 H264_FILTER_CHROMA4(%%mm1, %%mm0, %%mm3, %5) //p0'
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
766 H264_FILTER_CHROMA4(%%mm2, %%mm3, %%mm0, %5) //q0'
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
767 "psubb %%mm5, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
768 "psubb %%mm6, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
769 "pand %%mm7, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
770 "pand %%mm7, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
771 "paddb %%mm5, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
772 "paddb %%mm6, %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
773 "movq %%mm1, (%0,%2) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
774 "movq %%mm2, (%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
775 :: "r"(pix-2*stride), "r"(pix), "r"((x86_reg)stride),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
776 "m"(alpha1), "m"(beta1), "m"(ff_bone)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
777 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
778 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
779
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
780 static void h264_v_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
781 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
782 h264_loop_filter_chroma_intra_mmx2(pix, stride, alpha-1, beta-1);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
783 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
784
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
785 static void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
786 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
787 //FIXME: could cut some load/stores by merging transpose with filter
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
788 DECLARE_ALIGNED(8, uint8_t, trans)[8*4];
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
789 transpose4x4(trans, pix-2, 8, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
790 transpose4x4(trans+4, pix-2+4*stride, 8, stride);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
791 h264_loop_filter_chroma_intra_mmx2(trans+2*8, 8, alpha-1, beta-1);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
792 transpose4x4(pix-2, trans, stride, 8);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
793 transpose4x4(pix-2+4*stride, trans+4, stride, 8);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
794 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
795
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
796 static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2],
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
797 int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field ) {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
798 int dir;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
799 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
800 "movq %0, %%mm7 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
801 "movq %1, %%mm6 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
802 ::"m"(ff_pb_1), "m"(ff_pb_3)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
803 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
804 if(field)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
805 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
806 "movq %0, %%mm6 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
807 ::"m"(ff_pb_3_1)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
808 );
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
809 __asm__ volatile(
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
810 "movq %%mm6, %%mm5 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
811 "paddb %%mm5, %%mm5 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
812 :);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
813
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
814 // could do a special case for dir==0 && edges==1, but it only reduces the
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
815 // average filter time by 1.2%
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
816 for( dir=1; dir>=0; dir-- ) {
10953
eb9a2581f50e Attempt to fix asm compilation failure.
michael
parents: 10943
diff changeset
817 const x86_reg d_idx = dir ? -8 : -1;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
818 const int mask_mv = dir ? mask_mv1 : mask_mv0;
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
819 DECLARE_ALIGNED(8, const uint64_t, mask_dir) = dir ? 0 : 0xffffffffffffffffULL;
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
820 int b_idx, edge;
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
821 for( b_idx=12, edge=0; edge<edges; edge+=step, b_idx+=8*step ) {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
822 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
823 "pand %0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
824 ::"m"(mask_dir)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
825 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
826 if(!(mask_mv & edge)) {
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
827 if(bidir) {
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
828 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
829 "movd (%1,%0), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
830 "punpckldq 40(%1,%0), %%mm2 \n" // { ref0[bn], ref1[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
831 "pshufw $0x44, (%1), %%mm0 \n" // { ref0[b], ref0[b] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
832 "pshufw $0x44, 40(%1), %%mm1 \n" // { ref1[b], ref1[b] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
833 "pshufw $0x4E, %%mm2, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
834 "psubb %%mm2, %%mm0 \n" // { ref0[b]!=ref0[bn], ref0[b]!=ref1[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
835 "psubb %%mm3, %%mm1 \n" // { ref1[b]!=ref1[bn], ref1[b]!=ref0[bn] }
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
836 "1: \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
837 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
838 "movq (%2,%0,4), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
839 "movq 8(%2,%0,4), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
840 "movq %%mm1, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
841 "movq %%mm2, %%mm4 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
842 "psubw (%2), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
843 "psubw 8(%2), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
844 "psubw 160(%2), %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
845 "psubw 168(%2), %%mm4 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
846 "packsswb %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
847 "packsswb %%mm4, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
848 "paddb %%mm6, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
849 "paddb %%mm6, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
850 "psubusb %%mm5, %%mm1 \n" // abs(mv[b] - mv[bn]) >= limit
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
851 "psubusb %%mm5, %%mm3 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
852 "packsswb %%mm3, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
853 "add $40, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
854 "cmp $40, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
855 "jl 1b \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
856 "sub $80, %0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
857 "pshufw $0x4E, %%mm1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
858 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
859 "pshufw $0x4E, %%mm0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
860 "pminub %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
861 ::"r"(d_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
862 "r"(ref[0]+b_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
863 "r"(mv[0]+b_idx)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
864 );
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
865 } else {
10938
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
866 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
867 "movd (%1), %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
868 "psubb (%1,%0), %%mm0 \n" // ref[b] != ref[bn]
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
869 "movq (%2), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
870 "movq 8(%2), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
871 "psubw (%2,%0,4), %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
872 "psubw 8(%2,%0,4), %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
873 "packsswb %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
874 "paddb %%mm6, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
875 "psubusb %%mm5, %%mm1 \n" // abs(mv[b] - mv[bn]) >= limit
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
876 "packsswb %%mm1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
877 "por %%mm1, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
878 ::"r"(d_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
879 "r"(ref[0]+b_idx),
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
880 "r"(mv[0]+b_idx)
10938
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
881 );
2a50b786b888 Fix h264_loop_filter_strength_mmx2() so it works with b frames.
michael
parents: 10937
diff changeset
882 }
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
883 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
884 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
885 "movd %0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
886 "por %1, %%mm1 \n" // nnz[b] || nnz[bn]
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
887 ::"m"(nnz[b_idx]),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
888 "m"(nnz[b_idx+d_idx])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
889 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
890 __asm__ volatile(
11017
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
891 "pminub %%mm7, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
892 "pminub %%mm7, %%mm0 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
893 "psllw $1, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
894 "pxor %%mm2, %%mm2 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
895 "pmaxub %%mm0, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
896 "punpcklbw %%mm2, %%mm1 \n"
aa10bb3c244c optimize h264_loop_filter_strength_mmx2
lorenm
parents: 10961
diff changeset
897 "movq %%mm1, %0 \n"
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
898 :"=m"(*bS[dir][edge])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
899 ::"memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
900 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
901 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
902 edges = 4;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
903 step = 1;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
904 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
905 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
906 "movq (%0), %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
907 "movq 8(%0), %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
908 "movq 16(%0), %%mm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
909 "movq 24(%0), %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
910 TRANSPOSE4(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
911 "movq %%mm0, (%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
912 "movq %%mm3, 8(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
913 "movq %%mm4, 16(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
914 "movq %%mm2, 24(%0) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
915 ::"r"(bS[0])
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
916 :"memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
917 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
918 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
919
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
920 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
921 /* motion compensation */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
922
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
923 #define QPEL_H264V_MM(A,B,C,D,E,F,OP,T,Z,d,q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
924 "mov"#q" "#C", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
925 "mov"#d" (%0), "#F" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
926 "paddw "#D", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
927 "psllw $2, "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
928 "psubw "#B", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
929 "psubw "#E", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
930 "punpcklbw "#Z", "#F" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
931 "pmullw %4, "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
932 "paddw %5, "#A" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
933 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
934 "paddw "#F", "#A" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
935 "paddw "#A", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
936 "psraw $5, "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
937 "packuswb "#T", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
938 OP(T, (%1), A, d)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
939 "add %3, %1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
940
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
941 #define QPEL_H264HV_MM(A,B,C,D,E,F,OF,T,Z,d,q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
942 "mov"#q" "#C", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
943 "mov"#d" (%0), "#F" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
944 "paddw "#D", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
945 "psllw $2, "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
946 "paddw %4, "#A" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
947 "psubw "#B", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
948 "psubw "#E", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
949 "punpcklbw "#Z", "#F" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
950 "pmullw %3, "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
951 "paddw "#F", "#A" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
952 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
953 "paddw "#A", "#T" \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
954 "mov"#q" "#T", "#OF"(%1) \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
955
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
956 #define QPEL_H264V(A,B,C,D,E,F,OP) QPEL_H264V_MM(A,B,C,D,E,F,OP,%%mm6,%%mm7,d,q)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
957 #define QPEL_H264HV(A,B,C,D,E,F,OF) QPEL_H264HV_MM(A,B,C,D,E,F,OF,%%mm6,%%mm7,d,q)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
958 #define QPEL_H264V_XMM(A,B,C,D,E,F,OP) QPEL_H264V_MM(A,B,C,D,E,F,OP,%%xmm6,%%xmm7,q,dqa)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
959 #define QPEL_H264HV_XMM(A,B,C,D,E,F,OF) QPEL_H264HV_MM(A,B,C,D,E,F,OF,%%xmm6,%%xmm7,q,dqa)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
960
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
961
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
962 #define QPEL_H264(OPNAME, OP, MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
963 static av_noinline void OPNAME ## h264_qpel4_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
964 int h=4;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
965 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
966 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
967 "pxor %%mm7, %%mm7 \n\t"\
11569
731050abce41 Convert two "m" constraints to MANGLE to fix compilation with some compilers.
reimar
parents: 11369
diff changeset
968 "movq "MANGLE(ff_pw_5) ", %%mm4\n\t"\
731050abce41 Convert two "m" constraints to MANGLE to fix compilation with some compilers.
reimar
parents: 11369
diff changeset
969 "movq "MANGLE(ff_pw_16)", %%mm5\n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
970 "1: \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
971 "movd -1(%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
972 "movd (%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
973 "movd 1(%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
974 "movd 2(%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
975 "punpcklbw %%mm7, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
976 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
977 "punpcklbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
978 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
979 "paddw %%mm0, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
980 "paddw %%mm3, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
981 "movd -2(%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
982 "movd 3(%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
983 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
984 "punpcklbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
985 "paddw %%mm3, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
986 "psllw $2, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
987 "psubw %%mm1, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
988 "pmullw %%mm4, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
989 "paddw %%mm5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
990 "paddw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
991 "psraw $5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
992 "packuswb %%mm0, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
993 OP(%%mm0, (%1),%%mm6, d)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
994 "add %3, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
995 "add %4, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
996 "decl %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
997 " jnz 1b \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
998 : "+a"(src), "+c"(dst), "+g"(h)\
11569
731050abce41 Convert two "m" constraints to MANGLE to fix compilation with some compilers.
reimar
parents: 11369
diff changeset
999 : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride)\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1000 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1001 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1002 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1003 static av_noinline void OPNAME ## h264_qpel4_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1004 int h=4;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1005 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1006 "pxor %%mm7, %%mm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1007 "movq %0, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1008 "movq %1, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1009 :: "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1010 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1011 do{\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1012 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1013 "movd -1(%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1014 "movd (%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1015 "movd 1(%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1016 "movd 2(%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1017 "punpcklbw %%mm7, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1018 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1019 "punpcklbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1020 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1021 "paddw %%mm0, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1022 "paddw %%mm3, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1023 "movd -2(%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1024 "movd 3(%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1025 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1026 "punpcklbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1027 "paddw %%mm3, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1028 "psllw $2, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1029 "psubw %%mm1, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1030 "pmullw %%mm4, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1031 "paddw %%mm5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1032 "paddw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1033 "movd (%2), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1034 "psraw $5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1035 "packuswb %%mm0, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1036 PAVGB" %%mm3, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1037 OP(%%mm0, (%1),%%mm6, d)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1038 "add %4, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1039 "add %4, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1040 "add %3, %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1041 : "+a"(src), "+c"(dst), "+d"(src2)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1042 : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1043 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1044 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1045 }while(--h);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1046 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1047 static av_noinline void OPNAME ## h264_qpel4_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1048 src -= 2*srcStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1049 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1050 "pxor %%mm7, %%mm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1051 "movd (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1052 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1053 "movd (%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1054 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1055 "movd (%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1056 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1057 "movd (%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1058 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1059 "movd (%0), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1060 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1061 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1062 "punpcklbw %%mm7, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1063 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1064 "punpcklbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1065 "punpcklbw %%mm7, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1066 QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1067 QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1068 QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1069 QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1070 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1071 : "+a"(src), "+c"(dst)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1072 : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1073 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1074 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1075 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1076 static av_noinline void OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1077 int h=4;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1078 int w=3;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1079 src -= 2*srcStride+2;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1080 while(w--){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1081 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1082 "pxor %%mm7, %%mm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1083 "movd (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1084 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1085 "movd (%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1086 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1087 "movd (%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1088 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1089 "movd (%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1090 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1091 "movd (%0), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1092 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1093 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1094 "punpcklbw %%mm7, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1095 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1096 "punpcklbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1097 "punpcklbw %%mm7, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1098 QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*3)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1099 QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*3)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1100 QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*3)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1101 QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*3)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1102 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1103 : "+a"(src)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1104 : "c"(tmp), "S"((x86_reg)srcStride), "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1105 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1106 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1107 tmp += 4;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1108 src += 4 - 9*srcStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1109 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1110 tmp -= 3*4;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1111 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1112 "1: \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1113 "movq (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1114 "paddw 10(%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1115 "movq 2(%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1116 "paddw 8(%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1117 "movq 4(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1118 "paddw 6(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1119 "psubw %%mm1, %%mm0 \n\t"/*a-b (abccba)*/\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1120 "psraw $2, %%mm0 \n\t"/*(a-b)/4 */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1121 "psubw %%mm1, %%mm0 \n\t"/*(a-b)/4-b */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1122 "paddsw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1123 "psraw $2, %%mm0 \n\t"/*((a-b)/4-b+c)/4 */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1124 "paddw %%mm2, %%mm0 \n\t"/*(a-5*b+20*c)/16 */\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1125 "psraw $6, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1126 "packuswb %%mm0, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1127 OP(%%mm0, (%1),%%mm7, d)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1128 "add $24, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1129 "add %3, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1130 "decl %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1131 " jnz 1b \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1132 : "+a"(tmp), "+c"(dst), "+g"(h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1133 : "S"((x86_reg)dstStride)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1134 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1135 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1136 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1137 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1138 static av_noinline void OPNAME ## h264_qpel8_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1139 int h=8;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1140 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1141 "pxor %%mm7, %%mm7 \n\t"\
11701
953d0c2d2c0a Replace more "m" constraints with MANGLE to fix compilation issues
reimar
parents: 11569
diff changeset
1142 "movq "MANGLE(ff_pw_5)", %%mm6\n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1143 "1: \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1144 "movq (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1145 "movq 1(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1146 "movq %%mm0, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1147 "movq %%mm2, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1148 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1149 "punpckhbw %%mm7, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1150 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1151 "punpckhbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1152 "paddw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1153 "paddw %%mm3, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1154 "psllw $2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1155 "psllw $2, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1156 "movq -1(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1157 "movq 2(%0), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1158 "movq %%mm2, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1159 "movq %%mm4, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1160 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1161 "punpckhbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1162 "punpcklbw %%mm7, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1163 "punpckhbw %%mm7, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1164 "paddw %%mm4, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1165 "paddw %%mm3, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1166 "psubw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1167 "psubw %%mm5, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1168 "pmullw %%mm6, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1169 "pmullw %%mm6, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1170 "movd -2(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1171 "movd 7(%0), %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1172 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1173 "punpcklbw %%mm7, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1174 "paddw %%mm3, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1175 "paddw %%mm5, %%mm4 \n\t"\
11701
953d0c2d2c0a Replace more "m" constraints with MANGLE to fix compilation issues
reimar
parents: 11569
diff changeset
1176 "movq "MANGLE(ff_pw_16)", %%mm5\n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1177 "paddw %%mm5, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1178 "paddw %%mm5, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1179 "paddw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1180 "paddw %%mm4, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1181 "psraw $5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1182 "psraw $5, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1183 "packuswb %%mm1, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1184 OP(%%mm0, (%1),%%mm5, q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1185 "add %3, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1186 "add %4, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1187 "decl %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1188 " jnz 1b \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1189 : "+a"(src), "+c"(dst), "+g"(h)\
11701
953d0c2d2c0a Replace more "m" constraints with MANGLE to fix compilation issues
reimar
parents: 11569
diff changeset
1190 : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride)\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1191 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1192 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1193 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1194 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1195 static av_noinline void OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1196 int h=8;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1197 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1198 "pxor %%mm7, %%mm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1199 "movq %0, %%mm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1200 :: "m"(ff_pw_5)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1201 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1202 do{\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1203 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1204 "movq (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1205 "movq 1(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1206 "movq %%mm0, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1207 "movq %%mm2, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1208 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1209 "punpckhbw %%mm7, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1210 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1211 "punpckhbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1212 "paddw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1213 "paddw %%mm3, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1214 "psllw $2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1215 "psllw $2, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1216 "movq -1(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1217 "movq 2(%0), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1218 "movq %%mm2, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1219 "movq %%mm4, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1220 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1221 "punpckhbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1222 "punpcklbw %%mm7, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1223 "punpckhbw %%mm7, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1224 "paddw %%mm4, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1225 "paddw %%mm3, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1226 "psubw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1227 "psubw %%mm5, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1228 "pmullw %%mm6, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1229 "pmullw %%mm6, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1230 "movd -2(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1231 "movd 7(%0), %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1232 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1233 "punpcklbw %%mm7, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1234 "paddw %%mm3, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1235 "paddw %%mm5, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1236 "movq %5, %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1237 "paddw %%mm5, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1238 "paddw %%mm5, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1239 "paddw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1240 "paddw %%mm4, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1241 "psraw $5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1242 "psraw $5, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1243 "movq (%2), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1244 "packuswb %%mm1, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1245 PAVGB" %%mm4, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1246 OP(%%mm0, (%1),%%mm5, q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1247 "add %4, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1248 "add %4, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1249 "add %3, %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1250 : "+a"(src), "+c"(dst), "+d"(src2)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1251 : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride),\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1252 "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1253 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1254 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1255 }while(--h);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1256 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1257 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1258 static av_noinline void OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1259 int w= 2;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1260 src -= 2*srcStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1261 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1262 while(w--){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1263 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1264 "pxor %%mm7, %%mm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1265 "movd (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1266 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1267 "movd (%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1268 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1269 "movd (%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1270 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1271 "movd (%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1272 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1273 "movd (%0), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1274 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1275 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1276 "punpcklbw %%mm7, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1277 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1278 "punpcklbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1279 "punpcklbw %%mm7, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1280 QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1281 QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1282 QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1283 QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1284 QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1285 QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1286 QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1287 QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1288 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1289 : "+a"(src), "+c"(dst)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1290 : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1291 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1292 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1293 if(h==16){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1294 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1295 QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1296 QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1297 QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1298 QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1299 QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1300 QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1301 QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1302 QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1303 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1304 : "+a"(src), "+c"(dst)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1305 : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1306 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1307 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1308 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1309 src += 4-(h+5)*srcStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1310 dst += 4-h*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1311 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1312 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1313 static av_always_inline void OPNAME ## h264_qpel8or16_hv1_lowpass_ ## MMX(int16_t *tmp, uint8_t *src, int tmpStride, int srcStride, int size){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1314 int w = (size+8)>>2;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1315 src -= 2*srcStride+2;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1316 while(w--){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1317 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1318 "pxor %%mm7, %%mm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1319 "movd (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1320 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1321 "movd (%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1322 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1323 "movd (%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1324 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1325 "movd (%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1326 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1327 "movd (%0), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1328 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1329 "punpcklbw %%mm7, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1330 "punpcklbw %%mm7, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1331 "punpcklbw %%mm7, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1332 "punpcklbw %%mm7, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1333 "punpcklbw %%mm7, %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1334 QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1335 QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1336 QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1337 QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1338 QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 4*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1339 QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 5*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1340 QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 6*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1341 QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 7*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1342 : "+a"(src)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1343 : "c"(tmp), "S"((x86_reg)srcStride), "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1344 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1345 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1346 if(size==16){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1347 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1348 QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 8*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1349 QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 9*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1350 QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 10*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1351 QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 11*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1352 QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 12*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1353 QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 13*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1354 QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 14*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1355 QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 15*48)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1356 : "+a"(src)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1357 : "c"(tmp), "S"((x86_reg)srcStride), "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1358 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1359 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1360 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1361 tmp += 4;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1362 src += 4 - (size+5)*srcStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1363 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1364 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1365 static av_always_inline void OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1366 int w = size>>4;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1367 do{\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1368 int h = size;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1369 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1370 "1: \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1371 "movq (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1372 "movq 8(%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1373 "movq 2(%0), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1374 "movq 10(%0), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1375 "paddw %%mm4, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1376 "paddw %%mm3, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1377 "paddw 18(%0), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1378 "paddw 16(%0), %%mm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1379 "movq 4(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1380 "movq 12(%0), %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1381 "paddw 6(%0), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1382 "paddw 14(%0), %%mm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1383 "psubw %%mm1, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1384 "psubw %%mm4, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1385 "psraw $2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1386 "psraw $2, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1387 "psubw %%mm1, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1388 "psubw %%mm4, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1389 "paddsw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1390 "paddsw %%mm5, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1391 "psraw $2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1392 "psraw $2, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1393 "paddw %%mm2, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1394 "paddw %%mm5, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1395 "psraw $6, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1396 "psraw $6, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1397 "packuswb %%mm3, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1398 OP(%%mm0, (%1),%%mm7, q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1399 "add $48, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1400 "add %3, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1401 "decl %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1402 " jnz 1b \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1403 : "+a"(tmp), "+c"(dst), "+g"(h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1404 : "S"((x86_reg)dstStride)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1405 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1406 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1407 tmp += 8 - size*24;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1408 dst += 8 - size*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1409 }while(w--);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1410 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1411 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1412 static void OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1413 OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1414 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1415 static av_noinline void OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1416 OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1417 OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1418 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1419 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1420 static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1421 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1422 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1423 src += 8*srcStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1424 dst += 8*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1425 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1426 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1427 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1428 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1429 static av_noinline void OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1430 OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1431 OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1432 src += 8*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1433 dst += 8*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1434 src2 += 8*src2Stride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1435 OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1436 OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1437 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1438 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1439 static av_noinline void OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1440 put_h264_qpel8or16_hv1_lowpass_ ## MMX(tmp, src, tmpStride, srcStride, size);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1441 OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1442 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1443 static void OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1444 OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 8);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1445 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1446 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1447 static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1448 OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride, 16);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1449 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1450 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1451 static av_noinline void OPNAME ## pixels4_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1452 {\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1453 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1454 "movq (%1), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1455 "movq 24(%1), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1456 "psraw $5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1457 "psraw $5, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1458 "packuswb %%mm0, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1459 "packuswb %%mm1, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1460 PAVGB" (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1461 PAVGB" (%0,%3), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1462 OP(%%mm0, (%2), %%mm4, d)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1463 OP(%%mm1, (%2,%4), %%mm5, d)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1464 "lea (%0,%3,2), %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1465 "lea (%2,%4,2), %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1466 "movq 48(%1), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1467 "movq 72(%1), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1468 "psraw $5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1469 "psraw $5, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1470 "packuswb %%mm0, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1471 "packuswb %%mm1, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1472 PAVGB" (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1473 PAVGB" (%0,%3), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1474 OP(%%mm0, (%2), %%mm4, d)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1475 OP(%%mm1, (%2,%4), %%mm5, d)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1476 :"+a"(src8), "+c"(src16), "+d"(dst)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1477 :"S"((x86_reg)src8Stride), "D"((x86_reg)dstStride)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1478 :"memory");\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1479 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1480 static av_noinline void OPNAME ## pixels8_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1481 {\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1482 do{\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1483 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1484 "movq (%1), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1485 "movq 8(%1), %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1486 "movq 48(%1), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1487 "movq 8+48(%1), %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1488 "psraw $5, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1489 "psraw $5, %%mm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1490 "psraw $5, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1491 "psraw $5, %%mm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1492 "packuswb %%mm1, %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1493 "packuswb %%mm3, %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1494 PAVGB" (%0), %%mm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1495 PAVGB" (%0,%3), %%mm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1496 OP(%%mm0, (%2), %%mm5, q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1497 OP(%%mm2, (%2,%4), %%mm5, q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1498 ::"a"(src8), "c"(src16), "d"(dst),\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1499 "r"((x86_reg)src8Stride), "r"((x86_reg)dstStride)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1500 :"memory");\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1501 src8 += 2L*src8Stride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1502 src16 += 48;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1503 dst += 2L*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1504 }while(h-=2);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1505 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1506 static void OPNAME ## pixels16_l2_shift5_ ## MMX(uint8_t *dst, int16_t *src16, uint8_t *src8, int dstStride, int src8Stride, int h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1507 {\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1508 OPNAME ## pixels8_l2_shift5_ ## MMX(dst , src16 , src8 , dstStride, src8Stride, h);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1509 OPNAME ## pixels8_l2_shift5_ ## MMX(dst+8, src16+8, src8+8, dstStride, src8Stride, h);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1510 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1511
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1512
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8519
diff changeset
1513 #if ARCH_X86_64
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1514 #define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1515 static av_noinline void OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1516 int h=16;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1517 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1518 "pxor %%xmm15, %%xmm15 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1519 "movdqa %6, %%xmm14 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1520 "movdqa %7, %%xmm13 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1521 "1: \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1522 "lddqu 6(%0), %%xmm1 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1523 "lddqu -2(%0), %%xmm7 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1524 "movdqa %%xmm1, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1525 "punpckhbw %%xmm15, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1526 "punpcklbw %%xmm15, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1527 "punpcklbw %%xmm15, %%xmm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1528 "movdqa %%xmm1, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1529 "movdqa %%xmm0, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1530 "movdqa %%xmm1, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1531 "movdqa %%xmm0, %%xmm8 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1532 "movdqa %%xmm1, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1533 "movdqa %%xmm0, %%xmm9 \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1534 "movdqa %%xmm0, %%xmm12 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1535 "movdqa %%xmm1, %%xmm11 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1536 "palignr $10,%%xmm0, %%xmm11\n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1537 "palignr $10,%%xmm7, %%xmm12\n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1538 "palignr $2, %%xmm0, %%xmm4 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1539 "palignr $2, %%xmm7, %%xmm9 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1540 "palignr $4, %%xmm0, %%xmm3 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1541 "palignr $4, %%xmm7, %%xmm8 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1542 "palignr $6, %%xmm0, %%xmm2 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1543 "palignr $6, %%xmm7, %%xmm6 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1544 "paddw %%xmm0 ,%%xmm11 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1545 "palignr $8, %%xmm0, %%xmm1 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1546 "palignr $8, %%xmm7, %%xmm0 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1547 "paddw %%xmm12,%%xmm7 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1548 "paddw %%xmm3, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1549 "paddw %%xmm8, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1550 "paddw %%xmm4, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1551 "paddw %%xmm9, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1552 "psllw $2, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1553 "psllw $2, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1554 "psubw %%xmm1, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1555 "psubw %%xmm0, %%xmm6 \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1556 "paddw %%xmm13,%%xmm11 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1557 "paddw %%xmm13,%%xmm7 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1558 "pmullw %%xmm14,%%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1559 "pmullw %%xmm14,%%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1560 "lddqu (%2), %%xmm3 \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1561 "paddw %%xmm11,%%xmm2 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1562 "paddw %%xmm7, %%xmm6 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1563 "psraw $5, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1564 "psraw $5, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1565 "packuswb %%xmm2,%%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1566 "pavgb %%xmm3, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1567 OP(%%xmm6, (%1), %%xmm4, dqa)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1568 "add %5, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1569 "add %5, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1570 "add %4, %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1571 "decl %3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1572 "jg 1b \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1573 : "+a"(src), "+c"(dst), "+d"(src2), "+g"(h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1574 : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride),\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1575 "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1576 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1577 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1578 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1579 #else // ARCH_X86_64
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1580 #define QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1581 static av_noinline void OPNAME ## h264_qpel16_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1582 OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1583 OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1584 src += 8*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1585 dst += 8*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1586 src2 += 8*src2Stride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1587 OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst , src , src2 , dstStride, src2Stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1588 OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(dst+8, src+8, src2+8, dstStride, src2Stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1589 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1590 #endif // ARCH_X86_64
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1591
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1592 #define QPEL_H264_H_XMM(OPNAME, OP, MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1593 static av_noinline void OPNAME ## h264_qpel8_h_lowpass_l2_ ## MMX(uint8_t *dst, uint8_t *src, uint8_t *src2, int dstStride, int src2Stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1594 int h=8;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1595 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1596 "pxor %%xmm7, %%xmm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1597 "movdqa %0, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1598 :: "m"(ff_pw_5)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1599 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1600 do{\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1601 __asm__ volatile(\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1602 "lddqu -2(%0), %%xmm1 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1603 "movdqa %%xmm1, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1604 "punpckhbw %%xmm7, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1605 "punpcklbw %%xmm7, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1606 "movdqa %%xmm1, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1607 "movdqa %%xmm1, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1608 "movdqa %%xmm1, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1609 "movdqa %%xmm1, %%xmm5 \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1610 "palignr $2, %%xmm0, %%xmm4 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1611 "palignr $4, %%xmm0, %%xmm3 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1612 "palignr $6, %%xmm0, %%xmm2 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1613 "palignr $8, %%xmm0, %%xmm1 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1614 "palignr $10,%%xmm0, %%xmm5 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1615 "paddw %%xmm5, %%xmm0 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1616 "paddw %%xmm3, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1617 "paddw %%xmm4, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1618 "psllw $2, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1619 "movq (%2), %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1620 "psubw %%xmm1, %%xmm2 \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1621 "paddw %5, %%xmm0 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1622 "pmullw %%xmm6, %%xmm2 \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1623 "paddw %%xmm0, %%xmm2 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1624 "psraw $5, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1625 "packuswb %%xmm2, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1626 "pavgb %%xmm3, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1627 OP(%%xmm2, (%1), %%xmm4, q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1628 "add %4, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1629 "add %4, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1630 "add %3, %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1631 : "+a"(src), "+c"(dst), "+d"(src2)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1632 : "D"((x86_reg)src2Stride), "S"((x86_reg)dstStride),\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1633 "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1634 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1635 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1636 }while(--h);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1637 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1638 QPEL_H264_H16_XMM(OPNAME, OP, MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1639 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1640 static av_noinline void OPNAME ## h264_qpel8_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1641 int h=8;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1642 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1643 "pxor %%xmm7, %%xmm7 \n\t"\
11701
953d0c2d2c0a Replace more "m" constraints with MANGLE to fix compilation issues
reimar
parents: 11569
diff changeset
1644 "movdqa "MANGLE(ff_pw_5)", %%xmm6\n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1645 "1: \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1646 "lddqu -2(%0), %%xmm1 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1647 "movdqa %%xmm1, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1648 "punpckhbw %%xmm7, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1649 "punpcklbw %%xmm7, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1650 "movdqa %%xmm1, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1651 "movdqa %%xmm1, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1652 "movdqa %%xmm1, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1653 "movdqa %%xmm1, %%xmm5 \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1654 "palignr $2, %%xmm0, %%xmm4 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1655 "palignr $4, %%xmm0, %%xmm3 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1656 "palignr $6, %%xmm0, %%xmm2 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1657 "palignr $8, %%xmm0, %%xmm1 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1658 "palignr $10,%%xmm0, %%xmm5 \n\t"\
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1659 "paddw %%xmm5, %%xmm0 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1660 "paddw %%xmm3, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1661 "paddw %%xmm4, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1662 "psllw $2, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1663 "psubw %%xmm1, %%xmm2 \n\t"\
11701
953d0c2d2c0a Replace more "m" constraints with MANGLE to fix compilation issues
reimar
parents: 11569
diff changeset
1664 "paddw "MANGLE(ff_pw_16)", %%xmm0\n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1665 "pmullw %%xmm6, %%xmm2 \n\t"\
9739
96e6cab7470a H264: Fix out of bounds reads in SSSE3 MC
astrange
parents: 9440
diff changeset
1666 "paddw %%xmm0, %%xmm2 \n\t"\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1667 "psraw $5, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1668 "packuswb %%xmm2, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1669 OP(%%xmm2, (%1), %%xmm4, q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1670 "add %3, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1671 "add %4, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1672 "decl %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1673 " jnz 1b \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1674 : "+a"(src), "+c"(dst), "+g"(h)\
11701
953d0c2d2c0a Replace more "m" constraints with MANGLE to fix compilation issues
reimar
parents: 11569
diff changeset
1675 : "D"((x86_reg)srcStride), "S"((x86_reg)dstStride)\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1676 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1677 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1678 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1679 static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1680 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1681 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1682 src += 8*srcStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1683 dst += 8*dstStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1684 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1685 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1686 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1687
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1688 #define QPEL_H264_V_XMM(OPNAME, OP, MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1689 static av_noinline void OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1690 src -= 2*srcStride;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1691 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1692 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1693 "pxor %%xmm7, %%xmm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1694 "movq (%0), %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1695 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1696 "movq (%0), %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1697 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1698 "movq (%0), %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1699 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1700 "movq (%0), %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1701 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1702 "movq (%0), %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1703 "add %2, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1704 "punpcklbw %%xmm7, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1705 "punpcklbw %%xmm7, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1706 "punpcklbw %%xmm7, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1707 "punpcklbw %%xmm7, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1708 "punpcklbw %%xmm7, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1709 QPEL_H264V_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1710 QPEL_H264V_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1711 QPEL_H264V_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1712 QPEL_H264V_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1713 QPEL_H264V_XMM(%%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1714 QPEL_H264V_XMM(%%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1715 QPEL_H264V_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1716 QPEL_H264V_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1717 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1718 : "+a"(src), "+c"(dst)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1719 : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1720 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1721 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1722 if(h==16){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1723 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1724 QPEL_H264V_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1725 QPEL_H264V_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1726 QPEL_H264V_XMM(%%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1727 QPEL_H264V_XMM(%%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1728 QPEL_H264V_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1729 QPEL_H264V_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1730 QPEL_H264V_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1731 QPEL_H264V_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, OP)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1732 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1733 : "+a"(src), "+c"(dst)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1734 : "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1735 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1736 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1737 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1738 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1739 static void OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1740 OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 8);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1741 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1742 static av_noinline void OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1743 OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst , src , dstStride, srcStride, 16);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1744 OPNAME ## h264_qpel8or16_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride, 16);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1745 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1746
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1747 static av_always_inline void put_h264_qpel8or16_hv1_lowpass_sse2(int16_t *tmp, uint8_t *src, int tmpStride, int srcStride, int size){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1748 int w = (size+8)>>3;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1749 src -= 2*srcStride+2;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1750 while(w--){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1751 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1752 "pxor %%xmm7, %%xmm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1753 "movq (%0), %%xmm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1754 "add %2, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1755 "movq (%0), %%xmm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1756 "add %2, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1757 "movq (%0), %%xmm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1758 "add %2, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1759 "movq (%0), %%xmm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1760 "add %2, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1761 "movq (%0), %%xmm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1762 "add %2, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1763 "punpcklbw %%xmm7, %%xmm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1764 "punpcklbw %%xmm7, %%xmm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1765 "punpcklbw %%xmm7, %%xmm2 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1766 "punpcklbw %%xmm7, %%xmm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1767 "punpcklbw %%xmm7, %%xmm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1768 QPEL_H264HV_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, 0*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1769 QPEL_H264HV_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, 1*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1770 QPEL_H264HV_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, 2*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1771 QPEL_H264HV_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, 3*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1772 QPEL_H264HV_XMM(%%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, 4*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1773 QPEL_H264HV_XMM(%%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, 5*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1774 QPEL_H264HV_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, 6*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1775 QPEL_H264HV_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, 7*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1776 : "+a"(src)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1777 : "c"(tmp), "S"((x86_reg)srcStride), "m"(ff_pw_5), "m"(ff_pw_16)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1778 : "memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1779 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1780 if(size==16){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1781 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1782 QPEL_H264HV_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, 8*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1783 QPEL_H264HV_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, 9*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1784 QPEL_H264HV_XMM(%%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, 10*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1785 QPEL_H264HV_XMM(%%xmm5, %%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, 11*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1786 QPEL_H264HV_XMM(%%xmm0, %%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, 12*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1787 QPEL_H264HV_XMM(%%xmm1, %%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, 13*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1788 QPEL_H264HV_XMM(%%xmm2, %%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, 14*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1789 QPEL_H264HV_XMM(%%xmm3, %%xmm4, %%xmm5, %%xmm0, %%xmm1, %%xmm2, 15*48)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1790 : "+a"(src)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1791 : "c"(tmp), "S"((x86_reg)srcStride), "m"(ff_pw_5), "m"(ff_pw_16)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1792 : "memory"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1793 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1794 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1795 tmp += 8;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1796 src += 8 - (size+5)*srcStride;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1797 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1798 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1799
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1800 #define QPEL_H264_HV2_XMM(OPNAME, OP, MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1801 static av_always_inline void OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, int dstStride, int tmpStride, int size){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1802 int h = size;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1803 if(size == 16){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1804 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1805 "1: \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1806 "movdqa 32(%0), %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1807 "movdqa 16(%0), %%xmm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1808 "movdqa (%0), %%xmm7 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1809 "movdqa %%xmm4, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1810 "movdqa %%xmm4, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1811 "movdqa %%xmm4, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1812 "movdqa %%xmm4, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1813 "palignr $10, %%xmm5, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1814 "palignr $8, %%xmm5, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1815 "palignr $6, %%xmm5, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1816 "palignr $4, %%xmm5, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1817 "palignr $2, %%xmm5, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1818 "paddw %%xmm5, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1819 "paddw %%xmm4, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1820 "paddw %%xmm3, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1821 "movdqa %%xmm5, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1822 "movdqa %%xmm5, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1823 "movdqa %%xmm5, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1824 "palignr $8, %%xmm7, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1825 "palignr $2, %%xmm7, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1826 "palignr $10, %%xmm7, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1827 "paddw %%xmm6, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1828 "movdqa %%xmm5, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1829 "palignr $6, %%xmm7, %%xmm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1830 "palignr $4, %%xmm7, %%xmm6 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1831 "paddw %%xmm7, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1832 "paddw %%xmm6, %%xmm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1833 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1834 "psubw %%xmm1, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1835 "psubw %%xmm4, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1836 "psraw $2, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1837 "psraw $2, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1838 "psubw %%xmm1, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1839 "psubw %%xmm4, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1840 "paddw %%xmm2, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1841 "paddw %%xmm5, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1842 "psraw $2, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1843 "psraw $2, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1844 "paddw %%xmm2, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1845 "paddw %%xmm5, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1846 "psraw $6, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1847 "psraw $6, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1848 "packuswb %%xmm0, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1849 OP(%%xmm3, (%1), %%xmm7, dqa)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1850 "add $48, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1851 "add %3, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1852 "decl %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1853 " jnz 1b \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1854 : "+a"(tmp), "+c"(dst), "+g"(h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1855 : "S"((x86_reg)dstStride)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1856 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1857 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1858 }else{\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1859 __asm__ volatile(\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1860 "1: \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1861 "movdqa 16(%0), %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1862 "movdqa (%0), %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1863 "movdqa %%xmm1, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1864 "movdqa %%xmm1, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1865 "movdqa %%xmm1, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1866 "movdqa %%xmm1, %%xmm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1867 "palignr $10, %%xmm0, %%xmm5 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1868 "palignr $8, %%xmm0, %%xmm4 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1869 "palignr $6, %%xmm0, %%xmm3 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1870 "palignr $4, %%xmm0, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1871 "palignr $2, %%xmm0, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1872 "paddw %%xmm5, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1873 "paddw %%xmm4, %%xmm1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1874 "paddw %%xmm3, %%xmm2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1875 "psubw %%xmm1, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1876 "psraw $2, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1877 "psubw %%xmm1, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1878 "paddw %%xmm2, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1879 "psraw $2, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1880 "paddw %%xmm2, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1881 "psraw $6, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1882 "packuswb %%xmm0, %%xmm0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1883 OP(%%xmm0, (%1), %%xmm7, q)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1884 "add $48, %0 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1885 "add %3, %1 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1886 "decl %2 \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1887 " jnz 1b \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1888 : "+a"(tmp), "+c"(dst), "+g"(h)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1889 : "S"((x86_reg)dstStride)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1890 : "memory"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1891 );\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1892 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1893 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1894
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1895 #define QPEL_H264_HV_XMM(OPNAME, OP, MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1896 static av_noinline void OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride, int size){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1897 put_h264_qpel8or16_hv1_lowpass_sse2(tmp, src, tmpStride, srcStride, size);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1898 OPNAME ## h264_qpel8or16_hv2_lowpass_ ## MMX(dst, tmp, dstStride, tmpStride, size);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1899 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1900 static void OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1901 OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 8);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1902 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1903 static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1904 OPNAME ## h264_qpel8or16_hv_lowpass_ ## MMX(dst, tmp, src, dstStride, tmpStride, srcStride, 16);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1905 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1906
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1907 #define put_pixels8_l2_sse2 put_pixels8_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1908 #define avg_pixels8_l2_sse2 avg_pixels8_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1909 #define put_pixels16_l2_sse2 put_pixels16_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1910 #define avg_pixels16_l2_sse2 avg_pixels16_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1911 #define put_pixels8_l2_ssse3 put_pixels8_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1912 #define avg_pixels8_l2_ssse3 avg_pixels8_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1913 #define put_pixels16_l2_ssse3 put_pixels16_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1914 #define avg_pixels16_l2_ssse3 avg_pixels16_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1915
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1916 #define put_pixels8_l2_shift5_sse2 put_pixels8_l2_shift5_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1917 #define avg_pixels8_l2_shift5_sse2 avg_pixels8_l2_shift5_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1918 #define put_pixels16_l2_shift5_sse2 put_pixels16_l2_shift5_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1919 #define avg_pixels16_l2_shift5_sse2 avg_pixels16_l2_shift5_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1920 #define put_pixels8_l2_shift5_ssse3 put_pixels8_l2_shift5_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1921 #define avg_pixels8_l2_shift5_ssse3 avg_pixels8_l2_shift5_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1922 #define put_pixels16_l2_shift5_ssse3 put_pixels16_l2_shift5_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1923 #define avg_pixels16_l2_shift5_ssse3 avg_pixels16_l2_shift5_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1924
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1925 #define put_h264_qpel8_h_lowpass_l2_sse2 put_h264_qpel8_h_lowpass_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1926 #define avg_h264_qpel8_h_lowpass_l2_sse2 avg_h264_qpel8_h_lowpass_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1927 #define put_h264_qpel16_h_lowpass_l2_sse2 put_h264_qpel16_h_lowpass_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1928 #define avg_h264_qpel16_h_lowpass_l2_sse2 avg_h264_qpel16_h_lowpass_l2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1929
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1930 #define put_h264_qpel8_v_lowpass_ssse3 put_h264_qpel8_v_lowpass_sse2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1931 #define avg_h264_qpel8_v_lowpass_ssse3 avg_h264_qpel8_v_lowpass_sse2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1932 #define put_h264_qpel16_v_lowpass_ssse3 put_h264_qpel16_v_lowpass_sse2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1933 #define avg_h264_qpel16_v_lowpass_ssse3 avg_h264_qpel16_v_lowpass_sse2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1934
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1935 #define put_h264_qpel8or16_hv2_lowpass_sse2 put_h264_qpel8or16_hv2_lowpass_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1936 #define avg_h264_qpel8or16_hv2_lowpass_sse2 avg_h264_qpel8or16_hv2_lowpass_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1937
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1938 #define H264_MC(OPNAME, SIZE, MMX, ALIGN) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1939 H264_MC_C(OPNAME, SIZE, MMX, ALIGN)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1940 H264_MC_V(OPNAME, SIZE, MMX, ALIGN)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1941 H264_MC_H(OPNAME, SIZE, MMX, ALIGN)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1942 H264_MC_HV(OPNAME, SIZE, MMX, ALIGN)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1943
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1944 static void put_h264_qpel16_mc00_sse2 (uint8_t *dst, uint8_t *src, int stride){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1945 put_pixels16_sse2(dst, src, stride, 16);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1946 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1947 static void avg_h264_qpel16_mc00_sse2 (uint8_t *dst, uint8_t *src, int stride){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1948 avg_pixels16_sse2(dst, src, stride, 16);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1949 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1950 #define put_h264_qpel8_mc00_sse2 put_h264_qpel8_mc00_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1951 #define avg_h264_qpel8_mc00_sse2 avg_h264_qpel8_mc00_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1952
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1953 #define H264_MC_C(OPNAME, SIZE, MMX, ALIGN) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1954 static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1955 OPNAME ## pixels ## SIZE ## _ ## MMX(dst, src, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1956 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1957
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1958 #define H264_MC_H(OPNAME, SIZE, MMX, ALIGN) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1959 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1960 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src, stride, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1961 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1962 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1963 static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1964 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1965 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1966 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1967 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1968 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, src+1, stride, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1969 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1970
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1971 #define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1972 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
1973 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1974 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1975 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1976 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1977 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1978 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1979 OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1980 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1981 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1982 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
1983 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1984 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1985 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1986 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1987
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1988 #define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1989 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
1990 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1991 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1992 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1993 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1994 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1995 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
1996 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1997 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1998 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
1999 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2000 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2001 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
2002 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2003 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2004 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2005 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2006 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2007 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
2008 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2009 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2010 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2011 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2012 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2013 static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
2014 DECLARE_ALIGNED(ALIGN, uint16_t, temp)[SIZE*(SIZE<8?12:24)];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2015 OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, temp, src, stride, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2016 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2017 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2018 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
2019 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2020 uint8_t * const halfHV= temp;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2021 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2022 assert(((int)temp & 7) == 0);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2023 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2024 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, halfHV, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2025 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2026 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2027 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
2028 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2029 uint8_t * const halfHV= temp;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2030 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2031 assert(((int)temp & 7) == 0);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2032 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2033 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, halfHV, stride, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2034 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2035 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2036 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
2037 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2038 uint8_t * const halfHV= temp;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2039 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2040 assert(((int)temp & 7) == 0);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2041 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2042 OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+2, halfHV, stride, SIZE, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2043 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2044 \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2045 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
10961
34a65026fa06 Move array specifiers outside DECLARE_ALIGNED() invocations
mru
parents: 10955
diff changeset
2046 DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*(SIZE<8?12:24)*2 + SIZE*SIZE];\
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2047 uint8_t * const halfHV= temp;\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2048 int16_t * const halfV= (int16_t*)(temp + SIZE*SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2049 assert(((int)temp & 7) == 0);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2050 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, halfV, src, SIZE, SIZE, stride);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2051 OPNAME ## pixels ## SIZE ## _l2_shift5_ ## MMX(dst, halfV+3, halfHV, stride, SIZE, SIZE);\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2052 }\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2053
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2054 #define H264_MC_4816(MMX)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2055 H264_MC(put_, 4, MMX, 8)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2056 H264_MC(put_, 8, MMX, 8)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2057 H264_MC(put_, 16,MMX, 8)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2058 H264_MC(avg_, 4, MMX, 8)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2059 H264_MC(avg_, 8, MMX, 8)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2060 H264_MC(avg_, 16,MMX, 8)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2061
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2062 #define H264_MC_816(QPEL, XMM)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2063 QPEL(put_, 8, XMM, 16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2064 QPEL(put_, 16,XMM, 16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2065 QPEL(avg_, 8, XMM, 16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2066 QPEL(avg_, 16,XMM, 16)\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2067
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2068
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2069 #define AVG_3DNOW_OP(a,b,temp, size) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2070 "mov" #size " " #b ", " #temp " \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2071 "pavgusb " #temp ", " #a " \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2072 "mov" #size " " #a ", " #b " \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2073 #define AVG_MMX2_OP(a,b,temp, size) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2074 "mov" #size " " #b ", " #temp " \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2075 "pavgb " #temp ", " #a " \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2076 "mov" #size " " #a ", " #b " \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2077
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2078 #define PAVGB "pavgusb"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2079 QPEL_H264(put_, PUT_OP, 3dnow)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2080 QPEL_H264(avg_, AVG_3DNOW_OP, 3dnow)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2081 #undef PAVGB
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2082 #define PAVGB "pavgb"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2083 QPEL_H264(put_, PUT_OP, mmx2)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2084 QPEL_H264(avg_, AVG_MMX2_OP, mmx2)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2085 QPEL_H264_V_XMM(put_, PUT_OP, sse2)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2086 QPEL_H264_V_XMM(avg_, AVG_MMX2_OP, sse2)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2087 QPEL_H264_HV_XMM(put_, PUT_OP, sse2)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2088 QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, sse2)
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8519
diff changeset
2089 #if HAVE_SSSE3
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2090 QPEL_H264_H_XMM(put_, PUT_OP, ssse3)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2091 QPEL_H264_H_XMM(avg_, AVG_MMX2_OP, ssse3)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2092 QPEL_H264_HV2_XMM(put_, PUT_OP, ssse3)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2093 QPEL_H264_HV2_XMM(avg_, AVG_MMX2_OP, ssse3)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2094 QPEL_H264_HV_XMM(put_, PUT_OP, ssse3)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2095 QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, ssse3)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2096 #endif
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2097 #undef PAVGB
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2098
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2099 H264_MC_4816(3dnow)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2100 H264_MC_4816(mmx2)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2101 H264_MC_816(H264_MC_V, sse2)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2102 H264_MC_816(H264_MC_HV, sse2)
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8519
diff changeset
2103 #if HAVE_SSSE3
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2104 H264_MC_816(H264_MC_H, ssse3)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2105 H264_MC_816(H264_MC_HV, ssse3)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2106 #endif
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2107
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2108 /* rnd interleaved with rnd div 8, use p+1 to access rnd div 8 */
11369
98970e51365a Remove DECLARE_ALIGNED_{8,16} macros
mru
parents: 11017
diff changeset
2109 DECLARE_ALIGNED(8, static const uint64_t, h264_rnd_reg)[4] = {
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2110 0x0020002000200020ULL, 0x0004000400040004ULL, 0x001C001C001C001CULL, 0x0003000300030003ULL
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2111 };
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2112
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2113 #define H264_CHROMA_OP(S,D)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2114 #define H264_CHROMA_OP4(S,D,T)
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2115 #define H264_CHROMA_MC8_TMPL put_h264_chroma_generic_mc8_mmx
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2116 #define H264_CHROMA_MC4_TMPL put_h264_chroma_generic_mc4_mmx
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2117 #define H264_CHROMA_MC2_TMPL put_h264_chroma_mc2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2118 #define H264_CHROMA_MC8_MV0 put_pixels8_mmx
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2119 #include "dsputil_h264_template_mmx.c"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2120
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2121 static void put_h264_chroma_mc8_mmx_rnd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2122 {
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2123 put_h264_chroma_generic_mc8_mmx(dst, src, stride, h, x, y, h264_rnd_reg);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2124 }
9439
ef3a7b711cc0 Rename put_no_rnd_h264_chroma* to reflect its usage in VC1 only
conrad
parents: 8758
diff changeset
2125 static void put_vc1_chroma_mc8_mmx_nornd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2126 {
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2127 put_h264_chroma_generic_mc8_mmx(dst, src, stride, h, x, y, h264_rnd_reg+2);
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2128 }
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2129 static void put_h264_chroma_mc4_mmx(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2130 {
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2131 put_h264_chroma_generic_mc4_mmx(dst, src, stride, h, x, y, h264_rnd_reg);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2132 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2133
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2134 #undef H264_CHROMA_OP
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2135 #undef H264_CHROMA_OP4
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2136 #undef H264_CHROMA_MC8_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2137 #undef H264_CHROMA_MC4_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2138 #undef H264_CHROMA_MC2_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2139 #undef H264_CHROMA_MC8_MV0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2140
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2141 #define H264_CHROMA_OP(S,D) "pavgb " #S ", " #D " \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2142 #define H264_CHROMA_OP4(S,D,T) "movd " #S ", " #T " \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2143 "pavgb " #T ", " #D " \n\t"
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2144 #define H264_CHROMA_MC8_TMPL avg_h264_chroma_generic_mc8_mmx2
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2145 #define H264_CHROMA_MC4_TMPL avg_h264_chroma_generic_mc4_mmx2
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2146 #define H264_CHROMA_MC2_TMPL avg_h264_chroma_mc2_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2147 #define H264_CHROMA_MC8_MV0 avg_pixels8_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2148 #include "dsputil_h264_template_mmx.c"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2149 static void avg_h264_chroma_mc8_mmx2_rnd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2150 {
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2151 avg_h264_chroma_generic_mc8_mmx2(dst, src, stride, h, x, y, h264_rnd_reg);
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2152 }
9440
daee921fb6bb VC1: add and use avg_no_rnd chroma MC functions
conrad
parents: 9439
diff changeset
2153 static void avg_vc1_chroma_mc8_mmx2_nornd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
daee921fb6bb VC1: add and use avg_no_rnd chroma MC functions
conrad
parents: 9439
diff changeset
2154 {
daee921fb6bb VC1: add and use avg_no_rnd chroma MC functions
conrad
parents: 9439
diff changeset
2155 avg_h264_chroma_generic_mc8_mmx2(dst, src, stride, h, x, y, h264_rnd_reg+2);
daee921fb6bb VC1: add and use avg_no_rnd chroma MC functions
conrad
parents: 9439
diff changeset
2156 }
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2157 static void avg_h264_chroma_mc4_mmx2(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2158 {
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2159 avg_h264_chroma_generic_mc4_mmx2(dst, src, stride, h, x, y, h264_rnd_reg);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2160 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2161 #undef H264_CHROMA_OP
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2162 #undef H264_CHROMA_OP4
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2163 #undef H264_CHROMA_MC8_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2164 #undef H264_CHROMA_MC4_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2165 #undef H264_CHROMA_MC2_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2166 #undef H264_CHROMA_MC8_MV0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2167
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2168 #define H264_CHROMA_OP(S,D) "pavgusb " #S ", " #D " \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2169 #define H264_CHROMA_OP4(S,D,T) "movd " #S ", " #T " \n\t"\
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2170 "pavgusb " #T ", " #D " \n\t"
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2171 #define H264_CHROMA_MC8_TMPL avg_h264_chroma_generic_mc8_3dnow
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2172 #define H264_CHROMA_MC4_TMPL avg_h264_chroma_generic_mc4_3dnow
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2173 #define H264_CHROMA_MC8_MV0 avg_pixels8_3dnow
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2174 #include "dsputil_h264_template_mmx.c"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2175 static void avg_h264_chroma_mc8_3dnow_rnd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2176 {
8519
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2177 avg_h264_chroma_generic_mc8_3dnow(dst, src, stride, h, x, y, h264_rnd_reg);
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2178 }
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2179 static void avg_h264_chroma_mc4_3dnow(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2180 {
cc64e1343397 Use H264 MMX chroma functions to accelerate RV40 decoding.
cehoyos
parents: 8510
diff changeset
2181 avg_h264_chroma_generic_mc4_3dnow(dst, src, stride, h, x, y, h264_rnd_reg);
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2182 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2183 #undef H264_CHROMA_OP
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2184 #undef H264_CHROMA_OP4
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2185 #undef H264_CHROMA_MC8_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2186 #undef H264_CHROMA_MC4_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2187 #undef H264_CHROMA_MC8_MV0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2188
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8519
diff changeset
2189 #if HAVE_SSSE3
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2190 #define AVG_OP(X)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2191 #undef H264_CHROMA_MC8_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2192 #undef H264_CHROMA_MC4_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2193 #define H264_CHROMA_MC8_TMPL put_h264_chroma_mc8_ssse3
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2194 #define H264_CHROMA_MC4_TMPL put_h264_chroma_mc4_ssse3
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2195 #define H264_CHROMA_MC8_MV0 put_pixels8_mmx
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2196 #include "dsputil_h264_template_ssse3.c"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2197 static void put_h264_chroma_mc8_ssse3_rnd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2198 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2199 put_h264_chroma_mc8_ssse3(dst, src, stride, h, x, y, 1);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2200 }
9439
ef3a7b711cc0 Rename put_no_rnd_h264_chroma* to reflect its usage in VC1 only
conrad
parents: 8758
diff changeset
2201 static void put_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2202 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2203 put_h264_chroma_mc8_ssse3(dst, src, stride, h, x, y, 0);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2204 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2205
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2206 #undef AVG_OP
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2207 #undef H264_CHROMA_MC8_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2208 #undef H264_CHROMA_MC4_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2209 #undef H264_CHROMA_MC8_MV0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2210 #define AVG_OP(X) X
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2211 #define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_ssse3
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2212 #define H264_CHROMA_MC4_TMPL avg_h264_chroma_mc4_ssse3
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2213 #define H264_CHROMA_MC8_MV0 avg_pixels8_mmx2
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2214 #include "dsputil_h264_template_ssse3.c"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2215 static void avg_h264_chroma_mc8_ssse3_rnd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2216 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2217 avg_h264_chroma_mc8_ssse3(dst, src, stride, h, x, y, 1);
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2218 }
9440
daee921fb6bb VC1: add and use avg_no_rnd chroma MC functions
conrad
parents: 9439
diff changeset
2219 static void avg_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y)
daee921fb6bb VC1: add and use avg_no_rnd chroma MC functions
conrad
parents: 9439
diff changeset
2220 {
daee921fb6bb VC1: add and use avg_no_rnd chroma MC functions
conrad
parents: 9439
diff changeset
2221 avg_h264_chroma_mc8_ssse3(dst, src, stride, h, x, y, 0);
daee921fb6bb VC1: add and use avg_no_rnd chroma MC functions
conrad
parents: 9439
diff changeset
2222 }
8430
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2223 #undef AVG_OP
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2224 #undef H264_CHROMA_MC8_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2225 #undef H264_CHROMA_MC4_TMPL
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2226 #undef H264_CHROMA_MC8_MV0
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2227 #endif
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2228
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2229 /***********************************/
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2230 /* weighted prediction */
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2231
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2232 static inline void ff_h264_weight_WxH_mmx2(uint8_t *dst, int stride, int log2_denom, int weight, int offset, int w, int h)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2233 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2234 int x, y;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2235 offset <<= log2_denom;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2236 offset += (1 << log2_denom) >> 1;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2237 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2238 "movd %0, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2239 "movd %1, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2240 "movd %2, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2241 "pshufw $0, %%mm4, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2242 "pshufw $0, %%mm5, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2243 "pxor %%mm7, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2244 :: "g"(weight), "g"(offset), "g"(log2_denom)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2245 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2246 for(y=0; y<h; y+=2){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2247 for(x=0; x<w; x+=4){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2248 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2249 "movd %0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2250 "movd %1, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2251 "punpcklbw %%mm7, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2252 "punpcklbw %%mm7, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2253 "pmullw %%mm4, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2254 "pmullw %%mm4, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2255 "paddsw %%mm5, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2256 "paddsw %%mm5, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2257 "psraw %%mm6, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2258 "psraw %%mm6, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2259 "packuswb %%mm7, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2260 "packuswb %%mm7, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2261 "movd %%mm0, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2262 "movd %%mm1, %1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2263 : "+m"(*(uint32_t*)(dst+x)),
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2264 "+m"(*(uint32_t*)(dst+x+stride))
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2265 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2266 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2267 dst += 2*stride;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2268 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2269 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2270
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2271 static inline void ff_h264_biweight_WxH_mmx2(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset, int w, int h)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2272 {
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2273 int x, y;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2274 offset = ((offset + 1) | 1) << log2_denom;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2275 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2276 "movd %0, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2277 "movd %1, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2278 "movd %2, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2279 "movd %3, %%mm6 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2280 "pshufw $0, %%mm3, %%mm3 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2281 "pshufw $0, %%mm4, %%mm4 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2282 "pshufw $0, %%mm5, %%mm5 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2283 "pxor %%mm7, %%mm7 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2284 :: "g"(weightd), "g"(weights), "g"(offset), "g"(log2_denom+1)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2285 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2286 for(y=0; y<h; y++){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2287 for(x=0; x<w; x+=4){
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2288 __asm__ volatile(
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2289 "movd %0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2290 "movd %1, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2291 "punpcklbw %%mm7, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2292 "punpcklbw %%mm7, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2293 "pmullw %%mm3, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2294 "pmullw %%mm4, %%mm1 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2295 "paddsw %%mm1, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2296 "paddsw %%mm5, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2297 "psraw %%mm6, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2298 "packuswb %%mm0, %%mm0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2299 "movd %%mm0, %0 \n\t"
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2300 : "+m"(*(uint32_t*)(dst+x))
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2301 : "m"(*(uint32_t*)(src+x))
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2302 );
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2303 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2304 src += stride;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2305 dst += stride;
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2306 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2307 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2308
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2309 #define H264_WEIGHT(W,H) \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2310 static void ff_h264_biweight_ ## W ## x ## H ## _mmx2(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset){ \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2311 ff_h264_biweight_WxH_mmx2(dst, src, stride, log2_denom, weightd, weights, offset, W, H); \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2312 } \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2313 static void ff_h264_weight_ ## W ## x ## H ## _mmx2(uint8_t *dst, int stride, int log2_denom, int weight, int offset){ \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2314 ff_h264_weight_WxH_mmx2(dst, stride, log2_denom, weight, offset, W, H); \
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2315 }
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2316
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2317 H264_WEIGHT(16,16)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2318 H264_WEIGHT(16, 8)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2319 H264_WEIGHT( 8,16)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2320 H264_WEIGHT( 8, 8)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2321 H264_WEIGHT( 8, 4)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2322 H264_WEIGHT( 4, 8)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2323 H264_WEIGHT( 4, 4)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2324 H264_WEIGHT( 4, 2)
7768bdfd4f7b Rename libavcodec/i386/ --> libavcodec/x86/.
diego
parents:
diff changeset
2325
12366
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2326 void ff_h264_biweight_8x8_sse2(uint8_t *dst, uint8_t *src, int stride,
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2327 int log2_denom, int weightd, int weights,
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2328 int offset);
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2329
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2330 void ff_h264_biweight_16x16_sse2(uint8_t *dst, uint8_t *src, int stride,
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2331 int log2_denom, int weightd, int weights,
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2332 int offset);
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2333
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2334 void ff_h264_biweight_8x8_ssse3(uint8_t *dst, uint8_t *src, int stride,
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2335 int log2_denom, int weightd, int weights,
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2336 int offset);
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2337
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2338 void ff_h264_biweight_16x16_ssse3(uint8_t *dst, uint8_t *src, int stride,
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2339 int log2_denom, int weightd, int weights,
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2340 int offset);
09a31ef6ed58 H.264: SSE2/SSSE3 weighted prediction asm
darkshikari
parents: 12035
diff changeset
2341
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2342 void ff_pred16x16_vertical_mmx (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2343 void ff_pred16x16_vertical_sse (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2344 void ff_pred16x16_horizontal_mmx (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2345 void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2346 void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2347 void ff_pred16x16_dc_mmxext (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2348 void ff_pred16x16_dc_sse2 (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2349 void ff_pred16x16_dc_ssse3 (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2350 void ff_pred16x16_tm_vp8_mmx (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2351 void ff_pred16x16_tm_vp8_mmxext (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2352 void ff_pred16x16_tm_vp8_sse2 (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2353 void ff_pred8x8_dc_rv40_mmxext (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2354 void ff_pred8x8_vertical_mmx (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2355 void ff_pred8x8_horizontal_mmx (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2356 void ff_pred8x8_horizontal_mmxext (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2357 void ff_pred8x8_horizontal_ssse3 (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2358 void ff_pred8x8_tm_vp8_mmx (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2359 void ff_pred8x8_tm_vp8_mmxext (uint8_t *src, int stride);
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2360 void ff_pred8x8_tm_vp8_sse2 (uint8_t *src, int stride);
11953
65470eea7561 Cosmetics: Fix indentation.
cehoyos
parents: 11951
diff changeset
2361 void ff_pred8x8_tm_vp8_ssse3 (uint8_t *src, int stride);
12001
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11993
diff changeset
2362 void ff_pred4x4_dc_mmxext (uint8_t *src, const uint8_t *topright, int stride);
12003
3b761226ea35 Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents: 12001
diff changeset
2363 void ff_pred4x4_tm_vp8_mmx (uint8_t *src, const uint8_t *topright, int stride);
3b761226ea35 Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents: 12001
diff changeset
2364 void ff_pred4x4_tm_vp8_mmxext (uint8_t *src, const uint8_t *topright, int stride);
3b761226ea35 Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents: 12001
diff changeset
2365 void ff_pred4x4_tm_vp8_ssse3 (uint8_t *src, const uint8_t *topright, int stride);
12004
2002ea7c06f6 MMXEXT version of vp8 4x4 vertical pred
darkshikari
parents: 12003
diff changeset
2366 void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2367
12379
2ea2fd28da07 Split h264dsp and h264pred in configure.
darkshikari
parents: 12366
diff changeset
2368 #if CONFIG_H264PRED
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2369 void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2370 {
12414
3fc4c625b6f3 Remove global mm_flags variable
mru
parents: 12379
diff changeset
2371 int mm_flags = mm_support();
12012
2d70a8b0ec8a Add missing mm_support call toff_h264_pred_init_x86.
darkshikari
parents: 12004
diff changeset
2372
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2373 #if HAVE_YASM
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2374 if (mm_flags & FF_MM_MMX) {
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2375 h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_mmx;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2376 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2377 h->pred8x8 [VERT_PRED8x8] = ff_pred8x8_vertical_mmx;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2378 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2379 if (codec_id == CODEC_ID_VP8) {
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2380 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmx;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2381 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmx;
12003
3b761226ea35 Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents: 12001
diff changeset
2382 h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmx;
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2383 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2384 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2385
11993
c15e87b9767b Change MMXEXT to MMX2, MMXEXT is deprecated
bcoudurier
parents: 11987
diff changeset
2386 if (mm_flags & FF_MM_MMX2) {
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2387 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2388 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmxext;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2389 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
12001
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11993
diff changeset
2390 h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_mmxext;
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2391 if (codec_id == CODEC_ID_VP8) {
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2392 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2393 h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2394 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext;
12003
3b761226ea35 Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents: 12001
diff changeset
2395 h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmxext;
12004
2002ea7c06f6 MMXEXT version of vp8 4x4 vertical pred
darkshikari
parents: 12003
diff changeset
2396 h->pred4x4 [VERT_PRED ] = ff_pred4x4_vertical_vp8_mmxext;
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2397 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2398 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2399
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2400 if (mm_flags & FF_MM_SSE) {
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2401 h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2402 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2403
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2404 if (mm_flags & FF_MM_SSE2) {
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2405 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2406 if (codec_id == CODEC_ID_VP8) {
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2407 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2408 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2409 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2410 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2411
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2412 if (mm_flags & FF_MM_SSSE3) {
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2413 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2414 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2415 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2416 if (codec_id == CODEC_ID_VP8) {
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2417 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3;
12003
3b761226ea35 Add mmx/mmxext/ssse3 4x4 TM intra pred functions for vp8
darkshikari
parents: 12001
diff changeset
2418 h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_ssse3;
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2419 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2420 }
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2421 #endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents: 11701
diff changeset
2422 }
11987
f910bb8f9257 Fix x86 build with h264dsp disabled
mru
parents: 11953
diff changeset
2423 #endif