On Mon, Nov 3, 2014 at 12:55 PM, Luca Barbato <[email protected]> wrote: > On 30/10/14 01:51, Vittorio Giovara wrote: >> >> if(s->me.dia_size>=2){ >> const int tl= >> score_map[(index-(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)]; >> const int bl= >> score_map[(index+(1<<ME_MAP_SHIFT)-1)&(ME_MAP_SIZE-1)]; >> @@ -281,7 +281,7 @@ static int qpel_motion_search(MpegEncContext * s, >> // if(nx&1) score-=1024*c->penalty_factor; >> // if(ny&1) score-=1024*c->penalty_factor; >> >> - for(i=0; i<8; i++){ >> + for (i = 0; i < FF_ARRAY_ELEMS(best) - 1; 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)); >> @@ -328,7 +328,7 @@ static int qpel_motion_search(MpegEncContext * s, >> // if(nx&1) score-=32*c->penalty_factor; >> // if(ny&1) score-=32*c->penalty_factor; >> >> - for(i=0; i<8; i++){ >> + for (i = 0; i < FF_ARRAY_ELEMS(best) - 1; 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)); >> > > The memmove do not change, you forgot a -1 somewhere maybe?
umh, I am reducing the loop bound with "FF_ARRAY_ELEMS(best) - 1", unless I am missing something memmove indexes should not be touched, right? -- Vittorio _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
