Revision 50eb40a7 libavcodec/h264_loopfilter.c

View differences:

libavcodec/h264_loopfilter.c
381 381
            int step = IS_8x8DCT(mb_type) ? 2 : 1;
382 382
            edges = (mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4;
383 383
            s->dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache,
384
                                              (h->slice_type_nos == FF_B_TYPE), edges, step, mask_edge0, mask_edge1, FIELD_PICTURE);
384
                                              h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE);
385 385
        }
386 386
        if( IS_INTRA(s->current_picture.mb_type[mb_xy-1]) )
387 387
            bSv[0][0] = 0x0004000400040004ULL;
......
513 513
                int bn_idx= b_idx - (dir ? 8:1);
514 514
                int v = 0;
515 515

  
516
                for( l = 0; !v && l < 1 + (h->slice_type_nos == FF_B_TYPE); l++ ) {
516
                for( l = 0; !v && l < h->list_count; l++ ) {
517 517
                    v |= h->ref_cache[l][b_idx] != h->ref_cache[l][bn_idx] |
518 518
                         h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] + 3 >= 7U |
519 519
                         FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit;
520 520
                }
521 521

  
522
                if(h->slice_type_nos == FF_B_TYPE && v){
522
                if(h->list_count==2 && v){
523 523
                    v=0;
524 524
                    for( l = 0; !v && l < 2; l++ ) {
525 525
                        int ln= 1-l;
......
548 548
                else if(!mv_done)
549 549
                {
550 550
                    bS[i] = 0;
551
                    for( l = 0; l < 1 + (h->slice_type_nos == FF_B_TYPE); l++ ) {
551
                    for( l = 0; l < h->list_count; l++ ) {
552 552
                        if( h->ref_cache[l][b_idx] != h->ref_cache[l][bn_idx] |
553 553
                            h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] + 3 >= 7U |
554 554
                            FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit ) {
......
557 557
                        }
558 558
                    }
559 559

  
560
                    if(h->slice_type_nos == FF_B_TYPE && bS[i]){
560
                    if(h->list_count == 2 && bS[i]){
561 561
                        bS[i] = 0;
562 562
                        for( l = 0; l < 2; l++ ) {
563 563
                            int ln= 1-l;

Also available in: Unified diff