Revision b6303e6d libavcodec/h264_loopfilter.c

View differences:

libavcodec/h264_loopfilter.c
472 472
        // be done twice (one each of the field) even if we are in a
473 473
        // frame macroblock.
474 474
        //
475
        static const int nnz_idx[4] = {4,5,6,3};
476 475
        unsigned int tmp_linesize   = 2 *   linesize;
477 476
        unsigned int tmp_uvlinesize = 2 * uvlinesize;
478 477
        int mbn_xy = mb_xy - 2 * s->mb_stride;
......
488 487
                const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy];
489 488
                for( i = 0; i < 4; i++ ) {
490 489
                    if( h->non_zero_count_cache[scan8[0]+i] != 0 ||
491
                        mbn_nnz[nnz_idx[i]] != 0 )
490
                        mbn_nnz[i+4+3*8] != 0 )
492 491
                        bS[i] = 2;
493 492
                    else
494 493
                        bS[i] = 1;
......
663 662
            return;
664 663
        }
665 664
    }
666

  
667
    h->non_zero_count_cache[7+8*1]=h->non_zero_count[mb_xy][0];
668
    h->non_zero_count_cache[7+8*2]=h->non_zero_count[mb_xy][1];
669
    h->non_zero_count_cache[7+8*3]=h->non_zero_count[mb_xy][2];
670
    h->non_zero_count_cache[7+8*4]=h->non_zero_count[mb_xy][3];
671
    h->non_zero_count_cache[4+8*4]=h->non_zero_count[mb_xy][4];
672
    h->non_zero_count_cache[5+8*4]=h->non_zero_count[mb_xy][5];
673
    h->non_zero_count_cache[6+8*4]=h->non_zero_count[mb_xy][6];
674

  
675
    h->non_zero_count_cache[1+8*2]=h->non_zero_count[mb_xy][9];
676
    h->non_zero_count_cache[2+8*2]=h->non_zero_count[mb_xy][8];
677
    h->non_zero_count_cache[2+8*1]=h->non_zero_count[mb_xy][7];
678

  
679
    h->non_zero_count_cache[1+8*5]=h->non_zero_count[mb_xy][12];
680
    h->non_zero_count_cache[2+8*5]=h->non_zero_count[mb_xy][11];
681
    h->non_zero_count_cache[2+8*4]=h->non_zero_count[mb_xy][10];
682

  
683
    h->non_zero_count_cache[6+8*1]=h->non_zero_count[mb_xy][13];
684
    h->non_zero_count_cache[6+8*2]=h->non_zero_count[mb_xy][14];
685
    h->non_zero_count_cache[6+8*3]=h->non_zero_count[mb_xy][15];
686
    h->non_zero_count_cache[5+8*1]=h->non_zero_count[mb_xy][16];
687
    h->non_zero_count_cache[5+8*2]=h->non_zero_count[mb_xy][17];
688
    h->non_zero_count_cache[5+8*3]=h->non_zero_count[mb_xy][18];
689
    h->non_zero_count_cache[4+8*1]=h->non_zero_count[mb_xy][19];
690
    h->non_zero_count_cache[4+8*2]=h->non_zero_count[mb_xy][20];
691
    h->non_zero_count_cache[4+8*3]=h->non_zero_count[mb_xy][21];
692

  
693
    h->non_zero_count_cache[1+8*1]=h->non_zero_count[mb_xy][22];
694
    h->non_zero_count_cache[1+8*4]=h->non_zero_count[mb_xy][23];
695

  
696 665
    // CAVLC 8x8dct requires NNZ values for residual decoding that differ from what the loop filter needs
697 666
    if(!h->pps.cabac && h->pps.transform_8x8_mode){
698 667
        int top_type, left_type[2];
......
762 731
                         ((!h->pps.cabac && IS_8x8DCT(s->current_picture.mb_type[mbn_xy])) ?
763 732
                            (h->cbp_table[mbn_xy] & ((MB_FIELD ? (i&2) : (mb_y&1)) ? 8 : 2))
764 733
                                                                       :
765
                            h->non_zero_count[mbn_xy][MB_FIELD ? i&3 : (i>>2)+(mb_y&1)*2]))
734
                            h->non_zero_count[mbn_xy][7+(MB_FIELD ? (i&3) : (i>>2)+(mb_y&1)*2)*8]))
766 735
                    bS[i] = 2;
767 736
                else
768 737
                    bS[i] = 1;

Also available in: Unified diff