36 #define COMPILE_TEMPLATE_MMXEXT 0
37 #define COMPILE_TEMPLATE_SSE2 0
38 #define COMPILE_TEMPLATE_SSSE3 0
39 #define RENAME(a) a ## _mmx
40 #define RENAME_FDCT(a) a ## _mmx
44 #if HAVE_MMXEXT_INLINE
45 #undef COMPILE_TEMPLATE_SSSE3
46 #undef COMPILE_TEMPLATE_SSE2
47 #undef COMPILE_TEMPLATE_MMXEXT
48 #define COMPILE_TEMPLATE_MMXEXT 1
49 #define COMPILE_TEMPLATE_SSE2 0
50 #define COMPILE_TEMPLATE_SSSE3 0
53 #define RENAME(a) a ## _mmxext
54 #define RENAME_FDCT(a) a ## _mmxext
59 #undef COMPILE_TEMPLATE_MMXEXT
60 #undef COMPILE_TEMPLATE_SSE2
61 #undef COMPILE_TEMPLATE_SSSE3
62 #define COMPILE_TEMPLATE_MMXEXT 0
63 #define COMPILE_TEMPLATE_SSE2 1
64 #define COMPILE_TEMPLATE_SSSE3 0
67 #define RENAME(a) a ## _sse2
68 #define RENAME_FDCT(a) a ## _sse2
73 #undef COMPILE_TEMPLATE_MMXEXT
74 #undef COMPILE_TEMPLATE_SSE2
75 #undef COMPILE_TEMPLATE_SSSE3
76 #define COMPILE_TEMPLATE_MMXEXT 0
77 #define COMPILE_TEMPLATE_SSE2 1
78 #define COMPILE_TEMPLATE_SSSE3 1
81 #define RENAME(a) a ## _ssse3
82 #define RENAME_FDCT(a) a ## _sse2
98 "pxor %%mm7, %%mm7 \n\t"
100 "pxor %%mm0, %%mm0 \n\t"
101 "pxor %%mm1, %%mm1 \n\t"
102 "movq (%0), %%mm2 \n\t"
103 "movq 8(%0), %%mm3 \n\t"
104 "pcmpgtw %%mm2, %%mm0 \n\t"
105 "pcmpgtw %%mm3, %%mm1 \n\t"
106 "pxor %%mm0, %%mm2 \n\t"
107 "pxor %%mm1, %%mm3 \n\t"
108 "psubw %%mm0, %%mm2 \n\t"
109 "psubw %%mm1, %%mm3 \n\t"
110 "movq %%mm2, %%mm4 \n\t"
111 "movq %%mm3, %%mm5 \n\t"
112 "psubusw (%2), %%mm2 \n\t"
113 "psubusw 8(%2), %%mm3 \n\t"
114 "pxor %%mm0, %%mm2 \n\t"
115 "pxor %%mm1, %%mm3 \n\t"
116 "psubw %%mm0, %%mm2 \n\t"
117 "psubw %%mm1, %%mm3 \n\t"
118 "movq %%mm2, (%0) \n\t"
119 "movq %%mm3, 8(%0) \n\t"
120 "movq %%mm4, %%mm2 \n\t"
121 "movq %%mm5, %%mm3 \n\t"
122 "punpcklwd %%mm7, %%mm4 \n\t"
123 "punpckhwd %%mm7, %%mm2 \n\t"
124 "punpcklwd %%mm7, %%mm5 \n\t"
125 "punpckhwd %%mm7, %%mm3 \n\t"
126 "paddd (%1), %%mm4 \n\t"
127 "paddd 8(%1), %%mm2 \n\t"
128 "paddd 16(%1), %%mm5 \n\t"
129 "paddd 24(%1), %%mm3 \n\t"
130 "movq %%mm4, (%1) \n\t"
131 "movq %%mm2, 8(%1) \n\t"
132 "movq %%mm5, 16(%1) \n\t"
133 "movq %%mm3, 24(%1) \n\t"
154 "pxor %%xmm7, %%xmm7 \n\t"
156 "pxor %%xmm0, %%xmm0 \n\t"
157 "pxor %%xmm1, %%xmm1 \n\t"
158 "movdqa (%0), %%xmm2 \n\t"
159 "movdqa 16(%0), %%xmm3 \n\t"
160 "pcmpgtw %%xmm2, %%xmm0 \n\t"
161 "pcmpgtw %%xmm3, %%xmm1 \n\t"
162 "pxor %%xmm0, %%xmm2 \n\t"
163 "pxor %%xmm1, %%xmm3 \n\t"
164 "psubw %%xmm0, %%xmm2 \n\t"
165 "psubw %%xmm1, %%xmm3 \n\t"
166 "movdqa %%xmm2, %%xmm4 \n\t"
167 "movdqa %%xmm3, %%xmm5 \n\t"
168 "psubusw (%2), %%xmm2 \n\t"
169 "psubusw 16(%2), %%xmm3 \n\t"
170 "pxor %%xmm0, %%xmm2 \n\t"
171 "pxor %%xmm1, %%xmm3 \n\t"
172 "psubw %%xmm0, %%xmm2 \n\t"
173 "psubw %%xmm1, %%xmm3 \n\t"
174 "movdqa %%xmm2, (%0) \n\t"
175 "movdqa %%xmm3, 16(%0) \n\t"
176 "movdqa %%xmm4, %%xmm6 \n\t"
177 "movdqa %%xmm5, %%xmm0 \n\t"
178 "punpcklwd %%xmm7, %%xmm4 \n\t"
179 "punpckhwd %%xmm7, %%xmm6 \n\t"
180 "punpcklwd %%xmm7, %%xmm5 \n\t"
181 "punpckhwd %%xmm7, %%xmm0 \n\t"
182 "paddd (%1), %%xmm4 \n\t"
183 "paddd 16(%1), %%xmm6 \n\t"
184 "paddd 32(%1), %%xmm5 \n\t"
185 "paddd 48(%1), %%xmm0 \n\t"
186 "movdqa %%xmm4, (%1) \n\t"
187 "movdqa %%xmm6, 16(%1) \n\t"
188 "movdqa %%xmm5, 32(%1) \n\t"
189 "movdqa %%xmm0, 48(%1) \n\t"
198 "%xmm4",
"%xmm5",
"%xmm6",
"%xmm7")
209 for (i = 0; i < 64; i++)
222 #if HAVE_6REGS && HAVE_MMXEXT_INLINE
234 #if HAVE_6REGS && HAVE_SSSE3_INLINE
int dct_algo
DCT algorithm, see FF_DCT_* below.
#define INLINE_SSE2(flags)
static atomic_int cpu_flags
Macro definitions for various function/variable attributes.
static uint16_t inv_zigzag_direct16[64]
void(* denoise_dct)(struct MpegEncContext *s, int16_t *block)
uint16_t(* dct_offset)[64]
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
#define INLINE_MMX(flags)
static const uint8_t offset[127][2]
#define INLINE_SSSE3(flags)
av_cold void ff_dct_encode_init_x86(MpegEncContext *s)
Libavcodec external API header.
const uint8_t ff_zigzag_direct[64]
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define XMM_CLOBBERS_ONLY(...)
struct AVCodecContext * avctx
#define INLINE_MMXEXT(flags)
int(* dct_quantize)(struct MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow)