28 #if HAVE_MMX_INLINE && HAVE_6REGS
30 const uint8_t *
src,
int src_stride,
int w,
int h)
34 int dstep = dst_stride - w;
35 int sstep = src_stride - w;
38 int contrast = (int) (param->
contrast * 256 * 16);
39 int brightness = ((int) (100.0 * param->
brightness + 100.0) * 511) / 200 - 128 - contrast / 32;
41 brvec[0] = brvec[1] = brvec[2] = brvec[3] = brightness;
42 contvec[0] = contvec[1] = contvec[2] = contvec[3] = contrast;
46 "movq (%5), %%mm3 \n\t"
47 "movq (%6), %%mm4 \n\t"
48 "pxor %%mm0, %%mm0 \n\t"
52 "movq (%0), %%mm1 \n\t"
53 "movq (%0), %%mm2 \n\t"
54 "punpcklbw %%mm0, %%mm1\n\t"
55 "punpckhbw %%mm0, %%mm2\n\t"
56 "psllw $4, %%mm1 \n\t"
57 "psllw $4, %%mm2 \n\t"
58 "pmulhw %%mm4, %%mm1 \n\t"
59 "pmulhw %%mm4, %%mm2 \n\t"
60 "paddw %%mm3, %%mm1 \n\t"
61 "paddw %%mm3, %%mm2 \n\t"
62 "packuswb %%mm2, %%mm1 \n\t"
64 "movq %%mm1, (%1) \n\t"
68 :
"=r" (
src),
"=r" (dst)
69 :
"0" (
src),
"1" (dst),
"r" (w>>3),
"r" (brvec),
"r" (contvec)
73 for (i = w&7; i; i--) {
74 pel = ((*src++ * contrast) >> 12) + brightness;
83 __asm__
volatile (
"emms \n\t" :::
"memory" );
89 #if HAVE_MMX_INLINE && HAVE_6REGS