Logo Search packages:      
Sourcecode: blender version File versions

static int get_cabac_ueg ( CABACContext *  c,
uint8_t *  state,
int  max,
int  is_signed,
int  k,
int  max_index 
) [inline, static]

get unary exp golomb k-th order binarization.

Definition at line 394 of file cabac.h.

                                                                                                               {
    int i, v;
    int m= 1<<k;

    if(get_cabac(c, state)==0)
        return 0;

    if(0 < max_index) state++;

    for(i=1; i<max; i++){
        if(get_cabac(c, state)==0){
            if(is_signed && get_cabac_bypass(c)){
                return -i;
            }else
                return i;
        }

        if(i < max_index) state++;
    }

    while(get_cabac_bypass(c)){
        i+= m;
        m+= m;
    }

    v=0;
    while(m>>=1){
        v+= v + get_cabac_bypass(c);
    }
    i += v;

    if(is_signed && get_cabac_bypass(c)){
        return -i;
    }else
        return i;
}


Generated by  Doxygen 1.6.0   Back to index