Go to the documentation of this file.
32 #define PHADDD(a, t) \
33 "movq " #a ", " #t " \n\t" \
34 "psrlq $32, " #a " \n\t" \
35 "paddd " #t ", " #a " \n\t"
42 #define PMULHRW(x, y, s, o) \
43 "pmulhw " #s ", " #x " \n\t" \
44 "pmulhw " #s ", " #y " \n\t" \
45 "paddw " #o ", " #x " \n\t" \
46 "paddw " #o ", " #y " \n\t" \
47 "psraw $1, " #x " \n\t" \
48 "psraw $1, " #y " \n\t"
49 #define DEF(x) x ## _mmx
50 #define SET_RND MOVQ_WONE
51 #define SCALE_OFFSET 1
60 #define DEF(x) x ## _3dnow
62 #define SCALE_OFFSET 0
63 #define PMULHRW(x, y, s, o) \
64 "pmulhrw " #s ", " #x " \n\t" \
65 "pmulhrw " #s ", " #y " \n\t"
76 #define DEF(x) x ## _ssse3
78 #define SCALE_OFFSET -1
80 #define PHADDD(a, t) \
81 "pshufw $0x0E, " #a ", " #t " \n\t" \
83 "paddd " #t ", " #a " \n\t"
85 #define PMULHRW(x, y, s, o) \
86 "pmulhrsw " #s ", " #x " \n\t" \
87 "pmulhrsw " #s ", " #y " \n\t"
100 static void draw_edges_mmx(uint8_t *buf,
int wrap,
int width,
int height,
101 int w,
int h,
int sides)
103 uint8_t *ptr, *last_line;
112 "movd (%0), %%mm0 \n\t"
113 "punpcklbw %%mm0, %%mm0 \n\t"
114 "punpcklwd %%mm0, %%mm0 \n\t"
115 "punpckldq %%mm0, %%mm0 \n\t"
116 "movq %%mm0, -8(%0) \n\t"
117 "movq -8(%0, %2), %%mm1 \n\t"
118 "punpckhbw %%mm1, %%mm1 \n\t"
119 "punpckhwd %%mm1, %%mm1 \n\t"
120 "punpckhdq %%mm1, %%mm1 \n\t"
121 "movq %%mm1, (%0, %2) \n\t"
128 }
else if (
w == 16) {
131 "movd (%0), %%mm0 \n\t"
132 "punpcklbw %%mm0, %%mm0 \n\t"
133 "punpcklwd %%mm0, %%mm0 \n\t"
134 "punpckldq %%mm0, %%mm0 \n\t"
135 "movq %%mm0, -8(%0) \n\t"
136 "movq %%mm0, -16(%0) \n\t"
137 "movq -8(%0, %2), %%mm1 \n\t"
138 "punpckhbw %%mm1, %%mm1 \n\t"
139 "punpckhwd %%mm1, %%mm1 \n\t"
140 "punpckhdq %%mm1, %%mm1 \n\t"
141 "movq %%mm1, (%0, %2) \n\t"
142 "movq %%mm1, 8(%0, %2) \n\t"
153 "movd (%0), %%mm0 \n\t"
154 "punpcklbw %%mm0, %%mm0 \n\t"
155 "punpcklwd %%mm0, %%mm0 \n\t"
156 "movd %%mm0, -4(%0) \n\t"
157 "movd -4(%0, %2), %%mm1 \n\t"
158 "punpcklbw %%mm1, %%mm1 \n\t"
159 "punpckhwd %%mm1, %%mm1 \n\t"
160 "punpckhdq %%mm1, %%mm1 \n\t"
161 "movd %%mm1, (%0, %2) \n\t"
172 for (
i = 0;
i <
h;
i += 4) {
173 ptr = buf - (
i + 1) *
wrap -
w;
176 "movq (%1, %0), %%mm0 \n\t"
177 "movq %%mm0, (%0) \n\t"
178 "movq %%mm0, (%0, %2) \n\t"
179 "movq %%mm0, (%0, %2, 2) \n\t"
180 "movq %%mm0, (%0, %3) \n\t"
187 "r" (ptr +
width + 2 *
w));
192 for (
i = 0;
i <
h;
i += 4) {
193 ptr = last_line + (
i + 1) *
wrap -
w;
196 "movq (%1, %0), %%mm0 \n\t"
197 "movq %%mm0, (%0) \n\t"
198 "movq %%mm0, (%0, %2) \n\t"
199 "movq %%mm0, (%0, %2, 2) \n\t"
200 "movq %%mm0, (%0, %3) \n\t"
207 "r" (ptr +
width + 2 *
w));
232 c->try_8x8basis = try_8x8basis_mmx;
234 c->add_8x8basis = add_8x8basis_mmx;
237 c->draw_edges = draw_edges_mmx;
243 c->try_8x8basis = try_8x8basis_3dnow;
245 c->add_8x8basis = add_8x8basis_3dnow;
248 #if HAVE_SSSE3_INLINE
251 c->try_8x8basis = try_8x8basis_ssse3;
253 c->add_8x8basis = add_8x8basis_ssse3;
#define INLINE_MMX(flags)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
static atomic_int cpu_flags
int flags
AV_CODEC_FLAG_*.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#define EXTERNAL_XOP(flags)
int ff_pix_sum16_xop(const uint8_t *pix, int line_size)
int ff_pix_norm1_sse2(const uint8_t *pix, int line_size)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
#define EXTERNAL_SSE2(flags)
#define i(width, name, range_min, range_max)
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
__asm__(".macro parse_r var r\n\t" "\\var = -1\n\t" _IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) ".iflt \\var\n\t" ".error \"Unable to parse register name \\r\"\n\t" ".endif\n\t" ".endm")
av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
#define INLINE_SSSE3(flags)
main external API structure.
int ff_pix_sum16_sse2(const uint8_t *pix, int line_size)
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
#define INLINE_AMD3DNOW(flags)