Revision 27739206 libavcodec/h264_cabac.c

View differences:

libavcodec/h264_cabac.c
706 706

  
707 707
static int decode_cabac_field_decoding_flag(H264Context *h) {
708 708
    MpegEncContext * const s = &h->s;
709
    const int mb_x = s->mb_x;
710
    const int mb_y = s->mb_y & ~1;
711
    const int mba_xy = mb_x - 1 +  mb_y   *s->mb_stride;
712
    const int mbb_xy = mb_x     + (mb_y-2)*s->mb_stride;
709
    const long mba_xy = h->mb_xy - 1L;
710
    const long mbb_xy = h->mb_xy - 2L*s->mb_stride;
713 711

  
714
    unsigned int ctx = 0;
712
    unsigned long ctx = 0;
715 713

  
716
    if( h->slice_table[mba_xy] == h->slice_num && IS_INTERLACED( s->current_picture.mb_type[mba_xy] ) ) {
717
        ctx += 1;
718
    }
719
    if( h->slice_table[mbb_xy] == h->slice_num && IS_INTERLACED( s->current_picture.mb_type[mbb_xy] ) ) {
720
        ctx += 1;
721
    }
714
    ctx += (s->current_picture.mb_type[mba_xy]>>7)&(h->slice_table[mba_xy] == h->slice_num);
715
    ctx += (s->current_picture.mb_type[mbb_xy]>>7)&(h->slice_table[mbb_xy] == h->slice_num);
722 716

  
723
    return get_cabac_noinline( &h->cabac, &h->cabac_state[70 + ctx] );
717
    return get_cabac_noinline( &h->cabac, &(h->cabac_state+70)[ctx] );
724 718
}
725 719

  
726 720
static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_slice) {

Also available in: Unified diff