comparison dsputil.c @ 764:d4726182dfd2 libavcodec

optimize block_permute() optimize dct_quantize_c() dont permute s->q_inter/intra_matrix
author michaelni
date Wed, 23 Oct 2002 15:11:07 +0000
parents 8e1f0939d15d
children eacc2dd8fd9d
comparison
equal deleted inserted replaced
763:339db642859d 764:d4726182dfd2
1551 pix3 += line_size; 1551 pix3 += line_size;
1552 } 1552 }
1553 return s; 1553 return s;
1554 } 1554 }
1555 1555
1556 /* permute block according so that it corresponds to the MMX idct 1556 void ff_block_permute(INT16 *block, UINT8 *permutation, const UINT8 *scantable, int last)
1557 order */ 1557 {
1558 void block_permute(INT16 *block, UINT8 *permutation) 1558 int i;
1559 { 1559 INT16 temp[64];
1560 int i; 1560
1561 INT16 temp[64]; 1561 if(last<=0) return;
1562 1562 if(permutation[1]==1) return; //FIXME its ok but not clean and might fail for some perms
1563 for(i=0; i<64; i++) temp[ permutation[i] ] = block[i]; 1563
1564 1564 for(i=0; i<=last; i++){
1565 for(i=0; i<64; i++) block[i] = temp[i]; 1565 const int j= scantable[i];
1566 temp[j]= block[j];
1567 block[j]=0;
1568 }
1569
1570 for(i=0; i<=last; i++){
1571 const int j= scantable[i];
1572 const int perm_j= permutation[j];
1573 block[perm_j]= temp[j];
1574 }
1566 } 1575 }
1567 1576
1568 void clear_blocks_c(DCTELEM *blocks) 1577 void clear_blocks_c(DCTELEM *blocks)
1569 { 1578 {
1570 memset(blocks, 0, sizeof(DCTELEM)*6*64); 1579 memset(blocks, 0, sizeof(DCTELEM)*6*64);