diff options
author | Alexander Strange <astrange@ithinksw.com> | 2008-04-16 01:34:55 +0000 |
---|---|---|
committer | Alexander Strange <astrange@ithinksw.com> | 2008-04-16 01:34:55 +0000 |
commit | 0e956ba2771452088ebfd69bbc75fce07c56f33c (patch) | |
tree | 2ecdf086901d249dfec4c4e977aca3fa4ca619bc | |
parent | b4999290fd962a484df9a51ff786a2454c6400b3 (diff) | |
download | ffmpeg-0e956ba2771452088ebfd69bbc75fce07c56f33c.tar.gz |
Add a new IDCT permutation, used in xvid_sse2 and possibly future similar IDCTs.
Originally committed as revision 12842 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/dsputil.c | 6 | ||||
-rw-r--r-- | libavcodec/dsputil.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index ee02062479..6c734e570e 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -151,6 +151,8 @@ static const uint8_t simple_mmx_permutation[64]={ 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 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) 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 --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 03b48c80de..cd9ae08211 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -408,6 +408,7 @@ typedef struct DSPContext { #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); |