Revision c42612f1 libavcodec/motion_est.c

View differences:

libavcodec/motion_est.c
1336 1336
    dxy = ((motion_fy & 1) << 1) | (motion_fx & 1);
1337 1337
    src_x = mb_x * 16 + (motion_fx >> 1);
1338 1338
    src_y = mb_y * 16 + (motion_fy >> 1);
1339
            
1339
    src_x = clip(src_x, -16, s->width);
1340
    if (src_x == s->width)
1341
        dxy&= 2;
1342
    src_y = clip(src_y, -16, s->height);
1343
    if (src_y == s->height)
1344
        dxy&= 1;
1345

  
1340 1346
    ptr = s->last_picture[0] + (src_y * s->linesize) + src_x;
1341 1347
    put_pixels_tab[0][dxy](dest_y    , ptr    , s->linesize, 16);
1342 1348
    
......
1345 1351
    dxy = ((motion_by & 1) << 1) | (motion_bx & 1);
1346 1352
    src_x = mb_x * 16 + (motion_bx >> 1);
1347 1353
    src_y = mb_y * 16 + (motion_by >> 1);
1354
    src_x = clip(src_x, -16, s->width);
1355
    if (src_x == s->width)
1356
        dxy&= 2;
1357
    src_y = clip(src_y, -16, s->height);
1358
    if (src_y == s->height)
1359
        dxy&= 1;
1348 1360
            
1349 1361
    ptr = s->next_picture[0] + (src_y * s->linesize) + src_x;
1350 1362
    avg_pixels_tab[0][dxy](dest_y    , ptr    , s->linesize, 16);

Also available in: Unified diff