Revision 6d7e6b26 libavcodec/h264_loopfilter.c

View differences:

libavcodec/h264_loopfilter.c
445 445
    int edge;
446 446
    const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy;
447 447
    const int mbm_type = s->current_picture.mb_type[mbm_xy];
448
    int (*ref2frm) [64] = h->ref2frm[ h->slice_num          &(MAX_SLICES-1) ][0] + (MB_MBAFF ? 20 : 2);
449
    int (*ref2frmm)[64] = h->ref2frm[ h->slice_table[mbm_xy]&(MAX_SLICES-1) ][0] + (MB_MBAFF ? 20 : 2);
450 448
    int start = h->slice_table[mbm_xy] == 0xFFFF ? 1 : 0;
451 449

  
452 450
    const int edges = (mb_type & (MB_TYPE_16x16|MB_TYPE_SKIP))
......
513 511
        /* mbn_xy: neighbor macroblock */
514 512
        const int mbn_xy = edge > 0 ? mb_xy : mbm_xy;
515 513
        const int mbn_type = s->current_picture.mb_type[mbn_xy];
516
        int (*ref2frmn)[64] = edge > 0 ? ref2frm : ref2frmm;
517 514
        int16_t bS[4];
518 515
        int qp;
519 516

  
......
553 550
                int v = 0;
554 551

  
555 552
                for( l = 0; !v && l < 1 + (h->slice_type_nos == FF_B_TYPE); l++ ) {
556
                    v |= ref2frm[l][h->ref_cache[l][b_idx]] != ref2frmn[l][h->ref_cache[l][bn_idx]] |
553
                    v |= h->ref_cache[l][b_idx] != h->ref_cache[l][bn_idx] |
557 554
                         h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] + 3 >= 7U |
558 555
                         FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit;
559 556
                }
......
562 559
                    v=0;
563 560
                    for( l = 0; !v && l < 2; l++ ) {
564 561
                        int ln= 1-l;
565
                        v |= ref2frm[l][h->ref_cache[l][b_idx]] != ref2frmn[ln][h->ref_cache[ln][bn_idx]] |
562
                        v |= h->ref_cache[l][b_idx] != h->ref_cache[ln][bn_idx] |
566 563
                            h->mv_cache[l][b_idx][0] - h->mv_cache[ln][bn_idx][0] + 3 >= 7U |
567 564
                            FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[ln][bn_idx][1] ) >= mvy_limit;
568 565
                    }
......
588 585
                {
589 586
                    bS[i] = 0;
590 587
                    for( l = 0; l < 1 + (h->slice_type_nos == FF_B_TYPE); l++ ) {
591
                        if( ref2frm[l][h->ref_cache[l][b_idx]] != ref2frmn[l][h->ref_cache[l][bn_idx]] |
588
                        if( h->ref_cache[l][b_idx] != h->ref_cache[l][bn_idx] |
592 589
                            h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] + 3 >= 7U |
593 590
                            FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit ) {
594 591
                            bS[i] = 1;
......
600 597
                        bS[i] = 0;
601 598
                        for( l = 0; l < 2; l++ ) {
602 599
                            int ln= 1-l;
603
                            if( ref2frm[l][h->ref_cache[l][b_idx]] != ref2frmn[ln][h->ref_cache[ln][bn_idx]] |
600
                            if( h->ref_cache[l][b_idx] != h->ref_cache[ln][bn_idx] |
604 601
                                h->mv_cache[l][b_idx][0] - h->mv_cache[ln][bn_idx][0] + 3 >= 7U |
605 602
                                FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[ln][bn_idx][1] ) >= mvy_limit ) {
606 603
                                bS[i] = 1;

Also available in: Unified diff