30 #define PHADDD(a, t) \
31 "movq " #a ", " #t " \n\t" \
32 "psrlq $32, " #a " \n\t" \
33 "paddd " #t ", " #a " \n\t"
40 #define PMULHRW(x, y, s, o) \
41 "pmulhw " #s ", " #x " \n\t" \
42 "pmulhw " #s ", " #y " \n\t" \
43 "paddw " #o ", " #x " \n\t" \
44 "paddw " #o ", " #y " \n\t" \
45 "psraw $1, " #x " \n\t" \
46 "psraw $1, " #y " \n\t"
47 #define DEF(x) x ## _mmx
48 #define SET_RND MOVQ_WONE
49 #define SCALE_OFFSET 1
58 #define DEF(x) x ## _3dnow
60 #define SCALE_OFFSET 0
61 #define PMULHRW(x, y, s, o) \
62 "pmulhrw " #s ", " #x " \n\t" \
63 "pmulhrw " #s ", " #y " \n\t"
74 #define DEF(x) x ## _ssse3
76 #define SCALE_OFFSET -1
78 #define PHADDD(a, t) \
79 "pshufw $0x0E, " #a ", " #t " \n\t" \
81 "paddd " #t ", " #a " \n\t"
83 #define PMULHRW(x, y, s, o) \
84 "pmulhrsw " #s ", " #x " \n\t" \
85 "pmulhrsw " #s ", " #y " \n\t"
99 int w,
int h,
int sides)
104 last_line = buf + (height - 1) * wrap;
110 "movd (%0), %%mm0 \n\t"
111 "punpcklbw %%mm0, %%mm0 \n\t"
112 "punpcklwd %%mm0, %%mm0 \n\t"
113 "punpckldq %%mm0, %%mm0 \n\t"
114 "movq %%mm0, -8(%0) \n\t"
115 "movq -8(%0, %2), %%mm1 \n\t"
116 "punpckhbw %%mm1, %%mm1 \n\t"
117 "punpckhwd %%mm1, %%mm1 \n\t"
118 "punpckhdq %%mm1, %%mm1 \n\t"
119 "movq %%mm1, (%0, %2) \n\t"
125 "r" (ptr + wrap * height));
129 "movd (%0), %%mm0 \n\t"
130 "punpcklbw %%mm0, %%mm0 \n\t"
131 "punpcklwd %%mm0, %%mm0 \n\t"
132 "punpckldq %%mm0, %%mm0 \n\t"
133 "movq %%mm0, -8(%0) \n\t"
134 "movq %%mm0, -16(%0) \n\t"
135 "movq -8(%0, %2), %%mm1 \n\t"
136 "punpckhbw %%mm1, %%mm1 \n\t"
137 "punpckhwd %%mm1, %%mm1 \n\t"
138 "punpckhdq %%mm1, %%mm1 \n\t"
139 "movq %%mm1, (%0, %2) \n\t"
140 "movq %%mm1, 8(%0, %2) \n\t"
146 "r" (ptr + wrap * height));
151 for (i = 0; i < h; i += 4) {
152 ptr = buf - (i + 1) * wrap - w;
155 "movq (%1, %0), %%mm0 \n\t"
156 "movq %%mm0, (%0) \n\t"
157 "movq %%mm0, (%0, %2) \n\t"
158 "movq %%mm0, (%0, %2, 2) \n\t"
159 "movq %%mm0, (%0, %3) \n\t"
166 "r" (ptr + width + 2 * w));
171 for (i = 0; i < h; i += 4) {
172 ptr = last_line + (i + 1) * wrap - w;
175 "movq (%1, %0), %%mm0 \n\t"
176 "movq %%mm0, (%0) \n\t"
177 "movq %%mm0, (%0, %2) \n\t"
178 "movq %%mm0, (%0, %2, 2) \n\t"
179 "movq %%mm0, (%0, %3) \n\t"
186 "r" (ptr + width + 2 * w));
223 #if HAVE_SSSE3_INLINE
#define EXTERNAL_MMX(flags)
int ff_pix_sum16_mmx(uint8_t *pix, int line_size)
av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Macro definitions for various function/variable attributes.
void(* draw_edges)(uint8_t *buf, int wrap, int width, int height, int w, int h, int sides)
#define CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
#define INLINE_MMX(flags)
int(* pix_norm1)(uint8_t *pix, int line_size)
int(* pix_sum)(uint8_t *pix, int line_size)
#define INLINE_SSSE3(flags)
#define INLINE_AMD3DNOW(flags)
Libavcodec external API header.
main external API structure.
void(* add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale)
int(* try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
int ff_pix_norm1_mmx(uint8_t *pix, int line_size)