Logo Search packages:      
Sourcecode: blender version File versions

void ff_block_permute ( DCTELEM *  block,
uint8_t *  permutation,
const uint8_t *  scantable,
int  last 
)

permutes an 8x8 block.

Parameters:
block the block which will be permuted according to the given permutation vector
permutation the permutation vector
last the last non zero coefficient in scantable order, used to speed the permutation up
scantable the used scantable, this is only used to speed the permutation up, the block is not (inverse) permutated to scantable order!

Definition at line 3144 of file dsputil.c.

{
    int i;
    DCTELEM temp[64];

    if(last<=0) return;
    //if(permutation[1]==1) return; //FIXME its ok but not clean and might fail for some perms

    for(i=0; i<=last; i++){
        const int j= scantable[i];
        temp[j]= block[j];
        block[j]=0;
    }

    for(i=0; i<=last; i++){
        const int j= scantable[i];
        const int perm_j= permutation[j];
        block[perm_j]= temp[j];
    }
}


Generated by  Doxygen 1.6.0   Back to index