# HG changeset patch # User astrange # Date 1208309695 0 # Node ID c3213c91124c45598d596b24eba7954b0f74f489 # Parent e5967b1cc47573eab508cd4202aa0e6aeb5fad4c Add a new IDCT permutation, used in xvid_sse2 and possibly future similar IDCTs. diff -r e5967b1cc475 -r c3213c91124c dsputil.c --- a/dsputil.c Tue Apr 15 13:51:41 2008 +0000 +++ b/dsputil.c Wed Apr 16 01:34:55 2008 +0000 @@ -151,6 +151,8 @@ 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, }; +static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7}; + void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable){ int i; int end; @@ -4476,6 +4478,10 @@ for(i=0; i<64; i++) c->idct_permutation[i]= (i&0x24) | ((i&3)<<3) | ((i>>3)&3); break; + case FF_SSE2_IDCT_PERM: + for(i=0; i<64; i++) + c->idct_permutation[i]= (i&0x38) | idct_sse2_row_perm[i&7]; + break; default: av_log(avctx, AV_LOG_ERROR, "Internal error, IDCT permutation not set\n"); } diff -r e5967b1cc475 -r c3213c91124c dsputil.h --- a/dsputil.h Tue Apr 15 13:51:41 2008 +0000 +++ b/dsputil.h Wed Apr 16 01:34:55 2008 +0000 @@ -408,6 +408,7 @@ #define FF_SIMPLE_IDCT_PERM 3 #define FF_TRANSPOSE_IDCT_PERM 4 #define FF_PARTTRANS_IDCT_PERM 5 +#define FF_SSE2_IDCT_PERM 6 int (*try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale); void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);