annotate x86/h264_intrapred.asm @ 12001:953a0949c789 libavcodec

Fix some intra pred MMX functions that used MMXEXT instructions Also add predict_4x4_dc MMXEXT function for vp8/h264.
author darkshikari
date Mon, 28 Jun 2010 23:35:17 +0000
parents afee30fe8c26
children 9c8584f68754
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
1 ;******************************************************************************
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
2 ;* H.264 intra prediction asm optimizations
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
3 ;* Copyright (c) 2010 Jason Garrett-Glaser
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
4 ;*
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
5 ;* This file is part of FFmpeg.
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
6 ;*
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
7 ;* FFmpeg is free software; you can redistribute it and/or
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
8 ;* modify it under the terms of the GNU Lesser General Public
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
9 ;* License as published by the Free Software Foundation; either
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
10 ;* version 2.1 of the License, or (at your option) any later version.
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
11 ;*
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
12 ;* FFmpeg is distributed in the hope that it will be useful,
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
13 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
14 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
15 ;* Lesser General Public License for more details.
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
16 ;*
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
17 ;* You should have received a copy of the GNU Lesser General Public
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
18 ;* License along with FFmpeg; if not, write to the Free Software
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
19 ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
20 ;******************************************************************************
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
21
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
22 %include "x86inc.asm"
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
23
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
24 SECTION_RODATA
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
25
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
26 tm_shuf: times 8 db 0x03, 0x80
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
27
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
28 SECTION .text
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
29
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
30 cextern pb_3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
31
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
32 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
33 ; void pred16x16_vertical(uint8_t *src, int stride)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
34 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
35
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
36 cglobal pred16x16_vertical_mmx, 2,3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
37 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
38 mov r2, 8
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
39 movq mm0, [r0+0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
40 movq mm1, [r0+8]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
41 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
42 movq [r0+r1*1+0], mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
43 movq [r0+r1*1+8], mm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
44 movq [r0+r1*2+0], mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
45 movq [r0+r1*2+8], mm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
46 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
47 dec r2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
48 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
49 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
50
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
51 cglobal pred16x16_vertical_sse, 2,3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
52 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
53 mov r2, 4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
54 movaps xmm0, [r0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
55 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
56 movaps [r0+r1*1], xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
57 movaps [r0+r1*2], xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
58 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
59 movaps [r0+r1*1], xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
60 movaps [r0+r1*2], xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
61 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
62 dec r2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
63 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
64 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
65
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
66 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
67 ; void pred16x16_horizontal(uint8_t *src, int stride)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
68 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
69
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
70 %macro PRED16x16_H 1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
71 cglobal pred16x16_horizontal_%1, 2,3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
72 mov r2, 8
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
73 %ifidn %1, ssse3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
74 mova m2, [pb_3]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
75 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
76 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
77 movd m0, [r0+r1*0-4]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
78 movd m1, [r0+r1*1-4]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
79
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
80 %ifidn %1, ssse3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
81 pshufb m0, m2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
82 pshufb m1, m2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
83 %else
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
84 punpcklbw m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
85 punpcklbw m1, m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
86 %ifidn %1, mmxext
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
87 pshufw m0, m0, 0xff
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
88 pshufw m1, m1, 0xff
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
89 %else
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
90 punpckhwd m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
91 punpckhwd m1, m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
92 punpckhdq m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
93 punpckhdq m1, m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
94 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
95 mova [r0+r1*0+8], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
96 mova [r0+r1*1+8], m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
97 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
98
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
99 mova [r0+r1*0], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
100 mova [r0+r1*1], m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
101 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
102 dec r2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
103 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
104 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
105 %endmacro
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
106
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
107 INIT_MMX
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
108 PRED16x16_H mmx
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
109 PRED16x16_H mmxext
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
110 INIT_XMM
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
111 PRED16x16_H ssse3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
112
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
113 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
114 ; void pred16x16_dc(uint8_t *src, int stride)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
115 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
116
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
117 %macro PRED16x16_DC 2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
118 cglobal pred16x16_dc_%1, 2,7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
119 mov r4, r0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
120 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
121 pxor mm0, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
122 pxor mm1, mm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
123 psadbw mm0, [r0+0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
124 psadbw mm1, [r0+8]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
125 dec r0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
126 movzx r5d, byte [r0+r1*1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
127 paddw mm0, mm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
128 movd r6d, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
129 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
130 %rep 7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
131 movzx r2d, byte [r0+r1*0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
132 movzx r3d, byte [r0+r1*1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
133 add r5d, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
134 add r6d, r3d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
135 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
136 %endrep
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
137 movzx r2d, byte [r0+r1*0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
138 add r5d, r6d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
139 lea r2d, [r2+r5+16]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
140 shr r2d, 5
12001
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
141 %ifidn %1, mmxext
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
142 movd m0, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
143 punpcklbw m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
144 pshufw m0, m0, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
145 %elifidn %1, sse
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
146 imul r2d, 0x01010101
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
147 movd m0, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
148 shufps m0, m0, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
149 %elifidn %1, sse2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
150 movd m0, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
151 punpcklbw m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
152 pshuflw m0, m0, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
153 punpcklqdq m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
154 %elifidn %1, ssse3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
155 pxor m1, m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
156 movd m0, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
157 pshufb m0, m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
158 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
159
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
160 %if mmsize==8
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
161 mov r3d, 8
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
162 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
163 %2 [r4+r1*0+0], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
164 %2 [r4+r1*0+8], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
165 %2 [r4+r1*1+0], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
166 %2 [r4+r1*1+8], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
167 %else
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
168 mov r3d, 4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
169 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
170 %2 [r4+r1*0], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
171 %2 [r4+r1*1], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
172 lea r4, [r4+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
173 %2 [r4+r1*0], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
174 %2 [r4+r1*1], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
175 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
176 lea r4, [r4+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
177 dec r3d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
178 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
179 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
180 %endmacro
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
181
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
182 INIT_MMX
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
183 PRED16x16_DC mmxext, movq
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
184 INIT_XMM
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
185 PRED16x16_DC sse, movaps
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
186 PRED16x16_DC sse2, movdqa
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
187 PRED16x16_DC ssse3, movdqa
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
188
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
189 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
190 ; void pred16x16_tm_vp8(uint8_t *src, int stride)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
191 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
192
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
193 %macro PRED16x16_TM_MMX 1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
194 cglobal pred16x16_tm_vp8_%1, 2,5
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
195 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
196 pxor mm7, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
197 movq mm0, [r0+0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
198 movq mm2, [r0+8]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
199 movq mm1, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
200 movq mm3, mm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
201 punpcklbw mm0, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
202 punpckhbw mm1, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
203 punpcklbw mm2, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
204 punpckhbw mm3, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
205 movzx r3d, byte [r0-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
206 mov r4d, 16
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
207 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
208 movzx r2d, byte [r0+r1-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
209 sub r2d, r3d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
210 movd mm4, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
211 %ifidn %1, mmx
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
212 punpcklwd mm4, mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
213 punpckldq mm4, mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
214 %else
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
215 pshufw mm4, mm4, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
216 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
217 movq mm5, mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
218 movq mm6, mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
219 movq mm7, mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
220 paddw mm4, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
221 paddw mm5, mm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
222 paddw mm6, mm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
223 paddw mm7, mm3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
224 packuswb mm4, mm5
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
225 packuswb mm6, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
226 movq [r0+r1+0], mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
227 movq [r0+r1+8], mm6
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
228 add r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
229 dec r4d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
230 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
231 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
232 %endmacro
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
233
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
234 PRED16x16_TM_MMX mmx
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
235 PRED16x16_TM_MMX mmxext
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
236
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
237 cglobal pred16x16_tm_vp8_sse2, 2,6,6
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
238 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
239 pxor xmm2, xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
240 movdqa xmm0, [r0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
241 movdqa xmm1, xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
242 punpcklbw xmm0, xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
243 punpckhbw xmm1, xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
244 movzx r4d, byte [r0-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
245 mov r5d, 8
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
246 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
247 movzx r2d, byte [r0+r1*1-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
248 movzx r3d, byte [r0+r1*2-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
249 sub r2d, r4d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
250 sub r3d, r4d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
251 movd xmm2, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
252 movd xmm4, r3d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
253 pshuflw xmm2, xmm2, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
254 pshuflw xmm4, xmm4, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
255 punpcklqdq xmm2, xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
256 punpcklqdq xmm4, xmm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
257 movdqa xmm3, xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
258 movdqa xmm5, xmm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
259 paddw xmm2, xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
260 paddw xmm3, xmm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
261 paddw xmm4, xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
262 paddw xmm5, xmm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
263 packuswb xmm2, xmm3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
264 packuswb xmm4, xmm5
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
265 movdqa [r0+r1*1], xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
266 movdqa [r0+r1*2], xmm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
267 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
268 dec r5d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
269 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
270 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
271
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
272 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
273 ; void pred8x8_vertical(uint8_t *src, int stride)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
274 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
275
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
276 cglobal pred8x8_vertical_mmx, 2,2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
277 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
278 movq mm0, [r0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
279 %rep 3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
280 movq [r0+r1*1], mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
281 movq [r0+r1*2], mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
282 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
283 %endrep
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
284 movq [r0+r1*1], mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
285 movq [r0+r1*2], mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
286 RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
287
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
288 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
289 ; void pred8x8_horizontal(uint8_t *src, int stride)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
290 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
291
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
292 %macro PRED8x8_H 1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
293 cglobal pred8x8_horizontal_%1, 2,3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
294 mov r2, 4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
295 %ifidn %1, ssse3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
296 mova m2, [pb_3]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
297 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
298 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
299 movd m0, [r0+r1*0-4]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
300 movd m1, [r0+r1*1-4]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
301 %ifidn %1, ssse3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
302 pshufb m0, m2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
303 pshufb m1, m2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
304 %else
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
305 punpcklbw m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
306 punpcklbw m1, m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
307 %ifidn %1, mmxext
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
308 pshufw m0, m0, 0xff
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
309 pshufw m1, m1, 0xff
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
310 %else
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
311 punpckhwd m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
312 punpckhwd m1, m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
313 punpckhdq m0, m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
314 punpckhdq m1, m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
315 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
316 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
317 mova [r0+r1*0], m0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
318 mova [r0+r1*1], m1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
319 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
320 dec r2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
321 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
322 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
323 %endmacro
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
324
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
325 INIT_MMX
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
326 PRED8x8_H mmx
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
327 PRED8x8_H mmxext
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
328 PRED8x8_H ssse3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
329
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
330 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
331 ; void pred8x8_dc_rv40(uint8_t *src, int stride)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
332 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
333
12001
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
334 cglobal pred8x8_dc_rv40_mmxext, 2,7
11951
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
335 mov r4, r0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
336 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
337 pxor mm0, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
338 psadbw mm0, [r0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
339 dec r0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
340 movzx r5d, byte [r0+r1*1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
341 movd r6d, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
342 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
343 %rep 3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
344 movzx r2d, byte [r0+r1*0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
345 movzx r3d, byte [r0+r1*1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
346 add r5d, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
347 add r6d, r3d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
348 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
349 %endrep
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
350 movzx r2d, byte [r0+r1*0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
351 add r5d, r6d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
352 lea r2d, [r2+r5+8]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
353 shr r2d, 4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
354 movd mm0, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
355 punpcklbw mm0, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
356 pshufw mm0, mm0, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
357 mov r3d, 4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
358 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
359 movq [r4+r1*0], mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
360 movq [r4+r1*1], mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
361 lea r4, [r4+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
362 dec r3d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
363 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
364 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
365
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
366 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
367 ; void pred8x8_tm_vp8(uint8_t *src, int stride)
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
368 ;-----------------------------------------------------------------------------
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
369
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
370 %macro PRED8x8_TM_MMX 1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
371 cglobal pred8x8_tm_vp8_%1, 2,6
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
372 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
373 pxor mm7, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
374 movq mm0, [r0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
375 movq mm1, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
376 punpcklbw mm0, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
377 punpckhbw mm1, mm7
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
378 movzx r4d, byte [r0-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
379 mov r5d, 4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
380 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
381 movzx r2d, byte [r0+r1*1-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
382 movzx r3d, byte [r0+r1*2-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
383 sub r2d, r4d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
384 sub r3d, r4d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
385 movd mm2, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
386 movd mm4, r3d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
387 %ifidn %1, mmx
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
388 punpcklwd mm2, mm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
389 punpcklwd mm4, mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
390 punpckldq mm2, mm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
391 punpckldq mm4, mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
392 %else
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
393 pshufw mm2, mm2, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
394 pshufw mm4, mm4, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
395 %endif
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
396 movq mm3, mm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
397 movq mm5, mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
398 paddw mm2, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
399 paddw mm3, mm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
400 paddw mm4, mm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
401 paddw mm5, mm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
402 packuswb mm2, mm3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
403 packuswb mm4, mm5
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
404 movq [r0+r1*1], mm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
405 movq [r0+r1*2], mm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
406 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
407 dec r5d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
408 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
409 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
410 %endmacro
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
411
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
412 PRED8x8_TM_MMX mmx
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
413 PRED8x8_TM_MMX mmxext
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
414
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
415 cglobal pred8x8_tm_vp8_sse2, 2,6,4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
416 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
417 pxor xmm1, xmm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
418 movq xmm0, [r0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
419 punpcklbw xmm0, xmm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
420 movzx r4d, byte [r0-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
421 mov r5d, 4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
422 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
423 movzx r2d, byte [r0+r1*1-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
424 movzx r3d, byte [r0+r1*2-1]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
425 sub r2d, r4d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
426 sub r3d, r4d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
427 movd xmm2, r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
428 movd xmm3, r3d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
429 pshuflw xmm2, xmm2, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
430 pshuflw xmm3, xmm3, 0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
431 punpcklqdq xmm2, xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
432 punpcklqdq xmm3, xmm3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
433 paddw xmm2, xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
434 paddw xmm3, xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
435 packuswb xmm2, xmm3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
436 movq [r0+r1*1], xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
437 movhps [r0+r1*2], xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
438 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
439 dec r5d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
440 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
441 REP_RET
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
442
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
443 cglobal pred8x8_tm_vp8_ssse3, 2,3,6
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
444 sub r0, r1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
445 movdqa xmm4, [tm_shuf]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
446 pxor xmm1, xmm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
447 movq xmm0, [r0]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
448 punpcklbw xmm0, xmm1
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
449 movd xmm5, [r0-4]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
450 pshufb xmm5, xmm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
451 mov r2d, 4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
452 .loop:
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
453 movd xmm2, [r0+r1*1-4]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
454 movd xmm3, [r0+r1*2-4]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
455 pshufb xmm2, xmm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
456 pshufb xmm3, xmm4
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
457 psubw xmm2, xmm5
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
458 psubw xmm3, xmm5
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
459 paddw xmm2, xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
460 paddw xmm3, xmm0
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
461 packuswb xmm2, xmm3
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
462 movq [r0+r1*1], xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
463 movhps [r0+r1*2], xmm2
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
464 lea r0, [r0+r1*2]
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
465 dec r2d
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
466 jg .loop
afee30fe8c26 16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264
darkshikari
parents:
diff changeset
467 REP_RET
12001
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
468
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
469 cglobal pred4x4_dc_mmxext, 3,5
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
470 pxor mm7, mm7
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
471 mov r4, r0
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
472 sub r0, r2
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
473 movd mm0, [r0]
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
474 psadbw mm0, mm7
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
475 movzx r1d, byte [r0+r2*1-1]
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
476 movd r3d, mm0
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
477 add r3d, r1d
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
478 movzx r1d, byte [r0+r2*2-1]
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
479 lea r0, [r0+r2*2]
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
480 add r3d, r1d
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
481 movzx r1d, byte [r0+r2*1-1]
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
482 add r3d, r1d
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
483 movzx r1d, byte [r0+r2*2-1]
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
484 add r3d, r1d
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
485 add r3d, 4
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
486 shr r3d, 3
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
487 imul r3d, 0x01010101
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
488 mov [r4+r2*0], r3d
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
489 mov [r0+r2*0], r3d
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
490 mov [r0+r2*1], r3d
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
491 mov [r0+r2*2], r3d
953a0949c789 Fix some intra pred MMX functions that used MMXEXT instructions
darkshikari
parents: 11951
diff changeset
492 RET