Revision ac5057c2

View differences:

libavcodec/h264.c
4897 4897
    h->cbp = cbp;
4898 4898

  
4899 4899
    if(dct8x8_allowed && (cbp&15) && !IS_INTRA(mb_type)){
4900
        if(get_bits1(&s->gb))
4900
        if(get_bits1(&s->gb)){
4901 4901
            mb_type |= MB_TYPE_8x8DCT;
4902
            h->cbp_table[mb_xy]= cbp;
4903
        }
4902 4904
    }
4903 4905
    s->current_picture.mb_type[mb_xy]= mb_type;
4904 4906

  
......
6577 6579
        }
6578 6580
    }
6579 6581

  
6582
    // CAVLC 8x8dct requires NNZ values for residual decoding that differ from what the loop filter needs
6583
    if(!h->pps.cabac && h->pps.transform_8x8_mode){
6584
        int top_type, left_type[2];
6585
        top_type     = s->current_picture.mb_type[h->top_mb_xy]    ;
6586
        left_type[0] = s->current_picture.mb_type[h->left_mb_xy[0]];
6587
        left_type[1] = s->current_picture.mb_type[h->left_mb_xy[1]];
6588

  
6589
        if(IS_8x8DCT(top_type)){
6590
            h->non_zero_count_cache[4+8*0]=
6591
            h->non_zero_count_cache[5+8*0]= h->cbp_table[h->top_mb_xy] & 4;
6592
            h->non_zero_count_cache[6+8*0]=
6593
            h->non_zero_count_cache[7+8*0]= h->cbp_table[h->top_mb_xy] & 8;
6594
        }
6595
        if(IS_8x8DCT(left_type[0])){
6596
            h->non_zero_count_cache[3+8*1]=
6597
            h->non_zero_count_cache[3+8*2]= h->cbp_table[h->left_mb_xy[0]]&2; //FIXME check MBAFF
6598
        }
6599
        if(IS_8x8DCT(left_type[1])){
6600
            h->non_zero_count_cache[3+8*3]=
6601
            h->non_zero_count_cache[3+8*4]= h->cbp_table[h->left_mb_xy[1]]&8; //FIXME check MBAFF
6602
        }
6603

  
6604
        if(IS_8x8DCT(mb_type)){
6605
            h->non_zero_count_cache[scan8[0   ]]= h->non_zero_count_cache[scan8[1   ]]=
6606
            h->non_zero_count_cache[scan8[2   ]]= h->non_zero_count_cache[scan8[3   ]]= h->cbp_table[mb_xy] & 1;
6607

  
6608
            h->non_zero_count_cache[scan8[0+ 4]]= h->non_zero_count_cache[scan8[1+ 4]]=
6609
            h->non_zero_count_cache[scan8[2+ 4]]= h->non_zero_count_cache[scan8[3+ 4]]= h->cbp_table[mb_xy] & 2;
6610

  
6611
            h->non_zero_count_cache[scan8[0+ 8]]= h->non_zero_count_cache[scan8[1+ 8]]=
6612
            h->non_zero_count_cache[scan8[2+ 8]]= h->non_zero_count_cache[scan8[3+ 8]]= h->cbp_table[mb_xy] & 4;
6613

  
6614
            h->non_zero_count_cache[scan8[0+12]]= h->non_zero_count_cache[scan8[1+12]]=
6615
            h->non_zero_count_cache[scan8[2+12]]= h->non_zero_count_cache[scan8[3+12]]= h->cbp_table[mb_xy] & 8;
6616
        }
6617
    }
6618

  
6580 6619
    if (FRAME_MBAFF
6581 6620
            // left mb is in picture
6582 6621
            && h->slice_table[mb_xy-1] != 255

Also available in: Unified diff