[Mplayer-cvslog] CVS: main/libmpcodecs/native svq1.c,1.1,1.2
Arpi of Ize
arpi at mplayerhq.hu
Sun Jun 23 01:58:18 CEST 2002
Update of /cvsroot/mplayer/main/libmpcodecs/native
In directory mail:/var/tmp.root/cvs-serv29058
Modified Files:
svq1.c
Log Message:
use libavcodec's optimized MC functions
Index: svq1.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/native/svq1.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- svq1.c 22 Jun 2002 23:07:40 -0000 1.1
+++ svq1.c 22 Jun 2002 23:58:15 -0000 1.2
@@ -25,6 +25,7 @@
#include <string.h>
#include <unistd.h>
+#include "../../config.h"
#include "bswap.h"
/* variable length (bit) code */
@@ -40,6 +41,12 @@
#include "svq1.h"
#include "svq1_cb.h"
+#ifdef USE_LIBAVCODEC
+typedef void (*op_pixels_func)(unsigned char *block, const unsigned char *pixels, int line_size, int h);
+extern op_pixels_func put_pixels_tab[4];
+extern op_pixels_func put_no_rnd_pixels_tab[4];
+#endif
+
/* memory bit stream */
typedef struct bit_buffer_s {
uint8_t *buffer;
@@ -339,6 +346,10 @@
src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1))*pitch];
dst = current;
+#ifdef USE_LIBAVCODEC
+ put_pixels_tab[((mv.y & 1) << 1) | (mv.x & 1)](dst,src,pitch,16);
+ put_pixels_tab[((mv.y & 1) << 1) | (mv.x & 1)](dst+8,src+8,pitch,16);
+#else
/* form prediction */
if (mv.y & 0x1) {
if (mv.x & 0x1) {
@@ -375,6 +386,7 @@
}
}
}
+#endif
return 0;
}
@@ -441,6 +453,9 @@
src = &previous[(x + (pmv[i]->x >> 1)) + (y + (pmv[i]->y >> 1))*pitch];
dst = current;
+#ifdef USE_LIBAVCODEC
+ put_pixels_tab[((pmv[i]->y & 1) << 1) | (pmv[i]->x & 1)](dst,src,pitch,8);
+#else
if (pmv[i]->y & 0x1) {
if (pmv[i]->x & 0x1) {
for (sy=0; sy < 8; sy++) {
@@ -476,6 +491,7 @@
}
}
}
+#endif
/* select next block */
if (i & 1) {
More information about the MPlayer-cvslog
mailing list