Mercurial > libavcodec.hg
comparison motion_est.c @ 11575:5a7797213359 libavcodec
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.
author | michael |
---|---|
date | Fri, 02 Apr 2010 11:06:29 +0000 |
parents | 7b86b341edd0 |
children | 56b71cbf22ac |
comparison
equal
deleted
inserted
replaced
11574:7b86b341edd0 | 11575:5a7797213359 |
---|---|
1473 const int shift= 1+qpel; | 1473 const int shift= 1+qpel; |
1474 const int xmin= c->xmin<<shift; | 1474 const int xmin= c->xmin<<shift; |
1475 const int ymin= c->ymin<<shift; | 1475 const int ymin= c->ymin<<shift; |
1476 const int xmax= c->xmax<<shift; | 1476 const int xmax= c->xmax<<shift; |
1477 const int ymax= c->ymax<<shift; | 1477 const int ymax= c->ymax<<shift; |
1478 uint8_t map[8][8][8][8]; | 1478 uint8_t map[256]; |
1479 | 1479 |
1480 memset(map,0,sizeof(map)); | 1480 memset(map,0,sizeof(map)); |
1481 #define BIDIR_MAP(fx,fy,bx,by) \ | 1481 #define BIDIR_MAP(fx,fy,bx,by) \ |
1482 map[(motion_fx+fx)&7][(motion_fy+fy)&7][(motion_bx+bx)&7][(motion_by+by)&7] | 1482 map[((motion_fx+fx)+17*(motion_fy+fy)+63*(motion_bx+bx)+117*(motion_by+by))&255] |
1483 BIDIR_MAP(0,0,0,0) = 1; | 1483 BIDIR_MAP(0,0,0,0) = 1; |
1484 | 1484 |
1485 fbmin= check_bidir_mv(s, motion_fx, motion_fy, | 1485 fbmin= check_bidir_mv(s, motion_fx, motion_fy, |
1486 motion_bx, motion_by, | 1486 motion_bx, motion_by, |
1487 pred_fx, pred_fy, | 1487 pred_fx, pred_fy, |