annotate i386/h264dsp_mmx.c @ 3001:b52d8ee430f6 libavcodec

fix some potential arithmetic overflows in pred_direct_motion() and ff_h264_weight_WxH_mmx2().
author lorenm
date Fri, 30 Dec 2005 23:47:41 +0000
parents bfabfdf9ce55
children 7a92269a3ccd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
1 /*
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
2 * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
3 *
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
4 * This library is free software; you can redistribute it and/or
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
5 * modify it under the terms of the GNU Lesser General Public
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
8 *
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
12 * Lesser General Public License for more details.
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
13 *
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
14 * You should have received a copy of the GNU Lesser General Public
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
15 * License along with this library; if not, write to the Free Software
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
17 */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
18
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
19
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
20 /***********************************/
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
21 /* IDCT */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
22
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
23 /* in/out: mma=mma+mmb, mmb=mmb-mma */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
24 #define SUMSUB_BA( a, b ) \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
25 "paddw "#b", "#a" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
26 "paddw "#b", "#b" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
27 "psubw "#a", "#b" \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
28
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
29 #define SUMSUB_BADC( a, b, c, d ) \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
30 "paddw "#b", "#a" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
31 "paddw "#d", "#c" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
32 "paddw "#b", "#b" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
33 "paddw "#d", "#d" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
34 "psubw "#a", "#b" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
35 "psubw "#c", "#d" \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
36
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
37 #define SUMSUBD2_AB( a, b, t ) \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
38 "movq "#b", "#t" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
39 "psraw $1 , "#b" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
40 "paddw "#a", "#b" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
41 "psraw $1 , "#a" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
42 "psubw "#t", "#a" \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
43
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
44 #define IDCT4_1D( s02, s13, d02, d13, t ) \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
45 SUMSUB_BA ( s02, d02 )\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
46 SUMSUBD2_AB( s13, d13, t )\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
47 SUMSUB_BADC( d13, s02, s13, d02 )
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
48
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
49 #define SBUTTERFLY(a,b,t,n)\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
50 "movq " #a ", " #t " \n\t" /* abcd */\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
51 "punpckl" #n " " #b ", " #a " \n\t" /* aebf */\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
52 "punpckh" #n " " #b ", " #t " \n\t" /* cgdh */\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
53
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
54 #define TRANSPOSE4(a,b,c,d,t)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
55 SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
56 SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
57 SBUTTERFLY(a,c,d,dq) /* a=aeim d=bfjn */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
58 SBUTTERFLY(t,b,c,dq) /* t=cgko c=dhlp */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
59
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
60 #define STORE_DIFF_4P( p, t, z ) \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
61 "psraw $6, "#p" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
62 "movd (%0), "#t" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
63 "punpcklbw "#z", "#t" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
64 "paddsw "#t", "#p" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
65 "packuswb "#z", "#p" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
66 "movd "#p", (%0) \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
67
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
68 void ff_h264_idct_add_mmx2(uint8_t *dst, int16_t *block, int stride)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
69 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
70 /* Load dct coeffs */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
71 asm volatile(
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
72 "movq (%0), %%mm0 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
73 "movq 8(%0), %%mm1 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
74 "movq 16(%0), %%mm2 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
75 "movq 24(%0), %%mm3 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
76 :: "r"(block) );
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
77
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
78 asm volatile(
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
79 /* mm1=s02+s13 mm2=s02-s13 mm4=d02+d13 mm0=d02-d13 */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
80 IDCT4_1D( %%mm2, %%mm1, %%mm0, %%mm3, %%mm4 )
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
81
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
82 "movq %0, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
83 /* in: 1,4,0,2 out: 1,2,3,0 */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
84 TRANSPOSE4( %%mm3, %%mm1, %%mm0, %%mm2, %%mm4 )
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
85
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
86 "paddw %%mm6, %%mm3 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
87
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
88 /* mm2=s02+s13 mm3=s02-s13 mm4=d02+d13 mm1=d02-d13 */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
89 IDCT4_1D( %%mm4, %%mm2, %%mm3, %%mm0, %%mm1 )
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
90
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
91 "pxor %%mm7, %%mm7 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
92 :: "m"(ff_pw_32));
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
93
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
94 asm volatile(
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
95 STORE_DIFF_4P( %%mm0, %%mm1, %%mm7)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
96 "add %1, %0 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
97 STORE_DIFF_4P( %%mm2, %%mm1, %%mm7)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
98 "add %1, %0 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
99 STORE_DIFF_4P( %%mm3, %%mm1, %%mm7)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
100 "add %1, %0 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
101 STORE_DIFF_4P( %%mm4, %%mm1, %%mm7)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
102 : "+r"(dst)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
103 : "r" ((long)stride)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
104 );
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
105 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
106
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
107
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
108 /***********************************/
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
109 /* deblocking */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
110
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
111 // out: o = |x-y|>a
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
112 // clobbers: t
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
113 #define DIFF_GT_MMX(x,y,a,o,t)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
114 "movq "#y", "#t" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
115 "movq "#x", "#o" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
116 "psubusb "#x", "#t" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
117 "psubusb "#y", "#o" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
118 "por "#t", "#o" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
119 "psubusb "#a", "#o" \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
120
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
121 // in: mm0=p1 mm1=p0 mm2=q0 mm3=q1
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
122 // out: mm5=beta-1, mm7=mask
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
123 // clobbers: mm4,mm6
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
124 #define H264_DEBLOCK_MASK(alpha1, beta1) \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
125 "pshufw $0, "#alpha1", %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
126 "pshufw $0, "#beta1 ", %%mm5 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
127 "packuswb %%mm4, %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
128 "packuswb %%mm5, %%mm5 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
129 DIFF_GT_MMX(%%mm1, %%mm2, %%mm4, %%mm7, %%mm6) /* |p0-q0| > alpha-1 */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
130 DIFF_GT_MMX(%%mm0, %%mm1, %%mm5, %%mm4, %%mm6) /* |p1-p0| > beta-1 */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
131 "por %%mm4, %%mm7 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
132 DIFF_GT_MMX(%%mm3, %%mm2, %%mm5, %%mm4, %%mm6) /* |q1-q0| > beta-1 */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
133 "por %%mm4, %%mm7 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
134 "pxor %%mm6, %%mm6 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
135 "pcmpeqb %%mm6, %%mm7 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
136
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
137 // in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
138 // out: mm1=p0' mm2=q0'
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
139 // clobbers: mm0,3-6
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
140 #define H264_DEBLOCK_P0_Q0(pb_01, pb_3f)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
141 /* a = q0^p0^((p1-q1)>>2) */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
142 "movq %%mm0, %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
143 "psubb %%mm3, %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
144 "psrlw $2, %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
145 "pxor %%mm1, %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
146 "pxor %%mm2, %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
147 /* b = p0^(q1>>2) */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
148 "psrlw $2, %%mm3 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
149 "pand "#pb_3f", %%mm3 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
150 "movq %%mm1, %%mm5 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
151 "pxor %%mm3, %%mm5 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
152 /* c = q0^(p1>>2) */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
153 "psrlw $2, %%mm0 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
154 "pand "#pb_3f", %%mm0 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
155 "movq %%mm2, %%mm6 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
156 "pxor %%mm0, %%mm6 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
157 /* d = (c^b) & ~(b^a) & 1 */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
158 "pxor %%mm5, %%mm6 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
159 "pxor %%mm4, %%mm5 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
160 "pandn %%mm6, %%mm5 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
161 "pand "#pb_01", %%mm5 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
162 /* delta = (avg(q0, p1>>2) + (d&a))
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
163 * - (avg(p0, q1>>2) + (d&~a)) */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
164 "pavgb %%mm2, %%mm0 \n\t"\
2855
da95623de901 simplify (d&a) and (d&~a) calculation, hint by skal
michael
parents: 2754
diff changeset
165 "pand %%mm5, %%mm4 \n\t"\
da95623de901 simplify (d&a) and (d&~a) calculation, hint by skal
michael
parents: 2754
diff changeset
166 "paddusb %%mm4, %%mm0 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
167 "pavgb %%mm1, %%mm3 \n\t"\
2855
da95623de901 simplify (d&a) and (d&~a) calculation, hint by skal
michael
parents: 2754
diff changeset
168 "pxor %%mm5, %%mm4 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
169 "paddusb %%mm4, %%mm3 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
170 /* p0 += clip(delta, -tc0, tc0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
171 * q0 -= clip(delta, -tc0, tc0) */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
172 "movq %%mm0, %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
173 "psubusb %%mm3, %%mm0 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
174 "psubusb %%mm4, %%mm3 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
175 "pminub %%mm7, %%mm0 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
176 "pminub %%mm7, %%mm3 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
177 "paddusb %%mm0, %%mm1 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
178 "paddusb %%mm3, %%mm2 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
179 "psubusb %%mm3, %%mm1 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
180 "psubusb %%mm0, %%mm2 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
181
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
182 // in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask) %8=mm_bone
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
183 // out: (q1addr) = clip( (q2+((p0+q0+1)>>1))>>1, q1-tc0, q1+tc0 )
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
184 // clobbers: q2, tmp, tc0
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
185 #define H264_DEBLOCK_Q1(p1, q2, q2addr, q1addr, tc0, tmp)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
186 "movq %%mm1, "#tmp" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
187 "pavgb %%mm2, "#tmp" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
188 "pavgb "#tmp", "#q2" \n\t" /* avg(p2,avg(p0,q0)) */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
189 "pxor "q2addr", "#tmp" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
190 "pand %8, "#tmp" \n\t" /* (p2^avg(p0,q0))&1 */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
191 "psubusb "#tmp", "#q2" \n\t" /* (p2+((p0+q0+1)>>1))>>1 */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
192 "movq "#p1", "#tmp" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
193 "psubusb "#tc0", "#tmp" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
194 "paddusb "#p1", "#tc0" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
195 "pmaxub "#tmp", "#q2" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
196 "pminub "#tc0", "#q2" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
197 "movq "#q2", "q1addr" \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
198
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
199 static inline void h264_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
200 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
201 uint64_t tmp0;
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
202 uint64_t tc = (uint8_t)tc0[1]*0x01010000 | (uint8_t)tc0[0]*0x0101;
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
203 // with luma, tc0=0 doesn't mean no filtering, so we need a separate input mask
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
204 uint32_t mask[2] = { (tc0[0]>=0)*0xffffffff, (tc0[1]>=0)*0xffffffff };
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
205
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
206 asm volatile(
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
207 "movq (%1,%3), %%mm0 \n\t" //p1
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
208 "movq (%1,%3,2), %%mm1 \n\t" //p0
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
209 "movq (%2), %%mm2 \n\t" //q0
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
210 "movq (%2,%3), %%mm3 \n\t" //q1
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
211 H264_DEBLOCK_MASK(%6, %7)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
212 "pand %5, %%mm7 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
213 "movq %%mm7, %0 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
214
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
215 /* filter p1 */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
216 "movq (%1), %%mm3 \n\t" //p2
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
217 DIFF_GT_MMX(%%mm1, %%mm3, %%mm5, %%mm6, %%mm4) // |p2-p0|>beta-1
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
218 "pandn %%mm7, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
219 "pcmpeqb %%mm7, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
220 "pand %%mm7, %%mm6 \n\t" // mask & |p2-p0|<beta
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
221 "pshufw $80, %4, %%mm4 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
222 "pand %%mm7, %%mm4 \n\t" // mask & tc0
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
223 "movq %8, %%mm7 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
224 "pand %%mm6, %%mm7 \n\t" // mask & |p2-p0|<beta & 1
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
225 "pand %%mm4, %%mm6 \n\t" // mask & |p2-p0|<beta & tc0
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
226 "paddb %%mm4, %%mm7 \n\t" // tc++
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
227 H264_DEBLOCK_Q1(%%mm0, %%mm3, "(%1)", "(%1,%3)", %%mm6, %%mm4)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
228
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
229 /* filter q1 */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
230 "movq (%2,%3,2), %%mm4 \n\t" //q2
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
231 DIFF_GT_MMX(%%mm2, %%mm4, %%mm5, %%mm6, %%mm3) // |q2-q0|>beta-1
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
232 "pandn %0, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
233 "pcmpeqb %0, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
234 "pand %0, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
235 "pshufw $80, %4, %%mm5 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
236 "pand %%mm6, %%mm5 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
237 "pand %8, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
238 "paddb %%mm6, %%mm7 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
239 "movq (%2,%3), %%mm3 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
240 H264_DEBLOCK_Q1(%%mm3, %%mm4, "(%2,%3,2)", "(%2,%3)", %%mm5, %%mm6)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
241
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
242 /* filter p0, q0 */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
243 H264_DEBLOCK_P0_Q0(%8, %9)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
244 "movq %%mm1, (%1,%3,2) \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
245 "movq %%mm2, (%2) \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
246
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
247 : "=m"(tmp0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
248 : "r"(pix-3*stride), "r"(pix), "r"((long)stride),
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
249 "m"(tc), "m"(*(uint64_t*)mask), "m"(alpha1), "m"(beta1),
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
250 "m"(mm_bone), "m"(ff_pb_3F)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
251 );
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
252 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
253
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
254 static void h264_v_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
255 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
256 if((tc0[0] & tc0[1]) >= 0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
257 h264_loop_filter_luma_mmx2(pix, stride, alpha-1, beta-1, tc0);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
258 if((tc0[2] & tc0[3]) >= 0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
259 h264_loop_filter_luma_mmx2(pix+8, stride, alpha-1, beta-1, tc0+2);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
260 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
261 static void h264_h_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
262 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
263 //FIXME: could cut some load/stores by merging transpose with filter
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
264 // also, it only needs to transpose 6x8
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
265 uint8_t trans[8*8];
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
266 int i;
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
267 for(i=0; i<2; i++, pix+=8*stride, tc0+=2) {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
268 if((tc0[0] & tc0[1]) < 0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
269 continue;
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
270 transpose4x4(trans, pix-4, 8, stride);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
271 transpose4x4(trans +4*8, pix, 8, stride);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
272 transpose4x4(trans+4, pix-4+4*stride, 8, stride);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
273 transpose4x4(trans+4+4*8, pix +4*stride, 8, stride);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
274 h264_loop_filter_luma_mmx2(trans+4*8, 8, alpha-1, beta-1, tc0);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
275 transpose4x4(pix-2, trans +2*8, stride, 8);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
276 transpose4x4(pix-2+4*stride, trans+4+2*8, stride, 8);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
277 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
278 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
279
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
280 static inline void h264_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
281 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
282 asm volatile(
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
283 "movq (%0), %%mm0 \n\t" //p1
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
284 "movq (%0,%2), %%mm1 \n\t" //p0
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
285 "movq (%1), %%mm2 \n\t" //q0
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
286 "movq (%1,%2), %%mm3 \n\t" //q1
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
287 H264_DEBLOCK_MASK(%4, %5)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
288 "movd %3, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
289 "punpcklbw %%mm6, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
290 "pand %%mm6, %%mm7 \n\t" // mm7 = tc&mask
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
291 H264_DEBLOCK_P0_Q0(%6, %7)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
292 "movq %%mm1, (%0,%2) \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
293 "movq %%mm2, (%1) \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
294
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
295 :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
296 "r"(*(uint32_t*)tc0),
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
297 "m"(alpha1), "m"(beta1), "m"(mm_bone), "m"(ff_pb_3F)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
298 );
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
299 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
300
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
301 static void h264_v_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
302 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
303 h264_loop_filter_chroma_mmx2(pix, stride, alpha-1, beta-1, tc0);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
304 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
305
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
306 static void h264_h_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
307 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
308 //FIXME: could cut some load/stores by merging transpose with filter
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
309 uint8_t trans[8*4];
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
310 transpose4x4(trans, pix-2, 8, stride);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
311 transpose4x4(trans+4, pix-2+4*stride, 8, stride);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
312 h264_loop_filter_chroma_mmx2(trans+2*8, 8, alpha-1, beta-1, tc0);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
313 transpose4x4(pix-2, trans, stride, 8);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
314 transpose4x4(pix-2+4*stride, trans+4, stride, 8);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
315 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
316
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
317 // p0 = (p0 + q1 + 2*p1 + 2) >> 2
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
318 #define H264_FILTER_CHROMA4(p0, p1, q1, one) \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
319 "movq "#p0", %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
320 "pxor "#q1", %%mm4 \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
321 "pand "#one", %%mm4 \n\t" /* mm4 = (p0^q1)&1 */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
322 "pavgb "#q1", "#p0" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
323 "psubusb %%mm4, "#p0" \n\t"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
324 "pavgb "#p1", "#p0" \n\t" /* dst = avg(p1, avg(p0,q1) - ((p0^q1)&1)) */\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
325
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
326 static inline void h264_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha1, int beta1)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
327 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
328 asm volatile(
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
329 "movq (%0), %%mm0 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
330 "movq (%0,%2), %%mm1 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
331 "movq (%1), %%mm2 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
332 "movq (%1,%2), %%mm3 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
333 H264_DEBLOCK_MASK(%3, %4)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
334 "movq %%mm1, %%mm5 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
335 "movq %%mm2, %%mm6 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
336 H264_FILTER_CHROMA4(%%mm1, %%mm0, %%mm3, %5) //p0'
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
337 H264_FILTER_CHROMA4(%%mm2, %%mm3, %%mm0, %5) //q0'
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
338 "psubb %%mm5, %%mm1 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
339 "psubb %%mm6, %%mm2 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
340 "pand %%mm7, %%mm1 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
341 "pand %%mm7, %%mm2 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
342 "paddb %%mm5, %%mm1 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
343 "paddb %%mm6, %%mm2 \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
344 "movq %%mm1, (%0,%2) \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
345 "movq %%mm2, (%1) \n\t"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
346 :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
347 "m"(alpha1), "m"(beta1), "m"(mm_bone)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
348 );
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
349 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
350
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
351 static void h264_v_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
352 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
353 h264_loop_filter_chroma_intra_mmx2(pix, stride, alpha-1, beta-1);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
354 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
355
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
356 static void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
357 {
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
358 //FIXME: could cut some load/stores by merging transpose with filter
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
359 uint8_t trans[8*4];
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
360 transpose4x4(trans, pix-2, 8, stride);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
361 transpose4x4(trans+4, pix-2+4*stride, 8, stride);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
362 h264_loop_filter_chroma_intra_mmx2(trans+2*8, 8, alpha-1, beta-1);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
363 transpose4x4(pix-2, trans, stride, 8);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
364 transpose4x4(pix-2+4*stride, trans+4, stride, 8);
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
365 }
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
366
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
367
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
368 /***********************************/
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
369 /* motion compensation */
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
370
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
371 #define QPEL_H264V(A,B,C,D,E,F,OP)\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
372 "movd (%0), "#F" \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
373 "movq "#C", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
374 "paddw "#D", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
375 "psllw $2, %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
376 "psubw "#B", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
377 "psubw "#E", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
378 "pmullw %4, %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
379 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
380 "punpcklbw %%mm7, "#F" \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
381 "paddw %5, "#A" \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
382 "paddw "#F", "#A" \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
383 "paddw "#A", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
384 "psraw $5, %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
385 "packuswb %%mm6, %%mm6 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
386 OP(%%mm6, (%1), A, d)\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
387 "add %3, %1 \n\t"
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
388
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
389 #define QPEL_H264HV(A,B,C,D,E,F,OF)\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
390 "movd (%0), "#F" \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
391 "movq "#C", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
392 "paddw "#D", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
393 "psllw $2, %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
394 "psubw "#B", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
395 "psubw "#E", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
396 "pmullw %3, %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
397 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
398 "punpcklbw %%mm7, "#F" \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
399 "paddw "#F", "#A" \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
400 "paddw "#A", %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
401 "movq %%mm6, "#OF"(%1) \n\t"
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2922
diff changeset
402
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
403 #define QPEL_H264(OPNAME, OP, MMX)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
404 static void OPNAME ## h264_qpel4_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
405 int h=4;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
406 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
407 asm volatile(\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
408 "pxor %%mm7, %%mm7 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
409 "movq %5, %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
410 "movq %6, %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
411 "1: \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
412 "movd -1(%0), %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
413 "movd (%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
414 "movd 1(%0), %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
415 "movd 2(%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
416 "punpcklbw %%mm7, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
417 "punpcklbw %%mm7, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
418 "punpcklbw %%mm7, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
419 "punpcklbw %%mm7, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
420 "paddw %%mm0, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
421 "paddw %%mm3, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
422 "movd -2(%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
423 "movd 3(%0), %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
424 "punpcklbw %%mm7, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
425 "punpcklbw %%mm7, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
426 "paddw %%mm3, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
427 "psllw $2, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
428 "psubw %%mm1, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
429 "pmullw %%mm4, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
430 "paddw %%mm5, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
431 "paddw %%mm2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
432 "psraw $5, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
433 "packuswb %%mm0, %%mm0 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
434 OP(%%mm0, (%1),%%mm6, d)\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
435 "add %3, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
436 "add %4, %1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
437 "decl %2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
438 " jnz 1b \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
439 : "+a"(src), "+c"(dst), "+m"(h)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
440 : "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
441 : "memory"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
442 );\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
443 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
444 static void OPNAME ## h264_qpel4_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
445 src -= 2*srcStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
446 asm volatile(\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
447 "pxor %%mm7, %%mm7 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
448 "movd (%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
449 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
450 "movd (%0), %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
451 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
452 "movd (%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
453 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
454 "movd (%0), %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
455 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
456 "movd (%0), %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
457 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
458 "punpcklbw %%mm7, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
459 "punpcklbw %%mm7, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
460 "punpcklbw %%mm7, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
461 "punpcklbw %%mm7, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
462 "punpcklbw %%mm7, %%mm4 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
463 QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
464 QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
465 QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
466 QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
467 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
468 : "+a"(src), "+c"(dst)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
469 : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
470 : "memory"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
471 );\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
472 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
473 static void OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
474 int h=4;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
475 int w=3;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
476 src -= 2*srcStride+2;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
477 while(w--){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
478 asm volatile(\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
479 "pxor %%mm7, %%mm7 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
480 "movd (%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
481 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
482 "movd (%0), %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
483 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
484 "movd (%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
485 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
486 "movd (%0), %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
487 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
488 "movd (%0), %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
489 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
490 "punpcklbw %%mm7, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
491 "punpcklbw %%mm7, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
492 "punpcklbw %%mm7, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
493 "punpcklbw %%mm7, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
494 "punpcklbw %%mm7, %%mm4 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
495 QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*3)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
496 QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*3)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
497 QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*3)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
498 QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*3)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
499 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
500 : "+a"(src)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
501 : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
502 : "memory"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
503 );\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
504 tmp += 4;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
505 src += 4 - 9*srcStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
506 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
507 tmp -= 3*4;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
508 asm volatile(\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
509 "movq %4, %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
510 "1: \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
511 "movq (%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
512 "paddw 10(%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
513 "movq 2(%0), %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
514 "paddw 8(%0), %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
515 "movq 4(%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
516 "paddw 6(%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
517 "psubw %%mm1, %%mm0 \n\t"/*a-b (abccba)*/\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
518 "psraw $2, %%mm0 \n\t"/*(a-b)/4 */\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
519 "psubw %%mm1, %%mm0 \n\t"/*(a-b)/4-b */\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
520 "paddsw %%mm2, %%mm0 \n\t"\
3001
b52d8ee430f6 fix some potential arithmetic overflows in pred_direct_motion() and
lorenm
parents: 2979
diff changeset
521 "psraw $2, %%mm0 \n\t"/*((a-b)/4-b+c)/4 */\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
522 "paddw %%mm6, %%mm2 \n\t"\
3001
b52d8ee430f6 fix some potential arithmetic overflows in pred_direct_motion() and
lorenm
parents: 2979
diff changeset
523 "paddw %%mm2, %%mm0 \n\t"/*(a-5*b+20*c)/16 +32 */\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
524 "psraw $6, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
525 "packuswb %%mm0, %%mm0 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
526 OP(%%mm0, (%1),%%mm7, d)\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
527 "add $24, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
528 "add %3, %1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
529 "decl %2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
530 " jnz 1b \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
531 : "+a"(tmp), "+c"(dst), "+m"(h)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
532 : "S"((long)dstStride), "m"(ff_pw_32)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
533 : "memory"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
534 );\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
535 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
536 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
537 static void OPNAME ## h264_qpel8_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
538 int h=8;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
539 asm volatile(\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
540 "pxor %%mm7, %%mm7 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
541 "movq %5, %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
542 "1: \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
543 "movq (%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
544 "movq 1(%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
545 "movq %%mm0, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
546 "movq %%mm2, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
547 "punpcklbw %%mm7, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
548 "punpckhbw %%mm7, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
549 "punpcklbw %%mm7, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
550 "punpckhbw %%mm7, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
551 "paddw %%mm2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
552 "paddw %%mm3, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
553 "psllw $2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
554 "psllw $2, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
555 "movq -1(%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
556 "movq 2(%0), %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
557 "movq %%mm2, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
558 "movq %%mm4, %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
559 "punpcklbw %%mm7, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
560 "punpckhbw %%mm7, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
561 "punpcklbw %%mm7, %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
562 "punpckhbw %%mm7, %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
563 "paddw %%mm4, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
564 "paddw %%mm3, %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
565 "psubw %%mm2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
566 "psubw %%mm5, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
567 "pmullw %%mm6, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
568 "pmullw %%mm6, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
569 "movd -2(%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
570 "movd 7(%0), %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
571 "punpcklbw %%mm7, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
572 "punpcklbw %%mm7, %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
573 "paddw %%mm3, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
574 "paddw %%mm5, %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
575 "movq %6, %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
576 "paddw %%mm5, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
577 "paddw %%mm5, %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
578 "paddw %%mm2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
579 "paddw %%mm4, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
580 "psraw $5, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
581 "psraw $5, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
582 "packuswb %%mm1, %%mm0 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
583 OP(%%mm0, (%1),%%mm5, q)\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
584 "add %3, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
585 "add %4, %1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
586 "decl %2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
587 " jnz 1b \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
588 : "+a"(src), "+c"(dst), "+m"(h)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
589 : "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
590 : "memory"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
591 );\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
592 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
593 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
594 static void OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
595 int h= 2;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
596 src -= 2*srcStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
597 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
598 while(h--){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
599 asm volatile(\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
600 "pxor %%mm7, %%mm7 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
601 "movd (%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
602 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
603 "movd (%0), %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
604 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
605 "movd (%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
606 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
607 "movd (%0), %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
608 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
609 "movd (%0), %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
610 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
611 "punpcklbw %%mm7, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
612 "punpcklbw %%mm7, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
613 "punpcklbw %%mm7, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
614 "punpcklbw %%mm7, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
615 "punpcklbw %%mm7, %%mm4 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
616 QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
617 QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
618 QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
619 QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
620 QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
621 QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
622 QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
623 QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
624 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
625 : "+a"(src), "+c"(dst)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
626 : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
627 : "memory"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
628 );\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
629 src += 4-13*srcStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
630 dst += 4-8*dstStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
631 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
632 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
633 static void OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
634 int h=8;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
635 int w=4;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
636 src -= 2*srcStride+2;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
637 while(w--){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
638 asm volatile(\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
639 "pxor %%mm7, %%mm7 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
640 "movd (%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
641 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
642 "movd (%0), %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
643 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
644 "movd (%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
645 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
646 "movd (%0), %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
647 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
648 "movd (%0), %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
649 "add %2, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
650 "punpcklbw %%mm7, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
651 "punpcklbw %%mm7, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
652 "punpcklbw %%mm7, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
653 "punpcklbw %%mm7, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
654 "punpcklbw %%mm7, %%mm4 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
655 QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*4)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
656 QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*4)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
657 QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*4)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
658 QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*4)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
659 QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 4*8*4)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
660 QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 5*8*4)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
661 QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 6*8*4)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
662 QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 7*8*4)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
663 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
664 : "+a"(src)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
665 : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
666 : "memory"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
667 );\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
668 tmp += 4;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
669 src += 4 - 13*srcStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
670 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
671 tmp -= 4*4;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
672 asm volatile(\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
673 "movq %4, %%mm6 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
674 "1: \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
675 "movq (%0), %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
676 "movq 8(%0), %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
677 "movq 2(%0), %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
678 "movq 10(%0), %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
679 "paddw %%mm4, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
680 "paddw %%mm3, %%mm1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
681 "paddw 18(%0), %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
682 "paddw 16(%0), %%mm4 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
683 "movq 4(%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
684 "movq 12(%0), %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
685 "paddw 6(%0), %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
686 "paddw 14(%0), %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
687 "psubw %%mm1, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
688 "psubw %%mm4, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
689 "psraw $2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
690 "psraw $2, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
691 "psubw %%mm1, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
692 "psubw %%mm4, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
693 "paddsw %%mm2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
694 "paddsw %%mm5, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
695 "psraw $2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
696 "psraw $2, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
697 "paddw %%mm6, %%mm2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
698 "paddw %%mm6, %%mm5 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
699 "paddw %%mm2, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
700 "paddw %%mm5, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
701 "psraw $6, %%mm0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
702 "psraw $6, %%mm3 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
703 "packuswb %%mm3, %%mm0 \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
704 OP(%%mm0, (%1),%%mm7, q)\
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
705 "add $32, %0 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
706 "add %3, %1 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
707 "decl %2 \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
708 " jnz 1b \n\t"\
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
709 : "+a"(tmp), "+c"(dst), "+m"(h)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
710 : "S"((long)dstStride), "m"(ff_pw_32)\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
711 : "memory"\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
712 );\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
713 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
714 static void OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
715 OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
716 OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
717 src += 8*srcStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
718 dst += 8*dstStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
719 OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
720 OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
721 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
722 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
723 static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
724 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
725 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
726 src += 8*srcStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
727 dst += 8*dstStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
728 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
729 OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
730 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
731 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
732 static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
733 OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
734 OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst+8, tmp , src+8, dstStride, tmpStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
735 src += 8*srcStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
736 dst += 8*dstStride;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
737 OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
738 OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst+8, tmp , src+8, dstStride, tmpStride, srcStride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
739 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
740
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
741 #define H264_MC(OPNAME, SIZE, MMX) \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
742 static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
743 OPNAME ## pixels ## SIZE ## _mmx(dst, src, stride, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
744 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
745 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
746 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
747 uint64_t temp[SIZE*SIZE/8];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
748 uint8_t * const half= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
749 put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(half, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
750 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, half, stride, stride, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
751 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
752 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
753 static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
754 OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
755 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
756 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
757 static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
758 uint64_t temp[SIZE*SIZE/8];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
759 uint8_t * const half= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
760 put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(half, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
761 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+1, half, stride, stride, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
762 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
763 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
764 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
765 uint64_t temp[SIZE*SIZE/8];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
766 uint8_t * const half= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
767 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
768 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, half, stride, stride, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
769 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
770 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
771 static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
772 OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
773 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
774 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
775 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
776 uint64_t temp[SIZE*SIZE/8];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
777 uint8_t * const half= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
778 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
779 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, half, stride, stride, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
780 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
781 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
782 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
783 uint64_t temp[SIZE*SIZE/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
784 uint8_t * const halfH= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
785 uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
786 put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
787 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
788 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
789 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
790 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
791 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
792 uint64_t temp[SIZE*SIZE/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
793 uint8_t * const halfH= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
794 uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
795 put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
796 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
797 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
798 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
799 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
800 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
801 uint64_t temp[SIZE*SIZE/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
802 uint8_t * const halfH= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
803 uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
804 put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
805 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
806 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
807 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
808 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
809 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
810 uint64_t temp[SIZE*SIZE/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
811 uint8_t * const halfH= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
812 uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
813 put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
814 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
815 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
816 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
817 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
818 static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
819 uint64_t temp[SIZE*(SIZE+8)/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
820 int16_t * const tmp= (int16_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
821 OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, tmp, src, stride, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
822 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
823 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
824 static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
825 uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
826 uint8_t * const halfH= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
827 uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
828 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
829 put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
830 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
831 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfHV, stride, SIZE, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
832 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
833 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
834 static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
835 uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
836 uint8_t * const halfH= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
837 uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
838 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
839 put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
840 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
841 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfHV, stride, SIZE, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
842 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
843 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
844 static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
845 uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
846 uint8_t * const halfV= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
847 uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
848 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
849 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
850 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
851 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfV, halfHV, stride, SIZE, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
852 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
853 \
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
854 static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
855 uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
856 uint8_t * const halfV= (uint8_t*)temp;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
857 uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
858 int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
859 put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
860 put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
861 OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfV, halfHV, stride, SIZE, SIZE);\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
862 }\
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
863
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
864
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
865 #define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b " \n\t"
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
866 #define AVG_3DNOW_OP(a,b,temp, size) \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
867 "mov" #size " " #b ", " #temp " \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
868 "pavgusb " #temp ", " #a " \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
869 "mov" #size " " #a ", " #b " \n\t"
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
870 #define AVG_MMX2_OP(a,b,temp, size) \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
871 "mov" #size " " #b ", " #temp " \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
872 "pavgb " #temp ", " #a " \n\t"\
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
873 "mov" #size " " #a ", " #b " \n\t"
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
874
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
875 QPEL_H264(put_, PUT_OP, 3dnow)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
876 QPEL_H264(avg_, AVG_3DNOW_OP, 3dnow)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
877 QPEL_H264(put_, PUT_OP, mmx2)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
878 QPEL_H264(avg_, AVG_MMX2_OP, mmx2)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
879
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
880 H264_MC(put_, 4, 3dnow)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
881 H264_MC(put_, 8, 3dnow)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
882 H264_MC(put_, 16,3dnow)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
883 H264_MC(avg_, 4, 3dnow)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
884 H264_MC(avg_, 8, 3dnow)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
885 H264_MC(avg_, 16,3dnow)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
886 H264_MC(put_, 4, mmx2)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
887 H264_MC(put_, 8, mmx2)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
888 H264_MC(put_, 16,mmx2)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
889 H264_MC(avg_, 4, mmx2)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
890 H264_MC(avg_, 8, mmx2)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
891 H264_MC(avg_, 16,mmx2)
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
892
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
893
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
894 #define H264_CHROMA_OP(S,D)
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
895 #define H264_CHROMA_OP4(S,D,T)
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
896 #define H264_CHROMA_MC8_TMPL put_h264_chroma_mc8_mmx
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
897 #define H264_CHROMA_MC4_TMPL put_h264_chroma_mc4_mmx
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
898 #define H264_CHROMA_MC8_MV0 put_pixels8_mmx
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
899 #include "dsputil_h264_template_mmx.c"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
900 #undef H264_CHROMA_OP
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
901 #undef H264_CHROMA_OP4
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
902 #undef H264_CHROMA_MC8_TMPL
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
903 #undef H264_CHROMA_MC4_TMPL
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
904 #undef H264_CHROMA_MC8_MV0
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
905
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
906 #define H264_CHROMA_OP(S,D) "pavgb " #S ", " #D " \n\t"
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
907 #define H264_CHROMA_OP4(S,D,T) "movd " #S ", " #T " \n\t"\
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
908 "pavgb " #T ", " #D " \n\t"
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
909 #define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_mmx2
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
910 #define H264_CHROMA_MC4_TMPL avg_h264_chroma_mc4_mmx2
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
911 #define H264_CHROMA_MC8_MV0 avg_pixels8_mmx2
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
912 #include "dsputil_h264_template_mmx.c"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
913 #undef H264_CHROMA_OP
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
914 #undef H264_CHROMA_OP4
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
915 #undef H264_CHROMA_MC8_TMPL
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
916 #undef H264_CHROMA_MC4_TMPL
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
917 #undef H264_CHROMA_MC8_MV0
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
918
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
919 #define H264_CHROMA_OP(S,D) "pavgusb " #S ", " #D " \n\t"
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
920 #define H264_CHROMA_OP4(S,D,T) "movd " #S ", " #T " \n\t"\
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
921 "pavgusb " #T ", " #D " \n\t"
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
922 #define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_3dnow
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
923 #define H264_CHROMA_MC4_TMPL avg_h264_chroma_mc4_3dnow
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
924 #define H264_CHROMA_MC8_MV0 avg_pixels8_3dnow
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
925 #include "dsputil_h264_template_mmx.c"
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
926 #undef H264_CHROMA_OP
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
927 #undef H264_CHROMA_OP4
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
928 #undef H264_CHROMA_MC8_TMPL
2922
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
929 #undef H264_CHROMA_MC4_TMPL
d772011258ec faster h264_chroma_mc8_mmx, added h264_chroma_mc4_mmx.
lorenm
parents: 2902
diff changeset
930 #undef H264_CHROMA_MC8_MV0
2754
a49f140179e9 sort H.264 mmx dsp functions into their own file
lorenm
parents:
diff changeset
931
2902
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
932 /***********************************/
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
933 /* weighted prediction */
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
934
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
935 static inline void ff_h264_weight_WxH_mmx2(uint8_t *dst, int stride, int log2_denom, int weight, int offset, int w, int h)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
936 {
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
937 int x, y;
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
938 offset <<= log2_denom;
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
939 offset += (1 << log2_denom) >> 1;
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
940 asm volatile(
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
941 "movd %0, %%mm4 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
942 "movd %1, %%mm5 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
943 "movd %2, %%mm6 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
944 "pshufw $0, %%mm4, %%mm4 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
945 "pshufw $0, %%mm5, %%mm5 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
946 "pxor %%mm7, %%mm7 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
947 :: "g"(weight), "g"(offset), "g"(log2_denom)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
948 );
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
949 for(y=0; y<h; y+=2){
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
950 for(x=0; x<w; x+=4){
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
951 asm volatile(
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
952 "movd %0, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
953 "movd %1, %%mm1 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
954 "punpcklbw %%mm7, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
955 "punpcklbw %%mm7, %%mm1 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
956 "pmullw %%mm4, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
957 "pmullw %%mm4, %%mm1 \n\t"
3001
b52d8ee430f6 fix some potential arithmetic overflows in pred_direct_motion() and
lorenm
parents: 2979
diff changeset
958 "paddsw %%mm5, %%mm0 \n\t"
b52d8ee430f6 fix some potential arithmetic overflows in pred_direct_motion() and
lorenm
parents: 2979
diff changeset
959 "paddsw %%mm5, %%mm1 \n\t"
2902
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
960 "psraw %%mm6, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
961 "psraw %%mm6, %%mm1 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
962 "packuswb %%mm7, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
963 "packuswb %%mm7, %%mm1 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
964 "movd %%mm0, %0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
965 "movd %%mm1, %1 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
966 : "+m"(*(uint32_t*)(dst+x)),
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
967 "+m"(*(uint32_t*)(dst+x+stride))
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
968 );
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
969 }
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
970 dst += 2*stride;
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
971 }
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
972 }
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
973
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
974 static inline void ff_h264_biweight_WxH_mmx2(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offsetd, int offsets, int w, int h)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
975 {
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
976 int x, y;
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
977 int offset = ((offsets + offsetd + 1) | 1) << log2_denom;
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
978 asm volatile(
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
979 "movd %0, %%mm3 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
980 "movd %1, %%mm4 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
981 "movd %2, %%mm5 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
982 "movd %3, %%mm6 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
983 "pshufw $0, %%mm3, %%mm3 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
984 "pshufw $0, %%mm4, %%mm4 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
985 "pshufw $0, %%mm5, %%mm5 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
986 "pxor %%mm7, %%mm7 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
987 :: "g"(weightd), "g"(weights), "g"(offset), "g"(log2_denom+1)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
988 );
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
989 for(y=0; y<h; y++){
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
990 for(x=0; x<w; x+=4){
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
991 asm volatile(
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
992 "movd %0, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
993 "movd %1, %%mm1 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
994 "punpcklbw %%mm7, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
995 "punpcklbw %%mm7, %%mm1 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
996 "pmullw %%mm3, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
997 "pmullw %%mm4, %%mm1 \n\t"
3001
b52d8ee430f6 fix some potential arithmetic overflows in pred_direct_motion() and
lorenm
parents: 2979
diff changeset
998 "paddsw %%mm1, %%mm0 \n\t"
b52d8ee430f6 fix some potential arithmetic overflows in pred_direct_motion() and
lorenm
parents: 2979
diff changeset
999 "paddsw %%mm5, %%mm0 \n\t"
2902
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1000 "psraw %%mm6, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1001 "packuswb %%mm0, %%mm0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1002 "movd %%mm0, %0 \n\t"
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1003 : "+m"(*(uint32_t*)(dst+x))
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1004 : "m"(*(uint32_t*)(src+x))
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1005 );
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1006 }
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1007 src += stride;
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1008 dst += stride;
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1009 }
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1010 }
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1011
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1012 #define H264_WEIGHT(W,H) \
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1013 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 offsetd, int offsets){ \
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1014 ff_h264_biweight_WxH_mmx2(dst, src, stride, log2_denom, weightd, weights, offsetd, offsets, W, H); \
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1015 } \
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1016 static void ff_h264_weight_ ## W ## x ## H ## _mmx2(uint8_t *dst, int stride, int log2_denom, int weight, int offset){ \
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1017 ff_h264_weight_WxH_mmx2(dst, stride, log2_denom, weight, offset, W, H); \
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1018 }
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1019
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1020 H264_WEIGHT(16,16)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1021 H264_WEIGHT(16, 8)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1022 H264_WEIGHT( 8,16)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1023 H264_WEIGHT( 8, 8)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1024 H264_WEIGHT( 8, 4)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1025 H264_WEIGHT( 4, 8)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1026 H264_WEIGHT( 4, 4)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1027 H264_WEIGHT( 4, 2)
3c79bc9f3aa9 h264 mmx weighted prediction. up to 3% overall speedup.
lorenm
parents: 2855
diff changeset
1028