mirror of https://git.ffmpeg.org/ffmpeg.git
dsputil_mmx: K&R formatting cosmetics
This commit is contained in:
parent
6a8b35dc88
commit
38675229a8
|
@ -83,7 +83,8 @@ void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
|||
"movq %%mm2, (%0, %1) \n\t"
|
||||
"movq %%mm4, (%0, %1, 2) \n\t"
|
||||
"movq %%mm6, (%0, %2) \n\t"
|
||||
:: "r"(pix), "r"((x86_reg)line_size), "r"((x86_reg)line_size * 3), "r"(p)
|
||||
:: "r" (pix), "r" ((x86_reg) line_size), "r" ((x86_reg) line_size * 3),
|
||||
"r" (p)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
|
@ -179,8 +180,7 @@ void name(int16_t *blocks) \
|
|||
"js 1b \n\t" \
|
||||
:: "r"(((uint8_t *) blocks) + 128 * n), \
|
||||
"i"(-128 * n) \
|
||||
: "%"REG_a \
|
||||
); \
|
||||
: "%"REG_a); \
|
||||
}
|
||||
CLEAR_BLOCKS(ff_clear_blocks_mmx, 6)
|
||||
CLEAR_BLOCKS(ff_clear_block_mmx, 1)
|
||||
|
@ -198,8 +198,7 @@ void ff_clear_block_sse(int16_t *block)
|
|||
"movaps %%xmm0, 96(%0) \n"
|
||||
"movaps %%xmm0, 112(%0) \n"
|
||||
:: "r" (block)
|
||||
: "memory"
|
||||
);
|
||||
: "memory");
|
||||
}
|
||||
|
||||
void ff_clear_blocks_sse(int16_t *blocks)
|
||||
|
@ -218,15 +217,14 @@ void ff_clear_blocks_sse(int16_t *blocks)
|
|||
"movaps %%xmm0, 112(%0, %%"REG_a") \n"
|
||||
"add $128, %%"REG_a" \n"
|
||||
"js 1b \n"
|
||||
:: "r"(((uint8_t *)blocks) + 128 * 6),
|
||||
"i"(-128 * 6)
|
||||
: "%"REG_a
|
||||
);
|
||||
:: "r"(((uint8_t *) blocks) + 128 * 6), "i"(-128 * 6)
|
||||
: "%"REG_a);
|
||||
}
|
||||
|
||||
void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, int w)
|
||||
{
|
||||
x86_reg i = 0;
|
||||
|
||||
__asm__ volatile (
|
||||
"jmp 2f \n\t"
|
||||
"1: \n\t"
|
||||
|
@ -243,8 +241,8 @@ void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, int w)
|
|||
"cmp %3, %0 \n\t"
|
||||
"js 1b \n\t"
|
||||
: "+r" (i)
|
||||
: "r"(src), "r"(dst), "r"((x86_reg)w - 15)
|
||||
);
|
||||
: "r" (src), "r" (dst), "r" ((x86_reg) w - 15));
|
||||
|
||||
for (; i < w; i++)
|
||||
dst[i + 0] += src[i + 0];
|
||||
}
|
||||
|
@ -277,8 +275,8 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
|
|||
"cmp %3, %0 \n\t"
|
||||
"jb 1b \n\t"
|
||||
: "+r" (ptr)
|
||||
: "r"((x86_reg)wrap), "r"((x86_reg)width), "r"(ptr + wrap * height)
|
||||
);
|
||||
: "r" ((x86_reg) wrap), "r" ((x86_reg) width),
|
||||
"r" (ptr + wrap * height));
|
||||
} else {
|
||||
__asm__ volatile (
|
||||
"1: \n\t"
|
||||
|
@ -298,8 +296,8 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
|
|||
"cmp %3, %0 \n\t"
|
||||
"jb 1b \n\t"
|
||||
: "+r" (ptr)
|
||||
: "r"((x86_reg)wrap), "r"((x86_reg)width), "r"(ptr + wrap * height)
|
||||
);
|
||||
: "r" ((x86_reg) wrap), "r" ((x86_reg) width),
|
||||
"r" (ptr + wrap * height));
|
||||
}
|
||||
|
||||
/* top and bottom (and hopefully also the corners) */
|
||||
|
@ -317,9 +315,9 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
|
|||
"cmp %4, %0 \n\t"
|
||||
"jb 1b \n\t"
|
||||
: "+r" (ptr)
|
||||
: "r"((x86_reg)buf - (x86_reg)ptr - w), "r"((x86_reg) -wrap),
|
||||
"r"((x86_reg) -wrap * 3), "r"(ptr + width + 2 * w)
|
||||
);
|
||||
: "r" ((x86_reg) buf - (x86_reg) ptr - w),
|
||||
"r" ((x86_reg) - wrap), "r" ((x86_reg) - wrap * 3),
|
||||
"r" (ptr + width + 2 * w));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -339,8 +337,7 @@ void ff_draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
|
|||
: "+r" (ptr)
|
||||
: "r" ((x86_reg) last_line - (x86_reg) ptr - w),
|
||||
"r" ((x86_reg) wrap), "r" ((x86_reg) wrap * 3),
|
||||
"r"(ptr + width + 2 * w)
|
||||
);
|
||||
"r" (ptr + width + 2 * w));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -369,11 +366,12 @@ void ff_gmc_mmx(uint8_t *dst, uint8_t *src,
|
|||
const int dyh = (dyy - (1 << (16 + shift))) * (h - 1);
|
||||
const int dxh = dxy * (h - 1);
|
||||
const int dyw = dyx * (w - 1);
|
||||
|
||||
if ( // non-constant fullpel offset (3% of blocks)
|
||||
((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) |
|
||||
(oy ^ (oy + dyw)) | (oy ^ (oy + dyh)) | (oy ^ (oy + dyw + dyh))) >> (16 + shift)
|
||||
(oy ^ (oy + dyw)) | (oy ^ (oy + dyh)) | (oy ^ (oy + dyw + dyh))) >> (16 + shift) ||
|
||||
// uses more than 16 bits of subpel mv (only at huge resolution)
|
||||
|| (dxx | dxy | dyx | dyy) & 15 ||
|
||||
(dxx | dxy | dyx | dyy) & 15 ||
|
||||
(unsigned) ix >= width - w ||
|
||||
(unsigned) iy >= height - h) {
|
||||
// FIXME could still use mmx for some of the rows
|
||||
|
@ -389,8 +387,7 @@ void ff_gmc_mmx(uint8_t *dst, uint8_t *src,
|
|||
"pxor %%mm7, %%mm7 \n\t"
|
||||
"punpcklwd %%mm6, %%mm6 \n\t"
|
||||
"punpcklwd %%mm6, %%mm6 \n\t"
|
||||
:: "r"(1<<shift)
|
||||
);
|
||||
:: "r" (1 << shift));
|
||||
|
||||
for (x = 0; x < w; x += 4) {
|
||||
uint16_t dx4[4] = { oxs - dxys + dxxs * (x + 0),
|
||||
|
@ -413,8 +410,7 @@ void ff_gmc_mmx(uint8_t *dst, uint8_t *src,
|
|||
"psrlw $12, %%mm4 \n\t"
|
||||
"psrlw $12, %%mm5 \n\t"
|
||||
: "+m" (*dx4), "+m" (*dy4)
|
||||
: "m"(*dxy4), "m"(*dyy4)
|
||||
);
|
||||
: "m" (*dxy4), "m" (*dyy4));
|
||||
|
||||
__asm__ volatile (
|
||||
"movq %%mm6, %%mm2 \n\t"
|
||||
|
@ -453,8 +449,7 @@ void ff_gmc_mmx(uint8_t *dst, uint8_t *src,
|
|||
: "=m" (dst[x + y * stride])
|
||||
: "m" (src[0]), "m" (src[1]),
|
||||
"m" (src[stride]), "m" (src[stride + 1]),
|
||||
"m"(*r4), "m"(shift2)
|
||||
);
|
||||
"m" (*r4), "m" (shift2));
|
||||
src += stride;
|
||||
}
|
||||
src += 4 - h * stride;
|
||||
|
@ -491,8 +486,7 @@ void ff_vector_clipf_sse(float *dst, const float *src,
|
|||
"jge 1b \n\t"
|
||||
: "+&r" (i)
|
||||
: "r" (dst), "r" (src), "m" (min), "m" (max)
|
||||
: "memory"
|
||||
);
|
||||
: "memory");
|
||||
}
|
||||
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
|
Loading…
Reference in New Issue