aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2007-03-30 19:15:31 +0000
committerLoren Merritt <lorenm@u.washington.edu>2007-03-30 19:15:31 +0000
commit5900637219ccccdd39ddafa4e7181da20b8e1f1b (patch)
tree7281321fc627bdc6f48aedc5dfb98e7719f85aa1 /libavcodec/dsputil.c
parent0c0d17f3ce9dc5bbf3a7c3b85f3fe95e3dbbb482 (diff)
downloadffmpeg-5900637219ccccdd39ddafa4e7181da20b8e1f1b.tar.gz
mmx 16-bit ssd. 2.3x faster svq1 encoding.
Originally committed as revision 8559 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 6aa54538ec..3f5e845e7e 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -3694,6 +3694,14 @@ static int vsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int st
return score;
}
+static int ssd_int8_vs_int16_c(int8_t *pix1, int16_t *pix2, int size){
+ int score=0;
+ int i;
+ for(i=0; i<size; i++)
+ score += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
+ return score;
+}
+
WARPER8_16_SQ(hadamard8_diff8x8_c, hadamard8_diff16_c)
WARPER8_16_SQ(hadamard8_intra8x8_c, hadamard8_intra16_c)
WARPER8_16_SQ(dct_sad8x8_c, dct_sad16_c)
@@ -4076,6 +4084,8 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->w97[1]= w97_8_c;
#endif
+ c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
+
c->add_bytes= add_bytes_c;
c->diff_bytes= diff_bytes_c;
c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c;