[FFmpeg-cvslog] r22773 - trunk/libavcodec/motion_est.c

michael subversion
Fri Apr 2 13:06:30 CEST 2010


Author: michael
Date: Fri Apr  2 13:06:29 2010
New Revision: 22773

Log:
Reduce the size of the bidir refine hashtable from 4096 to 256 and
change the hash function to something more sane and simple.
about 1/3 faster, no meassureable change in psnr or size and i gues
its even same md5 with my test file but i forgot testing that.

Modified:
   trunk/libavcodec/motion_est.c

Modified: trunk/libavcodec/motion_est.c
==============================================================================
--- trunk/libavcodec/motion_est.c	Fri Apr  2 03:13:59 2010	(r22772)
+++ trunk/libavcodec/motion_est.c	Fri Apr  2 13:06:29 2010	(r22773)
@@ -1475,11 +1475,11 @@ static inline int bidir_refine(MpegEncCo
     const int ymin= c->ymin<<shift;
     const int xmax= c->xmax<<shift;
     const int ymax= c->ymax<<shift;
-    uint8_t map[8][8][8][8];
+    uint8_t map[256];
 
     memset(map,0,sizeof(map));
 #define BIDIR_MAP(fx,fy,bx,by) \
-    map[(motion_fx+fx)&7][(motion_fy+fy)&7][(motion_bx+bx)&7][(motion_by+by)&7]
+    map[((motion_fx+fx)+17*(motion_fy+fy)+63*(motion_bx+bx)+117*(motion_by+by))&255]
     BIDIR_MAP(0,0,0,0) = 1;
 
     fbmin= check_bidir_mv(s, motion_fx, motion_fy,



More information about the ffmpeg-cvslog mailing list