35 "mov %3, %%"FF_REG_a
" \n\t"
36 "pcmpeqb %%mm7, %%mm7 \n\t"
37 "psllw $15, %%mm7 \n\t"
38 "packsswb %%mm7, %%mm7 \n\t"
41 "movq (%0, %%"FF_REG_a
"), %%mm0 \n\t"
42 "movq (%1, %%"FF_REG_a
"), %%mm1 \n\t"
43 "pxor %%mm7, %%mm0 \n\t"
44 "paddsb %%mm1, %%mm0 \n\t"
45 "pxor %%mm7, %%mm0 \n\t"
46 "movq %%mm0, (%2, %%"FF_REG_a
") \n\t"
47 "add $8, %%"FF_REG_a
" \n\t"
49 ::
"r" (src+mmx_len),
"r" (noise+mmx_len),
"r" (dst+mmx_len),
"g" (-mmx_len)
53 ff_line_noise_c(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
58 int len,
const int8_t *
const *shift)
63 "mov %5, %%"FF_REG_a
" \n\t"
66 "movq (%1, %%"FF_REG_a
"), %%mm1 \n\t"
67 "movq (%0, %%"FF_REG_a
"), %%mm0 \n\t"
68 "paddb (%2, %%"FF_REG_a
"), %%mm1\n\t"
69 "paddb (%3, %%"FF_REG_a
"), %%mm1\n\t"
70 "movq %%mm0, %%mm2 \n\t"
71 "movq %%mm1, %%mm3 \n\t"
72 "punpcklbw %%mm0, %%mm0 \n\t"
73 "punpckhbw %%mm2, %%mm2 \n\t"
74 "punpcklbw %%mm1, %%mm1 \n\t"
75 "punpckhbw %%mm3, %%mm3 \n\t"
76 "pmulhw %%mm0, %%mm1 \n\t"
77 "pmulhw %%mm2, %%mm3 \n\t"
78 "paddw %%mm1, %%mm1 \n\t"
79 "paddw %%mm3, %%mm3 \n\t"
80 "paddw %%mm0, %%mm1 \n\t"
81 "paddw %%mm2, %%mm3 \n\t"
82 "psrlw $8, %%mm1 \n\t"
83 "psrlw $8, %%mm3 \n\t"
84 "packuswb %%mm3, %%mm1 \n\t"
85 "movq %%mm1, (%4, %%"FF_REG_a
") \n\t"
86 "add $8, %%"FF_REG_a
" \n\t"
88 ::
"r" (src+mmx_len),
"r" (shift[0]+mmx_len),
"r" (shift[1]+mmx_len),
"r" (shift[2]+mmx_len),
89 "r" (dst+mmx_len),
"g" (-mmx_len)
94 const int8_t *
shift2[3] = { shift[0]+mmx_len, shift[1]+mmx_len, shift[2]+mmx_len };
101 const int8_t *noise,
int len,
int shift)
107 "mov %3, %%"FF_REG_a
" \n\t"
108 "pcmpeqb %%mm7, %%mm7 \n\t"
109 "psllw $15, %%mm7 \n\t"
110 "packsswb %%mm7, %%mm7 \n\t"
113 "movq (%0, %%"FF_REG_a
"), %%mm0 \n\t"
114 "movq (%1, %%"FF_REG_a
"), %%mm1 \n\t"
115 "pxor %%mm7, %%mm0 \n\t"
116 "paddsb %%mm1, %%mm0 \n\t"
117 "pxor %%mm7, %%mm0 \n\t"
118 "movntq %%mm0, (%2, %%"FF_REG_a
") \n\t"
119 "add $8, %%"FF_REG_a
" \n\t"
121 ::
"r" (src+mmx_len),
"r" (noise+mmx_len),
"r" (dst+mmx_len),
"g" (-mmx_len)
125 ff_line_noise_c(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
static int shift(int a, int b)
void ff_line_noise_c(uint8_t *dst, const uint8_t *src, const int8_t *noise, int len, int shift)
static atomic_int cpu_flags
Macro definitions for various function/variable attributes.
static void noise(uint8_t *dst, const uint8_t *src, int dst_linesize, int src_linesize, int width, int start, int end, NoiseContext *n, int comp)
#define INLINE_MMX(flags)
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
void(* line_noise_avg)(uint8_t *dst, const uint8_t *src, int len, const int8_t *const *shift)
void(* line_noise)(uint8_t *dst, const uint8_t *src, const int8_t *noise, int len, int shift)
#define INLINE_MMXEXT(flags)
static const int shift2[6]
void ff_line_noise_avg_c(uint8_t *dst, const uint8_t *src, int len, const int8_t *const *shift)
av_cold void ff_noise_init_x86(NoiseContext *n)