diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-02-05 22:51:23 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-02-05 22:51:23 +0000 |
commit | 6fe84b4327a281d44efbb3d77528f0b77b641009 (patch) | |
tree | 95e5d03b39e0fcdc662d60f7e7d6e66fd55a4d77 /libavcodec | |
parent | b81cf27484ea07536af267b24fc0fe6755a432aa (diff) | |
download | ffmpeg-6fe84b4327a281d44efbb3d77528f0b77b641009.tar.gz |
use multiply instead of divides for DC prediction on X86
Originally committed as revision 286 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/msmpeg4.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index b43db88d99..85436e909c 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -50,6 +50,8 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr); static int msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr); +extern UINT32 inverse[256]; + #ifdef DEBUG int intra_count = 0; int frame_count = 0; @@ -438,26 +440,22 @@ static int msmpeg4_pred_dc(MpegEncContext * s, int n, fact they decided to store the quantized DC (which would lead to problems if Q could vary !) */ #if defined ARCH_X86 && !defined PIC - /* using 16bit divisions as they are large enough and 2x as fast */ asm volatile( "movl %3, %%eax \n\t" "shrl $1, %%eax \n\t" "addl %%eax, %2 \n\t" "addl %%eax, %1 \n\t" "addl %0, %%eax \n\t" - "xorl %%edx, %%edx \n\t" - "divw %w3 \n\t" - "movzwl %%ax, %0 \n\t" + "mull %4 \n\t" + "movl %%edx, %0 \n\t" "movl %1, %%eax \n\t" - "xorl %%edx, %%edx \n\t" - "divw %w3 \n\t" - "movzwl %%ax, %1 \n\t" + "mull %4 \n\t" + "movl %%edx, %1 \n\t" "movl %2, %%eax \n\t" - "xorl %%edx, %%edx \n\t" - "divw %w3 \n\t" - "movzwl %%ax, %2 \n\t" - : "+r" (a), "+r" (b), "+r" (c) - : "r" (scale) + "mull %4 \n\t" + "movl %%edx, %2 \n\t" + : "+r" (a), "+r" (b), "+r" (c) + : "g" (scale), "r" (inverse[scale]) : "%eax", "%edx" ); #else |