Logo Search packages:      
Sourcecode: blender version File versions

static void put_cabac_u ( CABACContext *  c,
uint8_t *  state,
int  v,
int  max,
int  max_index,
int  truncated 
) [inline, static]

put (truncated) unary binarization.

Definition at line 179 of file cabac.h.

                                                                                                              {
    int i;

    assert(v <= max);

#if 1
    for(i=0; i<v; i++){
        put_cabac(c, state, 1);
        if(i < max_index) state++;
    }
    if(truncated==0 || v<max)
        put_cabac(c, state, 0);
#else
    if(v <= max_index){
        for(i=0; i<v; i++){
            put_cabac(c, state+i, 1);
        }
        if(truncated==0 || v<max)
            put_cabac(c, state+i, 0);
    }else{
        for(i=0; i<=max_index; i++){
            put_cabac(c, state+i, 1);
        }
        for(; i<v; i++){
            put_cabac(c, state+max_index, 1);
        }
        if(truncated==0 || v<max)
            put_cabac(c, state+max_index, 0);
    }
#endif
}


Generated by  Doxygen 1.6.0   Back to index