if( get_cabac( &h->cabac, &h->cabac_state[105+significant_coeff_flag_offset[cat]+last] )) {
if( get_cabac( &h->cabac, &h->cabac_state[significant_coeff_flag_field_offset[h->mb_field_decoding_flag]+significant_coeff_flag_offset[cat]+last] )) {
static int inline decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int qp, int max_coeff) {    const int mb_xy  = h->s.mb_x + h->s.mb_y*h->s.mb_stride;    const uint16_t *qmul= dequant_coeff[qp];    static const int significant_coeff_flag_offset[5] = { 0, 15, 29, 44, 47 };    static const int coeff_abs_level_m1_offset[5] = {227+ 0, 227+10, 227+20, 227+30, 227+39 };    int index[16];    int i, last;    int coeff_count = 0;    int abslevel1 = 1;    int abslevelgt1 = 0;    /* cat: 0-> DC 16x16  n = 0     *      1-> AC 16x16  n = luma4x4idx     *      2-> Luma4x4   n = luma4x4idx     *      3-> DC Chroma n = iCbCr     *      4-> AC Chroma n = 4 * iCbCr + chroma4x4idx     */    /* read coded block flag */    if( get_cabac( &h->cabac, &h->cabac_state[85 + get_cabac_cbf_ctx( h, cat, n ) ] ) == 0 ) {        if( cat == 1 || cat == 2 )            h->non_zero_count_cache[scan8[n]] = 0;        else if( cat == 4 )            h->non_zero_count_cache[scan8[16+n]] = 0;        return 0;    }    for(last= 0; last < max_coeff - 1; last++) {        if( get_cabac( &h->cabac, &h->cabac_state[105+significant_coeff_flag_offset[cat]+last] )) {            index[coeff_count++] = last;            if( get_cabac( &h->cabac, &h->cabac_state[166+significant_coeff_flag_offset[cat]+last] ) ) {                last= max_coeff;                break;            }        }    }    if( last == max_coeff -1 ) {        index[coeff_count++] = last;    }    assert(coeff_count > 0);    if( cat == 0 )        h->cbp_table[mb_xy] |= 0x100;    else if( cat == 1 || cat == 2 )        h->non_zero_count_cache[scan8[n]] = coeff_count;    else if( cat == 3 )        h->cbp_table[mb_xy] |= 0x40 << n;    else {        assert( cat == 4 );        h->non_zero_count_cache[scan8[16+n]] = coeff_count;    }    for( i = coeff_count - 1; i >= 0; i-- ) {        int ctx = (abslevelgt1 != 0 ? 0 : FFMIN( 4, abslevel1 )) + coeff_abs_level_m1_offset[cat];        int j= scantable[index[i]];        if( get_cabac( &h->cabac, &h->cabac_state[ctx] ) == 0 ) {            if( cat == 0 || cat == 3 ) {                if( get_cabac_bypass( &h->cabac ) ) block[j] = -1;                else                                block[j] =  1;            }else{                if( get_cabac_bypass( &h->cabac ) ) block[j] = -qmul[j];                else                                block[j] =  qmul[j];            }                abslevel1++;        } else {            int coeff_abs = 2;            ctx = 5 + FFMIN( 4, abslevelgt1 ) + coeff_abs_level_m1_offset[cat];            while( coeff_abs < 15 && get_cabac( &h->cabac, &h->cabac_state[ctx] ) ) {                coeff_abs++;            }            if( coeff_abs >= 15 ) {                int j = 0;                while( get_cabac_bypass( &h->cabac ) ) {                    coeff_abs += 1 << j;                    j++;                }                    while( j-- ) {                    if( get_cabac_bypass( &h->cabac ) )                        coeff_abs += 1 << j ;                }            }            if( cat == 0 || cat == 3 ) {                if( get_cabac_bypass( &h->cabac ) ) block[j] = -coeff_abs;                else                                block[j] =  coeff_abs;            }else{                if( get_cabac_bypass( &h->cabac ) ) block[j] = -coeff_abs * qmul[j];                else                                block[j] =  coeff_abs * qmul[j];            }                abslevelgt1++;        }    }    return 0;}