summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libffmpeg/libavcodec/i386/dsputil_mmx.c')
-rw-r--r--src/libffmpeg/libavcodec/i386/dsputil_mmx.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/libffmpeg/libavcodec/i386/dsputil_mmx.c b/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
index 772c9c1f0..c8db22e64 100644
--- a/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
+++ b/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
@@ -22,6 +22,7 @@
#include "../dsputil.h"
#include "../simple_idct.h"
+#include "mmx.h"
//#undef NDEBUG
//#include <assert.h>
@@ -293,6 +294,24 @@ void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size
:"memory");
}
+static unsigned char __align8 vector128[8] =
+ { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
+
+void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
+{
+ int i;
+
+ movq_m2r(*vector128, mm1);
+ for (i = 0; i < 8; i++) {
+ movq_m2r(*(block), mm0);
+ packsswb_m2r(*(block + 4), mm0);
+ block += 8;
+ paddb_r2r(mm1, mm0);
+ movq_r2m(mm0, *pixels);
+ pixels += line_size;
+ }
+}
+
void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
{
const DCTELEM *p;
@@ -2149,19 +2168,18 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
/* VP3 optimized DSP functions */
if (mm_flags & MM_SSE2) {
c->vp3_dsp_init = vp3_dsp_init_sse2;
- c->vp3_idct_put = vp3_idct_put_sse2;
- c->vp3_idct_add = vp3_idct_add_sse2;
+ c->vp3_idct = vp3_idct_sse2;
} else {
c->vp3_dsp_init = vp3_dsp_init_mmx;
- c->vp3_idct_put = vp3_idct_put_mmx;
- c->vp3_idct_add = vp3_idct_add_mmx;
+ c->vp3_idct = vp3_idct_mmx;
}
-
+
#ifdef CONFIG_ENCODERS
c->get_pixels = get_pixels_mmx;
c->diff_pixels = diff_pixels_mmx;
#endif //CONFIG_ENCODERS
c->put_pixels_clamped = put_pixels_clamped_mmx;
+ c->put_signed_pixels_clamped = put_signed_pixels_clamped_mmx;
c->add_pixels_clamped = add_pixels_clamped_mmx;
c->clear_blocks = clear_blocks_mmx;
#ifdef CONFIG_ENCODERS