const int av_unused ymin= c->ymin;\
const int av_unused xmax= c->xmax;\
const int av_unused ymax= c->ymax;\
- uint8_t *mv_penalty= c->current_mv_penalty;\
+ const uint8_t *mv_penalty = c->current_mv_penalty; \
const int pred_x= c->pred_x;\
const int pred_y= c->pred_y;\
if (mx > xmin && mx < xmax &&
my > ymin && my < ymax) {
int d= dmin;
- const int index= (my<<ME_MAP_SHIFT) + mx;
+ const int index = my * (1 << ME_MAP_SHIFT) + mx;
const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
+ (mv_penalty[bx - pred_x] + mv_penalty[by-2 - pred_y])*c->penalty_factor;
const int l= score_map[(index- 1 )&(ME_MAP_SIZE-1)]
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
unsigned key;
unsigned map_generation= c->map_generation;
- key= ((my-1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
+ key = (my - 1) * (1 << ME_MAP_MV_BITS) + (mx) + map_generation;
av_assert2(c->map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
- key= ((my+1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
+ key = (my + 1) * (1 << ME_MAP_MV_BITS) + (mx) + map_generation;
av_assert2(c->map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
- key= ((my)<<ME_MAP_MV_BITS) + (mx+1) + map_generation;
+ key = (my) * (1 << ME_MAP_MV_BITS) + (mx + 1) + map_generation;
av_assert2(c->map[(index+1)&(ME_MAP_SIZE-1)] == key);
- key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
+ key = (my) * (1 << ME_MAP_MV_BITS) + (mx - 1) + map_generation;
av_assert2(c->map[(index-1)&(ME_MAP_SIZE-1)] == key);
#endif
if(t<=b){
int src_index, int ref_index,
int size, int h)
{
- (*mx_ptr)<<=1;
- (*my_ptr)<<=1;
+ (*mx_ptr) *= 2;
+ (*my_ptr) *= 2;
return dmin;
}
int bx=4*mx, by=4*my;
int d= dmin;
int i, nx, ny;
- const int index= (my<<ME_MAP_SHIFT) + mx;
+ const int index = my * (1 << ME_MAP_SHIFT) + mx;
const int t= score_map[(index-(1<<ME_MAP_SHIFT) )&(ME_MAP_SIZE-1)];
const int l= score_map[(index- 1 )&(ME_MAP_SIZE-1)];
const int r= score_map[(index+ 1 )&(ME_MAP_SIZE-1)];
const int cy2= b + t - 2*c;
int cxy;
- if(map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)] == ((my-1)<<ME_MAP_MV_BITS) + (mx-1) + map_generation){
+ if (map[(index - (1 << ME_MAP_SHIFT) - 1) & (ME_MAP_SIZE - 1)] ==
+ (my - 1) * (1 << ME_MAP_MV_BITS) + (mx - 1) + map_generation) {
tl= score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)];
}else{
tl= cmp(s, mx-1, my-1, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);//FIXME wrong if chroma me is different
for(i=0; i<8; i++){
if(score < best[i]){
memmove(&best[i+1], &best[i], sizeof(int)*(7-i));
- memmove(&best_pos[i+1][0], &best_pos[i][0], sizeof(int)*2*(7-i));
+ memmove(best_pos[i + 1], best_pos[i], sizeof(best_pos[0]) * (7 - i));
best[i]= score;
best_pos[i][0]= nx + 4*mx;
best_pos[i][1]= ny + 4*my;