Revision ca7c784f

View differences:

libavcodec/h264_loopfilter.c
425 425
}
426 426

  
427 427
static int check_mv(H264Context *h, long b_idx, long bn_idx, int mvy_limit){
428
    int l;
429
    int v = 0;
428
    int v;
430 429

  
431
    for( l = 0; !v && l < h->list_count; l++ ) {
432
        v |= h->ref_cache[l][b_idx] != h->ref_cache[l][bn_idx] |
433
                h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] + 3 >= 7U |
434
                FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit;
435
    }
430
    v = h->ref_cache[0][b_idx] != h->ref_cache[0][bn_idx] |
431
        h->mv_cache[0][b_idx][0] - h->mv_cache[0][bn_idx][0] + 3 >= 7U |
432
        FFABS( h->mv_cache[0][b_idx][1] - h->mv_cache[0][bn_idx][1] ) >= mvy_limit;
433
    if(h->list_count==2 && !v)
434
        v = h->ref_cache[1][b_idx] != h->ref_cache[1][bn_idx] |
435
            h->mv_cache[1][b_idx][0] - h->mv_cache[1][bn_idx][0] + 3 >= 7U |
436
            FFABS( h->mv_cache[1][b_idx][1] - h->mv_cache[1][bn_idx][1] ) >= mvy_limit;
436 437

  
437 438
    if(h->list_count==2 && v){
438
        v=0;
439
        for( l = 0; !v && l < 2; l++ ) {
440
            int ln= 1-l;
441
            v |= h->ref_cache[l][b_idx] != h->ref_cache[ln][bn_idx] |
442
                h->mv_cache[l][b_idx][0] - h->mv_cache[ln][bn_idx][0] + 3 >= 7U |
443
                FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[ln][bn_idx][1] ) >= mvy_limit;
444
        }
439
        if(h->ref_cache[0][b_idx] != h->ref_cache[1][bn_idx] |
440
           h->mv_cache[0][b_idx][0] - h->mv_cache[1][bn_idx][0] + 3 >= 7U |
441
           FFABS( h->mv_cache[0][b_idx][1] - h->mv_cache[1][bn_idx][1] ) >= mvy_limit)
442
            return 1;
443
        if(h->ref_cache[1][b_idx] != h->ref_cache[0][bn_idx] |
444
           h->mv_cache[1][b_idx][0] - h->mv_cache[0][bn_idx][0] + 3 >= 7U |
445
           FFABS( h->mv_cache[1][b_idx][1] - h->mv_cache[0][bn_idx][1] ) >= mvy_limit)
446
            return 1;
447
        return 0;
445 448
    }
446 449

  
447 450
    return v;

Also available in: Unified diff