32 1, 2, 6, 7, 15, 16, 28, 29,
33 3, 5, 8, 14, 17, 27, 30, 43,
34 4, 9, 13, 18, 26, 31, 42, 44,
35 10, 12, 19, 25, 32, 41, 45, 54,
36 11, 20, 24, 33, 40, 46, 53, 55,
37 21, 23, 34, 39, 47, 52, 56, 61,
38 22, 35, 38, 48, 51, 57, 60, 62,
39 36, 37, 49, 50, 58, 59, 63, 64,
45 #define COMPILE_TEMPLATE_MMXEXT 0
46 #define COMPILE_TEMPLATE_SSE2 0
47 #define COMPILE_TEMPLATE_SSSE3 0
48 #define RENAME(a) a ## _mmx
49 #define RENAME_FDCT(a) a ## _mmx
53 #if HAVE_MMXEXT_INLINE
54 #undef COMPILE_TEMPLATE_SSSE3
55 #undef COMPILE_TEMPLATE_SSE2
56 #undef COMPILE_TEMPLATE_MMXEXT
57 #define COMPILE_TEMPLATE_MMXEXT 1
58 #define COMPILE_TEMPLATE_SSE2 0
59 #define COMPILE_TEMPLATE_SSSE3 0
62 #define RENAME(a) a ## _mmxext
63 #define RENAME_FDCT(a) a ## _mmxext
68 #undef COMPILE_TEMPLATE_MMXEXT
69 #undef COMPILE_TEMPLATE_SSE2
70 #undef COMPILE_TEMPLATE_SSSE3
71 #define COMPILE_TEMPLATE_MMXEXT 0
72 #define COMPILE_TEMPLATE_SSE2 1
73 #define COMPILE_TEMPLATE_SSSE3 0
76 #define RENAME(a) a ## _sse2
77 #define RENAME_FDCT(a) a ## _sse2
82 #undef COMPILE_TEMPLATE_MMXEXT
83 #undef COMPILE_TEMPLATE_SSE2
84 #undef COMPILE_TEMPLATE_SSSE3
85 #define COMPILE_TEMPLATE_MMXEXT 0
86 #define COMPILE_TEMPLATE_SSE2 1
87 #define COMPILE_TEMPLATE_SSSE3 1
90 #define RENAME(a) a ## _ssse3
91 #define RENAME_FDCT(a) a ## _sse2
100 const int intra=
s->mb_intra;
101 int *sum=
s->dct_error_sum[intra];
102 uint16_t *
offset=
s->dct_offset[intra];
104 s->dct_count[intra]++;
107 "pxor %%mm7, %%mm7 \n\t"
109 "pxor %%mm0, %%mm0 \n\t"
110 "pxor %%mm1, %%mm1 \n\t"
111 "movq (%0), %%mm2 \n\t"
112 "movq 8(%0), %%mm3 \n\t"
113 "pcmpgtw %%mm2, %%mm0 \n\t"
114 "pcmpgtw %%mm3, %%mm1 \n\t"
115 "pxor %%mm0, %%mm2 \n\t"
116 "pxor %%mm1, %%mm3 \n\t"
117 "psubw %%mm0, %%mm2 \n\t"
118 "psubw %%mm1, %%mm3 \n\t"
119 "movq %%mm2, %%mm4 \n\t"
120 "movq %%mm3, %%mm5 \n\t"
121 "psubusw (%2), %%mm2 \n\t"
122 "psubusw 8(%2), %%mm3 \n\t"
123 "pxor %%mm0, %%mm2 \n\t"
124 "pxor %%mm1, %%mm3 \n\t"
125 "psubw %%mm0, %%mm2 \n\t"
126 "psubw %%mm1, %%mm3 \n\t"
127 "movq %%mm2, (%0) \n\t"
128 "movq %%mm3, 8(%0) \n\t"
129 "movq %%mm4, %%mm2 \n\t"
130 "movq %%mm5, %%mm3 \n\t"
131 "punpcklwd %%mm7, %%mm4 \n\t"
132 "punpckhwd %%mm7, %%mm2 \n\t"
133 "punpcklwd %%mm7, %%mm5 \n\t"
134 "punpckhwd %%mm7, %%mm3 \n\t"
135 "paddd (%1), %%mm4 \n\t"
136 "paddd 8(%1), %%mm2 \n\t"
137 "paddd 16(%1), %%mm5 \n\t"
138 "paddd 24(%1), %%mm3 \n\t"
139 "movq %%mm4, (%1) \n\t"
140 "movq %%mm2, 8(%1) \n\t"
141 "movq %%mm5, 16(%1) \n\t"
142 "movq %%mm3, 24(%1) \n\t"
156 const int intra=
s->mb_intra;
157 int *sum=
s->dct_error_sum[intra];
158 uint16_t *
offset=
s->dct_offset[intra];
160 s->dct_count[intra]++;
163 "pxor %%xmm7, %%xmm7 \n\t"
165 "pxor %%xmm0, %%xmm0 \n\t"
166 "pxor %%xmm1, %%xmm1 \n\t"
167 "movdqa (%0), %%xmm2 \n\t"
168 "movdqa 16(%0), %%xmm3 \n\t"
169 "pcmpgtw %%xmm2, %%xmm0 \n\t"
170 "pcmpgtw %%xmm3, %%xmm1 \n\t"
171 "pxor %%xmm0, %%xmm2 \n\t"
172 "pxor %%xmm1, %%xmm3 \n\t"
173 "psubw %%xmm0, %%xmm2 \n\t"
174 "psubw %%xmm1, %%xmm3 \n\t"
175 "movdqa %%xmm2, %%xmm4 \n\t"
176 "movdqa %%xmm3, %%xmm5 \n\t"
177 "psubusw (%2), %%xmm2 \n\t"
178 "psubusw 16(%2), %%xmm3 \n\t"
179 "pxor %%xmm0, %%xmm2 \n\t"
180 "pxor %%xmm1, %%xmm3 \n\t"
181 "psubw %%xmm0, %%xmm2 \n\t"
182 "psubw %%xmm1, %%xmm3 \n\t"
183 "movdqa %%xmm2, (%0) \n\t"
184 "movdqa %%xmm3, 16(%0) \n\t"
185 "movdqa %%xmm4, %%xmm6 \n\t"
186 "movdqa %%xmm5, %%xmm0 \n\t"
187 "punpcklwd %%xmm7, %%xmm4 \n\t"
188 "punpckhwd %%xmm7, %%xmm6 \n\t"
189 "punpcklwd %%xmm7, %%xmm5 \n\t"
190 "punpckhwd %%xmm7, %%xmm0 \n\t"
191 "paddd (%1), %%xmm4 \n\t"
192 "paddd 16(%1), %%xmm6 \n\t"
193 "paddd 32(%1), %%xmm5 \n\t"
194 "paddd 48(%1), %%xmm0 \n\t"
195 "movdqa %%xmm4, (%1) \n\t"
196 "movdqa %%xmm6, 16(%1) \n\t"
197 "movdqa %%xmm5, 32(%1) \n\t"
198 "movdqa %%xmm0, 48(%1) \n\t"
207 "%xmm4",
"%xmm5",
"%xmm6",
"%xmm7")
215 const int dct_algo =
s->avctx->dct_algo;
222 s->dct_quantize = dct_quantize_mmx;
224 s->denoise_dct = denoise_dct_mmx;
227 #if HAVE_6REGS && HAVE_MMXEXT_INLINE
229 s->dct_quantize = dct_quantize_mmxext;
234 s->dct_quantize = dct_quantize_sse2;
236 s->denoise_dct = denoise_dct_sse2;
239 #if HAVE_6REGS && HAVE_SSSE3_INLINE
241 s->dct_quantize = dct_quantize_ssse3;