Revision 5f621dd2

View differences:

libavcodec/rv34.c
474 474
static int calc_add_mv(RV34DecContext *r, int dir, int val)
475 475
{
476 476
    int refdist = GET_PTS_DIFF(r->next_pts, r->last_pts);
477
    int dist = dir ? GET_PTS_DIFF(r->next_pts, r->cur_pts) : GET_PTS_DIFF(r->cur_pts, r->last_pts);
477
    int dist = dir ? -GET_PTS_DIFF(r->next_pts, r->cur_pts) : GET_PTS_DIFF(r->cur_pts, r->last_pts);
478
    int mul;
478 479

  
479 480
    if(!refdist) return 0;
480
    if(!dir)
481
        return (val * dist + refdist - 1) / refdist;
482
    else
483
        return -(val * dist / refdist);
481
    mul = (dist << 14) / refdist;
482
    return (val * mul + 0x2000) >> 14;
484 483
}
485 484

  
486 485
/**

Also available in: Unified diff