summaryrefslogtreecommitdiff
path: root/libavcodec/x86/fpel_mmx.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-04-27 22:52:26 +0200
committerDiego Biurrun <diego@biurrun.de>2013-05-02 11:45:37 +0200
commit932806232108872655556100011fe369125805d3 (patch)
treec4db29d8a8eb4ab870f0ef362cf48bdaccf7e5ce /libavcodec/x86/fpel_mmx.c
parent9c112a6158928e8d69443adeb9a37e258bf59e55 (diff)
x86: dsputil: Move avg_pixels16_mmx() out of rnd_template.c
The function does not do any rounding, so there is no point in keeping it in a round template file.
Diffstat (limited to 'libavcodec/x86/fpel_mmx.c')
-rw-r--r--libavcodec/x86/fpel_mmx.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/x86/fpel_mmx.c b/libavcodec/x86/fpel_mmx.c
index c42791426e..be64098e0b 100644
--- a/libavcodec/x86/fpel_mmx.c
+++ b/libavcodec/x86/fpel_mmx.c
@@ -50,6 +50,30 @@ void ff_avg_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
while (--h);
}
+void ff_avg_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
+ ptrdiff_t line_size, int h)
+{
+ MOVQ_BFE(mm6);
+ JUMPALIGN();
+ do {
+ __asm__ volatile(
+ "movq %0, %%mm0 \n\t"
+ "movq %1, %%mm1 \n\t"
+ PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
+ "movq %%mm2, %0 \n\t"
+ "movq 8%0, %%mm0 \n\t"
+ "movq 8%1, %%mm1 \n\t"
+ PAVGB_MMX(%%mm0, %%mm1, %%mm2, %%mm6)
+ "movq %%mm2, 8%0 \n\t"
+ :"+m"(*block)
+ :"m"(*pixels)
+ :"memory");
+ pixels += line_size;
+ block += line_size;
+ }
+ while (--h);
+}
+
void ff_put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{