void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)
{
    int i;
    DCTELEM temp[64];
    if(last<=0) return;
    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];
    }
}
['void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)\n{\n    int i;\n    DCTELEM temp[64];\n    if(last<=0) return;\n    for(i=0; i<=last; i++){\n        const int j= scantable[i];\n        temp[j]= block[j];\n        block[j]=0;\n    }\n    for(i=0; i<=last; i++){\n        const int j= scantable[i];\n        const int perm_j= permutation[j];\n        block[perm_j]= temp[j];\n    }\n}']